@@ -53,45 +53,45 @@ discard block |
||
| 53 | 53 | $search_mvt_num = GETPOST('search_mvt_num', 'int'); |
| 54 | 54 | $search_doc_type = GETPOST("search_doc_type", 'alpha'); |
| 55 | 55 | $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); |
| 56 | -$search_date_startyear = GETPOST('search_date_startyear', 'int'); |
|
| 57 | -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); |
|
| 58 | -$search_date_startday = GETPOST('search_date_startday', 'int'); |
|
| 59 | -$search_date_endyear = GETPOST('search_date_endyear', 'int'); |
|
| 60 | -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
|
| 61 | -$search_date_endday = GETPOST('search_date_endday', 'int'); |
|
| 56 | +$search_date_startyear = GETPOST('search_date_startyear', 'int'); |
|
| 57 | +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); |
|
| 58 | +$search_date_startday = GETPOST('search_date_startday', 'int'); |
|
| 59 | +$search_date_endyear = GETPOST('search_date_endyear', 'int'); |
|
| 60 | +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
|
| 61 | +$search_date_endday = GETPOST('search_date_endday', 'int'); |
|
| 62 | 62 | $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); |
| 63 | 63 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 64 | 64 | $search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); |
| 65 | -$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); |
|
| 66 | -$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); |
|
| 67 | -$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); |
|
| 68 | -$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); |
|
| 69 | -$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); |
|
| 70 | -$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); |
|
| 65 | +$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); |
|
| 66 | +$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); |
|
| 67 | +$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); |
|
| 68 | +$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); |
|
| 69 | +$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); |
|
| 70 | +$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); |
|
| 71 | 71 | $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); |
| 72 | 72 | $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); |
| 73 | -$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); |
|
| 74 | -$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); |
|
| 75 | -$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); |
|
| 76 | -$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); |
|
| 77 | -$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); |
|
| 78 | -$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); |
|
| 73 | +$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); |
|
| 74 | +$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); |
|
| 75 | +$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); |
|
| 76 | +$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); |
|
| 77 | +$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); |
|
| 78 | +$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); |
|
| 79 | 79 | $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); |
| 80 | 80 | $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); |
| 81 | -$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); |
|
| 82 | -$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); |
|
| 83 | -$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); |
|
| 84 | -$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); |
|
| 85 | -$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); |
|
| 86 | -$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); |
|
| 81 | +$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); |
|
| 82 | +$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); |
|
| 83 | +$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); |
|
| 84 | +$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); |
|
| 85 | +$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); |
|
| 86 | +$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); |
|
| 87 | 87 | $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); |
| 88 | 88 | $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); |
| 89 | -$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); |
|
| 90 | -$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); |
|
| 91 | -$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); |
|
| 92 | -$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); |
|
| 93 | -$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); |
|
| 94 | -$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); |
|
| 89 | +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); |
|
| 90 | +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); |
|
| 91 | +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); |
|
| 92 | +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); |
|
| 93 | +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); |
|
| 94 | +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); |
|
| 95 | 95 | $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); |
| 96 | 96 | $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); |
| 97 | 97 | $search_import_key = GETPOST("search_import_key", 'alpha'); |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | // Ajout directives pour resoudre bug IE |
| 698 | 698 | header('Cache-Control: Public, must-revalidate'); |
| 699 | 699 | header('Pragma: public'); |
| 700 | - header('Content-Length: ' . dol_filesize($downloadFilePath)); |
|
| 700 | + header('Content-Length: '.dol_filesize($downloadFilePath)); |
|
| 701 | 701 | |
| 702 | 702 | readfileLowMemory($downloadFilePath); |
| 703 | 703 | } else { |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | |
| 759 | 759 | // Output page |
| 760 | 760 | // -------------------------------------------------------------------- |
| 761 | -$help_url ='EN:Module_Double_Entry_Accounting#Exports|FR:Module_Comptabilité_en_Partie_Double#Exports'; |
|
| 761 | +$help_url = 'EN:Module_Double_Entry_Accounting#Exports|FR:Module_Comptabilité_en_Partie_Double#Exports'; |
|
| 762 | 762 | |
| 763 | 763 | llxHeader('', $title_page, $help_url); |
| 764 | 764 | |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | $form_question['formatexport'] = array( |
| 771 | 771 | 'name' => 'formatexport', |
| 772 | 772 | 'type' => 'select', |
| 773 | - 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
| 773 | + 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
| 774 | 774 | 'values' => $listofformat, |
| 775 | 775 | 'default' => $formatexportset, |
| 776 | 776 | 'morecss' => 'minwidth200 maxwidth200' |
@@ -1291,8 +1291,8 @@ discard block |
||
| 1291 | 1291 | $labeltoshow .= $objectstatic->getNomUrl(1); |
| 1292 | 1292 | $labeltoshowalt .= $objectstatic->ref; |
| 1293 | 1293 | $bank_ref = strstr($line->doc_ref, '-'); |
| 1294 | - $labeltoshow .= " " . $bank_ref; |
|
| 1295 | - $labeltoshowalt .= " " . $bank_ref; |
|
| 1294 | + $labeltoshow .= " ".$bank_ref; |
|
| 1295 | + $labeltoshowalt .= " ".$bank_ref; |
|
| 1296 | 1296 | } else { |
| 1297 | 1297 | $labeltoshow .= $line->doc_ref; |
| 1298 | 1298 | $labeltoshowalt .= $line->doc_ref; |
@@ -335,8 +335,8 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 0, $outputMode = 0, $noouput = 0) |
| 337 | 337 | { |
| 338 | - global $db, $conf, $langs; // The tpl file use $db |
|
| 339 | - global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
| 338 | + global $db, $conf, $langs; // The tpl file use $db |
|
| 339 | + global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
| 340 | 340 | |
| 341 | 341 | // Define name of file to save |
| 342 | 342 | $filename = 'general_ledger-'.$this->getFormatCode($formatexportset); |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $exportFile = null; |
| 347 | 347 | $exportFileName = ''; |
| 348 | 348 | $exportFilePath = ''; |
| 349 | - $exportFileFullName =''; |
|
| 349 | + $exportFileFullName = ''; |
|
| 350 | 350 | $downloadFileMimeType = ''; |
| 351 | 351 | $downloadFileFullName = ''; |
| 352 | 352 | $downloadFilePath = ''; |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | $exportFileFullName = $completefilename; |
| 417 | 417 | $exportFileBaseName = basename($exportFileFullName); |
| 418 | 418 | $exportFileName = pathinfo($exportFileBaseName, PATHINFO_FILENAME); |
| 419 | - $exportFilePath = $outputDir . '/' . $exportFileFullName; |
|
| 419 | + $exportFilePath = $outputDir.'/'.$exportFileFullName; |
|
| 420 | 420 | $exportFile = fopen($exportFilePath, 'w'); |
| 421 | 421 | if (!$exportFile) { |
| 422 | 422 | $this->errors[] = $langs->trans('ErrorFileNotFound', $exportFilePath); |
@@ -430,8 +430,8 @@ discard block |
||
| 430 | 430 | ); |
| 431 | 431 | |
| 432 | 432 | // archive name and path |
| 433 | - $archiveFullName = $exportFileName . '.zip'; |
|
| 434 | - $archivePath = $outputDir . '/' . $archiveFullName; |
|
| 433 | + $archiveFullName = $exportFileName.'.zip'; |
|
| 434 | + $archivePath = $outputDir.'/'.$archiveFullName; |
|
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | } |
@@ -569,11 +569,11 @@ discard block |
||
| 569 | 569 | if (!empty($downloadFileMimeType) && !empty($downloadFileFullName) && !empty($downloadFilePath) && empty($noouput)) { |
| 570 | 570 | // deprecated. We must not use this anymore, but have $noouput = 1 because HTTP header must be sent |
| 571 | 571 | // into main page not into a method. |
| 572 | - header('Content-Type: ' . $downloadFileMimeType); |
|
| 573 | - header('Content-Disposition: attachment; filename=' . $downloadFileFullName); |
|
| 572 | + header('Content-Type: '.$downloadFileMimeType); |
|
| 573 | + header('Content-Disposition: attachment; filename='.$downloadFileFullName); |
|
| 574 | 574 | header('Cache-Control: Public, must-revalidate'); |
| 575 | 575 | header('Pragma: public'); |
| 576 | - header('Content-Length: ' . dol_filesize($downloadFilePath)); |
|
| 576 | + header('Content-Length: '.dol_filesize($downloadFilePath)); |
|
| 577 | 577 | |
| 578 | 578 | readfileLowMemory($downloadFilePath); |
| 579 | 579 | } |
@@ -645,14 +645,14 @@ discard block |
||
| 645 | 645 | $refInvoice = ''; |
| 646 | 646 | if ($line->doc_type == 'customer_invoice') { |
| 647 | 647 | // Customer invoice |
| 648 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 648 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 649 | 649 | $invoice = new Facture($this->db); |
| 650 | 650 | $invoice->fetch($line->fk_doc); |
| 651 | 651 | |
| 652 | 652 | $refInvoice = $invoice->ref; |
| 653 | 653 | } elseif ($line->doc_type == 'supplier_invoice') { |
| 654 | 654 | // Supplier invoice |
| 655 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
| 655 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
| 656 | 656 | $invoice = new FactureFournisseur($this->db); |
| 657 | 657 | $invoice->fetch($line->fk_doc); |
| 658 | 658 | |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | $invoice = new FactureFournisseur($this->db); |
| 1001 | 1001 | $invoice->fetch($line->fk_doc); |
| 1002 | 1002 | $objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output; |
| 1003 | - $objectDirPath.= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1003 | + $objectDirPath .= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1004 | 1004 | } |
| 1005 | 1005 | $arrayofinclusion = array(); |
| 1006 | 1006 | // If it is a supplier invoice, we want to use last uploaded file |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | $objectDirPath = !empty($conf->expensereport->multidir_output[$conf->entity]) ? $conf->expensereport->multidir_output[$conf->entity] : $conf->expensereport->dir_output; |
| 1467 | 1467 | } elseif ($line->doc_type == 'supplier_invoice') { |
| 1468 | 1468 | $objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output; |
| 1469 | - $objectDirPath.= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1469 | + $objectDirPath .= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1470 | 1470 | } |
| 1471 | 1471 | $arrayofinclusion = array(); |
| 1472 | 1472 | // If it is a supplier invoice, we want to use last uploaded file |
@@ -1678,7 +1678,7 @@ discard block |
||
| 1678 | 1678 | $objectDirPath = !empty($conf->expensereport->multidir_output[$conf->entity]) ? $conf->expensereport->multidir_output[$conf->entity] : $conf->expensereport->dir_output; |
| 1679 | 1679 | } elseif ($line->doc_type == 'supplier_invoice') { |
| 1680 | 1680 | $objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output; |
| 1681 | - $objectDirPath.= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1681 | + $objectDirPath .= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1682 | 1682 | } |
| 1683 | 1683 | $arrayofinclusion = array(); |
| 1684 | 1684 | // If it is a supplier invoice, we want to use last uploaded file |
@@ -2000,7 +2000,7 @@ discard block |
||
| 2000 | 2000 | // MOPM |
| 2001 | 2001 | $tab[] = ""; |
| 2002 | 2002 | // BONP |
| 2003 | - $tab[] = ""; |
|
| 2003 | + $tab[] = ""; |
|
| 2004 | 2004 | // BQAF |
| 2005 | 2005 | $tab[] = ""; |
| 2006 | 2006 | // ECES |
@@ -2206,7 +2206,7 @@ discard block |
||
| 2206 | 2206 | } |
| 2207 | 2207 | } elseif ($line->doc_type == 'customer_invoice') { |
| 2208 | 2208 | if (($line->amount) < 0) { |
| 2209 | - $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 | + $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. |
|
| 2210 | 2210 | } else { |
| 2211 | 2211 | $nature_piece = 'FC'; |
| 2212 | 2212 | } |
@@ -2415,8 +2415,8 @@ discard block |
||
| 2415 | 2415 | ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) { |
| 2416 | 2416 | if ($line->doc_type == 'customer_invoice') { |
| 2417 | 2417 | // Get new customer invoice ref and company name |
| 2418 | - $sql = 'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f'; |
|
| 2419 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid'; |
|
| 2418 | + $sql = 'SELECT f.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture as f'; |
|
| 2419 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON f.fk_soc = s.rowid'; |
|
| 2420 | 2420 | $sql .= ' WHERE f.rowid = '.((int) $line->fk_doc); |
| 2421 | 2421 | $resql = $this->db->query($sql); |
| 2422 | 2422 | if ($resql) { |
@@ -2429,8 +2429,8 @@ discard block |
||
| 2429 | 2429 | } |
| 2430 | 2430 | } else { |
| 2431 | 2431 | // Get new supplier invoice ref and company name |
| 2432 | - $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff'; |
|
| 2433 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid'; |
|
| 2432 | + $sql = 'SELECT ff.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture_fourn as ff'; |
|
| 2433 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON ff.fk_soc = s.rowid'; |
|
| 2434 | 2434 | $sql .= ' WHERE ff.rowid = '.((int) $line->fk_doc); |
| 2435 | 2435 | $resql = $this->db->query($sql); |
| 2436 | 2436 | if ($resql) { |
@@ -2468,7 +2468,7 @@ discard block |
||
| 2468 | 2468 | $tab[] = ""; |
| 2469 | 2469 | //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"'; |
| 2470 | 2470 | //Libellé manual |
| 2471 | - $tab[] = dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1); |
|
| 2471 | + $tab[] = dol_trunc(str_replace('"', '', $invoice_ref.(!empty($company_name) ? ' - ' : '').$company_name), 40, 'right', 'UTF-8', 1); |
|
| 2472 | 2472 | //Numéro de pièce |
| 2473 | 2473 | $tab[] = dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1); |
| 2474 | 2474 | //Devise |
@@ -2522,8 +2522,8 @@ discard block |
||
| 2522 | 2522 | } |
| 2523 | 2523 | $tab[] = ""; |
| 2524 | 2524 | $tab[] = '"'.dol_trunc(str_replace('"', '', $line->label_operation), 40, 'right', 'UTF-8', 1).'"'; |
| 2525 | - $tab[] = '"' . dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1) . '"'; |
|
| 2526 | - $tab[] = '"' . dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . '"'; |
|
| 2525 | + $tab[] = '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"'; |
|
| 2526 | + $tab[] = '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'; |
|
| 2527 | 2527 | $tab[] = price2num(abs($line->debit - $line->credit)); |
| 2528 | 2528 | $tab[] = $line->sens; |
| 2529 | 2529 | $tab[] = $date_document; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $langs->loadLangs(array("admin", "other", "trips", "errors", "dict")); |
| 37 | 37 | |
| 38 | 38 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
| 39 | -$hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules')); |
|
| 39 | +$hookmanager->initHooks(array('admin', 'dictionaryadmin', 'expensereport_rules')); |
|
| 40 | 40 | |
| 41 | 41 | $object = new ExpenseReportRule($db); |
| 42 | 42 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if (!$error) { |
| 147 | - header('Location: ' . $_SERVER['PHP_SELF']); |
|
| 147 | + header('Location: '.$_SERVER['PHP_SELF']); |
|
| 148 | 148 | exit; |
| 149 | 149 | } else { |
| 150 | 150 | $action = ''; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | dol_print_error($object->db); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - header('Location: ' . $_SERVER['PHP_SELF']); |
|
| 161 | + header('Location: '.$_SERVER['PHP_SELF']); |
|
| 162 | 162 | exit; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -186,47 +186,47 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $form = new Form($db); |
| 188 | 188 | |
| 189 | -$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>'; |
|
| 189 | +$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; |
|
| 190 | 190 | print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); |
| 191 | 191 | |
| 192 | 192 | $head = expensereport_admin_prepare_head(); |
| 193 | 193 | print dol_get_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip'); |
| 194 | 194 | |
| 195 | -echo '<span class="opacitymedium">' . $langs->trans('ExpenseReportRulesDesc') . '</span>'; |
|
| 195 | +echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportRulesDesc').'</span>'; |
|
| 196 | 196 | print '<br><br>'; |
| 197 | 197 | |
| 198 | 198 | if ($action != 'edit') { |
| 199 | - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; |
|
| 200 | - echo '<input type="hidden" name="token" value="' . newToken() . '" />'; |
|
| 199 | + echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; |
|
| 200 | + echo '<input type="hidden" name="token" value="'.newToken().'" />'; |
|
| 201 | 201 | echo '<input type="hidden" name="action" value="save" />'; |
| 202 | 202 | |
| 203 | 203 | echo '<table class="noborder centpercent">'; |
| 204 | 204 | |
| 205 | 205 | echo '<tr class="liste_titre headerexpensereportrules">'; |
| 206 | - echo '<th class="linecolapplyto">' . $langs->trans('ExpenseReportApplyTo') . '</th>'; |
|
| 207 | - echo '<th class="linecoltype">' . $langs->trans('Type') . '</th>'; |
|
| 208 | - echo '<th class="linecollimiton">' . $langs->trans('ExpenseReportLimitOn') . '</th>'; |
|
| 209 | - echo '<th class="linecoldatestart">' . $langs->trans('ExpenseReportDateStart') . '</th>'; |
|
| 210 | - echo '<th class="linecoldateend">' . $langs->trans('ExpenseReportDateEnd') . '</th>'; |
|
| 211 | - echo '<th class="linecollimitamount">' . $langs->trans('ExpenseReportLimitAmount') . '</th>'; |
|
| 212 | - echo '<th class="linecolrestrictive">' . $langs->trans('ExpenseReportRestrictive') . '</th>'; |
|
| 206 | + echo '<th class="linecolapplyto">'.$langs->trans('ExpenseReportApplyTo').'</th>'; |
|
| 207 | + echo '<th class="linecoltype">'.$langs->trans('Type').'</th>'; |
|
| 208 | + echo '<th class="linecollimiton">'.$langs->trans('ExpenseReportLimitOn').'</th>'; |
|
| 209 | + echo '<th class="linecoldatestart">'.$langs->trans('ExpenseReportDateStart').'</th>'; |
|
| 210 | + echo '<th class="linecoldateend">'.$langs->trans('ExpenseReportDateEnd').'</th>'; |
|
| 211 | + echo '<th class="linecollimitamount">'.$langs->trans('ExpenseReportLimitAmount').'</th>'; |
|
| 212 | + echo '<th class="linecolrestrictive">'.$langs->trans('ExpenseReportRestrictive').'</th>'; |
|
| 213 | 213 | echo '<th> </th>'; |
| 214 | 214 | echo '</tr>'; |
| 215 | 215 | |
| 216 | 216 | echo '<tr class="oddeven">'; |
| 217 | 217 | echo '<td>'; |
| 218 | - echo '<div class="float linecolapplyto">' . $form->selectarray('apply_to', $tab_apply, '', 0) . '</div>'; |
|
| 219 | - echo '<div id="user" class="float linecoluser">' . $form->select_dolusers('', 'fk_user') . '</div>'; |
|
| 220 | - echo '<div id="group" class="float linecolgroup">' . $form->select_dolgroups('', 'fk_usergroup') . '</div>'; |
|
| 218 | + echo '<div class="float linecolapplyto">'.$form->selectarray('apply_to', $tab_apply, '', 0).'</div>'; |
|
| 219 | + echo '<div id="user" class="float linecoluser">'.$form->select_dolusers('', 'fk_user').'</div>'; |
|
| 220 | + echo '<div id="group" class="float linecolgroup">'.$form->select_dolgroups('', 'fk_usergroup').'</div>'; |
|
| 221 | 221 | echo '</td>'; |
| 222 | 222 | |
| 223 | - echo '<td class="linecoltype">' . $form->selectExpense('', 'fk_c_type_fees', 0, 1, 1) . '</td>'; |
|
| 224 | - echo '<td class="linecoltyperule">' . $form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0) . '</td>'; |
|
| 225 | - echo '<td class="linecoldatestart">' . $form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0) . '</td>'; |
|
| 226 | - echo '<td class="linecoldateend">' . $form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0) . '</td>'; |
|
| 223 | + echo '<td class="linecoltype">'.$form->selectExpense('', 'fk_c_type_fees', 0, 1, 1).'</td>'; |
|
| 224 | + echo '<td class="linecoltyperule">'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>'; |
|
| 225 | + echo '<td class="linecoldatestart">'.$form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0).'</td>'; |
|
| 226 | + echo '<td class="linecoldateend">'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>'; |
|
| 227 | 227 | echo '<td class="linecolamount"><input type="text" value="" class="maxwidth100" name="amount" class="amount right" /></td>'; |
| 228 | - echo '<td class="linecolrestrictive">' . $form->selectyesno('restrictive', 0, 1) . '</td>'; |
|
| 229 | - echo '<td class="right linecolbutton"><input type="submit" class="button button-add" value="' . $langs->trans('Add') . '" /></td>'; |
|
| 228 | + echo '<td class="linecolrestrictive">'.$form->selectyesno('restrictive', 0, 1).'</td>'; |
|
| 229 | + echo '<td class="right linecolbutton"><input type="submit" class="button button-add" value="'.$langs->trans('Add').'" /></td>'; |
|
| 230 | 230 | echo '</tr>'; |
| 231 | 231 | |
| 232 | 232 | echo '</table>'; |
@@ -234,11 +234,11 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| 237 | -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; |
|
| 238 | -echo '<input type="hidden" name="token" value="' . newToken() . '" />'; |
|
| 237 | +echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; |
|
| 238 | +echo '<input type="hidden" name="token" value="'.newToken().'" />'; |
|
| 239 | 239 | |
| 240 | 240 | if ($action == 'edit') { |
| 241 | - echo '<input type="hidden" name="id" value="' . $object->id . '" />'; |
|
| 241 | + echo '<input type="hidden" name="id" value="'.$object->id.'" />'; |
|
| 242 | 242 | echo '<input type="hidden" name="action" value="save" />'; |
| 243 | 243 | } |
| 244 | 244 | |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | echo '<table class="noborder centpercent">'; |
| 249 | 249 | |
| 250 | 250 | echo '<tr class="liste_titre expensereportrules">'; |
| 251 | -echo '<th class="linecolapplyto">' . $langs->trans('ExpenseReportApplyTo') . '</th>'; |
|
| 252 | -echo '<th class="linecoltype">' . $langs->trans('Type') . '</th>'; |
|
| 253 | -echo '<th class="linecollimiton">' . $langs->trans('ExpenseReportLimitOn') . '</th>'; |
|
| 254 | -echo '<th class="linecoldatestart">' . $langs->trans('ExpenseReportDateStart') . '</th>'; |
|
| 255 | -echo '<th class="linecoldateend">' . $langs->trans('ExpenseReportDateEnd') . '</th>'; |
|
| 256 | -echo '<th class="linecollimitamount">' . $langs->trans('ExpenseReportLimitAmount') . '</th>'; |
|
| 257 | -echo '<th class="linecolrestrictive">' . $langs->trans('ExpenseReportRestrictive') . '</th>'; |
|
| 251 | +echo '<th class="linecolapplyto">'.$langs->trans('ExpenseReportApplyTo').'</th>'; |
|
| 252 | +echo '<th class="linecoltype">'.$langs->trans('Type').'</th>'; |
|
| 253 | +echo '<th class="linecollimiton">'.$langs->trans('ExpenseReportLimitOn').'</th>'; |
|
| 254 | +echo '<th class="linecoldatestart">'.$langs->trans('ExpenseReportDateStart').'</th>'; |
|
| 255 | +echo '<th class="linecoldateend">'.$langs->trans('ExpenseReportDateEnd').'</th>'; |
|
| 256 | +echo '<th class="linecollimitamount">'.$langs->trans('ExpenseReportLimitAmount').'</th>'; |
|
| 257 | +echo '<th class="linecolrestrictive">'.$langs->trans('ExpenseReportRestrictive').'</th>'; |
|
| 258 | 258 | echo '<th> </th>'; |
| 259 | 259 | echo '</tr>'; |
| 260 | 260 | |
@@ -264,16 +264,16 @@ discard block |
||
| 264 | 264 | echo '<td class="linecolusergroup">'; |
| 265 | 265 | if ($action == 'edit' && $object->id == $rule->id) { |
| 266 | 266 | $selected = ($object->is_for_all > 0) ? 'A' : ($object->fk_usergroup > 0 ? 'G' : 'U'); |
| 267 | - echo '<div class="float">' . $form->selectarray('apply_to', $tab_apply, $selected, 0) . '</div>'; |
|
| 268 | - echo '<div id="user" class="float">' . $form->select_dolusers($object->fk_user, 'fk_user') . '</div>'; |
|
| 269 | - echo '<div id="group" class="float">' . $form->select_dolgroups($object->fk_usergroup, 'fk_usergroup') . '</div>'; |
|
| 267 | + echo '<div class="float">'.$form->selectarray('apply_to', $tab_apply, $selected, 0).'</div>'; |
|
| 268 | + echo '<div id="user" class="float">'.$form->select_dolusers($object->fk_user, 'fk_user').'</div>'; |
|
| 269 | + echo '<div id="group" class="float">'.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').'</div>'; |
|
| 270 | 270 | } else { |
| 271 | 271 | if ($rule->is_for_all > 0) { |
| 272 | 272 | echo $tab_apply['A']; |
| 273 | 273 | } elseif ($rule->fk_usergroup > 0) { |
| 274 | - echo $tab_apply['G'] . ' (' . $rule->getGroupLabel() . ')'; |
|
| 274 | + echo $tab_apply['G'].' ('.$rule->getGroupLabel().')'; |
|
| 275 | 275 | } elseif ($rule->fk_user > 0) { |
| 276 | - echo $tab_apply['U'] . ' (' . $rule->getUserName() . ')'; |
|
| 276 | + echo $tab_apply['U'].' ('.$rule->getUserName().')'; |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | echo '</td>'; |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | // Amount |
| 327 | 327 | echo '<td class="linecolamount">'; |
| 328 | 328 | if ($action == 'edit' && $object->id == $rule->id) { |
| 329 | - echo '<input type="text" value="' . price2num($object->amount) . '" name="amount" class="amount width50 right" />'; |
|
| 329 | + echo '<input type="text" value="'.price2num($object->amount).'" name="amount" class="amount width50 right" />'; |
|
| 330 | 330 | } else { |
| 331 | 331 | echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency); |
| 332 | 332 | } |
@@ -344,11 +344,11 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | echo '<td class="center">'; |
| 346 | 346 | if ($object->id != $rule->id) { |
| 347 | - echo '<a class="editfielda paddingright paddingleft" href="' . $_SERVER['PHP_SELF'] . '?action=edit&token=' . newToken() . '&id=' . $rule->id . '">' . img_edit() . '</a> '; |
|
| 348 | - echo '<a class="paddingright paddingleft" href="' . $_SERVER['PHP_SELF'] . '?action=delete&token=' . newToken() . '&id=' . $rule->id . '">' . img_delete() . '</a>'; |
|
| 347 | + echo '<a class="editfielda paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$rule->id.'">'.img_edit().'</a> '; |
|
| 348 | + echo '<a class="paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$rule->id.'">'.img_delete().'</a>'; |
|
| 349 | 349 | } else { |
| 350 | - echo '<input type="submit" class="button button-edit" value="' . $langs->trans('Update') . '" /> '; |
|
| 351 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '" class="button button-cancel">' . $langs->trans("Cancel") . '</a>'; |
|
| 350 | + echo '<input type="submit" class="button button-edit" value="'.$langs->trans('Update').'" /> '; |
|
| 351 | + echo '<a href="'.$_SERVER['PHP_SELF'].'" class="button button-cancel">'.$langs->trans("Cancel").'</a>'; |
|
| 352 | 352 | } |
| 353 | 353 | echo '</td>'; |
| 354 | 354 | |
@@ -41,45 +41,45 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | // Get parameters |
| 44 | -$action = GETPOST('action', 'aZ09'); |
|
| 44 | +$action = GETPOST('action', 'aZ09'); |
|
| 45 | 45 | $massaction = GETPOST('massaction', 'alpha'); |
| 46 | 46 | $show_files = GETPOST('show_files', 'int'); |
| 47 | -$confirm = GETPOST('confirm', 'alpha'); |
|
| 47 | +$confirm = GETPOST('confirm', 'alpha'); |
|
| 48 | 48 | $cancel = GETPOST('cancel', 'alpha'); |
| 49 | -$toselect = GETPOST('toselect', 'array'); |
|
| 49 | +$toselect = GETPOST('toselect', 'array'); |
|
| 50 | 50 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search |
| 51 | 51 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 52 | 52 | $optioncss = GETPOST('optioncss', 'aZ'); |
| 53 | -$mode = GETPOST('mode', 'alpha'); |
|
| 53 | +$mode = GETPOST('mode', 'alpha'); |
|
| 54 | 54 | |
| 55 | 55 | // Search fields |
| 56 | -$search = GETPOST("search", 'alpha'); |
|
| 57 | -$search_ref = GETPOST("search_ref", 'alpha'); |
|
| 56 | +$search = GETPOST("search", 'alpha'); |
|
| 57 | +$search_ref = GETPOST("search_ref", 'alpha'); |
|
| 58 | 58 | $search_lastname = GETPOST("search_lastname", 'alpha'); |
| 59 | -$search_firstname = GETPOST("search_firstname", 'alpha'); |
|
| 59 | +$search_firstname = GETPOST("search_firstname", 'alpha'); |
|
| 60 | 60 | $search_gender = GETPOST("search_gender", 'alpha'); |
| 61 | 61 | $search_civility = GETPOST("search_civility", 'alpha'); |
| 62 | 62 | $search_company = GETPOST('search_company', 'alphanohtml'); |
| 63 | -$search_login = GETPOST("search_login", 'alpha'); |
|
| 63 | +$search_login = GETPOST("search_login", 'alpha'); |
|
| 64 | 64 | $search_address = GETPOST("search_address", 'alpha'); |
| 65 | -$search_zip = GETPOST("search_zip", 'alpha'); |
|
| 66 | -$search_town = GETPOST("search_town", 'alpha'); |
|
| 67 | -$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
| 68 | -$search_country = GETPOST("search_country", 'alpha'); |
|
| 65 | +$search_zip = GETPOST("search_zip", 'alpha'); |
|
| 66 | +$search_town = GETPOST("search_town", 'alpha'); |
|
| 67 | +$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
| 68 | +$search_country = GETPOST("search_country", 'alpha'); |
|
| 69 | 69 | $search_phone = GETPOST("search_phone", 'alpha'); |
| 70 | 70 | $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); |
| 71 | 71 | $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); |
| 72 | -$search_type = GETPOST("search_type", 'alpha'); |
|
| 72 | +$search_type = GETPOST("search_type", 'alpha'); |
|
| 73 | 73 | $search_email = GETPOST("search_email", 'alpha'); |
| 74 | 74 | $search_categ = GETPOST("search_categ", 'int'); |
| 75 | -$search_morphy = GETPOST("search_morphy", 'alpha'); |
|
| 76 | -$search_import_key = trim(GETPOST("search_import_key", 'alpha')); |
|
| 75 | +$search_morphy = GETPOST("search_morphy", 'alpha'); |
|
| 76 | +$search_import_key = trim(GETPOST("search_import_key", 'alpha')); |
|
| 77 | 77 | |
| 78 | 78 | $catid = GETPOST("catid", 'int'); |
| 79 | 79 | $socid = GETPOST('socid', 'int'); |
| 80 | 80 | |
| 81 | 81 | $search_filter = GETPOST("search_filter", 'alpha'); |
| 82 | -$search_status = GETPOST("search_status", 'intcomma'); // status |
|
| 82 | +$search_status = GETPOST("search_status", 'intcomma'); // status |
|
| 83 | 83 | $search_datec_start = dol_mktime(0, 0, 0, GETPOST('search_datec_start_month', 'int'), GETPOST('search_datec_start_day', 'int'), GETPOST('search_datec_start_year', 'int')); |
| 84 | 84 | $search_datec_end = dol_mktime(23, 59, 59, GETPOST('search_datec_end_month', 'int'), GETPOST('search_datec_end_day', 'int'), GETPOST('search_datec_end_year', 'int')); |
| 85 | 85 | $search_datem_start = dol_mktime(0, 0, 0, GETPOST('search_datem_start_month', 'int'), GETPOST('search_datem_start_day', 'int'), GETPOST('search_datem_start_year', 'int')); |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | $sqlfields = $sql; // $sql fields to remove for count total |
| 398 | 398 | |
| 399 | 399 | // SQL Alias adherent |
| 400 | -$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; // maybe better to use ad (adh) instead of d |
|
| 400 | +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; // maybe better to use ad (adh) instead of d |
|
| 401 | 401 | if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
| 402 | 402 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)"; |
| 403 | 403 | } |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | if ($searchCategoryContactOperator == 0) { |
| 427 | 427 | $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie = ".((int) $searchCategoryContact).")"; |
| 428 | 428 | } else { |
| 429 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); |
|
| 429 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryContact); |
|
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | 432 | } |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | // Output page |
| 589 | 589 | // -------------------------------------------------------------------- |
| 590 | 590 | |
| 591 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
| 591 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
| 592 | 592 | |
| 593 | 593 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
| 594 | 594 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
| 120 | 120 | if (!empty($perm)) { |
| 121 | 121 | $tmp = explode(':', $typeofdata); |
| 122 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
| 122 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
| 123 | 123 | if ($fieldrequired) { |
| 124 | 124 | $ret .= '<span class="fieldrequired">'; |
| 125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ($fieldrequired) { |
| 132 | 132 | $ret .= '</span>'; |
| 133 | 133 | } |
| 134 | - $ret .= '</div>' . "\n"; |
|
| 134 | + $ret .= '</div>'."\n"; |
|
| 135 | 135 | } else { |
| 136 | 136 | if ($fieldrequired) { |
| 137 | 137 | $ret .= '<span class="fieldrequired">'; |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | if (empty($notabletag) && $perm) { |
| 170 | 170 | $ret .= '<td class="right">'; |
| 171 | 171 | } |
| 172 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
| 173 | - $ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>'; |
|
| 172 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
| 173 | + $ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>'; |
|
| 174 | 174 | } |
| 175 | 175 | if (!empty($notabletag) && $notabletag == 1) { |
| 176 | 176 | if ($text) { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } elseif ($reg[1] == 'int') { |
| 238 | 238 | $typeofdata = 'numeric'; |
| 239 | 239 | } else { |
| 240 | - return 'ErrorBadParameter ' . $typeofdata; |
|
| 240 | + return 'ErrorBadParameter '.$typeofdata; |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | if ($editaction == '') { |
| 249 | 249 | $editaction = GETPOST('action', 'aZ09'); |
| 250 | 250 | } |
| 251 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
| 251 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
| 252 | 252 | if ($editmode) { // edit mode |
| 253 | 253 | $ret .= "\n"; |
| 254 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
| 255 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 256 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 257 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
| 254 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
| 255 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 256 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 257 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
| 258 | 258 | if (empty($notabletag)) { |
| 259 | 259 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 260 | 260 | } |
@@ -263,28 +263,28 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
| 265 | 265 | $tmp = explode(':', $typeofdata); |
| 266 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 266 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 267 | 267 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
| 268 | 268 | $tmp = explode(':', $typeofdata); |
| 269 | 269 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
| 270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 271 | 271 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
| 272 | 272 | $tmp = explode(':', $typeofdata); |
| 273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
| 274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 275 | 275 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
| 276 | 276 | $tmp = explode(':', $typeofdata); |
| 277 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
| 277 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
| 278 | 278 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
| 279 | 279 | $tmp = explode(':', $typeofdata); |
| 280 | 280 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
| 281 | 281 | $morealt = ''; |
| 282 | 282 | if (preg_match('/%/', $cols)) { |
| 283 | - $morealt = ' style="width: ' . $cols . '"'; |
|
| 283 | + $morealt = ' style="width: '.$cols.'"'; |
|
| 284 | 284 | $cols = ''; |
| 285 | 285 | } |
| 286 | 286 | $valuetoshow = ($editvalue ? $editvalue : $value); |
| 287 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
| 287 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
| 288 | 288 | // textarea convert automatically entities chars into simple chars. |
| 289 | 289 | // So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwig is off. |
| 290 | 290 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -294,12 +294,12 @@ discard block |
||
| 294 | 294 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 295 | 295 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 296 | 296 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 297 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 297 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 298 | 298 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 299 | 299 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 300 | 300 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 301 | 301 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 302 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 302 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 303 | 303 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 304 | 304 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 305 | 305 | $arraylist = array(); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | // TODO Not yet implemented. See code for extrafields |
| 314 | 314 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
| 315 | 315 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
| 316 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 316 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 317 | 317 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
| 318 | 318 | $ret .= $doleditor->Create(1); |
| 319 | 319 | } elseif ($typeofdata == 'asis') { |
@@ -328,19 +328,19 @@ discard block |
||
| 328 | 328 | $ret .= '<td>'; |
| 329 | 329 | } |
| 330 | 330 | //else $ret.='<div class="clearboth"></div>'; |
| 331 | - $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
| 331 | + $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
| 332 | 332 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
| 333 | - $ret .= '<br>' . "\n"; |
|
| 333 | + $ret .= '<br>'."\n"; |
|
| 334 | 334 | } |
| 335 | - $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 335 | + $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 336 | 336 | if (empty($notabletag)) { |
| 337 | 337 | $ret .= '</td>'; |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | if (empty($notabletag)) { |
| 341 | - $ret .= '</tr></table>' . "\n"; |
|
| 341 | + $ret .= '</tr></table>'."\n"; |
|
| 342 | 342 | } |
| 343 | - $ret .= '</form>' . "\n"; |
|
| 343 | + $ret .= '</form>'."\n"; |
|
| 344 | 344 | } else { // view mode |
| 345 | 345 | if (preg_match('/^email/', $typeofdata)) { |
| 346 | 346 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -352,15 +352,15 @@ discard block |
||
| 352 | 352 | $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); |
| 353 | 353 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
| 354 | 354 | $tmp = explode(':', $typeofdata); |
| 355 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
| 355 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
| 356 | 356 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
| 357 | 357 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
| 358 | 358 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
| 359 | 359 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
| 360 | 360 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
| 361 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
| 361 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
| 362 | 362 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 363 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
| 363 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
| 364 | 364 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 365 | 365 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 366 | 366 | $arraylist = array(); |
@@ -371,9 +371,9 @@ discard block |
||
| 371 | 371 | $ret .= $arraylist[$value]; |
| 372 | 372 | if ($htmlname == 'fk_product_type') { |
| 373 | 373 | if ($value == 0) { |
| 374 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 374 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 375 | 375 | } else { |
| 376 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 376 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
| 382 | 382 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
| 383 | 383 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
| 384 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 384 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 385 | 385 | } |
| 386 | 386 | // We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
| 387 | 387 | // clean data from some dangerous html |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
| 391 | 391 | $ret .= dol_escape_htmltag($value); |
| 392 | 392 | } else { |
| 393 | - $ret .= $value; // $value must be already html escaped. |
|
| 393 | + $ret .= $value; // $value must be already html escaped. |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 430 | 430 | if (!is_object($extralanguages)) { |
| 431 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 431 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 432 | 432 | $extralanguages = new ExtraLanguages($this->db); |
| 433 | 433 | } |
| 434 | 434 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -437,17 +437,17 @@ discard block |
||
| 437 | 437 | return ''; // No extralang field to show |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
| 441 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
| 440 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
| 441 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
| 442 | 442 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
| 443 | 443 | $result .= $s; |
| 444 | 444 | $result .= '</div>'; |
| 445 | 445 | |
| 446 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
| 446 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
| 447 | 447 | |
| 448 | 448 | $resultforextrlang = ''; |
| 449 | 449 | foreach ($arrayoflangcode as $langcode) { |
| 450 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
| 450 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
| 451 | 451 | if (empty($valuetoshow)) { |
| 452 | 452 | $object->fetchValuesForExtraLanguages(); |
| 453 | 453 | //var_dump($object->array_languages); |
@@ -459,17 +459,17 @@ discard block |
||
| 459 | 459 | |
| 460 | 460 | // TODO Use the showInputField() method of ExtraLanguages object |
| 461 | 461 | if ($typeofdata == 'textarea') { |
| 462 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 462 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 463 | 463 | $resultforextrlang .= $valuetoshow; |
| 464 | 464 | $resultforextrlang .= '</textarea>'; |
| 465 | 465 | } else { |
| 466 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
| 466 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | $result .= $resultforextrlang; |
| 470 | 470 | |
| 471 | 471 | $result .= '</div>'; |
| 472 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
| 472 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | return $result; |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | if (!empty($tmp[2])) { |
| 535 | 535 | $savemethod = $tmp[2]; |
| 536 | 536 | } |
| 537 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
| 537 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
| 538 | 538 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
| 539 | 539 | $tmp = explode(':', $inputType); |
| 540 | 540 | $inputType = $tmp[0]; |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | $savemethod = $tmp[2]; |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
| 548 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
| 549 | 549 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
| 550 | 550 | $tmp = explode(':', $inputType); |
| 551 | 551 | $inputType = $tmp[0]; |
@@ -576,40 +576,40 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | if (isModEnabled('fckeditor')) { |
| 579 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
| 579 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
| 580 | 580 | } else { |
| 581 | 581 | $inputType = 'textarea'; |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
| 586 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
| 587 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
| 588 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
| 585 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
| 586 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
| 587 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
| 588 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
| 589 | 589 | if (!empty($savemethod)) { |
| 590 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
| 590 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
| 591 | 591 | } |
| 592 | 592 | if (!empty($ext_element)) { |
| 593 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
| 593 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
| 594 | 594 | } |
| 595 | 595 | if (!empty($custommsg)) { |
| 596 | 596 | if (is_array($custommsg)) { |
| 597 | 597 | if (!empty($custommsg['success'])) { |
| 598 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
| 598 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
| 599 | 599 | } |
| 600 | 600 | if (!empty($custommsg['error'])) { |
| 601 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
| 601 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
| 602 | 602 | } |
| 603 | 603 | } else { |
| 604 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
| 604 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | if ($inputType == 'textarea') { |
| 608 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
| 609 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
| 608 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
| 609 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
| 610 | 610 | } |
| 611 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
| 612 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
| 611 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
| 612 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
| 613 | 613 | } else { |
| 614 | 614 | $out = $value; |
| 615 | 615 | } |
@@ -638,12 +638,12 @@ discard block |
||
| 638 | 638 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
| 639 | 639 | { |
| 640 | 640 | if ($incbefore) { |
| 641 | - $text = $incbefore . $text; |
|
| 641 | + $text = $incbefore.$text; |
|
| 642 | 642 | } |
| 643 | 643 | if (!$htmltext) { |
| 644 | 644 | return $text; |
| 645 | 645 | } |
| 646 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 646 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 647 | 647 | |
| 648 | 648 | $tag = 'td'; |
| 649 | 649 | if ($notabs == 2) { |
@@ -657,11 +657,11 @@ discard block |
||
| 657 | 657 | |
| 658 | 658 | $extrastyle = ''; |
| 659 | 659 | if ($direction < 0) { |
| 660 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 660 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 661 | 661 | $extrastyle = 'padding: 0px; padding-left: 3px;'; |
| 662 | 662 | } |
| 663 | 663 | if ($direction > 0) { |
| 664 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 664 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 665 | 665 | $extrastyle = 'padding: 0px; padding-right: 3px;'; |
| 666 | 666 | } |
| 667 | 667 | |
@@ -674,53 +674,53 @@ discard block |
||
| 674 | 674 | $htmltext = str_replace('"', '"', $htmltext); |
| 675 | 675 | } else { |
| 676 | 676 | $classfortooltip = 'classfortooltiponclick'; |
| 677 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
| 677 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
| 678 | 678 | } |
| 679 | 679 | if ($tooltipon == 2 || $tooltipon == 3) { |
| 680 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
| 680 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
| 681 | 681 | if ($tooltiptrigger == '') { |
| 682 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
| 682 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
|
| 683 | 683 | } else { |
| 684 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 684 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 685 | 685 | } |
| 686 | 686 | } else { |
| 687 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 687 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 688 | 688 | } |
| 689 | 689 | if ($tooltipon == 1 || $tooltipon == 3) { |
| 690 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 690 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
| 691 | 691 | if ($tooltiptrigger == '') { |
| 692 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
| 692 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
|
| 693 | 693 | } else { |
| 694 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 694 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 695 | 695 | } |
| 696 | 696 | } else { |
| 697 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 697 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 698 | 698 | } |
| 699 | 699 | if (empty($notabs)) { |
| 700 | 700 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
| 701 | 701 | } elseif ($notabs == 2) { |
| 702 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
| 702 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
| 703 | 703 | } |
| 704 | 704 | // Define value if value is before |
| 705 | 705 | if ($direction < 0) { |
| 706 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 706 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 707 | 707 | if ($tag == 'td') { |
| 708 | 708 | $s .= ' class="valigntop" width="14"'; |
| 709 | 709 | } |
| 710 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 710 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 711 | 711 | } |
| 712 | 712 | // Use another method to help avoid having a space in value in order to use this value with jquery |
| 713 | 713 | // Define label |
| 714 | 714 | if ((string) $text != '') { |
| 715 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
| 715 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
| 716 | 716 | } |
| 717 | 717 | // Define value if value is after |
| 718 | 718 | if ($direction > 0) { |
| 719 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 719 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 720 | 720 | if ($tag == 'td') { |
| 721 | 721 | $s .= ' class="valignmiddle" width="14"'; |
| 722 | 722 | } |
| 723 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 723 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 724 | 724 | } |
| 725 | 725 | if (empty($notabs)) { |
| 726 | 726 | $s .= '</tr></table>'; |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | $disabled = 0; |
| 826 | 826 | $ret = '<div class="centpercent center">'; |
| 827 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
| 827 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
| 828 | 828 | |
| 829 | 829 | // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. |
| 830 | 830 | $parameters = array(); |
@@ -834,9 +834,9 @@ discard block |
||
| 834 | 834 | return; |
| 835 | 835 | } |
| 836 | 836 | if (empty($reshook)) { |
| 837 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
| 837 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
| 838 | 838 | foreach ($arrayofaction as $code => $label) { |
| 839 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
| 839 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | $ret .= $hookmanager->resPrint; |
@@ -844,17 +844,17 @@ discard block |
||
| 844 | 844 | $ret .= '</select>'; |
| 845 | 845 | |
| 846 | 846 | if (empty($conf->dol_optimize_smallscreen)) { |
| 847 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
| 847 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
| 848 | 848 | } |
| 849 | 849 | |
| 850 | 850 | // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button |
| 851 | 851 | $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. |
| 852 | - $ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">'; |
|
| 852 | + $ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; |
|
| 853 | 853 | $ret .= '</div>'; |
| 854 | 854 | |
| 855 | 855 | if (!empty($conf->use_javascript_ajax)) { |
| 856 | 856 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
| 857 | - <script nonce="' . getNonce() . '"> |
|
| 857 | + <script nonce="' . getNonce().'"> |
|
| 858 | 858 | function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */ |
| 859 | 859 | { |
| 860 | 860 | atleastoneselected=0; |
@@ -865,11 +865,11 @@ discard block |
||
| 865 | 865 | |
| 866 | 866 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
| 867 | 867 | |
| 868 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
| 868 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
| 869 | 869 | { |
| 870 | 870 | jQuery("."+name).show(); |
| 871 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
| 872 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
| 871 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
| 872 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
| 873 | 873 | } |
| 874 | 874 | else |
| 875 | 875 | { |
@@ -879,11 +879,11 @@ discard block |
||
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | jQuery(document).ready(function () { |
| 882 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
| 883 | - jQuery(".' . $cssclass . '").click(function() { |
|
| 884 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
| 882 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
| 883 | + jQuery(".' . $cssclass.'").click(function() { |
|
| 884 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
| 885 | 885 | }); |
| 886 | - jQuery(".' . $name . 'select").change(function() { |
|
| 886 | + jQuery(".' . $name.'select").change(function() { |
|
| 887 | 887 | var massaction = $( this ).val(); |
| 888 | 888 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
| 889 | 889 | if (massaction == "builddoc") |
@@ -891,18 +891,18 @@ discard block |
||
| 891 | 891 | urlform = urlform + "#show_files"; |
| 892 | 892 | } |
| 893 | 893 | $( this ).closest("form").attr("action", urlform); |
| 894 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
| 894 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
| 895 | 895 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
| 896 | 896 | if ($(this).val() != \'0\') |
| 897 | 897 | { |
| 898 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
| 899 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
| 900 | - jQuery(".' . $name . '"+massaction).show(); |
|
| 898 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
| 899 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
| 900 | + jQuery(".' . $name.'"+massaction).show(); |
|
| 901 | 901 | } |
| 902 | 902 | else |
| 903 | 903 | { |
| 904 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
| 905 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
| 904 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
| 905 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
| 906 | 906 | } |
| 907 | 907 | }); |
| 908 | 908 | }); |
@@ -945,14 +945,14 @@ discard block |
||
| 945 | 945 | $atleastonefavorite = 0; |
| 946 | 946 | |
| 947 | 947 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
| 948 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
| 948 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
| 949 | 949 | $sql .= " WHERE active > 0"; |
| 950 | 950 | //$sql.= " ORDER BY code ASC"; |
| 951 | 951 | |
| 952 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
| 952 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
| 953 | 953 | $resql = $this->db->query($sql); |
| 954 | 954 | if ($resql) { |
| 955 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 955 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 956 | 956 | $num = $this->db->num_rows($resql); |
| 957 | 957 | $i = 0; |
| 958 | 958 | if ($num) { |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | $countryArray[$i]['rowid'] = $obj->rowid; |
| 963 | 963 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
| 964 | 964 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
| 965 | - $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 965 | + $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 966 | 966 | $countryArray[$i]['favorite'] = $obj->favorite; |
| 967 | 967 | $countryArray[$i]['eec'] = $obj->eec; |
| 968 | 968 | $favorite[$i] = $obj->favorite; |
@@ -980,20 +980,20 @@ discard block |
||
| 980 | 980 | |
| 981 | 981 | if ($showempty) { |
| 982 | 982 | if (is_numeric($showempty)) { |
| 983 | - $out .= '<option value=""> </option>' . "\n"; |
|
| 983 | + $out .= '<option value=""> </option>'."\n"; |
|
| 984 | 984 | } else { |
| 985 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
| 985 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
| 986 | 986 | } |
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
| 990 | 990 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
| 991 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 992 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
| 991 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 992 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
| 993 | 993 | if ($mysoc->isInEEC()) { |
| 994 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 994 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 995 | 995 | } |
| 996 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
| 996 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
| 997 | 997 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
| 998 | 998 | } |
| 999 | 999 | |
@@ -1021,20 +1021,20 @@ discard block |
||
| 1021 | 1021 | $labeltoshow .= ' '; |
| 1022 | 1022 | } |
| 1023 | 1023 | if ($row['code_iso']) { |
| 1024 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
| 1024 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
| 1025 | 1025 | if (empty($hideflags)) { |
| 1026 | 1026 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
| 1027 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
| 1027 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
| 1032 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1032 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1033 | 1033 | } else { |
| 1034 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
| 1034 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
| 1035 | 1035 | } |
| 1036 | 1036 | $out .= $labeltoshow; |
| 1037 | - $out .= '</option>' . "\n"; |
|
| 1037 | + $out .= '</option>'."\n"; |
|
| 1038 | 1038 | } |
| 1039 | 1039 | } |
| 1040 | 1040 | $out .= '</select>'; |
@@ -1043,8 +1043,8 @@ discard block |
||
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | 1045 | // Make select dynamic |
| 1046 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1047 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
| 1046 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1047 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
| 1048 | 1048 | |
| 1049 | 1049 | return $out; |
| 1050 | 1050 | } |
@@ -1076,25 +1076,25 @@ discard block |
||
| 1076 | 1076 | $incotermArray = array(); |
| 1077 | 1077 | |
| 1078 | 1078 | $sql = "SELECT rowid, code"; |
| 1079 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
| 1079 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
| 1080 | 1080 | $sql .= " WHERE active > 0"; |
| 1081 | 1081 | $sql .= " ORDER BY code ASC"; |
| 1082 | 1082 | |
| 1083 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
| 1083 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
| 1084 | 1084 | $resql = $this->db->query($sql); |
| 1085 | 1085 | if ($resql) { |
| 1086 | 1086 | if ($conf->use_javascript_ajax && !$forcecombo) { |
| 1087 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1087 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1088 | 1088 | $out .= ajax_combobox($htmlname, $events); |
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | if (!empty($page)) { |
| 1092 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1092 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1093 | 1093 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
| 1094 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1094 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 1097 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 1098 | 1098 | $out .= '<option value="0"> </option>'; |
| 1099 | 1099 | $num = $this->db->num_rows($resql); |
| 1100 | 1100 | $i = 0; |
@@ -1108,9 +1108,9 @@ discard block |
||
| 1108 | 1108 | |
| 1109 | 1109 | foreach ($incotermArray as $row) { |
| 1110 | 1110 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
| 1111 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
| 1111 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
| 1112 | 1112 | } else { |
| 1113 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
| 1113 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | if ($row['code']) { |
@@ -1123,13 +1123,13 @@ discard block |
||
| 1123 | 1123 | $out .= '</select>'; |
| 1124 | 1124 | |
| 1125 | 1125 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 1126 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
| 1126 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
| 1127 | 1127 | $moreattrib .= ' autocomplete="off"'; |
| 1128 | 1128 | } |
| 1129 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
| 1129 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
| 1130 | 1130 | |
| 1131 | 1131 | if (!empty($page)) { |
| 1132 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
| 1132 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
| 1133 | 1133 | } |
| 1134 | 1134 | } else { |
| 1135 | 1135 | dol_print_error($this->db); |
@@ -1160,9 +1160,9 @@ discard block |
||
| 1160 | 1160 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
| 1161 | 1161 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
| 1162 | 1162 | if (empty($hidetext)) { |
| 1163 | - print $langs->trans("Type") . ': '; |
|
| 1163 | + print $langs->trans("Type").': '; |
|
| 1164 | 1164 | } |
| 1165 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1165 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1166 | 1166 | if ($showempty) { |
| 1167 | 1167 | print '<option value="-1"'; |
| 1168 | 1168 | if ($selected == -1) { |
@@ -1175,28 +1175,28 @@ discard block |
||
| 1175 | 1175 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1176 | 1176 | print ' selected'; |
| 1177 | 1177 | } |
| 1178 | - print '>' . $langs->trans("Product"); |
|
| 1178 | + print '>'.$langs->trans("Product"); |
|
| 1179 | 1179 | |
| 1180 | 1180 | print '<option value="1"'; |
| 1181 | 1181 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1182 | 1182 | print ' selected'; |
| 1183 | 1183 | } |
| 1184 | - print '>' . $langs->trans("Service"); |
|
| 1184 | + print '>'.$langs->trans("Service"); |
|
| 1185 | 1185 | |
| 1186 | 1186 | print '</select>'; |
| 1187 | - print ajax_combobox('select_' . $htmlname); |
|
| 1187 | + print ajax_combobox('select_'.$htmlname); |
|
| 1188 | 1188 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1189 | 1189 | } |
| 1190 | 1190 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1191 | 1191 | print $langs->trans("Service"); |
| 1192 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1192 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1193 | 1193 | } |
| 1194 | 1194 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1195 | 1195 | print $langs->trans("Product"); |
| 1196 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1196 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1197 | 1197 | } |
| 1198 | 1198 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1199 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1199 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
| 1200 | 1200 | } |
| 1201 | 1201 | } |
| 1202 | 1202 | |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | $langs->load("trips"); |
| 1223 | 1223 | |
| 1224 | 1224 | $sql = "SELECT c.code, c.label"; |
| 1225 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1225 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1226 | 1226 | $sql .= " WHERE active > 0"; |
| 1227 | 1227 | |
| 1228 | 1228 | $resql = $this->db->query($sql); |
@@ -1263,11 +1263,11 @@ discard block |
||
| 1263 | 1263 | // phpcs:enable |
| 1264 | 1264 | global $user, $langs; |
| 1265 | 1265 | |
| 1266 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1266 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1267 | 1267 | |
| 1268 | 1268 | $this->load_cache_types_fees(); |
| 1269 | 1269 | |
| 1270 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1270 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1271 | 1271 | if ($showempty) { |
| 1272 | 1272 | print '<option value="-1"'; |
| 1273 | 1273 | if ($selected == -1) { |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | foreach ($this->cache_types_fees as $key => $value) { |
| 1280 | - print '<option value="' . $key . '"'; |
|
| 1280 | + print '<option value="'.$key.'"'; |
|
| 1281 | 1281 | if ($key == $selected) { |
| 1282 | 1282 | print ' selected'; |
| 1283 | 1283 | } |
@@ -1328,12 +1328,12 @@ discard block |
||
| 1328 | 1328 | $ajaxoptions = array(); |
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1331 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1332 | 1332 | |
| 1333 | 1333 | // No immediate load of all database |
| 1334 | 1334 | $placeholder = ''; |
| 1335 | 1335 | if ($selected && empty($selected_input_value)) { |
| 1336 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1336 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1337 | 1337 | $societetmp = new Societe($this->db); |
| 1338 | 1338 | $societetmp->fetch($selected); |
| 1339 | 1339 | $selected_input_value = $societetmp->name; |
@@ -1341,25 +1341,25 @@ discard block |
||
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | // mode 1 |
| 1344 | - $urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . join(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : ''); |
|
| 1344 | + $urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : ''); |
|
| 1345 | 1345 | |
| 1346 | 1346 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1347 | 1347 | if (empty($hidelabel)) { |
| 1348 | - print $langs->trans("RefOrLabel") . ' : '; |
|
| 1348 | + print $langs->trans("RefOrLabel").' : '; |
|
| 1349 | 1349 | } elseif ($hidelabel > 1) { |
| 1350 | 1350 | $placeholder = $langs->trans("RefOrLabel"); |
| 1351 | 1351 | if ($hidelabel == 2) { |
| 1352 | 1352 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1353 | 1353 | } |
| 1354 | 1354 | } |
| 1355 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 1355 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 1356 | 1356 | if ($hidelabel == 3) { |
| 1357 | 1357 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | 1360 | $out .= ajax_event($htmlname, $events); |
| 1361 | 1361 | |
| 1362 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1362 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1363 | 1363 | } else { |
| 1364 | 1364 | // Immediate load of all database |
| 1365 | 1365 | $out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode); |
@@ -1443,30 +1443,30 @@ discard block |
||
| 1443 | 1443 | $sql .= ", s.address, s.zip, s.town"; |
| 1444 | 1444 | $sql .= ", dictp.code as country_code"; |
| 1445 | 1445 | } |
| 1446 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1446 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1447 | 1447 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1448 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1448 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1449 | 1449 | } |
| 1450 | 1450 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1451 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1451 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1452 | 1452 | } |
| 1453 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1453 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1454 | 1454 | if (!empty($user->socid)) { |
| 1455 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1455 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1456 | 1456 | } |
| 1457 | 1457 | if ($filter) { |
| 1458 | 1458 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1459 | 1459 | // if not, by testSqlAndScriptInject() only. |
| 1460 | - $sql .= " AND (" . $filter . ")"; |
|
| 1460 | + $sql .= " AND (".$filter.")"; |
|
| 1461 | 1461 | } |
| 1462 | 1462 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1463 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1463 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1466 | 1466 | $sql .= " AND s.status <> 0"; |
| 1467 | 1467 | } |
| 1468 | 1468 | if (!empty($excludeids)) { |
| 1469 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(join(',', $excludeids)) . ")"; |
|
| 1469 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; |
|
| 1470 | 1470 | } |
| 1471 | 1471 | // Add where from hooks |
| 1472 | 1472 | $parameters = array(); |
@@ -1486,17 +1486,17 @@ discard block |
||
| 1486 | 1486 | if ($i > 0) { |
| 1487 | 1487 | $sql .= " AND "; |
| 1488 | 1488 | } |
| 1489 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1489 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1490 | 1490 | $i++; |
| 1491 | 1491 | } |
| 1492 | 1492 | if (count($scrit) > 1) { |
| 1493 | 1493 | $sql .= ")"; |
| 1494 | 1494 | } |
| 1495 | 1495 | if (isModEnabled('barcode')) { |
| 1496 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1496 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1497 | 1497 | } |
| 1498 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1499 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1498 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1499 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1500 | 1500 | $sql .= ")"; |
| 1501 | 1501 | } |
| 1502 | 1502 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1507,12 +1507,12 @@ discard block |
||
| 1507 | 1507 | $resql = $this->db->query($sql); |
| 1508 | 1508 | if ($resql) { |
| 1509 | 1509 | if (!$forcecombo) { |
| 1510 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1510 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1511 | 1511 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1512 | 1512 | } |
| 1513 | 1513 | |
| 1514 | 1514 | // Construct $out and $outarray |
| 1515 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1515 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1516 | 1516 | |
| 1517 | 1517 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1518 | 1518 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | } |
| 1526 | 1526 | } |
| 1527 | 1527 | if ($showempty) { |
| 1528 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1528 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | $companytemp = new Societe($this->db); |
@@ -1538,18 +1538,18 @@ discard block |
||
| 1538 | 1538 | $label = ''; |
| 1539 | 1539 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
| 1540 | 1540 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1541 | - $label = $obj->code_client . ' - '; |
|
| 1541 | + $label = $obj->code_client.' - '; |
|
| 1542 | 1542 | } |
| 1543 | 1543 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1544 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1544 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1545 | 1545 | } |
| 1546 | - $label .= ' ' . $obj->name; |
|
| 1546 | + $label .= ' '.$obj->name; |
|
| 1547 | 1547 | } else { |
| 1548 | 1548 | $label = $obj->name; |
| 1549 | 1549 | } |
| 1550 | 1550 | |
| 1551 | 1551 | if (!empty($obj->name_alias)) { |
| 1552 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1552 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | 1555 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1564,7 +1564,7 @@ discard block |
||
| 1564 | 1564 | $companytemp->fournisseur = $obj->fournisseur; |
| 1565 | 1565 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1566 | 1566 | if ($tmptype) { |
| 1567 | - $labelhtml .= ' ' . $tmptype; |
|
| 1567 | + $labelhtml .= ' '.$tmptype; |
|
| 1568 | 1568 | } |
| 1569 | 1569 | |
| 1570 | 1570 | if ($obj->client || $obj->fournisseur) { |
@@ -1574,10 +1574,10 @@ discard block |
||
| 1574 | 1574 | $label .= $langs->trans("Customer"); |
| 1575 | 1575 | } |
| 1576 | 1576 | if ($obj->client == 2 || $obj->client == 3) { |
| 1577 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1577 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1578 | 1578 | } |
| 1579 | 1579 | if ($obj->fournisseur) { |
| 1580 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1580 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1581 | 1581 | } |
| 1582 | 1582 | if ($obj->client || $obj->fournisseur) { |
| 1583 | 1583 | $label .= ')'; |
@@ -1585,9 +1585,9 @@ discard block |
||
| 1585 | 1585 | } |
| 1586 | 1586 | |
| 1587 | 1587 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1588 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1588 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1589 | 1589 | if (!empty($obj->country_code)) { |
| 1590 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1590 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1591 | 1591 | } |
| 1592 | 1592 | $label .= $s; |
| 1593 | 1593 | $labelhtml .= $s; |
@@ -1595,9 +1595,9 @@ discard block |
||
| 1595 | 1595 | |
| 1596 | 1596 | if (empty($outputmode)) { |
| 1597 | 1597 | if (in_array($obj->rowid, $selected)) { |
| 1598 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1598 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1599 | 1599 | } else { |
| 1600 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1600 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1601 | 1601 | } |
| 1602 | 1602 | } else { |
| 1603 | 1603 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1609,7 +1609,7 @@ discard block |
||
| 1609 | 1609 | } |
| 1610 | 1610 | } |
| 1611 | 1611 | } |
| 1612 | - $out .= '</select>' . "\n"; |
|
| 1612 | + $out .= '</select>'."\n"; |
|
| 1613 | 1613 | } else { |
| 1614 | 1614 | dol_print_error($this->db); |
| 1615 | 1615 | } |
@@ -1643,18 +1643,18 @@ discard block |
||
| 1643 | 1643 | // On recherche les remises |
| 1644 | 1644 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 1645 | 1645 | $sql .= " re.description, re.fk_facture_source"; |
| 1646 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 1647 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 1648 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 1646 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 1647 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 1648 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 1649 | 1649 | if ($filter) { |
| 1650 | - $sql .= " AND " . $filter; |
|
| 1650 | + $sql .= " AND ".$filter; |
|
| 1651 | 1651 | } |
| 1652 | 1652 | $sql .= " ORDER BY re.description ASC"; |
| 1653 | 1653 | |
| 1654 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 1654 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 1655 | 1655 | $resql = $this->db->query($sql); |
| 1656 | 1656 | if ($resql) { |
| 1657 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 1657 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 1658 | 1658 | $num = $this->db->num_rows($resql); |
| 1659 | 1659 | |
| 1660 | 1660 | $qualifiedlines = $num; |
@@ -1692,16 +1692,16 @@ discard block |
||
| 1692 | 1692 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
| 1693 | 1693 | $tmpfac = new Facture($this->db); |
| 1694 | 1694 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 1695 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 1695 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 1696 | 1696 | } |
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 1699 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 1700 | 1700 | $i++; |
| 1701 | 1701 | } |
| 1702 | 1702 | } |
| 1703 | 1703 | print '</select>'; |
| 1704 | - print ajax_combobox('select_' . $htmlname); |
|
| 1704 | + print ajax_combobox('select_'.$htmlname); |
|
| 1705 | 1705 | |
| 1706 | 1706 | return $qualifiedlines; |
| 1707 | 1707 | } else { |
@@ -1782,7 +1782,7 @@ discard block |
||
| 1782 | 1782 | $out = ''; |
| 1783 | 1783 | |
| 1784 | 1784 | if (!is_object($hookmanager)) { |
| 1785 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1785 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1786 | 1786 | $hookmanager = new HookManager($this->db); |
| 1787 | 1787 | } |
| 1788 | 1788 | |
@@ -1791,13 +1791,13 @@ discard block |
||
| 1791 | 1791 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1792 | 1792 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1793 | 1793 | } |
| 1794 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1794 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1795 | 1795 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1796 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1796 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1797 | 1797 | } |
| 1798 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1798 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1799 | 1799 | if ($socid > 0 || $socid == -1) { |
| 1800 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1800 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1801 | 1801 | } |
| 1802 | 1802 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1803 | 1803 | $sql .= " AND sp.statut <> 0"; |
@@ -1808,30 +1808,30 @@ discard block |
||
| 1808 | 1808 | $sql .= $hookmanager->resPrint; |
| 1809 | 1809 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1810 | 1810 | |
| 1811 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1811 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1812 | 1812 | $resql = $this->db->query($sql); |
| 1813 | 1813 | if ($resql) { |
| 1814 | 1814 | $num = $this->db->num_rows($resql); |
| 1815 | 1815 | |
| 1816 | 1816 | if ($htmlname != 'none' && !$options_only) { |
| 1817 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1817 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | 1820 | if ($showempty && !is_numeric($showempty)) { |
| 1821 | 1821 | $textforempty = $showempty; |
| 1822 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1822 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1823 | 1823 | } else { |
| 1824 | 1824 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1825 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1825 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1826 | 1826 | } |
| 1827 | 1827 | if ($showempty == 2) { |
| 1828 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1828 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1829 | 1829 | } |
| 1830 | 1830 | } |
| 1831 | 1831 | |
| 1832 | 1832 | $i = 0; |
| 1833 | 1833 | if ($num) { |
| 1834 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1834 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1835 | 1835 | $contactstatic = new Contact($this->db); |
| 1836 | 1836 | |
| 1837 | 1837 | while ($i < $num) { |
@@ -1867,7 +1867,7 @@ discard block |
||
| 1867 | 1867 | } |
| 1868 | 1868 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1869 | 1869 | if (!empty($extendedInfos)) { |
| 1870 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1870 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1871 | 1871 | } |
| 1872 | 1872 | } |
| 1873 | 1873 | |
@@ -1884,42 +1884,42 @@ discard block |
||
| 1884 | 1884 | $disabled = 1; |
| 1885 | 1885 | } |
| 1886 | 1886 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1887 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1887 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1888 | 1888 | if ($disabled) { |
| 1889 | 1889 | $out .= ' disabled'; |
| 1890 | 1890 | } |
| 1891 | 1891 | $out .= ' selected>'; |
| 1892 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1892 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1893 | 1893 | if ($showfunction && $obj->poste) { |
| 1894 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1894 | + $out .= ' ('.$obj->poste.')'; |
|
| 1895 | 1895 | } |
| 1896 | 1896 | if (($showsoc > 0) && $obj->company) { |
| 1897 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1897 | + $out .= ' - ('.$obj->company.')'; |
|
| 1898 | 1898 | } |
| 1899 | 1899 | $out .= '</option>'; |
| 1900 | 1900 | } else { |
| 1901 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1901 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1902 | 1902 | if ($disabled) { |
| 1903 | 1903 | $out .= ' disabled'; |
| 1904 | 1904 | } |
| 1905 | 1905 | $out .= '>'; |
| 1906 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1906 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1907 | 1907 | if ($showfunction && $obj->poste) { |
| 1908 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1908 | + $out .= ' ('.$obj->poste.')'; |
|
| 1909 | 1909 | } |
| 1910 | 1910 | if (($showsoc > 0) && $obj->company) { |
| 1911 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1911 | + $out .= ' - ('.$obj->company.')'; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | $out .= '</option>'; |
| 1914 | 1914 | } |
| 1915 | 1915 | } else { |
| 1916 | 1916 | if (in_array($obj->rowid, $selected)) { |
| 1917 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1917 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1918 | 1918 | if ($showfunction && $obj->poste) { |
| 1919 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1919 | + $out .= ' ('.$obj->poste.')'; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | if (($showsoc > 0) && $obj->company) { |
| 1922 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1922 | + $out .= ' - ('.$obj->company.')'; |
|
| 1923 | 1923 | } |
| 1924 | 1924 | } |
| 1925 | 1925 | } |
@@ -1928,7 +1928,7 @@ discard block |
||
| 1928 | 1928 | } |
| 1929 | 1929 | } else { |
| 1930 | 1930 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1931 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1931 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1932 | 1932 | $out .= $labeltoshow; |
| 1933 | 1933 | $out .= '</option>'; |
| 1934 | 1934 | } |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | } |
| 1950 | 1950 | |
| 1951 | 1951 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1952 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1952 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1953 | 1953 | $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1954 | 1954 | } |
| 1955 | 1955 | |
@@ -2054,11 +2054,11 @@ discard block |
||
| 2054 | 2054 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2055 | 2055 | $sql .= ", e.label"; |
| 2056 | 2056 | } |
| 2057 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2057 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2058 | 2058 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2059 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2059 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2060 | 2060 | if (!empty($force_entity)) { |
| 2061 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2061 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2062 | 2062 | } else { |
| 2063 | 2063 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2064 | 2064 | } |
@@ -2066,17 +2066,17 @@ discard block |
||
| 2066 | 2066 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2067 | 2067 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2068 | 2068 | } else { |
| 2069 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2069 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2070 | 2070 | } |
| 2071 | 2071 | } |
| 2072 | 2072 | if (!empty($user->socid)) { |
| 2073 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2073 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2074 | 2074 | } |
| 2075 | 2075 | if (is_array($exclude) && $excludeUsers) { |
| 2076 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2076 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2077 | 2077 | } |
| 2078 | 2078 | if ($includeUsers) { |
| 2079 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2079 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2080 | 2080 | } |
| 2081 | 2081 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
| 2082 | 2082 | $sql .= " AND u.statut <> 0"; |
@@ -2088,7 +2088,7 @@ discard block |
||
| 2088 | 2088 | $sql .= " AND u.fk_soc IS NULL"; |
| 2089 | 2089 | } |
| 2090 | 2090 | if (!empty($morefilter)) { |
| 2091 | - $sql .= " " . $morefilter; |
|
| 2091 | + $sql .= " ".$morefilter; |
|
| 2092 | 2092 | } |
| 2093 | 2093 | |
| 2094 | 2094 | //Add hook to filter on user (for example on usergroup define in custom modules) |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 2106 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2106 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2107 | 2107 | |
| 2108 | 2108 | $resql = $this->db->query($sql); |
| 2109 | 2109 | if ($resql) { |
@@ -2111,7 +2111,7 @@ discard block |
||
| 2111 | 2111 | $i = 0; |
| 2112 | 2112 | if ($num) { |
| 2113 | 2113 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2114 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2114 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2115 | 2115 | if ($show_empty && !$multiple) { |
| 2116 | 2116 | $textforempty = ' '; |
| 2117 | 2117 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2120,10 +2120,10 @@ discard block |
||
| 2120 | 2120 | if (!is_numeric($show_empty)) { |
| 2121 | 2121 | $textforempty = $show_empty; |
| 2122 | 2122 | } |
| 2123 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2123 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2124 | 2124 | } |
| 2125 | 2125 | if ($show_every) { |
| 2126 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2126 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2127 | 2127 | } |
| 2128 | 2128 | |
| 2129 | 2129 | $userstatic = new User($this->db); |
@@ -2170,22 +2170,22 @@ discard block |
||
| 2170 | 2170 | } |
| 2171 | 2171 | if ($showstatus >= 0) { |
| 2172 | 2172 | if ($obj->status == 1 && $showstatus == 1) { |
| 2173 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2174 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2173 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2174 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2175 | 2175 | } |
| 2176 | 2176 | if ($obj->status == 0 && $showstatus == 1) { |
| 2177 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2178 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2177 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2178 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2179 | 2179 | } |
| 2180 | 2180 | } |
| 2181 | 2181 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) { |
| 2182 | 2182 | if (empty($obj->entity)) { |
| 2183 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2184 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2183 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2184 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2185 | 2185 | } else { |
| 2186 | 2186 | if ($obj->entity != $conf->entity) { |
| 2187 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2188 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2187 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2188 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2189 | 2189 | } |
| 2190 | 2190 | } |
| 2191 | 2191 | } |
@@ -2193,13 +2193,13 @@ discard block |
||
| 2193 | 2193 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2194 | 2194 | if (!empty($disableline) && $disableline != '1') { |
| 2195 | 2195 | // Add text from $enableonlytext parameter |
| 2196 | - $moreinfo .= ' - ' . $disableline; |
|
| 2197 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2196 | + $moreinfo .= ' - '.$disableline; |
|
| 2197 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2198 | 2198 | } |
| 2199 | 2199 | $labeltoshow .= $moreinfo; |
| 2200 | 2200 | $labeltoshowhtml .= $moreinfohtml; |
| 2201 | 2201 | |
| 2202 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2202 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2203 | 2203 | if (!empty($disableline)) { |
| 2204 | 2204 | $out .= ' disabled'; |
| 2205 | 2205 | } |
@@ -2207,7 +2207,7 @@ discard block |
||
| 2207 | 2207 | $out .= ' selected'; |
| 2208 | 2208 | } |
| 2209 | 2209 | $out .= ' data-html="'; |
| 2210 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2210 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2211 | 2211 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2212 | 2212 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2213 | 2213 | } |
@@ -2220,7 +2220,7 @@ discard block |
||
| 2220 | 2220 | $out .= $labeltoshow; |
| 2221 | 2221 | $out .= '</option>'; |
| 2222 | 2222 | |
| 2223 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2223 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2224 | 2224 | $outarray2[$userstatic->id] = array( |
| 2225 | 2225 | 'id'=>$userstatic->id, |
| 2226 | 2226 | 'label'=>$labeltoshow, |
@@ -2232,14 +2232,14 @@ discard block |
||
| 2232 | 2232 | $i++; |
| 2233 | 2233 | } |
| 2234 | 2234 | } else { |
| 2235 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2236 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2235 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2236 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2237 | 2237 | } |
| 2238 | 2238 | $out .= '</select>'; |
| 2239 | 2239 | |
| 2240 | 2240 | if ($num && !$forcecombo) { |
| 2241 | 2241 | // Enhance with select2 |
| 2242 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2242 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2243 | 2243 | $out .= ajax_combobox($htmlname); |
| 2244 | 2244 | } |
| 2245 | 2245 | } else { |
@@ -2309,16 +2309,16 @@ discard block |
||
| 2309 | 2309 | $out .= $userstatic->getNomUrl(-1); |
| 2310 | 2310 | if ($i == 0) { |
| 2311 | 2311 | $ownerid = $value['id']; |
| 2312 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2312 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2313 | 2313 | } |
| 2314 | 2314 | if ($nbassignetouser > 1 && $action != 'view') { |
| 2315 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">'; |
|
| 2315 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; |
|
| 2316 | 2316 | } |
| 2317 | 2317 | // Show my availability |
| 2318 | 2318 | if ($showproperties) { |
| 2319 | 2319 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2320 | 2320 | $out .= '<div class="myavailability inline-block">'; |
| 2321 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2321 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2322 | 2322 | $out .= '</div>'; |
| 2323 | 2323 | } |
| 2324 | 2324 | } |
@@ -2335,15 +2335,15 @@ discard block |
||
| 2335 | 2335 | // Method with no ajax |
| 2336 | 2336 | if ($action != 'view') { |
| 2337 | 2337 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2338 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2338 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2339 | 2339 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2340 | 2340 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2341 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2342 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2341 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2342 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2343 | 2343 | $out .= '});'; |
| 2344 | 2344 | $out .= '})</script>'; |
| 2345 | 2345 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2346 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2346 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2347 | 2347 | $out .= '<br>'; |
| 2348 | 2348 | } |
| 2349 | 2349 | |
@@ -2398,13 +2398,13 @@ discard block |
||
| 2398 | 2398 | $resourcestatic->fetch($value['id']); |
| 2399 | 2399 | $out .= $resourcestatic->getNomUrl(-1); |
| 2400 | 2400 | if ($nbassignetoresource > 1 && $action != 'view') { |
| 2401 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
| 2401 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
|
| 2402 | 2402 | } |
| 2403 | 2403 | // Show my availability |
| 2404 | 2404 | if ($showproperties) { |
| 2405 | 2405 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2406 | 2406 | $out .= '<div class="myavailability inline-block">'; |
| 2407 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
| 2407 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
| 2408 | 2408 | $out .= '</div>'; |
| 2409 | 2409 | } |
| 2410 | 2410 | } |
@@ -2421,11 +2421,11 @@ discard block |
||
| 2421 | 2421 | // Method with no ajax |
| 2422 | 2422 | if ($action != 'view') { |
| 2423 | 2423 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
| 2424 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2424 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2425 | 2425 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2426 | 2426 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2427 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2428 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2427 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2428 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2429 | 2429 | $out .= '});'; |
| 2430 | 2430 | $out .= '})</script>'; |
| 2431 | 2431 | |
@@ -2433,7 +2433,7 @@ discard block |
||
| 2433 | 2433 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2434 | 2434 | $out .= $formresources->select_resource_list(0, $htmlname, '', 1, 1, 0, $events, '', 2, null); |
| 2435 | 2435 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2436 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2436 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2437 | 2437 | $out .= '<br>'; |
| 2438 | 2438 | } |
| 2439 | 2439 | |
@@ -2494,7 +2494,7 @@ discard block |
||
| 2494 | 2494 | $placeholder = ''; |
| 2495 | 2495 | |
| 2496 | 2496 | if ($selected && empty($selected_input_value)) { |
| 2497 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2497 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2498 | 2498 | $producttmpselect = new Product($this->db); |
| 2499 | 2499 | $producttmpselect->fetch($selected); |
| 2500 | 2500 | $selected_input_value = $producttmpselect->ref; |
@@ -2509,17 +2509,17 @@ discard block |
||
| 2509 | 2509 | } |
| 2510 | 2510 | } |
| 2511 | 2511 | // mode=1 means customers products |
| 2512 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus; |
|
| 2513 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2512 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus; |
|
| 2513 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2514 | 2514 | |
| 2515 | 2515 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2516 | 2516 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2517 | 2517 | // when a parent of variant has been selected. |
| 2518 | 2518 | $out .= ' |
| 2519 | 2519 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2520 | - <script nonce="' . getNonce() . '"> |
|
| 2520 | + <script nonce="' . getNonce().'"> |
|
| 2521 | 2521 | // auto show attributes fields |
| 2522 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2522 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2523 | 2523 | combvalues = {}; |
| 2524 | 2524 | |
| 2525 | 2525 | jQuery(document).ready(function () { |
@@ -2530,7 +2530,7 @@ discard block |
||
| 2530 | 2530 | } |
| 2531 | 2531 | }); |
| 2532 | 2532 | |
| 2533 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2533 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2534 | 2534 | |
| 2535 | 2535 | if (!jQuery(this).val()) { |
| 2536 | 2536 | jQuery(\'div#attributes_box\').empty(); |
@@ -2539,7 +2539,7 @@ discard block |
||
| 2539 | 2539 | |
| 2540 | 2540 | console.log("A change has started. We get variants fields to inject html select"); |
| 2541 | 2541 | |
| 2542 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2542 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2543 | 2543 | id: jQuery(this).val() |
| 2544 | 2544 | }, function (data) { |
| 2545 | 2545 | jQuery(\'div#attributes_box\').empty(); |
@@ -2582,21 +2582,21 @@ discard block |
||
| 2582 | 2582 | }) |
| 2583 | 2583 | }); |
| 2584 | 2584 | |
| 2585 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2585 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2586 | 2586 | }); |
| 2587 | 2587 | </script> |
| 2588 | 2588 | '; |
| 2589 | 2589 | } |
| 2590 | 2590 | |
| 2591 | 2591 | if (empty($hidelabel)) { |
| 2592 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 2592 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 2593 | 2593 | } elseif ($hidelabel > 1) { |
| 2594 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 2594 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 2595 | 2595 | if ($hidelabel == 2) { |
| 2596 | 2596 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2597 | 2597 | } |
| 2598 | 2598 | } |
| 2599 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 2599 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 2600 | 2600 | if ($hidelabel == 3) { |
| 2601 | 2601 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2602 | 2602 | } |
@@ -2633,33 +2633,33 @@ discard block |
||
| 2633 | 2633 | // phpcs:enable |
| 2634 | 2634 | global $conf, $user, $langs, $db; |
| 2635 | 2635 | |
| 2636 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2636 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2637 | 2637 | |
| 2638 | 2638 | $error = 0; |
| 2639 | 2639 | $out = ''; |
| 2640 | 2640 | |
| 2641 | 2641 | if (!$forcecombo) { |
| 2642 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2642 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2643 | 2643 | $events = array(); |
| 2644 | 2644 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2645 | 2645 | } |
| 2646 | 2646 | |
| 2647 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2647 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2648 | 2648 | |
| 2649 | 2649 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2650 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2651 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2650 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2651 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2652 | 2652 | if (!empty($status)) { |
| 2653 | - $sql .= ' AND status = ' . (int) $status; |
|
| 2653 | + $sql .= ' AND status = '.(int) $status; |
|
| 2654 | 2654 | } |
| 2655 | 2655 | if (!empty($type)) { |
| 2656 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2656 | + $sql .= ' AND bomtype = '.(int) $type; |
|
| 2657 | 2657 | } |
| 2658 | 2658 | if (!empty($TProducts)) { |
| 2659 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2659 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2660 | 2660 | } |
| 2661 | 2661 | if (!empty($limit)) { |
| 2662 | - $sql .= ' LIMIT ' . (int) $limit; |
|
| 2662 | + $sql .= ' LIMIT '.(int) $limit; |
|
| 2663 | 2663 | } |
| 2664 | 2664 | $resql = $db->query($sql); |
| 2665 | 2665 | if ($resql) { |
@@ -2673,11 +2673,11 @@ discard block |
||
| 2673 | 2673 | while ($obj = $db->fetch_object($resql)) { |
| 2674 | 2674 | $product = new Product($db); |
| 2675 | 2675 | $res = $product->fetch($obj->fk_product); |
| 2676 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2676 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2677 | 2677 | if ($obj->rowid == $selected) { |
| 2678 | 2678 | $out .= 'selected'; |
| 2679 | 2679 | } |
| 2680 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2680 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2681 | 2681 | } |
| 2682 | 2682 | } else { |
| 2683 | 2683 | $error++; |
@@ -2734,7 +2734,7 @@ discard block |
||
| 2734 | 2734 | |
| 2735 | 2735 | $warehouseStatusArray = array(); |
| 2736 | 2736 | if (!empty($warehouseStatus)) { |
| 2737 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2737 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2738 | 2738 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2739 | 2739 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2740 | 2740 | } |
@@ -2748,9 +2748,9 @@ discard block |
||
| 2748 | 2748 | |
| 2749 | 2749 | $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression"; |
| 2750 | 2750 | if (count($warehouseStatusArray)) { |
| 2751 | - $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock |
|
| 2751 | + $selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock |
|
| 2752 | 2752 | } else { |
| 2753 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2753 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2754 | 2754 | } |
| 2755 | 2755 | |
| 2756 | 2756 | $sql = "SELECT "; |
@@ -2766,9 +2766,9 @@ discard block |
||
| 2766 | 2766 | |
| 2767 | 2767 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
| 2768 | 2768 | //Product category |
| 2769 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2770 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2771 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2769 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2770 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2771 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2772 | 2772 | LIMIT 1 |
| 2773 | 2773 | ) AS categorie_product_id "; |
| 2774 | 2774 | } |
@@ -2794,15 +2794,15 @@ discard block |
||
| 2794 | 2794 | } |
| 2795 | 2795 | // Price by quantity |
| 2796 | 2796 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2797 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2797 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2798 | 2798 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2799 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2799 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2800 | 2800 | } |
| 2801 | 2801 | $sql .= " ORDER BY date_price"; |
| 2802 | 2802 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 2803 | - $sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2803 | + $sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
| 2804 | 2804 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2805 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2805 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2806 | 2806 | } |
| 2807 | 2807 | $sql .= " ORDER BY date_price"; |
| 2808 | 2808 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2816,53 +2816,53 @@ discard block |
||
| 2816 | 2816 | $sql .= $hookmanager->resPrint; |
| 2817 | 2817 | |
| 2818 | 2818 | if (count($warehouseStatusArray)) { |
| 2819 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2820 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 2821 | - $sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 2819 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2820 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 2821 | + $sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
| 2822 | 2822 | } |
| 2823 | 2823 | |
| 2824 | 2824 | // include search in supplier ref |
| 2825 | 2825 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 2826 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2826 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2827 | 2827 | } |
| 2828 | 2828 | |
| 2829 | 2829 | //Price by customer |
| 2830 | 2830 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 2831 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 2831 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 2832 | 2832 | } |
| 2833 | 2833 | // Units |
| 2834 | 2834 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 2835 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 2835 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 2836 | 2836 | } |
| 2837 | 2837 | // Multilang : we add translation |
| 2838 | 2838 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2839 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2839 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2840 | 2840 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
| 2841 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 2841 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 2842 | 2842 | $soc = new Societe($this->db); |
| 2843 | 2843 | $result = $soc->fetch($socid); |
| 2844 | 2844 | if ($result > 0 && !empty($soc->default_lang)) { |
| 2845 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 2845 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 2846 | 2846 | } else { |
| 2847 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2847 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2848 | 2848 | } |
| 2849 | 2849 | } else { |
| 2850 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2850 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2851 | 2851 | } |
| 2852 | 2852 | } |
| 2853 | 2853 | |
| 2854 | 2854 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 2855 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2855 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2856 | 2856 | } |
| 2857 | 2857 | |
| 2858 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 2858 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 2859 | 2859 | |
| 2860 | 2860 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 2861 | 2861 | $sql .= " AND pac.rowid IS NULL"; |
| 2862 | 2862 | } |
| 2863 | 2863 | |
| 2864 | 2864 | if ($finished == 0) { |
| 2865 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 2865 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 2866 | 2866 | } elseif ($finished == 1) { |
| 2867 | 2867 | $sql .= " AND p.finished = ".((int) $finished); |
| 2868 | 2868 | } |
@@ -2870,11 +2870,11 @@ discard block |
||
| 2870 | 2870 | $sql .= " AND p.tosell = ".((int) $status); |
| 2871 | 2871 | } |
| 2872 | 2872 | if ($status_purchase >= 0) { |
| 2873 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 2873 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 2874 | 2874 | } |
| 2875 | 2875 | // Filter by product type |
| 2876 | 2876 | if (strval($filtertype) != '') { |
| 2877 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 2877 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 2878 | 2878 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 2879 | 2879 | $sql .= " AND p.fk_product_type = 1"; |
| 2880 | 2880 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -2898,21 +2898,21 @@ discard block |
||
| 2898 | 2898 | if ($i > 0) { |
| 2899 | 2899 | $sql .= " AND "; |
| 2900 | 2900 | } |
| 2901 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2901 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2902 | 2902 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2903 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2903 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2904 | 2904 | } |
| 2905 | 2905 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 2906 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2906 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2907 | 2907 | } |
| 2908 | 2908 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
| 2909 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2909 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2910 | 2910 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2911 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2911 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2912 | 2912 | } |
| 2913 | 2913 | } |
| 2914 | 2914 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 2915 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2915 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2916 | 2916 | } |
| 2917 | 2917 | $sql .= ")"; |
| 2918 | 2918 | $i++; |
@@ -2921,12 +2921,12 @@ discard block |
||
| 2921 | 2921 | $sql .= ")"; |
| 2922 | 2922 | } |
| 2923 | 2923 | if (isModEnabled('barcode')) { |
| 2924 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 2924 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 2925 | 2925 | } |
| 2926 | 2926 | $sql .= ')'; |
| 2927 | 2927 | } |
| 2928 | 2928 | if (count($warehouseStatusArray)) { |
| 2929 | - $sql .= " GROUP BY " . $selectFields; |
|
| 2929 | + $sql .= " GROUP BY ".$selectFields; |
|
| 2930 | 2930 | } |
| 2931 | 2931 | |
| 2932 | 2932 | //Sort by category |
@@ -2941,23 +2941,23 @@ discard block |
||
| 2941 | 2941 | $sql .= $this->db->plimit($limit, 0); |
| 2942 | 2942 | |
| 2943 | 2943 | // Build output string |
| 2944 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 2944 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 2945 | 2945 | $result = $this->db->query($sql); |
| 2946 | 2946 | if ($result) { |
| 2947 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2948 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 2949 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 2947 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2948 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 2949 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 2950 | 2950 | |
| 2951 | 2951 | $num = $this->db->num_rows($result); |
| 2952 | 2952 | |
| 2953 | 2953 | $events = null; |
| 2954 | 2954 | |
| 2955 | 2955 | if (!$forcecombo) { |
| 2956 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2956 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2957 | 2957 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2958 | 2958 | } |
| 2959 | 2959 | |
| 2960 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2960 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2961 | 2961 | |
| 2962 | 2962 | $textifempty = ''; |
| 2963 | 2963 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -2974,7 +2974,7 @@ discard block |
||
| 2974 | 2974 | } |
| 2975 | 2975 | } |
| 2976 | 2976 | if ($showempty) { |
| 2977 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 2977 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 2978 | 2978 | } |
| 2979 | 2979 | |
| 2980 | 2980 | $i = 0; |
@@ -2985,11 +2985,11 @@ discard block |
||
| 2985 | 2985 | |
| 2986 | 2986 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product |
| 2987 | 2987 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 2988 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 2989 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 2988 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 2989 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 2990 | 2990 | $sql .= " ORDER BY quantity ASC"; |
| 2991 | 2991 | |
| 2992 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2992 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2993 | 2993 | $result2 = $this->db->query($sql); |
| 2994 | 2994 | if ($result2) { |
| 2995 | 2995 | $nb_prices = $this->db->num_rows($result2); |
@@ -3027,7 +3027,7 @@ discard block |
||
| 3027 | 3027 | $price_product = new Product($this->db); |
| 3028 | 3028 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3029 | 3029 | |
| 3030 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3030 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3031 | 3031 | $priceparser = new PriceParser($this->db); |
| 3032 | 3032 | $price_result = $priceparser->parseProduct($price_product); |
| 3033 | 3033 | if ($price_result >= 0) { |
@@ -3111,7 +3111,7 @@ discard block |
||
| 3111 | 3111 | $label = $objp->label_translated; |
| 3112 | 3112 | } |
| 3113 | 3113 | if (!empty($filterkey) && $filterkey != '') { |
| 3114 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3114 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3115 | 3115 | } |
| 3116 | 3116 | |
| 3117 | 3117 | $outkey = $objp->rowid; |
@@ -3132,32 +3132,32 @@ discard block |
||
| 3132 | 3132 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3133 | 3133 | |
| 3134 | 3134 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3135 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3135 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3136 | 3136 | } |
| 3137 | 3137 | |
| 3138 | 3138 | // Units |
| 3139 | 3139 | $outvalUnits = ''; |
| 3140 | 3140 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3141 | 3141 | if (!empty($objp->unit_short)) { |
| 3142 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3142 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3143 | 3143 | } |
| 3144 | 3144 | } |
| 3145 | 3145 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
| 3146 | 3146 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3147 | 3147 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3148 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3148 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3149 | 3149 | } |
| 3150 | 3150 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3151 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3152 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3151 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3152 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3153 | 3153 | } |
| 3154 | 3154 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3155 | 3155 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3156 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3156 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3157 | 3157 | } |
| 3158 | 3158 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3159 | 3159 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3160 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3160 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3161 | 3161 | } |
| 3162 | 3162 | } |
| 3163 | 3163 | if ($outdurationvalue && $outdurationunit) { |
@@ -3169,14 +3169,14 @@ discard block |
||
| 3169 | 3169 | 'y' => $langs->trans('Year') |
| 3170 | 3170 | ); |
| 3171 | 3171 | if (isset($da[$outdurationunit])) { |
| 3172 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3172 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3173 | 3173 | } |
| 3174 | 3174 | } |
| 3175 | 3175 | |
| 3176 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3176 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3177 | 3177 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3178 | 3178 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3179 | - $opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"'; |
|
| 3179 | + $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; |
|
| 3180 | 3180 | } |
| 3181 | 3181 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3182 | 3182 | if ($user->hasRight('stock', 'lire')) { |
@@ -3188,36 +3188,36 @@ discard block |
||
| 3188 | 3188 | } |
| 3189 | 3189 | } |
| 3190 | 3190 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 3191 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3192 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3191 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3192 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3193 | 3193 | } |
| 3194 | 3194 | $opt .= '>'; |
| 3195 | 3195 | $opt .= $objp->ref; |
| 3196 | 3196 | if (!empty($objp->custref)) { |
| 3197 | - $opt .= ' (' . $objp->custref . ')'; |
|
| 3197 | + $opt .= ' ('.$objp->custref.')'; |
|
| 3198 | 3198 | } |
| 3199 | 3199 | if ($outbarcode) { |
| 3200 | - $opt .= ' (' . $outbarcode . ')'; |
|
| 3200 | + $opt .= ' ('.$outbarcode.')'; |
|
| 3201 | 3201 | } |
| 3202 | - $opt .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3202 | + $opt .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3203 | 3203 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3204 | - $opt .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3204 | + $opt .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3205 | 3205 | } |
| 3206 | 3206 | |
| 3207 | 3207 | $objRef = $objp->ref; |
| 3208 | 3208 | if (!empty($objp->custref)) { |
| 3209 | - $objRef .= ' (' . $objp->custref . ')'; |
|
| 3209 | + $objRef .= ' ('.$objp->custref.')'; |
|
| 3210 | 3210 | } |
| 3211 | 3211 | if (!empty($filterkey) && $filterkey != '') { |
| 3212 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3212 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3213 | 3213 | } |
| 3214 | 3214 | $outval .= $objRef; |
| 3215 | 3215 | if ($outbarcode) { |
| 3216 | - $outval .= ' (' . $outbarcode . ')'; |
|
| 3216 | + $outval .= ' ('.$outbarcode.')'; |
|
| 3217 | 3217 | } |
| 3218 | - $outval .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3218 | + $outval .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3219 | 3219 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3220 | - $outval .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3220 | + $outval .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3221 | 3221 | } |
| 3222 | 3222 | |
| 3223 | 3223 | // Units |
@@ -3230,35 +3230,35 @@ discard block |
||
| 3230 | 3230 | // If we need a particular price level (from 1 to n) |
| 3231 | 3231 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { |
| 3232 | 3232 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3233 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3234 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3235 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3236 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3233 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3234 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3235 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3236 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3237 | 3237 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3238 | 3238 | $sql .= " LIMIT 1"; |
| 3239 | 3239 | |
| 3240 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3240 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3241 | 3241 | $result2 = $this->db->query($sql); |
| 3242 | 3242 | if ($result2) { |
| 3243 | 3243 | $objp2 = $this->db->fetch_object($result2); |
| 3244 | 3244 | if ($objp2) { |
| 3245 | 3245 | $found = 1; |
| 3246 | 3246 | if ($objp2->price_base_type == 'HT') { |
| 3247 | - $opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3248 | - $outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3247 | + $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3248 | + $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3249 | 3249 | } else { |
| 3250 | - $opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3251 | - $outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3250 | + $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3251 | + $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3252 | 3252 | } |
| 3253 | 3253 | $outprice_ht = price($objp2->price); |
| 3254 | 3254 | $outprice_ttc = price($objp2->price_ttc); |
| 3255 | 3255 | $outpricebasetype = $objp2->price_base_type; |
| 3256 | 3256 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
| 3257 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3258 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3257 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3258 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3259 | 3259 | } else { |
| 3260 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3261 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3260 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3261 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3262 | 3262 | } |
| 3263 | 3263 | } |
| 3264 | 3264 | } else { |
@@ -3272,13 +3272,13 @@ discard block |
||
| 3272 | 3272 | $outqty = $objp->quantity; |
| 3273 | 3273 | $outdiscount = $objp->remise_percent; |
| 3274 | 3274 | if ($objp->quantity == 1) { |
| 3275 | - $opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3276 | - $outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3275 | + $opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3276 | + $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3277 | 3277 | $opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3278 | 3278 | $outval .= $langs->transnoentities("Unit"); |
| 3279 | 3279 | } else { |
| 3280 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3281 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3280 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3281 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3282 | 3282 | $opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3283 | 3283 | $outval .= $langs->transnoentities("Units"); |
| 3284 | 3284 | } |
@@ -3286,16 +3286,16 @@ discard block |
||
| 3286 | 3286 | $outprice_ht = price($objp->unitprice); |
| 3287 | 3287 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3288 | 3288 | $outpricebasetype = $objp->price_base_type; |
| 3289 | - $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3290 | - $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3289 | + $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3290 | + $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
| 3291 | 3291 | } |
| 3292 | 3292 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3293 | - $opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3294 | - $outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3293 | + $opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3294 | + $outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3295 | 3295 | } |
| 3296 | 3296 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3297 | - $opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3298 | - $outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3297 | + $opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3298 | + $outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3299 | 3299 | } |
| 3300 | 3300 | |
| 3301 | 3301 | // Price by customer |
@@ -3304,11 +3304,11 @@ discard block |
||
| 3304 | 3304 | $found = 1; |
| 3305 | 3305 | |
| 3306 | 3306 | if ($objp->custprice_base_type == 'HT') { |
| 3307 | - $opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3308 | - $outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3307 | + $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3308 | + $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3309 | 3309 | } else { |
| 3310 | - $opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3311 | - $outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3310 | + $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3311 | + $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3312 | 3312 | } |
| 3313 | 3313 | |
| 3314 | 3314 | $outprice_ht = price($objp->custprice); |
@@ -3322,11 +3322,11 @@ discard block |
||
| 3322 | 3322 | // If level no defined or multiprice not found, we used the default price |
| 3323 | 3323 | if (empty($hidepriceinlabel) && !$found) { |
| 3324 | 3324 | if ($objp->price_base_type == 'HT') { |
| 3325 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3326 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3325 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3326 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3327 | 3327 | } else { |
| 3328 | - $opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3329 | - $outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3328 | + $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3329 | + $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3330 | 3330 | } |
| 3331 | 3331 | $outprice_ht = price($objp->price); |
| 3332 | 3332 | $outprice_ttc = price($objp->price_ttc); |
@@ -3337,14 +3337,14 @@ discard block |
||
| 3337 | 3337 | |
| 3338 | 3338 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3339 | 3339 | if ($user->hasRight('stock', 'lire')) { |
| 3340 | - $opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3340 | + $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3341 | 3341 | |
| 3342 | 3342 | if ($objp->stock > 0) { |
| 3343 | 3343 | $outval .= ' - <span class="product_line_stock_ok">'; |
| 3344 | 3344 | } elseif ($objp->stock <= 0) { |
| 3345 | 3345 | $outval .= ' - <span class="product_line_stock_too_low">'; |
| 3346 | 3346 | } |
| 3347 | - $outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3347 | + $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3348 | 3348 | $outval .= '</span>'; |
| 3349 | 3349 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3350 | 3350 | $langs->load("stocks"); |
@@ -3354,9 +3354,9 @@ discard block |
||
| 3354 | 3354 | $tmpproduct->load_virtual_stock(); |
| 3355 | 3355 | $virtualstock = $tmpproduct->stock_theorique; |
| 3356 | 3356 | |
| 3357 | - $opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3357 | + $opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3358 | 3358 | |
| 3359 | - $outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3359 | + $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3360 | 3360 | if ($virtualstock > 0) { |
| 3361 | 3361 | $outval .= '<span class="product_line_stock_ok">'; |
| 3362 | 3362 | } elseif ($virtualstock <= 0) { |
@@ -3434,7 +3434,7 @@ discard block |
||
| 3434 | 3434 | $selected_input_value = ''; |
| 3435 | 3435 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
| 3436 | 3436 | if ($selected > 0) { |
| 3437 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3437 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3438 | 3438 | $producttmpselect = new Product($this->db); |
| 3439 | 3439 | $producttmpselect->fetch($selected); |
| 3440 | 3440 | $selected_input_value = $producttmpselect->ref; |
@@ -3442,10 +3442,10 @@ discard block |
||
| 3442 | 3442 | } |
| 3443 | 3443 | |
| 3444 | 3444 | // mode=2 means suppliers products |
| 3445 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3446 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3445 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3446 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3447 | 3447 | |
| 3448 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3448 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3449 | 3449 | } else { |
| 3450 | 3450 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3451 | 3451 | } |
@@ -3505,25 +3505,25 @@ discard block |
||
| 3505 | 3505 | if (isModEnabled('barcode')) { |
| 3506 | 3506 | $sql .= ", pfp.barcode"; |
| 3507 | 3507 | } |
| 3508 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3509 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3508 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3509 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3510 | 3510 | if ($socid > 0) { |
| 3511 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3511 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3512 | 3512 | } |
| 3513 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3513 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3514 | 3514 | // Units |
| 3515 | 3515 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3516 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3516 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3517 | 3517 | } |
| 3518 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3518 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3519 | 3519 | if ($statut != -1) { |
| 3520 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3520 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3521 | 3521 | } |
| 3522 | 3522 | if (strval($filtertype) != '') { |
| 3523 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3523 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3524 | 3524 | } |
| 3525 | 3525 | if (!empty($filtre)) { |
| 3526 | - $sql .= " " . $filtre; |
|
| 3526 | + $sql .= " ".$filtre; |
|
| 3527 | 3527 | } |
| 3528 | 3528 | // Add where from hooks |
| 3529 | 3529 | $parameters = array(); |
@@ -3543,9 +3543,9 @@ discard block |
||
| 3543 | 3543 | if ($i > 0) { |
| 3544 | 3544 | $sql .= " AND "; |
| 3545 | 3545 | } |
| 3546 | - $sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3546 | + $sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3547 | 3547 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
| 3548 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3548 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3549 | 3549 | } |
| 3550 | 3550 | $sql .= ")"; |
| 3551 | 3551 | $i++; |
@@ -3554,8 +3554,8 @@ discard block |
||
| 3554 | 3554 | $sql .= ")"; |
| 3555 | 3555 | } |
| 3556 | 3556 | if (isModEnabled('barcode')) { |
| 3557 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3558 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3557 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3558 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3559 | 3559 | } |
| 3560 | 3560 | $sql .= ')'; |
| 3561 | 3561 | } |
@@ -3564,20 +3564,20 @@ discard block |
||
| 3564 | 3564 | |
| 3565 | 3565 | // Build output string |
| 3566 | 3566 | |
| 3567 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3567 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3568 | 3568 | $result = $this->db->query($sql); |
| 3569 | 3569 | if ($result) { |
| 3570 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3571 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3570 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3571 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3572 | 3572 | |
| 3573 | 3573 | $num = $this->db->num_rows($result); |
| 3574 | 3574 | |
| 3575 | 3575 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3576 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3576 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3577 | 3577 | if (!$selected) { |
| 3578 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3578 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3579 | 3579 | } else { |
| 3580 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3580 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3581 | 3581 | } |
| 3582 | 3582 | |
| 3583 | 3583 | $i = 0; |
@@ -3592,7 +3592,7 @@ discard block |
||
| 3592 | 3592 | |
| 3593 | 3593 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3594 | 3594 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3595 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3595 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3596 | 3596 | } |
| 3597 | 3597 | |
| 3598 | 3598 | $outref = $objp->ref; |
@@ -3607,23 +3607,23 @@ discard block |
||
| 3607 | 3607 | $outvalUnits = ''; |
| 3608 | 3608 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3609 | 3609 | if (!empty($objp->unit_short)) { |
| 3610 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3610 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3611 | 3611 | } |
| 3612 | 3612 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3613 | 3613 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3614 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3614 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3615 | 3615 | } |
| 3616 | 3616 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3617 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3618 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3617 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3618 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3619 | 3619 | } |
| 3620 | 3620 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3621 | 3621 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3622 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3622 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3623 | 3623 | } |
| 3624 | 3624 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3625 | 3625 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3626 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3626 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3627 | 3627 | } |
| 3628 | 3628 | if ($outdurationvalue && $outdurationunit) { |
| 3629 | 3629 | $da = array( |
@@ -3634,22 +3634,22 @@ discard block |
||
| 3634 | 3634 | 'y' => $langs->trans('Year') |
| 3635 | 3635 | ); |
| 3636 | 3636 | if (isset($da[$outdurationunit])) { |
| 3637 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3637 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3638 | 3638 | } |
| 3639 | 3639 | } |
| 3640 | 3640 | } |
| 3641 | 3641 | |
| 3642 | 3642 | $objRef = $objp->ref; |
| 3643 | 3643 | if ($filterkey && $filterkey != '') { |
| 3644 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3644 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3645 | 3645 | } |
| 3646 | 3646 | $objRefFourn = $objp->ref_fourn; |
| 3647 | 3647 | if ($filterkey && $filterkey != '') { |
| 3648 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3648 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3649 | 3649 | } |
| 3650 | 3650 | $label = $objp->label; |
| 3651 | 3651 | if ($filterkey && $filterkey != '') { |
| 3652 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3652 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3653 | 3653 | } |
| 3654 | 3654 | |
| 3655 | 3655 | switch ($objp->fk_product_type) { |
@@ -3672,21 +3672,21 @@ discard block |
||
| 3672 | 3672 | |
| 3673 | 3673 | $optlabel .= $objp->ref; |
| 3674 | 3674 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3675 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3675 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3676 | 3676 | } |
| 3677 | 3677 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3678 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3678 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3679 | 3679 | } |
| 3680 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3680 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3681 | 3681 | |
| 3682 | 3682 | $outvallabel = $objRef; |
| 3683 | 3683 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3684 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3684 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3685 | 3685 | } |
| 3686 | 3686 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3687 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3687 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3688 | 3688 | } |
| 3689 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3689 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3690 | 3690 | |
| 3691 | 3691 | // Units |
| 3692 | 3692 | $optlabel .= $outvalUnits; |
@@ -3703,7 +3703,7 @@ discard block |
||
| 3703 | 3703 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3704 | 3704 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3705 | 3705 | |
| 3706 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3706 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3707 | 3707 | $priceparser = new PriceParser($this->db); |
| 3708 | 3708 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3709 | 3709 | if ($price_result >= 0) { |
@@ -3714,47 +3714,47 @@ discard block |
||
| 3714 | 3714 | } |
| 3715 | 3715 | } |
| 3716 | 3716 | if ($objp->quantity == 1) { |
| 3717 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3718 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3717 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3718 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3719 | 3719 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3720 | 3720 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3721 | 3721 | } else { |
| 3722 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3723 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3724 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3725 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3722 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3723 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3724 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3725 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3726 | 3726 | } |
| 3727 | 3727 | |
| 3728 | 3728 | if ($objp->quantity > 1) { |
| 3729 | - $optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3730 | - $outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3729 | + $optlabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3730 | + $outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3731 | 3731 | } |
| 3732 | 3732 | if ($objp->remise_percent >= 1) { |
| 3733 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3734 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3733 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3734 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3735 | 3735 | } |
| 3736 | 3736 | if ($objp->duration) { |
| 3737 | - $optlabel .= " - " . $objp->duration; |
|
| 3738 | - $outvallabel .= " - " . $objp->duration; |
|
| 3737 | + $optlabel .= " - ".$objp->duration; |
|
| 3738 | + $outvallabel .= " - ".$objp->duration; |
|
| 3739 | 3739 | } |
| 3740 | 3740 | if (!$socid) { |
| 3741 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3742 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3741 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3742 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3743 | 3743 | } |
| 3744 | 3744 | if ($objp->supplier_reputation) { |
| 3745 | 3745 | //TODO dictionary |
| 3746 | 3746 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 3747 | 3747 | |
| 3748 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3749 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3748 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3749 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3750 | 3750 | } |
| 3751 | 3751 | } else { |
| 3752 | 3752 | if (empty($alsoproductwithnosupplierprice)) { // No supplier price defined for couple product/supplier |
| 3753 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3754 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3753 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3754 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3755 | 3755 | } else { // No supplier price defined for product, even on other suppliers |
| 3756 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3757 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3756 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3757 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3758 | 3758 | } |
| 3759 | 3759 | } |
| 3760 | 3760 | |
@@ -3762,14 +3762,14 @@ discard block |
||
| 3762 | 3762 | $novirtualstock = ($showstockinlist == 2); |
| 3763 | 3763 | |
| 3764 | 3764 | if ($user->hasRight('stock', 'lire')) { |
| 3765 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3765 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3766 | 3766 | |
| 3767 | 3767 | if ($objp->stock > 0) { |
| 3768 | 3768 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 3769 | 3769 | } elseif ($objp->stock <= 0) { |
| 3770 | 3770 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 3771 | 3771 | } |
| 3772 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 3772 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 3773 | 3773 | $optlabel .= '</span>'; |
| 3774 | 3774 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3775 | 3775 | $langs->load("stocks"); |
@@ -3779,9 +3779,9 @@ discard block |
||
| 3779 | 3779 | $tmpproduct->load_virtual_stock(); |
| 3780 | 3780 | $virtualstock = $tmpproduct->stock_theorique; |
| 3781 | 3781 | |
| 3782 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3782 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3783 | 3783 | |
| 3784 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3784 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3785 | 3785 | if ($virtualstock > 0) { |
| 3786 | 3786 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 3787 | 3787 | } elseif ($virtualstock <= 0) { |
@@ -3795,7 +3795,7 @@ discard block |
||
| 3795 | 3795 | } |
| 3796 | 3796 | } |
| 3797 | 3797 | |
| 3798 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 3798 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 3799 | 3799 | if ($selected && $selected == $objp->idprodfournprice) { |
| 3800 | 3800 | $optstart .= ' selected'; |
| 3801 | 3801 | } |
@@ -3804,27 +3804,27 @@ discard block |
||
| 3804 | 3804 | } |
| 3805 | 3805 | |
| 3806 | 3806 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 3807 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 3808 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 3809 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 3810 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 3811 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 3812 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 3813 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 3814 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 3815 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 3816 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 3817 | - } |
|
| 3818 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 3807 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 3808 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 3809 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 3810 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 3811 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 3812 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 3813 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 3814 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 3815 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 3816 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 3817 | + } |
|
| 3818 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 3819 | 3819 | |
| 3820 | 3820 | $outarrayentry = array( |
| 3821 | 3821 | 'key' => $outkey, |
| 3822 | 3822 | 'value' => $outref, |
| 3823 | 3823 | 'label' => $outvallabel, |
| 3824 | 3824 | 'qty' => $outqty, |
| 3825 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3826 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3827 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3825 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3826 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3827 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3828 | 3828 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 3829 | 3829 | 'tva_tx' => price2num($objp->tva_tx), |
| 3830 | 3830 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3849,18 +3849,18 @@ discard block |
||
| 3849 | 3849 | // Add new entry |
| 3850 | 3850 | // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax |
| 3851 | 3851 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 3852 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 3852 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 3853 | 3853 | array_push( |
| 3854 | 3854 | $outarray, |
| 3855 | 3855 | array('key' => $outkey, |
| 3856 | 3856 | 'value' => $outref, |
| 3857 | 3857 | 'label' => $outvallabel, |
| 3858 | 3858 | 'qty' => $outqty, |
| 3859 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3859 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3860 | 3860 | 'price_qty_ht_locale' => price($objp->fprice), |
| 3861 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3861 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3862 | 3862 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 3863 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3863 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3864 | 3864 | 'tva_tx_formated' => price($objp->tva_tx), |
| 3865 | 3865 | 'tva_tx' => price2num($objp->tva_tx), |
| 3866 | 3866 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3887,7 +3887,7 @@ discard block |
||
| 3887 | 3887 | |
| 3888 | 3888 | $this->db->free($result); |
| 3889 | 3889 | |
| 3890 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3890 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3891 | 3891 | $out .= ajax_combobox($htmlname); |
| 3892 | 3892 | } else { |
| 3893 | 3893 | dol_print_error($this->db); |
@@ -3919,43 +3919,43 @@ discard block |
||
| 3919 | 3919 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 3920 | 3920 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 3921 | 3921 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 3922 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3923 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3924 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3925 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 3922 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3923 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3924 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3925 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 3926 | 3926 | $sql .= " AND p.tobuy = 1"; |
| 3927 | 3927 | $sql .= " AND s.fournisseur = 1"; |
| 3928 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 3928 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 3929 | 3929 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
| 3930 | 3930 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 3931 | 3931 | } else { |
| 3932 | 3932 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 3933 | 3933 | } |
| 3934 | 3934 | |
| 3935 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 3935 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 3936 | 3936 | $result = $this->db->query($sql); |
| 3937 | 3937 | |
| 3938 | 3938 | if ($result) { |
| 3939 | 3939 | $num = $this->db->num_rows($result); |
| 3940 | 3940 | |
| 3941 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3941 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3942 | 3942 | |
| 3943 | 3943 | if (!$num) { |
| 3944 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 3944 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 3945 | 3945 | } else { |
| 3946 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3946 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3947 | 3947 | $form .= '<option value="0"> </option>'; |
| 3948 | 3948 | |
| 3949 | 3949 | $i = 0; |
| 3950 | 3950 | while ($i < $num) { |
| 3951 | 3951 | $objp = $this->db->fetch_object($result); |
| 3952 | 3952 | |
| 3953 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 3953 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 3954 | 3954 | //if there is only one supplier, preselect it |
| 3955 | 3955 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
| 3956 | 3956 | $opt .= ' selected'; |
| 3957 | 3957 | } |
| 3958 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 3958 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 3959 | 3959 | |
| 3960 | 3960 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 3961 | 3961 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -3965,7 +3965,7 @@ discard block |
||
| 3965 | 3965 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3966 | 3966 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3967 | 3967 | |
| 3968 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3968 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3969 | 3969 | $priceparser = new PriceParser($this->db); |
| 3970 | 3970 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3971 | 3971 | if ($price_result >= 0) { |
@@ -3976,10 +3976,10 @@ discard block |
||
| 3976 | 3976 | } |
| 3977 | 3977 | } |
| 3978 | 3978 | if ($objp->quantity == 1) { |
| 3979 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3979 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3980 | 3980 | } |
| 3981 | 3981 | |
| 3982 | - $opt .= $objp->quantity . ' '; |
|
| 3982 | + $opt .= $objp->quantity.' '; |
|
| 3983 | 3983 | |
| 3984 | 3984 | if ($objp->quantity == 1) { |
| 3985 | 3985 | $opt .= $langs->trans("Unit"); |
@@ -3988,10 +3988,10 @@ discard block |
||
| 3988 | 3988 | } |
| 3989 | 3989 | if ($objp->quantity > 1) { |
| 3990 | 3990 | $opt .= " - "; |
| 3991 | - $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
| 3991 | + $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
| 3992 | 3992 | } |
| 3993 | 3993 | if ($objp->duration) { |
| 3994 | - $opt .= " - " . $objp->duration; |
|
| 3994 | + $opt .= " - ".$objp->duration; |
|
| 3995 | 3995 | } |
| 3996 | 3996 | $opt .= "</option>\n"; |
| 3997 | 3997 | |
@@ -4029,8 +4029,8 @@ discard block |
||
| 4029 | 4029 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4030 | 4030 | |
| 4031 | 4031 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4032 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4033 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4032 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4033 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4034 | 4034 | $sql .= " AND active > 0"; |
| 4035 | 4035 | $sql .= " ORDER BY sortorder"; |
| 4036 | 4036 | |
@@ -4042,7 +4042,7 @@ discard block |
||
| 4042 | 4042 | $obj = $this->db->fetch_object($resql); |
| 4043 | 4043 | |
| 4044 | 4044 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4045 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4045 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4046 | 4046 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4047 | 4047 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4048 | 4048 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4070,7 +4070,7 @@ discard block |
||
| 4070 | 4070 | // phpcs:enable |
| 4071 | 4071 | global $langs; |
| 4072 | 4072 | |
| 4073 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4073 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4074 | 4074 | if ($num > 0) { |
| 4075 | 4075 | return 0; // Cache already loaded |
| 4076 | 4076 | } |
@@ -4080,7 +4080,7 @@ discard block |
||
| 4080 | 4080 | $langs->load('propal'); |
| 4081 | 4081 | |
| 4082 | 4082 | $sql = "SELECT rowid, code, label, position"; |
| 4083 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4083 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4084 | 4084 | $sql .= " WHERE active > 0"; |
| 4085 | 4085 | |
| 4086 | 4086 | $resql = $this->db->query($sql); |
@@ -4091,7 +4091,7 @@ discard block |
||
| 4091 | 4091 | $obj = $this->db->fetch_object($resql); |
| 4092 | 4092 | |
| 4093 | 4093 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4094 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4094 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4095 | 4095 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4096 | 4096 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4097 | 4097 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4123,17 +4123,17 @@ discard block |
||
| 4123 | 4123 | |
| 4124 | 4124 | $this->load_cache_availability(); |
| 4125 | 4125 | |
| 4126 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4126 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4127 | 4127 | |
| 4128 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4128 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4129 | 4129 | if ($addempty) { |
| 4130 | 4130 | print '<option value="0"> </option>'; |
| 4131 | 4131 | } |
| 4132 | 4132 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4133 | 4133 | if ($selected == $id) { |
| 4134 | - print '<option value="' . $id . '" selected>'; |
|
| 4134 | + print '<option value="'.$id.'" selected>'; |
|
| 4135 | 4135 | } else { |
| 4136 | - print '<option value="' . $id . '">'; |
|
| 4136 | + print '<option value="'.$id.'">'; |
|
| 4137 | 4137 | } |
| 4138 | 4138 | print dol_escape_htmltag($arrayavailability['label']); |
| 4139 | 4139 | print '</option>'; |
@@ -4154,13 +4154,13 @@ discard block |
||
| 4154 | 4154 | { |
| 4155 | 4155 | global $langs; |
| 4156 | 4156 | |
| 4157 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4157 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4158 | 4158 | if ($num > 0) { |
| 4159 | 4159 | return 0; // Cache already loaded |
| 4160 | 4160 | } |
| 4161 | 4161 | |
| 4162 | 4162 | $sql = "SELECT rowid, code, label"; |
| 4163 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4163 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4164 | 4164 | $sql .= " WHERE active > 0"; |
| 4165 | 4165 | |
| 4166 | 4166 | $resql = $this->db->query($sql); |
@@ -4173,8 +4173,8 @@ discard block |
||
| 4173 | 4173 | |
| 4174 | 4174 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4175 | 4175 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4176 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
| 4177 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4176 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
| 4177 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4178 | 4178 | } |
| 4179 | 4179 | if ($langs->trans($obj->code) != $obj->code) { |
| 4180 | 4180 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4214,9 +4214,9 @@ discard block |
||
| 4214 | 4214 | |
| 4215 | 4215 | $this->loadCacheInputReason(); |
| 4216 | 4216 | |
| 4217 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4217 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4218 | 4218 | if ($addempty) { |
| 4219 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4219 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4220 | 4220 | } |
| 4221 | 4221 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4222 | 4222 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4224,9 +4224,9 @@ discard block |
||
| 4224 | 4224 | } |
| 4225 | 4225 | |
| 4226 | 4226 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4227 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4227 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4228 | 4228 | } else { |
| 4229 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4229 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4230 | 4230 | } |
| 4231 | 4231 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4232 | 4232 | print $langs->trans($label); |
@@ -4236,7 +4236,7 @@ discard block |
||
| 4236 | 4236 | if ($user->admin && empty($notooltip)) { |
| 4237 | 4237 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4238 | 4238 | } |
| 4239 | - print ajax_combobox('select_' . $htmlname); |
|
| 4239 | + print ajax_combobox('select_'.$htmlname); |
|
| 4240 | 4240 | } |
| 4241 | 4241 | |
| 4242 | 4242 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4251,7 +4251,7 @@ discard block |
||
| 4251 | 4251 | // phpcs:enable |
| 4252 | 4252 | global $langs; |
| 4253 | 4253 | |
| 4254 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4254 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4255 | 4255 | if ($num > 0) { |
| 4256 | 4256 | return $num; // Cache already loaded |
| 4257 | 4257 | } |
@@ -4261,8 +4261,8 @@ discard block |
||
| 4261 | 4261 | $this->cache_types_paiements = array(); |
| 4262 | 4262 | |
| 4263 | 4263 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4264 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4265 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4264 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4265 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4266 | 4266 | |
| 4267 | 4267 | $resql = $this->db->query($sql); |
| 4268 | 4268 | if ($resql) { |
@@ -4272,7 +4272,7 @@ discard block |
||
| 4272 | 4272 | $obj = $this->db->fetch_object($resql); |
| 4273 | 4273 | |
| 4274 | 4274 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4275 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4275 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4276 | 4276 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4277 | 4277 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4278 | 4278 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4344,17 +4344,17 @@ discard block |
||
| 4344 | 4344 | global $langs, $user, $conf; |
| 4345 | 4345 | |
| 4346 | 4346 | $out = ''; |
| 4347 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4347 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4348 | 4348 | |
| 4349 | 4349 | $this->load_cache_conditions_paiements(); |
| 4350 | 4350 | |
| 4351 | 4351 | // Set default value if not already set by caller |
| 4352 | 4352 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
| 4353 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4353 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4354 | 4354 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 4355 | 4355 | } |
| 4356 | 4356 | |
| 4357 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4357 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4358 | 4358 | if ($addempty) { |
| 4359 | 4359 | $out .= '<option value="0"> </option>'; |
| 4360 | 4360 | } |
@@ -4368,9 +4368,9 @@ discard block |
||
| 4368 | 4368 | |
| 4369 | 4369 | if ($selected == $id) { |
| 4370 | 4370 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4371 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4371 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4372 | 4372 | } else { |
| 4373 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4373 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4374 | 4374 | } |
| 4375 | 4375 | $label = $arrayconditions['label']; |
| 4376 | 4376 | |
@@ -4388,21 +4388,21 @@ discard block |
||
| 4388 | 4388 | $out .= ajax_combobox($htmlname); |
| 4389 | 4389 | |
| 4390 | 4390 | if ($deposit_percent >= 0) { |
| 4391 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4392 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4393 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4391 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4392 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4393 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4394 | 4394 | $out .= '</span>'; |
| 4395 | 4395 | $out .= ' |
| 4396 | - <script nonce="' . getNonce() . '"> |
|
| 4396 | + <script nonce="' . getNonce().'"> |
|
| 4397 | 4397 | $(document).ready(function () { |
| 4398 | - $("#' . $htmlname . '").change(function () { |
|
| 4398 | + $("#' . $htmlname.'").change(function () { |
|
| 4399 | 4399 | let $selected = $(this).find("option:selected"); |
| 4400 | 4400 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4401 | 4401 | |
| 4402 | 4402 | if (depositPercent.length > 0) { |
| 4403 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4403 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4404 | 4404 | } else { |
| 4405 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4405 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4406 | 4406 | } |
| 4407 | 4407 | |
| 4408 | 4408 | return true; |
@@ -4440,7 +4440,7 @@ discard block |
||
| 4440 | 4440 | |
| 4441 | 4441 | $out = ''; |
| 4442 | 4442 | |
| 4443 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4443 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4444 | 4444 | |
| 4445 | 4445 | $filterarray = array(); |
| 4446 | 4446 | if ($filtertype == 'CRDT') { |
@@ -4455,11 +4455,11 @@ discard block |
||
| 4455 | 4455 | |
| 4456 | 4456 | // Set default value if not already set by caller |
| 4457 | 4457 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
| 4458 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4458 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4459 | 4459 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 4460 | 4460 | } |
| 4461 | 4461 | |
| 4462 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4462 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4463 | 4463 | if ($empty) { |
| 4464 | 4464 | $out .= '<option value=""> </option>'; |
| 4465 | 4465 | } |
@@ -4480,13 +4480,13 @@ discard block |
||
| 4480 | 4480 | } |
| 4481 | 4481 | |
| 4482 | 4482 | if ($format == 0) { |
| 4483 | - $out .= '<option value="' . $id . '"'; |
|
| 4483 | + $out .= '<option value="'.$id.'"'; |
|
| 4484 | 4484 | } elseif ($format == 1) { |
| 4485 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4485 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4486 | 4486 | } elseif ($format == 2) { |
| 4487 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4487 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4488 | 4488 | } elseif ($format == 3) { |
| 4489 | - $out .= '<option value="' . $id . '"'; |
|
| 4489 | + $out .= '<option value="'.$id.'"'; |
|
| 4490 | 4490 | } |
| 4491 | 4491 | // Print attribute selected or not |
| 4492 | 4492 | if ($format == 1 || $format == 2) { |
@@ -4516,7 +4516,7 @@ discard block |
||
| 4516 | 4516 | if ($user->admin && !$noadmininfo) { |
| 4517 | 4517 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4518 | 4518 | } |
| 4519 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4519 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4520 | 4520 | |
| 4521 | 4521 | if (empty($nooutput)) { |
| 4522 | 4522 | print $out; |
@@ -4538,22 +4538,22 @@ discard block |
||
| 4538 | 4538 | { |
| 4539 | 4539 | global $langs; |
| 4540 | 4540 | |
| 4541 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4541 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4542 | 4542 | $options = array( |
| 4543 | 4543 | 'HT' => $langs->trans("HT"), |
| 4544 | 4544 | 'TTC' => $langs->trans("TTC") |
| 4545 | 4545 | ); |
| 4546 | 4546 | foreach ($options as $id => $value) { |
| 4547 | 4547 | if ($selected == $id) { |
| 4548 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4548 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4549 | 4549 | } else { |
| 4550 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4550 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4551 | 4551 | } |
| 4552 | 4552 | $return .= '</option>'; |
| 4553 | 4553 | } |
| 4554 | 4554 | $return .= '</select>'; |
| 4555 | 4555 | if ($addjscombo) { |
| 4556 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4556 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4557 | 4557 | } |
| 4558 | 4558 | |
| 4559 | 4559 | return $return; |
@@ -4571,7 +4571,7 @@ discard block |
||
| 4571 | 4571 | // phpcs:enable |
| 4572 | 4572 | global $langs; |
| 4573 | 4573 | |
| 4574 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4574 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4575 | 4575 | if ($num > 0) { |
| 4576 | 4576 | return $num; // Cache already loaded |
| 4577 | 4577 | } |
@@ -4581,8 +4581,8 @@ discard block |
||
| 4581 | 4581 | $this->cache_transport_mode = array(); |
| 4582 | 4582 | |
| 4583 | 4583 | $sql = "SELECT rowid, code, label, active"; |
| 4584 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4585 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4584 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4585 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4586 | 4586 | |
| 4587 | 4587 | $resql = $this->db->query($sql); |
| 4588 | 4588 | if ($resql) { |
@@ -4592,7 +4592,7 @@ discard block |
||
| 4592 | 4592 | $obj = $this->db->fetch_object($resql); |
| 4593 | 4593 | |
| 4594 | 4594 | // If traduction exist, we use it else we take the default label |
| 4595 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4595 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4596 | 4596 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4597 | 4597 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4598 | 4598 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4626,11 +4626,11 @@ discard block |
||
| 4626 | 4626 | { |
| 4627 | 4627 | global $langs, $user; |
| 4628 | 4628 | |
| 4629 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4629 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4630 | 4630 | |
| 4631 | 4631 | $this->load_cache_transport_mode(); |
| 4632 | 4632 | |
| 4633 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4633 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4634 | 4634 | if ($empty) { |
| 4635 | 4635 | print '<option value=""> </option>'; |
| 4636 | 4636 | } |
@@ -4646,13 +4646,13 @@ discard block |
||
| 4646 | 4646 | } |
| 4647 | 4647 | |
| 4648 | 4648 | if ($format == 0) { |
| 4649 | - print '<option value="' . $id . '"'; |
|
| 4649 | + print '<option value="'.$id.'"'; |
|
| 4650 | 4650 | } elseif ($format == 1) { |
| 4651 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4651 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4652 | 4652 | } elseif ($format == 2) { |
| 4653 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4653 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4654 | 4654 | } elseif ($format == 3) { |
| 4655 | - print '<option value="' . $id . '"'; |
|
| 4655 | + print '<option value="'.$id.'"'; |
|
| 4656 | 4656 | } |
| 4657 | 4657 | // If text is selected, we compare with code, else with id |
| 4658 | 4658 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4700,31 +4700,31 @@ discard block |
||
| 4700 | 4700 | $langs->load("deliveries"); |
| 4701 | 4701 | |
| 4702 | 4702 | $sql = "SELECT rowid, code, libelle as label"; |
| 4703 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4703 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4704 | 4704 | $sql .= " WHERE active > 0"; |
| 4705 | 4705 | if ($filtre) { |
| 4706 | - $sql .= " AND " . $filtre; |
|
| 4706 | + $sql .= " AND ".$filtre; |
|
| 4707 | 4707 | } |
| 4708 | 4708 | $sql .= " ORDER BY libelle ASC"; |
| 4709 | 4709 | |
| 4710 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4710 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4711 | 4711 | $result = $this->db->query($sql); |
| 4712 | 4712 | if ($result) { |
| 4713 | 4713 | $num = $this->db->num_rows($result); |
| 4714 | 4714 | $i = 0; |
| 4715 | 4715 | if ($num) { |
| 4716 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4716 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4717 | 4717 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4718 | 4718 | print '<option value="-1"> </option>'; |
| 4719 | 4719 | } |
| 4720 | 4720 | while ($i < $num) { |
| 4721 | 4721 | $obj = $this->db->fetch_object($result); |
| 4722 | 4722 | if ($selected == $obj->rowid) { |
| 4723 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4723 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4724 | 4724 | } else { |
| 4725 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4725 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4726 | 4726 | } |
| 4727 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 4727 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 4728 | 4728 | print '</option>'; |
| 4729 | 4729 | $i++; |
| 4730 | 4730 | } |
@@ -4733,7 +4733,7 @@ discard block |
||
| 4733 | 4733 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4734 | 4734 | } |
| 4735 | 4735 | |
| 4736 | - print ajax_combobox('select' . $htmlname); |
|
| 4736 | + print ajax_combobox('select'.$htmlname); |
|
| 4737 | 4737 | } else { |
| 4738 | 4738 | print $langs->trans("NoShippingMethodDefined"); |
| 4739 | 4739 | } |
@@ -4758,16 +4758,16 @@ discard block |
||
| 4758 | 4758 | $langs->load("deliveries"); |
| 4759 | 4759 | |
| 4760 | 4760 | if ($htmlname != "none") { |
| 4761 | - print '<form method="POST" action="' . $page . '">'; |
|
| 4761 | + print '<form method="POST" action="'.$page.'">'; |
|
| 4762 | 4762 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 4763 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 4763 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 4764 | 4764 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 4765 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 4765 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 4766 | 4766 | print '</form>'; |
| 4767 | 4767 | } else { |
| 4768 | 4768 | if ($selected) { |
| 4769 | 4769 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 4770 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 4770 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 4771 | 4771 | } else { |
| 4772 | 4772 | print " "; |
| 4773 | 4773 | } |
@@ -4790,10 +4790,10 @@ discard block |
||
| 4790 | 4790 | |
| 4791 | 4791 | $opt = '<option value="" selected></option>'; |
| 4792 | 4792 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 4793 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 4794 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 4793 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 4794 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 4795 | 4795 | $sql .= ' AND situation_counter >= 1'; |
| 4796 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 4796 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 4797 | 4797 | $sql .= ' AND type <> 2'; |
| 4798 | 4798 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 4799 | 4799 | $resql = $this->db->query($sql); |
@@ -4811,19 +4811,19 @@ discard block |
||
| 4811 | 4811 | //Not prov? |
| 4812 | 4812 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 4813 | 4813 | if ($selected == $obj->rowid) { |
| 4814 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 4814 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 4815 | 4815 | } else { |
| 4816 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 4816 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 4817 | 4817 | } |
| 4818 | 4818 | } |
| 4819 | 4819 | } |
| 4820 | 4820 | } |
| 4821 | 4821 | } |
| 4822 | 4822 | } else { |
| 4823 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 4823 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 4824 | 4824 | } |
| 4825 | 4825 | if ($opt == '<option value ="" selected></option>') { |
| 4826 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 4826 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 4827 | 4827 | } |
| 4828 | 4828 | return $opt; |
| 4829 | 4829 | } |
@@ -4843,12 +4843,12 @@ discard block |
||
| 4843 | 4843 | |
| 4844 | 4844 | $langs->load('products'); |
| 4845 | 4845 | |
| 4846 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4846 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4847 | 4847 | |
| 4848 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 4848 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 4849 | 4849 | $sql .= ' WHERE active > 0'; |
| 4850 | 4850 | if (!empty($unit_type)) { |
| 4851 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 4851 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 4852 | 4852 | } |
| 4853 | 4853 | $sql .= " ORDER BY sortorder"; |
| 4854 | 4854 | |
@@ -4860,14 +4860,14 @@ discard block |
||
| 4860 | 4860 | |
| 4861 | 4861 | while ($res = $this->db->fetch_object($resql)) { |
| 4862 | 4862 | $unitLabel = $res->label; |
| 4863 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 4864 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 4863 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 4864 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 4865 | 4865 | } |
| 4866 | 4866 | |
| 4867 | 4867 | if ($selected == $res->rowid) { |
| 4868 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 4868 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 4869 | 4869 | } else { |
| 4870 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 4870 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 4871 | 4871 | } |
| 4872 | 4872 | } |
| 4873 | 4873 | $return .= '</select>'; |
@@ -4902,23 +4902,23 @@ discard block |
||
| 4902 | 4902 | $num = 0; |
| 4903 | 4903 | |
| 4904 | 4904 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 4905 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 4906 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 4905 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 4906 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 4907 | 4907 | if ($status != 2) { |
| 4908 | - $sql .= " AND clos = " . (int) $status; |
|
| 4908 | + $sql .= " AND clos = ".(int) $status; |
|
| 4909 | 4909 | } |
| 4910 | 4910 | if ($filtre) { |
| 4911 | - $sql .= " AND " . $filtre; |
|
| 4911 | + $sql .= " AND ".$filtre; |
|
| 4912 | 4912 | } |
| 4913 | 4913 | $sql .= " ORDER BY label"; |
| 4914 | 4914 | |
| 4915 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 4915 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 4916 | 4916 | $result = $this->db->query($sql); |
| 4917 | 4917 | if ($result) { |
| 4918 | 4918 | $num = $this->db->num_rows($result); |
| 4919 | 4919 | $i = 0; |
| 4920 | 4920 | if ($num) { |
| 4921 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4921 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4922 | 4922 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4923 | 4923 | $out .= '<option value="-1"> </option>'; |
| 4924 | 4924 | } |
@@ -4926,27 +4926,27 @@ discard block |
||
| 4926 | 4926 | while ($i < $num) { |
| 4927 | 4927 | $obj = $this->db->fetch_object($result); |
| 4928 | 4928 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 4929 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
| 4929 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
| 4930 | 4930 | } else { |
| 4931 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
| 4931 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
| 4932 | 4932 | } |
| 4933 | 4933 | $out .= trim($obj->label); |
| 4934 | 4934 | if ($showcurrency) { |
| 4935 | - $out .= ' (' . $obj->currency_code . ')'; |
|
| 4935 | + $out .= ' ('.$obj->currency_code.')'; |
|
| 4936 | 4936 | } |
| 4937 | 4937 | if ($status == 2 && $obj->status == 1) { |
| 4938 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
| 4938 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
| 4939 | 4939 | } |
| 4940 | 4940 | $out .= '</option>'; |
| 4941 | 4941 | $i++; |
| 4942 | 4942 | } |
| 4943 | 4943 | $out .= "</select>"; |
| 4944 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4944 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4945 | 4945 | } else { |
| 4946 | 4946 | if ($status == 0) { |
| 4947 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 4947 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 4948 | 4948 | } else { |
| 4949 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
| 4949 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
| 4950 | 4950 | } |
| 4951 | 4951 | } |
| 4952 | 4952 | } else { |
@@ -4982,23 +4982,23 @@ discard block |
||
| 4982 | 4982 | $num = 0; |
| 4983 | 4983 | |
| 4984 | 4984 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 4985 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 4985 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 4986 | 4986 | $sql .= " WHERE 1=1"; |
| 4987 | 4987 | if ($status != 2) { |
| 4988 | - $sql .= " AND status = " . (int) $status; |
|
| 4988 | + $sql .= " AND status = ".(int) $status; |
|
| 4989 | 4989 | } |
| 4990 | 4990 | if ($filtre) { |
| 4991 | - $sql .= " AND " . $filtre; |
|
| 4991 | + $sql .= " AND ".$filtre; |
|
| 4992 | 4992 | } |
| 4993 | 4993 | $sql .= " ORDER BY name"; |
| 4994 | 4994 | |
| 4995 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 4995 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 4996 | 4996 | $result = $this->db->query($sql); |
| 4997 | 4997 | if ($result) { |
| 4998 | 4998 | $num = $this->db->num_rows($result); |
| 4999 | 4999 | $i = 0; |
| 5000 | 5000 | if ($num) { |
| 5001 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5001 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5002 | 5002 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5003 | 5003 | print '<option value="-1"> </option>'; |
| 5004 | 5004 | } |
@@ -5006,13 +5006,13 @@ discard block |
||
| 5006 | 5006 | while ($i < $num) { |
| 5007 | 5007 | $obj = $this->db->fetch_object($result); |
| 5008 | 5008 | if ($selected == $obj->rowid) { |
| 5009 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5009 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5010 | 5010 | } else { |
| 5011 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5011 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5012 | 5012 | } |
| 5013 | 5013 | print trim($obj->name); |
| 5014 | 5014 | if ($status == 2 && $obj->status == 1) { |
| 5015 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 5015 | + print ' ('.$langs->trans("Closed").')'; |
|
| 5016 | 5016 | } |
| 5017 | 5017 | print '</option>'; |
| 5018 | 5018 | $i++; |
@@ -5020,9 +5020,9 @@ discard block |
||
| 5020 | 5020 | print "</select>"; |
| 5021 | 5021 | } else { |
| 5022 | 5022 | if ($status == 0) { |
| 5023 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5023 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5024 | 5024 | } else { |
| 5025 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5025 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5026 | 5026 | } |
| 5027 | 5027 | } |
| 5028 | 5028 | |
@@ -5046,20 +5046,20 @@ discard block |
||
| 5046 | 5046 | { |
| 5047 | 5047 | global $langs; |
| 5048 | 5048 | if ($htmlname != "none") { |
| 5049 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5049 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5050 | 5050 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5051 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5051 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5052 | 5052 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5053 | 5053 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5054 | 5054 | if ($nbaccountfound > 0) { |
| 5055 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5055 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5056 | 5056 | } |
| 5057 | 5057 | print '</form>'; |
| 5058 | 5058 | } else { |
| 5059 | 5059 | $langs->load('banks'); |
| 5060 | 5060 | |
| 5061 | 5061 | if ($selected) { |
| 5062 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5062 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5063 | 5063 | $bankstatic = new Account($this->db); |
| 5064 | 5064 | $result = $bankstatic->fetch($selected); |
| 5065 | 5065 | if ($result) { |
@@ -5097,19 +5097,19 @@ discard block |
||
| 5097 | 5097 | global $conf, $langs; |
| 5098 | 5098 | $langs->load("categories"); |
| 5099 | 5099 | |
| 5100 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5100 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5101 | 5101 | |
| 5102 | 5102 | // For backward compatibility |
| 5103 | 5103 | if (is_numeric($type)) { |
| 5104 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5104 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5105 | 5105 | } |
| 5106 | 5106 | |
| 5107 | 5107 | if ($type === Categorie::TYPE_BANK_LINE) { |
| 5108 | 5108 | // TODO Move this into common category feature |
| 5109 | 5109 | $cate_arbo = array(); |
| 5110 | 5110 | $sql = "SELECT c.label, c.rowid"; |
| 5111 | - $sql .= " FROM " . $this->db->prefix() . "bank_categ as c"; |
|
| 5112 | - $sql .= " WHERE entity = " . $conf->entity; |
|
| 5111 | + $sql .= " FROM ".$this->db->prefix()."bank_categ as c"; |
|
| 5112 | + $sql .= " WHERE entity = ".$conf->entity; |
|
| 5113 | 5113 | $sql .= " ORDER BY c.label"; |
| 5114 | 5114 | $result = $this->db->query($sql); |
| 5115 | 5115 | if ($result) { |
@@ -5134,10 +5134,10 @@ discard block |
||
| 5134 | 5134 | $outarray = array(); |
| 5135 | 5135 | $outarrayrichhtml = array(); |
| 5136 | 5136 | |
| 5137 | - $output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5137 | + $output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5138 | 5138 | if (is_array($cate_arbo)) { |
| 5139 | 5139 | if (!count($cate_arbo)) { |
| 5140 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5140 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5141 | 5141 | } else { |
| 5142 | 5142 | $output .= '<option value="-1"> </option>'; |
| 5143 | 5143 | foreach ($cate_arbo as $key => $value) { |
@@ -5147,15 +5147,15 @@ discard block |
||
| 5147 | 5147 | $add = ''; |
| 5148 | 5148 | } |
| 5149 | 5149 | |
| 5150 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5150 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5151 | 5151 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5152 | 5152 | |
| 5153 | 5153 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5154 | 5154 | |
| 5155 | 5155 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5156 | 5156 | |
| 5157 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5158 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5157 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5158 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5159 | 5159 | $output .= '>'; |
| 5160 | 5160 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5161 | 5161 | $output .= '</option>'; |
@@ -5196,7 +5196,7 @@ discard block |
||
| 5196 | 5196 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5197 | 5197 | { |
| 5198 | 5198 | // phpcs:enable |
| 5199 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5199 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5200 | 5200 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5201 | 5201 | } |
| 5202 | 5202 | |
@@ -5231,7 +5231,7 @@ discard block |
||
| 5231 | 5231 | { |
| 5232 | 5232 | global $langs, $conf; |
| 5233 | 5233 | |
| 5234 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5234 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5235 | 5235 | $formconfirm = ''; |
| 5236 | 5236 | $inputok = array(); |
| 5237 | 5237 | $inputko = array(); |
@@ -5255,27 +5255,27 @@ discard block |
||
| 5255 | 5255 | foreach ($formquestion as $key => $input) { |
| 5256 | 5256 | if (is_array($input) && !empty($input)) { |
| 5257 | 5257 | if ($input['type'] == 'hidden') { |
| 5258 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5259 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5258 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5259 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5260 | 5260 | |
| 5261 | - $more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n"; |
|
| 5261 | + $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n"; |
|
| 5262 | 5262 | } |
| 5263 | 5263 | } |
| 5264 | 5264 | } |
| 5265 | 5265 | |
| 5266 | 5266 | // Now add questions |
| 5267 | 5267 | $moreonecolumn = ''; |
| 5268 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5268 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5269 | 5269 | foreach ($formquestion as $key => $input) { |
| 5270 | 5270 | if (is_array($input) && !empty($input)) { |
| 5271 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5272 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5273 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5271 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5272 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5273 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5274 | 5274 | |
| 5275 | 5275 | if ($input['type'] == 'text') { |
| 5276 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5276 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5277 | 5277 | } elseif ($input['type'] == 'password') { |
| 5278 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
| 5278 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
| 5279 | 5279 | } elseif ($input['type'] == 'textarea') { |
| 5280 | 5280 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5281 | 5281 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5283,8 +5283,8 @@ discard block |
||
| 5283 | 5283 | $more .= '</textarea>'; |
| 5284 | 5284 | $more .= '</div></div>'."\n";*/ |
| 5285 | 5285 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5286 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5287 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5286 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5287 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5288 | 5288 | $moreonecolumn .= $input['value']; |
| 5289 | 5289 | $moreonecolumn .= '</textarea>'; |
| 5290 | 5290 | $moreonecolumn .= '</div>'; |
@@ -5301,20 +5301,20 @@ discard block |
||
| 5301 | 5301 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5302 | 5302 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5303 | 5303 | |
| 5304 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5304 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5305 | 5305 | if (!empty($input['label'])) { |
| 5306 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5306 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5307 | 5307 | } |
| 5308 | 5308 | if ($input['type'] == 'select') { |
| 5309 | 5309 | $more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); |
| 5310 | 5310 | } else { |
| 5311 | 5311 | $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); |
| 5312 | 5312 | } |
| 5313 | - $more .= '</div></div>' . "\n"; |
|
| 5313 | + $more .= '</div></div>'."\n"; |
|
| 5314 | 5314 | } elseif ($input['type'] == 'checkbox') { |
| 5315 | 5315 | $more .= '<div class="tagtr">'; |
| 5316 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5317 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5316 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5317 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5318 | 5318 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5319 | 5319 | $more .= ' checked'; |
| 5320 | 5320 | } |
@@ -5325,19 +5325,19 @@ discard block |
||
| 5325 | 5325 | $more .= ' disabled'; |
| 5326 | 5326 | } |
| 5327 | 5327 | $more .= ' /></div>'; |
| 5328 | - $more .= '</div>' . "\n"; |
|
| 5328 | + $more .= '</div>'."\n"; |
|
| 5329 | 5329 | } elseif ($input['type'] == 'radio') { |
| 5330 | 5330 | $i = 0; |
| 5331 | 5331 | foreach ($input['values'] as $selkey => $selval) { |
| 5332 | 5332 | $more .= '<div class="tagtr">'; |
| 5333 | 5333 | if (isset($input['label'])) { |
| 5334 | 5334 | if ($i == 0) { |
| 5335 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5335 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5336 | 5336 | } else { |
| 5337 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5337 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5338 | 5338 | } |
| 5339 | 5339 | } |
| 5340 | - $more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr; |
|
| 5340 | + $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr; |
|
| 5341 | 5341 | if (!empty($input['disabled'])) { |
| 5342 | 5342 | $more .= ' disabled'; |
| 5343 | 5343 | } |
@@ -5345,12 +5345,12 @@ discard block |
||
| 5345 | 5345 | $more .= ' checked="checked"'; |
| 5346 | 5346 | } |
| 5347 | 5347 | $more .= ' /> '; |
| 5348 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5349 | - $more .= '</div></div>' . "\n"; |
|
| 5348 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5349 | + $more .= '</div></div>'."\n"; |
|
| 5350 | 5350 | $i++; |
| 5351 | 5351 | } |
| 5352 | 5352 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5353 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5353 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5354 | 5354 | $more .= '<div class="tagtd">'; |
| 5355 | 5355 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5356 | 5356 | $h = $m = 0; |
@@ -5368,24 +5368,24 @@ discard block |
||
| 5368 | 5368 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5369 | 5369 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5370 | 5370 | if (!empty($input['label'])) { |
| 5371 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5371 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5372 | 5372 | } |
| 5373 | 5373 | $more .= $input['value']; |
| 5374 | - $more .= '</div></div>' . "\n"; |
|
| 5374 | + $more .= '</div></div>'."\n"; |
|
| 5375 | 5375 | } elseif ($input['type'] == 'onecolumn') { |
| 5376 | 5376 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5377 | 5377 | $moreonecolumn .= $input['value']; |
| 5378 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5378 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5379 | 5379 | } elseif ($input['type'] == 'hidden') { |
| 5380 | 5380 | // Do nothing more, already added by a previous loop |
| 5381 | 5381 | } elseif ($input['type'] == 'separator') { |
| 5382 | 5382 | $more .= '<br>'; |
| 5383 | 5383 | } else { |
| 5384 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5384 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5385 | 5385 | } |
| 5386 | 5386 | } |
| 5387 | 5387 | } |
| 5388 | - $more .= '</div>' . "\n"; |
|
| 5388 | + $more .= '</div>'."\n"; |
|
| 5389 | 5389 | $more .= $moreonecolumn; |
| 5390 | 5390 | } |
| 5391 | 5391 | |
@@ -5407,10 +5407,10 @@ discard block |
||
| 5407 | 5407 | $button = $useajax; |
| 5408 | 5408 | $useajax = 1; |
| 5409 | 5409 | $autoOpen = false; |
| 5410 | - $dialogconfirm .= '-' . $button; |
|
| 5410 | + $dialogconfirm .= '-'.$button; |
|
| 5411 | 5411 | } |
| 5412 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5413 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5412 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5413 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5414 | 5414 | |
| 5415 | 5415 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5416 | 5416 | if (is_array($formquestion)) { |
@@ -5432,24 +5432,24 @@ discard block |
||
| 5432 | 5432 | } |
| 5433 | 5433 | |
| 5434 | 5434 | // Show JQuery confirm box. |
| 5435 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5435 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5436 | 5436 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5437 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5437 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5438 | 5438 | } |
| 5439 | 5439 | if (!empty($more)) { |
| 5440 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5440 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5441 | 5441 | } |
| 5442 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : ''); |
|
| 5443 | - $formconfirm .= '</div>' . "\n"; |
|
| 5442 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : ''); |
|
| 5443 | + $formconfirm .= '</div>'."\n"; |
|
| 5444 | 5444 | |
| 5445 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5446 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5445 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5446 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5447 | 5447 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5448 | 5448 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5449 | 5449 | $(function() { |
| 5450 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5450 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5451 | 5451 | { |
| 5452 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5452 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5453 | 5453 | if ($newselectedchoice == 'no') { |
| 5454 | 5454 | $formconfirm .= ' |
| 5455 | 5455 | open: function() { |
@@ -5459,24 +5459,24 @@ discard block |
||
| 5459 | 5459 | |
| 5460 | 5460 | $jsforcursor = ''; |
| 5461 | 5461 | if ($useajax == 1) { |
| 5462 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5463 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5462 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5463 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5464 | 5464 | } |
| 5465 | 5465 | |
| 5466 | 5466 | $postconfirmas = 'GET'; |
| 5467 | 5467 | |
| 5468 | 5468 | $formconfirm .= ' |
| 5469 | 5469 | resizable: false, |
| 5470 | - height: "' . $height . '", |
|
| 5471 | - width: "' . $width . '", |
|
| 5470 | + height: "' . $height.'", |
|
| 5471 | + width: "' . $width.'", |
|
| 5472 | 5472 | modal: true, |
| 5473 | 5473 | closeOnEscape: false, |
| 5474 | 5474 | buttons: { |
| 5475 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5476 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5477 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5478 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5479 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5475 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5476 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5477 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5478 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5479 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5480 | 5480 | |
| 5481 | 5481 | if (inputok.length > 0) { |
| 5482 | 5482 | $.each(inputok, function(i, inputname) { |
@@ -5510,11 +5510,11 @@ discard block |
||
| 5510 | 5510 | } |
| 5511 | 5511 | $(this).dialog("close"); |
| 5512 | 5512 | }, |
| 5513 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5514 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5515 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5516 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5517 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5513 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5514 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5515 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5516 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5517 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5518 | 5518 | if (inputko.length > 0) { |
| 5519 | 5519 | $.each(inputko, function(i, inputname) { |
| 5520 | 5520 | var more = ""; |
@@ -5546,10 +5546,10 @@ discard block |
||
| 5546 | 5546 | } |
| 5547 | 5547 | ); |
| 5548 | 5548 | |
| 5549 | - var button = "' . $button . '"; |
|
| 5549 | + var button = "' . $button.'"; |
|
| 5550 | 5550 | if (button.length > 0) { |
| 5551 | 5551 | $( "#" + button ).click(function() { |
| 5552 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5552 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5553 | 5553 | }); |
| 5554 | 5554 | } |
| 5555 | 5555 | }); |
@@ -5557,44 +5557,44 @@ discard block |
||
| 5557 | 5557 | </script>'; |
| 5558 | 5558 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5559 | 5559 | } else { |
| 5560 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5560 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5561 | 5561 | |
| 5562 | 5562 | if (empty($disableformtag)) { |
| 5563 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
| 5563 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
| 5564 | 5564 | } |
| 5565 | 5565 | |
| 5566 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5567 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5566 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5567 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5568 | 5568 | |
| 5569 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5569 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 5570 | 5570 | |
| 5571 | 5571 | // Line title |
| 5572 | 5572 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 5573 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 5574 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5573 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 5574 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5575 | 5575 | |
| 5576 | 5576 | // Line text |
| 5577 | 5577 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5578 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 5578 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 5579 | 5579 | } |
| 5580 | 5580 | |
| 5581 | 5581 | // Line form fields |
| 5582 | 5582 | if ($more) { |
| 5583 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 5583 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 5584 | 5584 | $formconfirm .= $more; |
| 5585 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5585 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5586 | 5586 | } |
| 5587 | 5587 | |
| 5588 | 5588 | // Line with question |
| 5589 | 5589 | $formconfirm .= '<tr class="valid">'; |
| 5590 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 5590 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 5591 | 5591 | $formconfirm .= '<td class="valid center">'; |
| 5592 | 5592 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 5593 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 5593 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 5594 | 5594 | $formconfirm .= '</td>'; |
| 5595 | - $formconfirm .= '</tr>' . "\n"; |
|
| 5595 | + $formconfirm .= '</tr>'."\n"; |
|
| 5596 | 5596 | |
| 5597 | - $formconfirm .= '</table>' . "\n"; |
|
| 5597 | + $formconfirm .= '</table>'."\n"; |
|
| 5598 | 5598 | |
| 5599 | 5599 | if (empty($disableformtag)) { |
| 5600 | 5600 | $formconfirm .= "</form>\n"; |
@@ -5603,7 +5603,7 @@ discard block |
||
| 5603 | 5603 | |
| 5604 | 5604 | if (!empty($conf->use_javascript_ajax)) { |
| 5605 | 5605 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 5606 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5606 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5607 | 5607 | $formconfirm .= ' |
| 5608 | 5608 | $(document).ready(function () { |
| 5609 | 5609 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5615,7 +5615,7 @@ discard block |
||
| 5615 | 5615 | }); |
| 5616 | 5616 | }); |
| 5617 | 5617 | '; |
| 5618 | - $formconfirm .= '</script>' . "\n"; |
|
| 5618 | + $formconfirm .= '</script>'."\n"; |
|
| 5619 | 5619 | } |
| 5620 | 5620 | |
| 5621 | 5621 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5647,8 +5647,8 @@ discard block |
||
| 5647 | 5647 | // phpcs:enable |
| 5648 | 5648 | global $langs; |
| 5649 | 5649 | |
| 5650 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 5651 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 5650 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 5651 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 5652 | 5652 | |
| 5653 | 5653 | $out = ''; |
| 5654 | 5654 | |
@@ -5656,11 +5656,11 @@ discard block |
||
| 5656 | 5656 | |
| 5657 | 5657 | $langs->load("project"); |
| 5658 | 5658 | if ($htmlname != "none") { |
| 5659 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 5659 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 5660 | 5660 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 5661 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5661 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5662 | 5662 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 5663 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5663 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5664 | 5664 | $out .= '</form>'; |
| 5665 | 5665 | } else { |
| 5666 | 5666 | $out .= '<span class="project_head_block">'; |
@@ -5669,7 +5669,7 @@ discard block |
||
| 5669 | 5669 | $projet->fetch($selected); |
| 5670 | 5670 | $out .= $projet->getNomUrl(0, '', 1); |
| 5671 | 5671 | } else { |
| 5672 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 5672 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 5673 | 5673 | } |
| 5674 | 5674 | $out .= '</span>'; |
| 5675 | 5675 | } |
@@ -5706,14 +5706,14 @@ discard block |
||
| 5706 | 5706 | $out = ''; |
| 5707 | 5707 | |
| 5708 | 5708 | if ($htmlname != "none") { |
| 5709 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5709 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5710 | 5710 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 5711 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5711 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5712 | 5712 | if ($type) { |
| 5713 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5713 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5714 | 5714 | } |
| 5715 | 5715 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 5716 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5716 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5717 | 5717 | $out .= '</form>'; |
| 5718 | 5718 | } else { |
| 5719 | 5719 | if ($selected) { |
@@ -5758,12 +5758,12 @@ discard block |
||
| 5758 | 5758 | // phpcs:enable |
| 5759 | 5759 | global $langs; |
| 5760 | 5760 | if ($htmlname != "none") { |
| 5761 | - print '<form method="post" action="' . $page . '">'; |
|
| 5761 | + print '<form method="post" action="'.$page.'">'; |
|
| 5762 | 5762 | print '<input type="hidden" name="action" value="setavailability">'; |
| 5763 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5763 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5764 | 5764 | $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); |
| 5765 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5766 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 5765 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5766 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 5767 | 5767 | print '</form>'; |
| 5768 | 5768 | } else { |
| 5769 | 5769 | if ($selected) { |
@@ -5789,11 +5789,11 @@ discard block |
||
| 5789 | 5789 | { |
| 5790 | 5790 | global $langs; |
| 5791 | 5791 | if ($htmlname != "none") { |
| 5792 | - print '<form method="post" action="' . $page . '">'; |
|
| 5792 | + print '<form method="post" action="'.$page.'">'; |
|
| 5793 | 5793 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 5794 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5794 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5795 | 5795 | $this->selectInputReason($selected, $htmlname, -1, $addempty); |
| 5796 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5796 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5797 | 5797 | print '</form>'; |
| 5798 | 5798 | } else { |
| 5799 | 5799 | if ($selected) { |
@@ -5833,17 +5833,17 @@ discard block |
||
| 5833 | 5833 | $ret = ''; |
| 5834 | 5834 | |
| 5835 | 5835 | if ($htmlname != "none") { |
| 5836 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5837 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5838 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5836 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5837 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5838 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5839 | 5839 | if ($type) { |
| 5840 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5840 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5841 | 5841 | } |
| 5842 | 5842 | $ret .= '<table class="nobordernopadding">'; |
| 5843 | 5843 | $ret .= '<tr><td>'; |
| 5844 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 5844 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 5845 | 5845 | $ret .= '</td>'; |
| 5846 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 5846 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 5847 | 5847 | $ret .= '</tr></table></form>'; |
| 5848 | 5848 | } else { |
| 5849 | 5849 | if ($displayhour) { |
@@ -5878,15 +5878,15 @@ discard block |
||
| 5878 | 5878 | global $langs; |
| 5879 | 5879 | |
| 5880 | 5880 | if ($htmlname != "none") { |
| 5881 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5882 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5883 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5881 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5882 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5883 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5884 | 5884 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 5885 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5885 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5886 | 5886 | print '</form>'; |
| 5887 | 5887 | } else { |
| 5888 | 5888 | if ($selected) { |
| 5889 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 5889 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 5890 | 5890 | $theuser = new User($this->db); |
| 5891 | 5891 | $theuser->fetch($selected); |
| 5892 | 5892 | print $theuser->getNomUrl(1); |
@@ -5919,14 +5919,14 @@ discard block |
||
| 5919 | 5919 | |
| 5920 | 5920 | $out = ''; |
| 5921 | 5921 | if ($htmlname != "none") { |
| 5922 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5922 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5923 | 5923 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 5924 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5924 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5925 | 5925 | if ($type) { |
| 5926 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5926 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5927 | 5927 | } |
| 5928 | 5928 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 5929 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5929 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5930 | 5930 | $out .= '</form>'; |
| 5931 | 5931 | } else { |
| 5932 | 5932 | if ($selected) { |
@@ -5959,11 +5959,11 @@ discard block |
||
| 5959 | 5959 | { |
| 5960 | 5960 | global $langs; |
| 5961 | 5961 | if ($htmlname != "none") { |
| 5962 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5962 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5963 | 5963 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 5964 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5964 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5965 | 5965 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 5966 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5966 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5967 | 5967 | print '</form>'; |
| 5968 | 5968 | } else { |
| 5969 | 5969 | if ($selected) { |
@@ -5990,11 +5990,11 @@ discard block |
||
| 5990 | 5990 | // phpcs:enable |
| 5991 | 5991 | global $langs; |
| 5992 | 5992 | if ($htmlname != "none") { |
| 5993 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5993 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5994 | 5994 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 5995 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5995 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5996 | 5996 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 5997 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5997 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5998 | 5998 | print '</form>'; |
| 5999 | 5999 | } else { |
| 6000 | 6000 | dol_include_once('/core/lib/company.lib.php'); |
@@ -6019,21 +6019,21 @@ discard block |
||
| 6019 | 6019 | global $langs, $mysoc, $conf; |
| 6020 | 6020 | |
| 6021 | 6021 | if ($htmlname != "none") { |
| 6022 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6022 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6023 | 6023 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6024 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6025 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6024 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6025 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6026 | 6026 | print '<select name="calculation_mode">'; |
| 6027 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6028 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6027 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6028 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6029 | 6029 | print '</select> '; |
| 6030 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6030 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6031 | 6031 | print '</form>'; |
| 6032 | 6032 | } else { |
| 6033 | 6033 | if (!empty($rate)) { |
| 6034 | 6034 | print price($rate, 1, $langs, 1, 0); |
| 6035 | 6035 | if ($currency && $rate != 1) { |
| 6036 | - print ' (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
| 6036 | + print ' ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
| 6037 | 6037 | } |
| 6038 | 6038 | } else { |
| 6039 | 6039 | print 1; |
@@ -6064,9 +6064,9 @@ discard block |
||
| 6064 | 6064 | // phpcs:enable |
| 6065 | 6065 | global $conf, $langs; |
| 6066 | 6066 | if ($htmlname != "none") { |
| 6067 | - print '<form method="post" action="' . $page . '">'; |
|
| 6067 | + print '<form method="post" action="'.$page.'">'; |
|
| 6068 | 6068 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6069 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6069 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6070 | 6070 | print '<div class="inline-block">'; |
| 6071 | 6071 | if (!empty($discount_type)) { |
| 6072 | 6072 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6104,24 +6104,24 @@ discard block |
||
| 6104 | 6104 | print '</div>'; |
| 6105 | 6105 | if (empty($hidelist)) { |
| 6106 | 6106 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6107 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6107 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6108 | 6108 | if (!empty($discount_type)) { |
| 6109 | 6109 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6110 | 6110 | } else { |
| 6111 | 6111 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6112 | 6112 | } |
| 6113 | 6113 | if ($filter) { |
| 6114 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6114 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6115 | 6115 | } |
| 6116 | 6116 | // output the combo of discounts |
| 6117 | 6117 | $nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6118 | 6118 | if ($nbqualifiedlines > 0) { |
| 6119 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6119 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6120 | 6120 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6121 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6121 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6122 | 6122 | } |
| 6123 | 6123 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6124 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6124 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6125 | 6125 | } |
| 6126 | 6126 | |
| 6127 | 6127 | print '>'; |
@@ -6161,23 +6161,23 @@ discard block |
||
| 6161 | 6161 | global $langs, $conf; |
| 6162 | 6162 | |
| 6163 | 6163 | if ($htmlname != "none") { |
| 6164 | - print '<form method="post" action="' . $page . '">'; |
|
| 6164 | + print '<form method="post" action="'.$page.'">'; |
|
| 6165 | 6165 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6166 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6166 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6167 | 6167 | print '<table class="nobordernopadding">'; |
| 6168 | 6168 | print '<tr><td>'; |
| 6169 | 6169 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6170 | 6170 | $num = $this->num; |
| 6171 | 6171 | if ($num == 0) { |
| 6172 | 6172 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6173 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6173 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6174 | 6174 | } |
| 6175 | 6175 | print '</td>'; |
| 6176 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6176 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6177 | 6177 | print '</tr></table></form>'; |
| 6178 | 6178 | } else { |
| 6179 | 6179 | if ($selected) { |
| 6180 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6180 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6181 | 6181 | $contact = new Contact($this->db); |
| 6182 | 6182 | $contact->fetch($selected); |
| 6183 | 6183 | print $contact->getFullName($langs); |
@@ -6212,20 +6212,20 @@ discard block |
||
| 6212 | 6212 | |
| 6213 | 6213 | $out = ''; |
| 6214 | 6214 | if ($htmlname != "none") { |
| 6215 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6215 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6216 | 6216 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6217 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6217 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6218 | 6218 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6219 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6219 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6220 | 6220 | $out .= '</form>'; |
| 6221 | 6221 | } else { |
| 6222 | 6222 | if ($selected) { |
| 6223 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6223 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6224 | 6224 | $soc = new Societe($this->db); |
| 6225 | 6225 | $soc->fetch($selected); |
| 6226 | 6226 | $out .= $soc->getNomUrl(0, ''); |
| 6227 | 6227 | } else { |
| 6228 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6228 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6229 | 6229 | } |
| 6230 | 6230 | } |
| 6231 | 6231 | |
@@ -6275,22 +6275,22 @@ discard block |
||
| 6275 | 6275 | $selected = 'EUR'; // Pour compatibilite |
| 6276 | 6276 | } |
| 6277 | 6277 | |
| 6278 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6278 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6279 | 6279 | if ($useempty) { |
| 6280 | 6280 | $out .= '<option value="-1" selected></option>'; |
| 6281 | 6281 | } |
| 6282 | 6282 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6283 | 6283 | $labeltoshow = $currency['label']; |
| 6284 | 6284 | if ($mode == 1) { |
| 6285 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6285 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6286 | 6286 | } else { |
| 6287 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6287 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6288 | 6288 | } |
| 6289 | 6289 | |
| 6290 | 6290 | if ($selected && $selected == $code_iso) { |
| 6291 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6291 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6292 | 6292 | } else { |
| 6293 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6293 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6294 | 6294 | } |
| 6295 | 6295 | $out .= $labeltoshow; |
| 6296 | 6296 | $out .= '</option>'; |
@@ -6301,7 +6301,7 @@ discard block |
||
| 6301 | 6301 | } |
| 6302 | 6302 | |
| 6303 | 6303 | // Make select dynamic |
| 6304 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6304 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6305 | 6305 | $out .= ajax_combobox($htmlname); |
| 6306 | 6306 | |
| 6307 | 6307 | return $out; |
@@ -6327,10 +6327,10 @@ discard block |
||
| 6327 | 6327 | |
| 6328 | 6328 | $TCurrency = array(); |
| 6329 | 6329 | |
| 6330 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6331 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6330 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6331 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6332 | 6332 | if ($filter) { |
| 6333 | - $sql .= " AND " . $filter; |
|
| 6333 | + $sql .= " AND ".$filter; |
|
| 6334 | 6334 | } |
| 6335 | 6335 | $resql = $this->db->query($sql); |
| 6336 | 6336 | if ($resql) { |
@@ -6340,7 +6340,7 @@ discard block |
||
| 6340 | 6340 | } |
| 6341 | 6341 | |
| 6342 | 6342 | $out = ''; |
| 6343 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6343 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6344 | 6344 | if ($useempty) { |
| 6345 | 6345 | $out .= '<option value=""> </option>'; |
| 6346 | 6346 | } |
@@ -6352,13 +6352,13 @@ discard block |
||
| 6352 | 6352 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6353 | 6353 | if (isset($TCurrency[$code_iso])) { |
| 6354 | 6354 | if (!empty($selected) && $selected == $code_iso) { |
| 6355 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6355 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6356 | 6356 | } else { |
| 6357 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6357 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6358 | 6358 | } |
| 6359 | 6359 | |
| 6360 | 6360 | $out .= $currency['label']; |
| 6361 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6361 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6362 | 6362 | $out .= '</option>'; |
| 6363 | 6363 | } |
| 6364 | 6364 | } |
@@ -6367,7 +6367,7 @@ discard block |
||
| 6367 | 6367 | $out .= '</select>'; |
| 6368 | 6368 | |
| 6369 | 6369 | // Make select dynamic |
| 6370 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6370 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6371 | 6371 | $out .= ajax_combobox($htmlname); |
| 6372 | 6372 | |
| 6373 | 6373 | return $out; |
@@ -6398,7 +6398,7 @@ discard block |
||
| 6398 | 6398 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6399 | 6399 | $sql .= " AND t.active > 0"; |
| 6400 | 6400 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6401 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6401 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6402 | 6402 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6403 | 6403 | |
| 6404 | 6404 | $resql = $this->db->query($sql); |
@@ -6410,30 +6410,30 @@ discard block |
||
| 6410 | 6410 | |
| 6411 | 6411 | $tmparray = array(); |
| 6412 | 6412 | $tmparray['rowid'] = $obj->rowid; |
| 6413 | - $tmparray['type_vat'] = $obj->type_vat; |
|
| 6414 | - $tmparray['code'] = $obj->code; |
|
| 6413 | + $tmparray['type_vat'] = $obj->type_vat; |
|
| 6414 | + $tmparray['code'] = $obj->code; |
|
| 6415 | 6415 | $tmparray['txtva'] = $obj->taux; |
| 6416 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6416 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6417 | 6417 | $tmparray['localtax1'] = $obj->localtax1; |
| 6418 | 6418 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
| 6419 | 6419 | $tmparray['localtax2'] = $obj->localtax2; |
| 6420 | 6420 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
| 6421 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6422 | - $tmparray['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6421 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6422 | + $tmparray['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6423 | 6423 | $positiverates = ''; |
| 6424 | 6424 | if ($obj->taux) { |
| 6425 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6425 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6426 | 6426 | } |
| 6427 | 6427 | if ($obj->localtax1) { |
| 6428 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6428 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6429 | 6429 | } |
| 6430 | 6430 | if ($obj->localtax2) { |
| 6431 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6431 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6432 | 6432 | } |
| 6433 | 6433 | if (empty($positiverates)) { |
| 6434 | 6434 | $positiverates = '0'; |
| 6435 | 6435 | } |
| 6436 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6436 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6437 | 6437 | |
| 6438 | 6438 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
| 6439 | 6439 | } |
@@ -6453,7 +6453,7 @@ discard block |
||
| 6453 | 6453 | return -1; |
| 6454 | 6454 | } |
| 6455 | 6455 | } else { |
| 6456 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6456 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6457 | 6457 | return -2; |
| 6458 | 6458 | } |
| 6459 | 6459 | } |
@@ -6506,9 +6506,9 @@ discard block |
||
| 6506 | 6506 | // Check parameters |
| 6507 | 6507 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6508 | 6508 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6509 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6509 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6510 | 6510 | } else { |
| 6511 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6511 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6512 | 6512 | } |
| 6513 | 6513 | return $return; |
| 6514 | 6514 | } |
@@ -6520,12 +6520,12 @@ discard block |
||
| 6520 | 6520 | // Define list of countries to use to search VAT rates to show |
| 6521 | 6521 | // First we defined code_country to use to find list |
| 6522 | 6522 | if (is_object($societe_vendeuse)) { |
| 6523 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6523 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6524 | 6524 | } else { |
| 6525 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6525 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6526 | 6526 | } |
| 6527 | 6527 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
| 6528 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6528 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6529 | 6529 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
| 6530 | 6530 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
| 6531 | 6531 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6535,27 +6535,27 @@ discard block |
||
| 6535 | 6535 | if ($type == 1) { // We know product is a service |
| 6536 | 6536 | switch ($selectVatComboMode) { |
| 6537 | 6537 | case '1': |
| 6538 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6538 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6539 | 6539 | break; |
| 6540 | 6540 | case '2': |
| 6541 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6541 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6542 | 6542 | break; |
| 6543 | 6543 | } |
| 6544 | 6544 | } |
| 6545 | 6545 | } elseif (!$idprod) { // We don't know type of product |
| 6546 | 6546 | switch ($selectVatComboMode) { |
| 6547 | 6547 | case '1': |
| 6548 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6548 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6549 | 6549 | break; |
| 6550 | 6550 | case '2': |
| 6551 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6551 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6552 | 6552 | break; |
| 6553 | 6553 | } |
| 6554 | 6554 | } else { |
| 6555 | 6555 | $prodstatic = new Product($this->db); |
| 6556 | 6556 | $prodstatic->fetch($idprod); |
| 6557 | 6557 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 6558 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6558 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6559 | 6559 | } |
| 6560 | 6560 | } |
| 6561 | 6561 | } |
@@ -6617,13 +6617,13 @@ discard block |
||
| 6617 | 6617 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 6618 | 6618 | // of using supplier invoices (this is a very bad idea !) |
| 6619 | 6619 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
| 6620 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 6620 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 6621 | 6621 | $disabled = true; |
| 6622 | 6622 | } |
| 6623 | 6623 | } |
| 6624 | 6624 | |
| 6625 | 6625 | if (!$options_only) { |
| 6626 | - $return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 6626 | + $return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 6627 | 6627 | } |
| 6628 | 6628 | |
| 6629 | 6629 | $selectedfound = false; |
@@ -6637,13 +6637,13 @@ discard block |
||
| 6637 | 6637 | $key = $rate['txtva']; |
| 6638 | 6638 | $key .= $rate['nprtva'] ? '*' : ''; |
| 6639 | 6639 | if ($mode > 0 && $rate['code']) { |
| 6640 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 6640 | + $key .= ' ('.$rate['code'].')'; |
|
| 6641 | 6641 | } |
| 6642 | 6642 | if ($mode < 0) { |
| 6643 | 6643 | $key = $rate['rowid']; |
| 6644 | 6644 | } |
| 6645 | 6645 | |
| 6646 | - $return .= '<option value="' . $key . '"'; |
|
| 6646 | + $return .= '<option value="'.$key.'"'; |
|
| 6647 | 6647 | if (!$selectedfound) { |
| 6648 | 6648 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 6649 | 6649 | if ($defaultcode == $rate['code']) { |
@@ -6714,7 +6714,7 @@ discard block |
||
| 6714 | 6714 | public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '') |
| 6715 | 6715 | { |
| 6716 | 6716 | // phpcs:enable |
| 6717 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6717 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6718 | 6718 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 6719 | 6719 | if (!empty($nooutput)) { |
| 6720 | 6720 | return $retstring; |
@@ -6743,11 +6743,11 @@ discard block |
||
| 6743 | 6743 | { |
| 6744 | 6744 | global $langs; |
| 6745 | 6745 | |
| 6746 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6746 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6747 | 6747 | if ($forcenewline) { |
| 6748 | 6748 | $ret .= '<br>'; |
| 6749 | 6749 | } |
| 6750 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6750 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6751 | 6751 | return $ret; |
| 6752 | 6752 | } |
| 6753 | 6753 | |
@@ -6813,7 +6813,7 @@ discard block |
||
| 6813 | 6813 | $orig_set_time = $set_time; |
| 6814 | 6814 | |
| 6815 | 6815 | if ($set_time === '' && $emptydate == 0) { |
| 6816 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 6816 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 6817 | 6817 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 6818 | 6818 | $set_time = dol_now($gm); |
| 6819 | 6819 | } else { |
@@ -6881,38 +6881,38 @@ discard block |
||
| 6881 | 6881 | // Calendrier popup version eldy |
| 6882 | 6882 | if ($usecalendar == "eldy") { |
| 6883 | 6883 | // Input area to enter date manually |
| 6884 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"'; |
|
| 6884 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
|
| 6885 | 6885 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6886 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6886 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6887 | 6887 | $retstring .= '>'; |
| 6888 | 6888 | |
| 6889 | 6889 | // Icon calendar |
| 6890 | 6890 | $retstringbuttom = ''; |
| 6891 | 6891 | if (!$disabled) { |
| 6892 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6893 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 6894 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
| 6895 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6892 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6893 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 6894 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
| 6895 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6896 | 6896 | } else { |
| 6897 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6897 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6898 | 6898 | } |
| 6899 | - $retstring = $retstringbuttom . $retstring; |
|
| 6899 | + $retstring = $retstringbuttom.$retstring; |
|
| 6900 | 6900 | |
| 6901 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6902 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6903 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6901 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6902 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6903 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6904 | 6904 | } elseif ($usecalendar == 'jquery') { |
| 6905 | 6905 | if (!$disabled) { |
| 6906 | 6906 | // Output javascript for datepicker |
| 6907 | 6907 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100)); |
| 6908 | 6908 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100)); |
| 6909 | 6909 | |
| 6910 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 6911 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 6912 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 6910 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 6911 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 6912 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 6913 | 6913 | autoclose: true, |
| 6914 | 6914 | todayHighlight: true, |
| 6915 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 6915 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 6916 | 6916 | if (!empty($conf->dol_use_jmobile)) { |
| 6917 | 6917 | $retstring .= " |
| 6918 | 6918 | beforeShow: function (input, datePicker) { |
@@ -6927,7 +6927,7 @@ discard block |
||
| 6927 | 6927 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
| 6928 | 6928 | $retstring .= " |
| 6929 | 6929 | showOn: 'button', /* both has problem with autocompletion */ |
| 6930 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
| 6930 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
| 6931 | 6931 | buttonImageOnly: true"; |
| 6932 | 6932 | } |
| 6933 | 6933 | $retstring .= " |
@@ -6939,8 +6939,8 @@ discard block |
||
| 6939 | 6939 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 6940 | 6940 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
| 6941 | 6941 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6942 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 6943 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6942 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 6943 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6944 | 6944 | $retstring .= '>'; |
| 6945 | 6945 | |
| 6946 | 6946 | // Icone calendrier |
@@ -6955,40 +6955,40 @@ discard block |
||
| 6955 | 6955 | $retstring.='});'; |
| 6956 | 6956 | $retstring.="</script>";*/ |
| 6957 | 6957 | } else { |
| 6958 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6959 | - $retsring = $retstringbutton . $retstring; |
|
| 6958 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6959 | + $retsring = $retstringbutton.$retstring; |
|
| 6960 | 6960 | } |
| 6961 | 6961 | |
| 6962 | 6962 | $retstring .= '</div>'; |
| 6963 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6964 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6965 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6963 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6964 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6965 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6966 | 6966 | } else { |
| 6967 | 6967 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 6968 | 6968 | } |
| 6969 | 6969 | } else { |
| 6970 | 6970 | // Show date with combo selects |
| 6971 | 6971 | // Day |
| 6972 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 6972 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 6973 | 6973 | |
| 6974 | 6974 | if ($emptydate || $set_time == -1) { |
| 6975 | 6975 | $retstring .= '<option value="0" selected> </option>'; |
| 6976 | 6976 | } |
| 6977 | 6977 | |
| 6978 | 6978 | for ($day = 1; $day <= 31; $day++) { |
| 6979 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 6979 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 6980 | 6980 | } |
| 6981 | 6981 | |
| 6982 | 6982 | $retstring .= "</select>"; |
| 6983 | 6983 | |
| 6984 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 6984 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 6985 | 6985 | if ($emptydate || $set_time == -1) { |
| 6986 | 6986 | $retstring .= '<option value="0" selected> </option>'; |
| 6987 | 6987 | } |
| 6988 | 6988 | |
| 6989 | 6989 | // Month |
| 6990 | 6990 | for ($month = 1; $month <= 12; $month++) { |
| 6991 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 6991 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 6992 | 6992 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 6993 | 6993 | $retstring .= "</option>"; |
| 6994 | 6994 | } |
@@ -6996,12 +6996,12 @@ discard block |
||
| 6996 | 6996 | |
| 6997 | 6997 | // Year |
| 6998 | 6998 | if ($emptydate || $set_time == -1) { |
| 6999 | - $retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">'; |
|
| 6999 | + $retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'; |
|
| 7000 | 7000 | } else { |
| 7001 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 7001 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 7002 | 7002 | |
| 7003 | 7003 | for ($year = $syear - 10; $year < $syear + 10; $year++) { |
| 7004 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 7004 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 7005 | 7005 | } |
| 7006 | 7006 | $retstring .= "</select>\n"; |
| 7007 | 7007 | } |
@@ -7025,15 +7025,15 @@ discard block |
||
| 7025 | 7025 | } |
| 7026 | 7026 | } |
| 7027 | 7027 | // Show hour |
| 7028 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 7028 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 7029 | 7029 | if ($emptyhours) { |
| 7030 | 7030 | $retstring .= '<option value="-1"> </option>'; |
| 7031 | 7031 | } |
| 7032 | 7032 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 7033 | 7033 | if (strlen($hour) < 2) { |
| 7034 | - $hour = "0" . $hour; |
|
| 7034 | + $hour = "0".$hour; |
|
| 7035 | 7035 | } |
| 7036 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 7036 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 7037 | 7037 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 7038 | 7038 | $retstring .= '</option>'; |
| 7039 | 7039 | } |
@@ -7046,19 +7046,19 @@ discard block |
||
| 7046 | 7046 | |
| 7047 | 7047 | if ($m) { |
| 7048 | 7048 | // Show minutes |
| 7049 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 7049 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 7050 | 7050 | if ($emptyhours) { |
| 7051 | 7051 | $retstring .= '<option value="-1"> </option>'; |
| 7052 | 7052 | } |
| 7053 | 7053 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7054 | 7054 | if (strlen($min) < 2) { |
| 7055 | - $min = "0" . $min; |
|
| 7055 | + $min = "0".$min; |
|
| 7056 | 7056 | } |
| 7057 | - $retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>'; |
|
| 7057 | + $retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>'; |
|
| 7058 | 7058 | } |
| 7059 | 7059 | $retstring .= '</select>'; |
| 7060 | 7060 | |
| 7061 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7061 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7062 | 7062 | } |
| 7063 | 7063 | |
| 7064 | 7064 | if ($d && $h) { |
@@ -7081,10 +7081,10 @@ discard block |
||
| 7081 | 7081 | |
| 7082 | 7082 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7083 | 7083 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7084 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7085 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7086 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7087 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7084 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7085 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7086 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7087 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7088 | 7088 | } elseif ($addnowlink == 2) { |
| 7089 | 7089 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7090 | 7090 | * This break application for foreign languages. |
@@ -7093,10 +7093,10 @@ discard block |
||
| 7093 | 7093 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7094 | 7094 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7095 | 7095 | */ |
| 7096 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7097 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7098 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7099 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7096 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7097 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7098 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7099 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7100 | 7100 | } |
| 7101 | 7101 | /*if ($usecalendar == "eldy") |
| 7102 | 7102 | { |
@@ -7116,11 +7116,11 @@ discard block |
||
| 7116 | 7116 | } |
| 7117 | 7117 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7118 | 7118 | if ($addnowlink == 1) { |
| 7119 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7120 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7119 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7120 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7121 | 7121 | } elseif ($addnowlink == 2) { |
| 7122 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7123 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7122 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7123 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7124 | 7124 | } |
| 7125 | 7125 | |
| 7126 | 7126 | if ($fullday) { |
@@ -7134,11 +7134,11 @@ discard block |
||
| 7134 | 7134 | } |
| 7135 | 7135 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7136 | 7136 | if ($addnowlink == 1) { |
| 7137 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7138 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7137 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7138 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7139 | 7139 | } elseif ($addnowlink == 2) { |
| 7140 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7141 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7140 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7141 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7142 | 7142 | } |
| 7143 | 7143 | if ($fullday) { |
| 7144 | 7144 | $reset_scripts .= ' } '; |
@@ -7146,7 +7146,7 @@ discard block |
||
| 7146 | 7146 | } |
| 7147 | 7147 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7148 | 7148 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 7149 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7149 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7150 | 7150 | $retstring .= $langs->trans("Now"); |
| 7151 | 7151 | $retstring .= '</button> '; |
| 7152 | 7152 | } |
@@ -7158,16 +7158,16 @@ discard block |
||
| 7158 | 7158 | $reset_scripts = ""; |
| 7159 | 7159 | |
| 7160 | 7160 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7161 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7162 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7163 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7164 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7161 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7162 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7163 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7164 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7165 | 7165 | // Update the hour part |
| 7166 | 7166 | if ($h) { |
| 7167 | 7167 | if ($fullday) { |
| 7168 | 7168 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7169 | 7169 | } |
| 7170 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7170 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7171 | 7171 | if ($fullday) { |
| 7172 | 7172 | $reset_scripts .= ' } '; |
| 7173 | 7173 | } |
@@ -7177,14 +7177,14 @@ discard block |
||
| 7177 | 7177 | if ($fullday) { |
| 7178 | 7178 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7179 | 7179 | } |
| 7180 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7180 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7181 | 7181 | if ($fullday) { |
| 7182 | 7182 | $reset_scripts .= ' } '; |
| 7183 | 7183 | } |
| 7184 | 7184 | } |
| 7185 | 7185 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7186 | 7186 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7187 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7187 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7188 | 7188 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7189 | 7189 | $retstring .= '</button> '; |
| 7190 | 7190 | } |
@@ -7242,17 +7242,17 @@ discard block |
||
| 7242 | 7242 | unset($TDurationTypes[$value]); |
| 7243 | 7243 | } |
| 7244 | 7244 | |
| 7245 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7245 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7246 | 7246 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7247 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7247 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7248 | 7248 | if ($key == $selected) { |
| 7249 | 7249 | $retstring .= " selected"; |
| 7250 | 7250 | } |
| 7251 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7251 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7252 | 7252 | } |
| 7253 | 7253 | $retstring .= "</select>"; |
| 7254 | 7254 | |
| 7255 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7255 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7256 | 7256 | |
| 7257 | 7257 | return $retstring; |
| 7258 | 7258 | } |
@@ -7284,30 +7284,30 @@ discard block |
||
| 7284 | 7284 | |
| 7285 | 7285 | // Hours |
| 7286 | 7286 | if ($iSecond != '') { |
| 7287 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7287 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7288 | 7288 | |
| 7289 | 7289 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7290 | 7290 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7291 | 7291 | } |
| 7292 | 7292 | |
| 7293 | 7293 | if ($typehour == 'select') { |
| 7294 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7294 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7295 | 7295 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7296 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7296 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7297 | 7297 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7298 | 7298 | $retstring .= " selected"; |
| 7299 | 7299 | } |
| 7300 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7300 | + $retstring .= ">".$hour."</option>"; |
|
| 7301 | 7301 | } |
| 7302 | 7302 | $retstring .= "</select>"; |
| 7303 | 7303 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7304 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7304 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7305 | 7305 | } else { |
| 7306 | 7306 | return 'BadValueForParameterTypeHour'; |
| 7307 | 7307 | } |
| 7308 | 7308 | |
| 7309 | 7309 | if ($typehour != 'text') { |
| 7310 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7310 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7311 | 7311 | } else { |
| 7312 | 7312 | $retstring .= '<span class="">:</span>'; |
| 7313 | 7313 | } |
@@ -7322,21 +7322,21 @@ discard block |
||
| 7322 | 7322 | } |
| 7323 | 7323 | |
| 7324 | 7324 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7325 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7325 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7326 | 7326 | for ($min = 0; $min <= 55; $min = $min + 5) { |
| 7327 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7327 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7328 | 7328 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7329 | 7329 | $retstring .= ' selected'; |
| 7330 | 7330 | } |
| 7331 | - $retstring .= '>' . $min . '</option>'; |
|
| 7331 | + $retstring .= '>'.$min.'</option>'; |
|
| 7332 | 7332 | } |
| 7333 | 7333 | $retstring .= "</select>"; |
| 7334 | 7334 | } elseif ($typehour == 'text') { |
| 7335 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7335 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7336 | 7336 | } |
| 7337 | 7337 | |
| 7338 | 7338 | if ($typehour != 'text') { |
| 7339 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7339 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7340 | 7340 | } |
| 7341 | 7341 | |
| 7342 | 7342 | $retstring .= "</span>"; |
@@ -7384,7 +7384,7 @@ discard block |
||
| 7384 | 7384 | $placeholder = ''; |
| 7385 | 7385 | |
| 7386 | 7386 | if ($selected && empty($selected_input_value)) { |
| 7387 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7387 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7388 | 7388 | $tickettmpselect = new Ticket($this->db); |
| 7389 | 7389 | $tickettmpselect->fetch($selected); |
| 7390 | 7390 | $selected_input_value = $tickettmpselect->ref; |
@@ -7392,17 +7392,17 @@ discard block |
||
| 7392 | 7392 | } |
| 7393 | 7393 | |
| 7394 | 7394 | $urloption = ''; |
| 7395 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7395 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7396 | 7396 | |
| 7397 | 7397 | if (empty($hidelabel)) { |
| 7398 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7398 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7399 | 7399 | } elseif ($hidelabel > 1) { |
| 7400 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7400 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7401 | 7401 | if ($hidelabel == 2) { |
| 7402 | 7402 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7403 | 7403 | } |
| 7404 | 7404 | } |
| 7405 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7405 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7406 | 7406 | if ($hidelabel == 3) { |
| 7407 | 7407 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7408 | 7408 | } |
@@ -7446,8 +7446,8 @@ discard block |
||
| 7446 | 7446 | |
| 7447 | 7447 | $sql = "SELECT "; |
| 7448 | 7448 | $sql .= $selectFields; |
| 7449 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7450 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7449 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7450 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7451 | 7451 | |
| 7452 | 7452 | // Add criteria on ref/label |
| 7453 | 7453 | if ($filterkey != '') { |
@@ -7463,7 +7463,7 @@ discard block |
||
| 7463 | 7463 | if ($i > 0) { |
| 7464 | 7464 | $sql .= " AND "; |
| 7465 | 7465 | } |
| 7466 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7466 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7467 | 7467 | $sql .= ")"; |
| 7468 | 7468 | $i++; |
| 7469 | 7469 | } |
@@ -7476,22 +7476,22 @@ discard block |
||
| 7476 | 7476 | $sql .= $this->db->plimit($limit, 0); |
| 7477 | 7477 | |
| 7478 | 7478 | // Build output string |
| 7479 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7479 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7480 | 7480 | $result = $this->db->query($sql); |
| 7481 | 7481 | if ($result) { |
| 7482 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7483 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7482 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7483 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7484 | 7484 | |
| 7485 | 7485 | $num = $this->db->num_rows($result); |
| 7486 | 7486 | |
| 7487 | 7487 | $events = null; |
| 7488 | 7488 | |
| 7489 | 7489 | if (!$forcecombo) { |
| 7490 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7490 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7491 | 7491 | $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); |
| 7492 | 7492 | } |
| 7493 | 7493 | |
| 7494 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7494 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7495 | 7495 | |
| 7496 | 7496 | $textifempty = ''; |
| 7497 | 7497 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7508,7 +7508,7 @@ discard block |
||
| 7508 | 7508 | } |
| 7509 | 7509 | } |
| 7510 | 7510 | if ($showempty) { |
| 7511 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7511 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7512 | 7512 | } |
| 7513 | 7513 | |
| 7514 | 7514 | $i = 0; |
@@ -7563,13 +7563,13 @@ discard block |
||
| 7563 | 7563 | $outref = $objp->ref; |
| 7564 | 7564 | $outtype = $objp->fk_product_type; |
| 7565 | 7565 | |
| 7566 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7566 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7567 | 7567 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7568 | 7568 | $opt .= '>'; |
| 7569 | 7569 | $opt .= $objp->ref; |
| 7570 | 7570 | $objRef = $objp->ref; |
| 7571 | 7571 | if (!empty($filterkey) && $filterkey != '') { |
| 7572 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7572 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7573 | 7573 | } |
| 7574 | 7574 | |
| 7575 | 7575 | $opt .= "</option>\n"; |
@@ -7610,7 +7610,7 @@ discard block |
||
| 7610 | 7610 | $placeholder = ''; |
| 7611 | 7611 | |
| 7612 | 7612 | if ($selected && empty($selected_input_value)) { |
| 7613 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7613 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7614 | 7614 | $projecttmpselect = new Project($this->db); |
| 7615 | 7615 | $projecttmpselect->fetch($selected); |
| 7616 | 7616 | $selected_input_value = $projecttmpselect->ref; |
@@ -7618,17 +7618,17 @@ discard block |
||
| 7618 | 7618 | } |
| 7619 | 7619 | |
| 7620 | 7620 | $urloption = ''; |
| 7621 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7621 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7622 | 7622 | |
| 7623 | 7623 | if (empty($hidelabel)) { |
| 7624 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7624 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7625 | 7625 | } elseif ($hidelabel > 1) { |
| 7626 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7626 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7627 | 7627 | if ($hidelabel == 2) { |
| 7628 | 7628 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7629 | 7629 | } |
| 7630 | 7630 | } |
| 7631 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7631 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7632 | 7632 | if ($hidelabel == 3) { |
| 7633 | 7633 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7634 | 7634 | } |
@@ -7671,8 +7671,8 @@ discard block |
||
| 7671 | 7671 | |
| 7672 | 7672 | $sql = "SELECT "; |
| 7673 | 7673 | $sql .= $selectFields; |
| 7674 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 7675 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 7674 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 7675 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 7676 | 7676 | |
| 7677 | 7677 | // Add criteria on ref/label |
| 7678 | 7678 | if ($filterkey != '') { |
@@ -7688,7 +7688,7 @@ discard block |
||
| 7688 | 7688 | if ($i > 0) { |
| 7689 | 7689 | $sql .= " AND "; |
| 7690 | 7690 | } |
| 7691 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7691 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7692 | 7692 | $sql .= ""; |
| 7693 | 7693 | $i++; |
| 7694 | 7694 | } |
@@ -7701,22 +7701,22 @@ discard block |
||
| 7701 | 7701 | $sql .= $this->db->plimit($limit, 0); |
| 7702 | 7702 | |
| 7703 | 7703 | // Build output string |
| 7704 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 7704 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 7705 | 7705 | $result = $this->db->query($sql); |
| 7706 | 7706 | if ($result) { |
| 7707 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7708 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 7707 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7708 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 7709 | 7709 | |
| 7710 | 7710 | $num = $this->db->num_rows($result); |
| 7711 | 7711 | |
| 7712 | 7712 | $events = null; |
| 7713 | 7713 | |
| 7714 | 7714 | if (!$forcecombo) { |
| 7715 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7715 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7716 | 7716 | $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); |
| 7717 | 7717 | } |
| 7718 | 7718 | |
| 7719 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7719 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7720 | 7720 | |
| 7721 | 7721 | $textifempty = ''; |
| 7722 | 7722 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7733,7 +7733,7 @@ discard block |
||
| 7733 | 7733 | } |
| 7734 | 7734 | } |
| 7735 | 7735 | if ($showempty) { |
| 7736 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7736 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7737 | 7737 | } |
| 7738 | 7738 | |
| 7739 | 7739 | $i = 0; |
@@ -7791,13 +7791,13 @@ discard block |
||
| 7791 | 7791 | $outlabel = $objp->label; |
| 7792 | 7792 | $outtype = $objp->fk_product_type; |
| 7793 | 7793 | |
| 7794 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7794 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7795 | 7795 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7796 | 7796 | $opt .= '>'; |
| 7797 | 7797 | $opt .= $objp->ref; |
| 7798 | 7798 | $objRef = $objp->ref; |
| 7799 | 7799 | if (!empty($filterkey) && $filterkey != '') { |
| 7800 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7800 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7801 | 7801 | } |
| 7802 | 7802 | |
| 7803 | 7803 | $opt .= "</option>\n"; |
@@ -7840,7 +7840,7 @@ discard block |
||
| 7840 | 7840 | $urloption = ''; |
| 7841 | 7841 | |
| 7842 | 7842 | if ($selected && empty($selected_input_value)) { |
| 7843 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7843 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7844 | 7844 | $adherenttmpselect = new Adherent($this->db); |
| 7845 | 7845 | $adherenttmpselect->fetch($selected); |
| 7846 | 7846 | $selected_input_value = $adherenttmpselect->ref; |
@@ -7849,17 +7849,17 @@ discard block |
||
| 7849 | 7849 | |
| 7850 | 7850 | $urloption = ''; |
| 7851 | 7851 | |
| 7852 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7852 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7853 | 7853 | |
| 7854 | 7854 | if (empty($hidelabel)) { |
| 7855 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7855 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7856 | 7856 | } elseif ($hidelabel > 1) { |
| 7857 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7857 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7858 | 7858 | if ($hidelabel == 2) { |
| 7859 | 7859 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7860 | 7860 | } |
| 7861 | 7861 | } |
| 7862 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7862 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7863 | 7863 | if ($hidelabel == 3) { |
| 7864 | 7864 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7865 | 7865 | } |
@@ -7904,8 +7904,8 @@ discard block |
||
| 7904 | 7904 | |
| 7905 | 7905 | $sql = "SELECT "; |
| 7906 | 7906 | $sql .= $selectFields; |
| 7907 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 7908 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 7907 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 7908 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 7909 | 7909 | |
| 7910 | 7910 | // Add criteria on ref/label |
| 7911 | 7911 | if ($filterkey != '') { |
@@ -7921,8 +7921,8 @@ discard block |
||
| 7921 | 7921 | if ($i > 0) { |
| 7922 | 7922 | $sql .= " AND "; |
| 7923 | 7923 | } |
| 7924 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7925 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 7924 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7925 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 7926 | 7926 | $i++; |
| 7927 | 7927 | } |
| 7928 | 7928 | if (count($scrit) > 1) { |
@@ -7931,27 +7931,27 @@ discard block |
||
| 7931 | 7931 | $sql .= ')'; |
| 7932 | 7932 | } |
| 7933 | 7933 | if ($status != -1) { |
| 7934 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 7934 | + $sql .= ' AND statut = '.((int) $status); |
|
| 7935 | 7935 | } |
| 7936 | 7936 | $sql .= $this->db->plimit($limit, 0); |
| 7937 | 7937 | |
| 7938 | 7938 | // Build output string |
| 7939 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 7939 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 7940 | 7940 | $result = $this->db->query($sql); |
| 7941 | 7941 | if ($result) { |
| 7942 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7943 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 7942 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7943 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 7944 | 7944 | |
| 7945 | 7945 | $num = $this->db->num_rows($result); |
| 7946 | 7946 | |
| 7947 | 7947 | $events = null; |
| 7948 | 7948 | |
| 7949 | 7949 | if (!$forcecombo) { |
| 7950 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7950 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7951 | 7951 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 7952 | 7952 | } |
| 7953 | 7953 | |
| 7954 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7954 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7955 | 7955 | |
| 7956 | 7956 | $textifempty = ''; |
| 7957 | 7957 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7968,7 +7968,7 @@ discard block |
||
| 7968 | 7968 | } |
| 7969 | 7969 | } |
| 7970 | 7970 | if ($showempty) { |
| 7971 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 7971 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 7972 | 7972 | } |
| 7973 | 7973 | |
| 7974 | 7974 | $i = 0; |
@@ -8024,11 +8024,11 @@ discard block |
||
| 8024 | 8024 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 8025 | 8025 | $outtype = $objp->fk_adherent_type; |
| 8026 | 8026 | |
| 8027 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8027 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8028 | 8028 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8029 | 8029 | $opt .= '>'; |
| 8030 | 8030 | if (!empty($filterkey) && $filterkey != '') { |
| 8031 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8031 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8032 | 8032 | } |
| 8033 | 8033 | $opt .= $outlabel; |
| 8034 | 8034 | $opt .= "</option>\n"; |
@@ -8101,9 +8101,9 @@ discard block |
||
| 8101 | 8101 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 8102 | 8102 | $reg = array(); |
| 8103 | 8103 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 8104 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8104 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8105 | 8105 | } |
| 8106 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8106 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8107 | 8107 | |
| 8108 | 8108 | $classname = $InfoFieldList[0]; |
| 8109 | 8109 | $classpath = $InfoFieldList[1]; |
@@ -8134,8 +8134,8 @@ discard block |
||
| 8134 | 8134 | ); |
| 8135 | 8135 | |
| 8136 | 8136 | if (!is_object($objecttmp)) { |
| 8137 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
|
| 8138 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield; |
|
| 8137 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
|
| 8138 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield; |
|
| 8139 | 8139 | } |
| 8140 | 8140 | |
| 8141 | 8141 | //var_dump($filter); |
@@ -8146,9 +8146,9 @@ discard block |
||
| 8146 | 8146 | if ($prefixforautocompletemode == 'product') { |
| 8147 | 8147 | $prefixforautocompletemode = 'produit'; |
| 8148 | 8148 | } |
| 8149 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8149 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8150 | 8150 | |
| 8151 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8151 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8152 | 8152 | |
| 8153 | 8153 | // Generate the combo HTML component |
| 8154 | 8154 | $out = ''; |
@@ -8162,13 +8162,13 @@ discard block |
||
| 8162 | 8162 | } |
| 8163 | 8163 | |
| 8164 | 8164 | // Set url and param to call to get json of the search results |
| 8165 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8166 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8165 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8166 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8167 | 8167 | |
| 8168 | 8168 | // Activate the auto complete using ajax call. |
| 8169 | 8169 | $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0, array()); |
| 8170 | 8170 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8171 | - $out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />'; |
|
| 8171 | + $out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />'; |
|
| 8172 | 8172 | } else { |
| 8173 | 8173 | // Immediate load of table record. |
| 8174 | 8174 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8208,7 +8208,7 @@ discard block |
||
| 8208 | 8208 | if ($prefixforautocompletemode == 'societe') { |
| 8209 | 8209 | $prefixforautocompletemode = 'company'; |
| 8210 | 8210 | } |
| 8211 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8211 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8212 | 8212 | |
| 8213 | 8213 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8214 | 8214 | $tmpfieldstoshow = ''; |
@@ -8217,7 +8217,7 @@ discard block |
||
| 8217 | 8217 | continue; |
| 8218 | 8218 | } |
| 8219 | 8219 | if (!empty($val['showoncombobox'])) { |
| 8220 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8220 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8221 | 8221 | } |
| 8222 | 8222 | } |
| 8223 | 8223 | if ($tmpfieldstoshow) { |
@@ -8245,18 +8245,18 @@ discard block |
||
| 8245 | 8245 | $num = 0; |
| 8246 | 8246 | |
| 8247 | 8247 | // Search data |
| 8248 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 8248 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 8249 | 8249 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8250 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8250 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8251 | 8251 | } |
| 8252 | 8252 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8253 | 8253 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8254 | 8254 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8255 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 8255 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 8256 | 8256 | } |
| 8257 | 8257 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8258 | 8258 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8259 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8259 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8260 | 8260 | } |
| 8261 | 8261 | } |
| 8262 | 8262 | } |
@@ -8276,21 +8276,21 @@ discard block |
||
| 8276 | 8276 | $sql .= " WHERE 1=1"; |
| 8277 | 8277 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8278 | 8278 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8279 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8279 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8280 | 8280 | } |
| 8281 | 8281 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8282 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 8282 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 8283 | 8283 | } |
| 8284 | 8284 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8285 | 8285 | if ($objecttmp->element == 'societe') { |
| 8286 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8286 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8287 | 8287 | } else { |
| 8288 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8288 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8289 | 8289 | } |
| 8290 | 8290 | } |
| 8291 | 8291 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8292 | 8292 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8293 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8293 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8294 | 8294 | } |
| 8295 | 8295 | } |
| 8296 | 8296 | } |
@@ -8302,7 +8302,7 @@ discard block |
||
| 8302 | 8302 | $errormessage = ''; |
| 8303 | 8303 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8304 | 8304 | if ($errormessage) { |
| 8305 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8305 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8306 | 8306 | } |
| 8307 | 8307 | } |
| 8308 | 8308 | } |
@@ -8314,7 +8314,7 @@ discard block |
||
| 8314 | 8314 | $resql = $this->db->query($sql); |
| 8315 | 8315 | if ($resql) { |
| 8316 | 8316 | // Construct $out and $outarray |
| 8317 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8317 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8318 | 8318 | |
| 8319 | 8319 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8320 | 8320 | $textifempty = ' '; |
@@ -8328,7 +8328,7 @@ discard block |
||
| 8328 | 8328 | } |
| 8329 | 8329 | } |
| 8330 | 8330 | if ($showempty) { |
| 8331 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8331 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8332 | 8332 | } |
| 8333 | 8333 | |
| 8334 | 8334 | $num = $this->db->num_rows($resql); |
@@ -8351,9 +8351,9 @@ discard block |
||
| 8351 | 8351 | } |
| 8352 | 8352 | if (empty($outputmode)) { |
| 8353 | 8353 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8354 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8354 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8355 | 8355 | } else { |
| 8356 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8356 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8357 | 8357 | } |
| 8358 | 8358 | } else { |
| 8359 | 8359 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8366,10 +8366,10 @@ discard block |
||
| 8366 | 8366 | } |
| 8367 | 8367 | } |
| 8368 | 8368 | |
| 8369 | - $out .= '</select>' . "\n"; |
|
| 8369 | + $out .= '</select>'."\n"; |
|
| 8370 | 8370 | |
| 8371 | 8371 | if (!$forcecombo) { |
| 8372 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8372 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8373 | 8373 | $out .= ajax_combobox($htmlname, null, getDolGlobalInt($confkeyforautocompletemode, 0)); |
| 8374 | 8374 | } |
| 8375 | 8375 | } else { |
@@ -8431,8 +8431,8 @@ discard block |
||
| 8431 | 8431 | } |
| 8432 | 8432 | } |
| 8433 | 8433 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8434 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8435 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8434 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8435 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8436 | 8436 | $out .= '>'."\n"; |
| 8437 | 8437 | |
| 8438 | 8438 | if ($show_empty) { |
@@ -8443,7 +8443,7 @@ discard block |
||
| 8443 | 8443 | if (!is_numeric($show_empty)) { |
| 8444 | 8444 | $textforempty = $show_empty; |
| 8445 | 8445 | } |
| 8446 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8446 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8447 | 8447 | } |
| 8448 | 8448 | if (is_array($array)) { |
| 8449 | 8449 | // Translate |
@@ -8466,7 +8466,7 @@ discard block |
||
| 8466 | 8466 | if (is_array($tmpvalue)) { |
| 8467 | 8467 | $value = $tmpvalue['label']; |
| 8468 | 8468 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8469 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8469 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8470 | 8470 | } else { |
| 8471 | 8471 | $value = $tmpvalue; |
| 8472 | 8472 | $disabled = ''; |
@@ -8481,9 +8481,9 @@ discard block |
||
| 8481 | 8481 | } |
| 8482 | 8482 | if ($key_in_label) { |
| 8483 | 8483 | if (empty($nohtmlescape)) { |
| 8484 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8484 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8485 | 8485 | } else { |
| 8486 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8486 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8487 | 8487 | } |
| 8488 | 8488 | } else { |
| 8489 | 8489 | if (empty($nohtmlescape)) { |
@@ -8495,8 +8495,8 @@ discard block |
||
| 8495 | 8495 | $selectOptionValue = ' '; |
| 8496 | 8496 | } |
| 8497 | 8497 | } |
| 8498 | - $out .= '<option value="' . $key . '"'; |
|
| 8499 | - $out .= $style . $disabled; |
|
| 8498 | + $out .= '<option value="'.$key.'"'; |
|
| 8499 | + $out .= $style.$disabled; |
|
| 8500 | 8500 | if (is_array($id)) { |
| 8501 | 8501 | if (in_array($key, $id) && !$disabled) { |
| 8502 | 8502 | $out .= ' selected'; // To preselect a value |
@@ -8508,7 +8508,7 @@ discard block |
||
| 8508 | 8508 | } |
| 8509 | 8509 | } |
| 8510 | 8510 | if ($nohtmlescape) { |
| 8511 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 8511 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 8512 | 8512 | } |
| 8513 | 8513 | if (is_array($tmpvalue)) { |
| 8514 | 8514 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
@@ -8526,7 +8526,7 @@ discard block |
||
| 8526 | 8526 | // Add code for jquery to use multiselect |
| 8527 | 8527 | if ($addjscombo && $jsbeautify) { |
| 8528 | 8528 | // Enhance with select2 |
| 8529 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8529 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8530 | 8530 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 8531 | 8531 | } |
| 8532 | 8532 | |
@@ -8554,28 +8554,28 @@ discard block |
||
| 8554 | 8554 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 8555 | 8555 | { |
| 8556 | 8556 | global $conf, $langs; |
| 8557 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8557 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8558 | 8558 | |
| 8559 | 8559 | // TODO Use an internal dolibarr component instead of select2 |
| 8560 | 8560 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8561 | 8561 | return ''; |
| 8562 | 8562 | } |
| 8563 | 8563 | |
| 8564 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 8564 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 8565 | 8565 | |
| 8566 | 8566 | $outdelayed = ''; |
| 8567 | 8567 | if (!empty($conf->use_javascript_ajax)) { |
| 8568 | 8568 | $tmpplugin = 'select2'; |
| 8569 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8570 | - <script nonce="' . getNonce() . '"> |
|
| 8569 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8570 | + <script nonce="' . getNonce().'"> |
|
| 8571 | 8571 | $(document).ready(function () { |
| 8572 | 8572 | |
| 8573 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 8573 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 8574 | 8574 | |
| 8575 | - $(".' . $htmlname . '").select2({ |
|
| 8575 | + $(".' . $htmlname.'").select2({ |
|
| 8576 | 8576 | ajax: { |
| 8577 | 8577 | dir: "ltr", |
| 8578 | - url: "' . $url . '", |
|
| 8578 | + url: "' . $url.'", |
|
| 8579 | 8579 | dataType: \'json\', |
| 8580 | 8580 | delay: 250, |
| 8581 | 8581 | data: function (params) { |
@@ -8602,9 +8602,9 @@ discard block |
||
| 8602 | 8602 | }, |
| 8603 | 8603 | language: select2arrayoflanguage, |
| 8604 | 8604 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8605 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8605 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8606 | 8606 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8607 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 8607 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 8608 | 8608 | formatResult: function (result, container, query, escapeMarkup) { |
| 8609 | 8609 | return escapeMarkup(result.text); |
| 8610 | 8610 | }, |
@@ -8612,10 +8612,10 @@ discard block |
||
| 8612 | 8612 | |
| 8613 | 8613 | ' . ($callurlonselect ? ' |
| 8614 | 8614 | /* Code to execute a GET when we select a value */ |
| 8615 | - $(".' . $htmlname . '").change(function() { |
|
| 8616 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8615 | + $(".' . $htmlname.'").change(function() { |
|
| 8616 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8617 | 8617 | console.log("We select in selectArrayAjax the entry "+selected) |
| 8618 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8618 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8619 | 8619 | $.each( saveRemoteData, function( key, value ) { |
| 8620 | 8620 | if (key == selected) |
| 8621 | 8621 | { |
@@ -8623,7 +8623,7 @@ discard block |
||
| 8623 | 8623 | location.assign(value.url); |
| 8624 | 8624 | } |
| 8625 | 8625 | }); |
| 8626 | - });' : '') . ' |
|
| 8626 | + });' : '').' |
|
| 8627 | 8627 | |
| 8628 | 8628 | }); |
| 8629 | 8629 | </script>'; |
@@ -8659,14 +8659,14 @@ discard block |
||
| 8659 | 8659 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 8660 | 8660 | { |
| 8661 | 8661 | global $conf, $langs; |
| 8662 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8662 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8663 | 8663 | |
| 8664 | 8664 | // TODO Use an internal dolibarr component instead of select2 |
| 8665 | 8665 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8666 | 8666 | return ''; |
| 8667 | 8667 | } |
| 8668 | 8668 | |
| 8669 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8669 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8670 | 8670 | |
| 8671 | 8671 | $formattedarrayresult = array(); |
| 8672 | 8672 | |
@@ -8681,20 +8681,20 @@ discard block |
||
| 8681 | 8681 | $outdelayed = ''; |
| 8682 | 8682 | if (!empty($conf->use_javascript_ajax)) { |
| 8683 | 8683 | $tmpplugin = 'select2'; |
| 8684 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8685 | - <script nonce="' . getNonce() . '"> |
|
| 8684 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8685 | + <script nonce="' . getNonce().'"> |
|
| 8686 | 8686 | $(document).ready(function () { |
| 8687 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 8687 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 8688 | 8688 | |
| 8689 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 8689 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 8690 | 8690 | |
| 8691 | - $(".' . $htmlname . '").select2({ |
|
| 8691 | + $(".' . $htmlname.'").select2({ |
|
| 8692 | 8692 | data: data, |
| 8693 | 8693 | language: select2arrayoflanguage, |
| 8694 | 8694 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8695 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8695 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8696 | 8696 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8697 | - minimumInputLength: ' . $minimumInputLength . ', |
|
| 8697 | + minimumInputLength: ' . $minimumInputLength.', |
|
| 8698 | 8698 | formatResult: function (result, container, query, escapeMarkup) { |
| 8699 | 8699 | return escapeMarkup(result.text); |
| 8700 | 8700 | }, |
@@ -8733,11 +8733,11 @@ discard block |
||
| 8733 | 8733 | |
| 8734 | 8734 | ' . ($callurlonselect ? ' |
| 8735 | 8735 | /* Code to execute a GET when we select a value */ |
| 8736 | - $(".' . $htmlname . '").change(function() { |
|
| 8737 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8736 | + $(".' . $htmlname.'").change(function() { |
|
| 8737 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8738 | 8738 | console.log("We select "+selected) |
| 8739 | 8739 | |
| 8740 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8740 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8741 | 8741 | $.each( saveRemoteData, function( key, value ) { |
| 8742 | 8742 | if (key == selected) |
| 8743 | 8743 | { |
@@ -8745,7 +8745,7 @@ discard block |
||
| 8745 | 8745 | location.assign(value.url); |
| 8746 | 8746 | } |
| 8747 | 8747 | }); |
| 8748 | - });' : '') . ' |
|
| 8748 | + });' : '').' |
|
| 8749 | 8749 | |
| 8750 | 8750 | }); |
| 8751 | 8751 | </script>'; |
@@ -8794,7 +8794,7 @@ discard block |
||
| 8794 | 8794 | $useenhancedmultiselect = 0; |
| 8795 | 8795 | if (!empty($conf->use_javascript_ajax) && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 8796 | 8796 | if ($addjscombo) { |
| 8797 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 8797 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 8798 | 8798 | } |
| 8799 | 8799 | } |
| 8800 | 8800 | |
@@ -8803,7 +8803,7 @@ discard block |
||
| 8803 | 8803 | // submitted to nothing. |
| 8804 | 8804 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
| 8805 | 8805 | // Output select component |
| 8806 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
| 8806 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
| 8807 | 8807 | if (is_array($array) && !empty($array)) { |
| 8808 | 8808 | if ($value_as_key) { |
| 8809 | 8809 | $array = array_combine($array, $array); |
@@ -8824,57 +8824,57 @@ discard block |
||
| 8824 | 8824 | $tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml']; |
| 8825 | 8825 | } |
| 8826 | 8826 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 8827 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 8827 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 8828 | 8828 | |
| 8829 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 8829 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 8830 | 8830 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 8831 | 8831 | $out .= ' selected'; |
| 8832 | 8832 | } |
| 8833 | 8833 | if (!empty($tmplabelhtml)) { |
| 8834 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8834 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8835 | 8835 | } else { |
| 8836 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 8837 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8836 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 8837 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8838 | 8838 | } |
| 8839 | 8839 | $out .= '>'; |
| 8840 | 8840 | $out .= dol_htmlentitiesbr($newval); |
| 8841 | - $out .= '</option>' . "\n"; |
|
| 8841 | + $out .= '</option>'."\n"; |
|
| 8842 | 8842 | } |
| 8843 | 8843 | } |
| 8844 | 8844 | } |
| 8845 | - $out .= '</select>' . "\n"; |
|
| 8845 | + $out .= '</select>'."\n"; |
|
| 8846 | 8846 | |
| 8847 | 8847 | // Add code for jquery to use multiselect |
| 8848 | 8848 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8849 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 8850 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 8849 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 8850 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 8851 | 8851 | if ($addjscombo == 1) { |
| 8852 | 8852 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 8853 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 8853 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 8854 | 8854 | // If property html set, we decode html entities and use this. |
| 8855 | 8855 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 8856 | 8856 | $out .= ' if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n"; |
| 8857 | 8857 | $out .= ' return record.text;'; |
| 8858 | - $out .= '}' . "\n"; |
|
| 8859 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 8858 | + $out .= '}'."\n"; |
|
| 8859 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 8860 | 8860 | if ($elemtype == 'category') { |
| 8861 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8861 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8862 | 8862 | } else { |
| 8863 | 8863 | $out .= 'return record.text;'; |
| 8864 | 8864 | } |
| 8865 | - $out .= '}' . "\n"; |
|
| 8865 | + $out .= '}'."\n"; |
|
| 8866 | 8866 | $out .= '$(document).ready(function () { |
| 8867 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
| 8867 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
| 8868 | 8868 | if ($placeholder) { |
| 8869 | 8869 | $out .= ' |
| 8870 | 8870 | placeholder: { |
| 8871 | 8871 | id: \'-1\', |
| 8872 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 8872 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 8873 | 8873 | },'; |
| 8874 | 8874 | } |
| 8875 | 8875 | $out .= ' dir: \'ltr\', |
| 8876 | 8876 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 8877 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
| 8877 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
| 8878 | 8878 | // Specify format function for dropdown item |
| 8879 | 8879 | formatResult: formatResult, |
| 8880 | 8880 | templateResult: formatResult, /* For 4.0 */ |
@@ -8886,21 +8886,21 @@ discard block |
||
| 8886 | 8886 | |
| 8887 | 8887 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 8888 | 8888 | the size only if component is not hidden by default on load */ |
| 8889 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
| 8889 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
| 8890 | 8890 | });' . "\n"; |
| 8891 | 8891 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 8892 | 8892 | // Add other js lib |
| 8893 | 8893 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 8894 | 8894 | // ... |
| 8895 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
| 8895 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
| 8896 | 8896 | $out .= '$(document).ready(function () { |
| 8897 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
| 8897 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
| 8898 | 8898 | containerHTML: \'<div class="multi-select-container">\', |
| 8899 | 8899 | menuHTML: \'<div class="multi-select-menu">\', |
| 8900 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
| 8900 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
| 8901 | 8901 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 8902 | 8902 | activeClass: \'multi-select-container--open\', |
| 8903 | - noneText: \'' . $placeholder . '\' |
|
| 8903 | + noneText: \'' . $placeholder.'\' |
|
| 8904 | 8904 | }); |
| 8905 | 8905 | })'; |
| 8906 | 8906 | } |
@@ -8932,7 +8932,7 @@ discard block |
||
| 8932 | 8932 | return ''; |
| 8933 | 8933 | } |
| 8934 | 8934 | |
| 8935 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 8935 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 8936 | 8936 | |
| 8937 | 8937 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 8938 | 8938 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -8975,19 +8975,19 @@ discard block |
||
| 8975 | 8975 | } |
| 8976 | 8976 | |
| 8977 | 8977 | // Note: $val['checked'] <> 0 means we must show the field into the combo list |
| 8978 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
| 8979 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 8978 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
| 8979 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 8980 | 8980 | } |
| 8981 | 8981 | } |
| 8982 | 8982 | |
| 8983 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 8983 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 8984 | 8984 | |
| 8985 | 8985 | <dl class="dropdown"> |
| 8986 | 8986 | <dt> |
| 8987 | - <a href="#' . $htmlname . '"> |
|
| 8988 | - ' . img_picto('', 'list') . ' |
|
| 8987 | + <a href="#' . $htmlname.'"> |
|
| 8988 | + ' . img_picto('', 'list').' |
|
| 8989 | 8989 | </a> |
| 8990 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 8990 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 8991 | 8991 | </dt> |
| 8992 | 8992 | <dd class="dropdowndd"> |
| 8993 | 8993 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -8999,19 +8999,19 @@ discard block |
||
| 8999 | 8999 | </dd> |
| 9000 | 9000 | </dl> |
| 9001 | 9001 | |
| 9002 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 9002 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 9003 | 9003 | jQuery(document).ready(function () { |
| 9004 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9004 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9005 | 9005 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 9006 | 9006 | |
| 9007 | 9007 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 9008 | 9008 | |
| 9009 | 9009 | var title = $(this).val() + ","; |
| 9010 | 9010 | if ($(this).is(\':checked\')) { |
| 9011 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 9011 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 9012 | 9012 | } |
| 9013 | 9013 | else { |
| 9014 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 9014 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 9015 | 9015 | } |
| 9016 | 9016 | // Now, we submit page |
| 9017 | 9017 | //$(this).parents(\'form:first\').submit(); |
@@ -9042,7 +9042,7 @@ discard block |
||
| 9042 | 9042 | */ |
| 9043 | 9043 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 9044 | 9044 | { |
| 9045 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 9045 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 9046 | 9046 | |
| 9047 | 9047 | $cat = new Categorie($this->db); |
| 9048 | 9048 | $categories = $cat->containing($id, $type); |
@@ -9052,10 +9052,10 @@ discard block |
||
| 9052 | 9052 | foreach ($categories as $c) { |
| 9053 | 9053 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 9054 | 9054 | foreach ($ways as $way) { |
| 9055 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 9055 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 9056 | 9056 | } |
| 9057 | 9057 | } |
| 9058 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 9058 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 9059 | 9059 | } |
| 9060 | 9060 | |
| 9061 | 9061 | if ($rendermode == 0) { |
@@ -9103,15 +9103,15 @@ discard block |
||
| 9103 | 9103 | |
| 9104 | 9104 | |
| 9105 | 9105 | print '<div class="div-table-responsive-no-min">'; |
| 9106 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 9106 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 9107 | 9107 | |
| 9108 | 9108 | print '<tr class="liste_titre">'; |
| 9109 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 9110 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9109 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 9110 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9111 | 9111 | print '<td class="center"></td>'; |
| 9112 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 9113 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9114 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 9112 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 9113 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9114 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 9115 | 9115 | print '<td></td>'; |
| 9116 | 9116 | print '</tr>'; |
| 9117 | 9117 | |
@@ -9130,13 +9130,13 @@ discard block |
||
| 9130 | 9130 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 9131 | 9131 | $element = $regs[1]; |
| 9132 | 9132 | $subelement = $regs[2]; |
| 9133 | - $tplpath = $element . '/' . $subelement; |
|
| 9133 | + $tplpath = $element.'/'.$subelement; |
|
| 9134 | 9134 | } |
| 9135 | 9135 | $tplname = 'linkedobjectblock'; |
| 9136 | 9136 | |
| 9137 | 9137 | // To work with non standard path |
| 9138 | 9138 | if ($objecttype == 'facture') { |
| 9139 | - $tplpath = 'compta/' . $element; |
|
| 9139 | + $tplpath = 'compta/'.$element; |
|
| 9140 | 9140 | if (!isModEnabled('facture')) { |
| 9141 | 9141 | continue; // Do not show if module disabled |
| 9142 | 9142 | } |
@@ -9147,7 +9147,7 @@ discard block |
||
| 9147 | 9147 | continue; // Do not show if module disabled |
| 9148 | 9148 | } |
| 9149 | 9149 | } elseif ($objecttype == 'propal') { |
| 9150 | - $tplpath = 'comm/' . $element; |
|
| 9150 | + $tplpath = 'comm/'.$element; |
|
| 9151 | 9151 | if (!isModEnabled('propal')) { |
| 9152 | 9152 | continue; // Do not show if module disabled |
| 9153 | 9153 | } |
@@ -9198,14 +9198,14 @@ discard block |
||
| 9198 | 9198 | $linkedObjectBlock = $objects; |
| 9199 | 9199 | |
| 9200 | 9200 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9201 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9201 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9202 | 9202 | foreach ($dirtpls as $reldir) { |
| 9203 | 9203 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
| 9204 | 9204 | global $noMoreLinkedObjectBlockAfter; |
| 9205 | 9205 | $noMoreLinkedObjectBlockAfter = 1; |
| 9206 | 9206 | } |
| 9207 | 9207 | |
| 9208 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9208 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9209 | 9209 | if ($res) { |
| 9210 | 9210 | $nboftypesoutput++; |
| 9211 | 9211 | break; |
@@ -9214,7 +9214,7 @@ discard block |
||
| 9214 | 9214 | } |
| 9215 | 9215 | |
| 9216 | 9216 | if (!$nboftypesoutput) { |
| 9217 | - print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9217 | + print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9218 | 9218 | } |
| 9219 | 9219 | |
| 9220 | 9220 | print '</table>'; |
@@ -9254,14 +9254,14 @@ discard block |
||
| 9254 | 9254 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9255 | 9255 | $listofidcompanytoscan = $object->thirdparty->id; |
| 9256 | 9256 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
| 9257 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
| 9257 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
| 9258 | 9258 | } |
| 9259 | 9259 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
| 9260 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9260 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9261 | 9261 | $tmpproject = new Project($this->db); |
| 9262 | 9262 | $tmpproject->fetch($object->fk_project); |
| 9263 | 9263 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9264 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
| 9264 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
| 9265 | 9265 | } |
| 9266 | 9266 | unset($tmpproject); |
| 9267 | 9267 | } |
@@ -9271,63 +9271,63 @@ discard block |
||
| 9271 | 9271 | 'enabled' => isModEnabled('propal'), |
| 9272 | 9272 | 'perms' => 1, |
| 9273 | 9273 | 'label' => 'LinkToProposal', |
| 9274 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), |
|
| 9274 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'), |
|
| 9275 | 9275 | 'shipping' => array( |
| 9276 | 9276 | 'enabled' => isModEnabled('expedition'), |
| 9277 | 9277 | 'perms' => 1, |
| 9278 | 9278 | 'label' => 'LinkToExpedition', |
| 9279 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), |
|
| 9279 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'), |
|
| 9280 | 9280 | 'order' => array( |
| 9281 | 9281 | 'enabled' => isModEnabled('commande'), |
| 9282 | 9282 | 'perms' => 1, |
| 9283 | 9283 | 'label' => 'LinkToOrder', |
| 9284 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), |
|
| 9284 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), |
|
| 9285 | 9285 | 'invoice' => array( |
| 9286 | 9286 | 'enabled' => isModEnabled('facture'), |
| 9287 | 9287 | 'perms' => 1, |
| 9288 | 9288 | 'label' => 'LinkToInvoice', |
| 9289 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9289 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9290 | 9290 | 'invoice_template' => array( |
| 9291 | 9291 | 'enabled' => isModEnabled('facture'), |
| 9292 | 9292 | 'perms' => 1, |
| 9293 | 9293 | 'label' => 'LinkToTemplateInvoice', |
| 9294 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), |
|
| 9294 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), |
|
| 9295 | 9295 | 'contrat' => array( |
| 9296 | 9296 | 'enabled' => isModEnabled('contrat'), |
| 9297 | 9297 | 'perms' => 1, |
| 9298 | 9298 | 'label' => 'LinkToContract', |
| 9299 | 9299 | 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht |
| 9300 | - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9300 | + FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' |
|
| 9301 | 9301 | ), |
| 9302 | 9302 | 'fichinter' => array( |
| 9303 | 9303 | 'enabled' => isModEnabled('ficheinter'), |
| 9304 | 9304 | 'perms' => 1, |
| 9305 | 9305 | 'label' => 'LinkToIntervention', |
| 9306 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), |
|
| 9306 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), |
|
| 9307 | 9307 | 'supplier_proposal' => array( |
| 9308 | 9308 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9309 | 9309 | 'perms' => 1, |
| 9310 | 9310 | 'label' => 'LinkToSupplierProposal', |
| 9311 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'), |
|
| 9311 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), |
|
| 9312 | 9312 | 'order_supplier' => array( |
| 9313 | 9313 | 'enabled' => isModEnabled("supplier_order"), |
| 9314 | 9314 | 'perms' => 1, |
| 9315 | 9315 | 'label' => 'LinkToSupplierOrder', |
| 9316 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'), |
|
| 9316 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), |
|
| 9317 | 9317 | 'invoice_supplier' => array( |
| 9318 | 9318 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9319 | 9319 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9320 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'), |
|
| 9320 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), |
|
| 9321 | 9321 | 'ticket' => array( |
| 9322 | 9322 | 'enabled' => isModEnabled('ticket'), |
| 9323 | 9323 | 'perms' => 1, |
| 9324 | 9324 | 'label' => 'LinkToTicket', |
| 9325 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'), |
|
| 9325 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), |
|
| 9326 | 9326 | 'mo' => array( |
| 9327 | 9327 | 'enabled' => isModEnabled('mrp'), |
| 9328 | 9328 | 'perms' => 1, |
| 9329 | 9329 | 'label' => 'LinkToMo', |
| 9330 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')') |
|
| 9330 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') |
|
| 9331 | 9331 | ); |
| 9332 | 9332 | } |
| 9333 | 9333 | |
@@ -9362,22 +9362,22 @@ discard block |
||
| 9362 | 9362 | } |
| 9363 | 9363 | |
| 9364 | 9364 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9365 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9365 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9366 | 9366 | |
| 9367 | 9367 | if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9368 | 9368 | print '<br>'."\n"; |
| 9369 | 9369 | print '<!-- form to add a link from anywhere -->'."\n"; |
| 9370 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9371 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9370 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9371 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9372 | 9372 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9373 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9374 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9373 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9374 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9375 | 9375 | print '<table class="noborder">'; |
| 9376 | 9376 | print '<tr>'; |
| 9377 | 9377 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9378 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9379 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9380 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9378 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9379 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9380 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9381 | 9381 | print '</tr>'; |
| 9382 | 9382 | print '</table>'; |
| 9383 | 9383 | print '</form>'; |
@@ -9392,48 +9392,48 @@ discard block |
||
| 9392 | 9392 | |
| 9393 | 9393 | print '<br>'; |
| 9394 | 9394 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9395 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9395 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9396 | 9396 | print '<input type="hidden" name="action" value="addlink">'; |
| 9397 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9398 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9399 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9397 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9398 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9399 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9400 | 9400 | print '<table class="noborder">'; |
| 9401 | 9401 | print '<tr class="liste_titre">'; |
| 9402 | 9402 | print '<td class="nowrap"></td>'; |
| 9403 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
| 9404 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9405 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9406 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
| 9403 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
| 9404 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
| 9405 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9406 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
| 9407 | 9407 | print '</tr>'; |
| 9408 | 9408 | while ($i < $num) { |
| 9409 | 9409 | $objp = $this->db->fetch_object($resqllist); |
| 9410 | 9410 | |
| 9411 | 9411 | print '<tr class="oddeven">'; |
| 9412 | 9412 | print '<td class="left">'; |
| 9413 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9413 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9414 | 9414 | print '</td>'; |
| 9415 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9416 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9415 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9416 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9417 | 9417 | print '<td class="right">'; |
| 9418 | 9418 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9419 | 9419 | $form = new Form($this->db); |
| 9420 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9420 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9421 | 9421 | } |
| 9422 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9422 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9423 | 9423 | print '</td>'; |
| 9424 | - print '<td>' . $objp->name . '</td>'; |
|
| 9424 | + print '<td>'.$objp->name.'</td>'; |
|
| 9425 | 9425 | print '</tr>'; |
| 9426 | 9426 | $i++; |
| 9427 | 9427 | } |
| 9428 | 9428 | print '</table>'; |
| 9429 | 9429 | print '<div class="center">'; |
| 9430 | 9430 | if ($num) { |
| 9431 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
| 9431 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
| 9432 | 9432 | } |
| 9433 | 9433 | if (empty($conf->use_javascript_ajax)) { |
| 9434 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9434 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9435 | 9435 | } else { |
| 9436 | - print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9436 | + print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9437 | 9437 | } |
| 9438 | 9438 | print '</form>'; |
| 9439 | 9439 | $this->db->free($resqllist); |
@@ -9444,10 +9444,10 @@ discard block |
||
| 9444 | 9444 | |
| 9445 | 9445 | //$linktoelem.=($linktoelem?' ':''); |
| 9446 | 9446 | if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9447 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 9447 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 9448 | 9448 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 9449 | 9449 | } else { |
| 9450 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 9450 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 9451 | 9451 | } |
| 9452 | 9452 | } |
| 9453 | 9453 | } |
@@ -9457,11 +9457,11 @@ discard block |
||
| 9457 | 9457 | <dl class="dropdown" id="linktoobjectname"> |
| 9458 | 9458 | '; |
| 9459 | 9459 | if (!empty($conf->use_javascript_ajax)) { |
| 9460 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 9460 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 9461 | 9461 | } |
| 9462 | 9462 | $linktoelem .= '<dd> |
| 9463 | 9463 | <div class="multiselectlinkto"> |
| 9464 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 9464 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 9465 | 9465 | </ul> |
| 9466 | 9466 | </div> |
| 9467 | 9467 | </dd> |
@@ -9472,7 +9472,7 @@ discard block |
||
| 9472 | 9472 | |
| 9473 | 9473 | if (!empty($conf->use_javascript_ajax)) { |
| 9474 | 9474 | print '<!-- Add js to show linkto box --> |
| 9475 | - <script nonce="' . getNonce() . '"> |
|
| 9475 | + <script nonce="' . getNonce().'"> |
|
| 9476 | 9476 | jQuery(document).ready(function() { |
| 9477 | 9477 | jQuery(".linkto").click(function() { |
| 9478 | 9478 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9513,19 +9513,19 @@ discard block |
||
| 9513 | 9513 | |
| 9514 | 9514 | $disabled = ($disabled ? ' disabled' : ''); |
| 9515 | 9515 | |
| 9516 | - $resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 9516 | + $resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 9517 | 9517 | if ($useempty) { |
| 9518 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9518 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 9519 | 9519 | } |
| 9520 | 9520 | if (("$value" == 'yes') || ($value == 1)) { |
| 9521 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9522 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9521 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9522 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9523 | 9523 | } else { |
| 9524 | 9524 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 9525 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9526 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9525 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9526 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9527 | 9527 | } |
| 9528 | - $resultyesno .= '</select>' . "\n"; |
|
| 9528 | + $resultyesno .= '</select>'."\n"; |
|
| 9529 | 9529 | |
| 9530 | 9530 | if ($addjscombo) { |
| 9531 | 9531 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9549,12 +9549,12 @@ discard block |
||
| 9549 | 9549 | { |
| 9550 | 9550 | // phpcs:enable |
| 9551 | 9551 | $sql = "SELECT rowid, label"; |
| 9552 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 9553 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 9552 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 9553 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 9554 | 9554 | $sql .= " ORDER BY rowid"; |
| 9555 | 9555 | $result = $this->db->query($sql); |
| 9556 | 9556 | if ($result) { |
| 9557 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 9557 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 9558 | 9558 | if ($useempty) { |
| 9559 | 9559 | print '<option value="-1"> </option>'; |
| 9560 | 9560 | } |
@@ -9564,9 +9564,9 @@ discard block |
||
| 9564 | 9564 | while ($i < $num) { |
| 9565 | 9565 | $obj = $this->db->fetch_object($result); |
| 9566 | 9566 | if ($selected == $obj->rowid) { |
| 9567 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 9567 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 9568 | 9568 | } else { |
| 9569 | - print '<option value="' . $obj->rowid . '">'; |
|
| 9569 | + print '<option value="'.$obj->rowid.'">'; |
|
| 9570 | 9570 | } |
| 9571 | 9571 | print $obj->label; |
| 9572 | 9572 | print '</option>'; |
@@ -9656,8 +9656,8 @@ discard block |
||
| 9656 | 9656 | $stringforfirstkey .= ' CTL +'; |
| 9657 | 9657 | } |
| 9658 | 9658 | |
| 9659 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9660 | - $next_ref = $object->ref_next ? '<a accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9659 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
| 9660 | + $next_ref = $object->ref_next ? '<a accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
| 9661 | 9661 | } |
| 9662 | 9662 | |
| 9663 | 9663 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9665,18 +9665,18 @@ discard block |
||
| 9665 | 9665 | |
| 9666 | 9666 | // Right part of banner |
| 9667 | 9667 | if ($morehtmlright) { |
| 9668 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 9668 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 9669 | 9669 | } |
| 9670 | 9670 | |
| 9671 | 9671 | if ($previous_ref || $next_ref || $morehtml) { |
| 9672 | 9672 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 9673 | 9673 | } |
| 9674 | 9674 | if ($morehtml) { |
| 9675 | - $ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 9675 | + $ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 9676 | 9676 | } |
| 9677 | 9677 | if ($shownav && ($previous_ref || $next_ref)) { |
| 9678 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 9679 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 9678 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 9679 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 9680 | 9680 | } |
| 9681 | 9681 | if ($previous_ref || $next_ref || $morehtml) { |
| 9682 | 9682 | $ret .= '</ul></div>'; |
@@ -9691,7 +9691,7 @@ discard block |
||
| 9691 | 9691 | $morehtmlstatus = $hookmanager->resPrint; |
| 9692 | 9692 | } |
| 9693 | 9693 | if ($morehtmlstatus) { |
| 9694 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 9694 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 9695 | 9695 | } |
| 9696 | 9696 | |
| 9697 | 9697 | $parameters = array(); |
@@ -9705,14 +9705,14 @@ discard block |
||
| 9705 | 9705 | // Left part of banner |
| 9706 | 9706 | if ($morehtmlleft) { |
| 9707 | 9707 | if ($conf->browser->layout == 'phone') { |
| 9708 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 9708 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 9709 | 9709 | } else { |
| 9710 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 9710 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 9711 | 9711 | } |
| 9712 | 9712 | } |
| 9713 | 9713 | |
| 9714 | 9714 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 9715 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 9715 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 9716 | 9716 | |
| 9717 | 9717 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 9718 | 9718 | if ($object->element == 'societe') { |
@@ -9726,7 +9726,7 @@ discard block |
||
| 9726 | 9726 | |
| 9727 | 9727 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 9728 | 9728 | if (!is_object($extralanguages)) { |
| 9729 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 9729 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 9730 | 9730 | $extralanguages = new ExtraLanguages($this->db); |
| 9731 | 9731 | } |
| 9732 | 9732 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -9741,27 +9741,27 @@ discard block |
||
| 9741 | 9741 | if ($object->array_languages['name'][$extralangcode]) { |
| 9742 | 9742 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 9743 | 9743 | } else { |
| 9744 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 9744 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 9745 | 9745 | } |
| 9746 | 9746 | } |
| 9747 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 9747 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 9748 | 9748 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 9749 | 9749 | } |
| 9750 | 9750 | } |
| 9751 | 9751 | } elseif ($object->element == 'member') { |
| 9752 | - $ret .= $object->ref . '<br>'; |
|
| 9752 | + $ret .= $object->ref.'<br>'; |
|
| 9753 | 9753 | $fullname = $object->getFullName($langs); |
| 9754 | 9754 | if ($object->morphy == 'mor' && $object->societe) { |
| 9755 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 9755 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 9756 | 9756 | } else { |
| 9757 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 9757 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 9758 | 9758 | } |
| 9759 | 9759 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 9760 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
| 9760 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
| 9761 | 9761 | } elseif ($object->element == 'usergroup') { |
| 9762 | 9762 | $ret .= dol_htmlentities($object->name); |
| 9763 | 9763 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 9764 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 9764 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 9765 | 9765 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 9766 | 9766 | $ret .= $object->label; |
| 9767 | 9767 | } elseif ($object->element == 'ecm_directories') { |
@@ -9813,9 +9813,9 @@ discard block |
||
| 9813 | 9813 | } |
| 9814 | 9814 | |
| 9815 | 9815 | // Barcode image |
| 9816 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 9817 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 9818 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 9816 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 9817 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 9818 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 9819 | 9819 | |
| 9820 | 9820 | return $out; |
| 9821 | 9821 | } |
@@ -9856,28 +9856,28 @@ discard block |
||
| 9856 | 9856 | if (!empty($object->logo)) { |
| 9857 | 9857 | if (dolIsAllowedForPreview($object->logo)) { |
| 9858 | 9858 | if ((string) $imagesize == 'mini') { |
| 9859 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9859 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9860 | 9860 | } elseif ((string) $imagesize == 'small') { |
| 9861 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 9861 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 9862 | 9862 | } else { |
| 9863 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9863 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9864 | 9864 | } |
| 9865 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9865 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9866 | 9866 | } |
| 9867 | 9867 | } |
| 9868 | 9868 | $email = $object->email; |
| 9869 | 9869 | } elseif ($modulepart == 'contact') { |
| 9870 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 9870 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 9871 | 9871 | if (!empty($object->photo)) { |
| 9872 | 9872 | if (dolIsAllowedForPreview($object->photo)) { |
| 9873 | 9873 | if ((string) $imagesize == 'mini') { |
| 9874 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9874 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9875 | 9875 | } elseif ((string) $imagesize == 'small') { |
| 9876 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9876 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9877 | 9877 | } else { |
| 9878 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9878 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9879 | 9879 | } |
| 9880 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9880 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9881 | 9881 | } |
| 9882 | 9882 | } |
| 9883 | 9883 | $email = $object->email; |
@@ -9887,17 +9887,17 @@ discard block |
||
| 9887 | 9887 | if (!empty($object->photo)) { |
| 9888 | 9888 | if (dolIsAllowedForPreview($object->photo)) { |
| 9889 | 9889 | if ((string) $imagesize == 'mini') { |
| 9890 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9890 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9891 | 9891 | } elseif ((string) $imagesize == 'small') { |
| 9892 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9892 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9893 | 9893 | } else { |
| 9894 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9894 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9895 | 9895 | } |
| 9896 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9896 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9897 | 9897 | } |
| 9898 | 9898 | } |
| 9899 | 9899 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 9900 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9900 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9901 | 9901 | } |
| 9902 | 9902 | $email = $object->email; |
| 9903 | 9903 | $capture = 'user'; |
@@ -9906,17 +9906,17 @@ discard block |
||
| 9906 | 9906 | if (!empty($object->photo)) { |
| 9907 | 9907 | if (dolIsAllowedForPreview($object->photo)) { |
| 9908 | 9908 | if ((string) $imagesize == 'mini') { |
| 9909 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9909 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9910 | 9910 | } elseif ((string) $imagesize == 'small') { |
| 9911 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9911 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9912 | 9912 | } else { |
| 9913 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9913 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9914 | 9914 | } |
| 9915 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9915 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9916 | 9916 | } |
| 9917 | 9917 | } |
| 9918 | 9918 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 9919 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9919 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9920 | 9920 | } |
| 9921 | 9921 | $email = $object->email; |
| 9922 | 9922 | $capture = 'user'; |
@@ -9926,17 +9926,17 @@ discard block |
||
| 9926 | 9926 | if (!empty($object->photo)) { |
| 9927 | 9927 | if (dolIsAllowedForPreview($object->photo)) { |
| 9928 | 9928 | if ((string) $imagesize == 'mini') { |
| 9929 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9929 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9930 | 9930 | } elseif ((string) $imagesize == 'small') { |
| 9931 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9931 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9932 | 9932 | } else { |
| 9933 | - $file = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
| 9933 | + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
| 9934 | 9934 | } |
| 9935 | - $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo; |
|
| 9935 | + $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; |
|
| 9936 | 9936 | } |
| 9937 | 9937 | } |
| 9938 | 9938 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 9939 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9939 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9940 | 9940 | } |
| 9941 | 9941 | $email = $object->email; |
| 9942 | 9942 | } |
@@ -9946,35 +9946,35 @@ discard block |
||
| 9946 | 9946 | } |
| 9947 | 9947 | |
| 9948 | 9948 | if ($dir) { |
| 9949 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 9949 | + if ($file && file_exists($dir."/".$file)) { |
|
| 9950 | 9950 | if ($addlinktofullsize) { |
| 9951 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9951 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9952 | 9952 | if ($urladvanced) { |
| 9953 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9953 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9954 | 9954 | } else { |
| 9955 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9955 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9956 | 9956 | } |
| 9957 | 9957 | } |
| 9958 | - $ret .= '<img alt="Photo" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">'; |
|
| 9958 | + $ret .= '<img alt="Photo" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; |
|
| 9959 | 9959 | if ($addlinktofullsize) { |
| 9960 | 9960 | $ret .= '</a>'; |
| 9961 | 9961 | } |
| 9962 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 9962 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 9963 | 9963 | if ($addlinktofullsize) { |
| 9964 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9964 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9965 | 9965 | if ($urladvanced) { |
| 9966 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9966 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9967 | 9967 | } else { |
| 9968 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9968 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9969 | 9969 | } |
| 9970 | 9970 | } |
| 9971 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">'; |
|
| 9971 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">'; |
|
| 9972 | 9972 | if ($addlinktofullsize) { |
| 9973 | 9973 | $ret .= '</a>'; |
| 9974 | 9974 | } |
| 9975 | 9975 | } else { |
| 9976 | 9976 | $nophoto = '/public/theme/common/nophoto.png'; |
| 9977 | - $defaultimg = 'identicon'; // For gravatar |
|
| 9977 | + $defaultimg = 'identicon'; // For gravatar |
|
| 9978 | 9978 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 9979 | 9979 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) { |
| 9980 | 9980 | $nophoto = 'company'; |
@@ -9992,13 +9992,13 @@ discard block |
||
| 9992 | 9992 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 9993 | 9993 | // see https://gravatar.com/site/implement/images/php/ |
| 9994 | 9994 | $ret .= '<!-- Put link to gravatar -->'; |
| 9995 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
| 9995 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
| 9996 | 9996 | } else { |
| 9997 | 9997 | if ($nophoto == 'company') { |
| 9998 | - $ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 9998 | + $ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 9999 | 9999 | $ret .= '<div class="difforspanimgright"></div>'; |
| 10000 | 10000 | } else { |
| 10001 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 10001 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 10002 | 10002 | } |
| 10003 | 10003 | } |
| 10004 | 10004 | } |
@@ -10009,15 +10009,15 @@ discard block |
||
| 10009 | 10009 | } |
| 10010 | 10010 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 10011 | 10011 | if ($object->photo) { |
| 10012 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 10012 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 10013 | 10013 | } |
| 10014 | 10014 | $ret .= '<tr><td class="tdoverflow">'; |
| 10015 | 10015 | $maxfilesizearray = getMaxFileSizeArray(); |
| 10016 | 10016 | $maxmin = $maxfilesizearray['maxmin']; |
| 10017 | 10017 | if ($maxmin > 0) { |
| 10018 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10018 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10019 | 10019 | } |
| 10020 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 10020 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 10021 | 10021 | $ret .= '</td></tr>'; |
| 10022 | 10022 | $ret .= '</table>'; |
| 10023 | 10023 | } |
@@ -10071,38 +10071,38 @@ discard block |
||
| 10071 | 10071 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10072 | 10072 | $sql .= ", e.label"; |
| 10073 | 10073 | } |
| 10074 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 10074 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 10075 | 10075 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10076 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 10076 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 10077 | 10077 | if ($force_entity) { |
| 10078 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 10078 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 10079 | 10079 | } else { |
| 10080 | 10080 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 10081 | 10081 | } |
| 10082 | 10082 | } else { |
| 10083 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 10083 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 10084 | 10084 | } |
| 10085 | 10085 | if (is_array($exclude) && $excludeGroups) { |
| 10086 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 10086 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 10087 | 10087 | } |
| 10088 | 10088 | if (is_array($include) && $includeGroups) { |
| 10089 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 10089 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 10090 | 10090 | } |
| 10091 | 10091 | $sql .= " ORDER BY ug.nom ASC"; |
| 10092 | 10092 | |
| 10093 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 10093 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 10094 | 10094 | $resql = $this->db->query($sql); |
| 10095 | 10095 | if ($resql) { |
| 10096 | 10096 | // Enhance with select2 |
| 10097 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10097 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10098 | 10098 | |
| 10099 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 10099 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 10100 | 10100 | |
| 10101 | 10101 | $num = $this->db->num_rows($resql); |
| 10102 | 10102 | $i = 0; |
| 10103 | 10103 | if ($num) { |
| 10104 | 10104 | if ($show_empty && !$multiple) { |
| 10105 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10105 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 10106 | 10106 | } |
| 10107 | 10107 | |
| 10108 | 10108 | while ($i < $num) { |
@@ -10115,11 +10115,11 @@ discard block |
||
| 10115 | 10115 | $label = $obj->name; |
| 10116 | 10116 | $labelhtml = $obj->name; |
| 10117 | 10117 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 10118 | - $label .= " (" . $obj->label . ")"; |
|
| 10119 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
| 10118 | + $label .= " (".$obj->label.")"; |
|
| 10119 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
| 10120 | 10120 | } |
| 10121 | 10121 | |
| 10122 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 10122 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 10123 | 10123 | if ($disableline) { |
| 10124 | 10124 | $out .= ' disabled'; |
| 10125 | 10125 | } |
@@ -10135,9 +10135,9 @@ discard block |
||
| 10135 | 10135 | } |
| 10136 | 10136 | } else { |
| 10137 | 10137 | if ($show_empty) { |
| 10138 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 10138 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 10139 | 10139 | } |
| 10140 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 10140 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 10141 | 10141 | } |
| 10142 | 10142 | $out .= '</select>'; |
| 10143 | 10143 | |
@@ -10186,25 +10186,25 @@ discard block |
||
| 10186 | 10186 | $out = ''; |
| 10187 | 10187 | |
| 10188 | 10188 | if (!empty($conf->use_javascript_ajax)) { |
| 10189 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10189 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10190 | 10190 | } |
| 10191 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10191 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10192 | 10192 | $(document).ready(function() { |
| 10193 | - $("#' . $cssclass . 's").click(function() { |
|
| 10193 | + $("#' . $cssclass.'s").click(function() { |
|
| 10194 | 10194 | if($(this).is(\':checked\')){ |
| 10195 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10196 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10195 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10196 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10197 | 10197 | } |
| 10198 | 10198 | else |
| 10199 | 10199 | { |
| 10200 | 10200 | console.log("We uncheck all"); |
| 10201 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10201 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10202 | 10202 | }' . "\n"; |
| 10203 | 10203 | if ($calljsfunction) { |
| 10204 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10204 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10205 | 10205 | } |
| 10206 | 10206 | $out .= ' }); |
| 10207 | - $(".' . $cssclass . '").change(function() { |
|
| 10207 | + $(".' . $cssclass.'").change(function() { |
|
| 10208 | 10208 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10209 | 10209 | }); |
| 10210 | 10210 | }); |
@@ -10249,67 +10249,67 @@ discard block |
||
| 10249 | 10249 | global $langs, $user; |
| 10250 | 10250 | |
| 10251 | 10251 | $out = ''; |
| 10252 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10253 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10252 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10253 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10254 | 10254 | if (!empty($excludeid)) { |
| 10255 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10255 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10256 | 10256 | } |
| 10257 | 10257 | $sql .= " ORDER BY label"; |
| 10258 | 10258 | |
| 10259 | 10259 | $resql = $this->db->query($sql); |
| 10260 | 10260 | if ($resql) { |
| 10261 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10261 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10262 | 10262 | if ($useempty) { |
| 10263 | 10263 | $out .= '<option value="0"> </option>'; |
| 10264 | 10264 | } |
| 10265 | 10265 | |
| 10266 | 10266 | while ($obj = $this->db->fetch_object($resql)) { |
| 10267 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10267 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10268 | 10268 | } |
| 10269 | 10269 | $out .= '</select>'; |
| 10270 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10270 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10271 | 10271 | |
| 10272 | 10272 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10273 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10273 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10274 | 10274 | } |
| 10275 | 10275 | |
| 10276 | 10276 | if (!empty($target)) { |
| 10277 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10277 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10278 | 10278 | $resql = $this->db->query($sql); |
| 10279 | 10279 | if ($resql) { |
| 10280 | 10280 | if ($this->db->num_rows($resql) > 0) { |
| 10281 | 10281 | $obj = $this->db->fetch_object($resql); |
| 10282 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10282 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10283 | 10283 | $(function() { |
| 10284 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10284 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10285 | 10285 | var current_val = $(this).val(); |
| 10286 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10286 | + if (current_val == ' . $obj->id.') {'; |
|
| 10287 | 10287 | if (!empty($default_selected) || !empty($selected)) { |
| 10288 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10288 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10289 | 10289 | } |
| 10290 | 10290 | |
| 10291 | 10291 | $out .= ' |
| 10292 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10292 | + $("select[name=' . $htmlname.']").change(); |
|
| 10293 | 10293 | } |
| 10294 | 10294 | }); |
| 10295 | 10295 | |
| 10296 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10296 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10297 | 10297 | |
| 10298 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10298 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10299 | 10299 | // get price of kilometer to fill the unit price |
| 10300 | 10300 | $.ajax({ |
| 10301 | 10301 | method: "POST", |
| 10302 | 10302 | dataType: "json", |
| 10303 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10304 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . join('&', $params)) . '", |
|
| 10303 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10304 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.join('&', $params)).'", |
|
| 10305 | 10305 | }).done(function( data, textStatus, jqXHR ) { |
| 10306 | 10306 | console.log(data); |
| 10307 | 10307 | if (typeof data.up != "undefined") { |
| 10308 | 10308 | $("input[name=value_unit]").val(data.up); |
| 10309 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10309 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10310 | 10310 | } else { |
| 10311 | 10311 | $("input[name=value_unit]").val(""); |
| 10312 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10312 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10313 | 10313 | } |
| 10314 | 10314 | }); |
| 10315 | 10315 | } |
@@ -10339,18 +10339,18 @@ discard block |
||
| 10339 | 10339 | global $conf, $langs; |
| 10340 | 10340 | |
| 10341 | 10341 | $out = ''; |
| 10342 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10343 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10342 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10343 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10344 | 10344 | |
| 10345 | 10345 | $resql = $this->db->query($sql); |
| 10346 | 10346 | if ($resql) { |
| 10347 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10347 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10348 | 10348 | if ($useempty) { |
| 10349 | 10349 | $out .= '<option value="0"></option>'; |
| 10350 | 10350 | } |
| 10351 | 10351 | |
| 10352 | 10352 | while ($obj = $this->db->fetch_object($resql)) { |
| 10353 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10353 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10354 | 10354 | } |
| 10355 | 10355 | $out .= '</select>'; |
| 10356 | 10356 | } else { |
@@ -10381,12 +10381,12 @@ discard block |
||
| 10381 | 10381 | |
| 10382 | 10382 | $resql = $this->db->query($sql); |
| 10383 | 10383 | if ($resql) { |
| 10384 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10384 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10385 | 10385 | if ($useempty) { |
| 10386 | 10386 | $out .= '<option value="0"></option>'; |
| 10387 | 10387 | } |
| 10388 | 10388 | if ($allchoice) { |
| 10389 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10389 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10390 | 10390 | } |
| 10391 | 10391 | |
| 10392 | 10392 | $field = 'code'; |
@@ -10396,7 +10396,7 @@ discard block |
||
| 10396 | 10396 | |
| 10397 | 10397 | while ($obj = $this->db->fetch_object($resql)) { |
| 10398 | 10398 | $key = $langs->trans($obj->code); |
| 10399 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10399 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10400 | 10400 | } |
| 10401 | 10401 | $out .= '</select>'; |
| 10402 | 10402 | |
@@ -10430,7 +10430,7 @@ discard block |
||
| 10430 | 10430 | { |
| 10431 | 10431 | global $user, $conf, $langs; |
| 10432 | 10432 | |
| 10433 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 10433 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 10434 | 10434 | |
| 10435 | 10435 | if (is_null($usertofilter)) { |
| 10436 | 10436 | $usertofilter = $user; |
@@ -10454,10 +10454,10 @@ discard block |
||
| 10454 | 10454 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 10455 | 10455 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 10456 | 10456 | $sql .= ' s.nom as name'; |
| 10457 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 10458 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10459 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 10460 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 10457 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 10458 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10459 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 10460 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 10461 | 10461 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 10462 | 10462 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 10463 | 10463 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10468,14 +10468,14 @@ discard block |
||
| 10468 | 10468 | if ($resql) { |
| 10469 | 10469 | // Use select2 selector |
| 10470 | 10470 | if (!empty($conf->use_javascript_ajax)) { |
| 10471 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10471 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10472 | 10472 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10473 | 10473 | $out .= $comboenhancement; |
| 10474 | 10474 | $morecss = 'minwidth200imp maxwidth500'; |
| 10475 | 10475 | } |
| 10476 | 10476 | |
| 10477 | 10477 | if (empty($option_only)) { |
| 10478 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10478 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10479 | 10479 | } |
| 10480 | 10480 | if (!empty($show_empty)) { |
| 10481 | 10481 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10505,33 +10505,33 @@ discard block |
||
| 10505 | 10505 | if ($showproject == 'all') { |
| 10506 | 10506 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 10507 | 10507 | if ($obj->name) { |
| 10508 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 10508 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 10509 | 10509 | } |
| 10510 | 10510 | |
| 10511 | 10511 | $disabled = 0; |
| 10512 | 10512 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 10513 | 10513 | $disabled = 1; |
| 10514 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 10514 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 10515 | 10515 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 10516 | 10516 | if ($discard_closed == 2) { |
| 10517 | 10517 | $disabled = 1; |
| 10518 | 10518 | } |
| 10519 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10519 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10520 | 10520 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 10521 | 10521 | $disabled = 1; |
| 10522 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 10522 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 10523 | 10523 | } |
| 10524 | 10524 | } |
| 10525 | 10525 | |
| 10526 | 10526 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10527 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10527 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10528 | 10528 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10529 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10529 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10530 | 10530 | } else { |
| 10531 | 10531 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 10532 | 10532 | $resultat = ''; |
| 10533 | 10533 | } else { |
| 10534 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10534 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10535 | 10535 | if ($disabled) { |
| 10536 | 10536 | $resultat .= ' disabled'; |
| 10537 | 10537 | } |
@@ -10583,22 +10583,22 @@ discard block |
||
| 10583 | 10583 | |
| 10584 | 10584 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 10585 | 10585 | //$sql.= ', el.fk_source'; |
| 10586 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 10587 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 10586 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 10587 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 10588 | 10588 | $sql .= " ORDER BY f.titre ASC"; |
| 10589 | 10589 | |
| 10590 | 10590 | $resql = $this->db->query($sql); |
| 10591 | 10591 | if ($resql) { |
| 10592 | 10592 | // Use select2 selector |
| 10593 | 10593 | if (!empty($conf->use_javascript_ajax)) { |
| 10594 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10594 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10595 | 10595 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10596 | 10596 | $out .= $comboenhancement; |
| 10597 | 10597 | $morecss = 'minwidth200imp maxwidth500'; |
| 10598 | 10598 | } |
| 10599 | 10599 | |
| 10600 | 10600 | if (empty($option_only)) { |
| 10601 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10601 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10602 | 10602 | } |
| 10603 | 10603 | if (!empty($show_empty)) { |
| 10604 | 10604 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10617,19 +10617,19 @@ discard block |
||
| 10617 | 10617 | $disabled = 0; |
| 10618 | 10618 | if (!empty($obj->suspended)) { |
| 10619 | 10619 | $disabled = 1; |
| 10620 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10620 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10621 | 10621 | } |
| 10622 | 10622 | |
| 10623 | 10623 | |
| 10624 | 10624 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10625 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10625 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10626 | 10626 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10627 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10627 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10628 | 10628 | } else { |
| 10629 | 10629 | if ($disabled && ($selected != $obj->rowid)) { |
| 10630 | 10630 | $resultat = ''; |
| 10631 | 10631 | } else { |
| 10632 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10632 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10633 | 10633 | if ($disabled) { |
| 10634 | 10634 | $resultat .= ' disabled'; |
| 10635 | 10635 | } |
@@ -10669,14 +10669,14 @@ discard block |
||
| 10669 | 10669 | global $langs; |
| 10670 | 10670 | |
| 10671 | 10671 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 10672 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 10672 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 10673 | 10673 | } |
| 10674 | 10674 | |
| 10675 | 10675 | $ret = ''; |
| 10676 | 10676 | |
| 10677 | 10677 | $ret .= '<div class="divadvancedsearchfieldcomp inline-block">'; |
| 10678 | 10678 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 10679 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 10679 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 10680 | 10680 | $ret .= '</a>'; |
| 10681 | 10681 | |
| 10682 | 10682 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -10703,13 +10703,13 @@ discard block |
||
| 10703 | 10703 | } |
| 10704 | 10704 | |
| 10705 | 10705 | if ($countparenthesis == 0) { |
| 10706 | - $char2 = dol_substr($search_component_params_hidden, $i+1, 1); |
|
| 10707 | - $char3 = dol_substr($search_component_params_hidden, $i+2, 1); |
|
| 10706 | + $char2 = dol_substr($search_component_params_hidden, $i + 1, 1); |
|
| 10707 | + $char3 = dol_substr($search_component_params_hidden, $i + 2, 1); |
|
| 10708 | 10708 | if ($char == 'A' && $char2 == 'N' && $char3 == 'D') { |
| 10709 | 10709 | // We found a AND |
| 10710 | 10710 | $arrayofandtags[] = trim($s); |
| 10711 | 10711 | $s = ''; |
| 10712 | - $i+=2; |
|
| 10712 | + $i += 2; |
|
| 10713 | 10713 | } else { |
| 10714 | 10714 | $s .= $char; |
| 10715 | 10715 | } |
@@ -10733,8 +10733,8 @@ discard block |
||
| 10733 | 10733 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
| 10734 | 10734 | $searchtags = removeGlobalParenthesis($searchtags); |
| 10735 | 10735 | |
| 10736 | - $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10737 | - $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> '; |
|
| 10736 | + $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10737 | + $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> '; |
|
| 10738 | 10738 | $ret .= dol_escape_htmltag($searchtags); |
| 10739 | 10739 | $ret .= '</span>'; |
| 10740 | 10740 | } |
@@ -10751,29 +10751,29 @@ discard block |
||
| 10751 | 10751 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 10752 | 10752 | } |
| 10753 | 10753 | $ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->"; |
| 10754 | - $ret .= '<input type="hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 10754 | + $ret .= '<input type="hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 10755 | 10755 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 10756 | 10756 | |
| 10757 | 10757 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 10758 | 10758 | foreach ($arrayofcriterias as $criteria) { |
| 10759 | 10759 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
| 10760 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10760 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10761 | 10761 | continue; |
| 10762 | 10762 | } |
| 10763 | 10763 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 10764 | 10764 | continue; |
| 10765 | 10765 | } |
| 10766 | 10766 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 10767 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 10768 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 10769 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 10770 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 10771 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 10772 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 10773 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 10774 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 10767 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 10768 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 10769 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 10770 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 10771 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 10772 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 10773 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 10774 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 10775 | 10775 | } else { |
| 10776 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 10776 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 10777 | 10777 | } |
| 10778 | 10778 | } |
| 10779 | 10779 | } |
@@ -10781,7 +10781,7 @@ discard block |
||
| 10781 | 10781 | $ret .= '</div>'; |
| 10782 | 10782 | |
| 10783 | 10783 | $ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n"; |
| 10784 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Search") . '" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10784 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Search").'" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10785 | 10785 | |
| 10786 | 10786 | $ret .= '</div>'; |
| 10787 | 10787 | $ret .= '</div>'; |
@@ -10817,7 +10817,7 @@ discard block |
||
| 10817 | 10817 | |
| 10818 | 10818 | $TModels = array(); |
| 10819 | 10819 | |
| 10820 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 10820 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 10821 | 10821 | $formmail = new FormMail($this->db); |
| 10822 | 10822 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 10823 | 10823 | |
@@ -10830,17 +10830,17 @@ discard block |
||
| 10830 | 10830 | } |
| 10831 | 10831 | } |
| 10832 | 10832 | |
| 10833 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 10833 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 10834 | 10834 | |
| 10835 | 10835 | foreach ($TModels as $id_model => $label_model) { |
| 10836 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 10837 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 10836 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 10837 | + $retstring .= ">".$label_model."</option>"; |
|
| 10838 | 10838 | } |
| 10839 | 10839 | |
| 10840 | 10840 | $retstring .= "</select>"; |
| 10841 | 10841 | |
| 10842 | 10842 | if ($addjscombo) { |
| 10843 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 10843 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 10844 | 10844 | } |
| 10845 | 10845 | |
| 10846 | 10846 | return $retstring; |
@@ -10891,16 +10891,16 @@ discard block |
||
| 10891 | 10891 | |
| 10892 | 10892 | foreach ($buttons as $button) { |
| 10893 | 10893 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 10894 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
| 10894 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
| 10895 | 10895 | } |
| 10896 | 10896 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 10897 | 10897 | |
| 10898 | 10898 | if ($dol_openinpopup) { |
| 10899 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 10900 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 10899 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 10900 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 10901 | 10901 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 10902 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\'); |
|
| 10903 | - window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\'); |
|
| 10902 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\'); |
|
| 10903 | + window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\'); |
|
| 10904 | 10904 | });'; |
| 10905 | 10905 | $retstring .= '</script>'; |
| 10906 | 10906 | } |
@@ -10929,7 +10929,7 @@ discard block |
||
| 10929 | 10929 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 10930 | 10930 | |
| 10931 | 10931 | $sql = "SELECT rowid, code, label as label"; |
| 10932 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 10932 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 10933 | 10933 | $sql .= " WHERE active = 1"; |
| 10934 | 10934 | |
| 10935 | 10935 | $resql = $this->db->query($sql); |
@@ -10940,7 +10940,7 @@ discard block |
||
| 10940 | 10940 | $obj = $this->db->fetch_object($resql); |
| 10941 | 10941 | |
| 10942 | 10942 | // If translation exists, we use it, otherwise we take the default wording |
| 10943 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10943 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10944 | 10944 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 10945 | 10945 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 10946 | 10946 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -10972,18 +10972,18 @@ discard block |
||
| 10972 | 10972 | global $langs, $user; |
| 10973 | 10973 | |
| 10974 | 10974 | $out = ''; |
| 10975 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 10975 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 10976 | 10976 | |
| 10977 | 10977 | $this->load_cache_invoice_subtype(); |
| 10978 | 10978 | |
| 10979 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 10979 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 10980 | 10980 | if ($addempty) { |
| 10981 | 10981 | $out .= '<option value="0"> </option>'; |
| 10982 | 10982 | } |
| 10983 | 10983 | |
| 10984 | 10984 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 10985 | 10985 | $label = $subtype['label']; |
| 10986 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 10986 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 10987 | 10987 | if ($selected == $subtype['rowid']) { |
| 10988 | 10988 | $out .= ' selected="selected"'; |
| 10989 | 10989 | } |
@@ -154,15 +154,15 @@ discard block |
||
| 154 | 154 | return $hookmanager->resPrint; |
| 155 | 155 | } else { |
| 156 | 156 | $out = '<!-- Start generateOutput from FormSetup class -->'; |
| 157 | - $out.= $this->htmlBeforeOutputForm; |
|
| 157 | + $out .= $this->htmlBeforeOutputForm; |
|
| 158 | 158 | |
| 159 | 159 | if ($editMode) { |
| 160 | - $out.= '<form ' . self::generateAttributesStringFromArray($this->formAttributes) . ' >'; |
|
| 160 | + $out .= '<form '.self::generateAttributesStringFromArray($this->formAttributes).' >'; |
|
| 161 | 161 | |
| 162 | 162 | // generate hidden values from $this->formHiddenInputs |
| 163 | 163 | if (!empty($this->formHiddenInputs) && is_array($this->formHiddenInputs)) { |
| 164 | 164 | foreach ($this->formHiddenInputs as $hiddenKey => $hiddenValue) { |
| 165 | - $out.= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="' . dol_escape_htmltag($hiddenValue) . '">'; |
|
| 165 | + $out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="'.dol_escape_htmltag($hiddenValue).'">'; |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | } |
@@ -180,8 +180,8 @@ discard block |
||
| 180 | 180 | return $hookmanager->resPrint; |
| 181 | 181 | } elseif ($editMode) { |
| 182 | 182 | $out .= '<div class="form-setup-button-container center">'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes |
| 183 | - $out.= $this->htmlOutputMoreButton; |
|
| 184 | - $out .= '<input class="button button-save" type="submit" value="' . $this->langs->trans("Save") . '">'; // Todo fix dolibarr style for <button and use <button instead of input |
|
| 183 | + $out .= $this->htmlOutputMoreButton; |
|
| 184 | + $out .= '<input class="button button-save" type="submit" value="'.$this->langs->trans("Save").'">'; // Todo fix dolibarr style for <button and use <button instead of input |
|
| 185 | 185 | /*$out .= ' '; |
| 186 | 186 | $out .= '<a class="button button-cancel" type="submit" href="' . $this->formAttributes['action'] . '">'.$this->langs->trans('Cancel').'</a>'; |
| 187 | 187 | */ |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $out .= '</form>'; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - $out.= $this->htmlAfterOutputForm; |
|
| 195 | + $out .= $this->htmlAfterOutputForm; |
|
| 196 | 196 | |
| 197 | 197 | return $out; |
| 198 | 198 | } |
@@ -225,8 +225,8 @@ discard block |
||
| 225 | 225 | if (empty($hideTitle)) { |
| 226 | 226 | $out .= '<thead>'; |
| 227 | 227 | $out .= '<tr class="liste_titre">'; |
| 228 | - $out .= ' <td>' . $this->langs->trans("Parameter") . '</td>'; |
|
| 229 | - $out .= ' <td>' . $this->langs->trans("Value") . '</td>'; |
|
| 228 | + $out .= ' <td>'.$this->langs->trans("Parameter").'</td>'; |
|
| 229 | + $out .= ' <td>'.$this->langs->trans("Value").'</td>'; |
|
| 230 | 230 | $out .= '</tr>'; |
| 231 | 231 | $out .= '</thead>'; |
| 232 | 232 | } |
@@ -312,27 +312,27 @@ discard block |
||
| 312 | 312 | public function generateLineOutput($item, $editMode = false) |
| 313 | 313 | { |
| 314 | 314 | $out = ''; |
| 315 | - if ($item->enabled==1) { |
|
| 315 | + if ($item->enabled == 1) { |
|
| 316 | 316 | $trClass = 'oddeven'; |
| 317 | 317 | if ($item->getType() == 'title') { |
| 318 | 318 | $trClass = 'liste_titre'; |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | $this->setupNotEmpty++; |
| 322 | - $out.= '<tr class="'.$trClass.'">'; |
|
| 322 | + $out .= '<tr class="'.$trClass.'">'; |
|
| 323 | 323 | |
| 324 | - $out.= '<td class="col-setup-title">'; |
|
| 325 | - $out.= '<span id="helplink'.$item->confKey.'" class="spanforparamtooltip">'; |
|
| 326 | - $out.= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1, 'info', '', 0, 3, 'tootips'.$item->confKey); |
|
| 327 | - $out.= '</span>'; |
|
| 328 | - $out.= '</td>'; |
|
| 324 | + $out .= '<td class="col-setup-title">'; |
|
| 325 | + $out .= '<span id="helplink'.$item->confKey.'" class="spanforparamtooltip">'; |
|
| 326 | + $out .= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1, 'info', '', 0, 3, 'tootips'.$item->confKey); |
|
| 327 | + $out .= '</span>'; |
|
| 328 | + $out .= '</td>'; |
|
| 329 | 329 | |
| 330 | - $out.= '<td>'; |
|
| 330 | + $out .= '<td>'; |
|
| 331 | 331 | |
| 332 | 332 | if ($editMode) { |
| 333 | - $out.= $item->generateInputField(); |
|
| 333 | + $out .= $item->generateInputField(); |
|
| 334 | 334 | } else { |
| 335 | - $out.= $item->generateOutputField(); |
|
| 335 | + $out .= $item->generateOutputField(); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | if (!empty($item->errors)) { |
@@ -340,8 +340,8 @@ discard block |
||
| 340 | 340 | setEventMessages(null, $item->errors, 'errors'); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - $out.= '</td>'; |
|
| 344 | - $out.= '</tr>'; |
|
| 343 | + $out .= '</td>'; |
|
| 344 | + $out .= '</tr>'; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | return $out; |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | if (!empty($this->helpText)) { |
| 813 | 813 | return $this->helpText; |
| 814 | 814 | } |
| 815 | - return (($this->langs->trans($this->confKey . 'Tooltip') != $this->confKey . 'Tooltip') ? $this->langs->trans($this->confKey . 'Tooltip') : ''); |
|
| 815 | + return (($this->langs->trans($this->confKey.'Tooltip') != $this->confKey.'Tooltip') ? $this->langs->trans($this->confKey.'Tooltip') : ''); |
|
| 816 | 816 | } |
| 817 | 817 | |
| 818 | 818 | /** |
@@ -858,47 +858,47 @@ discard block |
||
| 858 | 858 | $out = ''; |
| 859 | 859 | |
| 860 | 860 | if ($this->type == 'title') { |
| 861 | - $out.= $this->generateOutputField(); // title have no input |
|
| 861 | + $out .= $this->generateOutputField(); // title have no input |
|
| 862 | 862 | } elseif ($this->type == 'multiselect') { |
| 863 | - $out.= $this->generateInputFieldMultiSelect(); |
|
| 863 | + $out .= $this->generateInputFieldMultiSelect(); |
|
| 864 | 864 | } elseif ($this->type == 'select') { |
| 865 | - $out.= $this->generateInputFieldSelect(); |
|
| 865 | + $out .= $this->generateInputFieldSelect(); |
|
| 866 | 866 | } elseif ($this->type == 'selectUser') { |
| 867 | - $out.= $this->generateInputFieldSelectUser(); |
|
| 867 | + $out .= $this->generateInputFieldSelectUser(); |
|
| 868 | 868 | } elseif ($this->type == 'textarea') { |
| 869 | - $out.= $this->generateInputFieldTextarea(); |
|
| 870 | - } elseif ($this->type== 'html') { |
|
| 871 | - $out.= $this->generateInputFieldHtml(); |
|
| 872 | - } elseif ($this->type== 'color') { |
|
| 873 | - $out.= $this->generateInputFieldColor(); |
|
| 869 | + $out .= $this->generateInputFieldTextarea(); |
|
| 870 | + } elseif ($this->type == 'html') { |
|
| 871 | + $out .= $this->generateInputFieldHtml(); |
|
| 872 | + } elseif ($this->type == 'color') { |
|
| 873 | + $out .= $this->generateInputFieldColor(); |
|
| 874 | 874 | } elseif ($this->type == 'yesno') { |
| 875 | 875 | if (!empty($conf->use_javascript_ajax)) { |
| 876 | - $out.= ajax_constantonoff($this->confKey); |
|
| 876 | + $out .= ajax_constantonoff($this->confKey); |
|
| 877 | 877 | } else { |
| 878 | - $out.= $this->form->selectyesno($this->confKey, $this->fieldValue, 1); |
|
| 878 | + $out .= $this->form->selectyesno($this->confKey, $this->fieldValue, 1); |
|
| 879 | 879 | } |
| 880 | 880 | } elseif (preg_match('/emailtemplate:/', $this->type)) { |
| 881 | - $out.= $this->generateInputFieldEmailTemplate(); |
|
| 881 | + $out .= $this->generateInputFieldEmailTemplate(); |
|
| 882 | 882 | } elseif (preg_match('/category:/', $this->type)) { |
| 883 | - $out.=$this->generateInputFieldCategories(); |
|
| 883 | + $out .= $this->generateInputFieldCategories(); |
|
| 884 | 884 | } elseif (preg_match('/thirdparty_type/', $this->type)) { |
| 885 | 885 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
| 886 | 886 | $formcompany = new FormCompany($this->db); |
| 887 | - $out.= $formcompany->selectProspectCustomerType($this->fieldValue, $this->confKey); |
|
| 887 | + $out .= $formcompany->selectProspectCustomerType($this->fieldValue, $this->confKey); |
|
| 888 | 888 | } elseif ($this->type == 'securekey') { |
| 889 | - $out.= $this->generateInputFieldSecureKey(); |
|
| 889 | + $out .= $this->generateInputFieldSecureKey(); |
|
| 890 | 890 | } elseif ($this->type == 'product') { |
| 891 | 891 | if (isModEnabled("product") || isModEnabled("service")) { |
| 892 | 892 | $selected = (empty($this->fieldValue) ? '' : $this->fieldValue); |
| 893 | - $out.= $this->form->select_produits($selected, $this->confKey, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, $this->cssClass, 0, '', null, 1); |
|
| 893 | + $out .= $this->form->select_produits($selected, $this->confKey, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, $this->cssClass, 0, '', null, 1); |
|
| 894 | 894 | } |
| 895 | 895 | } elseif ($this->type == 'selectBankAccount') { |
| 896 | 896 | if (isModEnabled("bank")) { |
| 897 | 897 | $selected = (empty($this->fieldValue) ? '' : $this->fieldValue); |
| 898 | - $out.= $this->form->select_comptes($selected, $this->confKey, 0, '', 0, '', 0, '', 1); |
|
| 898 | + $out .= $this->form->select_comptes($selected, $this->confKey, 0, '', 0, '', 0, '', 1); |
|
| 899 | 899 | } |
| 900 | 900 | } else { |
| 901 | - $out.= $this->generateInputFieldText(); |
|
| 901 | + $out .= $this->generateInputFieldText(); |
|
| 902 | 902 | } |
| 903 | 903 | |
| 904 | 904 | return $out; |
@@ -924,9 +924,9 @@ discard block |
||
| 924 | 924 | */ |
| 925 | 925 | public function generateInputFieldTextarea() |
| 926 | 926 | { |
| 927 | - $out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">' . "\n"; |
|
| 928 | - $out.= dol_htmlentities($this->fieldValue); |
|
| 929 | - $out.= "</textarea>\n"; |
|
| 927 | + $out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
| 928 | + $out .= dol_htmlentities($this->fieldValue); |
|
| 929 | + $out .= "</textarea>\n"; |
|
| 930 | 930 | return $out; |
| 931 | 931 | } |
| 932 | 932 | |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | public function generateInputFieldHtml() |
| 939 | 939 | { |
| 940 | 940 | global $conf; |
| 941 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 941 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 942 | 942 | $doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
| 943 | 943 | return $doleditor->Create(1); |
| 944 | 944 | } |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | |
| 977 | 977 | $out = ''; |
| 978 | 978 | if (preg_match('/emailtemplate:/', $this->type)) { |
| 979 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 979 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 980 | 980 | $formmail = new FormMail($this->db); |
| 981 | 981 | |
| 982 | 982 | $tmp = explode(':', $this->type); |
@@ -986,10 +986,10 @@ discard block |
||
| 986 | 986 | foreach ($formmail->lines_model as $modelMail) { |
| 987 | 987 | $moreonlabel = ''; |
| 988 | 988 | if (!empty($arrayOfMessageName[$modelMail->label])) { |
| 989 | - $moreonlabel = ' <span class="opacitymedium">(' . $this->langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
| 989 | + $moreonlabel = ' <span class="opacitymedium">('.$this->langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
| 990 | 990 | } |
| 991 | 991 | // The 'label' is the key that is unique if we exclude the language |
| 992 | - $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)) . $moreonlabel; |
|
| 992 | + $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)).$moreonlabel; |
|
| 993 | 993 | } |
| 994 | 994 | } |
| 995 | 995 | $out .= $this->form->selectarray($this->confKey, $arrayOfMessageName, $this->fieldValue, 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | global $conf; |
| 1010 | 1010 | $out = '<input required="required" type="text" class="flat" id="'.$this->confKey.'" name="'.$this->confKey.'" value="'.(GETPOST($this->confKey, 'alpha') ? GETPOST($this->confKey, 'alpha') : $this->fieldValue).'" size="40">'; |
| 1011 | 1011 | if (!empty($conf->use_javascript_ajax)) { |
| 1012 | - $out.= ' '.img_picto($this->langs->trans('Generate'), 'refresh', 'id="generate_token'.$this->confKey.'" class="linkobject"'); |
|
| 1012 | + $out .= ' '.img_picto($this->langs->trans('Generate'), 'refresh', 'id="generate_token'.$this->confKey.'" class="linkobject"'); |
|
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | 1015 | // Add button to autosuggest a key |
@@ -1124,30 +1124,30 @@ discard block |
||
| 1124 | 1124 | if ($this->type == 'title') { |
| 1125 | 1125 | // nothing to do |
| 1126 | 1126 | } elseif ($this->type == 'textarea') { |
| 1127 | - $out.= dol_nl2br($this->fieldValue); |
|
| 1127 | + $out .= dol_nl2br($this->fieldValue); |
|
| 1128 | 1128 | } elseif ($this->type == 'multiselect') { |
| 1129 | - $out.= $this->generateOutputFieldMultiSelect(); |
|
| 1129 | + $out .= $this->generateOutputFieldMultiSelect(); |
|
| 1130 | 1130 | } elseif ($this->type == 'select') { |
| 1131 | - $out.= $this->generateOutputFieldSelect(); |
|
| 1131 | + $out .= $this->generateOutputFieldSelect(); |
|
| 1132 | 1132 | } elseif ($this->type == 'selectUser') { |
| 1133 | - $out.= $this->generateOutputFieldSelectUser(); |
|
| 1133 | + $out .= $this->generateOutputFieldSelectUser(); |
|
| 1134 | 1134 | } elseif ($this->type == 'html') { |
| 1135 | - $out.= $this->fieldValue; |
|
| 1135 | + $out .= $this->fieldValue; |
|
| 1136 | 1136 | } elseif ($this->type == 'color') { |
| 1137 | - $out.= $this->generateOutputFieldColor(); |
|
| 1137 | + $out .= $this->generateOutputFieldColor(); |
|
| 1138 | 1138 | } elseif ($this->type == 'yesno') { |
| 1139 | 1139 | if (!empty($conf->use_javascript_ajax)) { |
| 1140 | - $out.= ajax_constantonoff($this->confKey); |
|
| 1140 | + $out .= ajax_constantonoff($this->confKey); |
|
| 1141 | 1141 | } else { |
| 1142 | 1142 | if ($this->fieldValue == 1) { |
| 1143 | - $out.= $langs->trans('yes'); |
|
| 1143 | + $out .= $langs->trans('yes'); |
|
| 1144 | 1144 | } else { |
| 1145 | - $out.= $langs->trans('no'); |
|
| 1145 | + $out .= $langs->trans('no'); |
|
| 1146 | 1146 | } |
| 1147 | 1147 | } |
| 1148 | 1148 | } elseif (preg_match('/emailtemplate:/', $this->type)) { |
| 1149 | 1149 | if ($this->fieldValue > 0) { |
| 1150 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 1150 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 1151 | 1151 | $formmail = new FormMail($this->db); |
| 1152 | 1152 | |
| 1153 | 1153 | $tmp = explode(':', $this->type); |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | if (is_numeric($template) && $template < 0) { |
| 1157 | 1157 | $this->setErrors($formmail->errors); |
| 1158 | 1158 | } |
| 1159 | - $out.= $this->langs->trans($template->label); |
|
| 1159 | + $out .= $this->langs->trans($template->label); |
|
| 1160 | 1160 | } |
| 1161 | 1161 | } elseif (preg_match('/category:/', $this->type)) { |
| 1162 | 1162 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
@@ -1168,18 +1168,18 @@ discard block |
||
| 1168 | 1168 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1169 | 1169 | $toprint = array(); |
| 1170 | 1170 | foreach ($ways as $way) { |
| 1171 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 1171 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 1172 | 1172 | } |
| 1173 | - $out.='<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 1173 | + $out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 1174 | 1174 | } elseif (preg_match('/thirdparty_type/', $this->type)) { |
| 1175 | - if ($this->fieldValue==2) { |
|
| 1176 | - $out.= $this->langs->trans("Prospect"); |
|
| 1177 | - } elseif ($this->fieldValue==3) { |
|
| 1178 | - $out.= $this->langs->trans("ProspectCustomer"); |
|
| 1179 | - } elseif ($this->fieldValue==1) { |
|
| 1180 | - $out.= $this->langs->trans("Customer"); |
|
| 1181 | - } elseif ($this->fieldValue==0) { |
|
| 1182 | - $out.= $this->langs->trans("NorProspectNorCustomer"); |
|
| 1175 | + if ($this->fieldValue == 2) { |
|
| 1176 | + $out .= $this->langs->trans("Prospect"); |
|
| 1177 | + } elseif ($this->fieldValue == 3) { |
|
| 1178 | + $out .= $this->langs->trans("ProspectCustomer"); |
|
| 1179 | + } elseif ($this->fieldValue == 1) { |
|
| 1180 | + $out .= $this->langs->trans("Customer"); |
|
| 1181 | + } elseif ($this->fieldValue == 0) { |
|
| 1182 | + $out .= $this->langs->trans("NorProspectNorCustomer"); |
|
| 1183 | 1183 | } |
| 1184 | 1184 | } elseif ($this->type == 'product') { |
| 1185 | 1185 | require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
@@ -1187,7 +1187,7 @@ discard block |
||
| 1187 | 1187 | $product = new Product($this->db); |
| 1188 | 1188 | $resprod = $product->fetch($this->fieldValue); |
| 1189 | 1189 | if ($resprod > 0) { |
| 1190 | - $out.= $product->ref; |
|
| 1190 | + $out .= $product->ref; |
|
| 1191 | 1191 | } elseif ($resprod < 0) { |
| 1192 | 1192 | $this->setErrors($product->errors); |
| 1193 | 1193 | } |
@@ -1197,12 +1197,12 @@ discard block |
||
| 1197 | 1197 | $bankaccount = new Account($this->db); |
| 1198 | 1198 | $resbank = $bankaccount->fetch($this->fieldValue); |
| 1199 | 1199 | if ($resbank > 0) { |
| 1200 | - $out.= $bankaccount->label; |
|
| 1200 | + $out .= $bankaccount->label; |
|
| 1201 | 1201 | } elseif ($resbank < 0) { |
| 1202 | 1202 | $this->setErrors($bankaccount->errors); |
| 1203 | 1203 | } |
| 1204 | 1204 | } else { |
| 1205 | - $out.= $this->fieldValue; |
|
| 1205 | + $out .= $this->fieldValue; |
|
| 1206 | 1206 | } |
| 1207 | 1207 | |
| 1208 | 1208 | return $out; |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | if (!empty($TSelected)) { |
| 1226 | 1226 | foreach ($TSelected as $selected) { |
| 1227 | 1227 | if (!empty($this->fieldOptions[$selected])) { |
| 1228 | - $outPut.= dolGetBadge('', $this->fieldOptions[$selected], 'info').' '; |
|
| 1228 | + $outPut .= dolGetBadge('', $this->fieldOptions[$selected], 'info').' '; |
|
| 1229 | 1229 | } |
| 1230 | 1230 | } |
| 1231 | 1231 | } |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | */ |
| 1240 | 1240 | public function generateOutputFieldColor() |
| 1241 | 1241 | { |
| 1242 | - $this->fieldAttr['disabled']=null; |
|
| 1242 | + $this->fieldAttr['disabled'] = null; |
|
| 1243 | 1243 | return $this->generateInputField(); |
| 1244 | 1244 | } |
| 1245 | 1245 | /** |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | */ |
| 1250 | 1250 | public function generateInputFieldColor() |
| 1251 | 1251 | { |
| 1252 | - $this->fieldAttr['type']= 'color'; |
|
| 1252 | + $this->fieldAttr['type'] = 'color'; |
|
| 1253 | 1253 | return $this->generateInputFieldText(); |
| 1254 | 1254 | } |
| 1255 | 1255 | |
@@ -1278,7 +1278,7 @@ discard block |
||
| 1278 | 1278 | $outPut = ''; |
| 1279 | 1279 | $user = new User($this->db); |
| 1280 | 1280 | $user->fetch($this->fieldValue); |
| 1281 | - $outPut = $user->firstname . " " . $user->lastname; |
|
| 1281 | + $outPut = $user->firstname." ".$user->lastname; |
|
| 1282 | 1282 | return $outPut; |
| 1283 | 1283 | } |
| 1284 | 1284 | |