@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | if (!defined('NOREQUIREDB')) { |
27 | - define('NOREQUIREDB', '1'); // Do not create database handler $db |
|
27 | + define('NOREQUIREDB', '1'); // Do not create database handler $db |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $sapi_type = php_sapi_name(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $result = array(); |
61 | 61 | while ($i < $argc) { |
62 | 62 | if (!empty($argv[$i])) { |
63 | - parse_str($argv[$i], $result); // set all params $release, $includecustom, $includeconstant, $buildzip ... |
|
63 | + parse_str($argv[$i], $result); // set all params $release, $includecustom, $includeconstant, $buildzip ... |
|
64 | 64 | } |
65 | 65 | if (!empty($result["release"])) { |
66 | 66 | $release = $result["release"]; |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | $buildzip = 1; |
76 | 76 | } |
77 | 77 | if (preg_match('/includeconstant=/', strval($argv[$i]))) { |
78 | - $tmp = explode(':', $result['includeconstant'], 3); // $includeconstant has been set with previous parse_str() |
|
78 | + $tmp = explode(':', $result['includeconstant'], 3); // $includeconstant has been set with previous parse_str() |
|
79 | 79 | if (count($tmp) != 3) { |
80 | - print "Error: Bad parameter includeconstant=".$result['includeconstant'] ."\n"; |
|
80 | + print "Error: Bad parameter includeconstant=".$result['includeconstant']."\n"; |
|
81 | 81 | exit -1; |
82 | 82 | } |
83 | 83 | $includeconstants[$tmp[0]][$tmp[1]] = $tmp[2]; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | // Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php) |
170 | 170 | $regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; |
171 | -$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs |
|
171 | +$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs |
|
172 | 172 | $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
173 | 173 | |
174 | 174 | $dir = ''; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n"); |
211 | 211 | |
212 | 212 | $regextoinclude = '\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; |
213 | -$regextoexclude = '(custom|documents|conf|install)$'; // Exclude dirs |
|
213 | +$regextoexclude = '(custom|documents|conf|install)$'; // Exclude dirs |
|
214 | 214 | $files = dol_dir_list(dirname(__FILE__).'/../../scripts/', 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
215 | 215 | $dir = ''; |
216 | 216 | $needtoclose = 0; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | fputs($fp, '<dolibarr_unalterable_files version="'.$release.'">'."\n"); |
251 | 251 | |
252 | 252 | $regextoinclude = '(\.php|\.sql)$'; |
253 | -$regextoexclude = ''; // Exclude dirs |
|
253 | +$regextoexclude = ''; // Exclude dirs |
|
254 | 254 | $files = dol_dir_list(dirname(__FILE__).'/../../htdocs/blockedlog', 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
255 | 255 | $dir = ''; |
256 | 256 | $needtoclose = 0; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | // Add the SQL file |
279 | 279 | $regextoinclude = 'llx_blockedlog.*(\.php|\.sql)$'; |
280 | -$regextoexclude = ''; // Exclude dirs |
|
280 | +$regextoexclude = ''; // Exclude dirs |
|
281 | 281 | $files = dol_dir_list(dirname(__FILE__).'/../../htdocs/install/mysql/tables', 'files', 0, $regextoinclude, $regextoexclude, 'fullname'); |
282 | 282 | $needtoclose = 0; |
283 | 283 | foreach ($files as $filetmp) { |
@@ -80,7 +80,7 @@ |
||
80 | 80 | |
81 | 81 | require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; |
82 | 82 | $b = new BlockedLog($this->db); |
83 | - $b->loadTrackedEvents(); // Get the list of tracked events into $b->trackedevents |
|
83 | + $b->loadTrackedEvents(); // Get the list of tracked events into $b->trackedevents |
|
84 | 84 | |
85 | 85 | // Tracked events |
86 | 86 | if (!in_array($action, array_keys($b->trackedevents))) { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $toselect = GETPOST('toselect', 'array'); |
60 | 60 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search |
61 | 61 | $optioncss = GETPOST('optioncss', 'alpha'); |
62 | -$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...) |
|
62 | +$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...) |
|
63 | 63 | |
64 | 64 | // Load variable for pagination |
65 | 65 | $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | } |
487 | 487 | |
488 | 488 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
489 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
489 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
490 | 490 | $selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : ''); |
491 | 491 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
492 | 492 | |
@@ -578,9 +578,9 @@ discard block |
||
578 | 578 | print '<td class="center">'; |
579 | 579 | print '</td>'; |
580 | 580 | } |
581 | - print '<td><input class="minwidth200" name="dateinput" value="'. date('Y-m-d', dol_stringtotime($obj->date_sync)) .'" type="date"></td>'; |
|
582 | - print '<td>' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . '</td>'; |
|
583 | - print '<td><input type="text" min="0" step="any" class="maxwidth100" name="rateinput" value="' . dol_escape_htmltag($obj->rate) . '">'; |
|
581 | + print '<td><input class="minwidth200" name="dateinput" value="'.date('Y-m-d', dol_stringtotime($obj->date_sync)).'" type="date"></td>'; |
|
582 | + print '<td>'.$form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true).'</td>'; |
|
583 | + print '<td><input type="text" min="0" step="any" class="maxwidth100" name="rateinput" value="'.dol_escape_htmltag($obj->rate).'">'; |
|
584 | 584 | print '<input type="hidden" name="page" value="'.dol_escape_htmltag((string) $page).'">'; |
585 | 585 | print '<input type="hidden" name="id_rate" value="'.dol_escape_htmltag($obj->rowid).'">'; |
586 | 586 | print '<button type="submit" class="button small reposition" name="action" value="update">'.$langs->trans("Modify").'</button>'; |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | print ' - <span class="opacitymedium">'.$obj->name.'</span>'; |
627 | 627 | print "</td>\n"; |
628 | 628 | |
629 | - if (! $i) { |
|
629 | + if (!$i) { |
|
630 | 630 | $totalarray['nbfield']++; |
631 | 631 | } |
632 | 632 | } |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | print '<td class="tdoverflowmax200">'; |
637 | 637 | print $obj->rate; |
638 | 638 | print "</td>\n"; |
639 | - if (! $i) { |
|
639 | + if (!$i) { |
|
640 | 640 | $totalarray['nbfield']++; |
641 | 641 | } |
642 | 642 | } |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | print '<td class="tdoverflowmax200">'; |
647 | 647 | print $obj->rate_indirect; |
648 | 648 | print "</td>\n"; |
649 | - if (! $i) { |
|
649 | + if (!$i) { |
|
650 | 650 | $totalarray['nbfield']++; |
651 | 651 | } |
652 | 652 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | |
655 | 655 | // Fields from hook |
656 | 656 | $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj); |
657 | - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook |
|
657 | + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook |
|
658 | 658 | print $hookmanager->resPrint; |
659 | 659 | |
660 | 660 | // Action |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | if (getDolGlobalString('HOLIDAY_ADDON')) { |
233 | 233 | $mybool = false; |
234 | 234 | |
235 | - $file = getDolGlobalString('HOLIDAY_ADDON') . ".php"; |
|
235 | + $file = getDolGlobalString('HOLIDAY_ADDON').".php"; |
|
236 | 236 | $classname = getDolGlobalString('HOLIDAY_ADDON'); |
237 | 237 | |
238 | 238 | // Include file with class |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | $this->date_fin_gmt = $this->db->jdate($obj->date_fin, 1); |
463 | 463 | $this->halfday = $obj->halfday; |
464 | 464 | $this->status = $obj->status; |
465 | - $this->statut = $obj->status; // deprecated |
|
465 | + $this->statut = $obj->status; // deprecated |
|
466 | 466 | $this->fk_validator = $obj->fk_validator; |
467 | 467 | $this->date_valid = $this->db->jdate($obj->date_valid); |
468 | 468 | $this->fk_user_valid = $obj->fk_user_valid; |
@@ -828,8 +828,8 @@ discard block |
||
828 | 828 | // Rename directory if dir was a temporary ref |
829 | 829 | if (preg_match('/^[\(]?PROV/i', $this->ref)) { |
830 | 830 | // Now we rename also files into index |
831 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'holiday/" . $this->db->escape($this->newref) . "'"; |
|
832 | - $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int) $conf->entity); |
|
831 | + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'holiday/".$this->db->escape($this->newref)."'"; |
|
832 | + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'holiday/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity); |
|
833 | 833 | $resql = $this->db->query($sql); |
834 | 834 | if (!$resql) { |
835 | 835 | $error++; |
@@ -846,19 +846,19 @@ discard block |
||
846 | 846 | // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments |
847 | 847 | $oldref = dol_sanitizeFileName($this->ref); |
848 | 848 | $newref = dol_sanitizeFileName($num); |
849 | - $dirsource = $conf->holiday->multidir_output[$this->entity] . '/' . $oldref; |
|
850 | - $dirdest = $conf->holiday->multidir_output[$this->entity] . '/' . $newref; |
|
849 | + $dirsource = $conf->holiday->multidir_output[$this->entity].'/'.$oldref; |
|
850 | + $dirdest = $conf->holiday->multidir_output[$this->entity].'/'.$newref; |
|
851 | 851 | if (!$error && file_exists($dirsource)) { |
852 | - dol_syslog(get_class($this) . "::validate rename dir " . $dirsource . " into " . $dirdest); |
|
852 | + dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); |
|
853 | 853 | if (@rename($dirsource, $dirdest)) { |
854 | 854 | dol_syslog("Rename ok"); |
855 | 855 | // Rename docs starting with $oldref with $newref |
856 | - $listoffiles = dol_dir_list($dirdest, 'files', 1, '^' . preg_quote($oldref, '/')); |
|
856 | + $listoffiles = dol_dir_list($dirdest, 'files', 1, '^'.preg_quote($oldref, '/')); |
|
857 | 857 | foreach ($listoffiles as $fileentry) { |
858 | 858 | $dirsource = $fileentry['name']; |
859 | - $dirdest = preg_replace('/^' . preg_quote($oldref, '/') . '/', $newref, $dirsource); |
|
860 | - $dirsource = $fileentry['path'] . '/' . $dirsource; |
|
861 | - $dirdest = $fileentry['path'] . '/' . $dirdest; |
|
859 | + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); |
|
860 | + $dirsource = $fileentry['path'].'/'.$dirsource; |
|
861 | + $dirdest = $fileentry['path'].'/'.$dirdest; |
|
862 | 862 | @rename($dirsource, $dirdest); |
863 | 863 | } |
864 | 864 | } |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | } else { |
1387 | 1387 | $labeltoshow = (($typeleaves[$this->fk_type]['code'] && $langs->trans($typeleaves[$this->fk_type]['code']) != $typeleaves[$this->fk_type]['code']) ? $langs->trans($typeleaves[$this->fk_type]['code']) : $typeleaves[$this->fk_type]['label']); |
1388 | 1388 | } |
1389 | - $datas['type'] = '<br><b>'.$langs->trans("Type") . ':</b> ' . $labeltoshow; |
|
1389 | + $datas['type'] = '<br><b>'.$langs->trans("Type").':</b> '.$labeltoshow; |
|
1390 | 1390 | } |
1391 | 1391 | if (isset($this->halfday) && !empty($this->date_debut) && !empty($this->date_fin)) { |
1392 | 1392 | $listhalfday = array( |
@@ -1395,8 +1395,8 @@ discard block |
||
1395 | 1395 | ); |
1396 | 1396 | $starthalfday = ($this->halfday == -1 || $this->halfday == 2) ? 'afternoon' : 'morning'; |
1397 | 1397 | $endhalfday = ($this->halfday == 1 || $this->halfday == 2) ? 'morning' : 'afternoon'; |
1398 | - $datas['date_start'] = '<br><b>'.$langs->trans('DateDebCP') . '</b>: '. dol_print_date($this->date_debut, 'day') . ' <span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>'; |
|
1399 | - $datas['date_end'] = '<br><b>'.$langs->trans('DateFinCP') . '</b>: '. dol_print_date($this->date_fin, 'day') . ' <span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>'; |
|
1398 | + $datas['date_start'] = '<br><b>'.$langs->trans('DateDebCP').'</b>: '.dol_print_date($this->date_debut, 'day').' <span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>'; |
|
1399 | + $datas['date_end'] = '<br><b>'.$langs->trans('DateFinCP').'</b>: '.dol_print_date($this->date_fin, 'day').' <span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>'; |
|
1400 | 1400 | } |
1401 | 1401 | |
1402 | 1402 | |
@@ -1477,7 +1477,7 @@ discard block |
||
1477 | 1477 | $result .= $linkend; |
1478 | 1478 | |
1479 | 1479 | global $action; |
1480 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1480 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1481 | 1481 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
1482 | 1482 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
1483 | 1483 | if ($reshook > 0) { |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | $now = dol_now(); |
1679 | 1679 | |
1680 | 1680 | // Get month of last update |
1681 | - $stringInDBForLastUpdate = $this->getConfCP('lastUpdate', dol_print_date($now, '%Y%m%d%H%M%S')); // Example '20200101120000' |
|
1681 | + $stringInDBForLastUpdate = $this->getConfCP('lastUpdate', dol_print_date($now, '%Y%m%d%H%M%S')); // Example '20200101120000' |
|
1682 | 1682 | // Protection when $lastUpdate has a not valid value |
1683 | 1683 | if ($stringInDBForLastUpdate < '20000101000000') { |
1684 | 1684 | $stringInDBForLastUpdate = '20000101000000'; |
@@ -2367,7 +2367,7 @@ discard block |
||
2367 | 2367 | $sql = "SELECT rowid, code, label, affect, delay, newbymonth"; |
2368 | 2368 | $sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types"; |
2369 | 2369 | $sql .= " WHERE (fk_country IS NULL OR fk_country = ".((int) $mysoc->country_id).')'; |
2370 | - $sql .= " AND entity IN (0, ".getEntity('c_holiday_types').")"; // Need entity 0 (holiday types common to all countries= + current entity). |
|
2370 | + $sql .= " AND entity IN (0, ".getEntity('c_holiday_types').")"; // Need entity 0 (holiday types common to all countries= + current entity). |
|
2371 | 2371 | if ($active >= 0) { |
2372 | 2372 | $sql .= " AND active = ".((int) $active); |
2373 | 2373 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | 'linkedObjectsIds', |
465 | 465 | 'linkedObjects', |
466 | 466 | 'fk_delivery_address', |
467 | - 'projet', // There is already ->fk_project |
|
467 | + 'projet', // There is already ->fk_project |
|
468 | 468 | 'restrictiononfksoc', |
469 | 469 | 'specimen', |
470 | 470 | ); |
@@ -809,10 +809,10 @@ discard block |
||
809 | 809 | if ($resql) { |
810 | 810 | $obj = $this->db->fetch_object($resql); |
811 | 811 | if ($obj) { |
812 | - $this->id = $obj->rowid; |
|
813 | - $this->entity = $obj->entity; |
|
812 | + $this->id = $obj->rowid; |
|
813 | + $this->entity = $obj->entity; |
|
814 | 814 | |
815 | - $this->date_creation = $this->db->jdate($obj->date_creation); |
|
815 | + $this->date_creation = $this->db->jdate($obj->date_creation); |
|
816 | 816 | $this->date_modification = $this->db->jdate($obj->tms); |
817 | 817 | |
818 | 818 | $this->amounts = (float) $obj->amounts; |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | $this->object_version = $obj->object_version; |
831 | 831 | |
832 | 832 | $this->signature = $obj->signature; |
833 | - $this->signature_line = $obj->signature_line; |
|
833 | + $this->signature_line = $obj->signature_line; |
|
834 | 834 | $this->certified = ($obj->certified == 1); |
835 | 835 | |
836 | 836 | return 1; |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | |
951 | 951 | $previoushash = $this->getPreviousHash(1, 0); // This get last record and lock database until insert is done and transaction closed |
952 | 952 | |
953 | - $keyforsignature = $this->buildKeyForSignature(); // All the information for the hash (meta data + data saved) |
|
953 | + $keyforsignature = $this->buildKeyForSignature(); // All the information for the hash (meta data + data saved) |
|
954 | 954 | |
955 | 955 | $this->debuginfo = $this->buildFirstPartOfKeyForSignature(); |
956 | 956 | |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | $sql .= " fk_user,"; |
980 | 980 | $sql .= " user_fullname,"; |
981 | 981 | $sql .= " entity,"; |
982 | - $sql .= " debuginfo"; // Only stored |
|
982 | + $sql .= " debuginfo"; // Only stored |
|
983 | 983 | $sql .= ") VALUES ("; |
984 | 984 | $sql .= "'".$this->db->idate($this->date_creation)."',"; |
985 | 985 | $sql .= "'".$this->db->escape($this->action)."',"; |