@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } else { |
202 | 202 | // Create the prospect |
203 | 203 | if (GETPOST('societe', 'alpha')) { |
204 | - $thirdparty->name = GETPOST('societe', 'alpha'); |
|
204 | + $thirdparty->name = GETPOST('societe', 'alpha'); |
|
205 | 205 | $thirdparty->name_alias = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('lastname', 'alpha')); |
206 | 206 | } else { |
207 | 207 | $thirdparty->name = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('lastname', 'alpha')); |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | } |
534 | 534 | |
535 | 535 | // Other attributes |
536 | -$parameters['tpl_context'] = 'public'; // define template context to public |
|
536 | +$parameters['tpl_context'] = 'public'; // define template context to public |
|
537 | 537 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
538 | 538 | // Comments |
539 | 539 | print '<tr>'; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | $partnership->status = 0; |
210 | 210 | $partnership->note_private = GETPOST('note_private'); |
211 | - $partnership->date_creation = dol_now(); |
|
211 | + $partnership->date_creation = dol_now(); |
|
212 | 212 | $partnership->date_partnership_start = dol_now(); |
213 | 213 | $partnership->fk_user_creat = 0; |
214 | 214 | $partnership->fk_type = GETPOSTINT('partnershiptype'); |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | |
589 | 589 | if (getDolGlobalInt('PARTNERSHIP_NEWFORM_FORCETYPE')) { |
590 | 590 | print $listofpartnership[getDolGlobalInt('PARTNERSHIP_NEWFORM_FORCETYPE')]; |
591 | - print '<input type="hidden" id="partnershiptype" name="partnershiptype" value="' . getDolGlobalInt('PARTNERSHIP_NEWFORM_FORCETYPE').'">'; |
|
591 | + print '<input type="hidden" id="partnershiptype" name="partnershiptype" value="'.getDolGlobalInt('PARTNERSHIP_NEWFORM_FORCETYPE').'">'; |
|
592 | 592 | } |
593 | 593 | |
594 | 594 | print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n"; |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | //print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n"; |
666 | 666 | // Other attributes |
667 | 667 | $parameters['tdclass'] = 'titlefieldauto'; |
668 | -$parameters['tpl_context'] = 'public'; // define template context to public |
|
668 | +$parameters['tpl_context'] = 'public'; // define template context to public |
|
669 | 669 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
670 | 670 | // Comments |
671 | 671 | print '<tr>'; |
@@ -63,17 +63,17 @@ |
||
63 | 63 | 'chatgpt' => array( |
64 | 64 | 'label' => 'ChatGPT', |
65 | 65 | 'url' => 'https://api.openai.com/v1/', |
66 | - 'textgeneration' => 'gpt-3.5-turbo', // a lot of text transformation like: 'textgenerationemail', 'textgenerationwebpage', 'textgeneration', 'texttranslation', 'textsummarize' |
|
66 | + 'textgeneration' => 'gpt-3.5-turbo', // a lot of text transformation like: 'textgenerationemail', 'textgenerationwebpage', 'textgeneration', 'texttranslation', 'textsummarize' |
|
67 | 67 | 'imagegeneration' => 'dall-e-3', |
68 | 68 | 'audiogeneration' => 'tts-1', |
69 | 69 | 'videogeneration' => 'na', |
70 | - 'transcription' => 'whisper-1', // audio to text |
|
71 | - 'translation' => 'whisper-1', // audio to text into another language |
|
70 | + 'transcription' => 'whisper-1', // audio to text |
|
71 | + 'translation' => 'whisper-1', // audio to text into another language |
|
72 | 72 | ), |
73 | 73 | 'groq' => array( |
74 | 74 | 'label' => 'Groq', |
75 | 75 | 'url' => 'https://api.groq.com/openai/', |
76 | - 'textgeneration' => 'mixtral-8x7b-32768', // 'llama3-8b-8192', 'gemma-7b-it' |
|
76 | + 'textgeneration' => 'mixtral-8x7b-32768', // 'llama3-8b-8192', 'gemma-7b-it' |
|
77 | 77 | 'imagegeneration' => 'na', |
78 | 78 | 'audiogeneration' => 'na', |
79 | 79 | 'videogeneration' => 'na', |
@@ -206,14 +206,14 @@ discard block |
||
206 | 206 | $payload = json_encode($arrayforpayload); |
207 | 207 | |
208 | 208 | $headers = array( |
209 | - 'Authorization: Bearer ' . $this->apiKey, |
|
209 | + 'Authorization: Bearer '.$this->apiKey, |
|
210 | 210 | 'Content-Type: application/json' |
211 | 211 | ); |
212 | 212 | |
213 | 213 | if (getDolGlobalString("AI_DEBUG")) { |
214 | 214 | if (@is_writable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir |
215 | 215 | $outputfile = $dolibarr_main_data_root."/dolibarr_ai.log"; |
216 | - $fp = fopen($outputfile, "w"); // overwrite |
|
216 | + $fp = fopen($outputfile, "w"); // overwrite |
|
217 | 217 | |
218 | 218 | if ($fp) { |
219 | 219 | fwrite($fp, var_export($headers, true)."\n"); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | - $localurl = 2; // Accept both local and external endpoints |
|
228 | + $localurl = 2; // Accept both local and external endpoints |
|
229 | 229 | $response = getURLContent($this->apiEndpoint, 'POST', $payload, 1, $headers, array('http', 'https'), $localurl); |
230 | 230 | |
231 | 231 | if (empty($response['http_code'])) { |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | : ''; |
251 | 251 | |
252 | 252 | if ($type !== 'separate') { |
253 | - if (in_array($type, array('point','multipts','linestrg','polygon'))) { |
|
253 | + if (in_array($type, array('point', 'multipts', 'linestrg', 'polygon'))) { |
|
254 | 254 | $sql .= ", ST_AsWKT(ef.".$key.") as ".$key; |
255 | 255 | } else { |
256 | 256 | $sql .= ", ef.".$key; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | $objp = $this->db->fetch_object($result); |
275 | 275 | |
276 | 276 | if (!$objp) { |
277 | - $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; |
|
277 | + $this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql; |
|
278 | 278 | return 0; |
279 | 279 | } |
280 | 280 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $this->multicurrency_total_tva = $objp->multicurrency_total_tva; |
336 | 336 | $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; |
337 | 337 | |
338 | - $this->packaging = $objp->packaging; |
|
338 | + $this->packaging = $objp->packaging; |
|
339 | 339 | |
340 | 340 | $this->array_options = array(); |
341 | 341 | if ($doFetchInOneSqlRequest && $extraFieldsCheck) { |
@@ -349,15 +349,15 @@ discard block |
||
349 | 349 | |
350 | 350 | // date/datetime |
351 | 351 | if (in_array($type, array('date', 'datetime'))) { |
352 | - $this->array_options['options_' . $key] = $this->db->jdate($rawval); |
|
352 | + $this->array_options['options_'.$key] = $this->db->jdate($rawval); |
|
353 | 353 | } elseif ($type == 'password') { |
354 | 354 | if (!empty($rawval) && preg_match('/^dolcrypt:/', $rawval)) { |
355 | - $this->array_options['options_' . $key] = dolDecrypt($rawval); |
|
355 | + $this->array_options['options_'.$key] = dolDecrypt($rawval); |
|
356 | 356 | } else { |
357 | - $this->array_options['options_' . $key] = $rawval; |
|
357 | + $this->array_options['options_'.$key] = $rawval; |
|
358 | 358 | } |
359 | 359 | } else { |
360 | - $this->array_options['options_' . $key] = $rawval; |
|
360 | + $this->array_options['options_'.$key] = $rawval; |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (empty($conf->disable_compute)) { |
369 | 369 | global $objectoffield; |
370 | 370 | $objectoffield = $this; |
371 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
371 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
372 | 372 | } |
373 | 373 | } |
374 | 374 | } |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | $sql .= ", date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null"); |
744 | 744 | $sql .= ", product_type=".$this->product_type; |
745 | 745 | $sql .= ", info_bits='".$this->db->escape((string) $this->info_bits)."'"; |
746 | - $sql .= ", special_code=" . (int) $this->special_code; |
|
746 | + $sql .= ", special_code=".(int) $this->special_code; |
|
747 | 747 | if (empty($this->skip_update_total)) { |
748 | 748 | $sql .= ", total_ht=".price2num($this->total_ht); |
749 | 749 | $sql .= ", total_tva=".price2num($this->total_tva); |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | $this->mode_reglement_id = 0; |
507 | 507 | } |
508 | 508 | $this->status = self::STATUS_DRAFT; |
509 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
509 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
510 | 510 | |
511 | 511 | if (!empty($this->multicurrency_code)) { |
512 | 512 | // Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate) |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | if (!empty($_facrec->frequency)) { // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence. |
593 | 593 | $this->socid = $_facrec->socid; |
594 | 594 | } |
595 | - $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
595 | + $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
596 | 596 | |
597 | 597 | // Fields coming from GUI. |
598 | 598 | // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | $this->mode_reglement_id = 0; |
632 | 632 | } |
633 | 633 | $this->status = self::STATUS_DRAFT; |
634 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
634 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
635 | 635 | |
636 | 636 | $this->linked_objects = $_facrec->linkedObjectsIds; |
637 | 637 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | |
880 | 880 | // Complete vat rate with code |
881 | 881 | $vatrate = $newinvoiceline->tva_tx; |
882 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) { |
|
882 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) { |
|
883 | 883 | $vatrate .= ' ('.$newinvoiceline->vat_src_code.')'; |
884 | 884 | } |
885 | 885 | |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | ($_facrec->lines[$i]->date_end_fill == 1 && $previousdaynextdatewhen) ? $previousdaynextdatewhen : '', |
1088 | 1088 | 0, |
1089 | 1089 | $tva_npr, |
1090 | - 0, // fk_remise_except |
|
1090 | + 0, // fk_remise_except |
|
1091 | 1091 | 'HT', |
1092 | 1092 | 0, |
1093 | 1093 | $_facrec->lines[$i]->product_type, |
@@ -1100,8 +1100,8 @@ discard block |
||
1100 | 1100 | $buyprice, |
1101 | 1101 | $_facrec->lines[$i]->label, |
1102 | 1102 | empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options, |
1103 | - 100, // situation percent is undefined on recurring invoice lines |
|
1104 | - 0, // fk_prev_id |
|
1103 | + 100, // situation percent is undefined on recurring invoice lines |
|
1104 | + 0, // fk_prev_id |
|
1105 | 1105 | $_facrec->lines[$i]->fk_unit, |
1106 | 1106 | $_facrec->lines[$i]->multicurrency_subprice, |
1107 | 1107 | $_facrec->lines[$i]->ref_ext, |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | |
1190 | 1190 | $facture->fk_facture_source = $this->fk_facture_source; |
1191 | 1191 | $facture->type = $this->type; |
1192 | - $facture->subtype = $this->subtype; |
|
1192 | + $facture->subtype = $this->subtype; |
|
1193 | 1193 | $facture->socid = $this->socid; |
1194 | 1194 | $facture->date = $this->date; |
1195 | 1195 | $facture->date_pointoftax = $this->date_pointoftax; |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | |
1207 | 1207 | $facture->origin = $this->origin; |
1208 | 1208 | $facture->origin_id = $this->origin_id; |
1209 | - $facture->fk_account = $this->fk_account; |
|
1209 | + $facture->fk_account = $this->fk_account; |
|
1210 | 1210 | |
1211 | 1211 | $facture->lines = $this->lines; // Array of lines of invoice |
1212 | 1212 | $facture->situation_counter = $this->situation_counter; |
@@ -1473,8 +1473,8 @@ discard block |
||
1473 | 1473 | $this->fk_account = $object->fk_account; |
1474 | 1474 | $this->cond_reglement_id = $object->cond_reglement_id; |
1475 | 1475 | $this->mode_reglement_id = $object->mode_reglement_id; |
1476 | - $this->fk_incoterms = $object->fk_incoterms; |
|
1477 | - $this->location_incoterms = $object->location_incoterms; |
|
1476 | + $this->fk_incoterms = $object->fk_incoterms; |
|
1477 | + $this->location_incoterms = $object->location_incoterms; |
|
1478 | 1478 | $this->availability_id = $object->availability_id; |
1479 | 1479 | $this->demand_reason_id = $object->demand_reason_id; |
1480 | 1480 | $this->delivery_date = $object->delivery_date; |
@@ -1683,7 +1683,7 @@ discard block |
||
1683 | 1683 | { |
1684 | 1684 | global $conf, $langs, $hookmanager, $action; |
1685 | 1685 | |
1686 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
1686 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
1687 | 1687 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
1688 | 1688 | return null; |
1689 | 1689 | } |
@@ -1693,7 +1693,7 @@ discard block |
||
1693 | 1693 | return null; |
1694 | 1694 | } |
1695 | 1695 | |
1696 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
1696 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
1697 | 1697 | |
1698 | 1698 | if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) { |
1699 | 1699 | $origin->error = 'ErrorDateIsInFuture'; |
@@ -1737,7 +1737,7 @@ discard block |
||
1737 | 1737 | $deposit->pos_source = $origin->pos_source; |
1738 | 1738 | $deposit->model_pdf = 'crabe'; |
1739 | 1739 | |
1740 | - $modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type; |
|
1740 | + $modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type; |
|
1741 | 1741 | |
1742 | 1742 | if (getDolGlobalString($modelByTypeConfName)) { |
1743 | 1743 | $deposit->model_pdf = getDolGlobalString($modelByTypeConfName); |
@@ -1797,10 +1797,10 @@ discard block |
||
1797 | 1797 | $descriptions[$key] = ''; |
1798 | 1798 | } |
1799 | 1799 | $TTotalByTva[$key] += $line->total_ttc; |
1800 | - $descriptions[$key] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); |
|
1801 | - $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); |
|
1802 | - $descriptions[$key] .= $langs->trans('Qty') . ' : ' . $line->qty; |
|
1803 | - $descriptions[$key] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>'; |
|
1800 | + $descriptions[$key] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : ''); |
|
1801 | + $descriptions[$key] .= (!empty($line->product_label) ? $line->product_label.' - ' : ''); |
|
1802 | + $descriptions[$key] .= $langs->trans('Qty').' : '.$line->qty; |
|
1803 | + $descriptions[$key] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>'; |
|
1804 | 1804 | } |
1805 | 1805 | |
1806 | 1806 | foreach ($TTotalByTva as $tva => &$total) { |
@@ -1824,10 +1824,10 @@ discard block |
||
1824 | 1824 | $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? |
1825 | 1825 | $tva_tx = $lines[$i]->tva_tx; |
1826 | 1826 | $amountdeposit[$tva_tx] += ((float) $lines[$i]->total_ht * (float) $origin->deposit_percent) / 100; |
1827 | - $descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); |
|
1828 | - $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); |
|
1829 | - $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; |
|
1830 | - $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>'; |
|
1827 | + $descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : ''); |
|
1828 | + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : ''); |
|
1829 | + $descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty; |
|
1830 | + $descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>'; |
|
1831 | 1831 | } |
1832 | 1832 | |
1833 | 1833 | if ($totalamount == 0) { |
@@ -1842,11 +1842,11 @@ discard block |
||
1842 | 1842 | continue; |
1843 | 1843 | } |
1844 | 1844 | |
1845 | - $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; |
|
1845 | + $descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref; |
|
1846 | 1846 | |
1847 | 1847 | // Hidden conf |
1848 | 1848 | if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) { |
1849 | - $descline .= '<ul>' . $descriptions[$tva] . '</ul>'; |
|
1849 | + $descline .= '<ul>'.$descriptions[$tva].'</ul>'; |
|
1850 | 1850 | } |
1851 | 1851 | |
1852 | 1852 | $addlineResult = $deposit->addline( |
@@ -2234,7 +2234,7 @@ discard block |
||
2234 | 2234 | : ''; |
2235 | 2235 | |
2236 | 2236 | if ($type !== 'separate') { |
2237 | - if (in_array($type, array('point','multipts','linestrg','polygon'))) { |
|
2237 | + if (in_array($type, array('point', 'multipts', 'linestrg', 'polygon'))) { |
|
2238 | 2238 | $sql .= ", ST_AsWKT(ef.".$key.") as ".$key; |
2239 | 2239 | } else { |
2240 | 2240 | $sql .= ", ef.".$key; |
@@ -2276,9 +2276,9 @@ discard block |
||
2276 | 2276 | $this->id = $obj->rowid; |
2277 | 2277 | $this->entity = $obj->entity; |
2278 | 2278 | |
2279 | - $this->ref = $obj->ref; |
|
2280 | - $this->ref_client = $obj->ref_client; |
|
2281 | - $this->ref_customer = $obj->ref_client; |
|
2279 | + $this->ref = $obj->ref; |
|
2280 | + $this->ref_client = $obj->ref_client; |
|
2281 | + $this->ref_customer = $obj->ref_client; |
|
2282 | 2282 | $this->ref_ext = $obj->ref_ext; |
2283 | 2283 | $this->type = $obj->type; |
2284 | 2284 | $this->subtype = $obj->subtype; |
@@ -2304,7 +2304,7 @@ discard block |
||
2304 | 2304 | $this->fk_project = $obj->fk_project; |
2305 | 2305 | $this->project = null; // Clear if another value was already set by fetch_projet |
2306 | 2306 | |
2307 | - $this->statut = $obj->status; // deprecated |
|
2307 | + $this->statut = $obj->status; // deprecated |
|
2308 | 2308 | $this->status = $obj->status; |
2309 | 2309 | |
2310 | 2310 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -2320,7 +2320,7 @@ discard block |
||
2320 | 2320 | $this->fk_fac_rec_source = $obj->fk_fac_rec_source; |
2321 | 2321 | $this->note = $obj->note_private; // deprecated |
2322 | 2322 | $this->note_private = $obj->note_private; |
2323 | - $this->note_public = $obj->note_public; |
|
2323 | + $this->note_public = $obj->note_public; |
|
2324 | 2324 | $this->user_creation_id = $obj->fk_user_author; |
2325 | 2325 | $this->user_validation_id = $obj->fk_user_valid; |
2326 | 2326 | $this->user_modification_id = $obj->fk_user_modif; |
@@ -2367,15 +2367,15 @@ discard block |
||
2367 | 2367 | |
2368 | 2368 | // date/datetime |
2369 | 2369 | if (in_array($type, array('date', 'datetime'))) { |
2370 | - $this->array_options['options_' . $key] = $this->db->jdate($rawval); |
|
2370 | + $this->array_options['options_'.$key] = $this->db->jdate($rawval); |
|
2371 | 2371 | } elseif ($type == 'password') { |
2372 | 2372 | if (!empty($rawval) && preg_match('/^dolcrypt:/', $rawval)) { |
2373 | - $this->array_options['options_' . $key] = dolDecrypt($rawval); |
|
2373 | + $this->array_options['options_'.$key] = dolDecrypt($rawval); |
|
2374 | 2374 | } else { |
2375 | - $this->array_options['options_' . $key] = $rawval; |
|
2375 | + $this->array_options['options_'.$key] = $rawval; |
|
2376 | 2376 | } |
2377 | 2377 | } else { |
2378 | - $this->array_options['options_' . $key] = $rawval; |
|
2378 | + $this->array_options['options_'.$key] = $rawval; |
|
2379 | 2379 | } |
2380 | 2380 | } |
2381 | 2381 | } |
@@ -2386,7 +2386,7 @@ discard block |
||
2386 | 2386 | if (empty($conf->disable_compute)) { |
2387 | 2387 | global $objectoffield; |
2388 | 2388 | $objectoffield = $this; |
2389 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
2389 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
2390 | 2390 | } |
2391 | 2391 | } |
2392 | 2392 | } |
@@ -2482,7 +2482,7 @@ discard block |
||
2482 | 2482 | : ''; |
2483 | 2483 | |
2484 | 2484 | if ($type !== 'separate') { |
2485 | - if (in_array($type, array('point','multipts','linestrg','polygon'))) { |
|
2485 | + if (in_array($type, array('point', 'multipts', 'linestrg', 'polygon'))) { |
|
2486 | 2486 | $sql .= ", ST_AsWKT(ef.".$key.") as ".$key; |
2487 | 2487 | } else { |
2488 | 2488 | $sql .= ", ef.".$key; |
@@ -2522,7 +2522,7 @@ discard block |
||
2522 | 2522 | $line->ref = $objp->product_ref; // Ref product |
2523 | 2523 | $line->product_ref = $objp->product_ref; // Ref product |
2524 | 2524 | $line->libelle = $objp->product_label; // deprecated |
2525 | - $line->product_label = $objp->product_label; // Label product |
|
2525 | + $line->product_label = $objp->product_label; // Label product |
|
2526 | 2526 | $line->product_barcode = $objp->product_barcode; // Barcode number product |
2527 | 2527 | $line->product_desc = $objp->product_desc; // Description product |
2528 | 2528 | $line->fk_product_type = $objp->fk_product_type; // Type of product |
@@ -2588,15 +2588,15 @@ discard block |
||
2588 | 2588 | |
2589 | 2589 | // date/datetime |
2590 | 2590 | if (in_array($type, array('date', 'datetime'))) { |
2591 | - $this->array_options['options_' . $key] = $this->db->jdate($rawval); |
|
2591 | + $this->array_options['options_'.$key] = $this->db->jdate($rawval); |
|
2592 | 2592 | } elseif ($type == 'password') { |
2593 | 2593 | if (!empty($rawval) && preg_match('/^dolcrypt:/', $rawval)) { |
2594 | - $this->array_options['options_' . $key] = dolDecrypt($rawval); |
|
2594 | + $this->array_options['options_'.$key] = dolDecrypt($rawval); |
|
2595 | 2595 | } else { |
2596 | - $this->array_options['options_' . $key] = $rawval; |
|
2596 | + $this->array_options['options_'.$key] = $rawval; |
|
2597 | 2597 | } |
2598 | 2598 | } else { |
2599 | - $this->array_options['options_' . $key] = $rawval; |
|
2599 | + $this->array_options['options_'.$key] = $rawval; |
|
2600 | 2600 | } |
2601 | 2601 | } |
2602 | 2602 | } |
@@ -2607,7 +2607,7 @@ discard block |
||
2607 | 2607 | if (empty($conf->disable_compute)) { |
2608 | 2608 | global $objectoffield; |
2609 | 2609 | $objectoffield = $this; |
2610 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2'); |
|
2610 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2'); |
|
2611 | 2611 | } |
2612 | 2612 | } |
2613 | 2613 | } |
@@ -3461,10 +3461,10 @@ discard block |
||
3461 | 3461 | if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer')) |
3462 | 3462 | || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) { |
3463 | 3463 | $this->error = 'Permission denied'; |
3464 | - dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3464 | + dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
3465 | 3465 | return -1; |
3466 | 3466 | } |
3467 | - if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3467 | + if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
3468 | 3468 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
3469 | 3469 | ) { |
3470 | 3470 | $this->date = dol_now(); |
@@ -3648,7 +3648,7 @@ discard block |
||
3648 | 3648 | for ($i = 0; $i < $cpt; $i++) { |
3649 | 3649 | if ($this->lines[$i]->fk_product > 0) { |
3650 | 3650 | $mouvP = new MouvementStock($this->db); |
3651 | - $mouvP->origin = &$this; // deprecated |
|
3651 | + $mouvP->origin = &$this; // deprecated |
|
3652 | 3652 | $mouvP->setOrigin($this->element, $this->id); |
3653 | 3653 | |
3654 | 3654 | // We decrease stock for product |
@@ -3817,7 +3817,7 @@ discard block |
||
3817 | 3817 | // Set new ref and define current status |
3818 | 3818 | if (!$error) { |
3819 | 3819 | $this->ref = $num; |
3820 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3820 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
3821 | 3821 | $this->status = self::STATUS_VALIDATED; |
3822 | 3822 | $this->date_validation = $now; |
3823 | 3823 | $i = 0; |
@@ -3995,7 +3995,7 @@ discard block |
||
3995 | 3995 | |
3996 | 3996 | if ($error == 0) { |
3997 | 3997 | $old_statut = $this->status; |
3998 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
3998 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
3999 | 3999 | $this->status = self::STATUS_DRAFT; |
4000 | 4000 | |
4001 | 4001 | // Call trigger |
@@ -4533,8 +4533,8 @@ discard block |
||
4533 | 4533 | $rangmax = $this->line_max($fk_parent_line); |
4534 | 4534 | $this->line->rang = $rangmax + 1; |
4535 | 4535 | } |
4536 | - $apply_abs_price_on_credit_note=false; |
|
4537 | - if ($this->type == self::TYPE_CREDIT_NOTE && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) { |
|
4536 | + $apply_abs_price_on_credit_note = false; |
|
4537 | + if ($this->type == self::TYPE_CREDIT_NOTE && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) { |
|
4538 | 4538 | $apply_abs_price_on_credit_note = true; |
4539 | 4539 | } |
4540 | 4540 | |
@@ -4967,7 +4967,7 @@ discard block |
||
4967 | 4967 | } |
4968 | 4968 | |
4969 | 4969 | if (!empty($addon)) { |
4970 | - dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
4970 | + dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
4971 | 4971 | |
4972 | 4972 | $mybool = false; |
4973 | 4973 | |
@@ -5434,7 +5434,7 @@ discard block |
||
5434 | 5434 | |
5435 | 5435 | if (empty($option) || $option != 'nolines') { |
5436 | 5436 | // Lines |
5437 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
5437 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
5438 | 5438 | $xnbp = 0; |
5439 | 5439 | while ($xnbp < $nbp) { |
5440 | 5440 | $line = new FactureLigne($this->db); |
@@ -6062,14 +6062,14 @@ discard block |
||
6062 | 6062 | if (!empty($paymentmode) && $paymentmode != 'all') { |
6063 | 6063 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
6064 | 6064 | } |
6065 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
6066 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
6065 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
6066 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
6067 | 6067 | if ($datetouse == 'invoicedate') { |
6068 | 6068 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
6069 | 6069 | } else { |
6070 | 6070 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
6071 | 6071 | } |
6072 | - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
6072 | + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
6073 | 6073 | if (!empty($paymentmode) && $paymentmode != 'all') { |
6074 | 6074 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
6075 | 6075 | } |
@@ -6288,7 +6288,7 @@ discard block |
||
6288 | 6288 | $actioncomm->create($user); |
6289 | 6289 | } |
6290 | 6290 | |
6291 | - $this->db->commit(); // We always commit |
|
6291 | + $this->db->commit(); // We always commit |
|
6292 | 6292 | } |
6293 | 6293 | |
6294 | 6294 | if ($errormesg) { |
@@ -6330,7 +6330,7 @@ discard block |
||
6330 | 6330 | // get date of last validated invoices of same type |
6331 | 6331 | $sql = "SELECT datef"; |
6332 | 6332 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
6333 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
6333 | + $sql .= " WHERE type = ".(int) $this->type; |
|
6334 | 6334 | $sql .= " AND date_valid IS NOT NULL"; |
6335 | 6335 | $sql .= " AND entity IN (".getEntity('invoice').")"; |
6336 | 6336 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | session_set_cookie_params($sessioncookieparams); |
136 | 136 | } |
137 | 137 | session_name($sessionname); |
138 | - dol_session_start(); // This call the open and read of session handler |
|
138 | + dol_session_start(); // This call the open and read of session handler |
|
139 | 139 | //exit; // this exist generates a call to write and close |
140 | 140 | } |
141 | 141 | |
@@ -163,11 +163,11 @@ discard block |
||
163 | 163 | if (!$ok) { |
164 | 164 | if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { |
165 | 165 | print 'Sorry, your application is offline.'."\n"; |
166 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
166 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
167 | 167 | $nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); |
168 | 168 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
169 | 169 | } else { |
170 | - print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
170 | + print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
171 | 171 | $nexturl = DOL_URL_ROOT.'/'; |
172 | 172 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
173 | 173 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n"; |
384 | 384 | print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0"; |
385 | 385 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
386 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
386 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
387 | 387 | } |
388 | 388 | print " into setup).\n"; |
389 | 389 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | unset($_GET['action']); |
412 | 412 | unset($_GET['confirmmassaction']); |
413 | 413 | unset($_GET['massaction']); |
414 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
414 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
415 | 415 | if (isset($savid)) { |
416 | 416 | $_POST['id'] = ((int) $savid); |
417 | 417 | } |
@@ -433,18 +433,18 @@ discard block |
||
433 | 433 | foreach ($disabled_modules as $module) { |
434 | 434 | if ($module) { |
435 | 435 | if (empty($conf->$module)) { |
436 | - $conf->$module = new stdClass(); // To avoid warnings |
|
436 | + $conf->$module = new stdClass(); // To avoid warnings |
|
437 | 437 | } |
438 | 438 | |
439 | - $conf->$module->enabled = false; // Old usage |
|
439 | + $conf->$module->enabled = false; // Old usage |
|
440 | 440 | unset($conf->modules[$module]); |
441 | 441 | |
442 | 442 | foreach ($modulepartkeys as $modulepartkey) { |
443 | 443 | unset($conf->modules_parts[$modulepartkey][$module]); |
444 | 444 | } |
445 | 445 | if ($module == 'fournisseur') { // Special case |
446 | - $conf->supplier_order->enabled = 0; // Old usage |
|
447 | - $conf->supplier_invoice->enabled = 0; // Old usage |
|
446 | + $conf->supplier_order->enabled = 0; // Old usage |
|
447 | + $conf->supplier_invoice->enabled = 0; // Old usage |
|
448 | 448 | unset($conf->modules['supplier_order']); |
449 | 449 | unset($conf->modules['supplier_invoice']); |
450 | 450 | } |
@@ -580,12 +580,12 @@ discard block |
||
580 | 580 | if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
581 | 581 | $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
582 | 582 | } else { |
583 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
583 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
584 | 584 | $test = false; |
585 | 585 | $error++; |
586 | 586 | } |
587 | 587 | } else { |
588 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
588 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
589 | 589 | $test = false; |
590 | 590 | $error++; |
591 | 591 | } |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | |
630 | 630 | $allowedmethodtopostusername = 3; |
631 | 631 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
632 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
632 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
633 | 633 | } |
634 | 634 | // TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ? |
635 | 635 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | } |
772 | 772 | |
773 | 773 | // Show login form |
774 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
774 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
775 | 775 | } |
776 | 776 | exit; |
777 | 777 | } |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | } else { |
1130 | 1130 | // We may have NOLOGIN set, but NOREQUIREUSER not |
1131 | 1131 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
1132 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1132 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1133 | 1133 | } |
1134 | 1134 | } |
1135 | 1135 | |
@@ -1192,7 +1192,7 @@ discard block |
||
1192 | 1192 | $conf->dol_optimize_smallscreen = 1; |
1193 | 1193 | |
1194 | 1194 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) { |
1195 | - $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
1195 | + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 | // Replace themes bugged with jmobile with eldy |
@@ -1280,7 +1280,7 @@ discard block |
||
1280 | 1280 | define('ROWS_9', 8); |
1281 | 1281 | } |
1282 | 1282 | |
1283 | -$heightforframes = 52; // Used by frames.php page |
|
1283 | +$heightforframes = 52; // Used by frames.php page |
|
1284 | 1284 | |
1285 | 1285 | // Init menu manager |
1286 | 1286 | if (!defined('NOREQUIREMENU')) { |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | |
1321 | 1321 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
1322 | 1322 | $message = GETPOST('seteventmessages', 'alpha'); |
1323 | - $messages = explode(',', $message); |
|
1323 | + $messages = explode(',', $message); |
|
1324 | 1324 | foreach ($messages as $key => $msg) { |
1325 | 1325 | $tmp = explode(':', $msg); |
1326 | 1326 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | } |
1632 | 1632 | |
1633 | 1633 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
1634 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1634 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1635 | 1635 | } |
1636 | 1636 | |
1637 | 1637 | // Auto refresh page |
@@ -1719,9 +1719,9 @@ discard block |
||
1719 | 1719 | $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); |
1720 | 1720 | } |
1721 | 1721 | if (constant('JS_JQUERY_UI')) { |
1722 | - print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // Forced JQuery |
|
1722 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // Forced JQuery |
|
1723 | 1723 | } else { |
1724 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JQuery |
|
1724 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery |
|
1725 | 1725 | } |
1726 | 1726 | } |
1727 | 1727 | if (!defined('DISABLE_JQUERY_JNOTIFY')) { |
@@ -1754,7 +1754,7 @@ discard block |
||
1754 | 1754 | |
1755 | 1755 | if (!defined('DISABLE_CSS_DEFAULT_THEME')) { |
1756 | 1756 | print '<!-- Includes CSS for Dolibarr theme -->'."\n"; |
1757 | - print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; |
|
1757 | + print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n"; |
|
1758 | 1758 | } |
1759 | 1759 | |
1760 | 1760 | if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) { |
@@ -1825,9 +1825,9 @@ discard block |
||
1825 | 1825 | } |
1826 | 1826 | if (!defined('DISABLE_JQUERY_UI')) { |
1827 | 1827 | if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { |
1828 | - print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
1828 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
1829 | 1829 | } else { |
1830 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
1830 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
1831 | 1831 | } |
1832 | 1832 | } |
1833 | 1833 | // jQuery jnotify |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | // Global js function |
1923 | 1923 | print '<!-- Includes JS of Dolibarr -->'."\n"; |
1924 | 1924 | if (!defined('DISABLE_LIB_HEAD_JS')) { |
1925 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
1925 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
1926 | 1926 | } |
1927 | 1927 | |
1928 | 1928 | // Leaflet |
@@ -1973,7 +1973,7 @@ discard block |
||
1973 | 1973 | print $head."\n"; |
1974 | 1974 | } |
1975 | 1975 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
1976 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
1976 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
1977 | 1977 | } |
1978 | 1978 | |
1979 | 1979 | $parameters = array(); |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | |
2117 | 2117 | $toprightmenu .= '</div>'; |
2118 | 2118 | |
2119 | - $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
2119 | + $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
2120 | 2120 | |
2121 | 2121 | |
2122 | 2122 | // Add block for other tools |
@@ -2866,7 +2866,7 @@ discard block |
||
2866 | 2866 | $langs->load(explode('@', $item['name'])[1]); |
2867 | 2867 | $dropDownQuickAddHtml .= ' |
2868 | 2868 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
2869 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
2869 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
2870 | 2870 | '; |
2871 | 2871 | } |
2872 | 2872 | |
@@ -2986,7 +2986,7 @@ discard block |
||
2986 | 2986 | */ |
2987 | 2987 | function top_menu_search() |
2988 | 2988 | { |
2989 | - global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
2989 | + global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
2990 | 2990 | |
2991 | 2991 | $html = ''; |
2992 | 2992 | |
@@ -3755,7 +3755,7 @@ discard block |
||
3755 | 3755 | $forceping = GETPOST('forceping', 'alpha'); |
3756 | 3756 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
3757 | 3757 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
3758 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
3758 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
3759 | 3759 | |
3760 | 3760 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
3761 | 3761 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | $object = new Contrat($db); |
104 | 104 | $extrafields = new ExtraFields($db); |
105 | 105 | $ret = 0; |
106 | -$pu_ht = null; // Init for static analysis |
|
107 | -$pu_ttc = null; // Init for static analysis |
|
106 | +$pu_ht = null; // Init for static analysis |
|
107 | +$pu_ttc = null; // Init for static analysis |
|
108 | 108 | |
109 | 109 | // Load object |
110 | 110 | if ($id > 0 || !empty($ref) && $action != 'add') { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php |
127 | 127 | $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php |
128 | 128 | $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); |
129 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
129 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
130 | 130 | $permissiontoedit = $permissiontoadd; |
131 | 131 | $permissiontoactivate = $user->hasRight('contrat', 'activer'); |
132 | 132 | $permissiontoeditextra = $permissiontoadd; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
184 | 184 | |
185 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
185 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
186 | 186 | |
187 | 187 | if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) { |
188 | 188 | $date_start = ''; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
206 | 206 | $result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'CONTRACT_MODIFY'); |
207 | 207 | if ($result >= 0) { |
208 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
208 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
209 | 209 | exit; |
210 | 210 | } else { |
211 | 211 | $mesg = $object->error; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
214 | 214 | $result = $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'CONTRACT_MODIFY'); |
215 | 215 | if ($result >= 0) { |
216 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
216 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
217 | 217 | exit; |
218 | 218 | } else { |
219 | 219 | $mesg = $object->error; |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | |
345 | 345 | $classname = ucfirst($subelement); |
346 | 346 | $srcobject = new $classname($db); |
347 | - '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
347 | + '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
348 | 348 | |
349 | 349 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
350 | 350 | $result = $srcobject->fetch($object->origin_id); |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | } |
770 | 770 | $objectline->fetch_optionals(); |
771 | 771 | |
772 | - $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
772 | + $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
773 | 773 | } else { |
774 | 774 | $objectline = null; |
775 | 775 | } |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | } elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) { |
920 | 920 | $date_start = dol_mktime(12, 0, 0, GETPOSTINT('d_startmonth'), GETPOSTINT('d_startday'), GETPOSTINT('d_startyear')); |
921 | 921 | $date_end = dol_mktime(12, 0, 0, GETPOSTINT('d_endmonth'), GETPOSTINT('d_endday'), GETPOSTINT('d_endyear')); |
922 | - $comment = GETPOST('comment', 'alpha'); |
|
922 | + $comment = GETPOST('comment', 'alpha'); |
|
923 | 923 | $result = $object->activateAll($user, $date_start, 0, $comment, $date_end); |
924 | 924 | if ($result < 0) { |
925 | 925 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1481,7 +1481,7 @@ discard block |
||
1481 | 1481 | $morehtmlref .= '<div class="refidno">'; |
1482 | 1482 | // Ref customer |
1483 | 1483 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
1484 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
1484 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
1485 | 1485 | // Ref supplier |
1486 | 1486 | $morehtmlref .= '<br>'; |
1487 | 1487 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
@@ -1574,7 +1574,7 @@ discard block |
||
1574 | 1574 | } |
1575 | 1575 | |
1576 | 1576 | |
1577 | - $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
1577 | + $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
1578 | 1578 | |
1579 | 1579 | /* |
1580 | 1580 | * Lines of contracts |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | $description = $objp->description; |
1707 | 1707 | |
1708 | 1708 | if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { |
1709 | - print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '') . $text; |
|
1709 | + print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '').$text; |
|
1710 | 1710 | if (!getDolGlobalInt('PRODUIT_DESC_IN_FORM')) { |
1711 | 1711 | print $form->textwithpicto('', $description); |
1712 | 1712 | } |
@@ -1842,7 +1842,7 @@ discard block |
||
1842 | 1842 | print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; |
1843 | 1843 | print '<input type="hidden" name="idprod" value="'.$currentLineProductId.'">'; |
1844 | 1844 | } else { |
1845 | - $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
1845 | + $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
1846 | 1846 | if (empty($senderissupplier)) { |
1847 | 1847 | if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) { |
1848 | 1848 | $filtertype = ''; |
@@ -2345,9 +2345,9 @@ discard block |
||
2345 | 2345 | // Sign |
2346 | 2346 | if ($object->status > Contrat::STATUS_DRAFT) { |
2347 | 2347 | if ($object->signed_status != Contrat::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
2348 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("ContractSign") . '</a></div>'; |
|
2348 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("ContractSign").'</a></div>'; |
|
2349 | 2349 | } else { |
2350 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("ContractUnsign") . '</a></div>'; |
|
2350 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("ContractUnsign").'</a></div>'; |
|
2351 | 2351 | } |
2352 | 2352 | } |
2353 | 2353 |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | $ai = new Ai($db); |
76 | 76 | |
77 | 77 | // Get parameters |
78 | -$function = empty($jsonData['function']) ? 'textgeneration' : $jsonData['function']; // Default value. Can also be 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', 'imagegeneration', 'videogeneration', ... |
|
78 | +$function = empty($jsonData['function']) ? 'textgeneration' : $jsonData['function']; // Default value. Can also be 'textgeneration', 'textgenerationemail', 'textgenerationwebpage', 'imagegeneration', 'videogeneration', ... |
|
79 | 79 | $instructions = dol_string_nohtmltag($jsonData['instructions'], 1, 'UTF-8'); |
80 | -$format = empty($jsonData['format']) ? '' : $jsonData['format']; // Can be '' for text, 'html', ... |
|
80 | +$format = empty($jsonData['format']) ? '' : $jsonData['format']; // Can be '' for text, 'html', ... |
|
81 | 81 | |
82 | 82 | if ($format == "html") { |
83 | 83 | $instructions = $jsonData['instructions']; |
@@ -102,18 +102,18 @@ discard block |
||
102 | 102 | print "Quota or allowed period exceeded. Retry Later !"; |
103 | 103 | } elseif (!empty($generatedContent['code']) && $generatedContent['code'] >= 400) { |
104 | 104 | http_response_code($generatedContent['code']); |
105 | - print "Error : " . $generatedContent['message']; |
|
105 | + print "Error : ".$generatedContent['message']; |
|
106 | 106 | print '<br><a href="'.DOL_MAIN_URL_ROOT.'/ai/admin/setup.php">'.$langs->trans('ErrorGoToModuleSetup').'</a>'; |
107 | 107 | } elseif (!empty($generatedContent['message'])) { |
108 | 108 | http_response_code($generatedContent['code']); |
109 | - print "Error returned by API call: " . $generatedContent['message']; |
|
109 | + print "Error returned by API call: ".$generatedContent['message']; |
|
110 | 110 | } else { |
111 | 111 | http_response_code($generatedContent['code']); |
112 | 112 | print "Error API returned no answer"; |
113 | 113 | } |
114 | 114 | } else { |
115 | 115 | if ($function == 'textgenerationemail' || $function == 'textgenerationwebpage') { |
116 | - print dolPrintHTML($generatedContent); // Note that common HTML tags are NOT escaped (but a sanitization is done) |
|
116 | + print dolPrintHTML($generatedContent); // Note that common HTML tags are NOT escaped (but a sanitization is done) |
|
117 | 117 | } elseif ($function == 'imagegeneration') { |
118 | 118 | // TODO |
119 | 119 | } elseif ($function == 'videogeneration') { |