@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | * |
| 478 | 478 | * Note: cond_reglement can not be aliased to cond_reglement!!! |
| 479 | 479 | */ |
| 480 | - private $cond_reglement; // Private to call DolDeprecationHandler |
|
| 480 | + private $cond_reglement; // Private to call DolDeprecationHandler |
|
| 481 | 481 | /** |
| 482 | 482 | * @var int|string Internal to detect deprecated access |
| 483 | 483 | */ |
| 484 | - protected $depr_cond_reglement; // Internal value for deprecation |
|
| 484 | + protected $depr_cond_reglement; // Internal value for deprecation |
|
| 485 | 485 | |
| 486 | 486 | /** |
| 487 | 487 | * @var int Delivery address ID |
@@ -538,12 +538,12 @@ discard block |
||
| 538 | 538 | /** |
| 539 | 539 | * @var float|string Multicurrency total localtax1 |
| 540 | 540 | */ |
| 541 | - public $multicurrency_total_localtax1; // not in database |
|
| 541 | + public $multicurrency_total_localtax1; // not in database |
|
| 542 | 542 | |
| 543 | 543 | /** |
| 544 | 544 | * @var float|string Multicurrency total localtax2 |
| 545 | 545 | */ |
| 546 | - public $multicurrency_total_localtax2; // not in database |
|
| 546 | + public $multicurrency_total_localtax2; // not in database |
|
| 547 | 547 | |
| 548 | 548 | /** |
| 549 | 549 | * @var ?string |
@@ -1028,17 +1028,17 @@ discard block |
||
| 1028 | 1028 | } |
| 1029 | 1029 | $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); |
| 1030 | 1030 | if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { |
| 1031 | - $data[$key] = '<br><b><u>'. $labelextra . '</u></b>'; |
|
| 1031 | + $data[$key] = '<br><b><u>'.$labelextra.'</u></b>'; |
|
| 1032 | 1032 | } else { |
| 1033 | - $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); |
|
| 1034 | - $data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element); |
|
| 1033 | + $value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]); |
|
| 1034 | + $data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element); |
|
| 1035 | 1035 | $count++; |
| 1036 | 1036 | } |
| 1037 | 1037 | } |
| 1038 | 1038 | $data['closedivextra'] = '</div>'; |
| 1039 | 1039 | } |
| 1040 | 1040 | |
| 1041 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1041 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1042 | 1042 | $parameters = array( |
| 1043 | 1043 | 'tooltipcontentarray' => &$data, |
| 1044 | 1044 | 'params' => $params, |
@@ -1538,7 +1538,7 @@ discard block |
||
| 1538 | 1538 | $sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")"; |
| 1539 | 1539 | } |
| 1540 | 1540 | if ($status >= 0) { |
| 1541 | - $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
| 1541 | + $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
| 1542 | 1542 | } |
| 1543 | 1543 | if ($statusoflink >= 0) { |
| 1544 | 1544 | $sql .= " AND ec.statut = ".((int) $statusoflink); |
@@ -1922,7 +1922,7 @@ discard block |
||
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | 1924 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element; |
| 1925 | - $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
| 1925 | + $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
| 1926 | 1926 | $sql .= " LIMIT 1"; |
| 1927 | 1927 | |
| 1928 | 1928 | $query = $this->db->query($sql); |
@@ -2241,9 +2241,9 @@ discard block |
||
| 2241 | 2241 | |
| 2242 | 2242 | $oldvalue = null; |
| 2243 | 2243 | if ($trigkey) { |
| 2244 | - $sql = "SELECT " . $field; |
|
| 2245 | - $sql .= " FROM " . MAIN_DB_PREFIX . $table; |
|
| 2246 | - $sql .= " WHERE " . $id_field . " = " . ((int) $id); |
|
| 2244 | + $sql = "SELECT ".$field; |
|
| 2245 | + $sql .= " FROM ".MAIN_DB_PREFIX.$table; |
|
| 2246 | + $sql .= " WHERE ".$id_field." = ".((int) $id); |
|
| 2247 | 2247 | |
| 2248 | 2248 | $resql = $this->db->query($sql); |
| 2249 | 2249 | if ($resql) { |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | // Triggers |
| 2624 | 2624 | if (!$error && !$notrigger) { |
| 2625 | 2625 | // Call triggers |
| 2626 | - $result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user); |
|
| 2626 | + $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); |
|
| 2627 | 2627 | if ($result < 0) { |
| 2628 | 2628 | $error++; |
| 2629 | 2629 | } //Do also here what you must do to rollback action if trigger fail |
@@ -3001,7 +3001,7 @@ discard block |
||
| 3001 | 3001 | $sql = 'UPDATE '.$this->db->prefix().$this->table_element; |
| 3002 | 3002 | $sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL'); |
| 3003 | 3003 | if (in_array($this->table_element, array('propal', 'commande', 'societe'))) { |
| 3004 | - $sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
| 3004 | + $sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
| 3005 | 3005 | } |
| 3006 | 3006 | $sql .= ' WHERE rowid='.((int) $this->id); |
| 3007 | 3007 | |
@@ -3349,10 +3349,10 @@ discard block |
||
| 3349 | 3349 | $sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line; |
| 3350 | 3350 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3351 | 3351 | if (!$renum) { |
| 3352 | - $sql .= " AND " . $fieldposition . " = 0"; |
|
| 3352 | + $sql .= " AND ".$fieldposition." = 0"; |
|
| 3353 | 3353 | } |
| 3354 | 3354 | if ($renum) { |
| 3355 | - $sql .= " AND " . $fieldposition . " <> 0"; |
|
| 3355 | + $sql .= " AND ".$fieldposition." <> 0"; |
|
| 3356 | 3356 | } |
| 3357 | 3357 | |
| 3358 | 3358 | dol_syslog(get_class($this)."::line_order", LOG_DEBUG); |
@@ -3373,7 +3373,7 @@ discard block |
||
| 3373 | 3373 | if ($fk_parent_line) { |
| 3374 | 3374 | $sql .= ' AND fk_parent_line IS NULL'; |
| 3375 | 3375 | } |
| 3376 | - $sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder; |
|
| 3376 | + $sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder; |
|
| 3377 | 3377 | |
| 3378 | 3378 | dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); |
| 3379 | 3379 | $resql = $this->db->query($sql); |
@@ -3425,7 +3425,7 @@ discard block |
||
| 3425 | 3425 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
| 3426 | 3426 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3427 | 3427 | $sql .= ' AND fk_parent_line = '.((int) $id); |
| 3428 | - $sql .= " ORDER BY " . $fieldposition . " ASC"; |
|
| 3428 | + $sql .= " ORDER BY ".$fieldposition." ASC"; |
|
| 3429 | 3429 | |
| 3430 | 3430 | dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG); |
| 3431 | 3431 | |
@@ -3549,7 +3549,7 @@ discard block |
||
| 3549 | 3549 | |
| 3550 | 3550 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
| 3551 | 3551 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3552 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1)); |
|
| 3552 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang - 1)); |
|
| 3553 | 3553 | if ($this->db->query($sql)) { |
| 3554 | 3554 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1)); |
| 3555 | 3555 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3580,7 +3580,7 @@ discard block |
||
| 3580 | 3580 | |
| 3581 | 3581 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
| 3582 | 3582 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3583 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1)); |
|
| 3583 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang + 1)); |
|
| 3584 | 3584 | if ($this->db->query($sql)) { |
| 3585 | 3585 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1)); |
| 3586 | 3586 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3606,7 +3606,7 @@ discard block |
||
| 3606 | 3606 | $fieldposition = 'position'; |
| 3607 | 3607 | } |
| 3608 | 3608 | |
| 3609 | - $sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line; |
|
| 3609 | + $sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line; |
|
| 3610 | 3610 | $sql .= " WHERE rowid = ".((int) $rowid); |
| 3611 | 3611 | |
| 3612 | 3612 | dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); |
@@ -3634,7 +3634,7 @@ discard block |
||
| 3634 | 3634 | |
| 3635 | 3635 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
| 3636 | 3636 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
| 3637 | - $sql .= " AND " . $fieldposition . " = ".((int) $rang); |
|
| 3637 | + $sql .= " AND ".$fieldposition." = ".((int) $rang); |
|
| 3638 | 3638 | $resql = $this->db->query($sql); |
| 3639 | 3639 | if ($resql) { |
| 3640 | 3640 | $row = $this->db->fetch_row($resql); |
@@ -3753,7 +3753,7 @@ discard block |
||
| 3753 | 3753 | $newsuffix = ''; |
| 3754 | 3754 | } |
| 3755 | 3755 | if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) { |
| 3756 | - $fieldusermod = "fk_user_mod"; |
|
| 3756 | + $fieldusermod = "fk_user_mod"; |
|
| 3757 | 3757 | } elseif ($this->table_element == 'ecm_files') { |
| 3758 | 3758 | $fieldusermod = "fk_user_m"; |
| 3759 | 3759 | } else { |
@@ -3795,7 +3795,7 @@ discard block |
||
| 3795 | 3795 | $trigger_name = 'EXPENSE_REPORT_MODIFY'; |
| 3796 | 3796 | break; |
| 3797 | 3797 | default: |
| 3798 | - $trigger_name = strtoupper($this->element) . '_MODIFY'; |
|
| 3798 | + $trigger_name = strtoupper($this->element).'_MODIFY'; |
|
| 3799 | 3799 | } |
| 3800 | 3800 | $ret = $this->call_trigger($trigger_name, $user); |
| 3801 | 3801 | if ($ret < 0) { |
@@ -4093,7 +4093,7 @@ discard block |
||
| 4093 | 4093 | // Situations totals |
| 4094 | 4094 | if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) { // @phan-suppress-current-line PhanUndeclaredProperty |
| 4095 | 4095 | '@phan-var-force Facture $this'; |
| 4096 | - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded |
|
| 4096 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded |
|
| 4097 | 4097 | if ($this->type != Facture::TYPE_CREDIT_NOTE) { // @phpstan-ignore-line |
| 4098 | 4098 | if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) { |
| 4099 | 4099 | $prev_sits = $this->get_prev_sits(); |
@@ -4215,19 +4215,19 @@ discard block |
||
| 4215 | 4215 | $this->db->begin(); |
| 4216 | 4216 | $error = 0; |
| 4217 | 4217 | |
| 4218 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
| 4218 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
| 4219 | 4219 | $sql .= "fk_source"; |
| 4220 | 4220 | $sql .= ", sourcetype"; |
| 4221 | 4221 | $sql .= ", fk_target"; |
| 4222 | 4222 | $sql .= ", targettype"; |
| 4223 | 4223 | $sql .= ") VALUES ("; |
| 4224 | 4224 | $sql .= ((int) $origin_id); |
| 4225 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
| 4226 | - $sql .= ", " . ((int) $this->id); |
|
| 4227 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
| 4225 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
| 4226 | + $sql .= ", ".((int) $this->id); |
|
| 4227 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
| 4228 | 4228 | $sql .= ")"; |
| 4229 | 4229 | |
| 4230 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
| 4230 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
| 4231 | 4231 | if ($this->db->query($sql)) { |
| 4232 | 4232 | if (!$notrigger) { |
| 4233 | 4233 | // Call trigger |
@@ -4480,20 +4480,20 @@ discard block |
||
| 4480 | 4480 | $this->db->begin(); |
| 4481 | 4481 | $error = 0; |
| 4482 | 4482 | |
| 4483 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
| 4483 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
| 4484 | 4484 | if ($updatesource) { |
| 4485 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
| 4486 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
| 4487 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
| 4488 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
| 4485 | + $sql .= "fk_source = ".((int) $sourceid); |
|
| 4486 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
| 4487 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
| 4488 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
| 4489 | 4489 | } elseif ($updatetarget) { |
| 4490 | - $sql .= "fk_target = " . ((int) $targetid); |
|
| 4491 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
| 4492 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
| 4493 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
| 4490 | + $sql .= "fk_target = ".((int) $targetid); |
|
| 4491 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
| 4492 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
| 4493 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
| 4494 | 4494 | } |
| 4495 | 4495 | |
| 4496 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
| 4496 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
| 4497 | 4497 | if ($this->db->query($sql)) { |
| 4498 | 4498 | if (!$notrigger) { |
| 4499 | 4499 | // Call trigger |
@@ -4569,25 +4569,25 @@ discard block |
||
| 4569 | 4569 | } |
| 4570 | 4570 | |
| 4571 | 4571 | if (!$error) { |
| 4572 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
| 4572 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
| 4573 | 4573 | $sql .= " WHERE"; |
| 4574 | 4574 | if ($rowid > 0) { |
| 4575 | - $sql .= " rowid = " . ((int) $rowid); |
|
| 4575 | + $sql .= " rowid = ".((int) $rowid); |
|
| 4576 | 4576 | } else { |
| 4577 | 4577 | if ($deletesource) { |
| 4578 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
| 4579 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
| 4578 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
| 4579 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'"; |
|
| 4580 | 4580 | } elseif ($deletetarget) { |
| 4581 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
| 4582 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
| 4581 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
| 4582 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
| 4583 | 4583 | } else { |
| 4584 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')"; |
|
| 4584 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')"; |
|
| 4585 | 4585 | $sql .= " OR"; |
| 4586 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')"; |
|
| 4586 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')"; |
|
| 4587 | 4587 | } |
| 4588 | 4588 | } |
| 4589 | 4589 | |
| 4590 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
| 4590 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
| 4591 | 4591 | if (!$this->db->query($sql)) { |
| 4592 | 4592 | $this->error = $this->db->lasterror(); |
| 4593 | 4593 | $this->errors[] = $this->error; |
@@ -4752,14 +4752,14 @@ discard block |
||
| 4752 | 4752 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
| 4753 | 4753 | } |
| 4754 | 4754 | $sql .= " WHERE rowid = ".((int) $elementId); |
| 4755 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
| 4755 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
| 4756 | 4756 | |
| 4757 | 4757 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
| 4758 | 4758 | $resql = $this->db->query($sql); |
| 4759 | 4759 | if ($resql) { |
| 4760 | 4760 | $error = 0; |
| 4761 | 4761 | |
| 4762 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
| 4762 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
| 4763 | 4763 | |
| 4764 | 4764 | if ($nb_rows_affected > 0) { |
| 4765 | 4765 | if (empty($trigkey)) { |
@@ -4806,7 +4806,7 @@ discard block |
||
| 4806 | 4806 | if ($fieldstatus == 'tosell') { |
| 4807 | 4807 | $this->status = $status; |
| 4808 | 4808 | } elseif ($fieldstatus == 'tobuy') { |
| 4809 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
| 4809 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
| 4810 | 4810 | } else { |
| 4811 | 4811 | $this->status = $status; |
| 4812 | 4812 | } |
@@ -4914,7 +4914,7 @@ discard block |
||
| 4914 | 4914 | return -1; |
| 4915 | 4915 | } |
| 4916 | 4916 | |
| 4917 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
| 4917 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
| 4918 | 4918 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
| 4919 | 4919 | $tmparray = array_keys($this->childtables); |
| 4920 | 4920 | if (is_numeric($tmparray[0])) { |
@@ -6017,7 +6017,7 @@ discard block |
||
| 6017 | 6017 | $setsharekey = false; |
| 6018 | 6018 | if ($this->element == 'propal' || $this->element == 'proposal') { |
| 6019 | 6019 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
| 6020 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
| 6020 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
| 6021 | 6021 | } |
| 6022 | 6022 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
| 6023 | 6023 | $setsharekey = true; |
@@ -6077,7 +6077,7 @@ discard block |
||
| 6077 | 6077 | $ecmfile->gen_or_uploaded = 'generated'; |
| 6078 | 6078 | $ecmfile->description = ''; // indexed content |
| 6079 | 6079 | $ecmfile->keywords = ''; // keyword content |
| 6080 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
| 6080 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
| 6081 | 6081 | $ecmfile->src_object_id = $this->id; |
| 6082 | 6082 | |
| 6083 | 6083 | $result = $ecmfile->create($user); |
@@ -6229,8 +6229,8 @@ discard block |
||
| 6229 | 6229 | // phpcs:enable |
| 6230 | 6230 | global $langs, $conf; |
| 6231 | 6231 | |
| 6232 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
| 6233 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
| 6232 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
| 6233 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
| 6234 | 6234 | exit; |
| 6235 | 6235 | } |
| 6236 | 6236 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -6422,7 +6422,7 @@ discard block |
||
| 6422 | 6422 | $savDisableCompute = $conf->disable_compute; |
| 6423 | 6423 | $conf->disable_compute = 1; |
| 6424 | 6424 | |
| 6425 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
| 6425 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
| 6426 | 6426 | |
| 6427 | 6427 | $conf->disable_compute = $savDisableCompute; |
| 6428 | 6428 | |
@@ -6484,7 +6484,7 @@ discard block |
||
| 6484 | 6484 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
| 6485 | 6485 | $sql = "SELECT rowid"; |
| 6486 | 6486 | foreach ($optionsArray as $name => $label) { |
| 6487 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
| 6487 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
| 6488 | 6488 | $sql .= ", ".$name; |
| 6489 | 6489 | } |
| 6490 | 6490 | // use geo sql fonction to read as text |
@@ -6537,7 +6537,7 @@ discard block |
||
| 6537 | 6537 | **/ |
| 6538 | 6538 | if (is_array($extrafields->attributes[$this->table_element]['label'])) { |
| 6539 | 6539 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
| 6540 | - $this->array_options['options_' . $key] = null; |
|
| 6540 | + $this->array_options['options_'.$key] = null; |
|
| 6541 | 6541 | } |
| 6542 | 6542 | } |
| 6543 | 6543 | } |
@@ -6549,9 +6549,9 @@ discard block |
||
| 6549 | 6549 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
| 6550 | 6550 | //var_dump($conf->disable_compute); |
| 6551 | 6551 | if (empty($conf->disable_compute)) { |
| 6552 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
| 6553 | - $objectoffield = $this; // we can use it inside computed formula |
|
| 6554 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
| 6552 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
| 6553 | + $objectoffield = $this; // we can use it inside computed formula |
|
| 6554 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
| 6555 | 6555 | } |
| 6556 | 6556 | } |
| 6557 | 6557 | } |
@@ -6738,7 +6738,7 @@ discard block |
||
| 6738 | 6738 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
| 6739 | 6739 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
| 6740 | 6740 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
| 6741 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6741 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6742 | 6742 | } else { |
| 6743 | 6743 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
| 6744 | 6744 | } |
@@ -6749,7 +6749,7 @@ discard block |
||
| 6749 | 6749 | // If value has changed |
| 6750 | 6750 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
| 6751 | 6751 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
| 6752 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6752 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6753 | 6753 | } else { |
| 6754 | 6754 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
| 6755 | 6755 | } |
@@ -6761,7 +6761,7 @@ discard block |
||
| 6761 | 6761 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
| 6762 | 6762 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
| 6763 | 6763 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
| 6764 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6764 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
| 6765 | 6765 | } else { |
| 6766 | 6766 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
| 6767 | 6767 | } |
@@ -7211,7 +7211,7 @@ discard block |
||
| 7211 | 7211 | if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
| 7212 | 7212 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
| 7213 | 7213 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
| 7214 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7214 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7215 | 7215 | } else { |
| 7216 | 7216 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
| 7217 | 7217 | } |
@@ -7231,7 +7231,7 @@ discard block |
||
| 7231 | 7231 | } |
| 7232 | 7232 | } else { |
| 7233 | 7233 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
| 7234 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7234 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
| 7235 | 7235 | } else { |
| 7236 | 7236 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
| 7237 | 7237 | } |
@@ -7819,7 +7819,7 @@ discard block |
||
| 7819 | 7819 | // 7 : sort field |
| 7820 | 7820 | |
| 7821 | 7821 | // If there is filter |
| 7822 | - if (! empty($InfoFieldList[4])) { |
|
| 7822 | + if (!empty($InfoFieldList[4])) { |
|
| 7823 | 7823 | $pos = 0; |
| 7824 | 7824 | $parenthesisopen = 0; |
| 7825 | 7825 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7883,8 +7883,8 @@ discard block |
||
| 7883 | 7883 | } |
| 7884 | 7884 | |
| 7885 | 7885 | $sqlwhere = ''; |
| 7886 | - $sql = "SELECT " . $keyList; |
|
| 7887 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
| 7886 | + $sql = "SELECT ".$keyList; |
|
| 7887 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
| 7888 | 7888 | |
| 7889 | 7889 | if (!empty($InfoFieldList[4])) { |
| 7890 | 7890 | // can use SELECT request |
@@ -7902,11 +7902,11 @@ discard block |
||
| 7902 | 7902 | // We have to join on extrafield table |
| 7903 | 7903 | $errstr = ''; |
| 7904 | 7904 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 7905 | - $sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra"; |
|
| 7906 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
| 7907 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7905 | + $sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra"; |
|
| 7906 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
| 7907 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7908 | 7908 | } else { |
| 7909 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7909 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 7910 | 7910 | } |
| 7911 | 7911 | } else { |
| 7912 | 7912 | $sqlwhere .= ' WHERE 1=1'; |
@@ -7927,7 +7927,7 @@ discard block |
||
| 7927 | 7927 | |
| 7928 | 7928 | // Some tables may have field, some other not. For the moment we disable it. |
| 7929 | 7929 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 7930 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 7930 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 7931 | 7931 | } |
| 7932 | 7932 | $sql .= $sqlwhere; |
| 7933 | 7933 | |
@@ -7938,7 +7938,7 @@ discard block |
||
| 7938 | 7938 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
| 7939 | 7939 | } |
| 7940 | 7940 | |
| 7941 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
| 7941 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
| 7942 | 7942 | $resql = $this->db->query($sql); |
| 7943 | 7943 | if ($resql) { |
| 7944 | 7944 | $out .= '<option value="0"> </option>'; |
@@ -7954,7 +7954,7 @@ discard block |
||
| 7954 | 7954 | if (count($fields_label) > 1) { |
| 7955 | 7955 | $notrans = true; |
| 7956 | 7956 | foreach ($fields_label as $field_toshow) { |
| 7957 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 7957 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 7958 | 7958 | } |
| 7959 | 7959 | } else { |
| 7960 | 7960 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7965,12 +7965,12 @@ discard block |
||
| 7965 | 7965 | foreach ($fields_label as $field_toshow) { |
| 7966 | 7966 | $translabel = $langs->trans($obj->$field_toshow); |
| 7967 | 7967 | if ($translabel != $obj->$field_toshow) { |
| 7968 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
| 7968 | + $labeltoshow = dol_trunc($translabel).' '; |
|
| 7969 | 7969 | } else { |
| 7970 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
| 7970 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
| 7971 | 7971 | } |
| 7972 | 7972 | } |
| 7973 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 7973 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 7974 | 7974 | } else { |
| 7975 | 7975 | if (!$notrans) { |
| 7976 | 7976 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -7984,34 +7984,34 @@ discard block |
||
| 7984 | 7984 | $labeltoshow = '(not defined)'; |
| 7985 | 7985 | } |
| 7986 | 7986 | if ($value == $obj->rowid) { |
| 7987 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
| 7987 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
| 7988 | 7988 | } |
| 7989 | 7989 | |
| 7990 | 7990 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 7991 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 7991 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 7992 | 7992 | $isDependList = 1; |
| 7993 | 7993 | } |
| 7994 | 7994 | |
| 7995 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 7995 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 7996 | 7996 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
| 7997 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
| 7998 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 7997 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
| 7998 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 7999 | 7999 | } |
| 8000 | 8000 | |
| 8001 | 8001 | $i++; |
| 8002 | 8002 | } |
| 8003 | 8003 | $this->db->free($resql); |
| 8004 | 8004 | } else { |
| 8005 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 8005 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 8006 | 8006 | } |
| 8007 | 8007 | } else { |
| 8008 | 8008 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
| 8009 | 8009 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 8010 | 8010 | $out .= '<option value="0"> </option>'; |
| 8011 | 8011 | foreach ($data as $data_key => $data_value) { |
| 8012 | - $out .= '<option value="' . $data_key . '"'; |
|
| 8012 | + $out .= '<option value="'.$data_key.'"'; |
|
| 8013 | 8013 | $out .= ($value == $data_key ? ' selected' : ''); |
| 8014 | - $out .= '>' . $data_value . '</option>'; |
|
| 8014 | + $out .= '>'.$data_value.'</option>'; |
|
| 8015 | 8015 | } |
| 8016 | 8016 | } |
| 8017 | 8017 | } |
@@ -8051,7 +8051,7 @@ discard block |
||
| 8051 | 8051 | // 7 : sort field |
| 8052 | 8052 | |
| 8053 | 8053 | // If there is a filter |
| 8054 | - if (! empty($InfoFieldList[4])) { |
|
| 8054 | + if (!empty($InfoFieldList[4])) { |
|
| 8055 | 8055 | $pos = 0; |
| 8056 | 8056 | $parenthesisopen = 0; |
| 8057 | 8057 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -8117,8 +8117,8 @@ discard block |
||
| 8117 | 8117 | } |
| 8118 | 8118 | |
| 8119 | 8119 | $sqlwhere = ''; |
| 8120 | - $sql = "SELECT " . $keyList; |
|
| 8121 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
| 8120 | + $sql = "SELECT ".$keyList; |
|
| 8121 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
| 8122 | 8122 | |
| 8123 | 8123 | if (!empty($InfoFieldList[4])) { |
| 8124 | 8124 | // can use SELECT request |
@@ -8136,11 +8136,11 @@ discard block |
||
| 8136 | 8136 | // We have to join on extrafield table |
| 8137 | 8137 | $errstr = ''; |
| 8138 | 8138 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
| 8139 | - $sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra'; |
|
| 8140 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
| 8141 | - $sqlwhere .= " AND " . $InfoFieldList[4]; |
|
| 8139 | + $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
|
| 8140 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
| 8141 | + $sqlwhere .= " AND ".$InfoFieldList[4]; |
|
| 8142 | 8142 | } else { |
| 8143 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
| 8143 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
| 8144 | 8144 | } |
| 8145 | 8145 | } else { |
| 8146 | 8146 | $sqlwhere .= ' WHERE 1=1'; |
@@ -8161,14 +8161,14 @@ discard block |
||
| 8161 | 8161 | |
| 8162 | 8162 | // Some tables may have field, some other not. For the moment we disable it. |
| 8163 | 8163 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
| 8164 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
| 8164 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
| 8165 | 8165 | } |
| 8166 | 8166 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
| 8167 | 8167 | // print $sql; |
| 8168 | 8168 | |
| 8169 | 8169 | $sql .= $sqlwhere; |
| 8170 | 8170 | |
| 8171 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
| 8171 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
| 8172 | 8172 | |
| 8173 | 8173 | $resql = $this->db->query($sql); |
| 8174 | 8174 | if ($resql) { |
@@ -8187,7 +8187,7 @@ discard block |
||
| 8187 | 8187 | if (count($fields_label) > 1) { |
| 8188 | 8188 | $notrans = true; |
| 8189 | 8189 | foreach ($fields_label as $field_toshow) { |
| 8190 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
| 8190 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
| 8191 | 8191 | } |
| 8192 | 8192 | } else { |
| 8193 | 8193 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -8198,9 +8198,9 @@ discard block |
||
| 8198 | 8198 | foreach ($fields_label as $field_toshow) { |
| 8199 | 8199 | $translabel = $langs->trans($obj->$field_toshow); |
| 8200 | 8200 | if ($translabel != $obj->$field_toshow) { |
| 8201 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
| 8201 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
| 8202 | 8202 | } else { |
| 8203 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
| 8203 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
| 8204 | 8204 | } |
| 8205 | 8205 | } |
| 8206 | 8206 | |
@@ -8223,7 +8223,7 @@ discard block |
||
| 8223 | 8223 | } |
| 8224 | 8224 | |
| 8225 | 8225 | if (!empty($InfoFieldList[3]) && $parentField) { |
| 8226 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
| 8226 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
| 8227 | 8227 | $isDependList = 1; |
| 8228 | 8228 | } |
| 8229 | 8229 | |
@@ -8234,14 +8234,14 @@ discard block |
||
| 8234 | 8234 | } |
| 8235 | 8235 | $this->db->free($resql); |
| 8236 | 8236 | |
| 8237 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8237 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8238 | 8238 | } else { |
| 8239 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
| 8239 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
| 8240 | 8240 | } |
| 8241 | 8241 | } else { |
| 8242 | 8242 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
| 8243 | 8243 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
| 8244 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8244 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
| 8245 | 8245 | } |
| 8246 | 8246 | } |
| 8247 | 8247 | } elseif ($type == 'link') { |
@@ -8478,7 +8478,7 @@ discard block |
||
| 8478 | 8478 | $value = $this->getLibStatut(3); |
| 8479 | 8479 | } elseif ($type == 'date') { |
| 8480 | 8480 | if (!empty($value)) { |
| 8481 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 8481 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
| 8482 | 8482 | } else { |
| 8483 | 8483 | $value = ''; |
| 8484 | 8484 | } |
@@ -8579,7 +8579,7 @@ discard block |
||
| 8579 | 8579 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
| 8580 | 8580 | if (strpos($value, "|") !== false) { |
| 8581 | 8581 | $value = $langs->trans(explode('|', $value)[0]); |
| 8582 | - } elseif (! is_numeric($value)) { |
|
| 8582 | + } elseif (!is_numeric($value)) { |
|
| 8583 | 8583 | $value = $langs->trans($value); |
| 8584 | 8584 | } |
| 8585 | 8585 | } elseif ($type == 'sellist') { |
@@ -8641,9 +8641,9 @@ discard block |
||
| 8641 | 8641 | $translabel = $langs->trans($obj->$field_toshow); |
| 8642 | 8642 | } |
| 8643 | 8643 | if ($translabel != $field_toshow) { |
| 8644 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
| 8644 | + $value .= dol_trunc($translabel, 18).' '; |
|
| 8645 | 8645 | } else { |
| 8646 | - $value .= $obj->$field_toshow . ' '; |
|
| 8646 | + $value .= $obj->$field_toshow.' '; |
|
| 8647 | 8647 | } |
| 8648 | 8648 | } |
| 8649 | 8649 | } else { |
@@ -8659,7 +8659,7 @@ discard block |
||
| 8659 | 8659 | } |
| 8660 | 8660 | } |
| 8661 | 8661 | } else { |
| 8662 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 8662 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 8663 | 8663 | |
| 8664 | 8664 | $toprint = array(); |
| 8665 | 8665 | $obj = $this->db->fetch_object($resql); |
@@ -8667,7 +8667,7 @@ discard block |
||
| 8667 | 8667 | $c->fetch($obj->rowid); |
| 8668 | 8668 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 8669 | 8669 | foreach ($ways as $way) { |
| 8670 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 8670 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 8671 | 8671 | } |
| 8672 | 8672 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
| 8673 | 8673 | } |
@@ -8683,11 +8683,11 @@ discard block |
||
| 8683 | 8683 | $toprint = array(); |
| 8684 | 8684 | foreach ($value_arr as $keyval => $valueval) { |
| 8685 | 8685 | if (!empty($valueval)) { |
| 8686 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
| 8686 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
| 8687 | 8687 | } |
| 8688 | 8688 | } |
| 8689 | 8689 | if (!empty($toprint)) { |
| 8690 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 8690 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 8691 | 8691 | } |
| 8692 | 8692 | } |
| 8693 | 8693 | } elseif ($type == 'chkbxlst') { |
@@ -8742,9 +8742,9 @@ discard block |
||
| 8742 | 8742 | $translabel = $langs->trans($obj->$field_toshow); |
| 8743 | 8743 | } |
| 8744 | 8744 | if ($translabel != $field_toshow) { |
| 8745 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
| 8745 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
| 8746 | 8746 | } else { |
| 8747 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
| 8747 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
| 8748 | 8748 | } |
| 8749 | 8749 | } |
| 8750 | 8750 | } else { |
@@ -8753,15 +8753,15 @@ discard block |
||
| 8753 | 8753 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
| 8754 | 8754 | } |
| 8755 | 8755 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
| 8756 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
| 8756 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
| 8757 | 8757 | } else { |
| 8758 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
| 8758 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
| 8759 | 8759 | } |
| 8760 | 8760 | } |
| 8761 | 8761 | } |
| 8762 | 8762 | } |
| 8763 | 8763 | } else { |
| 8764 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 8764 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 8765 | 8765 | |
| 8766 | 8766 | $toprint = array(); |
| 8767 | 8767 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8770,7 +8770,7 @@ discard block |
||
| 8770 | 8770 | $c->fetch($obj->rowid); |
| 8771 | 8771 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 8772 | 8772 | foreach ($ways as $way) { |
| 8773 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 8773 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 8774 | 8774 | } |
| 8775 | 8775 | } |
| 8776 | 8776 | } |
@@ -8940,7 +8940,7 @@ discard block |
||
| 8940 | 8940 | global $langs; |
| 8941 | 8941 | |
| 8942 | 8942 | if (!class_exists('Validate')) { |
| 8943 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
| 8943 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
| 8944 | 8944 | } |
| 8945 | 8945 | |
| 8946 | 8946 | $this->clearFieldError($fieldKey); |
@@ -9179,7 +9179,7 @@ discard block |
||
| 9179 | 9179 | $out .= "\n"; |
| 9180 | 9180 | |
| 9181 | 9181 | $nbofextrafieldsshown = 0; |
| 9182 | - $e = 0; // var to manage the modulo (odd/even) |
|
| 9182 | + $e = 0; // var to manage the modulo (odd/even) |
|
| 9183 | 9183 | |
| 9184 | 9184 | $lastseparatorkeyfound = ''; |
| 9185 | 9185 | $extrafields_collapse_num = ''; |
@@ -9217,9 +9217,9 @@ discard block |
||
| 9217 | 9217 | continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list |
| 9218 | 9218 | } elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) { |
| 9219 | 9219 | // We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost |
| 9220 | - $ef_name = 'options_' . $key; |
|
| 9220 | + $ef_name = 'options_'.$key; |
|
| 9221 | 9221 | $ef_value = $this->array_options[$ef_name]; |
| 9222 | - $out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n"; |
|
| 9222 | + $out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n"; |
|
| 9223 | 9223 | continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation |
| 9224 | 9224 | } elseif ($mode == 'view' && empty($visibility)) { |
| 9225 | 9225 | continue; |
@@ -10290,7 +10290,7 @@ discard block |
||
| 10290 | 10290 | continue; |
| 10291 | 10291 | } |
| 10292 | 10292 | } |
| 10293 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
| 10293 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
| 10294 | 10294 | } |
| 10295 | 10295 | return implode(',', $keys_with_alias); |
| 10296 | 10296 | } else { |
@@ -10430,7 +10430,7 @@ discard block |
||
| 10430 | 10430 | if (!$error) { |
| 10431 | 10431 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
| 10432 | 10432 | $sql .= " (".implode(", ", $keys).')'; |
| 10433 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
| 10433 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
| 10434 | 10434 | |
| 10435 | 10435 | $res = $this->db->query($sql); |
| 10436 | 10436 | if (!$res) { |
@@ -10733,7 +10733,7 @@ discard block |
||
| 10733 | 10733 | |
| 10734 | 10734 | // Update extrafield |
| 10735 | 10735 | if (!$error) { |
| 10736 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
| 10736 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
| 10737 | 10737 | if ($result < 0) { |
| 10738 | 10738 | $error++; |
| 10739 | 10739 | } |
@@ -10935,12 +10935,12 @@ discard block |
||
| 10935 | 10935 | $error++; |
| 10936 | 10936 | } else { |
| 10937 | 10937 | while ($obj = $this->db->fetch_object($resql)) { |
| 10938 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
| 10938 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
| 10939 | 10939 | if ($result < 0) { |
| 10940 | 10940 | $error++; |
| 10941 | 10941 | $this->errors[] = $this->error; |
| 10942 | 10942 | } else { |
| 10943 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
| 10943 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
| 10944 | 10944 | if ($result < 0) { |
| 10945 | 10945 | $error++; |
| 10946 | 10946 | $this->errors[] = $this->error; |
@@ -11106,7 +11106,7 @@ discard block |
||
| 11106 | 11106 | ); |
| 11107 | 11107 | foreach ($fields as $key => $value) { |
| 11108 | 11108 | if (array_key_exists($key, $this->fields)) { |
| 11109 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
| 11109 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
| 11110 | 11110 | } |
| 11111 | 11111 | } |
| 11112 | 11112 | |
@@ -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]) ? false : (bool) $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 . ($tag != 'td' ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 692 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.($tag != 'td' ? ' 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 .= dol_string_nohtmltag($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); |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | if (empty($hidetext)) { |
| 1170 | 1170 | print $langs->trans("Type").'...'; |
| 1171 | 1171 | } |
| 1172 | - print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1172 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1173 | 1173 | if ($showempty) { |
| 1174 | 1174 | print '<option value="-1" class="opacitymedium"'.($useajaxcombo ? '' : ' disabled="disabled"'); |
| 1175 | 1175 | if ($selected == -1) { |
@@ -1188,31 +1188,31 @@ discard block |
||
| 1188 | 1188 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1189 | 1189 | print ' selected'; |
| 1190 | 1190 | } |
| 1191 | - print '>' . $langs->trans("Product"); |
|
| 1191 | + print '>'.$langs->trans("Product"); |
|
| 1192 | 1192 | |
| 1193 | 1193 | print '<option value="1"'; |
| 1194 | 1194 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1195 | 1195 | print ' selected'; |
| 1196 | 1196 | } |
| 1197 | - print '>' . $langs->trans("Service"); |
|
| 1197 | + print '>'.$langs->trans("Service"); |
|
| 1198 | 1198 | |
| 1199 | 1199 | print '</select>'; |
| 1200 | 1200 | |
| 1201 | 1201 | if ($useajaxcombo) { |
| 1202 | - print ajax_combobox('select_' . $htmlname); |
|
| 1202 | + print ajax_combobox('select_'.$htmlname); |
|
| 1203 | 1203 | } |
| 1204 | 1204 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1205 | 1205 | } |
| 1206 | 1206 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1207 | 1207 | print $langs->trans("Service"); |
| 1208 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1208 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1209 | 1209 | } |
| 1210 | 1210 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1211 | 1211 | print $langs->trans("Product"); |
| 1212 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1212 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1213 | 1213 | } |
| 1214 | 1214 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1215 | - 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 |
|
| 1215 | + 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 |
|
| 1216 | 1216 | } |
| 1217 | 1217 | } |
| 1218 | 1218 | |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | $langs->load("trips"); |
| 1239 | 1239 | |
| 1240 | 1240 | $sql = "SELECT c.code, c.label"; |
| 1241 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1241 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1242 | 1242 | $sql .= " WHERE active > 0"; |
| 1243 | 1243 | |
| 1244 | 1244 | $resql = $this->db->query($sql); |
@@ -1279,11 +1279,11 @@ discard block |
||
| 1279 | 1279 | // phpcs:enable |
| 1280 | 1280 | global $user, $langs; |
| 1281 | 1281 | |
| 1282 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1282 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1283 | 1283 | |
| 1284 | 1284 | $this->load_cache_types_fees(); |
| 1285 | 1285 | |
| 1286 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1286 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1287 | 1287 | if ($showempty) { |
| 1288 | 1288 | print '<option value="-1"'; |
| 1289 | 1289 | if ($selected == -1) { |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | } |
| 1294 | 1294 | |
| 1295 | 1295 | foreach ($this->cache_types_fees as $key => $value) { |
| 1296 | - print '<option value="' . $key . '"'; |
|
| 1296 | + print '<option value="'.$key.'"'; |
|
| 1297 | 1297 | if ($key == $selected) { |
| 1298 | 1298 | print ' selected'; |
| 1299 | 1299 | } |
@@ -1345,12 +1345,12 @@ discard block |
||
| 1345 | 1345 | $ajaxoptions = array(); |
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1348 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1349 | 1349 | |
| 1350 | 1350 | // No immediate load of all database |
| 1351 | 1351 | $placeholder = ''; |
| 1352 | 1352 | if ($selected && empty($selected_input_value)) { |
| 1353 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1353 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1354 | 1354 | $societetmp = new Societe($this->db); |
| 1355 | 1355 | $societetmp->fetch($selected); |
| 1356 | 1356 | $selected_input_value = $societetmp->name; |
@@ -1358,11 +1358,11 @@ discard block |
||
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | 1360 | // mode 1 |
| 1361 | - $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)) : ''); |
|
| 1361 | + $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)) : ''); |
|
| 1362 | 1362 | |
| 1363 | 1363 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1364 | 1364 | if (empty($hidelabel)) { |
| 1365 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 1365 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 1366 | 1366 | } elseif ($hidelabel == 1 && !is_numeric($showempty)) { |
| 1367 | 1367 | $placeholder = $langs->trans($showempty); |
| 1368 | 1368 | } elseif ($hidelabel > 1) { |
@@ -1371,7 +1371,7 @@ discard block |
||
| 1371 | 1371 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1372 | 1372 | } |
| 1373 | 1373 | } |
| 1374 | - $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' : '') . ' />'; |
|
| 1374 | + $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' : '').' />'; |
|
| 1375 | 1375 | if ($hidelabel == 3) { |
| 1376 | 1376 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1377 | 1377 | } |
@@ -1433,12 +1433,12 @@ discard block |
||
| 1433 | 1433 | $events = array(); |
| 1434 | 1434 | } |
| 1435 | 1435 | |
| 1436 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1436 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1437 | 1437 | |
| 1438 | 1438 | // No immediate load of all database |
| 1439 | 1439 | $placeholder = ''; |
| 1440 | 1440 | if ($selected && empty($selected_input_value)) { |
| 1441 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1441 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1442 | 1442 | $contacttmp = new Contact($this->db); |
| 1443 | 1443 | $contacttmp->fetch($selected); |
| 1444 | 1444 | $selected_input_value = $contacttmp->getFullName($langs); |
@@ -1449,11 +1449,11 @@ discard block |
||
| 1449 | 1449 | } |
| 1450 | 1450 | |
| 1451 | 1451 | // mode 1 |
| 1452 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : ''); |
|
| 1452 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : ''); |
|
| 1453 | 1453 | |
| 1454 | 1454 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1455 | 1455 | |
| 1456 | - $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' : '') . ' />'; |
|
| 1456 | + $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' : '').' />'; |
|
| 1457 | 1457 | |
| 1458 | 1458 | $out .= ajax_event($htmlname, $events); |
| 1459 | 1459 | |
@@ -1552,30 +1552,30 @@ discard block |
||
| 1552 | 1552 | $sql .= ", s.address, s.zip, s.town"; |
| 1553 | 1553 | $sql .= ", dictp.code as country_code"; |
| 1554 | 1554 | } |
| 1555 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1555 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1556 | 1556 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1557 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1557 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1558 | 1558 | } |
| 1559 | 1559 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1560 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1560 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1561 | 1561 | } |
| 1562 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1562 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1563 | 1563 | if (!empty($user->socid)) { |
| 1564 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1564 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1565 | 1565 | } |
| 1566 | 1566 | if ($filter) { |
| 1567 | 1567 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1568 | 1568 | // if not, by testSqlAndScriptInject() only. |
| 1569 | - $sql .= " AND (" . $filter . ")"; |
|
| 1569 | + $sql .= " AND (".$filter.")"; |
|
| 1570 | 1570 | } |
| 1571 | 1571 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1572 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1572 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1573 | 1573 | } |
| 1574 | 1574 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1575 | 1575 | $sql .= " AND s.status <> 0"; |
| 1576 | 1576 | } |
| 1577 | 1577 | if (!empty($excludeids)) { |
| 1578 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
| 1578 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
| 1579 | 1579 | } |
| 1580 | 1580 | // Add where from hooks |
| 1581 | 1581 | $parameters = array(); |
@@ -1595,17 +1595,17 @@ discard block |
||
| 1595 | 1595 | if ($i > 0) { |
| 1596 | 1596 | $sql .= " AND "; |
| 1597 | 1597 | } |
| 1598 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1598 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1599 | 1599 | $i++; |
| 1600 | 1600 | } |
| 1601 | 1601 | if (count($search_crit) > 1) { |
| 1602 | 1602 | $sql .= ")"; |
| 1603 | 1603 | } |
| 1604 | 1604 | if (isModEnabled('barcode')) { |
| 1605 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1605 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1606 | 1606 | } |
| 1607 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1608 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1607 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1608 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1609 | 1609 | $sql .= ")"; |
| 1610 | 1610 | } |
| 1611 | 1611 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1616,7 +1616,7 @@ discard block |
||
| 1616 | 1616 | $resql = $this->db->query($sql); |
| 1617 | 1617 | if ($resql) { |
| 1618 | 1618 | // Construct $out and $outarray |
| 1619 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1619 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1620 | 1620 | |
| 1621 | 1621 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1622 | 1622 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | } |
| 1630 | 1630 | } |
| 1631 | 1631 | if ($showempty) { |
| 1632 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1632 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | |
| 1635 | 1635 | $companytemp = new Societe($this->db); |
@@ -1642,18 +1642,18 @@ discard block |
||
| 1642 | 1642 | $label = ''; |
| 1643 | 1643 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
| 1644 | 1644 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1645 | - $label = $obj->code_client . ' - '; |
|
| 1645 | + $label = $obj->code_client.' - '; |
|
| 1646 | 1646 | } |
| 1647 | 1647 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1648 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1648 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1649 | 1649 | } |
| 1650 | - $label .= ' ' . $obj->name; |
|
| 1650 | + $label .= ' '.$obj->name; |
|
| 1651 | 1651 | } else { |
| 1652 | 1652 | $label = $obj->name; |
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | if (!empty($obj->name_alias)) { |
| 1656 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1656 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1657 | 1657 | } |
| 1658 | 1658 | |
| 1659 | 1659 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1668,7 +1668,7 @@ discard block |
||
| 1668 | 1668 | $companytemp->fournisseur = $obj->fournisseur; |
| 1669 | 1669 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1670 | 1670 | if ($tmptype) { |
| 1671 | - $labelhtml .= ' ' . $tmptype; |
|
| 1671 | + $labelhtml .= ' '.$tmptype; |
|
| 1672 | 1672 | } |
| 1673 | 1673 | |
| 1674 | 1674 | if ($obj->client || $obj->fournisseur) { |
@@ -1678,10 +1678,10 @@ discard block |
||
| 1678 | 1678 | $label .= $langs->trans("Customer"); |
| 1679 | 1679 | } |
| 1680 | 1680 | if ($obj->client == 2 || $obj->client == 3) { |
| 1681 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1681 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1682 | 1682 | } |
| 1683 | 1683 | if ($obj->fournisseur) { |
| 1684 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1684 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1685 | 1685 | } |
| 1686 | 1686 | if ($obj->client || $obj->fournisseur) { |
| 1687 | 1687 | $label .= ')'; |
@@ -1689,9 +1689,9 @@ discard block |
||
| 1689 | 1689 | } |
| 1690 | 1690 | |
| 1691 | 1691 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1692 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1692 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1693 | 1693 | if (!empty($obj->country_code)) { |
| 1694 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1694 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1695 | 1695 | } |
| 1696 | 1696 | $label .= $s; |
| 1697 | 1697 | $labelhtml .= $s; |
@@ -1699,9 +1699,9 @@ discard block |
||
| 1699 | 1699 | |
| 1700 | 1700 | if (empty($outputmode)) { |
| 1701 | 1701 | if (in_array($obj->rowid, $selected)) { |
| 1702 | - $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>'; |
|
| 1702 | + $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>'; |
|
| 1703 | 1703 | } else { |
| 1704 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1704 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1705 | 1705 | } |
| 1706 | 1706 | } else { |
| 1707 | 1707 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1713,9 +1713,9 @@ discard block |
||
| 1713 | 1713 | } |
| 1714 | 1714 | } |
| 1715 | 1715 | } |
| 1716 | - $out .= '</select>' . "\n"; |
|
| 1716 | + $out .= '</select>'."\n"; |
|
| 1717 | 1717 | if (!$forcecombo) { |
| 1718 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1718 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1719 | 1719 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1720 | 1720 | } |
| 1721 | 1721 | } else { |
@@ -1804,7 +1804,7 @@ discard block |
||
| 1804 | 1804 | } |
| 1805 | 1805 | |
| 1806 | 1806 | if (!is_object($hookmanager)) { |
| 1807 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1807 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1808 | 1808 | $hookmanager = new HookManager($this->db); |
| 1809 | 1809 | } |
| 1810 | 1810 | |
@@ -1813,14 +1813,14 @@ discard block |
||
| 1813 | 1813 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1814 | 1814 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1815 | 1815 | } |
| 1816 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1816 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1817 | 1817 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1818 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1818 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1819 | 1819 | } |
| 1820 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1820 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1821 | 1821 | $sql .= " AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0)"; // check if this is a private contact |
| 1822 | 1822 | if ($socid > 0 || $socid == -1) { |
| 1823 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1823 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1824 | 1824 | } |
| 1825 | 1825 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1826 | 1826 | $sql .= " AND sp.statut <> 0"; |
@@ -1828,7 +1828,7 @@ discard block |
||
| 1828 | 1828 | if ($filter) { |
| 1829 | 1829 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1830 | 1830 | // if not, by testSqlAndScriptInject() only. |
| 1831 | - $sql .= " AND (" . $filter . ")"; |
|
| 1831 | + $sql .= " AND (".$filter.")"; |
|
| 1832 | 1832 | } |
| 1833 | 1833 | // Add where from hooks |
| 1834 | 1834 | $parameters = array(); |
@@ -1836,30 +1836,30 @@ discard block |
||
| 1836 | 1836 | $sql .= $hookmanager->resPrint; |
| 1837 | 1837 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1838 | 1838 | |
| 1839 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1839 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1840 | 1840 | $resql = $this->db->query($sql); |
| 1841 | 1841 | if ($resql) { |
| 1842 | 1842 | $num = $this->db->num_rows($resql); |
| 1843 | 1843 | |
| 1844 | 1844 | if ($htmlname != 'none' && !$options_only) { |
| 1845 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1845 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1846 | 1846 | } |
| 1847 | 1847 | |
| 1848 | 1848 | if ($showempty && !is_numeric($showempty)) { |
| 1849 | 1849 | $textforempty = $showempty; |
| 1850 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1850 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1851 | 1851 | } else { |
| 1852 | 1852 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1853 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1853 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1854 | 1854 | } |
| 1855 | 1855 | if ($showempty == 2) { |
| 1856 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1856 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1857 | 1857 | } |
| 1858 | 1858 | } |
| 1859 | 1859 | |
| 1860 | 1860 | $i = 0; |
| 1861 | 1861 | if ($num) { |
| 1862 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1862 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1863 | 1863 | $contactstatic = new Contact($this->db); |
| 1864 | 1864 | |
| 1865 | 1865 | while ($i < $num) { |
@@ -1895,7 +1895,7 @@ discard block |
||
| 1895 | 1895 | } |
| 1896 | 1896 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1897 | 1897 | if (!empty($extendedInfos)) { |
| 1898 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1898 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1899 | 1899 | } |
| 1900 | 1900 | } |
| 1901 | 1901 | |
@@ -1913,35 +1913,35 @@ discard block |
||
| 1913 | 1913 | $disabled = 1; |
| 1914 | 1914 | } |
| 1915 | 1915 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1916 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1916 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1917 | 1917 | if ($disabled) { |
| 1918 | 1918 | $out .= ' disabled'; |
| 1919 | 1919 | } |
| 1920 | 1920 | $out .= ' selected>'; |
| 1921 | 1921 | |
| 1922 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1922 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1923 | 1923 | if ($showfunction && $obj->poste) { |
| 1924 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1924 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1925 | 1925 | } |
| 1926 | 1926 | if (($showsoc > 0) && $obj->company) { |
| 1927 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1927 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1928 | 1928 | } |
| 1929 | 1929 | |
| 1930 | 1930 | $out .= $tmplabel; |
| 1931 | 1931 | $out .= '</option>'; |
| 1932 | 1932 | } else { |
| 1933 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1933 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1934 | 1934 | if ($disabled) { |
| 1935 | 1935 | $out .= ' disabled'; |
| 1936 | 1936 | } |
| 1937 | 1937 | $out .= '>'; |
| 1938 | 1938 | |
| 1939 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1939 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1940 | 1940 | if ($showfunction && $obj->poste) { |
| 1941 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1941 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1942 | 1942 | } |
| 1943 | 1943 | if (($showsoc > 0) && $obj->company) { |
| 1944 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1944 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1945 | 1945 | } |
| 1946 | 1946 | |
| 1947 | 1947 | $out .= $tmplabel; |
@@ -1949,12 +1949,12 @@ discard block |
||
| 1949 | 1949 | } |
| 1950 | 1950 | } else { |
| 1951 | 1951 | if (in_array($obj->rowid, $selected)) { |
| 1952 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1952 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1953 | 1953 | if ($showfunction && $obj->poste) { |
| 1954 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
| 1954 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
| 1955 | 1955 | } |
| 1956 | 1956 | if (($showsoc > 0) && $obj->company) { |
| 1957 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
| 1957 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
| 1958 | 1958 | } |
| 1959 | 1959 | |
| 1960 | 1960 | $out .= $tmplabel; |
@@ -1969,7 +1969,7 @@ discard block |
||
| 1969 | 1969 | } |
| 1970 | 1970 | } else { |
| 1971 | 1971 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1972 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1972 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1973 | 1973 | $out .= $labeltoshow; |
| 1974 | 1974 | $out .= '</option>'; |
| 1975 | 1975 | } |
@@ -1990,7 +1990,7 @@ discard block |
||
| 1990 | 1990 | } |
| 1991 | 1991 | |
| 1992 | 1992 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1993 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1993 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1994 | 1994 | $out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1995 | 1995 | } |
| 1996 | 1996 | |
@@ -2029,18 +2029,18 @@ discard block |
||
| 2029 | 2029 | // On recherche les remises |
| 2030 | 2030 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 2031 | 2031 | $sql .= " re.description, re.fk_facture_source"; |
| 2032 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 2033 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 2034 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 2032 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 2033 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 2034 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 2035 | 2035 | if ($filter) { |
| 2036 | - $sql .= " AND " . $filter; |
|
| 2036 | + $sql .= " AND ".$filter; |
|
| 2037 | 2037 | } |
| 2038 | 2038 | $sql .= " ORDER BY re.description ASC"; |
| 2039 | 2039 | |
| 2040 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 2040 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 2041 | 2041 | $resql = $this->db->query($sql); |
| 2042 | 2042 | if ($resql) { |
| 2043 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 2043 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 2044 | 2044 | $num = $this->db->num_rows($resql); |
| 2045 | 2045 | |
| 2046 | 2046 | $qualifiedlines = $num; |
@@ -2078,16 +2078,16 @@ discard block |
||
| 2078 | 2078 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
| 2079 | 2079 | $tmpfac = new Facture($this->db); |
| 2080 | 2080 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 2081 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 2081 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 2082 | 2082 | } |
| 2083 | 2083 | } |
| 2084 | 2084 | |
| 2085 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 2085 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 2086 | 2086 | $i++; |
| 2087 | 2087 | } |
| 2088 | 2088 | } |
| 2089 | 2089 | print '</select>'; |
| 2090 | - print ajax_combobox('select_' . $htmlname); |
|
| 2090 | + print ajax_combobox('select_'.$htmlname); |
|
| 2091 | 2091 | |
| 2092 | 2092 | return $qualifiedlines; |
| 2093 | 2093 | } else { |
@@ -2196,14 +2196,14 @@ discard block |
||
| 2196 | 2196 | if ($showlabelofentity) { |
| 2197 | 2197 | $sql .= ", e.label"; |
| 2198 | 2198 | } |
| 2199 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2199 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2200 | 2200 | if ($showlabelofentity) { |
| 2201 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2201 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2202 | 2202 | } |
| 2203 | 2203 | // Condition here should be the same than into societe->getSalesRepresentatives(). |
| 2204 | 2204 | if ($userissuperadminentityone && $force_entity != 'default') { |
| 2205 | 2205 | if (!empty($force_entity)) { |
| 2206 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2206 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2207 | 2207 | } else { |
| 2208 | 2208 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2209 | 2209 | } |
@@ -2211,18 +2211,18 @@ discard block |
||
| 2211 | 2211 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2212 | 2212 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2213 | 2213 | } else { |
| 2214 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2214 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2215 | 2215 | } |
| 2216 | 2216 | } |
| 2217 | 2217 | |
| 2218 | 2218 | if (!empty($user->socid)) { |
| 2219 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2219 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2220 | 2220 | } |
| 2221 | 2221 | if (is_array($exclude) && $excludeUsers) { |
| 2222 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2222 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2223 | 2223 | } |
| 2224 | 2224 | if ($includeUsers) { |
| 2225 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2225 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2226 | 2226 | } |
| 2227 | 2227 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
| 2228 | 2228 | $sql .= " AND u.statut <> 0"; |
@@ -2259,7 +2259,7 @@ discard block |
||
| 2259 | 2259 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2260 | 2260 | } |
| 2261 | 2261 | |
| 2262 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2262 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2263 | 2263 | |
| 2264 | 2264 | $resql = $this->db->query($sql); |
| 2265 | 2265 | if ($resql) { |
@@ -2267,7 +2267,7 @@ discard block |
||
| 2267 | 2267 | $i = 0; |
| 2268 | 2268 | if ($num) { |
| 2269 | 2269 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2270 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2270 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2271 | 2271 | if ($show_empty && !$multiple) { |
| 2272 | 2272 | $textforempty = ' '; |
| 2273 | 2273 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2276,7 +2276,7 @@ discard block |
||
| 2276 | 2276 | if (!is_numeric($show_empty)) { |
| 2277 | 2277 | $textforempty = $show_empty; |
| 2278 | 2278 | } |
| 2279 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2279 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2280 | 2280 | |
| 2281 | 2281 | $outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty; |
| 2282 | 2282 | $outarray2[($show_empty < 0 ? $show_empty : -1)] = array( |
@@ -2288,13 +2288,13 @@ discard block |
||
| 2288 | 2288 | ); |
| 2289 | 2289 | } |
| 2290 | 2290 | if ($show_every) { |
| 2291 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2291 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2292 | 2292 | |
| 2293 | - $outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --'; |
|
| 2293 | + $outarray[-2] = '-- '.$langs->trans("Everybody").' --'; |
|
| 2294 | 2294 | $outarray2[-2] = array( |
| 2295 | 2295 | 'id' => -2, |
| 2296 | - 'label' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2297 | - 'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --', |
|
| 2296 | + 'label' => '-- '.$langs->trans("Everybody").' --', |
|
| 2297 | + 'labelhtml' => '-- '.$langs->trans("Everybody").' --', |
|
| 2298 | 2298 | 'color' => '', |
| 2299 | 2299 | 'picto' => '' |
| 2300 | 2300 | ); |
@@ -2345,21 +2345,21 @@ discard block |
||
| 2345 | 2345 | } |
| 2346 | 2346 | if ($showstatus >= 0) { |
| 2347 | 2347 | if ($obj->status == 1 && $showstatus == 1) { |
| 2348 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2349 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2348 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2349 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2350 | 2350 | } |
| 2351 | 2351 | if ($obj->status == 0 && $showstatus == 1) { |
| 2352 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2353 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2352 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2353 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2354 | 2354 | } |
| 2355 | 2355 | } |
| 2356 | 2356 | if ($showlabelofentity) { |
| 2357 | 2357 | if (empty($obj->entity)) { |
| 2358 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2359 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2358 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2359 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2360 | 2360 | } else { |
| 2361 | 2361 | if ($obj->entity != $conf->entity) { |
| 2362 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2362 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2363 | 2363 | $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
| 2364 | 2364 | } |
| 2365 | 2365 | } |
@@ -2368,13 +2368,13 @@ discard block |
||
| 2368 | 2368 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2369 | 2369 | if (!empty($disableline) && $disableline != '1') { |
| 2370 | 2370 | // Add text from $enableonlytext parameter |
| 2371 | - $moreinfo .= ' - ' . $disableline; |
|
| 2372 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2371 | + $moreinfo .= ' - '.$disableline; |
|
| 2372 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2373 | 2373 | } |
| 2374 | 2374 | $labeltoshow .= $moreinfo; |
| 2375 | 2375 | $labeltoshowhtml .= $moreinfohtml; |
| 2376 | 2376 | |
| 2377 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2377 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2378 | 2378 | if (!empty($disableline)) { |
| 2379 | 2379 | $out .= ' disabled'; |
| 2380 | 2380 | } |
@@ -2383,7 +2383,7 @@ discard block |
||
| 2383 | 2383 | } |
| 2384 | 2384 | $out .= ' data-html="'; |
| 2385 | 2385 | |
| 2386 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2386 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2387 | 2387 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2388 | 2388 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2389 | 2389 | } |
@@ -2398,7 +2398,7 @@ discard block |
||
| 2398 | 2398 | $out .= $labeltoshow; |
| 2399 | 2399 | $out .= '</option>'; |
| 2400 | 2400 | |
| 2401 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2401 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2402 | 2402 | $outarray2[$userstatic->id] = array( |
| 2403 | 2403 | 'id' => $userstatic->id, |
| 2404 | 2404 | 'label' => $labeltoshow, |
@@ -2410,14 +2410,14 @@ discard block |
||
| 2410 | 2410 | $i++; |
| 2411 | 2411 | } |
| 2412 | 2412 | } else { |
| 2413 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2414 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2413 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2414 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2415 | 2415 | } |
| 2416 | 2416 | $out .= '</select>'; |
| 2417 | 2417 | |
| 2418 | 2418 | if ($num && !$forcecombo) { |
| 2419 | 2419 | // Enhance with select2 |
| 2420 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2420 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2421 | 2421 | $out .= ajax_combobox($htmlname); |
| 2422 | 2422 | } |
| 2423 | 2423 | } else { |
@@ -2494,7 +2494,7 @@ discard block |
||
| 2494 | 2494 | $out .= $userstatic->getNomUrl(-1); |
| 2495 | 2495 | if ($i == 0) { |
| 2496 | 2496 | $ownerid = $value['id']; |
| 2497 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2497 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2498 | 2498 | } |
| 2499 | 2499 | // Add picto to delete owner/assignee |
| 2500 | 2500 | if ($nbassignetouser > 1 && $action != 'view') { |
@@ -2505,7 +2505,7 @@ discard block |
||
| 2505 | 2505 | $canremoveassignee = 0; |
| 2506 | 2506 | } |
| 2507 | 2507 | if (!$user->hasRight('agenda', 'allactions', 'create')) { |
| 2508 | - $canremoveassignee = 0; // Can't remove the owner |
|
| 2508 | + $canremoveassignee = 0; // Can't remove the owner |
|
| 2509 | 2509 | } |
| 2510 | 2510 | } else { |
| 2511 | 2511 | // We are not on the owner of the event but on a secondary assignee |
@@ -2513,14 +2513,14 @@ discard block |
||
| 2513 | 2513 | if ($canremoveassignee) { |
| 2514 | 2514 | // If user has all permission, he should be ableto remove a assignee. |
| 2515 | 2515 | // If user has not all permission, he can onlyremove assignee of other (he can't remove itself) |
| 2516 | - $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 . '">'; |
|
| 2516 | + $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.'">'; |
|
| 2517 | 2517 | } |
| 2518 | 2518 | } |
| 2519 | 2519 | // Show my availability |
| 2520 | 2520 | if ($showproperties) { |
| 2521 | 2521 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2522 | 2522 | $out .= '<div class="myavailability inline-block">'; |
| 2523 | - $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>'; |
|
| 2523 | + $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>'; |
|
| 2524 | 2524 | $out .= '</div>'; |
| 2525 | 2525 | } |
| 2526 | 2526 | } |
@@ -2537,15 +2537,15 @@ discard block |
||
| 2537 | 2537 | // Method with no ajax |
| 2538 | 2538 | if ($action != 'view') { |
| 2539 | 2539 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2540 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2540 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2541 | 2541 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2542 | 2542 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2543 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2544 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2543 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2544 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2545 | 2545 | $out .= '});'; |
| 2546 | 2546 | $out .= '})</script>'; |
| 2547 | 2547 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2548 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2548 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2549 | 2549 | $out .= '<br>'; |
| 2550 | 2550 | } |
| 2551 | 2551 | |
@@ -2604,13 +2604,13 @@ discard block |
||
| 2604 | 2604 | $resourcestatic->fetch($value['id']); |
| 2605 | 2605 | $out .= $resourcestatic->getNomUrl(-1); |
| 2606 | 2606 | if ($nbassignetoresource >= 1 && $action != 'view') { |
| 2607 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassignedresource reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
| 2607 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassignedresource reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
|
| 2608 | 2608 | } |
| 2609 | 2609 | // Show my availability |
| 2610 | 2610 | if ($showproperties) { |
| 2611 | 2611 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2612 | 2612 | $out .= '<div class="myavailability inline-block">'; |
| 2613 | - $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>'; |
|
| 2613 | + $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>'; |
|
| 2614 | 2614 | $out .= '</div>'; |
| 2615 | 2615 | } |
| 2616 | 2616 | } |
@@ -2627,11 +2627,11 @@ discard block |
||
| 2627 | 2627 | // Method with no ajax |
| 2628 | 2628 | if ($action != 'view') { |
| 2629 | 2629 | $out .= '<input type="hidden" class="removedassignedresourcehidden" name="removedassignedresource" value="">'; |
| 2630 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2630 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2631 | 2631 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2632 | 2632 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2633 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2634 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2633 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2634 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2635 | 2635 | $out .= '});'; |
| 2636 | 2636 | $out .= '})</script>'; |
| 2637 | 2637 | |
@@ -2639,7 +2639,7 @@ discard block |
||
| 2639 | 2639 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2640 | 2640 | $out .= $formresources->select_resource_list(0, $htmlname, '', 1, 1, 0, $events, '', 2, 0); |
| 2641 | 2641 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2642 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2642 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2643 | 2643 | $out .= '<br>'; |
| 2644 | 2644 | } |
| 2645 | 2645 | |
@@ -2702,7 +2702,7 @@ discard block |
||
| 2702 | 2702 | $placeholder = (is_numeric($showempty) ? '' : 'placeholder="'.dolPrintHTML($showempty).'"'); |
| 2703 | 2703 | |
| 2704 | 2704 | if ($selected && empty($selected_input_value)) { |
| 2705 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2705 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2706 | 2706 | $producttmpselect = new Product($this->db); |
| 2707 | 2707 | $producttmpselect->fetch($selected); |
| 2708 | 2708 | $selected_input_value = $producttmpselect->ref; |
@@ -2717,21 +2717,21 @@ discard block |
||
| 2717 | 2717 | } |
| 2718 | 2718 | } |
| 2719 | 2719 | // mode=1 means customers products |
| 2720 | - $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; |
|
| 2720 | + $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; |
|
| 2721 | 2721 | if ((int) $warehouseId > 0) { |
| 2722 | - $urloption .= '&warehouseid=' . (int) $warehouseId; |
|
| 2722 | + $urloption .= '&warehouseid='.(int) $warehouseId; |
|
| 2723 | 2723 | } |
| 2724 | 2724 | |
| 2725 | - $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); |
|
| 2725 | + $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); |
|
| 2726 | 2726 | |
| 2727 | 2727 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2728 | 2728 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2729 | 2729 | // when a parent of variant has been selected. |
| 2730 | 2730 | $out .= ' |
| 2731 | 2731 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2732 | - <script nonce="' . getNonce() . '"> |
|
| 2732 | + <script nonce="' . getNonce().'"> |
|
| 2733 | 2733 | // auto show attributes fields |
| 2734 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2734 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2735 | 2735 | combvalues = {}; |
| 2736 | 2736 | |
| 2737 | 2737 | jQuery(document).ready(function () { |
@@ -2742,7 +2742,7 @@ discard block |
||
| 2742 | 2742 | } |
| 2743 | 2743 | }); |
| 2744 | 2744 | |
| 2745 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2745 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2746 | 2746 | |
| 2747 | 2747 | if (!jQuery(this).val()) { |
| 2748 | 2748 | jQuery(\'div#attributes_box\').empty(); |
@@ -2751,7 +2751,7 @@ discard block |
||
| 2751 | 2751 | |
| 2752 | 2752 | console.log("A change has started. We get variants fields to inject html select"); |
| 2753 | 2753 | |
| 2754 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2754 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2755 | 2755 | id: jQuery(this).val() |
| 2756 | 2756 | }, function (data) { |
| 2757 | 2757 | jQuery(\'div#attributes_box\').empty(); |
@@ -2794,22 +2794,22 @@ discard block |
||
| 2794 | 2794 | }) |
| 2795 | 2795 | }); |
| 2796 | 2796 | |
| 2797 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2797 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2798 | 2798 | }); |
| 2799 | 2799 | </script> |
| 2800 | 2800 | '; |
| 2801 | 2801 | } |
| 2802 | 2802 | |
| 2803 | 2803 | if (empty($hidelabel)) { |
| 2804 | - $placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"'; |
|
| 2804 | + $placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"'; |
|
| 2805 | 2805 | } elseif ($hidelabel > 1) { |
| 2806 | - $placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"'; |
|
| 2806 | + $placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"'; |
|
| 2807 | 2807 | if ($hidelabel == 2) { |
| 2808 | 2808 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2809 | 2809 | } |
| 2810 | 2810 | } |
| 2811 | 2811 | |
| 2812 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 2812 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 2813 | 2813 | if ($hidelabel == 3) { |
| 2814 | 2814 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2815 | 2815 | } |
@@ -2846,33 +2846,33 @@ discard block |
||
| 2846 | 2846 | // phpcs:enable |
| 2847 | 2847 | global $db; |
| 2848 | 2848 | |
| 2849 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2849 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2850 | 2850 | |
| 2851 | 2851 | $error = 0; |
| 2852 | 2852 | $out = ''; |
| 2853 | 2853 | |
| 2854 | 2854 | if (!$forcecombo) { |
| 2855 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2855 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2856 | 2856 | $events = array(); |
| 2857 | 2857 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2858 | 2858 | } |
| 2859 | 2859 | |
| 2860 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2860 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2861 | 2861 | |
| 2862 | 2862 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2863 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2864 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2863 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2864 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2865 | 2865 | if (!empty($status)) { |
| 2866 | - $sql .= ' AND status = ' . (int) $status; |
|
| 2866 | + $sql .= ' AND status = '.(int) $status; |
|
| 2867 | 2867 | } |
| 2868 | 2868 | if (!empty($type)) { |
| 2869 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2869 | + $sql .= ' AND bomtype = '.(int) $type; |
|
| 2870 | 2870 | } |
| 2871 | 2871 | if (!empty($TProducts)) { |
| 2872 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2872 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2873 | 2873 | } |
| 2874 | 2874 | if (!empty($limit)) { |
| 2875 | - $sql .= ' LIMIT ' . (int) $limit; |
|
| 2875 | + $sql .= ' LIMIT '.(int) $limit; |
|
| 2876 | 2876 | } |
| 2877 | 2877 | $resql = $db->query($sql); |
| 2878 | 2878 | if ($resql) { |
@@ -2886,11 +2886,11 @@ discard block |
||
| 2886 | 2886 | while ($obj = $db->fetch_object($resql)) { |
| 2887 | 2887 | $product = new Product($db); |
| 2888 | 2888 | $res = $product->fetch($obj->fk_product); |
| 2889 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2889 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2890 | 2890 | if ($obj->rowid == $selected) { |
| 2891 | 2891 | $out .= 'selected'; |
| 2892 | 2892 | } |
| 2893 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2893 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2894 | 2894 | } |
| 2895 | 2895 | } else { |
| 2896 | 2896 | $error++; |
@@ -2948,7 +2948,7 @@ discard block |
||
| 2948 | 2948 | |
| 2949 | 2949 | $warehouseStatusArray = array(); |
| 2950 | 2950 | if (!empty($warehouseStatus)) { |
| 2951 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2951 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2952 | 2952 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2953 | 2953 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2954 | 2954 | } |
@@ -2962,9 +2962,9 @@ discard block |
||
| 2962 | 2962 | |
| 2963 | 2963 | $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"; |
| 2964 | 2964 | if (count($warehouseStatusArray)) { |
| 2965 | - $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 |
|
| 2965 | + $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 |
|
| 2966 | 2966 | } else { |
| 2967 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2967 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2968 | 2968 | } |
| 2969 | 2969 | |
| 2970 | 2970 | $sql = "SELECT "; |
@@ -2980,9 +2980,9 @@ discard block |
||
| 2980 | 2980 | |
| 2981 | 2981 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
| 2982 | 2982 | //Product category |
| 2983 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2984 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2985 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2983 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2984 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2985 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2986 | 2986 | LIMIT 1 |
| 2987 | 2987 | ) AS categorie_product_id "; |
| 2988 | 2988 | } |
@@ -3008,15 +3008,15 @@ discard block |
||
| 3008 | 3008 | } |
| 3009 | 3009 | // Price by quantity |
| 3010 | 3010 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 3011 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 3011 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 3012 | 3012 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 3013 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3013 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3014 | 3014 | } |
| 3015 | 3015 | $sql .= " ORDER BY date_price"; |
| 3016 | 3016 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 3017 | - $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 |
|
| 3017 | + $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 |
|
| 3018 | 3018 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 3019 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3019 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3020 | 3020 | } |
| 3021 | 3021 | $sql .= " ORDER BY date_price"; |
| 3022 | 3022 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -3026,7 +3026,7 @@ discard block |
||
| 3026 | 3026 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
| 3027 | 3027 | |
| 3028 | 3028 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) { |
| 3029 | - $sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")"; |
|
| 3029 | + $sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")"; |
|
| 3030 | 3030 | } |
| 3031 | 3031 | |
| 3032 | 3032 | // Add from (left join) from hooks |
@@ -3035,48 +3035,48 @@ discard block |
||
| 3035 | 3035 | $sql .= $hookmanager->resPrint; |
| 3036 | 3036 | |
| 3037 | 3037 | if (count($warehouseStatusArray)) { |
| 3038 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3039 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 3040 | - $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. |
|
| 3038 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 3039 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 3040 | + $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. |
|
| 3041 | 3041 | } |
| 3042 | 3042 | |
| 3043 | 3043 | //Price by customer |
| 3044 | 3044 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
| 3045 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 3045 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 3046 | 3046 | } |
| 3047 | 3047 | // Units |
| 3048 | 3048 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3049 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3049 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3050 | 3050 | } |
| 3051 | 3051 | // Multilang : we add translation |
| 3052 | 3052 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3053 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3053 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 3054 | 3054 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
| 3055 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 3055 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 3056 | 3056 | $soc = new Societe($this->db); |
| 3057 | 3057 | $result = $soc->fetch($socid); |
| 3058 | 3058 | if ($result > 0 && !empty($soc->default_lang)) { |
| 3059 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 3059 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 3060 | 3060 | } else { |
| 3061 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3061 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3062 | 3062 | } |
| 3063 | 3063 | } else { |
| 3064 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 3064 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 3065 | 3065 | } |
| 3066 | 3066 | } |
| 3067 | 3067 | |
| 3068 | 3068 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3069 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3069 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 3070 | 3070 | } |
| 3071 | 3071 | |
| 3072 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 3072 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 3073 | 3073 | |
| 3074 | 3074 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 3075 | 3075 | $sql .= " AND pac.rowid IS NULL"; |
| 3076 | 3076 | } |
| 3077 | 3077 | |
| 3078 | 3078 | if ($finished == 0) { |
| 3079 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 3079 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 3080 | 3080 | } elseif ($finished == 1) { |
| 3081 | 3081 | $sql .= " AND p.finished = ".((int) $finished); |
| 3082 | 3082 | } |
@@ -3084,11 +3084,11 @@ discard block |
||
| 3084 | 3084 | $sql .= " AND p.tosell = ".((int) $status); |
| 3085 | 3085 | } |
| 3086 | 3086 | if ($status_purchase >= 0) { |
| 3087 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 3087 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 3088 | 3088 | } |
| 3089 | 3089 | // Filter by product type |
| 3090 | 3090 | if (strval($filtertype) != '') { |
| 3091 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3091 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3092 | 3092 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 3093 | 3093 | $sql .= " AND p.fk_product_type = 1"; |
| 3094 | 3094 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -3096,7 +3096,7 @@ discard block |
||
| 3096 | 3096 | } |
| 3097 | 3097 | |
| 3098 | 3098 | if ((int) $warehouseId > 0) { |
| 3099 | - $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)"; |
|
| 3099 | + $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)"; |
|
| 3100 | 3100 | } |
| 3101 | 3101 | |
| 3102 | 3102 | // Add where from hooks |
@@ -3105,7 +3105,7 @@ discard block |
||
| 3105 | 3105 | $sql .= $hookmanager->resPrint; |
| 3106 | 3106 | // Add criteria on ref/label |
| 3107 | 3107 | if ($filterkey != '') { |
| 3108 | - $sqlSupplierSearch= ''; |
|
| 3108 | + $sqlSupplierSearch = ''; |
|
| 3109 | 3109 | |
| 3110 | 3110 | $sql .= ' AND ('; |
| 3111 | 3111 | $prefix = !getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on |
@@ -3119,24 +3119,24 @@ discard block |
||
| 3119 | 3119 | if ($i > 0) { |
| 3120 | 3120 | $sql .= " AND "; |
| 3121 | 3121 | } |
| 3122 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3122 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3123 | 3123 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3124 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3124 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3125 | 3125 | } |
| 3126 | 3126 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
| 3127 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3127 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3128 | 3128 | } |
| 3129 | 3129 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
| 3130 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3130 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3131 | 3131 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 3132 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3132 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3133 | 3133 | } |
| 3134 | 3134 | } |
| 3135 | 3135 | |
| 3136 | 3136 | // include search in supplier ref |
| 3137 | 3137 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3138 | - $sqlSupplierSearch .= !empty($sqlSupplierSearch) ? ' OR ':''; |
|
| 3139 | - $sqlSupplierSearch .= " pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3138 | + $sqlSupplierSearch .= !empty($sqlSupplierSearch) ? ' OR ' : ''; |
|
| 3139 | + $sqlSupplierSearch .= " pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3140 | 3140 | } |
| 3141 | 3141 | $sql .= ")"; |
| 3142 | 3142 | $i++; |
@@ -3145,12 +3145,12 @@ discard block |
||
| 3145 | 3145 | $sql .= ")"; |
| 3146 | 3146 | } |
| 3147 | 3147 | if (isModEnabled('barcode')) { |
| 3148 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3148 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3149 | 3149 | } |
| 3150 | 3150 | |
| 3151 | 3151 | // include search in supplier ref |
| 3152 | 3152 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 3153 | - $sql .= " OR EXISTS (SELECT pfp.fk_product FROM " . $this->db->prefix() . "product_fournisseur_price as pfp WHERE p.rowid = pfp.fk_product"; |
|
| 3153 | + $sql .= " OR EXISTS (SELECT pfp.fk_product FROM ".$this->db->prefix()."product_fournisseur_price as pfp WHERE p.rowid = pfp.fk_product"; |
|
| 3154 | 3154 | $sql .= " AND ("; |
| 3155 | 3155 | $sql .= $sqlSupplierSearch; |
| 3156 | 3156 | $sql .= "))"; |
@@ -3159,7 +3159,7 @@ discard block |
||
| 3159 | 3159 | $sql .= ')'; |
| 3160 | 3160 | } |
| 3161 | 3161 | if (count($warehouseStatusArray)) { |
| 3162 | - $sql .= " GROUP BY " . $selectFields; |
|
| 3162 | + $sql .= " GROUP BY ".$selectFields; |
|
| 3163 | 3163 | } |
| 3164 | 3164 | |
| 3165 | 3165 | //Sort by category |
@@ -3174,23 +3174,23 @@ discard block |
||
| 3174 | 3174 | $sql .= $this->db->plimit($limit, 0); |
| 3175 | 3175 | |
| 3176 | 3176 | // Build output string |
| 3177 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 3177 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 3178 | 3178 | $result = $this->db->query($sql); |
| 3179 | 3179 | if ($result) { |
| 3180 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3181 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3182 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3180 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3181 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3182 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3183 | 3183 | |
| 3184 | 3184 | $num = $this->db->num_rows($result); |
| 3185 | 3185 | |
| 3186 | 3186 | $events = array(); |
| 3187 | 3187 | |
| 3188 | 3188 | if (!$forcecombo) { |
| 3189 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3189 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3190 | 3190 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 3191 | 3191 | } |
| 3192 | 3192 | |
| 3193 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 3193 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 3194 | 3194 | |
| 3195 | 3195 | $textifempty = ''; |
| 3196 | 3196 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -3207,7 +3207,7 @@ discard block |
||
| 3207 | 3207 | } |
| 3208 | 3208 | } |
| 3209 | 3209 | if ($showempty) { |
| 3210 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 3210 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 3211 | 3211 | } |
| 3212 | 3212 | |
| 3213 | 3213 | $i = 0; |
@@ -3218,11 +3218,11 @@ discard block |
||
| 3218 | 3218 | |
| 3219 | 3219 | 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 |
| 3220 | 3220 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 3221 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 3222 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 3221 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 3222 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 3223 | 3223 | $sql .= " ORDER BY quantity ASC"; |
| 3224 | 3224 | |
| 3225 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3225 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 3226 | 3226 | $result2 = $this->db->query($sql); |
| 3227 | 3227 | if ($result2) { |
| 3228 | 3228 | $nb_prices = $this->db->num_rows($result2); |
@@ -3260,7 +3260,7 @@ discard block |
||
| 3260 | 3260 | $price_product = new Product($this->db); |
| 3261 | 3261 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3262 | 3262 | |
| 3263 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3263 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3264 | 3264 | $priceparser = new PriceParser($this->db); |
| 3265 | 3265 | $price_result = $priceparser->parseProduct($price_product); |
| 3266 | 3266 | if ($price_result >= 0) { |
@@ -3346,7 +3346,7 @@ discard block |
||
| 3346 | 3346 | $label = $objp->label_translated; |
| 3347 | 3347 | } |
| 3348 | 3348 | if (!empty($filterkey) && $filterkey != '') { |
| 3349 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3349 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3350 | 3350 | } |
| 3351 | 3351 | |
| 3352 | 3352 | $outkey = $objp->rowid; |
@@ -3367,32 +3367,32 @@ discard block |
||
| 3367 | 3367 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3368 | 3368 | |
| 3369 | 3369 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3370 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3370 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3371 | 3371 | } |
| 3372 | 3372 | |
| 3373 | 3373 | // Units |
| 3374 | 3374 | $outvalUnits = ''; |
| 3375 | 3375 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3376 | 3376 | if (!empty($objp->unit_short)) { |
| 3377 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3377 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3378 | 3378 | } |
| 3379 | 3379 | } |
| 3380 | 3380 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
| 3381 | 3381 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3382 | 3382 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3383 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3383 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3384 | 3384 | } |
| 3385 | 3385 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3386 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3387 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3386 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3387 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3388 | 3388 | } |
| 3389 | 3389 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3390 | 3390 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3391 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3391 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3392 | 3392 | } |
| 3393 | 3393 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3394 | 3394 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3395 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3395 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3396 | 3396 | } |
| 3397 | 3397 | } |
| 3398 | 3398 | if ($outdurationvalue && $outdurationunit) { |
@@ -3404,7 +3404,7 @@ discard block |
||
| 3404 | 3404 | 'y' => $langs->trans('Year') |
| 3405 | 3405 | ); |
| 3406 | 3406 | if (isset($da[$outdurationunit])) { |
| 3407 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3407 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3408 | 3408 | } |
| 3409 | 3409 | } |
| 3410 | 3410 | |
@@ -3424,31 +3424,31 @@ discard block |
||
| 3424 | 3424 | $labeltoshow = ''; |
| 3425 | 3425 | $labeltoshow .= $objp->ref; |
| 3426 | 3426 | if (!empty($objp->custref)) { |
| 3427 | - $labeltoshow .= ' (' . $objp->custref . ')'; |
|
| 3427 | + $labeltoshow .= ' ('.$objp->custref.')'; |
|
| 3428 | 3428 | } |
| 3429 | 3429 | if ($outbarcode) { |
| 3430 | - $labeltoshow .= ' (' . $outbarcode . ')'; |
|
| 3430 | + $labeltoshow .= ' ('.$outbarcode.')'; |
|
| 3431 | 3431 | } |
| 3432 | - $labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3432 | + $labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3433 | 3433 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3434 | - $labeltoshow .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3434 | + $labeltoshow .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3435 | 3435 | } |
| 3436 | 3436 | |
| 3437 | 3437 | // Set $labltoshowhtml |
| 3438 | 3438 | $labeltoshowhtml = ''; |
| 3439 | 3439 | $labeltoshowhtml .= $objp->ref; |
| 3440 | 3440 | if (!empty($objp->custref)) { |
| 3441 | - $labeltoshowhtml .= ' (' . $objp->custref . ')'; |
|
| 3441 | + $labeltoshowhtml .= ' ('.$objp->custref.')'; |
|
| 3442 | 3442 | } |
| 3443 | 3443 | if (!empty($filterkey) && $filterkey != '') { |
| 3444 | - $labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3444 | + $labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
| 3445 | 3445 | } |
| 3446 | 3446 | if ($outbarcode) { |
| 3447 | - $labeltoshowhtml .= ' (' . $outbarcode . ')'; |
|
| 3447 | + $labeltoshowhtml .= ' ('.$outbarcode.')'; |
|
| 3448 | 3448 | } |
| 3449 | - $labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3449 | + $labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3450 | 3450 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3451 | - $labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')'; |
|
| 3451 | + $labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')'; |
|
| 3452 | 3452 | } |
| 3453 | 3453 | |
| 3454 | 3454 | // Stock |
@@ -3456,14 +3456,14 @@ discard block |
||
| 3456 | 3456 | $labeltoshowhtmlstock = ''; |
| 3457 | 3457 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3458 | 3458 | if ($user->hasRight('stock', 'lire')) { |
| 3459 | - $labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3459 | + $labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3460 | 3460 | |
| 3461 | 3461 | if ($objp->stock > 0) { |
| 3462 | 3462 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">'; |
| 3463 | 3463 | } elseif ($objp->stock <= 0) { |
| 3464 | 3464 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">'; |
| 3465 | 3465 | } |
| 3466 | - $labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3466 | + $labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 3467 | 3467 | $labeltoshowhtmlstock .= '</span>'; |
| 3468 | 3468 | |
| 3469 | 3469 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
@@ -3474,9 +3474,9 @@ discard block |
||
| 3474 | 3474 | $tmpproduct->load_virtual_stock(); |
| 3475 | 3475 | $virtualstock = $tmpproduct->stock_theorique; |
| 3476 | 3476 | |
| 3477 | - $labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3477 | + $labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3478 | 3478 | |
| 3479 | - $labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3479 | + $labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3480 | 3480 | if ($virtualstock > 0) { |
| 3481 | 3481 | $labeltoshowhtmlstock .= '<span class="product_line_stock_ok">'; |
| 3482 | 3482 | } elseif ($virtualstock <= 0) { |
@@ -3497,35 +3497,35 @@ discard block |
||
| 3497 | 3497 | // If we need a particular price level (from 1 to n) |
| 3498 | 3498 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) { |
| 3499 | 3499 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3500 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3501 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3502 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3503 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3500 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3501 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3502 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3503 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3504 | 3504 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3505 | 3505 | $sql .= " LIMIT 1"; |
| 3506 | 3506 | |
| 3507 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3507 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3508 | 3508 | $result2 = $this->db->query($sql); |
| 3509 | 3509 | if ($result2) { |
| 3510 | 3510 | $objp2 = $this->db->fetch_object($result2); |
| 3511 | 3511 | if ($objp2) { |
| 3512 | 3512 | $found = 1; |
| 3513 | 3513 | if ($objp2->price_base_type == 'HT') { |
| 3514 | - $labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3515 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3514 | + $labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3515 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3516 | 3516 | } else { |
| 3517 | - $labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3518 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3517 | + $labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3518 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3519 | 3519 | } |
| 3520 | 3520 | $outprice_ht = price($objp2->price); |
| 3521 | 3521 | $outprice_ttc = price($objp2->price_ttc); |
| 3522 | 3522 | $outpricebasetype = $objp2->price_base_type; |
| 3523 | 3523 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
| 3524 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3525 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3524 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3525 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3526 | 3526 | } else { |
| 3527 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3528 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3527 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3528 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3529 | 3529 | } |
| 3530 | 3530 | } |
| 3531 | 3531 | } else { |
@@ -3539,13 +3539,13 @@ discard block |
||
| 3539 | 3539 | $outqty = $objp->quantity; |
| 3540 | 3540 | $outdiscount = $objp->remise_percent; |
| 3541 | 3541 | if ($objp->quantity == 1) { |
| 3542 | - $labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3543 | - $labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3542 | + $labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3543 | + $labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3544 | 3544 | $labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3545 | 3545 | $labeltoshowhtmlprice .= $langs->transnoentities("Unit"); |
| 3546 | 3546 | } else { |
| 3547 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3548 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3547 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3548 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3549 | 3549 | $labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3550 | 3550 | $labeltoshowhtmlprice .= $langs->transnoentities("Units"); |
| 3551 | 3551 | } |
@@ -3553,16 +3553,16 @@ discard block |
||
| 3553 | 3553 | $outprice_ht = price($objp->unitprice); |
| 3554 | 3554 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3555 | 3555 | $outpricebasetype = $objp->price_base_type; |
| 3556 | - $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 |
|
| 3557 | - $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 |
|
| 3556 | + $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 |
|
| 3557 | + $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 |
|
| 3558 | 3558 | } |
| 3559 | 3559 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3560 | - $labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3561 | - $labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3560 | + $labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3561 | + $labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3562 | 3562 | } |
| 3563 | 3563 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3564 | - $labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3565 | - $labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3564 | + $labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3565 | + $labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3566 | 3566 | } |
| 3567 | 3567 | |
| 3568 | 3568 | // Price by customer |
@@ -3571,11 +3571,11 @@ discard block |
||
| 3571 | 3571 | $found = 1; |
| 3572 | 3572 | |
| 3573 | 3573 | if ($objp->custprice_base_type == 'HT') { |
| 3574 | - $labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3575 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3574 | + $labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3575 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3576 | 3576 | } else { |
| 3577 | - $labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3578 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3577 | + $labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3578 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3579 | 3579 | } |
| 3580 | 3580 | |
| 3581 | 3581 | $outprice_ht = price($objp->custprice); |
@@ -3589,11 +3589,11 @@ discard block |
||
| 3589 | 3589 | // If level no defined or multiprice not found, we used the default price |
| 3590 | 3590 | if (empty($hidepriceinlabel) && !$found) { |
| 3591 | 3591 | if ($objp->price_base_type == 'HT') { |
| 3592 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3593 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3592 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3593 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3594 | 3594 | } else { |
| 3595 | - $labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3596 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3595 | + $labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3596 | + $labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3597 | 3597 | } |
| 3598 | 3598 | $outprice_ht = price($objp->price); |
| 3599 | 3599 | $outprice_ttc = price($objp->price_ttc); |
@@ -3603,14 +3603,14 @@ discard block |
||
| 3603 | 3603 | } |
| 3604 | 3604 | |
| 3605 | 3605 | // Build options |
| 3606 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3606 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3607 | 3607 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3608 | 3608 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3609 | - $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 . '"'; |
|
| 3609 | + $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.'"'; |
|
| 3610 | 3610 | } |
| 3611 | 3611 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 3612 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3613 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3612 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3613 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3614 | 3614 | } |
| 3615 | 3615 | |
| 3616 | 3616 | if ($stocktag == 1) { |
@@ -3705,7 +3705,7 @@ discard block |
||
| 3705 | 3705 | $selected_input_value = ''; |
| 3706 | 3706 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
| 3707 | 3707 | if ($selected > 0) { |
| 3708 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3708 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3709 | 3709 | $producttmpselect = new Product($this->db); |
| 3710 | 3710 | $producttmpselect->fetch($selected); |
| 3711 | 3711 | $selected_input_value = $producttmpselect->ref; |
@@ -3713,10 +3713,10 @@ discard block |
||
| 3713 | 3713 | } |
| 3714 | 3714 | |
| 3715 | 3715 | // mode=2 means suppliers products |
| 3716 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3717 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3716 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3717 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
| 3718 | 3718 | |
| 3719 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3719 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3720 | 3720 | } else { |
| 3721 | 3721 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3722 | 3722 | } |
@@ -3774,25 +3774,25 @@ discard block |
||
| 3774 | 3774 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3775 | 3775 | $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"; |
| 3776 | 3776 | } |
| 3777 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3778 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3777 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3778 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3779 | 3779 | if ($socid > 0) { |
| 3780 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3780 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3781 | 3781 | } |
| 3782 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3782 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3783 | 3783 | // Units |
| 3784 | 3784 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3785 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3785 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3786 | 3786 | } |
| 3787 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3787 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3788 | 3788 | if ($statut != -1) { |
| 3789 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3789 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3790 | 3790 | } |
| 3791 | 3791 | if (strval($filtertype) != '') { |
| 3792 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3792 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3793 | 3793 | } |
| 3794 | 3794 | if (!empty($filtre)) { |
| 3795 | - $sql .= " " . $filtre; |
|
| 3795 | + $sql .= " ".$filtre; |
|
| 3796 | 3796 | } |
| 3797 | 3797 | // Add where from hooks |
| 3798 | 3798 | $parameters = array(); |
@@ -3812,9 +3812,9 @@ discard block |
||
| 3812 | 3812 | if ($i > 0) { |
| 3813 | 3813 | $sql .= " AND "; |
| 3814 | 3814 | } |
| 3815 | - $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) . "%'"; |
|
| 3815 | + $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)."%'"; |
|
| 3816 | 3816 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
| 3817 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3817 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3818 | 3818 | } |
| 3819 | 3819 | $sql .= ")"; |
| 3820 | 3820 | $i++; |
@@ -3823,8 +3823,8 @@ discard block |
||
| 3823 | 3823 | $sql .= ")"; |
| 3824 | 3824 | } |
| 3825 | 3825 | if (isModEnabled('barcode')) { |
| 3826 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3827 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3826 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3827 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3828 | 3828 | } |
| 3829 | 3829 | $sql .= ')'; |
| 3830 | 3830 | } |
@@ -3833,20 +3833,20 @@ discard block |
||
| 3833 | 3833 | |
| 3834 | 3834 | // Build output string |
| 3835 | 3835 | |
| 3836 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3836 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3837 | 3837 | $result = $this->db->query($sql); |
| 3838 | 3838 | if ($result) { |
| 3839 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3840 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3839 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3840 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3841 | 3841 | |
| 3842 | 3842 | $num = $this->db->num_rows($result); |
| 3843 | 3843 | |
| 3844 | 3844 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3845 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3845 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3846 | 3846 | if (!$selected) { |
| 3847 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3847 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3848 | 3848 | } else { |
| 3849 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3849 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3850 | 3850 | } |
| 3851 | 3851 | |
| 3852 | 3852 | $i = 0; |
@@ -3861,7 +3861,7 @@ discard block |
||
| 3861 | 3861 | |
| 3862 | 3862 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3863 | 3863 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3864 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3864 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3865 | 3865 | } |
| 3866 | 3866 | |
| 3867 | 3867 | $outref = $objp->ref; |
@@ -3876,23 +3876,23 @@ discard block |
||
| 3876 | 3876 | $outvalUnits = ''; |
| 3877 | 3877 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3878 | 3878 | if (!empty($objp->unit_short)) { |
| 3879 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3879 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3880 | 3880 | } |
| 3881 | 3881 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3882 | 3882 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3883 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3883 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3884 | 3884 | } |
| 3885 | 3885 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3886 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3887 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3886 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3887 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3888 | 3888 | } |
| 3889 | 3889 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3890 | 3890 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3891 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3891 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3892 | 3892 | } |
| 3893 | 3893 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3894 | 3894 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3895 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3895 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3896 | 3896 | } |
| 3897 | 3897 | if ($outdurationvalue && $outdurationunit) { |
| 3898 | 3898 | $da = array( |
@@ -3903,22 +3903,22 @@ discard block |
||
| 3903 | 3903 | 'y' => $langs->trans('Year') |
| 3904 | 3904 | ); |
| 3905 | 3905 | if (isset($da[$outdurationunit])) { |
| 3906 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3906 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3907 | 3907 | } |
| 3908 | 3908 | } |
| 3909 | 3909 | } |
| 3910 | 3910 | |
| 3911 | 3911 | $objRef = $objp->ref; |
| 3912 | 3912 | if ($filterkey && $filterkey != '') { |
| 3913 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3913 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3914 | 3914 | } |
| 3915 | 3915 | $objRefFourn = $objp->ref_fourn; |
| 3916 | 3916 | if ($filterkey && $filterkey != '') { |
| 3917 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3917 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3918 | 3918 | } |
| 3919 | 3919 | $label = $objp->label; |
| 3920 | 3920 | if ($filterkey && $filterkey != '') { |
| 3921 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3921 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3922 | 3922 | } |
| 3923 | 3923 | |
| 3924 | 3924 | switch ($objp->fk_product_type) { |
@@ -3941,21 +3941,21 @@ discard block |
||
| 3941 | 3941 | |
| 3942 | 3942 | $optlabel .= $objp->ref; |
| 3943 | 3943 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3944 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3944 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3945 | 3945 | } |
| 3946 | 3946 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3947 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3947 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3948 | 3948 | } |
| 3949 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3949 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3950 | 3950 | |
| 3951 | 3951 | $outvallabel = $objRef; |
| 3952 | 3952 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3953 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3953 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3954 | 3954 | } |
| 3955 | 3955 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3956 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3956 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3957 | 3957 | } |
| 3958 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3958 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3959 | 3959 | |
| 3960 | 3960 | // Units |
| 3961 | 3961 | $optlabel .= $outvalUnits; |
@@ -3972,7 +3972,7 @@ discard block |
||
| 3972 | 3972 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3973 | 3973 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3974 | 3974 | |
| 3975 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3975 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3976 | 3976 | $priceparser = new PriceParser($this->db); |
| 3977 | 3977 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3978 | 3978 | if ($price_result >= 0) { |
@@ -3983,57 +3983,57 @@ discard block |
||
| 3983 | 3983 | } |
| 3984 | 3984 | } |
| 3985 | 3985 | if ($objp->quantity == 1) { |
| 3986 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3987 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3986 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3987 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3988 | 3988 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3989 | 3989 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3990 | 3990 | } else { |
| 3991 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3992 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3993 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3994 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3991 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3992 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3993 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3994 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3995 | 3995 | } |
| 3996 | 3996 | |
| 3997 | 3997 | if ($objp->quantity > 1) { |
| 3998 | - $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 |
|
| 3999 | - $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 |
|
| 3998 | + $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 |
|
| 3999 | + $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 |
|
| 4000 | 4000 | } |
| 4001 | 4001 | if ($objp->remise_percent >= 1) { |
| 4002 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 4003 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 4002 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 4003 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 4004 | 4004 | } |
| 4005 | 4005 | if ($objp->duration) { |
| 4006 | - $optlabel .= " - " . $objp->duration; |
|
| 4007 | - $outvallabel .= " - " . $objp->duration; |
|
| 4006 | + $optlabel .= " - ".$objp->duration; |
|
| 4007 | + $outvallabel .= " - ".$objp->duration; |
|
| 4008 | 4008 | } |
| 4009 | 4009 | if (!$socid) { |
| 4010 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 4011 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 4010 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 4011 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 4012 | 4012 | } |
| 4013 | 4013 | if ($objp->supplier_reputation) { |
| 4014 | 4014 | //TODO dictionary |
| 4015 | 4015 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 4016 | 4016 | |
| 4017 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 4018 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 4017 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 4018 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 4019 | 4019 | } |
| 4020 | 4020 | } else { |
| 4021 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 4022 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 4021 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 4022 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 4023 | 4023 | } |
| 4024 | 4024 | |
| 4025 | 4025 | if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 4026 | 4026 | $novirtualstock = ($showstockinlist == 2); |
| 4027 | 4027 | |
| 4028 | 4028 | if ($user->hasRight('stock', 'lire')) { |
| 4029 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 4029 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
| 4030 | 4030 | |
| 4031 | 4031 | if ($objp->stock > 0) { |
| 4032 | 4032 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 4033 | 4033 | } elseif ($objp->stock <= 0) { |
| 4034 | 4034 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 4035 | 4035 | } |
| 4036 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 4036 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 4037 | 4037 | $optlabel .= '</span>'; |
| 4038 | 4038 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 4039 | 4039 | $langs->load("stocks"); |
@@ -4043,9 +4043,9 @@ discard block |
||
| 4043 | 4043 | $tmpproduct->load_virtual_stock(); |
| 4044 | 4044 | $virtualstock = $tmpproduct->stock_theorique; |
| 4045 | 4045 | |
| 4046 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 4046 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 4047 | 4047 | |
| 4048 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 4048 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 4049 | 4049 | if ($virtualstock > 0) { |
| 4050 | 4050 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 4051 | 4051 | } elseif ($virtualstock <= 0) { |
@@ -4059,7 +4059,7 @@ discard block |
||
| 4059 | 4059 | } |
| 4060 | 4060 | } |
| 4061 | 4061 | |
| 4062 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 4062 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 4063 | 4063 | if ($selected && $selected == $objp->idprodfournprice) { |
| 4064 | 4064 | $optstart .= ' selected'; |
| 4065 | 4065 | } |
@@ -4068,22 +4068,22 @@ discard block |
||
| 4068 | 4068 | } |
| 4069 | 4069 | |
| 4070 | 4070 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 4071 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 4072 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 4073 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 4074 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 4075 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 4076 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 4077 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 4078 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 4079 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 4080 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 4071 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 4072 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 4073 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 4074 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 4075 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 4076 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 4077 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 4078 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 4079 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 4080 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 4081 | 4081 | if (isModEnabled('multicurrency')) { |
| 4082 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
| 4083 | - $optstart .= ' data-multicurrency-unitprice="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
| 4082 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
| 4083 | + $optstart .= ' data-multicurrency-unitprice="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
| 4084 | 4084 | } |
| 4085 | 4085 | } |
| 4086 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 4086 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 4087 | 4087 | |
| 4088 | 4088 | // set $parameters to call hook |
| 4089 | 4089 | $outarrayentry = array( |
@@ -4092,9 +4092,9 @@ discard block |
||
| 4092 | 4092 | 'label' => $outvallabel, |
| 4093 | 4093 | 'labelhtml' => $optlabel, |
| 4094 | 4094 | 'qty' => $outqty, |
| 4095 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4096 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4097 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4095 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4096 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4097 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4098 | 4098 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 4099 | 4099 | 'tva_tx' => price2num($objp->tva_tx), |
| 4100 | 4100 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4124,18 +4124,18 @@ discard block |
||
| 4124 | 4124 | // Add new entry |
| 4125 | 4125 | // "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 |
| 4126 | 4126 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 4127 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 4127 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 4128 | 4128 | $outarraypush = array( |
| 4129 | 4129 | 'key' => $outkey, |
| 4130 | 4130 | 'value' => $outref, |
| 4131 | 4131 | 'label' => $outvallabel, |
| 4132 | 4132 | 'labelhtml' => $optlabel, |
| 4133 | 4133 | 'qty' => $outqty, |
| 4134 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4134 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 4135 | 4135 | 'price_qty_ht_locale' => price($objp->fprice), |
| 4136 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4136 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 4137 | 4137 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 4138 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4138 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 4139 | 4139 | 'tva_tx_formated' => price($objp->tva_tx), |
| 4140 | 4140 | 'tva_tx' => price2num($objp->tva_tx), |
| 4141 | 4141 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4168,7 +4168,7 @@ discard block |
||
| 4168 | 4168 | |
| 4169 | 4169 | $this->db->free($result); |
| 4170 | 4170 | |
| 4171 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 4171 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 4172 | 4172 | $out .= ajax_combobox($htmlname); |
| 4173 | 4173 | } else { |
| 4174 | 4174 | dol_print_error($this->db); |
@@ -4200,43 +4200,43 @@ discard block |
||
| 4200 | 4200 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 4201 | 4201 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 4202 | 4202 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 4203 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 4204 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4205 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4206 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 4203 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 4204 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 4205 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 4206 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 4207 | 4207 | $sql .= " AND p.tobuy = 1"; |
| 4208 | 4208 | $sql .= " AND s.fournisseur = 1"; |
| 4209 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 4209 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 4210 | 4210 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
| 4211 | 4211 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 4212 | 4212 | } else { |
| 4213 | 4213 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 4214 | 4214 | } |
| 4215 | 4215 | |
| 4216 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 4216 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 4217 | 4217 | $result = $this->db->query($sql); |
| 4218 | 4218 | |
| 4219 | 4219 | if ($result) { |
| 4220 | 4220 | $num = $this->db->num_rows($result); |
| 4221 | 4221 | |
| 4222 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4222 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4223 | 4223 | |
| 4224 | 4224 | if (!$num) { |
| 4225 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 4225 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 4226 | 4226 | } else { |
| 4227 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4227 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4228 | 4228 | $form .= '<option value="0"> </option>'; |
| 4229 | 4229 | |
| 4230 | 4230 | $i = 0; |
| 4231 | 4231 | while ($i < $num) { |
| 4232 | 4232 | $objp = $this->db->fetch_object($result); |
| 4233 | 4233 | |
| 4234 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 4234 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 4235 | 4235 | //if there is only one supplier, preselect it |
| 4236 | 4236 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
| 4237 | 4237 | $opt .= ' selected'; |
| 4238 | 4238 | } |
| 4239 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 4239 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 4240 | 4240 | |
| 4241 | 4241 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 4242 | 4242 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -4246,7 +4246,7 @@ discard block |
||
| 4246 | 4246 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 4247 | 4247 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 4248 | 4248 | |
| 4249 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 4249 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 4250 | 4250 | $priceparser = new PriceParser($this->db); |
| 4251 | 4251 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 4252 | 4252 | if ($price_result >= 0) { |
@@ -4257,10 +4257,10 @@ discard block |
||
| 4257 | 4257 | } |
| 4258 | 4258 | } |
| 4259 | 4259 | if ($objp->quantity == 1) { |
| 4260 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 4260 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 4261 | 4261 | } |
| 4262 | 4262 | |
| 4263 | - $opt .= $objp->quantity . ' '; |
|
| 4263 | + $opt .= $objp->quantity.' '; |
|
| 4264 | 4264 | |
| 4265 | 4265 | if ($objp->quantity == 1) { |
| 4266 | 4266 | $opt .= $langs->trans("Unit"); |
@@ -4269,10 +4269,10 @@ discard block |
||
| 4269 | 4269 | } |
| 4270 | 4270 | if ($objp->quantity > 1) { |
| 4271 | 4271 | $opt .= " - "; |
| 4272 | - $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"); |
|
| 4272 | + $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"); |
|
| 4273 | 4273 | } |
| 4274 | 4274 | if ($objp->duration) { |
| 4275 | - $opt .= " - " . $objp->duration; |
|
| 4275 | + $opt .= " - ".$objp->duration; |
|
| 4276 | 4276 | } |
| 4277 | 4277 | $opt .= "</option>\n"; |
| 4278 | 4278 | |
@@ -4310,8 +4310,8 @@ discard block |
||
| 4310 | 4310 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4311 | 4311 | |
| 4312 | 4312 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4313 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4314 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4313 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4314 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4315 | 4315 | $sql .= " AND active > 0"; |
| 4316 | 4316 | $sql .= " ORDER BY sortorder"; |
| 4317 | 4317 | |
@@ -4323,7 +4323,7 @@ discard block |
||
| 4323 | 4323 | $obj = $this->db->fetch_object($resql); |
| 4324 | 4324 | |
| 4325 | 4325 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4326 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4326 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4327 | 4327 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4328 | 4328 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4329 | 4329 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4351,7 +4351,7 @@ discard block |
||
| 4351 | 4351 | // phpcs:enable |
| 4352 | 4352 | global $langs; |
| 4353 | 4353 | |
| 4354 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4354 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4355 | 4355 | if ($num > 0) { |
| 4356 | 4356 | return 0; // Cache already loaded |
| 4357 | 4357 | } |
@@ -4361,7 +4361,7 @@ discard block |
||
| 4361 | 4361 | $langs->load('propal'); |
| 4362 | 4362 | |
| 4363 | 4363 | $sql = "SELECT rowid, code, label, position"; |
| 4364 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4364 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4365 | 4365 | $sql .= " WHERE active > 0"; |
| 4366 | 4366 | |
| 4367 | 4367 | $resql = $this->db->query($sql); |
@@ -4372,7 +4372,7 @@ discard block |
||
| 4372 | 4372 | $obj = $this->db->fetch_object($resql); |
| 4373 | 4373 | |
| 4374 | 4374 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4375 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4375 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4376 | 4376 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4377 | 4377 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4378 | 4378 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4404,17 +4404,17 @@ discard block |
||
| 4404 | 4404 | |
| 4405 | 4405 | $this->load_cache_availability(); |
| 4406 | 4406 | |
| 4407 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4407 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4408 | 4408 | |
| 4409 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4409 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4410 | 4410 | if ($addempty) { |
| 4411 | 4411 | print '<option value="0"> </option>'; |
| 4412 | 4412 | } |
| 4413 | 4413 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4414 | 4414 | if ($selected == $id) { |
| 4415 | - print '<option value="' . $id . '" selected>'; |
|
| 4415 | + print '<option value="'.$id.'" selected>'; |
|
| 4416 | 4416 | } else { |
| 4417 | - print '<option value="' . $id . '">'; |
|
| 4417 | + print '<option value="'.$id.'">'; |
|
| 4418 | 4418 | } |
| 4419 | 4419 | print dol_escape_htmltag($arrayavailability['label']); |
| 4420 | 4420 | print '</option>'; |
@@ -4435,13 +4435,13 @@ discard block |
||
| 4435 | 4435 | { |
| 4436 | 4436 | global $langs; |
| 4437 | 4437 | |
| 4438 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4438 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4439 | 4439 | if ($num > 0) { |
| 4440 | 4440 | return 0; // Cache already loaded |
| 4441 | 4441 | } |
| 4442 | 4442 | |
| 4443 | 4443 | $sql = "SELECT rowid, code, label"; |
| 4444 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4444 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4445 | 4445 | $sql .= " WHERE active > 0"; |
| 4446 | 4446 | |
| 4447 | 4447 | $resql = $this->db->query($sql); |
@@ -4454,8 +4454,8 @@ discard block |
||
| 4454 | 4454 | |
| 4455 | 4455 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4456 | 4456 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4457 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
| 4458 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4457 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
| 4458 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4459 | 4459 | } |
| 4460 | 4460 | if ($langs->trans($obj->code) != $obj->code) { |
| 4461 | 4461 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4495,9 +4495,9 @@ discard block |
||
| 4495 | 4495 | |
| 4496 | 4496 | $this->loadCacheInputReason(); |
| 4497 | 4497 | |
| 4498 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4498 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4499 | 4499 | if ($addempty) { |
| 4500 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4500 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4501 | 4501 | } |
| 4502 | 4502 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4503 | 4503 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4505,9 +4505,9 @@ discard block |
||
| 4505 | 4505 | } |
| 4506 | 4506 | |
| 4507 | 4507 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4508 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4508 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4509 | 4509 | } else { |
| 4510 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4510 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4511 | 4511 | } |
| 4512 | 4512 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4513 | 4513 | print $langs->trans($label); |
@@ -4517,7 +4517,7 @@ discard block |
||
| 4517 | 4517 | if ($user->admin && empty($notooltip)) { |
| 4518 | 4518 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4519 | 4519 | } |
| 4520 | - print ajax_combobox('select_' . $htmlname); |
|
| 4520 | + print ajax_combobox('select_'.$htmlname); |
|
| 4521 | 4521 | } |
| 4522 | 4522 | |
| 4523 | 4523 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4532,7 +4532,7 @@ discard block |
||
| 4532 | 4532 | // phpcs:enable |
| 4533 | 4533 | global $langs; |
| 4534 | 4534 | |
| 4535 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4535 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4536 | 4536 | if ($num > 0) { |
| 4537 | 4537 | return $num; // Cache already loaded |
| 4538 | 4538 | } |
@@ -4542,8 +4542,8 @@ discard block |
||
| 4542 | 4542 | $this->cache_types_paiements = array(); |
| 4543 | 4543 | |
| 4544 | 4544 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4545 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4546 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4545 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4546 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4547 | 4547 | |
| 4548 | 4548 | $resql = $this->db->query($sql); |
| 4549 | 4549 | if ($resql) { |
@@ -4553,7 +4553,7 @@ discard block |
||
| 4553 | 4553 | $obj = $this->db->fetch_object($resql); |
| 4554 | 4554 | |
| 4555 | 4555 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4556 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4556 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4557 | 4557 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4558 | 4558 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4559 | 4559 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4625,17 +4625,17 @@ discard block |
||
| 4625 | 4625 | global $langs, $user, $conf; |
| 4626 | 4626 | |
| 4627 | 4627 | $out = ''; |
| 4628 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4628 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4629 | 4629 | |
| 4630 | 4630 | $this->load_cache_conditions_paiements(); |
| 4631 | 4631 | |
| 4632 | 4632 | // Set default value if not already set by caller |
| 4633 | 4633 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
| 4634 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4634 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4635 | 4635 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 4636 | 4636 | } |
| 4637 | 4637 | |
| 4638 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4638 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4639 | 4639 | if ($addempty) { |
| 4640 | 4640 | $out .= '<option value="0"> </option>'; |
| 4641 | 4641 | } |
@@ -4649,9 +4649,9 @@ discard block |
||
| 4649 | 4649 | |
| 4650 | 4650 | if ($selected == $id) { |
| 4651 | 4651 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4652 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4652 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4653 | 4653 | } else { |
| 4654 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4654 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4655 | 4655 | } |
| 4656 | 4656 | $label = $arrayconditions['label']; |
| 4657 | 4657 | |
@@ -4669,21 +4669,21 @@ discard block |
||
| 4669 | 4669 | $out .= ajax_combobox($htmlname); |
| 4670 | 4670 | |
| 4671 | 4671 | if ($deposit_percent >= 0) { |
| 4672 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4673 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4674 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4672 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4673 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4674 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4675 | 4675 | $out .= '</span>'; |
| 4676 | 4676 | $out .= ' |
| 4677 | - <script nonce="' . getNonce() . '"> |
|
| 4677 | + <script nonce="' . getNonce().'"> |
|
| 4678 | 4678 | $(document).ready(function () { |
| 4679 | - $("#' . $htmlname . '").change(function () { |
|
| 4679 | + $("#' . $htmlname.'").change(function () { |
|
| 4680 | 4680 | let $selected = $(this).find("option:selected"); |
| 4681 | 4681 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4682 | 4682 | |
| 4683 | 4683 | if (depositPercent.length > 0) { |
| 4684 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4684 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4685 | 4685 | } else { |
| 4686 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4686 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4687 | 4687 | } |
| 4688 | 4688 | |
| 4689 | 4689 | return true; |
@@ -4721,7 +4721,7 @@ discard block |
||
| 4721 | 4721 | |
| 4722 | 4722 | $out = ''; |
| 4723 | 4723 | |
| 4724 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4724 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4725 | 4725 | |
| 4726 | 4726 | $filterarray = array(); |
| 4727 | 4727 | if ($filtertype == 'CRDT') { |
@@ -4736,11 +4736,11 @@ discard block |
||
| 4736 | 4736 | |
| 4737 | 4737 | // Set default value if not already set by caller |
| 4738 | 4738 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
| 4739 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4739 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4740 | 4740 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 4741 | 4741 | } |
| 4742 | 4742 | |
| 4743 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4743 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4744 | 4744 | if ($empty) { |
| 4745 | 4745 | $out .= '<option value=""> </option>'; |
| 4746 | 4746 | } |
@@ -4761,13 +4761,13 @@ discard block |
||
| 4761 | 4761 | } |
| 4762 | 4762 | |
| 4763 | 4763 | if ($format == 0) { |
| 4764 | - $out .= '<option value="' . $id . '" data-code="'.$arraytypes['code'].'"'; |
|
| 4764 | + $out .= '<option value="'.$id.'" data-code="'.$arraytypes['code'].'"'; |
|
| 4765 | 4765 | } elseif ($format == 1) { |
| 4766 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4766 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4767 | 4767 | } elseif ($format == 2) { |
| 4768 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4768 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4769 | 4769 | } elseif ($format == 3) { |
| 4770 | - $out .= '<option value="' . $id . '"'; |
|
| 4770 | + $out .= '<option value="'.$id.'"'; |
|
| 4771 | 4771 | } |
| 4772 | 4772 | // Print attribute selected or not |
| 4773 | 4773 | if ($format == 1 || $format == 2) { |
@@ -4797,7 +4797,7 @@ discard block |
||
| 4797 | 4797 | if ($user->admin && !$noadmininfo) { |
| 4798 | 4798 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4799 | 4799 | } |
| 4800 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4800 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4801 | 4801 | |
| 4802 | 4802 | if (empty($nooutput)) { |
| 4803 | 4803 | print $out; |
@@ -4819,22 +4819,22 @@ discard block |
||
| 4819 | 4819 | { |
| 4820 | 4820 | global $langs; |
| 4821 | 4821 | |
| 4822 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4822 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4823 | 4823 | $options = array( |
| 4824 | 4824 | 'HT' => $langs->trans("HT"), |
| 4825 | 4825 | 'TTC' => $langs->trans("TTC") |
| 4826 | 4826 | ); |
| 4827 | 4827 | foreach ($options as $id => $value) { |
| 4828 | 4828 | if ($selected == $id) { |
| 4829 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4829 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4830 | 4830 | } else { |
| 4831 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4831 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4832 | 4832 | } |
| 4833 | 4833 | $return .= '</option>'; |
| 4834 | 4834 | } |
| 4835 | 4835 | $return .= '</select>'; |
| 4836 | 4836 | if ($addjscombo) { |
| 4837 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4837 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4838 | 4838 | } |
| 4839 | 4839 | |
| 4840 | 4840 | return $return; |
@@ -4852,7 +4852,7 @@ discard block |
||
| 4852 | 4852 | // phpcs:enable |
| 4853 | 4853 | global $langs; |
| 4854 | 4854 | |
| 4855 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4855 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4856 | 4856 | if ($num > 0) { |
| 4857 | 4857 | return $num; // Cache already loaded |
| 4858 | 4858 | } |
@@ -4862,8 +4862,8 @@ discard block |
||
| 4862 | 4862 | $this->cache_transport_mode = array(); |
| 4863 | 4863 | |
| 4864 | 4864 | $sql = "SELECT rowid, code, label, active"; |
| 4865 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4866 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4865 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4866 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4867 | 4867 | |
| 4868 | 4868 | $resql = $this->db->query($sql); |
| 4869 | 4869 | if ($resql) { |
@@ -4873,7 +4873,7 @@ discard block |
||
| 4873 | 4873 | $obj = $this->db->fetch_object($resql); |
| 4874 | 4874 | |
| 4875 | 4875 | // If traduction exist, we use it else we take the default label |
| 4876 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4876 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4877 | 4877 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4878 | 4878 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4879 | 4879 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4907,11 +4907,11 @@ discard block |
||
| 4907 | 4907 | { |
| 4908 | 4908 | global $langs, $user; |
| 4909 | 4909 | |
| 4910 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4910 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4911 | 4911 | |
| 4912 | 4912 | $this->load_cache_transport_mode(); |
| 4913 | 4913 | |
| 4914 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4914 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4915 | 4915 | if ($empty) { |
| 4916 | 4916 | print '<option value=""> </option>'; |
| 4917 | 4917 | } |
@@ -4927,13 +4927,13 @@ discard block |
||
| 4927 | 4927 | } |
| 4928 | 4928 | |
| 4929 | 4929 | if ($format == 0) { |
| 4930 | - print '<option value="' . $id . '"'; |
|
| 4930 | + print '<option value="'.$id.'"'; |
|
| 4931 | 4931 | } elseif ($format == 1) { |
| 4932 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4932 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4933 | 4933 | } elseif ($format == 2) { |
| 4934 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4934 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4935 | 4935 | } elseif ($format == 3) { |
| 4936 | - print '<option value="' . $id . '"'; |
|
| 4936 | + print '<option value="'.$id.'"'; |
|
| 4937 | 4937 | } |
| 4938 | 4938 | // If text is selected, we compare with code, else with id |
| 4939 | 4939 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4984,31 +4984,31 @@ discard block |
||
| 4984 | 4984 | $langs->load("deliveries"); |
| 4985 | 4985 | |
| 4986 | 4986 | $sql = "SELECT rowid, code, libelle as label"; |
| 4987 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4987 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4988 | 4988 | $sql .= " WHERE active > 0"; |
| 4989 | 4989 | if ($filtre) { |
| 4990 | - $sql .= " AND " . $filtre; |
|
| 4990 | + $sql .= " AND ".$filtre; |
|
| 4991 | 4991 | } |
| 4992 | 4992 | $sql .= " ORDER BY libelle ASC"; |
| 4993 | 4993 | |
| 4994 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4994 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4995 | 4995 | $result = $this->db->query($sql); |
| 4996 | 4996 | if ($result) { |
| 4997 | 4997 | $num = $this->db->num_rows($result); |
| 4998 | 4998 | $i = 0; |
| 4999 | 4999 | if ($num) { |
| 5000 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5000 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5001 | 5001 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5002 | 5002 | print '<option value="-1"> </option>'; |
| 5003 | 5003 | } |
| 5004 | 5004 | while ($i < $num) { |
| 5005 | 5005 | $obj = $this->db->fetch_object($result); |
| 5006 | 5006 | if ($selected == $obj->rowid) { |
| 5007 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5007 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5008 | 5008 | } else { |
| 5009 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5009 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5010 | 5010 | } |
| 5011 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 5011 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 5012 | 5012 | print '</option>'; |
| 5013 | 5013 | $i++; |
| 5014 | 5014 | } |
@@ -5017,7 +5017,7 @@ discard block |
||
| 5017 | 5017 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 5018 | 5018 | } |
| 5019 | 5019 | |
| 5020 | - print ajax_combobox('select' . $htmlname); |
|
| 5020 | + print ajax_combobox('select'.$htmlname); |
|
| 5021 | 5021 | } else { |
| 5022 | 5022 | print $langs->trans("NoShippingMethodDefined"); |
| 5023 | 5023 | } |
@@ -5042,16 +5042,16 @@ discard block |
||
| 5042 | 5042 | $langs->load("deliveries"); |
| 5043 | 5043 | |
| 5044 | 5044 | if ($htmlname != "none") { |
| 5045 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5045 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5046 | 5046 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 5047 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5047 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5048 | 5048 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 5049 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5049 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5050 | 5050 | print '</form>'; |
| 5051 | 5051 | } else { |
| 5052 | 5052 | if ($selected) { |
| 5053 | 5053 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 5054 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 5054 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 5055 | 5055 | } else { |
| 5056 | 5056 | print " "; |
| 5057 | 5057 | } |
@@ -5074,10 +5074,10 @@ discard block |
||
| 5074 | 5074 | |
| 5075 | 5075 | $opt = '<option value="" selected></option>'; |
| 5076 | 5076 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 5077 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 5078 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 5077 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 5078 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 5079 | 5079 | $sql .= ' AND situation_counter >= 1'; |
| 5080 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 5080 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 5081 | 5081 | $sql .= ' AND type <> 2'; |
| 5082 | 5082 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 5083 | 5083 | $resql = $this->db->query($sql); |
@@ -5095,19 +5095,19 @@ discard block |
||
| 5095 | 5095 | //Not prov? |
| 5096 | 5096 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 5097 | 5097 | if ($selected == $obj->rowid) { |
| 5098 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 5098 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 5099 | 5099 | } else { |
| 5100 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 5100 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 5101 | 5101 | } |
| 5102 | 5102 | } |
| 5103 | 5103 | } |
| 5104 | 5104 | } |
| 5105 | 5105 | } |
| 5106 | 5106 | } else { |
| 5107 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 5107 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 5108 | 5108 | } |
| 5109 | 5109 | if ($opt == '<option value ="" selected></option>') { |
| 5110 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 5110 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 5111 | 5111 | } |
| 5112 | 5112 | return $opt; |
| 5113 | 5113 | } |
@@ -5127,12 +5127,12 @@ discard block |
||
| 5127 | 5127 | |
| 5128 | 5128 | $langs->load('products'); |
| 5129 | 5129 | |
| 5130 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 5130 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 5131 | 5131 | |
| 5132 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 5132 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 5133 | 5133 | $sql .= ' WHERE active > 0'; |
| 5134 | 5134 | if (!empty($unit_type)) { |
| 5135 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 5135 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 5136 | 5136 | } |
| 5137 | 5137 | $sql .= " ORDER BY sortorder"; |
| 5138 | 5138 | |
@@ -5144,14 +5144,14 @@ discard block |
||
| 5144 | 5144 | |
| 5145 | 5145 | while ($res = $this->db->fetch_object($resql)) { |
| 5146 | 5146 | $unitLabel = $res->label; |
| 5147 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 5148 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 5147 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 5148 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 5149 | 5149 | } |
| 5150 | 5150 | |
| 5151 | 5151 | if ($selected == $res->rowid) { |
| 5152 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 5152 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 5153 | 5153 | } else { |
| 5154 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 5154 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 5155 | 5155 | } |
| 5156 | 5156 | } |
| 5157 | 5157 | $return .= '</select>'; |
@@ -5188,29 +5188,29 @@ discard block |
||
| 5188 | 5188 | $num = 0; |
| 5189 | 5189 | |
| 5190 | 5190 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 5191 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 5192 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 5191 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 5192 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 5193 | 5193 | if ($status != 2) { |
| 5194 | - $sql .= " AND clos = " . (int) $status; |
|
| 5194 | + $sql .= " AND clos = ".(int) $status; |
|
| 5195 | 5195 | } |
| 5196 | 5196 | if ($filtre) { // TODO Support USF |
| 5197 | - $sql .= " AND " . $filtre; |
|
| 5197 | + $sql .= " AND ".$filtre; |
|
| 5198 | 5198 | } |
| 5199 | 5199 | $sql .= " ORDER BY label"; |
| 5200 | 5200 | |
| 5201 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 5201 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 5202 | 5202 | $result = $this->db->query($sql); |
| 5203 | 5203 | if ($result) { |
| 5204 | 5204 | $num = $this->db->num_rows($result); |
| 5205 | 5205 | $i = 0; |
| 5206 | 5206 | |
| 5207 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5207 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5208 | 5208 | |
| 5209 | 5209 | if ($num == 0) { |
| 5210 | 5210 | if ($status == 0) { |
| 5211 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 5211 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 5212 | 5212 | } else { |
| 5213 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>'; |
|
| 5213 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>'; |
|
| 5214 | 5214 | } |
| 5215 | 5215 | } else { |
| 5216 | 5216 | if (!empty($useempty) && !is_numeric($useempty)) { |
@@ -5226,25 +5226,25 @@ discard block |
||
| 5226 | 5226 | $labeltoshow = trim($obj->label); |
| 5227 | 5227 | $labeltoshowhtml = trim($obj->label); |
| 5228 | 5228 | if ($showcurrency) { |
| 5229 | - $labeltoshow .= ' (' . $obj->currency_code . ')'; |
|
| 5230 | - $labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->currency_code . ')</span>'; |
|
| 5229 | + $labeltoshow .= ' ('.$obj->currency_code.')'; |
|
| 5230 | + $labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->currency_code.')</span>'; |
|
| 5231 | 5231 | } |
| 5232 | 5232 | if ($status == 2 && $obj->status == 1) { |
| 5233 | - $labeltoshow .= ' (' . $langs->trans("Closed") . ')'; |
|
| 5234 | - $labeltoshowhtml .= ' <span class="opacitymedium">(' . $langs->trans("Closed") . ')</span>'; |
|
| 5233 | + $labeltoshow .= ' ('.$langs->trans("Closed").')'; |
|
| 5234 | + $labeltoshowhtml .= ' <span class="opacitymedium">('.$langs->trans("Closed").')</span>'; |
|
| 5235 | 5235 | } |
| 5236 | 5236 | |
| 5237 | 5237 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 5238 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>'; |
|
| 5238 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>'; |
|
| 5239 | 5239 | } else { |
| 5240 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">'; |
|
| 5240 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">'; |
|
| 5241 | 5241 | } |
| 5242 | 5242 | $out .= $labeltoshow; |
| 5243 | 5243 | $out .= '</option>'; |
| 5244 | 5244 | $i++; |
| 5245 | 5245 | } |
| 5246 | 5246 | $out .= "</select>"; |
| 5247 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 5247 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 5248 | 5248 | } else { |
| 5249 | 5249 | dol_print_error($this->db); |
| 5250 | 5250 | } |
@@ -5283,22 +5283,22 @@ discard block |
||
| 5283 | 5283 | $num = 0; |
| 5284 | 5284 | |
| 5285 | 5285 | $sql = "SELECT rowid, label, bank, status, iban_prefix, bic"; |
| 5286 | - $sql .= " FROM " . $this->db->prefix() . "societe_rib"; |
|
| 5287 | - $sql .= " WHERE type = 'ban'"; |
|
| 5286 | + $sql .= " FROM ".$this->db->prefix()."societe_rib"; |
|
| 5287 | + $sql .= " WHERE type = 'ban'"; |
|
| 5288 | 5288 | if ($filtre) { // TODO Support USF |
| 5289 | - $sql .= " AND " . $filtre; |
|
| 5289 | + $sql .= " AND ".$filtre; |
|
| 5290 | 5290 | } |
| 5291 | 5291 | $sql .= " ORDER BY label"; |
| 5292 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 5292 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 5293 | 5293 | $result = $this->db->query($sql); |
| 5294 | 5294 | if ($result) { |
| 5295 | 5295 | $num = $this->db->num_rows($result); |
| 5296 | 5296 | $i = 0; |
| 5297 | 5297 | |
| 5298 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5298 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5299 | 5299 | |
| 5300 | 5300 | if ($num == 0) { |
| 5301 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>'; |
|
| 5301 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>'; |
|
| 5302 | 5302 | } else { |
| 5303 | 5303 | if (!empty($useempty) && !is_numeric($useempty)) { |
| 5304 | 5304 | $out .= '<option value="-1">'.$langs->trans($useempty).'</option>'; |
@@ -5311,19 +5311,19 @@ discard block |
||
| 5311 | 5311 | $obj = $this->db->fetch_object($result); |
| 5312 | 5312 | $iban = dolDecrypt($obj->iban_prefix); |
| 5313 | 5313 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 5314 | - $out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '" selected>'; |
|
| 5314 | + $out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'" selected>'; |
|
| 5315 | 5315 | } else { |
| 5316 | - $out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '">'; |
|
| 5316 | + $out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'">'; |
|
| 5317 | 5317 | } |
| 5318 | 5318 | $out .= trim($obj->label); |
| 5319 | 5319 | if ($showibanbic) { |
| 5320 | - $out .= ' (' . $iban . '/' .$obj->bic. ')'; |
|
| 5320 | + $out .= ' ('.$iban.'/'.$obj->bic.')'; |
|
| 5321 | 5321 | } |
| 5322 | 5322 | $out .= '</option>'; |
| 5323 | 5323 | $i++; |
| 5324 | 5324 | } |
| 5325 | 5325 | $out .= "</select>"; |
| 5326 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 5326 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 5327 | 5327 | } else { |
| 5328 | 5328 | dol_print_error($this->db); |
| 5329 | 5329 | } |
@@ -5357,23 +5357,23 @@ discard block |
||
| 5357 | 5357 | $num = 0; |
| 5358 | 5358 | |
| 5359 | 5359 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 5360 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 5360 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 5361 | 5361 | $sql .= " WHERE 1=1"; |
| 5362 | 5362 | if ($status != 2) { |
| 5363 | - $sql .= " AND status = " . (int) $status; |
|
| 5363 | + $sql .= " AND status = ".(int) $status; |
|
| 5364 | 5364 | } |
| 5365 | 5365 | if ($filtre) { // TODO Support USF |
| 5366 | - $sql .= " AND " . $filtre; |
|
| 5366 | + $sql .= " AND ".$filtre; |
|
| 5367 | 5367 | } |
| 5368 | 5368 | $sql .= " ORDER BY name"; |
| 5369 | 5369 | |
| 5370 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 5370 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 5371 | 5371 | $result = $this->db->query($sql); |
| 5372 | 5372 | if ($result) { |
| 5373 | 5373 | $num = $this->db->num_rows($result); |
| 5374 | 5374 | $i = 0; |
| 5375 | 5375 | if ($num) { |
| 5376 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5376 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5377 | 5377 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5378 | 5378 | print '<option value="-1"> </option>'; |
| 5379 | 5379 | } |
@@ -5381,13 +5381,13 @@ discard block |
||
| 5381 | 5381 | while ($i < $num) { |
| 5382 | 5382 | $obj = $this->db->fetch_object($result); |
| 5383 | 5383 | if ($selected == $obj->rowid) { |
| 5384 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5384 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5385 | 5385 | } else { |
| 5386 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5386 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5387 | 5387 | } |
| 5388 | 5388 | print trim($obj->name); |
| 5389 | 5389 | if ($status == 2 && $obj->status == 1) { |
| 5390 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 5390 | + print ' ('.$langs->trans("Closed").')'; |
|
| 5391 | 5391 | } |
| 5392 | 5392 | print '</option>'; |
| 5393 | 5393 | $i++; |
@@ -5395,9 +5395,9 @@ discard block |
||
| 5395 | 5395 | print "</select>"; |
| 5396 | 5396 | } else { |
| 5397 | 5397 | if ($status == 0) { |
| 5398 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5398 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5399 | 5399 | } else { |
| 5400 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5400 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5401 | 5401 | } |
| 5402 | 5402 | } |
| 5403 | 5403 | |
@@ -5421,20 +5421,20 @@ discard block |
||
| 5421 | 5421 | { |
| 5422 | 5422 | global $langs; |
| 5423 | 5423 | if ($htmlname != "none") { |
| 5424 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5424 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5425 | 5425 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5426 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5426 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5427 | 5427 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5428 | 5428 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5429 | 5429 | if ($nbaccountfound > 0) { |
| 5430 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5430 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5431 | 5431 | } |
| 5432 | 5432 | print '</form>'; |
| 5433 | 5433 | } else { |
| 5434 | 5434 | $langs->load('banks'); |
| 5435 | 5435 | |
| 5436 | 5436 | if ($selected) { |
| 5437 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5437 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5438 | 5438 | $bankstatic = new Account($this->db); |
| 5439 | 5439 | $result = $bankstatic->fetch($selected); |
| 5440 | 5440 | if ($result) { |
@@ -5461,25 +5461,25 @@ discard block |
||
| 5461 | 5461 | { |
| 5462 | 5462 | global $langs; |
| 5463 | 5463 | if ($htmlname != "none") { |
| 5464 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5464 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5465 | 5465 | print '<input type="hidden" name="action" value="setbankaccountcustomer">'; |
| 5466 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5466 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5467 | 5467 | $nbaccountfound = $this->selectRib($selected, $htmlname, $filtre, $addempty, '', $showibanbic); |
| 5468 | 5468 | if ($nbaccountfound > 0) { |
| 5469 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5469 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5470 | 5470 | } |
| 5471 | 5471 | print '</form>'; |
| 5472 | 5472 | } else { |
| 5473 | 5473 | $langs->load('banks'); |
| 5474 | 5474 | |
| 5475 | 5475 | if ($selected) { |
| 5476 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; |
|
| 5476 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
|
| 5477 | 5477 | $bankstatic = new CompanyBankAccount($this->db); |
| 5478 | 5478 | $result = $bankstatic->fetch($selected); |
| 5479 | 5479 | if ($result) { |
| 5480 | 5480 | print $bankstatic->label; |
| 5481 | 5481 | if ($showibanbic) { |
| 5482 | - print ' (' . $bankstatic->iban . '/' .$bankstatic->bic. ')'; |
|
| 5482 | + print ' ('.$bankstatic->iban.'/'.$bankstatic->bic.')'; |
|
| 5483 | 5483 | } |
| 5484 | 5484 | } |
| 5485 | 5485 | } else { |
@@ -5515,11 +5515,11 @@ discard block |
||
| 5515 | 5515 | global $conf, $langs; |
| 5516 | 5516 | $langs->load("categories"); |
| 5517 | 5517 | |
| 5518 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5518 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5519 | 5519 | |
| 5520 | 5520 | // For backward compatibility |
| 5521 | 5521 | if (is_numeric($type)) { |
| 5522 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5522 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5523 | 5523 | } |
| 5524 | 5524 | |
| 5525 | 5525 | if ($type === Categorie::TYPE_BANK_LINE) { |
@@ -5527,8 +5527,8 @@ discard block |
||
| 5527 | 5527 | $cat = new Categorie($this->db); |
| 5528 | 5528 | $cate_arbo = array(); |
| 5529 | 5529 | $sql = "SELECT c.label, c.rowid"; |
| 5530 | - $sql .= " FROM " . $this->db->prefix() . "categorie as c"; |
|
| 5531 | - $sql .= " WHERE entity = " . $conf->entity . " AND type = " . ((int) $cat->getMapId()[$type]); |
|
| 5530 | + $sql .= " FROM ".$this->db->prefix()."categorie as c"; |
|
| 5531 | + $sql .= " WHERE entity = ".$conf->entity." AND type = ".((int) $cat->getMapId()[$type]); |
|
| 5532 | 5532 | $sql .= " ORDER BY c.label"; |
| 5533 | 5533 | $result = $this->db->query($sql); |
| 5534 | 5534 | if ($result) { |
@@ -5554,12 +5554,12 @@ discard block |
||
| 5554 | 5554 | $outarrayrichhtml = array(); |
| 5555 | 5555 | |
| 5556 | 5556 | |
| 5557 | - $output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5557 | + $output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5558 | 5558 | if (is_array($cate_arbo)) { |
| 5559 | 5559 | $num = count($cate_arbo); |
| 5560 | 5560 | |
| 5561 | 5561 | if (!$num) { |
| 5562 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5562 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5563 | 5563 | } else { |
| 5564 | 5564 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5565 | 5565 | $output .= '<option value="-1"> </option>'; |
@@ -5571,15 +5571,15 @@ discard block |
||
| 5571 | 5571 | $add = ''; |
| 5572 | 5572 | } |
| 5573 | 5573 | |
| 5574 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5574 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5575 | 5575 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5576 | 5576 | |
| 5577 | 5577 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5578 | 5578 | |
| 5579 | 5579 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5580 | 5580 | |
| 5581 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5582 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5581 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5582 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5583 | 5583 | $output .= '>'; |
| 5584 | 5584 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5585 | 5585 | $output .= '</option>'; |
@@ -5625,7 +5625,7 @@ discard block |
||
| 5625 | 5625 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5626 | 5626 | { |
| 5627 | 5627 | // phpcs:enable |
| 5628 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5628 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5629 | 5629 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5630 | 5630 | } |
| 5631 | 5631 | |
@@ -5660,7 +5660,7 @@ discard block |
||
| 5660 | 5660 | { |
| 5661 | 5661 | global $langs, $conf; |
| 5662 | 5662 | |
| 5663 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5663 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5664 | 5664 | $formconfirm = ''; |
| 5665 | 5665 | $inputok = array(); |
| 5666 | 5666 | $inputko = array(); |
@@ -5684,27 +5684,27 @@ discard block |
||
| 5684 | 5684 | foreach ($formquestion as $key => $input) { |
| 5685 | 5685 | if (is_array($input) && !empty($input)) { |
| 5686 | 5686 | if ($input['type'] == 'hidden') { |
| 5687 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5688 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5687 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5688 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5689 | 5689 | |
| 5690 | - $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"; |
|
| 5690 | + $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"; |
|
| 5691 | 5691 | } |
| 5692 | 5692 | } |
| 5693 | 5693 | } |
| 5694 | 5694 | |
| 5695 | 5695 | // Now add questions |
| 5696 | 5696 | $moreonecolumn = ''; |
| 5697 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5697 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5698 | 5698 | foreach ($formquestion as $key => $input) { |
| 5699 | 5699 | if (is_array($input) && !empty($input)) { |
| 5700 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5701 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5702 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5700 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5701 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5702 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5703 | 5703 | |
| 5704 | 5704 | if ($input['type'] == 'text') { |
| 5705 | - $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"; |
|
| 5705 | + $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"; |
|
| 5706 | 5706 | } elseif ($input['type'] == 'password') { |
| 5707 | - $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"; |
|
| 5707 | + $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"; |
|
| 5708 | 5708 | } elseif ($input['type'] == 'textarea') { |
| 5709 | 5709 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5710 | 5710 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5712,8 +5712,8 @@ discard block |
||
| 5712 | 5712 | $more .= '</textarea>'; |
| 5713 | 5713 | $more .= '</div></div>'."\n";*/ |
| 5714 | 5714 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5715 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5716 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5715 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5716 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5717 | 5717 | $moreonecolumn .= $input['value']; |
| 5718 | 5718 | $moreonecolumn .= '</textarea>'; |
| 5719 | 5719 | $moreonecolumn .= '</div>'; |
@@ -5730,20 +5730,20 @@ discard block |
||
| 5730 | 5730 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5731 | 5731 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5732 | 5732 | |
| 5733 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5733 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5734 | 5734 | if (!empty($input['label'])) { |
| 5735 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5735 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5736 | 5736 | } |
| 5737 | 5737 | if ($input['type'] == 'select') { |
| 5738 | 5738 | $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); |
| 5739 | 5739 | } else { |
| 5740 | 5740 | $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); |
| 5741 | 5741 | } |
| 5742 | - $more .= '</div></div>' . "\n"; |
|
| 5742 | + $more .= '</div></div>'."\n"; |
|
| 5743 | 5743 | } elseif ($input['type'] == 'checkbox') { |
| 5744 | 5744 | $more .= '<div class="tagtr">'; |
| 5745 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5746 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5745 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5746 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5747 | 5747 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5748 | 5748 | $more .= ' checked'; |
| 5749 | 5749 | } |
@@ -5754,19 +5754,19 @@ discard block |
||
| 5754 | 5754 | $more .= ' disabled'; |
| 5755 | 5755 | } |
| 5756 | 5756 | $more .= ' /></div>'; |
| 5757 | - $more .= '</div>' . "\n"; |
|
| 5757 | + $more .= '</div>'."\n"; |
|
| 5758 | 5758 | } elseif ($input['type'] == 'radio') { |
| 5759 | 5759 | $i = 0; |
| 5760 | 5760 | foreach ($input['values'] as $selkey => $selval) { |
| 5761 | 5761 | $more .= '<div class="tagtr">'; |
| 5762 | 5762 | if (isset($input['label'])) { |
| 5763 | 5763 | if ($i == 0) { |
| 5764 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5764 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5765 | 5765 | } else { |
| 5766 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5766 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5767 | 5767 | } |
| 5768 | 5768 | } |
| 5769 | - $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; |
|
| 5769 | + $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; |
|
| 5770 | 5770 | if (!empty($input['disabled'])) { |
| 5771 | 5771 | $more .= ' disabled'; |
| 5772 | 5772 | } |
@@ -5774,12 +5774,12 @@ discard block |
||
| 5774 | 5774 | $more .= ' checked="checked"'; |
| 5775 | 5775 | } |
| 5776 | 5776 | $more .= ' /> '; |
| 5777 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5778 | - $more .= '</div></div>' . "\n"; |
|
| 5777 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5778 | + $more .= '</div></div>'."\n"; |
|
| 5779 | 5779 | $i++; |
| 5780 | 5780 | } |
| 5781 | 5781 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5782 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5782 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5783 | 5783 | $more .= '<div class="tagtd">'; |
| 5784 | 5784 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5785 | 5785 | $h = $m = 0; |
@@ -5797,24 +5797,24 @@ discard block |
||
| 5797 | 5797 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5798 | 5798 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5799 | 5799 | if (!empty($input['label'])) { |
| 5800 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5800 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5801 | 5801 | } |
| 5802 | 5802 | $more .= $input['value']; |
| 5803 | - $more .= '</div></div>' . "\n"; |
|
| 5803 | + $more .= '</div></div>'."\n"; |
|
| 5804 | 5804 | } elseif ($input['type'] == 'onecolumn') { |
| 5805 | 5805 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5806 | 5806 | $moreonecolumn .= $input['value']; |
| 5807 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5807 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5808 | 5808 | } elseif ($input['type'] == 'hidden') { |
| 5809 | 5809 | // Do nothing more, already added by a previous loop |
| 5810 | 5810 | } elseif ($input['type'] == 'separator') { |
| 5811 | 5811 | $more .= '<br>'; |
| 5812 | 5812 | } else { |
| 5813 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5813 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5814 | 5814 | } |
| 5815 | 5815 | } |
| 5816 | 5816 | } |
| 5817 | - $more .= '</div>' . "\n"; |
|
| 5817 | + $more .= '</div>'."\n"; |
|
| 5818 | 5818 | $more .= $moreonecolumn; |
| 5819 | 5819 | } |
| 5820 | 5820 | |
@@ -5836,10 +5836,10 @@ discard block |
||
| 5836 | 5836 | $button = $useajax; |
| 5837 | 5837 | $useajax = 1; |
| 5838 | 5838 | $autoOpen = false; |
| 5839 | - $dialogconfirm .= '-' . $button; |
|
| 5839 | + $dialogconfirm .= '-'.$button; |
|
| 5840 | 5840 | } |
| 5841 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5842 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5841 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5842 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5843 | 5843 | |
| 5844 | 5844 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5845 | 5845 | if (is_array($formquestion)) { |
@@ -5862,24 +5862,24 @@ discard block |
||
| 5862 | 5862 | } |
| 5863 | 5863 | |
| 5864 | 5864 | // Show JQuery confirm box. |
| 5865 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5865 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5866 | 5866 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 5867 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5867 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5868 | 5868 | } |
| 5869 | 5869 | if (!empty($more)) { |
| 5870 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5870 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5871 | 5871 | } |
| 5872 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : ''); |
|
| 5873 | - $formconfirm .= '</div>' . "\n"; |
|
| 5872 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : ''); |
|
| 5873 | + $formconfirm .= '</div>'."\n"; |
|
| 5874 | 5874 | |
| 5875 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5876 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5875 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5876 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5877 | 5877 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5878 | 5878 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5879 | 5879 | $(function() { |
| 5880 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5880 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5881 | 5881 | { |
| 5882 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5882 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5883 | 5883 | if ($newselectedchoice == 'no') { |
| 5884 | 5884 | $formconfirm .= ' |
| 5885 | 5885 | open: function() { |
@@ -5889,24 +5889,24 @@ discard block |
||
| 5889 | 5889 | |
| 5890 | 5890 | $jsforcursor = ''; |
| 5891 | 5891 | if ($useajax == 1) { |
| 5892 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5893 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5892 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5893 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5894 | 5894 | } |
| 5895 | 5895 | |
| 5896 | 5896 | $postconfirmas = 'GET'; |
| 5897 | 5897 | |
| 5898 | 5898 | $formconfirm .= ' |
| 5899 | 5899 | resizable: false, |
| 5900 | - height: "' . $height . '", |
|
| 5901 | - width: "' . $width . '", |
|
| 5900 | + height: "' . $height.'", |
|
| 5901 | + width: "' . $width.'", |
|
| 5902 | 5902 | modal: true, |
| 5903 | 5903 | closeOnEscape: false, |
| 5904 | 5904 | buttons: { |
| 5905 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5906 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5907 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5908 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5909 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5905 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5906 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5907 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5908 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5909 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5910 | 5910 | |
| 5911 | 5911 | if (inputok.length > 0) { |
| 5912 | 5912 | $.each(inputok, function(i, inputname) { |
@@ -5940,11 +5940,11 @@ discard block |
||
| 5940 | 5940 | } |
| 5941 | 5941 | $(this).dialog("close"); |
| 5942 | 5942 | }, |
| 5943 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5944 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5945 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5946 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5947 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5943 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5944 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5945 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5946 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5947 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5948 | 5948 | if (inputko.length > 0) { |
| 5949 | 5949 | $.each(inputko, function(i, inputname) { |
| 5950 | 5950 | var more = ""; |
@@ -5976,10 +5976,10 @@ discard block |
||
| 5976 | 5976 | } |
| 5977 | 5977 | ); |
| 5978 | 5978 | |
| 5979 | - var button = "' . $button . '"; |
|
| 5979 | + var button = "' . $button.'"; |
|
| 5980 | 5980 | if (button.length > 0) { |
| 5981 | 5981 | $( "#" + button ).click(function() { |
| 5982 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5982 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5983 | 5983 | }); |
| 5984 | 5984 | } |
| 5985 | 5985 | }); |
@@ -5987,44 +5987,44 @@ discard block |
||
| 5987 | 5987 | </script>'; |
| 5988 | 5988 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5989 | 5989 | } else { |
| 5990 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5990 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5991 | 5991 | |
| 5992 | 5992 | if (empty($disableformtag)) { |
| 5993 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n"; |
|
| 5993 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n"; |
|
| 5994 | 5994 | } |
| 5995 | 5995 | |
| 5996 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5997 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5996 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5997 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5998 | 5998 | |
| 5999 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5999 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 6000 | 6000 | |
| 6001 | 6001 | // Line title |
| 6002 | 6002 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 6003 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 6004 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 6003 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 6004 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 6005 | 6005 | |
| 6006 | 6006 | // Line text |
| 6007 | 6007 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
| 6008 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 6008 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 6009 | 6009 | } |
| 6010 | 6010 | |
| 6011 | 6011 | // Line form fields |
| 6012 | 6012 | if ($more) { |
| 6013 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 6013 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 6014 | 6014 | $formconfirm .= $more; |
| 6015 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 6015 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 6016 | 6016 | } |
| 6017 | 6017 | |
| 6018 | 6018 | // Line with question |
| 6019 | 6019 | $formconfirm .= '<tr class="valid">'; |
| 6020 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 6020 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 6021 | 6021 | $formconfirm .= '<td class="valid center">'; |
| 6022 | 6022 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 6023 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 6023 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 6024 | 6024 | $formconfirm .= '</td>'; |
| 6025 | - $formconfirm .= '</tr>' . "\n"; |
|
| 6025 | + $formconfirm .= '</tr>'."\n"; |
|
| 6026 | 6026 | |
| 6027 | - $formconfirm .= '</table>' . "\n"; |
|
| 6027 | + $formconfirm .= '</table>'."\n"; |
|
| 6028 | 6028 | |
| 6029 | 6029 | if (empty($disableformtag)) { |
| 6030 | 6030 | $formconfirm .= "</form>\n"; |
@@ -6033,7 +6033,7 @@ discard block |
||
| 6033 | 6033 | |
| 6034 | 6034 | if (!empty($conf->use_javascript_ajax)) { |
| 6035 | 6035 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 6036 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 6036 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 6037 | 6037 | $formconfirm .= ' |
| 6038 | 6038 | $(document).ready(function () { |
| 6039 | 6039 | $(".confirmvalidatebutton").on("click", function() { |
@@ -6045,7 +6045,7 @@ discard block |
||
| 6045 | 6045 | }); |
| 6046 | 6046 | }); |
| 6047 | 6047 | '; |
| 6048 | - $formconfirm .= '</script>' . "\n"; |
|
| 6048 | + $formconfirm .= '</script>'."\n"; |
|
| 6049 | 6049 | } |
| 6050 | 6050 | |
| 6051 | 6051 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -6077,8 +6077,8 @@ discard block |
||
| 6077 | 6077 | // phpcs:enable |
| 6078 | 6078 | global $langs; |
| 6079 | 6079 | |
| 6080 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 6081 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 6080 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 6081 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 6082 | 6082 | |
| 6083 | 6083 | $out = ''; |
| 6084 | 6084 | |
@@ -6086,11 +6086,11 @@ discard block |
||
| 6086 | 6086 | |
| 6087 | 6087 | $langs->load("project"); |
| 6088 | 6088 | if ($htmlname != "none") { |
| 6089 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6089 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6090 | 6090 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 6091 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6091 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6092 | 6092 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 6093 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6093 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6094 | 6094 | $out .= '</form>'; |
| 6095 | 6095 | } else { |
| 6096 | 6096 | $out .= '<span class="project_head_block">'; |
@@ -6099,7 +6099,7 @@ discard block |
||
| 6099 | 6099 | $projet->fetch($selected); |
| 6100 | 6100 | $out .= $projet->getNomUrl(0, '', 1); |
| 6101 | 6101 | } else { |
| 6102 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 6102 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 6103 | 6103 | } |
| 6104 | 6104 | $out .= '</span>'; |
| 6105 | 6105 | } |
@@ -6136,14 +6136,14 @@ discard block |
||
| 6136 | 6136 | $out = ''; |
| 6137 | 6137 | |
| 6138 | 6138 | if ($htmlname != "none") { |
| 6139 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 6139 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 6140 | 6140 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 6141 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6141 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6142 | 6142 | if ($type) { |
| 6143 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6143 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6144 | 6144 | } |
| 6145 | 6145 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 6146 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6146 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6147 | 6147 | $out .= '</form>'; |
| 6148 | 6148 | } else { |
| 6149 | 6149 | if ($selected) { |
@@ -6188,12 +6188,12 @@ discard block |
||
| 6188 | 6188 | // phpcs:enable |
| 6189 | 6189 | global $langs; |
| 6190 | 6190 | if ($htmlname != "none") { |
| 6191 | - print '<form method="post" action="' . $page . '">'; |
|
| 6191 | + print '<form method="post" action="'.$page.'">'; |
|
| 6192 | 6192 | print '<input type="hidden" name="action" value="setavailability">'; |
| 6193 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6193 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6194 | 6194 | $this->selectAvailabilityDelay($selected, $htmlname, '', $addempty); |
| 6195 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6196 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 6195 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6196 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 6197 | 6197 | print '</form>'; |
| 6198 | 6198 | } else { |
| 6199 | 6199 | if ($selected) { |
@@ -6219,11 +6219,11 @@ discard block |
||
| 6219 | 6219 | { |
| 6220 | 6220 | global $langs; |
| 6221 | 6221 | if ($htmlname != "none") { |
| 6222 | - print '<form method="post" action="' . $page . '">'; |
|
| 6222 | + print '<form method="post" action="'.$page.'">'; |
|
| 6223 | 6223 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 6224 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6224 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6225 | 6225 | $this->selectInputReason($selected, $htmlname, '-1', $addempty); |
| 6226 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 6226 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 6227 | 6227 | print '</form>'; |
| 6228 | 6228 | } else { |
| 6229 | 6229 | if ($selected) { |
@@ -6263,17 +6263,17 @@ discard block |
||
| 6263 | 6263 | $ret = ''; |
| 6264 | 6264 | |
| 6265 | 6265 | if ($htmlname != "none") { |
| 6266 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6267 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6268 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6266 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6267 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6268 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6269 | 6269 | if ($type) { |
| 6270 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6270 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6271 | 6271 | } |
| 6272 | 6272 | $ret .= '<table class="nobordernopadding">'; |
| 6273 | 6273 | $ret .= '<tr><td>'; |
| 6274 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 6274 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 6275 | 6275 | $ret .= '</td>'; |
| 6276 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6276 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6277 | 6277 | $ret .= '</tr></table></form>'; |
| 6278 | 6278 | } else { |
| 6279 | 6279 | if ($displayhour) { |
@@ -6308,15 +6308,15 @@ discard block |
||
| 6308 | 6308 | global $langs; |
| 6309 | 6309 | |
| 6310 | 6310 | if ($htmlname != "none") { |
| 6311 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 6312 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 6313 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6311 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 6312 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 6313 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6314 | 6314 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 6315 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6315 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6316 | 6316 | print '</form>'; |
| 6317 | 6317 | } else { |
| 6318 | 6318 | if ($selected) { |
| 6319 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 6319 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 6320 | 6320 | $theuser = new User($this->db); |
| 6321 | 6321 | $theuser->fetch($selected); |
| 6322 | 6322 | print $theuser->getNomUrl(1); |
@@ -6349,14 +6349,14 @@ discard block |
||
| 6349 | 6349 | |
| 6350 | 6350 | $out = ''; |
| 6351 | 6351 | if ($htmlname != "none") { |
| 6352 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 6352 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 6353 | 6353 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 6354 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6354 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6355 | 6355 | if ($type) { |
| 6356 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 6356 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 6357 | 6357 | } |
| 6358 | 6358 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 6359 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6359 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6360 | 6360 | $out .= '</form>'; |
| 6361 | 6361 | } else { |
| 6362 | 6362 | if ($selected) { |
@@ -6389,11 +6389,11 @@ discard block |
||
| 6389 | 6389 | { |
| 6390 | 6390 | global $langs; |
| 6391 | 6391 | if ($htmlname != "none") { |
| 6392 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6392 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6393 | 6393 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 6394 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6394 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6395 | 6395 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 6396 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6396 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6397 | 6397 | print '</form>'; |
| 6398 | 6398 | } else { |
| 6399 | 6399 | if ($selected) { |
@@ -6420,14 +6420,14 @@ discard block |
||
| 6420 | 6420 | // phpcs:enable |
| 6421 | 6421 | global $langs; |
| 6422 | 6422 | if ($htmlname != "none") { |
| 6423 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6423 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6424 | 6424 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 6425 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6425 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6426 | 6426 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 6427 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6427 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6428 | 6428 | print '</form>'; |
| 6429 | 6429 | } else { |
| 6430 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6430 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6431 | 6431 | print !empty($selected) ? currency_name($selected, 1) : ' '; |
| 6432 | 6432 | } |
| 6433 | 6433 | } |
@@ -6449,22 +6449,22 @@ discard block |
||
| 6449 | 6449 | global $langs, $mysoc, $conf; |
| 6450 | 6450 | |
| 6451 | 6451 | if ($htmlname != "none") { |
| 6452 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6452 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6453 | 6453 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6454 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6455 | - print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6454 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6455 | + print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6456 | 6456 | print '<select name="calculation_mode" id="calculation_mode">'; |
| 6457 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6458 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6457 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6458 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6459 | 6459 | print '</select> '; |
| 6460 | 6460 | print ajax_combobox("calculation_mode"); |
| 6461 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6461 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6462 | 6462 | print '</form>'; |
| 6463 | 6463 | } else { |
| 6464 | 6464 | if (!empty($rate)) { |
| 6465 | 6465 | print price($rate, 1, $langs, 0, 0); |
| 6466 | 6466 | if ($currency && $rate != 1) { |
| 6467 | - print ' <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>'; |
|
| 6467 | + print ' <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>'; |
|
| 6468 | 6468 | } |
| 6469 | 6469 | } else { |
| 6470 | 6470 | print 1; |
@@ -6494,9 +6494,9 @@ discard block |
||
| 6494 | 6494 | // phpcs:enable |
| 6495 | 6495 | global $conf, $langs; |
| 6496 | 6496 | if ($htmlname != "none") { |
| 6497 | - print '<form method="post" action="' . $page . '">'; |
|
| 6497 | + print '<form method="post" action="'.$page.'">'; |
|
| 6498 | 6498 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6499 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6499 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6500 | 6500 | print '<div class="inline-block">'; |
| 6501 | 6501 | if (!empty($discount_type)) { |
| 6502 | 6502 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6534,24 +6534,24 @@ discard block |
||
| 6534 | 6534 | print '</div>'; |
| 6535 | 6535 | if (empty($hidelist)) { |
| 6536 | 6536 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6537 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6537 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6538 | 6538 | if (!empty($discount_type)) { |
| 6539 | 6539 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6540 | 6540 | } else { |
| 6541 | 6541 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6542 | 6542 | } |
| 6543 | 6543 | if ($filter) { |
| 6544 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6544 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6545 | 6545 | } |
| 6546 | 6546 | // output the combo of discounts |
| 6547 | 6547 | $nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6548 | 6548 | if ($nbqualifiedlines > 0) { |
| 6549 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6549 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6550 | 6550 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6551 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6551 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6552 | 6552 | } |
| 6553 | 6553 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6554 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6554 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6555 | 6555 | } |
| 6556 | 6556 | |
| 6557 | 6557 | print '>'; |
@@ -6591,23 +6591,23 @@ discard block |
||
| 6591 | 6591 | global $langs; |
| 6592 | 6592 | |
| 6593 | 6593 | if ($htmlname != "none") { |
| 6594 | - print '<form method="post" action="' . $page . '">'; |
|
| 6594 | + print '<form method="post" action="'.$page.'">'; |
|
| 6595 | 6595 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6596 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6596 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6597 | 6597 | print '<table class="nobordernopadding">'; |
| 6598 | 6598 | print '<tr><td>'; |
| 6599 | 6599 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6600 | 6600 | $num = $this->num; |
| 6601 | 6601 | if ($num == 0) { |
| 6602 | 6602 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6603 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6603 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6604 | 6604 | } |
| 6605 | 6605 | print '</td>'; |
| 6606 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6606 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6607 | 6607 | print '</tr></table></form>'; |
| 6608 | 6608 | } else { |
| 6609 | 6609 | if ($selected) { |
| 6610 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6610 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6611 | 6611 | $contact = new Contact($this->db); |
| 6612 | 6612 | $contact->fetch($selected); |
| 6613 | 6613 | print $contact->getFullName($langs); |
@@ -6642,20 +6642,20 @@ discard block |
||
| 6642 | 6642 | |
| 6643 | 6643 | $out = ''; |
| 6644 | 6644 | if ($htmlname != "none") { |
| 6645 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6645 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6646 | 6646 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6647 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6647 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6648 | 6648 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6649 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6649 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6650 | 6650 | $out .= '</form>'; |
| 6651 | 6651 | } else { |
| 6652 | 6652 | if ($selected) { |
| 6653 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6653 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6654 | 6654 | $soc = new Societe($this->db); |
| 6655 | 6655 | $soc->fetch($selected); |
| 6656 | 6656 | $out .= $soc->getNomUrl(0, ''); |
| 6657 | 6657 | } else { |
| 6658 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6658 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6659 | 6659 | } |
| 6660 | 6660 | } |
| 6661 | 6661 | |
@@ -6705,22 +6705,22 @@ discard block |
||
| 6705 | 6705 | $selected = 'EUR'; // Pour compatibilite |
| 6706 | 6706 | } |
| 6707 | 6707 | |
| 6708 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6708 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6709 | 6709 | if ($useempty) { |
| 6710 | 6710 | $out .= '<option value="-1" selected></option>'; |
| 6711 | 6711 | } |
| 6712 | 6712 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6713 | 6713 | $labeltoshow = $currency['label']; |
| 6714 | 6714 | if ($mode == 1) { |
| 6715 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6715 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6716 | 6716 | } else { |
| 6717 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6717 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6718 | 6718 | } |
| 6719 | 6719 | |
| 6720 | 6720 | if ($selected && $selected == $code_iso) { |
| 6721 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6721 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6722 | 6722 | } else { |
| 6723 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6723 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6724 | 6724 | } |
| 6725 | 6725 | $out .= dol_string_nohtmltag($labeltoshow); |
| 6726 | 6726 | $out .= '</option>'; |
@@ -6731,7 +6731,7 @@ discard block |
||
| 6731 | 6731 | } |
| 6732 | 6732 | |
| 6733 | 6733 | // Make select dynamic |
| 6734 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6734 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6735 | 6735 | $out .= ajax_combobox($htmlname); |
| 6736 | 6736 | |
| 6737 | 6737 | return $out; |
@@ -6757,10 +6757,10 @@ discard block |
||
| 6757 | 6757 | |
| 6758 | 6758 | $TCurrency = array(); |
| 6759 | 6759 | |
| 6760 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6761 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6760 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6761 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6762 | 6762 | if ($filter) { |
| 6763 | - $sql .= " AND " . $filter; |
|
| 6763 | + $sql .= " AND ".$filter; |
|
| 6764 | 6764 | } |
| 6765 | 6765 | $resql = $this->db->query($sql); |
| 6766 | 6766 | if ($resql) { |
@@ -6770,7 +6770,7 @@ discard block |
||
| 6770 | 6770 | } |
| 6771 | 6771 | |
| 6772 | 6772 | $out = ''; |
| 6773 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6773 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6774 | 6774 | if ($useempty) { |
| 6775 | 6775 | $out .= '<option value=""> </option>'; |
| 6776 | 6776 | } |
@@ -6782,13 +6782,13 @@ discard block |
||
| 6782 | 6782 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6783 | 6783 | if (isset($TCurrency[$code_iso])) { |
| 6784 | 6784 | if (!empty($selected) && $selected == $code_iso) { |
| 6785 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6785 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6786 | 6786 | } else { |
| 6787 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6787 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6788 | 6788 | } |
| 6789 | 6789 | |
| 6790 | 6790 | $out .= $currency['label']; |
| 6791 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6791 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6792 | 6792 | $out .= '</option>'; |
| 6793 | 6793 | } |
| 6794 | 6794 | } |
@@ -6797,7 +6797,7 @@ discard block |
||
| 6797 | 6797 | $out .= '</select>'; |
| 6798 | 6798 | |
| 6799 | 6799 | // Make select dynamic |
| 6800 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6800 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6801 | 6801 | $out .= ajax_combobox($htmlname); |
| 6802 | 6802 | |
| 6803 | 6803 | return $out; |
@@ -6828,7 +6828,7 @@ discard block |
||
| 6828 | 6828 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6829 | 6829 | $sql .= " AND t.active > 0"; |
| 6830 | 6830 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6831 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6831 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6832 | 6832 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6833 | 6833 | |
| 6834 | 6834 | $resql = $this->db->query($sql); |
@@ -6840,30 +6840,30 @@ discard block |
||
| 6840 | 6840 | |
| 6841 | 6841 | $tmparray = array(); |
| 6842 | 6842 | $tmparray['rowid'] = $obj->rowid; |
| 6843 | - $tmparray['type_vat'] = $obj->type_vat; |
|
| 6844 | - $tmparray['code'] = $obj->code; |
|
| 6843 | + $tmparray['type_vat'] = $obj->type_vat; |
|
| 6844 | + $tmparray['code'] = $obj->code; |
|
| 6845 | 6845 | $tmparray['txtva'] = $obj->taux; |
| 6846 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6846 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6847 | 6847 | $tmparray['localtax1'] = $obj->localtax1; |
| 6848 | 6848 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
| 6849 | 6849 | $tmparray['localtax2'] = $obj->localtax2; |
| 6850 | 6850 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
| 6851 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6852 | - $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 |
|
| 6851 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6852 | + $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 |
|
| 6853 | 6853 | $positiverates = ''; |
| 6854 | 6854 | if ($obj->taux) { |
| 6855 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6855 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6856 | 6856 | } |
| 6857 | 6857 | if ($obj->localtax1) { |
| 6858 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6858 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6859 | 6859 | } |
| 6860 | 6860 | if ($obj->localtax2) { |
| 6861 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6861 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6862 | 6862 | } |
| 6863 | 6863 | if (empty($positiverates)) { |
| 6864 | 6864 | $positiverates = '0'; |
| 6865 | 6865 | } |
| 6866 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6866 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6867 | 6867 | |
| 6868 | 6868 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
| 6869 | 6869 | } |
@@ -6883,7 +6883,7 @@ discard block |
||
| 6883 | 6883 | return -1; |
| 6884 | 6884 | } |
| 6885 | 6885 | } else { |
| 6886 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6886 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6887 | 6887 | return -2; |
| 6888 | 6888 | } |
| 6889 | 6889 | } |
@@ -6955,9 +6955,9 @@ discard block |
||
| 6955 | 6955 | // Check parameters |
| 6956 | 6956 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6957 | 6957 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6958 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6958 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6959 | 6959 | } else { |
| 6960 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6960 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6961 | 6961 | } |
| 6962 | 6962 | return $return; |
| 6963 | 6963 | } |
@@ -6969,12 +6969,12 @@ discard block |
||
| 6969 | 6969 | // Define list of countries to use to search VAT rates to show |
| 6970 | 6970 | // First we defined code_country to use to find list |
| 6971 | 6971 | if (is_object($societe_vendeuse)) { |
| 6972 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6972 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6973 | 6973 | } else { |
| 6974 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6974 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6975 | 6975 | } |
| 6976 | 6976 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
| 6977 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6977 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6978 | 6978 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
| 6979 | 6979 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
| 6980 | 6980 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6984,27 +6984,27 @@ discard block |
||
| 6984 | 6984 | if ($type == 1) { // We know product is a service |
| 6985 | 6985 | switch ($selectVatComboMode) { |
| 6986 | 6986 | case '1': |
| 6987 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6987 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6988 | 6988 | break; |
| 6989 | 6989 | case '2': |
| 6990 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6990 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6991 | 6991 | break; |
| 6992 | 6992 | } |
| 6993 | 6993 | } |
| 6994 | 6994 | } elseif (!$idprod) { // We don't know type of product |
| 6995 | 6995 | switch ($selectVatComboMode) { |
| 6996 | 6996 | case '1': |
| 6997 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6997 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6998 | 6998 | break; |
| 6999 | 6999 | case '2': |
| 7000 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 7000 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 7001 | 7001 | break; |
| 7002 | 7002 | } |
| 7003 | 7003 | } else { |
| 7004 | 7004 | $prodstatic = new Product($this->db); |
| 7005 | 7005 | $prodstatic->fetch($idprod); |
| 7006 | 7006 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 7007 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 7007 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 7008 | 7008 | } |
| 7009 | 7009 | } |
| 7010 | 7010 | } |
@@ -7066,13 +7066,13 @@ discard block |
||
| 7066 | 7066 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 7067 | 7067 | // of using supplier invoices (this is a very bad idea !) |
| 7068 | 7068 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
| 7069 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 7069 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 7070 | 7070 | $disabled = true; |
| 7071 | 7071 | } |
| 7072 | 7072 | } |
| 7073 | 7073 | |
| 7074 | 7074 | if (!$options_only) { |
| 7075 | - $return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 7075 | + $return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 7076 | 7076 | } |
| 7077 | 7077 | |
| 7078 | 7078 | $selectedfound = false; |
@@ -7086,13 +7086,13 @@ discard block |
||
| 7086 | 7086 | $key = $rate['txtva']; |
| 7087 | 7087 | $key .= $rate['nprtva'] ? '*' : ''; |
| 7088 | 7088 | if ($mode > 0 && $rate['code']) { |
| 7089 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 7089 | + $key .= ' ('.$rate['code'].')'; |
|
| 7090 | 7090 | } |
| 7091 | 7091 | if ($mode < 0) { |
| 7092 | 7092 | $key = $rate['rowid']; |
| 7093 | 7093 | } |
| 7094 | 7094 | |
| 7095 | - $return .= '<option value="' . $key . '"'; |
|
| 7095 | + $return .= '<option value="'.$key.'"'; |
|
| 7096 | 7096 | if (!$selectedfound) { |
| 7097 | 7097 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 7098 | 7098 | if ($defaultcode == $rate['code']) { |
@@ -7163,7 +7163,7 @@ discard block |
||
| 7163 | 7163 | 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 = '') |
| 7164 | 7164 | { |
| 7165 | 7165 | // phpcs:enable |
| 7166 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 7166 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 7167 | 7167 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 7168 | 7168 | if (!empty($nooutput)) { |
| 7169 | 7169 | return $retstring; |
@@ -7192,11 +7192,11 @@ discard block |
||
| 7192 | 7192 | { |
| 7193 | 7193 | global $langs; |
| 7194 | 7194 | |
| 7195 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 7195 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 7196 | 7196 | if ($forcenewline) { |
| 7197 | 7197 | $ret .= '<br>'; |
| 7198 | 7198 | } |
| 7199 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 7199 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 7200 | 7200 | return $ret; |
| 7201 | 7201 | } |
| 7202 | 7202 | |
@@ -7263,7 +7263,7 @@ discard block |
||
| 7263 | 7263 | $orig_set_time = $set_time; |
| 7264 | 7264 | |
| 7265 | 7265 | if ($set_time === '' && $emptydate == 0) { |
| 7266 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7266 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7267 | 7267 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 7268 | 7268 | $set_time = dol_now($gm); |
| 7269 | 7269 | } else { |
@@ -7335,38 +7335,38 @@ discard block |
||
| 7335 | 7335 | // Calendrier popup version eldy |
| 7336 | 7336 | if ($usecalendar == "eldy") { |
| 7337 | 7337 | // Input area to enter date manually |
| 7338 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"'; |
|
| 7338 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
|
| 7339 | 7339 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7340 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7340 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7341 | 7341 | $retstring .= ' autocomplete="off">'; |
| 7342 | 7342 | |
| 7343 | 7343 | // Icon calendar |
| 7344 | 7344 | $retstringbuttom = ''; |
| 7345 | 7345 | if (!$disabled) { |
| 7346 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7347 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 7348 | - $retstringbuttom .= ' onClick="showDP(\'' . dol_escape_js($base) . '\',\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\',\'' . dol_escape_js($langs->defaultlang) . '\');"'; |
|
| 7349 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7346 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 7347 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 7348 | + $retstringbuttom .= ' onClick="showDP(\''.dol_escape_js($base).'\',\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\',\''.dol_escape_js($langs->defaultlang).'\');"'; |
|
| 7349 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7350 | 7350 | } else { |
| 7351 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7351 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7352 | 7352 | } |
| 7353 | - $retstring = $retstringbuttom . $retstring; |
|
| 7353 | + $retstring = $retstringbuttom.$retstring; |
|
| 7354 | 7354 | |
| 7355 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7356 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7357 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7355 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7356 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7357 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7358 | 7358 | } elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
| 7359 | 7359 | if (!$disabled && $usecalendar != 'html') { |
| 7360 | 7360 | // Output javascript for datepicker |
| 7361 | 7361 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100)); |
| 7362 | 7362 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100)); |
| 7363 | 7363 | |
| 7364 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 7365 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 7366 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 7364 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 7365 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 7366 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 7367 | 7367 | autoclose: true, |
| 7368 | 7368 | todayHighlight: true, |
| 7369 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 7369 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 7370 | 7370 | if (!empty($conf->dol_use_jmobile)) { |
| 7371 | 7371 | $retstring .= " |
| 7372 | 7372 | beforeShow: function (input, datePicker) { |
@@ -7379,10 +7379,10 @@ discard block |
||
| 7379 | 7379 | } |
| 7380 | 7380 | // Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php |
| 7381 | 7381 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
| 7382 | - $buttonImage = $calendarpicto ?: DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png"; |
|
| 7382 | + $buttonImage = $calendarpicto ?: DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png"; |
|
| 7383 | 7383 | $retstring .= " |
| 7384 | 7384 | showOn: 'button', /* both has problem with autocompletion */ |
| 7385 | - buttonImage: '" . $buttonImage . "', |
|
| 7385 | + buttonImage: '" . $buttonImage."', |
|
| 7386 | 7386 | buttonImageOnly: true"; |
| 7387 | 7387 | } |
| 7388 | 7388 | $retstring .= " |
@@ -7394,46 +7394,46 @@ discard block |
||
| 7394 | 7394 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 7395 | 7395 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="'.($usecalendar == 'html' ? "date" : "text").'" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
| 7396 | 7396 | $retstring .= ($disabled ? ' disabled' : ''); |
| 7397 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 7398 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7397 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 7398 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 7399 | 7399 | $retstring .= ' autocomplete="off">'; |
| 7400 | 7400 | |
| 7401 | 7401 | // Icone calendrier |
| 7402 | 7402 | if ($disabled) { |
| 7403 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 7404 | - $retstring = $retstringbutton . $retstring; |
|
| 7403 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 7404 | + $retstring = $retstringbutton.$retstring; |
|
| 7405 | 7405 | } |
| 7406 | 7406 | |
| 7407 | 7407 | $retstring .= '</div>'; |
| 7408 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 7409 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 7410 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 7408 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 7409 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 7410 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 7411 | 7411 | } else { |
| 7412 | 7412 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 7413 | 7413 | } |
| 7414 | 7414 | } else { |
| 7415 | 7415 | // Show date with combo selects |
| 7416 | 7416 | // Day |
| 7417 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 7417 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 7418 | 7418 | |
| 7419 | 7419 | if ($emptydate || $set_time == -1) { |
| 7420 | 7420 | $retstring .= '<option value="0" selected> </option>'; |
| 7421 | 7421 | } |
| 7422 | 7422 | |
| 7423 | 7423 | for ($day = 1; $day <= 31; $day++) { |
| 7424 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 7424 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 7425 | 7425 | } |
| 7426 | 7426 | |
| 7427 | 7427 | $retstring .= "</select>"; |
| 7428 | 7428 | |
| 7429 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 7429 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 7430 | 7430 | if ($emptydate || $set_time == -1) { |
| 7431 | 7431 | $retstring .= '<option value="0" selected> </option>'; |
| 7432 | 7432 | } |
| 7433 | 7433 | |
| 7434 | 7434 | // Month |
| 7435 | 7435 | for ($month = 1; $month <= 12; $month++) { |
| 7436 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 7436 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 7437 | 7437 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 7438 | 7438 | $retstring .= "</option>"; |
| 7439 | 7439 | } |
@@ -7441,13 +7441,13 @@ discard block |
||
| 7441 | 7441 | |
| 7442 | 7442 | // Year |
| 7443 | 7443 | if ($emptydate || $set_time == -1) { |
| 7444 | - $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 . '">'; |
|
| 7444 | + $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.'">'; |
|
| 7445 | 7445 | } else { |
| 7446 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 7446 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 7447 | 7447 | |
| 7448 | 7448 | $syear = (int) $syear; |
| 7449 | 7449 | for ($year = $syear - 10; $year < (int) $syear + 10; $year++) { |
| 7450 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 7450 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 7451 | 7451 | } |
| 7452 | 7452 | $retstring .= "</select>\n"; |
| 7453 | 7453 | } |
@@ -7472,15 +7472,15 @@ discard block |
||
| 7472 | 7472 | } |
| 7473 | 7473 | |
| 7474 | 7474 | // Show hour |
| 7475 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 7475 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 7476 | 7476 | if ($emptyhours) { |
| 7477 | 7477 | $retstring .= '<option value="-1"> </option>'; |
| 7478 | 7478 | } |
| 7479 | 7479 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 7480 | 7480 | if (strlen($hour) < 2) { |
| 7481 | - $hour = "0" . $hour; |
|
| 7481 | + $hour = "0".$hour; |
|
| 7482 | 7482 | } |
| 7483 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 7483 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 7484 | 7484 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 7485 | 7485 | $retstring .= '</option>'; |
| 7486 | 7486 | } |
@@ -7493,17 +7493,17 @@ discard block |
||
| 7493 | 7493 | |
| 7494 | 7494 | if ($m) { |
| 7495 | 7495 | // Show minutes |
| 7496 | - $retstring .= '<select ' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 7496 | + $retstring .= '<select '.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 7497 | 7497 | if ($emptyhours) { |
| 7498 | 7498 | $retstring .= '<option value="-1"> </option>'; |
| 7499 | 7499 | } |
| 7500 | 7500 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7501 | 7501 | $min_str = sprintf("%02d", $min); |
| 7502 | - $retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>'; |
|
| 7502 | + $retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>'; |
|
| 7503 | 7503 | } |
| 7504 | 7504 | $retstring .= '</select>'; |
| 7505 | 7505 | |
| 7506 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7506 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7507 | 7507 | } |
| 7508 | 7508 | |
| 7509 | 7509 | if ($d && $h) { |
@@ -7526,10 +7526,10 @@ discard block |
||
| 7526 | 7526 | |
| 7527 | 7527 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7528 | 7528 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7529 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7530 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7531 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7532 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7529 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7530 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7531 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7532 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7533 | 7533 | } elseif ($addnowlink == 2) { |
| 7534 | 7534 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7535 | 7535 | * This break application for foreign languages. |
@@ -7538,10 +7538,10 @@ discard block |
||
| 7538 | 7538 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7539 | 7539 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7540 | 7540 | */ |
| 7541 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7542 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7543 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7544 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7541 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7542 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7543 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7544 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7545 | 7545 | } |
| 7546 | 7546 | /*if ($usecalendar == "eldy") |
| 7547 | 7547 | { |
@@ -7561,11 +7561,11 @@ discard block |
||
| 7561 | 7561 | } |
| 7562 | 7562 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7563 | 7563 | if ($addnowlink == 1) { |
| 7564 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7565 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7564 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7565 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7566 | 7566 | } elseif ($addnowlink == 2) { |
| 7567 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7568 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7567 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7568 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7569 | 7569 | } |
| 7570 | 7570 | |
| 7571 | 7571 | if ($fullday) { |
@@ -7579,11 +7579,11 @@ discard block |
||
| 7579 | 7579 | } |
| 7580 | 7580 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7581 | 7581 | if ($addnowlink == 1) { |
| 7582 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7583 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7582 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7583 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7584 | 7584 | } elseif ($addnowlink == 2) { |
| 7585 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7586 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7585 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7586 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7587 | 7587 | } |
| 7588 | 7588 | if ($fullday) { |
| 7589 | 7589 | $reset_scripts .= ' } '; |
@@ -7591,7 +7591,7 @@ discard block |
||
| 7591 | 7591 | } |
| 7592 | 7592 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7593 | 7593 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 7594 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7594 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7595 | 7595 | $retstring .= $langs->trans("Now"); |
| 7596 | 7596 | $retstring .= '</button> '; |
| 7597 | 7597 | } |
@@ -7603,16 +7603,16 @@ discard block |
||
| 7603 | 7603 | $reset_scripts = ""; |
| 7604 | 7604 | |
| 7605 | 7605 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7606 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7607 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7608 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7609 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7606 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7607 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7608 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7609 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7610 | 7610 | // Update the hour part |
| 7611 | 7611 | if ($h) { |
| 7612 | 7612 | if ($fullday) { |
| 7613 | 7613 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7614 | 7614 | } |
| 7615 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7615 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7616 | 7616 | if ($fullday) { |
| 7617 | 7617 | $reset_scripts .= ' } '; |
| 7618 | 7618 | } |
@@ -7622,14 +7622,14 @@ discard block |
||
| 7622 | 7622 | if ($fullday) { |
| 7623 | 7623 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7624 | 7624 | } |
| 7625 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7625 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7626 | 7626 | if ($fullday) { |
| 7627 | 7627 | $reset_scripts .= ' } '; |
| 7628 | 7628 | } |
| 7629 | 7629 | } |
| 7630 | 7630 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7631 | 7631 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7632 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7632 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7633 | 7633 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7634 | 7634 | $retstring .= '</button> '; |
| 7635 | 7635 | } |
@@ -7687,17 +7687,17 @@ discard block |
||
| 7687 | 7687 | unset($TDurationTypes[$value]); |
| 7688 | 7688 | } |
| 7689 | 7689 | |
| 7690 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7690 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7691 | 7691 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7692 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7692 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7693 | 7693 | if ($key == $selected) { |
| 7694 | 7694 | $retstring .= " selected"; |
| 7695 | 7695 | } |
| 7696 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7696 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7697 | 7697 | } |
| 7698 | 7698 | $retstring .= "</select>"; |
| 7699 | 7699 | |
| 7700 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7700 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7701 | 7701 | |
| 7702 | 7702 | return $retstring; |
| 7703 | 7703 | } |
@@ -7729,30 +7729,30 @@ discard block |
||
| 7729 | 7729 | |
| 7730 | 7730 | // Hours |
| 7731 | 7731 | if ($iSecond != '') { |
| 7732 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7732 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7733 | 7733 | |
| 7734 | 7734 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7735 | 7735 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7736 | 7736 | } |
| 7737 | 7737 | |
| 7738 | 7738 | if ($typehour == 'select') { |
| 7739 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7739 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7740 | 7740 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7741 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7741 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7742 | 7742 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7743 | 7743 | $retstring .= " selected"; |
| 7744 | 7744 | } |
| 7745 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7745 | + $retstring .= ">".$hour."</option>"; |
|
| 7746 | 7746 | } |
| 7747 | 7747 | $retstring .= "</select>"; |
| 7748 | 7748 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7749 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7749 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7750 | 7750 | } else { |
| 7751 | 7751 | return 'BadValueForParameterTypeHour'; |
| 7752 | 7752 | } |
| 7753 | 7753 | |
| 7754 | 7754 | if ($typehour != 'text') { |
| 7755 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7755 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7756 | 7756 | } else { |
| 7757 | 7757 | $retstring .= '<span class="">:</span>'; |
| 7758 | 7758 | } |
@@ -7767,21 +7767,21 @@ discard block |
||
| 7767 | 7767 | } |
| 7768 | 7768 | |
| 7769 | 7769 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7770 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7770 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7771 | 7771 | for ($min = 0; $min <= 55; $min += 5) { |
| 7772 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7772 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7773 | 7773 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7774 | 7774 | $retstring .= ' selected'; |
| 7775 | 7775 | } |
| 7776 | - $retstring .= '>' . $min . '</option>'; |
|
| 7776 | + $retstring .= '>'.$min.'</option>'; |
|
| 7777 | 7777 | } |
| 7778 | 7778 | $retstring .= "</select>"; |
| 7779 | 7779 | } elseif ($typehour == 'text') { |
| 7780 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7780 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7781 | 7781 | } |
| 7782 | 7782 | |
| 7783 | 7783 | if ($typehour != 'text') { |
| 7784 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7784 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7785 | 7785 | } |
| 7786 | 7786 | |
| 7787 | 7787 | $retstring .= "</span>"; |
@@ -7829,7 +7829,7 @@ discard block |
||
| 7829 | 7829 | $placeholder = ''; |
| 7830 | 7830 | |
| 7831 | 7831 | if ($selected && empty($selected_input_value)) { |
| 7832 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7832 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7833 | 7833 | $tickettmpselect = new Ticket($this->db); |
| 7834 | 7834 | $tickettmpselect->fetch($selected); |
| 7835 | 7835 | $selected_input_value = $tickettmpselect->ref; |
@@ -7837,17 +7837,17 @@ discard block |
||
| 7837 | 7837 | } |
| 7838 | 7838 | |
| 7839 | 7839 | $urloption = ''; |
| 7840 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7840 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7841 | 7841 | |
| 7842 | 7842 | if (empty($hidelabel)) { |
| 7843 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7843 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7844 | 7844 | } elseif ($hidelabel > 1) { |
| 7845 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7845 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7846 | 7846 | if ($hidelabel == 2) { |
| 7847 | 7847 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7848 | 7848 | } |
| 7849 | 7849 | } |
| 7850 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7850 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7851 | 7851 | if ($hidelabel == 3) { |
| 7852 | 7852 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7853 | 7853 | } |
@@ -7891,8 +7891,8 @@ discard block |
||
| 7891 | 7891 | |
| 7892 | 7892 | $sql = "SELECT "; |
| 7893 | 7893 | $sql .= $selectFields; |
| 7894 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7895 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7894 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7895 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7896 | 7896 | |
| 7897 | 7897 | // Add criteria on ref/label |
| 7898 | 7898 | if ($filterkey != '') { |
@@ -7908,7 +7908,7 @@ discard block |
||
| 7908 | 7908 | if ($i > 0) { |
| 7909 | 7909 | $sql .= " AND "; |
| 7910 | 7910 | } |
| 7911 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7911 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7912 | 7912 | $sql .= ")"; |
| 7913 | 7913 | $i++; |
| 7914 | 7914 | } |
@@ -7921,22 +7921,22 @@ discard block |
||
| 7921 | 7921 | $sql .= $this->db->plimit($limit, 0); |
| 7922 | 7922 | |
| 7923 | 7923 | // Build output string |
| 7924 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7924 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7925 | 7925 | $result = $this->db->query($sql); |
| 7926 | 7926 | if ($result) { |
| 7927 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7928 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7927 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7928 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7929 | 7929 | |
| 7930 | 7930 | $num = $this->db->num_rows($result); |
| 7931 | 7931 | |
| 7932 | 7932 | $events = array(); |
| 7933 | 7933 | |
| 7934 | 7934 | if (!$forcecombo) { |
| 7935 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7935 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7936 | 7936 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT')); |
| 7937 | 7937 | } |
| 7938 | 7938 | |
| 7939 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7939 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7940 | 7940 | |
| 7941 | 7941 | $textifempty = ''; |
| 7942 | 7942 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7953,7 +7953,7 @@ discard block |
||
| 7953 | 7953 | } |
| 7954 | 7954 | } |
| 7955 | 7955 | if ($showempty) { |
| 7956 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7956 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7957 | 7957 | } |
| 7958 | 7958 | |
| 7959 | 7959 | $i = 0; |
@@ -8008,13 +8008,13 @@ discard block |
||
| 8008 | 8008 | $outkey = $objp->rowid; |
| 8009 | 8009 | $outref = $objp->ref; |
| 8010 | 8010 | |
| 8011 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8011 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8012 | 8012 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8013 | 8013 | $opt .= '>'; |
| 8014 | 8014 | $opt .= $objp->ref; |
| 8015 | 8015 | $objRef = $objp->ref; |
| 8016 | 8016 | if (!empty($filterkey) && $filterkey != '') { |
| 8017 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8017 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8018 | 8018 | } |
| 8019 | 8019 | |
| 8020 | 8020 | $opt .= "</option>\n"; |
@@ -8055,7 +8055,7 @@ discard block |
||
| 8055 | 8055 | $placeholder = ''; |
| 8056 | 8056 | |
| 8057 | 8057 | if ($selected && empty($selected_input_value)) { |
| 8058 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 8058 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 8059 | 8059 | $projecttmpselect = new Project($this->db); |
| 8060 | 8060 | $projecttmpselect->fetch($selected); |
| 8061 | 8061 | $selected_input_value = $projecttmpselect->ref; |
@@ -8063,17 +8063,17 @@ discard block |
||
| 8063 | 8063 | } |
| 8064 | 8064 | |
| 8065 | 8065 | $urloption = ''; |
| 8066 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8066 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8067 | 8067 | |
| 8068 | 8068 | if (empty($hidelabel)) { |
| 8069 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 8069 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 8070 | 8070 | } elseif ($hidelabel > 1) { |
| 8071 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 8071 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 8072 | 8072 | if ($hidelabel == 2) { |
| 8073 | 8073 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8074 | 8074 | } |
| 8075 | 8075 | } |
| 8076 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 8076 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 8077 | 8077 | if ($hidelabel == 3) { |
| 8078 | 8078 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8079 | 8079 | } |
@@ -8116,8 +8116,8 @@ discard block |
||
| 8116 | 8116 | |
| 8117 | 8117 | $sql = "SELECT "; |
| 8118 | 8118 | $sql .= $selectFields; |
| 8119 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 8120 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 8119 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 8120 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 8121 | 8121 | |
| 8122 | 8122 | // Add criteria on ref/label |
| 8123 | 8123 | if ($filterkey != '') { |
@@ -8133,7 +8133,7 @@ discard block |
||
| 8133 | 8133 | if ($i > 0) { |
| 8134 | 8134 | $sql .= " AND "; |
| 8135 | 8135 | } |
| 8136 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 8136 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 8137 | 8137 | $sql .= ""; |
| 8138 | 8138 | $i++; |
| 8139 | 8139 | } |
@@ -8146,22 +8146,22 @@ discard block |
||
| 8146 | 8146 | $sql .= $this->db->plimit($limit, 0); |
| 8147 | 8147 | |
| 8148 | 8148 | // Build output string |
| 8149 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 8149 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 8150 | 8150 | $result = $this->db->query($sql); |
| 8151 | 8151 | if ($result) { |
| 8152 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 8153 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 8152 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 8153 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 8154 | 8154 | |
| 8155 | 8155 | $num = $this->db->num_rows($result); |
| 8156 | 8156 | |
| 8157 | 8157 | $events = array(); |
| 8158 | 8158 | |
| 8159 | 8159 | if (!$forcecombo) { |
| 8160 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8160 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8161 | 8161 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT')); |
| 8162 | 8162 | } |
| 8163 | 8163 | |
| 8164 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 8164 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 8165 | 8165 | |
| 8166 | 8166 | $textifempty = ''; |
| 8167 | 8167 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8178,7 +8178,7 @@ discard block |
||
| 8178 | 8178 | } |
| 8179 | 8179 | } |
| 8180 | 8180 | if ($showempty) { |
| 8181 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 8181 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 8182 | 8182 | } |
| 8183 | 8183 | |
| 8184 | 8184 | $i = 0; |
@@ -8236,13 +8236,13 @@ discard block |
||
| 8236 | 8236 | $outlabel = $objp->label; |
| 8237 | 8237 | $outtype = $objp->fk_product_type; |
| 8238 | 8238 | |
| 8239 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8239 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8240 | 8240 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8241 | 8241 | $opt .= '>'; |
| 8242 | 8242 | $opt .= $objp->ref; |
| 8243 | 8243 | $objRef = $objp->ref; |
| 8244 | 8244 | if (!empty($filterkey) && $filterkey != '') { |
| 8245 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8245 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 8246 | 8246 | } |
| 8247 | 8247 | |
| 8248 | 8248 | $opt .= "</option>\n"; |
@@ -8284,7 +8284,7 @@ discard block |
||
| 8284 | 8284 | $placeholder = ''; |
| 8285 | 8285 | |
| 8286 | 8286 | if ($selected && empty($selected_input_value)) { |
| 8287 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8287 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8288 | 8288 | $adherenttmpselect = new Adherent($this->db); |
| 8289 | 8289 | $adherenttmpselect->fetch($selected); |
| 8290 | 8290 | $selected_input_value = $adherenttmpselect->ref; |
@@ -8293,17 +8293,17 @@ discard block |
||
| 8293 | 8293 | |
| 8294 | 8294 | $urloption = ''; |
| 8295 | 8295 | |
| 8296 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8296 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 8297 | 8297 | |
| 8298 | 8298 | if (empty($hidelabel)) { |
| 8299 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 8299 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 8300 | 8300 | } elseif ($hidelabel > 1) { |
| 8301 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 8301 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 8302 | 8302 | if ($hidelabel == 2) { |
| 8303 | 8303 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8304 | 8304 | } |
| 8305 | 8305 | } |
| 8306 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 8306 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 8307 | 8307 | if ($hidelabel == 3) { |
| 8308 | 8308 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 8309 | 8309 | } |
@@ -8348,8 +8348,8 @@ discard block |
||
| 8348 | 8348 | |
| 8349 | 8349 | $sql = "SELECT "; |
| 8350 | 8350 | $sql .= $selectFields; |
| 8351 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 8352 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 8351 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 8352 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 8353 | 8353 | |
| 8354 | 8354 | // Add criteria on ref/label |
| 8355 | 8355 | if ($filterkey != '') { |
@@ -8365,8 +8365,8 @@ discard block |
||
| 8365 | 8365 | if ($i > 0) { |
| 8366 | 8366 | $sql .= " AND "; |
| 8367 | 8367 | } |
| 8368 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 8369 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 8368 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 8369 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 8370 | 8370 | $i++; |
| 8371 | 8371 | } |
| 8372 | 8372 | if (count($search_crit) > 1) { |
@@ -8375,27 +8375,27 @@ discard block |
||
| 8375 | 8375 | $sql .= ')'; |
| 8376 | 8376 | } |
| 8377 | 8377 | if ($status != -1) { |
| 8378 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 8378 | + $sql .= ' AND statut = '.((int) $status); |
|
| 8379 | 8379 | } |
| 8380 | 8380 | $sql .= $this->db->plimit($limit, 0); |
| 8381 | 8381 | |
| 8382 | 8382 | // Build output string |
| 8383 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 8383 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 8384 | 8384 | $result = $this->db->query($sql); |
| 8385 | 8385 | if ($result) { |
| 8386 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 8387 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 8386 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 8387 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 8388 | 8388 | |
| 8389 | 8389 | $num = $this->db->num_rows($result); |
| 8390 | 8390 | |
| 8391 | 8391 | $events = array(); |
| 8392 | 8392 | |
| 8393 | 8393 | if (!$forcecombo) { |
| 8394 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8394 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8395 | 8395 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 8396 | 8396 | } |
| 8397 | 8397 | |
| 8398 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 8398 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 8399 | 8399 | |
| 8400 | 8400 | $textifempty = ''; |
| 8401 | 8401 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8412,7 +8412,7 @@ discard block |
||
| 8412 | 8412 | } |
| 8413 | 8413 | } |
| 8414 | 8414 | if ($showempty) { |
| 8415 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 8415 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 8416 | 8416 | } |
| 8417 | 8417 | |
| 8418 | 8418 | $i = 0; |
@@ -8468,11 +8468,11 @@ discard block |
||
| 8468 | 8468 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 8469 | 8469 | $outtype = $objp->fk_adherent_type; |
| 8470 | 8470 | |
| 8471 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8471 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8472 | 8472 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8473 | 8473 | $opt .= '>'; |
| 8474 | 8474 | if (!empty($filterkey) && $filterkey != '') { |
| 8475 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8475 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8476 | 8476 | } |
| 8477 | 8477 | $opt .= $outlabel; |
| 8478 | 8478 | $opt .= "</option>\n"; |
@@ -8527,8 +8527,8 @@ discard block |
||
| 8527 | 8527 | $objecttmp = null; |
| 8528 | 8528 | $InfoFieldList = array(); |
| 8529 | 8529 | $classname = ''; |
| 8530 | - $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8531 | - $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8530 | + $filter = ''; // Ensure filter has value (for static analysis) |
|
| 8531 | + $sortfield = ''; // Ensure filter has value (for static analysis) |
|
| 8532 | 8532 | |
| 8533 | 8533 | if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield |
| 8534 | 8534 | // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield' |
@@ -8572,9 +8572,9 @@ discard block |
||
| 8572 | 8572 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 8573 | 8573 | $reg = array(); |
| 8574 | 8574 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 8575 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8575 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8576 | 8576 | } |
| 8577 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8577 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8578 | 8578 | |
| 8579 | 8579 | $classname = $InfoFieldList[0]; |
| 8580 | 8580 | $classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1]; |
@@ -8605,8 +8605,8 @@ discard block |
||
| 8605 | 8605 | ); |
| 8606 | 8606 | |
| 8607 | 8607 | if (!is_object($objecttmp)) { |
| 8608 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8609 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8608 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
| 8609 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
| 8610 | 8610 | } |
| 8611 | 8611 | '@phan-var-force CommonObject $objecttmp'; |
| 8612 | 8612 | /** @var CommonObject $objecttmp */ |
@@ -8618,9 +8618,9 @@ discard block |
||
| 8618 | 8618 | if ($prefixforautocompletemode == 'product') { |
| 8619 | 8619 | $prefixforautocompletemode = 'produit'; |
| 8620 | 8620 | } |
| 8621 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8621 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8622 | 8622 | |
| 8623 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8623 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8624 | 8624 | |
| 8625 | 8625 | // Generate the combo HTML component |
| 8626 | 8626 | $out = ''; |
@@ -8649,13 +8649,13 @@ discard block |
||
| 8649 | 8649 | } |
| 8650 | 8650 | |
| 8651 | 8651 | // Set url and param to call to get json of the search results |
| 8652 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8653 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8652 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8653 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8654 | 8654 | |
| 8655 | 8655 | // Activate the auto complete using ajax call. |
| 8656 | 8656 | $out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0); |
| 8657 | 8657 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8658 | - $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) . '"' : '') . ' />'; |
|
| 8658 | + $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).'"' : '').' />'; |
|
| 8659 | 8659 | } else { |
| 8660 | 8660 | // Immediate load of table record. |
| 8661 | 8661 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8695,16 +8695,16 @@ discard block |
||
| 8695 | 8695 | if ($prefixforautocompletemode == 'societe') { |
| 8696 | 8696 | $prefixforautocompletemode = 'company'; |
| 8697 | 8697 | } |
| 8698 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8698 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8699 | 8699 | |
| 8700 | 8700 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8701 | 8701 | $tmpfieldstoshow = ''; |
| 8702 | 8702 | foreach ($objecttmp->fields as $key => $val) { |
| 8703 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8703 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
| 8704 | 8704 | continue; |
| 8705 | 8705 | } |
| 8706 | 8706 | if (!empty($val['showoncombobox'])) { |
| 8707 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8707 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8708 | 8708 | } |
| 8709 | 8709 | } |
| 8710 | 8710 | if ($tmpfieldstoshow) { |
@@ -8741,25 +8741,25 @@ discard block |
||
| 8741 | 8741 | $num = 0; |
| 8742 | 8742 | |
| 8743 | 8743 | // Search data |
| 8744 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . " as t"; |
|
| 8744 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)." as t"; |
|
| 8745 | 8745 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8746 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . "_extrafields as e ON t.rowid = e.fk_object"; |
|
| 8746 | + $sql .= " LEFT JOIN ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)."_extrafields as e ON t.rowid = e.fk_object"; |
|
| 8747 | 8747 | } |
| 8748 | 8748 | if (!empty($objecttmp->parent_element)) { |
| 8749 | 8749 | $parent_properties = getElementProperties($objecttmp->parent_element); |
| 8750 | - $sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($parent_properties['table_element']) . " as o ON o.rowid = t.".$objecttmp->fk_parent_attribute; |
|
| 8750 | + $sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($parent_properties['table_element'])." as o ON o.rowid = t.".$objecttmp->fk_parent_attribute; |
|
| 8751 | 8751 | } |
| 8752 | 8752 | if (in_array($objecttmp->parent_element, ['commande', 'propal', 'facture', 'expedition'])) { |
| 8753 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product as p ON p.rowid = t.fk_product"; |
|
| 8753 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = t.fk_product"; |
|
| 8754 | 8754 | } |
| 8755 | 8755 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8756 | 8756 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8757 | 8757 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8758 | - $sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($tmparray[1]) . " as parenttable ON parenttable.rowid = t." . $this->db->sanitize($tmparray[0]); |
|
| 8758 | + $sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($tmparray[1])." as parenttable ON parenttable.rowid = t.".$this->db->sanitize($tmparray[0]); |
|
| 8759 | 8759 | } |
| 8760 | 8760 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8761 | 8761 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8762 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8762 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8763 | 8763 | } |
| 8764 | 8764 | } |
| 8765 | 8765 | } |
@@ -8779,21 +8779,21 @@ discard block |
||
| 8779 | 8779 | $sql .= " WHERE 1=1"; |
| 8780 | 8780 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8781 | 8781 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8782 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8782 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8783 | 8783 | } |
| 8784 | 8784 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8785 | - $sql .= " AND parenttable.entity = t." . $this->db->sanitize($tmparray[0]); |
|
| 8785 | + $sql .= " AND parenttable.entity = t.".$this->db->sanitize($tmparray[0]); |
|
| 8786 | 8786 | } |
| 8787 | 8787 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8788 | 8788 | if ($objecttmp->element == 'societe') { |
| 8789 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8789 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8790 | 8790 | } else { |
| 8791 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8791 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8792 | 8792 | } |
| 8793 | 8793 | } |
| 8794 | 8794 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8795 | 8795 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8796 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8796 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8797 | 8797 | } |
| 8798 | 8798 | } |
| 8799 | 8799 | } |
@@ -8811,7 +8811,7 @@ discard block |
||
| 8811 | 8811 | $errormessage = ''; |
| 8812 | 8812 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8813 | 8813 | if ($errormessage) { |
| 8814 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8814 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8815 | 8815 | } |
| 8816 | 8816 | } |
| 8817 | 8817 | } |
@@ -8823,7 +8823,7 @@ discard block |
||
| 8823 | 8823 | $resql = $this->db->query($sql); |
| 8824 | 8824 | if ($resql) { |
| 8825 | 8825 | // Construct $out and $outarray |
| 8826 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8826 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8827 | 8827 | |
| 8828 | 8828 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8829 | 8829 | $textifempty = ' '; |
@@ -8837,7 +8837,7 @@ discard block |
||
| 8837 | 8837 | } |
| 8838 | 8838 | } |
| 8839 | 8839 | if ($showempty) { |
| 8840 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8840 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8841 | 8841 | } |
| 8842 | 8842 | |
| 8843 | 8843 | $num = $this->db->num_rows($resql); |
@@ -8860,9 +8860,9 @@ discard block |
||
| 8860 | 8860 | } |
| 8861 | 8861 | if (empty($outputmode)) { |
| 8862 | 8862 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8863 | - $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>'; |
|
| 8863 | + $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>'; |
|
| 8864 | 8864 | } else { |
| 8865 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8865 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8866 | 8866 | } |
| 8867 | 8867 | } else { |
| 8868 | 8868 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8875,10 +8875,10 @@ discard block |
||
| 8875 | 8875 | } |
| 8876 | 8876 | } |
| 8877 | 8877 | |
| 8878 | - $out .= '</select>' . "\n"; |
|
| 8878 | + $out .= '</select>'."\n"; |
|
| 8879 | 8879 | |
| 8880 | 8880 | if (!$forcecombo) { |
| 8881 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8881 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8882 | 8882 | $out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0)); |
| 8883 | 8883 | } |
| 8884 | 8884 | } else { |
@@ -8942,8 +8942,8 @@ discard block |
||
| 8942 | 8942 | } |
| 8943 | 8943 | } |
| 8944 | 8944 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8945 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8946 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8945 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8946 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8947 | 8947 | $out .= '>'."\n"; |
| 8948 | 8948 | |
| 8949 | 8949 | if ($show_empty) { |
@@ -8954,7 +8954,7 @@ discard block |
||
| 8954 | 8954 | if (!is_numeric($show_empty)) { |
| 8955 | 8955 | $textforempty = $show_empty; |
| 8956 | 8956 | } |
| 8957 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8957 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8958 | 8958 | } |
| 8959 | 8959 | if (is_array($array)) { |
| 8960 | 8960 | // Translate |
@@ -8979,7 +8979,7 @@ discard block |
||
| 8979 | 8979 | $value = $tmpvalue['label']; |
| 8980 | 8980 | //$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html']; |
| 8981 | 8981 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8982 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8982 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8983 | 8983 | } else { |
| 8984 | 8984 | $value = $tmpvalue; |
| 8985 | 8985 | //$valuehtml = $tmpvalue; |
@@ -8995,9 +8995,9 @@ discard block |
||
| 8995 | 8995 | } |
| 8996 | 8996 | if ($key_in_label) { |
| 8997 | 8997 | if (empty($nohtmlescape)) { |
| 8998 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8998 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8999 | 8999 | } else { |
| 9000 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 9000 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 9001 | 9001 | } |
| 9002 | 9002 | } else { |
| 9003 | 9003 | if (empty($nohtmlescape)) { |
@@ -9009,8 +9009,8 @@ discard block |
||
| 9009 | 9009 | $selectOptionValue = ' '; |
| 9010 | 9010 | } |
| 9011 | 9011 | } |
| 9012 | - $out .= '<option value="' . $key . '"'; |
|
| 9013 | - $out .= $style . $disabled; |
|
| 9012 | + $out .= '<option value="'.$key.'"'; |
|
| 9013 | + $out .= $style.$disabled; |
|
| 9014 | 9014 | if (is_array($id)) { |
| 9015 | 9015 | if (in_array($key, $id) && !$disabled) { |
| 9016 | 9016 | $out .= ' selected'; // To preselect a value |
@@ -9022,7 +9022,7 @@ discard block |
||
| 9022 | 9022 | } |
| 9023 | 9023 | } |
| 9024 | 9024 | if (!empty($nohtmlescape)) { // deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content. |
| 9025 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 9025 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 9026 | 9026 | } |
| 9027 | 9027 | |
| 9028 | 9028 | if (is_array($tmpvalue)) { |
@@ -9045,7 +9045,7 @@ discard block |
||
| 9045 | 9045 | // Add code for jquery to use multiselect |
| 9046 | 9046 | if ($addjscombo && $jsbeautify) { |
| 9047 | 9047 | // Enhance with select2 |
| 9048 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 9048 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 9049 | 9049 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 9050 | 9050 | } |
| 9051 | 9051 | |
@@ -9073,28 +9073,28 @@ discard block |
||
| 9073 | 9073 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 9074 | 9074 | { |
| 9075 | 9075 | global $conf; |
| 9076 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 9076 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 9077 | 9077 | |
| 9078 | 9078 | // TODO Use an internal dolibarr component instead of select2 |
| 9079 | 9079 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 9080 | 9080 | return ''; |
| 9081 | 9081 | } |
| 9082 | 9082 | |
| 9083 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 9083 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 9084 | 9084 | |
| 9085 | 9085 | $outdelayed = ''; |
| 9086 | 9086 | if (!empty($conf->use_javascript_ajax)) { |
| 9087 | 9087 | $tmpplugin = 'select2'; |
| 9088 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 9089 | - <script nonce="' . getNonce() . '"> |
|
| 9088 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 9089 | + <script nonce="' . getNonce().'"> |
|
| 9090 | 9090 | $(document).ready(function () { |
| 9091 | 9091 | |
| 9092 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 9092 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 9093 | 9093 | |
| 9094 | - $(".' . $htmlname . '").select2({ |
|
| 9094 | + $(".' . $htmlname.'").select2({ |
|
| 9095 | 9095 | ajax: { |
| 9096 | 9096 | dir: "ltr", |
| 9097 | - url: "' . $url . '", |
|
| 9097 | + url: "' . $url.'", |
|
| 9098 | 9098 | dataType: \'json\', |
| 9099 | 9099 | delay: 250, |
| 9100 | 9100 | data: function (params) { |
@@ -9121,9 +9121,9 @@ discard block |
||
| 9121 | 9121 | }, |
| 9122 | 9122 | language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage, |
| 9123 | 9123 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
| 9124 | - placeholder: \'' . dol_escape_js($placeholder) . '\', |
|
| 9124 | + placeholder: \'' . dol_escape_js($placeholder).'\', |
|
| 9125 | 9125 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 9126 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 9126 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 9127 | 9127 | formatResult: function (result, container, query, escapeMarkup) { |
| 9128 | 9128 | return escapeMarkup(result.text); |
| 9129 | 9129 | }, |
@@ -9131,10 +9131,10 @@ discard block |
||
| 9131 | 9131 | |
| 9132 | 9132 | ' . ($callurlonselect ? ' |
| 9133 | 9133 | /* Code to execute a GET when we select a value */ |
| 9134 | - $(".' . $htmlname . '").change(function() { |
|
| 9135 | - var selected = $(\'.' . dol_escape_js($htmlname) . '\').val(); |
|
| 9134 | + $(".' . $htmlname.'").change(function() { |
|
| 9135 | + var selected = $(\'.' . dol_escape_js($htmlname).'\').val(); |
|
| 9136 | 9136 | console.log("We select in selectArrayAjax the entry "+selected) |
| 9137 | - $(\'.' . dol_escape_js($htmlname) . '\').val(""); /* reset visible combo value */ |
|
| 9137 | + $(\'.' . dol_escape_js($htmlname).'\').val(""); /* reset visible combo value */ |
|
| 9138 | 9138 | $.each( saveRemoteData, function( key, value ) { |
| 9139 | 9139 | if (key == selected) |
| 9140 | 9140 | { |
@@ -9142,7 +9142,7 @@ discard block |
||
| 9142 | 9142 | location.assign(value.url); |
| 9143 | 9143 | } |
| 9144 | 9144 | }); |
| 9145 | - });' : '') . ' |
|
| 9145 | + });' : '').' |
|
| 9146 | 9146 | |
| 9147 | 9147 | }); |
| 9148 | 9148 | </script>'; |
@@ -9178,14 +9178,14 @@ discard block |
||
| 9178 | 9178 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 9179 | 9179 | { |
| 9180 | 9180 | global $conf; |
| 9181 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 9181 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 9182 | 9182 | |
| 9183 | 9183 | // TODO Use an internal dolibarr component instead of select2 |
| 9184 | 9184 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 9185 | 9185 | return ''; |
| 9186 | 9186 | } |
| 9187 | 9187 | |
| 9188 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 9188 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 9189 | 9189 | |
| 9190 | 9190 | $formattedarrayresult = array(); |
| 9191 | 9191 | |
@@ -9200,20 +9200,20 @@ discard block |
||
| 9200 | 9200 | $outdelayed = ''; |
| 9201 | 9201 | if (!empty($conf->use_javascript_ajax)) { |
| 9202 | 9202 | $tmpplugin = 'select2'; |
| 9203 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 9204 | - <script nonce="' . getNonce() . '"> |
|
| 9203 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 9204 | + <script nonce="' . getNonce().'"> |
|
| 9205 | 9205 | $(document).ready(function () { |
| 9206 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 9206 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 9207 | 9207 | |
| 9208 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 9208 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 9209 | 9209 | |
| 9210 | - $(\'.' . dol_escape_js($htmlname) . '\').select2({ |
|
| 9210 | + $(\'.' . dol_escape_js($htmlname).'\').select2({ |
|
| 9211 | 9211 | data: data, |
| 9212 | 9212 | language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage, |
| 9213 | 9213 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
| 9214 | - placeholder: \'' . dol_escape_js($placeholder) . '\', |
|
| 9214 | + placeholder: \'' . dol_escape_js($placeholder).'\', |
|
| 9215 | 9215 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 9216 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 9216 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 9217 | 9217 | formatResult: function (result, container, query, escapeMarkup) { |
| 9218 | 9218 | return escapeMarkup(result.text); |
| 9219 | 9219 | }, |
@@ -9252,11 +9252,11 @@ discard block |
||
| 9252 | 9252 | |
| 9253 | 9253 | ' . ($callurlonselect ? ' |
| 9254 | 9254 | /* Code to execute a GET when we select a value */ |
| 9255 | - $(\'.' . dol_escape_js($htmlname) . '\').change(function() { |
|
| 9256 | - var selected = $(\'.' . dol_escape_js($htmlname) . '\').val(); |
|
| 9255 | + $(\'.' . dol_escape_js($htmlname).'\').change(function() { |
|
| 9256 | + var selected = $(\'.' . dol_escape_js($htmlname).'\').val(); |
|
| 9257 | 9257 | console.log("We select "+selected) |
| 9258 | 9258 | |
| 9259 | - $(\'.' . dol_escape_js($htmlname) . '\').val(""); /* reset visible combo value */ |
|
| 9259 | + $(\'.' . dol_escape_js($htmlname).'\').val(""); /* reset visible combo value */ |
|
| 9260 | 9260 | $.each( saveRemoteData, function( key, value ) { |
| 9261 | 9261 | if (key == selected) |
| 9262 | 9262 | { |
@@ -9264,7 +9264,7 @@ discard block |
||
| 9264 | 9264 | location.assign(value.url); |
| 9265 | 9265 | } |
| 9266 | 9266 | }); |
| 9267 | - });' : '') . ' |
|
| 9267 | + });' : '').' |
|
| 9268 | 9268 | |
| 9269 | 9269 | }); |
| 9270 | 9270 | </script>'; |
@@ -9312,7 +9312,7 @@ discard block |
||
| 9312 | 9312 | $useenhancedmultiselect = 0; |
| 9313 | 9313 | if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 9314 | 9314 | if ($addjscombo) { |
| 9315 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9315 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 9316 | 9316 | } |
| 9317 | 9317 | } |
| 9318 | 9318 | |
@@ -9321,7 +9321,7 @@ discard block |
||
| 9321 | 9321 | // submitted to nothing. |
| 9322 | 9322 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
| 9323 | 9323 | // Output select component |
| 9324 | - $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"; |
|
| 9324 | + $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"; |
|
| 9325 | 9325 | if (is_array($array) && !empty($array)) { |
| 9326 | 9326 | if ($value_as_key) { |
| 9327 | 9327 | $array = array_combine($array, $array); |
@@ -9342,33 +9342,33 @@ discard block |
||
| 9342 | 9342 | $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml']; |
| 9343 | 9343 | } |
| 9344 | 9344 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 9345 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 9345 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 9346 | 9346 | |
| 9347 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 9347 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 9348 | 9348 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 9349 | 9349 | $out .= ' selected'; |
| 9350 | 9350 | } |
| 9351 | 9351 | if (!empty($tmplabelhtml)) { |
| 9352 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9352 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9353 | 9353 | } else { |
| 9354 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 9355 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 9354 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 9355 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 9356 | 9356 | } |
| 9357 | 9357 | $out .= '>'; |
| 9358 | 9358 | $out .= dol_htmlentitiesbr($newval); |
| 9359 | - $out .= '</option>' . "\n"; |
|
| 9359 | + $out .= '</option>'."\n"; |
|
| 9360 | 9360 | } |
| 9361 | 9361 | } |
| 9362 | 9362 | } |
| 9363 | - $out .= '</select>' . "\n"; |
|
| 9363 | + $out .= '</select>'."\n"; |
|
| 9364 | 9364 | |
| 9365 | 9365 | // Add code for jquery to use multiselect |
| 9366 | 9366 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 9367 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 9368 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 9367 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 9368 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 9369 | 9369 | if ($addjscombo == 1) { |
| 9370 | 9370 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 9371 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 9371 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 9372 | 9372 | // If property data-html set, we decode html entities and use this. |
| 9373 | 9373 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 9374 | 9374 | $out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
@@ -9376,26 +9376,26 @@ discard block |
||
| 9376 | 9376 | $out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
| 9377 | 9377 | $out .= ' }'."\n"; |
| 9378 | 9378 | $out .= ' return record.text;'; |
| 9379 | - $out .= '}' . "\n"; |
|
| 9380 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 9379 | + $out .= '}'."\n"; |
|
| 9380 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 9381 | 9381 | if ($elemtype == 'category') { |
| 9382 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9382 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 9383 | 9383 | } else { |
| 9384 | 9384 | $out .= 'return record.text;'; |
| 9385 | 9385 | } |
| 9386 | - $out .= '}' . "\n"; |
|
| 9386 | + $out .= '}'."\n"; |
|
| 9387 | 9387 | $out .= '$(document).ready(function () { |
| 9388 | - $(\'#' . dol_escape_js($htmlname) . '\').' . $tmpplugin . '({'; |
|
| 9388 | + $(\'#' . dol_escape_js($htmlname).'\').'.$tmpplugin.'({'; |
|
| 9389 | 9389 | if ($placeholder) { |
| 9390 | 9390 | $out .= ' |
| 9391 | 9391 | placeholder: { |
| 9392 | 9392 | id: \'-1\', |
| 9393 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 9393 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 9394 | 9394 | },'; |
| 9395 | 9395 | } |
| 9396 | 9396 | $out .= ' dir: \'ltr\', |
| 9397 | 9397 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 9398 | - dropdownCssClass: \'' . dol_escape_js($morecss) . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9398 | + dropdownCssClass: \'' . dol_escape_js($morecss).'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
| 9399 | 9399 | // Specify format function for dropdown item |
| 9400 | 9400 | formatResult: formatResult, |
| 9401 | 9401 | templateResult: formatResult, /* For 4.0 */ |
@@ -9408,21 +9408,21 @@ discard block |
||
| 9408 | 9408 | |
| 9409 | 9409 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 9410 | 9410 | the size only if component is not hidden by default on load */ |
| 9411 | - $(\'#' . dol_escape_js($htmlname) . ' + .select2\').addClass(\'' . dol_escape_js($morecss) . '\'); |
|
| 9411 | + $(\'#' . dol_escape_js($htmlname).' + .select2\').addClass(\''.dol_escape_js($morecss).'\'); |
|
| 9412 | 9412 | });' . "\n"; |
| 9413 | 9413 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 9414 | 9414 | // Add other js lib |
| 9415 | 9415 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 9416 | 9416 | // ... |
| 9417 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . dol_escape_js($htmlname) . '\');'; |
|
| 9417 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.dol_escape_js($htmlname).'\');'; |
|
| 9418 | 9418 | $out .= '$(document).ready(function () { |
| 9419 | - $(\'#' . dol_escape_js($htmlname) . '\').multiSelect({ |
|
| 9419 | + $(\'#' . dol_escape_js($htmlname).'\').multiSelect({ |
|
| 9420 | 9420 | containerHTML: \'<div class="multi-select-container">\', |
| 9421 | 9421 | menuHTML: \'<div class="multi-select-menu">\', |
| 9422 | - buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss) . '">\', |
|
| 9422 | + buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss).'">\', |
|
| 9423 | 9423 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 9424 | 9424 | activeClass: \'multi-select-container--open\', |
| 9425 | - noneText: \'' . dol_escape_js($placeholder) . '\' |
|
| 9425 | + noneText: \'' . dol_escape_js($placeholder).'\' |
|
| 9426 | 9426 | }); |
| 9427 | 9427 | })'; |
| 9428 | 9428 | } |
@@ -9455,7 +9455,7 @@ discard block |
||
| 9455 | 9455 | return ''; |
| 9456 | 9456 | } |
| 9457 | 9457 | |
| 9458 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 9458 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 9459 | 9459 | |
| 9460 | 9460 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 9461 | 9461 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -9498,19 +9498,19 @@ discard block |
||
| 9498 | 9498 | } |
| 9499 | 9499 | |
| 9500 | 9500 | // Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
| 9501 | - $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>'; |
|
| 9502 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 9501 | + $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>'; |
|
| 9502 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 9503 | 9503 | } |
| 9504 | 9504 | } |
| 9505 | 9505 | |
| 9506 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 9506 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 9507 | 9507 | |
| 9508 | 9508 | <dl class="dropdown"> |
| 9509 | 9509 | <dt> |
| 9510 | - <a href="#' . $htmlname . '"> |
|
| 9511 | - ' . img_picto('', 'list') . ' |
|
| 9510 | + <a href="#' . $htmlname.'"> |
|
| 9511 | + ' . img_picto('', 'list').' |
|
| 9512 | 9512 | </a> |
| 9513 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 9513 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 9514 | 9514 | </dt> |
| 9515 | 9515 | <dd class="dropdowndd"> |
| 9516 | 9516 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9522,19 +9522,19 @@ discard block |
||
| 9522 | 9522 | </dd> |
| 9523 | 9523 | </dl> |
| 9524 | 9524 | |
| 9525 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 9525 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 9526 | 9526 | jQuery(document).ready(function () { |
| 9527 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9527 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9528 | 9528 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 9529 | 9529 | |
| 9530 | 9530 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 9531 | 9531 | |
| 9532 | 9532 | var title = $(this).val() + ","; |
| 9533 | 9533 | if ($(this).is(\':checked\')) { |
| 9534 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 9534 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 9535 | 9535 | } |
| 9536 | 9536 | else { |
| 9537 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 9537 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 9538 | 9538 | } |
| 9539 | 9539 | // Now, we submit page |
| 9540 | 9540 | //$(this).parents(\'form:first\').submit(); |
@@ -9565,7 +9565,7 @@ discard block |
||
| 9565 | 9565 | */ |
| 9566 | 9566 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 9567 | 9567 | { |
| 9568 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 9568 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 9569 | 9569 | |
| 9570 | 9570 | $cat = new Categorie($this->db); |
| 9571 | 9571 | $categories = $cat->containing($id, $type); |
@@ -9575,13 +9575,13 @@ discard block |
||
| 9575 | 9575 | foreach ($categories as $c) { |
| 9576 | 9576 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 9577 | 9577 | foreach ($ways as $way) { |
| 9578 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 9578 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 9579 | 9579 | } |
| 9580 | 9580 | } |
| 9581 | 9581 | if (empty($toprint)) { |
| 9582 | 9582 | return ''; |
| 9583 | 9583 | } else { |
| 9584 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 9584 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 9585 | 9585 | } |
| 9586 | 9586 | } |
| 9587 | 9587 | |
@@ -9630,15 +9630,15 @@ discard block |
||
| 9630 | 9630 | |
| 9631 | 9631 | |
| 9632 | 9632 | print '<div class="div-table-responsive-no-min">'; |
| 9633 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 9633 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 9634 | 9634 | |
| 9635 | 9635 | print '<tr class="liste_titre">'; |
| 9636 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 9637 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9636 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 9637 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9638 | 9638 | print '<td class="center"></td>'; |
| 9639 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 9640 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9641 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 9639 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 9640 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9641 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 9642 | 9642 | print '<td></td>'; |
| 9643 | 9643 | print '</tr>'; |
| 9644 | 9644 | |
@@ -9657,13 +9657,13 @@ discard block |
||
| 9657 | 9657 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 9658 | 9658 | $element = $regs[1]; |
| 9659 | 9659 | $subelement = $regs[2]; |
| 9660 | - $tplpath = $element . '/' . $subelement; |
|
| 9660 | + $tplpath = $element.'/'.$subelement; |
|
| 9661 | 9661 | } |
| 9662 | 9662 | $tplname = 'linkedobjectblock'; |
| 9663 | 9663 | |
| 9664 | 9664 | // To work with non standard path |
| 9665 | 9665 | if ($objecttype == 'facture') { |
| 9666 | - $tplpath = 'compta/' . $element; |
|
| 9666 | + $tplpath = 'compta/'.$element; |
|
| 9667 | 9667 | if (!isModEnabled('invoice')) { |
| 9668 | 9668 | continue; // Do not show if module disabled |
| 9669 | 9669 | } |
@@ -9674,7 +9674,7 @@ discard block |
||
| 9674 | 9674 | continue; // Do not show if module disabled |
| 9675 | 9675 | } |
| 9676 | 9676 | } elseif ($objecttype == 'propal') { |
| 9677 | - $tplpath = 'comm/' . $element; |
|
| 9677 | + $tplpath = 'comm/'.$element; |
|
| 9678 | 9678 | if (!isModEnabled('propal')) { |
| 9679 | 9679 | continue; // Do not show if module disabled |
| 9680 | 9680 | } |
@@ -9727,7 +9727,7 @@ discard block |
||
| 9727 | 9727 | $linkedObjectBlock = $objects; |
| 9728 | 9728 | |
| 9729 | 9729 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9730 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9730 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9731 | 9731 | foreach ($dirtpls as $reldir) { |
| 9732 | 9732 | $reldir = rtrim($reldir, '/'); |
| 9733 | 9733 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9735,7 +9735,7 @@ discard block |
||
| 9735 | 9735 | $noMoreLinkedObjectBlockAfter = 1; |
| 9736 | 9736 | } |
| 9737 | 9737 | |
| 9738 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9738 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9739 | 9739 | if ($res) { |
| 9740 | 9740 | $nboftypesoutput++; |
| 9741 | 9741 | break; |
@@ -9744,7 +9744,7 @@ discard block |
||
| 9744 | 9744 | } |
| 9745 | 9745 | |
| 9746 | 9746 | if (!$nboftypesoutput) { |
| 9747 | - print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9747 | + print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9748 | 9748 | } |
| 9749 | 9749 | |
| 9750 | 9750 | print '</table>'; |
@@ -9792,14 +9792,14 @@ discard block |
||
| 9792 | 9792 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9793 | 9793 | $listofidcompanytoscan = (int) $object->thirdparty->id; |
| 9794 | 9794 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
| 9795 | - $listofidcompanytoscan .= ',' . (int) $object->thirdparty->parent; |
|
| 9795 | + $listofidcompanytoscan .= ','.(int) $object->thirdparty->parent; |
|
| 9796 | 9796 | } |
| 9797 | 9797 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
| 9798 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9798 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9799 | 9799 | $tmpproject = new Project($this->db); |
| 9800 | 9800 | $tmpproject->fetch($object->fk_project); |
| 9801 | 9801 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9802 | - $listofidcompanytoscan .= ',' . (int) $tmpproject->socid; |
|
| 9802 | + $listofidcompanytoscan .= ','.(int) $tmpproject->socid; |
|
| 9803 | 9803 | } |
| 9804 | 9804 | unset($tmpproject); |
| 9805 | 9805 | } |
@@ -9809,75 +9809,75 @@ discard block |
||
| 9809 | 9809 | 'enabled' => isModEnabled('propal'), |
| 9810 | 9810 | 'perms' => 1, |
| 9811 | 9811 | 'label' => 'LinkToProposal', |
| 9812 | - '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' : ''), |
|
| 9812 | + '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' : ''), |
|
| 9813 | 9813 | ), |
| 9814 | 9814 | 'shipping' => array( |
| 9815 | 9815 | 'enabled' => isModEnabled('shipping'), |
| 9816 | 9816 | 'perms' => 1, |
| 9817 | 9817 | 'label' => 'LinkToExpedition', |
| 9818 | - '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' : ''), |
|
| 9818 | + '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' : ''), |
|
| 9819 | 9819 | ), |
| 9820 | 9820 | 'order' => array( |
| 9821 | 9821 | 'enabled' => isModEnabled('order'), |
| 9822 | 9822 | 'perms' => 1, |
| 9823 | 9823 | 'label' => 'LinkToOrder', |
| 9824 | - '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' : ''), |
|
| 9824 | + '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' : ''), |
|
| 9825 | 9825 | 'linkname' => 'commande', |
| 9826 | 9826 | ), |
| 9827 | 9827 | 'invoice' => array( |
| 9828 | 9828 | 'enabled' => isModEnabled('invoice'), |
| 9829 | 9829 | 'perms' => 1, |
| 9830 | 9830 | 'label' => 'LinkToInvoice', |
| 9831 | - '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' : ''), |
|
| 9831 | + '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' : ''), |
|
| 9832 | 9832 | 'linkname' => 'facture', |
| 9833 | 9833 | ), |
| 9834 | 9834 | 'invoice_template' => array( |
| 9835 | 9835 | 'enabled' => isModEnabled('invoice'), |
| 9836 | 9836 | 'perms' => 1, |
| 9837 | 9837 | 'label' => 'LinkToTemplateInvoice', |
| 9838 | - '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' : ''), |
|
| 9838 | + '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' : ''), |
|
| 9839 | 9839 | ), |
| 9840 | 9840 | 'contrat' => array( |
| 9841 | 9841 | 'enabled' => isModEnabled('contract'), |
| 9842 | 9842 | 'perms' => 1, |
| 9843 | 9843 | 'label' => 'LinkToContract', |
| 9844 | 9844 | '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 |
| 9845 | - 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', |
|
| 9845 | + 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', |
|
| 9846 | 9846 | ), |
| 9847 | 9847 | 'fichinter' => array( |
| 9848 | 9848 | 'enabled' => isModEnabled('intervention'), |
| 9849 | 9849 | 'perms' => 1, |
| 9850 | 9850 | 'label' => 'LinkToIntervention', |
| 9851 | - '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') . ')', |
|
| 9851 | + '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').')', |
|
| 9852 | 9852 | ), |
| 9853 | 9853 | 'supplier_proposal' => array( |
| 9854 | 9854 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9855 | 9855 | 'perms' => 1, |
| 9856 | 9856 | 'label' => 'LinkToSupplierProposal', |
| 9857 | - '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' : ''), |
|
| 9857 | + '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' : ''), |
|
| 9858 | 9858 | ), |
| 9859 | 9859 | 'order_supplier' => array( |
| 9860 | 9860 | 'enabled' => isModEnabled("supplier_order"), |
| 9861 | 9861 | 'perms' => 1, |
| 9862 | 9862 | 'label' => 'LinkToSupplierOrder', |
| 9863 | - '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' : ''), |
|
| 9863 | + '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' : ''), |
|
| 9864 | 9864 | ), |
| 9865 | 9865 | 'invoice_supplier' => array( |
| 9866 | 9866 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9867 | 9867 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9868 | - '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' : ''), |
|
| 9868 | + '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' : ''), |
|
| 9869 | 9869 | ), |
| 9870 | 9870 | 'ticket' => array( |
| 9871 | 9871 | 'enabled' => isModEnabled('ticket'), |
| 9872 | 9872 | 'perms' => 1, |
| 9873 | 9873 | 'label' => 'LinkToTicket', |
| 9874 | - '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' : ''), |
|
| 9874 | + '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' : ''), |
|
| 9875 | 9875 | ), |
| 9876 | 9876 | 'mo' => array( |
| 9877 | 9877 | 'enabled' => isModEnabled('mrp'), |
| 9878 | 9878 | 'perms' => 1, |
| 9879 | 9879 | 'label' => 'LinkToMo', |
| 9880 | - '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' : ''), |
|
| 9880 | + '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' : ''), |
|
| 9881 | 9881 | ), |
| 9882 | 9882 | ); |
| 9883 | 9883 | } |
@@ -9919,23 +9919,23 @@ discard block |
||
| 9919 | 9919 | } |
| 9920 | 9920 | |
| 9921 | 9921 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9922 | - $htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9922 | + $htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9923 | 9923 | |
| 9924 | 9924 | // Section for free ref input |
| 9925 | 9925 | if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
| 9926 | 9926 | $htmltoenteralink .= '<br>'."\n"; |
| 9927 | 9927 | $htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n"; |
| 9928 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9929 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9928 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9929 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9930 | 9930 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9931 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9932 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9931 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9932 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9933 | 9933 | $htmltoenteralink .= '<table class="noborder">'; |
| 9934 | 9934 | $htmltoenteralink .= '<tr class="liste_titre">'; |
| 9935 | 9935 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9936 | - $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9937 | - $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9938 | - $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9936 | + $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9937 | + $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9938 | + $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9939 | 9939 | $htmltoenteralink .= '</tr>'; |
| 9940 | 9940 | $htmltoenteralink .= '</table>'; |
| 9941 | 9941 | $htmltoenteralink .= '</form>'; |
@@ -9954,18 +9954,18 @@ discard block |
||
| 9954 | 9954 | $htmltoenteralink .= '<br>'; |
| 9955 | 9955 | } |
| 9956 | 9956 | $htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9957 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9958 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9957 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9958 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9959 | 9959 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlink">'; |
| 9960 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9961 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9960 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9961 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9962 | 9962 | $htmltoenteralink .= '<table class="noborder">'; |
| 9963 | 9963 | $htmltoenteralink .= '<tr class="liste_titre">'; |
| 9964 | 9964 | $htmltoenteralink .= '<td class="nowrap"></td>'; |
| 9965 | - $htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9966 | - $htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9967 | - $htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9968 | - $htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>'; |
|
| 9965 | + $htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9966 | + $htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>'; |
|
| 9967 | + $htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9968 | + $htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>'; |
|
| 9969 | 9969 | $htmltoenteralink .= '</tr>'; |
| 9970 | 9970 | while ($i < $num) { |
| 9971 | 9971 | $objp = $this->db->fetch_object($resqllist); |
@@ -9980,30 +9980,30 @@ discard block |
||
| 9980 | 9980 | if ($alreadylinked) { |
| 9981 | 9981 | $htmltoenteralink .= img_picto('', 'link'); |
| 9982 | 9982 | } else { |
| 9983 | - $htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9983 | + $htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9984 | 9984 | } |
| 9985 | 9985 | $htmltoenteralink .= '</td>'; |
| 9986 | - $htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9987 | - $htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9986 | + $htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9987 | + $htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9988 | 9988 | $htmltoenteralink .= '<td class="right">'; |
| 9989 | 9989 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9990 | - $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9990 | + $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9991 | 9991 | } |
| 9992 | - $htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9992 | + $htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9993 | 9993 | $htmltoenteralink .= '</td>'; |
| 9994 | - $htmltoenteralink .= '<td>' . $objp->name . '</td>'; |
|
| 9994 | + $htmltoenteralink .= '<td>'.$objp->name.'</td>'; |
|
| 9995 | 9995 | $htmltoenteralink .= '</tr>'; |
| 9996 | 9996 | $i++; |
| 9997 | 9997 | } |
| 9998 | 9998 | $htmltoenteralink .= '</table>'; |
| 9999 | 9999 | $htmltoenteralink .= '<div class="center">'; |
| 10000 | 10000 | if ($num) { |
| 10001 | - $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="' . $langs->trans('ToLink') . '">'; |
|
| 10001 | + $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="'.$langs->trans('ToLink').'">'; |
|
| 10002 | 10002 | } |
| 10003 | 10003 | if (empty($conf->use_javascript_ajax)) { |
| 10004 | - $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 10004 | + $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 10005 | 10005 | } else { |
| 10006 | - $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 10006 | + $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 10007 | 10007 | } |
| 10008 | 10008 | $htmltoenteralink .= '</form>'; |
| 10009 | 10009 | } |
@@ -10017,10 +10017,10 @@ discard block |
||
| 10017 | 10017 | |
| 10018 | 10018 | // Complete the list for the combo box |
| 10019 | 10019 | if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
| 10020 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 10020 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 10021 | 10021 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 10022 | 10022 | } else { |
| 10023 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 10023 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 10024 | 10024 | } |
| 10025 | 10025 | } |
| 10026 | 10026 | } |
@@ -10030,11 +10030,11 @@ discard block |
||
| 10030 | 10030 | <dl class="dropdown" id="linktoobjectname"> |
| 10031 | 10031 | '; |
| 10032 | 10032 | if (!empty($conf->use_javascript_ajax)) { |
| 10033 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 10033 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 10034 | 10034 | } |
| 10035 | 10035 | $linktoelem .= '<dd> |
| 10036 | 10036 | <div class="multiselectlinkto"> |
| 10037 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 10037 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 10038 | 10038 | </ul> |
| 10039 | 10039 | </div> |
| 10040 | 10040 | </dd> |
@@ -10045,7 +10045,7 @@ discard block |
||
| 10045 | 10045 | |
| 10046 | 10046 | if (!empty($conf->use_javascript_ajax)) { |
| 10047 | 10047 | print '<!-- Add js to show linkto box --> |
| 10048 | - <script nonce="' . getNonce() . '"> |
|
| 10048 | + <script nonce="' . getNonce().'"> |
|
| 10049 | 10049 | jQuery(document).ready(function() { |
| 10050 | 10050 | jQuery(".linkto").click(function() { |
| 10051 | 10051 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -10092,19 +10092,19 @@ discard block |
||
| 10092 | 10092 | |
| 10093 | 10093 | $disabled = ($disabled ? ' disabled' : ''); |
| 10094 | 10094 | |
| 10095 | - $resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 10095 | + $resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 10096 | 10096 | if ($useempty) { |
| 10097 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10097 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 10098 | 10098 | } |
| 10099 | 10099 | if (("$value" == 'yes') || ($value == 1)) { |
| 10100 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 10101 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 10100 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 10101 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 10102 | 10102 | } else { |
| 10103 | 10103 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 10104 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 10105 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 10104 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 10105 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 10106 | 10106 | } |
| 10107 | - $resultyesno .= '</select>' . "\n"; |
|
| 10107 | + $resultyesno .= '</select>'."\n"; |
|
| 10108 | 10108 | |
| 10109 | 10109 | if ($addjscombo) { |
| 10110 | 10110 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -10128,12 +10128,12 @@ discard block |
||
| 10128 | 10128 | { |
| 10129 | 10129 | // phpcs:enable |
| 10130 | 10130 | $sql = "SELECT rowid, label"; |
| 10131 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 10132 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 10131 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 10132 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 10133 | 10133 | $sql .= " ORDER BY rowid"; |
| 10134 | 10134 | $result = $this->db->query($sql); |
| 10135 | 10135 | if ($result) { |
| 10136 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10136 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10137 | 10137 | if ($useempty) { |
| 10138 | 10138 | print '<option value="-1"> </option>'; |
| 10139 | 10139 | } |
@@ -10143,9 +10143,9 @@ discard block |
||
| 10143 | 10143 | while ($i < $num) { |
| 10144 | 10144 | $obj = $this->db->fetch_object($result); |
| 10145 | 10145 | if ($selected == $obj->rowid) { |
| 10146 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 10146 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 10147 | 10147 | } else { |
| 10148 | - print '<option value="' . $obj->rowid . '">'; |
|
| 10148 | + print '<option value="'.$obj->rowid.'">'; |
|
| 10149 | 10149 | } |
| 10150 | 10150 | print $obj->label; |
| 10151 | 10151 | print '</option>'; |
@@ -10236,8 +10236,8 @@ discard block |
||
| 10236 | 10236 | $stringforfirstkey .= ' CTL +'; |
| 10237 | 10237 | } |
| 10238 | 10238 | |
| 10239 | - $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>'; |
|
| 10240 | - $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>'; |
|
| 10239 | + $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>'; |
|
| 10240 | + $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>'; |
|
| 10241 | 10241 | } |
| 10242 | 10242 | |
| 10243 | 10243 | //print "xx".$previous_ref."x".$next_ref; |
@@ -10245,18 +10245,18 @@ discard block |
||
| 10245 | 10245 | |
| 10246 | 10246 | // Right part of banner |
| 10247 | 10247 | if ($morehtmlright) { |
| 10248 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 10248 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 10249 | 10249 | } |
| 10250 | 10250 | |
| 10251 | 10251 | if ($previous_ref || $next_ref || $morehtml) { |
| 10252 | 10252 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 10253 | 10253 | } |
| 10254 | 10254 | if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { |
| 10255 | - $ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 10255 | + $ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 10256 | 10256 | } |
| 10257 | 10257 | if ($shownav && ($previous_ref || $next_ref)) { |
| 10258 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 10259 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 10258 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 10259 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 10260 | 10260 | } |
| 10261 | 10261 | if ($previous_ref || $next_ref || $morehtml) { |
| 10262 | 10262 | $ret .= '</ul></div>'; |
@@ -10271,7 +10271,7 @@ discard block |
||
| 10271 | 10271 | $morehtmlstatus = $hookmanager->resPrint; |
| 10272 | 10272 | } |
| 10273 | 10273 | if ($morehtmlstatus) { |
| 10274 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 10274 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 10275 | 10275 | } |
| 10276 | 10276 | |
| 10277 | 10277 | $parameters = array(); |
@@ -10285,14 +10285,14 @@ discard block |
||
| 10285 | 10285 | // Left part of banner |
| 10286 | 10286 | if ($morehtmlleft) { |
| 10287 | 10287 | if ($conf->browser->layout == 'phone') { |
| 10288 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 10288 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 10289 | 10289 | } else { |
| 10290 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 10290 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 10291 | 10291 | } |
| 10292 | 10292 | } |
| 10293 | 10293 | |
| 10294 | 10294 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 10295 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 10295 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 10296 | 10296 | |
| 10297 | 10297 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 10298 | 10298 | if ($object->element == 'societe') { |
@@ -10306,7 +10306,7 @@ discard block |
||
| 10306 | 10306 | |
| 10307 | 10307 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 10308 | 10308 | if (!is_object($extralanguages)) { |
| 10309 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 10309 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 10310 | 10310 | $extralanguages = new ExtraLanguages($this->db); |
| 10311 | 10311 | } |
| 10312 | 10312 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -10321,21 +10321,21 @@ discard block |
||
| 10321 | 10321 | if ($object->array_languages['name'][$extralangcode]) { |
| 10322 | 10322 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 10323 | 10323 | } else { |
| 10324 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 10324 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 10325 | 10325 | } |
| 10326 | 10326 | } |
| 10327 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 10327 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 10328 | 10328 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 10329 | 10329 | } |
| 10330 | 10330 | } |
| 10331 | 10331 | } elseif ($object->element == 'member') { |
| 10332 | 10332 | '@phan-var-force Adherent $object'; |
| 10333 | - $ret .= $object->ref . '<br>'; |
|
| 10333 | + $ret .= $object->ref.'<br>'; |
|
| 10334 | 10334 | $fullname = $object->getFullName($langs); |
| 10335 | 10335 | if ($object->morphy == 'mor' && $object->societe) { |
| 10336 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 10336 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 10337 | 10337 | } else { |
| 10338 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 10338 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 10339 | 10339 | } |
| 10340 | 10340 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 10341 | 10341 | $ret .= '<span class="valignmiddle">'.dol_htmlentities($object->getFullName($langs)).'</span>'.$addgendertxt; |
@@ -10343,7 +10343,7 @@ discard block |
||
| 10343 | 10343 | $ret .= dol_htmlentities($object->name); |
| 10344 | 10344 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 10345 | 10345 | '@phan-var-force ActionComm $object'; |
| 10346 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 10346 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 10347 | 10347 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 10348 | 10348 | $ret .= $object->label; |
| 10349 | 10349 | } elseif ($object->element == 'ecm_directories') { |
@@ -10396,9 +10396,9 @@ discard block |
||
| 10396 | 10396 | } |
| 10397 | 10397 | |
| 10398 | 10398 | // Barcode image @phan-suppress-next-line PhanUndeclaredProperty |
| 10399 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 10400 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 10401 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 10399 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 10400 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 10401 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 10402 | 10402 | |
| 10403 | 10403 | return $out; |
| 10404 | 10404 | } |
@@ -10425,7 +10425,7 @@ discard block |
||
| 10425 | 10425 | global $conf, $langs; |
| 10426 | 10426 | |
| 10427 | 10427 | $entity = (empty($object->entity) ? $conf->entity : $object->entity); |
| 10428 | - $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10428 | + $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
| 10429 | 10429 | |
| 10430 | 10430 | $dir = ''; |
| 10431 | 10431 | $file = ''; |
@@ -10438,28 +10438,28 @@ discard block |
||
| 10438 | 10438 | if (!empty($object->logo)) { |
| 10439 | 10439 | if (dolIsAllowedForPreview($object->logo)) { |
| 10440 | 10440 | if ((string) $imagesize == 'mini') { |
| 10441 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10441 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 10442 | 10442 | } elseif ((string) $imagesize == 'small') { |
| 10443 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 10443 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 10444 | 10444 | } else { |
| 10445 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10445 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10446 | 10446 | } |
| 10447 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 10447 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 10448 | 10448 | } |
| 10449 | 10449 | } |
| 10450 | 10450 | $email = $object->email; |
| 10451 | 10451 | } elseif ($modulepart == 'contact') { |
| 10452 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 10452 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 10453 | 10453 | if (!empty($object->photo)) { |
| 10454 | 10454 | if (dolIsAllowedForPreview($object->photo)) { |
| 10455 | 10455 | if ((string) $imagesize == 'mini') { |
| 10456 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10456 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10457 | 10457 | } elseif ((string) $imagesize == 'small') { |
| 10458 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10458 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10459 | 10459 | } else { |
| 10460 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10460 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10461 | 10461 | } |
| 10462 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 10462 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 10463 | 10463 | } |
| 10464 | 10464 | } |
| 10465 | 10465 | $email = $object->email; |
@@ -10469,17 +10469,17 @@ discard block |
||
| 10469 | 10469 | if (!empty($object->photo)) { |
| 10470 | 10470 | if (dolIsAllowedForPreview($object->photo)) { |
| 10471 | 10471 | if ((string) $imagesize == 'mini') { |
| 10472 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10472 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10473 | 10473 | } elseif ((string) $imagesize == 'small') { |
| 10474 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10474 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10475 | 10475 | } else { |
| 10476 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10476 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10477 | 10477 | } |
| 10478 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 10478 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 10479 | 10479 | } |
| 10480 | 10480 | } |
| 10481 | 10481 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10482 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10482 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10483 | 10483 | } |
| 10484 | 10484 | $email = $object->email; |
| 10485 | 10485 | $capture = 'user'; |
@@ -10488,17 +10488,17 @@ discard block |
||
| 10488 | 10488 | if (!empty($object->photo)) { |
| 10489 | 10489 | if (dolIsAllowedForPreview($object->photo)) { |
| 10490 | 10490 | if ((string) $imagesize == 'mini') { |
| 10491 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 10491 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 10492 | 10492 | } elseif ((string) $imagesize == 'small') { |
| 10493 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 10493 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 10494 | 10494 | } else { |
| 10495 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10495 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10496 | 10496 | } |
| 10497 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 10497 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 10498 | 10498 | } |
| 10499 | 10499 | } |
| 10500 | 10500 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 10501 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 10501 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 10502 | 10502 | } |
| 10503 | 10503 | $email = $object->email; |
| 10504 | 10504 | $capture = 'user'; |
@@ -10524,35 +10524,35 @@ discard block |
||
| 10524 | 10524 | $ret = ''; |
| 10525 | 10525 | |
| 10526 | 10526 | if ($dir) { |
| 10527 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 10527 | + if ($file && file_exists($dir."/".$file)) { |
|
| 10528 | 10528 | if ($addlinktofullsize) { |
| 10529 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10529 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10530 | 10530 | if ($urladvanced) { |
| 10531 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10531 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10532 | 10532 | } else { |
| 10533 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10533 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10534 | 10534 | } |
| 10535 | 10535 | } |
| 10536 | - $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 . '">'; |
|
| 10536 | + $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.'">'; |
|
| 10537 | 10537 | if ($addlinktofullsize) { |
| 10538 | 10538 | $ret .= '</a>'; |
| 10539 | 10539 | } |
| 10540 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 10540 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 10541 | 10541 | if ($addlinktofullsize) { |
| 10542 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 10542 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 10543 | 10543 | if ($urladvanced) { |
| 10544 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 10544 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 10545 | 10545 | } else { |
| 10546 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 10546 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 10547 | 10547 | } |
| 10548 | 10548 | } |
| 10549 | - $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 . '">'; |
|
| 10549 | + $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.'">'; |
|
| 10550 | 10550 | if ($addlinktofullsize) { |
| 10551 | 10551 | $ret .= '</a>'; |
| 10552 | 10552 | } |
| 10553 | 10553 | } else { |
| 10554 | 10554 | $nophoto = '/public/theme/common/nophoto.png'; |
| 10555 | - $defaultimg = 'identicon'; // For gravatar |
|
| 10555 | + $defaultimg = 'identicon'; // For gravatar |
|
| 10556 | 10556 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 10557 | 10557 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) { |
| 10558 | 10558 | $nophoto = 'company'; |
@@ -10570,13 +10570,13 @@ discard block |
||
| 10570 | 10570 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 10571 | 10571 | // see https://gravatar.com/site/implement/images/php/ |
| 10572 | 10572 | $ret .= '<!-- Put link to gravatar -->'; |
| 10573 | - $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 |
|
| 10573 | + $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 |
|
| 10574 | 10574 | } else { |
| 10575 | 10575 | if ($nophoto == 'company') { |
| 10576 | - $ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 10576 | + $ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 10577 | 10577 | //$ret .= '<div class="difforspanimgright"></div>'; |
| 10578 | 10578 | } else { |
| 10579 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 10579 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 10580 | 10580 | } |
| 10581 | 10581 | } |
| 10582 | 10582 | } |
@@ -10587,15 +10587,15 @@ discard block |
||
| 10587 | 10587 | } |
| 10588 | 10588 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 10589 | 10589 | if ($object->photo) { |
| 10590 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 10590 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 10591 | 10591 | } |
| 10592 | 10592 | $ret .= '<tr><td class="tdoverflow">'; |
| 10593 | 10593 | $maxfilesizearray = getMaxFileSizeArray(); |
| 10594 | 10594 | $maxmin = $maxfilesizearray['maxmin']; |
| 10595 | 10595 | if ($maxmin > 0) { |
| 10596 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10596 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10597 | 10597 | } |
| 10598 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 10598 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 10599 | 10599 | $ret .= '</td></tr>'; |
| 10600 | 10600 | $ret .= '</table>'; |
| 10601 | 10601 | } |
@@ -10649,38 +10649,38 @@ discard block |
||
| 10649 | 10649 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10650 | 10650 | $sql .= ", e.label"; |
| 10651 | 10651 | } |
| 10652 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 10652 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 10653 | 10653 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10654 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 10654 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 10655 | 10655 | if ($force_entity) { |
| 10656 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 10656 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 10657 | 10657 | } else { |
| 10658 | 10658 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 10659 | 10659 | } |
| 10660 | 10660 | } else { |
| 10661 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 10661 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 10662 | 10662 | } |
| 10663 | 10663 | if (is_array($exclude) && $excludeGroups) { |
| 10664 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 10664 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 10665 | 10665 | } |
| 10666 | 10666 | if (is_array($include) && $includeGroups) { |
| 10667 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 10667 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 10668 | 10668 | } |
| 10669 | 10669 | $sql .= " ORDER BY ug.nom ASC"; |
| 10670 | 10670 | |
| 10671 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 10671 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 10672 | 10672 | $resql = $this->db->query($sql); |
| 10673 | 10673 | if ($resql) { |
| 10674 | 10674 | // Enhance with select2 |
| 10675 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10675 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10676 | 10676 | |
| 10677 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 10677 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 10678 | 10678 | |
| 10679 | 10679 | $num = $this->db->num_rows($resql); |
| 10680 | 10680 | $i = 0; |
| 10681 | 10681 | if ($num) { |
| 10682 | 10682 | if ($show_empty && !$multiple) { |
| 10683 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10683 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 10684 | 10684 | } |
| 10685 | 10685 | |
| 10686 | 10686 | while ($i < $num) { |
@@ -10693,11 +10693,11 @@ discard block |
||
| 10693 | 10693 | $label = $obj->name; |
| 10694 | 10694 | $labelhtml = $obj->name; |
| 10695 | 10695 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 10696 | - $label .= " (" . $obj->label . ")"; |
|
| 10697 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
| 10696 | + $label .= " (".$obj->label.")"; |
|
| 10697 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
| 10698 | 10698 | } |
| 10699 | 10699 | |
| 10700 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 10700 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 10701 | 10701 | if ($disableline) { |
| 10702 | 10702 | $out .= ' disabled'; |
| 10703 | 10703 | } |
@@ -10713,9 +10713,9 @@ discard block |
||
| 10713 | 10713 | } |
| 10714 | 10714 | } else { |
| 10715 | 10715 | if ($show_empty) { |
| 10716 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 10716 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 10717 | 10717 | } |
| 10718 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 10718 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 10719 | 10719 | } |
| 10720 | 10720 | $out .= '</select>'; |
| 10721 | 10721 | |
@@ -10759,25 +10759,25 @@ discard block |
||
| 10759 | 10759 | $out = ''; |
| 10760 | 10760 | |
| 10761 | 10761 | if (!empty($conf->use_javascript_ajax)) { |
| 10762 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10762 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10763 | 10763 | } |
| 10764 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10764 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10765 | 10765 | $(document).ready(function() { |
| 10766 | - $("#' . $cssclass . 's").click(function() { |
|
| 10766 | + $("#' . $cssclass.'s").click(function() { |
|
| 10767 | 10767 | if($(this).is(\':checked\')){ |
| 10768 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10769 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10768 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10769 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10770 | 10770 | } |
| 10771 | 10771 | else |
| 10772 | 10772 | { |
| 10773 | 10773 | console.log("We uncheck all"); |
| 10774 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10774 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10775 | 10775 | }' . "\n"; |
| 10776 | 10776 | if ($calljsfunction) { |
| 10777 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10777 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10778 | 10778 | } |
| 10779 | 10779 | $out .= ' }); |
| 10780 | - $(".' . $cssclass . '").change(function() { |
|
| 10780 | + $(".' . $cssclass.'").change(function() { |
|
| 10781 | 10781 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10782 | 10782 | }); |
| 10783 | 10783 | }); |
@@ -10822,67 +10822,67 @@ discard block |
||
| 10822 | 10822 | global $langs, $user; |
| 10823 | 10823 | |
| 10824 | 10824 | $out = ''; |
| 10825 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10826 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10825 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10826 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10827 | 10827 | if (!empty($excludeid)) { |
| 10828 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10828 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10829 | 10829 | } |
| 10830 | 10830 | $sql .= " ORDER BY label"; |
| 10831 | 10831 | |
| 10832 | 10832 | $resql = $this->db->query($sql); |
| 10833 | 10833 | if ($resql) { |
| 10834 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10834 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10835 | 10835 | if ($useempty) { |
| 10836 | 10836 | $out .= '<option value="0"> </option>'; |
| 10837 | 10837 | } |
| 10838 | 10838 | |
| 10839 | 10839 | while ($obj = $this->db->fetch_object($resql)) { |
| 10840 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10840 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10841 | 10841 | } |
| 10842 | 10842 | $out .= '</select>'; |
| 10843 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10843 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10844 | 10844 | |
| 10845 | 10845 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10846 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10846 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10847 | 10847 | } |
| 10848 | 10848 | |
| 10849 | 10849 | if (!empty($target)) { |
| 10850 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10850 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10851 | 10851 | $resql = $this->db->query($sql); |
| 10852 | 10852 | if ($resql) { |
| 10853 | 10853 | if ($this->db->num_rows($resql) > 0) { |
| 10854 | 10854 | $obj = $this->db->fetch_object($resql); |
| 10855 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10855 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10856 | 10856 | $(function() { |
| 10857 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10857 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10858 | 10858 | var current_val = $(this).val(); |
| 10859 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10859 | + if (current_val == ' . $obj->id.') {'; |
|
| 10860 | 10860 | if (!empty($default_selected) || !empty($selected)) { |
| 10861 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10861 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10862 | 10862 | } |
| 10863 | 10863 | |
| 10864 | 10864 | $out .= ' |
| 10865 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10865 | + $("select[name=' . $htmlname.']").change(); |
|
| 10866 | 10866 | } |
| 10867 | 10867 | }); |
| 10868 | 10868 | |
| 10869 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10869 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10870 | 10870 | |
| 10871 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10871 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10872 | 10872 | // get price of kilometer to fill the unit price |
| 10873 | 10873 | $.ajax({ |
| 10874 | 10874 | method: "POST", |
| 10875 | 10875 | dataType: "json", |
| 10876 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10877 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
| 10876 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10877 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
| 10878 | 10878 | }).done(function( data, textStatus, jqXHR ) { |
| 10879 | 10879 | console.log(data); |
| 10880 | 10880 | if (typeof data.up != "undefined") { |
| 10881 | 10881 | $("input[name=value_unit]").val(data.up); |
| 10882 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10882 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10883 | 10883 | } else { |
| 10884 | 10884 | $("input[name=value_unit]").val(""); |
| 10885 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10885 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10886 | 10886 | } |
| 10887 | 10887 | }); |
| 10888 | 10888 | } |
@@ -10912,18 +10912,18 @@ discard block |
||
| 10912 | 10912 | global $conf, $langs; |
| 10913 | 10913 | |
| 10914 | 10914 | $out = ''; |
| 10915 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10916 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10915 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10916 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10917 | 10917 | |
| 10918 | 10918 | $resql = $this->db->query($sql); |
| 10919 | 10919 | if ($resql) { |
| 10920 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10920 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10921 | 10921 | if ($useempty) { |
| 10922 | 10922 | $out .= '<option value="0"></option>'; |
| 10923 | 10923 | } |
| 10924 | 10924 | |
| 10925 | 10925 | while ($obj = $this->db->fetch_object($resql)) { |
| 10926 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10926 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10927 | 10927 | } |
| 10928 | 10928 | $out .= '</select>'; |
| 10929 | 10929 | } else { |
@@ -10954,12 +10954,12 @@ discard block |
||
| 10954 | 10954 | |
| 10955 | 10955 | $resql = $this->db->query($sql); |
| 10956 | 10956 | if ($resql) { |
| 10957 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10957 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10958 | 10958 | if ($useempty) { |
| 10959 | 10959 | $out .= '<option value="0"></option>'; |
| 10960 | 10960 | } |
| 10961 | 10961 | if ($allchoice) { |
| 10962 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10962 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10963 | 10963 | } |
| 10964 | 10964 | |
| 10965 | 10965 | $field = 'code'; |
@@ -10969,7 +10969,7 @@ discard block |
||
| 10969 | 10969 | |
| 10970 | 10970 | while ($obj = $this->db->fetch_object($resql)) { |
| 10971 | 10971 | $key = $langs->trans($obj->code); |
| 10972 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10972 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10973 | 10973 | } |
| 10974 | 10974 | $out .= '</select>'; |
| 10975 | 10975 | |
@@ -11003,7 +11003,7 @@ discard block |
||
| 11003 | 11003 | { |
| 11004 | 11004 | global $user, $conf, $langs; |
| 11005 | 11005 | |
| 11006 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 11006 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 11007 | 11007 | |
| 11008 | 11008 | if (is_null($usertofilter)) { |
| 11009 | 11009 | $usertofilter = $user; |
@@ -11027,10 +11027,10 @@ discard block |
||
| 11027 | 11027 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 11028 | 11028 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 11029 | 11029 | $sql .= ' s.nom as name'; |
| 11030 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 11031 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 11032 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 11033 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 11030 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 11031 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 11032 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 11033 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 11034 | 11034 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 11035 | 11035 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 11036 | 11036 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -11041,14 +11041,14 @@ discard block |
||
| 11041 | 11041 | if ($resql) { |
| 11042 | 11042 | // Use select2 selector |
| 11043 | 11043 | if (!empty($conf->use_javascript_ajax)) { |
| 11044 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 11044 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 11045 | 11045 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 11046 | 11046 | $out .= $comboenhancement; |
| 11047 | 11047 | $morecss = 'minwidth200imp maxwidth500'; |
| 11048 | 11048 | } |
| 11049 | 11049 | |
| 11050 | 11050 | if (empty($option_only)) { |
| 11051 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 11051 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 11052 | 11052 | } |
| 11053 | 11053 | if (!empty($show_empty)) { |
| 11054 | 11054 | $out .= '<option value="0" class="optiongrey">'; |
@@ -11078,33 +11078,33 @@ discard block |
||
| 11078 | 11078 | if ($showproject == 'all') { |
| 11079 | 11079 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 11080 | 11080 | if ($obj->name) { |
| 11081 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 11081 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 11082 | 11082 | } |
| 11083 | 11083 | |
| 11084 | 11084 | $disabled = 0; |
| 11085 | 11085 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 11086 | 11086 | $disabled = 1; |
| 11087 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 11087 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 11088 | 11088 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 11089 | 11089 | if ($discard_closed == 2) { |
| 11090 | 11090 | $disabled = 1; |
| 11091 | 11091 | } |
| 11092 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 11092 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 11093 | 11093 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 11094 | 11094 | $disabled = 1; |
| 11095 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 11095 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 11096 | 11096 | } |
| 11097 | 11097 | } |
| 11098 | 11098 | |
| 11099 | 11099 | if (!empty($selected) && $selected == $obj->rowid) { |
| 11100 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 11100 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 11101 | 11101 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 11102 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 11102 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 11103 | 11103 | } else { |
| 11104 | 11104 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 11105 | 11105 | $resultat = ''; |
| 11106 | 11106 | } else { |
| 11107 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 11107 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 11108 | 11108 | if ($disabled) { |
| 11109 | 11109 | $resultat .= ' disabled'; |
| 11110 | 11110 | } |
@@ -11156,22 +11156,22 @@ discard block |
||
| 11156 | 11156 | |
| 11157 | 11157 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 11158 | 11158 | //$sql.= ', el.fk_source'; |
| 11159 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 11160 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 11159 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 11160 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 11161 | 11161 | $sql .= " ORDER BY f.titre ASC"; |
| 11162 | 11162 | |
| 11163 | 11163 | $resql = $this->db->query($sql); |
| 11164 | 11164 | if ($resql) { |
| 11165 | 11165 | // Use select2 selector |
| 11166 | 11166 | if (!empty($conf->use_javascript_ajax)) { |
| 11167 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 11167 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 11168 | 11168 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
| 11169 | 11169 | $out .= $comboenhancement; |
| 11170 | 11170 | $morecss = 'minwidth200imp maxwidth500'; |
| 11171 | 11171 | } |
| 11172 | 11172 | |
| 11173 | 11173 | if (empty($option_only)) { |
| 11174 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 11174 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 11175 | 11175 | } |
| 11176 | 11176 | if (!empty($show_empty)) { |
| 11177 | 11177 | $out .= '<option value="0" class="optiongrey">'; |
@@ -11190,19 +11190,19 @@ discard block |
||
| 11190 | 11190 | $disabled = 0; |
| 11191 | 11191 | if (!empty($obj->suspended)) { |
| 11192 | 11192 | $disabled = 1; |
| 11193 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 11193 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 11194 | 11194 | } |
| 11195 | 11195 | |
| 11196 | 11196 | |
| 11197 | 11197 | if (!empty($selected) && $selected == $obj->rowid) { |
| 11198 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 11198 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 11199 | 11199 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 11200 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 11200 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 11201 | 11201 | } else { |
| 11202 | 11202 | if ($disabled && ($selected != $obj->rowid)) { |
| 11203 | 11203 | $resultat = ''; |
| 11204 | 11204 | } else { |
| 11205 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 11205 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 11206 | 11206 | if ($disabled) { |
| 11207 | 11207 | $resultat .= ' disabled'; |
| 11208 | 11208 | } |
@@ -11247,14 +11247,14 @@ discard block |
||
| 11247 | 11247 | $formother = new FormOther($this->db); |
| 11248 | 11248 | |
| 11249 | 11249 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 11250 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 11250 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 11251 | 11251 | } |
| 11252 | 11252 | |
| 11253 | 11253 | $ret = ''; |
| 11254 | 11254 | |
| 11255 | 11255 | $ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; |
| 11256 | 11256 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 11257 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 11257 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 11258 | 11258 | $ret .= '</a>'; |
| 11259 | 11259 | |
| 11260 | 11260 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -11298,30 +11298,30 @@ discard block |
||
| 11298 | 11298 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 11299 | 11299 | } |
| 11300 | 11300 | $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%')) -->"; |
| 11301 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 11301 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 11302 | 11302 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 11303 | 11303 | |
| 11304 | 11304 | // TODO : Use $arrayoffiltercriterias instead of $arrayofcriterias |
| 11305 | 11305 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 11306 | 11306 | foreach ($arrayofcriterias as $criteria) { |
| 11307 | 11307 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
| 11308 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11308 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 11309 | 11309 | continue; |
| 11310 | 11310 | } |
| 11311 | 11311 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 11312 | 11312 | continue; |
| 11313 | 11313 | } |
| 11314 | 11314 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 11315 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 11316 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 11317 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 11318 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 11319 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 11320 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 11321 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 11322 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 11315 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 11316 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 11317 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 11318 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 11319 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 11320 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 11321 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 11322 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 11323 | 11323 | } else { |
| 11324 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 11324 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 11325 | 11325 | } |
| 11326 | 11326 | } |
| 11327 | 11327 | } |
@@ -11329,7 +11329,7 @@ discard block |
||
| 11329 | 11329 | $ret .= '</div>'; |
| 11330 | 11330 | |
| 11331 | 11331 | $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"; |
| 11332 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11332 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 11333 | 11333 | |
| 11334 | 11334 | $ret .= '</div>'; |
| 11335 | 11335 | $ret .= '</div>'; |
@@ -11386,7 +11386,7 @@ discard block |
||
| 11386 | 11386 | // Convert $arrayoffiltercriterias into a json object that can be used in jquery to build the search component dynamically |
| 11387 | 11387 | $arrayoffiltercriterias_json = json_encode($arrayoffiltercriterias); |
| 11388 | 11388 | $ret .= '<script> |
| 11389 | - var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json . '; |
|
| 11389 | + var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json.'; |
|
| 11390 | 11390 | </script>'; |
| 11391 | 11391 | |
| 11392 | 11392 | |
@@ -11400,9 +11400,9 @@ discard block |
||
| 11400 | 11400 | $ret .= '<div class="search-component-assistance">'; |
| 11401 | 11401 | $ret .= '<div>'; |
| 11402 | 11402 | |
| 11403 | - $ret .= '<p class="assistance-title">' . img_picto('', 'filter') . ' ' . $langs->trans('FilterAssistance') . ' </p>'; |
|
| 11403 | + $ret .= '<p class="assistance-title">'.img_picto('', 'filter').' '.$langs->trans('FilterAssistance').' </p>'; |
|
| 11404 | 11404 | |
| 11405 | - $ret .= '<p class="assistance-errors error" style="display:none">' . $langs->trans('AllFieldsRequired') . ' </p>'; |
|
| 11405 | + $ret .= '<p class="assistance-errors error" style="display:none">'.$langs->trans('AllFieldsRequired').' </p>'; |
|
| 11406 | 11406 | |
| 11407 | 11407 | $ret .= '<div class="operand">'; |
| 11408 | 11408 | $ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width250', 1); |
@@ -11416,7 +11416,7 @@ discard block |
||
| 11416 | 11416 | $ret .= '</select>'; |
| 11417 | 11417 | $ret .= '<script>$(document).ready(function() {'; |
| 11418 | 11418 | $ret .= ' $(".operator-selector").select2({'; |
| 11419 | - $ret .= ' placeholder: \'' . dol_escape_js($langs->trans('Operator')) . '\''; |
|
| 11419 | + $ret .= ' placeholder: \''.dol_escape_js($langs->trans('Operator')).'\''; |
|
| 11420 | 11420 | $ret .= ' });'; |
| 11421 | 11421 | $ret .= '});</script>'; |
| 11422 | 11422 | $ret .= '</div>'; |
@@ -11425,12 +11425,12 @@ discard block |
||
| 11425 | 11425 | |
| 11426 | 11426 | $ret .= '<div class="value">'; |
| 11427 | 11427 | // Input field for entering values |
| 11428 | - $ret .= '<input type="text" class="flat width100 value-input" placeholder="' . dolPrintHTML($langs->trans('Value')) . '">'; |
|
| 11428 | + $ret .= '<input type="text" class="flat width100 value-input" placeholder="'.dolPrintHTML($langs->trans('Value')).'">'; |
|
| 11429 | 11429 | |
| 11430 | 11430 | // Date selector |
| 11431 | 11431 | $dateOne = ''; |
| 11432 | 11432 | $ret .= '<span class="date-one" style="display:none">'; |
| 11433 | - $ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, ''); |
|
| 11433 | + $ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, ''); |
|
| 11434 | 11434 | $ret .= '</span>'; |
| 11435 | 11435 | |
| 11436 | 11436 | // Value selector (will be populated dynamically) based on search_filter_field value if a selected value has an array of values |
@@ -11439,7 +11439,7 @@ discard block |
||
| 11439 | 11439 | $ret .= '<script> |
| 11440 | 11440 | $(document).ready(function() { |
| 11441 | 11441 | $("#value-selector").select2({ |
| 11442 | - placeholder: "' . dol_escape_js($langs->trans('Value')) . '" |
|
| 11442 | + placeholder: "' . dol_escape_js($langs->trans('Value')).'" |
|
| 11443 | 11443 | }); |
| 11444 | 11444 | $("#value-selector").hide(); |
| 11445 | 11445 | $("#value-selector").next(".select2-container").hide(); |
@@ -11449,7 +11449,7 @@ discard block |
||
| 11449 | 11449 | $ret .= '</div>'; |
| 11450 | 11450 | |
| 11451 | 11451 | $ret .= '<div class="btn-div">'; |
| 11452 | - $ret .= '<button class="button buttongen button-save add-filter-btn" type="button">' . $langs->trans("addToFilter") . '</button>'; |
|
| 11452 | + $ret .= '<button class="button buttongen button-save add-filter-btn" type="button">'.$langs->trans("addToFilter").'</button>'; |
|
| 11453 | 11453 | $ret .= '</div>'; |
| 11454 | 11454 | |
| 11455 | 11455 | $ret .= '</div>'; |
@@ -11615,7 +11615,7 @@ discard block |
||
| 11615 | 11615 | |
| 11616 | 11616 | $TModels = array(); |
| 11617 | 11617 | |
| 11618 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 11618 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 11619 | 11619 | $formmail = new FormMail($this->db); |
| 11620 | 11620 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 11621 | 11621 | |
@@ -11628,20 +11628,20 @@ discard block |
||
| 11628 | 11628 | } |
| 11629 | 11629 | } |
| 11630 | 11630 | |
| 11631 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 11631 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 11632 | 11632 | |
| 11633 | 11633 | foreach ($TModels as $id_model => $label_model) { |
| 11634 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 11634 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 11635 | 11635 | if (!empty($selected) && $selected == $id_model) { |
| 11636 | 11636 | $retstring .= "selected"; |
| 11637 | 11637 | } |
| 11638 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 11638 | + $retstring .= ">".$label_model."</option>"; |
|
| 11639 | 11639 | } |
| 11640 | 11640 | |
| 11641 | 11641 | $retstring .= "</select>"; |
| 11642 | 11642 | |
| 11643 | 11643 | if ($addjscombo) { |
| 11644 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 11644 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 11645 | 11645 | } |
| 11646 | 11646 | |
| 11647 | 11647 | return $retstring; |
@@ -11692,16 +11692,16 @@ discard block |
||
| 11692 | 11692 | |
| 11693 | 11693 | foreach ($buttons as $button) { |
| 11694 | 11694 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 11695 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->transnoentities($button['label_key'])) . '">'; |
|
| 11695 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->transnoentities($button['label_key'])).'">'; |
|
| 11696 | 11696 | } |
| 11697 | 11697 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 11698 | 11698 | |
| 11699 | 11699 | if ($dol_openinpopup) { |
| 11700 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 11701 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 11700 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 11701 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 11702 | 11702 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 11703 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\'); |
|
| 11704 | - window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\'); |
|
| 11703 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\'); |
|
| 11704 | + window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\'); |
|
| 11705 | 11705 | });'; |
| 11706 | 11706 | $retstring .= '</script>'; |
| 11707 | 11707 | } |
@@ -11730,7 +11730,7 @@ discard block |
||
| 11730 | 11730 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 11731 | 11731 | |
| 11732 | 11732 | $sql = "SELECT rowid, code, label as label"; |
| 11733 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 11733 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 11734 | 11734 | $sql .= " WHERE active = 1"; |
| 11735 | 11735 | |
| 11736 | 11736 | $resql = $this->db->query($sql); |
@@ -11741,7 +11741,7 @@ discard block |
||
| 11741 | 11741 | $obj = $this->db->fetch_object($resql); |
| 11742 | 11742 | |
| 11743 | 11743 | // If translation exists, we use it, otherwise we take the default wording |
| 11744 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11744 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 11745 | 11745 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 11746 | 11746 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 11747 | 11747 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -11773,18 +11773,18 @@ discard block |
||
| 11773 | 11773 | global $langs, $user; |
| 11774 | 11774 | |
| 11775 | 11775 | $out = ''; |
| 11776 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 11776 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 11777 | 11777 | |
| 11778 | 11778 | $this->load_cache_invoice_subtype(); |
| 11779 | 11779 | |
| 11780 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 11780 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 11781 | 11781 | if ($addempty) { |
| 11782 | 11782 | $out .= '<option value="0"> </option>'; |
| 11783 | 11783 | } |
| 11784 | 11784 | |
| 11785 | 11785 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 11786 | 11786 | $label = $subtype['label']; |
| 11787 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 11787 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 11788 | 11788 | if ($selected == $subtype['rowid']) { |
| 11789 | 11789 | $out .= ' selected="selected"'; |
| 11790 | 11790 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | if (!is_string($objecttype) || empty($objecttype)) { |
| 129 | 129 | $objecttype = 'thirdparty'; |
| 130 | 130 | } |
| 131 | -'@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null |
|
| 131 | +'@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null |
|
| 132 | 132 | |
| 133 | 133 | require_once DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php"; |
| 134 | 134 | require_once DOL_DOCUMENT_ROOT."/core/class/html.form.class.php"; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | // Fetch optionals attributes and labels |
| 235 | -$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
| 235 | +$extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects |
|
| 236 | 236 | //$extrafields->fetch_name_optionals_label($object->table_element_line); |
| 237 | 237 | |
| 238 | 238 | $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | // If string is not an universal filter string, we try to convert it into universal filter syntax string |
| 247 | 247 | $errorstr = ''; |
| 248 | -forgeSQLFromUniversalSearchCriteria($search_component_params_input, $errorstr); // Try conversion UFS->SQL |
|
| 248 | +forgeSQLFromUniversalSearchCriteria($search_component_params_input, $errorstr); // Try conversion UFS->SQL |
|
| 249 | 249 | //var_dump($errorstr); |
| 250 | 250 | if ($errorstr) { |
| 251 | 251 | $value = $search_component_params_input; |
@@ -257,14 +257,14 @@ discard block |
||
| 257 | 257 | $crits = explode(' ', trim($value)); // the string after the name of the field. Explode on each AND |
| 258 | 258 | $res = ''; |
| 259 | 259 | |
| 260 | - $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
| 260 | + $i1 = 0; // count the nb of and criteria added (all fields / criteria) |
|
| 261 | 261 | foreach ($crits as $crit) { // Loop on each AND criteria |
| 262 | 262 | $crit = trim($crit); |
| 263 | 263 | |
| 264 | - $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
| 264 | + $i2 = 0; // count the nb of valid criteria added for this first criteria |
|
| 265 | 265 | $newres = ''; |
| 266 | 266 | $tmpcrits = explode('|', $crit); |
| 267 | - $i3 = 0; // count the nb of valid criteria added for this current field |
|
| 267 | + $i3 = 0; // count the nb of valid criteria added for this current field |
|
| 268 | 268 | foreach ($tmpcrits as $tmpcrit) { |
| 269 | 269 | if ($tmpcrit !== '0' && empty($tmpcrit)) { |
| 270 | 270 | continue; |
@@ -282,8 +282,8 @@ discard block |
||
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
| 286 | - $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
| 285 | + $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field |
|
| 286 | + $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field |
|
| 287 | 287 | //var_dump($field); var_dump($tmpcrit); var_dump($i3); |
| 288 | 288 | |
| 289 | 289 | $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | foreach ($arrayofmesures as $key => $val) { |
| 665 | 665 | $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; |
| 666 | 666 | } |
| 667 | - print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
| 667 | + print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields |
|
| 668 | 668 | print '</div>'; |
| 669 | 669 | |
| 670 | 670 | // XAxis |
@@ -672,14 +672,14 @@ discard block |
||
| 672 | 672 | print '<div class="divadvancedsearchfield">'; |
| 673 | 673 | print '<div class="inline-block"><span class="fas fa-ruler-combined paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span><span class="fas fa-caret-down caretdownaxis" title="'.dol_escape_htmltag($langs->trans("XAxis")).'"></span></div>'; |
| 674 | 674 | //var_dump($arrayofxaxis); |
| 675 | - print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields |
|
| 675 | + print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields |
|
| 676 | 676 | print '</div>'; |
| 677 | 677 | |
| 678 | 678 | // Group by |
| 679 | 679 | $count = 0; |
| 680 | 680 | print '<div class="divadvancedsearchfield">'; |
| 681 | 681 | print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("GroupBy")).'"></span></div>'; |
| 682 | - print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
| 682 | + print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields |
|
| 683 | 683 | print '</div>'; |
| 684 | 684 | |
| 685 | 685 | |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | //var_dump($arrayofgroupby); |
| 842 | 842 | $tmpforloop = dolExplodeIntoArray($arrayofxaxis[$val]['tablefromt'], ','); |
| 843 | 843 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 844 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 844 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 845 | 845 | $tmpforexplode = explode('__', $tmptablealias); |
| 846 | 846 | $endpart = end($tmpforexplode); |
| 847 | 847 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | //var_dump($arrayofgroupby[$val]); var_dump($tmpval); |
| 869 | 869 | $tmpforloop = dolExplodeIntoArray($arrayofgroupby[$val]['tablefromt'], ','); |
| 870 | 870 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 871 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 871 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 872 | 872 | $tmpforexplode = explode('__', $tmptablealias); |
| 873 | 873 | $endpart = end($tmpforexplode); |
| 874 | 874 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | //var_dump($arrayofgroupby); |
| 896 | 896 | $tmpforloop = dolExplodeIntoArray($arrayofmesures[$val]['tablefromt'], ','); |
| 897 | 897 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 898 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 898 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 899 | 899 | $tmpforexplode = explode('__', $tmptablealias); |
| 900 | 900 | $endpart = end($tmpforexplode); |
| 901 | 901 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | $tmpval = explode('.', $val); |
| 930 | 930 | $tmpforloop = dolExplodeIntoArray($arrayoffilterfields[$val]['tablefromt'], ','); |
| 931 | 931 | foreach ($tmpforloop as $tmptable => $tmptablealias) { |
| 932 | - if (! in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 932 | + if (!in_array($tmptable, $listoftablesalreadyadded)) { // We do not add join for main table and tables already added |
|
| 933 | 933 | $tmpforexplode = explode('__', $tmptablealias); |
| 934 | 934 | $endpart = end($tmpforexplode); |
| 935 | 935 | $parenttableandfield = preg_replace('/__'.$endpart.'$/', '', $tmptablealias).'.'.$endpart; |
@@ -965,9 +965,9 @@ discard block |
||
| 965 | 965 | * @param array<int, string> $matches |
| 966 | 966 | * @return string SQL filter condition |
| 967 | 967 | */ |
| 968 | - function (array $matches): string { |
|
| 968 | + function(array $matches): string { |
|
| 969 | 969 | global $db; |
| 970 | - $column = $matches[1] . '.' . $matches[2]; |
|
| 970 | + $column = $matches[1].'.'.$matches[2]; |
|
| 971 | 971 | $operator = $matches[3]; |
| 972 | 972 | $year = (int) $matches[4]; |
| 973 | 973 | $month = (int) $matches[5]; |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $search_date_due_start = ''; |
| 297 | 297 | // Due date end |
| 298 | 298 | $search_date_due_end_day = ''; |
| 299 | - $search_date_due_end_month = ''; |
|
| 299 | + $search_date_due_end_month = ''; |
|
| 300 | 300 | $search_date_due_end_year = ''; |
| 301 | 301 | $search_date_due_end = ''; |
| 302 | 302 | $search_lettering_code = ''; |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | } else { |
| 343 | 343 | $filter['t.numero_compte>='] = $search_accountancy_code_start; |
| 344 | 344 | } |
| 345 | - $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); |
|
| 345 | + $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); |
|
| 346 | 346 | } |
| 347 | 347 | if (!empty($search_accountancy_code_end)) { |
| 348 | 348 | if ($type == 'sub') { |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | } else { |
| 351 | 351 | $filter['t.numero_compte<='] = $search_accountancy_code_end; |
| 352 | 352 | } |
| 353 | - $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); |
|
| 353 | + $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); |
|
| 354 | 354 | } |
| 355 | 355 | if (!empty($search_label_account)) { |
| 356 | 356 | $filter['t.label_compte'] = $search_label_account; |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | if (!$error) { |
| 520 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 520 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 521 | 521 | exit(); |
| 522 | 522 | } |
| 523 | 523 | } elseif ($massaction == 'letteringmanual' && $permissiontoadd) { |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | setEventMessages('', $lettering->errors, 'errors'); |
| 528 | 528 | } else { |
| 529 | 529 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 530 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 530 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 531 | 531 | exit(); |
| 532 | 532 | } |
| 533 | 533 | } elseif ($type == 'sub' && $massaction == 'letteringpartial') { |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | setEventMessages('', $lettering->errors, 'errors'); |
| 538 | 538 | } else { |
| 539 | 539 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 540 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 540 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 541 | 541 | exit(); |
| 542 | 542 | } |
| 543 | 543 | } elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) { |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | if (!$error) { |
| 561 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 561 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 562 | 562 | exit(); |
| 563 | 563 | } |
| 564 | 564 | } elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) { |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | setEventMessages('', $lettering->errors, 'errors'); |
| 569 | 569 | } else { |
| 570 | 570 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoUnletteringModified' : 'AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
| 571 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 571 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 572 | 572 | exit(); |
| 573 | 573 | } |
| 574 | 574 | } |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | } else { |
| 664 | 664 | $subledger_start_account = $subledger_end_account = ''; |
| 665 | 665 | } |
| 666 | - print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 666 | + print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 667 | 667 | } else { |
| 668 | 668 | print '<span class="a-mesure marginleftonly marginrightonly">'; |
| 669 | 669 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | } else { |
| 684 | 684 | $subledger_start_account = $subledger_end_account = ''; |
| 685 | 685 | } |
| 686 | - print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 686 | + print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 687 | 687 | } else { |
| 688 | 688 | print '<span class="a-mesure marginleftonly marginrightonly">'; |
| 689 | 689 | } |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter, 'AND', 0); |
| 729 | 729 | } |
| 730 | 730 | //$num = count($object->lines); |
| 731 | - $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
| 731 | + $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
| 732 | 732 | |
| 733 | 733 | if ($result < 0) { |
| 734 | 734 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -744,13 +744,13 @@ discard block |
||
| 744 | 744 | // List of mass actions available |
| 745 | 745 | $arrayofmassactions = array(); |
| 746 | 746 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
| 747 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
| 748 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
| 749 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
| 747 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
| 748 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
| 749 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
| 750 | 750 | if ($type == 'sub') { |
| 751 | - $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringPartial'); |
|
| 751 | + $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringPartial'); |
|
| 752 | 752 | } |
| 753 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
| 753 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
| 754 | 754 | } |
| 755 | 755 | if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { |
| 756 | 756 | $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 770 | 770 | print '<input type="hidden" name="type" value="'.$type.'">'; |
| 771 | 771 | if (!empty($socid)) { |
| 772 | - print '<input type="hidden" name="socid" value="' . $socid . '">'; |
|
| 772 | + print '<input type="hidden" name="socid" value="'.$socid.'">'; |
|
| 773 | 773 | } |
| 774 | 774 | print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
| 775 | 775 | print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
@@ -786,17 +786,17 @@ discard block |
||
| 786 | 786 | if (empty($reshook)) { |
| 787 | 787 | // Remove button navigation if in thirdparty tab mode |
| 788 | 788 | if (empty($socid)) { |
| 789 | - $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param); |
|
| 789 | + $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); |
|
| 790 | 790 | if ($type == 'sub') { |
| 791 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 792 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 791 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 792 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 793 | 793 | } else { |
| 794 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 795 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 794 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 795 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 796 | 796 | } |
| 797 | 797 | $newcardbutton .= dolGetButtonTitleSeparator(); |
| 798 | 798 | } |
| 799 | - $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); |
|
| 799 | + $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
@@ -863,8 +863,8 @@ discard block |
||
| 863 | 863 | } else { |
| 864 | 864 | $stringforfirstkey .= ' CTL +'; |
| 865 | 865 | } |
| 866 | - $moreforfilter .= ' <a id="previous_account" accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
| 867 | - $moreforfilter .= ' <a id="next_account" accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
| 866 | + $moreforfilter .= ' <a id="previous_account" accesskey="p" title="'.$stringforfirstkey.' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
| 867 | + $moreforfilter .= ' <a id="next_account" accesskey="n" title="'.$stringforfirstkey.' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
| 868 | 868 | $moreforfilter .= <<<SCRIPT |
| 869 | 869 | <script type="text/javascript"> |
| 870 | 870 | jQuery(document).ready(function() { |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | if (empty($socid)) { |
| 897 | 897 | $moreforfilter .= '<div class="divsearchfield">'; |
| 898 | - $moreforfilter .= $langs->trans('AccountingCategory') . ': '; |
|
| 898 | + $moreforfilter .= $langs->trans('AccountingCategory').': '; |
|
| 899 | 899 | $moreforfilter .= '<div class="nowrap inline-block">'; |
| 900 | 900 | $moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0); |
| 901 | 901 | $moreforfilter .= '</div>'; |
@@ -1082,9 +1082,9 @@ discard block |
||
| 1082 | 1082 | |
| 1083 | 1083 | $displayed_account_number = null; // Start with undefined to be able to distinguish with empty |
| 1084 | 1084 | |
| 1085 | -$objectstatic = null; // Init for static analysis |
|
| 1086 | -$objectlink = ''; // Init for static analysis |
|
| 1087 | -$result = -1; // Init for static analysis |
|
| 1085 | +$objectstatic = null; // Init for static analysis |
|
| 1086 | +$objectlink = ''; // Init for static analysis |
|
| 1087 | +$result = -1; // Init for static analysis |
|
| 1088 | 1088 | |
| 1089 | 1089 | // Loop on record |
| 1090 | 1090 | // -------------------------------------------------------------------- |
@@ -1100,8 +1100,8 @@ discard block |
||
| 1100 | 1100 | $totalarray['val']['totalbalance'] = 0; |
| 1101 | 1101 | |
| 1102 | 1102 | // Init for static analysis |
| 1103 | -$colspan = 0; // colspan before field 'label of operation' |
|
| 1104 | -$colspanend = 0; // colspan after debit/credit |
|
| 1103 | +$colspan = 0; // colspan before field 'label of operation' |
|
| 1104 | +$colspanend = 0; // colspan after debit/credit |
|
| 1105 | 1105 | $accountg = '-'; |
| 1106 | 1106 | |
| 1107 | 1107 | while ($i < min($num, $limit)) { |
@@ -1114,8 +1114,8 @@ discard block |
||
| 1114 | 1114 | } |
| 1115 | 1115 | //if (empty($accountg)) $accountg = '-'; |
| 1116 | 1116 | |
| 1117 | - $colspan = 0; // colspan before field 'label of operation' |
|
| 1118 | - $colspanend = 0; // colspan after debit/credit |
|
| 1117 | + $colspan = 0; // colspan before field 'label of operation' |
|
| 1118 | + $colspanend = 0; // colspan after debit/credit |
|
| 1119 | 1119 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 1120 | 1120 | $colspan++; |
| 1121 | 1121 | } |
@@ -1168,9 +1168,9 @@ discard block |
||
| 1168 | 1168 | if (isset($displayed_account_number)) { |
| 1169 | 1169 | print '<tr class="liste_total">'; |
| 1170 | 1170 | if ($type == 'sub') { |
| 1171 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accounta($displayed_account_number) . ':</td>'; |
|
| 1171 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accounta($displayed_account_number).':</td>'; |
|
| 1172 | 1172 | } else { |
| 1173 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accountg($displayed_account_number) . ':</td>'; |
|
| 1173 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':</td>'; |
|
| 1174 | 1174 | } |
| 1175 | 1175 | print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>'; |
| 1176 | 1176 | print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>'; |
@@ -1209,9 +1209,9 @@ discard block |
||
| 1209 | 1209 | print length_accounta($line->subledger_account); |
| 1210 | 1210 | } else { |
| 1211 | 1211 | // Should not happen: subledger account must be null or a non empty value |
| 1212 | - print '<span class="error">' . $langs->trans("Unknown"); |
|
| 1212 | + print '<span class="error">'.$langs->trans("Unknown"); |
|
| 1213 | 1213 | if ($line->subledger_label) { |
| 1214 | - print ' (' . $line->subledger_label . ')'; |
|
| 1214 | + print ' ('.$line->subledger_label.')'; |
|
| 1215 | 1215 | $htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined'; |
| 1216 | 1216 | } else { |
| 1217 | 1217 | $htmltext = 'EmptyStringForSubledgerAccountAndSubledgerLabel'; |
@@ -1221,9 +1221,9 @@ discard block |
||
| 1221 | 1221 | } |
| 1222 | 1222 | } else { |
| 1223 | 1223 | if ($line->numero_compte != "" && $line->numero_compte != '-1') { |
| 1224 | - print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); |
|
| 1224 | + print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte); |
|
| 1225 | 1225 | } else { |
| 1226 | - print '<span class="error">' . $langs->trans("Unknown") . '</span>'; |
|
| 1226 | + print '<span class="error">'.$langs->trans("Unknown").'</span>'; |
|
| 1227 | 1227 | } |
| 1228 | 1228 | } |
| 1229 | 1229 | print '</td>'; |
@@ -1246,7 +1246,7 @@ discard block |
||
| 1246 | 1246 | if (in_array($line->id, $arrayofselected)) { |
| 1247 | 1247 | $selected = 1; |
| 1248 | 1248 | } |
| 1249 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
| 1249 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
| 1250 | 1250 | } |
| 1251 | 1251 | print '</td>'; |
| 1252 | 1252 | if (!$i) { |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | } elseif ($line->doc_type == 'bank') { |
| 1341 | 1341 | print $objectstatic->getNomUrl(1); |
| 1342 | 1342 | $bank_ref = strstr($line->doc_ref, '-'); |
| 1343 | - print " " . $bank_ref; |
|
| 1343 | + print " ".$bank_ref; |
|
| 1344 | 1344 | } else { |
| 1345 | 1345 | print $line->doc_ref; |
| 1346 | 1346 | } |
@@ -1453,7 +1453,7 @@ discard block |
||
| 1453 | 1453 | if (in_array($line->id, $arrayofselected)) { |
| 1454 | 1454 | $selected = 1; |
| 1455 | 1455 | } |
| 1456 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
| 1456 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
| 1457 | 1457 | } |
| 1458 | 1458 | print '</td>'; |
| 1459 | 1459 | if (!$i) { |
@@ -65,45 +65,45 @@ discard block |
||
| 65 | 65 | $search_mvt_num = GETPOST('search_mvt_num', 'alpha'); |
| 66 | 66 | $search_doc_type = GETPOST("search_doc_type", 'alpha'); |
| 67 | 67 | $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); |
| 68 | -$search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 69 | -$search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 70 | -$search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 71 | -$search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 72 | -$search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 73 | -$search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 68 | +$search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 69 | +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 70 | +$search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 71 | +$search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 72 | +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 73 | +$search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 74 | 74 | $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); |
| 75 | 75 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 76 | 76 | $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
| 77 | -$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 78 | -$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 79 | -$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 80 | -$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 81 | -$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 82 | -$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 77 | +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 78 | +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 79 | +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 80 | +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 81 | +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 82 | +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 83 | 83 | $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); |
| 84 | 84 | $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); |
| 85 | -$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 86 | -$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 87 | -$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 88 | -$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 89 | -$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 90 | -$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 85 | +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 86 | +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 87 | +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 88 | +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 89 | +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 90 | +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 91 | 91 | $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); |
| 92 | 92 | $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); |
| 93 | -$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 94 | -$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 95 | -$search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 96 | -$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 97 | -$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 98 | -$search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 93 | +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 94 | +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 95 | +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 96 | +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 97 | +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 98 | +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 99 | 99 | $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); |
| 100 | 100 | $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); |
| 101 | -$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 102 | -$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 103 | -$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 104 | -$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 105 | -$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 106 | -$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 101 | +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 102 | +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 103 | +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 104 | +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 105 | +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 106 | +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 107 | 107 | $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); |
| 108 | 108 | $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); |
| 109 | 109 | // Due date start |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $search_date_due_start = ''; |
| 326 | 326 | // Due date end |
| 327 | 327 | $search_date_due_end_day = ''; |
| 328 | - $search_date_due_end_month = ''; |
|
| 328 | + $search_date_due_end_month = ''; |
|
| 329 | 329 | $search_date_due_end_year = ''; |
| 330 | 330 | $search_date_due_end = ''; |
| 331 | 331 | $search_debit = ''; |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | if (!$error) { |
| 579 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 579 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 580 | 580 | exit(); |
| 581 | 581 | } |
| 582 | 582 | } elseif ($massaction == 'letteringmanual' && $permissiontoadd) { |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | setEventMessages('', $lettering->errors, 'errors'); |
| 587 | 587 | } else { |
| 588 | 588 | setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 589 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 589 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 590 | 590 | exit(); |
| 591 | 591 | } |
| 592 | 592 | } elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) { |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | if (!$error) { |
| 610 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 610 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 611 | 611 | exit(); |
| 612 | 612 | } |
| 613 | 613 | } elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) { |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | setEventMessages('', $lettering->errors, 'errors'); |
| 618 | 618 | } else { |
| 619 | 619 | setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
| 620 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 620 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 621 | 621 | exit(); |
| 622 | 622 | } |
| 623 | 623 | } |
@@ -800,10 +800,10 @@ discard block |
||
| 800 | 800 | // List of mass actions available |
| 801 | 801 | $arrayofmassactions = array(); |
| 802 | 802 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
| 803 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
| 804 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
| 805 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
| 806 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
| 803 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
| 804 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
| 805 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
| 806 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
| 807 | 807 | } |
| 808 | 808 | if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { |
| 809 | 809 | $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly')); |
| 844 | 844 | $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub'.$param, '', 1, array('morecss' => 'marginleftonly')); |
| 845 | 845 | |
| 846 | - $url = './card.php?action=create'.(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($_SERVER['PHP_SELF']); |
|
| 846 | + $url = './card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']); |
|
| 847 | 847 | if (!empty($socid)) { |
| 848 | 848 | $url .= '&socid='.$socid; |
| 849 | 849 | } |
@@ -1224,7 +1224,7 @@ discard block |
||
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | 1226 | // Document ref |
| 1227 | - $modulepart = ''; // may be used by include*.tpl.php |
|
| 1227 | + $modulepart = ''; // may be used by include*.tpl.php |
|
| 1228 | 1228 | if (!empty($arrayfields['t.doc_ref']['checked'])) { |
| 1229 | 1229 | $objectstatic = null; |
| 1230 | 1230 | |
@@ -1292,8 +1292,8 @@ discard block |
||
| 1292 | 1292 | $labeltoshow .= $objectstatic->getNomUrl(1); |
| 1293 | 1293 | $labeltoshowalt .= $objectstatic->ref; |
| 1294 | 1294 | $bank_ref = strstr($line->doc_ref, '-'); |
| 1295 | - $labeltoshow .= " " . $bank_ref; |
|
| 1296 | - $labeltoshowalt .= " " . $bank_ref; |
|
| 1295 | + $labeltoshow .= " ".$bank_ref; |
|
| 1296 | + $labeltoshowalt .= " ".$bank_ref; |
|
| 1297 | 1297 | } else { |
| 1298 | 1298 | $labeltoshow .= $line->doc_ref; |
| 1299 | 1299 | $labeltoshowalt .= $line->doc_ref; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context |
| 95 | 95 | $object = new BookKeeping($db); |
| 96 | -$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array |
|
| 96 | +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array |
|
| 97 | 97 | |
| 98 | 98 | $formaccounting = new FormAccounting($db); |
| 99 | 99 | $formother = new FormOther($db); |
@@ -174,11 +174,11 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | if (!empty($search_date_start)) { |
| 176 | 176 | $filter['t.doc_date>='] = $search_date_start; |
| 177 | - $param .= '&date_startmonth=' . GETPOSTINT('date_startmonth') . '&date_startday=' . GETPOSTINT('date_startday') . '&date_startyear=' . GETPOSTINT('date_startyear'); |
|
| 177 | + $param .= '&date_startmonth='.GETPOSTINT('date_startmonth').'&date_startday='.GETPOSTINT('date_startday').'&date_startyear='.GETPOSTINT('date_startyear'); |
|
| 178 | 178 | } |
| 179 | 179 | if (!empty($search_date_end)) { |
| 180 | 180 | $filter['t.doc_date<='] = $search_date_end; |
| 181 | - $param .= '&date_endmonth=' . GETPOSTINT('date_endmonth') . '&date_endday=' . GETPOSTINT('date_endday') . '&date_endyear=' . GETPOSTINT('date_endyear'); |
|
| 181 | + $param .= '&date_endmonth='.GETPOSTINT('date_endmonth').'&date_endday='.GETPOSTINT('date_endday').'&date_endyear='.GETPOSTINT('date_endyear'); |
|
| 182 | 182 | } |
| 183 | 183 | if (!empty($search_accountancy_code_start)) { |
| 184 | 184 | if ($type == 'sub') { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } else { |
| 187 | 187 | $filter['t.numero_compte>='] = $search_accountancy_code_start; |
| 188 | 188 | } |
| 189 | - $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); |
|
| 189 | + $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); |
|
| 190 | 190 | } |
| 191 | 191 | if (!empty($search_accountancy_code_end)) { |
| 192 | 192 | if ($type == 'sub') { |
@@ -194,12 +194,12 @@ discard block |
||
| 194 | 194 | } else { |
| 195 | 195 | $filter['t.numero_compte<='] = $search_accountancy_code_end; |
| 196 | 196 | } |
| 197 | - $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); |
|
| 197 | + $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); |
|
| 198 | 198 | } |
| 199 | 199 | if (!empty($search_ledger_code)) { |
| 200 | 200 | $filter['t.code_journal'] = $search_ledger_code; |
| 201 | 201 | foreach ($search_ledger_code as $code) { |
| 202 | - $param .= '&search_ledger_code[]=' . urlencode($code); |
|
| 202 | + $param .= '&search_ledger_code[]='.urlencode($code); |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | if (!empty($search_not_reconciled)) { |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | // param with type of list |
| 211 | 211 | $url_param = substr($param, 1); // remove first "&" |
| 212 | 212 | if (!empty($type)) { |
| 213 | - $param = '&type=' . $type . $param; |
|
| 213 | + $param = '&type='.$type.$param; |
|
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
@@ -232,11 +232,11 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | foreach ($object->lines as $line) { |
| 234 | 234 | if ($type == 'sub') { |
| 235 | - print '"' . length_accounta($line->subledger_account) . '"' . $sep; |
|
| 236 | - print '"' . $line->subledger_label . '"' . $sep; |
|
| 235 | + print '"'.length_accounta($line->subledger_account).'"'.$sep; |
|
| 236 | + print '"'.$line->subledger_label.'"'.$sep; |
|
| 237 | 237 | } else { |
| 238 | - print '"' . length_accountg($line->numero_compte) . '"' . $sep; |
|
| 239 | - print '"' . $object->get_compte_desc($line->numero_compte) . '"' . $sep; |
|
| 238 | + print '"'.length_accountg($line->numero_compte).'"'.$sep; |
|
| 239 | + print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep; |
|
| 240 | 240 | } |
| 241 | 241 | print '"'.price($line->debit).'"'.$sep; |
| 242 | 242 | print '"'.price($line->credit).'"'.$sep; |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; |
| 314 | 314 | |
| 315 | 315 | if (empty($reshook)) { |
| 316 | - $newcardbutton = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' (' . getDolGlobalString('ACCOUNTING_EXPORT_FORMAT').')" />'; |
|
| 316 | + $newcardbutton = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.getDolGlobalString('ACCOUNTING_EXPORT_FORMAT').')" />'; |
|
| 317 | 317 | |
| 318 | 318 | print '<script type="text/javascript"> |
| 319 | 319 | jQuery(document).ready(function() { |
@@ -328,14 +328,14 @@ discard block |
||
| 328 | 328 | </script>'; |
| 329 | 329 | |
| 330 | 330 | if ($type == 'sub') { |
| 331 | - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 332 | - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 331 | + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 332 | + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?type=sub'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 333 | 333 | } else { |
| 334 | - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 335 | - $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/balance.php?type=sub' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 334 | + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 335 | + $newcardbutton .= dolGetButtonTitle($langs->trans('AccountBalance')." - ".$langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/balance.php?type=sub'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 336 | 336 | } |
| 337 | 337 | $newcardbutton .= dolGetButtonTitleSeparator(); |
| 338 | - $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); |
|
| 338 | + $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); |
|
| 339 | 339 | } |
| 340 | 340 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
| 341 | 341 | $param .= '&contextpage='.urlencode($contextpage); |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | // without time and class limits (Class 6 and 7 accounts ???) and does not take into account the "a-nouveau" journal. |
| 475 | 475 | if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { |
| 476 | 476 | $sql = "SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance"; |
| 477 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t"; |
|
| 478 | - $sql .= " WHERE t.entity = " . $conf->entity; // Never do sharing into accounting features |
|
| 479 | - $sql .= " AND t.doc_date < '" . $db->idate($search_date_start) . "'"; |
|
| 477 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as t"; |
|
| 478 | + $sql .= " WHERE t.entity = ".$conf->entity; // Never do sharing into accounting features |
|
| 479 | + $sql .= " AND t.doc_date < '".$db->idate($search_date_start)."'"; |
|
| 480 | 480 | $sql .= " GROUP BY t.numero_compte"; |
| 481 | 481 | |
| 482 | 482 | $resql = $db->query($sql); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | for ($i = 0; $i < $nrows; $i++) { |
| 487 | 487 | $arr = $db->fetch_array($resql); |
| 488 | 488 | if (is_array($arr)) { |
| 489 | - $opening_balances["'" . $arr['numero_compte'] . "'"] = $arr['opening_balance']; |
|
| 489 | + $opening_balances["'".$arr['numero_compte']."'"] = $arr['opening_balance']; |
|
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | 492 | } else { |
@@ -523,9 +523,9 @@ discard block |
||
| 523 | 523 | //var_dump($accounting_account); |
| 524 | 524 | //var_dump($accountingaccountstatic); |
| 525 | 525 | if (empty($accountingaccountstatic->label) && $accountingaccountstatic->id > 0) { |
| 526 | - $link = '<a class="editfielda reposition" href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=update&token=' . newToken() . '&id=' . $accountingaccountstatic->id . '">' . img_edit() . '</a>'; |
|
| 526 | + $link = '<a class="editfielda reposition" href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=update&token='.newToken().'&id='.$accountingaccountstatic->id.'">'.img_edit().'</a>'; |
|
| 527 | 527 | } elseif ($accounting_account == 'NotDefined') { |
| 528 | - $link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=create&token=' . newToken() . '&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>'; |
|
| 528 | + $link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&token='.newToken().'&accountingaccount='.length_accountg($line->numero_compte).'">'.img_edit_add().'</a>'; |
|
| 529 | 529 | } /* elseif (empty($tmparrayforrootaccount['label'])) { |
| 530 | 530 | // $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent. |
| 531 | 531 | // This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent. |
@@ -601,22 +601,22 @@ discard block |
||
| 601 | 601 | $urlzoom = ''; |
| 602 | 602 | if ($type == 'sub') { |
| 603 | 603 | if ($line->subledger_account) { |
| 604 | - $urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start=' . urlencode($line->subledger_account) . '&search_accountancy_code_end=' . urlencode($line->subledger_account); |
|
| 604 | + $urlzoom = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start='.urlencode($line->subledger_account).'&search_accountancy_code_end='.urlencode($line->subledger_account); |
|
| 605 | 605 | if (GETPOSTISSET('date_startmonth')) { |
| 606 | - $urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear'); |
|
| 606 | + $urlzoom .= '&search_date_startmonth='.GETPOSTINT('date_startmonth').'&search_date_startday='.GETPOSTINT('date_startday').'&search_date_startyear='.GETPOSTINT('date_startyear'); |
|
| 607 | 607 | } |
| 608 | 608 | if (GETPOSTISSET('date_endmonth')) { |
| 609 | - $urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear'); |
|
| 609 | + $urlzoom .= '&search_date_endmonth='.GETPOSTINT('date_endmonth').'&search_date_endday='.GETPOSTINT('date_endday').'&search_date_endyear='.GETPOSTINT('date_endyear'); |
|
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | } else { |
| 613 | 613 | if ($line->numero_compte) { |
| 614 | - $urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($line->numero_compte) . '&search_accountancy_code_end=' . urlencode($line->numero_compte); |
|
| 614 | + $urlzoom = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($line->numero_compte).'&search_accountancy_code_end='.urlencode($line->numero_compte); |
|
| 615 | 615 | if (GETPOSTISSET('date_startmonth')) { |
| 616 | - $urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear'); |
|
| 616 | + $urlzoom .= '&search_date_startmonth='.GETPOSTINT('date_startmonth').'&search_date_startday='.GETPOSTINT('date_startday').'&search_date_startyear='.GETPOSTINT('date_startyear'); |
|
| 617 | 617 | } |
| 618 | 618 | if (GETPOSTISSET('date_endmonth')) { |
| 619 | - $urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear'); |
|
| 619 | + $urlzoom .= '&search_date_endmonth='.GETPOSTINT('date_endmonth').'&search_date_endday='.GETPOSTINT('date_endday').'&search_date_endyear='.GETPOSTINT('date_endyear'); |
|
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | } |
@@ -659,9 +659,9 @@ discard block |
||
| 659 | 659 | print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit, 'MT')).'</td>'; |
| 660 | 660 | print '<td class="right nowraponall amount">'.price(price2num($sous_total_credit, 'MT')).'</td>'; |
| 661 | 661 | if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { |
| 662 | - print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>'; |
|
| 662 | + print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')).'</td>'; |
|
| 663 | 663 | } else { |
| 664 | - print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>'; |
|
| 664 | + print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit - $sous_total_credit, 'MT')).'</td>'; |
|
| 665 | 665 | } |
| 666 | 666 | // Action column |
| 667 | 667 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -682,9 +682,9 @@ discard block |
||
| 682 | 682 | print '<td class="right nowraponall amount">'.price(price2num($total_debit, 'MT')).'</td>'; |
| 683 | 683 | print '<td class="right nowraponall amount">'.price(price2num($total_credit, 'MT')).'</td>'; |
| 684 | 684 | if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { |
| 685 | - print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>'; |
|
| 685 | + print '<td class="right nowraponall amount">'.price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')).'</td>'; |
|
| 686 | 686 | } else { |
| 687 | - print '<td class="right nowraponall amount">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>'; |
|
| 687 | + print '<td class="right nowraponall amount">'.price(price2num($total_debit - $total_credit, 'MT')).'</td>'; |
|
| 688 | 688 | } |
| 689 | 689 | // Action column |
| 690 | 690 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 699 | 699 | print "<td></td>\n"; |
| 700 | 700 | } |
| 701 | - print '<td class="right">' . $langs->trans("AccountingResult") . ':</td>'; |
|
| 701 | + print '<td class="right">'.$langs->trans("AccountingResult").':</td>'; |
|
| 702 | 702 | if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { |
| 703 | 703 | print '<td></td>'; |
| 704 | 704 | } |
@@ -713,8 +713,8 @@ discard block |
||
| 713 | 713 | $accountingResultCredit = price(price2num($accountingResult, 'MT')); |
| 714 | 714 | $accountingResultClassCSS = ' green'; |
| 715 | 715 | } |
| 716 | - print '<td class="right nowraponall amount' . $accountingResultClassCSS . '">' . $accountingResultDebit . '</td>'; |
|
| 717 | - print '<td class="right nowraponall amount' . $accountingResultClassCSS . '">' . $accountingResultCredit . '</td>'; |
|
| 716 | + print '<td class="right nowraponall amount'.$accountingResultClassCSS.'">'.$accountingResultDebit.'</td>'; |
|
| 717 | + print '<td class="right nowraponall amount'.$accountingResultClassCSS.'">'.$accountingResultCredit.'</td>'; |
|
| 718 | 718 | |
| 719 | 719 | print '<td></td>'; |
| 720 | 720 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $id = GETPOSTINT('id'); // id of record |
| 64 | 64 | $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp' |
| 65 | -$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id) |
|
| 65 | +$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id) |
|
| 66 | 66 | |
| 67 | 67 | $accountingaccount = new AccountingAccount($db); |
| 68 | 68 | $accountingjournal = new AccountingJournal($db); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $error = 0; |
| 128 | 128 | |
| 129 | 129 | if ($cancel) { |
| 130 | - header("Location: ". $backtopage . (!empty($type)?'?type=sub':'')); |
|
| 130 | + header("Location: ".$backtopage.(!empty($type) ? '?type=sub' : '')); |
|
| 131 | 131 | exit; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) { |
| 202 | 202 | $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
| 203 | 203 | } else { |
| 204 | - $datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year |
|
| 204 | + $datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | $object = new BookKeeping($db); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | if ($result < 0) { |
| 361 | 361 | setEventMessages($object->error, $object->errors, 'errors'); |
| 362 | 362 | } else { |
| 363 | - header("Location: " . $backtopage . "?sortfield=t.piece_num&sortorder=asc" . ($type ? '&type='.$type : '')); |
|
| 363 | + header("Location: ".$backtopage."?sortfield=t.piece_num&sortorder=asc".($type ? '&type='.$type : '')); |
|
| 364 | 364 | exit; |
| 365 | 365 | } |
| 366 | 366 | } |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | // Due date (if invoice) |
| 686 | 686 | //if (in_array($object->doc_type, array('customer_invoice', 'supplier_invoice'))) { |
| 687 | 687 | print '<tr>'; |
| 688 | - print '<td class="titlefield">' . $form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")) . '</td>'; |
|
| 688 | + print '<td class="titlefield">'.$form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")).'</td>'; |
|
| 689 | 689 | print '<td>'; |
| 690 | 690 | print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : ' '; |
| 691 | 691 | print '</td>'; |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | if ($mode != "_tmp") { |
| 697 | 697 | // Date document export |
| 698 | 698 | print '<tr>'; |
| 699 | - print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>'; |
|
| 699 | + print '<td class="titlefield">'.$langs->trans("DateExport").'</td>'; |
|
| 700 | 700 | print '<td>'; |
| 701 | 701 | print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; |
| 702 | 702 | print '</td>'; |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | |
| 705 | 705 | // Date document validation |
| 706 | 706 | print '<tr>'; |
| 707 | - print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>'; |
|
| 707 | + print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>'; |
|
| 708 | 708 | print '<td>'; |
| 709 | 709 | print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; |
| 710 | 710 | print '</td>'; |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | // Id_import |
| 714 | 714 | if (!empty($object->import_key)) { |
| 715 | 715 | print '<tr>'; |
| 716 | - print '<td class="titlefield">' . $langs->trans("ImportId") . '</td>'; |
|
| 716 | + print '<td class="titlefield">'.$langs->trans("ImportId").'</td>'; |
|
| 717 | 717 | print '<td>'; |
| 718 | 718 | print $object->import_key; |
| 719 | 719 | print '</td>'; |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | print dol_get_fiche_end(); |
| 773 | 773 | |
| 774 | 774 | |
| 775 | - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
| 775 | + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
| 776 | 776 | |
| 777 | 777 | if ($result < 0) { |
| 778 | 778 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -902,14 +902,14 @@ discard block |
||
| 902 | 902 | if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { |
| 903 | 903 | print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); |
| 904 | 904 | } else { |
| 905 | - print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">'; |
|
| 905 | + print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; |
|
| 906 | 906 | } |
| 907 | - print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">'; |
|
| 907 | + print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; |
|
| 908 | 908 | print '</td>'; |
| 909 | - print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>'; |
|
| 909 | + print '<td><input type="text" class="minwidth200" name="label_operation" value="'.dol_escape_htmltag($label_operation).'"/></td>'; |
|
| 910 | 910 | print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>'; |
| 911 | 911 | print '<td class="right"><input type="text" class="right width50" name="credit" value=""/></td>'; |
| 912 | - print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>'; |
|
| 912 | + print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>'; |
|
| 913 | 913 | print "</tr>\n"; |
| 914 | 914 | } |
| 915 | 915 | } else { |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | print '<td class="center nowraponall">'; |
| 936 | 936 | if ($permissiontoadd) { |
| 937 | 937 | if (empty($line->date_export) && empty($line->date_validation)) { |
| 938 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
| 938 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
| 939 | 939 | print img_edit('', 0, 'class="marginrightonly"'); |
| 940 | 940 | print '</a> '; |
| 941 | 941 | } else { |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | $actiontodelete = 'confirm_delete'; |
| 951 | 951 | } |
| 952 | 952 | |
| 953 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
| 953 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
| 954 | 954 | print img_delete(); |
| 955 | 955 | print '</a>'; |
| 956 | 956 | } else { |
@@ -980,13 +980,13 @@ discard block |
||
| 980 | 980 | if (empty($total_debit) && empty($total_credit)) { |
| 981 | 981 | print '<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans("EnterNonEmptyLinesFirst")).'" value="'.dol_escape_htmltag($langs->trans("ValidTransaction")).'">'; |
| 982 | 982 | } elseif ($total_debit == $total_credit) { |
| 983 | - print '<a class="button" href="'.$_SERVER["PHP_SELF"].'?piece_num='.((int) $object->piece_num).(!empty($type)?'&type=sub':'').'&backtopage='.urlencode($backtopage).'&action=valid&token='.newToken().'">'.$langs->trans("ValidTransaction").'</a>'; |
|
| 983 | + print '<a class="button" href="'.$_SERVER["PHP_SELF"].'?piece_num='.((int) $object->piece_num).(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($backtopage).'&action=valid&token='.newToken().'">'.$langs->trans("ValidTransaction").'</a>'; |
|
| 984 | 984 | } else { |
| 985 | 985 | print '<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans("MvtNotCorrectlyBalanced", $total_debit, $total_credit)).'" value="'.dol_escape_htmltag($langs->trans("ValidTransaction")).'">'; |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | 988 | print ' '; |
| 989 | - print '<a class="button button-cancel" href="'.$backtopage.(!empty($type)?'?type=sub':'').'">'.$langs->trans("Cancel").'</a>'; |
|
| 989 | + print '<a class="button button-cancel" href="'.$backtopage.(!empty($type) ? '?type=sub' : '').'">'.$langs->trans("Cancel").'</a>'; |
|
| 990 | 990 | |
| 991 | 991 | print "</div>"; |
| 992 | 992 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | if (empty($doactionsthenredirect)) { |
| 252 | 252 | $head = ''; |
| 253 | 253 | if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) { |
| 254 | - $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
| 254 | + $head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | $conf->dol_hide_topmenu = 1; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | } |
| 302 | 302 | if (getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT')) { |
| 303 | 303 | print '<div class="backimagepublicpayment">'; |
| 304 | - print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="' . getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">'; |
|
| 304 | + print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="'.getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">'; |
|
| 305 | 305 | print '</div>'; |
| 306 | 306 | } |
| 307 | 307 | |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | // Redirect to an error page |
| 344 | 344 | // Paymentko page must be created for the specific website |
| 345 | 345 | if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) { |
| 346 | - $ext_urlko = $ws_virtuelhost . '/paymentko.php?fulltag='.$FULLTAG; |
|
| 346 | + $ext_urlko = $ws_virtuelhost.'/paymentko.php?fulltag='.$FULLTAG; |
|
| 347 | 347 | } else { |
| 348 | 348 | $ext_urlko = DOL_URL_ROOT.'/public/website/index.php?website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG; |
| 349 | 349 | } |