@@ -76,10 +76,10 @@ |
||
76 | 76 | //global $dolibarr_main_url_root; |
77 | 77 | //$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); |
78 | 78 | //$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
79 | - $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
|
79 | + $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
|
80 | 80 | |
81 | 81 | //$shortscope = 'userinfo_email,userinfo_profile'; |
82 | - $shortscope = 'openid,email,profile'; // For openid connect |
|
82 | + $shortscope = 'openid,email,profile'; // For openid connect |
|
83 | 83 | |
84 | 84 | $oauthstateanticsrf = bin2hex(random_bytes(128 / 8)); |
85 | 85 | $_SESSION['oauthstateanticsrf'] = $shortscope . '-' . $oauthstateanticsrf; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | function decodeHttpBasicAuth($value) |
64 | 64 | { |
65 | - $encoded_basic_auth = substr($value, 6); // Remove the "Basic " string |
|
65 | + $encoded_basic_auth = substr($value, 6); // Remove the "Basic " string |
|
66 | 66 | $decoded_basic_auth = base64_decode($encoded_basic_auth); |
67 | 67 | $credentials_basic_auth = explode(':', $decoded_basic_auth); |
68 | 68 |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | } else { |
166 | 166 | dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '" . $usertotest . "'", LOG_NOTICE); |
167 | - sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
167 | + sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
168 | 168 | |
169 | 169 | // Load translation files required by the page |
170 | 170 | $langs->loadLangs(array('main', 'errors')); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | } else { |
180 | 180 | dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO Too many attempts", LOG_NOTICE); |
181 | - sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
181 | + sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
182 | 182 | // Load translation files required by the page |
183 | 183 | $langs->loadLangs(array('main', 'errors')); |
184 | 184 | $_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorTooManyAttempts"); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | case 'sellist': |
51 | 51 | $tmp = ''; |
52 | 52 | $tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null |
53 | - if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) { |
|
53 | + if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) { |
|
54 | 54 | $tmpkeys = array_keys($tmpparam['options']); |
55 | 55 | $tmp = array_shift($tmpkeys); |
56 | 56 | } |
@@ -265,7 +265,7 @@ |
||
265 | 265 | // Refuse email if not |
266 | 266 | $contact = new Contact($this->db); |
267 | 267 | $res = $contact->fetch($contactid); |
268 | - if (! in_array($contact, $linked_contacts)) { |
|
268 | + if (!in_array($contact, $linked_contacts)) { |
|
269 | 269 | $error_msg = $langs->trans('Error') . ': '; |
270 | 270 | $error_msg .= $langs->transnoentities('TicketWrongContact'); |
271 | 271 | setEventMessages($error_msg, [], 'errors'); |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | $objectobj2->fk_element = $objid2; |
606 | 606 | $objectobj2->elementtype = $objectobj2->element; |
607 | 607 | if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) { |
608 | - $objectobj2->actionmsg2 = $subjectreplaced; // Short text |
|
608 | + $objectobj2->actionmsg2 = $subjectreplaced; // Short text |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | $triggername = strtoupper(get_class($objectobj2)) . '_SENTBYMAIL'; |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | continue; |
1065 | 1065 | } |
1066 | 1066 | |
1067 | - if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) { |
|
1067 | + if ($objectclass == 'Holiday' && !in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) { |
|
1068 | 1068 | $langs->load("errors"); |
1069 | 1069 | $nbignored++; |
1070 | 1070 | $TMsg[] = '<div class="error">' . $langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref) . '</div><br>'; |
@@ -1468,7 +1468,7 @@ discard block |
||
1468 | 1468 | $db->begin(); |
1469 | 1469 | |
1470 | 1470 | $objecttmp = new $objectclass($db); |
1471 | - $e = new ExtraFields($db);// fetch optionals attributes and labels |
|
1471 | + $e = new ExtraFields($db); // fetch optionals attributes and labels |
|
1472 | 1472 | $e->fetch_name_optionals_label($objecttmp->table_element); |
1473 | 1473 | |
1474 | 1474 | $nbok = 0; |
@@ -1606,7 +1606,7 @@ discard block |
||
1606 | 1606 | $objecttmp->date_valid = dol_now(); |
1607 | 1607 | $objecttmp->fk_user_valid = $user->id; |
1608 | 1608 | $objecttmp->status = Holiday::STATUS_APPROVED; |
1609 | - $objecttmp->statut = $objecttmp->status; // deprecated |
|
1609 | + $objecttmp->statut = $objecttmp->status; // deprecated |
|
1610 | 1610 | |
1611 | 1611 | $verif = $objecttmp->approve($user); |
1612 | 1612 | |
@@ -1713,7 +1713,7 @@ discard block |
||
1713 | 1713 | $objecttmp = new $objectclass($db); |
1714 | 1714 | $nbok = 0; |
1715 | 1715 | $typeholiday = GETPOST('typeholiday', 'alpha'); |
1716 | - $nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5 |
|
1716 | + $nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5 |
|
1717 | 1717 | |
1718 | 1718 | if ($nbdaysholidays <= 0) { |
1719 | 1719 | setEventMessages($langs->trans("WrongAmount"), "", 'errors'); |
@@ -81,19 +81,19 @@ discard block |
||
81 | 81 | $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString($keyforuploaddir)))); |
82 | 82 | |
83 | 83 | foreach ($listofdir as $key => $tmpdir) { |
84 | - $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
84 | + $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
85 | 85 | if (!$tmpdir) { |
86 | 86 | unset($listofdir[$key]); |
87 | 87 | continue; |
88 | 88 | } |
89 | - $tmpdir = DOL_DATA_ROOT . '/' . $tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
89 | + $tmpdir = DOL_DATA_ROOT . '/' . $tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
90 | 90 | if (!is_dir($tmpdir)) { |
91 | 91 | if (empty($nomessageinsetmoduleoptions)) { |
92 | 92 | setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); |
93 | 93 | } |
94 | 94 | } else { |
95 | 95 | $upload_dir = $tmpdir; |
96 | - break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
96 | + break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -133,19 +133,19 @@ discard block |
||
133 | 133 | |
134 | 134 | foreach ($listofdir as $key => $tmpdir) { |
135 | 135 | $tmpdir = trim($tmpdir); |
136 | - $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
136 | + $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
137 | 137 | if (!$tmpdir) { |
138 | 138 | unset($listofdir[$key]); |
139 | 139 | continue; |
140 | 140 | } |
141 | - $tmpdir = DOL_DATA_ROOT . '/' . $tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
141 | + $tmpdir = DOL_DATA_ROOT . '/' . $tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
142 | 142 | if (!is_dir($tmpdir)) { |
143 | 143 | if (empty($nomessageinsetmoduleoptions)) { |
144 | 144 | setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); |
145 | 145 | } |
146 | 146 | } else { |
147 | 147 | $upload_dir = $tmpdir; |
148 | - break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
148 | + break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | } |
192 | 192 | |
193 | 193 | // Fetch optionals attributes and labels |
194 | -$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
194 | +$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
195 | 195 | //$extrafields->fetch_name_optionals_label($object->table_element_line); |
196 | 196 | |
197 | 197 | $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); |
@@ -216,14 +216,14 @@ discard block |
||
216 | 216 | $crits = explode(' ', trim($value)); // the string after the name of the field. Explode on each AND |
217 | 217 | $res = ''; |
218 | 218 | |
219 | - $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
219 | + $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
220 | 220 | foreach ($crits as $crit) { // Loop on each AND criteria |
221 | 221 | $crit = trim($crit); |
222 | 222 | |
223 | - $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
223 | + $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
224 | 224 | $newres = ''; |
225 | 225 | $tmpcrits = explode('|', $crit); |
226 | - $i3 = 0; // count the nb of valid criteria added for this current field |
|
226 | + $i3 = 0; // count the nb of valid criteria added for this current field |
|
227 | 227 | foreach ($tmpcrits as $tmpcrit) { |
228 | 228 | if ($tmpcrit !== '0' && empty($tmpcrit)) { |
229 | 229 | continue; |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
244 | - $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
245 | - $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
244 | + $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
245 | + $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
246 | 246 | //var_dump($field); var_dump($tmpcrit); var_dump($i3); |
247 | 247 | |
248 | 248 | $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | foreach ($arrayofmesures as $key => $val) { |
613 | 613 | $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; |
614 | 614 | } |
615 | - print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
615 | + print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
616 | 616 | print '</div>'; |
617 | 617 | |
618 | 618 | // XAxis |
@@ -620,14 +620,14 @@ discard block |
||
620 | 620 | print '<div class="divadvancedsearchfield">'; |
621 | 621 | print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("XAxis")) . '"></span><span class="fas fa-caret-down caretdownaxis" title="' . dol_escape_htmltag($langs->trans("XAxis")) . '"></span></div>'; |
622 | 622 | //var_dump($arrayofxaxis); |
623 | - print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400'); // Fill the array $arrayofxaxis with possible fields |
|
623 | + print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400'); // Fill the array $arrayofxaxis with possible fields |
|
624 | 624 | print '</div>'; |
625 | 625 | |
626 | 626 | // Group by |
627 | 627 | $count = 0; |
628 | 628 | print '<div class="divadvancedsearchfield">'; |
629 | 629 | print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("GroupBy")) . '"></span></div>'; |
630 | - print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
630 | + print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
631 | 631 | print '</div>'; |
632 | 632 | |
633 | 633 | |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | //var_dump($arrayofgroupby); |
785 | 785 | $tmpforloop = dolExplodeIntoArray($arrayofxaxis[$val]['tablefromt'], ','); |
786 | 786 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
787 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
787 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
788 | 788 | $tmpforexplode = explode('__', $tmptablealias); |
789 | 789 | $endpart = end($tmpforexplode); |
790 | 790 | $parenttableandfield = preg_replace('/__' . $endpart . '$/', '', $tmptablealias) . '.' . $endpart; |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | //var_dump($arrayofgroupby[$val]); var_dump($tmpval); |
812 | 812 | $tmpforloop = dolExplodeIntoArray($arrayofgroupby[$val]['tablefromt'], ','); |
813 | 813 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
814 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
814 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
815 | 815 | $tmpforexplode = explode('__', $tmptablealias); |
816 | 816 | $endpart = end($tmpforexplode); |
817 | 817 | $parenttableandfield = preg_replace('/__' . $endpart . '$/', '', $tmptablealias) . '.' . $endpart; |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | //var_dump($arrayofgroupby); |
839 | 839 | $tmpforloop = dolExplodeIntoArray($arrayofmesures[$val]['tablefromt'], ','); |
840 | 840 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
841 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
841 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
842 | 842 | $tmpforexplode = explode('__', $tmptablealias); |
843 | 843 | $endpart = end($tmpforexplode); |
844 | 844 | $parenttableandfield = preg_replace('/__' . $endpart . '$/', '', $tmptablealias) . '.' . $endpart; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | ob_start(); |
27 | 27 | |
28 | -require 'config.inc.php'; // This include the main.inc.php |
|
28 | +require 'config.inc.php'; // This include the main.inc.php |
|
29 | 29 | require 'connector.lib.php'; |
30 | 30 | |
31 | 31 | if (!$Config['Enabled']) { |