2
0
forked from Wavyzz/dolibarr

Debug v19

This commit is contained in:
Laurent Destailleur
2023-10-29 17:36:00 +01:00
parent 582a6f7f45
commit 0158c3ff68
2 changed files with 36 additions and 26 deletions

View File

@@ -107,7 +107,7 @@ PermissionsDefDesc=Define here the new permissions provided by your module
MenusDefDescTooltip=The menus provided by your module/application are defined into the array <strong>$this->menus</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and the module re-activated), the menus are also visible into the menu editor available to administrator users on %s. MenusDefDescTooltip=The menus provided by your module/application are defined into the array <strong>$this->menus</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and the module re-activated), the menus are also visible into the menu editor available to administrator users on %s.
DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array <strong>$this->dictionaries</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s. DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array <strong>$this->dictionaries</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s.
PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array <strong>$this->rights</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s. PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array <strong>$this->rights</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s.
HooksDefDesc=Define in the <b>module_parts['hooks']</b> property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '<b>executeHooks</b>' in core code). HooksDefDesc=Define in the property <b>module_parts['hooks']</b>, in the module descriptor file, the list of contexts when your hook must be executed (the list of possible contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Then edit the file with hooks code with the code of your hooked functions (the list of hookable functions can be found by a search on '<b>executeHooks</b>' in core code).
TriggerDefDesc=Define in the trigger file the code that you want to execute when a business event external to your module is executed (events triggered by other modules). TriggerDefDesc=Define in the trigger file the code that you want to execute when a business event external to your module is executed (events triggered by other modules).
SeeIDsInUse=See IDs in use in your installation SeeIDsInUse=See IDs in use in your installation
SeeReservedIDsRangeHere=See range of reserved IDs SeeReservedIDsRangeHere=See range of reserved IDs

View File

@@ -5033,22 +5033,29 @@ if ($module == 'initmodule') {
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="noborder small">'; print '<table class="noborder small">';
$htmltextenabled = '<u>'.$langs->trans("Examples").':</u><br>';
$htmltextenabled .= '1 <span class="opacitymedium">(module always enabled)</span><br>';
$htmltextenabled .= '0 <span class="opacitymedium">(module always disabled)</span><br>';
$htmltextenabled .= 'isModEnabled(\''.dol_escape_htmltag(strtolower($module)).'\') <span class="opacitymedium">(enabled when module is enabled)</span>';
$htmltextperms = '<u>'.$langs->trans("Examples").':</u><br>';
$htmltextperms .= '1 <span class="opacitymedium">(access always allowed)</span><br>';
$htmltextperms .= '$user->hasright(\''.dol_escape_htmltag(strtolower($module)).'\', \'myobject\', \'read\') <span class="opacitymedium">(access allowed if user has permission module->object->read)</span>';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center tdsticky tdstickygray '); print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center tdsticky tdstickygray ');
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center'); print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center');
print_liste_field_titre("LinkToParentMenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("LinkToParentMenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'minwidth100 ');
print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->transnoentitiesnoconv('DetailUrl')); print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->transnoentitiesnoconv('DetailUrl'));
print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('DetailEnabled')); print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('DetailEnabled').'<br><br>'.$htmltextenabled);
print_liste_field_titre("Rights", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->trans('DetailRight')); print_liste_field_titre("Rights", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->trans('DetailRight').'<br><br>'.$htmltextperms);
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->trans('DetailTarget')); print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->trans('DetailTarget'));
print_liste_field_titre("MenuForUsers", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('DetailUser')); print_liste_field_titre("MenuForUsers", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center minwidth100 ', $langs->trans('DetailUser'));
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('')); print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans(''));
print "</tr>\n"; print "</tr>\n";
$r = count($menus)+1; $r = count($menus)+1;
@@ -5072,18 +5079,14 @@ if ($module == 'initmodule') {
print '</td>'; print '</td>';
print '<td class="left"><input type="text" class="left maxwidth50" name="mainmenu" value="'.(empty(GETPOST('mainmenu')) ? strtolower($module) : dol_escape_htmltag(GETPOST('mainmenu', 'alpha'))).'"></td>'; print '<td class="left"><input type="text" class="left maxwidth50" name="mainmenu" value="'.(empty(GETPOST('mainmenu')) ? strtolower($module) : dol_escape_htmltag(GETPOST('mainmenu', 'alpha'))).'"></td>';
print '<td class="center"><input id="leftmenu" type="text" class="left maxwidth50" name="leftmenu" value="'.dol_escape_htmltag(GETPOST('leftmenu', 'alpha')).'"></td>'; print '<td class="center"><input id="leftmenu" type="text" class="left maxwidth50" name="leftmenu" value="'.dol_escape_htmltag(GETPOST('leftmenu', 'alpha')).'"></td>';
print '<td class="left"><input id="url" type="text" class="left maxwidth50" name="url" value="'.dol_escape_htmltag(GETPOST('url', 'alpha')).'"></td>'; // URL
print '<td class="left"><input id="url" type="text" class="left maxwidth100" name="url" value="'.dol_escape_htmltag(GETPOST('url', 'alpha')).'"></td>';
print '<td class="left"><input type="text" class="left maxwidth75" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>'; print '<td class="left"><input type="text" class="left maxwidth75" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>';
// Position // Position
print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000+$r).'" readonly></td>'; print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000+$r).'" readonly></td>';
// Enabled // Enabled
print '<td class="center">'; print '<td class="center">';
print '<input type="enabled" class="maxwidth125" value="'.dol_escape_htmltag(GETPOSTISSET('enabled') ? GETPOST('enabled') : 'isModEnabled(\''.$module.'\')').'">'; print '<input type="enabled" class="maxwidth125" value="'.dol_escape_htmltag(GETPOSTISSET('enabled') ? GETPOST('enabled') : 'isModEnabled(\''.$module.'\')').'">';
$htmltext = '<u>'.$langs->trans("Examples").':</u><br>';
$htmltext .= '1 <span class="opacitymedium">(always enabled)</span><br>';
$htmltext .= '0 <span class="opacitymedium">(always disabled)</span><br>';
$htmltext .= 'isModEnabled(\''.dol_escape_htmltag($module).'\') <span class="opacitymedium">(enabled when module is enabled)</span><br>';
print $form->textwithpicto('', $htmltext);
/* /*
print '<select class="maxwidth" name="enabled">'; print '<select class="maxwidth" name="enabled">';
print '<option value="1" selected>'.$langs->trans("Show").'</option>'; print '<option value="1" selected>'.$langs->trans("Show").'</option>';
@@ -5147,11 +5150,12 @@ if ($module == 'initmodule') {
print '<input type="hidden" name="action" value="update_menu">'; print '<input type="hidden" name="action" value="update_menu">';
print '<input type="hidden" name="tab" value="menus">'; print '<input type="hidden" name="tab" value="menus">';
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">'; print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
print '<input type="hidden" name="menukey" value="'.$i.'"/>';
//print '<input type="hidden" name="tabobject" value="'.dol_escape_htmltag($tabobject).'">'; //print '<input type="hidden" name="tabobject" value="'.dol_escape_htmltag($tabobject).'">';
print '<td class="tdsticky tdstickygray">'; print '<td class="tdsticky tdstickygray">';
print $i; print $i;
print '</td>'; print '</td>';
print '<input type="hidden" name="menukey" value="'.$i.'"/>'; // Position (top, left)
print '<td class="center"> print '<td class="center">
<select class="center maxwidth50" name="type"> <select class="center maxwidth50" name="type">
<option value="'.dol_escape_htmltag($menu['type']).'"> <option value="'.dol_escape_htmltag($menu['type']).'">
@@ -5164,21 +5168,25 @@ if ($module == 'initmodule') {
print 'left'; print 'left';
} }
print '</option></select></td>'; print '</option></select></td>';
print '<td class="left"><input type="text" class="left maxwidth" name="titre" value="'.dol_escape_htmltag($propTitre).'"></td>'; // Title
print '<td class="left">'; print '<td><input type="text" class="left maxwidth100" name="titre" value="'.dol_escape_htmltag($propTitre).'"></td>';
print '<select name="fk_menu" class="left maxwidth">'; // Parent menu
print '<td>';
/*print '<select name="fk_menu" class="left maxwidth">';
print '<option value="'.dol_escape_htmltag($propFk_menu).'">'.dol_escape_htmltag($value).'</option>'; print '<option value="'.dol_escape_htmltag($propFk_menu).'">'.dol_escape_htmltag($value).'</option>';
foreach ($menus as $obj) { foreach ($menus as $obj) {
if ($obj['type'] == 'left' && $obj['leftmenu'] != $value && $obj['leftmenu'] != $menu['leftmenu']) { if ($obj['type'] == 'left' && $obj['leftmenu'] != $value && $obj['leftmenu'] != $menu['leftmenu']) {
print "<option value=".strtolower($obj['leftmenu']).">".$obj['leftmenu']."</option>"; print "<option value=".strtolower($obj['leftmenu']).">".$obj['leftmenu']."</option>";
} }
} }
print '</select>'; print '</select>';*/
print '<input type="text" name="fk_menu" class="maxwidth150" value="'.dol_escape_htmltag($propFk_menu).'">';
print '</td>'; print '</td>';
print '<td class="left"><input type="text" class="left maxwidth50" name="mainmenu" value="'.dol_escape_htmltag($propMainmenu).'" readonly></td>'; print '<td><input type="text" class="left maxwidth50" name="mainmenu" value="'.dol_escape_htmltag($propMainmenu).'" readonly></td>';
print '<td class="left"><input type="text" class="left maxwidth50" name="leftmenu" value="'.dol_escape_htmltag($propLeftmenu).'" readonly></td>'; print '<td><input type="text" class="left maxwidth50" name="leftmenu" value="'.dol_escape_htmltag($propLeftmenu).'" readonly></td>';
print '<td class="left"><input type="text" class="left maxwidth50" name="url" value="'.dol_escape_htmltag($propUrl).'"></td>'; // URL
print '<td class="left"><input type="text" class="left maxwidth50" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>'; print '<td><input type="text" class="left maxwidth250" name="url" value="'.dol_escape_htmltag($propUrl).'"></td>';
print '<td><input type="text" class="left maxwidth50" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>';
// Position // Position
print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.($menu['position']).'" readonly></td>'; print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.($menu['position']).'" readonly></td>';
// Enabled // Enabled
@@ -5198,7 +5206,7 @@ if ($module == 'initmodule') {
*/ */
print '</td>'; print '</td>';
// Permissions // Permissions
print '<td class="center nowraponall">'; print '<td class="nowraponall">';
print '<input type="text" name="perms" value="'.dol_escape_htmltag($propPerms).'">'; print '<input type="text" name="perms" value="'.dol_escape_htmltag($propPerms).'">';
/* /*
if (!empty($objPerms)) { if (!empty($objPerms)) {
@@ -5243,16 +5251,18 @@ if ($module == 'initmodule') {
print $i; print $i;
print '</td>'; print '</td>';
print '<td>'; print '<td class="center">';
print dol_escape_htmltag($menu['type']); print dol_escape_htmltag($menu['type']);
print '</td>'; print '</td>';
// Title
print '<td>'; print '<td>';
print dol_escape_htmltag($menu['titre']); print dol_escape_htmltag($menu['titre']);
print '</td>'; print '</td>';
print '<td>'; // Parent menu
print ($value == strtolower($module) ? '/' : $value); print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($menu['fk_menu']).'">';
print dol_escape_htmltag($menu['fk_menu']);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
@@ -5263,7 +5273,7 @@ if ($module == 'initmodule') {
print dol_escape_htmltag($menu['leftmenu']); print dol_escape_htmltag($menu['leftmenu']);
print '</td>'; print '</td>';
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($menu['url']).'">'; print '<td class="tdoverflowmax250" title="'.dol_escape_htmltag($menu['url']).'">';
print dol_escape_htmltag($menu['url']); print dol_escape_htmltag($menu['url']);
print '</td>'; print '</td>';