@@ -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 | } |
@@ -537,8 +537,8 @@ |
||
537 | 537 | // Ref customer |
538 | 538 | //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, $user->rights->ficheinter->creer, 'string', '', 0, 1); |
539 | 539 | //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, $user->rights->ficheinter->creer, 'string', '', null, null, '', 1); |
540 | - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', 0, 1); |
|
541 | - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', null, null, '', 1); |
|
540 | + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', 0, 1); |
|
541 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $fichinter->ref_client, $fichinter, 0, 'string', '', null, null, '', 1); |
|
542 | 542 | // Thirdparty |
543 | 543 | $morehtmlref .= '<br>'.$fichinter->thirdparty->getNomUrl(1, 'customer'); |
544 | 544 | // Project |
@@ -179,9 +179,9 @@ |
||
179 | 179 | public $max_total_amount_of_all_payments; |
180 | 180 | public $preapproval_key; |
181 | 181 | public $total_amount_of_all_payments; |
182 | - public $stripe_card_ref; // External system payment mode ID |
|
183 | - public $stripe_account; // External system customer ID |
|
184 | - public $ext_payment_site; // External system 'StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ... |
|
182 | + public $stripe_card_ref; // External system payment mode ID |
|
183 | + public $stripe_account; // External system customer ID |
|
184 | + public $ext_payment_site; // External system 'StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ... |
|
185 | 185 | |
186 | 186 | /** |
187 | 187 | * @var int Status |
@@ -280,7 +280,7 @@ |
||
280 | 280 | |
281 | 281 | // Type |
282 | 282 | $membertypestatic->id = $objp->type_id; |
283 | - $membertypestatic->libelle = $objp->type_label; // deprecated |
|
283 | + $membertypestatic->libelle = $objp->type_label; // deprecated |
|
284 | 284 | $membertypestatic->label = $objp->type_label; |
285 | 285 | |
286 | 286 | print '<td class="nowrap">'; |
@@ -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 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // set filter for each period available |
138 | 138 | $filter = array(); |
139 | 139 | $doc_date_start = null; |
140 | - $doc_date_end= null; |
|
140 | + $doc_date_end = null; |
|
141 | 141 | $now = dol_now(); |
142 | 142 | $now_arr = dol_getdate($now); |
143 | 143 | $now_month = $now_arr['mon']; |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | $prev_month_date_list = array(); |
174 | 174 | $prev_month_date_list[] = dol_get_prev_month($now_month, $now_year); // get previous month for index = 0 |
175 | 175 | for ($i = 1; $i < $nb_prev_month; $i++) { |
176 | - $prev_month_date_list[] = dol_get_prev_month($prev_month_date_list[$i-1]['month'], $prev_month_date_list[$i-1]['year']); // get i+1 previous month for index=i |
|
176 | + $prev_month_date_list[] = dol_get_prev_month($prev_month_date_list[$i - 1]['month'], $prev_month_date_list[$i - 1]['year']); // get i+1 previous month for index=i |
|
177 | 177 | } |
178 | - $doc_date_start = dol_mktime(0, 0, 0, $prev_month_date_list[$nb_prev_month-1]['month'], 1, $prev_month_date_list[$nb_prev_month-1]['year']); // first day of n previous month for index=n-1 |
|
178 | + $doc_date_start = dol_mktime(0, 0, 0, $prev_month_date_list[$nb_prev_month - 1]['month'], 1, $prev_month_date_list[$nb_prev_month - 1]['year']); // first day of n previous month for index=n-1 |
|
179 | 179 | $doc_date_end = dol_get_last_day($prev_month_date_list[0]['year'], $prev_month_date_list[0]['month']); // last day of previous month for index = 0 |
180 | 180 | } elseif ($period == 'currentyear' || $period == 'lastyear') { |
181 | 181 | $period_year = $now_year; |
@@ -242,9 +242,9 @@ discard block |
||
242 | 242 | foreach ($bookkeeping->lines as $movement) { |
243 | 243 | $now = dol_now(); |
244 | 244 | |
245 | - $sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping"; |
|
246 | - $sql .= " SET date_export = '" . $this->db->idate($now) . "'"; |
|
247 | - $sql .= " WHERE rowid = " . ((int) $movement->id); |
|
245 | + $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; |
|
246 | + $sql .= " SET date_export = '".$this->db->idate($now)."'"; |
|
247 | + $sql .= " WHERE rowid = ".((int) $movement->id); |
|
248 | 248 | |
249 | 249 | $result = $this->db->query($sql); |
250 | 250 | if (!$result) { |
@@ -2387,14 +2387,14 @@ |
||
2387 | 2387 | } |
2388 | 2388 | |
2389 | 2389 | /** |
2390 | - * Export format : iSuite Expert |
|
2391 | - * |
|
2392 | - * by OpenSolus [https://opensolus.fr] |
|
2393 | - * |
|
2390 | + * Export format : iSuite Expert |
|
2391 | + * |
|
2392 | + * by OpenSolus [https://opensolus.fr] |
|
2393 | + * |
|
2394 | 2394 | * @param array $objectLines data |
2395 | 2395 | * @param resource $exportFile [=null] File resource to export or print if null |
2396 | 2396 | * @return void |
2397 | - */ |
|
2397 | + */ |
|
2398 | 2398 | public function exportiSuiteExpert($objectLines, $exportFile = null) |
2399 | 2399 | { |
2400 | 2400 | $separator = ';'; |
@@ -334,8 +334,8 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 0, $outputMode = 0, $noouput = 0) |
336 | 336 | { |
337 | - global $db, $conf, $langs; // The tpl file use $db |
|
338 | - global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
337 | + global $db, $conf, $langs; // The tpl file use $db |
|
338 | + global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
339 | 339 | |
340 | 340 | // Define name of file to save |
341 | 341 | $filename = 'general_ledger-'.$this->getFormatCode($formatexportset); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $exportFileFullName = $completefilename; |
416 | 416 | $exportFileBaseName = basename($exportFileFullName); |
417 | 417 | $exportFileName = pathinfo($exportFileBaseName, PATHINFO_FILENAME); |
418 | - $exportFilePath = $outputDir . '/' . $exportFileFullName; |
|
418 | + $exportFilePath = $outputDir.'/'.$exportFileFullName; |
|
419 | 419 | $exportFile = fopen($exportFilePath, 'w'); |
420 | 420 | if (!$exportFile) { |
421 | 421 | $this->errors[] = $langs->trans('ErrorFileNotFound', $exportFilePath); |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | ); |
430 | 430 | |
431 | 431 | // archive name and path |
432 | - $archiveFullName = $exportFileName . '.zip'; |
|
433 | - $archivePath = $outputDir . '/' . $archiveFullName; |
|
432 | + $archiveFullName = $exportFileName.'.zip'; |
|
433 | + $archivePath = $outputDir.'/'.$archiveFullName; |
|
434 | 434 | } |
435 | 435 | } |
436 | 436 | } |
@@ -568,11 +568,11 @@ discard block |
||
568 | 568 | if (!empty($downloadFileMimeType) && !empty($downloadFileFullName) && !empty($downloadFilePath) && empty($noouput)) { |
569 | 569 | // deprecated. We must not use this anymore, but have $noouput = 1 because HTTP header must be sent |
570 | 570 | // into main page not into a method. |
571 | - header('Content-Type: ' . $downloadFileMimeType); |
|
572 | - header('Content-Disposition: attachment; filename=' . $downloadFileFullName); |
|
571 | + header('Content-Type: '.$downloadFileMimeType); |
|
572 | + header('Content-Disposition: attachment; filename='.$downloadFileFullName); |
|
573 | 573 | header('Cache-Control: Public, must-revalidate'); |
574 | 574 | header('Pragma: public'); |
575 | - header('Content-Length: ' . dol_filesize($downloadFilePath)); |
|
575 | + header('Content-Length: '.dol_filesize($downloadFilePath)); |
|
576 | 576 | |
577 | 577 | readfileLowMemory($downloadFilePath); |
578 | 578 | } |
@@ -644,14 +644,14 @@ discard block |
||
644 | 644 | $refInvoice = ''; |
645 | 645 | if ($line->doc_type == 'customer_invoice') { |
646 | 646 | // Customer invoice |
647 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
647 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
648 | 648 | $invoice = new Facture($this->db); |
649 | 649 | $invoice->fetch($line->fk_doc); |
650 | 650 | |
651 | 651 | $refInvoice = $invoice->ref; |
652 | 652 | } elseif ($line->doc_type == 'supplier_invoice') { |
653 | 653 | // Supplier invoice |
654 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
654 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
655 | 655 | $invoice = new FactureFournisseur($this->db); |
656 | 656 | $invoice->fetch($line->fk_doc); |
657 | 657 | |
@@ -1999,7 +1999,7 @@ discard block |
||
1999 | 1999 | // MOPM |
2000 | 2000 | $tab[] = ""; |
2001 | 2001 | // BONP |
2002 | - $tab[] = ""; |
|
2002 | + $tab[] = ""; |
|
2003 | 2003 | // BQAF |
2004 | 2004 | $tab[] = ""; |
2005 | 2005 | // ECES |
@@ -2205,7 +2205,7 @@ discard block |
||
2205 | 2205 | } |
2206 | 2206 | } elseif ($line->doc_type == 'customer_invoice') { |
2207 | 2207 | if (($line->amount) < 0) { |
2208 | - $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
2208 | + $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
2209 | 2209 | } else { |
2210 | 2210 | $nature_piece = 'FC'; |
2211 | 2211 | } |
@@ -2414,8 +2414,8 @@ discard block |
||
2414 | 2414 | ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) { |
2415 | 2415 | if ($line->doc_type == 'customer_invoice') { |
2416 | 2416 | // Get new customer invoice ref and company name |
2417 | - $sql = 'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f'; |
|
2418 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid'; |
|
2417 | + $sql = 'SELECT f.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture as f'; |
|
2418 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON f.fk_soc = s.rowid'; |
|
2419 | 2419 | $sql .= ' WHERE f.rowid = '.((int) $line->fk_doc); |
2420 | 2420 | $resql = $this->db->query($sql); |
2421 | 2421 | if ($resql) { |
@@ -2428,8 +2428,8 @@ discard block |
||
2428 | 2428 | } |
2429 | 2429 | } else { |
2430 | 2430 | // Get new supplier invoice ref and company name |
2431 | - $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff'; |
|
2432 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid'; |
|
2431 | + $sql = 'SELECT ff.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture_fourn as ff'; |
|
2432 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON ff.fk_soc = s.rowid'; |
|
2433 | 2433 | $sql .= ' WHERE ff.rowid = '.((int) $line->fk_doc); |
2434 | 2434 | $resql = $this->db->query($sql); |
2435 | 2435 | if ($resql) { |
@@ -2467,7 +2467,7 @@ discard block |
||
2467 | 2467 | $tab[] = ""; |
2468 | 2468 | //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"'; |
2469 | 2469 | //Libellé manual |
2470 | - $tab[] = dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1); |
|
2470 | + $tab[] = dol_trunc(str_replace('"', '', $invoice_ref.(!empty($company_name) ? ' - ' : '').$company_name), 40, 'right', 'UTF-8', 1); |
|
2471 | 2471 | //Numéro de pièce |
2472 | 2472 | $tab[] = dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1); |
2473 | 2473 | //Devise |
@@ -2521,8 +2521,8 @@ discard block |
||
2521 | 2521 | } |
2522 | 2522 | $tab[] = ""; |
2523 | 2523 | $tab[] = '"'.dol_trunc(str_replace('"', '', $line->label_operation), 40, 'right', 'UTF-8', 1).'"'; |
2524 | - $tab[] = '"' . dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1) . '"'; |
|
2525 | - $tab[] = '"' . dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . '"'; |
|
2524 | + $tab[] = '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"'; |
|
2525 | + $tab[] = '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'; |
|
2526 | 2526 | $tab[] = price2num(abs($line->debit - $line->credit)); |
2527 | 2527 | $tab[] = $line->sens; |
2528 | 2528 | $tab[] = $date_document; |
@@ -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 | } |