@@ -102,7 +102,7 @@ |
||
102 | 102 | $sql .= " AND u.statut = ".User::STATUS_ENABLED; |
103 | 103 | $sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0); |
104 | 104 | $sql .= " AND u.dateemployment < '".$this->db->idate(dol_get_first_day($tmparray['year']))."'"; |
105 | - $sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year |
|
105 | + $sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year |
|
106 | 106 | $sql .= $this->db->plimit($max, 0); |
107 | 107 | |
108 | 108 | dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | } else { |
162 | 162 | dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE); |
163 | - sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
163 | + sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
164 | 164 | |
165 | 165 | // Load translation files required by the page |
166 | 166 | $langs->loadLangs(array('main', 'errors')); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | } else { |
176 | 176 | dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO Too many attempts", LOG_NOTICE); |
177 | - sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
177 | + sleep(1); // Anti brut force protection. Must be same delay when password is not valid |
|
178 | 178 | // Load translation files required by the page |
179 | 179 | $langs->loadLangs(array('main', 'errors')); |
180 | 180 | $_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorTooManyAttempts"); |
@@ -75,12 +75,12 @@ |
||
75 | 75 | //global $dolibarr_main_url_root; |
76 | 76 | //$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); |
77 | 77 | //$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
78 | - $urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
|
78 | + $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current |
|
79 | 79 | |
80 | 80 | //$shortscope = 'userinfo_email,userinfo_profile'; |
81 | - $shortscope = 'openid,email,profile'; // For openid connect |
|
81 | + $shortscope = 'openid,email,profile'; // For openid connect |
|
82 | 82 | |
83 | - $oauthstateanticsrf = bin2hex(random_bytes(128/8)); |
|
83 | + $oauthstateanticsrf = bin2hex(random_bytes(128 / 8)); |
|
84 | 84 | $_SESSION['oauthstateanticsrf'] = $shortscope.'-'.$oauthstateanticsrf; |
85 | 85 | |
86 | 86 | $url = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode('forlogin-'.$shortscope.'-'.$oauthstateanticsrf).'&username='.urlencode($usertotest); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | // Object card |
119 | 119 | // ------------------------------------------------------------ |
120 | - $linkback = '<a href="' . dol_buildpath('/asset/asset_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
120 | + $linkback = '<a href="'.dol_buildpath('/asset/asset_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
121 | 121 | |
122 | 122 | $morehtmlref = '<div class="refidno">'; |
123 | 123 | $morehtmlref .= '</div>'; |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | print '<table class="border centpercent tableforfield">'; |
131 | 131 | |
132 | 132 | // Number of files |
133 | - print '<tr><td class="titlefield">' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>'; |
|
133 | + print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>'; |
|
134 | 134 | |
135 | 135 | // Total size |
136 | - print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>'; |
|
136 | + print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; |
|
137 | 137 | |
138 | 138 | print '</table>'; |
139 | 139 | |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | // $permissiontoadd = 1; |
147 | 147 | $permtoedit = $user->hasRight('asset', 'write'); |
148 | 148 | // $permtoedit = 1; |
149 | - $param = '&id=' . $object->id; |
|
149 | + $param = '&id='.$object->id; |
|
150 | 150 | |
151 | 151 | //$relativepathwithnofile='asset/' . dol_sanitizeFileName($object->id).'/'; |
152 | - $relativepathwithnofile = dol_sanitizeFileName($object->ref) . '/'; |
|
152 | + $relativepathwithnofile = dol_sanitizeFileName($object->ref).'/'; |
|
153 | 153 | |
154 | - include DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; |
|
154 | + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; |
|
155 | 155 | } else { |
156 | 156 | accessforbidden('', 0, 1); |
157 | 157 | } |
@@ -216,7 +216,7 @@ |
||
216 | 216 | if (!$disable_delete) { |
217 | 217 | print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', 1); |
218 | 218 | } else { |
219 | - print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans('Delete'), '', $_SERVER["PHP_SELF"].'?id='.$object->id.'#', '', 1, [ 'attr' => ['classOverride' => 'butActionRefused']]); |
|
219 | + print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans('Delete'), '', $_SERVER["PHP_SELF"].'?id='.$object->id.'#', '', 1, ['attr' => ['classOverride' => 'butActionRefused']]); |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | } |
@@ -72,5 +72,5 @@ |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | if (empty($downloadMode)) { |
75 | - header('Content-Disposition: attachment;filename=' . $completefilename); |
|
75 | + header('Content-Disposition: attachment;filename='.$completefilename); |
|
76 | 76 | } |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); |
77 | 77 | $action = 'create'; |
78 | 78 | } else { |
79 | - $sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); |
|
79 | + $sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); |
|
80 | 80 | |
81 | - dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); |
|
81 | + dol_syslog('accountancy/admin/card.php:: $sql='.$sql); |
|
82 | 82 | $result = $db->query($sql); |
83 | 83 | $obj = $db->fetch_object($result); |
84 | 84 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | if (!$error) { |
124 | 124 | setEventMessages("RecordCreatedSuccessfully", null, 'mesgs'); |
125 | 125 | $urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php'; |
126 | - header("Location: " . $urltogo); |
|
126 | + header("Location: ".$urltogo); |
|
127 | 127 | exit; |
128 | 128 | } |
129 | 129 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) getDolGlobalInt('CHARTOFACCOUNTS')); |
143 | 143 | |
144 | - dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); |
|
144 | + dol_syslog('accountancy/admin/card.php:: $sql='.$sql); |
|
145 | 145 | $result2 = $db->query($sql); |
146 | 146 | $obj = $db->fetch_object($result2); |
147 | 147 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | $result = $object->update($user); |
172 | 172 | |
173 | 173 | if ($result > 0) { |
174 | - $urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id); |
|
175 | - header("Location: " . $urltogo); |
|
174 | + $urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id); |
|
175 | + header("Location: ".$urltogo); |
|
176 | 176 | exit(); |
177 | 177 | } elseif ($result == -2) { |
178 | 178 | setEventMessages($langs->trans("ErrorAccountNumberAlreadyExists", $object->account_number), null, 'errors'); |
@@ -264,14 +264,14 @@ discard block |
||
264 | 264 | print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">'; |
265 | 265 | // autosuggest from existing account types if found |
266 | 266 | print '<datalist id="pcg_type_datalist">'; |
267 | - $sql = "SELECT DISTINCT pcg_type FROM " . MAIN_DB_PREFIX . "accounting_account"; |
|
268 | - $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; |
|
269 | - $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. |
|
267 | + $sql = "SELECT DISTINCT pcg_type FROM ".MAIN_DB_PREFIX."accounting_account"; |
|
268 | + $sql .= " WHERE fk_pcg_version = '".$db->escape($accountsystem->ref)."'"; |
|
269 | + $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. |
|
270 | 270 | $sql .= ' LIMIT 50000'; // just as a sanity check |
271 | 271 | $resql = $db->query($sql); |
272 | 272 | if ($resql) { |
273 | 273 | while ($obj = $db->fetch_object($resql)) { |
274 | - print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">'; |
|
274 | + print '<option value="'.dol_escape_htmltag($obj->pcg_type).'">'; |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | print '</datalist>'; |
@@ -341,14 +341,14 @@ discard block |
||
341 | 341 | print '<input type="text" name="pcg_type" list="pcg_type_datalist" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">'; |
342 | 342 | // autosuggest from existing account types if found |
343 | 343 | print '<datalist id="pcg_type_datalist">'; |
344 | - $sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account'; |
|
345 | - $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; |
|
346 | - $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. |
|
344 | + $sql = 'SELECT DISTINCT pcg_type FROM '.MAIN_DB_PREFIX.'accounting_account'; |
|
345 | + $sql .= " WHERE fk_pcg_version = '".$db->escape($accountsystem->ref)."'"; |
|
346 | + $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. |
|
347 | 347 | $sql .= ' LIMIT 50000'; // just as a sanity check |
348 | 348 | $resql = $db->query($sql); |
349 | 349 | if ($resql) { |
350 | 350 | while ($obj = $db->fetch_object($resql)) { |
351 | - print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">'; |
|
351 | + print '<option value="'.dol_escape_htmltag($obj->pcg_type).'">'; |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | print '</datalist>'; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | } |
253 | 253 | } |
254 | 254 | if (empty($error)) { |
255 | - header("Location: card.php?id=" . $object->id); |
|
255 | + header("Location: card.php?id=".$object->id); |
|
256 | 256 | exit; |
257 | 257 | } |
258 | 258 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } else { |
308 | 308 | $result = $object->fetch($id); |
309 | 309 | |
310 | - $object->amount = $amount; |
|
310 | + $object->amount = $amount; |
|
311 | 311 | |
312 | 312 | $result = $object->update($user); |
313 | 313 | if ($result <= 0) { |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | // Auto create payment |
471 | 471 | print '<tr><td><label for="auto_create_paiement">'.$langs->trans('AutomaticCreationPayment').'</label></td>'; |
472 | - print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_payment) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n"; |
|
472 | + print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.(empty($auto_create_payment) ? '' : 'checked="checked"').' value="1"></td></tr>'."\n"; |
|
473 | 473 | |
474 | 474 | print '<tr class="hide_if_no_auto_create_payment">'; |
475 | 475 | print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>'; |
@@ -609,9 +609,9 @@ discard block |
||
609 | 609 | print '</td></tr>'; |
610 | 610 | |
611 | 611 | if ($action == 'edit') { |
612 | - print '<tr><td class="fieldrequired">' . $langs->trans("Amount") . '</td><td><input name="amount" size="10" value="' . price($object->amount) . '"></td></tr>'; |
|
612 | + print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.price($object->amount).'"></td></tr>'; |
|
613 | 613 | } else { |
614 | - print '<tr><td>' . $langs->trans("Amount") . '</td><td>' . price($object->amount) . '</td></tr>'; |
|
614 | + print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>'; |
|
615 | 615 | } |
616 | 616 | |
617 | 617 | // Mode of payment |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $this->type_payment = $obj->fk_typepayment; |
307 | 307 | $this->num_payment = $obj->num_payment; |
308 | 308 | $this->label = $obj->label; |
309 | - $this->note = $obj->note_private; // For backward compatibility |
|
309 | + $this->note = $obj->note_private; // For backward compatibility |
|
310 | 310 | $this->note_private = $obj->note_private; |
311 | 311 | $this->subledger_account = $obj->subledger_account; |
312 | 312 | $this->accountancy_code = $obj->accountancy_code; |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 0); |
487 | 487 | $sql .= ", ".((int) $user->id); |
488 | 488 | $sql .= ", '".$this->db->idate($now)."'"; |
489 | - $sql .= ", NULL"; // Filled later |
|
489 | + $sql .= ", NULL"; // Filled later |
|
490 | 490 | $sql .= ", ".((int) $conf->entity); |
491 | 491 | $sql .= ")"; |
492 | 492 |