@@ -95,7 +95,7 @@ |
||
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
98 | -$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php |
|
98 | +$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php |
|
99 | 99 | |
100 | 100 | |
101 | 101 | /* |
@@ -24,15 +24,14 @@ discard block |
||
24 | 24 | $dolibarr_main_cookie_cryptkey; // This is loaded by filefunc.inc.php |
25 | 25 | |
26 | 26 | $tmp_instance_unique_id = empty($dolibarr_main_instance_unique_id) ? |
27 | - (empty($dolibarr_main_cookie_cryptkey) ? '' : |
|
28 | - $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; |
|
27 | + (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; |
|
29 | 28 | // Unique id of instance |
30 | 29 | |
31 | 30 | // The recommended value (may be not defined for old versions) |
32 | 31 | if (!empty($tmp_instance_unique_id)) { |
33 | - return sha1('webportal' . $tmp_instance_unique_id); |
|
32 | + return sha1('webportal'.$tmp_instance_unique_id); |
|
34 | 33 | } else { |
35 | - return sha1('webportal' . $_SERVER['SERVER_NAME'].$_SERVER['DOCUMENT_ROOT'].DOL_DOCUMENT_ROOT); |
|
34 | + return sha1('webportal'.$_SERVER['SERVER_NAME'].$_SERVER['DOCUMENT_ROOT'].DOL_DOCUMENT_ROOT); |
|
36 | 35 | } |
37 | 36 | } |
38 | 37 | } |
@@ -40,14 +39,14 @@ discard block |
||
40 | 39 | |
41 | 40 | // Change this following line to use the correct relative path (../, ../../, etc) |
42 | 41 | $res = 0; |
43 | -if (!$res && file_exists('../../main.inc.php')) $res = @include '../../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory |
|
44 | -if (!$res && file_exists('../../../main.inc.php')) $res = @include '../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
45 | -if (!$res && file_exists('../../../../main.inc.php')) $res = @include '../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
46 | -if (!$res && file_exists('../../../../../main.inc.php')) $res = @include '../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
47 | -if (!$res && file_exists('../../../../../../main.inc.php')) $res = @include '../../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
42 | +if (!$res && file_exists('../../main.inc.php')) $res = @include '../../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory |
|
43 | +if (!$res && file_exists('../../../main.inc.php')) $res = @include '../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
44 | +if (!$res && file_exists('../../../../main.inc.php')) $res = @include '../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
45 | +if (!$res && file_exists('../../../../../main.inc.php')) $res = @include '../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
46 | +if (!$res && file_exists('../../../../../../main.inc.php')) $res = @include '../../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory |
|
48 | 47 | if (!$res) die('Include of main fails'); |
49 | -require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
50 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societeaccount.class.php'; |
|
48 | +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
49 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; |
|
51 | 50 | dol_include_once('/public/webportal/lib/webportal.lib.php'); |
52 | 51 | dol_include_once('/webportal/class/context.class.php'); |
53 | 52 | dol_include_once('/webportal/class/webportalmember.class.php'); |
@@ -57,9 +56,9 @@ discard block |
||
57 | 56 | // Must be done after the include of filefunc.inc.php so global variables of conf file are defined (like $dolibarr_main_instance_unique_id or $dolibarr_main_force_https). |
58 | 57 | // Note: the function dol_getprefix is defined into functions.lib.php but may have been defined to return a different key to manage another area to protect. |
59 | 58 | $prefix = dol_getprefix(''); |
60 | -$sessionname = 'WEBPORTAL_SESSID_' . $prefix; |
|
61 | -$sessiontimeout = 'WEBPORTAL_SESSTIMEOUT_' . $prefix; |
|
62 | -if (!empty($_COOKIE[$sessiontimeout]) && session_status()===PHP_SESSION_NONE) { |
|
59 | +$sessionname = 'WEBPORTAL_SESSID_'.$prefix; |
|
60 | +$sessiontimeout = 'WEBPORTAL_SESSTIMEOUT_'.$prefix; |
|
61 | +if (!empty($_COOKIE[$sessiontimeout]) && session_status() === PHP_SESSION_NONE) { |
|
63 | 62 | ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]); |
64 | 63 | } |
65 | 64 | |
@@ -77,7 +76,7 @@ discard block |
||
77 | 76 | |
78 | 77 | if (!defined('WEBPORTAL_NOREQUIRETRAN') || (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->accessNeedLoggedUser))) { |
79 | 78 | if (!is_object($langs)) { // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages. |
80 | - include_once DOL_DOCUMENT_ROOT . '/core/class/translate.class.php'; |
|
79 | + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; |
|
81 | 80 | $langs = new Translate("", $conf); |
82 | 81 | $langcode = (GETPOST('lang', 'aZ09', 1) ? GETPOST('lang', 'aZ09', 1) : (empty($logged_user->conf->MAIN_LANG_DEFAULT) ? (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT) : $logged_user->conf->MAIN_LANG_DEFAULT)); |
83 | 82 | if (defined('MAIN_LANG_DEFAULT')) { |
@@ -223,7 +222,7 @@ discard block |
||
223 | 222 | if (!$error) { |
224 | 223 | if ($logged_thirdparty->default_lang != $langs->defaultlang && !defined('WEBPORTAL_NOREQUIRETRAN')) { |
225 | 224 | if (!is_object($langs)) { // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages. |
226 | - include_once DOL_DOCUMENT_ROOT . '/core/class/translate.class.php'; |
|
225 | + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; |
|
227 | 226 | $langs = new Translate("", $conf); |
228 | 227 | $langs->setDefaultLang($logged_thirdparty->default_lang); |
229 | 228 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $navUserMenu['user_logout'] = array( |
82 | 82 | 'id' => 'user_logout', |
83 | 83 | 'rank' => 99999, |
84 | - 'url' => $context->getControllerUrl() . 'logout.php', |
|
84 | + 'url' => $context->getControllerUrl().'logout.php', |
|
85 | 85 | 'name' => $langs->trans('Logout'), |
86 | 86 | ); |
87 | 87 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'maxTopMenu' => & $maxTopMenu |
112 | 112 | ); |
113 | 113 | |
114 | -$reshook = $hookmanager->executeHooks('PrintTopMenu', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
114 | +$reshook = $hookmanager->executeHooks('PrintTopMenu', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
115 | 115 | if ($reshook < 0) $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
116 | 116 | |
117 | 117 | if (empty($reshook)) { |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | $brandTitle = getDolGlobalString('WEBPORTAL_TITLE') ? getDolGlobalString('WEBPORTAL_TITLE') : getDolGlobalString('MAIN_INFO_SOCIETE_NOM'); |
171 | 171 | print '<a class="brand__logo-link" href="'.$context->getControllerUrl().'" >'; |
172 | 172 | if (!empty($context->theme->menuLogoUrl)) { |
173 | - print '<img class="brand__logo-img" src="' . dol_escape_htmltag($context->theme->menuLogoUrl) . '" alt="' . dol_escape_htmltag($brandTitle) . '" >'; |
|
173 | + print '<img class="brand__logo-img" src="'.dol_escape_htmltag($context->theme->menuLogoUrl).'" alt="'.dol_escape_htmltag($brandTitle).'" >'; |
|
174 | 174 | } else { |
175 | - print '<span class="brand__name">' . $brandTitle . '</span>'; |
|
175 | + print '<span class="brand__name">'.$brandTitle.'</span>'; |
|
176 | 176 | } |
177 | 177 | print '</a>'; |
178 | 178 | ?> |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | $sql = "SELECT t.rowid, t.ref, t.ref_ext"; |
192 | 192 | $sql .= " FROM ".$this->db->prefix()."product as t"; |
193 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
193 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
194 | 194 | if ($category > 0) { |
195 | 195 | $sql .= ", ".$this->db->prefix()."categorie_product as c"; |
196 | 196 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | //this query will return total products with the filters given |
233 | - $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
233 | + $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
234 | 234 | |
235 | 235 | $sql .= $this->db->order($sortfield, $sortorder); |
236 | 236 | if ($limit) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $obj_ret['pagination'] = array( |
291 | 291 | 'total' => (int) $total, |
292 | 292 | 'page' => $page, //count starts from 0 |
293 | - 'page_count' => ceil((int) $total/$limit), |
|
293 | + 'page_count' => ceil((int) $total / $limit), |
|
294 | 294 | 'limit' => $limit |
295 | 295 | ); |
296 | 296 | } |
@@ -1999,7 +1999,7 @@ discard block |
||
1999 | 1999 | unset($object->fk_bank); |
2000 | 2000 | unset($object->fk_account); |
2001 | 2001 | |
2002 | - unset($object->supplierprices); // Must use another API to get them |
|
2002 | + unset($object->supplierprices); // Must use another API to get them |
|
2003 | 2003 | |
2004 | 2004 | if (!DolibarrApiAccess::$user->hasRight('stock', 'lire')) { |
2005 | 2005 | unset($object->stock_reel); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | $usercanedit = $user->hasRight('website', 'write'); |
351 | -$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
351 | +$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
352 | 352 | $permissiontodelete = $user->hasRight('website', 'delete'); |
353 | 353 | |
354 | 354 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | if ($sortorder) { |
416 | 416 | $backtopage .= '&sortorder='.urlencode($sortorder); |
417 | 417 | } |
418 | -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
418 | +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
419 | 419 | |
420 | 420 | $backtopage = $savbacktopage; |
421 | 421 | //var_dump($backtopage); |
@@ -1528,7 +1528,7 @@ discard block |
||
1528 | 1528 | $error++; |
1529 | 1529 | setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors'); |
1530 | 1530 | } |
1531 | - if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1531 | + if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1532 | 1532 | $error++; |
1533 | 1533 | setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors'); |
1534 | 1534 | } |
@@ -1540,7 +1540,7 @@ discard block |
||
1540 | 1540 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1541 | 1541 | $action = 'preview'; |
1542 | 1542 | if ($backtopage) { |
1543 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1543 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1544 | 1544 | header("Location: ".$backtopage); |
1545 | 1545 | exit; |
1546 | 1546 | } |
@@ -1573,7 +1573,7 @@ discard block |
||
1573 | 1573 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1574 | 1574 | |
1575 | 1575 | // Security analysis |
1576 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1576 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1577 | 1577 | |
1578 | 1578 | if (!$errorphpcheck) { |
1579 | 1579 | $htmlheadercontent = ''; |
@@ -1611,7 +1611,7 @@ discard block |
||
1611 | 1611 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1612 | 1612 | |
1613 | 1613 | // Security analysis |
1614 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1614 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1615 | 1615 | |
1616 | 1616 | if (!$errorphpcheck) { |
1617 | 1617 | $csscontent = ''; |
@@ -1654,7 +1654,7 @@ discard block |
||
1654 | 1654 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1655 | 1655 | |
1656 | 1656 | // Security analysis |
1657 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1657 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1658 | 1658 | |
1659 | 1659 | if (!$errorphpcheck) { |
1660 | 1660 | $jscontent = ''; |
@@ -1692,7 +1692,7 @@ discard block |
||
1692 | 1692 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1693 | 1693 | |
1694 | 1694 | // Security analysis |
1695 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1695 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1696 | 1696 | |
1697 | 1697 | if (!$errorphpcheck) { |
1698 | 1698 | $robotcontent = ''; |
@@ -1730,7 +1730,7 @@ discard block |
||
1730 | 1730 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1731 | 1731 | |
1732 | 1732 | // Security analysis |
1733 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1733 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1734 | 1734 | |
1735 | 1735 | if (!$errorphpcheck) { |
1736 | 1736 | $htaccesscontent = ''; |
@@ -1754,7 +1754,7 @@ discard block |
||
1754 | 1754 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1755 | 1755 | |
1756 | 1756 | // Security analysis |
1757 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1757 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1758 | 1758 | |
1759 | 1759 | if (!$errorphpcheck) { |
1760 | 1760 | $manifestjsoncontent = ''; |
@@ -1792,7 +1792,7 @@ discard block |
||
1792 | 1792 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1793 | 1793 | |
1794 | 1794 | // Security analysis |
1795 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1795 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1796 | 1796 | |
1797 | 1797 | if (!$errorphpcheck) { |
1798 | 1798 | $readmecontent = ''; |
@@ -1830,7 +1830,7 @@ discard block |
||
1830 | 1830 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1831 | 1831 | |
1832 | 1832 | // Security analysis |
1833 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1833 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1834 | 1834 | |
1835 | 1835 | if (!$errorphpcheck) { |
1836 | 1836 | $licensecontent = ''; |
@@ -1872,7 +1872,7 @@ discard block |
||
1872 | 1872 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1873 | 1873 | $action = 'preview'; |
1874 | 1874 | if ($backtopage) { |
1875 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1875 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1876 | 1876 | header("Location: ".$backtopage); |
1877 | 1877 | exit; |
1878 | 1878 | } |
@@ -1891,7 +1891,7 @@ discard block |
||
1891 | 1891 | |
1892 | 1892 | $object->fk_default_home = $pageid; |
1893 | 1893 | $res = $object->update($user); |
1894 | - if (! ($res > 0)) { |
|
1894 | + if (!($res > 0)) { |
|
1895 | 1895 | $error++; |
1896 | 1896 | setEventMessages($object->error, $object->errors, 'errors'); |
1897 | 1897 | } |
@@ -2282,7 +2282,7 @@ discard block |
||
2282 | 2282 | |
2283 | 2283 | $phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content); |
2284 | 2284 | |
2285 | - $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2285 | + $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2286 | 2286 | |
2287 | 2287 | $phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content); |
2288 | 2288 | |
@@ -2487,7 +2487,7 @@ discard block |
||
2487 | 2487 | $fileofzip = ''; |
2488 | 2488 | if (GETPOSTISSET('templateuserfile')) { |
2489 | 2489 | // Case we selected one template |
2490 | - $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2490 | + $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2491 | 2491 | } elseif (!empty($_FILES) && is_array($_FILES['userfile'])) { |
2492 | 2492 | // Case we upload a new template |
2493 | 2493 | if (is_array($_FILES['userfile']['tmp_name'])) { |
@@ -2569,7 +2569,7 @@ discard block |
||
2569 | 2569 | if ($website->virtualhost) { |
2570 | 2570 | $domainname = $website->virtualhost; |
2571 | 2571 | } |
2572 | - if (! preg_match('/^http/i', $domainname)) { |
|
2572 | + if (!preg_match('/^http/i', $domainname)) { |
|
2573 | 2573 | $domainname = 'https://'.$domainname; |
2574 | 2574 | } |
2575 | 2575 | |
@@ -2635,7 +2635,7 @@ discard block |
||
2635 | 2635 | $url->appendChild($lastmod); |
2636 | 2636 | // Add suggested frequency for refresh |
2637 | 2637 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
2638 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2638 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2639 | 2639 | $url->appendChild($changefreq); |
2640 | 2640 | } |
2641 | 2641 | // Add higher priority for home page |
@@ -2740,7 +2740,7 @@ discard block |
||
2740 | 2740 | $url->appendChild($lastmod); |
2741 | 2741 | // Add suggested frequency for refresh |
2742 | 2742 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
2743 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2743 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2744 | 2744 | $url->appendChild($changefreq); |
2745 | 2745 | } |
2746 | 2746 | |
@@ -3335,7 +3335,7 @@ discard block |
||
3335 | 3335 | $formquestion[] = array('type' => 'checkbox', 'tdclass'=>'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0, 'morecss'=>'margintoponly'); |
3336 | 3336 | } |
3337 | 3337 | |
3338 | - $value= $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
3338 | + $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
3339 | 3339 | $formquestion[] = array('type' => 'other', 'name' => 'newlang', 'label' => $form->textwithpicto($langs->trans("Language"), $langs->trans("DefineListOfAltLanguagesInWebsiteProperties")), 'value' => $value); |
3340 | 3340 | |
3341 | 3341 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550); |
@@ -3363,7 +3363,7 @@ discard block |
||
3363 | 3363 | print '<!-- button EditInLine and ShowSubcontainers -->'."\n"; |
3364 | 3364 | print '<div class="websiteselectionsection inline-block">'; |
3365 | 3365 | |
3366 | - print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
3366 | + print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
3367 | 3367 | print $langs->trans("ShowSubcontainers"); |
3368 | 3368 | if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) { |
3369 | 3369 | print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>'; |
@@ -3372,7 +3372,7 @@ discard block |
||
3372 | 3372 | } |
3373 | 3373 | print '</div>'; |
3374 | 3374 | |
3375 | - print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3375 | + print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3376 | 3376 | |
3377 | 3377 | print '<span id="switchckeditorinline">'."\n"; |
3378 | 3378 | // Enable CKEditor inline with js on section and div with conteneditable=true |
@@ -3490,7 +3490,7 @@ discard block |
||
3490 | 3490 | } else { |
3491 | 3491 | $disabled = ''; |
3492 | 3492 | $title = ''; |
3493 | - $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3493 | + $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3494 | 3494 | } |
3495 | 3495 | print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>'; |
3496 | 3496 | print '</span>'; |
@@ -3699,7 +3699,7 @@ discard block |
||
3699 | 3699 | // Clean the php htaccesscontent file to remove php code and get only html part |
3700 | 3700 | $htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htaccesscontent); |
3701 | 3701 | } else { |
3702 | - $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
3702 | + $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
3703 | 3703 | } |
3704 | 3704 | if (!trim($htaccesscontent)) { |
3705 | 3705 | $htaccesscontent .= "# Order allow,deny\n"; |
@@ -3801,7 +3801,7 @@ discard block |
||
3801 | 3801 | $maxfilesizearray = getMaxFileSizeArray(); |
3802 | 3802 | $maxmin = $maxfilesizearray['maxmin']; |
3803 | 3803 | if ($maxmin > 0) { |
3804 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3804 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
3805 | 3805 | } |
3806 | 3806 | print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>'; |
3807 | 3807 | |
@@ -4057,7 +4057,7 @@ discard block |
||
4057 | 4057 | $maxfilesizearray = getMaxFileSizeArray(); |
4058 | 4058 | $maxmin = $maxfilesizearray['maxmin']; |
4059 | 4059 | if ($maxmin > 0) { |
4060 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4060 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4061 | 4061 | } |
4062 | 4062 | print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">'; |
4063 | 4063 | print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">'; |
@@ -4576,7 +4576,7 @@ discard block |
||
4576 | 4576 | |
4577 | 4577 | |
4578 | 4578 | $module = 'medias'; |
4579 | - $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php |
|
4579 | + $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php |
|
4580 | 4580 | if (empty($url)) { |
4581 | 4581 | $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param |
4582 | 4582 | } |
@@ -4629,7 +4629,7 @@ discard block |
||
4629 | 4629 | |
4630 | 4630 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
4631 | 4631 | $poscursor = array('x'=>GETPOST('PAGE_CONTENT_x'), 'y'=>GETPOST('PAGE_CONTENT_y')); |
4632 | - $doleditor=new DolEditor('PAGE_CONTENT', $contentforedit, '', 500, 'Full', '', true, true, true, ROWS_5, '90%', 0, $poscursor); |
|
4632 | + $doleditor = new DolEditor('PAGE_CONTENT', $contentforedit, '', 500, 'Full', '', true, true, true, ROWS_5, '90%', 0, $poscursor); |
|
4633 | 4633 | $doleditor->Create(0, '', false); |
4634 | 4634 | } |
4635 | 4635 | |
@@ -4807,7 +4807,7 @@ discard block |
||
4807 | 4807 | print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']); |
4808 | 4808 | print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
4809 | 4809 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
4810 | - print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
4810 | + print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
4811 | 4811 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
4812 | 4812 | print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
4813 | 4813 | print '</tr>'; |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | |
92 | 92 | $parameters = array(); |
93 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
93 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
94 | 94 | // Delete Link |
95 | 95 | $permissiondellink = $user->hasRight('expedition', 'delivery', 'supprimer'); // Used by the include of actions_dellink.inc.php |
96 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
96 | +include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
97 | 97 | |
98 | 98 | if ($action == 'add') { |
99 | 99 | $db->begin(); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $morehtmlref = '<div class="refidno">'; |
327 | 327 | // Ref customer shipment |
328 | 328 | $morehtmlref .= $form->editfieldkey("RefCustomer", '', $expedition->ref_customer, $expedition, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1); |
329 | - $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->hasRight('expedition', 'creer'), 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
329 | + $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->hasRight('expedition', 'creer'), 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
330 | 330 | $morehtmlref .= '<br>'.$langs->trans("RefDeliveryReceipt").' : '.$object->ref; |
331 | 331 | // Thirdparty |
332 | 332 | $morehtmlref .= '<br>'.$expedition->thirdparty->getNomUrl(1); |
@@ -95,7 +95,7 @@ |
||
95 | 95 | } |
96 | 96 | $result = restrictedArea($user, 'expedition', $object->id, ''); |
97 | 97 | |
98 | -$permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php |
|
98 | +$permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php |
|
99 | 99 | |
100 | 100 | |
101 | 101 | /* |
@@ -27,33 +27,33 @@ discard block |
||
27 | 27 | |
28 | 28 | // Load Dolibarr environment |
29 | 29 | require '../main.inc.php'; |
30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
31 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
39 | 39 | |
40 | 40 | |
41 | 41 | // Load translation files required by the page |
42 | 42 | $langs->loadLangs(array("hrm", "other", 'products')); |
43 | 43 | |
44 | -$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
44 | +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
45 | 45 | $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) |
46 | 46 | $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? |
47 | -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
|
48 | -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
|
49 | -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
47 | +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
|
48 | +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
|
49 | +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
|
50 | 50 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobpositionlist'; // To manage different context of search |
51 | 51 | $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
52 | 52 | $backtopage = GETPOST('backtopage', 'alpha'); |
53 | 53 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
54 | 54 | |
55 | -$id = GETPOST('id', 'int'); |
|
56 | -$ref = GETPOST('ref', 'alpha'); |
|
55 | +$id = GETPOST('id', 'int'); |
|
56 | +$ref = GETPOST('ref', 'alpha'); |
|
57 | 57 | $fk_job = (GETPOSTISSET('fk_job') ? GETPOST('fk_job', 'int') : $id); |
58 | 58 | $fk_user = GETPOST('fk_user', 'int'); |
59 | 59 | //$start_date = date('Y-m-d', GETPOST('date_startyear', 'int').'-'.GETPOST('date_startmonth', 'int').'-'.GETPOST('date_startday', 'int')); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; |
65 | 65 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
66 | 66 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
67 | -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
67 | +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); |
|
68 | 68 | if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { |
69 | 69 | // If $page is not defined, or '' or -1 or if we click on clear filters |
70 | 70 | $page = 0; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $object = new Job($db); |
79 | 79 | $objectposition = new Position($db); |
80 | 80 | $extrafields = new ExtraFields($db); |
81 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
81 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
82 | 82 | $hookmanager->initHooks(array('jobpositioncard', 'globalcard')); // Note that conf->hooks_modules contains array |
83 | 83 | |
84 | 84 | |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | |
91 | 91 | // Default sort order (if not yet defined by previous GETPOST) |
92 | 92 | if (!$sortfield) { |
93 | - reset($objectposition->fields); // Reset is required to avoid key() to return null. |
|
94 | - $sortfield = "t." . key($objectposition->fields); // Set here default search field. By default 1st field in definition. |
|
93 | + reset($objectposition->fields); // Reset is required to avoid key() to return null. |
|
94 | + $sortfield = "t.".key($objectposition->fields); // Set here default search field. By default 1st field in definition. |
|
95 | 95 | } |
96 | 96 | if (!$sortorder) { |
97 | 97 | $sortorder = "ASC"; |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); |
102 | 102 | $search = array(); |
103 | 103 | foreach ($objectposition->fields as $key => $val) { |
104 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
105 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
104 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
105 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
106 | 106 | } |
107 | 107 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
108 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int')); |
|
109 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int')); |
|
108 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); |
|
109 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $fieldstosearchall = array(); |
115 | 115 | foreach ($objectposition->fields as $key => $val) { |
116 | 116 | if (!empty($val['searchall'])) { |
117 | - $fieldstosearchall['t.' . $key] = $val['label']; |
|
117 | + $fieldstosearchall['t.'.$key] = $val['label']; |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // If $val['visible']==0, then we never show the field |
125 | 125 | if (!empty($val['visible'])) { |
126 | 126 | $visible = (int) dol_eval($val['visible'], 1, 1, '1'); |
127 | - $arrayfields['t.' . $key] = array( |
|
127 | + $arrayfields['t.'.$key] = array( |
|
128 | 128 | 'label' => $val['label'], |
129 | 129 | 'checked' => (($visible < 0) ? 0 : 1), |
130 | 130 | 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | } |
136 | 136 | // Extra fields |
137 | -include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
137 | +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
138 | 138 | |
139 | 139 | $objectposition->fields = dol_sort_array($objectposition->fields, 'position'); |
140 | 140 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | |
144 | 144 | |
145 | 145 | // Load object |
146 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
146 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
147 | 147 | |
148 | 148 | // Permissions |
149 | 149 | $permissiontoread = $user->hasRight('hrm', 'all', 'read'); |
150 | 150 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
151 | 151 | $permissiontodelete = $user->hasRight('hrm', 'all', 'delete'); |
152 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; |
|
152 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position'; |
|
153 | 153 | |
154 | 154 | // Security check (enable the most restrictive one) |
155 | 155 | //if ($user->socid > 0) accessforbidden(); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $backurlforlist = dol_buildpath('/hrm/position_list.php', 1); |
180 | 180 | $idBacktoPage = GETPOST('fk_job', 'aZ09'); |
181 | 181 | if ($idBacktoPage > 0) { |
182 | - $backtopage = dol_buildpath('/hrm/position.php', 1) . '?id=' . $idBacktoPage; |
|
182 | + $backtopage = dol_buildpath('/hrm/position.php', 1).'?id='.$idBacktoPage; |
|
183 | 183 | } |
184 | 184 | if (empty($backtopage) || ($cancel && empty($id))) { |
185 | 185 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | $backtopage = $backurlforlist; |
188 | 188 | } else { |
189 | 189 | if ($fk_job > 0) { |
190 | - $backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); |
|
190 | + $backtopage = dol_buildpath('/hrm/position.php', 1).'?fk_job='.($fk_job > 0 ? $fk_job : '__ID__'); |
|
191 | 191 | } else { |
192 | - $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=__ID__'; |
|
192 | + $backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id=__ID__'; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | } |
@@ -202,15 +202,15 @@ discard block |
||
202 | 202 | $object = new Position($db); |
203 | 203 | |
204 | 204 | // Selection of new fields |
205 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
205 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
206 | 206 | |
207 | 207 | // Purge search criteria |
208 | 208 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
209 | 209 | foreach ($object->fields as $key => $val) { |
210 | 210 | $search[$key] = ''; |
211 | 211 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
212 | - $search[$key . '_dtstart'] = ''; |
|
213 | - $search[$key . '_dtend'] = ''; |
|
212 | + $search[$key.'_dtstart'] = ''; |
|
213 | + $search[$key.'_dtend'] = ''; |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | $toselect = array(); |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | $objectclass = 'Position'; |
226 | 226 | $objectlabel = 'Position'; |
227 | 227 | $uploaddir = $conf->hrm->dir_output; |
228 | - include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; |
|
228 | + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; |
|
229 | 229 | |
230 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
230 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
231 | 231 | |
232 | 232 | $object = $job; |
233 | 233 | } |
@@ -249,29 +249,29 @@ discard block |
||
249 | 249 | $object = new Position($db); |
250 | 250 | // Fetch optionals attributes and labels |
251 | 251 | $extrafields->fetch_name_optionals_label($object->table_element); |
252 | - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Position")), '', 'object_' . $object->picto); |
|
252 | + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Position")), '', 'object_'.$object->picto); |
|
253 | 253 | |
254 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
255 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
254 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
255 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
256 | 256 | print '<input type="hidden" name="action" value="add">'; |
257 | 257 | if ($backtopage) { |
258 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
258 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
259 | 259 | } |
260 | 260 | if ($backtopageforcancel) { |
261 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
261 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | print dol_get_fiche_head(array(), ''); |
265 | 265 | |
266 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
266 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
267 | 267 | |
268 | 268 | // Common attributes |
269 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
269 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
270 | 270 | |
271 | 271 | // Other attributes |
272 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
272 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
273 | 273 | |
274 | - print '</table>' . "\n"; |
|
274 | + print '</table>'."\n"; |
|
275 | 275 | |
276 | 276 | print dol_get_fiche_end(); |
277 | 277 | |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | } |
284 | 284 | if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { |
285 | 285 | if ($backtopage) { |
286 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
286 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
287 | 287 | } |
288 | 288 | if ($backtopageforcancel) { |
289 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
289 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | // Part to show record |
@@ -299,10 +299,10 @@ discard block |
||
299 | 299 | |
300 | 300 | // Object card |
301 | 301 | // ------------------------------------------------------------ |
302 | - $linkback = '<a href="' . dol_buildpath('/hrm/position_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($fk_job) ? '&fk_job=' . $fk_job : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
302 | + $linkback = '<a href="'.dol_buildpath('/hrm/position_list.php', 1).'?restore_lastsearch_values=1'.(!empty($fk_job) ? '&fk_job='.$fk_job : '').'">'.$langs->trans("BackToList").'</a>'; |
|
303 | 303 | |
304 | 304 | $morehtmlref = '<div class="refid">'; |
305 | - $morehtmlref.= $object->label; |
|
305 | + $morehtmlref .= $object->label; |
|
306 | 306 | $morehtmlref .= '</div>'; |
307 | 307 | |
308 | 308 | dol_banner_tab($object, 'fk_job', $linkback, 1, 'rowid', 'rowid', $morehtmlref); |
@@ -311,17 +311,17 @@ discard block |
||
311 | 311 | print '<div class="fichecenter">'; |
312 | 312 | print '<div class="fichehalfleft">'; |
313 | 313 | print '<div class="underbanner clearboth"></div>'; |
314 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
314 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
315 | 315 | |
316 | 316 | // Common attributes |
317 | 317 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
318 | 318 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
319 | 319 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
320 | - $object->fields['label']['visible']=0; // Already in banner |
|
321 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
320 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
321 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
322 | 322 | |
323 | 323 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
324 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
324 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
325 | 325 | |
326 | 326 | print '</table>'; |
327 | 327 | print '</div>'; |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | // Add fields from extrafields |
345 | 345 | if (!empty($extrafields->attributes[$object->table_element]['label'])) { |
346 | 346 | foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { |
347 | - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . " as options_" . $key . ', ' : ''); |
|
347 | + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | // Add fields from hooks |
@@ -352,20 +352,20 @@ discard block |
||
352 | 352 | $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook |
353 | 353 | $sql .= $hookmanager->resPrint; |
354 | 354 | $sql = preg_replace('/,\s*$/', '', $sql); |
355 | - $sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t"; |
|
355 | + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; |
|
356 | 356 | if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
357 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
357 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
358 | 358 | } |
359 | 359 | // Add table from hooks |
360 | 360 | $parameters = array(); |
361 | 361 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook |
362 | 362 | $sql .= $hookmanager->resPrint; |
363 | 363 | if ($object->ismultientitymanaged == 1) { |
364 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element) . ")"; |
|
364 | + $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; |
|
365 | 365 | } else { |
366 | 366 | $sql .= " WHERE 1 = 1"; |
367 | 367 | } |
368 | - $sql .= " AND t.fk_job = " . ((int) $fk_job) . " "; |
|
368 | + $sql .= " AND t.fk_job = ".((int) $fk_job)." "; |
|
369 | 369 | |
370 | 370 | foreach ($search as $key => $val) { |
371 | 371 | if (array_key_exists($key, $object->fields)) { |
@@ -387,10 +387,10 @@ discard block |
||
387 | 387 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
388 | 388 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
389 | 389 | if (preg_match('/_dtstart$/', $key)) { |
390 | - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; |
|
390 | + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
|
391 | 391 | } |
392 | 392 | if (preg_match('/_dtend$/', $key)) { |
393 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
393 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
394 | 394 | } |
395 | 395 | } |
396 | 396 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | } |
402 | 402 | //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); |
403 | 403 | // Add where from extra fields |
404 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
404 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
405 | 405 | // Add where from hooks |
406 | 406 | $parameters = array(); |
407 | 407 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -440,15 +440,15 @@ discard block |
||
440 | 440 | if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { |
441 | 441 | $obj = $db->fetch_object($resql); |
442 | 442 | $id = $obj->rowid; |
443 | - header("Location: " . dol_buildpath('/hrm/position.php', 1) . '?id=' . $id); |
|
443 | + header("Location: ".dol_buildpath('/hrm/position.php', 1).'?id='.$id); |
|
444 | 444 | exit; |
445 | 445 | } |
446 | 446 | |
447 | 447 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
448 | 448 | |
449 | - $param = 'fk_job=' . $fk_job; |
|
449 | + $param = 'fk_job='.$fk_job; |
|
450 | 450 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
451 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
451 | + $param .= '&contextpage='.urlencode($contextpage); |
|
452 | 452 | } |
453 | 453 | if ($limit > 0 && $limit != $conf->liste_limit) { |
454 | 454 | $param .= '&limit='.((int) $limit); |
@@ -456,17 +456,17 @@ discard block |
||
456 | 456 | foreach ($search as $key => $val) { |
457 | 457 | if (is_array($search[$key]) && count($search[$key])) { |
458 | 458 | foreach ($search[$key] as $skey) { |
459 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
459 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
460 | 460 | } |
461 | 461 | } else { |
462 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
462 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
463 | 463 | } |
464 | 464 | } |
465 | 465 | if ($optioncss != '') { |
466 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
466 | + $param .= '&optioncss='.urlencode($optioncss); |
|
467 | 467 | } |
468 | 468 | // Add $param from extra fields |
469 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php'; |
|
469 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
|
470 | 470 | // Add $param from hooks |
471 | 471 | $parameters = array(); |
472 | 472 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -480,43 +480,43 @@ discard block |
||
480 | 480 | //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), |
481 | 481 | ); |
482 | 482 | if ($permissiontodelete) { |
483 | - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"') . $langs->trans("Delete"); |
|
483 | + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
|
484 | 484 | } |
485 | 485 | if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { |
486 | 486 | $arrayofmassactions = array(); |
487 | 487 | } |
488 | 488 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
489 | 489 | |
490 | - print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '?fk_job=' . $fk_job . '">' . "\n"; |
|
490 | + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?fk_job='.$fk_job.'">'."\n"; |
|
491 | 491 | if ($optioncss != '') { |
492 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
492 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
493 | 493 | } |
494 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
494 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
495 | 495 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
496 | 496 | print '<input type="hidden" name="action" value="list">'; |
497 | - print '<input type="hidden" name="massaction" value="' . $massaction . '">'; |
|
498 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
499 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
500 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
501 | - print '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
497 | + print '<input type="hidden" name="massaction" value="'.$massaction.'">'; |
|
498 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
499 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
500 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
501 | + print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
502 | 502 | |
503 | 503 | $newcardbutton = ''; |
504 | 504 | $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/position.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).'&fk_job='.((int) $fk_job), '', $permissiontoadd); |
505 | 505 | |
506 | - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
|
506 | + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); |
|
507 | 507 | |
508 | 508 | // Add code for pre mass action (confirmation or email presend form) |
509 | 509 | $topicmail = "SendPositionRef"; |
510 | 510 | $modelmail = "position"; |
511 | 511 | $objecttmp = new Position($db); |
512 | - $trackid = 'xxxx' . $object->id; |
|
513 | - include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php'; |
|
512 | + $trackid = 'xxxx'.$object->id; |
|
513 | + include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; |
|
514 | 514 | |
515 | 515 | if ($search_all) { |
516 | 516 | foreach ($fieldstosearchall as $key => $val) { |
517 | 517 | $fieldstosearchall[$key] = $langs->trans($val); |
518 | 518 | } |
519 | - print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '</div>'; |
|
519 | + print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>'; |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | $moreforfilter = ''; |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
544 | 544 | |
545 | 545 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
546 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
546 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
547 | 547 | |
548 | 548 | // Fields title search |
549 | 549 | // -------------------------------------------------------------------- |
@@ -551,35 +551,35 @@ discard block |
||
551 | 551 | foreach ($object->fields as $key => $val) { |
552 | 552 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
553 | 553 | if ($key == 'status') { |
554 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
554 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
555 | 555 | } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
556 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
556 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
557 | 557 | } elseif (in_array($val['type'], array('timestamp'))) { |
558 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
558 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
559 | 559 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
560 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
560 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
561 | 561 | } |
562 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
563 | - print '<td class="liste_titre' . ($cssforfield ? ' ' . $cssforfield : '') . '">'; |
|
562 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
563 | + print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">'; |
|
564 | 564 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
565 | - print $form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
|
565 | + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); |
|
566 | 566 | } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { |
567 | 567 | print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); |
568 | 568 | } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
569 | - print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
569 | + print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
570 | 570 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
571 | 571 | print '<div class="nowrap">'; |
572 | - print $form->selectDate($search[$key . '_dtstart'] ? $search[$key . '_dtstart'] : '', "search_" . $key . "_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); |
|
572 | + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); |
|
573 | 573 | print '</div>'; |
574 | 574 | print '<div class="nowrap">'; |
575 | - print $form->selectDate($search[$key . '_dtend'] ? $search[$key . '_dtend'] : '', "search_" . $key . "_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
|
575 | + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
|
576 | 576 | print '</div>'; |
577 | 577 | } |
578 | 578 | print '</td>'; |
579 | 579 | } |
580 | 580 | } |
581 | 581 | // Extra fields |
582 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php'; |
|
582 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; |
|
583 | 583 | |
584 | 584 | // Fields from hook |
585 | 585 | $parameters = array('arrayfields' => $arrayfields); |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | $searchpicto = $form->showFilterButtons(); |
591 | 591 | print $searchpicto; |
592 | 592 | print '</td>'; |
593 | - print '</tr>' . "\n"; |
|
593 | + print '</tr>'."\n"; |
|
594 | 594 | |
595 | 595 | |
596 | 596 | // Fields title label |
@@ -599,27 +599,27 @@ discard block |
||
599 | 599 | foreach ($object->fields as $key => $val) { |
600 | 600 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
601 | 601 | if ($key == 'status') { |
602 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
602 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
603 | 603 | } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
604 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
604 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
605 | 605 | } elseif (in_array($val['type'], array('timestamp'))) { |
606 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
606 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
607 | 607 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
608 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
608 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
609 | 609 | } |
610 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
611 | - print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n"; |
|
610 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
611 | + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; |
|
612 | 612 | } |
613 | 613 | } |
614 | 614 | // Extra fields |
615 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php'; |
|
615 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; |
|
616 | 616 | // Hook fields |
617 | 617 | $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); |
618 | 618 | $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook |
619 | 619 | print $hookmanager->resPrint; |
620 | 620 | // Action column |
621 | - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ') . "\n"; |
|
622 | - print '</tr>' . "\n"; |
|
621 | + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
|
622 | + print '</tr>'."\n"; |
|
623 | 623 | |
624 | 624 | // Detect if we need a fetch on each output line |
625 | 625 | $needToFetchEachLine = 0; |
@@ -651,24 +651,24 @@ discard block |
||
651 | 651 | foreach ($object->fields as $key => $val) { |
652 | 652 | $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); |
653 | 653 | if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
654 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
654 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
655 | 655 | } elseif ($key == 'status') { |
656 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; |
|
656 | + $cssforfield .= ($cssforfield ? ' ' : '').'center'; |
|
657 | 657 | } |
658 | 658 | |
659 | 659 | if (in_array($val['type'], array('timestamp'))) { |
660 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
660 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
661 | 661 | } elseif ($key == 'ref') { |
662 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; |
|
662 | + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; |
|
663 | 663 | } |
664 | 664 | |
665 | 665 | if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { |
666 | - $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; |
|
666 | + $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
|
667 | 667 | } |
668 | 668 | //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; |
669 | 669 | |
670 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
671 | - print '<td' . ($cssforfield ? ' class="' . $cssforfield . '"' : '') . '>'; |
|
670 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
671 | + print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>'; |
|
672 | 672 | if ($key == 'status') { |
673 | 673 | print $object->getLibStatut(5); |
674 | 674 | } elseif ($key == 'rowid') { |
@@ -682,20 +682,20 @@ discard block |
||
682 | 682 | } |
683 | 683 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
684 | 684 | if (!$i) { |
685 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
685 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
686 | 686 | } |
687 | 687 | if (!isset($totalarray['val'])) { |
688 | 688 | $totalarray['val'] = array(); |
689 | 689 | } |
690 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
691 | - $totalarray['val']['t.' . $key] = 0; |
|
690 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
691 | + $totalarray['val']['t.'.$key] = 0; |
|
692 | 692 | } |
693 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
693 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
694 | 694 | } |
695 | 695 | } |
696 | 696 | } |
697 | 697 | // Extra fields |
698 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
698 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
699 | 699 | // Fields from hook |
700 | 700 | $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); |
701 | 701 | $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -707,20 +707,20 @@ discard block |
||
707 | 707 | if (in_array($object->id, $arrayofselected)) { |
708 | 708 | $selected = 1; |
709 | 709 | } |
710 | - print '<input id="cb' . $object->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $object->id . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
710 | + print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
711 | 711 | } |
712 | 712 | print '</td>'; |
713 | 713 | if (!$i) { |
714 | 714 | $totalarray['nbfield']++; |
715 | 715 | } |
716 | 716 | |
717 | - print '</tr>' . "\n"; |
|
717 | + print '</tr>'."\n"; |
|
718 | 718 | |
719 | 719 | $i++; |
720 | 720 | } |
721 | 721 | |
722 | 722 | // Show total line |
723 | - include DOL_DOCUMENT_ROOT . '/core/tpl/list_print_total.tpl.php'; |
|
723 | + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; |
|
724 | 724 | |
725 | 725 | // If no record found |
726 | 726 | if ($num == 0) { |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | $colspan++; |
731 | 731 | } |
732 | 732 | } |
733 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
733 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
734 | 734 | } |
735 | 735 | |
736 | 736 | |
@@ -740,10 +740,10 @@ discard block |
||
740 | 740 | $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook |
741 | 741 | print $hookmanager->resPrint; |
742 | 742 | |
743 | - print '</table>' . "\n"; |
|
744 | - print '</div>' . "\n"; |
|
743 | + print '</table>'."\n"; |
|
744 | + print '</div>'."\n"; |
|
745 | 745 | |
746 | - print '</form>' . "\n"; |
|
746 | + print '</form>'."\n"; |
|
747 | 747 | |
748 | 748 | if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { |
749 | 749 | $hidegeneratedfilelistifempty = 1; |
@@ -751,11 +751,11 @@ discard block |
||
751 | 751 | $hidegeneratedfilelistifempty = 0; |
752 | 752 | } |
753 | 753 | |
754 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
754 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
755 | 755 | $formfile = new FormFile($db); |
756 | 756 | |
757 | 757 | // Show list of available documents |
758 | - $urlsource = $_SERVER['PHP_SELF'] . '?sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
758 | + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
759 | 759 | $urlsource .= str_replace('&', '&', $param); |
760 | 760 | |
761 | 761 | $filedir = $diroutputmassaction; |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | // Load Dolibarr environment |
29 | 29 | require '../main.inc.php'; |
30 | 30 | |
31 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; |
|
32 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | // Load translation files required by the page |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | // Permissions |
63 | 63 | $permissionnote = $user->hasRight('hrm', 'evaluation', 'write'); // Used by the include of actions_setnotes.inc.php |
64 | -$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read'); // Used by the include of actions_addupdatedelete.inc.php |
|
64 | +$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read'); // Used by the include of actions_addupdatedelete.inc.php |
|
65 | 65 | |
66 | 66 | // Security check (enable the most restrictive one) |
67 | 67 | //if ($user->socid > 0) accessforbidden(); |