@@ -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]; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | $gitcommit = 'seetag'; |
155 | -$branchname = preg_replace('/^(\d+\.\d+)\..*$/', '\1', $release); // Keep only x.y into x.y.z |
|
155 | +$branchname = preg_replace('/^(\d+\.\d+)\..*$/', '\1', $release); // Keep only x.y into x.y.z |
|
156 | 156 | $fileforgit = dirname(dirname(dirname(__FILE__))).'/.git/refs/heads/'.$branchname; |
157 | 157 | print "Try to get last commit ID from file ".$fileforgit."\n"; |
158 | 158 | $fileforgitcontent = file_get_contents($fileforgit); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | // Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php) |
182 | 182 | $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)$'; |
183 | -$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 |
|
183 | +$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 |
|
184 | 184 | $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
185 | 185 | |
186 | 186 | $dir = ''; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n"); |
224 | 224 | |
225 | 225 | $regextoinclude = '\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; |
226 | -$regextoexclude = '(custom|documents|conf|install)$'; // Exclude dirs |
|
226 | +$regextoexclude = '(custom|documents|conf|install)$'; // Exclude dirs |
|
227 | 227 | $files = dol_dir_list(dirname(__FILE__).'/../../scripts/', 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
228 | 228 | $dir = ''; |
229 | 229 | foreach ($files as $filetmp) { |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | fputs($fp, '<dolibarr_unalterable_files version="'.$release.'">'."\n"); |
265 | 265 | |
266 | 266 | $regextoinclude = '(\.php|\.sql)$'; |
267 | -$regextoexclude = ''; // Exclude dirs |
|
267 | +$regextoexclude = ''; // Exclude dirs |
|
268 | 268 | $files = dol_dir_list(dirname(__FILE__).'/../../htdocs/blockedlog', 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); |
269 | 269 | $dir = ''; |
270 | 270 | foreach ($files as $filetmp) { |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | } |
293 | 293 | // Add the SQL file |
294 | 294 | $regextoinclude = 'llx_blockedlog.*(\.php|\.sql)$'; |
295 | -$regextoexclude = ''; // Exclude dirs |
|
295 | +$regextoexclude = ''; // Exclude dirs |
|
296 | 296 | $files = dol_dir_list(dirname(__FILE__).'/../../htdocs/install/mysql/tables', 'files', 0, $regextoinclude, $regextoexclude, 'fullname'); |
297 | 297 | foreach ($files as $filetmp) { |
298 | 298 | $file = $filetmp['fullname']; |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | |
452 | 452 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
453 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
453 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
454 | 454 | $selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : ''); |
455 | 455 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
456 | 456 | |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | } 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'])) { |
541 | 541 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
542 | 542 | } |
543 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
543 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
544 | 544 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
545 | 545 | 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"; |
546 | 546 | $totalarray['nbfield']++; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // Parameters |
55 | 55 | $value = GETPOST('value', 'alpha'); |
56 | 56 | $action = GETPOST('action', 'aZ09'); |
57 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
57 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
58 | 58 | |
59 | 59 | $label = GETPOST('label', 'alpha'); |
60 | 60 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | print(empty($module->name) ? $name : $module->name); |
474 | 474 | print "</td><td>\n"; |
475 | 475 | if (method_exists($module, 'info')) { |
476 | - print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
476 | + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
477 | 477 | } else { |
478 | 478 | print $module->description; |
479 | 479 | } |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | print '<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_FROM" class="block">'.$langs->trans("TicketEmailNotificationFrom").'</label></td>'; |
661 | 661 | print '<td class="left">'; |
662 | 662 | print img_picto('', 'email', 'class="pictofixedwidth"'); |
663 | -print '<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_FROM" name="TICKET_NOTIFICATION_EMAIL_FROM" value="' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'"></td>'; |
|
663 | +print '<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_FROM" name="TICKET_NOTIFICATION_EMAIL_FROM" value="'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'"></td>'; |
|
664 | 664 | print '<td class="center">'; |
665 | 665 | print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), 1, 'help'); |
666 | 666 | print '</td>'; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | print '<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_REPLYTO" class="block">'.$langs->trans("TicketEmailNotificationReplyTo").'</label></td>'; |
671 | 671 | print '<td class="left">'; |
672 | 672 | print img_picto('', 'email', 'class="pictofixedwidth"'); |
673 | -print '<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_REPLYTO" name="TICKET_NOTIFICATION_EMAIL_REPLYTO" value="' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO').'"></td>'; |
|
673 | +print '<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_REPLYTO" name="TICKET_NOTIFICATION_EMAIL_REPLYTO" value="'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO').'"></td>'; |
|
674 | 674 | print '<td class="center">'; |
675 | 675 | print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationReplyToHelp"), 1, 'help'); |
676 | 676 | print '</td>'; |
@@ -594,8 +594,8 @@ discard block |
||
594 | 594 | $sql .= " WHERE u.rowid = ".((int) $id); |
595 | 595 | } else { |
596 | 596 | if ($entity < 0) { |
597 | - if ((! isModEnabled('multicompany') || ! getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (! empty($user->entity))) { |
|
598 | - $sql .= " WHERE u.entity IN (0, " . ((int) $conf->entity) . ")"; |
|
597 | + if ((!isModEnabled('multicompany') || !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (!empty($user->entity))) { |
|
598 | + $sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")"; |
|
599 | 599 | } else { |
600 | 600 | $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database |
601 | 601 | } |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | if ($entity != '' && $entity == 0) { // If $entity = 0 |
608 | 608 | $sql .= " WHERE u.entity = 0"; |
609 | 609 | } else { // if $entity is -1 or > 0 |
610 | - $sql .= " WHERE u.entity IN (0, " . ((int) ($entity > 0 ? $entity : $conf->entity)) . ")"; |
|
610 | + $sql .= " WHERE u.entity IN (0, ".((int) ($entity > 0 ? $entity : $conf->entity)).")"; |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | } |
@@ -668,11 +668,11 @@ discard block |
||
668 | 668 | $this->pass_indatabase = $obj->pass; |
669 | 669 | $this->pass_indatabase_crypted = $obj->pass_crypted; |
670 | 670 | $this->pass = $obj->pass; |
671 | - $this->pass_temp = $obj->pass_temp; |
|
671 | + $this->pass_temp = $obj->pass_temp; |
|
672 | 672 | $this->datelastpassvalidation = $obj->datelastpassvalidation; |
673 | 673 | $this->api_key = dolDecrypt($obj->api_key); |
674 | 674 | |
675 | - $this->address = $obj->address; |
|
675 | + $this->address = $obj->address; |
|
676 | 676 | $this->zip = $obj->zip; |
677 | 677 | $this->town = $obj->town; |
678 | 678 | |
@@ -695,11 +695,11 @@ discard block |
||
695 | 695 | |
696 | 696 | $this->job = $obj->job; |
697 | 697 | $this->signature = $obj->signature; |
698 | - $this->admin = $obj->admin; |
|
698 | + $this->admin = $obj->admin; |
|
699 | 699 | $this->note_public = $obj->note_public; |
700 | 700 | $this->note_private = $obj->note_private; |
701 | 701 | |
702 | - $this->statut = $obj->status; // deprecated |
|
702 | + $this->statut = $obj->status; // deprecated |
|
703 | 703 | $this->status = $obj->status; |
704 | 704 | |
705 | 705 | $this->photo = $obj->photo; |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php'; |
838 | 838 | |
839 | 839 | $defaultValues = new DefaultValues($this->db); |
840 | - $result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined) |
|
840 | + $result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined) |
|
841 | 841 | //$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity))); // User 0 (all) + me (if defined) |
842 | 842 | |
843 | 843 | if (!is_array($result) && $result < 0) { |
@@ -954,16 +954,16 @@ discard block |
||
954 | 954 | // Special case for external user |
955 | 955 | if (!empty($this->socid)) { |
956 | 956 | if ($module == 'societe' && ($permlevel1 == 'creer' || $permlevel1 == 'write')) { |
957 | - return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself) |
|
957 | + return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself) |
|
958 | 958 | } |
959 | 959 | if ($module == 'societe' && $permlevel1 == 'client' && $permlevel2 == 'voir') { |
960 | - return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself) |
|
960 | + return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself) |
|
961 | 961 | } |
962 | 962 | if ($module == 'societe' && $permlevel1 == 'export') { |
963 | - return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself) |
|
963 | + return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself) |
|
964 | 964 | } |
965 | 965 | if ($module == 'societe' && ($permlevel1 == 'supprimer' || $permlevel1 == 'delete')) { |
966 | - return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself) |
|
966 | + return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself) |
|
967 | 967 | } |
968 | 968 | } |
969 | 969 | |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | $sql .= " FROM ".$this->db->prefix()."rights_def"; |
1112 | 1112 | $sql .= " WHERE entity = ".((int) $entity); |
1113 | 1113 | if (!empty($whereforadd) && $whereforadd != 'allmodules') { |
1114 | - $sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized |
|
1114 | + $sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | 1117 | $sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights"; |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | $sql .= " FROM ".$this->db->prefix()."rights_def"; |
1248 | 1248 | $sql .= " WHERE entity IN (".$this->db->sanitize($entity, 0, 0, 0, 0).")"; |
1249 | 1249 | if (!empty($wherefordel) && $wherefordel != 'allmodules') { |
1250 | - $sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized |
|
1250 | + $sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized |
|
1251 | 1251 | } |
1252 | 1252 | |
1253 | 1253 | // avoid admin to remove his own important rights |
@@ -1426,12 +1426,12 @@ discard block |
||
1426 | 1426 | $sql .= " AND r.entity = ".((int) $conf->entity); |
1427 | 1427 | } |
1428 | 1428 | } else { |
1429 | - $sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity |
|
1429 | + $sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity |
|
1430 | 1430 | // The entity on the table gu=usergroup_user should be useless and should never be used because it is already into gr and r. |
1431 | 1431 | // but when using MULTICOMPANY_TRANSVERSE_MODE, we may have inserted record that make rubbish result here due to the duplicate record of |
1432 | 1432 | // other entities, so we are forced to add a filter on gu here |
1433 | 1433 | $sql .= " AND gu.entity IN (0,".$conf->entity.")"; |
1434 | - $sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity |
|
1434 | + $sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity |
|
1435 | 1435 | } |
1436 | 1436 | // End of strange business rule |
1437 | 1437 | $sql .= " AND gr.fk_usergroup = gu.fk_usergroup"; |
@@ -1984,7 +1984,7 @@ discard block |
||
1984 | 1984 | $this->civility_code = $member->civility_code; |
1985 | 1985 | $this->lastname = $member->lastname; |
1986 | 1986 | $this->firstname = $member->firstname; |
1987 | - $this->gender = $member->gender; |
|
1987 | + $this->gender = $member->gender; |
|
1988 | 1988 | $this->email = $member->email; |
1989 | 1989 | $this->fk_member = $member->id; |
1990 | 1990 | $this->address = $member->address; |
@@ -2127,45 +2127,45 @@ discard block |
||
2127 | 2127 | $this->lastname = trim((string) $this->lastname); |
2128 | 2128 | $this->firstname = trim((string) $this->firstname); |
2129 | 2129 | $this->ref_employee = trim((string) $this->ref_employee); |
2130 | - $this->national_registration_number = trim((string) $this->national_registration_number); |
|
2130 | + $this->national_registration_number = trim((string) $this->national_registration_number); |
|
2131 | 2131 | $this->employee = ($this->employee > 0 ? $this->employee : 0); |
2132 | 2132 | $this->login = trim((string) $this->login); |
2133 | - $this->gender = trim((string) $this->gender); |
|
2133 | + $this->gender = trim((string) $this->gender); |
|
2134 | 2134 | |
2135 | 2135 | $this->pass = trim((string) $this->pass); |
2136 | - $this->api_key = trim((string) $this->api_key); |
|
2137 | - $this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity; |
|
2138 | - $this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity; |
|
2136 | + $this->api_key = trim((string) $this->api_key); |
|
2137 | + $this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity; |
|
2138 | + $this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity; |
|
2139 | 2139 | |
2140 | - $this->address = trim((string) $this->address); |
|
2141 | - $this->zip = trim((string) $this->zip); |
|
2142 | - $this->town = trim((string) $this->town); |
|
2140 | + $this->address = trim((string) $this->address); |
|
2141 | + $this->zip = trim((string) $this->zip); |
|
2142 | + $this->town = trim((string) $this->town); |
|
2143 | 2143 | |
2144 | - $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); |
|
2144 | + $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); |
|
2145 | 2145 | $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); |
2146 | - $this->office_phone = trim((string) $this->office_phone); |
|
2146 | + $this->office_phone = trim((string) $this->office_phone); |
|
2147 | 2147 | $this->office_fax = trim((string) $this->office_fax); |
2148 | - $this->user_mobile = trim((string) $this->user_mobile); |
|
2149 | - $this->personal_mobile = trim((string) $this->personal_mobile); |
|
2150 | - $this->email = trim((string) $this->email); |
|
2151 | - $this->personal_email = trim((string) $this->personal_email); |
|
2152 | - |
|
2153 | - $this->job = trim((string) $this->job); |
|
2154 | - $this->signature = trim((string) $this->signature); |
|
2155 | - $this->note_public = trim((string) $this->note_public); |
|
2156 | - $this->note_private = trim((string) $this->note_private); |
|
2157 | - $this->openid = trim((string) $this->openid); |
|
2158 | - $this->admin = ($this->admin > 0 ? $this->admin : 0); |
|
2159 | - |
|
2160 | - $this->accountancy_code_user_general = trim((string) $this->accountancy_code_user_general); |
|
2148 | + $this->user_mobile = trim((string) $this->user_mobile); |
|
2149 | + $this->personal_mobile = trim((string) $this->personal_mobile); |
|
2150 | + $this->email = trim((string) $this->email); |
|
2151 | + $this->personal_email = trim((string) $this->personal_email); |
|
2152 | + |
|
2153 | + $this->job = trim((string) $this->job); |
|
2154 | + $this->signature = trim((string) $this->signature); |
|
2155 | + $this->note_public = trim((string) $this->note_public); |
|
2156 | + $this->note_private = trim((string) $this->note_private); |
|
2157 | + $this->openid = trim((string) $this->openid); |
|
2158 | + $this->admin = ($this->admin > 0 ? $this->admin : 0); |
|
2159 | + |
|
2160 | + $this->accountancy_code_user_general = trim((string) $this->accountancy_code_user_general); |
|
2161 | 2161 | $this->accountancy_code = trim((string) $this->accountancy_code); |
2162 | - $this->color = trim((string) $this->color); |
|
2163 | - $this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment; |
|
2162 | + $this->color = trim((string) $this->color); |
|
2163 | + $this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment; |
|
2164 | 2164 | $this->dateemploymentend = empty($this->dateemploymentend) ? '' : $this->dateemploymentend; |
2165 | 2165 | |
2166 | - $this->birth = empty($this->birth) ? '' : $this->birth; |
|
2167 | - $this->fk_warehouse = (int) $this->fk_warehouse; |
|
2168 | - $this->fk_establishment = (int) $this->fk_establishment; |
|
2166 | + $this->birth = empty($this->birth) ? '' : $this->birth; |
|
2167 | + $this->fk_warehouse = (int) $this->fk_warehouse; |
|
2168 | + $this->fk_establishment = (int) $this->fk_establishment; |
|
2169 | 2169 | |
2170 | 2170 | $this->setUpperOrLowerCase(); |
2171 | 2171 | |
@@ -2930,7 +2930,7 @@ discard block |
||
2930 | 2930 | $sql .= " WHERE fk_user = ".((int) $this->id); |
2931 | 2931 | $sql .= " AND fk_usergroup = ".((int) $group); |
2932 | 2932 | if (empty($entity)) { |
2933 | - $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. |
|
2933 | + $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. |
|
2934 | 2934 | } else { |
2935 | 2935 | $sql .= " AND entity = ".((int) $entity); |
2936 | 2936 | } |
@@ -3191,7 +3191,7 @@ discard block |
||
3191 | 3191 | $linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"'; |
3192 | 3192 | } |
3193 | 3193 | $linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"'); |
3194 | - $linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
|
3194 | + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
|
3195 | 3195 | } else { |
3196 | 3196 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
3197 | 3197 | } |
@@ -3430,11 +3430,11 @@ discard block |
||
3430 | 3430 | global $conf; |
3431 | 3431 | $dn = ''; |
3432 | 3432 | if ($mode == 0) { |
3433 | - $dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN'); |
|
3433 | + $dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN'); |
|
3434 | 3434 | } elseif ($mode == 1) { |
3435 | 3435 | $dn = getDolGlobalString('LDAP_USER_DN'); |
3436 | 3436 | } elseif ($mode == 2) { |
3437 | - $dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]; |
|
3437 | + $dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')]; |
|
3438 | 3438 | } |
3439 | 3439 | return $dn; |
3440 | 3440 | } |
@@ -3649,7 +3649,7 @@ discard block |
||
3649 | 3649 | $this->iplastlogin = '127.0.0.1'; |
3650 | 3650 | $this->datepreviouslogin = $now; |
3651 | 3651 | $this->ippreviouslogin = '127.0.0.1'; |
3652 | - $this->statut = 1; // deprecated |
|
3652 | + $this->statut = 1; // deprecated |
|
3653 | 3653 | $this->status = 1; |
3654 | 3654 | |
3655 | 3655 | $this->entity = 1; |
@@ -3907,7 +3907,7 @@ discard block |
||
3907 | 3907 | $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
3908 | 3908 | } |
3909 | 3909 | if ($filter) { |
3910 | - $sql .= " AND ".$filter; // already sanitized |
|
3910 | + $sql .= " AND ".$filter; // already sanitized |
|
3911 | 3911 | } |
3912 | 3912 | |
3913 | 3913 | dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG); |
@@ -4241,8 +4241,8 @@ discard block |
||
4241 | 4241 | $sql .= " WHERE t.entity IS NOT NULL"; // Show all users |
4242 | 4242 | } else { |
4243 | 4243 | $sql .= " WHERE t.entity = 0 OR EXISTS ("; |
4244 | - $sql .= " SELECT ug.rowid FROM " . $this->db->prefix() . "usergroup_user as ug"; |
|
4245 | - $sql .= " WHERE ug.fk_user = t.rowid AND ug.entity IN (" . getEntity('usergroup') . "))"; |
|
4244 | + $sql .= " SELECT ug.rowid FROM ".$this->db->prefix()."usergroup_user as ug"; |
|
4245 | + $sql .= " WHERE ug.fk_user = t.rowid AND ug.entity IN (".getEntity('usergroup')."))"; |
|
4246 | 4246 | } |
4247 | 4247 | } else { |
4248 | 4248 | $sql .= " WHERE t.entity IN (".getEntity('user').")"; |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | $project->fetch((int) $selected); |
108 | 108 | $selected_input_value = $project->ref; |
109 | 109 | } |
110 | - $urloption = 'socid=' . ((int) $socid) . '&htmlname=' . urlencode($htmlname) . '&discardclosed=' . ((int) $discard_closed); |
|
110 | + $urloption = 'socid='.((int) $socid).'&htmlname='.urlencode($htmlname).'&discardclosed='.((int) $discard_closed); |
|
111 | 111 | if ($morefilter == 'usage_organize_event=1') { |
112 | 112 | $urloption .= '&usage_organize_event=1'; |
113 | 113 | } |
114 | - $out .= '<input type="text" class="minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' />'; |
|
114 | + $out .= '<input type="text" class="minwidth200'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />'; |
|
115 | 115 | |
116 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT'), 0, array()); |
|
116 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT'), 0, array()); |
|
117 | 117 | } else { |
118 | 118 | $out .= $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss, $morefilter); |
119 | 119 | } |
@@ -184,26 +184,26 @@ discard block |
||
184 | 184 | |
185 | 185 | // Search all projects |
186 | 186 | $sql = "SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias"; |
187 | - $sql .= " FROM " . $this->db->prefix() . "projet as p LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc"; |
|
188 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
187 | + $sql .= " FROM ".$this->db->prefix()."projet as p LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc"; |
|
188 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
189 | 189 | if ($projectsListId !== false) { |
190 | - $sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")"; |
|
190 | + $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
|
191 | 191 | } |
192 | 192 | if ($socid == 0) { |
193 | 193 | $sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
194 | 194 | } |
195 | 195 | if ($socid > 0) { |
196 | 196 | if (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) { |
197 | - $sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)"; |
|
197 | + $sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)"; |
|
198 | 198 | } elseif (getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') != 'all') { // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. |
199 | - $sql .= " AND (p.fk_soc IN (" . $this->db->sanitize(((int) $socid) . ", " . getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')) . ") OR p.fk_soc IS NULL)"; |
|
199 | + $sql .= " AND (p.fk_soc IN (".$this->db->sanitize(((int) $socid).", ".getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY')).") OR p.fk_soc IS NULL)"; |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 | if (!empty($filterkey)) { |
203 | 203 | $sql .= natural_search(array('p.title', 'p.ref'), $filterkey); |
204 | 204 | } |
205 | 205 | if ($morefilter) { |
206 | - $sql .= ' AND (' . $this->db->sanitize($morefilter, 0, 1) . ')'; |
|
206 | + $sql .= ' AND ('.$this->db->sanitize($morefilter, 0, 1).')'; |
|
207 | 207 | } |
208 | 208 | $sql .= " ORDER BY p.ref ASC"; |
209 | 209 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $morecss .= ' minwidth100'; |
214 | 214 | } |
215 | 215 | if (empty($option_only)) { |
216 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlid . '" name="' . $htmlname . '">'; |
|
216 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlid.'" name="'.$htmlname.'">'; |
|
217 | 217 | } |
218 | 218 | if (!empty($show_empty)) { |
219 | 219 | if (is_numeric($show_empty)) { |
@@ -239,37 +239,37 @@ discard block |
||
239 | 239 | $labeltoshow = dol_trunc($obj->ref, 18); |
240 | 240 | //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; |
241 | 241 | //else $labeltoshow.=' ('.$langs->trans("Private").')'; |
242 | - $labeltoshow .= ', ' . dol_trunc($obj->title, $maxlength); |
|
242 | + $labeltoshow .= ', '.dol_trunc($obj->title, $maxlength); |
|
243 | 243 | if ($obj->name) { |
244 | - $labeltoshow .= ' - ' . $obj->name; |
|
244 | + $labeltoshow .= ' - '.$obj->name; |
|
245 | 245 | if ($obj->name_alias) { |
246 | - $labeltoshow .= ' (' . $obj->name_alias . ')'; |
|
246 | + $labeltoshow .= ' ('.$obj->name_alias.')'; |
|
247 | 247 | } |
248 | 248 | } |
249 | 249 | |
250 | 250 | $disabled = 0; |
251 | 251 | if ($obj->fk_statut == 0) { |
252 | 252 | $disabled = 1; |
253 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
253 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
254 | 254 | } elseif ($obj->fk_statut == 2) { |
255 | 255 | if ($discard_closed == 2) { |
256 | 256 | $disabled = 1; |
257 | 257 | } |
258 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
258 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
259 | 259 | } elseif (!getDolGlobalString('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY') && $socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
260 | 260 | $disabled = 1; |
261 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
261 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | if (!empty($selected) && $selected == $obj->rowid) { |
265 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
265 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
266 | 266 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
267 | - $out .= '>' . $labeltoshow . '</option>'; |
|
267 | + $out .= '>'.$labeltoshow.'</option>'; |
|
268 | 268 | } else { |
269 | 269 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
270 | 270 | $resultat = ''; |
271 | 271 | } else { |
272 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
272 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
273 | 273 | if ($disabled) { |
274 | 274 | $resultat .= ' disabled'; |
275 | 275 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | 'value' => $obj->ref, |
287 | 287 | 'ref' => $obj->ref, |
288 | 288 | 'labelx' => $labeltoshow, |
289 | - 'label' => ($disabled ? '<span class="opacitymedium">' . $labeltoshow . '</span>' : $labeltoshow), |
|
289 | + 'label' => ($disabled ? '<span class="opacitymedium">'.$labeltoshow.'</span>' : $labeltoshow), |
|
290 | 290 | 'disabled' => (bool) $disabled |
291 | 291 | ); |
292 | 292 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | // Use select2 selector |
306 | 306 | if (!empty($conf->use_javascript_ajax)) { |
307 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
307 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
308 | 308 | $comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus); |
309 | 309 | $out .= $comboenhancement; |
310 | 310 | $morecss .= ' minwidth100'; |
@@ -373,19 +373,19 @@ discard block |
||
373 | 373 | $sql = "SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,"; |
374 | 374 | $sql .= " p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,"; |
375 | 375 | $sql .= " s.nom as name"; |
376 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
377 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc,"; |
|
378 | - $sql .= " " . $this->db->prefix() . "projet_task as t"; |
|
379 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
376 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
377 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc,"; |
|
378 | + $sql .= " ".$this->db->prefix()."projet_task as t"; |
|
379 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
380 | 380 | $sql .= " AND t.fk_projet = p.rowid"; |
381 | 381 | if ($projectsListId) { |
382 | - $sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")"; |
|
382 | + $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
|
383 | 383 | } |
384 | 384 | if ($socid == 0) { |
385 | 385 | $sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
386 | 386 | } |
387 | 387 | if ($socid > 0) { |
388 | - $sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)"; |
|
388 | + $sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)"; |
|
389 | 389 | } |
390 | 390 | $sql .= " ORDER BY p.ref, t.ref ASC"; |
391 | 391 | |
@@ -393,14 +393,14 @@ discard block |
||
393 | 393 | if ($resql) { |
394 | 394 | // Use select2 selector |
395 | 395 | if (empty($option_only) && !empty($conf->use_javascript_ajax)) { |
396 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
396 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
397 | 397 | $comboenhancement = ajax_combobox($htmlname, [], 0, $forcefocus); |
398 | 398 | $out .= $comboenhancement; |
399 | 399 | $morecss .= ' minwidth150imp'; |
400 | 400 | } |
401 | 401 | |
402 | 402 | if (empty($option_only)) { |
403 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'."\n"; |
|
403 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'."\n"; |
|
404 | 404 | } |
405 | 405 | if (!empty($show_empty)) { |
406 | 406 | $out .= '<option value="0" class="optiongrey">'; |
@@ -446,58 +446,58 @@ discard block |
||
446 | 446 | $labeltoshow .= dol_trunc($obj->ref, 18); // Project ref |
447 | 447 | //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; |
448 | 448 | //else $labeltoshow.=' ('.$langs->trans("Private").')'; |
449 | - $labeltoshow .= ' ' . dol_trunc($obj->title, $maxlength); |
|
449 | + $labeltoshow .= ' '.dol_trunc($obj->title, $maxlength); |
|
450 | 450 | $labeltoshowhtml = $labeltoshow; |
451 | 451 | |
452 | 452 | if ($obj->name) { |
453 | - $labeltoshow .= ' (' . $obj->name . ')'; |
|
454 | - $labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->name . ')</span>'; |
|
453 | + $labeltoshow .= ' ('.$obj->name.')'; |
|
454 | + $labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->name.')</span>'; |
|
455 | 455 | } |
456 | 456 | |
457 | 457 | $disabled = 0; |
458 | 458 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
459 | 459 | $disabled = 1; |
460 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
461 | - $labeltoshowhtml .= ' - <span class="opacitymedium">' . $langs->trans("Draft") . '</span>'; |
|
460 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
461 | + $labeltoshowhtml .= ' - <span class="opacitymedium">'.$langs->trans("Draft").'</span>'; |
|
462 | 462 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
463 | 463 | if ($discard_closed == 2) { |
464 | 464 | $disabled = 1; |
465 | 465 | } |
466 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
467 | - $labeltoshowhtml .= ' - <span class="opacitymedium">' . $langs->trans("Closed") . '</span>'; |
|
466 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
467 | + $labeltoshowhtml .= ' - <span class="opacitymedium">'.$langs->trans("Closed").'</span>'; |
|
468 | 468 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
469 | 469 | $disabled = 1; |
470 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
471 | - $labeltoshowhtml .= ' - <span class="opacitymedium">' . $langs->trans("LinkedToAnotherCompany") . '</span>'; |
|
470 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
471 | + $labeltoshowhtml .= ' - <span class="opacitymedium">'.$langs->trans("LinkedToAnotherCompany").'</span>'; |
|
472 | 472 | } |
473 | 473 | $labeltoshow .= ' - '; |
474 | 474 | $labeltoshowhtml .= ' - '; |
475 | 475 | } |
476 | 476 | |
477 | 477 | // Label for task |
478 | - $labeltoshow .= $obj->tref . ' ' . dol_trunc($obj->tlabel, $maxlength); |
|
479 | - $labeltoshowhtml .= $obj->tref . ' - ' . dol_trunc($obj->tlabel, $maxlength); |
|
478 | + $labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength); |
|
479 | + $labeltoshowhtml .= $obj->tref.' - '.dol_trunc($obj->tlabel, $maxlength); |
|
480 | 480 | if ($obj->usage_task && preg_match('/progress/', $showmore)) { |
481 | - $labeltoshow .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>'; |
|
482 | - $labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>'; |
|
481 | + $labeltoshow .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>'; |
|
482 | + $labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>'; |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | if (!empty($selected) && $selected == $obj->rowid) { |
486 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
487 | - $out .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"'; |
|
486 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
487 | + $out .= ' data-html="'.dol_escape_htmltag($labeltoshowhtml).'"'; |
|
488 | 488 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
489 | - $out .= '>' . $labeltoshow . '</option>'."\n"; |
|
489 | + $out .= '>'.$labeltoshow.'</option>'."\n"; |
|
490 | 490 | } else { |
491 | 491 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
492 | 492 | $resultat = ''; |
493 | 493 | } else { |
494 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
494 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
495 | 495 | if ($disabled) { |
496 | 496 | $resultat .= ' disabled'; |
497 | 497 | } |
498 | 498 | //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')'; |
499 | 499 | //else $labeltoshow.=' ('.$langs->trans("Private").')'; |
500 | - $resultat .= ' data-html="' . dol_escape_htmltag($labeltoshowhtml) . '"'; |
|
500 | + $resultat .= ' data-html="'.dol_escape_htmltag($labeltoshowhtml).'"'; |
|
501 | 501 | $resultat .= '>'; |
502 | 502 | $resultat .= $labeltoshow; |
503 | 503 | $resultat .= '</option>'."\n"; |
@@ -623,30 +623,30 @@ discard block |
||
623 | 623 | if ($linkedtothirdparty) { |
624 | 624 | $sql .= ", s.nom as name"; |
625 | 625 | } |
626 | - $sql .= " FROM " . $this->db->prefix() . $table_element . " as t"; |
|
626 | + $sql .= " FROM ".$this->db->prefix().$table_element." as t"; |
|
627 | 627 | if ($linkedtothirdparty) { |
628 | - $sql .= ", " . $this->db->prefix() . "societe as s"; |
|
628 | + $sql .= ", ".$this->db->prefix()."societe as s"; |
|
629 | 629 | } |
630 | - $sql .= " WHERE " . $projectkey . " is null"; |
|
630 | + $sql .= " WHERE ".$projectkey." is null"; |
|
631 | 631 | if (!empty($socid) && $linkedtothirdparty) { |
632 | 632 | if (is_numeric($socid)) { |
633 | - $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
633 | + $sql .= " AND t.fk_soc = ".((int) $socid); |
|
634 | 634 | } else { |
635 | - $sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socid) . ")"; |
|
635 | + $sql .= " AND t.fk_soc IN (".$this->db->sanitize($socid).")"; |
|
636 | 636 | } |
637 | 637 | } |
638 | 638 | if (!in_array($table_element, array('expensereport_det', 'stock_mouvement'))) { |
639 | - $sql .= ' AND t.entity IN (' . getEntity('project') . ')'; |
|
639 | + $sql .= ' AND t.entity IN ('.getEntity('project').')'; |
|
640 | 640 | } |
641 | 641 | if ($linkedtothirdparty) { |
642 | 642 | $sql .= " AND s.rowid = t.fk_soc"; |
643 | 643 | } |
644 | 644 | if ($sqlfilter) { |
645 | - $sql .= " AND " . $sqlfilter; |
|
645 | + $sql .= " AND ".$sqlfilter; |
|
646 | 646 | } |
647 | 647 | $sql .= " ORDER BY ref DESC"; |
648 | 648 | |
649 | - dol_syslog(get_class($this) . '::select_element', LOG_DEBUG); |
|
649 | + dol_syslog(get_class($this).'::select_element', LOG_DEBUG); |
|
650 | 650 | $resql = $this->db->query($sql); |
651 | 651 | if ($resql) { |
652 | 652 | $num = $this->db->num_rows($resql); |
@@ -654,18 +654,18 @@ discard block |
||
654 | 654 | $sellist = ''; |
655 | 655 | |
656 | 656 | if ($num > 0) { |
657 | - $sellist = '<select class="flat elementselect css' . $table_element . ($morecss ? ' ' . $morecss : '') . '" name="elementselect">'; |
|
658 | - $sellist .= '<option value="-1"' . ($placeholder ? ' class="optiongrey"' : '') . '>' . $placeholder . '</option>'; |
|
657 | + $sellist = '<select class="flat elementselect css'.$table_element.($morecss ? ' '.$morecss : '').'" name="elementselect">'; |
|
658 | + $sellist .= '<option value="-1"'.($placeholder ? ' class="optiongrey"' : '').'>'.$placeholder.'</option>'; |
|
659 | 659 | while ($i < $num) { |
660 | 660 | $obj = $this->db->fetch_object($resql); |
661 | 661 | $ref = $obj->ref ? $obj->ref : $obj->rowid; |
662 | 662 | if (!empty($obj->ref_supplier)) { |
663 | - $ref .= ' (' . $obj->ref_supplier . ')'; |
|
663 | + $ref .= ' ('.$obj->ref_supplier.')'; |
|
664 | 664 | } |
665 | 665 | if (!empty($obj->name)) { |
666 | - $ref .= ' - ' . $obj->name; |
|
666 | + $ref .= ' - '.$obj->name; |
|
667 | 667 | } |
668 | - $sellist .= '<option value="' . $obj->rowid . '">' . $ref . '</option>'; |
|
668 | + $sellist .= '<option value="'.$obj->rowid.'">'.$ref.'</option>'; |
|
669 | 669 | $i++; |
670 | 670 | } |
671 | 671 | $sellist .= '</select>'; |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | dol_print_error($this->db); |
684 | 684 | $this->error = $this->db->lasterror(); |
685 | 685 | $this->errors[] = $this->db->lasterror(); |
686 | - dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR); |
|
686 | + dol_syslog(get_class($this)."::select_element ".$this->error, LOG_ERR); |
|
687 | 687 | return -1; |
688 | 688 | } |
689 | 689 | } |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | global $conf, $langs, $user; |
709 | 709 | |
710 | 710 | $sql = "SELECT rowid, code, label, percent"; |
711 | - $sql .= " FROM " . $this->db->prefix() . 'c_lead_status'; |
|
711 | + $sql .= " FROM ".$this->db->prefix().'c_lead_status'; |
|
712 | 712 | $sql .= " WHERE active = 1"; |
713 | 713 | $sql .= " ORDER BY position"; |
714 | 714 | |
@@ -718,31 +718,31 @@ discard block |
||
718 | 718 | $i = 0; |
719 | 719 | $sellist = ''; |
720 | 720 | if ($num > 0) { |
721 | - $sellist = '<select class="flat oppstatus' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
721 | + $sellist = '<select class="flat oppstatus'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
722 | 722 | if ($showempty) { |
723 | 723 | // Without  , strange move of screen when switching value |
724 | 724 | $sellist .= '<option value="-1"> </option>'; |
725 | 725 | } |
726 | 726 | if ($showallnone) { |
727 | - $sellist .= '<option value="all"' . ($preselected == 'all' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OnlyOpportunitiesShort") . '</option>'; |
|
728 | - $sellist .= '<option value="openedopp"' . ($preselected == 'openedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OpenedOpportunitiesShort") . '</option>'; |
|
729 | - $sellist .= '<option value="notopenedopp"' . ($preselected == 'notopenedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotOpenedOpportunitiesShort") . '</option>'; |
|
730 | - $sellist .= '<option value="none"' . ($preselected == 'none' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotAnOpportunityShort") . '</option>'; |
|
727 | + $sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").'</option>'; |
|
728 | + $sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").'</option>'; |
|
729 | + $sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").'</option>'; |
|
730 | + $sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").'</option>'; |
|
731 | 731 | } |
732 | 732 | while ($i < $num) { |
733 | 733 | $obj = $this->db->fetch_object($resql); |
734 | 734 | |
735 | - $sellist .= '<option value="' . $obj->rowid . '" defaultpercent="' . $obj->percent . '" elemcode="' . $obj->code . '"'; |
|
735 | + $sellist .= '<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"'; |
|
736 | 736 | if ($obj->rowid == $preselected) { |
737 | 737 | $sellist .= ' selected="selected"'; |
738 | 738 | } |
739 | 739 | $sellist .= '>'; |
740 | 740 | if ($useshortlabel) { |
741 | - $finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label); |
|
741 | + $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label); |
|
742 | 742 | } else { |
743 | - $finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label); |
|
743 | + $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label); |
|
744 | 744 | if ($showpercent) { |
745 | - $finallabel .= ' (' . $obj->percent . '%)'; |
|
745 | + $finallabel .= ' ('.$obj->percent.'%)'; |
|
746 | 746 | } |
747 | 747 | } |
748 | 748 | $sellist .= $finallabel; |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | } else { |
772 | 772 | $this->error = $this->db->lasterror(); |
773 | 773 | $this->errors[] = $this->db->lasterror(); |
774 | - dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR); |
|
774 | + dol_syslog(get_class($this)."::selectOpportunityStatus ".$this->error, LOG_ERR); |
|
775 | 775 | return -1; |
776 | 776 | } |
777 | 777 | } |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | $tmpproject = new Project($this->db); |
800 | 800 | |
801 | 801 | foreach ($statustohow as $key => $value) { |
802 | - $tmpproject->statut = $key; // deprecated |
|
802 | + $tmpproject->statut = $key; // deprecated |
|
803 | 803 | $tmpproject->status = $key; |
804 | 804 | $options[$value] = $tmpproject->getLibStatut($short); |
805 | 805 | } |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | if (is_array($selected)) { |
808 | 808 | $selectedarray = $selected; |
809 | 809 | } elseif ($selected == 99) { |
810 | - $selectedarray = array(0,1); |
|
810 | + $selectedarray = array(0, 1); |
|
811 | 811 | } else { |
812 | 812 | $selectedarray = explode(',', $selected); |
813 | 813 | } |
@@ -831,24 +831,24 @@ discard block |
||
831 | 831 | { |
832 | 832 | global $user, $conf, $langs; |
833 | 833 | |
834 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
834 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
835 | 835 | |
836 | 836 | $out = ''; |
837 | 837 | if (empty($lineOnly)) { |
838 | 838 | // Search Invoice |
839 | 839 | $sql = "SELECT f.rowid, f.ref as fref,"; |
840 | 840 | $sql .= ' s.nom as name'; |
841 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
842 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc'; |
|
843 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid'; |
|
844 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
841 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
842 | + $sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc'; |
|
843 | + $sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid'; |
|
844 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
845 | 845 | if (!empty($filters)) { |
846 | 846 | foreach ($filters as $key => $value) { |
847 | 847 | if ($key == 'p.rowid') { |
848 | - $sql .= " AND p.rowid=" . (int) $value; |
|
848 | + $sql .= " AND p.rowid=".(int) $value; |
|
849 | 849 | } |
850 | 850 | if ($key == 'f.rowid') { |
851 | - $sql .= " AND f.rowid=" . (int) $value; |
|
851 | + $sql .= " AND f.rowid=".(int) $value; |
|
852 | 852 | } |
853 | 853 | } |
854 | 854 | } |
@@ -858,26 +858,26 @@ discard block |
||
858 | 858 | if ($resql) { |
859 | 859 | // Use select2 selector |
860 | 860 | if (!empty($conf->use_javascript_ajax)) { |
861 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
861 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
862 | 862 | $comboenhancement = ajax_combobox($htmlNameInvoice, array(array('method' => 'getLines', 'url' => dol_buildpath('/core/ajax/ajaxinvoiceline.php', 1), 'htmlname' => $htmlNameInvoiceLine)), 0, 0); |
863 | 863 | $out .= $comboenhancement; |
864 | 864 | $morecss = 'minwidth200imp maxwidth500'; |
865 | 865 | } |
866 | 866 | |
867 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoice . '" name="' . $htmlNameInvoice . '">'; |
|
867 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoice.'" name="'.$htmlNameInvoice.'">'; |
|
868 | 868 | $num = $this->db->num_rows($resql); |
869 | 869 | if ($num) { |
870 | 870 | while ($obj = $this->db->fetch_object($resql)) { |
871 | 871 | $labeltoshow = $obj->fref; // Invoice ref |
872 | 872 | if ($obj->name) { |
873 | - $labeltoshow .= ' - ' . $obj->name; |
|
873 | + $labeltoshow .= ' - '.$obj->name; |
|
874 | 874 | } |
875 | 875 | |
876 | - $out .= '<option value="' . $obj->rowid . '" '; |
|
876 | + $out .= '<option value="'.$obj->rowid.'" '; |
|
877 | 877 | if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) { |
878 | 878 | $out .= ' selected '; |
879 | 879 | } |
880 | - $out .= '>' . $labeltoshow . '</option>'; |
|
880 | + $out .= '>'.$labeltoshow.'</option>'; |
|
881 | 881 | } |
882 | 882 | } |
883 | 883 | $out .= '</select>'; |
@@ -889,20 +889,20 @@ discard block |
||
889 | 889 | |
890 | 890 | // Search Invoice Line |
891 | 891 | $sql = "SELECT fd.rowid, fd.label, fd.description"; |
892 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
893 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc'; |
|
894 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid'; |
|
895 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'facturedet as fd ON fd.fk_facture = f.rowid'; |
|
896 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
892 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
893 | + $sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc'; |
|
894 | + $sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid'; |
|
895 | + $sql .= ' INNER JOIN '.$this->db->prefix().'facturedet as fd ON fd.fk_facture = f.rowid'; |
|
896 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
897 | 897 | if (!empty($filters)) { |
898 | 898 | foreach ($filters as $key => $value) { |
899 | 899 | if ($key == 'p.rowid') { |
900 | - $sql .= " AND p.rowid=" . (int) $value; |
|
900 | + $sql .= " AND p.rowid=".(int) $value; |
|
901 | 901 | } |
902 | 902 | } |
903 | 903 | } |
904 | 904 | if (!empty($selectedInvoiceId)) { |
905 | - $sql .= " AND f.rowid=" . (int) $selectedInvoiceId; |
|
905 | + $sql .= " AND f.rowid=".(int) $selectedInvoiceId; |
|
906 | 906 | } |
907 | 907 | $sql .= " ORDER BY p.ref, f.ref ASC"; |
908 | 908 | $resql = $this->db->query($sql); |
@@ -910,24 +910,24 @@ discard block |
||
910 | 910 | // Use select2 selector |
911 | 911 | if (empty($lineOnly)) { |
912 | 912 | if (!empty($conf->use_javascript_ajax)) { |
913 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
913 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
914 | 914 | $comboenhancement = ajax_combobox($htmlNameInvoiceLine, [], 0, 0); |
915 | 915 | $out .= $comboenhancement; |
916 | 916 | $morecss = 'minwidth200imp maxwidth500'; |
917 | 917 | } |
918 | 918 | |
919 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLine . '" name="' . $htmlNameInvoiceLine . '">'; |
|
919 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoiceLine.'" name="'.$htmlNameInvoiceLine.'">'; |
|
920 | 920 | } |
921 | 921 | $num = $this->db->num_rows($resql); |
922 | 922 | if ($num) { |
923 | 923 | while ($obj = $this->db->fetch_object($resql)) { |
924 | 924 | $labeltoshow .= $obj->description; // Invoice ref |
925 | 925 | |
926 | - $out .= '<option value="' . $obj->rowid . '" '; |
|
926 | + $out .= '<option value="'.$obj->rowid.'" '; |
|
927 | 927 | if (!empty($selectedLineId) && $selectedLineId == $obj->rowid) { |
928 | 928 | $out .= ' selected '; |
929 | 929 | } |
930 | - $out .= '>' . $labeltoshow . '</option>'; |
|
930 | + $out .= '>'.$labeltoshow.'</option>'; |
|
931 | 931 | } |
932 | 932 | } |
933 | 933 | if (empty($lineOnly)) { |
@@ -960,14 +960,14 @@ discard block |
||
960 | 960 | |
961 | 961 | $out = ''; |
962 | 962 | if ($htmlname_status != "none" && $htmlname_percent != 'none') { |
963 | - $out .= '<form method="post" action="' . $page . '">'; |
|
963 | + $out .= '<form method="post" action="'.$page.'">'; |
|
964 | 964 | $out .= '<input type="hidden" name="action" value="set_opp_status">'; |
965 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
965 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
966 | 966 | $out .= $this-> selectOpportunityStatus($htmlname_status, $selected, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1); |
967 | 967 | $out .= ' / <span title="'.$langs->trans("OpportunityProbability").'"> '; |
968 | 968 | $out .= '<input class="width50 right" type="text" id="'.$htmlname_percent.'" name="'.$htmlname_percent.'" title="'.dol_escape_htmltag($langs->trans("OpportunityProbability")).'" value="'.$percent_value.'"> %'; |
969 | 969 | $out .= '</span>'; |
970 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
970 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
971 | 971 | $out .= '</form>'; |
972 | 972 | } else { |
973 | 973 | if ($selected > 0) { |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | |
867 | 867 | if (!empty($object->refuse_note)) { |
868 | 868 | $object->actionmsg .= '<br>'; |
869 | - $object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note; |
|
869 | + $object->actionmsg .= $langs->trans("Reason").': '.$object->refuse_note; |
|
870 | 870 | } |
871 | 871 | |
872 | 872 | $object->sendtoid = array(); |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | |
889 | 889 | if (!empty($object->cancel_note)) { |
890 | 890 | $object->actionmsg .= '<br>'; |
891 | - $object->actionmsg .= $langs->trans("Reason") . ': '.$object->cancel_note; |
|
891 | + $object->actionmsg .= $langs->trans("Reason").': '.$object->cancel_note; |
|
892 | 892 | } |
893 | 893 | |
894 | 894 | $object->sendtoid = array(); |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | |
911 | 911 | if (!empty($object->context['comments'])) { |
912 | 912 | $object->actionmsg .= '<br>'; |
913 | - $object->actionmsg .= $langs->trans("Comment") . ': '.$object->context['comments']; |
|
913 | + $object->actionmsg .= $langs->trans("Comment").': '.$object->context['comments']; |
|
914 | 914 | } |
915 | 915 | |
916 | 916 | $object->sendtoid = array(); |
@@ -1605,8 +1605,8 @@ discard block |
||
1605 | 1605 | $actioncomm = new ActionComm($this->db); |
1606 | 1606 | $actioncomm->type_code = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_TICKET_CREATE', 'AC_XXX'...) |
1607 | 1607 | $actioncomm->code = 'AC_'.$action; |
1608 | - $actioncomm->label = $object->actionmsg2; // Label of event |
|
1609 | - $actioncomm->note_private = $object->actionmsg; // Description |
|
1608 | + $actioncomm->label = $object->actionmsg2; // Label of event |
|
1609 | + $actioncomm->note_private = $object->actionmsg; // Description |
|
1610 | 1610 | $actioncomm->fk_project = $projectid; |
1611 | 1611 | $actioncomm->datep = $now; |
1612 | 1612 | $actioncomm->datef = $now; |
@@ -1619,7 +1619,7 @@ discard block |
||
1619 | 1619 | |
1620 | 1620 | // Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionmsg2 to be added into event label) |
1621 | 1621 | if (!property_exists($object, 'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) { |
1622 | - '@phan-var-force ActionComm $object'; // TODO: None of the dolibarr classes has all the fields, check class type or properties (email_date) |
|
1622 | + '@phan-var-force ActionComm $object'; // TODO: None of the dolibarr classes has all the fields, check class type or properties (email_date) |
|
1623 | 1623 | // If event is to record a message after an email received, we use the date of email as date of event. |
1624 | 1624 | if (!empty($object->email_date) && $actioncomm->type_code === 'AC_TICKET_CREATE') { |
1625 | 1625 | $actioncomm->datep = $object->email_date; |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | $langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", "orders", "bills")); |
52 | 52 | |
53 | 53 | // Get Parameters |
54 | -$action = GETPOST('action', 'aZ09'); |
|
54 | +$action = GETPOST('action', 'aZ09'); |
|
55 | 55 | $massaction = GETPOST('massaction', 'alpha'); |
56 | -$confirm = GETPOST('confirm', 'alpha'); |
|
56 | +$confirm = GETPOST('confirm', 'alpha'); |
|
57 | 57 | $cancel = GETPOST('cancel', 'alpha'); |
58 | -$toselect = GETPOST('toselect', 'array'); |
|
58 | +$toselect = GETPOST('toselect', 'array'); |
|
59 | 59 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search |
60 | 60 | $optioncss = GETPOST('optioncss', 'alpha'); |
61 | 61 | $mode = GETPOST('mode', 'aZ09'); |
62 | 62 | if (empty($mode) && preg_match('/show_/', $action)) { |
63 | - $mode = $action; // For backward compatibility |
|
63 | + $mode = $action; // For backward compatibility |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | if (isModEnabled('category') && $user->hasRight('agenda', 'myactions', 'create')) { |
421 | 421 | $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); |
422 | 422 | } |
423 | -if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { |
|
423 | +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { |
|
424 | 424 | $arrayofmassactions = array(); |
425 | 425 | } |
426 | 426 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { |
466 | 466 | // TODO Replace with a AND EXISTS |
467 | 467 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'"; |
468 | - if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { |
|
468 | + if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { |
|
469 | 469 | $sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility |
470 | 470 | } elseif ($filtert == '-3') { |
471 | 471 | $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
481 | 481 | $sql .= $hookmanager->resPrint; |
482 | 482 | |
483 | -$sql .= " WHERE a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
483 | +$sql .= " WHERE a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
484 | 484 | // Condition on actioncode |
485 | 485 | if (!empty($actioncode)) { |
486 | 486 | if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | * @param string $value |
511 | 511 | * @return bool |
512 | 512 | */ |
513 | - function ($value) { |
|
513 | + function($value) { |
|
514 | 514 | return ((string) $value !== '-1'); |
515 | 515 | } |
516 | 516 | ); |
@@ -1009,7 +1009,7 @@ discard block |
||
1009 | 1009 | $event_owner_style = ''; |
1010 | 1010 | // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) |
1011 | 1011 | if ($obj->fk_user_action > 0 && $cache_user_list[$obj->fk_user_action]->color != '') { |
1012 | - $event_owner_style .= 'border-left: #' . $cache_user_list[$obj->fk_user_action]->color . ' 5px solid;'; |
|
1012 | + $event_owner_style .= 'border-left: #'.$cache_user_list[$obj->fk_user_action]->color.' 5px solid;'; |
|
1013 | 1013 | } |
1014 | 1014 | |
1015 | 1015 | // get event style for start and end date |
@@ -1044,7 +1044,7 @@ discard block |
||
1044 | 1044 | } |
1045 | 1045 | $event_start_date_css = $event_end_date_css = $event_more_class; |
1046 | 1046 | |
1047 | - print '<tr class="oddeven' . ($event_more_class != '' ? ' '.$event_more_class : '') . '">'; |
|
1047 | + print '<tr class="oddeven'.($event_more_class != '' ? ' '.$event_more_class : '').'">'; |
|
1048 | 1048 | // Action column |
1049 | 1049 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
1050 | 1050 | print '<td class="nowrap center">'; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | |
52 | 52 | $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB', 5); |
53 | -$DELAYFORCACHE = 300; // 300 seconds |
|
53 | +$DELAYFORCACHE = 300; // 300 seconds |
|
54 | 54 | |
55 | 55 | $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); |
56 | 56 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $socid = ''; |
87 | 87 | } |
88 | 88 | |
89 | -$canedit = 1; // can read events of others |
|
89 | +$canedit = 1; // can read events of others |
|
90 | 90 | if (!$user->hasRight('agenda', 'myactions', 'read')) { |
91 | 91 | accessforbidden(); |
92 | 92 | } |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | $sql .= " ON bc.rowid = ba.fk_bookcal_calendar"; |
554 | 554 | $sql .= " WHERE bc.status = 1"; |
555 | 555 | $sql .= " AND ba.status = 1"; |
556 | - $sql .= " AND bc.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
556 | + $sql .= " AND bc.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
557 | 557 | if (!empty($filtert) && $filtert != '-1' && $filtert != '-2') { |
558 | 558 | $sql .= " AND bc.visibility IN (".$db->sanitize($filtert, 0, 0, 0, 0).")"; |
559 | 559 | } |
@@ -594,9 +594,9 @@ discard block |
||
594 | 594 | // Holiday calendar |
595 | 595 | if ($user->hasRight("holiday", "read")) { |
596 | 596 | $s .= ' |
597 | - <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"' . ($check_holiday ? ' checked' : '') . '> |
|
597 | + <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"' . ($check_holiday ? ' checked' : '').'> |
|
598 | 598 | <label for="check_holiday" class="labelcalendar"> |
599 | - <span class="check_holiday_text">' . $langs->trans("Holidays") . '</span> |
|
599 | + <span class="check_holiday_text">' . $langs->trans("Holidays").'</span> |
|
600 | 600 | </label> |
601 | 601 | </div>'; |
602 | 602 | } |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | // External calendars |
605 | 605 | if (count($showextcals) > 0) { |
606 | 606 | foreach ($showextcals as $val) { |
607 | - $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char |
|
607 | + $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char |
|
608 | 608 | |
609 | 609 | $s .= '<script type="text/javascript">'."\n"; |
610 | 610 | $s .= 'jQuery(document).ready(function () {'."\n"; |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | $s .= "\n".'<!-- End div to calendars selectors -->'."\n"; |
650 | 650 | } else { // If javascript off |
651 | 651 | $newparam = $param; // newparam is for birthday links |
652 | - $newparam = preg_replace('/showbirthday=[0-1]/i', 'showbirthday='.($showbirthday ? '1' : '0'), $newparam); // Always false @phpstan-ignore-line |
|
652 | + $newparam = preg_replace('/showbirthday=[0-1]/i', 'showbirthday='.($showbirthday ? '1' : '0'), $newparam); // Always false @phpstan-ignore-line |
|
653 | 653 | if (!preg_match('/showbirthday=/i', $newparam)) { |
654 | 654 | $newparam .= '&showbirthday=1'; |
655 | 655 | } |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | // TODO Replace with a AND EXISTS |
699 | 699 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar"; |
700 | 700 | $sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'"; |
701 | - if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { |
|
701 | + if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { |
|
702 | 702 | $sql .= " AND ar.fk_element IN (".$db->sanitize($filtert).")"; |
703 | 703 | } elseif ($filtert == '-3') { |
704 | 704 | $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | } |
710 | 710 | |
711 | 711 | $sql .= " WHERE a.fk_action = ca.id"; |
712 | -$sql .= " AND a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
712 | +$sql .= " AND a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
713 | 713 | |
714 | 714 | // Condition on actioncode |
715 | 715 | if (!empty($actioncode)) { |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | // event->datep and event->datef must be GMT date. |
876 | 876 | if ($event->fulldayevent) { |
877 | 877 | $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); |
878 | - $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz |
|
878 | + $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz |
|
879 | 879 | $event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver'); |
880 | 880 | } else { |
881 | 881 | // Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1) |
@@ -951,8 +951,8 @@ discard block |
||
951 | 951 | // Loop on each day covered by action to prepare an index to show on calendar |
952 | 952 | $loop = true; |
953 | 953 | $j = 0; |
954 | - $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz |
|
955 | - $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz |
|
954 | + $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz |
|
955 | + $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz |
|
956 | 956 | /* |
957 | 957 | print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>'; |
958 | 958 | print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>'; |
@@ -1154,9 +1154,9 @@ discard block |
||
1154 | 1154 | } elseif (in_array($obj->halfday, array(-1, 2)) && $firstdayofholiday) { |
1155 | 1155 | $newevent->label .= ' ('.$langs->trans("Afternoon").')'; |
1156 | 1156 | } |
1157 | - $eventarray[$daykey][] = $newevent; // We need to use ->gtTypePicto, getXXXon object, so clone must be PHP clone. |
|
1157 | + $eventarray[$daykey][] = $newevent; // We need to use ->gtTypePicto, getXXXon object, so clone must be PHP clone. |
|
1158 | 1158 | } else { |
1159 | - $eventarray[$daykey][] = $event; // We can use the event unchanged |
|
1159 | + $eventarray[$daykey][] = $event; // We can use the event unchanged |
|
1160 | 1160 | } |
1161 | 1161 | |
1162 | 1162 | $daykey += 60 * 60 * 24; |
@@ -1904,8 +1904,8 @@ discard block |
||
1904 | 1904 | // We are in a particular day for $username, now we scan all events |
1905 | 1905 | foreach ($eventarray as $daykey => $notused) { |
1906 | 1906 | $annee = (int) dol_print_date($daykey, '%Y', 'tzuserrel'); |
1907 | - $mois = (int) dol_print_date($daykey, '%m', 'tzuserrel'); |
|
1908 | - $jour = (int) dol_print_date($daykey, '%d', 'tzuserrel'); |
|
1907 | + $mois = (int) dol_print_date($daykey, '%m', 'tzuserrel'); |
|
1908 | + $jour = (int) dol_print_date($daykey, '%d', 'tzuserrel'); |
|
1909 | 1909 | //var_dump("daykey=$daykey day=$day jour=$jour, month=$month mois=$mois, year=$year annee=$annee ".dol_print_date($daykey, 'dayhour', 'gmt')); |
1910 | 1910 | //var_dump($notused); |
1911 | 1911 |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | */ |
51 | 51 | |
52 | 52 | $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB', 5); |
53 | -$DELAYFORCACHE = 300; // 300 seconds |
|
53 | +$DELAYFORCACHE = 300; // 300 seconds |
|
54 | 54 | |
55 | 55 | $action = GETPOST('action', 'aZ09'); |
56 | 56 | $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
57 | 57 | $mode = GETPOST('mode', 'aZ09'); |
58 | 58 | if (empty($mode) && preg_match('/show_/', $action)) { |
59 | - $mode = $action; // For backward compatibility |
|
59 | + $mode = $action; // For backward compatibility |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS')); |
147 | 147 | } |
148 | 148 | |
149 | -$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app |
|
150 | -$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview); // default for user |
|
149 | +$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app |
|
150 | +$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview); // default for user |
|
151 | 151 | if (empty($mode) && !GETPOSTISSET('mode')) { |
152 | 152 | $mode = $defaultview; |
153 | 153 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | |
562 | 562 | $viewmode .= '</div>'; |
563 | 563 | |
564 | -$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools |
|
564 | +$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools |
|
565 | 565 | |
566 | 566 | |
567 | 567 | $newparam = ''; |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $sql .= " ON bc.rowid = ba.fk_bookcal_calendar"; |
597 | 597 | $sql .= " WHERE bc.status = 1"; |
598 | 598 | $sql .= " AND ba.status = 1"; |
599 | - $sql .= " AND bc.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
599 | + $sql .= " AND bc.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
600 | 600 | if (!empty($filtert) && $filtert != '-1') { |
601 | 601 | $sql .= " AND bc.visibility IN (".$db->sanitize($filtert, 0, 0, 0, 0).")"; |
602 | 602 | } |
@@ -652,9 +652,9 @@ discard block |
||
652 | 652 | if ($user->hasRight("holiday", "read")) { |
653 | 653 | $s .= ' |
654 | 654 | <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"' . ($check_holiday |
655 | - ? ' checked' : '') . '> |
|
655 | + ? ' checked' : '').'> |
|
656 | 656 | <label for="check_holiday" class="labelcalendar"> |
657 | - <span class="check_holiday_text">' . $langs->trans("Holidays") . '</span> |
|
657 | + <span class="check_holiday_text">' . $langs->trans("Holidays").'</span> |
|
658 | 658 | </label> |
659 | 659 | </div>'; |
660 | 660 | } |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | $s .= '</script>'."\n"; |
681 | 681 | |
682 | 682 | foreach ($showextcals as $val) { |
683 | - $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char |
|
683 | + $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char |
|
684 | 684 | |
685 | 685 | if (!empty($val['default']) || GETPOSTINT('check_ext'.$htmlname)) { |
686 | 686 | $default = "checked"; |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { |
771 | 771 | // TODO Replace with a AND EXISTS |
772 | 772 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'"; |
773 | - if ($filtert != '-1' && $filtert != '-2' && $filtert != '-3') { |
|
773 | + if ($filtert != '-1' && $filtert != '-2' && $filtert != '-3') { |
|
774 | 774 | $sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility |
775 | 775 | } elseif ($filtert == '-3') { |
776 | 776 | $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $sql .= $hookmanager->resPrint; |
792 | 792 | |
793 | 793 | $sql .= " WHERE a.fk_action = ca.id"; |
794 | -$sql .= " AND a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
794 | +$sql .= " AND a.entity IN (".getEntity('agenda').")"; // bookcal is a "virtual view" of agenda |
|
795 | 795 | // Condition on actioncode |
796 | 796 | if (!empty($actioncode)) { |
797 | 797 | if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | * @param string $value |
822 | 822 | * @return bool |
823 | 823 | */ |
824 | - function ($value) { |
|
824 | + function($value) { |
|
825 | 825 | return ((string) $value !== '-1'); |
826 | 826 | } |
827 | 827 | ); |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | // event->datep and event->datef must be GMT date. |
945 | 945 | if ($event->fulldayevent) { |
946 | 946 | $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); |
947 | - $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz |
|
947 | + $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz |
|
948 | 948 | $event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver'); |
949 | 949 | } else { |
950 | 950 | // Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1) |
@@ -1022,8 +1022,8 @@ discard block |
||
1022 | 1022 | // Loop on each day covered by action to prepare an index to show on calendar |
1023 | 1023 | $loop = true; |
1024 | 1024 | $j = 0; |
1025 | - $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz |
|
1026 | - $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz |
|
1025 | + $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz |
|
1026 | + $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz |
|
1027 | 1027 | /* |
1028 | 1028 | print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>'; |
1029 | 1029 | print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>'; |
@@ -1150,7 +1150,7 @@ discard block |
||
1150 | 1150 | $sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved) |
1151 | 1151 | if ($mode == 'show_day') { |
1152 | 1152 | // Request only leaves for the current selected day |
1153 | - $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time |
|
1153 | + $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time |
|
1154 | 1154 | } elseif ($mode == 'show_week') { |
1155 | 1155 | // Restrict on current month (we get more, but we will filter later) |
1156 | 1156 | $sql .= " AND x.date_debut < '".$db->idate(dol_get_last_day($year, $month))."'"; |
@@ -1234,9 +1234,9 @@ discard block |
||
1234 | 1234 | } elseif (in_array($obj->halfday, array(-1, 2)) && $firstdayofholiday) { |
1235 | 1235 | $newevent->label .= ' ('.$langs->trans("Afternoon").')'; |
1236 | 1236 | } |
1237 | - $eventarray[$daykey][] = $newevent; // We need to use ->gtTypePicto, getXXXon object, so clone must be PHP clone. |
|
1237 | + $eventarray[$daykey][] = $newevent; // We need to use ->gtTypePicto, getXXXon object, so clone must be PHP clone. |
|
1238 | 1238 | } else { |
1239 | - $eventarray[$daykey][] = $event; // We can use the event unchanged |
|
1239 | + $eventarray[$daykey][] = $event; // We can use the event unchanged |
|
1240 | 1240 | } |
1241 | 1241 | |
1242 | 1242 | $daykey += 60 * 60 * 24; |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | |
1726 | 1726 | for ($iter_day = 0; $iter_day < 7; $iter_day++) { |
1727 | 1727 | // Show days of the current week |
1728 | - $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server |
|
1728 | + $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server |
|
1729 | 1729 | $tmpday = (int) dol_print_date($curtime, '%d', 'tzuserrel'); |
1730 | 1730 | $tmpmonth = (int) dol_print_date($curtime, '%m', 'tzuserrel'); |
1731 | 1731 | $tmpyear = (int) dol_print_date($curtime, '%Y', 'tzuserrel'); |
@@ -1960,9 +1960,9 @@ discard block |
||
1960 | 1960 | $tmpholiday = new Holiday($db); |
1961 | 1961 | |
1962 | 1962 | foreach ($eventarray as $daykey => $notused) { // daykey is the 'YYYYMMDD' to show according to user |
1963 | - $annee = (int) dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
1964 | - $mois = (int) dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
1965 | - $jour = (int) dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
1963 | + $annee = (int) dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
1964 | + $mois = (int) dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
1965 | + $jour = (int) dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD' |
|
1966 | 1966 | |
1967 | 1967 | //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n"; |
1968 | 1968 | //print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' day='.$day.' month='.$month.' year='.$year."<br>\n"; |
@@ -2232,7 +2232,7 @@ discard block |
||
2232 | 2232 | $event->label = $titletoshow; |
2233 | 2233 | // Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user. |
2234 | 2234 | $titletoshow = (($event->type_picto || $event->type_code) ? $event->getTypePicto() : ''); |
2235 | - $titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0); // do not add 'inline-block' in css here: it makes the title transformed completely into '...' |
|
2235 | + $titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0); // do not add 'inline-block' in css here: it makes the title transformed completely into '...' |
|
2236 | 2236 | $event->label = $savlabel; |
2237 | 2237 | } |
2238 | 2238 | |
@@ -2276,7 +2276,7 @@ discard block |
||
2276 | 2276 | $thirdparty = $cachethirdparties[$thirdparty_id]; |
2277 | 2277 | } |
2278 | 2278 | if (!empty($thirdparty->id)) { |
2279 | - $linerelatedto .= $thirdparty->getNomUrl(1, '', 0, 0, -1, 0, '', 'valignmiddle inline'); // using inline-block make the content completely replace with ... when too large |
|
2279 | + $linerelatedto .= $thirdparty->getNomUrl(1, '', 0, 0, -1, 0, '', 'valignmiddle inline'); // using inline-block make the content completely replace with ... when too large |
|
2280 | 2280 | } |
2281 | 2281 | } |
2282 | 2282 | if (!empty($contact_id) && $contact_id > 0) { |
@@ -2291,7 +2291,7 @@ discard block |
||
2291 | 2291 | $linerelatedto .= ' '; |
2292 | 2292 | } |
2293 | 2293 | if (!empty($contact->id)) { |
2294 | - $linerelatedto .= $contact->getNomUrl(1, '', 0, '', -1, 0, 'valignmiddle inline'); // using inline-block make the content completely replace with ... when too large |
|
2294 | + $linerelatedto .= $contact->getNomUrl(1, '', 0, '', -1, 0, 'valignmiddle inline'); // using inline-block make the content completely replace with ... when too large |
|
2295 | 2295 | } |
2296 | 2296 | } |
2297 | 2297 | if (!empty($event->fk_element) && $event->fk_element > 0 && !empty($event->elementtype) && getDolGlobalString('AGENDA_SHOW_LINKED_OBJECT')) { |