@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | $sapi_type = php_sapi_name(); |
29 | 29 | $script_file = basename(__FILE__); |
30 | -$path=__DIR__.'/'; |
|
30 | +$path = __DIR__.'/'; |
|
31 | 31 | |
32 | 32 | // Test si mode batch |
33 | 33 | if (substr($sapi_type, 0, 3) == 'cgi') { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | // Recupere root dolibarr |
39 | -$path=preg_replace('/purge-data.php/i', '', $_SERVER["PHP_SELF"]); |
|
39 | +$path = preg_replace('/purge-data.php/i', '', $_SERVER["PHP_SELF"]); |
|
40 | 40 | require $path."../../htdocs/master.inc.php"; |
41 | 41 | include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
42 | 42 | include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $langs->loadLangs(array("main", "errors")); |
49 | 49 | |
50 | 50 | // Global variables |
51 | -$version=DOL_VERSION; |
|
52 | -$error=0; |
|
51 | +$version = DOL_VERSION; |
|
52 | +$error = 0; |
|
53 | 53 | |
54 | 54 | // List of sql to execute |
55 | -$sqls=array( |
|
55 | +$sqls = array( |
|
56 | 56 | 'user'=>array( |
57 | 57 | "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user IN (SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin') AND fk_user IN (select rowid FROM ".MAIN_DB_PREFIX."user where datec < '__DATE__')", |
58 | 58 | "DELETE FROM ".MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin' AND datec < '__DATE__'", |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $option = $argv[2]; |
184 | 184 | $date = $argv[3]; |
185 | 185 | |
186 | -if (empty($mode) || ! in_array($mode, array('test','confirm'))) { |
|
186 | +if (empty($mode) || !in_array($mode, array('test', 'confirm'))) { |
|
187 | 187 | print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; |
188 | 188 | print "\n"; |
189 | 189 | print "option can be ".implode(',', array_keys($sqls))."\n"; |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | exit(-1); |
197 | 197 | } |
198 | 198 | if ($option != 'all') { |
199 | - $listofoptions=explode(',', $option); |
|
199 | + $listofoptions = explode(',', $option); |
|
200 | 200 | foreach ($listofoptions as $cursoroption) { |
201 | - if (! in_array($cursoroption, array_keys($sqls))) { |
|
201 | + if (!in_array($cursoroption, array_keys($sqls))) { |
|
202 | 202 | print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; |
203 | 203 | print "\n"; |
204 | 204 | print "option '".$cursoroption."' must be in list ".implode(',', array_keys($sqls))."\n"; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
210 | -if (empty($date) || (! preg_match('/\d\d\d\d\-\d\d\-\d\d$/', $date) && $date != 'all')) { |
|
210 | +if (empty($date) || (!preg_match('/\d\d\d\d\-\d\d\-\d\d$/', $date) && $date != 'all')) { |
|
211 | 211 | print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; |
212 | 212 | print "\n"; |
213 | 213 | print "date can be 'all' or 'YYYY-MM-DD' to delete record before YYYY-MM-DD\n"; |
@@ -222,12 +222,12 @@ discard block |
||
222 | 222 | if (!empty($argv[4])) { |
223 | 223 | $db->close(); |
224 | 224 | unset($db); |
225 | - $db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]); |
|
226 | - $user=new User($db); |
|
225 | + $db = getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]); |
|
226 | + $user = new User($db); |
|
227 | 227 | } |
228 | 228 | |
229 | -$ret=$user->fetch('', 'admin'); |
|
230 | -if (! $ret > 0) { |
|
229 | +$ret = $user->fetch('', 'admin'); |
|
230 | +if (!$ret > 0) { |
|
231 | 231 | print 'An admin user with login "admin" must exists to use this script.'."\n"; |
232 | 232 | exit; |
233 | 233 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | print "User = ".$db->database_user."\n"; |
243 | 243 | print "\n"; |
244 | 244 | |
245 | -if (! $confirmed) { |
|
245 | +if (!$confirmed) { |
|
246 | 246 | print "Hit Enter to continue or CTRL+C to stop...\n"; |
247 | 247 | $input = trim(fgets(STDIN)); |
248 | 248 | } |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | { |
260 | 260 | global $db, $sqls; |
261 | 261 | |
262 | - $error=0; |
|
262 | + $error = 0; |
|
263 | 263 | foreach ($sqls[$family] as $sql) { |
264 | 264 | if (preg_match('/^@/', $sql)) { |
265 | - $newfamily=preg_replace('/@/', '', $sql); |
|
265 | + $newfamily = preg_replace('/@/', '', $sql); |
|
266 | 266 | processfamily($newfamily, $date); |
267 | 267 | continue; |
268 | 268 | } |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | |
272 | 272 | print "Run sql: ".$sql."\n"; |
273 | 273 | |
274 | - $resql=$db->query($sql); |
|
275 | - if (! $resql) { |
|
274 | + $resql = $db->query($sql); |
|
275 | + if (!$resql) { |
|
276 | 276 | if ($db->errno() != 'DB_ERROR_NOSUCHTABLE') { |
277 | 277 | $error++; |
278 | 278 | } |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | |
296 | 296 | $db->begin(); |
297 | 297 | |
298 | -$listofoptions=explode(',', $option); |
|
298 | +$listofoptions = explode(',', $option); |
|
299 | 299 | foreach ($listofoptions as $cursoroption) { |
300 | - $oldfamily=''; |
|
300 | + $oldfamily = ''; |
|
301 | 301 | foreach ($sqls as $family => $familysql) { |
302 | 302 | if ($cursoroption && $cursoroption != 'all' && $cursoroption != $family) { |
303 | 303 | continue; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | $oldfamily = $family; |
310 | 310 | |
311 | - $result=processfamily($family, $date); |
|
311 | + $result = processfamily($family, $date); |
|
312 | 312 | if ($result < 0) { |
313 | 313 | $error++; |
314 | 314 | break; |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | |
57 | 57 | |
58 | 58 | // Get parameters |
59 | -$action = GETPOST('action', 'aZ09'); |
|
59 | +$action = GETPOST('action', 'aZ09'); |
|
60 | 60 | $massaction = GETPOST('massaction', 'alpha'); |
61 | 61 | $show_files = GETPOSTINT('show_files'); |
62 | -$confirm = GETPOST('confirm', 'alpha'); |
|
63 | -$toselect = GETPOST('toselect', 'array'); |
|
62 | +$confirm = GETPOST('confirm', 'alpha'); |
|
63 | +$toselect = GETPOST('toselect', 'array'); |
|
64 | 64 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'thirdpartylist'; |
65 | 65 | $optioncss = GETPOST('optioncss', 'alpha'); |
66 | 66 | if ($contextpage == 'poslist') { |
@@ -133,20 +133,20 @@ discard block |
||
133 | 133 | $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
134 | 134 | $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
135 | 135 | $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
136 | -$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
136 | +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
137 | 137 | $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
138 | 138 | $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
139 | 139 | $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
140 | -$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
140 | +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
141 | 141 | |
142 | 142 | $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth'); |
143 | 143 | $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear'); |
144 | 144 | $search_date_modif_startday = GETPOSTINT('search_date_modif_startday'); |
145 | -$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
145 | +$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
146 | 146 | $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth'); |
147 | 147 | $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear'); |
148 | 148 | $search_date_modif_endday = GETPOSTINT('search_date_modif_endday'); |
149 | -$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
149 | +$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
150 | 150 | |
151 | 151 | $type = GETPOST('type', 'alpha'); |
152 | 152 | $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | $object->fields = dol_sort_array($object->fields, 'position'); |
324 | 324 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
325 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
325 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
326 | 326 | |
327 | 327 | // Security check |
328 | 328 | $socid = GETPOSTINT('socid'); |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | if ($searchCategoryCustomerOperator == 0) { |
616 | 616 | $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")"; |
617 | 617 | } else { |
618 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); |
|
618 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer); |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 | } |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | if ($searchCategorySupplierOperator == 0) { |
645 | 645 | $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")"; |
646 | 646 | } else { |
647 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); |
|
647 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier); |
|
648 | 648 | } |
649 | 649 | } |
650 | 650 | } |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | $param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday)); |
1085 | 1085 | } |
1086 | 1086 | if ($search_date_modif_end) { |
1087 | - $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); |
|
1087 | + $param .= '&search_date_modif_end='.urlencode($search_date_modif_end); |
|
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | // Add $param from extra fields |
@@ -1154,7 +1154,7 @@ discard block |
||
1154 | 1154 | if (!empty($socid)) { |
1155 | 1155 | $url .= '&socid='.$socid; |
1156 | 1156 | } |
1157 | - $newcardbutton = ''; |
|
1157 | + $newcardbutton = ''; |
|
1158 | 1158 | $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); |
1159 | 1159 | $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); |
1160 | 1160 | $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url, '', $user->hasRight('societe', 'creer')); |
@@ -1266,7 +1266,7 @@ discard block |
||
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1269 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1269 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1270 | 1270 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
1271 | 1271 | $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1272 | 1272 | |
@@ -1720,15 +1720,15 @@ discard block |
||
1720 | 1720 | print $hookmanager->resPrint; |
1721 | 1721 | if (!empty($arrayfields['s.datec']['checked'])) { |
1722 | 1722 | print_liste_field_titre($arrayfields['s.datec']['label'], $_SERVER["PHP_SELF"], "s.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
1723 | - $totalarray['nbfield']++; // For the column action |
|
1723 | + $totalarray['nbfield']++; // For the column action |
|
1724 | 1724 | } |
1725 | 1725 | if (!empty($arrayfields['s.tms']['checked'])) { |
1726 | 1726 | print_liste_field_titre($arrayfields['s.tms']['label'], $_SERVER["PHP_SELF"], "s.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
1727 | - $totalarray['nbfield']++; // For the column action |
|
1727 | + $totalarray['nbfield']++; // For the column action |
|
1728 | 1728 | } |
1729 | 1729 | if (!empty($arrayfields['s.status']['checked'])) { |
1730 | 1730 | print_liste_field_titre($arrayfields['s.status']['label'], $_SERVER["PHP_SELF"], "s.status", "", $param, '', $sortfield, $sortorder, 'center '); |
1731 | - $totalarray['nbfield']++; // For the column action |
|
1731 | + $totalarray['nbfield']++; // For the column action |
|
1732 | 1732 | } |
1733 | 1733 | if (!empty($arrayfields['s.note_public']['checked'])) { |
1734 | 1734 | print_liste_field_titre($arrayfields['s.note_public']['label'], $_SERVER["PHP_SELF"], "s.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
@@ -1740,7 +1740,7 @@ discard block |
||
1740 | 1740 | } |
1741 | 1741 | if (!empty($arrayfields['s.import_key']['checked'])) { |
1742 | 1742 | print_liste_field_titre($arrayfields['s.import_key']['label'], $_SERVER["PHP_SELF"], "s.import_key", "", $param, '', $sortfield, $sortorder, 'center '); |
1743 | - $totalarray['nbfield']++; // For the column action |
|
1743 | + $totalarray['nbfield']++; // For the column action |
|
1744 | 1744 | } |
1745 | 1745 | // Action column |
1746 | 1746 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -1052,8 +1052,8 @@ discard block |
||
1052 | 1052 | $sql .= ", '".$this->db->escape($this->ip)."'"; |
1053 | 1053 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
1054 | 1054 | $sql .= ", ".(empty($this->vat_reverse_charge) ? '0' : '1'); |
1055 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1056 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1055 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1056 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1057 | 1057 | } |
1058 | 1058 | $sql .= ")"; |
1059 | 1059 | |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | } |
1103 | 1103 | |
1104 | 1104 | if ($ret >= 0) { |
1105 | - if (! $notrigger) { |
|
1105 | + if (!$notrigger) { |
|
1106 | 1106 | // Call trigger |
1107 | 1107 | $result = $this->call_trigger('COMPANY_CREATE', $user); |
1108 | 1108 | if ($result < 0) { |
@@ -1180,7 +1180,7 @@ discard block |
||
1180 | 1180 | $this->setUpperOrLowerCase(); |
1181 | 1181 | $contact->phone_pro = $this->phone; |
1182 | 1182 | if (getDolGlobalString('CONTACTS_DEFAULT_ROLES')) { |
1183 | - $contact->roles = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES')); |
|
1183 | + $contact->roles = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES')); |
|
1184 | 1184 | } |
1185 | 1185 | |
1186 | 1186 | $contactId = $contact->create($user, $notrigger); |
@@ -1348,7 +1348,7 @@ discard block |
||
1348 | 1348 | if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { |
1349 | 1349 | $langs->loadLangs(array("errors", 'compta')); |
1350 | 1350 | $error++; |
1351 | - $this->errors[] = $langs->trans('CustomerAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1351 | + $this->errors[] = $langs->trans('CustomerAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1352 | 1352 | } |
1353 | 1353 | } |
1354 | 1354 | |
@@ -1356,7 +1356,7 @@ discard block |
||
1356 | 1356 | if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) { |
1357 | 1357 | $langs->loadLangs(array("errors", 'compta')); |
1358 | 1358 | $error++; |
1359 | - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1359 | + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1360 | 1360 | } |
1361 | 1361 | } elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && !empty($this->fournisseur)) { |
1362 | 1362 | // Check for unicity |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { |
1365 | 1365 | $langs->loadLangs(array("errors", 'compta')); |
1366 | 1366 | $error++; |
1367 | - $this->errors[] = $langs->trans('SupplierAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1367 | + $this->errors[] = $langs->trans('SupplierAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1368 | 1368 | } |
1369 | 1369 | } |
1370 | 1370 | |
@@ -1372,7 +1372,7 @@ discard block |
||
1372 | 1372 | if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) { |
1373 | 1373 | $langs->loadLangs(array("errors", 'compta')); |
1374 | 1374 | $error++; |
1375 | - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1375 | + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1376 | 1376 | } |
1377 | 1377 | } |
1378 | 1378 | } |
@@ -1414,17 +1414,17 @@ discard block |
||
1414 | 1414 | $now = dol_now(); |
1415 | 1415 | |
1416 | 1416 | // Clean parameters |
1417 | - $this->id = $id; |
|
1418 | - $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); |
|
1417 | + $this->id = $id; |
|
1418 | + $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); |
|
1419 | 1419 | $this->name = $this->name ? trim($this->name) : trim((string) $this->nom); |
1420 | 1420 | $this->nom = $this->name; // For backward compatibility |
1421 | - $this->name_alias = trim((string) $this->name_alias); |
|
1421 | + $this->name_alias = trim((string) $this->name_alias); |
|
1422 | 1422 | $this->ref_ext = (empty($this->ref_ext) ? '' : trim($this->ref_ext)); |
1423 | 1423 | $this->address = trim((string) $this->address); |
1424 | 1424 | $this->zip = trim((string) $this->zip); |
1425 | 1425 | $this->town = trim((string) $this->town); |
1426 | - $this->state_id = (is_numeric($this->state_id)) ? (int) trim((string) $this->state_id) : 0; |
|
1427 | - $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; |
|
1426 | + $this->state_id = (is_numeric($this->state_id)) ? (int) trim((string) $this->state_id) : 0; |
|
1427 | + $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; |
|
1428 | 1428 | $this->phone = trim((string) $this->phone); |
1429 | 1429 | $this->phone = preg_replace("/\s/", "", $this->phone); |
1430 | 1430 | $this->phone = preg_replace("/\./", "", $this->phone); |
@@ -1434,7 +1434,7 @@ discard block |
||
1434 | 1434 | $this->fax = trim((string) $this->fax); |
1435 | 1435 | $this->fax = preg_replace("/\s/", "", $this->fax); |
1436 | 1436 | $this->fax = preg_replace("/\./", "", $this->fax); |
1437 | - $this->email = trim((string) $this->email); |
|
1437 | + $this->email = trim((string) $this->email); |
|
1438 | 1438 | $this->url = $this->url ? clean_url($this->url, 0) : ''; |
1439 | 1439 | $this->note_private = (empty($this->note_private) ? '' : trim($this->note_private)); |
1440 | 1440 | $this->note_public = (empty($this->note_public) ? '' : trim($this->note_public)); |
@@ -1444,14 +1444,14 @@ discard block |
||
1444 | 1444 | $this->idprof4 = trim((string) $this->idprof4); |
1445 | 1445 | $this->idprof5 = (!empty($this->idprof5) ? trim($this->idprof5) : ''); |
1446 | 1446 | $this->idprof6 = (!empty($this->idprof6) ? trim($this->idprof6) : ''); |
1447 | - $this->prefix_comm = trim((string) $this->prefix_comm); |
|
1447 | + $this->prefix_comm = trim((string) $this->prefix_comm); |
|
1448 | 1448 | $this->outstanding_limit = price2num($this->outstanding_limit); |
1449 | 1449 | $this->order_min_amount = price2num($this->order_min_amount); |
1450 | 1450 | $this->supplier_order_min_amount = price2num($this->supplier_order_min_amount); |
1451 | 1451 | |
1452 | 1452 | $this->tva_assuj = (is_numeric($this->tva_assuj)) ? (int) trim((string) $this->tva_assuj) : 0; |
1453 | 1453 | $this->tva_intra = dol_sanitizeFileName($this->tva_intra, ''); |
1454 | - $this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1; |
|
1454 | + $this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1; |
|
1455 | 1455 | if (empty($this->status)) { |
1456 | 1456 | $this->status = 0; |
1457 | 1457 | } |
@@ -1602,7 +1602,7 @@ discard block |
||
1602 | 1602 | $sql .= ",tva_assuj = ".($this->tva_assuj != '' ? "'".$this->db->escape($this->tva_assuj)."'" : "null"); |
1603 | 1603 | $sql .= ",tva_intra = '".$this->db->escape($this->tva_intra)."'"; |
1604 | 1604 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
1605 | - $sql .= ",vat_reverse_charge = " . ($this->vat_reverse_charge != '' ? "'" . $this->db->escape($this->vat_reverse_charge) . "'" : 0); |
|
1605 | + $sql .= ",vat_reverse_charge = ".($this->vat_reverse_charge != '' ? "'".$this->db->escape($this->vat_reverse_charge)."'" : 0); |
|
1606 | 1606 | } |
1607 | 1607 | $sql .= ",status = ".((int) $this->status); |
1608 | 1608 | |
@@ -1663,8 +1663,8 @@ discard block |
||
1663 | 1663 | $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null'); |
1664 | 1664 | $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; |
1665 | 1665 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
1666 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1667 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1666 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1667 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1668 | 1668 | if ($customer) { |
1669 | 1669 | $sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null"); |
1670 | 1670 | } |
@@ -2034,7 +2034,7 @@ discard block |
||
2034 | 2034 | $this->code_client = $obj->code_client; |
2035 | 2035 | $this->code_fournisseur = $obj->code_fournisseur; |
2036 | 2036 | |
2037 | - $this->code_compta = $obj->code_compta; // For backward compatibility |
|
2037 | + $this->code_compta = $obj->code_compta; // For backward compatibility |
|
2038 | 2038 | $this->code_compta_client = $obj->code_compta; |
2039 | 2039 | $this->code_compta_fournisseur = $obj->code_compta_fournisseur; |
2040 | 2040 | |
@@ -2051,7 +2051,7 @@ discard block |
||
2051 | 2051 | $this->vat_reverse_charge = 0; |
2052 | 2052 | } |
2053 | 2053 | |
2054 | - $this->status = $obj->status; |
|
2054 | + $this->status = $obj->status; |
|
2055 | 2055 | |
2056 | 2056 | // Local Taxes |
2057 | 2057 | $this->localtax1_assuj = $obj->localtax1_assuj; |
@@ -2078,7 +2078,7 @@ discard block |
||
2078 | 2078 | |
2079 | 2079 | $this->mode_reglement_id = $obj->mode_reglement; |
2080 | 2080 | $this->cond_reglement_id = $obj->cond_reglement; |
2081 | - $this->deposit_percent = $obj->deposit_percent; |
|
2081 | + $this->deposit_percent = $obj->deposit_percent; |
|
2082 | 2082 | $this->transport_mode_id = $obj->transport_mode; |
2083 | 2083 | $this->mode_reglement_supplier_id = $obj->mode_reglement_supplier; |
2084 | 2084 | $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; |
@@ -2649,10 +2649,10 @@ discard block |
||
2649 | 2649 | $reparray[$i]['firstname'] = $obj->firstname; |
2650 | 2650 | $reparray[$i]['email'] = $obj->email; |
2651 | 2651 | $reparray[$i]['phone'] = $obj->office_phone; |
2652 | - $reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone |
|
2652 | + $reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone |
|
2653 | 2653 | $reparray[$i]['office_fax'] = $obj->office_fax; |
2654 | - $reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile |
|
2655 | - $reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile |
|
2654 | + $reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile |
|
2655 | + $reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile |
|
2656 | 2656 | $reparray[$i]['job'] = $obj->job; |
2657 | 2657 | $reparray[$i]['statut'] = $obj->status; // deprecated |
2658 | 2658 | $reparray[$i]['status'] = $obj->status; |
@@ -2865,7 +2865,7 @@ discard block |
||
2865 | 2865 | $datas['status'] = ' '.$this->getLibStatut(5); |
2866 | 2866 | } |
2867 | 2867 | if (isset($this->client) && isset($this->fournisseur)) { |
2868 | - $datas['type'] = ' ' . $this->getTypeUrl(1); |
|
2868 | + $datas['type'] = ' '.$this->getTypeUrl(1); |
|
2869 | 2869 | } |
2870 | 2870 | $datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag(dol_string_nohtmltag($this->name)); |
2871 | 2871 | if (!empty($this->name_alias) && empty($noaliasinname)) { |
@@ -2933,9 +2933,9 @@ discard block |
||
2933 | 2933 | } |
2934 | 2934 | // show categories for this record only in ajax to not overload lists |
2935 | 2935 | if (!$nofetch && isModEnabled('category') && $this->client) { |
2936 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
2936 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
2937 | 2937 | $form = new Form($this->db); |
2938 | - $datas['categories_customer'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); |
|
2938 | + $datas['categories_customer'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); |
|
2939 | 2939 | } |
2940 | 2940 | if (!empty($this->code_fournisseur) && $this->fournisseur) { |
2941 | 2941 | $datas['suppliercode'] = '<br><b>'.$langs->trans('SupplierCode').':</b> '.$this->code_fournisseur; |
@@ -2946,9 +2946,9 @@ discard block |
||
2946 | 2946 | } |
2947 | 2947 | // show categories for this record only in ajax to not overload lists |
2948 | 2948 | if (!$nofetch && isModEnabled('category') && $this->fournisseur) { |
2949 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
2949 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
2950 | 2950 | $form = new Form($this->db); |
2951 | - $datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); |
|
2951 | + $datas['categories_supplier'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); |
|
2952 | 2952 | } |
2953 | 2953 | |
2954 | 2954 | $datas['divclose'] = '</div>'; |
@@ -3762,7 +3762,7 @@ discard block |
||
3762 | 3762 | } else { |
3763 | 3763 | if ($type == 'customer') { |
3764 | 3764 | $this->code_compta_client = ''; |
3765 | - $this->code_compta = ''; // For backward compatibility |
|
3765 | + $this->code_compta = ''; // For backward compatibility |
|
3766 | 3766 | } elseif ($type == 'supplier') { |
3767 | 3767 | $this->code_compta_fournisseur = ''; |
3768 | 3768 | } |
@@ -3854,7 +3854,7 @@ discard block |
||
3854 | 3854 | global $langs; |
3855 | 3855 | |
3856 | 3856 | if ($company_id > 0) { |
3857 | - $sql = "SELECT parent FROM " . MAIN_DB_PREFIX . "societe WHERE rowid = ".((int) $company_id); |
|
3857 | + $sql = "SELECT parent FROM ".MAIN_DB_PREFIX."societe WHERE rowid = ".((int) $company_id); |
|
3858 | 3858 | $resql = $this->db->query($sql); |
3859 | 3859 | if ($resql) { |
3860 | 3860 | if ($obj = $this->db->fetch_object($resql)) { |
@@ -4470,7 +4470,7 @@ discard block |
||
4470 | 4470 | $country_code = $country_label = ''; |
4471 | 4471 | if (getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')) { |
4472 | 4472 | $tmp = explode(':', getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')); |
4473 | - $country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0; |
|
4473 | + $country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0; |
|
4474 | 4474 | if (!empty($tmp[1])) { // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label" |
4475 | 4475 | $country_code = $tmp[1]; |
4476 | 4476 | $country_label = $tmp[2]; |
@@ -5345,7 +5345,7 @@ discard block |
||
5345 | 5345 | if (method_exists($this, 'getLibStatut')) { |
5346 | 5346 | $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>'; |
5347 | 5347 | } |
5348 | - $return .= '</div>'; // end info-box-content |
|
5348 | + $return .= '</div>'; // end info-box-content |
|
5349 | 5349 | $return .= '</div>'; |
5350 | 5350 | $return .= '</div>'; |
5351 | 5351 | |
@@ -5449,7 +5449,7 @@ discard block |
||
5449 | 5449 | global $conf, $langs, $hookmanager, $user, $action; |
5450 | 5450 | |
5451 | 5451 | $error = 0; |
5452 | - $soc_origin = new Societe($this->db); // The thirdparty that we will delete |
|
5452 | + $soc_origin = new Societe($this->db); // The thirdparty that we will delete |
|
5453 | 5453 | |
5454 | 5454 | dol_syslog("mergeCompany merge thirdparty id=".$soc_origin_id." (will be deleted) into the thirdparty id=".$this->id); |
5455 | 5455 |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | |
373 | 373 | $classname = ucfirst($subelement); |
374 | 374 | $srcobject = new $classname($db); |
375 | - '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Maybe other class but CommonObject is too generic |
|
375 | + '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Maybe other class but CommonObject is too generic |
|
376 | 376 | |
377 | 377 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
378 | 378 | $result = $srcobject->fetch($object->origin_id); |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | $idprod = GETPOSTINT('idprod'); |
603 | 603 | } |
604 | 604 | |
605 | - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
605 | + $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
606 | 606 | |
607 | 607 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
608 | 608 | $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | |
1218 | 1218 | $classname = ucfirst($subelement); |
1219 | 1219 | $objectsrc = new $classname($db); |
1220 | - '@phan-var-force Commande|Propal|CommandeFournisseur|SupplierProposal $objectsrc'; // Could be other classes, but CommonObject is too generic |
|
1220 | + '@phan-var-force Commande|Propal|CommandeFournisseur|SupplierProposal $objectsrc'; // Could be other classes, but CommonObject is too generic |
|
1221 | 1221 | $objectsrc->fetch($originid); |
1222 | 1222 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
1223 | 1223 | $objectsrc->fetch_lines(); |
@@ -1834,40 +1834,40 @@ discard block |
||
1834 | 1834 | |
1835 | 1835 | print '<tr>'; |
1836 | 1836 | // Amount HT |
1837 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
1838 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
1837 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
1838 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
1839 | 1839 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
1840 | 1840 | // Multicurrency Amount HT |
1841 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
1841 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
1842 | 1842 | } |
1843 | 1843 | print '</tr>'; |
1844 | 1844 | |
1845 | 1845 | print '<tr>'; |
1846 | 1846 | // Amount VAT |
1847 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
1848 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
1847 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
1848 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
1849 | 1849 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
1850 | 1850 | // Multicurrency Amount VAT |
1851 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
1851 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
1852 | 1852 | } |
1853 | 1853 | print '</tr>'; |
1854 | 1854 | |
1855 | 1855 | // Amount Local Taxes |
1856 | 1856 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
1857 | 1857 | print '<tr>'; |
1858 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
1859 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
1858 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
1859 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
1860 | 1860 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
1861 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
1861 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
1862 | 1862 | } |
1863 | 1863 | print '</tr>'; |
1864 | 1864 | |
1865 | 1865 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
1866 | 1866 | print '<tr>'; |
1867 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
1868 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
1867 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
1868 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
1869 | 1869 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
1870 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
1870 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
1871 | 1871 | } |
1872 | 1872 | print '</tr>'; |
1873 | 1873 | } |
@@ -1875,11 +1875,11 @@ discard block |
||
1875 | 1875 | |
1876 | 1876 | print '<tr>'; |
1877 | 1877 | // Amount TTC |
1878 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
1879 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
1878 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
1879 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
1880 | 1880 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
1881 | 1881 | // Multicurrency Amount TTC |
1882 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
1882 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
1883 | 1883 | } |
1884 | 1884 | print '</tr>'; |
1885 | 1885 |
@@ -412,7 +412,7 @@ |
||
412 | 412 | $extrafieldsobjectkey = 'projet_task'; |
413 | 413 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; |
414 | 414 | |
415 | -$tasksarraywithoutfilter = array(); // Default |
|
415 | +$tasksarraywithoutfilter = array(); // Default |
|
416 | 416 | |
417 | 417 | $tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. |
418 | 418 | if ($morewherefilter) { // Get all task without any filter, so we can show total of time spent for not visible tasks |
@@ -1762,7 +1762,7 @@ discard block |
||
1762 | 1762 | global $langs, $conf; |
1763 | 1763 | |
1764 | 1764 | $error = 0; |
1765 | - $clone_project_id = 0; // For static toolcheck |
|
1765 | + $clone_project_id = 0; // For static toolcheck |
|
1766 | 1766 | |
1767 | 1767 | dol_syslog("createFromClone clone_contact=".json_encode($clone_contact)." clone_task=".json_encode($clone_task)." clone_project_file=".json_encode($clone_project_file)." clone_note=".json_encode($clone_note)." move_date=".json_encode($move_date), LOG_DEBUG); |
1768 | 1768 | |
@@ -2060,7 +2060,7 @@ discard block |
||
2060 | 2060 | if ($tableName == "actioncomm") { |
2061 | 2061 | $sql .= " SET fk_project=".$this->id; |
2062 | 2062 | $sql .= " WHERE id=".((int) $elementSelectId); |
2063 | - } elseif (in_array($tableName, ["entrepot","mrp_mo","stocktransfer_stocktransfer"])) { |
|
2063 | + } elseif (in_array($tableName, ["entrepot", "mrp_mo", "stocktransfer_stocktransfer"])) { |
|
2064 | 2064 | $sql .= " SET fk_project=".$this->id; |
2065 | 2065 | $sql .= " WHERE rowid=".((int) $elementSelectId); |
2066 | 2066 | } else { |
@@ -2244,7 +2244,7 @@ discard block |
||
2244 | 2244 | |
2245 | 2245 | $num = $this->db->num_rows($resql); |
2246 | 2246 | $i = 0; |
2247 | - $week_number = ''; // Initialisation for static analysis |
|
2247 | + $week_number = ''; // Initialisation for static analysis |
|
2248 | 2248 | // Loop on each record found, so each couple (project id, task id) |
2249 | 2249 | while ($i < $num) { |
2250 | 2250 | $obj = $this->db->fetch_object($resql); |
@@ -2571,7 +2571,7 @@ discard block |
||
2571 | 2571 | $return .= '</div>'; |
2572 | 2572 | if (!empty($this->thirdparty->phone)) { |
2573 | 2573 | $return .= '<div class="inline-block valignmiddle">'; |
2574 | - $return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'paddingleft paddingright'); // @phan-suppress-current-line PhanPluginSuspiciousParamPosition |
|
2574 | + $return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'paddingleft paddingright'); // @phan-suppress-current-line PhanPluginSuspiciousParamPosition |
|
2575 | 2575 | $return .= '</div>'; |
2576 | 2576 | } |
2577 | 2577 | if (!empty($this->thirdparty->email)) { |
@@ -2596,7 +2596,7 @@ discard block |
||
2596 | 2596 | $return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Author").'</span>'; |
2597 | 2597 | $return .= '<span> : '.$user->getNomUrl(1).'</span>'; |
2598 | 2598 | }*/ |
2599 | - $return .= '<br><div>'; // start div line status |
|
2599 | + $return .= '<br><div>'; // start div line status |
|
2600 | 2600 | if ($this->usage_opportunity && $this->opp_status_code) { |
2601 | 2601 | //$return .= '<br><span class="info-bo-label opacitymedium">'.$langs->trans("OpportunityStatusShort").'</span>'; |
2602 | 2602 | //$return .= '<div class="small inline-block">'.dol_trunc($langs->trans("OppStatus".$this->opp_status_code), 5).'</div>'; |
@@ -2606,7 +2606,7 @@ discard block |
||
2606 | 2606 | if (method_exists($this, 'getLibStatut')) { |
2607 | 2607 | $return .= '<div class="info-box-status small inline-block valignmiddle">'.$this->getLibStatut(3).'</div>'; |
2608 | 2608 | } |
2609 | - $return .= '</div>'; // end div line status |
|
2609 | + $return .= '</div>'; // end div line status |
|
2610 | 2610 | |
2611 | 2611 | $return .= '</div>'; |
2612 | 2612 | $return .= '</div>'; |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php"; |
50 | 50 | require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; |
51 | 51 | } |
52 | -if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').".php")) { |
|
53 | - require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').'.php'; |
|
52 | +if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').".php")) { |
|
53 | + require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').'.php'; |
|
54 | 54 | } |
55 | 55 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
56 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $id = GETPOSTINT('id'); |
62 | 62 | $ref = GETPOST('ref', 'alpha'); |
63 | -$ref_client = GETPOST('ref_client', 'alpha'); |
|
63 | +$ref_client = GETPOST('ref_client', 'alpha'); |
|
64 | 64 | $socid = GETPOSTINT('socid'); |
65 | 65 | $contratid = GETPOSTINT('contratid'); |
66 | 66 | $action = GETPOST('action', 'alpha'); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
223 | 223 | } |
224 | 224 | |
225 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
225 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
226 | 226 | exit; |
227 | 227 | } else { |
228 | 228 | $mesg = $object->error; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
248 | 248 | } |
249 | 249 | |
250 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
250 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
251 | 251 | exit; |
252 | 252 | } else { |
253 | 253 | $mesg = $object->error; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
273 | 273 | } |
274 | 274 | |
275 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
275 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
276 | 276 | exit; |
277 | 277 | } else { |
278 | 278 | $mesg = $object->error; |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | $classname = ucfirst($subelement); |
370 | 370 | $srcobject = new $classname($db); |
371 | - '@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic |
|
371 | + '@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic |
|
372 | 372 | |
373 | 373 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
374 | 374 | $result = $srcobject->fetch($object->origin_id); |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | } else { |
1126 | 1126 | print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">'; |
1127 | 1127 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
1128 | - print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
1128 | + print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
1129 | 1129 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
1130 | 1130 | |
1131 | 1131 | print dol_get_fiche_head([]); |
@@ -1810,9 +1810,9 @@ discard block |
||
1810 | 1810 | // Sign |
1811 | 1811 | if ($object->statut > Fichinter::STATUS_DRAFT) { |
1812 | 1812 | if ($object->signed_status != Fichinter::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
1813 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("InterventionSign") . '</a></div>'; |
|
1813 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("InterventionSign").'</a></div>'; |
|
1814 | 1814 | } else { |
1815 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("InterventionUnsign") . '</a></div>'; |
|
1815 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("InterventionUnsign").'</a></div>'; |
|
1816 | 1816 | } |
1817 | 1817 | } |
1818 | 1818 |
@@ -80,18 +80,18 @@ discard block |
||
80 | 80 | |
81 | 81 | |
82 | 82 | $id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid')); |
83 | -$ref = GETPOST('ref', 'alpha'); |
|
84 | -$socid = GETPOSTINT('socid'); |
|
85 | -$action = GETPOST('action', 'aZ09'); |
|
86 | -$cancel = GETPOST('cancel', 'alpha'); |
|
87 | -$confirm = GETPOST('confirm', 'alpha'); |
|
83 | +$ref = GETPOST('ref', 'alpha'); |
|
84 | +$socid = GETPOSTINT('socid'); |
|
85 | +$action = GETPOST('action', 'aZ09'); |
|
86 | +$cancel = GETPOST('cancel', 'alpha'); |
|
87 | +$confirm = GETPOST('confirm', 'alpha'); |
|
88 | 88 | $backtopage = GETPOST('backtopage', 'alpha'); |
89 | 89 | |
90 | -$lineid = GETPOSTINT('lineid'); |
|
91 | -$contactid = GETPOSTINT('contactid'); |
|
92 | -$projectid = GETPOSTINT('projectid'); |
|
93 | -$origin = GETPOST('origin', 'alpha'); |
|
94 | -$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
|
90 | +$lineid = GETPOSTINT('lineid'); |
|
91 | +$contactid = GETPOSTINT('contactid'); |
|
92 | +$projectid = GETPOSTINT('projectid'); |
|
93 | +$origin = GETPOST('origin', 'alpha'); |
|
94 | +$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
|
95 | 95 | $rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; |
96 | 96 | |
97 | 97 | |
@@ -131,26 +131,26 @@ discard block |
||
131 | 131 | $extrafields->fetch_name_optionals_label($object->table_element); |
132 | 132 | |
133 | 133 | // Load object |
134 | -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
134 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
135 | 135 | |
136 | 136 | // Permissions / Rights |
137 | -$usercanread = $user->hasRight("commande", "lire"); |
|
138 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
139 | -$usercandelete = $user->hasRight("commande", "supprimer"); |
|
137 | +$usercanread = $user->hasRight("commande", "lire"); |
|
138 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
139 | +$usercandelete = $user->hasRight("commande", "supprimer"); |
|
140 | 140 | |
141 | 141 | // Advanced permissions |
142 | -$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close'))); |
|
143 | -$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
144 | -$usercancancel = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
145 | -$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send')); |
|
146 | -$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
142 | +$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close'))); |
|
143 | +$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate'))); |
|
144 | +$usercancancel = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler'))); |
|
145 | +$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send')); |
|
146 | +$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc')); |
|
147 | 147 | |
148 | 148 | $usermustrespectpricemin = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS')); |
149 | 149 | $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); |
150 | 150 | |
151 | -$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
152 | -$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
153 | -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
151 | +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php |
|
152 | +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php |
|
153 | +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
154 | 154 | |
155 | 155 | |
156 | 156 | $error = 0; |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | $action = ''; |
198 | 198 | } |
199 | 199 | |
200 | - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
200 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
201 | 201 | |
202 | - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
202 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
203 | 203 | |
204 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
204 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
205 | 205 | |
206 | 206 | // Action clone object |
207 | 207 | if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | $pu_ht = ''; |
723 | 723 | $pu_ttc = ''; |
724 | 724 | $pu_ht_devise = ''; |
725 | - $pu_ttc_devise = ''; |
|
725 | + $pu_ttc_devise = ''; |
|
726 | 726 | |
727 | 727 | if (GETPOST('price_ht') !== '') { |
728 | 728 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
@@ -867,8 +867,8 @@ discard block |
||
867 | 867 | if (count($prodcustprice->lines) > 0) { |
868 | 868 | $pu_ht = price($prodcustprice->lines[0]->price); |
869 | 869 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
870 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
871 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
870 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
871 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
872 | 872 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
873 | 873 | $tva_tx = $prodcustprice->lines[0]->tva_tx; |
874 | 874 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -1391,7 +1391,7 @@ discard block |
||
1391 | 1391 | GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) |
1392 | 1392 | && isModEnabled('invoice') && $user->hasRight('facture', 'creer') |
1393 | 1393 | ) { |
1394 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
1394 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
1395 | 1395 | |
1396 | 1396 | $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); |
1397 | 1397 | $forceFields = array(); |
@@ -1404,7 +1404,7 @@ discard block |
||
1404 | 1404 | |
1405 | 1405 | if ($deposit) { |
1406 | 1406 | setEventMessage('DepositGenerated'); |
1407 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
1407 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
1408 | 1408 | } else { |
1409 | 1409 | $error++; |
1410 | 1410 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1412,7 +1412,7 @@ discard block |
||
1412 | 1412 | } |
1413 | 1413 | |
1414 | 1414 | // Define output language |
1415 | - if (! $error) { |
|
1415 | + if (!$error) { |
|
1416 | 1416 | $db->commit(); |
1417 | 1417 | |
1418 | 1418 | if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | } |
1441 | 1441 | |
1442 | 1442 | if ($locationTarget) { |
1443 | - header('Location: ' . $locationTarget); |
|
1443 | + header('Location: '.$locationTarget); |
|
1444 | 1444 | exit; |
1445 | 1445 | } |
1446 | 1446 | } else { |
@@ -1768,7 +1768,7 @@ discard block |
||
1768 | 1768 | |
1769 | 1769 | $classname = ucfirst($subelement); |
1770 | 1770 | $objectsrc = new $classname($db); |
1771 | - '@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general |
|
1771 | + '@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general |
|
1772 | 1772 | $objectsrc->fetch($originid); |
1773 | 1773 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
1774 | 1774 | $objectsrc->fetch_lines(); |
@@ -1865,7 +1865,7 @@ discard block |
||
1865 | 1865 | print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
1866 | 1866 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
1867 | 1867 | print '<input type="hidden" name="action" value="add">'; |
1868 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
1868 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
1869 | 1869 | print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">'; |
1870 | 1870 | print '<input type="hidden" name="origin" value="'.$origin.'">'; |
1871 | 1871 | print '<input type="hidden" name="originid" value="'.$originid.'">'; |
@@ -2044,7 +2044,7 @@ discard block |
||
2044 | 2044 | // Other attributes |
2045 | 2045 | $parameters = array(); |
2046 | 2046 | if (!empty($origin) && !empty($originid) && is_object($objectsrc)) { |
2047 | - $parameters['objectsrc'] = $objectsrc; |
|
2047 | + $parameters['objectsrc'] = $objectsrc; |
|
2048 | 2048 | } |
2049 | 2049 | $parameters['socid'] = $socid; |
2050 | 2050 | |
@@ -2261,7 +2261,7 @@ discard block |
||
2261 | 2261 | $nbMandated = 0; |
2262 | 2262 | foreach ($object->lines as $line) { |
2263 | 2263 | $res = $line->fetch_product(); |
2264 | - if ($res > 0) { |
|
2264 | + if ($res > 0) { |
|
2265 | 2265 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
2266 | 2266 | $nbMandated++; |
2267 | 2267 | break; |
@@ -2285,7 +2285,7 @@ discard block |
||
2285 | 2285 | $deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
2286 | 2286 | |
2287 | 2287 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { |
2288 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
2288 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
2289 | 2289 | |
2290 | 2290 | $object->fetchObjectLinked(); |
2291 | 2291 | |
@@ -2498,7 +2498,7 @@ discard block |
||
2498 | 2498 | $morehtmlref = '<div class="refidno">'; |
2499 | 2499 | // Ref customer |
2500 | 2500 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); |
2501 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
2501 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
2502 | 2502 | // Thirdparty |
2503 | 2503 | $morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer'); |
2504 | 2504 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -2821,36 +2821,36 @@ discard block |
||
2821 | 2821 | |
2822 | 2822 | $alert = ''; |
2823 | 2823 | if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) { |
2824 | - $alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount)); |
|
2824 | + $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); |
|
2825 | 2825 | } |
2826 | 2826 | |
2827 | 2827 | print '<tr>'; |
2828 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
2829 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2828 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
2829 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2830 | 2830 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2831 | 2831 | // Multicurrency Amount HT |
2832 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2832 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2833 | 2833 | } |
2834 | 2834 | print '</tr>'; |
2835 | 2835 | |
2836 | 2836 | print '<tr>'; |
2837 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
2838 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2837 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
2838 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2839 | 2839 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2840 | 2840 | // Multicurrency Amount VAT |
2841 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2841 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2842 | 2842 | } |
2843 | 2843 | print '</tr>'; |
2844 | 2844 | |
2845 | 2845 | // Amount Local Taxes |
2846 | 2846 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
2847 | 2847 | print '<tr>'; |
2848 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
2849 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2848 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
2849 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2850 | 2850 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2851 | 2851 | $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
2852 | 2852 | |
2853 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2853 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2854 | 2854 | } |
2855 | 2855 | print '</tr>'; |
2856 | 2856 | } |
@@ -2858,22 +2858,22 @@ discard block |
||
2858 | 2858 | // Amount Local Taxes |
2859 | 2859 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
2860 | 2860 | print '<tr>'; |
2861 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
2862 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
2861 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
2862 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
2863 | 2863 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2864 | 2864 | $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
2865 | 2865 | |
2866 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2866 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
2867 | 2867 | } |
2868 | 2868 | print '</tr>'; |
2869 | 2869 | } |
2870 | 2870 | |
2871 | 2871 | print '<tr>'; |
2872 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
2873 | - print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>'; |
|
2872 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
2873 | + print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>'; |
|
2874 | 2874 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2875 | 2875 | // Multicurrency Amount TTC |
2876 | - print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2876 | + print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
2877 | 2877 | } |
2878 | 2878 | print '</tr>'."\n"; |
2879 | 2879 | |
@@ -2990,7 +2990,7 @@ discard block |
||
2990 | 2990 | if ($usercansend) { |
2991 | 2991 | print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
2992 | 2992 | } else { |
2993 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false); |
|
2993 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false); |
|
2994 | 2994 | } |
2995 | 2995 | } |
2996 | 2996 | } |
@@ -3062,7 +3062,7 @@ discard block |
||
3062 | 3062 | }*/ |
3063 | 3063 | } else { |
3064 | 3064 | $langs->load("errors"); |
3065 | - print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
3065 | + print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
3066 | 3066 | } |
3067 | 3067 | } |
3068 | 3068 | |
@@ -3124,7 +3124,7 @@ discard block |
||
3124 | 3124 | if ($numshipping == 0) { |
3125 | 3125 | print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); |
3126 | 3126 | } else { |
3127 | - print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
3127 | + print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
3128 | 3128 | } |
3129 | 3129 | } |
3130 | 3130 | } |
@@ -44,48 +44,48 @@ discard block |
||
44 | 44 | |
45 | 45 | |
46 | 46 | // Get parameters |
47 | -$action = GETPOST('action', 'aZ09'); |
|
47 | +$action = GETPOST('action', 'aZ09'); |
|
48 | 48 | $massaction = GETPOST('massaction', 'alpha'); |
49 | 49 | $show_files = GETPOSTINT('show_files'); |
50 | -$confirm = GETPOST('confirm', 'alpha'); |
|
50 | +$confirm = GETPOST('confirm', 'alpha'); |
|
51 | 51 | $cancel = GETPOST('cancel', 'alpha'); |
52 | -$toselect = GETPOST('toselect', 'array'); |
|
52 | +$toselect = GETPOST('toselect', 'array'); |
|
53 | 53 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search |
54 | 54 | $backtopage = GETPOST('backtopage', 'alpha'); |
55 | 55 | $optioncss = GETPOST('optioncss', 'aZ'); |
56 | -$mode = GETPOST('mode', 'alpha'); |
|
56 | +$mode = GETPOST('mode', 'alpha'); |
|
57 | 57 | |
58 | 58 | // Search fields |
59 | 59 | $search = GETPOST("search", 'alpha'); |
60 | 60 | $search_id = GETPOST('search_id', 'int'); |
61 | -$search_ref = GETPOST("search_ref", 'alpha'); |
|
61 | +$search_ref = GETPOST("search_ref", 'alpha'); |
|
62 | 62 | $search_lastname = GETPOST("search_lastname", 'alpha'); |
63 | -$search_firstname = GETPOST("search_firstname", 'alpha'); |
|
63 | +$search_firstname = GETPOST("search_firstname", 'alpha'); |
|
64 | 64 | $search_gender = GETPOST("search_gender", 'alpha'); |
65 | 65 | $search_civility = GETPOST("search_civility", 'alpha'); |
66 | 66 | $search_company = GETPOST('search_company', 'alphanohtml'); |
67 | -$search_login = GETPOST("search_login", 'alpha'); |
|
67 | +$search_login = GETPOST("search_login", 'alpha'); |
|
68 | 68 | $search_address = GETPOST("search_address", 'alpha'); |
69 | -$search_zip = GETPOST("search_zip", 'alpha'); |
|
70 | -$search_town = GETPOST("search_town", 'alpha'); |
|
71 | -$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
72 | -$search_country = GETPOST("search_country", 'alpha'); |
|
69 | +$search_zip = GETPOST("search_zip", 'alpha'); |
|
70 | +$search_town = GETPOST("search_town", 'alpha'); |
|
71 | +$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
72 | +$search_country = GETPOST("search_country", 'alpha'); |
|
73 | 73 | $search_phone = GETPOST("search_phone", 'alpha'); |
74 | 74 | $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); |
75 | 75 | $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); |
76 | -$search_type = GETPOST("search_type", 'alpha'); |
|
76 | +$search_type = GETPOST("search_type", 'alpha'); |
|
77 | 77 | $search_email = GETPOST("search_email", 'alpha'); |
78 | 78 | $search_categ = GETPOST("search_categ", 'intcomma'); |
79 | -$search_morphy = GETPOST("search_morphy", 'alpha'); |
|
80 | -$search_import_key = trim(GETPOST("search_import_key", 'alpha')); |
|
79 | +$search_morphy = GETPOST("search_morphy", 'alpha'); |
|
80 | +$search_import_key = trim(GETPOST("search_import_key", 'alpha')); |
|
81 | 81 | |
82 | -$socid = GETPOSTINT('socid'); |
|
82 | +$socid = GETPOSTINT('socid'); |
|
83 | 83 | if (GETPOSTINT('catid') && empty($search_categ)) { |
84 | 84 | $search_categ = GETPOSTINT('catid'); |
85 | 85 | } |
86 | 86 | |
87 | 87 | $search_filter = GETPOST("search_filter", 'alpha'); |
88 | -$search_status = GETPOST("search_status", 'intcomma'); // status |
|
88 | +$search_status = GETPOST("search_status", 'intcomma'); // status |
|
89 | 89 | $search_datec_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datec_start_month'), GETPOSTINT('search_datec_start_day'), GETPOSTINT('search_datec_start_year')); |
90 | 90 | $search_datec_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datec_end_month'), GETPOSTINT('search_datec_end_day'), GETPOSTINT('search_datec_end_year')); |
91 | 91 | $search_datem_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datem_start_month'), GETPOSTINT('search_datem_start_day'), GETPOSTINT('search_datem_start_year')); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | } |
212 | 212 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
213 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
213 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
214 | 214 | |
215 | 215 | // Security check |
216 | 216 | $result = restrictedArea($user, 'adherent'); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $sqlfields = $sql; // $sql fields to remove for count total |
442 | 442 | |
443 | 443 | // SQL Alias adherent |
444 | -$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; // maybe better to use ad (adh) instead of d |
|
444 | +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; // maybe better to use ad (adh) instead of d |
|
445 | 445 | if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
446 | 446 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)"; |
447 | 447 | } |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | if ($searchCategoryContactOperator == 0) { |
467 | 467 | $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie = ".((int) $searchCategoryContact).")"; |
468 | 468 | } else { |
469 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); |
|
469 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryContact); |
|
470 | 470 | } |
471 | 471 | } |
472 | 472 | } |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | // Output page |
634 | 634 | // -------------------------------------------------------------------- |
635 | 635 | |
636 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-member page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
636 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-member page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
637 | 637 | |
638 | 638 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
639 | 639 | |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | } |
830 | 830 | |
831 | 831 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
832 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
832 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
833 | 833 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
834 | 834 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
835 | 835 |