@@ -91,10 +91,10 @@ |
||
91 | 91 | */ |
92 | 92 | |
93 | 93 | $parameters = array(); |
94 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
94 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
95 | 95 | // Delete Link |
96 | 96 | $permissiondellink = $user->hasRight('expedition', 'delivery', 'supprimer'); // Used by the include of actions_dellink.inc.php |
97 | -include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
97 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
98 | 98 | |
99 | 99 | if ($action == 'add') { |
100 | 100 | $db->begin(); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | // Parameters |
69 | 69 | $action = GETPOST('action', 'aZ09'); |
70 | 70 | $backtopage = GETPOST('backtopage', 'alpha'); |
71 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
71 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
72 | 72 | |
73 | 73 | $value = GETPOST('value', 'alpha'); |
74 | 74 | $label = GETPOST('label', 'alpha'); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $object = new MyObject($db); |
121 | 121 | $extrafields = new ExtraFields($db); |
122 | 122 | $diroutputmassaction = $conf->mymodule->dir_output . '/temp/massgeneration/' . $user->id; |
123 | -$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
123 | +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
124 | 124 | |
125 | 125 | // Fetch optionals attributes and labels |
126 | 126 | $extrafields->fetch_name_optionals_label($object->table_element); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | // Default sort order (if not yet defined by previous GETPOST) |
132 | 132 | if (!$sortfield) { |
133 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
133 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
134 | 134 | $sortfield = "t." . key($object->fields); // Set here default search field. By default 1st field in definition. |
135 | 135 | } |
136 | 136 | if (!$sortorder) { |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | // Output page |
451 | 451 | // -------------------------------------------------------------------- |
452 | 452 | |
453 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-mymodule page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
453 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-mymodule page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
454 | 454 | |
455 | 455 | // Example : Adding jquery code |
456 | 456 | // print '<script type="text/javascript"> |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
675 | 675 | $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
676 | 676 | } |
677 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
677 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
678 | 678 | if (!empty($arrayfields['t.' . $key]['checked'])) { |
679 | 679 | print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist'])) . "\n"; |
680 | 680 | $totalarray['nbfield']++; |
@@ -89,13 +89,13 @@ |
||
89 | 89 | // Get parameters |
90 | 90 | $id = GETPOST('id', 'int'); |
91 | 91 | $ref = GETPOST('ref', 'alpha'); |
92 | -$lineid = GETPOST('lineid', 'int'); |
|
92 | +$lineid = GETPOST('lineid', 'int'); |
|
93 | 93 | |
94 | 94 | $action = GETPOST('action', 'aZ09'); |
95 | 95 | $confirm = GETPOST('confirm', 'alpha'); |
96 | 96 | $cancel = GETPOST('cancel', 'aZ09'); |
97 | 97 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)) . basename(__FILE__, '.php')); // To manage different context of search |
98 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
98 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
99 | 99 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
100 | 100 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
101 | 101 | $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | |
386 | 386 | clearstatcache(true); |
387 | 387 | if (function_exists('opcache_invalidate')) { |
388 | - opcache_reset(); // remove the include cache hell ! |
|
388 | + opcache_reset(); // remove the include cache hell ! |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | header("Location: " . $_SERVER['PHP_SELF'] . '?module=' . $modulename); |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | } |
881 | 881 | $stringLog = implode("\n", $strreplace); |
882 | 882 | // @phan-suppress-next-line PhanPluginSuspiciousParamPosition |
883 | - dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog)); |
|
883 | + dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '', '__CHANGELOG__' => $stringLog)); |
|
884 | 884 | } |
885 | 885 | |
886 | 886 | // Delete old documentation files |
@@ -1534,7 +1534,7 @@ discard block |
||
1534 | 1534 | } |
1535 | 1535 | } |
1536 | 1536 | $menus = $moduleobj->menu; |
1537 | - $counter = 0 ; |
|
1537 | + $counter = 0; |
|
1538 | 1538 | foreach ($menus as $menu) { |
1539 | 1539 | if ($menu['leftmenu'] == strtolower($objectname)) { |
1540 | 1540 | $counter++; |
@@ -1676,7 +1676,7 @@ discard block |
||
1676 | 1676 | } else { |
1677 | 1677 | createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries); |
1678 | 1678 | if (function_exists('opcache_invalidate')) { |
1679 | - opcache_reset(); // remove the include cache hell ! |
|
1679 | + opcache_reset(); // remove the include cache hell ! |
|
1680 | 1680 | } |
1681 | 1681 | clearstatcache(true); |
1682 | 1682 | header("Location: " . DOL_URL_ROOT . '/modulebuilder/index.php?tab=dictionaries&module=' . $module . ($forceddirread ? '@' . $dirread : '')); |
@@ -1771,7 +1771,7 @@ discard block |
||
1771 | 1771 | 'isameasure' => GETPOSTINT('propisameasure'), |
1772 | 1772 | 'comment' => GETPOST('propcomment', 'alpha'), |
1773 | 1773 | 'help' => GETPOST('prophelp', 'alpha'), |
1774 | - 'css' => GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example |
|
1774 | + 'css' => GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example |
|
1775 | 1775 | 'cssview' => GETPOST('propcssview', 'alpha'), |
1776 | 1776 | 'csslist' => GETPOST('propcsslist', 'alpha'), |
1777 | 1777 | 'default' => GETPOST('propdefault', 'restricthtml'), |
@@ -1926,7 +1926,7 @@ discard block |
||
1926 | 1926 | |
1927 | 1927 | clearstatcache(true); |
1928 | 1928 | if (function_exists('opcache_invalidate')) { |
1929 | - opcache_reset(); // remove the include cache hell ! |
|
1929 | + opcache_reset(); // remove the include cache hell ! |
|
1930 | 1930 | } |
1931 | 1931 | |
1932 | 1932 | header("Location: " . $_SERVER['PHP_SELF'] . '?module=deletemodule'); |
@@ -2018,7 +2018,7 @@ discard block |
||
2018 | 2018 | |
2019 | 2019 | clearstatcache(true); |
2020 | 2020 | if (function_exists('opcache_invalidate')) { |
2021 | - opcache_reset(); // remove the include cache hell ! |
|
2021 | + opcache_reset(); // remove the include cache hell ! |
|
2022 | 2022 | } |
2023 | 2023 | $resultko = 0; |
2024 | 2024 | foreach ($filetodelete as $tmpfiletodelete) { |
@@ -2038,7 +2038,7 @@ discard block |
||
2038 | 2038 | } |
2039 | 2039 | |
2040 | 2040 | $action = ''; |
2041 | - if (! $error) { |
|
2041 | + if (!$error) { |
|
2042 | 2042 | $tabobj = 'newobject'; |
2043 | 2043 | } else { |
2044 | 2044 | $tabobj = 'deleteobject'; |
@@ -2142,7 +2142,7 @@ discard block |
||
2142 | 2142 | setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null); |
2143 | 2143 | } |
2144 | 2144 | if (function_exists('opcache_invalidate')) { |
2145 | - opcache_reset(); // remove the include cache hell ! |
|
2145 | + opcache_reset(); // remove the include cache hell ! |
|
2146 | 2146 | } |
2147 | 2147 | clearstatcache(true); |
2148 | 2148 | header("Location: " . DOL_URL_ROOT . '/modulebuilder/index.php?tab=dictionaries&module=' . $module . ($forceddirread ? '@' . $dirread : '')); |
@@ -2150,7 +2150,7 @@ discard block |
||
2150 | 2150 | } |
2151 | 2151 | } |
2152 | 2152 | if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) { |
2153 | - $keydict = GETPOST('dictionnarykey') - 1 ; |
|
2153 | + $keydict = GETPOST('dictionnarykey') - 1; |
|
2154 | 2154 | |
2155 | 2155 | $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
2156 | 2156 | $destdir = $dirins . '/' . strtolower($module); |
@@ -2184,7 +2184,7 @@ discard block |
||
2184 | 2184 | setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null); |
2185 | 2185 | } |
2186 | 2186 | if (function_exists('opcache_invalidate')) { |
2187 | - opcache_reset(); // remove the include cache hell ! |
|
2187 | + opcache_reset(); // remove the include cache hell ! |
|
2188 | 2188 | } |
2189 | 2189 | clearstatcache(true); |
2190 | 2190 | header("Location: " . DOL_URL_ROOT . '/modulebuilder/index.php?tab=dictionaries&module=' . $module . ($forceddirread ? '@' . $dirread : '')); |
@@ -2359,7 +2359,7 @@ discard block |
||
2359 | 2359 | |
2360 | 2360 | clearstatcache(true); |
2361 | 2361 | if (function_exists('opcache_invalidate')) { |
2362 | - opcache_reset(); // remove the include cache hell ! |
|
2362 | + opcache_reset(); // remove the include cache hell ! |
|
2363 | 2363 | } |
2364 | 2364 | header("Location: " . DOL_URL_ROOT . '/modulebuilder/index.php?tab=permissions&module=' . $module); |
2365 | 2365 | exit; |
@@ -2465,7 +2465,7 @@ discard block |
||
2465 | 2465 | setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null); |
2466 | 2466 | clearstatcache(true); |
2467 | 2467 | if (function_exists('opcache_invalidate')) { |
2468 | - opcache_reset(); // remove the include cache hell ! |
|
2468 | + opcache_reset(); // remove the include cache hell ! |
|
2469 | 2469 | } |
2470 | 2470 | header("Location: " . DOL_URL_ROOT . '/modulebuilder/index.php?tab=permissions&module=' . $module); |
2471 | 2471 | exit; |
@@ -2515,7 +2515,7 @@ discard block |
||
2515 | 2515 | |
2516 | 2516 | clearstatcache(true); |
2517 | 2517 | if (function_exists('opcache_invalidate')) { |
2518 | - opcache_reset(); // remove the include cache hell ! |
|
2518 | + opcache_reset(); // remove the include cache hell ! |
|
2519 | 2519 | } |
2520 | 2520 | |
2521 | 2521 | header("Location: " . DOL_URL_ROOT . '/modulebuilder/index.php?tab=permissions&module=' . $module); |
@@ -2685,7 +2685,7 @@ discard block |
||
2685 | 2685 | |
2686 | 2686 | clearstatcache(true); |
2687 | 2687 | if (function_exists('opcache_invalidate')) { |
2688 | - opcache_reset(); // remove the include cache hell ! |
|
2688 | + opcache_reset(); // remove the include cache hell ! |
|
2689 | 2689 | } |
2690 | 2690 | |
2691 | 2691 | setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null); |
@@ -2742,7 +2742,7 @@ discard block |
||
2742 | 2742 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors'); |
2743 | 2743 | } |
2744 | 2744 | if (!empty(GETPOST('target'))) { |
2745 | - $targets = array('_blank','_self','_parent','_top',''); |
|
2745 | + $targets = array('_blank', '_self', '_parent', '_top', ''); |
|
2746 | 2746 | if (!in_array(GETPOST('target'), $targets)) { |
2747 | 2747 | $error++; |
2748 | 2748 | setEventMessages($langs->trans("ErrorFieldValue", $langs->transnoentities("target")), null, 'errors'); |
@@ -2848,7 +2848,7 @@ discard block |
||
2848 | 2848 | |
2849 | 2849 | // Modify a menu entry |
2850 | 2850 | if ($dirins && $action == "update_menu" && GETPOSTINT('menukey') && GETPOST('tabobj')) { |
2851 | - $objectname = GETPOST('tabobj'); |
|
2851 | + $objectname = GETPOST('tabobj'); |
|
2852 | 2852 | $dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; |
2853 | 2853 | $destdir = $dirins . '/' . strtolower($module); |
2854 | 2854 | $objects = dolGetListOfObjectClasses($destdir); |
@@ -4118,16 +4118,16 @@ discard block |
||
4118 | 4118 | // Define path for sql file |
4119 | 4119 | $pathtosql = strtolower($module) . '/sql/llx_' . strtolower($module) . '_' . strtolower($tabobj) . '-' . strtolower($module) . '.sql'; |
4120 | 4120 | $result = dol_buildpath($pathtosql); |
4121 | - if (! dol_is_file($result)) { |
|
4121 | + if (!dol_is_file($result)) { |
|
4122 | 4122 | $pathtosql = strtolower($module) . '/sql/llx_' . strtolower($module) . '_' . strtolower($tabobj) . '.sql'; |
4123 | 4123 | $result = dol_buildpath($pathtosql); |
4124 | - if (! dol_is_file($result)) { |
|
4124 | + if (!dol_is_file($result)) { |
|
4125 | 4125 | $pathtosql = 'install/mysql/tables/llx_' . strtolower($module) . '_' . strtolower($tabobj) . '-' . strtolower($module) . '.sql'; |
4126 | 4126 | $result = dol_buildpath($pathtosql); |
4127 | - if (! dol_is_file($result)) { |
|
4127 | + if (!dol_is_file($result)) { |
|
4128 | 4128 | $pathtosql = 'install/mysql/tables/llx_' . strtolower($module) . '-' . strtolower($module) . '.sql'; |
4129 | 4129 | $result = dol_buildpath($pathtosql); |
4130 | - if (! dol_is_file($result)) { |
|
4130 | + if (!dol_is_file($result)) { |
|
4131 | 4131 | $pathtosql = 'install/mysql/tables/llx_' . strtolower($module) . '.sql'; |
4132 | 4132 | $pathtosqlextra = 'install/mysql/tables/llx_' . strtolower($module) . '_extrafields.sql'; |
4133 | 4133 | $result = dol_buildpath($pathtosql); |
@@ -4146,7 +4146,7 @@ discard block |
||
4146 | 4146 | $pathtosqlroot = preg_replace('/\/llx_.*$/', '', $pathtosql); |
4147 | 4147 | |
4148 | 4148 | $pathtosqlkey = preg_replace('/\.sql$/', '.key.sql', $pathtosql); |
4149 | - $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4149 | + $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4150 | 4150 | |
4151 | 4151 | $pathtolib = strtolower($module) . '/lib/' . strtolower($module) . '.lib.php'; |
4152 | 4152 | $pathtoobjlib = strtolower($module) . '/lib/' . strtolower($module) . '_' . strtolower($tabobj) . '.lib.php'; |
@@ -5655,7 +5655,7 @@ discard block |
||
5655 | 5655 | if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) { |
5656 | 5656 | print dol_escape_htmltag(ucfirst($perm[4])); |
5657 | 5657 | } else { |
5658 | - print ''; // No particular object |
|
5658 | + print ''; // No particular object |
|
5659 | 5659 | } |
5660 | 5660 | print '</td>'; |
5661 | 5661 |
@@ -875,7 +875,7 @@ |
||
875 | 875 | $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning'; |
876 | 876 | $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon'; |
877 | 877 | |
878 | - $nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates |
|
878 | + $nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates |
|
879 | 879 | $totalduration += $nbopenedday; |
880 | 880 | |
881 | 881 | if ($mode == 'kanban') { |
@@ -160,7 +160,7 @@ |
||
160 | 160 | $sql .= " AND cp.statut = " . Holiday::STATUS_APPROVED; |
161 | 161 | $sql .= " AND ("; |
162 | 162 | $sql .= " (date_format(cp.date_debut, '%Y-%m') = '" . $db->escape($year_month) . "' OR date_format(cp.date_fin, '%Y-%m') = '" . $db->escape($year_month) . "')"; |
163 | -$sql .= " OR"; // For leave over several months |
|
163 | +$sql .= " OR"; // For leave over several months |
|
164 | 164 | $sql .= " (date_format(cp.date_debut, '%Y-%m') < '" . $db->escape($year_month) . "' AND date_format(cp.date_fin, '%Y-%m') > '" . $db->escape($year_month) . "') "; |
165 | 165 | $sql .= " )"; |
166 | 166 | if (!empty($search_ref)) { |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | |
506 | 506 | // option to warn the validator in case of too short delay |
507 | 507 | if (!getDolGlobalString('HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY')) { |
508 | - $delayForRequest = 0; // TODO Set delay depending of holiday leave type |
|
508 | + $delayForRequest = 0; // TODO Set delay depending of holiday leave type |
|
509 | 509 | if ($delayForRequest) { |
510 | 510 | $nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd'); |
511 | 511 | |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | $result = $object->fetch($id, $ref); |
1214 | 1214 | |
1215 | 1215 | $approverexpected = new User($db); |
1216 | - $approverexpected->fetch($object->fk_validator); // Use that should be the approver |
|
1216 | + $approverexpected->fetch($object->fk_validator); // Use that should be the approver |
|
1217 | 1217 | |
1218 | 1218 | $userRequest = new User($db); |
1219 | 1219 | $userRequest->fetch($object->fk_user); |
@@ -1448,7 +1448,7 @@ discard block |
||
1448 | 1448 | print '</tr>'; |
1449 | 1449 | } else { |
1450 | 1450 | print '<tr>'; |
1451 | - print '<td class="titlefield">' . $langs->trans('ReviewedByCP') . '</td>'; // Will be approved by |
|
1451 | + print '<td class="titlefield">' . $langs->trans('ReviewedByCP') . '</td>'; // Will be approved by |
|
1452 | 1452 | print '<td>'; |
1453 | 1453 | $include_users = $object->fetch_users_approver_holiday(); |
1454 | 1454 | if (!in_array($object->fk_validator, $include_users)) { // Add the current validator to the list to not lose it when editing. |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | if (!$error) { |
168 | - $users = GETPOST('users', 'array'); |
|
169 | - $groups = GETPOST('groups', 'array'); |
|
168 | + $users = GETPOST('users', 'array'); |
|
169 | + $groups = GETPOST('groups', 'array'); |
|
170 | 170 | |
171 | 171 | $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); |
172 | 172 | $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | |
733 | 733 | // option to warn the validator in case of too short delay |
734 | 734 | if (!getDolGlobalString('HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY')) { |
735 | - $delayForRequest = 0; // TODO Set delay depending of holiday leave type |
|
735 | + $delayForRequest = 0; // TODO Set delay depending of holiday leave type |
|
736 | 736 | if ($delayForRequest) { |
737 | 737 | $nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd'); |
738 | 738 |