@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | print '<tr class="oddeven nohover" id="tr-aaa-'.$rowid.'">'; |
| 1126 | 1126 | print '<td colspan="10" class="paddingleft" style="padding-left: 20px">'; |
| 1127 | 1127 | |
| 1128 | - $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); |
|
| 1128 | + $fieldsforcontent = array('topic', 'email_from', 'joinfiles', 'content'); |
|
| 1129 | 1129 | if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) { |
| 1130 | 1130 | $fieldsforcontent[] = 'content_lines'; |
| 1131 | 1131 | } |
@@ -1198,7 +1198,7 @@ discard block |
||
| 1198 | 1198 | continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled) |
| 1199 | 1199 | } |
| 1200 | 1200 | // Test on 'enabled' |
| 1201 | - if (! (int) dol_eval($obj->enabled, 1, 1, '1')) { |
|
| 1201 | + if (!(int) dol_eval($obj->enabled, 1, 1, '1')) { |
|
| 1202 | 1202 | $i++; |
| 1203 | 1203 | continue; // Email template not qualified |
| 1204 | 1204 | } |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | print $form->selectyesno($value, (isset($obj->$value) ? $obj->$value : ''), 1, false, 0, 1); |
| 1491 | 1491 | } |
| 1492 | 1492 | } else { |
| 1493 | - print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'. $value .'"'.($context == 'preview' ? ' disabled' : '').'>'; |
|
| 1493 | + print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->$value) ? $obj->$value : '').'" name="'.$value.'"'.($context == 'preview' ? ' disabled' : '').'>'; |
|
| 1494 | 1494 | } |
| 1495 | 1495 | print '</td>'; |
| 1496 | 1496 | } |
@@ -29,17 +29,17 @@ discard block |
||
| 29 | 29 | * \brief File of withdrawal receipts class |
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
| 38 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; |
|
| 39 | -require_once DOL_DOCUMENT_ROOT . '/salaries/class/salary.class.php'; |
|
| 40 | -require_once DOL_DOCUMENT_ROOT . '/salaries/class/paymentsalary.class.php'; |
|
| 41 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 42 | -require_once DOL_DOCUMENT_ROOT . '/user/class/userbankaccount.class.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
| 38 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; |
|
| 39 | +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; |
|
| 40 | +require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; |
|
| 41 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 42 | +require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | const STATUS_DRAFT = 0; |
| 151 | 151 | const STATUS_TRANSFERED = 1; |
| 152 | - const STATUS_CREDITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type |
|
| 153 | - const STATUS_DEBITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type |
|
| 152 | + const STATUS_CREDITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type |
|
| 153 | + const STATUS_DEBITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type |
|
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | if ($result == 0) { |
| 341 | 341 | if ($line_id > 0) { |
| 342 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement ("; |
|
| 342 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement ("; |
|
| 343 | 343 | if ($type != 'bank-transfer') { |
| 344 | 344 | $sql .= "fk_facture"; |
| 345 | 345 | } else { |
@@ -352,24 +352,24 @@ discard block |
||
| 352 | 352 | $sql .= ",fk_prelevement_lignes"; |
| 353 | 353 | $sql .= ") VALUES ("; |
| 354 | 354 | $sql .= ((int) $invoice_id); |
| 355 | - $sql .= ", " . ((int) $line_id); |
|
| 355 | + $sql .= ", ".((int) $line_id); |
|
| 356 | 356 | $sql .= ")"; |
| 357 | 357 | |
| 358 | 358 | if ($this->db->query($sql)) { |
| 359 | 359 | $result = 0; |
| 360 | 360 | } else { |
| 361 | 361 | $result = -1; |
| 362 | - $this->errors[] = get_class($this) . "::AddFacture " . $this->db->lasterror; |
|
| 363 | - dol_syslog(get_class($this) . "::AddFacture Error $result"); |
|
| 362 | + $this->errors[] = get_class($this)."::AddFacture ".$this->db->lasterror; |
|
| 363 | + dol_syslog(get_class($this)."::AddFacture Error $result"); |
|
| 364 | 364 | } |
| 365 | 365 | } else { |
| 366 | 366 | $result = -2; |
| 367 | - $this->errors[] = get_class($this) . "::AddFacture linedid Empty"; |
|
| 368 | - dol_syslog(get_class($this) . "::AddFacture Error $result"); |
|
| 367 | + $this->errors[] = get_class($this)."::AddFacture linedid Empty"; |
|
| 368 | + dol_syslog(get_class($this)."::AddFacture Error $result"); |
|
| 369 | 369 | } |
| 370 | 370 | } else { |
| 371 | 371 | $result = -3; |
| 372 | - dol_syslog(get_class($this) . "::AddFacture Error $result"); |
|
| 372 | + dol_syslog(get_class($this)."::AddFacture Error $result"); |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | return $result; |
@@ -392,23 +392,23 @@ discard block |
||
| 392 | 392 | public function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key, $sourcetype = '') |
| 393 | 393 | { |
| 394 | 394 | $result = -1; |
| 395 | - $concat = 0; // ??? what is this for. Seems not used. |
|
| 395 | + $concat = 0; // ??? what is this for. Seems not used. |
|
| 396 | 396 | |
| 397 | 397 | if ($concat == 1) { |
| 398 | 398 | /* |
| 399 | 399 | * We aggregate the lines |
| 400 | 400 | */ |
| 401 | 401 | $sql = "SELECT rowid"; |
| 402 | - $sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_lignes"; |
|
| 403 | - $sql .= " WHERE fk_prelevement_bons = " . ((int) $this->id); |
|
| 402 | + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes"; |
|
| 403 | + $sql .= " WHERE fk_prelevement_bons = ".((int) $this->id); |
|
| 404 | 404 | if ($sourcetype == 'salary') { |
| 405 | - $sql .= " AND fk_soc = " . ((int) $client_id); |
|
| 405 | + $sql .= " AND fk_soc = ".((int) $client_id); |
|
| 406 | 406 | } else { |
| 407 | - $sql .= " AND fk_user = " . ((int) $client_id); |
|
| 407 | + $sql .= " AND fk_user = ".((int) $client_id); |
|
| 408 | 408 | } |
| 409 | - $sql .= " AND code_banque = '" . $this->db->escape($code_banque) . "'"; |
|
| 410 | - $sql .= " AND code_guichet = '" . $this->db->escape($code_guichet) . "'"; |
|
| 411 | - $sql .= " AND number = '" . $this->db->escape($number) . "'"; |
|
| 409 | + $sql .= " AND code_banque = '".$this->db->escape($code_banque)."'"; |
|
| 410 | + $sql .= " AND code_guichet = '".$this->db->escape($code_guichet)."'"; |
|
| 411 | + $sql .= " AND number = '".$this->db->escape($number)."'"; |
|
| 412 | 412 | |
| 413 | 413 | $resql = $this->db->query($sql); |
| 414 | 414 | if ($resql) { |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | /* |
| 421 | 421 | * No aggregate |
| 422 | 422 | */ |
| 423 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_lignes ("; |
|
| 423 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes ("; |
|
| 424 | 424 | $sql .= "fk_prelevement_bons"; |
| 425 | 425 | $sql .= ", fk_soc"; |
| 426 | 426 | $sql .= ", client_nom"; |
@@ -432,21 +432,21 @@ discard block |
||
| 432 | 432 | $sql .= ($sourcetype == 'salary' ? ", fk_user" : ""); |
| 433 | 433 | $sql .= ") VALUES ("; |
| 434 | 434 | $sql .= $this->id; |
| 435 | - $sql .= ", " . (($sourcetype != 'salary') ? ((int) $client_id) : "0"); // fk_soc can't be null |
|
| 436 | - $sql .= ", '" . $this->db->escape($client_nom) . "'"; |
|
| 437 | - $sql .= ", " . ((float) price2num($amount)); |
|
| 438 | - $sql .= ", '" . $this->db->escape($code_banque) . "'"; |
|
| 439 | - $sql .= ", '" . $this->db->escape($code_guichet) . "'"; |
|
| 440 | - $sql .= ", '" . $this->db->escape($number) . "'"; |
|
| 441 | - $sql .= ", '" . $this->db->escape($number_key) . "'"; |
|
| 442 | - $sql .= (($sourcetype == 'salary') ? ", " . ((int) $client_id) : ''); |
|
| 435 | + $sql .= ", ".(($sourcetype != 'salary') ? ((int) $client_id) : "0"); // fk_soc can't be null |
|
| 436 | + $sql .= ", '".$this->db->escape($client_nom)."'"; |
|
| 437 | + $sql .= ", ".((float) price2num($amount)); |
|
| 438 | + $sql .= ", '".$this->db->escape($code_banque)."'"; |
|
| 439 | + $sql .= ", '".$this->db->escape($code_guichet)."'"; |
|
| 440 | + $sql .= ", '".$this->db->escape($number)."'"; |
|
| 441 | + $sql .= ", '".$this->db->escape($number_key)."'"; |
|
| 442 | + $sql .= (($sourcetype == 'salary') ? ", ".((int) $client_id) : ''); |
|
| 443 | 443 | $sql .= ")"; |
| 444 | 444 | if ($this->db->query($sql)) { |
| 445 | - $line_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "prelevement_lignes"); |
|
| 445 | + $line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes"); |
|
| 446 | 446 | $result = 0; |
| 447 | 447 | } else { |
| 448 | - $this->errors[] = get_class($this) . "::addline Error -2 " . $this->db->lasterror; |
|
| 449 | - dol_syslog(get_class($this) . "::addline Error -2"); |
|
| 448 | + $this->errors[] = get_class($this)."::addline Error -2 ".$this->db->lasterror; |
|
| 449 | + dol_syslog(get_class($this)."::addline Error -2"); |
|
| 450 | 450 | $result = -2; |
| 451 | 451 | } |
| 452 | 452 | } |
@@ -489,15 +489,15 @@ discard block |
||
| 489 | 489 | $sql .= ", p.type"; |
| 490 | 490 | $sql .= ", p.fk_bank_account"; |
| 491 | 491 | $sql .= ", p.statut as status"; |
| 492 | - $sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as p"; |
|
| 493 | - $sql .= " WHERE p.entity IN (" . getEntity('invoice') . ")"; |
|
| 492 | + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; |
|
| 493 | + $sql .= " WHERE p.entity IN (".getEntity('invoice').")"; |
|
| 494 | 494 | if ($rowid > 0) { |
| 495 | - $sql .= " AND p.rowid = " . ((int) $rowid); |
|
| 495 | + $sql .= " AND p.rowid = ".((int) $rowid); |
|
| 496 | 496 | } else { |
| 497 | - $sql .= " AND p.ref = '" . $this->db->escape($ref) . "'"; |
|
| 497 | + $sql .= " AND p.ref = '".$this->db->escape($ref)."'"; |
|
| 498 | 498 | } |
| 499 | 499 | |
| 500 | - dol_syslog(get_class($this) . "::fetch", LOG_DEBUG); |
|
| 500 | + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); |
|
| 501 | 501 | $result = $this->db->query($sql); |
| 502 | 502 | if ($result) { |
| 503 | 503 | if ($this->db->num_rows($result)) { |
@@ -523,13 +523,13 @@ discard block |
||
| 523 | 523 | if (empty($this->status)) { // Value is sometimes null in database |
| 524 | 524 | $this->status = 0; |
| 525 | 525 | } |
| 526 | - $this->statut = $this->status; // For backward compatibility |
|
| 526 | + $this->statut = $this->status; // For backward compatibility |
|
| 527 | 527 | |
| 528 | 528 | $this->fetched = 1; |
| 529 | 529 | |
| 530 | 530 | return 1; |
| 531 | 531 | } else { |
| 532 | - dol_syslog(get_class($this) . "::Fetch no record found"); |
|
| 532 | + dol_syslog(get_class($this)."::Fetch no record found"); |
|
| 533 | 533 | return 0; |
| 534 | 534 | } |
| 535 | 535 | } else { |
@@ -570,19 +570,19 @@ discard block |
||
| 570 | 570 | if ($date < $this->date_trans) { |
| 571 | 571 | $langs->load("errors"); |
| 572 | 572 | $this->error = $langs->trans('ErrorDateOfMovementLowerThanDateOfFileTransmission'); |
| 573 | - dol_syslog("bon-prelevment::set_infocredit 1027 " . $this->error); |
|
| 573 | + dol_syslog("bon-prelevment::set_infocredit 1027 ".$this->error); |
|
| 574 | 574 | return -1027; |
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | $this->db->begin(); |
| 578 | 578 | |
| 579 | - $sql = " UPDATE " . MAIN_DB_PREFIX . "prelevement_bons"; |
|
| 580 | - $sql .= " SET fk_user_credit = " . ((int) $user->id); |
|
| 581 | - $sql .= ", statut = " . self::STATUS_CREDITED; |
|
| 582 | - $sql .= ", date_credit = '" . $this->db->idate($date) . "'"; |
|
| 583 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
| 584 | - $sql .= " AND entity = " . ((int) $conf->entity); |
|
| 585 | - $sql .= " AND statut = " . self::STATUS_TRANSFERED; |
|
| 579 | + $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_bons"; |
|
| 580 | + $sql .= " SET fk_user_credit = ".((int) $user->id); |
|
| 581 | + $sql .= ", statut = ".self::STATUS_CREDITED; |
|
| 582 | + $sql .= ", date_credit = '".$this->db->idate($date)."'"; |
|
| 583 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
| 584 | + $sql .= " AND entity = ".((int) $conf->entity); |
|
| 585 | + $sql .= " AND statut = ".self::STATUS_TRANSFERED; |
|
| 586 | 586 | |
| 587 | 587 | $resql = $this->db->query($sql); |
| 588 | 588 | if ($resql) { |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | $error++; |
| 697 | 697 | $this->error = $paiement->error; |
| 698 | 698 | $this->errors = $paiement->errors; |
| 699 | - dol_syslog(get_class($this) . "::set_infocredit AddPayment Error " . $this->error); |
|
| 699 | + dol_syslog(get_class($this)."::set_infocredit AddPayment Error ".$this->error); |
|
| 700 | 700 | } else { |
| 701 | 701 | if ($this->type == 'bank-transfer') { |
| 702 | 702 | if ($type == 'salary') { |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | } else { |
| 712 | 712 | $modeforaddpayment = 'payment'; |
| 713 | 713 | $labelforaddpayment = '(CustomerInvoicePayment)'; |
| 714 | - $addbankurl = 'direct-debit'; // = 'directdebit' |
|
| 714 | + $addbankurl = 'direct-debit'; // = 'directdebit' |
|
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | $error++; |
| 727 | 727 | $this->error = $paiement->error; |
| 728 | 728 | $this->errors = $paiement->errors; |
| 729 | - dol_syslog(get_class($this) . "::set_infocredit AddPaymentToBank Error " . $this->error); |
|
| 729 | + dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error); |
|
| 730 | 730 | } |
| 731 | 731 | } |
| 732 | 732 | } |
@@ -734,24 +734,24 @@ discard block |
||
| 734 | 734 | // Update withdrawal line |
| 735 | 735 | // TODO: Translate to ligneprelevement.class.php |
| 736 | 736 | if (!$error) { |
| 737 | - $sql = " UPDATE " . MAIN_DB_PREFIX . "prelevement_lignes"; |
|
| 737 | + $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes"; |
|
| 738 | 738 | $sql .= " SET statut = 2"; |
| 739 | - $sql .= " WHERE fk_prelevement_bons = " . ((int) $this->id); |
|
| 739 | + $sql .= " WHERE fk_prelevement_bons = ".((int) $this->id); |
|
| 740 | 740 | |
| 741 | 741 | if (!$this->db->query($sql)) { |
| 742 | - dol_syslog(get_class($this) . "::set_infocredit Update lines Error"); |
|
| 742 | + dol_syslog(get_class($this)."::set_infocredit Update lines Error"); |
|
| 743 | 743 | $error++; |
| 744 | 744 | } |
| 745 | 745 | } |
| 746 | 746 | } else { |
| 747 | 747 | $this->error = $this->db->lasterror(); |
| 748 | - dol_syslog(get_class($this) . "::set_infocredit Update Bons Error"); |
|
| 748 | + dol_syslog(get_class($this)."::set_infocredit Update Bons Error"); |
|
| 749 | 749 | $error++; |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | // End of procedure |
| 753 | 753 | if ($error == 0) { |
| 754 | - $this->date_credit = $date; // date credit or debit |
|
| 754 | + $this->date_credit = $date; // date credit or debit |
|
| 755 | 755 | $this->statut = self::STATUS_CREDITED; |
| 756 | 756 | $this->status = self::STATUS_CREDITED; |
| 757 | 757 | |
@@ -782,17 +782,17 @@ discard block |
||
| 782 | 782 | |
| 783 | 783 | $error = 0; |
| 784 | 784 | |
| 785 | - dol_syslog(get_class($this) . "::set_infotrans Start", LOG_INFO); |
|
| 785 | + dol_syslog(get_class($this)."::set_infotrans Start", LOG_INFO); |
|
| 786 | 786 | |
| 787 | 787 | if ($this->db->begin()) { |
| 788 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons "; |
|
| 789 | - $sql .= " SET fk_user_trans = " . $user->id; |
|
| 790 | - $sql .= " , date_trans = '" . $this->db->idate($date) . "'"; |
|
| 791 | - $sql .= " , method_trans = " . ((int) $method); |
|
| 792 | - $sql .= " , statut = " . self::STATUS_TRANSFERED; |
|
| 793 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
| 794 | - $sql .= " AND entity = " . ((int) $conf->entity); |
|
| 795 | - $sql .= " AND statut = " . self::STATUS_DRAFT; |
|
| 788 | + $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons "; |
|
| 789 | + $sql .= " SET fk_user_trans = ".$user->id; |
|
| 790 | + $sql .= " , date_trans = '".$this->db->idate($date)."'"; |
|
| 791 | + $sql .= " , method_trans = ".((int) $method); |
|
| 792 | + $sql .= " , statut = ".self::STATUS_TRANSFERED; |
|
| 793 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
| 794 | + $sql .= " AND entity = ".((int) $conf->entity); |
|
| 795 | + $sql .= " AND statut = ".self::STATUS_DRAFT; |
|
| 796 | 796 | |
| 797 | 797 | if ($this->db->query($sql)) { |
| 798 | 798 | $this->method_trans = $method; |
@@ -817,12 +817,12 @@ discard block |
||
| 817 | 817 | return 0; |
| 818 | 818 | } else { |
| 819 | 819 | $this->db->rollback(); |
| 820 | - dol_syslog(get_class($this) . "::set_infotrans ROLLBACK", LOG_ERR); |
|
| 820 | + dol_syslog(get_class($this)."::set_infotrans ROLLBACK", LOG_ERR); |
|
| 821 | 821 | |
| 822 | 822 | return -1; |
| 823 | 823 | } |
| 824 | 824 | } else { |
| 825 | - dol_syslog(get_class($this) . "::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT); |
|
| 825 | + dol_syslog(get_class($this)."::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT); |
|
| 826 | 826 | return -2; |
| 827 | 827 | } |
| 828 | 828 | } |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | |
| 842 | 842 | $arr = array(); |
| 843 | 843 | |
| 844 | - dol_syslog(get_class($this) . "::getListInvoices"); |
|
| 844 | + dol_syslog(get_class($this)."::getListInvoices"); |
|
| 845 | 845 | |
| 846 | 846 | // Returns all invoices presented within same order |
| 847 | 847 | $sql = "SELECT "; |
@@ -857,13 +857,13 @@ discard block |
||
| 857 | 857 | if ($amounts) { |
| 858 | 858 | $sql .= ", SUM(pl.amount)"; |
| 859 | 859 | } |
| 860 | - $sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as pb,"; |
|
| 861 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,"; |
|
| 862 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement as p"; |
|
| 860 | + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as pb,"; |
|
| 861 | + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; |
|
| 862 | + $sql .= " ".MAIN_DB_PREFIX."prelevement as p"; |
|
| 863 | 863 | $sql .= " WHERE p.fk_prelevement_lignes = pl.rowid"; |
| 864 | 864 | $sql .= " AND pl.fk_prelevement_bons = pb.rowid"; |
| 865 | - $sql .= " AND pb.rowid = " . ((int) $this->id); |
|
| 866 | - $sql .= " AND pb.entity = " . ((int) $conf->entity); |
|
| 865 | + $sql .= " AND pb.rowid = ".((int) $this->id); |
|
| 866 | + $sql .= " AND pb.entity = ".((int) $conf->entity); |
|
| 867 | 867 | if ($amounts) { |
| 868 | 868 | if ($this->type == 'bank-transfer') { |
| 869 | 869 | if ($type == 'salary') { |
@@ -917,17 +917,17 @@ discard block |
||
| 917 | 917 | $sql = "SELECT sum(pd.amount) as nb"; |
| 918 | 918 | if ($type !== 'salary') { |
| 919 | 919 | if ($mode != 'bank-transfer') { |
| 920 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f,"; |
|
| 920 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; |
|
| 921 | 921 | } else { |
| 922 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f,"; |
|
| 922 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; |
|
| 923 | 923 | } |
| 924 | 924 | } else { |
| 925 | - $sql .= " FROM " . MAIN_DB_PREFIX . "salary as s,"; |
|
| 925 | + $sql .= " FROM ".MAIN_DB_PREFIX."salary as s,"; |
|
| 926 | 926 | } |
| 927 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement_demande as pd"; |
|
| 928 | - $sql .= ($type !== 'salary' ? " WHERE f.entity IN (" . getEntity('invoice') . ")" : " WHERE s.entity IN (" . getEntity('salary') . ")"); |
|
| 927 | + $sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pd"; |
|
| 928 | + $sql .= ($type !== 'salary' ? " WHERE f.entity IN (".getEntity('invoice').")" : " WHERE s.entity IN (".getEntity('salary').")"); |
|
| 929 | 929 | if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) { |
| 930 | - $sql .= ($type !== 'salary' ? " AND f.fk_statut = " . Facture::STATUS_VALIDATED : " AND s.paye = " . Salary::STATUS_UNPAID); |
|
| 930 | + $sql .= ($type !== 'salary' ? " AND f.fk_statut = ".Facture::STATUS_VALIDATED : " AND s.paye = ".Salary::STATUS_UNPAID); |
|
| 931 | 931 | } |
| 932 | 932 | if ($type !== 'salary') { |
| 933 | 933 | if ($mode != 'bank-transfer') { |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | return $obj->nb; |
| 953 | 953 | } else { |
| 954 | 954 | $error = 1; |
| 955 | - dol_syslog(get_class($this) . "::SommeAPrelever Erreur -1"); |
|
| 955 | + dol_syslog(get_class($this)."::SommeAPrelever Erreur -1"); |
|
| 956 | 956 | dol_syslog($this->db->error()); |
| 957 | 957 | |
| 958 | 958 | return -1; |
@@ -988,26 +988,26 @@ discard block |
||
| 988 | 988 | // phpcs:enable |
| 989 | 989 | if ($forsalary == 1) { |
| 990 | 990 | $sql = "SELECT count(s.rowid) as nb"; |
| 991 | - $sql .= " FROM " . MAIN_DB_PREFIX . "salary as s"; |
|
| 991 | + $sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; |
|
| 992 | 992 | } else { |
| 993 | 993 | $sql = "SELECT count(f.rowid) as nb"; |
| 994 | 994 | |
| 995 | 995 | if ($type == 'bank-transfer') { |
| 996 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; |
|
| 996 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
|
| 997 | 997 | } else { |
| 998 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
| 998 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
| 999 | 999 | } |
| 1000 | 1000 | } |
| 1001 | - $sql .= ", " . MAIN_DB_PREFIX . "prelevement_demande as pd"; |
|
| 1001 | + $sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pd"; |
|
| 1002 | 1002 | if ($forsalary == 1) { |
| 1003 | - $sql .= " WHERE s.entity IN (" . getEntity('invoice') . ")"; |
|
| 1003 | + $sql .= " WHERE s.entity IN (".getEntity('invoice').")"; |
|
| 1004 | 1004 | if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) { |
| 1005 | 1005 | $sql .= " AND s.paye = 0"; |
| 1006 | 1006 | } |
| 1007 | 1007 | } else { |
| 1008 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 1008 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 1009 | 1009 | if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) { |
| 1010 | - $sql .= " AND f.fk_statut = " . Facture::STATUS_VALIDATED; |
|
| 1010 | + $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; |
|
| 1011 | 1011 | } |
| 1012 | 1012 | } |
| 1013 | 1013 | if ($forsalary == 1) { |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | $sql .= " AND s.paye = 0"; |
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | - dol_syslog(get_class($this) . "::NbFactureAPrelever"); |
|
| 1030 | + dol_syslog(get_class($this)."::NbFactureAPrelever"); |
|
| 1031 | 1031 | $resql = $this->db->query($sql); |
| 1032 | 1032 | |
| 1033 | 1033 | if ($resql) { |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | |
| 1037 | 1037 | return $obj->nb; |
| 1038 | 1038 | } else { |
| 1039 | - $this->error = get_class($this) . "::NbFactureAPrelever Erreur -1 sql=" . $this->db->error(); |
|
| 1039 | + $this->error = get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error(); |
|
| 1040 | 1040 | return -1; |
| 1041 | 1041 | } |
| 1042 | 1042 | } |
@@ -1068,10 +1068,10 @@ discard block |
||
| 1068 | 1068 | // phpcs:enable |
| 1069 | 1069 | global $conf, $langs, $user; |
| 1070 | 1070 | |
| 1071 | - dol_syslog(__METHOD__ . " Bank=" . $banque . " Office=" . $agence . " mode=" . $mode . " format=" . $format, LOG_DEBUG); |
|
| 1071 | + dol_syslog(__METHOD__." Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG); |
|
| 1072 | 1072 | |
| 1073 | - require_once DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php"; |
|
| 1074 | - require_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php"; |
|
| 1073 | + require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; |
|
| 1074 | + require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; |
|
| 1075 | 1075 | |
| 1076 | 1076 | // Check params |
| 1077 | 1077 | if ($type != 'bank-transfer') { |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | $factures_prev_id = array(); |
| 1108 | 1108 | $factures_errors = array(); |
| 1109 | 1109 | if (!$error) { |
| 1110 | - dol_syslog(__METHOD__ . " Read invoices for did=" . ((int) $did), LOG_DEBUG); |
|
| 1110 | + dol_syslog(__METHOD__." Read invoices for did=".((int) $did), LOG_DEBUG); |
|
| 1111 | 1111 | |
| 1112 | 1112 | $sql = "SELECT f.rowid, pd.rowid as pfdrowid"; |
| 1113 | 1113 | if ($sourcetype != 'salary') { |
@@ -1126,30 +1126,30 @@ discard block |
||
| 1126 | 1126 | } |
| 1127 | 1127 | if ($sourcetype != 'salary') { |
| 1128 | 1128 | if ($type != 'bank-transfer') { |
| 1129 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
| 1130 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_facture"; |
|
| 1129 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
| 1130 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_demande as pd ON f.rowid = pd.fk_facture"; |
|
| 1131 | 1131 | } else { |
| 1132 | - $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; |
|
| 1133 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_facture_fourn"; |
|
| 1132 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
|
| 1133 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_demande as pd ON f.rowid = pd.fk_facture_fourn"; |
|
| 1134 | 1134 | } |
| 1135 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; |
|
| 1136 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_rib as sr ON s.rowid = sr.fk_soc AND sr.default_rib = 1"; |
|
| 1135 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
|
| 1136 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_rib as sr ON s.rowid = sr.fk_soc AND sr.default_rib = 1"; |
|
| 1137 | 1137 | } else { |
| 1138 | - $sql .= " FROM " . MAIN_DB_PREFIX . "salary as f"; |
|
| 1139 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_salary"; |
|
| 1140 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as s ON s.rowid = f.fk_user"; |
|
| 1141 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user_rib as sr ON s.rowid = sr.fk_user"; |
|
| 1138 | + $sql .= " FROM ".MAIN_DB_PREFIX."salary as f"; |
|
| 1139 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_demande as pd ON f.rowid = pd.fk_salary"; |
|
| 1140 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as s ON s.rowid = f.fk_user"; |
|
| 1141 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user_rib as sr ON s.rowid = sr.fk_user"; |
|
| 1142 | 1142 | // TODO Add 'AND sr.default_rib = 1' here. Note: the column has been created in v21 in llx_user_rib and default to 0 |
| 1143 | 1143 | // If we add a test on sr.default_rib = 1, we must also check we have a correct error management to stop if no default BAN is found. |
| 1144 | 1144 | } |
| 1145 | 1145 | if ($sourcetype != 'salary') { |
| 1146 | 1146 | if ($type != 'bank-transfer') { |
| 1147 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ')'; |
|
| 1147 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').')'; |
|
| 1148 | 1148 | } else { |
| 1149 | - $sql .= " WHERE f.entity IN (" . getEntity('supplier_invoice') . ')'; |
|
| 1149 | + $sql .= " WHERE f.entity IN (".getEntity('supplier_invoice').')'; |
|
| 1150 | 1150 | } |
| 1151 | 1151 | } else { |
| 1152 | - $sql .= " WHERE f.entity IN (" . getEntity('salary') . ')'; |
|
| 1152 | + $sql .= " WHERE f.entity IN (".getEntity('salary').')'; |
|
| 1153 | 1153 | } |
| 1154 | 1154 | if ($sourcetype != 'salary') { |
| 1155 | 1155 | $sql .= " AND f.fk_statut = 1"; // Invoice validated |
@@ -1163,10 +1163,10 @@ discard block |
||
| 1163 | 1163 | $sql .= " AND pd.traite = 0"; |
| 1164 | 1164 | $sql .= " AND pd.ext_payment_id IS NULL"; |
| 1165 | 1165 | if ($sourcetype != 'salary') { |
| 1166 | - $sql .= " AND sr.type = 'ban'"; // TODO Add AND sr.type = 'ban' for users too |
|
| 1166 | + $sql .= " AND sr.type = 'ban'"; // TODO Add AND sr.type = 'ban' for users too |
|
| 1167 | 1167 | } |
| 1168 | 1168 | if ($did > 0) { |
| 1169 | - $sql .= " AND pd.rowid = " . ((int) $did); |
|
| 1169 | + $sql .= " AND pd.rowid = ".((int) $did); |
|
| 1170 | 1170 | } |
| 1171 | 1171 | |
| 1172 | 1172 | $resql = $this->db->query($sql); |
@@ -1175,41 +1175,41 @@ discard block |
||
| 1175 | 1175 | $i = 0; |
| 1176 | 1176 | |
| 1177 | 1177 | while ($i < $num) { |
| 1178 | - $row = $this->db->fetch_row($resql); // TODO Replace with fetch_object() |
|
| 1178 | + $row = $this->db->fetch_row($resql); // TODO Replace with fetch_object() |
|
| 1179 | 1179 | $factures[$i] = $row; // All fields |
| 1180 | 1180 | |
| 1181 | 1181 | if ($row[7] == 0) { |
| 1182 | 1182 | $error++; |
| 1183 | - dol_syslog(__METHOD__ . " Read invoices/salary error Found a null amount", LOG_ERR); |
|
| 1184 | - $this->invoice_in_error[$row[0]] = "Error for invoice or salary id " . $row[0] . ", found a null amount"; |
|
| 1183 | + dol_syslog(__METHOD__." Read invoices/salary error Found a null amount", LOG_ERR); |
|
| 1184 | + $this->invoice_in_error[$row[0]] = "Error for invoice or salary id ".$row[0].", found a null amount"; |
|
| 1185 | 1185 | break; |
| 1186 | 1186 | } |
| 1187 | 1187 | $i++; |
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | $this->db->free($resql); |
| 1191 | - dol_syslog(__METHOD__ . " Read invoices/salary, " . $i . " invoices/salary to withdraw", LOG_DEBUG); |
|
| 1191 | + dol_syslog(__METHOD__." Read invoices/salary, ".$i." invoices/salary to withdraw", LOG_DEBUG); |
|
| 1192 | 1192 | } else { |
| 1193 | 1193 | $error++; |
| 1194 | 1194 | $this->error = $this->db->lasterror(); |
| 1195 | - dol_syslog(__METHOD__ . " Read invoices/salary error " . $this->db->lasterror(), LOG_ERR); |
|
| 1195 | + dol_syslog(__METHOD__." Read invoices/salary error ".$this->db->lasterror(), LOG_ERR); |
|
| 1196 | 1196 | return -1; |
| 1197 | 1197 | } |
| 1198 | 1198 | } |
| 1199 | 1199 | |
| 1200 | 1200 | if (!$error) { |
| 1201 | 1201 | // Make some checks |
| 1202 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1203 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 1204 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; |
|
| 1205 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; |
|
| 1202 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1203 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 1204 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
|
| 1205 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; |
|
| 1206 | 1206 | |
| 1207 | 1207 | $tmpsoc = new Societe($this->db); |
| 1208 | 1208 | $tmpuser = new User($this->db); |
| 1209 | 1209 | |
| 1210 | 1210 | // Check BAN |
| 1211 | 1211 | $i = 0; |
| 1212 | - dol_syslog(__METHOD__ . " Check BAN", LOG_DEBUG); |
|
| 1212 | + dol_syslog(__METHOD__." Check BAN", LOG_DEBUG); |
|
| 1213 | 1213 | |
| 1214 | 1214 | if (count($factures) > 0) { |
| 1215 | 1215 | foreach ($factures as $key => $fac) { |
@@ -1249,31 +1249,31 @@ discard block |
||
| 1249 | 1249 | if ($type != 'bank-transfer') { |
| 1250 | 1250 | $tmpsoc->id = $fac[2]; |
| 1251 | 1251 | $tmpsoc->name = $fac[8]; |
| 1252 | - $invoice_url = "<a href='" . DOL_URL_ROOT . '/compta/facture/card.php?facid=' . $fac[0] . "'>" . $fac[9] . "</a>"; |
|
| 1253 | - $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0); |
|
| 1254 | - $this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0); |
|
| 1252 | + $invoice_url = "<a href='".DOL_URL_ROOT.'/compta/facture/card.php?facid='.$fac[0]."'>".$fac[9]."</a>"; |
|
| 1253 | + $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0); |
|
| 1254 | + $this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0); |
|
| 1255 | 1255 | $error++; |
| 1256 | 1256 | } |
| 1257 | 1257 | if ($type == 'bank-transfer' && $sourcetype != 'salary') { |
| 1258 | 1258 | $tmpsoc->id = $fac[2]; |
| 1259 | 1259 | $tmpsoc->name = $fac[8]; |
| 1260 | - $invoice_url = "<a href='" . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $fac[0] . "'>" . $fac[9] . "</a>"; |
|
| 1261 | - $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0); |
|
| 1262 | - $this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0); |
|
| 1260 | + $invoice_url = "<a href='".DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$fac[0]."'>".$fac[9]."</a>"; |
|
| 1261 | + $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0); |
|
| 1262 | + $this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0); |
|
| 1263 | 1263 | $error++; |
| 1264 | 1264 | } |
| 1265 | 1265 | if ($type == 'bank-transfer' && $sourcetype == 'salary') { |
| 1266 | 1266 | $tmpuser->id = $fac[2]; |
| 1267 | 1267 | $tmpuser->firstname = $fac[8]; |
| 1268 | - $salary_url = "<a href='" . DOL_URL_ROOT . '/salaries/card.php?id=' . $fac[0] . "'>" . $fac[0] . "</a>"; |
|
| 1269 | - $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for salary " . $salary_url . " for employee " . $tmpuser->getNomUrl(0); |
|
| 1270 | - $this->thirdparty_in_error[$tmpuser->id] = "Error on default bank number IBAN/BIC for salary " . $salary_url . " for employee " . $tmpuser->getNomUrl(0); |
|
| 1268 | + $salary_url = "<a href='".DOL_URL_ROOT.'/salaries/card.php?id='.$fac[0]."'>".$fac[0]."</a>"; |
|
| 1269 | + $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for salary ".$salary_url." for employee ".$tmpuser->getNomUrl(0); |
|
| 1270 | + $this->thirdparty_in_error[$tmpuser->id] = "Error on default bank number IBAN/BIC for salary ".$salary_url." for employee ".$tmpuser->getNomUrl(0); |
|
| 1271 | 1271 | $error++; |
| 1272 | 1272 | } |
| 1273 | - dol_syslog(__METHOD__ . " Check BAN Error on default bank number IBAN/BIC reported by verif(): " . implode(', ', $fac), LOG_WARNING); |
|
| 1273 | + dol_syslog(__METHOD__." Check BAN Error on default bank number IBAN/BIC reported by verif(): ".implode(', ', $fac), LOG_WARNING); |
|
| 1274 | 1274 | } |
| 1275 | 1275 | } else { |
| 1276 | - dol_syslog(__METHOD__ . " Check BAN Failed to read company", LOG_WARNING); |
|
| 1276 | + dol_syslog(__METHOD__." Check BAN Failed to read company", LOG_WARNING); |
|
| 1277 | 1277 | } |
| 1278 | 1278 | /* |
| 1279 | 1279 | } else { |
@@ -1282,14 +1282,14 @@ discard block |
||
| 1282 | 1282 | */ |
| 1283 | 1283 | } |
| 1284 | 1284 | } else { |
| 1285 | - dol_syslog(__METHOD__ . " Check BAN No invoice to process", LOG_WARNING); |
|
| 1285 | + dol_syslog(__METHOD__." Check BAN No invoice to process", LOG_WARNING); |
|
| 1286 | 1286 | } |
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | $ok = 0; |
| 1290 | 1290 | |
| 1291 | 1291 | // Withdraw invoices in factures_prev array |
| 1292 | - $out = count($factures_prev) . " invoices will be included."; |
|
| 1292 | + $out = count($factures_prev)." invoices will be included."; |
|
| 1293 | 1293 | //print $out."\n"; |
| 1294 | 1294 | dol_syslog($out); |
| 1295 | 1295 | |
@@ -1323,32 +1323,32 @@ discard block |
||
| 1323 | 1323 | * Process order generation |
| 1324 | 1324 | */ |
| 1325 | 1325 | if (!$error) { |
| 1326 | - $ref = substr($year, -2) . $month; |
|
| 1326 | + $ref = substr($year, -2).$month; |
|
| 1327 | 1327 | |
| 1328 | 1328 | // Get next free number for the ref of bon prelevement |
| 1329 | - $sql = "SELECT substring(ref from char_length(ref) - 1)"; // To extract "YYMMXX" from "TYYMMXX" |
|
| 1330 | - $sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons"; |
|
| 1331 | - $sql .= " WHERE ref LIKE '_" . $this->db->escape($ref) . "%'"; |
|
| 1332 | - $sql .= " AND entity = " . ((int) $conf->entity); |
|
| 1329 | + $sql = "SELECT substring(ref from char_length(ref) - 1)"; // To extract "YYMMXX" from "TYYMMXX" |
|
| 1330 | + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons"; |
|
| 1331 | + $sql .= " WHERE ref LIKE '_".$this->db->escape($ref)."%'"; |
|
| 1332 | + $sql .= " AND entity = ".((int) $conf->entity); |
|
| 1333 | 1333 | $sql .= " ORDER BY ref DESC LIMIT 1"; |
| 1334 | 1334 | |
| 1335 | - dol_syslog(get_class($this) . " get next free number", LOG_DEBUG); |
|
| 1335 | + dol_syslog(get_class($this)." get next free number", LOG_DEBUG); |
|
| 1336 | 1336 | $resql = $this->db->query($sql); |
| 1337 | 1337 | |
| 1338 | 1338 | if ($resql) { |
| 1339 | 1339 | $row = $this->db->fetch_row($resql); |
| 1340 | 1340 | |
| 1341 | 1341 | // Build the new ref |
| 1342 | - $ref = "T" . $ref . sprintf("%02d", (intval($row[0]) + 1)); |
|
| 1342 | + $ref = "T".$ref.sprintf("%02d", (intval($row[0]) + 1)); |
|
| 1343 | 1343 | |
| 1344 | 1344 | // $conf->abc->dir_output may be: |
| 1345 | 1345 | // /home/ldestailleur/git/dolibarr_15.0/documents/abc/ |
| 1346 | 1346 | // or |
| 1347 | 1347 | // /home/ldestailleur/git/dolibarr_15.0/documents/X/abc with X >= 2 with multicompany. |
| 1348 | 1348 | if ($type != 'bank-transfer') { |
| 1349 | - $dir = $conf->prelevement->dir_output . '/receipts'; |
|
| 1349 | + $dir = $conf->prelevement->dir_output.'/receipts'; |
|
| 1350 | 1350 | } else { |
| 1351 | - $dir = $conf->paymentbybanktransfer->dir_output . '/receipts'; |
|
| 1351 | + $dir = $conf->paymentbybanktransfer->dir_output.'/receipts'; |
|
| 1352 | 1352 | } |
| 1353 | 1353 | if (!is_dir($dir)) { |
| 1354 | 1354 | dol_mkdir($dir); |
@@ -1356,41 +1356,41 @@ discard block |
||
| 1356 | 1356 | |
| 1357 | 1357 | if (isModEnabled('multicompany')) { |
| 1358 | 1358 | $labelentity = $conf->entity; |
| 1359 | - $this->filename = $dir . '/' . $ref . '-' . $labelentity . '.xml'; |
|
| 1359 | + $this->filename = $dir.'/'.$ref.'-'.$labelentity.'.xml'; |
|
| 1360 | 1360 | } else { |
| 1361 | - $this->filename = $dir . '/' . $ref . '.xml'; |
|
| 1361 | + $this->filename = $dir.'/'.$ref.'.xml'; |
|
| 1362 | 1362 | } |
| 1363 | 1363 | |
| 1364 | 1364 | // Create withdraw order in database |
| 1365 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_bons ("; |
|
| 1365 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons ("; |
|
| 1366 | 1366 | $sql .= "ref, entity, datec, type, fk_bank_account"; |
| 1367 | 1367 | $sql .= ") VALUES ("; |
| 1368 | - $sql .= "'" . $this->db->escape($ref) . "'"; |
|
| 1369 | - $sql .= ", " . ((int) $conf->entity); |
|
| 1370 | - $sql .= ", '" . $this->db->idate($now) . "'"; |
|
| 1371 | - $sql .= ", '" . ($type == 'bank-transfer' ? 'bank-transfer' : 'debit-order') . "'"; |
|
| 1372 | - $sql .= ", " . ((int) $fk_bank_account); |
|
| 1368 | + $sql .= "'".$this->db->escape($ref)."'"; |
|
| 1369 | + $sql .= ", ".((int) $conf->entity); |
|
| 1370 | + $sql .= ", '".$this->db->idate($now)."'"; |
|
| 1371 | + $sql .= ", '".($type == 'bank-transfer' ? 'bank-transfer' : 'debit-order')."'"; |
|
| 1372 | + $sql .= ", ".((int) $fk_bank_account); |
|
| 1373 | 1373 | $sql .= ")"; |
| 1374 | 1374 | |
| 1375 | 1375 | $resql = $this->db->query($sql); |
| 1376 | 1376 | |
| 1377 | 1377 | |
| 1378 | 1378 | if ($resql) { |
| 1379 | - $prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "prelevement_bons"); |
|
| 1379 | + $prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons"); |
|
| 1380 | 1380 | $this->id = $prev_id; |
| 1381 | 1381 | $this->ref = $ref; |
| 1382 | 1382 | } else { |
| 1383 | 1383 | $error++; |
| 1384 | - dol_syslog(__METHOD__ . " Create withdraw receipt " . $this->db->lasterror(), LOG_ERR); |
|
| 1384 | + dol_syslog(__METHOD__." Create withdraw receipt ".$this->db->lasterror(), LOG_ERR); |
|
| 1385 | 1385 | } |
| 1386 | 1386 | } else { |
| 1387 | 1387 | $error++; |
| 1388 | - dol_syslog(__METHOD__ . " Get last withdraw receipt " . $this->db->lasterror(), LOG_ERR); |
|
| 1388 | + dol_syslog(__METHOD__." Get last withdraw receipt ".$this->db->lasterror(), LOG_ERR); |
|
| 1389 | 1389 | } |
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | if (!$error) { |
| 1393 | - dol_syslog(__METHOD__ . " Now loop on each document to insert them in llx_prelevement_demande"); |
|
| 1393 | + dol_syslog(__METHOD__." Now loop on each document to insert them in llx_prelevement_demande"); |
|
| 1394 | 1394 | |
| 1395 | 1395 | // Add lines for the bon |
| 1396 | 1396 | if (count($factures_prev) > 0) { |
@@ -1419,17 +1419,17 @@ discard block |
||
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | // Update invoice requests as done |
| 1422 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_demande"; |
|
| 1422 | + $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande"; |
|
| 1423 | 1423 | $sql .= " SET traite = 1"; |
| 1424 | - $sql .= ", date_traite = '" . $this->db->idate($now) . "'"; |
|
| 1425 | - $sql .= ", fk_prelevement_bons = " . ((int) $this->id); |
|
| 1426 | - $sql .= " WHERE rowid = " . ((int) $fac[1]); |
|
| 1424 | + $sql .= ", date_traite = '".$this->db->idate($now)."'"; |
|
| 1425 | + $sql .= ", fk_prelevement_bons = ".((int) $this->id); |
|
| 1426 | + $sql .= " WHERE rowid = ".((int) $fac[1]); |
|
| 1427 | 1427 | |
| 1428 | 1428 | $resql = $this->db->query($sql); |
| 1429 | 1429 | if (!$resql) { |
| 1430 | 1430 | $error++; |
| 1431 | 1431 | $this->errors[] = $this->db->lasterror(); |
| 1432 | - dol_syslog(__METHOD__ . " Update Error=" . $this->db->lasterror(), LOG_ERR); |
|
| 1432 | + dol_syslog(__METHOD__." Update Error=".$this->db->lasterror(), LOG_ERR); |
|
| 1433 | 1433 | } |
| 1434 | 1434 | } |
| 1435 | 1435 | } |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | * Create file of type='direct-debit' for direct debit order or type='bank-transfer' for credit transfer into a XML file |
| 1441 | 1441 | */ |
| 1442 | 1442 | |
| 1443 | - dol_syslog(__METHOD__ . " Init direct debit or credit transfer file for " . count($factures_prev) . " invoices", LOG_DEBUG); |
|
| 1443 | + dol_syslog(__METHOD__." Init direct debit or credit transfer file for ".count($factures_prev)." invoices", LOG_DEBUG); |
|
| 1444 | 1444 | |
| 1445 | 1445 | if (count($factures_prev) > 0) { |
| 1446 | 1446 | $this->date_echeance = $datetimeprev; |
@@ -1456,7 +1456,7 @@ discard block |
||
| 1456 | 1456 | $this->emetteur_iban = $account->iban; |
| 1457 | 1457 | $this->emetteur_bic = $account->bic; |
| 1458 | 1458 | |
| 1459 | - $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Example "FR78ZZZ123456" |
|
| 1459 | + $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Example "FR78ZZZ123456" |
|
| 1460 | 1460 | |
| 1461 | 1461 | $this->raison_sociale = $account->proprio; |
| 1462 | 1462 | } |
@@ -1475,7 +1475,7 @@ discard block |
||
| 1475 | 1475 | $error++; |
| 1476 | 1476 | } |
| 1477 | 1477 | } |
| 1478 | - dol_syslog(__METHOD__ . " Bank order file has been generated under filename " . $this->filename, LOG_DEBUG); |
|
| 1478 | + dol_syslog(__METHOD__." Bank order file has been generated under filename ".$this->filename, LOG_DEBUG); |
|
| 1479 | 1479 | } |
| 1480 | 1480 | |
| 1481 | 1481 | |
@@ -1483,15 +1483,15 @@ discard block |
||
| 1483 | 1483 | * Update total defined after generation of file |
| 1484 | 1484 | */ |
| 1485 | 1485 | if (!$error) { |
| 1486 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons"; |
|
| 1487 | - $sql .= " SET amount = " . price2num($this->total); |
|
| 1488 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
| 1489 | - $sql .= " AND entity = " . ((int) $conf->entity); |
|
| 1486 | + $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons"; |
|
| 1487 | + $sql .= " SET amount = ".price2num($this->total); |
|
| 1488 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
| 1489 | + $sql .= " AND entity = ".((int) $conf->entity); |
|
| 1490 | 1490 | $resql = $this->db->query($sql); |
| 1491 | 1491 | |
| 1492 | 1492 | if (!$resql) { |
| 1493 | 1493 | $error++; |
| 1494 | - dol_syslog(__METHOD__ . " Error update total: " . $this->db->error(), LOG_ERR); |
|
| 1494 | + dol_syslog(__METHOD__." Error update total: ".$this->db->error(), LOG_ERR); |
|
| 1495 | 1495 | } |
| 1496 | 1496 | } |
| 1497 | 1497 | |
@@ -1511,7 +1511,7 @@ discard block |
||
| 1511 | 1511 | |
| 1512 | 1512 | if (!$error) { |
| 1513 | 1513 | $this->db->commit(); |
| 1514 | - return count($factures_prev); // The error of failed lines are into $this->invoice_in_error and $this->thirdparty_in_error |
|
| 1514 | + return count($factures_prev); // The error of failed lines are into $this->invoice_in_error and $this->thirdparty_in_error |
|
| 1515 | 1515 | } else { |
| 1516 | 1516 | $this->db->rollback(); |
| 1517 | 1517 | return -1; |
@@ -1550,7 +1550,7 @@ discard block |
||
| 1550 | 1550 | } |
| 1551 | 1551 | |
| 1552 | 1552 | if (!$error) { |
| 1553 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement WHERE fk_prelevement_lignes IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "prelevement_lignes WHERE fk_prelevement_bons = " . ((int) $this->id) . ")"; |
|
| 1553 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id).")"; |
|
| 1554 | 1554 | $resql1 = $this->db->query($sql); |
| 1555 | 1555 | if (!$resql1) { |
| 1556 | 1556 | dol_print_error($this->db); |
@@ -1558,7 +1558,7 @@ discard block |
||
| 1558 | 1558 | } |
| 1559 | 1559 | |
| 1560 | 1560 | if (!$error) { |
| 1561 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement_lignes WHERE fk_prelevement_bons = " . ((int) $this->id); |
|
| 1561 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id); |
|
| 1562 | 1562 | $resql2 = $this->db->query($sql); |
| 1563 | 1563 | if (!$resql2) { |
| 1564 | 1564 | dol_print_error($this->db); |
@@ -1566,7 +1566,7 @@ discard block |
||
| 1566 | 1566 | } |
| 1567 | 1567 | |
| 1568 | 1568 | if (!$error) { |
| 1569 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement_bons WHERE rowid = " . ((int) $this->id); |
|
| 1569 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = ".((int) $this->id); |
|
| 1570 | 1570 | $resql3 = $this->db->query($sql); |
| 1571 | 1571 | if (!$resql3) { |
| 1572 | 1572 | dol_print_error($this->db); |
@@ -1574,7 +1574,7 @@ discard block |
||
| 1574 | 1574 | } |
| 1575 | 1575 | |
| 1576 | 1576 | if (!$error) { |
| 1577 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = " . ((int) $this->id); |
|
| 1577 | + $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".((int) $this->id); |
|
| 1578 | 1578 | $resql4 = $this->db->query($sql); |
| 1579 | 1579 | if (!$resql4) { |
| 1580 | 1580 | dol_print_error($this->db); |
@@ -1616,22 +1616,22 @@ discard block |
||
| 1616 | 1616 | $labeltoshow = 'PaymentByBankTransfer'; |
| 1617 | 1617 | } |
| 1618 | 1618 | |
| 1619 | - $label = img_picto('', $this->picto) . ' <u>' . $langs->trans($labeltoshow) . '</u> ' . $this->getLibStatut(5); |
|
| 1619 | + $label = img_picto('', $this->picto).' <u>'.$langs->trans($labeltoshow).'</u> '.$this->getLibStatut(5); |
|
| 1620 | 1620 | $label .= '<br>'; |
| 1621 | - $label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; |
|
| 1621 | + $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref; |
|
| 1622 | 1622 | if (isset($this->amount)) { |
| 1623 | - $label .= '<br><b>' . $langs->trans("Amount") . ":</b> " . price($this->amount); |
|
| 1623 | + $label .= '<br><b>'.$langs->trans("Amount").":</b> ".price($this->amount); |
|
| 1624 | 1624 | } |
| 1625 | 1625 | if (isset($this->date_trans)) { |
| 1626 | - $label .= '<br><b>' . $langs->trans("TransData") . ":</b> " . dol_print_date($this->date_trans, 'dayhour', 'tzuserrel'); |
|
| 1626 | + $label .= '<br><b>'.$langs->trans("TransData").":</b> ".dol_print_date($this->date_trans, 'dayhour', 'tzuserrel'); |
|
| 1627 | 1627 | } |
| 1628 | 1628 | /*if (isset($this->date_credit)) { |
| 1629 | 1629 | $label .= '<br><b>'.$langs->trans("TransData").":</b> ".dol_print_date($this->date_credit, 'dayhour', 'tzuserrel'); |
| 1630 | 1630 | }*/ |
| 1631 | 1631 | |
| 1632 | - $url = DOL_URL_ROOT . '/compta/prelevement/card.php?id=' . $this->id; |
|
| 1632 | + $url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id; |
|
| 1633 | 1633 | if (!empty($this->type) && $this->type == 'bank-transfer') { |
| 1634 | - $url = DOL_URL_ROOT . '/compta/prelevement/card.php?id=' . $this->id; |
|
| 1634 | + $url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id; |
|
| 1635 | 1635 | } |
| 1636 | 1636 | |
| 1637 | 1637 | if ($option != 'nolink') { |
@@ -1649,21 +1649,21 @@ discard block |
||
| 1649 | 1649 | if (empty($notooltip)) { |
| 1650 | 1650 | if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 1651 | 1651 | $label = $langs->trans("ShowMyObject"); |
| 1652 | - $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; |
|
| 1652 | + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
|
| 1653 | 1653 | } |
| 1654 | - $linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"'; |
|
| 1655 | - $linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"'; |
|
| 1654 | + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
|
| 1655 | + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
|
| 1656 | 1656 | } else { |
| 1657 | - $linkclose = ($morecss ? ' class="' . $morecss . '"' : ''); |
|
| 1657 | + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | - $linkstart = '<a href="' . $url . '"'; |
|
| 1661 | - $linkstart .= $linkclose . '>'; |
|
| 1660 | + $linkstart = '<a href="'.$url.'"'; |
|
| 1661 | + $linkstart .= $linkclose.'>'; |
|
| 1662 | 1662 | $linkend = '</a>'; |
| 1663 | 1663 | |
| 1664 | 1664 | $result .= $linkstart; |
| 1665 | 1665 | if ($withpicto) { |
| 1666 | - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
| 1666 | + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
| 1667 | 1667 | } |
| 1668 | 1668 | if ($withpicto != 2) { |
| 1669 | 1669 | $result .= $this->ref; |
@@ -1692,8 +1692,8 @@ discard block |
||
| 1692 | 1692 | */ |
| 1693 | 1693 | public function deleteNotificationById($rowid) |
| 1694 | 1694 | { |
| 1695 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "notify_def"; |
|
| 1696 | - $sql .= " WHERE rowid = " . ((int) $rowid); |
|
| 1695 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; |
|
| 1696 | + $sql .= " WHERE rowid = ".((int) $rowid); |
|
| 1697 | 1697 | |
| 1698 | 1698 | if ($this->db->query($sql)) { |
| 1699 | 1699 | return 0; |
@@ -1717,8 +1717,8 @@ discard block |
||
| 1717 | 1717 | $userid = $user; |
| 1718 | 1718 | } |
| 1719 | 1719 | |
| 1720 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "notify_def"; |
|
| 1721 | - $sql .= " WHERE fk_user=" . ((int) $userid) . " AND fk_action='" . $this->db->escape($action) . "'"; |
|
| 1720 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; |
|
| 1721 | + $sql .= " WHERE fk_user=".((int) $userid)." AND fk_action='".$this->db->escape($action)."'"; |
|
| 1722 | 1722 | |
| 1723 | 1723 | if ($this->db->query($sql)) { |
| 1724 | 1724 | return 0; |
@@ -1750,15 +1750,15 @@ discard block |
||
| 1750 | 1750 | if ($this->deleteNotification($user, $action) == 0) { |
| 1751 | 1751 | $now = dol_now(); |
| 1752 | 1752 | |
| 1753 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)"; |
|
| 1754 | - $sql .= " VALUES ('" . $this->db->idate($now) . "', " . ((int) $userid) . ", 'NULL', 'NULL', '" . $this->db->escape($action) . "')"; |
|
| 1753 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)"; |
|
| 1754 | + $sql .= " VALUES ('".$this->db->idate($now)."', ".((int) $userid).", 'NULL', 'NULL', '".$this->db->escape($action)."')"; |
|
| 1755 | 1755 | |
| 1756 | - dol_syslog("adnotiff: " . $sql); |
|
| 1756 | + dol_syslog("adnotiff: ".$sql); |
|
| 1757 | 1757 | if ($this->db->query($sql)) { |
| 1758 | 1758 | $result = 0; |
| 1759 | 1759 | } else { |
| 1760 | 1760 | $result = -1; |
| 1761 | - dol_syslog(get_class($this) . "::addNotification Error $result"); |
|
| 1761 | + dol_syslog(get_class($this)."::addNotification Error $result"); |
|
| 1762 | 1762 | } |
| 1763 | 1763 | } |
| 1764 | 1764 | |
@@ -1793,7 +1793,7 @@ discard block |
||
| 1793 | 1793 | |
| 1794 | 1794 | $result = 0; |
| 1795 | 1795 | |
| 1796 | - dol_syslog(get_class($this) . "::generate build file=" . $this->filename . " type=" . $type); |
|
| 1796 | + dol_syslog(get_class($this)."::generate build file=".$this->filename." type=".$type); |
|
| 1797 | 1797 | |
| 1798 | 1798 | $this->file = fopen($this->filename, "w"); |
| 1799 | 1799 | if ($this->file == false) { |
@@ -1839,13 +1839,13 @@ discard block |
||
| 1839 | 1839 | $sql .= " f.ref as reffac, p.fk_facture as idfac,"; |
| 1840 | 1840 | $sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum"; |
| 1841 | 1841 | $sql .= " FROM"; |
| 1842 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,"; |
|
| 1843 | - $sql .= " " . MAIN_DB_PREFIX . "facture as f,"; |
|
| 1844 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement as p,"; |
|
| 1845 | - $sql .= " " . MAIN_DB_PREFIX . "societe as soc,"; |
|
| 1846 | - $sql .= " " . MAIN_DB_PREFIX . "c_country as c,"; |
|
| 1847 | - $sql .= " " . MAIN_DB_PREFIX . "societe_rib as rib"; |
|
| 1848 | - $sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id); |
|
| 1842 | + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; |
|
| 1843 | + $sql .= " ".MAIN_DB_PREFIX."facture as f,"; |
|
| 1844 | + $sql .= " ".MAIN_DB_PREFIX."prelevement as p,"; |
|
| 1845 | + $sql .= " ".MAIN_DB_PREFIX."societe as soc,"; |
|
| 1846 | + $sql .= " ".MAIN_DB_PREFIX."c_country as c,"; |
|
| 1847 | + $sql .= " ".MAIN_DB_PREFIX."societe_rib as rib"; |
|
| 1848 | + $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id); |
|
| 1849 | 1849 | $sql .= " AND pl.rowid = p.fk_prelevement_lignes"; |
| 1850 | 1850 | $sql .= " AND p.fk_facture = f.rowid"; |
| 1851 | 1851 | $sql .= " AND f.fk_soc = soc.rowid"; |
@@ -1882,7 +1882,7 @@ discard block |
||
| 1882 | 1882 | $nbtotalDrctDbtTxInf = $i; |
| 1883 | 1883 | } else { |
| 1884 | 1884 | $this->error = $this->db->lasterror(); |
| 1885 | - fwrite($this->file, 'ERROR DEBITOR ' . $sql . $CrLf); // DEBITOR = Customers |
|
| 1885 | + fwrite($this->file, 'ERROR DEBITOR '.$sql.$CrLf); // DEBITOR = Customers |
|
| 1886 | 1886 | $result = -2; |
| 1887 | 1887 | } |
| 1888 | 1888 | |
@@ -1899,26 +1899,26 @@ discard block |
||
| 1899 | 1899 | * SECTION CREATION SEPA FILE - ISO200022 |
| 1900 | 1900 | */ |
| 1901 | 1901 | // SEPA File Header |
| 1902 | - fwrite($this->file, '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>' . $CrLf); |
|
| 1903 | - fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . $CrLf); |
|
| 1904 | - fwrite($this->file, ' <CstmrDrctDbtInitn>' . $CrLf); |
|
| 1902 | + fwrite($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf); |
|
| 1903 | + fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'.$CrLf); |
|
| 1904 | + fwrite($this->file, ' <CstmrDrctDbtInitn>'.$CrLf); |
|
| 1905 | 1905 | // SEPA Group header |
| 1906 | - fwrite($this->file, ' <GrpHdr>' . $CrLf); |
|
| 1907 | - fwrite($this->file, ' <MsgId>' . ('DD/' . $dateTime_YMD . '/REF' . $this->id) . '</MsgId>' . $CrLf); |
|
| 1908 | - fwrite($this->file, ' <CreDtTm>' . $dateTime_ECMA . '</CreDtTm>' . $CrLf); |
|
| 1909 | - fwrite($this->file, ' <NbOfTxs>' . $i . '</NbOfTxs>' . $CrLf); |
|
| 1910 | - fwrite($this->file, ' <CtrlSum>' . $this->total . '</CtrlSum>' . $CrLf); |
|
| 1911 | - fwrite($this->file, ' <InitgPty>' . $CrLf); |
|
| 1912 | - fwrite($this->file, ' <Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf); |
|
| 1913 | - fwrite($this->file, ' <Id>' . $CrLf); |
|
| 1914 | - fwrite($this->file, ' <PrvtId>' . $CrLf); |
|
| 1915 | - fwrite($this->file, ' <Othr>' . $CrLf); |
|
| 1916 | - fwrite($this->file, ' <Id>' . $this->emetteur_ics . '</Id>' . $CrLf); |
|
| 1917 | - fwrite($this->file, ' </Othr>' . $CrLf); |
|
| 1918 | - fwrite($this->file, ' </PrvtId>' . $CrLf); |
|
| 1919 | - fwrite($this->file, ' </Id>' . $CrLf); |
|
| 1920 | - fwrite($this->file, ' </InitgPty>' . $CrLf); |
|
| 1921 | - fwrite($this->file, ' </GrpHdr>' . $CrLf); |
|
| 1906 | + fwrite($this->file, ' <GrpHdr>'.$CrLf); |
|
| 1907 | + fwrite($this->file, ' <MsgId>'.('DD/'.$dateTime_YMD.'/REF'.$this->id).'</MsgId>'.$CrLf); |
|
| 1908 | + fwrite($this->file, ' <CreDtTm>'.$dateTime_ECMA.'</CreDtTm>'.$CrLf); |
|
| 1909 | + fwrite($this->file, ' <NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf); |
|
| 1910 | + fwrite($this->file, ' <CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf); |
|
| 1911 | + fwrite($this->file, ' <InitgPty>'.$CrLf); |
|
| 1912 | + fwrite($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf); |
|
| 1913 | + fwrite($this->file, ' <Id>'.$CrLf); |
|
| 1914 | + fwrite($this->file, ' <PrvtId>'.$CrLf); |
|
| 1915 | + fwrite($this->file, ' <Othr>'.$CrLf); |
|
| 1916 | + fwrite($this->file, ' <Id>'.$this->emetteur_ics.'</Id>'.$CrLf); |
|
| 1917 | + fwrite($this->file, ' </Othr>'.$CrLf); |
|
| 1918 | + fwrite($this->file, ' </PrvtId>'.$CrLf); |
|
| 1919 | + fwrite($this->file, ' </Id>'.$CrLf); |
|
| 1920 | + fwrite($this->file, ' </InitgPty>'.$CrLf); |
|
| 1921 | + fwrite($this->file, ' </GrpHdr>'.$CrLf); |
|
| 1922 | 1922 | // SEPA File Emetteur |
| 1923 | 1923 | if ($result != -2) { |
| 1924 | 1924 | fwrite($this->file, $fileEmetteurSection); |
@@ -1928,9 +1928,9 @@ discard block |
||
| 1928 | 1928 | fwrite($this->file, $fileDebiteurSection); |
| 1929 | 1929 | } |
| 1930 | 1930 | // SEPA FILE FOOTER |
| 1931 | - fwrite($this->file, ' </PmtInf>' . $CrLf); |
|
| 1932 | - fwrite($this->file, ' </CstmrDrctDbtInitn>' . $CrLf); |
|
| 1933 | - fwrite($this->file, '</Document>' . $CrLf); |
|
| 1931 | + fwrite($this->file, ' </PmtInf>'.$CrLf); |
|
| 1932 | + fwrite($this->file, ' </CstmrDrctDbtInitn>'.$CrLf); |
|
| 1933 | + fwrite($this->file, '</Document>'.$CrLf); |
|
| 1934 | 1934 | } else { |
| 1935 | 1935 | /** |
| 1936 | 1936 | * SECTION CREATION FICHIER SEPA - CREDIT TRANSFER |
@@ -1962,13 +1962,13 @@ discard block |
||
| 1962 | 1962 | $sql .= " s.ref as reffac, p.fk_salary as idfac,"; |
| 1963 | 1963 | $sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, '' as rum, '' as date_rum"; |
| 1964 | 1964 | $sql .= " FROM"; |
| 1965 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,"; |
|
| 1966 | - $sql .= " " . MAIN_DB_PREFIX . "salary as s,"; |
|
| 1967 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement as p,"; |
|
| 1968 | - $sql .= " " . MAIN_DB_PREFIX . "user as u"; |
|
| 1969 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON u.fk_country = c.rowid,"; |
|
| 1970 | - $sql .= " " . MAIN_DB_PREFIX . "user_rib as rib"; |
|
| 1971 | - $sql .= " WHERE pl.fk_prelevement_bons=" . ((int) $this->id); |
|
| 1965 | + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; |
|
| 1966 | + $sql .= " ".MAIN_DB_PREFIX."salary as s,"; |
|
| 1967 | + $sql .= " ".MAIN_DB_PREFIX."prelevement as p,"; |
|
| 1968 | + $sql .= " ".MAIN_DB_PREFIX."user as u"; |
|
| 1969 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON u.fk_country = c.rowid,"; |
|
| 1970 | + $sql .= " ".MAIN_DB_PREFIX."user_rib as rib"; |
|
| 1971 | + $sql .= " WHERE pl.fk_prelevement_bons=".((int) $this->id); |
|
| 1972 | 1972 | $sql .= " AND pl.rowid = p.fk_prelevement_lignes"; |
| 1973 | 1973 | $sql .= " AND p.fk_salary = s.rowid"; |
| 1974 | 1974 | $sql .= " AND s.fk_user = u.rowid"; |
@@ -1979,13 +1979,13 @@ discard block |
||
| 1979 | 1979 | $sql .= " f.ref as reffac, f.ref_supplier as fac_ref_supplier, p.fk_facture_fourn as idfac,"; |
| 1980 | 1980 | $sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum"; |
| 1981 | 1981 | $sql .= " FROM"; |
| 1982 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,"; |
|
| 1983 | - $sql .= " " . MAIN_DB_PREFIX . "facture_fourn as f,"; |
|
| 1984 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement as p,"; |
|
| 1985 | - $sql .= " " . MAIN_DB_PREFIX . "societe as soc"; |
|
| 1986 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON soc.fk_pays = c.rowid,"; |
|
| 1987 | - $sql .= " " . MAIN_DB_PREFIX . "societe_rib as rib"; |
|
| 1988 | - $sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id); |
|
| 1982 | + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; |
|
| 1983 | + $sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,"; |
|
| 1984 | + $sql .= " ".MAIN_DB_PREFIX."prelevement as p,"; |
|
| 1985 | + $sql .= " ".MAIN_DB_PREFIX."societe as soc"; |
|
| 1986 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON soc.fk_pays = c.rowid,"; |
|
| 1987 | + $sql .= " ".MAIN_DB_PREFIX."societe_rib as rib"; |
|
| 1988 | + $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id); |
|
| 1989 | 1989 | $sql .= " AND pl.rowid = p.fk_prelevement_lignes"; |
| 1990 | 1990 | $sql .= " AND p.fk_facture_fourn = f.rowid"; |
| 1991 | 1991 | $sql .= " AND f.fk_soc = soc.rowid"; |
@@ -2014,7 +2014,7 @@ discard block |
||
| 2014 | 2014 | $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); |
| 2015 | 2015 | $refobj = $obj->reffac; |
| 2016 | 2016 | if (empty($refobj) && !empty($forsalary)) { // If ref of salary not defined, we force a value |
| 2017 | - $refobj = "SAL" . $obj->idfac; |
|
| 2017 | + $refobj = "SAL".$obj->idfac; |
|
| 2018 | 2018 | } |
| 2019 | 2019 | |
| 2020 | 2020 | $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $refobj, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier); |
@@ -2025,7 +2025,7 @@ discard block |
||
| 2025 | 2025 | $nbtotalDrctDbtTxInf = $i; |
| 2026 | 2026 | } else { |
| 2027 | 2027 | $this->error = $this->db->lasterror(); |
| 2028 | - fwrite($this->file, 'ERROR CREDITOR ' . $sql . $CrLf); // CREDITORS = Suppliers |
|
| 2028 | + fwrite($this->file, 'ERROR CREDITOR '.$sql.$CrLf); // CREDITORS = Suppliers |
|
| 2029 | 2029 | $result = -2; |
| 2030 | 2030 | } |
| 2031 | 2031 | // Define $fileEmetteurSection. Start of block PmtInf. Will contains all $nbtotalDrctDbtTxInf |
@@ -2041,26 +2041,26 @@ discard block |
||
| 2041 | 2041 | * SECTION CREATION SEPA FILE - CREDIT TRANSFER - ISO200022 |
| 2042 | 2042 | */ |
| 2043 | 2043 | // SEPA File Header |
| 2044 | - fwrite($this->file, '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>' . $CrLf); |
|
| 2045 | - fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . $CrLf); |
|
| 2046 | - fwrite($this->file, ' <CstmrCdtTrfInitn>' . $CrLf); |
|
| 2044 | + fwrite($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf); |
|
| 2045 | + fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'.$CrLf); |
|
| 2046 | + fwrite($this->file, ' <CstmrCdtTrfInitn>'.$CrLf); |
|
| 2047 | 2047 | // SEPA Group header |
| 2048 | - fwrite($this->file, ' <GrpHdr>' . $CrLf); |
|
| 2049 | - fwrite($this->file, ' <MsgId>' . ('TRF/' . $dateTime_YMD . '/REF' . $this->id) . '</MsgId>' . $CrLf); |
|
| 2050 | - fwrite($this->file, ' <CreDtTm>' . $dateTime_ECMA . '</CreDtTm>' . $CrLf); |
|
| 2051 | - fwrite($this->file, ' <NbOfTxs>' . $i . '</NbOfTxs>' . $CrLf); |
|
| 2052 | - fwrite($this->file, ' <CtrlSum>' . $this->total . '</CtrlSum>' . $CrLf); |
|
| 2053 | - fwrite($this->file, ' <InitgPty>' . $CrLf); |
|
| 2054 | - fwrite($this->file, ' <Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf); |
|
| 2055 | - fwrite($this->file, ' <Id>' . $CrLf); |
|
| 2056 | - fwrite($this->file, ' <PrvtId>' . $CrLf); |
|
| 2057 | - fwrite($this->file, ' <Othr>' . $CrLf); |
|
| 2058 | - fwrite($this->file, ' <Id>' . $this->emetteur_ics . '</Id>' . $CrLf); |
|
| 2059 | - fwrite($this->file, ' </Othr>' . $CrLf); |
|
| 2060 | - fwrite($this->file, ' </PrvtId>' . $CrLf); |
|
| 2061 | - fwrite($this->file, ' </Id>' . $CrLf); |
|
| 2062 | - fwrite($this->file, ' </InitgPty>' . $CrLf); |
|
| 2063 | - fwrite($this->file, ' </GrpHdr>' . $CrLf); |
|
| 2048 | + fwrite($this->file, ' <GrpHdr>'.$CrLf); |
|
| 2049 | + fwrite($this->file, ' <MsgId>'.('TRF/'.$dateTime_YMD.'/REF'.$this->id).'</MsgId>'.$CrLf); |
|
| 2050 | + fwrite($this->file, ' <CreDtTm>'.$dateTime_ECMA.'</CreDtTm>'.$CrLf); |
|
| 2051 | + fwrite($this->file, ' <NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf); |
|
| 2052 | + fwrite($this->file, ' <CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf); |
|
| 2053 | + fwrite($this->file, ' <InitgPty>'.$CrLf); |
|
| 2054 | + fwrite($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf); |
|
| 2055 | + fwrite($this->file, ' <Id>'.$CrLf); |
|
| 2056 | + fwrite($this->file, ' <PrvtId>'.$CrLf); |
|
| 2057 | + fwrite($this->file, ' <Othr>'.$CrLf); |
|
| 2058 | + fwrite($this->file, ' <Id>'.$this->emetteur_ics.'</Id>'.$CrLf); |
|
| 2059 | + fwrite($this->file, ' </Othr>'.$CrLf); |
|
| 2060 | + fwrite($this->file, ' </PrvtId>'.$CrLf); |
|
| 2061 | + fwrite($this->file, ' </Id>'.$CrLf); |
|
| 2062 | + fwrite($this->file, ' </InitgPty>'.$CrLf); |
|
| 2063 | + fwrite($this->file, ' </GrpHdr>'.$CrLf); |
|
| 2064 | 2064 | // SEPA File Emetteur (mycompany) |
| 2065 | 2065 | if ($result != -2) { |
| 2066 | 2066 | fwrite($this->file, $fileEmetteurSection); |
@@ -2070,9 +2070,9 @@ discard block |
||
| 2070 | 2070 | fwrite($this->file, $fileCrediteurSection); |
| 2071 | 2071 | } |
| 2072 | 2072 | // SEPA FILE FOOTER |
| 2073 | - fwrite($this->file, ' </PmtInf>' . $CrLf); |
|
| 2074 | - fwrite($this->file, ' </CstmrCdtTrfInitn>' . $CrLf); |
|
| 2075 | - fwrite($this->file, '</Document>' . $CrLf); |
|
| 2073 | + fwrite($this->file, ' </PmtInf>'.$CrLf); |
|
| 2074 | + fwrite($this->file, ' </CstmrCdtTrfInitn>'.$CrLf); |
|
| 2075 | + fwrite($this->file, '</Document>'.$CrLf); |
|
| 2076 | 2076 | } |
| 2077 | 2077 | } |
| 2078 | 2078 | |
@@ -2081,10 +2081,10 @@ discard block |
||
| 2081 | 2081 | if ($type != 'bank-transfer') { |
| 2082 | 2082 | $sql = "SELECT pl.amount"; |
| 2083 | 2083 | $sql .= " FROM"; |
| 2084 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,"; |
|
| 2085 | - $sql .= " " . MAIN_DB_PREFIX . "facture as f,"; |
|
| 2086 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement as p"; |
|
| 2087 | - $sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id); |
|
| 2084 | + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; |
|
| 2085 | + $sql .= " ".MAIN_DB_PREFIX."facture as f,"; |
|
| 2086 | + $sql .= " ".MAIN_DB_PREFIX."prelevement as p"; |
|
| 2087 | + $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id); |
|
| 2088 | 2088 | $sql .= " AND pl.rowid = p.fk_prelevement_lignes"; |
| 2089 | 2089 | $sql .= " AND p.fk_facture = f.rowid"; |
| 2090 | 2090 | |
@@ -2107,10 +2107,10 @@ discard block |
||
| 2107 | 2107 | } else { |
| 2108 | 2108 | $sql = "SELECT pl.amount"; |
| 2109 | 2109 | $sql .= " FROM"; |
| 2110 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,"; |
|
| 2111 | - $sql .= " " . MAIN_DB_PREFIX . "facture_fourn as f,"; |
|
| 2112 | - $sql .= " " . MAIN_DB_PREFIX . "prelevement as p"; |
|
| 2113 | - $sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id); |
|
| 2110 | + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; |
|
| 2111 | + $sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,"; |
|
| 2112 | + $sql .= " ".MAIN_DB_PREFIX."prelevement as p"; |
|
| 2113 | + $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id); |
|
| 2114 | 2114 | $sql .= " AND pl.rowid = p.fk_prelevement_lignes"; |
| 2115 | 2115 | $sql .= " AND p.fk_facture_fourn = f.rowid"; |
| 2116 | 2116 | // Lines |
@@ -2159,7 +2159,7 @@ discard block |
||
| 2159 | 2159 | $pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation) |
| 2160 | 2160 | |
| 2161 | 2161 | // 3 char + '-' + 12 + '-' + id + '-' + code Must be lower than 32. |
| 2162 | - return $pre . '-' . dol_print_date($row_datec, 'dayhourlogsmall') . '-' . dol_trunc($row_drum . ($row_code_client ? '-' . $row_code_client : ''), 13, 'right', 'UTF-8', 1); |
|
| 2162 | + return $pre.'-'.dol_print_date($row_datec, 'dayhourlogsmall').'-'.dol_trunc($row_drum.($row_code_client ? '-'.$row_code_client : ''), 13, 'right', 'UTF-8', 1); |
|
| 2163 | 2163 | } |
| 2164 | 2164 | |
| 2165 | 2165 | |
@@ -2198,11 +2198,11 @@ discard block |
||
| 2198 | 2198 | |
| 2199 | 2199 | // Raison Sociale Destinataire C2 |
| 2200 | 2200 | |
| 2201 | - fwrite($this->file, substr(strtoupper($client_nom) . " ", 0, 24)); |
|
| 2201 | + fwrite($this->file, substr(strtoupper($client_nom)." ", 0, 24)); |
|
| 2202 | 2202 | |
| 2203 | 2203 | // Address optional D1 |
| 2204 | 2204 | $address = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => "")); |
| 2205 | - fwrite($this->file, substr($address . " ", 0, 24)); |
|
| 2205 | + fwrite($this->file, substr($address." ", 0, 24)); |
|
| 2206 | 2206 | |
| 2207 | 2207 | // Zone Reservee D2 |
| 2208 | 2208 | |
@@ -2214,17 +2214,17 @@ discard block |
||
| 2214 | 2214 | |
| 2215 | 2215 | // Numero de compte D4 |
| 2216 | 2216 | |
| 2217 | - fwrite($this->file, substr("000000000000000" . $rib_number, -11)); |
|
| 2217 | + fwrite($this->file, substr("000000000000000".$rib_number, -11)); |
|
| 2218 | 2218 | |
| 2219 | 2219 | // Zone E Montant |
| 2220 | 2220 | |
| 2221 | 2221 | $montant = (round($amount, 2) * 100); |
| 2222 | 2222 | |
| 2223 | - fwrite($this->file, substr("000000000000000" . $montant, -16)); |
|
| 2223 | + fwrite($this->file, substr("000000000000000".$montant, -16)); |
|
| 2224 | 2224 | |
| 2225 | 2225 | // Label F |
| 2226 | 2226 | |
| 2227 | - fwrite($this->file, substr("*_" . $ref . "_RDVnet" . $rowid . " ", 0, 31)); |
|
| 2227 | + fwrite($this->file, substr("*_".$ref."_RDVnet".$rowid." ", 0, 31)); |
|
| 2228 | 2228 | |
| 2229 | 2229 | // Code etablissement G1 |
| 2230 | 2230 | |
@@ -2275,7 +2275,7 @@ discard block |
||
| 2275 | 2275 | $row_somme = round((float) $row_somme, 2); |
| 2276 | 2276 | } |
| 2277 | 2277 | |
| 2278 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
| 2278 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
| 2279 | 2279 | |
| 2280 | 2280 | $CrLf = "\n"; |
| 2281 | 2281 | $Rowing = sprintf("%010d", $row_idfac); |
@@ -2290,46 +2290,46 @@ discard block |
||
| 2290 | 2290 | if ($type != 'bank-transfer') { |
| 2291 | 2291 | // SEPA Paiement Information of buyer for Direct Debit |
| 2292 | 2292 | $XML_DEBITOR = ''; |
| 2293 | - $XML_DEBITOR .= ' <DrctDbtTxInf>' . $CrLf; |
|
| 2294 | - $XML_DEBITOR .= ' <PmtId>' . $CrLf; |
|
| 2293 | + $XML_DEBITOR .= ' <DrctDbtTxInf>'.$CrLf; |
|
| 2294 | + $XML_DEBITOR .= ' <PmtId>'.$CrLf; |
|
| 2295 | 2295 | // Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum) |
| 2296 | - $XML_DEBITOR .= ' <EndToEndId>' . ((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-' . dol_trunc($row_idfac . '-' . $row_ref, 20, 'right', 'UTF-8', 1)) . '-' . $Rowing) . '</EndToEndId>' . $CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters |
|
| 2297 | - $XML_DEBITOR .= ' </PmtId>' . $CrLf; |
|
| 2298 | - $XML_DEBITOR .= ' <InstdAmt Ccy="EUR">' . $row_somme . '</InstdAmt>' . $CrLf; |
|
| 2299 | - $XML_DEBITOR .= ' <DrctDbtTx>' . $CrLf; |
|
| 2300 | - $XML_DEBITOR .= ' <MndtRltdInf>' . $CrLf; |
|
| 2301 | - $XML_DEBITOR .= ' <MndtId>' . $Rum . '</MndtId>' . $CrLf; |
|
| 2302 | - $XML_DEBITOR .= ' <DtOfSgntr>' . $DtOfSgntr . '</DtOfSgntr>' . $CrLf; |
|
| 2303 | - $XML_DEBITOR .= ' <AmdmntInd>false</AmdmntInd>' . $CrLf; |
|
| 2304 | - $XML_DEBITOR .= ' </MndtRltdInf>' . $CrLf; |
|
| 2305 | - $XML_DEBITOR .= ' </DrctDbtTx>' . $CrLf; |
|
| 2306 | - $XML_DEBITOR .= ' <DbtrAgt>' . $CrLf; |
|
| 2307 | - $XML_DEBITOR .= ' <FinInstnId>' . $CrLf; |
|
| 2296 | + $XML_DEBITOR .= ' <EndToEndId>'.((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters |
|
| 2297 | + $XML_DEBITOR .= ' </PmtId>'.$CrLf; |
|
| 2298 | + $XML_DEBITOR .= ' <InstdAmt Ccy="EUR">'.$row_somme.'</InstdAmt>'.$CrLf; |
|
| 2299 | + $XML_DEBITOR .= ' <DrctDbtTx>'.$CrLf; |
|
| 2300 | + $XML_DEBITOR .= ' <MndtRltdInf>'.$CrLf; |
|
| 2301 | + $XML_DEBITOR .= ' <MndtId>'.$Rum.'</MndtId>'.$CrLf; |
|
| 2302 | + $XML_DEBITOR .= ' <DtOfSgntr>'.$DtOfSgntr.'</DtOfSgntr>'.$CrLf; |
|
| 2303 | + $XML_DEBITOR .= ' <AmdmntInd>false</AmdmntInd>'.$CrLf; |
|
| 2304 | + $XML_DEBITOR .= ' </MndtRltdInf>'.$CrLf; |
|
| 2305 | + $XML_DEBITOR .= ' </DrctDbtTx>'.$CrLf; |
|
| 2306 | + $XML_DEBITOR .= ' <DbtrAgt>'.$CrLf; |
|
| 2307 | + $XML_DEBITOR .= ' <FinInstnId>'.$CrLf; |
|
| 2308 | 2308 | if (getDolGlobalInt('WITHDRAWAL_WITHOUT_BIC') == 0) { |
| 2309 | - $XML_DEBITOR .= ' <BIC>' . $row_bic . '</BIC>' . $CrLf; |
|
| 2309 | + $XML_DEBITOR .= ' <BIC>'.$row_bic.'</BIC>'.$CrLf; |
|
| 2310 | 2310 | } |
| 2311 | - $XML_DEBITOR .= ' </FinInstnId>' . $CrLf; |
|
| 2312 | - $XML_DEBITOR .= ' </DbtrAgt>' . $CrLf; |
|
| 2313 | - $XML_DEBITOR .= ' <Dbtr>' . $CrLf; |
|
| 2314 | - $XML_DEBITOR .= ' <Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))) . '</Nm>' . $CrLf; |
|
| 2315 | - $XML_DEBITOR .= ' <PstlAdr>' . $CrLf; |
|
| 2316 | - $XML_DEBITOR .= ' <Ctry>' . $row_country_code . '</Ctry>' . $CrLf; |
|
| 2311 | + $XML_DEBITOR .= ' </FinInstnId>'.$CrLf; |
|
| 2312 | + $XML_DEBITOR .= ' </DbtrAgt>'.$CrLf; |
|
| 2313 | + $XML_DEBITOR .= ' <Dbtr>'.$CrLf; |
|
| 2314 | + $XML_DEBITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf; |
|
| 2315 | + $XML_DEBITOR .= ' <PstlAdr>'.$CrLf; |
|
| 2316 | + $XML_DEBITOR .= ' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf; |
|
| 2317 | 2317 | $addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => "")); |
| 2318 | - $addressline2 = strtr($row_zip . (($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); |
|
| 2318 | + $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); |
|
| 2319 | 2319 | if (trim($addressline1)) { |
| 2320 | - $XML_DEBITOR .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2320 | + $XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2321 | 2321 | } |
| 2322 | 2322 | if (trim($addressline2)) { |
| 2323 | - $XML_DEBITOR .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2323 | + $XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2324 | 2324 | } |
| 2325 | - $XML_DEBITOR .= ' </PstlAdr>' . $CrLf; |
|
| 2326 | - $XML_DEBITOR .= ' </Dbtr>' . $CrLf; |
|
| 2327 | - $XML_DEBITOR .= ' <DbtrAcct>' . $CrLf; |
|
| 2328 | - $XML_DEBITOR .= ' <Id>' . $CrLf; |
|
| 2329 | - $XML_DEBITOR .= ' <IBAN>' . preg_replace('/\s/', '', $row_iban) . '</IBAN>' . $CrLf; |
|
| 2330 | - $XML_DEBITOR .= ' </Id>' . $CrLf; |
|
| 2331 | - $XML_DEBITOR .= ' </DbtrAcct>' . $CrLf; |
|
| 2332 | - $XML_DEBITOR .= ' <RmtInf>' . $CrLf; |
|
| 2325 | + $XML_DEBITOR .= ' </PstlAdr>'.$CrLf; |
|
| 2326 | + $XML_DEBITOR .= ' </Dbtr>'.$CrLf; |
|
| 2327 | + $XML_DEBITOR .= ' <DbtrAcct>'.$CrLf; |
|
| 2328 | + $XML_DEBITOR .= ' <Id>'.$CrLf; |
|
| 2329 | + $XML_DEBITOR .= ' <IBAN>'.preg_replace('/\s/', '', $row_iban).'</IBAN>'.$CrLf; |
|
| 2330 | + $XML_DEBITOR .= ' </Id>'.$CrLf; |
|
| 2331 | + $XML_DEBITOR .= ' </DbtrAcct>'.$CrLf; |
|
| 2332 | + $XML_DEBITOR .= ' <RmtInf>'.$CrLf; |
|
| 2333 | 2333 | |
| 2334 | 2334 | // Structured data for Belgium |
| 2335 | 2335 | if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION') && $mysoc->country_code == 'BE') { |
@@ -2339,24 +2339,24 @@ discard block |
||
| 2339 | 2339 | $invoicestatic->fetch($row_idfac); |
| 2340 | 2340 | |
| 2341 | 2341 | $invoicePaymentKey = dolBECalculateStructuredCommunication($invoicestatic->ref, $invoicestatic->type); |
| 2342 | - $XML_DEBITOR .= ' <strd>' . $invoicePaymentKey . '</strd>' . $CrLf; |
|
| 2342 | + $XML_DEBITOR .= ' <strd>'.$invoicePaymentKey.'</strd>'.$CrLf; |
|
| 2343 | 2343 | } else { |
| 2344 | 2344 | // A string with some information on payment - 140 max |
| 2345 | - $XML_DEBITOR .= ' <Ustrd>' . getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstuctured data - 140 max |
|
| 2345 | + $XML_DEBITOR .= ' <Ustrd>'.getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))).'</Ustrd>'.$CrLf; // Free unstuctured data - 140 max |
|
| 2346 | 2346 | } |
| 2347 | - $XML_DEBITOR .= ' </RmtInf>' . $CrLf; |
|
| 2348 | - $XML_DEBITOR .= ' </DrctDbtTxInf>' . $CrLf; |
|
| 2347 | + $XML_DEBITOR .= ' </RmtInf>'.$CrLf; |
|
| 2348 | + $XML_DEBITOR .= ' </DrctDbtTxInf>'.$CrLf; |
|
| 2349 | 2349 | return $XML_DEBITOR; |
| 2350 | 2350 | } else { |
| 2351 | 2351 | // SEPA Payment Information of seller for Credit Transfer |
| 2352 | 2352 | $XML_CREDITOR = ''; |
| 2353 | - $XML_CREDITOR .= ' <CdtTrfTxInf>' . $CrLf; |
|
| 2354 | - $XML_CREDITOR .= ' <PmtId>' . $CrLf; |
|
| 2353 | + $XML_CREDITOR .= ' <CdtTrfTxInf>'.$CrLf; |
|
| 2354 | + $XML_CREDITOR .= ' <PmtId>'.$CrLf; |
|
| 2355 | 2355 | // Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum) |
| 2356 | - $XML_CREDITOR .= ' <EndToEndId>' . ((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-' . dol_trunc($row_idfac . '-' . $row_ref, 20, 'right', 'UTF-8', 1)) . '-' . $Rowing) . '</EndToEndId>' . $CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters |
|
| 2357 | - $XML_CREDITOR .= ' </PmtId>' . $CrLf; |
|
| 2356 | + $XML_CREDITOR .= ' <EndToEndId>'.((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters |
|
| 2357 | + $XML_CREDITOR .= ' </PmtId>'.$CrLf; |
|
| 2358 | 2358 | if (!empty($this->sepa_xml_pti_in_ctti)) { |
| 2359 | - $XML_CREDITOR .= ' <PmtTpInf>' . $CrLf; |
|
| 2359 | + $XML_CREDITOR .= ' <PmtTpInf>'.$CrLf; |
|
| 2360 | 2360 | |
| 2361 | 2361 | // Can be 'NORM' for normal or 'HIGH' for high priority level |
| 2362 | 2362 | if (getDolGlobalString('PAYMENTBYBANKTRANSFER_FORCE_HIGH_PRIORITY')) { |
@@ -2364,18 +2364,18 @@ discard block |
||
| 2364 | 2364 | } else { |
| 2365 | 2365 | $instrprty = 'NORM'; |
| 2366 | 2366 | } |
| 2367 | - $XML_CREDITOR .= ' <InstrPrty>' . $instrprty . '</InstrPrty>' . $CrLf; |
|
| 2368 | - $XML_CREDITOR .= ' <SvcLvl>' . $CrLf; |
|
| 2369 | - $XML_CREDITOR .= ' <Cd>SEPA</Cd>' . $CrLf; |
|
| 2370 | - $XML_CREDITOR .= ' </SvcLvl>' . $CrLf; |
|
| 2371 | - $XML_CREDITOR .= ' <CtgyPurp>' . $CrLf; |
|
| 2372 | - $XML_CREDITOR .= ' <Cd>CORE</Cd>' . $CrLf; |
|
| 2373 | - $XML_CREDITOR .= ' </CtgyPurp>' . $CrLf; |
|
| 2374 | - $XML_CREDITOR .= ' </PmtTpInf>' . $CrLf; |
|
| 2367 | + $XML_CREDITOR .= ' <InstrPrty>'.$instrprty.'</InstrPrty>'.$CrLf; |
|
| 2368 | + $XML_CREDITOR .= ' <SvcLvl>'.$CrLf; |
|
| 2369 | + $XML_CREDITOR .= ' <Cd>SEPA</Cd>'.$CrLf; |
|
| 2370 | + $XML_CREDITOR .= ' </SvcLvl>'.$CrLf; |
|
| 2371 | + $XML_CREDITOR .= ' <CtgyPurp>'.$CrLf; |
|
| 2372 | + $XML_CREDITOR .= ' <Cd>CORE</Cd>'.$CrLf; |
|
| 2373 | + $XML_CREDITOR .= ' </CtgyPurp>'.$CrLf; |
|
| 2374 | + $XML_CREDITOR .= ' </PmtTpInf>'.$CrLf; |
|
| 2375 | 2375 | } |
| 2376 | - $XML_CREDITOR .= ' <Amt>' . $CrLf; |
|
| 2376 | + $XML_CREDITOR .= ' <Amt>'.$CrLf; |
|
| 2377 | 2377 | $XML_CREDITOR .= ' <InstdAmt Ccy="EUR">'.round((float) $row_somme, 2).'</InstdAmt>'.$CrLf; |
| 2378 | - $XML_CREDITOR .= ' </Amt>' . $CrLf; |
|
| 2378 | + $XML_CREDITOR .= ' </Amt>'.$CrLf; |
|
| 2379 | 2379 | /* |
| 2380 | 2380 | $XML_CREDITOR .= ' <DrctDbtTx>'.$CrLf; |
| 2381 | 2381 | $XML_CREDITOR .= ' <MndtRltdInf>'.$CrLf; |
@@ -2386,35 +2386,35 @@ discard block |
||
| 2386 | 2386 | $XML_CREDITOR .= ' </DrctDbtTx>'.$CrLf; |
| 2387 | 2387 | */ |
| 2388 | 2388 | //$XML_CREDITOR .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; |
| 2389 | - $XML_CREDITOR .= ' <CdtrAgt>' . $CrLf; |
|
| 2390 | - $XML_CREDITOR .= ' <FinInstnId>' . $CrLf; |
|
| 2391 | - $XML_CREDITOR .= ' <BIC>' . $row_bic . '</BIC>' . $CrLf; |
|
| 2392 | - $XML_CREDITOR .= ' </FinInstnId>' . $CrLf; |
|
| 2393 | - $XML_CREDITOR .= ' </CdtrAgt>' . $CrLf; |
|
| 2394 | - $XML_CREDITOR .= ' <Cdtr>' . $CrLf; |
|
| 2395 | - $XML_CREDITOR .= ' <Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))) . '</Nm>' . $CrLf; |
|
| 2396 | - $XML_CREDITOR .= ' <PstlAdr>' . $CrLf; |
|
| 2397 | - $XML_CREDITOR .= ' <Ctry>' . $row_country_code . '</Ctry>' . $CrLf; |
|
| 2389 | + $XML_CREDITOR .= ' <CdtrAgt>'.$CrLf; |
|
| 2390 | + $XML_CREDITOR .= ' <FinInstnId>'.$CrLf; |
|
| 2391 | + $XML_CREDITOR .= ' <BIC>'.$row_bic.'</BIC>'.$CrLf; |
|
| 2392 | + $XML_CREDITOR .= ' </FinInstnId>'.$CrLf; |
|
| 2393 | + $XML_CREDITOR .= ' </CdtrAgt>'.$CrLf; |
|
| 2394 | + $XML_CREDITOR .= ' <Cdtr>'.$CrLf; |
|
| 2395 | + $XML_CREDITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf; |
|
| 2396 | + $XML_CREDITOR .= ' <PstlAdr>'.$CrLf; |
|
| 2397 | + $XML_CREDITOR .= ' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf; |
|
| 2398 | 2398 | $addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => "")); |
| 2399 | - $addressline2 = strtr($row_zip . (($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); |
|
| 2399 | + $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); |
|
| 2400 | 2400 | if (trim($addressline1)) { |
| 2401 | - $XML_CREDITOR .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2401 | + $XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2402 | 2402 | } |
| 2403 | 2403 | if (trim($addressline2)) { |
| 2404 | - $XML_CREDITOR .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2404 | + $XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2405 | 2405 | } |
| 2406 | - $XML_CREDITOR .= ' </PstlAdr>' . $CrLf; |
|
| 2407 | - $XML_CREDITOR .= ' </Cdtr>' . $CrLf; |
|
| 2408 | - $XML_CREDITOR .= ' <CdtrAcct>' . $CrLf; |
|
| 2409 | - $XML_CREDITOR .= ' <Id>' . $CrLf; |
|
| 2410 | - $XML_CREDITOR .= ' <IBAN>' . preg_replace('/\s/', '', $row_iban) . '</IBAN>' . $CrLf; |
|
| 2411 | - $XML_CREDITOR .= ' </Id>' . $CrLf; |
|
| 2412 | - $XML_CREDITOR .= ' </CdtrAcct>' . $CrLf; |
|
| 2413 | - $XML_CREDITOR .= ' <RmtInf>' . $CrLf; |
|
| 2406 | + $XML_CREDITOR .= ' </PstlAdr>'.$CrLf; |
|
| 2407 | + $XML_CREDITOR .= ' </Cdtr>'.$CrLf; |
|
| 2408 | + $XML_CREDITOR .= ' <CdtrAcct>'.$CrLf; |
|
| 2409 | + $XML_CREDITOR .= ' <Id>'.$CrLf; |
|
| 2410 | + $XML_CREDITOR .= ' <IBAN>'.preg_replace('/\s/', '', $row_iban).'</IBAN>'.$CrLf; |
|
| 2411 | + $XML_CREDITOR .= ' </Id>'.$CrLf; |
|
| 2412 | + $XML_CREDITOR .= ' </CdtrAcct>'.$CrLf; |
|
| 2413 | + $XML_CREDITOR .= ' <RmtInf>'.$CrLf; |
|
| 2414 | 2414 | // A string with some information on payment - 140 max |
| 2415 | - $XML_CREDITOR .= ' <Ustrd>' . getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstructured data - 140 max |
|
| 2416 | - $XML_CREDITOR .= ' </RmtInf>' . $CrLf; |
|
| 2417 | - $XML_CREDITOR .= ' </CdtTrfTxInf>' . $CrLf; |
|
| 2415 | + $XML_CREDITOR .= ' <Ustrd>'.getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))).'</Ustrd>'.$CrLf; // Free unstructured data - 140 max |
|
| 2416 | + $XML_CREDITOR .= ' </RmtInf>'.$CrLf; |
|
| 2417 | + $XML_CREDITOR .= ' </CdtTrfTxInf>'.$CrLf; |
|
| 2418 | 2418 | return $XML_CREDITOR; |
| 2419 | 2419 | } |
| 2420 | 2420 | } |
@@ -2446,11 +2446,11 @@ discard block |
||
| 2446 | 2446 | |
| 2447 | 2447 | // Raison Sociale C2 |
| 2448 | 2448 | |
| 2449 | - fwrite($this->file, substr($this->raison_sociale . " ", 0, 24)); |
|
| 2449 | + fwrite($this->file, substr($this->raison_sociale." ", 0, 24)); |
|
| 2450 | 2450 | |
| 2451 | 2451 | // Ref of thirdparty on 7 characters |
| 2452 | 2452 | |
| 2453 | - fwrite($this->file, substr($this->reference_remise . " ", 0, 7)); |
|
| 2453 | + fwrite($this->file, substr($this->reference_remise." ", 0, 7)); |
|
| 2454 | 2454 | |
| 2455 | 2455 | // Zone Reservee D1-2 |
| 2456 | 2456 | |
@@ -2468,7 +2468,7 @@ discard block |
||
| 2468 | 2468 | |
| 2469 | 2469 | // Numero de compte D4 |
| 2470 | 2470 | |
| 2471 | - fwrite($this->file, substr("000000000000000" . $this->emetteur_numero_compte, -11)); |
|
| 2471 | + fwrite($this->file, substr("000000000000000".$this->emetteur_numero_compte, -11)); |
|
| 2472 | 2472 | |
| 2473 | 2473 | // Zone Reservee E |
| 2474 | 2474 | |
@@ -2531,15 +2531,15 @@ discard block |
||
| 2531 | 2531 | $this->emetteur_iban = $account->iban; |
| 2532 | 2532 | $this->emetteur_bic = $account->bic; |
| 2533 | 2533 | |
| 2534 | - $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; |
|
| 2534 | + $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; |
|
| 2535 | 2535 | |
| 2536 | 2536 | $this->raison_sociale = $account->proprio; |
| 2537 | 2537 | } |
| 2538 | 2538 | |
| 2539 | 2539 | // Get pending payments |
| 2540 | 2540 | $sql = "SELECT rowid, ref"; |
| 2541 | - $sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as pb"; |
|
| 2542 | - $sql .= " WHERE pb.rowid = " . ((int) $this->id); |
|
| 2541 | + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as pb"; |
|
| 2542 | + $sql .= " WHERE pb.rowid = ".((int) $this->id); |
|
| 2543 | 2543 | |
| 2544 | 2544 | $resql = $this->db->query($sql); |
| 2545 | 2545 | if ($resql) { |
@@ -2556,45 +2556,45 @@ discard block |
||
| 2556 | 2556 | if ($type != 'bank-transfer') { |
| 2557 | 2557 | // SEPA Paiement Information of my company for Direct Debit |
| 2558 | 2558 | $XML_SEPA_INFO = ''; |
| 2559 | - $XML_SEPA_INFO .= ' <PmtInf>' . $CrLf; |
|
| 2560 | - $XML_SEPA_INFO .= ' <PmtInfId>' . ('DD/' . $dateTime_YMD . '/ID' . $IdBon . '-' . $RefBon) . '</PmtInfId>' . $CrLf; |
|
| 2561 | - $XML_SEPA_INFO .= ' <PmtMtd>DD</PmtMtd>' . $CrLf; |
|
| 2562 | - $XML_SEPA_INFO .= ' <NbOfTxs>' . $nombre . '</NbOfTxs>' . $CrLf; |
|
| 2563 | - $XML_SEPA_INFO .= ' <CtrlSum>' . $total . '</CtrlSum>' . $CrLf; |
|
| 2564 | - $XML_SEPA_INFO .= ' <PmtTpInf>' . $CrLf; |
|
| 2565 | - $XML_SEPA_INFO .= ' <SvcLvl>' . $CrLf; |
|
| 2566 | - $XML_SEPA_INFO .= ' <Cd>SEPA</Cd>' . $CrLf; |
|
| 2567 | - $XML_SEPA_INFO .= ' </SvcLvl>' . $CrLf; |
|
| 2568 | - $XML_SEPA_INFO .= ' <LclInstrm>' . $CrLf; |
|
| 2569 | - $XML_SEPA_INFO .= ' <Cd>CORE</Cd>' . $CrLf; |
|
| 2570 | - $XML_SEPA_INFO .= ' </LclInstrm>' . $CrLf; |
|
| 2571 | - $XML_SEPA_INFO .= ' <SeqTp>' . $format . '</SeqTp>' . $CrLf; |
|
| 2572 | - $XML_SEPA_INFO .= ' </PmtTpInf>' . $CrLf; |
|
| 2573 | - $XML_SEPA_INFO .= ' <ReqdColltnDt>' . $dateTime_ETAD . '</ReqdColltnDt>' . $CrLf; |
|
| 2574 | - $XML_SEPA_INFO .= ' <Cdtr>' . $CrLf; |
|
| 2575 | - $XML_SEPA_INFO .= ' <Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf; |
|
| 2576 | - $XML_SEPA_INFO .= ' <PstlAdr>' . $CrLf; |
|
| 2577 | - $XML_SEPA_INFO .= ' <Ctry>' . $country[1] . '</Ctry>' . $CrLf; |
|
| 2559 | + $XML_SEPA_INFO .= ' <PmtInf>'.$CrLf; |
|
| 2560 | + $XML_SEPA_INFO .= ' <PmtInfId>'.('DD/'.$dateTime_YMD.'/ID'.$IdBon.'-'.$RefBon).'</PmtInfId>'.$CrLf; |
|
| 2561 | + $XML_SEPA_INFO .= ' <PmtMtd>DD</PmtMtd>'.$CrLf; |
|
| 2562 | + $XML_SEPA_INFO .= ' <NbOfTxs>'.$nombre.'</NbOfTxs>'.$CrLf; |
|
| 2563 | + $XML_SEPA_INFO .= ' <CtrlSum>'.$total.'</CtrlSum>'.$CrLf; |
|
| 2564 | + $XML_SEPA_INFO .= ' <PmtTpInf>'.$CrLf; |
|
| 2565 | + $XML_SEPA_INFO .= ' <SvcLvl>'.$CrLf; |
|
| 2566 | + $XML_SEPA_INFO .= ' <Cd>SEPA</Cd>'.$CrLf; |
|
| 2567 | + $XML_SEPA_INFO .= ' </SvcLvl>'.$CrLf; |
|
| 2568 | + $XML_SEPA_INFO .= ' <LclInstrm>'.$CrLf; |
|
| 2569 | + $XML_SEPA_INFO .= ' <Cd>CORE</Cd>'.$CrLf; |
|
| 2570 | + $XML_SEPA_INFO .= ' </LclInstrm>'.$CrLf; |
|
| 2571 | + $XML_SEPA_INFO .= ' <SeqTp>'.$format.'</SeqTp>'.$CrLf; |
|
| 2572 | + $XML_SEPA_INFO .= ' </PmtTpInf>'.$CrLf; |
|
| 2573 | + $XML_SEPA_INFO .= ' <ReqdColltnDt>'.$dateTime_ETAD.'</ReqdColltnDt>'.$CrLf; |
|
| 2574 | + $XML_SEPA_INFO .= ' <Cdtr>'.$CrLf; |
|
| 2575 | + $XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf; |
|
| 2576 | + $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; |
|
| 2577 | + $XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf; |
|
| 2578 | 2578 | $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => "")); |
| 2579 | - $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP . (($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' ' . $configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '') . $configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); |
|
| 2579 | + $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); |
|
| 2580 | 2580 | if ($addressline1) { |
| 2581 | - $XML_SEPA_INFO .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2581 | + $XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2582 | 2582 | } |
| 2583 | 2583 | if ($addressline2) { |
| 2584 | - $XML_SEPA_INFO .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2584 | + $XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2585 | 2585 | } |
| 2586 | - $XML_SEPA_INFO .= ' </PstlAdr>' . $CrLf; |
|
| 2587 | - $XML_SEPA_INFO .= ' </Cdtr>' . $CrLf; |
|
| 2588 | - $XML_SEPA_INFO .= ' <CdtrAcct>' . $CrLf; |
|
| 2589 | - $XML_SEPA_INFO .= ' <Id>' . $CrLf; |
|
| 2590 | - $XML_SEPA_INFO .= ' <IBAN>' . preg_replace('/\s/', '', $this->emetteur_iban) . '</IBAN>' . $CrLf; |
|
| 2591 | - $XML_SEPA_INFO .= ' </Id>' . $CrLf; |
|
| 2592 | - $XML_SEPA_INFO .= ' </CdtrAcct>' . $CrLf; |
|
| 2593 | - $XML_SEPA_INFO .= ' <CdtrAgt>' . $CrLf; |
|
| 2594 | - $XML_SEPA_INFO .= ' <FinInstnId>' . $CrLf; |
|
| 2595 | - $XML_SEPA_INFO .= ' <BIC>' . $this->emetteur_bic . '</BIC>' . $CrLf; |
|
| 2596 | - $XML_SEPA_INFO .= ' </FinInstnId>' . $CrLf; |
|
| 2597 | - $XML_SEPA_INFO .= ' </CdtrAgt>' . $CrLf; |
|
| 2586 | + $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; |
|
| 2587 | + $XML_SEPA_INFO .= ' </Cdtr>'.$CrLf; |
|
| 2588 | + $XML_SEPA_INFO .= ' <CdtrAcct>'.$CrLf; |
|
| 2589 | + $XML_SEPA_INFO .= ' <Id>'.$CrLf; |
|
| 2590 | + $XML_SEPA_INFO .= ' <IBAN>'.preg_replace('/\s/', '', $this->emetteur_iban).'</IBAN>'.$CrLf; |
|
| 2591 | + $XML_SEPA_INFO .= ' </Id>'.$CrLf; |
|
| 2592 | + $XML_SEPA_INFO .= ' </CdtrAcct>'.$CrLf; |
|
| 2593 | + $XML_SEPA_INFO .= ' <CdtrAgt>'.$CrLf; |
|
| 2594 | + $XML_SEPA_INFO .= ' <FinInstnId>'.$CrLf; |
|
| 2595 | + $XML_SEPA_INFO .= ' <BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf; |
|
| 2596 | + $XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf; |
|
| 2597 | + $XML_SEPA_INFO .= ' </CdtrAgt>'.$CrLf; |
|
| 2598 | 2598 | /* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf; |
| 2599 | 2599 | $XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf; |
| 2600 | 2600 | $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; |
@@ -2603,64 +2603,64 @@ discard block |
||
| 2603 | 2603 | $XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
| 2604 | 2604 | $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; |
| 2605 | 2605 | $XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/ |
| 2606 | - $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>' . $CrLf; // Field "Responsible of fees". Must be SLEV |
|
| 2607 | - $XML_SEPA_INFO .= ' <CdtrSchmeId>' . $CrLf; |
|
| 2608 | - $XML_SEPA_INFO .= ' <Id>' . $CrLf; |
|
| 2609 | - $XML_SEPA_INFO .= ' <PrvtId>' . $CrLf; |
|
| 2610 | - $XML_SEPA_INFO .= ' <Othr>' . $CrLf; |
|
| 2611 | - $XML_SEPA_INFO .= ' <Id>' . $this->emetteur_ics . '</Id>' . $CrLf; |
|
| 2612 | - $XML_SEPA_INFO .= ' <SchmeNm>' . $CrLf; |
|
| 2613 | - $XML_SEPA_INFO .= ' <Prtry>SEPA</Prtry>' . $CrLf; |
|
| 2614 | - $XML_SEPA_INFO .= ' </SchmeNm>' . $CrLf; |
|
| 2615 | - $XML_SEPA_INFO .= ' </Othr>' . $CrLf; |
|
| 2616 | - $XML_SEPA_INFO .= ' </PrvtId>' . $CrLf; |
|
| 2617 | - $XML_SEPA_INFO .= ' </Id>' . $CrLf; |
|
| 2618 | - $XML_SEPA_INFO .= ' </CdtrSchmeId>' . $CrLf; |
|
| 2606 | + $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV |
|
| 2607 | + $XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf; |
|
| 2608 | + $XML_SEPA_INFO .= ' <Id>'.$CrLf; |
|
| 2609 | + $XML_SEPA_INFO .= ' <PrvtId>'.$CrLf; |
|
| 2610 | + $XML_SEPA_INFO .= ' <Othr>'.$CrLf; |
|
| 2611 | + $XML_SEPA_INFO .= ' <Id>'.$this->emetteur_ics.'</Id>'.$CrLf; |
|
| 2612 | + $XML_SEPA_INFO .= ' <SchmeNm>'.$CrLf; |
|
| 2613 | + $XML_SEPA_INFO .= ' <Prtry>SEPA</Prtry>'.$CrLf; |
|
| 2614 | + $XML_SEPA_INFO .= ' </SchmeNm>'.$CrLf; |
|
| 2615 | + $XML_SEPA_INFO .= ' </Othr>'.$CrLf; |
|
| 2616 | + $XML_SEPA_INFO .= ' </PrvtId>'.$CrLf; |
|
| 2617 | + $XML_SEPA_INFO .= ' </Id>'.$CrLf; |
|
| 2618 | + $XML_SEPA_INFO .= ' </CdtrSchmeId>'.$CrLf; |
|
| 2619 | 2619 | } else { |
| 2620 | 2620 | // SEPA Paiement Information of my company for Credit Transfer |
| 2621 | 2621 | $XML_SEPA_INFO = ''; |
| 2622 | - $XML_SEPA_INFO .= ' <PmtInf>' . $CrLf; |
|
| 2623 | - $XML_SEPA_INFO .= ' <PmtInfId>' . ('TRF/' . $dateTime_YMD . '/ID' . $IdBon . '-' . $RefBon) . '</PmtInfId>' . $CrLf; |
|
| 2624 | - $XML_SEPA_INFO .= ' <PmtMtd>TRF</PmtMtd>' . $CrLf; |
|
| 2622 | + $XML_SEPA_INFO .= ' <PmtInf>'.$CrLf; |
|
| 2623 | + $XML_SEPA_INFO .= ' <PmtInfId>'.('TRF/'.$dateTime_YMD.'/ID'.$IdBon.'-'.$RefBon).'</PmtInfId>'.$CrLf; |
|
| 2624 | + $XML_SEPA_INFO .= ' <PmtMtd>TRF</PmtMtd>'.$CrLf; |
|
| 2625 | 2625 | //$XML_SEPA_INFO .= ' <BtchBookg>False</BtchBookg>'.$CrLf; |
| 2626 | - $XML_SEPA_INFO .= ' <NbOfTxs>' . $nombre . '</NbOfTxs>' . $CrLf; |
|
| 2627 | - $XML_SEPA_INFO .= ' <CtrlSum>' . $total . '</CtrlSum>' . $CrLf; |
|
| 2626 | + $XML_SEPA_INFO .= ' <NbOfTxs>'.$nombre.'</NbOfTxs>'.$CrLf; |
|
| 2627 | + $XML_SEPA_INFO .= ' <CtrlSum>'.$total.'</CtrlSum>'.$CrLf; |
|
| 2628 | 2628 | if (!empty($this->sepa_xml_pti_in_ctti) && !empty($format)) { // @TODO Using $format (FRST ou RCUR) in a section for a Credit Transfer looks strange. |
| 2629 | - $XML_SEPA_INFO .= ' <PmtTpInf>' . $CrLf; |
|
| 2630 | - $XML_SEPA_INFO .= ' <SvcLvl>' . $CrLf; |
|
| 2631 | - $XML_SEPA_INFO .= ' <Cd>SEPA</Cd>' . $CrLf; |
|
| 2632 | - $XML_SEPA_INFO .= ' </SvcLvl>' . $CrLf; |
|
| 2633 | - $XML_SEPA_INFO .= ' <LclInstrm>' . $CrLf; |
|
| 2634 | - $XML_SEPA_INFO .= ' <Cd>CORE</Cd>' . $CrLf; |
|
| 2635 | - $XML_SEPA_INFO .= ' </LclInstrm>' . $CrLf; |
|
| 2636 | - $XML_SEPA_INFO .= ' <SeqTp>' . $format . '</SeqTp>' . $CrLf; |
|
| 2637 | - $XML_SEPA_INFO .= ' </PmtTpInf>' . $CrLf; |
|
| 2629 | + $XML_SEPA_INFO .= ' <PmtTpInf>'.$CrLf; |
|
| 2630 | + $XML_SEPA_INFO .= ' <SvcLvl>'.$CrLf; |
|
| 2631 | + $XML_SEPA_INFO .= ' <Cd>SEPA</Cd>'.$CrLf; |
|
| 2632 | + $XML_SEPA_INFO .= ' </SvcLvl>'.$CrLf; |
|
| 2633 | + $XML_SEPA_INFO .= ' <LclInstrm>'.$CrLf; |
|
| 2634 | + $XML_SEPA_INFO .= ' <Cd>CORE</Cd>'.$CrLf; |
|
| 2635 | + $XML_SEPA_INFO .= ' </LclInstrm>'.$CrLf; |
|
| 2636 | + $XML_SEPA_INFO .= ' <SeqTp>'.$format.'</SeqTp>'.$CrLf; |
|
| 2637 | + $XML_SEPA_INFO .= ' </PmtTpInf>'.$CrLf; |
|
| 2638 | 2638 | } |
| 2639 | - $XML_SEPA_INFO .= ' <ReqdExctnDt>' . dol_print_date($dateTime_ETAD, 'dayrfc') . '</ReqdExctnDt>' . $CrLf; |
|
| 2640 | - $XML_SEPA_INFO .= ' <Dbtr>' . $CrLf; |
|
| 2641 | - $XML_SEPA_INFO .= ' <Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf; |
|
| 2642 | - $XML_SEPA_INFO .= ' <PstlAdr>' . $CrLf; |
|
| 2643 | - $XML_SEPA_INFO .= ' <Ctry>' . $country[1] . '</Ctry>' . $CrLf; |
|
| 2639 | + $XML_SEPA_INFO .= ' <ReqdExctnDt>'.dol_print_date($dateTime_ETAD, 'dayrfc').'</ReqdExctnDt>'.$CrLf; |
|
| 2640 | + $XML_SEPA_INFO .= ' <Dbtr>'.$CrLf; |
|
| 2641 | + $XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf; |
|
| 2642 | + $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; |
|
| 2643 | + $XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf; |
|
| 2644 | 2644 | $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => "")); |
| 2645 | - $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP . (($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' ' . $configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '') . $configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); |
|
| 2645 | + $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); |
|
| 2646 | 2646 | if ($addressline1) { |
| 2647 | - $XML_SEPA_INFO .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2647 | + $XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2648 | 2648 | } |
| 2649 | 2649 | if ($addressline2) { |
| 2650 | - $XML_SEPA_INFO .= ' <AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf; |
|
| 2650 | + $XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
|
| 2651 | 2651 | } |
| 2652 | - $XML_SEPA_INFO .= ' </PstlAdr>' . $CrLf; |
|
| 2653 | - $XML_SEPA_INFO .= ' </Dbtr>' . $CrLf; |
|
| 2654 | - $XML_SEPA_INFO .= ' <DbtrAcct>' . $CrLf; |
|
| 2655 | - $XML_SEPA_INFO .= ' <Id>' . $CrLf; |
|
| 2656 | - $XML_SEPA_INFO .= ' <IBAN>' . preg_replace('/\s/', '', $this->emetteur_iban) . '</IBAN>' . $CrLf; |
|
| 2657 | - $XML_SEPA_INFO .= ' </Id>' . $CrLf; |
|
| 2658 | - $XML_SEPA_INFO .= ' </DbtrAcct>' . $CrLf; |
|
| 2659 | - $XML_SEPA_INFO .= ' <DbtrAgt>' . $CrLf; |
|
| 2660 | - $XML_SEPA_INFO .= ' <FinInstnId>' . $CrLf; |
|
| 2661 | - $XML_SEPA_INFO .= ' <BIC>' . $this->emetteur_bic . '</BIC>' . $CrLf; |
|
| 2662 | - $XML_SEPA_INFO .= ' </FinInstnId>' . $CrLf; |
|
| 2663 | - $XML_SEPA_INFO .= ' </DbtrAgt>' . $CrLf; |
|
| 2652 | + $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; |
|
| 2653 | + $XML_SEPA_INFO .= ' </Dbtr>'.$CrLf; |
|
| 2654 | + $XML_SEPA_INFO .= ' <DbtrAcct>'.$CrLf; |
|
| 2655 | + $XML_SEPA_INFO .= ' <Id>'.$CrLf; |
|
| 2656 | + $XML_SEPA_INFO .= ' <IBAN>'.preg_replace('/\s/', '', $this->emetteur_iban).'</IBAN>'.$CrLf; |
|
| 2657 | + $XML_SEPA_INFO .= ' </Id>'.$CrLf; |
|
| 2658 | + $XML_SEPA_INFO .= ' </DbtrAcct>'.$CrLf; |
|
| 2659 | + $XML_SEPA_INFO .= ' <DbtrAgt>'.$CrLf; |
|
| 2660 | + $XML_SEPA_INFO .= ' <FinInstnId>'.$CrLf; |
|
| 2661 | + $XML_SEPA_INFO .= ' <BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf; |
|
| 2662 | + $XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf; |
|
| 2663 | + $XML_SEPA_INFO .= ' </DbtrAgt>'.$CrLf; |
|
| 2664 | 2664 | /* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf; |
| 2665 | 2665 | $XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf; |
| 2666 | 2666 | $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; |
@@ -2669,7 +2669,7 @@ discard block |
||
| 2669 | 2669 | $XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf; |
| 2670 | 2670 | $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; |
| 2671 | 2671 | $XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/ |
| 2672 | - $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>' . $CrLf; // Field "Responsible of fees". Must be SLEV |
|
| 2672 | + $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV |
|
| 2673 | 2673 | /*$XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf; |
| 2674 | 2674 | $XML_SEPA_INFO .= ' <Id>'.$CrLf; |
| 2675 | 2675 | $XML_SEPA_INFO .= ' <PrvtId>'.$CrLf; |
@@ -2684,7 +2684,7 @@ discard block |
||
| 2684 | 2684 | $XML_SEPA_INFO .= ' </CdtrSchmeId>'.$CrLf;*/ |
| 2685 | 2685 | } |
| 2686 | 2686 | } else { |
| 2687 | - fwrite($this->file, 'INCORRECT EMETTEUR ' . $this->raison_sociale . $CrLf); |
|
| 2687 | + fwrite($this->file, 'INCORRECT EMETTEUR '.$this->raison_sociale.$CrLf); |
|
| 2688 | 2688 | $XML_SEPA_INFO = ''; |
| 2689 | 2689 | } |
| 2690 | 2690 | return $XML_SEPA_INFO; |
@@ -2736,7 +2736,7 @@ discard block |
||
| 2736 | 2736 | |
| 2737 | 2737 | $montant = ($total * 100); |
| 2738 | 2738 | |
| 2739 | - fwrite($this->file, substr("000000000000000" . $montant, -16)); |
|
| 2739 | + fwrite($this->file, substr("000000000000000".$montant, -16)); |
|
| 2740 | 2740 | |
| 2741 | 2741 | // Zone Reservee F |
| 2742 | 2742 | |
@@ -2893,18 +2893,18 @@ discard block |
||
| 2893 | 2893 | $return .= img_picto('', $this->picto); |
| 2894 | 2894 | $return .= '</span>'; |
| 2895 | 2895 | $return .= '<div class="info-box-content">'; |
| 2896 | - $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . (method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref) . '</span>'; |
|
| 2896 | + $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>'; |
|
| 2897 | 2897 | if ($selected >= 0) { |
| 2898 | - $return .= '<input id="cb' . $this->id . '" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this->id . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
| 2898 | + $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
| 2899 | 2899 | } |
| 2900 | 2900 | if (property_exists($this, 'date_echeance')) { |
| 2901 | - $return .= '<br><span class="opacitymedium">' . $langs->trans("Date") . '</span> : <span class="info-box-label">' . dol_print_date($this->db->jdate($this->date_echeance), 'day') . '</span>'; |
|
| 2901 | + $return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->date_echeance), 'day').'</span>'; |
|
| 2902 | 2902 | } |
| 2903 | 2903 | if (property_exists($this, 'total')) { |
| 2904 | - $return .= '<br><span class="opacitymedium">' . $langs->trans("Amount") . '</span> : <span class="amount">' . price($this->total) . '</span>'; |
|
| 2904 | + $return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="amount">'.price($this->total).'</span>'; |
|
| 2905 | 2905 | } |
| 2906 | 2906 | if (method_exists($this, 'LibStatut')) { |
| 2907 | - $return .= '<br><div class="info-box-status">' . $this->getLibStatut(3) . '</div>'; |
|
| 2907 | + $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>'; |
|
| 2908 | 2908 | } |
| 2909 | 2909 | $return .= '</div>'; |
| 2910 | 2910 | $return .= '</div>'; |
@@ -2925,9 +2925,9 @@ discard block |
||
| 2925 | 2925 | return 0; |
| 2926 | 2926 | } |
| 2927 | 2927 | if ($id) { |
| 2928 | - $sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "prelevement_lignes"; |
|
| 2929 | - $sql .= " WHERE fk_prelevement_bons = " . ((int) $id); |
|
| 2930 | - $sql .= " AND fk_soc = 0"; // fk_soc can't be NULL |
|
| 2928 | + $sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."prelevement_lignes"; |
|
| 2929 | + $sql .= " WHERE fk_prelevement_bons = ".((int) $id); |
|
| 2930 | + $sql .= " AND fk_soc = 0"; // fk_soc can't be NULL |
|
| 2931 | 2931 | $sql .= " AND fk_user IS NOT NULL"; |
| 2932 | 2932 | |
| 2933 | 2933 | $num = 0; |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); |
| 107 | 107 | $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); |
| 108 | 108 | |
| 109 | -$pastmonth = null; // Initialise, could be unset |
|
| 110 | -$pastmonthyear = null; // Initialise, could be unset |
|
| 109 | +$pastmonth = null; // Initialise, could be unset |
|
| 110 | +$pastmonthyear = null; // Initialise, could be unset |
|
| 111 | 111 | |
| 112 | 112 | if (empty($date_startmonth)) { |
| 113 | 113 | // Period by default on transfer |
@@ -157,14 +157,14 @@ discard block |
||
| 157 | 157 | $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as fd"; |
| 158 | 158 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; |
| 159 | 159 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 160 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 160 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 161 | 161 | } |
| 162 | 162 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; |
| 163 | 163 | $sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn"; |
| 164 | 164 | $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
| 165 | 165 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
| 166 | 166 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 167 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
| 167 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
| 168 | 168 | } |
| 169 | 169 | $parameters = array(); |
| 170 | 170 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $cpttva = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined'); |
| 221 | 221 | $rcctva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined'); |
| 222 | 222 | $rcdtva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined'); |
| 223 | - $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
| 223 | + $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
| 224 | 224 | |
| 225 | 225 | $i = 0; |
| 226 | 226 | while ($i < $num) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - $tax_id = $obj->tva_tx . ($obj->vat_src_code ? ' (' . $obj->vat_src_code . ')' : ''); |
|
| 242 | + $tax_id = $obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''); |
|
| 243 | 243 | if (array_key_exists($tax_id, $vatdata_cache)) { |
| 244 | 244 | $vatdata = $vatdata_cache[$tax_id]; |
| 245 | 245 | } else { |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | // VAT Reverse charge |
| 290 | 290 | if (($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) && $obj->vat_reverse_charge == 1 && in_array($obj->country_code, $country_code_in_EEC)) { |
| 291 | - $rcvatdata = getTaxesFromId($obj->product_buy_vat . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : ''), $mysoc, $mysoc, 0); |
|
| 291 | + $rcvatdata = getTaxesFromId($obj->product_buy_vat.($obj->product_buy_default_vat_code ? ' ('.$obj->product_buy_default_vat_code.')' : ''), $mysoc, $mysoc, 0); |
|
| 292 | 292 | $rcc_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva); |
| 293 | 293 | $rcd_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva); |
| 294 | 294 | $rcc_compta_localtax1 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $rcc_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva); |
| 297 | 297 | $rcd_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva); |
| 298 | 298 | if (price2num($obj->product_buy_vat) || !empty($obj->product_buy_default_vat_code)) { |
| 299 | - $vat_key = vatrate($obj->product_buy_vat) . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : ''); |
|
| 299 | + $vat_key = vatrate($obj->product_buy_vat).($obj->product_buy_default_vat_code ? ' ('.$obj->product_buy_default_vat_code.')' : ''); |
|
| 300 | 300 | $val_value = $vat_key; |
| 301 | 301 | $def_tva[$obj->rowid][$rcc_compta_tva][$vat_key] = $val_value; |
| 302 | 302 | $def_tva[$obj->rowid][$rcd_compta_tva][$vat_key] = $val_value; |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | fk_facture_fourn, |
| 391 | 391 | COUNT(fd.rowid) as nb |
| 392 | 392 | FROM |
| 393 | - " . MAIN_DB_PREFIX . "facture_fourn_det as fd |
|
| 393 | + " . MAIN_DB_PREFIX."facture_fourn_det as fd |
|
| 394 | 394 | WHERE |
| 395 | 395 | fd.product_type <= 2 |
| 396 | 396 | AND fd.fk_code_ventilation <= 0 |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | $totalcredit = 0; |
| 432 | 432 | $totaldebit = 0; |
| 433 | 433 | |
| 434 | - $db->begin(); // We accept transaction into loop, so if we hang, we can continue transfer from the last error |
|
| 434 | + $db->begin(); // We accept transaction into loop, so if we hang, we can continue transfer from the last error |
|
| 435 | 435 | |
| 436 | 436 | $companystatic->id = $tabcompany[$key]['id']; |
| 437 | 437 | $companystatic->name = $tabcompany[$key]['name']; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | } |
| 520 | 520 | } else { |
| 521 | 521 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { |
| 522 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; |
|
| 522 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; |
|
| 523 | 523 | $lettering_static = new Lettering($db); |
| 524 | 524 | |
| 525 | 525 | $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | |
| 639 | 639 | foreach ($arrayofvat[$key] as $k => $mt) { |
| 640 | 640 | if ($mt) { |
| 641 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache for label |
|
| 641 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache for label |
|
| 642 | 642 | $label_account = $accountingaccount->label; |
| 643 | 643 | |
| 644 | 644 | $bookkeeping = new BookKeeping($db); |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | 1004 | // Button to write into Ledger |
| 1005 | - $acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['','-1']); |
|
| 1005 | + $acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['', '-1']); |
|
| 1006 | 1006 | if ($acctSupplierNotConfigured) { |
| 1007 | 1007 | print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
| 1008 | 1008 | $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
@@ -1158,7 +1158,7 @@ discard block |
||
| 1158 | 1158 | print $accountoshow; |
| 1159 | 1159 | } |
| 1160 | 1160 | print '</td>'; |
| 1161 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $langs->trans("SubledgerAccount")) . "</td>"; |
|
| 1161 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $langs->trans("SubledgerAccount"))."</td>"; |
|
| 1162 | 1162 | print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
| 1163 | 1163 | print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
| 1164 | 1164 | print "</tr>"; |
@@ -1196,12 +1196,12 @@ discard block |
||
| 1196 | 1196 | print length_accounta($tabcompany[$key]['code_compta_fournisseur']); |
| 1197 | 1197 | } |
| 1198 | 1198 | } elseif (($accountoshow == "") || $accountoshow == 'NotDefined') { |
| 1199 | - print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>'; |
|
| 1199 | + print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>'; |
|
| 1200 | 1200 | } |
| 1201 | 1201 | print '</td>'; |
| 1202 | 1202 | $companystatic->id = $tabcompany[$key]['id']; |
| 1203 | 1203 | $companystatic->name = $tabcompany[$key]['name']; |
| 1204 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $accountingaccount->label) . "</td>"; |
|
| 1204 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $accountingaccount->label)."</td>"; |
|
| 1205 | 1205 | print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
| 1206 | 1206 | print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
| 1207 | 1207 | print "</tr>"; |
@@ -1265,7 +1265,7 @@ discard block |
||
| 1265 | 1265 | $tmpvatrate = (empty($def_tva[$key][$k]) ? (empty($arrayofvat[$key][$k]) ? '' : $arrayofvat[$key][$k]) : implode(', ', $def_tva[$key][$k])); |
| 1266 | 1266 | $labelvatrate = $langs->trans("Taxes").' '.$tmpvatrate.' %'; |
| 1267 | 1267 | $labelvatrate .= ($numtax ? ' - Localtax '.$numtax : ''); |
| 1268 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $labelvatrate) . "</td>"; |
|
| 1268 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $labelvatrate)."</td>"; |
|
| 1269 | 1269 | print "</td>"; |
| 1270 | 1270 | print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
| 1271 | 1271 | print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | // Subledger account |
| 1297 | 1297 | print "<td>"; |
| 1298 | 1298 | print '</td>'; |
| 1299 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $langs->trans("VAT")." NPR (counterpart)") . "</td>"; |
|
| 1299 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'supplier'), $invoicestatic->ref_supplier, $langs->trans("VAT")." NPR (counterpart)")."</td>"; |
|
| 1300 | 1300 | print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
| 1301 | 1301 | print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
| 1302 | 1302 | print "</tr>"; |
@@ -173,11 +173,11 @@ |
||
| 173 | 173 | $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_system"; |
| 174 | 174 | $sql .= " (date_creation, fk_user_author, label, pcg_version, active)"; |
| 175 | 175 | $sql .= " VALUES ('" |
| 176 | - . $this->db->idate($now) ."'," |
|
| 177 | - . ((int) $user->id) .",'" |
|
| 178 | - . $this->db->escape($this->label) ."','" |
|
| 179 | - . $this->db->escape($this->pcg_version) ."'," |
|
| 180 | - . ((int) $this->active) .")"; |
|
| 176 | + . $this->db->idate($now)."'," |
|
| 177 | + . ((int) $user->id).",'" |
|
| 178 | + . $this->db->escape($this->label)."','" |
|
| 179 | + . $this->db->escape($this->pcg_version)."'," |
|
| 180 | + . ((int) $this->active).")"; |
|
| 181 | 181 | |
| 182 | 182 | dol_syslog(get_class($this)."::create", LOG_DEBUG); |
| 183 | 183 | $resql = $this->db->query($sql); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
| 44 | 44 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
| 45 | 45 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
| 46 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 46 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 47 | 47 | if (isModEnabled('invoice')) { |
| 48 | 48 | require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
| 49 | 49 | require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | |
| 392 | 392 | print $accountingaccount->getNomUrl(0, 1, 1, '', 1); |
| 393 | 393 | } |
| 394 | - $accountingAccountByDefault = " (" . $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')) . ")"; |
|
| 394 | + $accountingAccountByDefault = " (".$langs->trans("AccountingAccountByDefaultShort").": ".length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')).")"; |
|
| 395 | 395 | print (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') ? $accountingAccountByDefault : ''); |
| 396 | 396 | print '</td>'; |
| 397 | 397 | } |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | print '<td class="nowraponall">'; |
| 898 | 898 | $propal_static->id = $objp->propalid; |
| 899 | 899 | $propal_static->ref = $objp->ref; |
| 900 | - $propal_static->ref_client = $objp->ref_client; // deprecated |
|
| 900 | + $propal_static->ref_client = $objp->ref_client; // deprecated |
|
| 901 | 901 | $propal_static->ref_customer = $objp->ref_client; |
| 902 | 902 | $propal_static->fk_project = $objp->fk_projet; |
| 903 | 903 | $propal_static->total_ht = $objp->total_ht; |
@@ -750,7 +750,7 @@ |
||
| 750 | 750 | } |
| 751 | 751 | if (property_exists($this, 'amount')) { |
| 752 | 752 | $return .= '<br>'; |
| 753 | - $return .= '<span class="info-box-label amount">'.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 753 | + $return .= '<span class="info-box-label amount">'.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 754 | 754 | } |
| 755 | 755 | if (method_exists($this, 'getLibStatut')) { |
| 756 | 756 | $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>'; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | print $accountingaccount->getNomUrl(0, 1, 1, '', 1); |
| 278 | 278 | } |
| 279 | - $accountingAccountByDefault = " (" . $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')) . ")"; |
|
| 279 | + $accountingAccountByDefault = " (".$langs->trans("AccountingAccountByDefaultShort").": ".length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')).")"; |
|
| 280 | 280 | print (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') ? $accountingAccountByDefault : ''); |
| 281 | 281 | print '</td>'; |
| 282 | 282 | print '</tr>'; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | print '<td class="titlefield">'; |
| 320 | 320 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
| 321 | 321 | print '</td><td>'; |
| 322 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
| 322 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
| 323 | 323 | print '</td>'; |
| 324 | 324 | print '</tr>'; |
| 325 | 325 | } |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $part2 = substr($invoice_number, 3, 4); |
| 72 | 72 | $part3 = substr($invoice_number, 7, 5).'+++'; // Includes last 3 digits + 2 check digits |
| 73 | 73 | |
| 74 | - $invoice_number = $part1 . '/' . $part2 . '/' . $part3; |
|
| 74 | + $invoice_number = $part1.'/'.$part2.'/'.$part3; |
|
| 75 | 75 | |
| 76 | 76 | return $invoice_number; |
| 77 | 77 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
| 124 | 124 | if (!empty($perm)) { |
| 125 | 125 | $tmp = explode(':', $typeofdata); |
| 126 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
| 126 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
| 127 | 127 | if ($fieldrequired) { |
| 128 | 128 | $ret .= '<span class="fieldrequired">'; |
| 129 | 129 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if ($fieldrequired) { |
| 136 | 136 | $ret .= '</span>'; |
| 137 | 137 | } |
| 138 | - $ret .= '</div>' . "\n"; |
|
| 138 | + $ret .= '</div>'."\n"; |
|
| 139 | 139 | } else { |
| 140 | 140 | if ($fieldrequired) { |
| 141 | 141 | $ret .= '<span class="fieldrequired">'; |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | if (empty($notabletag) && $perm) { |
| 174 | 174 | $ret .= '<td class="right">'; |
| 175 | 175 | } |
| 176 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
| 177 | - $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>'; |
|
| 176 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
| 177 | + $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>'; |
|
| 178 | 178 | } |
| 179 | 179 | if (!empty($notabletag) && $notabletag == 1) { |
| 180 | 180 | if ($text) { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } elseif ($reg[1] == 'int') { |
| 242 | 242 | $typeofdata = 'numeric'; |
| 243 | 243 | } else { |
| 244 | - return 'ErrorBadParameter ' . $typeofdata; |
|
| 244 | + return 'ErrorBadParameter '.$typeofdata; |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
@@ -252,13 +252,13 @@ discard block |
||
| 252 | 252 | if ($editaction == '') { |
| 253 | 253 | $editaction = GETPOST('action', 'aZ09'); |
| 254 | 254 | } |
| 255 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
| 255 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
| 256 | 256 | if ($editmode) { // edit mode |
| 257 | 257 | $ret .= "<!-- formeditfieldval -->\n"; |
| 258 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
| 259 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 260 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 261 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
| 258 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
| 259 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 260 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 261 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
| 262 | 262 | if (empty($notabletag)) { |
| 263 | 263 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 264 | 264 | } |
@@ -267,28 +267,28 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
| 269 | 269 | $tmp = explode(':', $typeofdata); |
| 270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 271 | 271 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
| 272 | 272 | $tmp = explode(':', $typeofdata); |
| 273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
| 274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 275 | 275 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
| 276 | 276 | $tmp = explode(':', $typeofdata); |
| 277 | 277 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
| 278 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 278 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 279 | 279 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
| 280 | 280 | $tmp = explode(':', $typeofdata); |
| 281 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
| 281 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
| 282 | 282 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
| 283 | 283 | $tmp = explode(':', $typeofdata); |
| 284 | 284 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
| 285 | 285 | $morealt = ''; |
| 286 | 286 | if (preg_match('/%/', $cols)) { |
| 287 | - $morealt = ' style="width: ' . $cols . '"'; |
|
| 287 | + $morealt = ' style="width: '.$cols.'"'; |
|
| 288 | 288 | $cols = ''; |
| 289 | 289 | } |
| 290 | 290 | $valuetoshow = ($editvalue ? $editvalue : $value); |
| 291 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
| 291 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
| 292 | 292 | // textarea convert automatically entities chars into simple chars. |
| 293 | 293 | // 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 wysiwyg is off. |
| 294 | 294 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -298,12 +298,12 @@ discard block |
||
| 298 | 298 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 299 | 299 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 300 | 300 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 301 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 301 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 302 | 302 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 303 | 303 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 304 | 304 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 305 | 305 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 306 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 306 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 307 | 307 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 308 | 308 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 309 | 309 | $arraylist = array(); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | // TODO Not yet implemented. See code for extrafields |
| 318 | 318 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
| 319 | 319 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
| 320 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 320 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 321 | 321 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $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 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
| 322 | 322 | $ret .= $doleditor->Create(1); |
| 323 | 323 | } elseif ($typeofdata == 'asis') { |
@@ -332,19 +332,19 @@ discard block |
||
| 332 | 332 | $ret .= '<td>'; |
| 333 | 333 | } |
| 334 | 334 | //else $ret.='<div class="clearboth"></div>'; |
| 335 | - $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
| 335 | + $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
| 336 | 336 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
| 337 | - $ret .= '<br>' . "\n"; |
|
| 337 | + $ret .= '<br>'."\n"; |
|
| 338 | 338 | } |
| 339 | - $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 339 | + $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 340 | 340 | if (empty($notabletag)) { |
| 341 | 341 | $ret .= '</td>'; |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | if (empty($notabletag)) { |
| 345 | - $ret .= '</tr></table>' . "\n"; |
|
| 345 | + $ret .= '</tr></table>'."\n"; |
|
| 346 | 346 | } |
| 347 | - $ret .= '</form>' . "\n"; |
|
| 347 | + $ret .= '</form>'."\n"; |
|
| 348 | 348 | } else { // view mode |
| 349 | 349 | if (preg_match('/^email/', $typeofdata)) { |
| 350 | 350 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -356,15 +356,15 @@ discard block |
||
| 356 | 356 | $ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : ''); |
| 357 | 357 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
| 358 | 358 | $tmp = explode(':', $typeofdata); |
| 359 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
| 359 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
| 360 | 360 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
| 361 | 361 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
| 362 | 362 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
| 363 | 363 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
| 364 | 364 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
| 365 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
| 365 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
| 366 | 366 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 367 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
| 367 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
| 368 | 368 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 369 | 369 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 370 | 370 | $arraylist = array(); |
@@ -375,9 +375,9 @@ discard block |
||
| 375 | 375 | $ret .= $arraylist[$value]; |
| 376 | 376 | if ($htmlname == 'fk_product_type') { |
| 377 | 377 | if ($value == 0) { |
| 378 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 378 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 379 | 379 | } else { |
| 380 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 380 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
| 386 | 386 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
| 387 | 387 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
| 388 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 388 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 389 | 389 | } |
| 390 | 390 | // We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
| 391 | 391 | // clean data from some dangerous html |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
| 395 | 395 | $ret .= dol_escape_htmltag($value); |
| 396 | 396 | } else { |
| 397 | - $ret .= $value; // $value must be already html escaped. |
|
| 397 | + $ret .= $value; // $value must be already html escaped. |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 434 | 434 | if (!is_object($extralanguages)) { |
| 435 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 435 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 436 | 436 | $extralanguages = new ExtraLanguages($this->db); |
| 437 | 437 | } |
| 438 | 438 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -441,17 +441,17 @@ discard block |
||
| 441 | 441 | return ''; // No extralang field to show |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
| 445 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
| 444 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
| 445 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
| 446 | 446 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', 0, 0, 0, '', 'fa-15 editfieldlang'); |
| 447 | 447 | $result .= $s; |
| 448 | 448 | $result .= '</div>'; |
| 449 | 449 | |
| 450 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
| 450 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
| 451 | 451 | |
| 452 | 452 | $resultforextrlang = ''; |
| 453 | 453 | foreach ($arrayoflangcode as $langcode) { |
| 454 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
| 454 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
| 455 | 455 | if (empty($valuetoshow)) { |
| 456 | 456 | $object->fetchValuesForExtraLanguages(); |
| 457 | 457 | //var_dump($object->array_languages); |
@@ -463,17 +463,17 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | // TODO Use the showInputField() method of ExtraLanguages object |
| 465 | 465 | if ($typeofdata == 'textarea') { |
| 466 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 466 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 467 | 467 | $resultforextrlang .= $valuetoshow; |
| 468 | 468 | $resultforextrlang .= '</textarea>'; |
| 469 | 469 | } else { |
| 470 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
| 470 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | $result .= $resultforextrlang; |
| 474 | 474 | |
| 475 | 475 | $result .= '</div>'; |
| 476 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
| 476 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | return $result; |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | if (!empty($tmp[2])) { |
| 537 | 537 | $savemethod = $tmp[2]; |
| 538 | 538 | } |
| 539 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
| 539 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
| 540 | 540 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
| 541 | 541 | $tmp = explode(':', $inputType); |
| 542 | 542 | $inputType = $tmp[0]; |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $savemethod = $tmp[2]; |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
| 550 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
| 551 | 551 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
| 552 | 552 | $tmp = explode(':', $inputType); |
| 553 | 553 | $inputType = $tmp[0]; |
@@ -578,40 +578,40 @@ discard block |
||
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | if (isModEnabled('fckeditor')) { |
| 581 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
| 581 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
| 582 | 582 | } else { |
| 583 | 583 | $inputType = 'textarea'; |
| 584 | 584 | } |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
| 588 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
| 589 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
| 590 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
| 587 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
| 588 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
| 589 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
| 590 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
| 591 | 591 | if (!empty($savemethod)) { |
| 592 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
| 592 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
| 593 | 593 | } |
| 594 | 594 | if (!empty($ext_element)) { |
| 595 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
| 595 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
| 596 | 596 | } |
| 597 | 597 | if (!empty($custommsg)) { |
| 598 | 598 | if (is_array($custommsg)) { |
| 599 | 599 | if (!empty($custommsg['success'])) { |
| 600 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
| 600 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
| 601 | 601 | } |
| 602 | 602 | if (!empty($custommsg['error'])) { |
| 603 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
| 603 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
| 604 | 604 | } |
| 605 | 605 | } else { |
| 606 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
| 606 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | if ($inputType == 'textarea') { |
| 610 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
| 611 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
| 610 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
| 611 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
| 612 | 612 | } |
| 613 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
| 614 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
| 613 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
| 614 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
| 615 | 615 | } else { |
| 616 | 616 | $out = $value; |
| 617 | 617 | } |
@@ -640,12 +640,12 @@ discard block |
||
| 640 | 640 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
| 641 | 641 | { |
| 642 | 642 | if ($incbefore) { |
| 643 | - $text = $incbefore . $text; |
|
| 643 | + $text = $incbefore.$text; |
|
| 644 | 644 | } |
| 645 | 645 | if (!$htmltext) { |
| 646 | 646 | return $text; |
| 647 | 647 | } |
| 648 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 648 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 649 | 649 | |
| 650 | 650 | $tag = 'td'; |
| 651 | 651 | if ($notabs == 2) { |
@@ -659,11 +659,11 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | $extrastyle = ''; |
| 661 | 661 | if ($direction < 0) { |
| 662 | - $extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : ''); |
|
| 662 | + $extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : ''); |
|
| 663 | 663 | $extrastyle = 'padding: 0px; padding-left: 2px;'; |
| 664 | 664 | } |
| 665 | 665 | if ($direction > 0) { |
| 666 | - $extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : ''); |
|
| 666 | + $extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : ''); |
|
| 667 | 667 | $extrastyle = 'padding: 0px; padding-right: 2px;'; |
| 668 | 668 | } |
| 669 | 669 | |
@@ -676,53 +676,53 @@ discard block |
||
| 676 | 676 | $htmltext = str_replace('"', '"', $htmltext); |
| 677 | 677 | } else { |
| 678 | 678 | $classfortooltip = 'classfortooltiponclick'; |
| 679 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
| 679 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
| 680 | 680 | } |
| 681 | 681 | if ($tooltipon == 2 || $tooltipon == 3) { |
| 682 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
| 682 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
| 683 | 683 | if ($tooltiptrigger == '') { |
| 684 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
| 684 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
|
| 685 | 685 | } else { |
| 686 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 686 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 687 | 687 | } |
| 688 | 688 | } else { |
| 689 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 689 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 690 | 690 | } |
| 691 | 691 | if ($tooltipon == 1 || $tooltipon == 3) { |
| 692 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 692 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
| 693 | 693 | if ($tooltiptrigger == '') { |
| 694 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
| 694 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
|
| 695 | 695 | } else { |
| 696 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 696 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 697 | 697 | } |
| 698 | 698 | } else { |
| 699 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 699 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 700 | 700 | } |
| 701 | 701 | if (empty($notabs)) { |
| 702 | 702 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
| 703 | 703 | } elseif ($notabs == 2) { |
| 704 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
| 704 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
| 705 | 705 | } |
| 706 | 706 | // Define value if value is before |
| 707 | 707 | if ($direction < 0) { |
| 708 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 708 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 709 | 709 | if ($tag == 'td') { |
| 710 | 710 | $s .= ' class="valigntop" width="14"'; |
| 711 | 711 | } |
| 712 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 712 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 713 | 713 | } |
| 714 | 714 | // Use another method to help avoid having a space in value in order to use this value with jquery |
| 715 | 715 | // Define label |
| 716 | 716 | if ((string) $text != '') { |
| 717 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
| 717 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
| 718 | 718 | } |
| 719 | 719 | // Define value if value is after |
| 720 | 720 | if ($direction > 0) { |
| 721 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 721 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 722 | 722 | if ($tag == 'td') { |
| 723 | 723 | $s .= ' class="valignmiddle" width="14"'; |
| 724 | 724 | } |
| 725 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 725 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 726 | 726 | } |
| 727 | 727 | if (empty($notabs)) { |
| 728 | 728 | $s .= '</tr></table>'; |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | |
| 830 | 830 | $disabled = 0; |
| 831 | 831 | $ret = '<div class="centpercent center">'; |
| 832 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
| 832 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
| 833 | 833 | |
| 834 | 834 | // 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. |
| 835 | 835 | $parameters = array(); |
@@ -840,10 +840,10 @@ discard block |
||
| 840 | 840 | return; |
| 841 | 841 | } |
| 842 | 842 | if (empty($reshook)) { |
| 843 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
| 843 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
| 844 | 844 | if (is_array($arrayofaction)) { |
| 845 | 845 | foreach ($arrayofaction as $code => $label) { |
| 846 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
| 846 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
| 847 | 847 | } |
| 848 | 848 | } |
| 849 | 849 | } |
@@ -852,17 +852,17 @@ discard block |
||
| 852 | 852 | $ret .= '</select>'; |
| 853 | 853 | |
| 854 | 854 | if (empty($conf->dol_optimize_smallscreen)) { |
| 855 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
| 855 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | // 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 |
| 859 | 859 | $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. |
| 860 | - $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")) . '">'; |
|
| 860 | + $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")).'">'; |
|
| 861 | 861 | $ret .= '</div>'; |
| 862 | 862 | |
| 863 | 863 | if (!empty($conf->use_javascript_ajax)) { |
| 864 | 864 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
| 865 | - <script nonce="' . getNonce() . '"> |
|
| 865 | + <script nonce="' . getNonce().'"> |
|
| 866 | 866 | 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 */ |
| 867 | 867 | { |
| 868 | 868 | atleastoneselected=0; |
@@ -873,11 +873,11 @@ discard block |
||
| 873 | 873 | |
| 874 | 874 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
| 875 | 875 | |
| 876 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
| 876 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
| 877 | 877 | { |
| 878 | 878 | jQuery("."+name).show(); |
| 879 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
| 880 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
| 879 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
| 880 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
| 881 | 881 | } |
| 882 | 882 | else |
| 883 | 883 | { |
@@ -887,26 +887,26 @@ discard block |
||
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | jQuery(document).ready(function () { |
| 890 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
| 891 | - jQuery(".' . $cssclass . '").click(function() { |
|
| 892 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
| 890 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
| 891 | + jQuery(".' . $cssclass.'").click(function() { |
|
| 892 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
| 893 | 893 | }); |
| 894 | - jQuery(".' . $name . 'select").change(function() { |
|
| 894 | + jQuery(".' . $name.'select").change(function() { |
|
| 895 | 895 | var massaction = $( this ).val(); |
| 896 | 896 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
| 897 | 897 | if (massaction == "builddoc") { |
| 898 | 898 | urlform = urlform + "#show_files"; |
| 899 | 899 | } |
| 900 | 900 | $( this ).closest("form").attr("action", urlform); |
| 901 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
| 901 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
| 902 | 902 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
| 903 | 903 | if ($(this).val() != \'0\') { |
| 904 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
| 905 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
| 906 | - jQuery(".' . $name . '"+massaction).show(); |
|
| 904 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
| 905 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
| 906 | + jQuery(".' . $name.'"+massaction).show(); |
|
| 907 | 907 | } else { |
| 908 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
| 909 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
| 908 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
| 909 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
| 910 | 910 | } |
| 911 | 911 | }); |
| 912 | 912 | }); |
@@ -949,14 +949,14 @@ discard block |
||
| 949 | 949 | $atleastonefavorite = 0; |
| 950 | 950 | |
| 951 | 951 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
| 952 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
| 952 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
| 953 | 953 | $sql .= " WHERE active > 0"; |
| 954 | 954 | //$sql.= " ORDER BY code ASC"; |
| 955 | 955 | |
| 956 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
| 956 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
| 957 | 957 | $resql = $this->db->query($sql); |
| 958 | 958 | if ($resql) { |
| 959 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 959 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 960 | 960 | $num = $this->db->num_rows($resql); |
| 961 | 961 | $i = 0; |
| 962 | 962 | if ($num) { |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | $countryArray[$i]['rowid'] = $obj->rowid; |
| 967 | 967 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
| 968 | 968 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
| 969 | - $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 : '')); |
|
| 969 | + $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 : '')); |
|
| 970 | 970 | $countryArray[$i]['favorite'] = $obj->favorite; |
| 971 | 971 | $countryArray[$i]['eec'] = $obj->eec; |
| 972 | 972 | $favorite[$i] = $obj->favorite; |
@@ -984,20 +984,20 @@ discard block |
||
| 984 | 984 | |
| 985 | 985 | if ($showempty) { |
| 986 | 986 | if (is_numeric($showempty)) { |
| 987 | - $out .= '<option value=""> </option>' . "\n"; |
|
| 987 | + $out .= '<option value=""> </option>'."\n"; |
|
| 988 | 988 | } else { |
| 989 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
| 989 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
| 990 | 990 | } |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | 993 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
| 994 | 994 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
| 995 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 996 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
| 995 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 996 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
| 997 | 997 | if ($mysoc->isInEEC()) { |
| 998 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 998 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 999 | 999 | } |
| 1000 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
| 1000 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
| 1001 | 1001 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
| 1002 | 1002 | } |
| 1003 | 1003 | |
@@ -1025,20 +1025,20 @@ discard block |
||
| 1025 | 1025 | $labeltoshow .= ' '; |
| 1026 | 1026 | } |
| 1027 | 1027 | if ($row['code_iso']) { |
| 1028 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
| 1028 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
| 1029 | 1029 | if (empty($hideflags)) { |
| 1030 | 1030 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
| 1031 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
| 1031 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
| 1036 | - $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']) . '">'; |
|
| 1036 | + $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']).'">'; |
|
| 1037 | 1037 | } else { |
| 1038 | - $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']) . '">'; |
|
| 1038 | + $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']).'">'; |
|
| 1039 | 1039 | } |
| 1040 | 1040 | $out .= $labeltoshow; |
| 1041 | - $out .= '</option>' . "\n"; |
|
| 1041 | + $out .= '</option>'."\n"; |
|
| 1042 | 1042 | } |
| 1043 | 1043 | } |
| 1044 | 1044 | $out .= '</select>'; |
@@ -1047,8 +1047,8 @@ discard block |
||
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | // Make select dynamic |
| 1050 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1051 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
| 1050 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1051 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
| 1052 | 1052 | |
| 1053 | 1053 | return $out; |
| 1054 | 1054 | } |
@@ -1080,25 +1080,25 @@ discard block |
||
| 1080 | 1080 | $incotermArray = array(); |
| 1081 | 1081 | |
| 1082 | 1082 | $sql = "SELECT rowid, code"; |
| 1083 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
| 1083 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
| 1084 | 1084 | $sql .= " WHERE active > 0"; |
| 1085 | 1085 | $sql .= " ORDER BY code ASC"; |
| 1086 | 1086 | |
| 1087 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
| 1087 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
| 1088 | 1088 | $resql = $this->db->query($sql); |
| 1089 | 1089 | if ($resql) { |
| 1090 | 1090 | if ($conf->use_javascript_ajax && !$forcecombo) { |
| 1091 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1091 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1092 | 1092 | $out .= ajax_combobox($htmlname, $events); |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | if (!empty($page)) { |
| 1096 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1096 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1097 | 1097 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
| 1098 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1098 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 1101 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 1102 | 1102 | $out .= '<option value="0"> </option>'; |
| 1103 | 1103 | $num = $this->db->num_rows($resql); |
| 1104 | 1104 | $i = 0; |
@@ -1112,9 +1112,9 @@ discard block |
||
| 1112 | 1112 | |
| 1113 | 1113 | foreach ($incotermArray as $row) { |
| 1114 | 1114 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
| 1115 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
| 1115 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
| 1116 | 1116 | } else { |
| 1117 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
| 1117 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
| 1118 | 1118 | } |
| 1119 | 1119 | |
| 1120 | 1120 | if ($row['code']) { |
@@ -1128,13 +1128,13 @@ discard block |
||
| 1128 | 1128 | $out .= ajax_combobox($htmlname); |
| 1129 | 1129 | |
| 1130 | 1130 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 1131 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
| 1131 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
| 1132 | 1132 | $moreattrib .= ' autocomplete="off"'; |
| 1133 | 1133 | } |
| 1134 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
| 1134 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
| 1135 | 1135 | |
| 1136 | 1136 | if (!empty($page)) { |
| 1137 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
| 1137 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
| 1138 | 1138 | } |
| 1139 | 1139 | } else { |
| 1140 | 1140 | dol_print_error($this->db); |
@@ -1166,9 +1166,9 @@ discard block |
||
| 1166 | 1166 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
| 1167 | 1167 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
| 1168 | 1168 | if (empty($hidetext)) { |
| 1169 | - print $langs->trans("Type") . ': '; |
|
| 1169 | + print $langs->trans("Type").': '; |
|
| 1170 | 1170 | } |
| 1171 | - print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1171 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1172 | 1172 | if ($showempty) { |
| 1173 | 1173 | print '<option value="-1"'; |
| 1174 | 1174 | if ($selected == -1) { |
@@ -1187,28 +1187,28 @@ discard block |
||
| 1187 | 1187 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1188 | 1188 | print ' selected'; |
| 1189 | 1189 | } |
| 1190 | - print '>' . $langs->trans("Product"); |
|
| 1190 | + print '>'.$langs->trans("Product"); |
|
| 1191 | 1191 | |
| 1192 | 1192 | print '<option value="1"'; |
| 1193 | 1193 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1194 | 1194 | print ' selected'; |
| 1195 | 1195 | } |
| 1196 | - print '>' . $langs->trans("Service"); |
|
| 1196 | + print '>'.$langs->trans("Service"); |
|
| 1197 | 1197 | |
| 1198 | 1198 | print '</select>'; |
| 1199 | - print ajax_combobox('select_' . $htmlname); |
|
| 1199 | + print ajax_combobox('select_'.$htmlname); |
|
| 1200 | 1200 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1201 | 1201 | } |
| 1202 | 1202 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1203 | 1203 | print $langs->trans("Service"); |
| 1204 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1204 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1205 | 1205 | } |
| 1206 | 1206 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1207 | 1207 | print $langs->trans("Product"); |
| 1208 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1208 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1209 | 1209 | } |
| 1210 | 1210 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1211 | - 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 |
|
| 1211 | + 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 |
|
| 1212 | 1212 | } |
| 1213 | 1213 | } |
| 1214 | 1214 | |
@@ -1234,7 +1234,7 @@ discard block |
||
| 1234 | 1234 | $langs->load("trips"); |
| 1235 | 1235 | |
| 1236 | 1236 | $sql = "SELECT c.code, c.label"; |
| 1237 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1237 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1238 | 1238 | $sql .= " WHERE active > 0"; |
| 1239 | 1239 | |
| 1240 | 1240 | $resql = $this->db->query($sql); |
@@ -1275,11 +1275,11 @@ discard block |
||
| 1275 | 1275 | // phpcs:enable |
| 1276 | 1276 | global $user, $langs; |
| 1277 | 1277 | |
| 1278 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1278 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1279 | 1279 | |
| 1280 | 1280 | $this->load_cache_types_fees(); |
| 1281 | 1281 | |
| 1282 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1282 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1283 | 1283 | if ($showempty) { |
| 1284 | 1284 | print '<option value="-1"'; |
| 1285 | 1285 | if ($selected == -1) { |
@@ -1289,7 +1289,7 @@ discard block |
||
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | foreach ($this->cache_types_fees as $key => $value) { |
| 1292 | - print '<option value="' . $key . '"'; |
|
| 1292 | + print '<option value="'.$key.'"'; |
|
| 1293 | 1293 | if ($key == $selected) { |
| 1294 | 1294 | print ' selected'; |
| 1295 | 1295 | } |
@@ -1341,12 +1341,12 @@ discard block |
||
| 1341 | 1341 | $ajaxoptions = array(); |
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1344 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1345 | 1345 | |
| 1346 | 1346 | // No immediate load of all database |
| 1347 | 1347 | $placeholder = ''; |
| 1348 | 1348 | if ($selected && empty($selected_input_value)) { |
| 1349 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1349 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1350 | 1350 | $societetmp = new Societe($this->db); |
| 1351 | 1351 | $societetmp->fetch($selected); |
| 1352 | 1352 | $selected_input_value = $societetmp->name; |
@@ -1354,11 +1354,11 @@ discard block |
||
| 1354 | 1354 | } |
| 1355 | 1355 | |
| 1356 | 1356 | // mode 1 |
| 1357 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : ''); |
|
| 1357 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : ''); |
|
| 1358 | 1358 | |
| 1359 | 1359 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1360 | 1360 | if (empty($hidelabel)) { |
| 1361 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 1361 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 1362 | 1362 | } elseif ($hidelabel == 1 && !is_numeric($showempty)) { |
| 1363 | 1363 | $placeholder = $showempty; |
| 1364 | 1364 | } elseif ($hidelabel > 1) { |
@@ -1367,7 +1367,7 @@ discard block |
||
| 1367 | 1367 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1368 | 1368 | } |
| 1369 | 1369 | } |
| 1370 | - $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' : '') . ' />'; |
|
| 1370 | + $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' : '').' />'; |
|
| 1371 | 1371 | if ($hidelabel == 3) { |
| 1372 | 1372 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1373 | 1373 | } |
@@ -1429,12 +1429,12 @@ discard block |
||
| 1429 | 1429 | $events = array(); |
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1432 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1433 | 1433 | |
| 1434 | 1434 | // No immediate load of all database |
| 1435 | 1435 | $placeholder = ''; |
| 1436 | 1436 | if ($selected && empty($selected_input_value)) { |
| 1437 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1437 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1438 | 1438 | $contacttmp = new Contact($this->db); |
| 1439 | 1439 | $contacttmp->fetch($selected); |
| 1440 | 1440 | $selected_input_value = $contacttmp->getFullName($langs); |
@@ -1445,11 +1445,11 @@ discard block |
||
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | 1447 | // mode 1 |
| 1448 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : ''); |
|
| 1448 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : ''); |
|
| 1449 | 1449 | |
| 1450 | 1450 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1451 | 1451 | |
| 1452 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 1452 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 1453 | 1453 | |
| 1454 | 1454 | $out .= ajax_event($htmlname, $events); |
| 1455 | 1455 | |
@@ -1546,30 +1546,30 @@ discard block |
||
| 1546 | 1546 | $sql .= ", s.address, s.zip, s.town"; |
| 1547 | 1547 | $sql .= ", dictp.code as country_code"; |
| 1548 | 1548 | } |
| 1549 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1549 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1550 | 1550 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1551 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1551 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1552 | 1552 | } |
| 1553 | 1553 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1554 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1554 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1555 | 1555 | } |
| 1556 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1556 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1557 | 1557 | if (!empty($user->socid)) { |
| 1558 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1558 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1559 | 1559 | } |
| 1560 | 1560 | if ($filter) { |
| 1561 | 1561 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1562 | 1562 | // if not, by testSqlAndScriptInject() only. |
| 1563 | - $sql .= " AND (" . $filter . ")"; |
|
| 1563 | + $sql .= " AND (".$filter.")"; |
|
| 1564 | 1564 | } |
| 1565 | 1565 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1566 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1566 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1567 | 1567 | } |
| 1568 | 1568 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1569 | 1569 | $sql .= " AND s.status <> 0"; |
| 1570 | 1570 | } |
| 1571 | 1571 | if (!empty($excludeids)) { |
| 1572 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
| 1572 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
| 1573 | 1573 | } |
| 1574 | 1574 | // Add where from hooks |
| 1575 | 1575 | $parameters = array(); |
@@ -1589,17 +1589,17 @@ discard block |
||
| 1589 | 1589 | if ($i > 0) { |
| 1590 | 1590 | $sql .= " AND "; |
| 1591 | 1591 | } |
| 1592 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1592 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1593 | 1593 | $i++; |
| 1594 | 1594 | } |
| 1595 | 1595 | if (count($search_crit) > 1) { |
| 1596 | 1596 | $sql .= ")"; |
| 1597 | 1597 | } |
| 1598 | 1598 | if (isModEnabled('barcode')) { |
| 1599 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1599 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1600 | 1600 | } |
| 1601 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1602 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1601 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1602 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1603 | 1603 | $sql .= ")"; |
| 1604 | 1604 | } |
| 1605 | 1605 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1610,7 +1610,7 @@ discard block |
||
| 1610 | 1610 | $resql = $this->db->query($sql); |
| 1611 | 1611 | if ($resql) { |
| 1612 | 1612 | // Construct $out and $outarray |
| 1613 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1613 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1614 | 1614 | |
| 1615 | 1615 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1616 | 1616 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | } |
| 1624 | 1624 | } |
| 1625 | 1625 | if ($showempty) { |
| 1626 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1626 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1627 | 1627 | } |
| 1628 | 1628 | |
| 1629 | 1629 | $companytemp = new Societe($this->db); |
@@ -1636,18 +1636,18 @@ discard block |
||
| 1636 | 1636 | $label = ''; |
| 1637 | 1637 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
| 1638 | 1638 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1639 | - $label = $obj->code_client . ' - '; |
|
| 1639 | + $label = $obj->code_client.' - '; |
|
| 1640 | 1640 | } |
| 1641 | 1641 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1642 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1642 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1643 | 1643 | } |
| 1644 | - $label .= ' ' . $obj->name; |
|
| 1644 | + $label .= ' '.$obj->name; |
|
| 1645 | 1645 | } else { |
| 1646 | 1646 | $label = $obj->name; |
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | 1649 | if (!empty($obj->name_alias)) { |
| 1650 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1650 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1662,7 +1662,7 @@ discard block |
||
| 1662 | 1662 | $companytemp->fournisseur = $obj->fournisseur; |
| 1663 | 1663 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1664 | 1664 | if ($tmptype) { |
| 1665 | - $labelhtml .= ' ' . $tmptype; |
|
| 1665 | + $labelhtml .= ' '.$tmptype; |
|
| 1666 | 1666 | } |
| 1667 | 1667 | |
| 1668 | 1668 | if ($obj->client || $obj->fournisseur) { |
@@ -1672,10 +1672,10 @@ discard block |
||
| 1672 | 1672 | $label .= $langs->trans("Customer"); |
| 1673 | 1673 | } |
| 1674 | 1674 | if ($obj->client == 2 || $obj->client == 3) { |
| 1675 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1675 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1676 | 1676 | } |
| 1677 | 1677 | if ($obj->fournisseur) { |
| 1678 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1678 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1679 | 1679 | } |
| 1680 | 1680 | if ($obj->client || $obj->fournisseur) { |
| 1681 | 1681 | $label .= ')'; |
@@ -1683,9 +1683,9 @@ discard block |
||
| 1683 | 1683 | } |
| 1684 | 1684 | |
| 1685 | 1685 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1686 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1686 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1687 | 1687 | if (!empty($obj->country_code)) { |
| 1688 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1688 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1689 | 1689 | } |
| 1690 | 1690 | $label .= $s; |
| 1691 | 1691 | $labelhtml .= $s; |
@@ -1693,9 +1693,9 @@ discard block |
||
| 1693 | 1693 | |
| 1694 | 1694 | if (empty($outputmode)) { |
| 1695 | 1695 | if (in_array($obj->rowid, $selected)) { |
| 1696 | - $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>'; |
|
| 1696 | + $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>'; |
|
| 1697 | 1697 | } else { |
| 1698 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1698 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1699 | 1699 | } |
| 1700 | 1700 | } else { |
| 1701 | 1701 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1707,9 +1707,9 @@ discard block |
||
| 1707 | 1707 | } |
| 1708 | 1708 | } |
| 1709 | 1709 | } |
| 1710 | - $out .= '</select>' . "\n"; |
|
| 1710 | + $out .= '</select>'."\n"; |
|
| 1711 | 1711 | if (!$forcecombo) { |
| 1712 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1712 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1713 | 1713 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1714 | 1714 | } |
| 1715 | 1715 | } else { |
@@ -1798,7 +1798,7 @@ discard block |
||
| 1798 | 1798 | } |
| 1799 | 1799 | |
| 1800 | 1800 | if (!is_object($hookmanager)) { |
| 1801 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1801 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1802 | 1802 | $hookmanager = new HookManager($this->db); |
| 1803 | 1803 | } |
| 1804 | 1804 | |
@@ -1807,13 +1807,13 @@ discard block |
||
| 1807 | 1807 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1808 | 1808 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1809 | 1809 | } |
| 1810 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1810 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1811 | 1811 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1812 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1812 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1813 | 1813 | } |
| 1814 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1814 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1815 | 1815 | if ($socid > 0 || $socid == -1) { |
| 1816 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1816 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1817 | 1817 | } |
| 1818 | 1818 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1819 | 1819 | $sql .= " AND sp.statut <> 0"; |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | if ($filter) { |
| 1822 | 1822 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1823 | 1823 | // if not, by testSqlAndScriptInject() only. |
| 1824 | - $sql .= " AND (" . $filter . ")"; |
|
| 1824 | + $sql .= " AND (".$filter.")"; |
|
| 1825 | 1825 | } |
| 1826 | 1826 | // Add where from hooks |
| 1827 | 1827 | $parameters = array(); |
@@ -1829,30 +1829,30 @@ discard block |
||
| 1829 | 1829 | $sql .= $hookmanager->resPrint; |
| 1830 | 1830 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1831 | 1831 | |
| 1832 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1832 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1833 | 1833 | $resql = $this->db->query($sql); |
| 1834 | 1834 | if ($resql) { |
| 1835 | 1835 | $num = $this->db->num_rows($resql); |
| 1836 | 1836 | |
| 1837 | 1837 | if ($htmlname != 'none' && !$options_only) { |
| 1838 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1838 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1839 | 1839 | } |
| 1840 | 1840 | |
| 1841 | 1841 | if ($showempty && !is_numeric($showempty)) { |
| 1842 | 1842 | $textforempty = $showempty; |
| 1843 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1843 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1844 | 1844 | } else { |
| 1845 | 1845 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1846 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1846 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1847 | 1847 | } |
| 1848 | 1848 | if ($showempty == 2) { |
| 1849 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1849 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1850 | 1850 | } |
| 1851 | 1851 | } |
| 1852 | 1852 | |
| 1853 | 1853 | $i = 0; |
| 1854 | 1854 | if ($num) { |
| 1855 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1855 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1856 | 1856 | $contactstatic = new Contact($this->db); |
| 1857 | 1857 | |
| 1858 | 1858 | while ($i < $num) { |
@@ -1888,7 +1888,7 @@ discard block |
||
| 1888 | 1888 | } |
| 1889 | 1889 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1890 | 1890 | if (!empty($extendedInfos)) { |
| 1891 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1891 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1892 | 1892 | } |
| 1893 | 1893 | } |
| 1894 | 1894 | |
@@ -1906,35 +1906,35 @@ discard block |
||
| 1906 | 1906 | $disabled = 1; |
| 1907 | 1907 | } |
| 1908 | 1908 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1909 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1909 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1910 | 1910 | if ($disabled) { |
| 1911 | 1911 | $out .= ' disabled'; |
| 1912 | 1912 | } |
| 1913 | 1913 | $out .= ' selected>'; |
| 1914 | 1914 | |
| 1915 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1915 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1916 | 1916 | if ($showfunction && $obj->poste) { |
| 1917 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1917 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1918 | 1918 | } |
| 1919 | 1919 | if (($showsoc > 0) && $obj->company) { |
| 1920 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1920 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1921 | 1921 | } |
| 1922 | 1922 | |
| 1923 | 1923 | $out .= $tmplabel; |
| 1924 | 1924 | $out .= '</option>'; |
| 1925 | 1925 | } else { |
| 1926 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1926 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1927 | 1927 | if ($disabled) { |
| 1928 | 1928 | $out .= ' disabled'; |
| 1929 | 1929 | } |
| 1930 | 1930 | $out .= '>'; |
| 1931 | 1931 | |
| 1932 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1932 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1933 | 1933 | if ($showfunction && $obj->poste) { |
| 1934 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1934 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1935 | 1935 | } |
| 1936 | 1936 | if (($showsoc > 0) && $obj->company) { |
| 1937 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1937 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1938 | 1938 | } |
| 1939 | 1939 | |
| 1940 | 1940 | $out .= $tmplabel; |
@@ -1942,12 +1942,12 @@ discard block |
||
| 1942 | 1942 | } |
| 1943 | 1943 | } else { |
| 1944 | 1944 | if (in_array($obj->rowid, $selected)) { |
| 1945 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1945 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1946 | 1946 | if ($showfunction && $obj->poste) { |
| 1947 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1947 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1948 | 1948 | } |
| 1949 | 1949 | if (($showsoc > 0) && $obj->company) { |
| 1950 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1950 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1951 | 1951 | } |
| 1952 | 1952 | |
| 1953 | 1953 | $out .= $tmplabel; |
@@ -1962,7 +1962,7 @@ discard block |
||
| 1962 | 1962 | } |
| 1963 | 1963 | } else { |
| 1964 | 1964 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1965 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1965 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1966 | 1966 | $out .= $labeltoshow; |
| 1967 | 1967 | $out .= '</option>'; |
| 1968 | 1968 | } |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | } |
| 1984 | 1984 | |
| 1985 | 1985 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1986 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1986 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1987 | 1987 | $out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1988 | 1988 | } |
| 1989 | 1989 | |
@@ -2022,18 +2022,18 @@ discard block |
||
| 2022 | 2022 | // On recherche les remises |
| 2023 | 2023 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 2024 | 2024 | $sql .= " re.description, re.fk_facture_source"; |
| 2025 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 2026 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 2027 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 2025 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 2026 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 2027 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 2028 | 2028 | if ($filter) { |
| 2029 | - $sql .= " AND " . $filter; |
|
| 2029 | + $sql .= " AND ".$filter; |
|
| 2030 | 2030 | } |
| 2031 | 2031 | $sql .= " ORDER BY re.description ASC"; |
| 2032 | 2032 | |
| 2033 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 2033 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 2034 | 2034 | $resql = $this->db->query($sql); |
| 2035 | 2035 | if ($resql) { |
| 2036 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 2036 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 2037 | 2037 | $num = $this->db->num_rows($resql); |
| 2038 | 2038 | |
| 2039 | 2039 | $qualifiedlines = $num; |
@@ -2071,16 +2071,16 @@ discard block |
||
| 2071 | 2071 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
| 2072 | 2072 | $tmpfac = new Facture($this->db); |
| 2073 | 2073 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 2074 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 2074 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 2075 | 2075 | } |
| 2076 | 2076 | } |
| 2077 | 2077 | |
| 2078 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 2078 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 2079 | 2079 | $i++; |
| 2080 | 2080 | } |
| 2081 | 2081 | } |
| 2082 | 2082 | print '</select>'; |
| 2083 | - print ajax_combobox('select_' . $htmlname); |
|
| 2083 | + print ajax_combobox('select_'.$htmlname); |
|
| 2084 | 2084 | |
| 2085 | 2085 | return $qualifiedlines; |
| 2086 | 2086 | } else { |
@@ -2189,14 +2189,14 @@ discard block |
||
| 2189 | 2189 | if ($showlabelofentity) { |
| 2190 | 2190 | $sql .= ", e.label"; |
| 2191 | 2191 | } |
| 2192 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2192 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2193 | 2193 | if ($showlabelofentity) { |
| 2194 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2194 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2195 | 2195 | } |
| 2196 | 2196 | // Condition here should be the same than into societe->getSalesRepresentatives(). |
| 2197 | 2197 | if ($userissuperadminentityone && $force_entity != 'default') { |
| 2198 | 2198 | if (!empty($force_entity)) { |
| 2199 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2199 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2200 | 2200 | } else { |
| 2201 | 2201 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2202 | 2202 | } |
@@ -2204,18 +2204,18 @@ discard block |
||
| 2204 | 2204 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2205 | 2205 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2206 | 2206 | } else { |
| 2207 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2207 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2208 | 2208 | } |
| 2209 | 2209 | } |
| 2210 | 2210 | |
| 2211 | 2211 | if (!empty($user->socid)) { |
| 2212 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2212 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2213 | 2213 | } |
| 2214 | 2214 | if (is_array($exclude) && $excludeUsers) { |
| 2215 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2215 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2216 | 2216 | } |
| 2217 | 2217 | if ($includeUsers) { |
| 2218 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2218 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2219 | 2219 | } |
| 2220 | 2220 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
| 2221 | 2221 | $sql .= " AND u.statut <> 0"; |
@@ -2227,7 +2227,7 @@ discard block |
||
| 2227 | 2227 | $sql .= " AND u.fk_soc IS NULL"; |
| 2228 | 2228 | } |
| 2229 | 2229 | if (!empty($morefilter)) { |
| 2230 | - $sql .= " " . $morefilter; |
|
| 2230 | + $sql .= " ".$morefilter; |
|
| 2231 | 2231 | } |
| 2232 | 2232 | |
| 2233 | 2233 | //Add hook to filter on user (for example on usergroup define in custom modules) |
@@ -2242,7 +2242,7 @@ discard block |
||
| 2242 | 2242 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2243 | 2243 | } |
| 2244 | 2244 | |
| 2245 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2245 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2246 | 2246 | |
| 2247 | 2247 | $resql = $this->db->query($sql); |
| 2248 | 2248 | if ($resql) { |
@@ -2250,7 +2250,7 @@ discard block |
||
| 2250 | 2250 | $i = 0; |
| 2251 | 2251 | if ($num) { |
| 2252 | 2252 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2253 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2253 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2254 | 2254 | if ($show_empty && !$multiple) { |
| 2255 | 2255 | $textforempty = ' '; |
| 2256 | 2256 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2259,7 +2259,7 @@ discard block |
||
| 2259 | 2259 | if (!is_numeric($show_empty)) { |
| 2260 | 2260 | $textforempty = $show_empty; |
| 2261 | 2261 | } |
| 2262 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2262 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2263 | 2263 | |
| 2264 | 2264 | $outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty; |
| 2265 | 2265 | $outarray2[($show_empty < 0 ? $show_empty : -1)] = array( |
@@ -2271,13 +2271,13 @@ discard block |
||
| 2271 | 2271 | ); |
| 2272 | 2272 | } |
| 2273 | 2273 | if ($show_every) { |
| 2274 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2274 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2275 | 2275 | |
| 2276 | - $outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --'; |
|
| 2276 | + $outarray[-2] = '-- '.$langs->trans("Everybody").' --'; |
|
| 2277 | 2277 | $outarray2[-2] = array( |
| 2278 | 2278 | 'id' => -2, |
| 2279 | - 'label' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2280 | - 'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2279 | + 'label' => '-- '.$langs->trans("Everybody").' --', |
|
| 2280 | + 'labelhtml' => '-- '.$langs->trans("Everybody").' --', |
|
| 2281 | 2281 | 'color' => '', |
| 2282 | 2282 | 'picto' => '' |
| 2283 | 2283 | ); |
@@ -2328,21 +2328,21 @@ discard block |
||
| 2328 | 2328 | } |
| 2329 | 2329 | if ($showstatus >= 0) { |
| 2330 | 2330 | if ($obj->status == 1 && $showstatus == 1) { |
| 2331 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2332 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2331 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2332 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2333 | 2333 | } |
| 2334 | 2334 | if ($obj->status == 0 && $showstatus == 1) { |
| 2335 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2336 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2335 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2336 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2337 | 2337 | } |
| 2338 | 2338 | } |
| 2339 | 2339 | if ($showlabelofentity) { |
| 2340 | 2340 | if (empty($obj->entity)) { |
| 2341 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2342 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2341 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2342 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2343 | 2343 | } else { |
| 2344 | 2344 | if ($obj->entity != $conf->entity) { |
| 2345 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2345 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2346 | 2346 | $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
| 2347 | 2347 | } |
| 2348 | 2348 | } |
@@ -2351,13 +2351,13 @@ discard block |
||
| 2351 | 2351 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2352 | 2352 | if (!empty($disableline) && $disableline != '1') { |
| 2353 | 2353 | // Add text from $enableonlytext parameter |
| 2354 | - $moreinfo .= ' - ' . $disableline; |
|
| 2355 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2354 | + $moreinfo .= ' - '.$disableline; |
|
| 2355 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2356 | 2356 | } |
| 2357 | 2357 | $labeltoshow .= $moreinfo; |
| 2358 | 2358 | $labeltoshowhtml .= $moreinfohtml; |
| 2359 | 2359 | |
| 2360 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2360 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2361 | 2361 | if (!empty($disableline)) { |
| 2362 | 2362 | $out .= ' disabled'; |
| 2363 | 2363 | } |
@@ -2366,7 +2366,7 @@ discard block |
||
| 2366 | 2366 | } |
| 2367 | 2367 | $out .= ' data-html="'; |
| 2368 | 2368 | |
| 2369 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2369 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2370 | 2370 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2371 | 2371 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2372 | 2372 | } |
@@ -2381,7 +2381,7 @@ discard block |
||
| 2381 | 2381 | $out .= $labeltoshow; |
| 2382 | 2382 | $out .= '</option>'; |
| 2383 | 2383 | |
| 2384 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2384 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2385 | 2385 | $outarray2[$userstatic->id] = array( |
| 2386 | 2386 | 'id' => $userstatic->id, |
| 2387 | 2387 | 'label' => $labeltoshow, |
@@ -2393,14 +2393,14 @@ discard block |
||
| 2393 | 2393 | $i++; |
| 2394 | 2394 | } |
| 2395 | 2395 | } else { |
| 2396 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2397 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2396 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2397 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2398 | 2398 | } |
| 2399 | 2399 | $out .= '</select>'; |
| 2400 | 2400 | |
| 2401 | 2401 | if ($num && !$forcecombo) { |
| 2402 | 2402 | // Enhance with select2 |
| 2403 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2403 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2404 | 2404 | $out .= ajax_combobox($htmlname); |
| 2405 | 2405 | } |
| 2406 | 2406 | } else { |
@@ -2476,16 +2476,16 @@ discard block |
||
| 2476 | 2476 | $out .= $userstatic->getNomUrl(-1); |
| 2477 | 2477 | if ($i == 0) { |
| 2478 | 2478 | $ownerid = $value['id']; |
| 2479 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2479 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2480 | 2480 | } |
| 2481 | 2481 | if ($nbassignetouser > 1 && $action != 'view') { |
| 2482 | - $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 . '">'; |
|
| 2482 | + $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.'">'; |
|
| 2483 | 2483 | } |
| 2484 | 2484 | // Show my availability |
| 2485 | 2485 | if ($showproperties) { |
| 2486 | 2486 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2487 | 2487 | $out .= '<div class="myavailability inline-block">'; |
| 2488 | - $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>'; |
|
| 2488 | + $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>'; |
|
| 2489 | 2489 | $out .= '</div>'; |
| 2490 | 2490 | } |
| 2491 | 2491 | } |
@@ -2502,15 +2502,15 @@ discard block |
||
| 2502 | 2502 | // Method with no ajax |
| 2503 | 2503 | if ($action != 'view') { |
| 2504 | 2504 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2505 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2505 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2506 | 2506 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2507 | 2507 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2508 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2509 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2508 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2509 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2510 | 2510 | $out .= '});'; |
| 2511 | 2511 | $out .= '})</script>'; |
| 2512 | 2512 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2513 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2513 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2514 | 2514 | $out .= '<br>'; |
| 2515 | 2515 | } |
| 2516 | 2516 | |
@@ -2569,13 +2569,13 @@ discard block |
||
| 2569 | 2569 | $resourcestatic->fetch($value['id']); |
| 2570 | 2570 | $out .= $resourcestatic->getNomUrl(-1); |
| 2571 | 2571 | if ($nbassignetoresource > 1 && $action != 'view') { |
| 2572 | - $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 . '">'; |
|
| 2572 | + $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.'">'; |
|
| 2573 | 2573 | } |
| 2574 | 2574 | // Show my availability |
| 2575 | 2575 | if ($showproperties) { |
| 2576 | 2576 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2577 | 2577 | $out .= '<div class="myavailability inline-block">'; |
| 2578 | - $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>'; |
|
| 2578 | + $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>'; |
|
| 2579 | 2579 | $out .= '</div>'; |
| 2580 | 2580 | } |
| 2581 | 2581 | } |
@@ -2592,11 +2592,11 @@ discard block |
||
| 2592 | 2592 | // Method with no ajax |
| 2593 | 2593 | if ($action != 'view') { |
| 2594 | 2594 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
| 2595 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2595 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2596 | 2596 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2597 | 2597 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2598 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2599 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2598 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2599 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2600 | 2600 | $out .= '});'; |
| 2601 | 2601 | $out .= '})</script>'; |
| 2602 | 2602 | |
@@ -2604,7 +2604,7 @@ discard block |
||
| 2604 | 2604 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2605 | 2605 | $out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0); |
| 2606 | 2606 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2607 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2607 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2608 | 2608 | $out .= '<br>'; |
| 2609 | 2609 | } |
| 2610 | 2610 | |
@@ -2668,7 +2668,7 @@ discard block |
||
| 2668 | 2668 | $placeholder = ''; |
| 2669 | 2669 | |
| 2670 | 2670 | if ($selected && empty($selected_input_value)) { |
| 2671 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2671 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2672 | 2672 | $producttmpselect = new Product($this->db); |
| 2673 | 2673 | $producttmpselect->fetch($selected); |
| 2674 | 2674 | $selected_input_value = $producttmpselect->ref; |
@@ -2683,20 +2683,20 @@ discard block |
||
| 2683 | 2683 | } |
| 2684 | 2684 | } |
| 2685 | 2685 | // mode=1 means customers products |
| 2686 | - $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; |
|
| 2686 | + $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; |
|
| 2687 | 2687 | if ((int) $warehouseId > 0) { |
| 2688 | - $urloption .= '&warehouseid=' . (int) $warehouseId; |
|
| 2688 | + $urloption .= '&warehouseid='.(int) $warehouseId; |
|
| 2689 | 2689 | } |
| 2690 | - $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
| 2690 | + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
| 2691 | 2691 | |
| 2692 | 2692 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2693 | 2693 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2694 | 2694 | // when a parent of variant has been selected. |
| 2695 | 2695 | $out .= ' |
| 2696 | 2696 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2697 | - <script nonce="' . getNonce() . '"> |
|
| 2697 | + <script nonce="' . getNonce().'"> |
|
| 2698 | 2698 | // auto show attributes fields |
| 2699 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2699 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2700 | 2700 | combvalues = {}; |
| 2701 | 2701 | |
| 2702 | 2702 | jQuery(document).ready(function () { |
@@ -2707,7 +2707,7 @@ discard block |
||
| 2707 | 2707 | } |
| 2708 | 2708 | }); |
| 2709 | 2709 | |
| 2710 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2710 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2711 | 2711 | |
| 2712 | 2712 | if (!jQuery(this).val()) { |
| 2713 | 2713 | jQuery(\'div#attributes_box\').empty(); |
@@ -2716,7 +2716,7 @@ discard block |
||
| 2716 | 2716 | |
| 2717 | 2717 | console.log("A change has started. We get variants fields to inject html select"); |
| 2718 | 2718 | |
| 2719 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2719 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2720 | 2720 | id: jQuery(this).val() |
| 2721 | 2721 | }, function (data) { |
| 2722 | 2722 | jQuery(\'div#attributes_box\').empty(); |
@@ -2759,21 +2759,21 @@ discard block |
||
| 2759 | 2759 | }) |
| 2760 | 2760 | }); |
| 2761 | 2761 | |
| 2762 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2762 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2763 | 2763 | }); |
| 2764 | 2764 | </script> |
| 2765 | 2765 | '; |
| 2766 | 2766 | } |
| 2767 | 2767 | |
| 2768 | 2768 | if (empty($hidelabel)) { |
| 2769 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 2769 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 2770 | 2770 | } elseif ($hidelabel > 1) { |
| 2771 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 2771 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 2772 | 2772 | if ($hidelabel == 2) { |
| 2773 | 2773 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2774 | 2774 | } |
| 2775 | 2775 | } |
| 2776 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 2776 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 2777 | 2777 | if ($hidelabel == 3) { |
| 2778 | 2778 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2779 | 2779 | } |
@@ -2810,33 +2810,33 @@ discard block |
||
| 2810 | 2810 | // phpcs:enable |
| 2811 | 2811 | global $db; |
| 2812 | 2812 | |
| 2813 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2813 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2814 | 2814 | |
| 2815 | 2815 | $error = 0; |
| 2816 | 2816 | $out = ''; |
| 2817 | 2817 | |
| 2818 | 2818 | if (!$forcecombo) { |
| 2819 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2819 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2820 | 2820 | $events = array(); |
| 2821 | 2821 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2822 | 2822 | } |
| 2823 | 2823 | |
| 2824 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2824 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2825 | 2825 | |
| 2826 | 2826 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2827 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2828 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2827 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2828 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2829 | 2829 | if (!empty($status)) { |
| 2830 | - $sql .= ' AND status = ' . (int) $status; |
|
| 2830 | + $sql .= ' AND status = '.(int) $status; |
|
| 2831 | 2831 | } |
| 2832 | 2832 | if (!empty($type)) { |
| 2833 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2833 | + $sql .= ' AND bomtype = '.(int) $type; |
|
| 2834 | 2834 | } |
| 2835 | 2835 | if (!empty($TProducts)) { |
| 2836 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2836 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2837 | 2837 | } |
| 2838 | 2838 | if (!empty($limit)) { |
| 2839 | - $sql .= ' LIMIT ' . (int) $limit; |
|
| 2839 | + $sql .= ' LIMIT '.(int) $limit; |
|
| 2840 | 2840 | } |
| 2841 | 2841 | $resql = $db->query($sql); |
| 2842 | 2842 | if ($resql) { |
@@ -2850,11 +2850,11 @@ discard block |
||
| 2850 | 2850 | while ($obj = $db->fetch_object($resql)) { |
| 2851 | 2851 | $product = new Product($db); |
| 2852 | 2852 | $res = $product->fetch($obj->fk_product); |
| 2853 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2853 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2854 | 2854 | if ($obj->rowid == $selected) { |
| 2855 | 2855 | $out .= 'selected'; |
| 2856 | 2856 | } |
| 2857 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2857 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2858 | 2858 | } |
| 2859 | 2859 | } else { |
| 2860 | 2860 | $error++; |
@@ -2912,7 +2912,7 @@ discard block |
||
| 2912 | 2912 | |
| 2913 | 2913 | $warehouseStatusArray = array(); |
| 2914 | 2914 | if (!empty($warehouseStatus)) { |
| 2915 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2915 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2916 | 2916 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2917 | 2917 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2918 | 2918 | } |
@@ -2926,9 +2926,9 @@ discard block |
||
| 2926 | 2926 | |
| 2927 | 2927 | $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"; |
| 2928 | 2928 | if (count($warehouseStatusArray)) { |
| 2929 | - $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 |
|
| 2929 | + $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 |
|
| 2930 | 2930 | } else { |
| 2931 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2931 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2932 | 2932 | } |
| 2933 | 2933 | |
| 2934 | 2934 | $sql = "SELECT "; |
@@ -2944,9 +2944,9 @@ discard block |
||
| 2944 | 2944 | |
| 2945 | 2945 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
| 2946 | 2946 | //Product category |
| 2947 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2948 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2949 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2947 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2948 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2949 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2950 | 2950 | LIMIT 1 |
| 2951 | 2951 | ) AS categorie_product_id "; |
| 2952 | 2952 | } |
@@ -2972,15 +2972,15 @@ discard block |
||
| 2972 | 2972 | } |
| 2973 | 2973 | // Price by quantity |
| 2974 | 2974 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2975 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2975 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2976 | 2976 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2977 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2977 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2978 | 2978 | } |
| 2979 | 2979 | $sql .= " ORDER BY date_price"; |
| 2980 | 2980 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 2981 | - $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 |
|
| 2981 | + $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 |
|
| 2982 | 2982 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2983 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2983 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2984 | 2984 | } |
| 2985 | 2985 | $sql .= " ORDER BY date_price"; |
| 2986 | 2986 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2990,7 +2990,7 @@ discard block |
||
| 2990 | 2990 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
| 2991 | 2991 | |
| 2992 | 2992 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) { |
| 2993 | - $sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")"; |
|
| 2993 | + $sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")"; |
|
| 2994 | 2994 | } |
| 2995 | 2995 | |
| 2996 | 2996 | // Add from (left join) from hooks |
@@ -2999,53 +2999,53 @@ discard block |
||
| 2999 | 2999 | $sql .= $hookmanager->resPrint; |
| 3000 | 3000 | |
| 3001 | 3001 | if (count($warehouseStatusArray)) { |
| 3002 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3003 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 3004 | - $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. |
|
| 3002 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3003 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 3004 | + $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. |
|
| 3005 | 3005 | } |
| 3006 | 3006 | |
| 3007 | 3007 | // include search in supplier ref |
| 3008 | 3008 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3009 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3009 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3010 | 3010 | } |
| 3011 | 3011 | |
| 3012 | 3012 | //Price by customer |
| 3013 | 3013 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
| 3014 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 3014 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 3015 | 3015 | } |
| 3016 | 3016 | // Units |
| 3017 | 3017 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3018 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3018 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3019 | 3019 | } |
| 3020 | 3020 | // Multilang : we add translation |
| 3021 | 3021 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3022 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3022 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3023 | 3023 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
| 3024 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 3024 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 3025 | 3025 | $soc = new Societe($this->db); |
| 3026 | 3026 | $result = $soc->fetch($socid); |
| 3027 | 3027 | if ($result > 0 && !empty($soc->default_lang)) { |
| 3028 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 3028 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 3029 | 3029 | } else { |
| 3030 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3030 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3031 | 3031 | } |
| 3032 | 3032 | } else { |
| 3033 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3033 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3034 | 3034 | } |
| 3035 | 3035 | } |
| 3036 | 3036 | |
| 3037 | 3037 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3038 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3038 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3039 | 3039 | } |
| 3040 | 3040 | |
| 3041 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 3041 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 3042 | 3042 | |
| 3043 | 3043 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3044 | 3044 | $sql .= " AND pac.rowid IS NULL"; |
| 3045 | 3045 | } |
| 3046 | 3046 | |
| 3047 | 3047 | if ($finished == 0) { |
| 3048 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 3048 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 3049 | 3049 | } elseif ($finished == 1) { |
| 3050 | 3050 | $sql .= " AND p.finished = ".((int) $finished); |
| 3051 | 3051 | } |
@@ -3053,11 +3053,11 @@ discard block |
||
| 3053 | 3053 | $sql .= " AND p.tosell = ".((int) $status); |
| 3054 | 3054 | } |
| 3055 | 3055 | if ($status_purchase >= 0) { |
| 3056 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 3056 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 3057 | 3057 | } |
| 3058 | 3058 | // Filter by product type |
| 3059 | 3059 | if (strval($filtertype) != '') { |
| 3060 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3060 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3061 | 3061 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 3062 | 3062 | $sql .= " AND p.fk_product_type = 1"; |
| 3063 | 3063 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -3065,7 +3065,7 @@ discard block |
||
| 3065 | 3065 | } |
| 3066 | 3066 | |
| 3067 | 3067 | if ((int) $warehouseId > 0) { |
| 3068 | - $sql .= " AND EXISTS (SELECT psw.fk_product FROM " . $this->db->prefix() . "product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
| 3068 | + $sql .= " AND EXISTS (SELECT psw.fk_product FROM ".$this->db->prefix()."product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
| 3069 | 3069 | } |
| 3070 | 3070 | |
| 3071 | 3071 | // Add where from hooks |
@@ -3086,21 +3086,21 @@ discard block |
||
| 3086 | 3086 | if ($i > 0) { |
| 3087 | 3087 | $sql .= " AND "; |
| 3088 | 3088 | } |
| 3089 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3089 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3090 | 3090 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3091 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3091 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3092 | 3092 | } |
| 3093 | 3093 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
| 3094 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3094 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3095 | 3095 | } |
| 3096 | 3096 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
| 3097 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3097 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3098 | 3098 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3099 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3099 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3100 | 3100 | } |
| 3101 | 3101 | } |
| 3102 | 3102 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3103 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3103 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3104 | 3104 | } |
| 3105 | 3105 | $sql .= ")"; |
| 3106 | 3106 | $i++; |
@@ -3109,12 +3109,12 @@ discard block |
||
| 3109 | 3109 | $sql .= ")"; |
| 3110 | 3110 | } |
| 3111 | 3111 | if (isModEnabled('barcode')) { |
| 3112 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3112 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3113 | 3113 | } |
| 3114 | 3114 | $sql .= ')'; |
| 3115 | 3115 | } |
| 3116 | 3116 | if (count($warehouseStatusArray)) { |
| 3117 | - $sql .= " GROUP BY " . $selectFields; |
|
| 3117 | + $sql .= " GROUP BY ".$selectFields; |
|
| 3118 | 3118 | } |
| 3119 | 3119 | |
| 3120 | 3120 | //Sort by category |
@@ -3129,23 +3129,23 @@ discard block |
||
| 3129 | 3129 | $sql .= $this->db->plimit($limit, 0); |
| 3130 | 3130 | |
| 3131 | 3131 | // Build output string |
| 3132 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 3132 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 3133 | 3133 | $result = $this->db->query($sql); |
| 3134 | 3134 | if ($result) { |
| 3135 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3136 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3137 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3135 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3136 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3137 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3138 | 3138 | |
| 3139 | 3139 | $num = $this->db->num_rows($result); |
| 3140 | 3140 | |
| 3141 | 3141 | $events = array(); |
| 3142 | 3142 | |
| 3143 | 3143 | if (!$forcecombo) { |
| 3144 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3144 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3145 | 3145 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 3146 | 3146 | } |
| 3147 | 3147 | |
| 3148 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 3148 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 3149 | 3149 | |
| 3150 | 3150 | $textifempty = ''; |
| 3151 | 3151 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -3162,7 +3162,7 @@ discard block |
||
| 3162 | 3162 | } |
| 3163 | 3163 | } |
| 3164 | 3164 | if ($showempty) { |
| 3165 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 3165 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 3166 | 3166 | } |
| 3167 | 3167 | |
| 3168 | 3168 | $i = 0; |
@@ -3173,11 +3173,11 @@ discard block |
||
| 3173 | 3173 | |
| 3174 | 3174 | 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 |
| 3175 | 3175 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 3176 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 3177 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 3176 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 3177 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 3178 | 3178 | $sql .= " ORDER BY quantity ASC"; |
| 3179 | 3179 | |
| 3180 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3180 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3181 | 3181 | $result2 = $this->db->query($sql); |
| 3182 | 3182 | if ($result2) { |
| 3183 | 3183 | $nb_prices = $this->db->num_rows($result2); |
@@ -3215,7 +3215,7 @@ discard block |
||
| 3215 | 3215 | $price_product = new Product($this->db); |
| 3216 | 3216 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3217 | 3217 | |
| 3218 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3218 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3219 | 3219 | $priceparser = new PriceParser($this->db); |
| 3220 | 3220 | $price_result = $priceparser->parseProduct($price_product); |
| 3221 | 3221 | if ($price_result >= 0) { |
@@ -3301,7 +3301,7 @@ discard block |
||
| 3301 | 3301 | $label = $objp->label_translated; |
| 3302 | 3302 | } |
| 3303 | 3303 | if (!empty($filterkey) && $filterkey != '') { |
| 3304 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3304 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3305 | 3305 | } |
| 3306 | 3306 | |
| 3307 | 3307 | $outkey = $objp->rowid; |
@@ -3322,32 +3322,32 @@ discard block |
||
| 3322 | 3322 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3323 | 3323 | |
| 3324 | 3324 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3325 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3325 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3326 | 3326 | } |
| 3327 | 3327 | |
| 3328 | 3328 | // Units |
| 3329 | 3329 | $outvalUnits = ''; |
| 3330 | 3330 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3331 | 3331 | if (!empty($objp->unit_short)) { |
| 3332 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3332 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3333 | 3333 | } |
| 3334 | 3334 | } |
| 3335 | 3335 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
| 3336 | 3336 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3337 | 3337 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3338 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3338 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3339 | 3339 | } |
| 3340 | 3340 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3341 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3342 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3341 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3342 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3343 | 3343 | } |
| 3344 | 3344 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3345 | 3345 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3346 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3346 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3347 | 3347 | } |
| 3348 | 3348 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3349 | 3349 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3350 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3350 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3351 | 3351 | } |
| 3352 | 3352 | } |
| 3353 | 3353 | if ($outdurationvalue && $outdurationunit) { |
@@ -3359,7 +3359,7 @@ discard block |
||
| 3359 | 3359 | 'y' => $langs->trans('Year') |
| 3360 | 3360 | ); |
| 3361 | 3361 | if (isset($da[$outdurationunit])) { |
| 3362 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3362 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3363 | 3363 | } |
| 3364 | 3364 | } |
| 3365 | 3365 | |
@@ -3379,31 +3379,31 @@ discard block |
||
| 3379 | 3379 | $labeltoshow = ''; |
| 3380 | 3380 | $labeltoshow .= $objp->ref; |
| 3381 | 3381 | if (!empty($objp->custref)) { |
| 3382 | - $labeltoshow .= ' (' . $objp->custref . ')'; |
|
| 3382 | + $labeltoshow .= ' ('.$objp->custref.')'; |
|
| 3383 | 3383 | } |
| 3384 | 3384 | if ($outbarcode) { |
| 3385 | - $labeltoshow .= ' (' . $outbarcode . ')'; |
|
| 3385 | + $labeltoshow .= ' ('.$outbarcode.')'; |
|
| 3386 | 3386 | } |
| 3387 | - $labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3387 | + $labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3388 | 3388 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3389 | - $labeltoshow .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3389 | + $labeltoshow .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3390 | 3390 | } |
| 3391 | 3391 | |
| 3392 | 3392 | // Set $labltoshowhtml |
| 3393 | 3393 | $labeltoshowhtml = ''; |
| 3394 | 3394 | $labeltoshowhtml .= $objp->ref; |
| 3395 | 3395 | if (!empty($objp->custref)) { |
| 3396 | - $labeltoshowhtml .= ' (' . $objp->custref . ')'; |
|
| 3396 | + $labeltoshowhtml .= ' ('.$objp->custref.')'; |
|
| 3397 | 3397 | } |
| 3398 | 3398 | if (!empty($filterkey) && $filterkey != '') { |
| 3399 | - $labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3399 | + $labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3400 | 3400 | } |
| 3401 | 3401 | if ($outbarcode) { |
| 3402 | - $labeltoshowhtml .= ' (' . $outbarcode . ')'; |
|
| 3402 | + $labeltoshowhtml .= ' ('.$outbarcode.')'; |
|
| 3403 | 3403 | } |
| 3404 | - $labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3404 | + $labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3405 | 3405 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3406 | - $labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3406 | + $labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3407 | 3407 | } |
| 3408 | 3408 | |
| 3409 | 3409 | // Stock |
@@ -3411,14 +3411,14 @@ discard block |
||
| 3411 | 3411 | $labeltoshowhtmlstock = ''; |
| 3412 | 3412 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3413 | 3413 | if ($user->hasRight('stock', 'lire')) { |
| 3414 | - $labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3414 | + $labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3415 | 3415 | |
| 3416 | 3416 | if ($objp->stock > 0) { |
| 3417 | 3417 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">'; |
| 3418 | 3418 | } elseif ($objp->stock <= 0) { |
| 3419 | 3419 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">'; |
| 3420 | 3420 | } |
| 3421 | - $labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3421 | + $labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3422 | 3422 | $labeltoshowhtmlstock .= '</span>'; |
| 3423 | 3423 | |
| 3424 | 3424 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
@@ -3429,9 +3429,9 @@ discard block |
||
| 3429 | 3429 | $tmpproduct->load_virtual_stock(); |
| 3430 | 3430 | $virtualstock = $tmpproduct->stock_theorique; |
| 3431 | 3431 | |
| 3432 | - $labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3432 | + $labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3433 | 3433 | |
| 3434 | - $labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3434 | + $labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3435 | 3435 | if ($virtualstock > 0) { |
| 3436 | 3436 | $labeltoshowhtmlstock .= '<span class="product_line_stock_ok">'; |
| 3437 | 3437 | } elseif ($virtualstock <= 0) { |
@@ -3452,35 +3452,35 @@ discard block |
||
| 3452 | 3452 | // If we need a particular price level (from 1 to n) |
| 3453 | 3453 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) { |
| 3454 | 3454 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3455 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3456 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3457 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3458 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3455 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3456 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3457 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3458 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3459 | 3459 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3460 | 3460 | $sql .= " LIMIT 1"; |
| 3461 | 3461 | |
| 3462 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3462 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3463 | 3463 | $result2 = $this->db->query($sql); |
| 3464 | 3464 | if ($result2) { |
| 3465 | 3465 | $objp2 = $this->db->fetch_object($result2); |
| 3466 | 3466 | if ($objp2) { |
| 3467 | 3467 | $found = 1; |
| 3468 | 3468 | if ($objp2->price_base_type == 'HT') { |
| 3469 | - $labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3470 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3469 | + $labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3470 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3471 | 3471 | } else { |
| 3472 | - $labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3473 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3472 | + $labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3473 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3474 | 3474 | } |
| 3475 | 3475 | $outprice_ht = price($objp2->price); |
| 3476 | 3476 | $outprice_ttc = price($objp2->price_ttc); |
| 3477 | 3477 | $outpricebasetype = $objp2->price_base_type; |
| 3478 | 3478 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
| 3479 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3480 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3479 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3480 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3481 | 3481 | } else { |
| 3482 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3483 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3482 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3483 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3484 | 3484 | } |
| 3485 | 3485 | } |
| 3486 | 3486 | } else { |
@@ -3494,13 +3494,13 @@ discard block |
||
| 3494 | 3494 | $outqty = $objp->quantity; |
| 3495 | 3495 | $outdiscount = $objp->remise_percent; |
| 3496 | 3496 | if ($objp->quantity == 1) { |
| 3497 | - $labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3498 | - $labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3497 | + $labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3498 | + $labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3499 | 3499 | $labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3500 | 3500 | $labeltoshowhtmlprice .= $langs->transnoentities("Unit"); |
| 3501 | 3501 | } else { |
| 3502 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3503 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3502 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3503 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3504 | 3504 | $labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3505 | 3505 | $labeltoshowhtmlprice .= $langs->transnoentities("Units"); |
| 3506 | 3506 | } |
@@ -3508,16 +3508,16 @@ discard block |
||
| 3508 | 3508 | $outprice_ht = price($objp->unitprice); |
| 3509 | 3509 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3510 | 3510 | $outpricebasetype = $objp->price_base_type; |
| 3511 | - $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 |
|
| 3512 | - $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 |
|
| 3511 | + $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 |
|
| 3512 | + $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 |
|
| 3513 | 3513 | } |
| 3514 | 3514 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3515 | - $labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3516 | - $labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3515 | + $labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3516 | + $labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3517 | 3517 | } |
| 3518 | 3518 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3519 | - $labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3520 | - $labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3519 | + $labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3520 | + $labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3521 | 3521 | } |
| 3522 | 3522 | |
| 3523 | 3523 | // Price by customer |
@@ -3526,11 +3526,11 @@ discard block |
||
| 3526 | 3526 | $found = 1; |
| 3527 | 3527 | |
| 3528 | 3528 | if ($objp->custprice_base_type == 'HT') { |
| 3529 | - $labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3530 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3529 | + $labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3530 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3531 | 3531 | } else { |
| 3532 | - $labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3533 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3532 | + $labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3533 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3534 | 3534 | } |
| 3535 | 3535 | |
| 3536 | 3536 | $outprice_ht = price($objp->custprice); |
@@ -3544,11 +3544,11 @@ discard block |
||
| 3544 | 3544 | // If level no defined or multiprice not found, we used the default price |
| 3545 | 3545 | if (empty($hidepriceinlabel) && !$found) { |
| 3546 | 3546 | if ($objp->price_base_type == 'HT') { |
| 3547 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3548 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3547 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3548 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3549 | 3549 | } else { |
| 3550 | - $labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3551 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3550 | + $labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3551 | + $labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3552 | 3552 | } |
| 3553 | 3553 | $outprice_ht = price($objp->price); |
| 3554 | 3554 | $outprice_ttc = price($objp->price_ttc); |
@@ -3558,14 +3558,14 @@ discard block |
||
| 3558 | 3558 | } |
| 3559 | 3559 | |
| 3560 | 3560 | // Build options |
| 3561 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3561 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3562 | 3562 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3563 | 3563 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3564 | - $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 . '"'; |
|
| 3564 | + $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.'"'; |
|
| 3565 | 3565 | } |
| 3566 | 3566 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 3567 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3568 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3567 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3568 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3569 | 3569 | } |
| 3570 | 3570 | |
| 3571 | 3571 | if ($stocktag == 1) { |
@@ -3660,7 +3660,7 @@ discard block |
||
| 3660 | 3660 | $selected_input_value = ''; |
| 3661 | 3661 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
| 3662 | 3662 | if ($selected > 0) { |
| 3663 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3663 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3664 | 3664 | $producttmpselect = new Product($this->db); |
| 3665 | 3665 | $producttmpselect->fetch($selected); |
| 3666 | 3666 | $selected_input_value = $producttmpselect->ref; |
@@ -3668,10 +3668,10 @@ discard block |
||
| 3668 | 3668 | } |
| 3669 | 3669 | |
| 3670 | 3670 | // mode=2 means suppliers products |
| 3671 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3672 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3671 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3672 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3673 | 3673 | |
| 3674 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3674 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3675 | 3675 | } else { |
| 3676 | 3676 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3677 | 3677 | } |
@@ -3729,25 +3729,25 @@ discard block |
||
| 3729 | 3729 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3730 | 3730 | $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; |
| 3731 | 3731 | } |
| 3732 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3733 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3732 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3733 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3734 | 3734 | if ($socid > 0) { |
| 3735 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3735 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3736 | 3736 | } |
| 3737 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3737 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3738 | 3738 | // Units |
| 3739 | 3739 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3740 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3740 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3741 | 3741 | } |
| 3742 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3742 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3743 | 3743 | if ($statut != -1) { |
| 3744 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3744 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3745 | 3745 | } |
| 3746 | 3746 | if (strval($filtertype) != '') { |
| 3747 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3747 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3748 | 3748 | } |
| 3749 | 3749 | if (!empty($filtre)) { |
| 3750 | - $sql .= " " . $filtre; |
|
| 3750 | + $sql .= " ".$filtre; |
|
| 3751 | 3751 | } |
| 3752 | 3752 | // Add where from hooks |
| 3753 | 3753 | $parameters = array(); |
@@ -3767,9 +3767,9 @@ discard block |
||
| 3767 | 3767 | if ($i > 0) { |
| 3768 | 3768 | $sql .= " AND "; |
| 3769 | 3769 | } |
| 3770 | - $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) . "%'"; |
|
| 3770 | + $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)."%'"; |
|
| 3771 | 3771 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
| 3772 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3772 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3773 | 3773 | } |
| 3774 | 3774 | $sql .= ")"; |
| 3775 | 3775 | $i++; |
@@ -3778,8 +3778,8 @@ discard block |
||
| 3778 | 3778 | $sql .= ")"; |
| 3779 | 3779 | } |
| 3780 | 3780 | if (isModEnabled('barcode')) { |
| 3781 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3782 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3781 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3782 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3783 | 3783 | } |
| 3784 | 3784 | $sql .= ')'; |
| 3785 | 3785 | } |
@@ -3788,20 +3788,20 @@ discard block |
||
| 3788 | 3788 | |
| 3789 | 3789 | // Build output string |
| 3790 | 3790 | |
| 3791 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3791 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3792 | 3792 | $result = $this->db->query($sql); |
| 3793 | 3793 | if ($result) { |
| 3794 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3795 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3794 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3795 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3796 | 3796 | |
| 3797 | 3797 | $num = $this->db->num_rows($result); |
| 3798 | 3798 | |
| 3799 | 3799 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3800 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3800 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3801 | 3801 | if (!$selected) { |
| 3802 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3802 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3803 | 3803 | } else { |
| 3804 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3804 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3805 | 3805 | } |
| 3806 | 3806 | |
| 3807 | 3807 | $i = 0; |
@@ -3816,7 +3816,7 @@ discard block |
||
| 3816 | 3816 | |
| 3817 | 3817 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3818 | 3818 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3819 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3819 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3820 | 3820 | } |
| 3821 | 3821 | |
| 3822 | 3822 | $outref = $objp->ref; |
@@ -3831,23 +3831,23 @@ discard block |
||
| 3831 | 3831 | $outvalUnits = ''; |
| 3832 | 3832 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3833 | 3833 | if (!empty($objp->unit_short)) { |
| 3834 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3834 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3835 | 3835 | } |
| 3836 | 3836 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3837 | 3837 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3838 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3838 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3839 | 3839 | } |
| 3840 | 3840 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3841 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3842 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3841 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3842 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3843 | 3843 | } |
| 3844 | 3844 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3845 | 3845 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3846 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3846 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3847 | 3847 | } |
| 3848 | 3848 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3849 | 3849 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3850 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3850 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3851 | 3851 | } |
| 3852 | 3852 | if ($outdurationvalue && $outdurationunit) { |
| 3853 | 3853 | $da = array( |
@@ -3858,22 +3858,22 @@ discard block |
||
| 3858 | 3858 | 'y' => $langs->trans('Year') |
| 3859 | 3859 | ); |
| 3860 | 3860 | if (isset($da[$outdurationunit])) { |
| 3861 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3861 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3862 | 3862 | } |
| 3863 | 3863 | } |
| 3864 | 3864 | } |
| 3865 | 3865 | |
| 3866 | 3866 | $objRef = $objp->ref; |
| 3867 | 3867 | if ($filterkey && $filterkey != '') { |
| 3868 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3868 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3869 | 3869 | } |
| 3870 | 3870 | $objRefFourn = $objp->ref_fourn; |
| 3871 | 3871 | if ($filterkey && $filterkey != '') { |
| 3872 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3872 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3873 | 3873 | } |
| 3874 | 3874 | $label = $objp->label; |
| 3875 | 3875 | if ($filterkey && $filterkey != '') { |
| 3876 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3876 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3877 | 3877 | } |
| 3878 | 3878 | |
| 3879 | 3879 | switch ($objp->fk_product_type) { |
@@ -3896,21 +3896,21 @@ discard block |
||
| 3896 | 3896 | |
| 3897 | 3897 | $optlabel .= $objp->ref; |
| 3898 | 3898 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3899 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3899 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3900 | 3900 | } |
| 3901 | 3901 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3902 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3902 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3903 | 3903 | } |
| 3904 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3904 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3905 | 3905 | |
| 3906 | 3906 | $outvallabel = $objRef; |
| 3907 | 3907 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3908 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3908 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3909 | 3909 | } |
| 3910 | 3910 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3911 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3911 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3912 | 3912 | } |
| 3913 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3913 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3914 | 3914 | |
| 3915 | 3915 | // Units |
| 3916 | 3916 | $optlabel .= $outvalUnits; |
@@ -3927,7 +3927,7 @@ discard block |
||
| 3927 | 3927 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3928 | 3928 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3929 | 3929 | |
| 3930 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3930 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3931 | 3931 | $priceparser = new PriceParser($this->db); |
| 3932 | 3932 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3933 | 3933 | if ($price_result >= 0) { |
@@ -3938,57 +3938,57 @@ discard block |
||
| 3938 | 3938 | } |
| 3939 | 3939 | } |
| 3940 | 3940 | if ($objp->quantity == 1) { |
| 3941 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3942 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3941 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3942 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3943 | 3943 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3944 | 3944 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3945 | 3945 | } else { |
| 3946 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3947 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3948 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3949 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3946 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3947 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3948 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3949 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3950 | 3950 | } |
| 3951 | 3951 | |
| 3952 | 3952 | if ($objp->quantity > 1) { |
| 3953 | - $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 |
|
| 3954 | - $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 |
|
| 3953 | + $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 |
|
| 3954 | + $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 |
|
| 3955 | 3955 | } |
| 3956 | 3956 | if ($objp->remise_percent >= 1) { |
| 3957 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3958 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3957 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3958 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3959 | 3959 | } |
| 3960 | 3960 | if ($objp->duration) { |
| 3961 | - $optlabel .= " - " . $objp->duration; |
|
| 3962 | - $outvallabel .= " - " . $objp->duration; |
|
| 3961 | + $optlabel .= " - ".$objp->duration; |
|
| 3962 | + $outvallabel .= " - ".$objp->duration; |
|
| 3963 | 3963 | } |
| 3964 | 3964 | if (!$socid) { |
| 3965 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3966 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3965 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3966 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3967 | 3967 | } |
| 3968 | 3968 | if ($objp->supplier_reputation) { |
| 3969 | 3969 | //TODO dictionary |
| 3970 | 3970 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 3971 | 3971 | |
| 3972 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3973 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3972 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3973 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3974 | 3974 | } |
| 3975 | 3975 | } else { |
| 3976 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3977 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3976 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3977 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3978 | 3978 | } |
| 3979 | 3979 | |
| 3980 | 3980 | if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3981 | 3981 | $novirtualstock = ($showstockinlist == 2); |
| 3982 | 3982 | |
| 3983 | 3983 | if ($user->hasRight('stock', 'lire')) { |
| 3984 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3984 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3985 | 3985 | |
| 3986 | 3986 | if ($objp->stock > 0) { |
| 3987 | 3987 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 3988 | 3988 | } elseif ($objp->stock <= 0) { |
| 3989 | 3989 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 3990 | 3990 | } |
| 3991 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 3991 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 3992 | 3992 | $optlabel .= '</span>'; |
| 3993 | 3993 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3994 | 3994 | $langs->load("stocks"); |
@@ -3998,9 +3998,9 @@ discard block |
||
| 3998 | 3998 | $tmpproduct->load_virtual_stock(); |
| 3999 | 3999 | $virtualstock = $tmpproduct->stock_theorique; |
| 4000 | 4000 | |
| 4001 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 4001 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 4002 | 4002 | |
| 4003 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 4003 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 4004 | 4004 | if ($virtualstock > 0) { |
| 4005 | 4005 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 4006 | 4006 | } elseif ($virtualstock <= 0) { |
@@ -4014,7 +4014,7 @@ discard block |
||
| 4014 | 4014 | } |
| 4015 | 4015 | } |
| 4016 | 4016 | |
| 4017 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 4017 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 4018 | 4018 | if ($selected && $selected == $objp->idprodfournprice) { |
| 4019 | 4019 | $optstart .= ' selected'; |
| 4020 | 4020 | } |
@@ -4023,31 +4023,31 @@ discard block |
||
| 4023 | 4023 | } |
| 4024 | 4024 | |
| 4025 | 4025 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 4026 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 4027 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 4028 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 4029 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 4030 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 4031 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 4032 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 4033 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 4034 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 4035 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 4026 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 4027 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 4028 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 4029 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 4030 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 4031 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 4032 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 4033 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 4034 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 4035 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 4036 | 4036 | if (isModEnabled('multicurrency')) { |
| 4037 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
| 4038 | - $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
| 4037 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
| 4038 | + $optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
| 4039 | 4039 | } |
| 4040 | 4040 | } |
| 4041 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 4041 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 4042 | 4042 | |
| 4043 | 4043 | $outarrayentry = array( |
| 4044 | 4044 | 'key' => $outkey, |
| 4045 | 4045 | 'value' => $outref, |
| 4046 | 4046 | 'label' => $outvallabel, |
| 4047 | 4047 | 'qty' => $outqty, |
| 4048 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4049 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4050 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4048 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4049 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4050 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4051 | 4051 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 4052 | 4052 | 'tva_tx' => price2num($objp->tva_tx), |
| 4053 | 4053 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4078,17 +4078,17 @@ discard block |
||
| 4078 | 4078 | // Add new entry |
| 4079 | 4079 | // "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 |
| 4080 | 4080 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 4081 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 4081 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 4082 | 4082 | $outarraypush = array( |
| 4083 | 4083 | 'key' => $outkey, |
| 4084 | 4084 | 'value' => $outref, |
| 4085 | 4085 | 'label' => $outvallabel, |
| 4086 | 4086 | 'qty' => $outqty, |
| 4087 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4087 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4088 | 4088 | 'price_qty_ht_locale' => price($objp->fprice), |
| 4089 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4089 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4090 | 4090 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 4091 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4091 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4092 | 4092 | 'tva_tx_formated' => price($objp->tva_tx), |
| 4093 | 4093 | 'tva_tx' => price2num($objp->tva_tx), |
| 4094 | 4094 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4121,7 +4121,7 @@ discard block |
||
| 4121 | 4121 | |
| 4122 | 4122 | $this->db->free($result); |
| 4123 | 4123 | |
| 4124 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 4124 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 4125 | 4125 | $out .= ajax_combobox($htmlname); |
| 4126 | 4126 | } else { |
| 4127 | 4127 | dol_print_error($this->db); |
@@ -4153,43 +4153,43 @@ discard block |
||
| 4153 | 4153 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 4154 | 4154 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 4155 | 4155 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 4156 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 4157 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4158 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4159 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 4156 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 4157 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4158 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4159 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 4160 | 4160 | $sql .= " AND p.tobuy = 1"; |
| 4161 | 4161 | $sql .= " AND s.fournisseur = 1"; |
| 4162 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 4162 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 4163 | 4163 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
| 4164 | 4164 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 4165 | 4165 | } else { |
| 4166 | 4166 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 4167 | 4167 | } |
| 4168 | 4168 | |
| 4169 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 4169 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 4170 | 4170 | $result = $this->db->query($sql); |
| 4171 | 4171 | |
| 4172 | 4172 | if ($result) { |
| 4173 | 4173 | $num = $this->db->num_rows($result); |
| 4174 | 4174 | |
| 4175 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4175 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4176 | 4176 | |
| 4177 | 4177 | if (!$num) { |
| 4178 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 4178 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 4179 | 4179 | } else { |
| 4180 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4180 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4181 | 4181 | $form .= '<option value="0"> </option>'; |
| 4182 | 4182 | |
| 4183 | 4183 | $i = 0; |
| 4184 | 4184 | while ($i < $num) { |
| 4185 | 4185 | $objp = $this->db->fetch_object($result); |
| 4186 | 4186 | |
| 4187 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 4187 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 4188 | 4188 | //if there is only one supplier, preselect it |
| 4189 | 4189 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
| 4190 | 4190 | $opt .= ' selected'; |
| 4191 | 4191 | } |
| 4192 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 4192 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 4193 | 4193 | |
| 4194 | 4194 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 4195 | 4195 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -4199,7 +4199,7 @@ discard block |
||
| 4199 | 4199 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 4200 | 4200 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 4201 | 4201 | |
| 4202 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4202 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4203 | 4203 | $priceparser = new PriceParser($this->db); |
| 4204 | 4204 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 4205 | 4205 | if ($price_result >= 0) { |
@@ -4210,10 +4210,10 @@ discard block |
||
| 4210 | 4210 | } |
| 4211 | 4211 | } |
| 4212 | 4212 | if ($objp->quantity == 1) { |
| 4213 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 4213 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 4214 | 4214 | } |
| 4215 | 4215 | |
| 4216 | - $opt .= $objp->quantity . ' '; |
|
| 4216 | + $opt .= $objp->quantity.' '; |
|
| 4217 | 4217 | |
| 4218 | 4218 | if ($objp->quantity == 1) { |
| 4219 | 4219 | $opt .= $langs->trans("Unit"); |
@@ -4222,10 +4222,10 @@ discard block |
||
| 4222 | 4222 | } |
| 4223 | 4223 | if ($objp->quantity > 1) { |
| 4224 | 4224 | $opt .= " - "; |
| 4225 | - $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"); |
|
| 4225 | + $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"); |
|
| 4226 | 4226 | } |
| 4227 | 4227 | if ($objp->duration) { |
| 4228 | - $opt .= " - " . $objp->duration; |
|
| 4228 | + $opt .= " - ".$objp->duration; |
|
| 4229 | 4229 | } |
| 4230 | 4230 | $opt .= "</option>\n"; |
| 4231 | 4231 | |
@@ -4263,8 +4263,8 @@ discard block |
||
| 4263 | 4263 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4264 | 4264 | |
| 4265 | 4265 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4266 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4267 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4266 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4267 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4268 | 4268 | $sql .= " AND active > 0"; |
| 4269 | 4269 | $sql .= " ORDER BY sortorder"; |
| 4270 | 4270 | |
@@ -4276,7 +4276,7 @@ discard block |
||
| 4276 | 4276 | $obj = $this->db->fetch_object($resql); |
| 4277 | 4277 | |
| 4278 | 4278 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4279 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4279 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4280 | 4280 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4281 | 4281 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4282 | 4282 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4304,7 +4304,7 @@ discard block |
||
| 4304 | 4304 | // phpcs:enable |
| 4305 | 4305 | global $langs; |
| 4306 | 4306 | |
| 4307 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4307 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4308 | 4308 | if ($num > 0) { |
| 4309 | 4309 | return 0; // Cache already loaded |
| 4310 | 4310 | } |
@@ -4314,7 +4314,7 @@ discard block |
||
| 4314 | 4314 | $langs->load('propal'); |
| 4315 | 4315 | |
| 4316 | 4316 | $sql = "SELECT rowid, code, label, position"; |
| 4317 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4317 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4318 | 4318 | $sql .= " WHERE active > 0"; |
| 4319 | 4319 | |
| 4320 | 4320 | $resql = $this->db->query($sql); |
@@ -4325,7 +4325,7 @@ discard block |
||
| 4325 | 4325 | $obj = $this->db->fetch_object($resql); |
| 4326 | 4326 | |
| 4327 | 4327 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4328 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4328 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4329 | 4329 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4330 | 4330 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4331 | 4331 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4357,17 +4357,17 @@ discard block |
||
| 4357 | 4357 | |
| 4358 | 4358 | $this->load_cache_availability(); |
| 4359 | 4359 | |
| 4360 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4360 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4361 | 4361 | |
| 4362 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4362 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4363 | 4363 | if ($addempty) { |
| 4364 | 4364 | print '<option value="0"> </option>'; |
| 4365 | 4365 | } |
| 4366 | 4366 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4367 | 4367 | if ($selected == $id) { |
| 4368 | - print '<option value="' . $id . '" selected>'; |
|
| 4368 | + print '<option value="'.$id.'" selected>'; |
|
| 4369 | 4369 | } else { |
| 4370 | - print '<option value="' . $id . '">'; |
|
| 4370 | + print '<option value="'.$id.'">'; |
|
| 4371 | 4371 | } |
| 4372 | 4372 | print dol_escape_htmltag($arrayavailability['label']); |
| 4373 | 4373 | print '</option>'; |
@@ -4388,13 +4388,13 @@ discard block |
||
| 4388 | 4388 | { |
| 4389 | 4389 | global $langs; |
| 4390 | 4390 | |
| 4391 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4391 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4392 | 4392 | if ($num > 0) { |
| 4393 | 4393 | return 0; // Cache already loaded |
| 4394 | 4394 | } |
| 4395 | 4395 | |
| 4396 | 4396 | $sql = "SELECT rowid, code, label"; |
| 4397 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4397 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4398 | 4398 | $sql .= " WHERE active > 0"; |
| 4399 | 4399 | |
| 4400 | 4400 | $resql = $this->db->query($sql); |
@@ -4407,8 +4407,8 @@ discard block |
||
| 4407 | 4407 | |
| 4408 | 4408 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4409 | 4409 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4410 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
| 4411 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4410 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
| 4411 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4412 | 4412 | } |
| 4413 | 4413 | if ($langs->trans($obj->code) != $obj->code) { |
| 4414 | 4414 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4448,9 +4448,9 @@ discard block |
||
| 4448 | 4448 | |
| 4449 | 4449 | $this->loadCacheInputReason(); |
| 4450 | 4450 | |
| 4451 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4451 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4452 | 4452 | if ($addempty) { |
| 4453 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4453 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4454 | 4454 | } |
| 4455 | 4455 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4456 | 4456 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4458,9 +4458,9 @@ discard block |
||
| 4458 | 4458 | } |
| 4459 | 4459 | |
| 4460 | 4460 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4461 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4461 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4462 | 4462 | } else { |
| 4463 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4463 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4464 | 4464 | } |
| 4465 | 4465 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4466 | 4466 | print $langs->trans($label); |
@@ -4470,7 +4470,7 @@ discard block |
||
| 4470 | 4470 | if ($user->admin && empty($notooltip)) { |
| 4471 | 4471 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4472 | 4472 | } |
| 4473 | - print ajax_combobox('select_' . $htmlname); |
|
| 4473 | + print ajax_combobox('select_'.$htmlname); |
|
| 4474 | 4474 | } |
| 4475 | 4475 | |
| 4476 | 4476 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4485,7 +4485,7 @@ discard block |
||
| 4485 | 4485 | // phpcs:enable |
| 4486 | 4486 | global $langs; |
| 4487 | 4487 | |
| 4488 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4488 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4489 | 4489 | if ($num > 0) { |
| 4490 | 4490 | return $num; // Cache already loaded |
| 4491 | 4491 | } |
@@ -4495,8 +4495,8 @@ discard block |
||
| 4495 | 4495 | $this->cache_types_paiements = array(); |
| 4496 | 4496 | |
| 4497 | 4497 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4498 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4499 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4498 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4499 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4500 | 4500 | |
| 4501 | 4501 | $resql = $this->db->query($sql); |
| 4502 | 4502 | if ($resql) { |
@@ -4506,7 +4506,7 @@ discard block |
||
| 4506 | 4506 | $obj = $this->db->fetch_object($resql); |
| 4507 | 4507 | |
| 4508 | 4508 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4509 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4509 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4510 | 4510 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4511 | 4511 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4512 | 4512 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4578,17 +4578,17 @@ discard block |
||
| 4578 | 4578 | global $langs, $user, $conf; |
| 4579 | 4579 | |
| 4580 | 4580 | $out = ''; |
| 4581 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4581 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4582 | 4582 | |
| 4583 | 4583 | $this->load_cache_conditions_paiements(); |
| 4584 | 4584 | |
| 4585 | 4585 | // Set default value if not already set by caller |
| 4586 | 4586 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
| 4587 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4587 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4588 | 4588 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 4589 | 4589 | } |
| 4590 | 4590 | |
| 4591 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4591 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4592 | 4592 | if ($addempty) { |
| 4593 | 4593 | $out .= '<option value="0"> </option>'; |
| 4594 | 4594 | } |
@@ -4602,9 +4602,9 @@ discard block |
||
| 4602 | 4602 | |
| 4603 | 4603 | if ($selected == $id) { |
| 4604 | 4604 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4605 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4605 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4606 | 4606 | } else { |
| 4607 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4607 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4608 | 4608 | } |
| 4609 | 4609 | $label = $arrayconditions['label']; |
| 4610 | 4610 | |
@@ -4622,21 +4622,21 @@ discard block |
||
| 4622 | 4622 | $out .= ajax_combobox($htmlname); |
| 4623 | 4623 | |
| 4624 | 4624 | if ($deposit_percent >= 0) { |
| 4625 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4626 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4627 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4625 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4626 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4627 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4628 | 4628 | $out .= '</span>'; |
| 4629 | 4629 | $out .= ' |
| 4630 | - <script nonce="' . getNonce() . '"> |
|
| 4630 | + <script nonce="' . getNonce().'"> |
|
| 4631 | 4631 | $(document).ready(function () { |
| 4632 | - $("#' . $htmlname . '").change(function () { |
|
| 4632 | + $("#' . $htmlname.'").change(function () { |
|
| 4633 | 4633 | let $selected = $(this).find("option:selected"); |
| 4634 | 4634 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4635 | 4635 | |
| 4636 | 4636 | if (depositPercent.length > 0) { |
| 4637 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4637 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4638 | 4638 | } else { |
| 4639 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4639 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4640 | 4640 | } |
| 4641 | 4641 | |
| 4642 | 4642 | return true; |
@@ -4674,7 +4674,7 @@ discard block |
||
| 4674 | 4674 | |
| 4675 | 4675 | $out = ''; |
| 4676 | 4676 | |
| 4677 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4677 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4678 | 4678 | |
| 4679 | 4679 | $filterarray = array(); |
| 4680 | 4680 | if ($filtertype == 'CRDT') { |
@@ -4689,11 +4689,11 @@ discard block |
||
| 4689 | 4689 | |
| 4690 | 4690 | // Set default value if not already set by caller |
| 4691 | 4691 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
| 4692 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4692 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4693 | 4693 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 4694 | 4694 | } |
| 4695 | 4695 | |
| 4696 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4696 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4697 | 4697 | if ($empty) { |
| 4698 | 4698 | $out .= '<option value=""> </option>'; |
| 4699 | 4699 | } |
@@ -4714,13 +4714,13 @@ discard block |
||
| 4714 | 4714 | } |
| 4715 | 4715 | |
| 4716 | 4716 | if ($format == 0) { |
| 4717 | - $out .= '<option value="' . $id . '"'; |
|
| 4717 | + $out .= '<option value="'.$id.'"'; |
|
| 4718 | 4718 | } elseif ($format == 1) { |
| 4719 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4719 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4720 | 4720 | } elseif ($format == 2) { |
| 4721 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4721 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4722 | 4722 | } elseif ($format == 3) { |
| 4723 | - $out .= '<option value="' . $id . '"'; |
|
| 4723 | + $out .= '<option value="'.$id.'"'; |
|
| 4724 | 4724 | } |
| 4725 | 4725 | // Print attribute selected or not |
| 4726 | 4726 | if ($format == 1 || $format == 2) { |
@@ -4750,7 +4750,7 @@ discard block |
||
| 4750 | 4750 | if ($user->admin && !$noadmininfo) { |
| 4751 | 4751 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4752 | 4752 | } |
| 4753 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4753 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4754 | 4754 | |
| 4755 | 4755 | if (empty($nooutput)) { |
| 4756 | 4756 | print $out; |
@@ -4772,22 +4772,22 @@ discard block |
||
| 4772 | 4772 | { |
| 4773 | 4773 | global $langs; |
| 4774 | 4774 | |
| 4775 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4775 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4776 | 4776 | $options = array( |
| 4777 | 4777 | 'HT' => $langs->trans("HT"), |
| 4778 | 4778 | 'TTC' => $langs->trans("TTC") |
| 4779 | 4779 | ); |
| 4780 | 4780 | foreach ($options as $id => $value) { |
| 4781 | 4781 | if ($selected == $id) { |
| 4782 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4782 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4783 | 4783 | } else { |
| 4784 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4784 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4785 | 4785 | } |
| 4786 | 4786 | $return .= '</option>'; |
| 4787 | 4787 | } |
| 4788 | 4788 | $return .= '</select>'; |
| 4789 | 4789 | if ($addjscombo) { |
| 4790 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4790 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4791 | 4791 | } |
| 4792 | 4792 | |
| 4793 | 4793 | return $return; |
@@ -4805,7 +4805,7 @@ discard block |
||
| 4805 | 4805 | // phpcs:enable |
| 4806 | 4806 | global $langs; |
| 4807 | 4807 | |
| 4808 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4808 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4809 | 4809 | if ($num > 0) { |
| 4810 | 4810 | return $num; // Cache already loaded |
| 4811 | 4811 | } |
@@ -4815,8 +4815,8 @@ discard block |
||
| 4815 | 4815 | $this->cache_transport_mode = array(); |
| 4816 | 4816 | |
| 4817 | 4817 | $sql = "SELECT rowid, code, label, active"; |
| 4818 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4819 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4818 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4819 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4820 | 4820 | |
| 4821 | 4821 | $resql = $this->db->query($sql); |
| 4822 | 4822 | if ($resql) { |
@@ -4826,7 +4826,7 @@ discard block |
||
| 4826 | 4826 | $obj = $this->db->fetch_object($resql); |
| 4827 | 4827 | |
| 4828 | 4828 | // If traduction exist, we use it else we take the default label |
| 4829 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4829 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4830 | 4830 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4831 | 4831 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4832 | 4832 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4860,11 +4860,11 @@ discard block |
||
| 4860 | 4860 | { |
| 4861 | 4861 | global $langs, $user; |
| 4862 | 4862 | |
| 4863 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4863 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4864 | 4864 | |
| 4865 | 4865 | $this->load_cache_transport_mode(); |
| 4866 | 4866 | |
| 4867 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4867 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4868 | 4868 | if ($empty) { |
| 4869 | 4869 | print '<option value=""> </option>'; |
| 4870 | 4870 | } |
@@ -4880,13 +4880,13 @@ discard block |
||
| 4880 | 4880 | } |
| 4881 | 4881 | |
| 4882 | 4882 | if ($format == 0) { |
| 4883 | - print '<option value="' . $id . '"'; |
|
| 4883 | + print '<option value="'.$id.'"'; |
|
| 4884 | 4884 | } elseif ($format == 1) { |
| 4885 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4885 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4886 | 4886 | } elseif ($format == 2) { |
| 4887 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4887 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4888 | 4888 | } elseif ($format == 3) { |
| 4889 | - print '<option value="' . $id . '"'; |
|
| 4889 | + print '<option value="'.$id.'"'; |
|
| 4890 | 4890 | } |
| 4891 | 4891 | // If text is selected, we compare with code, else with id |
| 4892 | 4892 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4934,31 +4934,31 @@ discard block |
||
| 4934 | 4934 | $langs->load("deliveries"); |
| 4935 | 4935 | |
| 4936 | 4936 | $sql = "SELECT rowid, code, libelle as label"; |
| 4937 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4937 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4938 | 4938 | $sql .= " WHERE active > 0"; |
| 4939 | 4939 | if ($filtre) { |
| 4940 | - $sql .= " AND " . $filtre; |
|
| 4940 | + $sql .= " AND ".$filtre; |
|
| 4941 | 4941 | } |
| 4942 | 4942 | $sql .= " ORDER BY libelle ASC"; |
| 4943 | 4943 | |
| 4944 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4944 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4945 | 4945 | $result = $this->db->query($sql); |
| 4946 | 4946 | if ($result) { |
| 4947 | 4947 | $num = $this->db->num_rows($result); |
| 4948 | 4948 | $i = 0; |
| 4949 | 4949 | if ($num) { |
| 4950 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4950 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4951 | 4951 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4952 | 4952 | print '<option value="-1"> </option>'; |
| 4953 | 4953 | } |
| 4954 | 4954 | while ($i < $num) { |
| 4955 | 4955 | $obj = $this->db->fetch_object($result); |
| 4956 | 4956 | if ($selected == $obj->rowid) { |
| 4957 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4957 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4958 | 4958 | } else { |
| 4959 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4959 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4960 | 4960 | } |
| 4961 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 4961 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 4962 | 4962 | print '</option>'; |
| 4963 | 4963 | $i++; |
| 4964 | 4964 | } |
@@ -4967,7 +4967,7 @@ discard block |
||
| 4967 | 4967 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4968 | 4968 | } |
| 4969 | 4969 | |
| 4970 | - print ajax_combobox('select' . $htmlname); |
|
| 4970 | + print ajax_combobox('select'.$htmlname); |
|
| 4971 | 4971 | } else { |
| 4972 | 4972 | print $langs->trans("NoShippingMethodDefined"); |
| 4973 | 4973 | } |
@@ -4992,16 +4992,16 @@ discard block |
||
| 4992 | 4992 | $langs->load("deliveries"); |
| 4993 | 4993 | |
| 4994 | 4994 | if ($htmlname != "none") { |
| 4995 | - print '<form method="POST" action="' . $page . '">'; |
|
| 4995 | + print '<form method="POST" action="'.$page.'">'; |
|
| 4996 | 4996 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 4997 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 4997 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 4998 | 4998 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 4999 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 4999 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5000 | 5000 | print '</form>'; |
| 5001 | 5001 | } else { |
| 5002 | 5002 | if ($selected) { |
| 5003 | 5003 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 5004 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 5004 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 5005 | 5005 | } else { |
| 5006 | 5006 | print " "; |
| 5007 | 5007 | } |
@@ -5024,10 +5024,10 @@ discard block |
||
| 5024 | 5024 | |
| 5025 | 5025 | $opt = '<option value="" selected></option>'; |
| 5026 | 5026 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 5027 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 5028 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 5027 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 5028 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 5029 | 5029 | $sql .= ' AND situation_counter >= 1'; |
| 5030 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 5030 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 5031 | 5031 | $sql .= ' AND type <> 2'; |
| 5032 | 5032 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 5033 | 5033 | $resql = $this->db->query($sql); |
@@ -5045,19 +5045,19 @@ discard block |
||
| 5045 | 5045 | //Not prov? |
| 5046 | 5046 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 5047 | 5047 | if ($selected == $obj->rowid) { |
| 5048 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 5048 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 5049 | 5049 | } else { |
| 5050 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 5050 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 5051 | 5051 | } |
| 5052 | 5052 | } |
| 5053 | 5053 | } |
| 5054 | 5054 | } |
| 5055 | 5055 | } |
| 5056 | 5056 | } else { |
| 5057 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 5057 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 5058 | 5058 | } |
| 5059 | 5059 | if ($opt == '<option value ="" selected></option>') { |
| 5060 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 5060 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 5061 | 5061 | } |
| 5062 | 5062 | return $opt; |
| 5063 | 5063 | } |
@@ -5077,12 +5077,12 @@ discard block |
||
| 5077 | 5077 | |
| 5078 | 5078 | $langs->load('products'); |
| 5079 | 5079 | |
| 5080 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 5080 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 5081 | 5081 | |
| 5082 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 5082 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 5083 | 5083 | $sql .= ' WHERE active > 0'; |
| 5084 | 5084 | if (!empty($unit_type)) { |
| 5085 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 5085 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 5086 | 5086 | } |
| 5087 | 5087 | $sql .= " ORDER BY sortorder"; |
| 5088 | 5088 | |
@@ -5094,14 +5094,14 @@ discard block |
||
| 5094 | 5094 | |
| 5095 | 5095 | while ($res = $this->db->fetch_object($resql)) { |
| 5096 | 5096 | $unitLabel = $res->label; |
| 5097 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 5098 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 5097 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 5098 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 5099 | 5099 | } |
| 5100 | 5100 | |
| 5101 | 5101 | if ($selected == $res->rowid) { |
| 5102 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 5102 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 5103 | 5103 | } else { |
| 5104 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 5104 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 5105 | 5105 | } |
| 5106 | 5106 | } |
| 5107 | 5107 | $return .= '</select>'; |
@@ -5136,29 +5136,29 @@ discard block |
||
| 5136 | 5136 | $num = 0; |
| 5137 | 5137 | |
| 5138 | 5138 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 5139 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 5140 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 5139 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 5140 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 5141 | 5141 | if ($status != 2) { |
| 5142 | - $sql .= " AND clos = " . (int) $status; |
|
| 5142 | + $sql .= " AND clos = ".(int) $status; |
|
| 5143 | 5143 | } |
| 5144 | 5144 | if ($filtre) { // TODO Support USF |
| 5145 | - $sql .= " AND " . $filtre; |
|
| 5145 | + $sql .= " AND ".$filtre; |
|
| 5146 | 5146 | } |
| 5147 | 5147 | $sql .= " ORDER BY label"; |
| 5148 | 5148 | |
| 5149 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 5149 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 5150 | 5150 | $result = $this->db->query($sql); |
| 5151 | 5151 | if ($result) { |
| 5152 | 5152 | $num = $this->db->num_rows($result); |
| 5153 | 5153 | $i = 0; |
| 5154 | 5154 | |
| 5155 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5155 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5156 | 5156 | |
| 5157 | 5157 | if ($num == 0) { |
| 5158 | 5158 | if ($status == 0) { |
| 5159 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 5159 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 5160 | 5160 | } else { |
| 5161 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
| 5161 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
| 5162 | 5162 | } |
| 5163 | 5163 | } else { |
| 5164 | 5164 | if (!empty($useempty) && !is_numeric($useempty)) { |
@@ -5171,22 +5171,22 @@ discard block |
||
| 5171 | 5171 | while ($i < $num) { |
| 5172 | 5172 | $obj = $this->db->fetch_object($result); |
| 5173 | 5173 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 5174 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
| 5174 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
| 5175 | 5175 | } else { |
| 5176 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
| 5176 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
| 5177 | 5177 | } |
| 5178 | 5178 | $out .= trim($obj->label); |
| 5179 | 5179 | if ($showcurrency) { |
| 5180 | - $out .= ' (' . $obj->currency_code . ')'; |
|
| 5180 | + $out .= ' ('.$obj->currency_code.')'; |
|
| 5181 | 5181 | } |
| 5182 | 5182 | if ($status == 2 && $obj->status == 1) { |
| 5183 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
| 5183 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
| 5184 | 5184 | } |
| 5185 | 5185 | $out .= '</option>'; |
| 5186 | 5186 | $i++; |
| 5187 | 5187 | } |
| 5188 | 5188 | $out .= "</select>"; |
| 5189 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 5189 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 5190 | 5190 | } else { |
| 5191 | 5191 | dol_print_error($this->db); |
| 5192 | 5192 | } |
@@ -5220,23 +5220,23 @@ discard block |
||
| 5220 | 5220 | $num = 0; |
| 5221 | 5221 | |
| 5222 | 5222 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 5223 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 5223 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 5224 | 5224 | $sql .= " WHERE 1=1"; |
| 5225 | 5225 | if ($status != 2) { |
| 5226 | - $sql .= " AND status = " . (int) $status; |
|
| 5226 | + $sql .= " AND status = ".(int) $status; |
|
| 5227 | 5227 | } |
| 5228 | 5228 | if ($filtre) { // TODO Support USF |
| 5229 | - $sql .= " AND " . $filtre; |
|
| 5229 | + $sql .= " AND ".$filtre; |
|
| 5230 | 5230 | } |
| 5231 | 5231 | $sql .= " ORDER BY name"; |
| 5232 | 5232 | |
| 5233 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 5233 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 5234 | 5234 | $result = $this->db->query($sql); |
| 5235 | 5235 | if ($result) { |
| 5236 | 5236 | $num = $this->db->num_rows($result); |
| 5237 | 5237 | $i = 0; |
| 5238 | 5238 | if ($num) { |
| 5239 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5239 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5240 | 5240 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5241 | 5241 | print '<option value="-1"> </option>'; |
| 5242 | 5242 | } |
@@ -5244,13 +5244,13 @@ discard block |
||
| 5244 | 5244 | while ($i < $num) { |
| 5245 | 5245 | $obj = $this->db->fetch_object($result); |
| 5246 | 5246 | if ($selected == $obj->rowid) { |
| 5247 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5247 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5248 | 5248 | } else { |
| 5249 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5249 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5250 | 5250 | } |
| 5251 | 5251 | print trim($obj->name); |
| 5252 | 5252 | if ($status == 2 && $obj->status == 1) { |
| 5253 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 5253 | + print ' ('.$langs->trans("Closed").')'; |
|
| 5254 | 5254 | } |
| 5255 | 5255 | print '</option>'; |
| 5256 | 5256 | $i++; |
@@ -5258,9 +5258,9 @@ discard block |
||
| 5258 | 5258 | print "</select>"; |
| 5259 | 5259 | } else { |
| 5260 | 5260 | if ($status == 0) { |
| 5261 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5261 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5262 | 5262 | } else { |
| 5263 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5263 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5264 | 5264 | } |
| 5265 | 5265 | } |
| 5266 | 5266 | |
@@ -5284,20 +5284,20 @@ discard block |
||
| 5284 | 5284 | { |
| 5285 | 5285 | global $langs; |
| 5286 | 5286 | if ($htmlname != "none") { |
| 5287 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5287 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5288 | 5288 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5289 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5289 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5290 | 5290 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5291 | 5291 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5292 | 5292 | if ($nbaccountfound > 0) { |
| 5293 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5293 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5294 | 5294 | } |
| 5295 | 5295 | print '</form>'; |
| 5296 | 5296 | } else { |
| 5297 | 5297 | $langs->load('banks'); |
| 5298 | 5298 | |
| 5299 | 5299 | if ($selected) { |
| 5300 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5300 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5301 | 5301 | $bankstatic = new Account($this->db); |
| 5302 | 5302 | $result = $bankstatic->fetch($selected); |
| 5303 | 5303 | if ($result) { |
@@ -5336,11 +5336,11 @@ discard block |
||
| 5336 | 5336 | global $conf, $langs; |
| 5337 | 5337 | $langs->load("categories"); |
| 5338 | 5338 | |
| 5339 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5339 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5340 | 5340 | |
| 5341 | 5341 | // For backward compatibility |
| 5342 | 5342 | if (is_numeric($type)) { |
| 5343 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5343 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5344 | 5344 | } |
| 5345 | 5345 | |
| 5346 | 5346 | if ($type === Categorie::TYPE_BANK_LINE) { |
@@ -5348,8 +5348,8 @@ discard block |
||
| 5348 | 5348 | $cat = new Categorie($this->db); |
| 5349 | 5349 | $cate_arbo = array(); |
| 5350 | 5350 | $sql = "SELECT c.label, c.rowid"; |
| 5351 | - $sql .= " FROM " . $this->db->prefix() . "categorie as c"; |
|
| 5352 | - $sql .= " WHERE entity = " . $conf->entity . " AND type = " . ((int) $cat->getMapId()[$type]); |
|
| 5351 | + $sql .= " FROM ".$this->db->prefix()."categorie as c"; |
|
| 5352 | + $sql .= " WHERE entity = ".$conf->entity." AND type = ".((int) $cat->getMapId()[$type]); |
|
| 5353 | 5353 | $sql .= " ORDER BY c.label"; |
| 5354 | 5354 | $result = $this->db->query($sql); |
| 5355 | 5355 | if ($result) { |
@@ -5375,12 +5375,12 @@ discard block |
||
| 5375 | 5375 | $outarrayrichhtml = array(); |
| 5376 | 5376 | |
| 5377 | 5377 | |
| 5378 | - $output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5378 | + $output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5379 | 5379 | if (is_array($cate_arbo)) { |
| 5380 | 5380 | $num = count($cate_arbo); |
| 5381 | 5381 | |
| 5382 | 5382 | if (!$num) { |
| 5383 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5383 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5384 | 5384 | } else { |
| 5385 | 5385 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5386 | 5386 | $output .= '<option value="-1"> </option>'; |
@@ -5392,15 +5392,15 @@ discard block |
||
| 5392 | 5392 | $add = ''; |
| 5393 | 5393 | } |
| 5394 | 5394 | |
| 5395 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5395 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5396 | 5396 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5397 | 5397 | |
| 5398 | 5398 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5399 | 5399 | |
| 5400 | 5400 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5401 | 5401 | |
| 5402 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5403 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5402 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5403 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5404 | 5404 | $output .= '>'; |
| 5405 | 5405 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5406 | 5406 | $output .= '</option>'; |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5447 | 5447 | { |
| 5448 | 5448 | // phpcs:enable |
| 5449 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5449 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5450 | 5450 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5451 | 5451 | } |
| 5452 | 5452 | |
@@ -5481,7 +5481,7 @@ discard block |
||
| 5481 | 5481 | { |
| 5482 | 5482 | global $langs, $conf; |
| 5483 | 5483 | |
| 5484 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5484 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5485 | 5485 | $formconfirm = ''; |
| 5486 | 5486 | $inputok = array(); |
| 5487 | 5487 | $inputko = array(); |
@@ -5505,27 +5505,27 @@ discard block |
||
| 5505 | 5505 | foreach ($formquestion as $key => $input) { |
| 5506 | 5506 | if (is_array($input) && !empty($input)) { |
| 5507 | 5507 | if ($input['type'] == 'hidden') { |
| 5508 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5509 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5508 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5509 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5510 | 5510 | |
| 5511 | - $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"; |
|
| 5511 | + $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"; |
|
| 5512 | 5512 | } |
| 5513 | 5513 | } |
| 5514 | 5514 | } |
| 5515 | 5515 | |
| 5516 | 5516 | // Now add questions |
| 5517 | 5517 | $moreonecolumn = ''; |
| 5518 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5518 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5519 | 5519 | foreach ($formquestion as $key => $input) { |
| 5520 | 5520 | if (is_array($input) && !empty($input)) { |
| 5521 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5522 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5523 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5521 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5522 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5523 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5524 | 5524 | |
| 5525 | 5525 | if ($input['type'] == 'text') { |
| 5526 | - $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"; |
|
| 5526 | + $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"; |
|
| 5527 | 5527 | } elseif ($input['type'] == 'password') { |
| 5528 | - $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"; |
|
| 5528 | + $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"; |
|
| 5529 | 5529 | } elseif ($input['type'] == 'textarea') { |
| 5530 | 5530 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5531 | 5531 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5533,8 +5533,8 @@ discard block |
||
| 5533 | 5533 | $more .= '</textarea>'; |
| 5534 | 5534 | $more .= '</div></div>'."\n";*/ |
| 5535 | 5535 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5536 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5537 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5536 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5537 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5538 | 5538 | $moreonecolumn .= $input['value']; |
| 5539 | 5539 | $moreonecolumn .= '</textarea>'; |
| 5540 | 5540 | $moreonecolumn .= '</div>'; |
@@ -5551,20 +5551,20 @@ discard block |
||
| 5551 | 5551 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5552 | 5552 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5553 | 5553 | |
| 5554 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5554 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5555 | 5555 | if (!empty($input['label'])) { |
| 5556 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5556 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5557 | 5557 | } |
| 5558 | 5558 | if ($input['type'] == 'select') { |
| 5559 | 5559 | $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); |
| 5560 | 5560 | } else { |
| 5561 | 5561 | $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); |
| 5562 | 5562 | } |
| 5563 | - $more .= '</div></div>' . "\n"; |
|
| 5563 | + $more .= '</div></div>'."\n"; |
|
| 5564 | 5564 | } elseif ($input['type'] == 'checkbox') { |
| 5565 | 5565 | $more .= '<div class="tagtr">'; |
| 5566 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5567 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5566 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5567 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5568 | 5568 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5569 | 5569 | $more .= ' checked'; |
| 5570 | 5570 | } |
@@ -5575,19 +5575,19 @@ discard block |
||
| 5575 | 5575 | $more .= ' disabled'; |
| 5576 | 5576 | } |
| 5577 | 5577 | $more .= ' /></div>'; |
| 5578 | - $more .= '</div>' . "\n"; |
|
| 5578 | + $more .= '</div>'."\n"; |
|
| 5579 | 5579 | } elseif ($input['type'] == 'radio') { |
| 5580 | 5580 | $i = 0; |
| 5581 | 5581 | foreach ($input['values'] as $selkey => $selval) { |
| 5582 | 5582 | $more .= '<div class="tagtr">'; |
| 5583 | 5583 | if (isset($input['label'])) { |
| 5584 | 5584 | if ($i == 0) { |
| 5585 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5585 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5586 | 5586 | } else { |
| 5587 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5587 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5588 | 5588 | } |
| 5589 | 5589 | } |
| 5590 | - $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; |
|
| 5590 | + $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; |
|
| 5591 | 5591 | if (!empty($input['disabled'])) { |
| 5592 | 5592 | $more .= ' disabled'; |
| 5593 | 5593 | } |
@@ -5595,12 +5595,12 @@ discard block |
||
| 5595 | 5595 | $more .= ' checked="checked"'; |
| 5596 | 5596 | } |
| 5597 | 5597 | $more .= ' /> '; |
| 5598 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5599 | - $more .= '</div></div>' . "\n"; |
|
| 5598 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5599 | + $more .= '</div></div>'."\n"; |
|
| 5600 | 5600 | $i++; |
| 5601 | 5601 | } |
| 5602 | 5602 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5603 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5603 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5604 | 5604 | $more .= '<div class="tagtd">'; |
| 5605 | 5605 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5606 | 5606 | $h = $m = 0; |
@@ -5618,24 +5618,24 @@ discard block |
||
| 5618 | 5618 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5619 | 5619 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5620 | 5620 | if (!empty($input['label'])) { |
| 5621 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5621 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5622 | 5622 | } |
| 5623 | 5623 | $more .= $input['value']; |
| 5624 | - $more .= '</div></div>' . "\n"; |
|
| 5624 | + $more .= '</div></div>'."\n"; |
|
| 5625 | 5625 | } elseif ($input['type'] == 'onecolumn') { |
| 5626 | 5626 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5627 | 5627 | $moreonecolumn .= $input['value']; |
| 5628 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5628 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5629 | 5629 | } elseif ($input['type'] == 'hidden') { |
| 5630 | 5630 | // Do nothing more, already added by a previous loop |
| 5631 | 5631 | } elseif ($input['type'] == 'separator') { |
| 5632 | 5632 | $more .= '<br>'; |
| 5633 | 5633 | } else { |
| 5634 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5634 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5635 | 5635 | } |
| 5636 | 5636 | } |
| 5637 | 5637 | } |
| 5638 | - $more .= '</div>' . "\n"; |
|
| 5638 | + $more .= '</div>'."\n"; |
|
| 5639 | 5639 | $more .= $moreonecolumn; |
| 5640 | 5640 | } |
| 5641 | 5641 | |
@@ -5657,10 +5657,10 @@ discard block |
||
| 5657 | 5657 | $button = $useajax; |
| 5658 | 5658 | $useajax = 1; |
| 5659 | 5659 | $autoOpen = false; |
| 5660 | - $dialogconfirm .= '-' . $button; |
|
| 5660 | + $dialogconfirm .= '-'.$button; |
|
| 5661 | 5661 | } |
| 5662 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5663 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5662 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5663 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5664 | 5664 | |
| 5665 | 5665 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5666 | 5666 | if (is_array($formquestion)) { |
@@ -5683,24 +5683,24 @@ discard block |
||
| 5683 | 5683 | } |
| 5684 | 5684 | |
| 5685 | 5685 | // Show JQuery confirm box. |
| 5686 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5686 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5687 | 5687 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 5688 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5688 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5689 | 5689 | } |
| 5690 | 5690 | if (!empty($more)) { |
| 5691 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5691 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5692 | 5692 | } |
| 5693 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : ''); |
|
| 5694 | - $formconfirm .= '</div>' . "\n"; |
|
| 5693 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : ''); |
|
| 5694 | + $formconfirm .= '</div>'."\n"; |
|
| 5695 | 5695 | |
| 5696 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5697 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5696 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5697 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5698 | 5698 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5699 | 5699 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5700 | 5700 | $(function() { |
| 5701 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5701 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5702 | 5702 | { |
| 5703 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5703 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5704 | 5704 | if ($newselectedchoice == 'no') { |
| 5705 | 5705 | $formconfirm .= ' |
| 5706 | 5706 | open: function() { |
@@ -5710,24 +5710,24 @@ discard block |
||
| 5710 | 5710 | |
| 5711 | 5711 | $jsforcursor = ''; |
| 5712 | 5712 | if ($useajax == 1) { |
| 5713 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5714 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5713 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5714 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5715 | 5715 | } |
| 5716 | 5716 | |
| 5717 | 5717 | $postconfirmas = 'GET'; |
| 5718 | 5718 | |
| 5719 | 5719 | $formconfirm .= ' |
| 5720 | 5720 | resizable: false, |
| 5721 | - height: "' . $height . '", |
|
| 5722 | - width: "' . $width . '", |
|
| 5721 | + height: "' . $height.'", |
|
| 5722 | + width: "' . $width.'", |
|
| 5723 | 5723 | modal: true, |
| 5724 | 5724 | closeOnEscape: false, |
| 5725 | 5725 | buttons: { |
| 5726 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5727 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5728 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5729 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5730 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5726 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5727 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5728 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5729 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5730 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5731 | 5731 | |
| 5732 | 5732 | if (inputok.length > 0) { |
| 5733 | 5733 | $.each(inputok, function(i, inputname) { |
@@ -5761,11 +5761,11 @@ discard block |
||
| 5761 | 5761 | } |
| 5762 | 5762 | $(this).dialog("close"); |
| 5763 | 5763 | }, |
| 5764 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5765 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5766 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5767 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5768 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5764 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5765 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5766 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5767 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5768 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5769 | 5769 | if (inputko.length > 0) { |
| 5770 | 5770 | $.each(inputko, function(i, inputname) { |
| 5771 | 5771 | var more = ""; |
@@ -5797,10 +5797,10 @@ discard block |
||
| 5797 | 5797 | } |
| 5798 | 5798 | ); |
| 5799 | 5799 | |
| 5800 | - var button = "' . $button . '"; |
|
| 5800 | + var button = "' . $button.'"; |
|
| 5801 | 5801 | if (button.length > 0) { |
| 5802 | 5802 | $( "#" + button ).click(function() { |
| 5803 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5803 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5804 | 5804 | }); |
| 5805 | 5805 | } |
| 5806 | 5806 | }); |
@@ -5808,44 +5808,44 @@ discard block |
||
| 5808 | 5808 | </script>'; |
| 5809 | 5809 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5810 | 5810 | } else { |
| 5811 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5811 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5812 | 5812 | |
| 5813 | 5813 | if (empty($disableformtag)) { |
| 5814 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n"; |
|
| 5814 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n"; |
|
| 5815 | 5815 | } |
| 5816 | 5816 | |
| 5817 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5818 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5817 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5818 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5819 | 5819 | |
| 5820 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5820 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 5821 | 5821 | |
| 5822 | 5822 | // Line title |
| 5823 | 5823 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 5824 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 5825 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5824 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 5825 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5826 | 5826 | |
| 5827 | 5827 | // Line text |
| 5828 | 5828 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 5829 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 5829 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 5830 | 5830 | } |
| 5831 | 5831 | |
| 5832 | 5832 | // Line form fields |
| 5833 | 5833 | if ($more) { |
| 5834 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 5834 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 5835 | 5835 | $formconfirm .= $more; |
| 5836 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5836 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5837 | 5837 | } |
| 5838 | 5838 | |
| 5839 | 5839 | // Line with question |
| 5840 | 5840 | $formconfirm .= '<tr class="valid">'; |
| 5841 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 5841 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 5842 | 5842 | $formconfirm .= '<td class="valid center">'; |
| 5843 | 5843 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 5844 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 5844 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 5845 | 5845 | $formconfirm .= '</td>'; |
| 5846 | - $formconfirm .= '</tr>' . "\n"; |
|
| 5846 | + $formconfirm .= '</tr>'."\n"; |
|
| 5847 | 5847 | |
| 5848 | - $formconfirm .= '</table>' . "\n"; |
|
| 5848 | + $formconfirm .= '</table>'."\n"; |
|
| 5849 | 5849 | |
| 5850 | 5850 | if (empty($disableformtag)) { |
| 5851 | 5851 | $formconfirm .= "</form>\n"; |
@@ -5854,7 +5854,7 @@ discard block |
||
| 5854 | 5854 | |
| 5855 | 5855 | if (!empty($conf->use_javascript_ajax)) { |
| 5856 | 5856 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 5857 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5857 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5858 | 5858 | $formconfirm .= ' |
| 5859 | 5859 | $(document).ready(function () { |
| 5860 | 5860 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5866,7 +5866,7 @@ discard block |
||
| 5866 | 5866 | }); |
| 5867 | 5867 | }); |
| 5868 | 5868 | '; |
| 5869 | - $formconfirm .= '</script>' . "\n"; |
|
| 5869 | + $formconfirm .= '</script>'."\n"; |
|
| 5870 | 5870 | } |
| 5871 | 5871 | |
| 5872 | 5872 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5898,8 +5898,8 @@ discard block |
||
| 5898 | 5898 | // phpcs:enable |
| 5899 | 5899 | global $langs; |
| 5900 | 5900 | |
| 5901 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 5902 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 5901 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 5902 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 5903 | 5903 | |
| 5904 | 5904 | $out = ''; |
| 5905 | 5905 | |
@@ -5907,11 +5907,11 @@ discard block |
||
| 5907 | 5907 | |
| 5908 | 5908 | $langs->load("project"); |
| 5909 | 5909 | if ($htmlname != "none") { |
| 5910 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 5910 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 5911 | 5911 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 5912 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5912 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5913 | 5913 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 5914 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5914 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5915 | 5915 | $out .= '</form>'; |
| 5916 | 5916 | } else { |
| 5917 | 5917 | $out .= '<span class="project_head_block">'; |
@@ -5920,7 +5920,7 @@ discard block |
||
| 5920 | 5920 | $projet->fetch($selected); |
| 5921 | 5921 | $out .= $projet->getNomUrl(0, '', 1); |
| 5922 | 5922 | } else { |
| 5923 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 5923 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 5924 | 5924 | } |
| 5925 | 5925 | $out .= '</span>'; |
| 5926 | 5926 | } |
@@ -5957,14 +5957,14 @@ discard block |
||
| 5957 | 5957 | $out = ''; |
| 5958 | 5958 | |
| 5959 | 5959 | if ($htmlname != "none") { |
| 5960 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5960 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5961 | 5961 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 5962 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5962 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5963 | 5963 | if ($type) { |
| 5964 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5964 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5965 | 5965 | } |
| 5966 | 5966 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 5967 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5967 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5968 | 5968 | $out .= '</form>'; |
| 5969 | 5969 | } else { |
| 5970 | 5970 | if ($selected) { |
@@ -6009,12 +6009,12 @@ discard block |
||
| 6009 | 6009 | // phpcs:enable |
| 6010 | 6010 | global $langs; |
| 6011 | 6011 | if ($htmlname != "none") { |
| 6012 | - print '<form method="post" action="' . $page . '">'; |
|
| 6012 | + print '<form method="post" action="'.$page.'">'; |
|
| 6013 | 6013 | print '<input type="hidden" name="action" value="setavailability">'; |
| 6014 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6014 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6015 | 6015 | $this->selectAvailabilityDelay($selected, $htmlname, '', $addempty); |
| 6016 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6017 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 6016 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6017 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 6018 | 6018 | print '</form>'; |
| 6019 | 6019 | } else { |
| 6020 | 6020 | if ($selected) { |
@@ -6040,11 +6040,11 @@ discard block |
||
| 6040 | 6040 | { |
| 6041 | 6041 | global $langs; |
| 6042 | 6042 | if ($htmlname != "none") { |
| 6043 | - print '<form method="post" action="' . $page . '">'; |
|
| 6043 | + print '<form method="post" action="'.$page.'">'; |
|
| 6044 | 6044 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 6045 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6045 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6046 | 6046 | $this->selectInputReason($selected, $htmlname, '-1', $addempty); |
| 6047 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6047 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6048 | 6048 | print '</form>'; |
| 6049 | 6049 | } else { |
| 6050 | 6050 | if ($selected) { |
@@ -6084,17 +6084,17 @@ discard block |
||
| 6084 | 6084 | $ret = ''; |
| 6085 | 6085 | |
| 6086 | 6086 | if ($htmlname != "none") { |
| 6087 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6088 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6089 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6087 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6088 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6089 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6090 | 6090 | if ($type) { |
| 6091 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6091 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6092 | 6092 | } |
| 6093 | 6093 | $ret .= '<table class="nobordernopadding">'; |
| 6094 | 6094 | $ret .= '<tr><td>'; |
| 6095 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 6095 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 6096 | 6096 | $ret .= '</td>'; |
| 6097 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6097 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6098 | 6098 | $ret .= '</tr></table></form>'; |
| 6099 | 6099 | } else { |
| 6100 | 6100 | if ($displayhour) { |
@@ -6129,15 +6129,15 @@ discard block |
||
| 6129 | 6129 | global $langs; |
| 6130 | 6130 | |
| 6131 | 6131 | if ($htmlname != "none") { |
| 6132 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6133 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6134 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6132 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6133 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6134 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6135 | 6135 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 6136 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6136 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6137 | 6137 | print '</form>'; |
| 6138 | 6138 | } else { |
| 6139 | 6139 | if ($selected) { |
| 6140 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 6140 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 6141 | 6141 | $theuser = new User($this->db); |
| 6142 | 6142 | $theuser->fetch($selected); |
| 6143 | 6143 | print $theuser->getNomUrl(1); |
@@ -6170,14 +6170,14 @@ discard block |
||
| 6170 | 6170 | |
| 6171 | 6171 | $out = ''; |
| 6172 | 6172 | if ($htmlname != "none") { |
| 6173 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 6173 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 6174 | 6174 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 6175 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6175 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6176 | 6176 | if ($type) { |
| 6177 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6177 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6178 | 6178 | } |
| 6179 | 6179 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 6180 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6180 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6181 | 6181 | $out .= '</form>'; |
| 6182 | 6182 | } else { |
| 6183 | 6183 | if ($selected) { |
@@ -6210,11 +6210,11 @@ discard block |
||
| 6210 | 6210 | { |
| 6211 | 6211 | global $langs; |
| 6212 | 6212 | if ($htmlname != "none") { |
| 6213 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6213 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6214 | 6214 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 6215 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6215 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6216 | 6216 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 6217 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6217 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6218 | 6218 | print '</form>'; |
| 6219 | 6219 | } else { |
| 6220 | 6220 | if ($selected) { |
@@ -6241,14 +6241,14 @@ discard block |
||
| 6241 | 6241 | // phpcs:enable |
| 6242 | 6242 | global $langs; |
| 6243 | 6243 | if ($htmlname != "none") { |
| 6244 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6244 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6245 | 6245 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 6246 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6246 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6247 | 6247 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 6248 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6248 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6249 | 6249 | print '</form>'; |
| 6250 | 6250 | } else { |
| 6251 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6251 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6252 | 6252 | print !empty($selected) ? currency_name($selected, 1) : ' '; |
| 6253 | 6253 | } |
| 6254 | 6254 | } |
@@ -6270,22 +6270,22 @@ discard block |
||
| 6270 | 6270 | global $langs, $mysoc, $conf; |
| 6271 | 6271 | |
| 6272 | 6272 | if ($htmlname != "none") { |
| 6273 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6273 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6274 | 6274 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6275 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6276 | - print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6275 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6276 | + print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6277 | 6277 | print '<select name="calculation_mode" id="calculation_mode">'; |
| 6278 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6279 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6278 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6279 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6280 | 6280 | print '</select> '; |
| 6281 | 6281 | print ajax_combobox("calculation_mode"); |
| 6282 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6282 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6283 | 6283 | print '</form>'; |
| 6284 | 6284 | } else { |
| 6285 | 6285 | if (!empty($rate)) { |
| 6286 | 6286 | print price($rate, 1, $langs, 0, 0); |
| 6287 | 6287 | if ($currency && $rate != 1) { |
| 6288 | - print ' <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>'; |
|
| 6288 | + print ' <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>'; |
|
| 6289 | 6289 | } |
| 6290 | 6290 | } else { |
| 6291 | 6291 | print 1; |
@@ -6316,9 +6316,9 @@ discard block |
||
| 6316 | 6316 | // phpcs:enable |
| 6317 | 6317 | global $conf, $langs; |
| 6318 | 6318 | if ($htmlname != "none") { |
| 6319 | - print '<form method="post" action="' . $page . '">'; |
|
| 6319 | + print '<form method="post" action="'.$page.'">'; |
|
| 6320 | 6320 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6321 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6321 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6322 | 6322 | print '<div class="inline-block">'; |
| 6323 | 6323 | if (!empty($discount_type)) { |
| 6324 | 6324 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6356,24 +6356,24 @@ discard block |
||
| 6356 | 6356 | print '</div>'; |
| 6357 | 6357 | if (empty($hidelist)) { |
| 6358 | 6358 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6359 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6359 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6360 | 6360 | if (!empty($discount_type)) { |
| 6361 | 6361 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6362 | 6362 | } else { |
| 6363 | 6363 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6364 | 6364 | } |
| 6365 | 6365 | if ($filter) { |
| 6366 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6366 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6367 | 6367 | } |
| 6368 | 6368 | // output the combo of discounts |
| 6369 | 6369 | $nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6370 | 6370 | if ($nbqualifiedlines > 0) { |
| 6371 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6371 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6372 | 6372 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6373 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6373 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6374 | 6374 | } |
| 6375 | 6375 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6376 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6376 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6377 | 6377 | } |
| 6378 | 6378 | |
| 6379 | 6379 | print '>'; |
@@ -6413,23 +6413,23 @@ discard block |
||
| 6413 | 6413 | global $langs; |
| 6414 | 6414 | |
| 6415 | 6415 | if ($htmlname != "none") { |
| 6416 | - print '<form method="post" action="' . $page . '">'; |
|
| 6416 | + print '<form method="post" action="'.$page.'">'; |
|
| 6417 | 6417 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6418 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6418 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6419 | 6419 | print '<table class="nobordernopadding">'; |
| 6420 | 6420 | print '<tr><td>'; |
| 6421 | 6421 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6422 | 6422 | $num = $this->num; |
| 6423 | 6423 | if ($num == 0) { |
| 6424 | 6424 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6425 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6425 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6426 | 6426 | } |
| 6427 | 6427 | print '</td>'; |
| 6428 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6428 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6429 | 6429 | print '</tr></table></form>'; |
| 6430 | 6430 | } else { |
| 6431 | 6431 | if ($selected) { |
| 6432 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6432 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6433 | 6433 | $contact = new Contact($this->db); |
| 6434 | 6434 | $contact->fetch($selected); |
| 6435 | 6435 | print $contact->getFullName($langs); |
@@ -6464,20 +6464,20 @@ discard block |
||
| 6464 | 6464 | |
| 6465 | 6465 | $out = ''; |
| 6466 | 6466 | if ($htmlname != "none") { |
| 6467 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6467 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6468 | 6468 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6469 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6469 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6470 | 6470 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6471 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6471 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6472 | 6472 | $out .= '</form>'; |
| 6473 | 6473 | } else { |
| 6474 | 6474 | if ($selected) { |
| 6475 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6475 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6476 | 6476 | $soc = new Societe($this->db); |
| 6477 | 6477 | $soc->fetch($selected); |
| 6478 | 6478 | $out .= $soc->getNomUrl(0, ''); |
| 6479 | 6479 | } else { |
| 6480 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6480 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6481 | 6481 | } |
| 6482 | 6482 | } |
| 6483 | 6483 | |
@@ -6527,22 +6527,22 @@ discard block |
||
| 6527 | 6527 | $selected = 'EUR'; // Pour compatibilite |
| 6528 | 6528 | } |
| 6529 | 6529 | |
| 6530 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6530 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6531 | 6531 | if ($useempty) { |
| 6532 | 6532 | $out .= '<option value="-1" selected></option>'; |
| 6533 | 6533 | } |
| 6534 | 6534 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6535 | 6535 | $labeltoshow = $currency['label']; |
| 6536 | 6536 | if ($mode == 1) { |
| 6537 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6537 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6538 | 6538 | } else { |
| 6539 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6539 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6540 | 6540 | } |
| 6541 | 6541 | |
| 6542 | 6542 | if ($selected && $selected == $code_iso) { |
| 6543 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6543 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6544 | 6544 | } else { |
| 6545 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6545 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6546 | 6546 | } |
| 6547 | 6547 | $out .= $labeltoshow; |
| 6548 | 6548 | $out .= '</option>'; |
@@ -6553,7 +6553,7 @@ discard block |
||
| 6553 | 6553 | } |
| 6554 | 6554 | |
| 6555 | 6555 | // Make select dynamic |
| 6556 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6556 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6557 | 6557 | $out .= ajax_combobox($htmlname); |
| 6558 | 6558 | |
| 6559 | 6559 | return $out; |
@@ -6579,10 +6579,10 @@ discard block |
||
| 6579 | 6579 | |
| 6580 | 6580 | $TCurrency = array(); |
| 6581 | 6581 | |
| 6582 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6583 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6582 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6583 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6584 | 6584 | if ($filter) { |
| 6585 | - $sql .= " AND " . $filter; |
|
| 6585 | + $sql .= " AND ".$filter; |
|
| 6586 | 6586 | } |
| 6587 | 6587 | $resql = $this->db->query($sql); |
| 6588 | 6588 | if ($resql) { |
@@ -6592,7 +6592,7 @@ discard block |
||
| 6592 | 6592 | } |
| 6593 | 6593 | |
| 6594 | 6594 | $out = ''; |
| 6595 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6595 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6596 | 6596 | if ($useempty) { |
| 6597 | 6597 | $out .= '<option value=""> </option>'; |
| 6598 | 6598 | } |
@@ -6604,13 +6604,13 @@ discard block |
||
| 6604 | 6604 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6605 | 6605 | if (isset($TCurrency[$code_iso])) { |
| 6606 | 6606 | if (!empty($selected) && $selected == $code_iso) { |
| 6607 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6607 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6608 | 6608 | } else { |
| 6609 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6609 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6610 | 6610 | } |
| 6611 | 6611 | |
| 6612 | 6612 | $out .= $currency['label']; |
| 6613 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6613 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6614 | 6614 | $out .= '</option>'; |
| 6615 | 6615 | } |
| 6616 | 6616 | } |
@@ -6619,7 +6619,7 @@ discard block |
||
| 6619 | 6619 | $out .= '</select>'; |
| 6620 | 6620 | |
| 6621 | 6621 | // Make select dynamic |
| 6622 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6622 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6623 | 6623 | $out .= ajax_combobox($htmlname); |
| 6624 | 6624 | |
| 6625 | 6625 | return $out; |
@@ -6650,7 +6650,7 @@ discard block |
||
| 6650 | 6650 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6651 | 6651 | $sql .= " AND t.active > 0"; |
| 6652 | 6652 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6653 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6653 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6654 | 6654 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6655 | 6655 | |
| 6656 | 6656 | $resql = $this->db->query($sql); |
@@ -6662,30 +6662,30 @@ discard block |
||
| 6662 | 6662 | |
| 6663 | 6663 | $tmparray = array(); |
| 6664 | 6664 | $tmparray['rowid'] = $obj->rowid; |
| 6665 | - $tmparray['type_vat'] = $obj->type_vat; |
|
| 6666 | - $tmparray['code'] = $obj->code; |
|
| 6665 | + $tmparray['type_vat'] = $obj->type_vat; |
|
| 6666 | + $tmparray['code'] = $obj->code; |
|
| 6667 | 6667 | $tmparray['txtva'] = $obj->taux; |
| 6668 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6668 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6669 | 6669 | $tmparray['localtax1'] = $obj->localtax1; |
| 6670 | 6670 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
| 6671 | 6671 | $tmparray['localtax2'] = $obj->localtax2; |
| 6672 | 6672 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
| 6673 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6674 | - $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 |
|
| 6673 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6674 | + $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 |
|
| 6675 | 6675 | $positiverates = ''; |
| 6676 | 6676 | if ($obj->taux) { |
| 6677 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6677 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6678 | 6678 | } |
| 6679 | 6679 | if ($obj->localtax1) { |
| 6680 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6680 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6681 | 6681 | } |
| 6682 | 6682 | if ($obj->localtax2) { |
| 6683 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6683 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6684 | 6684 | } |
| 6685 | 6685 | if (empty($positiverates)) { |
| 6686 | 6686 | $positiverates = '0'; |
| 6687 | 6687 | } |
| 6688 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6688 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6689 | 6689 | |
| 6690 | 6690 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
| 6691 | 6691 | } |
@@ -6705,7 +6705,7 @@ discard block |
||
| 6705 | 6705 | return -1; |
| 6706 | 6706 | } |
| 6707 | 6707 | } else { |
| 6708 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6708 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6709 | 6709 | return -2; |
| 6710 | 6710 | } |
| 6711 | 6711 | } |
@@ -6758,9 +6758,9 @@ discard block |
||
| 6758 | 6758 | // Check parameters |
| 6759 | 6759 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6760 | 6760 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6761 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6761 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6762 | 6762 | } else { |
| 6763 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6763 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6764 | 6764 | } |
| 6765 | 6765 | return $return; |
| 6766 | 6766 | } |
@@ -6772,12 +6772,12 @@ discard block |
||
| 6772 | 6772 | // Define list of countries to use to search VAT rates to show |
| 6773 | 6773 | // First we defined code_country to use to find list |
| 6774 | 6774 | if (is_object($societe_vendeuse)) { |
| 6775 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6775 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6776 | 6776 | } else { |
| 6777 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6777 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6778 | 6778 | } |
| 6779 | 6779 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
| 6780 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6780 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6781 | 6781 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
| 6782 | 6782 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
| 6783 | 6783 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6787,27 +6787,27 @@ discard block |
||
| 6787 | 6787 | if ($type == 1) { // We know product is a service |
| 6788 | 6788 | switch ($selectVatComboMode) { |
| 6789 | 6789 | case '1': |
| 6790 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6790 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6791 | 6791 | break; |
| 6792 | 6792 | case '2': |
| 6793 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6793 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6794 | 6794 | break; |
| 6795 | 6795 | } |
| 6796 | 6796 | } |
| 6797 | 6797 | } elseif (!$idprod) { // We don't know type of product |
| 6798 | 6798 | switch ($selectVatComboMode) { |
| 6799 | 6799 | case '1': |
| 6800 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6800 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6801 | 6801 | break; |
| 6802 | 6802 | case '2': |
| 6803 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6803 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6804 | 6804 | break; |
| 6805 | 6805 | } |
| 6806 | 6806 | } else { |
| 6807 | 6807 | $prodstatic = new Product($this->db); |
| 6808 | 6808 | $prodstatic->fetch($idprod); |
| 6809 | 6809 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 6810 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6810 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6811 | 6811 | } |
| 6812 | 6812 | } |
| 6813 | 6813 | } |
@@ -6869,13 +6869,13 @@ discard block |
||
| 6869 | 6869 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 6870 | 6870 | // of using supplier invoices (this is a very bad idea !) |
| 6871 | 6871 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
| 6872 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 6872 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 6873 | 6873 | $disabled = true; |
| 6874 | 6874 | } |
| 6875 | 6875 | } |
| 6876 | 6876 | |
| 6877 | 6877 | if (!$options_only) { |
| 6878 | - $return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 6878 | + $return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 6879 | 6879 | } |
| 6880 | 6880 | |
| 6881 | 6881 | $selectedfound = false; |
@@ -6889,13 +6889,13 @@ discard block |
||
| 6889 | 6889 | $key = $rate['txtva']; |
| 6890 | 6890 | $key .= $rate['nprtva'] ? '*' : ''; |
| 6891 | 6891 | if ($mode > 0 && $rate['code']) { |
| 6892 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 6892 | + $key .= ' ('.$rate['code'].')'; |
|
| 6893 | 6893 | } |
| 6894 | 6894 | if ($mode < 0) { |
| 6895 | 6895 | $key = $rate['rowid']; |
| 6896 | 6896 | } |
| 6897 | 6897 | |
| 6898 | - $return .= '<option value="' . $key . '"'; |
|
| 6898 | + $return .= '<option value="'.$key.'"'; |
|
| 6899 | 6899 | if (!$selectedfound) { |
| 6900 | 6900 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 6901 | 6901 | if ($defaultcode == $rate['code']) { |
@@ -6966,7 +6966,7 @@ discard block |
||
| 6966 | 6966 | 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 = '') |
| 6967 | 6967 | { |
| 6968 | 6968 | // phpcs:enable |
| 6969 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6969 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6970 | 6970 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 6971 | 6971 | if (!empty($nooutput)) { |
| 6972 | 6972 | return $retstring; |
@@ -6995,11 +6995,11 @@ discard block |
||
| 6995 | 6995 | { |
| 6996 | 6996 | global $langs; |
| 6997 | 6997 | |
| 6998 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6998 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6999 | 6999 | if ($forcenewline) { |
| 7000 | 7000 | $ret .= '<br>'; |
| 7001 | 7001 | } |
| 7002 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 7002 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 7003 | 7003 | return $ret; |
| 7004 | 7004 | } |
| 7005 | 7005 | |
@@ -7065,7 +7065,7 @@ discard block |
||
| 7065 | 7065 | $orig_set_time = $set_time; |
| 7066 | 7066 | |
| 7067 | 7067 | if ($set_time === '' && $emptydate == 0) { |
| 7068 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7068 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7069 | 7069 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 7070 | 7070 | $set_time = dol_now($gm); |
| 7071 | 7071 | } else { |
@@ -7137,38 +7137,38 @@ discard block |
||
| 7137 | 7137 | // Calendrier popup version eldy |
| 7138 | 7138 | if ($usecalendar == "eldy") { |
| 7139 | 7139 | // Input area to enter date manually |
| 7140 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"'; |
|
| 7140 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
|
| 7141 | 7141 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7142 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7142 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7143 | 7143 | $retstring .= ' autocomplete="off">'; |
| 7144 | 7144 | |
| 7145 | 7145 | // Icon calendar |
| 7146 | 7146 | $retstringbuttom = ''; |
| 7147 | 7147 | if (!$disabled) { |
| 7148 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7149 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 7150 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
| 7151 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7148 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7149 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 7150 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
| 7151 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7152 | 7152 | } else { |
| 7153 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7153 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7154 | 7154 | } |
| 7155 | - $retstring = $retstringbuttom . $retstring; |
|
| 7155 | + $retstring = $retstringbuttom.$retstring; |
|
| 7156 | 7156 | |
| 7157 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7158 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7159 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7157 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7158 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7159 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7160 | 7160 | } elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
| 7161 | 7161 | if (!$disabled && $usecalendar != 'html') { |
| 7162 | 7162 | // Output javascript for datepicker |
| 7163 | 7163 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100)); |
| 7164 | 7164 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100)); |
| 7165 | 7165 | |
| 7166 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 7167 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 7168 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 7166 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 7167 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 7168 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 7169 | 7169 | autoclose: true, |
| 7170 | 7170 | todayHighlight: true, |
| 7171 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 7171 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 7172 | 7172 | if (!empty($conf->dol_use_jmobile)) { |
| 7173 | 7173 | $retstring .= " |
| 7174 | 7174 | beforeShow: function (input, datePicker) { |
@@ -7183,7 +7183,7 @@ discard block |
||
| 7183 | 7183 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
| 7184 | 7184 | $retstring .= " |
| 7185 | 7185 | showOn: 'button', /* both has problem with autocompletion */ |
| 7186 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
| 7186 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
| 7187 | 7187 | buttonImageOnly: true"; |
| 7188 | 7188 | } |
| 7189 | 7189 | $retstring .= " |
@@ -7195,46 +7195,46 @@ discard block |
||
| 7195 | 7195 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 7196 | 7196 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
| 7197 | 7197 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7198 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 7199 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7198 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 7199 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7200 | 7200 | $retstring .= ' autocomplete="off">'; |
| 7201 | 7201 | |
| 7202 | 7202 | // Icone calendrier |
| 7203 | 7203 | if ($disabled) { |
| 7204 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7205 | - $retstring = $retstringbutton . $retstring; |
|
| 7204 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7205 | + $retstring = $retstringbutton.$retstring; |
|
| 7206 | 7206 | } |
| 7207 | 7207 | |
| 7208 | 7208 | $retstring .= '</div>'; |
| 7209 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7210 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7211 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7209 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7210 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7211 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7212 | 7212 | } else { |
| 7213 | 7213 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 7214 | 7214 | } |
| 7215 | 7215 | } else { |
| 7216 | 7216 | // Show date with combo selects |
| 7217 | 7217 | // Day |
| 7218 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 7218 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 7219 | 7219 | |
| 7220 | 7220 | if ($emptydate || $set_time == -1) { |
| 7221 | 7221 | $retstring .= '<option value="0" selected> </option>'; |
| 7222 | 7222 | } |
| 7223 | 7223 | |
| 7224 | 7224 | for ($day = 1; $day <= 31; $day++) { |
| 7225 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 7225 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 7226 | 7226 | } |
| 7227 | 7227 | |
| 7228 | 7228 | $retstring .= "</select>"; |
| 7229 | 7229 | |
| 7230 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 7230 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 7231 | 7231 | if ($emptydate || $set_time == -1) { |
| 7232 | 7232 | $retstring .= '<option value="0" selected> </option>'; |
| 7233 | 7233 | } |
| 7234 | 7234 | |
| 7235 | 7235 | // Month |
| 7236 | 7236 | for ($month = 1; $month <= 12; $month++) { |
| 7237 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 7237 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 7238 | 7238 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 7239 | 7239 | $retstring .= "</option>"; |
| 7240 | 7240 | } |
@@ -7242,13 +7242,13 @@ discard block |
||
| 7242 | 7242 | |
| 7243 | 7243 | // Year |
| 7244 | 7244 | if ($emptydate || $set_time == -1) { |
| 7245 | - $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 . '">'; |
|
| 7245 | + $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.'">'; |
|
| 7246 | 7246 | } else { |
| 7247 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 7247 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 7248 | 7248 | |
| 7249 | 7249 | $syear = (int) $syear; |
| 7250 | 7250 | for ($year = $syear - 10; $year < (int) $syear + 10; $year++) { |
| 7251 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 7251 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 7252 | 7252 | } |
| 7253 | 7253 | $retstring .= "</select>\n"; |
| 7254 | 7254 | } |
@@ -7272,15 +7272,15 @@ discard block |
||
| 7272 | 7272 | } |
| 7273 | 7273 | } |
| 7274 | 7274 | // Show hour |
| 7275 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 7275 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 7276 | 7276 | if ($emptyhours) { |
| 7277 | 7277 | $retstring .= '<option value="-1"> </option>'; |
| 7278 | 7278 | } |
| 7279 | 7279 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 7280 | 7280 | if (strlen($hour) < 2) { |
| 7281 | - $hour = "0" . $hour; |
|
| 7281 | + $hour = "0".$hour; |
|
| 7282 | 7282 | } |
| 7283 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 7283 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 7284 | 7284 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 7285 | 7285 | $retstring .= '</option>'; |
| 7286 | 7286 | } |
@@ -7293,17 +7293,17 @@ discard block |
||
| 7293 | 7293 | |
| 7294 | 7294 | if ($m) { |
| 7295 | 7295 | // Show minutes |
| 7296 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 7296 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 7297 | 7297 | if ($emptyhours) { |
| 7298 | 7298 | $retstring .= '<option value="-1"> </option>'; |
| 7299 | 7299 | } |
| 7300 | 7300 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7301 | 7301 | $min_str = sprintf("%02d", $min); |
| 7302 | - $retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>'; |
|
| 7302 | + $retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>'; |
|
| 7303 | 7303 | } |
| 7304 | 7304 | $retstring .= '</select>'; |
| 7305 | 7305 | |
| 7306 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7306 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7307 | 7307 | } |
| 7308 | 7308 | |
| 7309 | 7309 | if ($d && $h) { |
@@ -7326,10 +7326,10 @@ discard block |
||
| 7326 | 7326 | |
| 7327 | 7327 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7328 | 7328 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7329 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7330 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7331 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7332 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7329 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7330 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7331 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7332 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7333 | 7333 | } elseif ($addnowlink == 2) { |
| 7334 | 7334 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7335 | 7335 | * This break application for foreign languages. |
@@ -7338,10 +7338,10 @@ discard block |
||
| 7338 | 7338 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7339 | 7339 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7340 | 7340 | */ |
| 7341 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7342 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7343 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7344 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7341 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7342 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7343 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7344 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7345 | 7345 | } |
| 7346 | 7346 | /*if ($usecalendar == "eldy") |
| 7347 | 7347 | { |
@@ -7361,11 +7361,11 @@ discard block |
||
| 7361 | 7361 | } |
| 7362 | 7362 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7363 | 7363 | if ($addnowlink == 1) { |
| 7364 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7365 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7364 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7365 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7366 | 7366 | } elseif ($addnowlink == 2) { |
| 7367 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7368 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7367 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7368 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7369 | 7369 | } |
| 7370 | 7370 | |
| 7371 | 7371 | if ($fullday) { |
@@ -7379,11 +7379,11 @@ discard block |
||
| 7379 | 7379 | } |
| 7380 | 7380 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7381 | 7381 | if ($addnowlink == 1) { |
| 7382 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7383 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7382 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7383 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7384 | 7384 | } elseif ($addnowlink == 2) { |
| 7385 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7386 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7385 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7386 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7387 | 7387 | } |
| 7388 | 7388 | if ($fullday) { |
| 7389 | 7389 | $reset_scripts .= ' } '; |
@@ -7391,7 +7391,7 @@ discard block |
||
| 7391 | 7391 | } |
| 7392 | 7392 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7393 | 7393 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 7394 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7394 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7395 | 7395 | $retstring .= $langs->trans("Now"); |
| 7396 | 7396 | $retstring .= '</button> '; |
| 7397 | 7397 | } |
@@ -7403,16 +7403,16 @@ discard block |
||
| 7403 | 7403 | $reset_scripts = ""; |
| 7404 | 7404 | |
| 7405 | 7405 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7406 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7407 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7408 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7409 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7406 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7407 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7408 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7409 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7410 | 7410 | // Update the hour part |
| 7411 | 7411 | if ($h) { |
| 7412 | 7412 | if ($fullday) { |
| 7413 | 7413 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7414 | 7414 | } |
| 7415 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7415 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7416 | 7416 | if ($fullday) { |
| 7417 | 7417 | $reset_scripts .= ' } '; |
| 7418 | 7418 | } |
@@ -7422,14 +7422,14 @@ discard block |
||
| 7422 | 7422 | if ($fullday) { |
| 7423 | 7423 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7424 | 7424 | } |
| 7425 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7425 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7426 | 7426 | if ($fullday) { |
| 7427 | 7427 | $reset_scripts .= ' } '; |
| 7428 | 7428 | } |
| 7429 | 7429 | } |
| 7430 | 7430 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7431 | 7431 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7432 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7432 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7433 | 7433 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7434 | 7434 | $retstring .= '</button> '; |
| 7435 | 7435 | } |
@@ -7487,17 +7487,17 @@ discard block |
||
| 7487 | 7487 | unset($TDurationTypes[$value]); |
| 7488 | 7488 | } |
| 7489 | 7489 | |
| 7490 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7490 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7491 | 7491 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7492 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7492 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7493 | 7493 | if ($key == $selected) { |
| 7494 | 7494 | $retstring .= " selected"; |
| 7495 | 7495 | } |
| 7496 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7496 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7497 | 7497 | } |
| 7498 | 7498 | $retstring .= "</select>"; |
| 7499 | 7499 | |
| 7500 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7500 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7501 | 7501 | |
| 7502 | 7502 | return $retstring; |
| 7503 | 7503 | } |
@@ -7529,30 +7529,30 @@ discard block |
||
| 7529 | 7529 | |
| 7530 | 7530 | // Hours |
| 7531 | 7531 | if ($iSecond != '') { |
| 7532 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7532 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7533 | 7533 | |
| 7534 | 7534 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7535 | 7535 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7536 | 7536 | } |
| 7537 | 7537 | |
| 7538 | 7538 | if ($typehour == 'select') { |
| 7539 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7539 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7540 | 7540 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7541 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7541 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7542 | 7542 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7543 | 7543 | $retstring .= " selected"; |
| 7544 | 7544 | } |
| 7545 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7545 | + $retstring .= ">".$hour."</option>"; |
|
| 7546 | 7546 | } |
| 7547 | 7547 | $retstring .= "</select>"; |
| 7548 | 7548 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7549 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7549 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7550 | 7550 | } else { |
| 7551 | 7551 | return 'BadValueForParameterTypeHour'; |
| 7552 | 7552 | } |
| 7553 | 7553 | |
| 7554 | 7554 | if ($typehour != 'text') { |
| 7555 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7555 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7556 | 7556 | } else { |
| 7557 | 7557 | $retstring .= '<span class="">:</span>'; |
| 7558 | 7558 | } |
@@ -7567,21 +7567,21 @@ discard block |
||
| 7567 | 7567 | } |
| 7568 | 7568 | |
| 7569 | 7569 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7570 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7570 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7571 | 7571 | for ($min = 0; $min <= 55; $min += 5) { |
| 7572 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7572 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7573 | 7573 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7574 | 7574 | $retstring .= ' selected'; |
| 7575 | 7575 | } |
| 7576 | - $retstring .= '>' . $min . '</option>'; |
|
| 7576 | + $retstring .= '>'.$min.'</option>'; |
|
| 7577 | 7577 | } |
| 7578 | 7578 | $retstring .= "</select>"; |
| 7579 | 7579 | } elseif ($typehour == 'text') { |
| 7580 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7580 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7581 | 7581 | } |
| 7582 | 7582 | |
| 7583 | 7583 | if ($typehour != 'text') { |
| 7584 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7584 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7585 | 7585 | } |
| 7586 | 7586 | |
| 7587 | 7587 | $retstring .= "</span>"; |
@@ -7629,7 +7629,7 @@ discard block |
||
| 7629 | 7629 | $placeholder = ''; |
| 7630 | 7630 | |
| 7631 | 7631 | if ($selected && empty($selected_input_value)) { |
| 7632 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7632 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7633 | 7633 | $tickettmpselect = new Ticket($this->db); |
| 7634 | 7634 | $tickettmpselect->fetch($selected); |
| 7635 | 7635 | $selected_input_value = $tickettmpselect->ref; |
@@ -7637,17 +7637,17 @@ discard block |
||
| 7637 | 7637 | } |
| 7638 | 7638 | |
| 7639 | 7639 | $urloption = ''; |
| 7640 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7640 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7641 | 7641 | |
| 7642 | 7642 | if (empty($hidelabel)) { |
| 7643 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7643 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7644 | 7644 | } elseif ($hidelabel > 1) { |
| 7645 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7645 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7646 | 7646 | if ($hidelabel == 2) { |
| 7647 | 7647 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7648 | 7648 | } |
| 7649 | 7649 | } |
| 7650 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7650 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7651 | 7651 | if ($hidelabel == 3) { |
| 7652 | 7652 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7653 | 7653 | } |
@@ -7691,8 +7691,8 @@ discard block |
||
| 7691 | 7691 | |
| 7692 | 7692 | $sql = "SELECT "; |
| 7693 | 7693 | $sql .= $selectFields; |
| 7694 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7695 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7694 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7695 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7696 | 7696 | |
| 7697 | 7697 | // Add criteria on ref/label |
| 7698 | 7698 | if ($filterkey != '') { |
@@ -7708,7 +7708,7 @@ discard block |
||
| 7708 | 7708 | if ($i > 0) { |
| 7709 | 7709 | $sql .= " AND "; |
| 7710 | 7710 | } |
| 7711 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7711 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7712 | 7712 | $sql .= ")"; |
| 7713 | 7713 | $i++; |
| 7714 | 7714 | } |
@@ -7721,22 +7721,22 @@ discard block |
||
| 7721 | 7721 | $sql .= $this->db->plimit($limit, 0); |
| 7722 | 7722 | |
| 7723 | 7723 | // Build output string |
| 7724 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7724 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7725 | 7725 | $result = $this->db->query($sql); |
| 7726 | 7726 | if ($result) { |
| 7727 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7728 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7727 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7728 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7729 | 7729 | |
| 7730 | 7730 | $num = $this->db->num_rows($result); |
| 7731 | 7731 | |
| 7732 | 7732 | $events = array(); |
| 7733 | 7733 | |
| 7734 | 7734 | if (!$forcecombo) { |
| 7735 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7735 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7736 | 7736 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT')); |
| 7737 | 7737 | } |
| 7738 | 7738 | |
| 7739 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7739 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7740 | 7740 | |
| 7741 | 7741 | $textifempty = ''; |
| 7742 | 7742 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7753,7 +7753,7 @@ discard block |
||
| 7753 | 7753 | } |
| 7754 | 7754 | } |
| 7755 | 7755 | if ($showempty) { |
| 7756 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7756 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7757 | 7757 | } |
| 7758 | 7758 | |
| 7759 | 7759 | $i = 0; |
@@ -7807,13 +7807,13 @@ discard block |
||
| 7807 | 7807 | $outkey = $objp->rowid; |
| 7808 | 7808 | $outref = $objp->ref; |
| 7809 | 7809 | |
| 7810 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7810 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7811 | 7811 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7812 | 7812 | $opt .= '>'; |
| 7813 | 7813 | $opt .= $objp->ref; |
| 7814 | 7814 | $objRef = $objp->ref; |
| 7815 | 7815 | if (!empty($filterkey) && $filterkey != '') { |
| 7816 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7816 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7817 | 7817 | } |
| 7818 | 7818 | |
| 7819 | 7819 | $opt .= "</option>\n"; |
@@ -7854,7 +7854,7 @@ discard block |
||
| 7854 | 7854 | $placeholder = ''; |
| 7855 | 7855 | |
| 7856 | 7856 | if ($selected && empty($selected_input_value)) { |
| 7857 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7857 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7858 | 7858 | $projecttmpselect = new Project($this->db); |
| 7859 | 7859 | $projecttmpselect->fetch($selected); |
| 7860 | 7860 | $selected_input_value = $projecttmpselect->ref; |
@@ -7862,17 +7862,17 @@ discard block |
||
| 7862 | 7862 | } |
| 7863 | 7863 | |
| 7864 | 7864 | $urloption = ''; |
| 7865 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7865 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7866 | 7866 | |
| 7867 | 7867 | if (empty($hidelabel)) { |
| 7868 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7868 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7869 | 7869 | } elseif ($hidelabel > 1) { |
| 7870 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7870 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7871 | 7871 | if ($hidelabel == 2) { |
| 7872 | 7872 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7873 | 7873 | } |
| 7874 | 7874 | } |
| 7875 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7875 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7876 | 7876 | if ($hidelabel == 3) { |
| 7877 | 7877 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7878 | 7878 | } |
@@ -7915,8 +7915,8 @@ discard block |
||
| 7915 | 7915 | |
| 7916 | 7916 | $sql = "SELECT "; |
| 7917 | 7917 | $sql .= $selectFields; |
| 7918 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 7919 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 7918 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 7919 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 7920 | 7920 | |
| 7921 | 7921 | // Add criteria on ref/label |
| 7922 | 7922 | if ($filterkey != '') { |
@@ -7932,7 +7932,7 @@ discard block |
||
| 7932 | 7932 | if ($i > 0) { |
| 7933 | 7933 | $sql .= " AND "; |
| 7934 | 7934 | } |
| 7935 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7935 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7936 | 7936 | $sql .= ""; |
| 7937 | 7937 | $i++; |
| 7938 | 7938 | } |
@@ -7945,22 +7945,22 @@ discard block |
||
| 7945 | 7945 | $sql .= $this->db->plimit($limit, 0); |
| 7946 | 7946 | |
| 7947 | 7947 | // Build output string |
| 7948 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 7948 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 7949 | 7949 | $result = $this->db->query($sql); |
| 7950 | 7950 | if ($result) { |
| 7951 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7952 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 7951 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7952 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 7953 | 7953 | |
| 7954 | 7954 | $num = $this->db->num_rows($result); |
| 7955 | 7955 | |
| 7956 | 7956 | $events = array(); |
| 7957 | 7957 | |
| 7958 | 7958 | if (!$forcecombo) { |
| 7959 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7959 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7960 | 7960 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT')); |
| 7961 | 7961 | } |
| 7962 | 7962 | |
| 7963 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7963 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7964 | 7964 | |
| 7965 | 7965 | $textifempty = ''; |
| 7966 | 7966 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7977,7 +7977,7 @@ discard block |
||
| 7977 | 7977 | } |
| 7978 | 7978 | } |
| 7979 | 7979 | if ($showempty) { |
| 7980 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7980 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7981 | 7981 | } |
| 7982 | 7982 | |
| 7983 | 7983 | $i = 0; |
@@ -8035,13 +8035,13 @@ discard block |
||
| 8035 | 8035 | $outlabel = $objp->label; |
| 8036 | 8036 | $outtype = $objp->fk_product_type; |
| 8037 | 8037 | |
| 8038 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8038 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8039 | 8039 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8040 | 8040 | $opt .= '>'; |
| 8041 | 8041 | $opt .= $objp->ref; |
| 8042 | 8042 | $objRef = $objp->ref; |
| 8043 | 8043 | if (!empty($filterkey) && $filterkey != '') { |
| 8044 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8044 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8045 | 8045 | } |
| 8046 | 8046 | |
| 8047 | 8047 | $opt .= "</option>\n"; |
@@ -8083,7 +8083,7 @@ discard block |
||
| 8083 | 8083 | $placeholder = ''; |
| 8084 | 8084 | |
| 8085 | 8085 | if ($selected && empty($selected_input_value)) { |
| 8086 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8086 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8087 | 8087 | $adherenttmpselect = new Adherent($this->db); |
| 8088 | 8088 | $adherenttmpselect->fetch($selected); |
| 8089 | 8089 | $selected_input_value = $adherenttmpselect->ref; |
@@ -8092,17 +8092,17 @@ discard block |
||
| 8092 | 8092 | |
| 8093 | 8093 | $urloption = ''; |
| 8094 | 8094 | |
| 8095 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8095 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8096 | 8096 | |
| 8097 | 8097 | if (empty($hidelabel)) { |
| 8098 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 8098 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 8099 | 8099 | } elseif ($hidelabel > 1) { |
| 8100 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 8100 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 8101 | 8101 | if ($hidelabel == 2) { |
| 8102 | 8102 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8103 | 8103 | } |
| 8104 | 8104 | } |
| 8105 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 8105 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 8106 | 8106 | if ($hidelabel == 3) { |
| 8107 | 8107 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8108 | 8108 | } |
@@ -8147,8 +8147,8 @@ discard block |
||
| 8147 | 8147 | |
| 8148 | 8148 | $sql = "SELECT "; |
| 8149 | 8149 | $sql .= $selectFields; |
| 8150 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 8151 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 8150 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 8151 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 8152 | 8152 | |
| 8153 | 8153 | // Add criteria on ref/label |
| 8154 | 8154 | if ($filterkey != '') { |
@@ -8164,8 +8164,8 @@ discard block |
||
| 8164 | 8164 | if ($i > 0) { |
| 8165 | 8165 | $sql .= " AND "; |
| 8166 | 8166 | } |
| 8167 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 8168 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 8167 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 8168 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 8169 | 8169 | $i++; |
| 8170 | 8170 | } |
| 8171 | 8171 | if (count($search_crit) > 1) { |
@@ -8174,27 +8174,27 @@ discard block |
||
| 8174 | 8174 | $sql .= ')'; |
| 8175 | 8175 | } |
| 8176 | 8176 | if ($status != -1) { |
| 8177 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 8177 | + $sql .= ' AND statut = '.((int) $status); |
|
| 8178 | 8178 | } |
| 8179 | 8179 | $sql .= $this->db->plimit($limit, 0); |
| 8180 | 8180 | |
| 8181 | 8181 | // Build output string |
| 8182 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 8182 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 8183 | 8183 | $result = $this->db->query($sql); |
| 8184 | 8184 | if ($result) { |
| 8185 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8186 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 8185 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8186 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 8187 | 8187 | |
| 8188 | 8188 | $num = $this->db->num_rows($result); |
| 8189 | 8189 | |
| 8190 | 8190 | $events = array(); |
| 8191 | 8191 | |
| 8192 | 8192 | if (!$forcecombo) { |
| 8193 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8193 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8194 | 8194 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 8195 | 8195 | } |
| 8196 | 8196 | |
| 8197 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 8197 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 8198 | 8198 | |
| 8199 | 8199 | $textifempty = ''; |
| 8200 | 8200 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8211,7 +8211,7 @@ discard block |
||
| 8211 | 8211 | } |
| 8212 | 8212 | } |
| 8213 | 8213 | if ($showempty) { |
| 8214 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 8214 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 8215 | 8215 | } |
| 8216 | 8216 | |
| 8217 | 8217 | $i = 0; |
@@ -8267,11 +8267,11 @@ discard block |
||
| 8267 | 8267 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 8268 | 8268 | $outtype = $objp->fk_adherent_type; |
| 8269 | 8269 | |
| 8270 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8270 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8271 | 8271 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8272 | 8272 | $opt .= '>'; |
| 8273 | 8273 | if (!empty($filterkey) && $filterkey != '') { |
| 8274 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8274 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8275 | 8275 | } |
| 8276 | 8276 | $opt .= $outlabel; |
| 8277 | 8277 | $opt .= "</option>\n"; |
@@ -8326,8 +8326,8 @@ discard block |
||
| 8326 | 8326 | $objecttmp = null; |
| 8327 | 8327 | $InfoFieldList = array(); |
| 8328 | 8328 | $classname = ''; |
| 8329 | - $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8330 | - $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8329 | + $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8330 | + $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8331 | 8331 | |
| 8332 | 8332 | if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield |
| 8333 | 8333 | // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield' |
@@ -8371,9 +8371,9 @@ discard block |
||
| 8371 | 8371 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 8372 | 8372 | $reg = array(); |
| 8373 | 8373 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 8374 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8374 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8375 | 8375 | } |
| 8376 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8376 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8377 | 8377 | |
| 8378 | 8378 | $classname = $InfoFieldList[0]; |
| 8379 | 8379 | $classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1]; |
@@ -8404,8 +8404,8 @@ discard block |
||
| 8404 | 8404 | ); |
| 8405 | 8405 | |
| 8406 | 8406 | if (!is_object($objecttmp)) { |
| 8407 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8408 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8407 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8408 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8409 | 8409 | } |
| 8410 | 8410 | '@phan-var-force CommonObject $objecttmp'; |
| 8411 | 8411 | |
@@ -8417,9 +8417,9 @@ discard block |
||
| 8417 | 8417 | if ($prefixforautocompletemode == 'product') { |
| 8418 | 8418 | $prefixforautocompletemode = 'produit'; |
| 8419 | 8419 | } |
| 8420 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8420 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8421 | 8421 | |
| 8422 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8422 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8423 | 8423 | |
| 8424 | 8424 | // Generate the combo HTML component |
| 8425 | 8425 | $out = ''; |
@@ -8448,13 +8448,13 @@ discard block |
||
| 8448 | 8448 | } |
| 8449 | 8449 | |
| 8450 | 8450 | // Set url and param to call to get json of the search results |
| 8451 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8452 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8451 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8452 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8453 | 8453 | |
| 8454 | 8454 | // Activate the auto complete using ajax call. |
| 8455 | 8455 | $out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0); |
| 8456 | 8456 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8457 | - $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) . '"' : '') . ' />'; |
|
| 8457 | + $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).'"' : '').' />'; |
|
| 8458 | 8458 | } else { |
| 8459 | 8459 | // Immediate load of table record. |
| 8460 | 8460 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8494,16 +8494,16 @@ discard block |
||
| 8494 | 8494 | if ($prefixforautocompletemode == 'societe') { |
| 8495 | 8495 | $prefixforautocompletemode = 'company'; |
| 8496 | 8496 | } |
| 8497 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8497 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8498 | 8498 | |
| 8499 | 8499 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8500 | 8500 | $tmpfieldstoshow = ''; |
| 8501 | 8501 | foreach ($objecttmp->fields as $key => $val) { |
| 8502 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8502 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8503 | 8503 | continue; |
| 8504 | 8504 | } |
| 8505 | 8505 | if (!empty($val['showoncombobox'])) { |
| 8506 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8506 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8507 | 8507 | } |
| 8508 | 8508 | } |
| 8509 | 8509 | if ($tmpfieldstoshow) { |
@@ -8531,18 +8531,18 @@ discard block |
||
| 8531 | 8531 | $num = 0; |
| 8532 | 8532 | |
| 8533 | 8533 | // Search data |
| 8534 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 8534 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 8535 | 8535 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8536 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8536 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8537 | 8537 | } |
| 8538 | 8538 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8539 | 8539 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8540 | 8540 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8541 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 8541 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 8542 | 8542 | } |
| 8543 | 8543 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8544 | 8544 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8545 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8545 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8546 | 8546 | } |
| 8547 | 8547 | } |
| 8548 | 8548 | } |
@@ -8562,21 +8562,21 @@ discard block |
||
| 8562 | 8562 | $sql .= " WHERE 1=1"; |
| 8563 | 8563 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8564 | 8564 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8565 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8565 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8566 | 8566 | } |
| 8567 | 8567 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8568 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 8568 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 8569 | 8569 | } |
| 8570 | 8570 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8571 | 8571 | if ($objecttmp->element == 'societe') { |
| 8572 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8572 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8573 | 8573 | } else { |
| 8574 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8574 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8575 | 8575 | } |
| 8576 | 8576 | } |
| 8577 | 8577 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8578 | 8578 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8579 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8579 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8580 | 8580 | } |
| 8581 | 8581 | } |
| 8582 | 8582 | } |
@@ -8588,7 +8588,7 @@ discard block |
||
| 8588 | 8588 | $errormessage = ''; |
| 8589 | 8589 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8590 | 8590 | if ($errormessage) { |
| 8591 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8591 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8592 | 8592 | } |
| 8593 | 8593 | } |
| 8594 | 8594 | } |
@@ -8600,7 +8600,7 @@ discard block |
||
| 8600 | 8600 | $resql = $this->db->query($sql); |
| 8601 | 8601 | if ($resql) { |
| 8602 | 8602 | // Construct $out and $outarray |
| 8603 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8603 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8604 | 8604 | |
| 8605 | 8605 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8606 | 8606 | $textifempty = ' '; |
@@ -8614,7 +8614,7 @@ discard block |
||
| 8614 | 8614 | } |
| 8615 | 8615 | } |
| 8616 | 8616 | if ($showempty) { |
| 8617 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8617 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8618 | 8618 | } |
| 8619 | 8619 | |
| 8620 | 8620 | $num = $this->db->num_rows($resql); |
@@ -8637,9 +8637,9 @@ discard block |
||
| 8637 | 8637 | } |
| 8638 | 8638 | if (empty($outputmode)) { |
| 8639 | 8639 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8640 | - $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>'; |
|
| 8640 | + $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>'; |
|
| 8641 | 8641 | } else { |
| 8642 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8642 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8643 | 8643 | } |
| 8644 | 8644 | } else { |
| 8645 | 8645 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8652,10 +8652,10 @@ discard block |
||
| 8652 | 8652 | } |
| 8653 | 8653 | } |
| 8654 | 8654 | |
| 8655 | - $out .= '</select>' . "\n"; |
|
| 8655 | + $out .= '</select>'."\n"; |
|
| 8656 | 8656 | |
| 8657 | 8657 | if (!$forcecombo) { |
| 8658 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8658 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8659 | 8659 | $out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0)); |
| 8660 | 8660 | } |
| 8661 | 8661 | } else { |
@@ -8719,8 +8719,8 @@ discard block |
||
| 8719 | 8719 | } |
| 8720 | 8720 | } |
| 8721 | 8721 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8722 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8723 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8722 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8723 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8724 | 8724 | $out .= '>'."\n"; |
| 8725 | 8725 | |
| 8726 | 8726 | if ($show_empty) { |
@@ -8731,7 +8731,7 @@ discard block |
||
| 8731 | 8731 | if (!is_numeric($show_empty)) { |
| 8732 | 8732 | $textforempty = $show_empty; |
| 8733 | 8733 | } |
| 8734 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8734 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8735 | 8735 | } |
| 8736 | 8736 | if (is_array($array)) { |
| 8737 | 8737 | // Translate |
@@ -8756,7 +8756,7 @@ discard block |
||
| 8756 | 8756 | $value = $tmpvalue['label']; |
| 8757 | 8757 | //$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html']; |
| 8758 | 8758 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8759 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8759 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8760 | 8760 | } else { |
| 8761 | 8761 | $value = $tmpvalue; |
| 8762 | 8762 | //$valuehtml = $tmpvalue; |
@@ -8772,9 +8772,9 @@ discard block |
||
| 8772 | 8772 | } |
| 8773 | 8773 | if ($key_in_label) { |
| 8774 | 8774 | if (empty($nohtmlescape)) { |
| 8775 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8775 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8776 | 8776 | } else { |
| 8777 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8777 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8778 | 8778 | } |
| 8779 | 8779 | } else { |
| 8780 | 8780 | if (empty($nohtmlescape)) { |
@@ -8786,8 +8786,8 @@ discard block |
||
| 8786 | 8786 | $selectOptionValue = ' '; |
| 8787 | 8787 | } |
| 8788 | 8788 | } |
| 8789 | - $out .= '<option value="' . $key . '"'; |
|
| 8790 | - $out .= $style . $disabled; |
|
| 8789 | + $out .= '<option value="'.$key.'"'; |
|
| 8790 | + $out .= $style.$disabled; |
|
| 8791 | 8791 | if (is_array($id)) { |
| 8792 | 8792 | if (in_array($key, $id) && !$disabled) { |
| 8793 | 8793 | $out .= ' selected'; // To preselect a value |
@@ -8799,7 +8799,7 @@ discard block |
||
| 8799 | 8799 | } |
| 8800 | 8800 | } |
| 8801 | 8801 | if (!empty($nohtmlescape)) { // deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content. |
| 8802 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 8802 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 8803 | 8803 | } |
| 8804 | 8804 | |
| 8805 | 8805 | if (is_array($tmpvalue)) { |
@@ -8822,7 +8822,7 @@ discard block |
||
| 8822 | 8822 | // Add code for jquery to use multiselect |
| 8823 | 8823 | if ($addjscombo && $jsbeautify) { |
| 8824 | 8824 | // Enhance with select2 |
| 8825 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8825 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8826 | 8826 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 8827 | 8827 | } |
| 8828 | 8828 | |
@@ -8850,28 +8850,28 @@ discard block |
||
| 8850 | 8850 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 8851 | 8851 | { |
| 8852 | 8852 | global $conf, $langs; |
| 8853 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8853 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8854 | 8854 | |
| 8855 | 8855 | // TODO Use an internal dolibarr component instead of select2 |
| 8856 | 8856 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8857 | 8857 | return ''; |
| 8858 | 8858 | } |
| 8859 | 8859 | |
| 8860 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 8860 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 8861 | 8861 | |
| 8862 | 8862 | $outdelayed = ''; |
| 8863 | 8863 | if (!empty($conf->use_javascript_ajax)) { |
| 8864 | 8864 | $tmpplugin = 'select2'; |
| 8865 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8866 | - <script nonce="' . getNonce() . '"> |
|
| 8865 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8866 | + <script nonce="' . getNonce().'"> |
|
| 8867 | 8867 | $(document).ready(function () { |
| 8868 | 8868 | |
| 8869 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 8869 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 8870 | 8870 | |
| 8871 | - $(".' . $htmlname . '").select2({ |
|
| 8871 | + $(".' . $htmlname.'").select2({ |
|
| 8872 | 8872 | ajax: { |
| 8873 | 8873 | dir: "ltr", |
| 8874 | - url: "' . $url . '", |
|
| 8874 | + url: "' . $url.'", |
|
| 8875 | 8875 | dataType: \'json\', |
| 8876 | 8876 | delay: 250, |
| 8877 | 8877 | data: function (params) { |
@@ -8898,9 +8898,9 @@ discard block |
||
| 8898 | 8898 | }, |
| 8899 | 8899 | language: select2arrayoflanguage, |
| 8900 | 8900 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8901 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8901 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8902 | 8902 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8903 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 8903 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 8904 | 8904 | formatResult: function (result, container, query, escapeMarkup) { |
| 8905 | 8905 | return escapeMarkup(result.text); |
| 8906 | 8906 | }, |
@@ -8908,10 +8908,10 @@ discard block |
||
| 8908 | 8908 | |
| 8909 | 8909 | ' . ($callurlonselect ? ' |
| 8910 | 8910 | /* Code to execute a GET when we select a value */ |
| 8911 | - $(".' . $htmlname . '").change(function() { |
|
| 8912 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8911 | + $(".' . $htmlname.'").change(function() { |
|
| 8912 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8913 | 8913 | console.log("We select in selectArrayAjax the entry "+selected) |
| 8914 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8914 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8915 | 8915 | $.each( saveRemoteData, function( key, value ) { |
| 8916 | 8916 | if (key == selected) |
| 8917 | 8917 | { |
@@ -8919,7 +8919,7 @@ discard block |
||
| 8919 | 8919 | location.assign(value.url); |
| 8920 | 8920 | } |
| 8921 | 8921 | }); |
| 8922 | - });' : '') . ' |
|
| 8922 | + });' : '').' |
|
| 8923 | 8923 | |
| 8924 | 8924 | }); |
| 8925 | 8925 | </script>'; |
@@ -8955,14 +8955,14 @@ discard block |
||
| 8955 | 8955 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 8956 | 8956 | { |
| 8957 | 8957 | global $conf, $langs; |
| 8958 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8958 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8959 | 8959 | |
| 8960 | 8960 | // TODO Use an internal dolibarr component instead of select2 |
| 8961 | 8961 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8962 | 8962 | return ''; |
| 8963 | 8963 | } |
| 8964 | 8964 | |
| 8965 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8965 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8966 | 8966 | |
| 8967 | 8967 | $formattedarrayresult = array(); |
| 8968 | 8968 | |
@@ -8977,20 +8977,20 @@ discard block |
||
| 8977 | 8977 | $outdelayed = ''; |
| 8978 | 8978 | if (!empty($conf->use_javascript_ajax)) { |
| 8979 | 8979 | $tmpplugin = 'select2'; |
| 8980 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8981 | - <script nonce="' . getNonce() . '"> |
|
| 8980 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8981 | + <script nonce="' . getNonce().'"> |
|
| 8982 | 8982 | $(document).ready(function () { |
| 8983 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 8983 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 8984 | 8984 | |
| 8985 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 8985 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 8986 | 8986 | |
| 8987 | - $(".' . $htmlname . '").select2({ |
|
| 8987 | + $(".' . $htmlname.'").select2({ |
|
| 8988 | 8988 | data: data, |
| 8989 | 8989 | language: select2arrayoflanguage, |
| 8990 | 8990 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8991 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8991 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8992 | 8992 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8993 | - minimumInputLength: ' . $minimumInputLength . ', |
|
| 8993 | + minimumInputLength: ' . $minimumInputLength.', |
|
| 8994 | 8994 | formatResult: function (result, container, query, escapeMarkup) { |
| 8995 | 8995 | return escapeMarkup(result.text); |
| 8996 | 8996 | }, |
@@ -9029,11 +9029,11 @@ discard block |
||
| 9029 | 9029 | |
| 9030 | 9030 | ' . ($callurlonselect ? ' |
| 9031 | 9031 | /* Code to execute a GET when we select a value */ |
| 9032 | - $(".' . $htmlname . '").change(function() { |
|
| 9033 | - var selected = $(".' . $htmlname . '").val(); |
|
| 9032 | + $(".' . $htmlname.'").change(function() { |
|
| 9033 | + var selected = $(".' . $htmlname.'").val(); |
|
| 9034 | 9034 | console.log("We select "+selected) |
| 9035 | 9035 | |
| 9036 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 9036 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 9037 | 9037 | $.each( saveRemoteData, function( key, value ) { |
| 9038 | 9038 | if (key == selected) |
| 9039 | 9039 | { |
@@ -9041,7 +9041,7 @@ discard block |
||
| 9041 | 9041 | location.assign(value.url); |
| 9042 | 9042 | } |
| 9043 | 9043 | }); |
| 9044 | - });' : '') . ' |
|
| 9044 | + });' : '').' |
|
| 9045 | 9045 | |
| 9046 | 9046 | }); |
| 9047 | 9047 | </script>'; |
@@ -9090,7 +9090,7 @@ discard block |
||
| 9090 | 9090 | $useenhancedmultiselect = 0; |
| 9091 | 9091 | if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 9092 | 9092 | if ($addjscombo) { |
| 9093 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9093 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9094 | 9094 | } |
| 9095 | 9095 | } |
| 9096 | 9096 | |
@@ -9099,7 +9099,7 @@ discard block |
||
| 9099 | 9099 | // submitted to nothing. |
| 9100 | 9100 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
| 9101 | 9101 | // Output select component |
| 9102 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
| 9102 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
| 9103 | 9103 | if (is_array($array) && !empty($array)) { |
| 9104 | 9104 | if ($value_as_key) { |
| 9105 | 9105 | $array = array_combine($array, $array); |
@@ -9120,33 +9120,33 @@ discard block |
||
| 9120 | 9120 | $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml']; |
| 9121 | 9121 | } |
| 9122 | 9122 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 9123 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 9123 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 9124 | 9124 | |
| 9125 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 9125 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 9126 | 9126 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 9127 | 9127 | $out .= ' selected'; |
| 9128 | 9128 | } |
| 9129 | 9129 | if (!empty($tmplabelhtml)) { |
| 9130 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9130 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9131 | 9131 | } else { |
| 9132 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 9133 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9132 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 9133 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9134 | 9134 | } |
| 9135 | 9135 | $out .= '>'; |
| 9136 | 9136 | $out .= dol_htmlentitiesbr($newval); |
| 9137 | - $out .= '</option>' . "\n"; |
|
| 9137 | + $out .= '</option>'."\n"; |
|
| 9138 | 9138 | } |
| 9139 | 9139 | } |
| 9140 | 9140 | } |
| 9141 | - $out .= '</select>' . "\n"; |
|
| 9141 | + $out .= '</select>'."\n"; |
|
| 9142 | 9142 | |
| 9143 | 9143 | // Add code for jquery to use multiselect |
| 9144 | 9144 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 9145 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 9146 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 9145 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 9146 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 9147 | 9147 | if ($addjscombo == 1) { |
| 9148 | 9148 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 9149 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 9149 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 9150 | 9150 | // If property data-html set, we decode html entities and use this. |
| 9151 | 9151 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 9152 | 9152 | $out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
@@ -9154,26 +9154,26 @@ discard block |
||
| 9154 | 9154 | $out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
| 9155 | 9155 | $out .= ' }'."\n"; |
| 9156 | 9156 | $out .= ' return record.text;'; |
| 9157 | - $out .= '}' . "\n"; |
|
| 9158 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 9157 | + $out .= '}'."\n"; |
|
| 9158 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 9159 | 9159 | if ($elemtype == 'category') { |
| 9160 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9160 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9161 | 9161 | } else { |
| 9162 | 9162 | $out .= 'return record.text;'; |
| 9163 | 9163 | } |
| 9164 | - $out .= '}' . "\n"; |
|
| 9164 | + $out .= '}'."\n"; |
|
| 9165 | 9165 | $out .= '$(document).ready(function () { |
| 9166 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
| 9166 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
| 9167 | 9167 | if ($placeholder) { |
| 9168 | 9168 | $out .= ' |
| 9169 | 9169 | placeholder: { |
| 9170 | 9170 | id: \'-1\', |
| 9171 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 9171 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 9172 | 9172 | },'; |
| 9173 | 9173 | } |
| 9174 | 9174 | $out .= ' dir: \'ltr\', |
| 9175 | 9175 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 9176 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9176 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9177 | 9177 | // Specify format function for dropdown item |
| 9178 | 9178 | formatResult: formatResult, |
| 9179 | 9179 | templateResult: formatResult, /* For 4.0 */ |
@@ -9185,21 +9185,21 @@ discard block |
||
| 9185 | 9185 | |
| 9186 | 9186 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 9187 | 9187 | the size only if component is not hidden by default on load */ |
| 9188 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
| 9188 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
| 9189 | 9189 | });' . "\n"; |
| 9190 | 9190 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 9191 | 9191 | // Add other js lib |
| 9192 | 9192 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 9193 | 9193 | // ... |
| 9194 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
| 9194 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
| 9195 | 9195 | $out .= '$(document).ready(function () { |
| 9196 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
| 9196 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
| 9197 | 9197 | containerHTML: \'<div class="multi-select-container">\', |
| 9198 | 9198 | menuHTML: \'<div class="multi-select-menu">\', |
| 9199 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
| 9199 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
| 9200 | 9200 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 9201 | 9201 | activeClass: \'multi-select-container--open\', |
| 9202 | - noneText: \'' . $placeholder . '\' |
|
| 9202 | + noneText: \'' . $placeholder.'\' |
|
| 9203 | 9203 | }); |
| 9204 | 9204 | })'; |
| 9205 | 9205 | } |
@@ -9232,7 +9232,7 @@ discard block |
||
| 9232 | 9232 | return ''; |
| 9233 | 9233 | } |
| 9234 | 9234 | |
| 9235 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 9235 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 9236 | 9236 | |
| 9237 | 9237 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 9238 | 9238 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -9275,19 +9275,19 @@ discard block |
||
| 9275 | 9275 | } |
| 9276 | 9276 | |
| 9277 | 9277 | // Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 9278 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
| 9279 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 9278 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
| 9279 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 9280 | 9280 | } |
| 9281 | 9281 | } |
| 9282 | 9282 | |
| 9283 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 9283 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 9284 | 9284 | |
| 9285 | 9285 | <dl class="dropdown"> |
| 9286 | 9286 | <dt> |
| 9287 | - <a href="#' . $htmlname . '"> |
|
| 9288 | - ' . img_picto('', 'list') . ' |
|
| 9287 | + <a href="#' . $htmlname.'"> |
|
| 9288 | + ' . img_picto('', 'list').' |
|
| 9289 | 9289 | </a> |
| 9290 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 9290 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 9291 | 9291 | </dt> |
| 9292 | 9292 | <dd class="dropdowndd"> |
| 9293 | 9293 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9299,19 +9299,19 @@ discard block |
||
| 9299 | 9299 | </dd> |
| 9300 | 9300 | </dl> |
| 9301 | 9301 | |
| 9302 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 9302 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 9303 | 9303 | jQuery(document).ready(function () { |
| 9304 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9304 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9305 | 9305 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 9306 | 9306 | |
| 9307 | 9307 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 9308 | 9308 | |
| 9309 | 9309 | var title = $(this).val() + ","; |
| 9310 | 9310 | if ($(this).is(\':checked\')) { |
| 9311 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 9311 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 9312 | 9312 | } |
| 9313 | 9313 | else { |
| 9314 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 9314 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 9315 | 9315 | } |
| 9316 | 9316 | // Now, we submit page |
| 9317 | 9317 | //$(this).parents(\'form:first\').submit(); |
@@ -9342,7 +9342,7 @@ discard block |
||
| 9342 | 9342 | */ |
| 9343 | 9343 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 9344 | 9344 | { |
| 9345 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 9345 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 9346 | 9346 | |
| 9347 | 9347 | $cat = new Categorie($this->db); |
| 9348 | 9348 | $categories = $cat->containing($id, $type); |
@@ -9352,13 +9352,13 @@ discard block |
||
| 9352 | 9352 | foreach ($categories as $c) { |
| 9353 | 9353 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 9354 | 9354 | foreach ($ways as $way) { |
| 9355 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 9355 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 9356 | 9356 | } |
| 9357 | 9357 | } |
| 9358 | 9358 | if (empty($toprint)) { |
| 9359 | 9359 | return ''; |
| 9360 | 9360 | } else { |
| 9361 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 9361 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 9362 | 9362 | } |
| 9363 | 9363 | } |
| 9364 | 9364 | |
@@ -9407,15 +9407,15 @@ discard block |
||
| 9407 | 9407 | |
| 9408 | 9408 | |
| 9409 | 9409 | print '<div class="div-table-responsive-no-min">'; |
| 9410 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 9410 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 9411 | 9411 | |
| 9412 | 9412 | print '<tr class="liste_titre">'; |
| 9413 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 9414 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9413 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 9414 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9415 | 9415 | print '<td class="center"></td>'; |
| 9416 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 9417 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9418 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 9416 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 9417 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9418 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 9419 | 9419 | print '<td></td>'; |
| 9420 | 9420 | print '</tr>'; |
| 9421 | 9421 | |
@@ -9434,13 +9434,13 @@ discard block |
||
| 9434 | 9434 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 9435 | 9435 | $element = $regs[1]; |
| 9436 | 9436 | $subelement = $regs[2]; |
| 9437 | - $tplpath = $element . '/' . $subelement; |
|
| 9437 | + $tplpath = $element.'/'.$subelement; |
|
| 9438 | 9438 | } |
| 9439 | 9439 | $tplname = 'linkedobjectblock'; |
| 9440 | 9440 | |
| 9441 | 9441 | // To work with non standard path |
| 9442 | 9442 | if ($objecttype == 'facture') { |
| 9443 | - $tplpath = 'compta/' . $element; |
|
| 9443 | + $tplpath = 'compta/'.$element; |
|
| 9444 | 9444 | if (!isModEnabled('invoice')) { |
| 9445 | 9445 | continue; // Do not show if module disabled |
| 9446 | 9446 | } |
@@ -9451,7 +9451,7 @@ discard block |
||
| 9451 | 9451 | continue; // Do not show if module disabled |
| 9452 | 9452 | } |
| 9453 | 9453 | } elseif ($objecttype == 'propal') { |
| 9454 | - $tplpath = 'comm/' . $element; |
|
| 9454 | + $tplpath = 'comm/'.$element; |
|
| 9455 | 9455 | if (!isModEnabled('propal')) { |
| 9456 | 9456 | continue; // Do not show if module disabled |
| 9457 | 9457 | } |
@@ -9504,7 +9504,7 @@ discard block |
||
| 9504 | 9504 | $linkedObjectBlock = $objects; |
| 9505 | 9505 | |
| 9506 | 9506 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9507 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9507 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9508 | 9508 | foreach ($dirtpls as $reldir) { |
| 9509 | 9509 | $reldir = rtrim($reldir, '/'); |
| 9510 | 9510 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9512,7 +9512,7 @@ discard block |
||
| 9512 | 9512 | $noMoreLinkedObjectBlockAfter = 1; |
| 9513 | 9513 | } |
| 9514 | 9514 | |
| 9515 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9515 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9516 | 9516 | if ($res) { |
| 9517 | 9517 | $nboftypesoutput++; |
| 9518 | 9518 | break; |
@@ -9521,7 +9521,7 @@ discard block |
||
| 9521 | 9521 | } |
| 9522 | 9522 | |
| 9523 | 9523 | if (!$nboftypesoutput) { |
| 9524 | - print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9524 | + print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9525 | 9525 | } |
| 9526 | 9526 | |
| 9527 | 9527 | print '</table>'; |
@@ -9567,14 +9567,14 @@ discard block |
||
| 9567 | 9567 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9568 | 9568 | $listofidcompanytoscan = $object->thirdparty->id; |
| 9569 | 9569 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
| 9570 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
| 9570 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
| 9571 | 9571 | } |
| 9572 | 9572 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
| 9573 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9573 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9574 | 9574 | $tmpproject = new Project($this->db); |
| 9575 | 9575 | $tmpproject->fetch($object->fk_project); |
| 9576 | 9576 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9577 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
| 9577 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
| 9578 | 9578 | } |
| 9579 | 9579 | unset($tmpproject); |
| 9580 | 9580 | } |
@@ -9584,63 +9584,63 @@ discard block |
||
| 9584 | 9584 | 'enabled' => isModEnabled('propal'), |
| 9585 | 9585 | 'perms' => 1, |
| 9586 | 9586 | 'label' => 'LinkToProposal', |
| 9587 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')), |
|
| 9587 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')), |
|
| 9588 | 9588 | 'shipping' => array( |
| 9589 | 9589 | 'enabled' => isModEnabled('shipping'), |
| 9590 | 9590 | 'perms' => 1, |
| 9591 | 9591 | 'label' => 'LinkToExpedition', |
| 9592 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : '')), |
|
| 9592 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : '')), |
|
| 9593 | 9593 | 'order' => array( |
| 9594 | 9594 | 'enabled' => isModEnabled('order'), |
| 9595 | 9595 | 'perms' => 1, |
| 9596 | 9596 | 'label' => 'LinkToOrder', |
| 9597 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : '')), |
|
| 9597 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : '')), |
|
| 9598 | 9598 | 'invoice' => array( |
| 9599 | 9599 | 'enabled' => isModEnabled('invoice'), |
| 9600 | 9600 | 'perms' => 1, |
| 9601 | 9601 | 'label' => 'LinkToInvoice', |
| 9602 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), |
|
| 9602 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), |
|
| 9603 | 9603 | 'invoice_template' => array( |
| 9604 | 9604 | 'enabled' => isModEnabled('invoice'), |
| 9605 | 9605 | 'perms' => 1, |
| 9606 | 9606 | 'label' => 'LinkToTemplateInvoice', |
| 9607 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), |
|
| 9607 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), |
|
| 9608 | 9608 | 'contrat' => array( |
| 9609 | 9609 | 'enabled' => isModEnabled('contract'), |
| 9610 | 9610 | 'perms' => 1, |
| 9611 | 9611 | 'label' => 'LinkToContract', |
| 9612 | 9612 | '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 |
| 9613 | - 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' |
|
| 9613 | + 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' |
|
| 9614 | 9614 | ), |
| 9615 | 9615 | 'fichinter' => array( |
| 9616 | 9616 | 'enabled' => isModEnabled('intervention'), |
| 9617 | 9617 | 'perms' => 1, |
| 9618 | 9618 | 'label' => 'LinkToIntervention', |
| 9619 | - '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') . ')'), |
|
| 9619 | + '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').')'), |
|
| 9620 | 9620 | 'supplier_proposal' => array( |
| 9621 | 9621 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9622 | 9622 | 'perms' => 1, |
| 9623 | 9623 | 'label' => 'LinkToSupplierProposal', |
| 9624 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')), |
|
| 9624 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : '')), |
|
| 9625 | 9625 | 'order_supplier' => array( |
| 9626 | 9626 | 'enabled' => isModEnabled("supplier_order"), |
| 9627 | 9627 | 'perms' => 1, |
| 9628 | 9628 | 'label' => 'LinkToSupplierOrder', |
| 9629 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : '')), |
|
| 9629 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : '')), |
|
| 9630 | 9630 | 'invoice_supplier' => array( |
| 9631 | 9631 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9632 | 9632 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9633 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), |
|
| 9633 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : '')), |
|
| 9634 | 9634 | 'ticket' => array( |
| 9635 | 9635 | 'enabled' => isModEnabled('ticket'), |
| 9636 | 9636 | 'perms' => 1, |
| 9637 | 9637 | 'label' => 'LinkToTicket', |
| 9638 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : '')), |
|
| 9638 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : '')), |
|
| 9639 | 9639 | 'mo' => array( |
| 9640 | 9640 | 'enabled' => isModEnabled('mrp'), |
| 9641 | 9641 | 'perms' => 1, |
| 9642 | 9642 | 'label' => 'LinkToMo', |
| 9643 | - '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') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : '')) |
|
| 9643 | + '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').')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : '')) |
|
| 9644 | 9644 | ); |
| 9645 | 9645 | } |
| 9646 | 9646 | |
@@ -9678,23 +9678,23 @@ discard block |
||
| 9678 | 9678 | } |
| 9679 | 9679 | |
| 9680 | 9680 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9681 | - $htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9681 | + $htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9682 | 9682 | |
| 9683 | 9683 | // Section for free ref input |
| 9684 | 9684 | if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
| 9685 | 9685 | $htmltoenteralink .= '<br>'."\n"; |
| 9686 | 9686 | $htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n"; |
| 9687 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9688 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9687 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9688 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9689 | 9689 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9690 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9691 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9690 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9691 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9692 | 9692 | $htmltoenteralink .= '<table class="noborder">'; |
| 9693 | 9693 | $htmltoenteralink .= '<tr>'; |
| 9694 | 9694 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9695 | - $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9696 | - $htmltoenteralink .= '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9697 | - $htmltoenteralink .= '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9695 | + $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9696 | + $htmltoenteralink .= '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9697 | + $htmltoenteralink .= '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9698 | 9698 | $htmltoenteralink .= '</tr>'; |
| 9699 | 9699 | $htmltoenteralink .= '</table>'; |
| 9700 | 9700 | $htmltoenteralink .= '</form>'; |
@@ -9711,47 +9711,47 @@ discard block |
||
| 9711 | 9711 | // Section for free predefined list |
| 9712 | 9712 | $htmltoenteralink .= '<br>'; |
| 9713 | 9713 | $htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9714 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9714 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9715 | 9715 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlink">'; |
| 9716 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9717 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9718 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9716 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9717 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9718 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9719 | 9719 | $htmltoenteralink .= '<table class="noborder">'; |
| 9720 | 9720 | $htmltoenteralink .= '<tr class="liste_titre">'; |
| 9721 | 9721 | $htmltoenteralink .= '<td class="nowrap"></td>'; |
| 9722 | - $htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9723 | - $htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9724 | - $htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9725 | - $htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>'; |
|
| 9722 | + $htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9723 | + $htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>'; |
|
| 9724 | + $htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9725 | + $htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>'; |
|
| 9726 | 9726 | $htmltoenteralink .= '</tr>'; |
| 9727 | 9727 | while ($i < $num) { |
| 9728 | 9728 | $objp = $this->db->fetch_object($resqllist); |
| 9729 | 9729 | |
| 9730 | 9730 | $htmltoenteralink .= '<tr class="oddeven">'; |
| 9731 | 9731 | $htmltoenteralink .= '<td>'; |
| 9732 | - $htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9732 | + $htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9733 | 9733 | $htmltoenteralink .= '</td>'; |
| 9734 | - $htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9735 | - $htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9734 | + $htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9735 | + $htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9736 | 9736 | $htmltoenteralink .= '<td class="right">'; |
| 9737 | 9737 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9738 | - $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9738 | + $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9739 | 9739 | } |
| 9740 | - $htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9740 | + $htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9741 | 9741 | $htmltoenteralink .= '</td>'; |
| 9742 | - $htmltoenteralink .= '<td>' . $objp->name . '</td>'; |
|
| 9742 | + $htmltoenteralink .= '<td>'.$objp->name.'</td>'; |
|
| 9743 | 9743 | $htmltoenteralink .= '</tr>'; |
| 9744 | 9744 | $i++; |
| 9745 | 9745 | } |
| 9746 | 9746 | $htmltoenteralink .= '</table>'; |
| 9747 | 9747 | $htmltoenteralink .= '<div class="center">'; |
| 9748 | 9748 | if ($num) { |
| 9749 | - $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
| 9749 | + $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
| 9750 | 9750 | } |
| 9751 | 9751 | if (empty($conf->use_javascript_ajax)) { |
| 9752 | - $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9752 | + $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9753 | 9753 | } else { |
| 9754 | - $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9754 | + $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9755 | 9755 | } |
| 9756 | 9756 | $htmltoenteralink .= '</form>'; |
| 9757 | 9757 | } |
@@ -9765,10 +9765,10 @@ discard block |
||
| 9765 | 9765 | |
| 9766 | 9766 | // Complete the list for the combo box |
| 9767 | 9767 | if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
| 9768 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 9768 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 9769 | 9769 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 9770 | 9770 | } else { |
| 9771 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 9771 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 9772 | 9772 | } |
| 9773 | 9773 | } |
| 9774 | 9774 | } |
@@ -9778,11 +9778,11 @@ discard block |
||
| 9778 | 9778 | <dl class="dropdown" id="linktoobjectname"> |
| 9779 | 9779 | '; |
| 9780 | 9780 | if (!empty($conf->use_javascript_ajax)) { |
| 9781 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 9781 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 9782 | 9782 | } |
| 9783 | 9783 | $linktoelem .= '<dd> |
| 9784 | 9784 | <div class="multiselectlinkto"> |
| 9785 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 9785 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 9786 | 9786 | </ul> |
| 9787 | 9787 | </div> |
| 9788 | 9788 | </dd> |
@@ -9793,7 +9793,7 @@ discard block |
||
| 9793 | 9793 | |
| 9794 | 9794 | if (!empty($conf->use_javascript_ajax)) { |
| 9795 | 9795 | print '<!-- Add js to show linkto box --> |
| 9796 | - <script nonce="' . getNonce() . '"> |
|
| 9796 | + <script nonce="' . getNonce().'"> |
|
| 9797 | 9797 | jQuery(document).ready(function() { |
| 9798 | 9798 | jQuery(".linkto").click(function() { |
| 9799 | 9799 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9840,19 +9840,19 @@ discard block |
||
| 9840 | 9840 | |
| 9841 | 9841 | $disabled = ($disabled ? ' disabled' : ''); |
| 9842 | 9842 | |
| 9843 | - $resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 9843 | + $resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 9844 | 9844 | if ($useempty) { |
| 9845 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9845 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 9846 | 9846 | } |
| 9847 | 9847 | if (("$value" == 'yes') || ($value == 1)) { |
| 9848 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9849 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9848 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9849 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9850 | 9850 | } else { |
| 9851 | 9851 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 9852 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9853 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9852 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9853 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9854 | 9854 | } |
| 9855 | - $resultyesno .= '</select>' . "\n"; |
|
| 9855 | + $resultyesno .= '</select>'."\n"; |
|
| 9856 | 9856 | |
| 9857 | 9857 | if ($addjscombo) { |
| 9858 | 9858 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9876,12 +9876,12 @@ discard block |
||
| 9876 | 9876 | { |
| 9877 | 9877 | // phpcs:enable |
| 9878 | 9878 | $sql = "SELECT rowid, label"; |
| 9879 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 9880 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 9879 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 9880 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 9881 | 9881 | $sql .= " ORDER BY rowid"; |
| 9882 | 9882 | $result = $this->db->query($sql); |
| 9883 | 9883 | if ($result) { |
| 9884 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 9884 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 9885 | 9885 | if ($useempty) { |
| 9886 | 9886 | print '<option value="-1"> </option>'; |
| 9887 | 9887 | } |
@@ -9891,9 +9891,9 @@ discard block |
||
| 9891 | 9891 | while ($i < $num) { |
| 9892 | 9892 | $obj = $this->db->fetch_object($result); |
| 9893 | 9893 | if ($selected == $obj->rowid) { |
| 9894 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 9894 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 9895 | 9895 | } else { |
| 9896 | - print '<option value="' . $obj->rowid . '">'; |
|
| 9896 | + print '<option value="'.$obj->rowid.'">'; |
|
| 9897 | 9897 | } |
| 9898 | 9898 | print $obj->label; |
| 9899 | 9899 | print '</option>'; |
@@ -9984,8 +9984,8 @@ discard block |
||
| 9984 | 9984 | $stringforfirstkey .= ' CTL +'; |
| 9985 | 9985 | } |
| 9986 | 9986 | |
| 9987 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" 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>'; |
|
| 9988 | - $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" 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>'; |
|
| 9987 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" 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>'; |
|
| 9988 | + $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" 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>'; |
|
| 9989 | 9989 | } |
| 9990 | 9990 | |
| 9991 | 9991 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9993,18 +9993,18 @@ discard block |
||
| 9993 | 9993 | |
| 9994 | 9994 | // Right part of banner |
| 9995 | 9995 | if ($morehtmlright) { |
| 9996 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 9996 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 9997 | 9997 | } |
| 9998 | 9998 | |
| 9999 | 9999 | if ($previous_ref || $next_ref || $morehtml) { |
| 10000 | 10000 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 10001 | 10001 | } |
| 10002 | 10002 | if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { |
| 10003 | - $ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 10003 | + $ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 10004 | 10004 | } |
| 10005 | 10005 | if ($shownav && ($previous_ref || $next_ref)) { |
| 10006 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 10007 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 10006 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 10007 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 10008 | 10008 | } |
| 10009 | 10009 | if ($previous_ref || $next_ref || $morehtml) { |
| 10010 | 10010 | $ret .= '</ul></div>'; |
@@ -10019,7 +10019,7 @@ discard block |
||
| 10019 | 10019 | $morehtmlstatus = $hookmanager->resPrint; |
| 10020 | 10020 | } |
| 10021 | 10021 | if ($morehtmlstatus) { |
| 10022 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 10022 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 10023 | 10023 | } |
| 10024 | 10024 | |
| 10025 | 10025 | $parameters = array(); |
@@ -10033,14 +10033,14 @@ discard block |
||
| 10033 | 10033 | // Left part of banner |
| 10034 | 10034 | if ($morehtmlleft) { |
| 10035 | 10035 | if ($conf->browser->layout == 'phone') { |
| 10036 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 10036 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 10037 | 10037 | } else { |
| 10038 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 10038 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 10039 | 10039 | } |
| 10040 | 10040 | } |
| 10041 | 10041 | |
| 10042 | 10042 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 10043 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 10043 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 10044 | 10044 | |
| 10045 | 10045 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 10046 | 10046 | if ($object->element == 'societe') { |
@@ -10054,7 +10054,7 @@ discard block |
||
| 10054 | 10054 | |
| 10055 | 10055 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 10056 | 10056 | if (!is_object($extralanguages)) { |
| 10057 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 10057 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 10058 | 10058 | $extralanguages = new ExtraLanguages($this->db); |
| 10059 | 10059 | } |
| 10060 | 10060 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -10069,29 +10069,29 @@ discard block |
||
| 10069 | 10069 | if ($object->array_languages['name'][$extralangcode]) { |
| 10070 | 10070 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 10071 | 10071 | } else { |
| 10072 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 10072 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 10073 | 10073 | } |
| 10074 | 10074 | } |
| 10075 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 10075 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 10076 | 10076 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 10077 | 10077 | } |
| 10078 | 10078 | } |
| 10079 | 10079 | } elseif ($object->element == 'member') { |
| 10080 | 10080 | '@phan-var-force Adherent $object'; |
| 10081 | - $ret .= $object->ref . '<br>'; |
|
| 10081 | + $ret .= $object->ref.'<br>'; |
|
| 10082 | 10082 | $fullname = $object->getFullName($langs); |
| 10083 | 10083 | if ($object->morphy == 'mor' && $object->societe) { |
| 10084 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 10084 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 10085 | 10085 | } else { |
| 10086 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 10086 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 10087 | 10087 | } |
| 10088 | 10088 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 10089 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
| 10089 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
| 10090 | 10090 | } elseif ($object->element == 'usergroup') { |
| 10091 | 10091 | $ret .= dol_htmlentities($object->name); |
| 10092 | 10092 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 10093 | 10093 | '@phan-var-force ActionComm $object'; |
| 10094 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 10094 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 10095 | 10095 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 10096 | 10096 | $ret .= $object->label; |
| 10097 | 10097 | } elseif ($object->element == 'ecm_directories') { |
@@ -10144,9 +10144,9 @@ discard block |
||
| 10144 | 10144 | } |
| 10145 | 10145 | |
| 10146 | 10146 | // Barcode image @phan-suppress-next-line PhanUndeclaredProperty |
| 10147 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 10148 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 10149 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 10147 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 10148 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 10149 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 10150 | 10150 | |
| 10151 | 10151 | return $out; |
| 10152 | 10152 | } |
@@ -10173,7 +10173,7 @@ discard block |
||
| 10173 | 10173 | global $conf, $langs; |
| 10174 | 10174 | |
| 10175 | 10175 | $entity = (empty($object->entity) ? $conf->entity : $object->entity); |
| 10176 | - $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10176 | + $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10177 | 10177 | |
| 10178 | 10178 | $dir = ''; |
| 10179 | 10179 | $file = ''; |
@@ -10186,28 +10186,28 @@ discard block |
||
| 10186 | 10186 | if (!empty($object->logo)) { |
| 10187 | 10187 | if (dolIsAllowedForPreview($object->logo)) { |
| 10188 | 10188 | if ((string) $imagesize == 'mini') { |
| 10189 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10189 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10190 | 10190 | } elseif ((string) $imagesize == 'small') { |
| 10191 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 10191 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 10192 | 10192 | } else { |
| 10193 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10193 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10194 | 10194 | } |
| 10195 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10195 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10196 | 10196 | } |
| 10197 | 10197 | } |
| 10198 | 10198 | $email = $object->email; |
| 10199 | 10199 | } elseif ($modulepart == 'contact') { |
| 10200 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 10200 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 10201 | 10201 | if (!empty($object->photo)) { |
| 10202 | 10202 | if (dolIsAllowedForPreview($object->photo)) { |
| 10203 | 10203 | if ((string) $imagesize == 'mini') { |
| 10204 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10204 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10205 | 10205 | } elseif ((string) $imagesize == 'small') { |
| 10206 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10206 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10207 | 10207 | } else { |
| 10208 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10208 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10209 | 10209 | } |
| 10210 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10210 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10211 | 10211 | } |
| 10212 | 10212 | } |
| 10213 | 10213 | $email = $object->email; |
@@ -10217,17 +10217,17 @@ discard block |
||
| 10217 | 10217 | if (!empty($object->photo)) { |
| 10218 | 10218 | if (dolIsAllowedForPreview($object->photo)) { |
| 10219 | 10219 | if ((string) $imagesize == 'mini') { |
| 10220 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10220 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10221 | 10221 | } elseif ((string) $imagesize == 'small') { |
| 10222 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10222 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10223 | 10223 | } else { |
| 10224 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10224 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10225 | 10225 | } |
| 10226 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10226 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10227 | 10227 | } |
| 10228 | 10228 | } |
| 10229 | 10229 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10230 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10230 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10231 | 10231 | } |
| 10232 | 10232 | $email = $object->email; |
| 10233 | 10233 | $capture = 'user'; |
@@ -10236,17 +10236,17 @@ discard block |
||
| 10236 | 10236 | if (!empty($object->photo)) { |
| 10237 | 10237 | if (dolIsAllowedForPreview($object->photo)) { |
| 10238 | 10238 | if ((string) $imagesize == 'mini') { |
| 10239 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10239 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10240 | 10240 | } elseif ((string) $imagesize == 'small') { |
| 10241 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10241 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10242 | 10242 | } else { |
| 10243 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10243 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10244 | 10244 | } |
| 10245 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10245 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10246 | 10246 | } |
| 10247 | 10247 | } |
| 10248 | 10248 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10249 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10249 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10250 | 10250 | } |
| 10251 | 10251 | $email = $object->email; |
| 10252 | 10252 | $capture = 'user'; |
@@ -10272,35 +10272,35 @@ discard block |
||
| 10272 | 10272 | $ret = ''; |
| 10273 | 10273 | |
| 10274 | 10274 | if ($dir) { |
| 10275 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 10275 | + if ($file && file_exists($dir."/".$file)) { |
|
| 10276 | 10276 | if ($addlinktofullsize) { |
| 10277 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10277 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10278 | 10278 | if ($urladvanced) { |
| 10279 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10279 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10280 | 10280 | } else { |
| 10281 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10281 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10282 | 10282 | } |
| 10283 | 10283 | } |
| 10284 | - $ret .= '<img alt="" 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 . '">'; |
|
| 10284 | + $ret .= '<img alt="" 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.'">'; |
|
| 10285 | 10285 | if ($addlinktofullsize) { |
| 10286 | 10286 | $ret .= '</a>'; |
| 10287 | 10287 | } |
| 10288 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 10288 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 10289 | 10289 | if ($addlinktofullsize) { |
| 10290 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10290 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10291 | 10291 | if ($urladvanced) { |
| 10292 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10292 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10293 | 10293 | } else { |
| 10294 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10294 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10295 | 10295 | } |
| 10296 | 10296 | } |
| 10297 | - $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 . '">'; |
|
| 10297 | + $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.'">'; |
|
| 10298 | 10298 | if ($addlinktofullsize) { |
| 10299 | 10299 | $ret .= '</a>'; |
| 10300 | 10300 | } |
| 10301 | 10301 | } else { |
| 10302 | 10302 | $nophoto = '/public/theme/common/nophoto.png'; |
| 10303 | - $defaultimg = 'identicon'; // For gravatar |
|
| 10303 | + $defaultimg = 'identicon'; // For gravatar |
|
| 10304 | 10304 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 10305 | 10305 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) { |
| 10306 | 10306 | $nophoto = 'company'; |
@@ -10318,13 +10318,13 @@ discard block |
||
| 10318 | 10318 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 10319 | 10319 | // see https://gravatar.com/site/implement/images/php/ |
| 10320 | 10320 | $ret .= '<!-- Put link to gravatar -->'; |
| 10321 | - $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 |
|
| 10321 | + $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 |
|
| 10322 | 10322 | } else { |
| 10323 | 10323 | if ($nophoto == 'company') { |
| 10324 | - $ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 10324 | + $ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 10325 | 10325 | //$ret .= '<div class="difforspanimgright"></div>'; |
| 10326 | 10326 | } else { |
| 10327 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 10327 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 10328 | 10328 | } |
| 10329 | 10329 | } |
| 10330 | 10330 | } |
@@ -10335,15 +10335,15 @@ discard block |
||
| 10335 | 10335 | } |
| 10336 | 10336 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 10337 | 10337 | if ($object->photo) { |
| 10338 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 10338 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 10339 | 10339 | } |
| 10340 | 10340 | $ret .= '<tr><td class="tdoverflow">'; |
| 10341 | 10341 | $maxfilesizearray = getMaxFileSizeArray(); |
| 10342 | 10342 | $maxmin = $maxfilesizearray['maxmin']; |
| 10343 | 10343 | if ($maxmin > 0) { |
| 10344 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10344 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10345 | 10345 | } |
| 10346 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 10346 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 10347 | 10347 | $ret .= '</td></tr>'; |
| 10348 | 10348 | $ret .= '</table>'; |
| 10349 | 10349 | } |
@@ -10397,38 +10397,38 @@ discard block |
||
| 10397 | 10397 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10398 | 10398 | $sql .= ", e.label"; |
| 10399 | 10399 | } |
| 10400 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 10400 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 10401 | 10401 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10402 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 10402 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 10403 | 10403 | if ($force_entity) { |
| 10404 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 10404 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 10405 | 10405 | } else { |
| 10406 | 10406 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 10407 | 10407 | } |
| 10408 | 10408 | } else { |
| 10409 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 10409 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 10410 | 10410 | } |
| 10411 | 10411 | if (is_array($exclude) && $excludeGroups) { |
| 10412 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 10412 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 10413 | 10413 | } |
| 10414 | 10414 | if (is_array($include) && $includeGroups) { |
| 10415 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 10415 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 10416 | 10416 | } |
| 10417 | 10417 | $sql .= " ORDER BY ug.nom ASC"; |
| 10418 | 10418 | |
| 10419 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 10419 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 10420 | 10420 | $resql = $this->db->query($sql); |
| 10421 | 10421 | if ($resql) { |
| 10422 | 10422 | // Enhance with select2 |
| 10423 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10423 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10424 | 10424 | |
| 10425 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 10425 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 10426 | 10426 | |
| 10427 | 10427 | $num = $this->db->num_rows($resql); |
| 10428 | 10428 | $i = 0; |
| 10429 | 10429 | if ($num) { |
| 10430 | 10430 | if ($show_empty && !$multiple) { |
| 10431 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10431 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 10432 | 10432 | } |
| 10433 | 10433 | |
| 10434 | 10434 | while ($i < $num) { |
@@ -10441,11 +10441,11 @@ discard block |
||
| 10441 | 10441 | $label = $obj->name; |
| 10442 | 10442 | $labelhtml = $obj->name; |
| 10443 | 10443 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 10444 | - $label .= " (" . $obj->label . ")"; |
|
| 10445 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
| 10444 | + $label .= " (".$obj->label.")"; |
|
| 10445 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
| 10446 | 10446 | } |
| 10447 | 10447 | |
| 10448 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 10448 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 10449 | 10449 | if ($disableline) { |
| 10450 | 10450 | $out .= ' disabled'; |
| 10451 | 10451 | } |
@@ -10461,9 +10461,9 @@ discard block |
||
| 10461 | 10461 | } |
| 10462 | 10462 | } else { |
| 10463 | 10463 | if ($show_empty) { |
| 10464 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 10464 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 10465 | 10465 | } |
| 10466 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 10466 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 10467 | 10467 | } |
| 10468 | 10468 | $out .= '</select>'; |
| 10469 | 10469 | |
@@ -10507,25 +10507,25 @@ discard block |
||
| 10507 | 10507 | $out = ''; |
| 10508 | 10508 | |
| 10509 | 10509 | if (!empty($conf->use_javascript_ajax)) { |
| 10510 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10510 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10511 | 10511 | } |
| 10512 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10512 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10513 | 10513 | $(document).ready(function() { |
| 10514 | - $("#' . $cssclass . 's").click(function() { |
|
| 10514 | + $("#' . $cssclass.'s").click(function() { |
|
| 10515 | 10515 | if($(this).is(\':checked\')){ |
| 10516 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10517 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10516 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10517 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10518 | 10518 | } |
| 10519 | 10519 | else |
| 10520 | 10520 | { |
| 10521 | 10521 | console.log("We uncheck all"); |
| 10522 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10522 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10523 | 10523 | }' . "\n"; |
| 10524 | 10524 | if ($calljsfunction) { |
| 10525 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10525 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10526 | 10526 | } |
| 10527 | 10527 | $out .= ' }); |
| 10528 | - $(".' . $cssclass . '").change(function() { |
|
| 10528 | + $(".' . $cssclass.'").change(function() { |
|
| 10529 | 10529 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10530 | 10530 | }); |
| 10531 | 10531 | }); |
@@ -10570,67 +10570,67 @@ discard block |
||
| 10570 | 10570 | global $langs, $user; |
| 10571 | 10571 | |
| 10572 | 10572 | $out = ''; |
| 10573 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10574 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10573 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10574 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10575 | 10575 | if (!empty($excludeid)) { |
| 10576 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10576 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10577 | 10577 | } |
| 10578 | 10578 | $sql .= " ORDER BY label"; |
| 10579 | 10579 | |
| 10580 | 10580 | $resql = $this->db->query($sql); |
| 10581 | 10581 | if ($resql) { |
| 10582 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10582 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10583 | 10583 | if ($useempty) { |
| 10584 | 10584 | $out .= '<option value="0"> </option>'; |
| 10585 | 10585 | } |
| 10586 | 10586 | |
| 10587 | 10587 | while ($obj = $this->db->fetch_object($resql)) { |
| 10588 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10588 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10589 | 10589 | } |
| 10590 | 10590 | $out .= '</select>'; |
| 10591 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10591 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10592 | 10592 | |
| 10593 | 10593 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10594 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10594 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10595 | 10595 | } |
| 10596 | 10596 | |
| 10597 | 10597 | if (!empty($target)) { |
| 10598 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10598 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10599 | 10599 | $resql = $this->db->query($sql); |
| 10600 | 10600 | if ($resql) { |
| 10601 | 10601 | if ($this->db->num_rows($resql) > 0) { |
| 10602 | 10602 | $obj = $this->db->fetch_object($resql); |
| 10603 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10603 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10604 | 10604 | $(function() { |
| 10605 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10605 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10606 | 10606 | var current_val = $(this).val(); |
| 10607 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10607 | + if (current_val == ' . $obj->id.') {'; |
|
| 10608 | 10608 | if (!empty($default_selected) || !empty($selected)) { |
| 10609 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10609 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10610 | 10610 | } |
| 10611 | 10611 | |
| 10612 | 10612 | $out .= ' |
| 10613 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10613 | + $("select[name=' . $htmlname.']").change(); |
|
| 10614 | 10614 | } |
| 10615 | 10615 | }); |
| 10616 | 10616 | |
| 10617 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10617 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10618 | 10618 | |
| 10619 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10619 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10620 | 10620 | // get price of kilometer to fill the unit price |
| 10621 | 10621 | $.ajax({ |
| 10622 | 10622 | method: "POST", |
| 10623 | 10623 | dataType: "json", |
| 10624 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10625 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
| 10624 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10625 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
| 10626 | 10626 | }).done(function( data, textStatus, jqXHR ) { |
| 10627 | 10627 | console.log(data); |
| 10628 | 10628 | if (typeof data.up != "undefined") { |
| 10629 | 10629 | $("input[name=value_unit]").val(data.up); |
| 10630 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10630 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10631 | 10631 | } else { |
| 10632 | 10632 | $("input[name=value_unit]").val(""); |
| 10633 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10633 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10634 | 10634 | } |
| 10635 | 10635 | }); |
| 10636 | 10636 | } |
@@ -10660,18 +10660,18 @@ discard block |
||
| 10660 | 10660 | global $conf, $langs; |
| 10661 | 10661 | |
| 10662 | 10662 | $out = ''; |
| 10663 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10664 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10663 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10664 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10665 | 10665 | |
| 10666 | 10666 | $resql = $this->db->query($sql); |
| 10667 | 10667 | if ($resql) { |
| 10668 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10668 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10669 | 10669 | if ($useempty) { |
| 10670 | 10670 | $out .= '<option value="0"></option>'; |
| 10671 | 10671 | } |
| 10672 | 10672 | |
| 10673 | 10673 | while ($obj = $this->db->fetch_object($resql)) { |
| 10674 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10674 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10675 | 10675 | } |
| 10676 | 10676 | $out .= '</select>'; |
| 10677 | 10677 | } else { |
@@ -10702,12 +10702,12 @@ discard block |
||
| 10702 | 10702 | |
| 10703 | 10703 | $resql = $this->db->query($sql); |
| 10704 | 10704 | if ($resql) { |
| 10705 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10705 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10706 | 10706 | if ($useempty) { |
| 10707 | 10707 | $out .= '<option value="0"></option>'; |
| 10708 | 10708 | } |
| 10709 | 10709 | if ($allchoice) { |
| 10710 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10710 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10711 | 10711 | } |
| 10712 | 10712 | |
| 10713 | 10713 | $field = 'code'; |
@@ -10717,7 +10717,7 @@ discard block |
||
| 10717 | 10717 | |
| 10718 | 10718 | while ($obj = $this->db->fetch_object($resql)) { |
| 10719 | 10719 | $key = $langs->trans($obj->code); |
| 10720 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10720 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10721 | 10721 | } |
| 10722 | 10722 | $out .= '</select>'; |
| 10723 | 10723 | |
@@ -10751,7 +10751,7 @@ discard block |
||
| 10751 | 10751 | { |
| 10752 | 10752 | global $user, $conf, $langs; |
| 10753 | 10753 | |
| 10754 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 10754 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 10755 | 10755 | |
| 10756 | 10756 | if (is_null($usertofilter)) { |
| 10757 | 10757 | $usertofilter = $user; |
@@ -10775,10 +10775,10 @@ discard block |
||
| 10775 | 10775 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 10776 | 10776 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 10777 | 10777 | $sql .= ' s.nom as name'; |
| 10778 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 10779 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10780 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 10781 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 10778 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 10779 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10780 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 10781 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 10782 | 10782 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 10783 | 10783 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 10784 | 10784 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10789,14 +10789,14 @@ discard block |
||
| 10789 | 10789 | if ($resql) { |
| 10790 | 10790 | // Use select2 selector |
| 10791 | 10791 | if (!empty($conf->use_javascript_ajax)) { |
| 10792 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10792 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10793 | 10793 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 10794 | 10794 | $out .= $comboenhancement; |
| 10795 | 10795 | $morecss = 'minwidth200imp maxwidth500'; |
| 10796 | 10796 | } |
| 10797 | 10797 | |
| 10798 | 10798 | if (empty($option_only)) { |
| 10799 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10799 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10800 | 10800 | } |
| 10801 | 10801 | if (!empty($show_empty)) { |
| 10802 | 10802 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10826,33 +10826,33 @@ discard block |
||
| 10826 | 10826 | if ($showproject == 'all') { |
| 10827 | 10827 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 10828 | 10828 | if ($obj->name) { |
| 10829 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 10829 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 10830 | 10830 | } |
| 10831 | 10831 | |
| 10832 | 10832 | $disabled = 0; |
| 10833 | 10833 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 10834 | 10834 | $disabled = 1; |
| 10835 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 10835 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 10836 | 10836 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 10837 | 10837 | if ($discard_closed == 2) { |
| 10838 | 10838 | $disabled = 1; |
| 10839 | 10839 | } |
| 10840 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10840 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10841 | 10841 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 10842 | 10842 | $disabled = 1; |
| 10843 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 10843 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 10844 | 10844 | } |
| 10845 | 10845 | } |
| 10846 | 10846 | |
| 10847 | 10847 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10848 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10848 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10849 | 10849 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10850 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10850 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10851 | 10851 | } else { |
| 10852 | 10852 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 10853 | 10853 | $resultat = ''; |
| 10854 | 10854 | } else { |
| 10855 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10855 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10856 | 10856 | if ($disabled) { |
| 10857 | 10857 | $resultat .= ' disabled'; |
| 10858 | 10858 | } |
@@ -10904,22 +10904,22 @@ discard block |
||
| 10904 | 10904 | |
| 10905 | 10905 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 10906 | 10906 | //$sql.= ', el.fk_source'; |
| 10907 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 10908 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 10907 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 10908 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 10909 | 10909 | $sql .= " ORDER BY f.titre ASC"; |
| 10910 | 10910 | |
| 10911 | 10911 | $resql = $this->db->query($sql); |
| 10912 | 10912 | if ($resql) { |
| 10913 | 10913 | // Use select2 selector |
| 10914 | 10914 | if (!empty($conf->use_javascript_ajax)) { |
| 10915 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10915 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10916 | 10916 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 10917 | 10917 | $out .= $comboenhancement; |
| 10918 | 10918 | $morecss = 'minwidth200imp maxwidth500'; |
| 10919 | 10919 | } |
| 10920 | 10920 | |
| 10921 | 10921 | if (empty($option_only)) { |
| 10922 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10922 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10923 | 10923 | } |
| 10924 | 10924 | if (!empty($show_empty)) { |
| 10925 | 10925 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10938,19 +10938,19 @@ discard block |
||
| 10938 | 10938 | $disabled = 0; |
| 10939 | 10939 | if (!empty($obj->suspended)) { |
| 10940 | 10940 | $disabled = 1; |
| 10941 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10941 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10942 | 10942 | } |
| 10943 | 10943 | |
| 10944 | 10944 | |
| 10945 | 10945 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10946 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10946 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10947 | 10947 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10948 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10948 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10949 | 10949 | } else { |
| 10950 | 10950 | if ($disabled && ($selected != $obj->rowid)) { |
| 10951 | 10951 | $resultat = ''; |
| 10952 | 10952 | } else { |
| 10953 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10953 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10954 | 10954 | if ($disabled) { |
| 10955 | 10955 | $resultat .= ' disabled'; |
| 10956 | 10956 | } |
@@ -10990,14 +10990,14 @@ discard block |
||
| 10990 | 10990 | global $langs; |
| 10991 | 10991 | |
| 10992 | 10992 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 10993 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 10993 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 10994 | 10994 | } |
| 10995 | 10995 | |
| 10996 | 10996 | $ret = ''; |
| 10997 | 10997 | |
| 10998 | 10998 | $ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; |
| 10999 | 10999 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 11000 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 11000 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 11001 | 11001 | $ret .= '</a>'; |
| 11002 | 11002 | |
| 11003 | 11003 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -11041,29 +11041,29 @@ discard block |
||
| 11041 | 11041 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 11042 | 11042 | } |
| 11043 | 11043 | $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%')) -->"; |
| 11044 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 11044 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 11045 | 11045 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 11046 | 11046 | |
| 11047 | 11047 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 11048 | 11048 | foreach ($arrayofcriterias as $criteria) { |
| 11049 | 11049 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
| 11050 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11050 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11051 | 11051 | continue; |
| 11052 | 11052 | } |
| 11053 | 11053 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 11054 | 11054 | continue; |
| 11055 | 11055 | } |
| 11056 | 11056 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 11057 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 11058 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 11059 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 11060 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 11061 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 11062 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 11063 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 11064 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 11057 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 11058 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 11059 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 11060 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 11061 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 11062 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 11063 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 11064 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 11065 | 11065 | } else { |
| 11066 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 11066 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 11067 | 11067 | } |
| 11068 | 11068 | } |
| 11069 | 11069 | } |
@@ -11071,7 +11071,7 @@ discard block |
||
| 11071 | 11071 | $ret .= '</div>'; |
| 11072 | 11072 | |
| 11073 | 11073 | $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"; |
| 11074 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11074 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11075 | 11075 | |
| 11076 | 11076 | $ret .= '</div>'; |
| 11077 | 11077 | $ret .= '</div>'; |
@@ -11145,7 +11145,7 @@ discard block |
||
| 11145 | 11145 | |
| 11146 | 11146 | $TModels = array(); |
| 11147 | 11147 | |
| 11148 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 11148 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 11149 | 11149 | $formmail = new FormMail($this->db); |
| 11150 | 11150 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 11151 | 11151 | |
@@ -11158,17 +11158,17 @@ discard block |
||
| 11158 | 11158 | } |
| 11159 | 11159 | } |
| 11160 | 11160 | |
| 11161 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 11161 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 11162 | 11162 | |
| 11163 | 11163 | foreach ($TModels as $id_model => $label_model) { |
| 11164 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 11165 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 11164 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 11165 | + $retstring .= ">".$label_model."</option>"; |
|
| 11166 | 11166 | } |
| 11167 | 11167 | |
| 11168 | 11168 | $retstring .= "</select>"; |
| 11169 | 11169 | |
| 11170 | 11170 | if ($addjscombo) { |
| 11171 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 11171 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 11172 | 11172 | } |
| 11173 | 11173 | |
| 11174 | 11174 | return $retstring; |
@@ -11219,16 +11219,16 @@ discard block |
||
| 11219 | 11219 | |
| 11220 | 11220 | foreach ($buttons as $button) { |
| 11221 | 11221 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 11222 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
| 11222 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
| 11223 | 11223 | } |
| 11224 | 11224 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 11225 | 11225 | |
| 11226 | 11226 | if ($dol_openinpopup) { |
| 11227 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 11228 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 11227 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 11228 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 11229 | 11229 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 11230 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\'); |
|
| 11231 | - window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\'); |
|
| 11230 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\'); |
|
| 11231 | + window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\'); |
|
| 11232 | 11232 | });'; |
| 11233 | 11233 | $retstring .= '</script>'; |
| 11234 | 11234 | } |
@@ -11257,7 +11257,7 @@ discard block |
||
| 11257 | 11257 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 11258 | 11258 | |
| 11259 | 11259 | $sql = "SELECT rowid, code, label as label"; |
| 11260 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 11260 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 11261 | 11261 | $sql .= " WHERE active = 1"; |
| 11262 | 11262 | |
| 11263 | 11263 | $resql = $this->db->query($sql); |
@@ -11268,7 +11268,7 @@ discard block |
||
| 11268 | 11268 | $obj = $this->db->fetch_object($resql); |
| 11269 | 11269 | |
| 11270 | 11270 | // If translation exists, we use it, otherwise we take the default wording |
| 11271 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11271 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11272 | 11272 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 11273 | 11273 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 11274 | 11274 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -11300,18 +11300,18 @@ discard block |
||
| 11300 | 11300 | global $langs, $user; |
| 11301 | 11301 | |
| 11302 | 11302 | $out = ''; |
| 11303 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 11303 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 11304 | 11304 | |
| 11305 | 11305 | $this->load_cache_invoice_subtype(); |
| 11306 | 11306 | |
| 11307 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 11307 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 11308 | 11308 | if ($addempty) { |
| 11309 | 11309 | $out .= '<option value="0"> </option>'; |
| 11310 | 11310 | } |
| 11311 | 11311 | |
| 11312 | 11312 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 11313 | 11313 | $label = $subtype['label']; |
| 11314 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 11314 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 11315 | 11315 | if ($selected == $subtype['rowid']) { |
| 11316 | 11316 | $out .= ' selected="selected"'; |
| 11317 | 11317 | } |