diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 8262e3155405f578ea53be8a89872f556b09597b..d7dce8613dba6d0dc1ec76807c9eba31d31aec33 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -262,6 +262,8 @@ class Interfaces { if (is_readable($newdir.'/'.$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/',$file,$reg)) { + if (preg_match('/\.back$/',$file)) continue; + $part1=$reg[1]; $part2=$reg[2]; $part3=$reg[3]; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 32ad3283d44d99f137fc9e0d5300b53fc4cb115d..71f834a56d74bb46370ff05b215d803267835a56 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -617,7 +617,8 @@ class DolibarrModules // Can not be abstract, because we need to insta * Gives the long description of a module. First check README-la_LA.md then README.md * If not markdown files found, it return translated value of the key ->descriptionlong. * - * @return string Long description of a module + * @param int $checkonly + * @return string Long description of a module from README of from property. */ function getDescLong() { @@ -627,25 +628,9 @@ class DolibarrModules // Can not be abstract, because we need to insta include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - $filefound= false; - - // Define path to file README.md. - // First check README-la_LA.md then README.md - $pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0); - if (dol_is_file($pathoffile)) - { - $filefound = true; - } - if (! $filefound) - { - $pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0); - if (dol_is_file($pathoffile)) - { - $filefound = true; - } - } + $pathoffile = $this->getDescLongReadmeFound(); - if ($filefound) // Mostly for external modules + if ($pathoffile) // Mostly for external modules { $content = file_get_contents($pathoffile); @@ -683,6 +668,35 @@ class DolibarrModules // Can not be abstract, because we need to insta return $content; } + /** + * Return path of file if a README file was found. + * + * @return string Path of file if a README file was found. + */ + function getDescLongReadmeFound() + { + $filefound= false; + + // Define path to file README.md. + // First check README-la_LA.md then README.md + $pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0); + if (dol_is_file($pathoffile)) + { + $filefound = true; + } + if (! $filefound) + { + $pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0); + if (dol_is_file($pathoffile)) + { + $filefound = true; + } + } + + return ($filefound?$pathoffile:''); + } + + /** * Gives the changelog. First check ChangeLog-la_LA.md then ChangeLog.md * diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 8b1c0df7f404d2d01f122e33a409b6e2076a851d..58028423a35cb498011245423c1d642ae07193b3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -72,8 +72,10 @@ SeeHere=See here Apply=Apply BackgroundColorByDefault=Default background color FileRenamed=The file was successfully renamed -FileUploaded=The file was successfully uploaded FileGenerated=The file was successfully generated +FileSaved=The file was successfully saved +FileUploaded=The file was successfully uploaded +FileTransferComplete=File(s) was uploaded successfuly FileWasNotUploaded=A file is selected for attachment but was not yet uploaded. Click on "Attach file" for this. NbOfEntries=Nb of entries GoToWikiHelpPage=Read online help (Internet access needed) @@ -519,7 +521,6 @@ MonthShort10=Oct MonthShort11=Nov MonthShort12=Dec AttachedFiles=Attached files and documents -FileTransferComplete=File was uploaded successfuly DateFormatYYYYMM=YYYY-MM DateFormatYYYYMMDD=YYYY-MM-DD DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4037b727ee465d36e8f286612e50b3c6cbc50da4..2547b893055c4705992692c65e3c6c35ebdf28e5 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -20,6 +20,8 @@ * \brief Home page for module builder module */ +if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test + require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -30,6 +32,7 @@ $langs->load("other"); $action=GETPOST('action','aZ09'); $confirm=GETPOST('confirm','alpha'); +$cancel=GETPOST('cancel','alpha'); $module=GETPOST('module','alpha'); $tab=GETPOST('tab','aZ09'); @@ -375,26 +378,42 @@ if ($dirins && $action == 'generatepackage') } } -if ($action == 'savefile') + +// Save file +if ($action == 'savefile' && empty($cancel)) { - $pathoftrigger=dol_buildpath($file, 0); - $pathoftriggerbackup=dol_buildpath($file.'.back', 0); + $relofcustom = basename($dirins); + + if ($relofcustom) + { + // Check that relative path ($file) start with name 'custom' + if (! preg_match('/^'.$relofcustom.'/', $file)) $file=$relofcustom.'/'.$file; - dol_move($pathoftrigger, $pathoftriggerbackup, 0, 1, 0, 0); + $pathoffile=dol_buildpath($file, 0); + $pathoffilebackup=dol_buildpath($file.'.back', 0); - $content = GETPOST('triggerfilecontent'); + // Save old version + if (dol_is_file($pathoffile)) + { + dol_move($pathoffile, $pathoffilebackup, 0, 1, 0, 0); + } - // Save file on disk - $newmask = 0; + $content = GETPOST('editfilecontent'); - file_put_contents($pathoftrigger, $content); - if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; - if (empty($newmask)) // This should no happen - { - $newmask='0664'; - } + // Save file on disk + $newmask = 0; - @chmod($pathoftrigger, octdec($newmask)); + file_put_contents($pathoffile, $content); + if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; + if (empty($newmask)) // This should no happen + { + $newmask='0664'; + } + + @chmod($pathoffile, octdec($newmask)); + + setEventMessages($langs->trans("FileSaved"), null); + } } @@ -438,7 +457,7 @@ if (!empty($conf->modulebuilder->enabled) && $mainmenu == 'modulebuilder') // En if (dol_is_file($fullname.'/'.$FILEFLAG)) { // Get real name of module (MyModule instead of mymodule) - $descriptorfiles = dol_dir_list($fullname.'/core/modules/', 'files', 0, 'mod.*\.class\.php'); + $descriptorfiles = dol_dir_list($fullname.'/core/modules/', 'files', 0, 'mod.*\.class\.php$'); $modulenamewithcase=''; foreach($descriptorfiles as $descriptorcursor) { @@ -654,80 +673,155 @@ elseif (! empty($module)) if ($tab == 'description') { $pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php'; + $pathtofilereadme = $modulelowercase.'/README.md'; - print '<span class="fa fa-file"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong><br>'; - print '<br>'; + if ($action != 'editfile' || empty($file)) + { + print '<span class="fa fa-file"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>'; + print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; + print '<br>'; + + print '<span class="fa fa-file"></span> '.$langs->trans("ReadmeFile").' : <strong>'.$pathtofilereadme.'</strong>'; + print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtofilereadme).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; + print '<br>'; + + print '<br>'; + print '<br>'; + + print_fiche_titre($langs->trans("DescriptorFile")); + + print '<div class="underbanner clearboth"></div>'; + print '<div class="fichecenter">'; + + print '<table class="border centpercent">'; + print '<tr class="liste_titre"><td class="titlefield">'; + print $langs->trans("Parameter"); + print '</td><td>'; + print $langs->trans("Value"); + print '</td></tr>'; + + print '<tr><td>'; + print $langs->trans("Numero"); + print ' (<a href="https://wiki.dolibarr.org/index.php/List_of_modules_id" target="_blank">'.$langs->trans("SeeHere").'</a>)'; + print '</td><td>'; + print $moduleobj->numero; + print '</td></tr>'; + + print '<tr><td>'; + print $langs->trans("Name"); + print '</td><td>'; + print $moduleobj->getName(); + print '</td></tr>'; + + print '<tr><td>'; + print $langs->trans("Version"); + print '</td><td>'; + print $moduleobj->getVersion(); + print '</td></tr>'; + + print '<tr><td>'; + print $langs->trans("Family"); + //print "<br>'crm','financial','hr','projects','products','ecm','technic','interface','other'"; + print '</td><td>'; + print $moduleobj->family; + print '</td></tr>'; + + print '<tr><td>'; + print $langs->trans("EditorName"); + print '</td><td>'; + print $moduleobj->editor_name; + print '</td></tr>'; + + print '<tr><td>'; + print $langs->trans("EditorUrl"); + print '</td><td>'; + print $moduleobj->editor_url; + print '</td></tr>'; + + print '<tr><td>'; + print $langs->trans("Description"); + print '</td><td>'; + print $moduleobj->getDesc(); + print '</td></tr>'; + + print '</table>'; - print '<div class="underbanner clearboth"></div>'; - print '<div class="fichecenter">'; - - print '<table class="border centpercent">'; - print '<tr class="liste_titre"><td class="titlefield">'; - print $langs->trans("Parameter"); - print '</td><td>'; - print $langs->trans("Value"); - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("Numero"); - print ' (<a href="https://wiki.dolibarr.org/index.php/List_of_modules_id" target="_blank">'.$langs->trans("SeeHere").'</a>)'; - print '</td><td>'; - print $moduleobj->numero; - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("Name"); - print '</td><td>'; - print $moduleobj->getName(); - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("Version"); - print '</td><td>'; - print $moduleobj->getVersion(); - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("Family"); - //print "<br>'crm','financial','hr','projects','products','ecm','technic','interface','other'"; - print '</td><td>'; - print $moduleobj->family; - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("EditorName"); - print '</td><td>'; - print $moduleobj->editor_name; - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("EditorUrl"); - print '</td><td>'; - print $moduleobj->editor_url; - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("Description"); - print '</td><td>'; - print $moduleobj->getDesc(); - print '</td></tr>'; - - print '<tr><td>'; - print $langs->trans("DescriptionLong"); - print '</td><td>'; - print $moduleobj->getDescLong(); - print '</td></tr>'; - - print '</table>'; - - print '</div>'; + + print '<br><br>'; + + + print_fiche_titre($langs->trans("ReadmeFile")); + + print '<div class="underbanner clearboth"></div>'; + print '<div class="fichecenter">'; + + print $moduleobj->getDescLong(); + + print '</div>'; + } + else + { + $fullpathoffile=dol_buildpath($file, 0); + + $content = file_get_contents($fullpathoffile); + + // New module + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="savefile">'; + print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">'; + print '<input type="hidden" name="tab" value="'.$tab.'">'; + print '<input type="hidden" name="module" value="'.$module.'">'; + + $doleditor=new DolEditor('editfilecontent', $content, '', '600', 'Full', 'In', true, false, false, 0, '99%'); + print $doleditor->Create(1, '', false); + print '<br>'; + print '<center>'; + print '<input type="submit" class="button" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; + print ' '; + print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; + print '</center>'; + + print '</form>'; + } } if ($tab == 'specifications') { - print $langs->trans("FeatureNotYetAvailable"); + $pathtofile = $modulelowercase.'/SPECIFICATIONS.md'; + + if ($action != 'editfile' || empty($file)) + { + print '<span class="fa fa-file"></span> '.$langs->trans("SpecificationFile").' : <strong>'.$pathtofile.'</strong>'; + print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; + print '<br>'; + } + else + { + $fullpathoffile=dol_buildpath($file, 0); + $content = file_get_contents($fullpathoffile); + + // New module + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="savefile">'; + print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">'; + print '<input type="hidden" name="tab" value="'.$tab.'">'; + print '<input type="hidden" name="module" value="'.$module.'">'; + + $doleditor=new DolEditor('editfilecontent', $content, '', '600', 'Full', 'In', true, false, false, 0, '99%'); + print $doleditor->Create(1, '', false); + print '<br>'; + print '<center>'; + print '<input type="submit" class="button" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; + print ' '; + print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; + print '</center>'; + + print '</form>'; + } } if ($tab == 'objects') @@ -910,43 +1004,20 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - print '<div class="div-table-responsive-no-min">'; - print '<table class="noborder"> - <tr class="liste_titre"> - <td colspan="2">'.$langs->trans("File").'</td> - <td align="center">'.$langs->trans("Active").'</td> - <td align="center"> </td> - <td align="center"> </td> - </tr> - '; - - $var=True; foreach ($triggers as $trigger) { - print '<tr class="oddeven">'; - print '<td width="14" align="center">'.$trigger['picto'].'</td>'; - print '<td>'.$trigger['relpath'].'</td>'; - print '<td align="center">'.(empty($trigger['status'])?$langs->trans("No"):$trigger['status']).'</td>'; - print '<td class="tdtop">'; - $text=$trigger['info']; - $text.="<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath']; - //$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']); - print $form->textwithpicto('', $text); - print '</td>'; - print '<td>'; - print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($trigger['relpath']).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; - print '</td>'; - print '</tr>'; - } + $pathtofile = $trigger['relpath']; - print '</table>'; - print '</div>'; + print '<span class="fa fa-file"></span> '.$langs->trans("TriggerFile").' : <strong>'.$pathtofile.'</strong>'; + print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; + print '<br>'; + } } else { - $pathoftrigger=dol_buildpath($file, 0); + $fullpathoffile=dol_buildpath($file, 0); - $content = file_get_contents($pathoftrigger); + $content = file_get_contents($fullpathoffile); // New module print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; @@ -956,10 +1027,13 @@ elseif (! empty($module)) print '<input type="hidden" name="tab" value="'.$tab.'">'; print '<input type="hidden" name="module" value="'.$module.'">'; - $doleditor=new DolEditor('triggerfilecontent', $content, '', '600', 'Full', 'In', true, false, false, 0, '90%'); + $doleditor=new DolEditor('editfilecontent', $content, '', '600', 'Full', 'In', true, false, false, 0, '99%'); print $doleditor->Create(1, '', false); + print '<br>'; print '<center>'; print '<input type="submit" class="button" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; + print ' '; + print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; print '</center>'; print '</form>'; diff --git a/htdocs/modulebuilder/template/SPECIFICATIONS.md b/htdocs/modulebuilder/template/SPECIFICATIONS.md new file mode 100644 index 0000000000000000000000000000000000000000..7b1711cf514b941b72d3a61db7754f232b785f15 --- /dev/null +++ b/htdocs/modulebuilder/template/SPECIFICATIONS.md @@ -0,0 +1 @@ +# SPECIFICATIONS OF MODULE MYMODULE FOR DOLIBARR ERP CRM \ No newline at end of file diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 6d0c76248f468b94711eb1176b87de8fe0778c5d..73f00abc89f5121527257c366dc73683aa7151f8 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -23,17 +23,19 @@ * Put here some comments */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) // Load Dolibarr environment $res=0; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 2e655578235e72e9e49ea98517fd2e6e6815a55b..28624dc9fc2cec391b709c1cd695354e32b760b5 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -23,17 +23,20 @@ * Put here some comments */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) + // Load Dolibarr environment $res=0;