@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | const KEY_ID = 0; |
| 145 | 145 | const KEY_LABEL = 1; |
| 146 | - const KEY_TYPE = 2; // deprecated |
|
| 146 | + const KEY_TYPE = 2; // deprecated |
|
| 147 | 147 | const KEY_DEFAULT = 3; |
| 148 | 148 | const KEY_FIRST_LEVEL = 4; |
| 149 | 149 | const KEY_SECOND_LEVEL = 5; |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | $moduleNameInConf = 'supplier_proposal'; |
| 730 | 730 | } |
| 731 | 731 | |
| 732 | - unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
| 732 | + unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
| 733 | 733 | |
| 734 | 734 | return 1; |
| 735 | 735 | } else { |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | $pathoffile = $this->getDescLongReadmeFound(); |
| 826 | 826 | |
| 827 | 827 | if ($pathoffile) { // Mostly for external modules |
| 828 | - $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
|
| 828 | + $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
|
| 829 | 829 | |
| 830 | 830 | if ((float) DOL_VERSION >= 6.0) { // @phpstan-ignore-line |
| 831 | 831 | @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; |
@@ -1589,7 +1589,7 @@ discard block |
||
| 1589 | 1589 | |
| 1590 | 1590 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def"; |
| 1591 | 1591 | $sql .= " WHERE file = '".$this->db->escape($file)."'"; |
| 1592 | - $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
| 1592 | + $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
| 1593 | 1593 | |
| 1594 | 1594 | dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); |
| 1595 | 1595 | $resql = $this->db->query($sql); |
@@ -1612,9 +1612,9 @@ discard block |
||
| 1612 | 1612 | public function insert_cronjobs() |
| 1613 | 1613 | { |
| 1614 | 1614 | // phpcs:enable |
| 1615 | - include_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; |
|
| 1616 | - include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php'; |
|
| 1617 | - include_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 1615 | + include_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; |
|
| 1616 | + include_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php'; |
|
| 1617 | + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 1618 | 1618 | |
| 1619 | 1619 | global $conf, $user; |
| 1620 | 1620 | |
@@ -1625,7 +1625,7 @@ discard block |
||
| 1625 | 1625 | $err = 0; |
| 1626 | 1626 | |
| 1627 | 1627 | if (is_array($this->cronjobs)) { |
| 1628 | - dol_syslog(get_class($this) . "::insert_cronjobs", LOG_DEBUG); |
|
| 1628 | + dol_syslog(get_class($this)."::insert_cronjobs", LOG_DEBUG); |
|
| 1629 | 1629 | |
| 1630 | 1630 | foreach ($this->cronjobs as $key => $value) { |
| 1631 | 1631 | $now = dol_now(); |
@@ -1652,7 +1652,7 @@ discard block |
||
| 1652 | 1652 | $test = isset($value['test']) ? $value['test'] : ''; // Line must be enabled or not (so visible or not) |
| 1653 | 1653 | |
| 1654 | 1654 | // Search if cron entry already present |
| 1655 | - $sql = "SELECT count(*) as nb FROM " . MAIN_DB_PREFIX . "cronjob"; |
|
| 1655 | + $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; |
|
| 1656 | 1656 | //$sql .= " WHERE module_name = '" . $this->db->escape(empty($this->rights_class) ? strtolower($this->name) : $this->rights_class) . "'"; |
| 1657 | 1657 | $sql .= " WHERE label = '".$this->db->escape($label)."'"; |
| 1658 | 1658 | /* unique key is on label,entity so no need for this test |
@@ -1672,7 +1672,7 @@ discard block |
||
| 1672 | 1672 | $sql .= " AND params = '" . $this->db->escape($params) . "'"; |
| 1673 | 1673 | } |
| 1674 | 1674 | */ |
| 1675 | - $sql .= " AND entity = " . ((int) $entity); // Must be exact entity |
|
| 1675 | + $sql .= " AND entity = ".((int) $entity); // Must be exact entity |
|
| 1676 | 1676 | |
| 1677 | 1677 | $result = $this->db->query($sql); |
| 1678 | 1678 | if (!$result) { |
@@ -1992,9 +1992,9 @@ discard block |
||
| 1992 | 1992 | |
| 1993 | 1993 | // If the module is active |
| 1994 | 1994 | foreach ($this->rights as $key => $value) { |
| 1995 | - $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
| 1995 | + $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
| 1996 | 1996 | $r_label = $this->rights[$key][self::KEY_LABEL]; |
| 1997 | - $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
| 1997 | + $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
| 1998 | 1998 | $r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0; |
| 1999 | 1999 | $r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? ''; |
| 2000 | 2000 | $r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? ''; |
@@ -2022,7 +2022,7 @@ discard block |
||
| 2022 | 2022 | } |
| 2023 | 2023 | |
| 2024 | 2024 | // condition to show or hide a user right (default: 1) (eg isModEnabled('anothermodule') or ($conf->global->MAIN_FEATURES_LEVEL > 0) or etc..) |
| 2025 | - $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1'; |
|
| 2025 | + $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1'; |
|
| 2026 | 2026 | |
| 2027 | 2027 | // Search if perm already present |
| 2028 | 2028 | $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def"; |
@@ -2039,10 +2039,10 @@ discard block |
||
| 2039 | 2039 | $sql .= ", libelle"; |
| 2040 | 2040 | $sql .= ", module"; |
| 2041 | 2041 | $sql .= ", module_origin"; |
| 2042 | - $sql .= ", module_position"; // Not that module_position can be fixed eynamically when accessing page user/perms.php |
|
| 2042 | + $sql .= ", module_position"; // Not that module_position can be fixed eynamically when accessing page user/perms.php |
|
| 2043 | 2043 | $sql .= ", family"; |
| 2044 | 2044 | $sql .= ", family_position"; |
| 2045 | - $sql .= ", type"; // Not used yet |
|
| 2045 | + $sql .= ", type"; // Not used yet |
|
| 2046 | 2046 | $sql .= ", bydefault"; |
| 2047 | 2047 | $sql .= ", perms"; |
| 2048 | 2048 | $sql .= ", subperms"; |
@@ -2056,7 +2056,7 @@ discard block |
||
| 2056 | 2056 | $sql .= ", '".$this->db->escape((string) $r_module_position)."'"; |
| 2057 | 2057 | $sql .= ", '".$this->db->escape($r_family)."'"; |
| 2058 | 2058 | $sql .= ", '".$this->db->escape((string) $r_family_position)."'"; |
| 2059 | - $sql .= ", '".$this->db->escape($r_type)."'"; // Not used yet |
|
| 2059 | + $sql .= ", '".$this->db->escape($r_type)."'"; // Not used yet |
|
| 2060 | 2060 | $sql .= ", ".((int) $r_default); |
| 2061 | 2061 | $sql .= ", '".$this->db->escape($r_perms)."'"; |
| 2062 | 2062 | $sql .= ", '".$this->db->escape($r_subperms)."'"; |
@@ -2278,7 +2278,7 @@ discard block |
||
| 2278 | 2278 | |
| 2279 | 2279 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; |
| 2280 | 2280 | $sql .= " WHERE module = '".$this->db->escape($module)."'"; |
| 2281 | - $sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria' |
|
| 2281 | + $sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria' |
|
| 2282 | 2282 | $sql .= " AND entity IN (0, ".$conf->entity.")"; |
| 2283 | 2283 | |
| 2284 | 2284 | dol_syslog(get_class($this)."::delete_menus", LOG_DEBUG); |
@@ -2462,7 +2462,7 @@ discard block |
||
| 2462 | 2462 | dol_delete_file($dest.'.zip'); |
| 2463 | 2463 | |
| 2464 | 2464 | // Compress it |
| 2465 | - global $errormsg; // Used by dol_compress_dir |
|
| 2465 | + global $errormsg; // Used by dol_compress_dir |
|
| 2466 | 2466 | $errormsg = ''; |
| 2467 | 2467 | $result = dol_compress_dir($src, $dest.'.zip', 'zip'); |
| 2468 | 2468 | if ($result < 0) { |
@@ -2662,36 +2662,36 @@ discard block |
||
| 2662 | 2662 | } |
| 2663 | 2663 | |
| 2664 | 2664 | if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { |
| 2665 | - $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
| 2665 | + $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
| 2666 | 2666 | if ($this->needUpdate) { |
| 2667 | 2667 | $versionTitle .= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; |
| 2668 | 2668 | } |
| 2669 | 2669 | |
| 2670 | - $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
| 2671 | - $return .= $this->getVersion(1); |
|
| 2672 | - $return .= '</span>'; |
|
| 2670 | + $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
| 2671 | + $return .= $this->getVersion(1); |
|
| 2672 | + $return .= '</span>'; |
|
| 2673 | 2673 | } |
| 2674 | 2674 | |
| 2675 | - $return .= '</div> |
|
| 2675 | + $return .= '</div> |
|
| 2676 | 2676 | <div class="info-box-content info-box-text-module'.(!getDolGlobalString($const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'"> |
| 2677 | 2677 | <span class="info-box-title">'.$this->getName().'</span> |
| 2678 | 2678 | <span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>'; |
| 2679 | 2679 | |
| 2680 | - $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
| 2680 | + $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
| 2681 | 2681 | //if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' '; |
| 2682 | - $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>'; |
|
| 2683 | - $return .= '</div><br>'; |
|
| 2684 | - |
|
| 2685 | - $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
| 2686 | - $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
| 2687 | - $return .= $codetoconfig; |
|
| 2688 | - $return .= '</div>'; |
|
| 2689 | - $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
| 2690 | - $return .= $codeenabledisable; |
|
| 2691 | - $return .= '</div>'; |
|
| 2692 | - $return .= '</div>'; |
|
| 2693 | - |
|
| 2694 | - $return .= ' |
|
| 2682 | + $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>'; |
|
| 2683 | + $return .= '</div><br>'; |
|
| 2684 | + |
|
| 2685 | + $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
| 2686 | + $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
| 2687 | + $return .= $codetoconfig; |
|
| 2688 | + $return .= '</div>'; |
|
| 2689 | + $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
| 2690 | + $return .= $codeenabledisable; |
|
| 2691 | + $return .= '</div>'; |
|
| 2692 | + $return .= '</div>'; |
|
| 2693 | + |
|
| 2694 | + $return .= ' |
|
| 2695 | 2695 | </div><!-- /.info-box-content --> |
| 2696 | 2696 | </div><!-- /.info-box --> |
| 2697 | 2697 | </div>'; |
@@ -2711,7 +2711,7 @@ discard block |
||
| 2711 | 2711 | { |
| 2712 | 2712 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
| 2713 | 2713 | if (!empty($this->url_last_version)) { |
| 2714 | - $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2714 | + $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2715 | 2715 | if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) { |
| 2716 | 2716 | // Security warning : be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . - |
| 2717 | 2717 | $this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']); |
@@ -2748,7 +2748,7 @@ discard block |
||
| 2748 | 2748 | if (empty($conf->cache['noncompliantmodules'])) { |
| 2749 | 2749 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
| 2750 | 2750 | |
| 2751 | - $result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2751 | + $result = getURLContent(self::URL_FOR_BLACKLISTED_MODULES, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
| 2752 | 2752 | if (isset($result['content']) && $result['http_code'] == 200) { |
| 2753 | 2753 | $langs->load("errors"); |
| 2754 | 2754 | |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // General $Variables |
| 94 | -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 94 | +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 95 | 95 | $ref = GETPOST('ref', 'alpha'); |
| 96 | 96 | $socid = GETPOSTINT('socid'); |
| 97 | 97 | $action = GETPOST('action', 'aZ09'); |
| 98 | 98 | $confirm = GETPOST('confirm', 'alpha'); |
| 99 | 99 | $cancel = GETPOST('cancel', 'alpha'); |
| 100 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 101 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 100 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 101 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 102 | 102 | $lineid = GETPOSTINT('lineid'); |
| 103 | 103 | $origin = GETPOST('origin', 'alpha'); |
| 104 | 104 | $originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | setEventMessages('', $warningMsgLineList, 'warnings'); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result); |
|
| 270 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result); |
|
| 271 | 271 | exit(); |
| 272 | 272 | } else { |
| 273 | 273 | $langs->load("errors"); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | // Validation |
| 393 | 393 | $object->fetch($id); |
| 394 | 394 | |
| 395 | - if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 395 | + if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 396 | 396 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
| 397 | 397 | ) { |
| 398 | 398 | $object->date = dol_now(); |
@@ -834,8 +834,8 @@ discard block |
||
| 834 | 834 | // We check if invoice has payments |
| 835 | 835 | $totalpaid = 0; |
| 836 | 836 | $sql = 'SELECT pf.amount'; |
| 837 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiement_facture as pf'; |
|
| 838 | - $sql .= ' WHERE pf.fk_facture = ' . ((int) $object->id); |
|
| 837 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; |
|
| 838 | + $sql .= ' WHERE pf.fk_facture = '.((int) $object->id); |
|
| 839 | 839 | |
| 840 | 840 | $result = $db->query($sql); |
| 841 | 841 | if ($result) { |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | $tempTva->datev = $object->date; |
| 912 | 912 | $tempTva->datep = $object->date; |
| 913 | 913 | $tempTva->amount = $amount; |
| 914 | - $tempTva->label = $langs->trans('WithholdingTax') . ' - ' . $object->ref; |
|
| 914 | + $tempTva->label = $langs->trans('WithholdingTax').' - '.$object->ref; |
|
| 915 | 915 | //$tempTva->paye = 1; |
| 916 | 916 | $valid = $tempTva->getIdForLabel($tempTva->label); |
| 917 | 917 | if (!$valid) { |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | if ($result < 0) { |
| 940 | 940 | setEventMessages($object->error, $object->errors, 'errors'); |
| 941 | 941 | } else { |
| 942 | - $object->fetch($object->id); // Reload properties |
|
| 942 | + $object->fetch($object->id); // Reload properties |
|
| 943 | 943 | } |
| 944 | 944 | } |
| 945 | 945 | } else { |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | if ($result < 0) { |
| 956 | 956 | setEventMessages($object->error, $object->errors, 'errors'); |
| 957 | 957 | } else { |
| 958 | - $object->fetch($object->id); // Reload properties |
|
| 958 | + $object->fetch($object->id); // Reload properties |
|
| 959 | 959 | } |
| 960 | 960 | } else { |
| 961 | 961 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | // Set invoice as paid |
| 1157 | 1157 | $result = $object->setPaid($user); |
| 1158 | 1158 | if ($result >= 0) { |
| 1159 | - $object->fetch($object->id); // Reload properties |
|
| 1159 | + $object->fetch($object->id); // Reload properties |
|
| 1160 | 1160 | $db->commit(); |
| 1161 | 1161 | } else { |
| 1162 | 1162 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | $error++; |
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1210 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1211 | 1211 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
| 1212 | 1212 | |
| 1213 | 1213 | // Replacement invoice |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1240 | 1240 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1241 | 1241 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1242 | - $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1242 | + $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1243 | 1243 | $object->fk_project = GETPOSTINT('projectid'); |
| 1244 | 1244 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
| 1245 | 1245 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
@@ -1300,9 +1300,9 @@ discard block |
||
| 1300 | 1300 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1301 | 1301 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1302 | 1302 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1303 | - $object->model_pdf = GETPOST('model'); |
|
| 1303 | + $object->model_pdf = GETPOST('model'); |
|
| 1304 | 1304 | $object->fk_project = GETPOSTINT('projectid'); |
| 1305 | - $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1305 | + $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1306 | 1306 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
| 1307 | 1307 | $object->fk_account = GETPOSTINT('fk_account'); |
| 1308 | 1308 | //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | $object->note_public = trim(GETPOST('note_public', 'restricthtml')); |
| 1630 | 1630 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1631 | 1631 | $object->ref_client = GETPOST('ref_client'); |
| 1632 | - $object->ref_customer = GETPOST('ref_client'); |
|
| 1632 | + $object->ref_customer = GETPOST('ref_client'); |
|
| 1633 | 1633 | $object->model_pdf = GETPOST('model'); |
| 1634 | 1634 | $object->fk_project = GETPOSTINT('projectid'); |
| 1635 | 1635 | $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | $element = $subelement = 'expedition'; |
| 1694 | 1694 | } |
| 1695 | 1695 | |
| 1696 | - $object->origin = $origin; // deprecated |
|
| 1696 | + $object->origin = $origin; // deprecated |
|
| 1697 | 1697 | $object->origin_type = $origin; |
| 1698 | 1698 | $object->origin_id = $originid; |
| 1699 | 1699 | |
@@ -1728,7 +1728,7 @@ discard block |
||
| 1728 | 1728 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines"); |
| 1729 | 1729 | $result = $srcobject->fetch($object->origin_id); |
| 1730 | 1730 | |
| 1731 | - $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
| 1731 | + $i = -1; // Ensure initialised for static analysis, but with invalid idx. |
|
| 1732 | 1732 | // If deposit invoice - down payment with 1 line (fixed amount or percent) |
| 1733 | 1733 | if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) { |
| 1734 | 1734 | // Define the array $amountdeposit |
@@ -2153,7 +2153,7 @@ discard block |
||
| 2153 | 2153 | if (!empty($origin) && !empty($originid)) { |
| 2154 | 2154 | include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; |
| 2155 | 2155 | |
| 2156 | - $object->origin = $origin; // deprecated |
|
| 2156 | + $object->origin = $origin; // deprecated |
|
| 2157 | 2157 | $object->origin_type = $origin; |
| 2158 | 2158 | $object->origin_id = $originid; |
| 2159 | 2159 | |
@@ -2179,7 +2179,7 @@ discard block |
||
| 2179 | 2179 | $line->fk_prev_id = $line->id; |
| 2180 | 2180 | $line->fetch_optionals(); |
| 2181 | 2181 | if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { |
| 2182 | - $line->situation_percent = 0; // New situation percent must be 0 (No cumulative) |
|
| 2182 | + $line->situation_percent = 0; // New situation percent must be 0 (No cumulative) |
|
| 2183 | 2183 | } else { |
| 2184 | 2184 | $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note |
| 2185 | 2185 | } |
@@ -2296,7 +2296,7 @@ discard block |
||
| 2296 | 2296 | } else { |
| 2297 | 2297 | $db->rollback(); |
| 2298 | 2298 | $action = 'create'; |
| 2299 | - $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2299 | + $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2300 | 2300 | $_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ? |
| 2301 | 2301 | setEventMessages($object->error, $object->errors, 'errors'); |
| 2302 | 2302 | } |
@@ -2762,7 +2762,7 @@ discard block |
||
| 2762 | 2762 | */ |
| 2763 | 2763 | |
| 2764 | 2764 | // Margin |
| 2765 | - $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 2765 | + $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 2766 | 2766 | $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value |
| 2767 | 2767 | |
| 2768 | 2768 | |
@@ -2900,7 +2900,7 @@ discard block |
||
| 2900 | 2900 | if ($prod->price_min > $line->subprice) { |
| 2901 | 2901 | $price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto'); |
| 2902 | 2902 | $price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto'); |
| 2903 | - setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings'); |
|
| 2903 | + setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); |
|
| 2904 | 2904 | } else { |
| 2905 | 2905 | setEventMessages($prod->error, $prod->errors, 'errors'); |
| 2906 | 2906 | } |
@@ -3051,7 +3051,7 @@ discard block |
||
| 3051 | 3051 | $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); |
| 3052 | 3052 | |
| 3053 | 3053 | // Add buying price |
| 3054 | - $fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 3054 | + $fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
| 3055 | 3055 | $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value |
| 3056 | 3056 | |
| 3057 | 3057 | // Prepare a price equivalent for minimum price check |
@@ -3094,7 +3094,7 @@ discard block |
||
| 3094 | 3094 | // Define special_code for special lines |
| 3095 | 3095 | $special_code = GETPOSTINT('special_code'); |
| 3096 | 3096 | if ($special_code == 3) { |
| 3097 | - $special_code = 0; // Options should not exists on invoices |
|
| 3097 | + $special_code = 0; // Options should not exists on invoices |
|
| 3098 | 3098 | } |
| 3099 | 3099 | |
| 3100 | 3100 | $line = new FactureLigne($db); |
@@ -3548,7 +3548,7 @@ discard block |
||
| 3548 | 3548 | |
| 3549 | 3549 | |
| 3550 | 3550 | if ($action == 'update_extras' && $permissiontoeditextra) { |
| 3551 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 3551 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 3552 | 3552 | |
| 3553 | 3553 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 3554 | 3554 | |
@@ -3664,13 +3664,13 @@ discard block |
||
| 3664 | 3664 | $mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
| 3665 | 3665 | $fk_account = GETPOSTINT('fk_account'); |
| 3666 | 3666 | |
| 3667 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 3667 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 3668 | 3668 | if (empty($dateinvoice)) { |
| 3669 | - $dateinvoice = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_INVOICE') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty. |
|
| 3669 | + $dateinvoice = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_INVOICE') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty. |
|
| 3670 | 3670 | } |
| 3671 | 3671 | |
| 3672 | 3672 | // Load objectsrc |
| 3673 | - $objectsrc = null; // Initialise |
|
| 3673 | + $objectsrc = null; // Initialise |
|
| 3674 | 3674 | //$remise_absolue = 0; |
| 3675 | 3675 | if (!empty($origin) && !empty($originid)) { |
| 3676 | 3676 | // Parse element/subelement (ex: project_task) |
@@ -3754,8 +3754,8 @@ discard block |
||
| 3754 | 3754 | $fk_account = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); |
| 3755 | 3755 | |
| 3756 | 3756 | if (isModEnabled('multicurrency')) { |
| 3757 | - $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3758 | - $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3757 | + $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3758 | + $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3759 | 3759 | } |
| 3760 | 3760 | |
| 3761 | 3761 | // replicate input reason |
@@ -3853,7 +3853,7 @@ discard block |
||
| 3853 | 3853 | print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">'; |
| 3854 | 3854 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 3855 | 3855 | print '<input type="hidden" name="action" id="formtocreateaction" value="add">'; |
| 3856 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3856 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3857 | 3857 | if ($soc->id > 0) { |
| 3858 | 3858 | print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; |
| 3859 | 3859 | } |
@@ -4042,7 +4042,7 @@ discard block |
||
| 4042 | 4042 | print $form->selectarray('typestandard', $arraylist, GETPOST('typestandard', 'aZ09'), 0, 0, 0, '', 1); |
| 4043 | 4043 | print '</td>';*/ |
| 4044 | 4044 | if (!getDolGlobalInt('INVOICE_DEPOSIT_INVOICE_ONLY_SAME_LINES')) { |
| 4045 | - print '<span class="opacitymedium marginleftonly">' . $langs->trans('PercentOfOriginalObject') . '</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="' . (GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%') . '"/>'; |
|
| 4045 | + print '<span class="opacitymedium marginleftonly">'.$langs->trans('PercentOfOriginalObject').'</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="'.(GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%').'"/>'; |
|
| 4046 | 4046 | } |
| 4047 | 4047 | } |
| 4048 | 4048 | print '</div></div>'."\n"; |
@@ -4397,8 +4397,8 @@ discard block |
||
| 4397 | 4397 | if ($socid > 0) { |
| 4398 | 4398 | print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">'; |
| 4399 | 4399 | |
| 4400 | - $thirdparty = $soc; // used by object_discounts.tpl.php |
|
| 4401 | - $discount_type = 0; // used by object_discounts.tpl.php |
|
| 4400 | + $thirdparty = $soc; // used by object_discounts.tpl.php |
|
| 4401 | + $discount_type = 0; // used by object_discounts.tpl.php |
|
| 4402 | 4402 | $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid'))); |
| 4403 | 4403 | |
| 4404 | 4404 | // loading object_discounts.tpl.php from module core/tpl if exists |
@@ -4458,7 +4458,7 @@ discard block |
||
| 4458 | 4458 | if (empty($retained_warranty)) { |
| 4459 | 4459 | if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value |
| 4460 | 4460 | // Facture->retained_warranty (does not exist on Expedition) |
| 4461 | - $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 4461 | + $retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 4462 | 4462 | } |
| 4463 | 4463 | } |
| 4464 | 4464 | $retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT'); |
@@ -4967,7 +4967,7 @@ discard block |
||
| 4967 | 4967 | $nbMandated = 0; |
| 4968 | 4968 | foreach ($object->lines as $line) { |
| 4969 | 4969 | $res = $line->fetch_product(); |
| 4970 | - if ($res > 0) { |
|
| 4970 | + if ($res > 0) { |
|
| 4971 | 4971 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 4972 | 4972 | $nbMandated++; |
| 4973 | 4973 | break; |
@@ -5210,7 +5210,7 @@ discard block |
||
| 5210 | 5210 | } |
| 5211 | 5211 | // Ref customer |
| 5212 | 5212 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string', '', 0, 1); |
| 5213 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 5213 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 5214 | 5214 | // Thirdparty |
| 5215 | 5215 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer'); |
| 5216 | 5216 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -5342,7 +5342,7 @@ discard block |
||
| 5342 | 5342 | print '</td><td class="valuefield fieldname_type">'; |
| 5343 | 5343 | print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="formposinfo">'; |
| 5344 | 5344 | print '<input type="hidden" name="action" value="setposinfo">'; |
| 5345 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5345 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5346 | 5346 | if ($action == 'editposinfo') { |
| 5347 | 5347 | print '<input type="text" class="maxwidth150" name="posmodule" placeholder="'.$langs->trans("POSModule").'" value="'.$object->module_source.'"> '; |
| 5348 | 5348 | print '<input type="text" class="maxwidth100" name="posterminal" placeholder="'.$langs->trans("Terminal").'" value="'.$object->pos_source.'">'; |
@@ -5705,45 +5705,45 @@ discard block |
||
| 5705 | 5705 | } |
| 5706 | 5706 | print '<tr>'; |
| 5707 | 5707 | // Amount HT |
| 5708 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 5709 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5708 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 5709 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5710 | 5710 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5711 | 5711 | // Multicurrency Amount HT |
| 5712 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5712 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5713 | 5713 | } |
| 5714 | 5714 | print '</tr>'; |
| 5715 | 5715 | |
| 5716 | 5716 | print '<tr>'; |
| 5717 | 5717 | // Amount VAT |
| 5718 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
| 5719 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5718 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
| 5719 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5720 | 5720 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5721 | 5721 | // Multicurrency Amount VAT |
| 5722 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5722 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5723 | 5723 | } |
| 5724 | 5724 | print '</tr>'; |
| 5725 | 5725 | |
| 5726 | 5726 | // Amount Local Taxes |
| 5727 | 5727 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { |
| 5728 | 5728 | print '<tr>'; |
| 5729 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 5730 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5729 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 5730 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5731 | 5731 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5732 | 5732 | $object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 5733 | 5733 | |
| 5734 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5734 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5735 | 5735 | } |
| 5736 | 5736 | print '</tr>'; |
| 5737 | 5737 | } |
| 5738 | 5738 | |
| 5739 | 5739 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { |
| 5740 | 5740 | print '<tr>'; |
| 5741 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 5742 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5741 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 5742 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5743 | 5743 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5744 | 5744 | $object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 5745 | 5745 | |
| 5746 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5746 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5747 | 5747 | } |
| 5748 | 5748 | print '</tr>'; |
| 5749 | 5749 | } |
@@ -5803,11 +5803,11 @@ discard block |
||
| 5803 | 5803 | |
| 5804 | 5804 | print '<tr>'; |
| 5805 | 5805 | // Amount TTC |
| 5806 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 5807 | - print '<td class="nowraponall amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5806 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 5807 | + print '<td class="nowraponall amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5808 | 5808 | if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
| 5809 | 5809 | // Multicurrency Amount TTC |
| 5810 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5810 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5811 | 5811 | } |
| 5812 | 5812 | print '</tr>'; |
| 5813 | 5813 | |
@@ -6101,7 +6101,7 @@ discard block |
||
| 6101 | 6101 | if ($object->type != Facture::TYPE_CREDIT_NOTE) { |
| 6102 | 6102 | // Total already paid |
| 6103 | 6103 | print '<tr>'; |
| 6104 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6104 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6105 | 6105 | print '<span class="opacitymedium">'; |
| 6106 | 6106 | if ($object->type != Facture::TYPE_DEPOSIT) { |
| 6107 | 6107 | print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); |
@@ -6183,7 +6183,7 @@ discard block |
||
| 6183 | 6183 | // Partially paid or abandoned 'badcustomer' |
| 6184 | 6184 | if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { |
| 6185 | 6185 | print '<tr>'; |
| 6186 | - print '<td colspan="'.($nbcols+1).'" class="nowrap right">'; |
|
| 6186 | + print '<td colspan="'.($nbcols + 1).'" class="nowrap right">'; |
|
| 6187 | 6187 | print '<span class="opacitymedium">'; |
| 6188 | 6188 | print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1); |
| 6189 | 6189 | print '</span>'; |
@@ -6198,7 +6198,7 @@ discard block |
||
| 6198 | 6198 | // Partially paid or abandoned 'product_returned' |
| 6199 | 6199 | if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { |
| 6200 | 6200 | print '<tr>'; |
| 6201 | - print '<td colspan="'.($nbcols+1).'" class="nowrap right">'; |
|
| 6201 | + print '<td colspan="'.($nbcols + 1).'" class="nowrap right">'; |
|
| 6202 | 6202 | print '<span class="opacitymedium">'; |
| 6203 | 6203 | print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1); |
| 6204 | 6204 | print '</span>'; |
@@ -6213,7 +6213,7 @@ discard block |
||
| 6213 | 6213 | // Partially paid or abandoned 'abandoned' |
| 6214 | 6214 | if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') { |
| 6215 | 6215 | print '<tr>'; |
| 6216 | - print '<td colspan="'.($nbcols+1).'" class="nowrap right">'; |
|
| 6216 | + print '<td colspan="'.($nbcols + 1).'" class="nowrap right">'; |
|
| 6217 | 6217 | $text = $langs->trans("HelpAbandonOther"); |
| 6218 | 6218 | if ($object->close_note) { |
| 6219 | 6219 | $text .= '<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note; |
@@ -6233,7 +6233,7 @@ discard block |
||
| 6233 | 6233 | |
| 6234 | 6234 | // Billed |
| 6235 | 6235 | print '<tr>'; |
| 6236 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6236 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6237 | 6237 | print '<span class="opacitymedium">'; |
| 6238 | 6238 | print $langs->trans("Billed"); |
| 6239 | 6239 | print '</td>'; |
@@ -6243,7 +6243,7 @@ discard block |
||
| 6243 | 6243 | |
| 6244 | 6244 | // Remainder to pay |
| 6245 | 6245 | print '<tr>'; |
| 6246 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6246 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6247 | 6247 | print '<span class="opacitymedium">'; |
| 6248 | 6248 | print $langs->trans('RemainderToPay'); |
| 6249 | 6249 | if ($resteapayeraffiche < 0) { |
@@ -6258,7 +6258,7 @@ discard block |
||
| 6258 | 6258 | // Remainder to pay Multicurrency |
| 6259 | 6259 | if (isModEnabled('multicurrency') && $object->multicurrency_code && ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)) { |
| 6260 | 6260 | print '<tr>'; |
| 6261 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6261 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6262 | 6262 | print '<span class="opacitymedium">'; |
| 6263 | 6263 | print $langs->trans('RemainderToPayMulticurrency'); |
| 6264 | 6264 | if ($resteapayeraffiche < 0) { |
@@ -6286,14 +6286,14 @@ discard block |
||
| 6286 | 6286 | $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty; |
| 6287 | 6287 | |
| 6288 | 6288 | print '<tr>'; |
| 6289 | - print '<td colspan="'.($nbcols+1).'" class="right">'.$langs->trans("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')).' :</td>'; |
|
| 6289 | + print '<td colspan="'.($nbcols + 1).'" class="right">'.$langs->trans("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')).' :</td>'; |
|
| 6290 | 6290 | //print '<td></td>'; |
| 6291 | 6291 | print '<td class="right">'.price($billedWithRetainedWarranty).'</td>'; |
| 6292 | 6292 | print '</tr>'; |
| 6293 | 6293 | |
| 6294 | 6294 | // retained warranty |
| 6295 | 6295 | print '<tr>'; |
| 6296 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6296 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6297 | 6297 | print $langs->trans("RetainedWarranty").' ('.$object->retained_warranty.'%)'; |
| 6298 | 6298 | print !empty($object->retained_warranty_date_limit) ? ' '.$langs->trans("ToPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; |
| 6299 | 6299 | print '</td>'; |
@@ -6308,7 +6308,7 @@ discard block |
||
| 6308 | 6308 | |
| 6309 | 6309 | // Total already paid back |
| 6310 | 6310 | print '<tr>'; |
| 6311 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6311 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6312 | 6312 | print '<span class="opacitymedium">'.$langs->trans('AlreadyPaidBack').'</span>'; |
| 6313 | 6313 | print '</td>'; |
| 6314 | 6314 | //print '<td></td>'; |
@@ -6317,13 +6317,13 @@ discard block |
||
| 6317 | 6317 | |
| 6318 | 6318 | // Billed |
| 6319 | 6319 | print '<tr>'; |
| 6320 | - print '<td colspan="'.($nbcols+1).'" class="right"><span class="opacitymedium">'.$langs->trans("Billed").'</span></td>'; |
|
| 6320 | + print '<td colspan="'.($nbcols + 1).'" class="right"><span class="opacitymedium">'.$langs->trans("Billed").'</span></td>'; |
|
| 6321 | 6321 | //print '<td></td>'; |
| 6322 | 6322 | print '<td class="right">'.price($sign * $object->total_ttc).'</td>'; |
| 6323 | 6323 | print '</tr>'; |
| 6324 | 6324 | |
| 6325 | 6325 | // Remainder to pay back |
| 6326 | - print '<tr><td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6326 | + print '<tr><td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6327 | 6327 | print '<span class="opacitymedium">'.$langs->trans('RemainderToPayBack'); |
| 6328 | 6328 | if ($resteapayeraffiche > 0) { |
| 6329 | 6329 | print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; |
@@ -6339,7 +6339,7 @@ discard block |
||
| 6339 | 6339 | // Remainder to pay back Multicurrency |
| 6340 | 6340 | if (isModEnabled('multicurrency') && (($object->multicurrency_code && $object->multicurrency_code != $conf->currency) || $object->multicurrency_tx != 1)) { |
| 6341 | 6341 | print '<tr>'; |
| 6342 | - print '<td colspan="'.($nbcols+1).'" class="right">'; |
|
| 6342 | + print '<td colspan="'.($nbcols + 1).'" class="right">'; |
|
| 6343 | 6343 | print '<span class="opacitymedium">'.$langs->trans('RemainderToPayBackMulticurrency'); |
| 6344 | 6344 | if ($resteapayeraffiche > 0) { |
| 6345 | 6345 | print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; |
@@ -6447,7 +6447,7 @@ discard block |
||
| 6447 | 6447 | if (isModEnabled('subtotals')) { |
| 6448 | 6448 | include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php'; |
| 6449 | 6449 | } else { |
| 6450 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
| 6450 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
| 6451 | 6451 | } |
| 6452 | 6452 | } |
| 6453 | 6453 | |
@@ -6510,10 +6510,10 @@ discard block |
||
| 6510 | 6510 | if (!$objectidnext && $object->is_last_in_cycle()) { |
| 6511 | 6511 | if ($usercanunvalidate) { |
| 6512 | 6512 | unset($params['attr']['title']); |
| 6513 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', true, $params); |
|
| 6513 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', true, $params); |
|
| 6514 | 6514 | } else { |
| 6515 | 6515 | $params['attr']['title'] = $langs->trans('NotEnoughPermissions'); |
| 6516 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', false, $params); |
|
| 6516 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', false, $params); |
|
| 6517 | 6517 | } |
| 6518 | 6518 | } elseif (!$object->is_last_in_cycle()) { |
| 6519 | 6519 | $params['attr']['title'] = $langs->trans('NotLastInCycle'); |
@@ -6554,7 +6554,7 @@ discard block |
||
| 6554 | 6554 | $langs->load("contracts"); |
| 6555 | 6555 | |
| 6556 | 6556 | if ($usercancreatecontract) { |
| 6557 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>'; |
|
| 6557 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>'; |
|
| 6558 | 6558 | } |
| 6559 | 6559 | } |
| 6560 | 6560 | } |
@@ -6805,7 +6805,7 @@ discard block |
||
| 6805 | 6805 | if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) |
| 6806 | 6806 | $enableDelete = false; |
| 6807 | 6807 | $deleteHref = '#'; |
| 6808 | - if ($isErasable > 0 && ! $objectidnext) { |
|
| 6808 | + if ($isErasable > 0 && !$objectidnext) { |
|
| 6809 | 6809 | $deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken(); |
| 6810 | 6810 | $enableDelete = true; |
| 6811 | 6811 | } |
@@ -49,29 +49,29 @@ discard block |
||
| 49 | 49 | * @var User $user |
| 50 | 50 | */ |
| 51 | 51 | |
| 52 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 53 | -require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; |
|
| 54 | -require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; |
|
| 55 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 56 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/sendings.lib.php'; |
|
| 57 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php'; |
|
| 58 | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 59 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
| 60 | -require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 61 | -require_once DOL_DOCUMENT_ROOT . '/product/stock/class/productlot.class.php'; |
|
| 62 | -require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; |
|
| 52 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 53 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; |
|
| 54 | +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; |
|
| 55 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 56 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; |
|
| 57 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; |
|
| 58 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 59 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
| 60 | +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 61 | +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; |
|
| 62 | +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; |
|
| 63 | 63 | if (isModEnabled("product") || isModEnabled("service")) { |
| 64 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 64 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 65 | 65 | } |
| 66 | 66 | if (isModEnabled("propal")) { |
| 67 | - require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; |
|
| 67 | + require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; |
|
| 68 | 68 | } |
| 69 | 69 | if (isModEnabled('productbatch')) { |
| 70 | - require_once DOL_DOCUMENT_ROOT . '/product/class/productbatch.class.php'; |
|
| 70 | + require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; |
|
| 71 | 71 | } |
| 72 | 72 | if (isModEnabled('project')) { |
| 73 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 74 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 73 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 74 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // Load translation files required by the page |
@@ -124,12 +124,12 @@ discard block |
||
| 124 | 124 | $extrafields->fetch_name_optionals_label($objectorder->table_element_line); |
| 125 | 125 | |
| 126 | 126 | // Load object. Make an object->fetch |
| 127 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
| 127 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once' |
|
| 128 | 128 | |
| 129 | 129 | // Permissions / Rights |
| 130 | -$usercanread = $user->hasRight("expedition", "lire"); |
|
| 131 | -$usercancreate = $user->hasRight("expedition", "creer"); |
|
| 132 | -$usercandelete = $user->hasRight("expedition", "supprimer"); |
|
| 130 | +$usercanread = $user->hasRight("expedition", "lire"); |
|
| 131 | +$usercancreate = $user->hasRight("expedition", "creer"); |
|
| 132 | +$usercandelete = $user->hasRight("expedition", "supprimer"); |
|
| 133 | 133 | |
| 134 | 134 | // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context |
| 135 | 135 | $hookmanager->initHooks(array('expeditioncard', 'globalcard')); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | -$upload_dir = $conf->expedition->dir_output . '/sending'; |
|
| 160 | +$upload_dir = $conf->expedition->dir_output.'/sending'; |
|
| 161 | 161 | |
| 162 | 162 | $editColspan = 0; |
| 163 | 163 | $objectsrc = null; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | if ($cancel) { |
| 208 | 208 | if ($origin_id > 0) { |
| 209 | 209 | if ($origin == 'commande') { |
| 210 | - header("Location: " . DOL_URL_ROOT . '/expedition/shipment.php?id=' . ((int) $origin_id)); |
|
| 210 | + header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.((int) $origin_id)); |
|
| 211 | 211 | exit; |
| 212 | 212 | } |
| 213 | 213 | } else { |
@@ -216,10 +216,10 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 219 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 220 | 220 | |
| 221 | 221 | // Actions to build doc |
| 222 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
| 222 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
| 223 | 223 | |
| 224 | 224 | // Back to draft |
| 225 | 225 | if ($action == 'setdraft' && $permissiontoadd) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | if ($result < 0) { |
| 229 | 229 | setEventMessages($object->error, $object->errors, 'errors'); |
| 230 | 230 | } else { |
| 231 | - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); |
|
| 231 | + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); |
|
| 232 | 232 | exit; |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | if ($result < 0) { |
| 240 | 240 | setEventMessages($object->error, $object->errors, 'errors'); |
| 241 | 241 | } else { |
| 242 | - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); |
|
| 242 | + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); |
|
| 243 | 243 | exit; |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | setEventMessages($object->error, $object->errors, 'errors'); |
| 261 | 261 | $action = 'editref_customer'; |
| 262 | 262 | } else { |
| 263 | - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); |
|
| 263 | + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); |
|
| 264 | 264 | exit; |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -398,16 +398,16 @@ discard block |
||
| 398 | 398 | $product_batch_used = array(); |
| 399 | 399 | |
| 400 | 400 | for ($i = 0; $i < $num; $i++) { |
| 401 | - $idl = "idl" . $i; |
|
| 401 | + $idl = "idl".$i; |
|
| 402 | 402 | |
| 403 | 403 | $sub_qty = array(); |
| 404 | 404 | $subtotalqty = 0; |
| 405 | 405 | |
| 406 | 406 | $j = 0; |
| 407 | 407 | |
| 408 | - $batch = "batchl" . $i . "_0"; |
|
| 409 | - $stockLocation = "ent1" . $i . "_0"; |
|
| 410 | - $qty = "qtyl" . $i; |
|
| 408 | + $batch = "batchl".$i."_0"; |
|
| 409 | + $stockLocation = "ent1".$i."_0"; |
|
| 410 | + $qty = "qtyl".$i; |
|
| 411 | 411 | |
| 412 | 412 | $is_batch_or_serial = 0; |
| 413 | 413 | if (!empty($objectsrc->lines[$i]->fk_product)) { |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) { |
| 423 | 423 | if (GETPOSTISSET($batch)) { |
| 424 | 424 | //shipment line with batch-enable product |
| 425 | - $qty .= '_' . $j; |
|
| 425 | + $qty .= '_'.$j; |
|
| 426 | 426 | while (GETPOSTISSET($batch)) { |
| 427 | 427 | // save line of detail into sub_qty |
| 428 | 428 | $sub_qty[$j]['q'] = price2num(GETPOST($qty, 'alpha'), 'MS'); // the qty we want to move for this stock record |
@@ -441,8 +441,8 @@ discard block |
||
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | $j++; |
| 444 | - $batch = "batchl" . $i . "_" . $j; |
|
| 445 | - $qty = "qtyl" . $i . '_' . $j; |
|
| 444 | + $batch = "batchl".$i."_".$j; |
|
| 445 | + $qty = "qtyl".$i.'_'.$j; |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | $batch_line[$i]['detail'] = $sub_qty; // array of details |
@@ -456,13 +456,13 @@ discard block |
||
| 456 | 456 | // We try to set an amount |
| 457 | 457 | // Case we don't use the list of available qty for each warehouse/lot |
| 458 | 458 | // GUI does not allow this yet |
| 459 | - setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse") . ' (' . $langs->trans("Line") . ' ' . GETPOSTINT($idl) . ')', null, 'errors'); |
|
| 459 | + setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse").' ('.$langs->trans("Line").' '.GETPOSTINT($idl).')', null, 'errors'); |
|
| 460 | 460 | $error++; |
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | } elseif (GETPOSTISSET($stockLocation)) { |
| 464 | 464 | //shipment line from multiple stock locations |
| 465 | - $qty .= '_' . $j; |
|
| 465 | + $qty .= '_'.$j; |
|
| 466 | 466 | while (GETPOSTISSET($stockLocation)) { |
| 467 | 467 | // save sub line of warehouse |
| 468 | 468 | $stockLine[$i][$j]['qty'] = price2num(GETPOST($qty, 'alpha'), 'MS'); |
@@ -473,8 +473,8 @@ discard block |
||
| 473 | 473 | $subtotalqty += price2num(GETPOST($qty, 'alpha'), 'MS'); |
| 474 | 474 | |
| 475 | 475 | $j++; |
| 476 | - $stockLocation = "ent1" . $i . "_" . $j; |
|
| 477 | - $qty = "qtyl" . $i . '_' . $j; |
|
| 476 | + $stockLocation = "ent1".$i."_".$j; |
|
| 477 | + $qty = "qtyl".$i.'_'.$j; |
|
| 478 | 478 | } |
| 479 | 479 | } else { |
| 480 | 480 | //shipment line for product with no batch management and no multiple stock location |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | if (isset($extrafields->attributes[$object->table_element_line]['label']) && is_array($extrafields->attributes[$object->table_element_line]['label'])) { |
| 498 | 498 | // Get extra fields |
| 499 | 499 | foreach ($extrafields->attributes[$object->table_element_line]['label'] as $key => $value) { |
| 500 | - unset($_POST["options_" . $key]); |
|
| 500 | + unset($_POST["options_".$key]); |
|
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | if (($totalqty > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) && !$error) { // There is at least one thing to ship and no error |
| 506 | 506 | $selected_subtotal_lines = GETPOST('subtotal_toselect', 'array:int'); |
| 507 | 507 | for ($i = 0; $i < $num; $i++) { |
| 508 | - $qty = "qtyl" . $i; |
|
| 508 | + $qty = "qtyl".$i; |
|
| 509 | 509 | |
| 510 | 510 | if (!isset($batch_line[$i])) { |
| 511 | 511 | // not batch mode |
@@ -523,8 +523,8 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | } else { |
| 525 | 525 | if (GETPOSTFLOAT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) { |
| 526 | - $ent = "entl" . $i; |
|
| 527 | - $idl = "idl" . $i; |
|
| 526 | + $ent = "entl".$i; |
|
| 527 | + $idl = "idl".$i; |
|
| 528 | 528 | $entrepot_id = is_numeric(GETPOSTINT($ent)) ? GETPOSTINT($ent) : GETPOSTINT('entrepot_id'); |
| 529 | 529 | if ($entrepot_id < 0) { |
| 530 | 530 | $entrepot_id = ''; |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | } elseif (!$error) { |
| 579 | 579 | $labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip"); |
| 580 | 580 | if (isModEnabled('stock')) { |
| 581 | - $labelfieldmissing .= '/' . $langs->transnoentitiesnoconv("Warehouse"); |
|
| 581 | + $labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse"); |
|
| 582 | 582 | } |
| 583 | 583 | setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors'); |
| 584 | 584 | $error++; |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | $line->extraparams = $objectsrc_line->extraparams; |
| 595 | 595 | $line->setExtraParameters(); |
| 596 | 596 | } |
| 597 | - header("Location: card.php?id=" . $object->id); |
|
| 597 | + header("Location: card.php?id=".$object->id); |
|
| 598 | 598 | exit; |
| 599 | 599 | } else { |
| 600 | 600 | $db->rollback(); |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | if ($result > 0) { |
| 610 | 610 | $db->commit(); |
| 611 | 611 | |
| 612 | - header("Location: " . DOL_URL_ROOT . '/delivery/card.php?action=create_delivery&token=' . newToken() . '&id=' . $result); |
|
| 612 | + header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&token='.newToken().'&id='.$result); |
|
| 613 | 613 | exit; |
| 614 | 614 | } else { |
| 615 | 615 | $db->rollback(); |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | $also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0); |
| 663 | 663 | $result = $object->delete($user, 0, (bool) $also_update_stock); |
| 664 | 664 | if ($result > 0) { |
| 665 | - header("Location: " . DOL_URL_ROOT . '/expedition/index.php'); |
|
| 665 | + header("Location: ".DOL_URL_ROOT.'/expedition/index.php'); |
|
| 666 | 666 | exit; |
| 667 | 667 | } else { |
| 668 | 668 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 702 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 703 | 703 | exit; |
| 704 | 704 | } else { |
| 705 | 705 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 731 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 732 | 732 | exit; |
| 733 | 733 | } else { |
| 734 | 734 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | } elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('expedition', 'creer')) { |
| 737 | 737 | $result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'SHIPPING_MODIFY'); |
| 738 | 738 | if ($result >= 0) { |
| 739 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 739 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 740 | 740 | exit; |
| 741 | 741 | } else { |
| 742 | 742 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | } elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('expedition', 'creer')) { |
| 745 | 745 | $result = $object->setSignedStatus($user, Expedition::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'SHIPPING_MODIFY'); |
| 746 | 746 | if ($result >= 0) { |
| 747 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 747 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 748 | 748 | exit; |
| 749 | 749 | } else { |
| 750 | 750 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | $datedelivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year')); |
| 754 | 754 | |
| 755 | 755 | $object->fetch($id); |
| 756 | - $result = $object->setDeliveryDate($user, $datedelivery); // Set the planned delivery date |
|
| 756 | + $result = $object->setDeliveryDate($user, $datedelivery); // Set the planned delivery date |
|
| 757 | 757 | if ($result < 0) { |
| 758 | 758 | setEventMessages($object->error, $object->errors, 'errors'); |
| 759 | 759 | } |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | if ($object->update($user) >= 0) { |
| 797 | - header("Location: card.php?id=" . $object->id); |
|
| 797 | + header("Location: card.php?id=".$object->id); |
|
| 798 | 798 | exit; |
| 799 | 799 | } |
| 800 | 800 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | $object->fetch($id); |
| 804 | 804 | $result = $object->setBilled(); |
| 805 | 805 | if ($result >= 0) { |
| 806 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 806 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 807 | 807 | exit(); |
| 808 | 808 | } |
| 809 | 809 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | $object->fetch($id); |
| 812 | 812 | $result = $object->setClosed(); |
| 813 | 813 | if ($result >= 0) { |
| 814 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 814 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 815 | 815 | exit(); |
| 816 | 816 | } |
| 817 | 817 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | } |
| 846 | 846 | |
| 847 | 847 | if (!$error) { |
| 848 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 848 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 849 | 849 | exit(); |
| 850 | 850 | } else { |
| 851 | 851 | setEventMessages($line->error, $line->errors, 'errors'); |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | if (is_array($extralabelsline)) { |
| 876 | 876 | // Get extra fields |
| 877 | 877 | foreach ($extralabelsline as $key => $value) { |
| 878 | - unset($_POST["options_" . $key]); |
|
| 878 | + unset($_POST["options_".$key]); |
|
| 879 | 879 | } |
| 880 | 880 | } |
| 881 | 881 | |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | // Unset extrafield POST Data |
| 933 | 933 | if (is_array($extrafields->attributes[$object->table_element_line]['label'])) { |
| 934 | 934 | foreach ($extrafields->attributes[$object->table_element_line]['label'] as $key => $value) { |
| 935 | - unset($_POST["options_" . $key]); |
|
| 935 | + unset($_POST["options_".$key]); |
|
| 936 | 936 | } |
| 937 | 937 | } |
| 938 | 938 | $line->fk_product = $lines[$i]->fk_product; |
@@ -940,8 +940,8 @@ discard block |
||
| 940 | 940 | // line with lot |
| 941 | 941 | foreach ($lines[$i]->detail_batch as $detail_batch) { |
| 942 | 942 | $lotStock = new Productbatch($db); |
| 943 | - $batch = "batchl" . $detail_batch->fk_expeditiondet . "_" . $detail_batch->fk_origin_stock; |
|
| 944 | - $qty = "qtyl" . $detail_batch->fk_expeditiondet . '_' . $detail_batch->id; |
|
| 943 | + $batch = "batchl".$detail_batch->fk_expeditiondet."_".$detail_batch->fk_origin_stock; |
|
| 944 | + $qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id; |
|
| 945 | 945 | $batch_id = GETPOSTINT($batch); |
| 946 | 946 | $batch_qty = GETPOSTFLOAT($qty); |
| 947 | 947 | if (!empty($batch_id)) { |
@@ -977,8 +977,8 @@ discard block |
||
| 977 | 977 | } |
| 978 | 978 | // add new batch |
| 979 | 979 | $lotStock = new Productbatch($db); |
| 980 | - $batch = "batchl" . $line_id . "_0"; |
|
| 981 | - $qty = "qtyl" . $line_id . "_0"; |
|
| 980 | + $batch = "batchl".$line_id."_0"; |
|
| 981 | + $qty = "qtyl".$line_id."_0"; |
|
| 982 | 982 | $batch_id = GETPOSTINT($batch); |
| 983 | 983 | $batch_qty = GETPOSTFLOAT($qty); |
| 984 | 984 | $lineIdToAddLot = 0; |
@@ -1041,8 +1041,8 @@ discard block |
||
| 1041 | 1041 | // line without lot |
| 1042 | 1042 | if ($lines[$i]->entrepot_id == 0) { |
| 1043 | 1043 | // single warehouse shipment line or line in several warehouses context but with warehouse not defined |
| 1044 | - $stockLocation = "entl" . $line_id; |
|
| 1045 | - $qty = "qtyl" . $line_id; |
|
| 1044 | + $stockLocation = "entl".$line_id; |
|
| 1045 | + $qty = "qtyl".$line_id; |
|
| 1046 | 1046 | $line->id = $line_id; |
| 1047 | 1047 | $line->entrepot_id = GETPOSTINT((string) $stockLocation); |
| 1048 | 1048 | $line->qty = GETPOSTFLOAT($qty); |
@@ -1054,8 +1054,8 @@ discard block |
||
| 1054 | 1054 | unset($_POST[$qty]); |
| 1055 | 1055 | } elseif ($lines[$i]->entrepot_id > 0) { |
| 1056 | 1056 | // single warehouse shipment line |
| 1057 | - $stockLocation = "entl" . $line_id; |
|
| 1058 | - $qty = "qtyl" . $line_id; |
|
| 1057 | + $stockLocation = "entl".$line_id; |
|
| 1058 | + $qty = "qtyl".$line_id; |
|
| 1059 | 1059 | $line->id = $line_id; |
| 1060 | 1060 | $line->entrepot_id = GETPOSTINT($stockLocation); |
| 1061 | 1061 | $line->qty = GETPOSTFLOAT($qty); |
@@ -1069,8 +1069,8 @@ discard block |
||
| 1069 | 1069 | // multi warehouse shipment lines |
| 1070 | 1070 | foreach ($lines[$i]->details_entrepot as $detail_entrepot) { |
| 1071 | 1071 | if (!$error) { |
| 1072 | - $stockLocation = "entl" . $detail_entrepot->line_id; |
|
| 1073 | - $qty = "qtyl" . $detail_entrepot->line_id; |
|
| 1072 | + $stockLocation = "entl".$detail_entrepot->line_id; |
|
| 1073 | + $qty = "qtyl".$detail_entrepot->line_id; |
|
| 1074 | 1074 | $warehouse = GETPOSTINT($stockLocation); |
| 1075 | 1075 | if (!empty($warehouse)) { |
| 1076 | 1076 | $line->id = $detail_entrepot->line_id; |
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | } |
| 1089 | 1089 | } |
| 1090 | 1090 | } elseif (!isModEnabled('stock') && !isModEnabled('productbatch')) { // both product batch and stock are not activated. |
| 1091 | - $qty = "qtyl" . $line_id; |
|
| 1091 | + $qty = "qtyl".$line_id; |
|
| 1092 | 1092 | $line->id = $line_id; |
| 1093 | 1093 | $line->qty = GETPOSTFLOAT($qty); |
| 1094 | 1094 | $line->entrepot_id = 0; |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | } |
| 1103 | 1103 | } else { |
| 1104 | 1104 | // Product no predefined |
| 1105 | - $qty = "qtyl" . $line_id; |
|
| 1105 | + $qty = "qtyl".$line_id; |
|
| 1106 | 1106 | $line->id = $line_id; |
| 1107 | 1107 | $line->qty = GETPOSTFLOAT($qty); |
| 1108 | 1108 | $line->entrepot_id = 0; |
@@ -1145,12 +1145,12 @@ discard block |
||
| 1145 | 1145 | $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 1146 | 1146 | } |
| 1147 | 1147 | } else { |
| 1148 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited |
|
| 1148 | + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To redisplay the form being edited |
|
| 1149 | 1149 | exit(); |
| 1150 | 1150 | } |
| 1151 | 1151 | } |
| 1152 | 1152 | } elseif ($action == 'updateline' && $permissiontoadd && GETPOST('cancel', 'alpha') == $langs->trans("Cancel")) { |
| 1153 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // To redisplay the form being edited |
|
| 1153 | + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To redisplay the form being edited |
|
| 1154 | 1154 | exit(); |
| 1155 | 1155 | } elseif ($action == 'addline' && !$origin && getDolGlobalString('SHIPMENT_STANDALONE') && $usercancreate) { // Add a new line |
| 1156 | 1156 | $langs->load('errors'); |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| 1354 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 1354 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 1355 | 1355 | exit; |
| 1356 | 1356 | } else { |
| 1357 | 1357 | $mesg = $object->error; |
@@ -1376,14 +1376,14 @@ discard block |
||
| 1376 | 1376 | $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 1377 | 1377 | } |
| 1378 | 1378 | |
| 1379 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 1379 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 1380 | 1380 | exit; |
| 1381 | 1381 | } else { |
| 1382 | 1382 | $mesg = $object->error; |
| 1383 | 1383 | } |
| 1384 | 1384 | } |
| 1385 | 1385 | |
| 1386 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
| 1386 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
| 1387 | 1387 | |
| 1388 | 1388 | // Actions to send emails |
| 1389 | 1389 | if (empty($id)) { |
@@ -1393,15 +1393,15 @@ discard block |
||
| 1393 | 1393 | $paramname = 'id'; |
| 1394 | 1394 | $autocopy = 'MAIN_MAIL_AUTOCOPY_SHIPMENT_TO'; |
| 1395 | 1395 | $mode = 'emailfromshipment'; |
| 1396 | - $trackid = 'shi' . $object->id; |
|
| 1397 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
| 1396 | + $trackid = 'shi'.$object->id; |
|
| 1397 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
| 1398 | 1398 | } |
| 1399 | 1399 | |
| 1400 | 1400 | /* |
| 1401 | 1401 | * View |
| 1402 | 1402 | */ |
| 1403 | 1403 | |
| 1404 | -$title = $object->ref . ' - ' . $langs->trans("Card"); |
|
| 1404 | +$title = $object->ref.' - '.$langs->trans("Card"); |
|
| 1405 | 1405 | if ($action == 'create') { |
| 1406 | 1406 | $title = $langs->trans("NewSending"); |
| 1407 | 1407 | } |
@@ -1430,7 +1430,7 @@ discard block |
||
| 1430 | 1430 | if (!$origin && $action == 'create' && !getDolGlobalString('SHIPMENT_STANDALONE')) { |
| 1431 | 1431 | print load_fiche_titre($langs->trans("CreateShipment"), '', 'dolly'); |
| 1432 | 1432 | |
| 1433 | - print '<br>' .$langs->trans("ShipmentCreationIsDoneFromOrder"); |
|
| 1433 | + print '<br>'.$langs->trans("ShipmentCreationIsDoneFromOrder"); |
|
| 1434 | 1434 | $action = ''; |
| 1435 | 1435 | $id = ''; |
| 1436 | 1436 | $ref = ''; |
@@ -1452,12 +1452,12 @@ discard block |
||
| 1452 | 1452 | $note_private = $object->getDefaultCreateValueFor('note_private'); |
| 1453 | 1453 | $note_public = $object->getDefaultCreateValueFor('note_public'); |
| 1454 | 1454 | |
| 1455 | - print '<form name="crea_expedition" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; |
|
| 1456 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1455 | + print '<form name="crea_expedition" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
| 1456 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1457 | 1457 | print '<input type="hidden" name="action" value="add">'; |
| 1458 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 1459 | - print '<input type="hidden" name="originid" value="' . $id . '">'; |
|
| 1460 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 1458 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 1459 | + print '<input type="hidden" name="originid" value="'.$id.'">'; |
|
| 1460 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 1461 | 1461 | |
| 1462 | 1462 | print dol_get_fiche_head([]); |
| 1463 | 1463 | |
@@ -1465,11 +1465,11 @@ discard block |
||
| 1465 | 1465 | |
| 1466 | 1466 | // Thirdparty |
| 1467 | 1467 | print '<tr>'; |
| 1468 | - print '<td class="fieldrequired">' . $langs->trans('ThirdParty') . '</td>'; |
|
| 1468 | + print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>'; |
|
| 1469 | 1469 | if ($socid > 0) { |
| 1470 | 1470 | print '<td>'; |
| 1471 | 1471 | print $soc->getNomUrl(1); |
| 1472 | - print '<input type="hidden" name="socid" value="' . $soc->id . '">'; |
|
| 1472 | + print '<input type="hidden" name="socid" value="'.$soc->id.'">'; |
|
| 1473 | 1473 | print '</td>'; |
| 1474 | 1474 | } else { |
| 1475 | 1475 | print '<td class="valuefieldcreate">'; |
@@ -1503,10 +1503,10 @@ discard block |
||
| 1503 | 1503 | |
| 1504 | 1504 | $langs->load("projects"); |
| 1505 | 1505 | print '<tr>'; |
| 1506 | - print '<td>' . $langs->trans("Project") . '</td><td colspan="2">'; |
|
| 1506 | + print '<td>'.$langs->trans("Project").'</td><td colspan="2">'; |
|
| 1507 | 1507 | print img_picto('', 'project', 'class="pictofixedwidth"'); |
| 1508 | 1508 | print $formproject->select_projects($soc->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'widthcentpercentminusxx'); |
| 1509 | - print ' <a class="paddingleft" href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle"></span></a>'; |
|
| 1509 | + print ' <a class="paddingleft" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle"></span></a>'; |
|
| 1510 | 1510 | print '</td>'; |
| 1511 | 1511 | print '</tr>'; |
| 1512 | 1512 | } |
@@ -1534,7 +1534,7 @@ discard block |
||
| 1534 | 1534 | print $langs->trans("Weight"); |
| 1535 | 1535 | print '</td><td colspan="3">'; |
| 1536 | 1536 | print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"'); |
| 1537 | - print '<input name="weight" size="4" value="' . GETPOSTINT('weight') . '"> '; |
|
| 1537 | + print '<input name="weight" size="4" value="'.GETPOSTINT('weight').'"> '; |
|
| 1538 | 1538 | $text = $formproduct->selectMeasuringUnits("weight_units", "weight", (string) GETPOSTINT('weight_units'), 0, 2); |
| 1539 | 1539 | $htmltext = $langs->trans("KeepEmptyForAutoCalculation"); |
| 1540 | 1540 | print $form->textwithpicto($text, $htmltext); |
@@ -1542,12 +1542,12 @@ discard block |
||
| 1542 | 1542 | |
| 1543 | 1543 | // Dim |
| 1544 | 1544 | print '<tr><td>'; |
| 1545 | - print $langs->trans("Width") . ' x ' . $langs->trans("Height") . ' x ' . $langs->trans("Depth"); |
|
| 1545 | + print $langs->trans("Width").' x '.$langs->trans("Height").' x '.$langs->trans("Depth"); |
|
| 1546 | 1546 | print ' </td><td colspan="3">'; |
| 1547 | 1547 | print img_picto('', 'fa-ruler', 'class="pictofixedwidth"'); |
| 1548 | - print '<input name="sizeW" size="4" value="' . GETPOSTINT('sizeW') . '">'; |
|
| 1549 | - print ' x <input name="sizeH" size="4" value="' . GETPOSTINT('sizeH') . '">'; |
|
| 1550 | - print ' x <input name="sizeS" size="4" value="' . GETPOSTINT('sizeS') . '">'; |
|
| 1548 | + print '<input name="sizeW" size="4" value="'.GETPOSTINT('sizeW').'">'; |
|
| 1549 | + print ' x <input name="sizeH" size="4" value="'.GETPOSTINT('sizeH').'">'; |
|
| 1550 | + print ' x <input name="sizeS" size="4" value="'.GETPOSTINT('sizeS').'">'; |
|
| 1551 | 1551 | print ' '; |
| 1552 | 1552 | $text = $formproduct->selectMeasuringUnits("size_units", "size", (string) GETPOSTINT('size_units'), 0, 2); |
| 1553 | 1553 | $htmltext = $langs->trans("KeepEmptyForAutoCalculation"); |
@@ -1607,7 +1607,7 @@ discard block |
||
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | 1609 | // Note Public |
| 1610 | - $htmltext =''; |
|
| 1610 | + $htmltext = ''; |
|
| 1611 | 1611 | print '<tr>'; |
| 1612 | 1612 | print '<td class="tdtop">'; |
| 1613 | 1613 | print $form->textwithpicto($langs->trans('NotePublic'), $htmltext); |
@@ -1654,13 +1654,13 @@ discard block |
||
| 1654 | 1654 | $entrepot = new Entrepot($db); |
| 1655 | 1655 | } |
| 1656 | 1656 | |
| 1657 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">'; |
|
| 1658 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1657 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; |
|
| 1658 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1659 | 1659 | print '<input type="hidden" name="action" value="add">'; |
| 1660 | - print '<input type="hidden" name="origin" value="' . $origin . '">'; |
|
| 1661 | - print '<input type="hidden" name="origin_id" value="' . $object->id . '">'; |
|
| 1660 | + print '<input type="hidden" name="origin" value="'.$origin.'">'; |
|
| 1661 | + print '<input type="hidden" name="origin_id" value="'.$object->id.'">'; |
|
| 1662 | 1662 | if (GETPOSTINT('entrepot_id')) { |
| 1663 | - print '<input type="hidden" name="entrepot_id" value="' . GETPOSTINT('entrepot_id') . '">'; |
|
| 1663 | + print '<input type="hidden" name="entrepot_id" value="'.GETPOSTINT('entrepot_id').'">'; |
|
| 1664 | 1664 | } |
| 1665 | 1665 | |
| 1666 | 1666 | print dol_get_fiche_head([]); |
@@ -1690,13 +1690,13 @@ discard block |
||
| 1690 | 1690 | print $langs->trans('RefCustomer'); |
| 1691 | 1691 | } |
| 1692 | 1692 | print '</td><td colspan="3">'; |
| 1693 | - print '<input type="text" name="ref_customer" value="' . $object->ref_client . '" />'; |
|
| 1693 | + print '<input type="text" name="ref_customer" value="'.$object->ref_client.'" />'; |
|
| 1694 | 1694 | print '</td>'; |
| 1695 | 1695 | print '</tr>'; |
| 1696 | 1696 | |
| 1697 | 1697 | // Thirdparty |
| 1698 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Company') . '</td>'; |
|
| 1699 | - print '<td colspan="3">' . $soc->getNomUrl(1) . '</td>'; |
|
| 1698 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Company').'</td>'; |
|
| 1699 | + print '<td colspan="3">'.$soc->getNomUrl(1).'</td>'; |
|
| 1700 | 1700 | print '</tr>'; |
| 1701 | 1701 | |
| 1702 | 1702 | // Project |
@@ -1710,16 +1710,16 @@ discard block |
||
| 1710 | 1710 | } |
| 1711 | 1711 | $langs->load("projects"); |
| 1712 | 1712 | print '<tr>'; |
| 1713 | - print '<td>' . $langs->trans("Project") . '</td><td colspan="2">'; |
|
| 1713 | + print '<td>'.$langs->trans("Project").'</td><td colspan="2">'; |
|
| 1714 | 1714 | print img_picto('', 'project', 'class="pictofixedwidth"'); |
| 1715 | 1715 | print $formproject->select_projects($soc->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'widthcentpercentminusxx'); |
| 1716 | - print ' <a class="paddingleft" href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle"></span></a>'; |
|
| 1716 | + print ' <a class="paddingleft" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle"></span></a>'; |
|
| 1717 | 1717 | print '</td>'; |
| 1718 | 1718 | print '</tr>'; |
| 1719 | 1719 | } |
| 1720 | 1720 | |
| 1721 | 1721 | // Date delivery planned |
| 1722 | - print '<tr><td>' . $langs->trans("DateDeliveryPlanned") . '</td>'; |
|
| 1722 | + print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>'; |
|
| 1723 | 1723 | print '<td colspan="3">'; |
| 1724 | 1724 | print img_picto('', 'action', 'class="pictofixedwidth"'); |
| 1725 | 1725 | $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST |
@@ -1728,7 +1728,7 @@ discard block |
||
| 1728 | 1728 | print '</tr>'; |
| 1729 | 1729 | |
| 1730 | 1730 | // Date shipment (sending) |
| 1731 | - print '<tr><td>' . $langs->trans("DateShipping") . '</td>'; |
|
| 1731 | + print '<tr><td>'.$langs->trans("DateShipping").'</td>'; |
|
| 1732 | 1732 | print '<td colspan="3">'; |
| 1733 | 1733 | print img_picto('', 'action', 'class="pictofixedwidth"'); |
| 1734 | 1734 | //$date_shipping = ($date_shipping ? $date_shipping : $object->date_shipping); // $date_shipping comes from GETPOST |
@@ -1737,7 +1737,7 @@ discard block |
||
| 1737 | 1737 | print '</tr>'; |
| 1738 | 1738 | |
| 1739 | 1739 | // Note Public |
| 1740 | - print '<tr><td>' . $langs->trans("NotePublic") . '</td>'; |
|
| 1740 | + print '<tr><td>'.$langs->trans("NotePublic").'</td>'; |
|
| 1741 | 1741 | print '<td colspan="3">'; |
| 1742 | 1742 | $doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%'); |
| 1743 | 1743 | print $doleditor->Create(1); |
@@ -1745,7 +1745,7 @@ discard block |
||
| 1745 | 1745 | |
| 1746 | 1746 | // Note Private |
| 1747 | 1747 | if ($object->note_private && !$user->socid) { |
| 1748 | - print '<tr><td>' . $langs->trans("NotePrivate") . '</td>'; |
|
| 1748 | + print '<tr><td>'.$langs->trans("NotePrivate").'</td>'; |
|
| 1749 | 1749 | print '<td colspan="3">'; |
| 1750 | 1750 | $doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%'); |
| 1751 | 1751 | print $doleditor->Create(1); |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | print $langs->trans("Weight"); |
| 1758 | 1758 | print '</td><td colspan="3">'; |
| 1759 | 1759 | print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"'); |
| 1760 | - print '<input name="weight" size="4" value="' . GETPOSTINT('weight') . '"> '; |
|
| 1760 | + print '<input name="weight" size="4" value="'.GETPOSTINT('weight').'"> '; |
|
| 1761 | 1761 | $text = $formproduct->selectMeasuringUnits("weight_units", "weight", (string) GETPOSTINT('weight_units'), 0, 2); |
| 1762 | 1762 | $htmltext = $langs->trans("KeepEmptyForAutoCalculation"); |
| 1763 | 1763 | print $form->textwithpicto($text, $htmltext); |
@@ -1765,12 +1765,12 @@ discard block |
||
| 1765 | 1765 | |
| 1766 | 1766 | // Dim |
| 1767 | 1767 | print '<tr><td>'; |
| 1768 | - print $langs->trans("Width") . ' x ' . $langs->trans("Height") . ' x ' . $langs->trans("Depth"); |
|
| 1768 | + print $langs->trans("Width").' x '.$langs->trans("Height").' x '.$langs->trans("Depth"); |
|
| 1769 | 1769 | print ' </td><td colspan="3">'; |
| 1770 | 1770 | print img_picto('', 'fa-ruler', 'class="pictofixedwidth"'); |
| 1771 | - print '<input name="sizeW" size="4" value="' . GETPOSTINT('sizeW') . '">'; |
|
| 1772 | - print ' x <input name="sizeH" size="4" value="' . GETPOSTINT('sizeH') . '">'; |
|
| 1773 | - print ' x <input name="sizeS" size="4" value="' . GETPOSTINT('sizeS') . '">'; |
|
| 1771 | + print '<input name="sizeW" size="4" value="'.GETPOSTINT('sizeW').'">'; |
|
| 1772 | + print ' x <input name="sizeH" size="4" value="'.GETPOSTINT('sizeH').'">'; |
|
| 1773 | + print ' x <input name="sizeS" size="4" value="'.GETPOSTINT('sizeS').'">'; |
|
| 1774 | 1774 | print ' '; |
| 1775 | 1775 | $text = $formproduct->selectMeasuringUnits("size_units", "size", (string) GETPOSTINT('size_units'), 0, 2); |
| 1776 | 1776 | $htmltext = $langs->trans("KeepEmptyForAutoCalculation"); |
@@ -1778,7 +1778,7 @@ discard block |
||
| 1778 | 1778 | print '</td></tr>'; |
| 1779 | 1779 | |
| 1780 | 1780 | // Delivery method |
| 1781 | - print "<tr><td>" . $langs->trans("DeliveryMethod") . "</td>"; |
|
| 1781 | + print "<tr><td>".$langs->trans("DeliveryMethod")."</td>"; |
|
| 1782 | 1782 | print '<td colspan="3">'; |
| 1783 | 1783 | $expe->fetch_delivery_methods(); |
| 1784 | 1784 | print img_picto('', 'dolly', 'class="pictofixedwidth"'); |
@@ -1789,16 +1789,16 @@ discard block |
||
| 1789 | 1789 | print "</td></tr>\n"; |
| 1790 | 1790 | |
| 1791 | 1791 | // Tracking number |
| 1792 | - print "<tr><td>" . $langs->trans("TrackingNumber") . "</td>"; |
|
| 1792 | + print "<tr><td>".$langs->trans("TrackingNumber")."</td>"; |
|
| 1793 | 1793 | print '<td colspan="3">'; |
| 1794 | 1794 | print img_picto('', 'barcode', 'class="pictofixedwidth"'); |
| 1795 | - print '<input name="tracking_number" size="20" value="' . GETPOST('tracking_number', 'alpha') . '">'; |
|
| 1795 | + print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number', 'alpha').'">'; |
|
| 1796 | 1796 | print "</td></tr>\n"; |
| 1797 | 1797 | |
| 1798 | 1798 | // Incoterms |
| 1799 | 1799 | if (isModEnabled('incoterm')) { |
| 1800 | 1800 | print '<tr>'; |
| 1801 | - print '<td><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1) . '</label></td>'; |
|
| 1801 | + print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1).'</label></td>'; |
|
| 1802 | 1802 | print '<td colspan="3" class="maxwidthonsmartphone">'; |
| 1803 | 1803 | print img_picto('', 'incoterm', 'class="pictofixedwidth"'); |
| 1804 | 1804 | print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : '')); |
@@ -1806,10 +1806,10 @@ discard block |
||
| 1806 | 1806 | } |
| 1807 | 1807 | |
| 1808 | 1808 | // Document model |
| 1809 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php'; |
|
| 1809 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; |
|
| 1810 | 1810 | $list = ModelePdfExpedition::liste_modeles($db); |
| 1811 | 1811 | if (is_countable($list) && count($list) > 1) { |
| 1812 | - print "<tr><td>" . $langs->trans("DefaultModel") . "</td>"; |
|
| 1812 | + print "<tr><td>".$langs->trans("DefaultModel")."</td>"; |
|
| 1813 | 1813 | print '<td colspan="3">'; |
| 1814 | 1814 | print img_picto('', 'pdf', 'class="pictofixedwidth"'); |
| 1815 | 1815 | print $form->selectarray('model', $list, getDolGlobalString('EXPEDITION_ADDON_PDF'), 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx'); |
@@ -1818,7 +1818,7 @@ discard block |
||
| 1818 | 1818 | |
| 1819 | 1819 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 1820 | 1820 | // $objectsrc is Commande|Facture |
| 1821 | - $objectsav = $object; // Because Expedition is $expe and not $object that is wrongly a duplicate of $objectsrc. |
|
| 1821 | + $objectsav = $object; // Because Expedition is $expe and not $object that is wrongly a duplicate of $objectsrc. |
|
| 1822 | 1822 | $object = $expe; |
| 1823 | 1823 | // Propagate extrafieldsvalue from source object to shipment object |
| 1824 | 1824 | if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && !empty($extrafields->attributes[$object->table_element]['label'])) { |
@@ -1845,22 +1845,22 @@ discard block |
||
| 1845 | 1845 | |
| 1846 | 1846 | $numAsked = count($object->lines); |
| 1847 | 1847 | |
| 1848 | - print '<script type="text/javascript">' . "\n"; |
|
| 1849 | - print 'jQuery(document).ready(function() {' . "\n"; |
|
| 1848 | + print '<script type="text/javascript">'."\n"; |
|
| 1849 | + print 'jQuery(document).ready(function() {'."\n"; |
|
| 1850 | 1850 | print 'jQuery("#autofill").click(function() {'; |
| 1851 | 1851 | $i = 0; |
| 1852 | 1852 | while ($i < $numAsked) { |
| 1853 | - print 'jQuery("#qtyl' . $i . '").val(jQuery("#qtyasked' . $i . '").val() - jQuery("#qtydelivered' . $i . '").val());' . "\n"; |
|
| 1853 | + print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; |
|
| 1854 | 1854 | if (isModEnabled('productbatch')) { |
| 1855 | - print 'jQuery("#qtyl' . $i . '_' . $i . '").val(jQuery("#qtyasked' . $i . '").val() - jQuery("#qtydelivered' . $i . '").val());' . "\n"; |
|
| 1855 | + print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; |
|
| 1856 | 1856 | } |
| 1857 | 1857 | $i++; |
| 1858 | 1858 | } |
| 1859 | - print 'return false; });' . "\n"; |
|
| 1860 | - print 'jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0);' . "\n"; |
|
| 1861 | - print 'return false; });' . "\n"; |
|
| 1862 | - print '});' . "\n"; |
|
| 1863 | - print '</script>' . "\n"; |
|
| 1859 | + print 'return false; });'."\n"; |
|
| 1860 | + print 'jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0);'."\n"; |
|
| 1861 | + print 'return false; });'."\n"; |
|
| 1862 | + print '});'."\n"; |
|
| 1863 | + print '</script>'."\n"; |
|
| 1864 | 1864 | |
| 1865 | 1865 | print '<br>'; |
| 1866 | 1866 | |
@@ -1893,26 +1893,26 @@ discard block |
||
| 1893 | 1893 | } |
| 1894 | 1894 | print $langs->trans("Description"); |
| 1895 | 1895 | print '</td>'; |
| 1896 | - print '<td class="center">' . $langs->trans("QtyOrdered") . '</td>'; |
|
| 1897 | - print '<td class="center">' . $langs->trans("QtyShipped") . '</td>'; |
|
| 1898 | - print '<td class="center">' . $langs->trans("QtyToShip"); |
|
| 1896 | + print '<td class="center">'.$langs->trans("QtyOrdered").'</td>'; |
|
| 1897 | + print '<td class="center">'.$langs->trans("QtyShipped").'</td>'; |
|
| 1898 | + print '<td class="center">'.$langs->trans("QtyToShip"); |
|
| 1899 | 1899 | if (!isModEnabled('productbatch')) { |
| 1900 | - print '<br><a href="#" id="autofill" class="opacitymedium link cursor cursorpointer">' . img_picto($langs->trans("Autofill"), 'autofill', 'class="paddingrightonly"') . '</a>'; |
|
| 1900 | + print '<br><a href="#" id="autofill" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Autofill"), 'autofill', 'class="paddingrightonly"').'</a>'; |
|
| 1901 | 1901 | print ' / '; |
| 1902 | 1902 | } else { |
| 1903 | 1903 | print '<br>'; |
| 1904 | 1904 | } |
| 1905 | - print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">' . img_picto($langs->trans("Reset"), 'eraser') . '</span>'; |
|
| 1905 | + print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Reset"), 'eraser').'</span>'; |
|
| 1906 | 1906 | print '</td>'; |
| 1907 | 1907 | if (isModEnabled('stock')) { |
| 1908 | 1908 | if (!isModEnabled('productbatch')) { |
| 1909 | - print '<td class="left">' . $langs->trans("Warehouse") . ' (' . $langs->trans("Stock") . ')</td>'; |
|
| 1909 | + print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>'; |
|
| 1910 | 1910 | } else { |
| 1911 | - print '<td class="left">' . $langs->trans("Warehouse") . ' / ' . $langs->trans("Batch") . ' (' . $langs->trans("Stock") . ')</td>'; |
|
| 1911 | + print '<td class="left">'.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' ('.$langs->trans("Stock").')</td>'; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | } |
| 1914 | 1914 | if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
| 1915 | - print '<td class="left">' . $langs->trans('StockEntryDate') . '</td>'; |
|
| 1915 | + print '<td class="left">'.$langs->trans('StockEntryDate').'</td>'; |
|
| 1916 | 1916 | } |
| 1917 | 1917 | print "</tr>\n"; |
| 1918 | 1918 | } |
@@ -1949,8 +1949,8 @@ discard block |
||
| 1949 | 1949 | $type = 1; |
| 1950 | 1950 | } |
| 1951 | 1951 | |
| 1952 | - print '<!-- line for order line ' . $line->id . ' -->' . "\n"; |
|
| 1953 | - print '<tr class="oddeven" id="row-' . $line->id . '">' . "\n"; |
|
| 1952 | + print '<!-- line for order line '.$line->id.' -->'."\n"; |
|
| 1953 | + print '<tr class="oddeven" id="row-'.$line->id.'">'."\n"; |
|
| 1954 | 1954 | |
| 1955 | 1955 | $qtyProdCom = $line->qty; |
| 1956 | 1956 | $productChildrenNb = 0; |
@@ -1971,7 +1971,7 @@ discard block |
||
| 1971 | 1971 | //var_dump($product->stock_warehouse[1]); |
| 1972 | 1972 | |
| 1973 | 1973 | print '<td>'; |
| 1974 | - print '<a name="' . $line->id . '"></a>'; // ancre pour retourner sur la ligne |
|
| 1974 | + print '<a name="'.$line->id.'"></a>'; // ancre pour retourner sur la ligne |
|
| 1975 | 1975 | |
| 1976 | 1976 | // Show product and description |
| 1977 | 1977 | $product_static->type = $line->fk_product_type; |
@@ -1984,7 +1984,7 @@ discard block |
||
| 1984 | 1984 | $showdescinproductdesc = getDolGlobalString('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE'); |
| 1985 | 1985 | |
| 1986 | 1986 | $text = $product_static->getNomUrl(1); |
| 1987 | - $text .= ' - ' . (!empty($line->label) ? $line->label : $line->product_label); |
|
| 1987 | + $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); |
|
| 1988 | 1988 | $description = ($showdescinproductdesc ? '' : dol_htmlentitiesbr($line->desc)); |
| 1989 | 1989 | $description .= empty($product->stockable_product) ? $langs->trans('StockDisabled') : $langs->trans('StockEnabled'); |
| 1990 | 1990 | print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i); |
@@ -1994,7 +1994,7 @@ discard block |
||
| 1994 | 1994 | |
| 1995 | 1995 | // Add description in form |
| 1996 | 1996 | if ($showdescinproductdesc) { |
| 1997 | - print ($line->desc && $line->desc != $line->product_label) ? '<br>' . dol_htmlentitiesbr($line->desc) : ''; |
|
| 1997 | + print ($line->desc && $line->desc != $line->product_label) ? '<br>'.dol_htmlentitiesbr($line->desc) : ''; |
|
| 1998 | 1998 | } |
| 1999 | 1999 | |
| 2000 | 2000 | print '</td>'; |
@@ -2007,10 +2007,10 @@ discard block |
||
| 2007 | 2007 | } |
| 2008 | 2008 | |
| 2009 | 2009 | if (!empty($line->label)) { |
| 2010 | - $text .= ' <strong>' . $line->label . '</strong>'; |
|
| 2010 | + $text .= ' <strong>'.$line->label.'</strong>'; |
|
| 2011 | 2011 | print $form->textwithtooltip($text, $line->desc, 3, 0, '', (string) $i); |
| 2012 | 2012 | } else { |
| 2013 | - print $text . ' ' . nl2br($line->desc); |
|
| 2013 | + print $text.' '.nl2br($line->desc); |
|
| 2014 | 2014 | } |
| 2015 | 2015 | |
| 2016 | 2016 | // Show range |
@@ -2025,16 +2025,16 @@ discard block |
||
| 2025 | 2025 | } |
| 2026 | 2026 | |
| 2027 | 2027 | // Qty |
| 2028 | - print '<td class="center">' . $line->qty; |
|
| 2029 | - print '<input name="qtyasked' . $indiceAsked . '" id="qtyasked' . $indiceAsked . '" type="hidden" value="' . $line->qty . '">'; |
|
| 2030 | - print '' . $unit_order . '</td>'; |
|
| 2028 | + print '<td class="center">'.$line->qty; |
|
| 2029 | + print '<input name="qtyasked'.$indiceAsked.'" id="qtyasked'.$indiceAsked.'" type="hidden" value="'.$line->qty.'">'; |
|
| 2030 | + print ''.$unit_order.'</td>'; |
|
| 2031 | 2031 | |
| 2032 | 2032 | // Qty already shipped |
| 2033 | 2033 | print '<td class="center">'; |
| 2034 | 2034 | $quantityDelivered = isset($object->expeditions[$line->id]) ? $object->expeditions[$line->id] : ''; |
| 2035 | 2035 | print $quantityDelivered; |
| 2036 | - print '<input name="qtydelivered' . $indiceAsked . '" id="qtydelivered' . $indiceAsked . '" type="hidden" value="' . $quantityDelivered . '">'; |
|
| 2037 | - print '' . $unit_order . '</td>'; |
|
| 2036 | + print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">'; |
|
| 2037 | + print ''.$unit_order.'</td>'; |
|
| 2038 | 2038 | |
| 2039 | 2039 | // Qty to ship |
| 2040 | 2040 | $quantityAsked = $line->qty; |
@@ -2065,19 +2065,19 @@ discard block |
||
| 2065 | 2065 | // Quantity to send |
| 2066 | 2066 | print '<td class="center">'; |
| 2067 | 2067 | if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES'))) { |
| 2068 | - if (GETPOSTINT('qtyl' . $indiceAsked)) { |
|
| 2069 | - $deliverableQty = GETPOSTINT('qtyl' . $indiceAsked); |
|
| 2068 | + if (GETPOSTINT('qtyl'.$indiceAsked)) { |
|
| 2069 | + $deliverableQty = GETPOSTINT('qtyl'.$indiceAsked); |
|
| 2070 | 2070 | } |
| 2071 | - print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">'; |
|
| 2071 | + print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">'; |
|
| 2072 | 2072 | $qtylValue = $deliverableQty; |
| 2073 | 2073 | if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) { |
| 2074 | 2074 | $qtylValue = ''; |
| 2075 | 2075 | } |
| 2076 | - print '<input name="qtyl' . $indiceAsked . '" id="qtyl' . $indiceAsked . '" class="qtyl right" type="text" size="4" value="' . $qtylValue . '">'; |
|
| 2076 | + print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl right" type="text" size="4" value="'.$qtylValue.'">'; |
|
| 2077 | 2077 | } else { |
| 2078 | 2078 | if (getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) { |
| 2079 | - print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">'; |
|
| 2080 | - print '<input name="qtyl' . $indiceAsked . '" id="qtyl' . $indiceAsked . '" type="hidden" value="0">'; |
|
| 2079 | + print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">'; |
|
| 2080 | + print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">'; |
|
| 2081 | 2081 | } |
| 2082 | 2082 | |
| 2083 | 2083 | print $langs->trans("NA"); |
@@ -2089,8 +2089,8 @@ discard block |
||
| 2089 | 2089 | print '<td class="left">'; |
| 2090 | 2090 | if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Type of product need stock change ? |
| 2091 | 2091 | // Show warehouse combo list |
| 2092 | - $ent = "entl" . $indiceAsked; |
|
| 2093 | - $idl = "idl" . $indiceAsked; |
|
| 2092 | + $ent = "entl".$indiceAsked; |
|
| 2093 | + $idl = "idl".$indiceAsked; |
|
| 2094 | 2094 | $tmpentrepot_id = is_numeric(GETPOST($ent)) ? GETPOSTINT($ent) : $warehouse_id; |
| 2095 | 2095 | if ($line->fk_product > 0) { |
| 2096 | 2096 | print '<!-- Show warehouse selection -->'; |
@@ -2100,24 +2100,24 @@ discard block |
||
| 2100 | 2100 | $stockMin = 0; |
| 2101 | 2101 | } |
| 2102 | 2102 | if ($productChildrenNb > 0) { |
| 2103 | - print $formproduct->selectWarehouses($tmpentrepot_id, 'entl' . $indiceAsked, '', 1, 0, 0, '', 0, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref'); |
|
| 2103 | + print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, 0, '', 0, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref'); |
|
| 2104 | 2104 | } else { |
| 2105 | 2105 | if ($product->stockable_product == Product::ENABLED_STOCK) { |
| 2106 | - print $formproduct->selectWarehouses($tmpentrepot_id, 'entl' . $indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref'); |
|
| 2106 | + print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', array(), 1, $stockMin, 'stock DESC, e.ref'); |
|
| 2107 | 2107 | } else { |
| 2108 | - print img_warning() . ' ' . $langs->trans('StockDisabled'); |
|
| 2108 | + print img_warning().' '.$langs->trans('StockDisabled'); |
|
| 2109 | 2109 | } |
| 2110 | 2110 | } |
| 2111 | 2111 | |
| 2112 | 2112 | if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) { |
| 2113 | 2113 | //print $stock.' '.$quantityToBeDelivered; |
| 2114 | 2114 | if ($stock < $quantityToBeDelivered) { |
| 2115 | - print ' ' . img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse |
|
| 2115 | + print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse |
|
| 2116 | 2116 | } |
| 2117 | 2117 | } |
| 2118 | 2118 | } |
| 2119 | 2119 | } else { |
| 2120 | - print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span><input name="entl' . $indiceAsked . '" id="entl' . $indiceAsked . '" type="hidden" value="0">'; |
|
| 2120 | + print '<span class="opacitymedium">('.$langs->trans("Service").')</span><input name="entl'.$indiceAsked.'" id="entl'.$indiceAsked.'" type="hidden" value="0">'; |
|
| 2121 | 2121 | } |
| 2122 | 2122 | print '</td>'; |
| 2123 | 2123 | } |
@@ -2138,9 +2138,9 @@ discard block |
||
| 2138 | 2138 | $img = img_warning($langs->trans("StockTooLow")); |
| 2139 | 2139 | } |
| 2140 | 2140 | print "<tr class=\"oddeven\"><td> -> |
| 2141 | - <a href=\"" . DOL_URL_ROOT . "/product/card.php?id=" . $value['id'] . "\">" . $value['fullpath'] . " |
|
| 2142 | - </a> (" . $value['nb'] . ")</td><td class=\"center\"> " . $value['nb_total'] . "</td><td> </td><td> </td> |
|
| 2143 | - <td class=\"center\">" . $value['stock'] . " " . $img . "</td>"; |
|
| 2141 | + <a href=\"" . DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']." |
|
| 2142 | + </a> (" . $value['nb'].")</td><td class=\"center\"> ".$value['nb_total']."</td><td> </td><td> </td> |
|
| 2143 | + <td class=\"center\">" . $value['stock']." ".$img."</td>"; |
|
| 2144 | 2144 | if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
| 2145 | 2145 | print '<td></td>'; |
| 2146 | 2146 | } //StockEntrydate |
@@ -2170,7 +2170,7 @@ discard block |
||
| 2170 | 2170 | $nbofsuggested++; |
| 2171 | 2171 | } |
| 2172 | 2172 | } |
| 2173 | - print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">'; |
|
| 2173 | + print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">'; |
|
| 2174 | 2174 | if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) { |
| 2175 | 2175 | foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch |
| 2176 | 2176 | //var_dump($dbatch); |
@@ -2196,7 +2196,7 @@ discard block |
||
| 2196 | 2196 | $deliverableQty = 0; |
| 2197 | 2197 | } |
| 2198 | 2198 | |
| 2199 | - $inputName = 'qtyl' . $indiceAsked . '_' . $subj; |
|
| 2199 | + $inputName = 'qtyl'.$indiceAsked.'_'.$subj; |
|
| 2200 | 2200 | if (GETPOSTISSET($inputName)) { |
| 2201 | 2201 | $deliverableQty = GETPOST($inputName, 'int'); |
| 2202 | 2202 | } |
@@ -2204,37 +2204,37 @@ discard block |
||
| 2204 | 2204 | $tooltipClass = $tooltipTitle = ''; |
| 2205 | 2205 | if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { |
| 2206 | 2206 | $tooltipClass = ' classfortooltip'; |
| 2207 | - $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
|
| 2207 | + $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
|
| 2208 | 2208 | } else { |
| 2209 | 2209 | $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0; |
| 2210 | 2210 | } |
| 2211 | 2211 | $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
| 2212 | 2212 | |
| 2213 | - print '<!-- subj=' . $subj . '/' . $nbofsuggested . ' --><tr ' . ((($subj + 1) == $nbofsuggested) ? 'oddeven' : '') . '>'; |
|
| 2213 | + print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'>'; |
|
| 2214 | 2214 | print '<td colspan="3" ></td><td class="center">'; |
| 2215 | 2215 | $qtylValue = $deliverableQty; |
| 2216 | 2216 | if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) { |
| 2217 | 2217 | $qtylValue = ''; |
| 2218 | 2218 | } |
| 2219 | - print '<input class="qtyl ' . $tooltipClass . ' right" title="' . $tooltipTitle . '" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '_' . $subj . '" type="text" size="4" value="' . $qtylValue . '">'; |
|
| 2219 | + print '<input class="qtyl '.$tooltipClass.' right" title="'.$tooltipTitle.'" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$qtylValue.'">'; |
|
| 2220 | 2220 | print '</td>'; |
| 2221 | 2221 | |
| 2222 | 2222 | print '<!-- Show details of lot -->'; |
| 2223 | 2223 | print '<td class="left">'; |
| 2224 | 2224 | |
| 2225 | - print $staticwarehouse->getNomUrl(0) . ' / '; |
|
| 2225 | + print $staticwarehouse->getNomUrl(0).' / '; |
|
| 2226 | 2226 | |
| 2227 | - print '<input name="batchl' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $dbatch->id . '">'; |
|
| 2227 | + print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">'; |
|
| 2228 | 2228 | |
| 2229 | 2229 | $detail = ''; |
| 2230 | - $detail .= $langs->trans("Batch") . ': ' . $dbatch->batch; |
|
| 2230 | + $detail .= $langs->trans("Batch").': '.$dbatch->batch; |
|
| 2231 | 2231 | if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY') && !empty($dbatch->sellby)) { |
| 2232 | - $detail .= ' - ' . $langs->trans("SellByDate") . ': ' . dol_print_date($dbatch->sellby, "day"); |
|
| 2232 | + $detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); |
|
| 2233 | 2233 | } |
| 2234 | 2234 | if (!getDolGlobalString('PRODUCT_DISABLE_EATBY') && !empty($dbatch->eatby)) { |
| 2235 | - $detail .= ' - ' . $langs->trans("EatByDate") . ': ' . dol_print_date($dbatch->eatby, "day"); |
|
| 2235 | + $detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); |
|
| 2236 | 2236 | } |
| 2237 | - $detail .= ' - ' . $langs->trans("Qty") . ': ' . $dbatch->qty; |
|
| 2237 | + $detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty; |
|
| 2238 | 2238 | $detail .= '<br>'; |
| 2239 | 2239 | print $detail; |
| 2240 | 2240 | |
@@ -2245,18 +2245,18 @@ discard block |
||
| 2245 | 2245 | $subj++; |
| 2246 | 2246 | print '</td>'; |
| 2247 | 2247 | if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
| 2248 | - print '<td>' . dol_print_date($dbatch->context['stock_entry_date'], 'day') . '</td>'; //StockEntrydate |
|
| 2248 | + print '<td>'.dol_print_date($dbatch->context['stock_entry_date'], 'day').'</td>'; //StockEntrydate |
|
| 2249 | 2249 | } |
| 2250 | 2250 | print '</tr>'; |
| 2251 | 2251 | } |
| 2252 | 2252 | } else { |
| 2253 | 2253 | print '<!-- Case there is no details of lot at all -->'; |
| 2254 | 2254 | print '<tr class="oddeven"><td colspan="3"></td><td class="center">'; |
| 2255 | - print '<input class="qtyl right" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '_' . $subj . '" type="text" size="4" value="0" disabled="disabled"> '; |
|
| 2255 | + print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> '; |
|
| 2256 | 2256 | print '</td>'; |
| 2257 | 2257 | |
| 2258 | 2258 | print '<td class="left">'; |
| 2259 | - print img_warning() . ' ' . $langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->label); |
|
| 2259 | + print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->label); |
|
| 2260 | 2260 | print '</td>'; |
| 2261 | 2261 | if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
| 2262 | 2262 | print '<td></td>'; |
@@ -2272,9 +2272,9 @@ discard block |
||
| 2272 | 2272 | if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
| 2273 | 2273 | print '<td></td>'; |
| 2274 | 2274 | } //StockEntrydate |
| 2275 | - print '</tr>' . "\n"; // end line and start a new one for each warehouse |
|
| 2275 | + print '</tr>'."\n"; // end line and start a new one for each warehouse |
|
| 2276 | 2276 | |
| 2277 | - print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">'; |
|
| 2277 | + print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">'; |
|
| 2278 | 2278 | $subj = 0; |
| 2279 | 2279 | // Define nb of lines suggested for this order line |
| 2280 | 2280 | $nbofsuggested = 0; |
@@ -2298,8 +2298,8 @@ discard block |
||
| 2298 | 2298 | $deliverableQty = min($quantityToBeDelivered, $stock); |
| 2299 | 2299 | $deliverableQty = max(0, $deliverableQty); |
| 2300 | 2300 | // Quantity to send |
| 2301 | - print '<!-- subj=' . $subj . '/' . $nbofsuggested . ' --><tr ' . ((($subj + 1) == $nbofsuggested) ? 'oddeven' : '') . '>'; |
|
| 2302 | - print '<td colspan="3" ></td><td class="center"><!-- qty to ship (no lot management for product line indiceAsked=' . $indiceAsked . ') -->'; |
|
| 2301 | + print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'>'; |
|
| 2302 | + print '<td colspan="3" ></td><td class="center"><!-- qty to ship (no lot management for product line indiceAsked='.$indiceAsked.') -->'; |
|
| 2303 | 2303 | if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { |
| 2304 | 2304 | if (isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { |
| 2305 | 2305 | $deliverableQty = min($quantityToBeDelivered, $stock - $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]); |
@@ -2318,14 +2318,14 @@ discard block |
||
| 2318 | 2318 | $tooltipClass = $tooltipTitle = ''; |
| 2319 | 2319 | if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { |
| 2320 | 2320 | $tooltipClass = ' classfortooltip'; |
| 2321 | - $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]; |
|
| 2321 | + $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtySetted[$line->fk_product][intval($warehouse_id)]; |
|
| 2322 | 2322 | } else { |
| 2323 | 2323 | $alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = 0; |
| 2324 | 2324 | } |
| 2325 | 2325 | |
| 2326 | 2326 | $alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = $deliverableQty + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]; |
| 2327 | 2327 | |
| 2328 | - $inputName = 'qtyl' . $indiceAsked . '_' . $subj; |
|
| 2328 | + $inputName = 'qtyl'.$indiceAsked.'_'.$subj; |
|
| 2329 | 2329 | if (GETPOSTISSET($inputName)) { |
| 2330 | 2330 | $deliverableQty = GETPOSTINT($inputName); |
| 2331 | 2331 | } |
@@ -2333,11 +2333,11 @@ discard block |
||
| 2333 | 2333 | if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) { |
| 2334 | 2334 | $qtylValue = ''; |
| 2335 | 2335 | } |
| 2336 | - print '<input class="qtyl' . $tooltipClass . ' right" title="' . $tooltipTitle . '" name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '" type="text" size="4" value="' . $qtylValue . '">'; |
|
| 2337 | - print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_id . '">'; |
|
| 2336 | + print '<input class="qtyl'.$tooltipClass.' right" title="'.$tooltipTitle.'" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'" type="text" size="4" value="'.$qtylValue.'">'; |
|
| 2337 | + print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_id.'">'; |
|
| 2338 | 2338 | } else { |
| 2339 | 2339 | if (getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) { |
| 2340 | - print '<input name="qtyl' . $indiceAsked . '_' . $subj . '" id="qtyl' . $indiceAsked . '" type="hidden" value="0">'; |
|
| 2340 | + print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">'; |
|
| 2341 | 2341 | } |
| 2342 | 2342 | |
| 2343 | 2343 | print $langs->trans("NA"); |
@@ -2348,16 +2348,16 @@ discard block |
||
| 2348 | 2348 | print '<td class="left">'; |
| 2349 | 2349 | if ($line->product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { |
| 2350 | 2350 | if ($product->stockable_product == Product::ENABLED_STOCK || $productChildrenNb > 0) { |
| 2351 | - print $tmpwarehouseObject->getNomUrl(0) . ' '; |
|
| 2351 | + print $tmpwarehouseObject->getNomUrl(0).' '; |
|
| 2352 | 2352 | if ($productChildrenNb <= 0) { |
| 2353 | 2353 | print '<!-- Show details of stock -->'; |
| 2354 | - print '(' . $stock . ')'; |
|
| 2354 | + print '('.$stock.')'; |
|
| 2355 | 2355 | } |
| 2356 | 2356 | } else { |
| 2357 | - print img_warning() . ' ' . $langs->trans('StockDisabled'); |
|
| 2357 | + print img_warning().' '.$langs->trans('StockDisabled'); |
|
| 2358 | 2358 | } |
| 2359 | 2359 | } else { |
| 2360 | - print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span>'; |
|
| 2360 | + print '<span class="opacitymedium">('.$langs->trans("Service").')</span>'; |
|
| 2361 | 2361 | } |
| 2362 | 2362 | print '</td>'; |
| 2363 | 2363 | $quantityToBeDelivered -= $deliverableQty; |
@@ -2384,9 +2384,9 @@ discard block |
||
| 2384 | 2384 | } |
| 2385 | 2385 | print '<tr class"oddeven"><td>'; |
| 2386 | 2386 | print " -> |
| 2387 | - <a href=\"" . DOL_URL_ROOT . "/product/card.php?id=" . $value['id'] . "\">" . $value['fullpath'] . " |
|
| 2388 | - </a> (" . $value['nb'] . ")</td><td class=\"center\"> " . $value['nb_total'] . "</td><td> </td><td> </td> |
|
| 2389 | - <td class=\"center\">" . $value['stock'] . " " . $img . "</td>"; |
|
| 2387 | + <a href=\"" . DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']." |
|
| 2388 | + </a> (" . $value['nb'].")</td><td class=\"center\"> ".$value['nb_total']."</td><td> </td><td> </td> |
|
| 2389 | + <td class=\"center\">" . $value['stock']." ".$img."</td>"; |
|
| 2390 | 2390 | if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
| 2391 | 2391 | print '<td></td>'; |
| 2392 | 2392 | } //StockEntrydate |
@@ -2403,7 +2403,7 @@ discard block |
||
| 2403 | 2403 | print '</tr>'; // end line and start a new one for lot/serial |
| 2404 | 2404 | |
| 2405 | 2405 | $subj = 0; |
| 2406 | - print '<input name="idl' . $indiceAsked . '" type="hidden" value="' . $line->id . '">'; |
|
| 2406 | + print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">'; |
|
| 2407 | 2407 | |
| 2408 | 2408 | $tmpwarehouseObject = new Entrepot($db); |
| 2409 | 2409 | $productlotObject = new Productlot($db); |
@@ -2445,7 +2445,7 @@ discard block |
||
| 2445 | 2445 | $deliverableQty = 0; |
| 2446 | 2446 | } |
| 2447 | 2447 | |
| 2448 | - $inputName = 'qtyl' . $indiceAsked . '_' . $subj; |
|
| 2448 | + $inputName = 'qtyl'.$indiceAsked.'_'.$subj; |
|
| 2449 | 2449 | if (GETPOSTISSET($inputName)) { |
| 2450 | 2450 | $deliverableQty = GETPOSTINT($inputName); |
| 2451 | 2451 | } |
@@ -2453,30 +2453,30 @@ discard block |
||
| 2453 | 2453 | $tooltipClass = $tooltipTitle = ''; |
| 2454 | 2454 | if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { |
| 2455 | 2455 | $tooltipClass = ' classfortooltip'; |
| 2456 | - $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines') . ' : ' . $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
|
| 2456 | + $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
|
| 2457 | 2457 | } else { |
| 2458 | 2458 | $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0; |
| 2459 | 2459 | } |
| 2460 | 2460 | $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; |
| 2461 | 2461 | |
| 2462 | - print '<!-- subj=' . $subj . '/' . $nbofsuggested . ' --><tr ' . ((($subj + 1) == $nbofsuggested) ? 'oddeven' : '') . '><td colspan="3"></td><td class="center">'; |
|
| 2462 | + print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'><td colspan="3"></td><td class="center">'; |
|
| 2463 | 2463 | $qtylValue = $deliverableQty; |
| 2464 | 2464 | if (getDolGlobalBool('SHIPMENT_DONT_PREFILL_QTY', false)) { |
| 2465 | 2465 | $qtylValue = ''; |
| 2466 | 2466 | } |
| 2467 | - print '<input class="qtyl right ' . $tooltipClass . '" title="' . $tooltipTitle . '" name="' . $inputName . '" id="' . $inputName . '" type="text" size="4" value="' . $qtylValue . '">'; |
|
| 2467 | + print '<input class="qtyl right '.$tooltipClass.'" title="'.$tooltipTitle.'" name="'.$inputName.'" id="'.$inputName.'" type="text" size="4" value="'.$qtylValue.'">'; |
|
| 2468 | 2468 | print '</td>'; |
| 2469 | 2469 | |
| 2470 | 2470 | print '<td class="left">'; |
| 2471 | 2471 | |
| 2472 | - print $tmpwarehouseObject->getNomUrl(0) . ' / '; |
|
| 2472 | + print $tmpwarehouseObject->getNomUrl(0).' / '; |
|
| 2473 | 2473 | |
| 2474 | 2474 | print '<!-- Show details of lot -->'; |
| 2475 | - print '<input name="batchl' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $dbatch->id . '">'; |
|
| 2476 | - print '<input name="entl' . $indiceAsked . '_'.$subj.'" type="hidden" value="' . $tmpwarehouseObject->id . '">'; |
|
| 2475 | + print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">'; |
|
| 2476 | + print '<input name="entl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$tmpwarehouseObject->id.'">'; |
|
| 2477 | 2477 | |
| 2478 | 2478 | //print '|'.$line->fk_product.'|'.$dbatch->batch.'|<br>'; |
| 2479 | - print $langs->trans("Batch") . ': '; |
|
| 2479 | + print $langs->trans("Batch").': '; |
|
| 2480 | 2480 | $result = $productlotObject->fetch(0, $line->fk_product, $dbatch->batch); |
| 2481 | 2481 | if ($result > 0) { |
| 2482 | 2482 | print $productlotObject->getNomUrl(1); |
@@ -2484,12 +2484,12 @@ discard block |
||
| 2484 | 2484 | print $langs->trans("TableLotIncompleteRunRepairWithParamStandardEqualConfirmed"); |
| 2485 | 2485 | } |
| 2486 | 2486 | if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY') && !empty($dbatch->sellby)) { |
| 2487 | - print ' - ' . $langs->trans("SellByDate") . ': ' . dol_print_date($dbatch->sellby, "day"); |
|
| 2487 | + print ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); |
|
| 2488 | 2488 | } |
| 2489 | 2489 | if (!getDolGlobalString('PRODUCT_DISABLE_EATBY') && !empty($dbatch->eatby)) { |
| 2490 | - print ' - ' . $langs->trans("EatByDate") . ': ' . dol_print_date($dbatch->eatby, "day"); |
|
| 2490 | + print ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); |
|
| 2491 | 2491 | } |
| 2492 | - print ' (' . $dbatch->qty . ')'; |
|
| 2492 | + print ' ('.$dbatch->qty.')'; |
|
| 2493 | 2493 | $quantityToBeDelivered -= $deliverableQty; |
| 2494 | 2494 | if ($quantityToBeDelivered < 0) { |
| 2495 | 2495 | $quantityToBeDelivered = 0; |
@@ -2498,7 +2498,7 @@ discard block |
||
| 2498 | 2498 | $subj++; |
| 2499 | 2499 | print '</td>'; |
| 2500 | 2500 | if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
| 2501 | - print '<td class="left">' . dol_print_date($dbatch->context['stock_entry_date'], 'day') . '</td>'; |
|
| 2501 | + print '<td class="left">'.dol_print_date($dbatch->context['stock_entry_date'], 'day').'</td>'; |
|
| 2502 | 2502 | } |
| 2503 | 2503 | print '</tr>'; |
| 2504 | 2504 | } |
@@ -2525,7 +2525,7 @@ discard block |
||
| 2525 | 2525 | } |
| 2526 | 2526 | print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled ? ' '.$disabled : '').'> '; |
| 2527 | 2527 | if (empty($disabled) && (!getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER') || $product->stockable_product == Product::DISABLED_STOCK)) { |
| 2528 | - print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">'; |
|
| 2528 | + print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">'; |
|
| 2529 | 2529 | } |
| 2530 | 2530 | } elseif ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { |
| 2531 | 2531 | $disabled = ''; |
@@ -2537,7 +2537,7 @@ discard block |
||
| 2537 | 2537 | } |
| 2538 | 2538 | print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$quantityToBeDelivered.'"'.($disabled ? ' '.$disabled : '').'> '; |
| 2539 | 2539 | if (empty($disabled) && !getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER')) { |
| 2540 | - print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">'; |
|
| 2540 | + print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">'; |
|
| 2541 | 2541 | } |
| 2542 | 2542 | } else { |
| 2543 | 2543 | print $langs->trans("NA"); |
@@ -2549,20 +2549,20 @@ discard block |
||
| 2549 | 2549 | if ($warehouse_selected_id > 0 && $product->stockable_product == Product::ENABLED_STOCK) { |
| 2550 | 2550 | $warehouseObject = new Entrepot($db); |
| 2551 | 2551 | $warehouseObject->fetch($warehouse_selected_id); |
| 2552 | - print img_warning() . ' ' . $langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->label); |
|
| 2552 | + print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->label); |
|
| 2553 | 2553 | } else { |
| 2554 | 2554 | if ($line->fk_product) { |
| 2555 | 2555 | if ($product->stockable_product == Product::ENABLED_STOCK) { |
| 2556 | - print img_warning() . ' ' . $langs->trans('StockTooLow'); |
|
| 2556 | + print img_warning().' '.$langs->trans('StockTooLow'); |
|
| 2557 | 2557 | } else { |
| 2558 | - print img_warning() . ' ' . $langs->trans('StockDisabled'); |
|
| 2558 | + print img_warning().' '.$langs->trans('StockDisabled'); |
|
| 2559 | 2559 | } |
| 2560 | 2560 | } else { |
| 2561 | 2561 | print ''; |
| 2562 | 2562 | } |
| 2563 | 2563 | } |
| 2564 | 2564 | } else { |
| 2565 | - print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span>'; |
|
| 2565 | + print '<span class="opacitymedium">('.$langs->trans("Service").')</span>'; |
|
| 2566 | 2566 | } |
| 2567 | 2567 | print '</td>'; |
| 2568 | 2568 | if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { |
@@ -2606,7 +2606,7 @@ discard block |
||
| 2606 | 2606 | } |
| 2607 | 2607 | } |
| 2608 | 2608 | } elseif ($object->id > 0) { |
| 2609 | - '@phan-var-force Expedition $object'; // Need to force it (type overridden earlier) |
|
| 2609 | + '@phan-var-force Expedition $object'; // Need to force it (type overridden earlier) |
|
| 2610 | 2610 | |
| 2611 | 2611 | // Edit and view mode |
| 2612 | 2612 | |
@@ -2646,7 +2646,7 @@ discard block |
||
| 2646 | 2646 | ); |
| 2647 | 2647 | } |
| 2648 | 2648 | $formconfirm = $form->formconfirm( |
| 2649 | - $_SERVER['PHP_SELF'] . '?id=' . $object->id, |
|
| 2649 | + $_SERVER['PHP_SELF'].'?id='.$object->id, |
|
| 2650 | 2650 | $langs->trans('DeleteSending'), |
| 2651 | 2651 | $langs->trans("ConfirmDeleteSending", $object->ref), |
| 2652 | 2652 | 'confirm_delete', |
@@ -2667,7 +2667,7 @@ discard block |
||
| 2667 | 2667 | $title = "DeleteTitleLine"; |
| 2668 | 2668 | $question = "ConfirmDeleteTitleLine"; |
| 2669 | 2669 | } |
| 2670 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1); |
|
| 2670 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1); |
|
| 2671 | 2671 | } |
| 2672 | 2672 | |
| 2673 | 2673 | // Confirm validation |
@@ -2681,13 +2681,13 @@ discard block |
||
| 2681 | 2681 | |
| 2682 | 2682 | $text = $langs->trans("ConfirmValidateSending", $numref); |
| 2683 | 2683 | if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) { |
| 2684 | - $text .= '<br>' . img_picto('', 'movement', 'class="pictofixedwidth"') . $langs->trans("StockMovementWillBeRecorded") . '.'; |
|
| 2684 | + $text .= '<br>'.img_picto('', 'movement', 'class="pictofixedwidth"').$langs->trans("StockMovementWillBeRecorded").'.'; |
|
| 2685 | 2685 | } elseif (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { |
| 2686 | - $text .= '<br>' . img_picto('', 'movement', 'class="pictofixedwidth"') . $langs->trans("StockMovementNotYetRecorded") . '.'; |
|
| 2686 | + $text .= '<br>'.img_picto('', 'movement', 'class="pictofixedwidth"').$langs->trans("StockMovementNotYetRecorded").'.'; |
|
| 2687 | 2687 | } |
| 2688 | 2688 | |
| 2689 | 2689 | if (isModEnabled('notification')) { |
| 2690 | - require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; |
|
| 2690 | + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; |
|
| 2691 | 2691 | $notify = new Notify($db); |
| 2692 | 2692 | $text .= '<br>'; |
| 2693 | 2693 | $text .= $notify->confirmMessage('SHIPPING_VALIDATE', $object->socid, $object); |
@@ -2698,14 +2698,14 @@ discard block |
||
| 2698 | 2698 | |
| 2699 | 2699 | // Confirm cancellation |
| 2700 | 2700 | if ($action == 'cancel') { |
| 2701 | - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('CancelSending'), $langs->trans("ConfirmCancelSending", $object->ref), 'confirm_cancel', '', 0, 1); |
|
| 2701 | + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('CancelSending'), $langs->trans("ConfirmCancelSending", $object->ref), 'confirm_cancel', '', 0, 1); |
|
| 2702 | 2702 | } |
| 2703 | 2703 | |
| 2704 | 2704 | // Confirm sign |
| 2705 | 2705 | if ($action == 'sign') { |
| 2706 | 2706 | $text = $langs->trans('ConfirmSignShipping'); |
| 2707 | 2707 | if (isModEnabled('notification')) { |
| 2708 | - require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; |
|
| 2708 | + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; |
|
| 2709 | 2709 | $notify = new Notify($db); |
| 2710 | 2710 | $text .= '<br>'; |
| 2711 | 2711 | $text .= $notify->confirmMessage('SHIPPING_MODIFY', $object->socid, $object); |
@@ -2715,7 +2715,7 @@ discard block |
||
| 2715 | 2715 | 'type' => 'select', |
| 2716 | 2716 | 'name' => 'signed_status', |
| 2717 | 2717 | 'select_show_empty' => 0, |
| 2718 | - 'label' => '<span class="fieldrequired">' . $langs->trans('SignStatus') . '</span>', |
|
| 2718 | + 'label' => '<span class="fieldrequired">'.$langs->trans('SignStatus').'</span>', |
|
| 2719 | 2719 | 'values' => $object->getSignedStatusLocalisedArray() |
| 2720 | 2720 | ]; |
| 2721 | 2721 | $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('SignShipping'), $text, 'confirm_sign', $formquestion, 0, 1); |
@@ -2725,7 +2725,7 @@ discard block |
||
| 2725 | 2725 | if ($action == 'unsign') { |
| 2726 | 2726 | $text = $langs->trans('ConfirmUnsignShipping'); |
| 2727 | 2727 | if (isModEnabled('notification')) { |
| 2728 | - require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; |
|
| 2728 | + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; |
|
| 2729 | 2729 | $notify = new Notify($db); |
| 2730 | 2730 | $text .= '<br>'; |
| 2731 | 2731 | $text .= $notify->confirmMessage('SHIPPING_MODIFY', $object->socid, $object); |
@@ -2761,14 +2761,14 @@ discard block |
||
| 2761 | 2761 | } |
| 2762 | 2762 | |
| 2763 | 2763 | // Shipment card |
| 2764 | - $linkback = '<a href="' . DOL_URL_ROOT . '/expedition/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 2764 | + $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 2765 | 2765 | $morehtmlref = '<div class="refidno">'; |
| 2766 | 2766 | // Ref customer shipment |
| 2767 | 2767 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1); |
| 2768 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string' . (isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2768 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 2769 | 2769 | |
| 2770 | 2770 | // Thirdparty |
| 2771 | - $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1); |
|
| 2771 | + $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1); |
|
| 2772 | 2772 | |
| 2773 | 2773 | // Project |
| 2774 | 2774 | if ($origin && $origin_id > 0) { |
@@ -2800,16 +2800,16 @@ discard block |
||
| 2800 | 2800 | if ($permissiontoadd) { |
| 2801 | 2801 | $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); |
| 2802 | 2802 | if ($action != 'classify') { |
| 2803 | - $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> '; |
|
| 2803 | + $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> '; |
|
| 2804 | 2804 | } |
| 2805 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 2805 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); |
|
| 2806 | 2806 | } else { |
| 2807 | 2807 | if (!empty($object->fk_project)) { |
| 2808 | 2808 | $proj = new Project($db); |
| 2809 | 2809 | $proj->fetch($object->fk_project); |
| 2810 | 2810 | $morehtmlref .= $proj->getNomUrl(1); |
| 2811 | 2811 | if ($proj->title) { |
| 2812 | - $morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>'; |
|
| 2812 | + $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>'; |
|
| 2813 | 2813 | } |
| 2814 | 2814 | } |
| 2815 | 2815 | } |
@@ -2828,7 +2828,7 @@ discard block |
||
| 2828 | 2828 | // Linked documents |
| 2829 | 2829 | if (!empty($typeobject) && $typeobject == 'commande' && $object->origin_object->id && isModEnabled('order')) { |
| 2830 | 2830 | print '<tr><td>'; |
| 2831 | - print $langs->trans("RefOrder") . '</td>'; |
|
| 2831 | + print $langs->trans("RefOrder").'</td>'; |
|
| 2832 | 2832 | print '<td>'; |
| 2833 | 2833 | print $objectsrc->getNomUrl(1, 'commande'); |
| 2834 | 2834 | print "</td>\n"; |
@@ -2836,7 +2836,7 @@ discard block |
||
| 2836 | 2836 | } |
| 2837 | 2837 | if (!empty($typeobject) && $typeobject == 'propal' && $object->origin_object->id && isModEnabled("propal")) { |
| 2838 | 2838 | print '<tr><td>'; |
| 2839 | - print $langs->trans("RefProposal") . '</td>'; |
|
| 2839 | + print $langs->trans("RefProposal").'</td>'; |
|
| 2840 | 2840 | print '<td>'; |
| 2841 | 2841 | print $objectsrc->getNomUrl(1, 'expedition'); |
| 2842 | 2842 | print "</td>\n"; |
@@ -2844,8 +2844,8 @@ discard block |
||
| 2844 | 2844 | } |
| 2845 | 2845 | |
| 2846 | 2846 | // Date creation |
| 2847 | - print '<tr><td class="titlefieldmiddle">' . $langs->trans("DateCreation") . '</td>'; |
|
| 2848 | - print '<td>' . dol_print_date($object->date_creation, "dayhour") . "</td>\n"; |
|
| 2847 | + print '<tr><td class="titlefieldmiddle">'.$langs->trans("DateCreation").'</td>'; |
|
| 2848 | + print '<td>'.dol_print_date($object->date_creation, "dayhour")."</td>\n"; |
|
| 2849 | 2849 | print '</tr>'; |
| 2850 | 2850 | |
| 2851 | 2851 | // Delivery date planned |
@@ -2854,16 +2854,16 @@ discard block |
||
| 2854 | 2854 | print $langs->trans('DateDeliveryPlanned'); |
| 2855 | 2855 | print '</td>'; |
| 2856 | 2856 | if ($action != 'editdate_livraison') { |
| 2857 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdate_livraison&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetDeliveryDate'), 1) . '</a></td>'; |
|
| 2857 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).'</a></td>'; |
|
| 2858 | 2858 | } |
| 2859 | 2859 | print '</tr></table>'; |
| 2860 | 2860 | print '</td><td>'; |
| 2861 | 2861 | if ($action == 'editdate_livraison') { |
| 2862 | - print '<form name="setdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; |
|
| 2863 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 2862 | + print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; |
|
| 2863 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 2864 | 2864 | print '<input type="hidden" name="action" value="setdate_livraison">'; |
| 2865 | 2865 | print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0); |
| 2866 | - print '<input type="submit" class="button button-edit smallpaddingimp" value="' . $langs->trans('Modify') . '">'; |
|
| 2866 | + print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">'; |
|
| 2867 | 2867 | print '</form>'; |
| 2868 | 2868 | } else { |
| 2869 | 2869 | print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; |
@@ -2877,16 +2877,16 @@ discard block |
||
| 2877 | 2877 | print $langs->trans('DateShipping'); |
| 2878 | 2878 | print '</td>'; |
| 2879 | 2879 | if ($action != 'editdate_shipping') { |
| 2880 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdate_shipping&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetShippingDate'), 1) . '</a></td>'; |
|
| 2880 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate_shipping&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingDate'), 1).'</a></td>'; |
|
| 2881 | 2881 | } |
| 2882 | 2882 | print '</tr></table>'; |
| 2883 | 2883 | print '</td><td>'; |
| 2884 | 2884 | if ($action == 'editdate_shipping') { |
| 2885 | - print '<form name="setdate_shipping" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; |
|
| 2886 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 2885 | + print '<form name="setdate_shipping" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; |
|
| 2886 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 2887 | 2887 | print '<input type="hidden" name="action" value="setdate_shipping">'; |
| 2888 | 2888 | print $form->selectDate($object->date_shipping ? $object->date_shipping : -1, 'ship_', 1, 1, 0, "setdate_shipping", 1, 0); |
| 2889 | - print '<input type="submit" class="button button-edit smallpaddingimp" value="' . $langs->trans('Modify') . '">'; |
|
| 2889 | + print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">'; |
|
| 2890 | 2890 | print '</form>'; |
| 2891 | 2891 | } else { |
| 2892 | 2892 | print $object->date_shipping ? dol_print_date($object->date_shipping, 'dayhour') : ' '; |
@@ -2900,24 +2900,24 @@ discard block |
||
| 2900 | 2900 | print '</td><td>'; |
| 2901 | 2901 | |
| 2902 | 2902 | if ($action == 'edittrueWeight') { |
| 2903 | - print '<form name="settrueweight" action="' . $_SERVER["PHP_SELF"] . '" method="post">'; |
|
| 2903 | + print '<form name="settrueweight" action="'.$_SERVER["PHP_SELF"].'" method="post">'; |
|
| 2904 | 2904 | print '<input name="action" value="settrueWeight" type="hidden">'; |
| 2905 | - print '<input name="id" value="' . $object->id . '" type="hidden">'; |
|
| 2906 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 2907 | - print '<input id="trueWeight" name="trueWeight" value="' . $object->trueWeight . '" type="text" class="width50 valignmiddle">'; |
|
| 2905 | + print '<input name="id" value="'.$object->id.'" type="hidden">'; |
|
| 2906 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 2907 | + print '<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.'" type="text" class="width50 valignmiddle">'; |
|
| 2908 | 2908 | print $formproduct->selectMeasuringUnits("weight_units", "weight", (string) $object->weight_units, 0, 2, 'maxwidth125 valignmiddle'); |
| 2909 | - print ' <input class="button smallpaddingimp valignmiddle" name="modify" value="' . $langs->trans("Modify") . '" type="submit">'; |
|
| 2910 | - print ' <input class="button button-cancel smallpaddingimp valignmiddle" name="cancel" value="' . $langs->trans("Cancel") . '" type="submit">'; |
|
| 2909 | + print ' <input class="button smallpaddingimp valignmiddle" name="modify" value="'.$langs->trans("Modify").'" type="submit">'; |
|
| 2910 | + print ' <input class="button button-cancel smallpaddingimp valignmiddle" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">'; |
|
| 2911 | 2911 | print '</form>'; |
| 2912 | 2912 | } else { |
| 2913 | 2913 | print $object->trueWeight; |
| 2914 | - print ($object->trueWeight && $object->weight_units != '') ? ' ' . measuringUnitString(0, "weight", $object->weight_units) : ''; |
|
| 2914 | + print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; |
|
| 2915 | 2915 | } |
| 2916 | 2916 | |
| 2917 | 2917 | // Calculated |
| 2918 | 2918 | if ($totalWeight > 0) { |
| 2919 | 2919 | if (!empty($object->trueWeight)) { |
| 2920 | - print ' (' . $langs->trans("SumOfProductWeights") . ': '; |
|
| 2920 | + print ' ('.$langs->trans("SumOfProductWeights").': '; |
|
| 2921 | 2921 | } |
| 2922 | 2922 | print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no')); |
| 2923 | 2923 | if (!empty($object->trueWeight)) { |
@@ -2927,34 +2927,34 @@ discard block |
||
| 2927 | 2927 | print '</td></tr>'; |
| 2928 | 2928 | |
| 2929 | 2929 | // Width |
| 2930 | - print '<tr><td>' . $form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')) . '</td><td>'; |
|
| 2930 | + print '<tr><td>'.$form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')).'</td><td>'; |
|
| 2931 | 2931 | print $form->editfieldval("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')); |
| 2932 | - print ($object->trueWidth && $object->width_units != '') ? ' ' . measuringUnitString(0, "size", $object->width_units) : ''; |
|
| 2932 | + print ($object->trueWidth && $object->width_units != '') ? ' '.measuringUnitString(0, "size", $object->width_units) : ''; |
|
| 2933 | 2933 | print '</td></tr>'; |
| 2934 | 2934 | |
| 2935 | 2935 | // Height |
| 2936 | - print '<tr><td>' . $form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')) . '</td><td>'; |
|
| 2936 | + print '<tr><td>'.$form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')).'</td><td>'; |
|
| 2937 | 2937 | if ($action == 'edittrueHeight') { |
| 2938 | - print '<form name="settrueHeight" action="' . $_SERVER["PHP_SELF"] . '" method="post">'; |
|
| 2938 | + print '<form name="settrueHeight" action="'.$_SERVER["PHP_SELF"].'" method="post">'; |
|
| 2939 | 2939 | print '<input name="action" value="settrueHeight" type="hidden">'; |
| 2940 | - print '<input name="id" value="' . $object->id . '" type="hidden">'; |
|
| 2941 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 2942 | - print '<input id="trueHeight" name="trueHeight" value="' . $object->trueHeight . '" type="text" class="width50">'; |
|
| 2940 | + print '<input name="id" value="'.$object->id.'" type="hidden">'; |
|
| 2941 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 2942 | + print '<input id="trueHeight" name="trueHeight" value="'.$object->trueHeight.'" type="text" class="width50">'; |
|
| 2943 | 2943 | print $formproduct->selectMeasuringUnits("size_units", "size", $object->size_units, 0, 2); |
| 2944 | - print ' <input class="button smallpaddingimp" name="modify" value="' . $langs->trans("Modify") . '" type="submit">'; |
|
| 2945 | - print ' <input class="button button-cancel smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '" type="submit">'; |
|
| 2944 | + print ' <input class="button smallpaddingimp" name="modify" value="'.$langs->trans("Modify").'" type="submit">'; |
|
| 2945 | + print ' <input class="button button-cancel smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">'; |
|
| 2946 | 2946 | print '</form>'; |
| 2947 | 2947 | } else { |
| 2948 | 2948 | print $object->trueHeight; |
| 2949 | - print ($object->trueHeight && $object->height_units != '') ? ' ' . measuringUnitString(0, "size", $object->height_units) : ''; |
|
| 2949 | + print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : ''; |
|
| 2950 | 2950 | } |
| 2951 | 2951 | |
| 2952 | 2952 | print '</td></tr>'; |
| 2953 | 2953 | |
| 2954 | 2954 | // Depth |
| 2955 | - print '<tr><td>' . $form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')) . '</td><td>'; |
|
| 2955 | + print '<tr><td>'.$form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')).'</td><td>'; |
|
| 2956 | 2956 | print $form->editfieldval("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')); |
| 2957 | - print ($object->trueDepth && $object->depth_units != '') ? ' ' . measuringUnitString(0, "size", $object->depth_units) : ''; |
|
| 2957 | + print ($object->trueDepth && $object->depth_units != '') ? ' '.measuringUnitString(0, "size", $object->depth_units) : ''; |
|
| 2958 | 2958 | print '</td></tr>'; |
| 2959 | 2959 | |
| 2960 | 2960 | // Volume |
@@ -2973,12 +2973,12 @@ discard block |
||
| 2973 | 2973 | if ($volumeUnit < 50) { |
| 2974 | 2974 | print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no')); |
| 2975 | 2975 | } else { |
| 2976 | - print $calculatedVolume . ' ' . measuringUnitString(0, "volume", $volumeUnit); |
|
| 2976 | + print $calculatedVolume.' '.measuringUnitString(0, "volume", $volumeUnit); |
|
| 2977 | 2977 | } |
| 2978 | 2978 | } |
| 2979 | 2979 | if ($totalVolume > 0) { |
| 2980 | 2980 | if ($calculatedVolume) { |
| 2981 | - print ' (' . $langs->trans("SumOfProductVolumes") . ': '; |
|
| 2981 | + print ' ('.$langs->trans("SumOfProductVolumes").': '; |
|
| 2982 | 2982 | } |
| 2983 | 2983 | print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no')); |
| 2984 | 2984 | //if (empty($calculatedVolume)) print ' ('.$langs->trans("Calculated").')'; |
@@ -2991,7 +2991,7 @@ discard block |
||
| 2991 | 2991 | |
| 2992 | 2992 | // Other attributes |
| 2993 | 2993 | //$cols = 2; |
| 2994 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 2994 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 2995 | 2995 | |
| 2996 | 2996 | print '</table>'; |
| 2997 | 2997 | |
@@ -3008,33 +3008,33 @@ discard block |
||
| 3008 | 3008 | print '</td>'; |
| 3009 | 3009 | |
| 3010 | 3010 | if ($action != 'editshipping_method_id' && $permissiontoadd) { |
| 3011 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editshipping_method_id&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetSendingMethod'), 1) . '</a></td>'; |
|
| 3011 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshipping_method_id&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).'</a></td>'; |
|
| 3012 | 3012 | } |
| 3013 | 3013 | print '</tr></table>'; |
| 3014 | 3014 | print '</td><td>'; |
| 3015 | 3015 | if ($action == 'editshipping_method_id') { |
| 3016 | - print '<form name="setshipping_method_id" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; |
|
| 3017 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 3016 | + print '<form name="setshipping_method_id" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; |
|
| 3017 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 3018 | 3018 | print '<input type="hidden" name="action" value="setshipping_method_id">'; |
| 3019 | 3019 | $object->fetch_delivery_methods(); |
| 3020 | 3020 | print $form->selectarray("shipping_method_id", $object->meths, $object->shipping_method_id, 1, 0, 0, "", 1); |
| 3021 | 3021 | if ($user->admin) { |
| 3022 | 3022 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 3023 | 3023 | } |
| 3024 | - print '<input type="submit" class="button button-edit smallpaddingimp" value="' . $langs->trans('Modify') . '">'; |
|
| 3024 | + print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">'; |
|
| 3025 | 3025 | print '</form>'; |
| 3026 | 3026 | } else { |
| 3027 | 3027 | if ($object->shipping_method_id > 0) { |
| 3028 | 3028 | // Get code using getLabelFromKey |
| 3029 | 3029 | $code = $langs->getLabelFromKey($db, (string) $object->shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); |
| 3030 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 3030 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 3031 | 3031 | } |
| 3032 | 3032 | } |
| 3033 | 3033 | print '</td>'; |
| 3034 | 3034 | print '</tr>'; |
| 3035 | 3035 | |
| 3036 | 3036 | // Tracking Number |
| 3037 | - print '<tr><td class="titlefieldmiddle">' . $form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')) . '</td><td>'; |
|
| 3037 | + print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')).'</td><td>'; |
|
| 3038 | 3038 | print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->hasRight('expedition', 'creer'), 'safehtmlstring', $object->tracking_number); |
| 3039 | 3039 | print '</td></tr>'; |
| 3040 | 3040 | |
@@ -3045,7 +3045,7 @@ discard block |
||
| 3045 | 3045 | print $langs->trans('IncotermLabel'); |
| 3046 | 3046 | print '<td><td class="right">'; |
| 3047 | 3047 | if ($permissiontoadd) { |
| 3048 | - print '<a class="editfielda" href="' . DOL_URL_ROOT . '/expedition/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>'; |
|
| 3048 | + print '<a class="editfielda" href="'.DOL_URL_ROOT.'/expedition/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>'; |
|
| 3049 | 3049 | } else { |
| 3050 | 3050 | print ' '; |
| 3051 | 3051 | } |
@@ -3055,7 +3055,7 @@ discard block |
||
| 3055 | 3055 | if ($action != 'editincoterm') { |
| 3056 | 3056 | print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); |
| 3057 | 3057 | } else { |
| 3058 | - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id); |
|
| 3058 | + print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); |
|
| 3059 | 3059 | } |
| 3060 | 3060 | print '</td></tr>'; |
| 3061 | 3061 | } |
@@ -3132,11 +3132,11 @@ discard block |
||
| 3132 | 3132 | // Lines of products of origin |
| 3133 | 3133 | if (!empty($object->origin) && $object->origin_id > 0) { |
| 3134 | 3134 | if ($action == 'editline') { |
| 3135 | - print ' <form name="updateline" id="updateline" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $line_id . '" method="POST"> |
|
| 3136 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
| 3135 | + print ' <form name="updateline" id="updateline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$line_id.'" method="POST"> |
|
| 3136 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
| 3137 | 3137 | <input type="hidden" name="action" value="updateline"> |
| 3138 | 3138 | <input type="hidden" name="mode" value=""> |
| 3139 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
| 3139 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
| 3140 | 3140 | '; |
| 3141 | 3141 | } |
| 3142 | 3142 | print '<br>'; |
@@ -3150,11 +3150,11 @@ discard block |
||
| 3150 | 3150 | print '<td width="5" class="center linecolnum"> </td>'; |
| 3151 | 3151 | } |
| 3152 | 3152 | // Product/Service |
| 3153 | - print '<td class="linecoldescription" >' . $langs->trans("Products") . '</td>'; |
|
| 3153 | + print '<td class="linecoldescription" >'.$langs->trans("Products").'</td>'; |
|
| 3154 | 3154 | // Qty |
| 3155 | - print '<td class="center linecolqty">' . $langs->trans("QtyOrdered") . '</td>'; |
|
| 3155 | + print '<td class="center linecolqty">'.$langs->trans("QtyOrdered").'</td>'; |
|
| 3156 | 3156 | if ($origin_id > 0) { |
| 3157 | - print '<td class="center linecolqtyinothershipments">' . $langs->trans("QtyInOtherShipments") . '</td>'; |
|
| 3157 | + print '<td class="center linecolqtyinothershipments">'.$langs->trans("QtyInOtherShipments").'</td>'; |
|
| 3158 | 3158 | } |
| 3159 | 3159 | if ($action == 'editline') { |
| 3160 | 3160 | $editColspan = 3; |
@@ -3164,35 +3164,35 @@ discard block |
||
| 3164 | 3164 | if (!isModEnabled('productbatch')) { |
| 3165 | 3165 | $editColspan--; |
| 3166 | 3166 | } |
| 3167 | - print '<td class="center linecoleditlineotherinfo" colspan="' . $editColspan . '">'; |
|
| 3167 | + print '<td class="center linecoleditlineotherinfo" colspan="'.$editColspan.'">'; |
|
| 3168 | 3168 | if ($object->status <= 1) { |
| 3169 | 3169 | print $langs->trans("QtyToShip"); |
| 3170 | 3170 | } else { |
| 3171 | 3171 | print $langs->trans("QtyShipped"); |
| 3172 | 3172 | } |
| 3173 | 3173 | if (isModEnabled('stock')) { |
| 3174 | - print ' - ' . $langs->trans("WarehouseSource"); |
|
| 3174 | + print ' - '.$langs->trans("WarehouseSource"); |
|
| 3175 | 3175 | } |
| 3176 | 3176 | if (isModEnabled('productbatch')) { |
| 3177 | - print ' - ' . $langs->trans("Batch"); |
|
| 3177 | + print ' - '.$langs->trans("Batch"); |
|
| 3178 | 3178 | } |
| 3179 | 3179 | print '</td>'; |
| 3180 | 3180 | } else { |
| 3181 | 3181 | if ($object->status <= 1) { |
| 3182 | - print '<td class="center linecolqtytoship">' . $langs->trans("QtyToShip") . '</td>'; |
|
| 3182 | + print '<td class="center linecolqtytoship">'.$langs->trans("QtyToShip").'</td>'; |
|
| 3183 | 3183 | } else { |
| 3184 | - print '<td class="center linecolqtyshipped">' . $langs->trans("QtyShipped") . '</td>'; |
|
| 3184 | + print '<td class="center linecolqtyshipped">'.$langs->trans("QtyShipped").'</td>'; |
|
| 3185 | 3185 | } |
| 3186 | 3186 | if (isModEnabled('stock')) { |
| 3187 | - print '<td class="left linecolwarehousesource">' . $langs->trans("WarehouseSource") . '</td>'; |
|
| 3187 | + print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>'; |
|
| 3188 | 3188 | } |
| 3189 | 3189 | |
| 3190 | 3190 | if (isModEnabled('productbatch')) { |
| 3191 | - print '<td class="left linecolbatch">' . $langs->trans("Batch") . '</td>'; |
|
| 3191 | + print '<td class="left linecolbatch">'.$langs->trans("Batch").'</td>'; |
|
| 3192 | 3192 | } |
| 3193 | 3193 | } |
| 3194 | - print '<td class="center linecolweight">' . $langs->trans("CalculatedWeight") . '</td>'; |
|
| 3195 | - print '<td class="center linecolvolume">' . $langs->trans("CalculatedVolume") . '</td>'; |
|
| 3194 | + print '<td class="center linecolweight">'.$langs->trans("CalculatedWeight").'</td>'; |
|
| 3195 | + print '<td class="center linecolvolume">'.$langs->trans("CalculatedVolume").'</td>'; |
|
| 3196 | 3196 | //print '<td class="center">'.$langs->trans("Size").'</td>'; |
| 3197 | 3197 | if ($object->status == 0) { |
| 3198 | 3198 | print '<td class="linecoledit"></td>'; |
@@ -3227,13 +3227,13 @@ discard block |
||
| 3227 | 3227 | //if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; |
| 3228 | 3228 | $sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch'; |
| 3229 | 3229 | $sql .= ', p.description as product_desc'; |
| 3230 | - $sql .= " FROM " . MAIN_DB_PREFIX . "expeditiondet as ed"; |
|
| 3231 | - $sql .= ", " . MAIN_DB_PREFIX . "expedition as e"; |
|
| 3232 | - $sql .= ", " . MAIN_DB_PREFIX . $origin . "det as obj"; |
|
| 3230 | + $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; |
|
| 3231 | + $sql .= ", ".MAIN_DB_PREFIX."expedition as e"; |
|
| 3232 | + $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; |
|
| 3233 | 3233 | //if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; |
| 3234 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON obj.fk_product = p.rowid"; |
|
| 3235 | - $sql .= " WHERE e.entity IN (" . getEntity('expedition') . ")"; |
|
| 3236 | - $sql .= " AND obj.fk_" . $origin . " = " . ((int) $origin_id); |
|
| 3234 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; |
|
| 3235 | + $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; |
|
| 3236 | + $sql .= " AND obj.fk_".$origin." = ".((int) $origin_id); |
|
| 3237 | 3237 | $sql .= " AND obj.rowid = ed.fk_elementdet"; |
| 3238 | 3238 | $sql .= " AND ed.fk_expedition = e.rowid"; |
| 3239 | 3239 | //if ($filter) $sql.= $filter; |
@@ -3279,12 +3279,12 @@ discard block |
||
| 3279 | 3279 | } |
| 3280 | 3280 | |
| 3281 | 3281 | if (empty($reshook) && $lines[$i]->product_type != "9") { |
| 3282 | - print '<!-- origin line id = ' . $lines[$i]->origin_line_id . ' -->'; // id of order line |
|
| 3283 | - print '<tr class="oddeven" id="row-' . $lines[$i]->id . '" data-id="' . $lines[$i]->id . '" data-element="' . $lines[$i]->element . '" >'; |
|
| 3282 | + print '<!-- origin line id = '.$lines[$i]->origin_line_id.' -->'; // id of order line |
|
| 3283 | + print '<tr class="oddeven" id="row-'.$lines[$i]->id.'" data-id="'.$lines[$i]->id.'" data-element="'.$lines[$i]->element.'" >'; |
|
| 3284 | 3284 | |
| 3285 | 3285 | // # |
| 3286 | 3286 | if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { |
| 3287 | - print '<td class="center linecolnum">' . ($i + 1) . '</td>'; |
|
| 3287 | + print '<td class="center linecolnum">'.($i + 1).'</td>'; |
|
| 3288 | 3288 | } |
| 3289 | 3289 | |
| 3290 | 3290 | // Predefined product or service |
@@ -3329,12 +3329,12 @@ discard block |
||
| 3329 | 3329 | $product_static->stockable_product = $lines[$i]->stockable_product; |
| 3330 | 3330 | |
| 3331 | 3331 | $text = $product_static->getNomUrl(1); |
| 3332 | - $text .= ' - ' . $label; |
|
| 3332 | + $text .= ' - '.$label; |
|
| 3333 | 3333 | $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->description)); |
| 3334 | 3334 | print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i); |
| 3335 | 3335 | print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : ''); |
| 3336 | 3336 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { |
| 3337 | - print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '<br>' . dol_htmlentitiesbr($lines[$i]->description) : ''; |
|
| 3337 | + print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '<br>'.dol_htmlentitiesbr($lines[$i]->description) : ''; |
|
| 3338 | 3338 | } |
| 3339 | 3339 | print "</td>\n"; |
| 3340 | 3340 | } else { |
@@ -3346,10 +3346,10 @@ discard block |
||
| 3346 | 3346 | } |
| 3347 | 3347 | |
| 3348 | 3348 | if (!empty($lines[$i]->label)) { |
| 3349 | - $text .= ' <strong>' . $lines[$i]->label . '</strong>'; |
|
| 3349 | + $text .= ' <strong>'.$lines[$i]->label.'</strong>'; |
|
| 3350 | 3350 | print $form->textwithtooltip($text, $lines[$i]->description, 3, 0, '', (string) $i); |
| 3351 | 3351 | } else { |
| 3352 | - print $text . ' ' . nl2br($lines[$i]->description); |
|
| 3352 | + print $text.' '.nl2br($lines[$i]->description); |
|
| 3353 | 3353 | } |
| 3354 | 3354 | |
| 3355 | 3355 | print_date_range($lines[$i]->date_start, $lines[$i]->date_end); |
@@ -3362,7 +3362,7 @@ discard block |
||
| 3362 | 3362 | } |
| 3363 | 3363 | |
| 3364 | 3364 | // Qty ordered |
| 3365 | - print '<td class="center linecolqty">' . $lines[$i]->qty_asked . ' ' . $unit_order . '</td>'; |
|
| 3365 | + print '<td class="center linecolqty">'.$lines[$i]->qty_asked.' '.$unit_order.'</td>'; |
|
| 3366 | 3366 | |
| 3367 | 3367 | // Qty in other shipments (with shipment and warehouse used) |
| 3368 | 3368 | if ($origin_id > 0) { |
@@ -3383,8 +3383,8 @@ discard block |
||
| 3383 | 3383 | } |
| 3384 | 3384 | $shipment_static->fetch($shipmentline_var['shipment_id']); |
| 3385 | 3385 | $htmltooltip .= $shipment_static->getNomUrl(1, '', 0, 0, 1); |
| 3386 | - $htmltooltip .= ' - ' . $shipmentline_var['qty_shipped']; |
|
| 3387 | - $htmltooltip .= ' - ' . $langs->trans("DateValidation") . ' : ' . (empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour')); |
|
| 3386 | + $htmltooltip .= ' - '.$shipmentline_var['qty_shipped']; |
|
| 3387 | + $htmltooltip .= ' - '.$langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour')); |
|
| 3388 | 3388 | /*if (isModEnabled('stock') && $shipmentline_var['warehouse'] > 0) { |
| 3389 | 3389 | $warehousestatic->fetch($shipmentline_var['warehouse']); |
| 3390 | 3390 | $htmltext .= '<br>'.$langs->trans("FromLocation").' : '.$warehousestatic->getNomUrl(1, '', 0, 1); |
@@ -3394,39 +3394,39 @@ discard block |
||
| 3394 | 3394 | $qtyalreadysent += $shipmentline_var['qty_shipped']; |
| 3395 | 3395 | } |
| 3396 | 3396 | if ($j) { |
| 3397 | - $htmltooltip = $langs->trans("QtyInOtherShipments") . '...<br><br>' . $htmltooltip . '<br><input type="submit" name="dummyhiddenbuttontogetfocus" style="display:none" autofocus>'; |
|
| 3397 | + $htmltooltip = $langs->trans("QtyInOtherShipments").'...<br><br>'.$htmltooltip.'<br><input type="submit" name="dummyhiddenbuttontogetfocus" style="display:none" autofocus>'; |
|
| 3398 | 3398 | } |
| 3399 | 3399 | } |
| 3400 | 3400 | } |
| 3401 | - print $form->textwithpicto((string) $qtyalreadysent, $htmltooltip, 1, 'info', '', 0, 3, 'tooltip' . $lines[$i]->id); |
|
| 3401 | + print $form->textwithpicto((string) $qtyalreadysent, $htmltooltip, 1, 'info', '', 0, 3, 'tooltip'.$lines[$i]->id); |
|
| 3402 | 3402 | print '</td>'; |
| 3403 | 3403 | } |
| 3404 | 3404 | |
| 3405 | 3405 | if ($action == 'editline' && $lines[$i]->id == $line_id) { |
| 3406 | 3406 | // edit mode |
| 3407 | - print '<td colspan="' . $editColspan . '" class="center"><table class="nobordernopadding centpercent">'; |
|
| 3407 | + print '<td colspan="'.$editColspan.'" class="center"><table class="nobordernopadding centpercent">'; |
|
| 3408 | 3408 | if (is_array($lines[$i]->detail_batch) && count($lines[$i]->detail_batch) > 0) { |
| 3409 | 3409 | print '<!-- case edit 1 -->'; |
| 3410 | 3410 | $line = new ExpeditionLigne($db); |
| 3411 | 3411 | foreach ($lines[$i]->detail_batch as $detail_batch) { |
| 3412 | 3412 | print '<tr>'; |
| 3413 | 3413 | // Qty to ship or shipped |
| 3414 | - print '<td><input class="qtyl right" name="qtyl' . $detail_batch->fk_expeditiondet . '_' . $detail_batch->id . '" id="qtyl' . $line_id . '_' . $detail_batch->id . '" type="text" size="4" value="' . $detail_batch->qty . '"></td>'; |
|
| 3414 | + print '<td><input class="qtyl right" name="qtyl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->id.'" id="qtyl'.$line_id.'_'.$detail_batch->id.'" type="text" size="4" value="'.$detail_batch->qty.'"></td>'; |
|
| 3415 | 3415 | // Batch number management |
| 3416 | 3416 | if ($lines[$i]->entrepot_id == 0) { |
| 3417 | 3417 | // only show lot numbers from src warehouse when shipping from multiple warehouses |
| 3418 | 3418 | $line->fetch($detail_batch->fk_expeditiondet); |
| 3419 | 3419 | } |
| 3420 | 3420 | $entrepot_id = !empty($detail_batch->entrepot_id) ? $detail_batch->entrepot_id : $lines[$i]->entrepot_id; |
| 3421 | - print '<td>' . $formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl' . $detail_batch->fk_expeditiondet . '_' . $detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id) . '</td>'; |
|
| 3421 | + print '<td>'.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).'</td>'; |
|
| 3422 | 3422 | print '</tr>'; |
| 3423 | 3423 | } |
| 3424 | 3424 | // add a 0 qty lot row to be able to add a lot |
| 3425 | 3425 | print '<tr>'; |
| 3426 | 3426 | // Qty to ship or shipped |
| 3427 | - print '<td><input class="qtyl" name="qtyl' . $line_id . '_0" id="qtyl' . $line_id . '_0" type="text" size="4" value="0"></td>'; |
|
| 3427 | + print '<td><input class="qtyl" name="qtyl'.$line_id.'_0" id="qtyl'.$line_id.'_0" type="text" size="4" value="0"></td>'; |
|
| 3428 | 3428 | // Batch number management |
| 3429 | - print '<td>' . $formproduct->selectLotStock('', 'batchl' . $line_id . '_0', '', 1, 0, $lines[$i]->fk_product) . '</td>'; |
|
| 3429 | + print '<td>'.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).'</td>'; |
|
| 3430 | 3430 | print '</tr>'; |
| 3431 | 3431 | } elseif (isModEnabled('stock')) { |
| 3432 | 3432 | if ($lines[$i]->fk_product > 0) { |
@@ -3434,13 +3434,13 @@ discard block |
||
| 3434 | 3434 | print '<!-- case edit 2 -->'; |
| 3435 | 3435 | print '<tr>'; |
| 3436 | 3436 | // Qty to ship or shipped |
| 3437 | - print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '">' . $unit_order . '</td>'; |
|
| 3437 | + print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'">'.$unit_order.'</td>'; |
|
| 3438 | 3438 | // Warehouse source |
| 3439 | - print '<td>' . $formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl' . $line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200') . '</td>'; |
|
| 3439 | + print '<td>'.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').'</td>'; |
|
| 3440 | 3440 | // Batch number management |
| 3441 | 3441 | print '<td>'; |
| 3442 | 3442 | if (isModEnabled('productbatch')) { |
| 3443 | - print ' - ' . $langs->trans("NA"); |
|
| 3443 | + print ' - '.$langs->trans("NA"); |
|
| 3444 | 3444 | } |
| 3445 | 3445 | print '</td>'; |
| 3446 | 3446 | print '</tr>'; |
@@ -3449,13 +3449,13 @@ discard block |
||
| 3449 | 3449 | foreach ($lines[$i]->details_entrepot as $detail_entrepot) { |
| 3450 | 3450 | print '<tr>'; |
| 3451 | 3451 | // Qty to ship or shipped |
| 3452 | - print '<td><input class="qtyl right" name="qtyl' . $detail_entrepot->line_id . '" id="qtyl' . $detail_entrepot->line_id . '" type="text" size="4" value="' . $detail_entrepot->qty_shipped . '">' . $unit_order . '</td>'; |
|
| 3452 | + print '<td><input class="qtyl right" name="qtyl'.$detail_entrepot->line_id.'" id="qtyl'.$detail_entrepot->line_id.'" type="text" size="4" value="'.$detail_entrepot->qty_shipped.'">'.$unit_order.'</td>'; |
|
| 3453 | 3453 | // Warehouse source |
| 3454 | - print '<td>' . $formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl' . $detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200') . '</td>'; |
|
| 3454 | + print '<td>'.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').'</td>'; |
|
| 3455 | 3455 | // Batch number management |
| 3456 | 3456 | print '<td>'; |
| 3457 | 3457 | if (isModEnabled('productbatch')) { |
| 3458 | - print ' - ' . $langs->trans("NA"); |
|
| 3458 | + print ' - '.$langs->trans("NA"); |
|
| 3459 | 3459 | } |
| 3460 | 3460 | print '</td>'; |
| 3461 | 3461 | print '</tr>'; |
@@ -3464,19 +3464,19 @@ discard block |
||
| 3464 | 3464 | print '<!-- case edit 4 -->'; |
| 3465 | 3465 | print '<tr>'; |
| 3466 | 3466 | // Qty to ship or shipped |
| 3467 | - print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '"></td>'; |
|
| 3468 | - print '<td><span class="opacitymedium">(' . $langs->trans("Service") . ')</span></td>'; |
|
| 3467 | + print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>'; |
|
| 3468 | + print '<td><span class="opacitymedium">('.$langs->trans("Service").')</span></td>'; |
|
| 3469 | 3469 | print '<td></td>'; |
| 3470 | 3470 | print '</tr>'; |
| 3471 | 3471 | } else { |
| 3472 | 3472 | print '<!-- case edit 5 -->'; |
| 3473 | - print '<tr><td colspan="3">' . $langs->trans("ErrorStockIsNotEnough") . '</td></tr>'; |
|
| 3473 | + print '<tr><td colspan="3">'.$langs->trans("ErrorStockIsNotEnough").'</td></tr>'; |
|
| 3474 | 3474 | } |
| 3475 | 3475 | } else { |
| 3476 | 3476 | print '<!-- case edit 6 -->'; |
| 3477 | 3477 | print '<tr>'; |
| 3478 | 3478 | // Qty to ship or shipped |
| 3479 | - print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '">' . $unit_order . '</td>'; |
|
| 3479 | + print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'">'.$unit_order.'</td>'; |
|
| 3480 | 3480 | // Warehouse source |
| 3481 | 3481 | print '<td></td>'; |
| 3482 | 3482 | // Batch number management |
@@ -3487,7 +3487,7 @@ discard block |
||
| 3487 | 3487 | print '<!-- case edit 7 -->'; |
| 3488 | 3488 | print '<tr>'; |
| 3489 | 3489 | // Qty to ship or shipped |
| 3490 | - print '<td><input class="qtyl right" name="qtyl' . $line_id . '" id="qtyl' . $line_id . '" type="text" size="4" value="' . $lines[$i]->qty_shipped . '"></td>'; |
|
| 3490 | + print '<td><input class="qtyl right" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>'; |
|
| 3491 | 3491 | // Warehouse source |
| 3492 | 3492 | print '<td></td>'; |
| 3493 | 3493 | // Batch number management |
@@ -3498,13 +3498,13 @@ discard block |
||
| 3498 | 3498 | print '</table></td>'; |
| 3499 | 3499 | } else { |
| 3500 | 3500 | // Qty to ship or shipped |
| 3501 | - print '<td class="linecolqtytoship center">' . $lines[$i]->qty_shipped . ' ' . $unit_order . '</td>'; |
|
| 3501 | + print '<td class="linecolqtytoship center">'.$lines[$i]->qty_shipped.' '.$unit_order.'</td>'; |
|
| 3502 | 3502 | |
| 3503 | 3503 | // Warehouse source |
| 3504 | 3504 | if (isModEnabled('stock')) { |
| 3505 | 3505 | print '<td class="linecolwarehousesource tdoverflowmax200">'; |
| 3506 | 3506 | if ($lines[$i]->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { |
| 3507 | - print '<span class="opacitymedium">(' . $langs->trans("Service") . ')</span>'; |
|
| 3507 | + print '<span class="opacitymedium">('.$langs->trans("Service").')</span>'; |
|
| 3508 | 3508 | } elseif ($lines[$i]->entrepot_id > 0 && $lines[$i]->stockable_product == Product::ENABLED_STOCK) { |
| 3509 | 3509 | $warehouse_id = $lines[$i]->entrepot_id; |
| 3510 | 3510 | if (!isset($conf->cache['warehouse'][$warehouse_id])) { |
@@ -3527,10 +3527,10 @@ discard block |
||
| 3527 | 3527 | } else { |
| 3528 | 3528 | $warehouse = $conf->cache['warehouse'][$warehouse_id]; |
| 3529 | 3529 | } |
| 3530 | - $detail .= $langs->trans("DetailWarehouseFormat", $warehouse->label, $detail_entrepot->qty_shipped) . '<br>'; |
|
| 3530 | + $detail .= $langs->trans("DetailWarehouseFormat", $warehouse->label, $detail_entrepot->qty_shipped).'<br>'; |
|
| 3531 | 3531 | } |
| 3532 | 3532 | } |
| 3533 | - print $form->textwithtooltip(img_picto('', 'object_stock') . ' ' . $langs->trans("DetailWarehouseNumber"), $detail); |
|
| 3533 | + print $form->textwithtooltip(img_picto('', 'object_stock').' '.$langs->trans("DetailWarehouseNumber"), $detail); |
|
| 3534 | 3534 | } elseif (count($lines[$i]->detail_children ?? []) > 1) { |
| 3535 | 3535 | $detail = ''; |
| 3536 | 3536 | foreach ($lines[$i]->detail_children as $child_product_id => $child_stock_list) { |
@@ -3544,7 +3544,7 @@ discard block |
||
| 3544 | 3544 | } else { |
| 3545 | 3545 | $child_product = $conf->cache['product'][$child_product_id]; |
| 3546 | 3546 | } |
| 3547 | - $child_product_label = $child_product->ref . ' ' . $child_product->label; |
|
| 3547 | + $child_product_label = $child_product->ref.' '.$child_product->label; |
|
| 3548 | 3548 | |
| 3549 | 3549 | // get warehouse from cache |
| 3550 | 3550 | if (!isset($conf->cache['warehouse'][$warehouse_id])) { |
@@ -3554,10 +3554,10 @@ discard block |
||
| 3554 | 3554 | } else { |
| 3555 | 3555 | $child_warehouse = $conf->cache['warehouse'][$warehouse_id]; |
| 3556 | 3556 | } |
| 3557 | - $detail .= $langs->trans('DetailChildrenFormat', $child_product_label, $child_warehouse->label, price2num($total_qty, 'MS')) . '<br>'; |
|
| 3557 | + $detail .= $langs->trans('DetailChildrenFormat', $child_product_label, $child_warehouse->label, price2num($total_qty, 'MS')).'<br>'; |
|
| 3558 | 3558 | } |
| 3559 | 3559 | } |
| 3560 | - print $form->textwithtooltip(img_picto('', 'object_stock') . ' ' . $langs->trans('DetailWarehouseNumber'), $detail); |
|
| 3560 | + print $form->textwithtooltip(img_picto('', 'object_stock').' '.$langs->trans('DetailWarehouseNumber'), $detail); |
|
| 3561 | 3561 | } |
| 3562 | 3562 | print '</td>'; |
| 3563 | 3563 | } |
@@ -3570,17 +3570,17 @@ discard block |
||
| 3570 | 3570 | if ($lines[$i]->product_tobatch) { |
| 3571 | 3571 | $detail = ''; |
| 3572 | 3572 | foreach ($lines[$i]->detail_batch as $dbatch) { // $dbatch is instance of ExpeditionLineBatch |
| 3573 | - $detail .= $langs->trans("Batch") . ': ' . $dbatch->batch; |
|
| 3573 | + $detail .= $langs->trans("Batch").': '.$dbatch->batch; |
|
| 3574 | 3574 | if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) { |
| 3575 | - $detail .= ' - ' . $langs->trans("SellByDate") . ': ' . dol_print_date($dbatch->sellby, "day"); |
|
| 3575 | + $detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); |
|
| 3576 | 3576 | } |
| 3577 | 3577 | if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) { |
| 3578 | - $detail .= ' - ' . $langs->trans("EatByDate") . ': ' . dol_print_date($dbatch->eatby, "day"); |
|
| 3578 | + $detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); |
|
| 3579 | 3579 | } |
| 3580 | - $detail .= ' - ' . $langs->trans("Qty") . ': ' . $dbatch->qty; |
|
| 3580 | + $detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty; |
|
| 3581 | 3581 | $detail .= '<br>'; |
| 3582 | 3582 | } |
| 3583 | - print $form->textwithtooltip(img_picto('', 'object_barcode') . ' ' . $langs->trans("DetailBatchNumber"), $detail); |
|
| 3583 | + print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); |
|
| 3584 | 3584 | } else { |
| 3585 | 3585 | print $langs->trans("NA"); |
| 3586 | 3586 | } |
@@ -3594,7 +3594,7 @@ discard block |
||
| 3594 | 3594 | // Weight |
| 3595 | 3595 | print '<td class="center linecolweight">'; |
| 3596 | 3596 | if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) { |
| 3597 | - print $lines[$i]->weight * $lines[$i]->qty_shipped . ' ' . measuringUnitString(0, "weight", $lines[$i]->weight_units); |
|
| 3597 | + print $lines[$i]->weight * $lines[$i]->qty_shipped.' '.measuringUnitString(0, "weight", $lines[$i]->weight_units); |
|
| 3598 | 3598 | } else { |
| 3599 | 3599 | print ' '; |
| 3600 | 3600 | } |
@@ -3603,7 +3603,7 @@ discard block |
||
| 3603 | 3603 | // Volume |
| 3604 | 3604 | print '<td class="center linecolvolume">'; |
| 3605 | 3605 | if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) { |
| 3606 | - print $lines[$i]->volume * $lines[$i]->qty_shipped . ' ' . measuringUnitString(0, "volume", $lines[$i]->volume_units); |
|
| 3606 | + print $lines[$i]->volume * $lines[$i]->qty_shipped.' '.measuringUnitString(0, "volume", $lines[$i]->volume_units); |
|
| 3607 | 3607 | } else { |
| 3608 | 3608 | print ' '; |
| 3609 | 3609 | } |
@@ -3614,11 +3614,11 @@ discard block |
||
| 3614 | 3614 | |
| 3615 | 3615 | if ($action == 'editline' && $lines[$i]->id == $line_id) { |
| 3616 | 3616 | print '<td class="center" colspan="2" valign="middle">'; |
| 3617 | - print '<input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="' . $langs->trans("Save") . '"><br>'; |
|
| 3618 | - print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="' . $langs->trans("Cancel") . '"><br>'; |
|
| 3617 | + print '<input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'"><br>'; |
|
| 3618 | + print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'"><br>'; |
|
| 3619 | 3619 | print '</td>'; |
| 3620 | 3620 | } elseif ($object->status == Expedition::STATUS_DRAFT) { |
| 3621 | - $edit_url = $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=editline&token=' . newToken() . '&lineid=' . $lines[$i]->id; |
|
| 3621 | + $edit_url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id; |
|
| 3622 | 3622 | if (getDolGlobalInt('PRODUIT_SOUSPRODUITS')) { |
| 3623 | 3623 | $product_id = $lines[$i]->fk_product; |
| 3624 | 3624 | if (!isset($conf->cache['product'][$product_id])) { |
@@ -3630,16 +3630,16 @@ discard block |
||
| 3630 | 3630 | } |
| 3631 | 3631 | |
| 3632 | 3632 | if ($product->hasFatherOrChild(1)) { |
| 3633 | - $edit_url = dol_buildpath('/expedition/dispatch.php?id=' . $object->id, 1); |
|
| 3633 | + $edit_url = dol_buildpath('/expedition/dispatch.php?id='.$object->id, 1); |
|
| 3634 | 3634 | } |
| 3635 | 3635 | } |
| 3636 | 3636 | |
| 3637 | 3637 | // edit-delete buttons |
| 3638 | 3638 | print '<td class="linecoledit center">'; |
| 3639 | - print '<a class="editfielda reposition" href="' . $edit_url . '">' . img_edit() . '</a>'; |
|
| 3639 | + print '<a class="editfielda reposition" href="'.$edit_url.'">'.img_edit().'</a>'; |
|
| 3640 | 3640 | print '</td>'; |
| 3641 | 3641 | print '<td class="linecoldelete" width="10">'; |
| 3642 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=deleteline&token=' . newToken() . '&lineid=' . $lines[$i]->id . '">' . img_delete() . '</a>'; |
|
| 3642 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().'</a>'; |
|
| 3643 | 3643 | print '</td>'; |
| 3644 | 3644 | |
| 3645 | 3645 | // Display lines extrafields |
@@ -3685,7 +3685,7 @@ discard block |
||
| 3685 | 3685 | } |
| 3686 | 3686 | // TODO Show also lines ordered but not delivered |
| 3687 | 3687 | if (empty($num_prod)) { |
| 3688 | - print '<tr><td colspan="8"><span class="opacitymedium">' . $langs->trans("NoLineGoOnTabToAddSome", $langs->transnoentitiesnoconv("ShipmentDistribution")) . '</span></td></tr>'; |
|
| 3688 | + print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("NoLineGoOnTabToAddSome", $langs->transnoentitiesnoconv("ShipmentDistribution")).'</span></td></tr>'; |
|
| 3689 | 3689 | } |
| 3690 | 3690 | |
| 3691 | 3691 | print "</table>\n"; |
@@ -3714,21 +3714,21 @@ discard block |
||
| 3714 | 3714 | if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'creer')) |
| 3715 | 3715 | || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'shipping_advance', 'validate')) |
| 3716 | 3716 | ) { |
| 3717 | - print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"] . '?action=valid&token=' . newToken() . '&id=' . $object->id, ''); |
|
| 3717 | + print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, ''); |
|
| 3718 | 3718 | } else { |
| 3719 | - print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'] . '#', '', false); |
|
| 3719 | + print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 3720 | 3720 | } |
| 3721 | 3721 | } |
| 3722 | 3722 | |
| 3723 | 3723 | // 0=draft, 1=validated/delivered, 2=closed/delivered |
| 3724 | 3724 | if ($object->status == Expedition::STATUS_VALIDATED && !getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) { |
| 3725 | 3725 | if ($user->hasRight('expedition', 'creer')) { |
| 3726 | - print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"] . '?action=setdraft&token=' . newToken() . '&id=' . $object->id, ''); |
|
| 3726 | + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=setdraft&token='.newToken().'&id='.$object->id, ''); |
|
| 3727 | 3727 | } |
| 3728 | 3728 | } |
| 3729 | 3729 | if ($object->status == Expedition::STATUS_CLOSED) { |
| 3730 | 3730 | if ($user->hasRight('expedition', 'creer')) { |
| 3731 | - print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"] . '?action=reopen&token=' . newToken() . '&id=' . $object->id, ''); |
|
| 3731 | + print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); |
|
| 3732 | 3732 | } |
| 3733 | 3733 | } |
| 3734 | 3734 | |
@@ -3736,9 +3736,9 @@ discard block |
||
| 3736 | 3736 | if (empty($user->socid)) { |
| 3737 | 3737 | if ($object->status > 0) { |
| 3738 | 3738 | if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('expedition', 'shipping_advance', 'send')) { |
| 3739 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', ''); |
|
| 3739 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
|
| 3740 | 3740 | } else { |
| 3741 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'] . '#', '', false); |
|
| 3741 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 3742 | 3742 | } |
| 3743 | 3743 | } |
| 3744 | 3744 | } |
@@ -3746,15 +3746,15 @@ discard block |
||
| 3746 | 3746 | // This is just to generate a delivery receipt when option to do this is on |
| 3747 | 3747 | //var_dump($object->linkedObjectsIds['delivery']); |
| 3748 | 3748 | if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && ($object->status == Expedition::STATUS_VALIDATED || $object->status == Expedition::STATUS_CLOSED) && $user->hasRight('expedition', 'delivery', 'creer') && empty($object->linkedObjectsIds['delivery'])) { |
| 3749 | - print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"] . '?action=create_delivery&token=' . newToken() . '&id=' . $object->id, ''); |
|
| 3749 | + print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"].'?action=create_delivery&token='.newToken().'&id='.$object->id, ''); |
|
| 3750 | 3750 | } |
| 3751 | 3751 | |
| 3752 | 3752 | // Sign (to set to status "Signed" without using the online signature page) |
| 3753 | 3753 | if ($object->status > Expedition::STATUS_DRAFT) { |
| 3754 | 3754 | if ($object->signed_status != Expedition::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
| 3755 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("SignShipping") . '</a></div>'; |
|
| 3755 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("SignShipping").'</a></div>'; |
|
| 3756 | 3756 | } else { |
| 3757 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("UnsignShipping") . '</a></div>'; |
|
| 3757 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("UnsignShipping").'</a></div>'; |
|
| 3758 | 3758 | } |
| 3759 | 3759 | } |
| 3760 | 3760 | |
@@ -3762,7 +3762,7 @@ discard block |
||
| 3762 | 3762 | if (isModEnabled('invoice') && ($object->status == Expedition::STATUS_VALIDATED || $object->status == Expedition::STATUS_CLOSED)) { |
| 3763 | 3763 | if ($user->hasRight('facture', 'creer')) { |
| 3764 | 3764 | if (getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') { |
| 3765 | - print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT . '/compta/facture/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid, ''); |
|
| 3765 | + print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); |
|
| 3766 | 3766 | } |
| 3767 | 3767 | } |
| 3768 | 3768 | } |
@@ -3771,22 +3771,22 @@ discard block |
||
| 3771 | 3771 | if ($object->status == Expedition::STATUS_VALIDATED) { |
| 3772 | 3772 | if ($user->hasRight('expedition', 'creer') && $object->status > 0) { |
| 3773 | 3773 | if (!$object->billed && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') { |
| 3774 | - print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"] . '?action=classifybilled&token=' . newToken() . '&id=' . $object->id, ''); |
|
| 3774 | + print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&token='.newToken().'&id='.$object->id, ''); |
|
| 3775 | 3775 | } |
| 3776 | - print dolGetButtonAction('', $langs->trans("Close"), 'default', $_SERVER["PHP_SELF"] . '?action=classifyclosed&token=' . newToken() . '&id=' . $object->id, ''); |
|
| 3776 | + print dolGetButtonAction('', $langs->trans("Close"), 'default', $_SERVER["PHP_SELF"].'?action=classifyclosed&token='.newToken().'&id='.$object->id, ''); |
|
| 3777 | 3777 | } |
| 3778 | 3778 | } |
| 3779 | 3779 | |
| 3780 | 3780 | // Cancel |
| 3781 | 3781 | if ($object->status == Expedition::STATUS_VALIDATED) { |
| 3782 | 3782 | if ($user->hasRight('expedition', 'creer')) { |
| 3783 | - print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"] . '?action=cancel&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', ''); |
|
| 3783 | + print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); |
|
| 3784 | 3784 | } |
| 3785 | 3785 | } |
| 3786 | 3786 | |
| 3787 | 3787 | // Delete |
| 3788 | 3788 | if ($user->hasRight('expedition', 'supprimer')) { |
| 3789 | - print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"] . '?action=delete&token=' . newToken() . '&id=' . $object->id, ''); |
|
| 3789 | + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); |
|
| 3790 | 3790 | } |
| 3791 | 3791 | } |
| 3792 | 3792 | |
@@ -3802,9 +3802,9 @@ discard block |
||
| 3802 | 3802 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
| 3803 | 3803 | |
| 3804 | 3804 | $objectref = dol_sanitizeFileName($object->ref); |
| 3805 | - $filedir = $conf->expedition->dir_output . "/sending/" . $objectref; |
|
| 3805 | + $filedir = $conf->expedition->dir_output."/sending/".$objectref; |
|
| 3806 | 3806 | |
| 3807 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
| 3807 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
| 3808 | 3808 | |
| 3809 | 3809 | $genallowed = $user->hasRight('expedition', 'lire'); |
| 3810 | 3810 | $delallowed = $user->hasRight('expedition', 'creer'); |
@@ -3825,20 +3825,20 @@ discard block |
||
| 3825 | 3825 | |
| 3826 | 3826 | if ($object->statut != Expedition::STATUS_DRAFT && $useonlinesignature) { |
| 3827 | 3827 | print '<br><!-- Link to sign -->'; |
| 3828 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php'; |
|
| 3829 | - print showOnlineSignatureUrl('expedition', $object->ref, $object) . '<br>'; |
|
| 3828 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; |
|
| 3829 | + print showOnlineSignatureUrl('expedition', $object->ref, $object).'<br>'; |
|
| 3830 | 3830 | } |
| 3831 | 3831 | |
| 3832 | 3832 | print '</div><div class="fichehalfright">'; |
| 3833 | 3833 | |
| 3834 | 3834 | |
| 3835 | 3835 | // List of actions on element |
| 3836 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
| 3836 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
| 3837 | 3837 | $formactions = new FormActions($db); |
| 3838 | 3838 | |
| 3839 | 3839 | //button to go to messaging from the events box |
| 3840 | 3840 | $MAXEVENT = 10; |
| 3841 | - $morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/expedition/messaging.php?id=' . $object->id); |
|
| 3841 | + $morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/expedition/messaging.php?id='.$object->id); |
|
| 3842 | 3842 | |
| 3843 | 3843 | $somethingshown = $formactions->showactions($object, 'shipping', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); |
| 3844 | 3844 | print '</div></div>'; |
@@ -3857,10 +3857,10 @@ discard block |
||
| 3857 | 3857 | // Presend form |
| 3858 | 3858 | $modelmail = 'shipping_send'; |
| 3859 | 3859 | $defaulttopic = 'SendShippingRef'; |
| 3860 | - $diroutput = $conf->expedition->dir_output . '/sending'; |
|
| 3861 | - $trackid = 'shi' . $object->id; |
|
| 3860 | + $diroutput = $conf->expedition->dir_output.'/sending'; |
|
| 3861 | + $trackid = 'shi'.$object->id; |
|
| 3862 | 3862 | |
| 3863 | - include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php'; |
|
| 3863 | + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
|
| 3864 | 3864 | } |
| 3865 | 3865 | |
| 3866 | 3866 | // End of page |
@@ -161,10 +161,10 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // Permissions |
| 164 | -$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 165 | -$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 164 | +$permissiontoread = $user->hasRight('societe', 'lire'); |
|
| 165 | +$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
| 166 | 166 | $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); |
| 167 | -$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 167 | +$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php |
|
| 168 | 168 | $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php |
| 169 | 169 | $permissiontoeditextra = $permissiontoadd; |
| 170 | 170 | if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 175 | +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; |
|
| 176 | 176 | |
| 177 | 177 | // Security check |
| 178 | 178 | $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 202 | 202 | $backtopage = $backurlforlist; |
| 203 | 203 | } else { |
| 204 | - $backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__') . (!empty($canvas) ? "&canvas=" . $canvas : ""); |
|
| 204 | + $backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__').(!empty($canvas) ? "&canvas=".$canvas : ""); |
|
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) { |
| 221 | 221 | $soc_origin_id = GETPOSTINT('soc_origin'); |
| 222 | - $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 222 | + $soc_origin = new Societe($db); // The thirdparty that we will delete |
|
| 223 | 223 | |
| 224 | 224 | if ($soc_origin_id <= 0) { |
| 225 | 225 | $langs->load('errors'); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | if ($action == 'update_extras' && $permissiontoeditextra) { |
| 268 | 268 | $object->fetch($socid); |
| 269 | 269 | |
| 270 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 270 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 271 | 271 | |
| 272 | 272 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 273 | 273 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | if (!$error) { |
| 324 | 324 | if ($action == 'update') { // Test on permission not required here |
| 325 | 325 | $ret = $object->fetch($socid); |
| 326 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 326 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 327 | 327 | } else { |
| 328 | 328 | $object->canvas = $canvas; |
| 329 | 329 | } |
@@ -333,21 +333,21 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); |
| 335 | 335 | $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
| 336 | - $object->civility_code = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
|
| 336 | + $object->civility_code = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int |
|
| 337 | 337 | // Add non official properties |
| 338 | - $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 339 | - $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 338 | + $object->name_bis = GETPOST('name', 'alphanohtml'); |
|
| 339 | + $object->firstname = GETPOST('firstname', 'alphanohtml'); |
|
| 340 | 340 | } else { |
| 341 | - $object->name = GETPOST('name', 'alphanohtml'); |
|
| 341 | + $object->name = GETPOST('name', 'alphanohtml'); |
|
| 342 | 342 | } |
| 343 | 343 | $object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity); |
| 344 | - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 344 | + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); |
|
| 345 | 345 | $object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent; |
| 346 | 346 | $object->address = GETPOST('address', 'alphanohtml'); |
| 347 | - $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 348 | - $object->town = GETPOST('town', 'alphanohtml'); |
|
| 349 | - $object->country_id = GETPOSTINT('country_id'); |
|
| 350 | - $object->state_id = GETPOSTINT('state_id'); |
|
| 347 | + $object->zip = GETPOST('zipcode', 'alphanohtml'); |
|
| 348 | + $object->town = GETPOST('town', 'alphanohtml'); |
|
| 349 | + $object->country_id = GETPOSTINT('country_id'); |
|
| 350 | + $object->state_id = GETPOSTINT('state_id'); |
|
| 351 | 351 | |
| 352 | 352 | $object->socialnetworks = array(); |
| 353 | 353 | if (isModEnabled('socialnetworks')) { |
@@ -359,10 +359,10 @@ discard block |
||
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | $object->phone = GETPOST('phone', 'alpha'); |
| 362 | - $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 362 | + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); |
|
| 363 | 363 | $object->fax = GETPOST('fax', 'alpha'); |
| 364 | 364 | $object->email = trim(GETPOST('email', 'email')); |
| 365 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 365 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 366 | 366 | $object->url = trim(GETPOST('url', 'url')); |
| 367 | 367 | $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); |
| 368 | 368 | $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); |
@@ -372,13 +372,13 @@ discard block |
||
| 372 | 372 | $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); |
| 373 | 373 | $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); |
| 374 | 374 | $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); |
| 375 | - $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 376 | - $object->capital = GETPOST('capital'); // Can be null or 0 or a float value |
|
| 375 | + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); |
|
| 376 | + $object->capital = GETPOST('capital'); // Can be null or 0 or a float value |
|
| 377 | 377 | $object->barcode = GETPOST('barcode', 'alphanohtml'); |
| 378 | 378 | |
| 379 | 379 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 380 | 380 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 381 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 381 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 382 | 382 | $object->status = GETPOSTINT('status'); |
| 383 | 383 | |
| 384 | 384 | // Local Taxes |
@@ -388,11 +388,11 @@ discard block |
||
| 388 | 388 | $object->localtax1_value = GETPOST('lt1', 'alpha'); |
| 389 | 389 | $object->localtax2_value = GETPOST('lt2', 'alpha'); |
| 390 | 390 | |
| 391 | - $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 392 | - $object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear')); |
|
| 391 | + $object->forme_juridique_code = GETPOSTINT('forme_juridique_code'); |
|
| 392 | + $object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear')); |
|
| 393 | 393 | |
| 394 | 394 | $object->effectif_id = GETPOSTINT('effectif_id'); |
| 395 | - $object->typent_id = GETPOSTINT('typent_id'); |
|
| 395 | + $object->typent_id = GETPOSTINT('typent_id'); |
|
| 396 | 396 | |
| 397 | 397 | $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type |
| 398 | 398 | |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | $prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0); |
| 402 | 402 | $prospectcustomer = $customer + $prospect; |
| 403 | 403 | |
| 404 | - $object->client = $prospectcustomer; |
|
| 405 | - $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 404 | + $object->client = $prospectcustomer; |
|
| 405 | + $object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0); |
|
| 406 | 406 | |
| 407 | 407 | if ($action == 'add') { // Test on permission already done |
| 408 | 408 | // for prospect, customer or supplier |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | if ($object->fournisseur > 0) { |
| 425 | - $object->cond_reglement_supplier_id = $paymentTermId; |
|
| 425 | + $object->cond_reglement_supplier_id = $paymentTermId; |
|
| 426 | 426 | |
| 427 | 427 | $filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method) |
| 428 | 428 | if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) { |
@@ -432,15 +432,15 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | - $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 436 | - $object->default_lang = GETPOST('default_lang'); |
|
| 435 | + $object->commercial_id = GETPOSTINT('commercial_id'); |
|
| 436 | + $object->default_lang = GETPOST('default_lang'); |
|
| 437 | 437 | |
| 438 | 438 | // Webservices url/key |
| 439 | 439 | $object->webservices_url = GETPOST('webservices_url', 'url'); |
| 440 | 440 | $object->webservices_key = GETPOST('webservices_key', 'password'); |
| 441 | 441 | |
| 442 | 442 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 443 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 443 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 444 | 444 | |
| 445 | 445 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 446 | 446 | $object->accountancy_code_sell = ''; |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 452 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 452 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 453 | 453 | |
| 454 | 454 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 455 | 455 | $object->accountancy_code_buy = ''; |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | // Delete third party |
| 836 | 836 | if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) { |
| 837 | 837 | $object->fetch($socid); |
| 838 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 838 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 839 | 839 | $result = $object->delete($socid, $user); |
| 840 | 840 | |
| 841 | 841 | if ($result > 0) { |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | } else { |
| 914 | 914 | $db->commit(); |
| 915 | 915 | $db->close(); |
| 916 | - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); |
|
| 916 | + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); |
|
| 917 | 917 | exit; |
| 918 | 918 | } |
| 919 | 919 | } else { |
@@ -1102,12 +1102,12 @@ discard block |
||
| 1102 | 1102 | $object->fax = GETPOST('fax', 'alpha'); |
| 1103 | 1103 | $object->email = GETPOST('email', 'email'); |
| 1104 | 1104 | $object->url = GETPOST('url', 'url'); |
| 1105 | - $object->capital = GETPOST('capital'); // can be null or 0 or a float value |
|
| 1105 | + $object->capital = GETPOST('capital'); // can be null or 0 or a float value |
|
| 1106 | 1106 | $paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables |
| 1107 | 1107 | if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) { |
| 1108 | 1108 | $paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 1109 | 1109 | } |
| 1110 | - $object->cond_reglement_id = $paymentTermId; |
|
| 1110 | + $object->cond_reglement_id = $paymentTermId; |
|
| 1111 | 1111 | $paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables |
| 1112 | 1112 | if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) { |
| 1113 | 1113 | $paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | $object->civility_id = GETPOST('civility_id', 'alpha'); |
| 1126 | 1126 | |
| 1127 | 1127 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 1128 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1128 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 1129 | 1129 | $object->status = GETPOSTINT('status'); |
| 1130 | 1130 | |
| 1131 | 1131 | //Local Taxes |
@@ -1141,7 +1141,7 @@ discard block |
||
| 1141 | 1141 | $object->default_lang = GETPOST('default_lang'); |
| 1142 | 1142 | |
| 1143 | 1143 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 1144 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1144 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 1145 | 1145 | |
| 1146 | 1146 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 1147 | 1147 | $object->accountancy_code_sell = ''; |
@@ -1276,7 +1276,7 @@ discard block |
||
| 1276 | 1276 | |
| 1277 | 1277 | print '<script type="text/javascript">'; |
| 1278 | 1278 | print '$(document).ready(function () { |
| 1279 | - var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . '; |
|
| 1279 | + var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').'; |
|
| 1280 | 1280 | |
| 1281 | 1281 | init_customer_categ(); |
| 1282 | 1282 | $("#prospectinput, #customerinput").change(function() { |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | print '</td><td colspan="3">'; |
| 1351 | 1351 | |
| 1352 | 1352 | print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus" spellcheck="false">'; |
| 1353 | - print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1353 | + print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages |
|
| 1354 | 1354 | // This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php |
| 1355 | 1355 | // on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input. |
| 1356 | 1356 | /* |
@@ -1469,8 +1469,8 @@ discard block |
||
| 1469 | 1469 | |
| 1470 | 1470 | // Prospect/Customer/Supplier |
| 1471 | 1471 | $selected = $object->client; |
| 1472 | - $selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0); |
|
| 1473 | - $selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0); |
|
| 1472 | + $selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0); |
|
| 1473 | + $selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0); |
|
| 1474 | 1474 | switch ($selected) { |
| 1475 | 1475 | case 1: |
| 1476 | 1476 | $selectedcustomer = 1; |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | print '<td></td>'; |
| 1724 | 1724 | print '<td></td>'; |
| 1725 | 1725 | } |
| 1726 | - print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1726 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>'; |
|
| 1727 | 1727 | print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
| 1728 | 1728 | print '</tr>'; |
| 1729 | 1729 | } |
@@ -1771,7 +1771,7 @@ discard block |
||
| 1771 | 1771 | // Vat is used |
| 1772 | 1772 | print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>'; |
| 1773 | 1773 | print '<td>'; |
| 1774 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation |
|
| 1774 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation |
|
| 1775 | 1775 | print '</td>'; |
| 1776 | 1776 | if ($conf->browser->layout == 'phone') { |
| 1777 | 1777 | print '</tr><tr>'; |
@@ -1812,7 +1812,7 @@ discard block |
||
| 1812 | 1812 | |
| 1813 | 1813 | // VAT reverse charge by default |
| 1814 | 1814 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 1815 | - print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">'; |
|
| 1815 | + print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">'; |
|
| 1816 | 1816 | print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 1817 | 1817 | print '</td></tr>'; |
| 1818 | 1818 | } |
@@ -1821,21 +1821,21 @@ discard block |
||
| 1821 | 1821 | // TODO: Place into a function to control showing by country or study better option |
| 1822 | 1822 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 1823 | 1823 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>'; |
| 1824 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1824 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1825 | 1825 | print '</td>'; |
| 1826 | 1826 | if ($conf->browser->layout == 'phone') { |
| 1827 | 1827 | print '</tr><tr>'; |
| 1828 | 1828 | } |
| 1829 | 1829 | print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>'; |
| 1830 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1830 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1831 | 1831 | print '</td></tr>'; |
| 1832 | 1832 | } elseif ($mysoc->localtax1_assuj == "1") { |
| 1833 | 1833 | print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1834 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1834 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">'; |
|
| 1835 | 1835 | print '</td></tr>'; |
| 1836 | 1836 | } elseif ($mysoc->localtax2_assuj == "1") { |
| 1837 | 1837 | print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">'; |
| 1838 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">'; |
|
| 1838 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">'; |
|
| 1839 | 1839 | print '</td></tr>'; |
| 1840 | 1840 | } |
| 1841 | 1841 | |
@@ -2114,7 +2114,7 @@ discard block |
||
| 2114 | 2114 | $prefixSupplierIsUsed = false; |
| 2115 | 2115 | } |
| 2116 | 2116 | |
| 2117 | - $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 2117 | + $object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 2118 | 2118 | |
| 2119 | 2119 | if (GETPOSTISSET('name')) { |
| 2120 | 2120 | // We overwrite with values if posted |
@@ -2142,12 +2142,12 @@ discard block |
||
| 2142 | 2142 | } |
| 2143 | 2143 | |
| 2144 | 2144 | $object->phone = GETPOST('phone', 'alpha'); |
| 2145 | - $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2145 | + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); |
|
| 2146 | 2146 | $object->fax = GETPOST('fax', 'alpha'); |
| 2147 | 2147 | $object->email = GETPOST('email', 'email'); |
| 2148 | - $object->no_email = GETPOSTINT("no_email"); |
|
| 2148 | + $object->no_email = GETPOSTINT("no_email"); |
|
| 2149 | 2149 | $object->url = GETPOST('url', 'url'); |
| 2150 | - $object->capital = GETPOST('capital'); // Can be null or 0 or a float value |
|
| 2150 | + $object->capital = GETPOST('capital'); // Can be null or 0 or a float value |
|
| 2151 | 2151 | $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); |
| 2152 | 2152 | $object->idprof2 = GETPOST('idprof2', 'alphanohtml'); |
| 2153 | 2153 | $object->idprof3 = GETPOST('idprof3', 'alphanohtml'); |
@@ -2161,16 +2161,16 @@ discard block |
||
| 2161 | 2161 | $object->default_lang = GETPOST('default_lang', 'alpha'); |
| 2162 | 2162 | |
| 2163 | 2163 | $object->tva_assuj = GETPOSTINT('assujtva_value'); |
| 2164 | - $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2164 | + $object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0; |
|
| 2165 | 2165 | $object->tva_intra = GETPOST('tva_intra', 'alphanohtml'); |
| 2166 | - $object->status = GETPOSTINT('status'); |
|
| 2166 | + $object->status = GETPOSTINT('status'); |
|
| 2167 | 2167 | |
| 2168 | 2168 | // Webservices url/key |
| 2169 | 2169 | $object->webservices_url = GETPOST('webservices_url', 'url'); |
| 2170 | 2170 | $object->webservices_key = GETPOST('webservices_key', 'password'); |
| 2171 | 2171 | |
| 2172 | 2172 | if (GETPOSTISSET('accountancy_code_sell')) { |
| 2173 | - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2173 | + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); |
|
| 2174 | 2174 | |
| 2175 | 2175 | if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { |
| 2176 | 2176 | $object->accountancy_code_sell = ''; |
@@ -2179,7 +2179,7 @@ discard block |
||
| 2179 | 2179 | } |
| 2180 | 2180 | } |
| 2181 | 2181 | if (GETPOSTISSET('accountancy_code_buy')) { |
| 2182 | - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2182 | + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); |
|
| 2183 | 2183 | |
| 2184 | 2184 | if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { |
| 2185 | 2185 | $object->accountancy_code_buy = ''; |
@@ -2261,7 +2261,7 @@ discard block |
||
| 2261 | 2261 | } |
| 2262 | 2262 | }); |
| 2263 | 2263 | |
| 2264 | - var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . '; |
|
| 2264 | + var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').'; |
|
| 2265 | 2265 | |
| 2266 | 2266 | init_customer_categ(); |
| 2267 | 2267 | $("#prospectinput, #customerinput").change(function() { |
@@ -2433,7 +2433,7 @@ discard block |
||
| 2433 | 2433 | $colspan = 3; |
| 2434 | 2434 | } |
| 2435 | 2435 | |
| 2436 | - print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>'; |
|
| 2436 | + print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>'; |
|
| 2437 | 2437 | print '<table class="nobordernopadding"><tr><td>'; |
| 2438 | 2438 | $tmpcode = $object->code_client ?? ''; |
| 2439 | 2439 | if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { |
@@ -2450,7 +2450,7 @@ discard block |
||
| 2450 | 2450 | print '</tr><tr>'; |
| 2451 | 2451 | } |
| 2452 | 2452 | |
| 2453 | - print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>'; |
|
| 2453 | + print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>'; |
|
| 2454 | 2454 | |
| 2455 | 2455 | if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) { |
| 2456 | 2456 | print '<table class="nobordernopadding"><tr><td>'; |
@@ -2631,14 +2631,14 @@ discard block |
||
| 2631 | 2631 | |
| 2632 | 2632 | // VAT is used |
| 2633 | 2633 | print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">'; |
| 2634 | - print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2634 | + print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2635 | 2635 | print '</td></tr>'; |
| 2636 | 2636 | |
| 2637 | 2637 | // Local Taxes |
| 2638 | 2638 | //TODO: Place into a function to control showing by country or study better option |
| 2639 | 2639 | if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { |
| 2640 | 2640 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>'; |
| 2641 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2641 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2642 | 2642 | if (!isOnlyOneLocalTax(1)) { |
| 2643 | 2643 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2644 | 2644 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2647,7 +2647,7 @@ discard block |
||
| 2647 | 2647 | print '</td>'; |
| 2648 | 2648 | print '</tr><tr>'; |
| 2649 | 2649 | print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>'; |
| 2650 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>'; |
|
| 2650 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>'; |
|
| 2651 | 2651 | if (!isOnlyOneLocalTax(2)) { |
| 2652 | 2652 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2653 | 2653 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2656,7 +2656,7 @@ discard block |
||
| 2656 | 2656 | print '</td></tr>'; |
| 2657 | 2657 | } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { |
| 2658 | 2658 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2659 | - print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2659 | + print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2660 | 2660 | if (!isOnlyOneLocalTax(1)) { |
| 2661 | 2661 | print '<span class="cblt1"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2662 | 2662 | $formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1"); |
@@ -2665,7 +2665,7 @@ discard block |
||
| 2665 | 2665 | print '</td></tr>'; |
| 2666 | 2666 | } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { |
| 2667 | 2667 | print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">'; |
| 2668 | - print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">'; |
|
| 2668 | + print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">'; |
|
| 2669 | 2669 | if (!isOnlyOneLocalTax(2)) { |
| 2670 | 2670 | print '<span class="cblt2"> '.$langs->transcountry("Type", $mysoc->country_code).': '; |
| 2671 | 2671 | $formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2"); |
@@ -2676,7 +2676,7 @@ discard block |
||
| 2676 | 2676 | |
| 2677 | 2677 | // VAT reverse charge by default |
| 2678 | 2678 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 2679 | - print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">'; |
|
| 2679 | + print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">'; |
|
| 2680 | 2680 | print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>'; |
| 2681 | 2681 | print '</td></tr>'; |
| 2682 | 2682 | } |
@@ -2848,7 +2848,7 @@ discard block |
||
| 2848 | 2848 | $maxfilesizearray = getMaxFileSizeArray(); |
| 2849 | 2849 | $maxmin = $maxfilesizearray['maxmin']; |
| 2850 | 2850 | if ($maxmin > 0) { |
| 2851 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2851 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 2852 | 2852 | } |
| 2853 | 2853 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 2854 | 2854 | print '</td></tr>'; |
@@ -3105,7 +3105,7 @@ discard block |
||
| 3105 | 3105 | print '<tr><td>'; |
| 3106 | 3106 | print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc')); |
| 3107 | 3107 | print '</td><td>'; |
| 3108 | - print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>'; |
|
| 3108 | + print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>'; |
|
| 3109 | 3109 | print '</td>'; |
| 3110 | 3110 | print '</tr>'; |
| 3111 | 3111 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE'); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; // Add also log into conf->logbuffer. |
|
| 311 | + $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; // Add also log into conf->logbuffer. |
|
| 312 | 312 | |
| 313 | 313 | $versiontoarray = array(); |
| 314 | 314 | $versionranarray = array(); |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | |
| 776 | 776 | if (!$error) { |
| 777 | 777 | // Set constant to ask to remake a new ping to inform about upgrade (if ping was already done and OK) |
| 778 | - $sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'"; // This should be useless now because constant is uniqueid+' v'+version |
|
| 778 | + $sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'"; // This should be useless now because constant is uniqueid+' v'+version |
|
| 779 | 779 | $db->query($sql, 1); |
| 780 | 780 | } |
| 781 | 781 | |
@@ -4373,7 +4373,7 @@ discard block |
||
| 4373 | 4373 | |
| 4374 | 4374 | if (!is_object($user)) { |
| 4375 | 4375 | include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
| 4376 | - $user = new User($db); // To avoid error during migration |
|
| 4376 | + $user = new User($db); // To avoid error during migration |
|
| 4377 | 4377 | } |
| 4378 | 4378 | |
| 4379 | 4379 | dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force.", listofmodule=".implode(',', array_keys($listofmodule)), LOG_NOTICE); |
@@ -4544,7 +4544,7 @@ discard block |
||
| 4544 | 4544 | |
| 4545 | 4545 | if (!is_object($user)) { |
| 4546 | 4546 | include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
| 4547 | - $user = new User($db); // To avoid error during migration |
|
| 4547 | + $user = new User($db); // To avoid error during migration |
|
| 4548 | 4548 | } |
| 4549 | 4549 | |
| 4550 | 4550 | print '<tr><td colspan="4">'; |
@@ -4555,7 +4555,7 @@ discard block |
||
| 4555 | 4555 | $resql = $db->query($sql); |
| 4556 | 4556 | |
| 4557 | 4557 | if ($resql) { |
| 4558 | - $modulepart="product_batch"; |
|
| 4558 | + $modulepart = "product_batch"; |
|
| 4559 | 4559 | |
| 4560 | 4560 | $lot = new Productlot($db); |
| 4561 | 4561 | |
@@ -4569,7 +4569,7 @@ discard block |
||
| 4569 | 4569 | |
| 4570 | 4570 | if ($dir) { |
| 4571 | 4571 | $lot->id = (int) $obj->rowid; |
| 4572 | - $lot->ref = (string) $obj->rowid; // No ref for the moment |
|
| 4572 | + $lot->ref = (string) $obj->rowid; // No ref for the moment |
|
| 4573 | 4573 | $lot->batch = $obj->batch; |
| 4574 | 4574 | $lot->entity = $obj->entity; |
| 4575 | 4575 | $lot->fk_product = $obj->fk_product; |
@@ -4577,10 +4577,10 @@ discard block |
||
| 4577 | 4577 | $savref = $lot->ref; |
| 4578 | 4578 | |
| 4579 | 4579 | $lot->ref = $obj->batch; |
| 4580 | - $origin = $dir . '/' . get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4580 | + $origin = $dir.'/'.get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4581 | 4581 | |
| 4582 | - $lot->ref = $savref; // So restore the id |
|
| 4583 | - $destin = $dir . '/' . get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4582 | + $lot->ref = $savref; // So restore the id |
|
| 4583 | + $destin = $dir.'/'.get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4584 | 4584 | |
| 4585 | 4585 | //var_dump($origin.' -> '.$destin.' '.$lot->batch.' dir origin is '.dol_is_dir($origin));exit; |
| 4586 | 4586 | |
@@ -5357,7 +5357,7 @@ discard block |
||
| 5357 | 5357 | $error++; |
| 5358 | 5358 | } |
| 5359 | 5359 | |
| 5360 | - $current_contract = $obj->cid; |
|
| 5360 | + $current_contract = $obj->cid; |
|
| 5361 | 5361 | } |
| 5362 | 5362 | } else { |
| 5363 | 5363 | $error++; |
@@ -5392,7 +5392,7 @@ discard block |
||
| 5392 | 5392 | print '<tr class="trforrunsql"><td colspan="4">'; |
| 5393 | 5393 | print '<b>'.$langs->trans('InvoiceExportModelsMigration')."</b>: \n"; |
| 5394 | 5394 | |
| 5395 | - if (! $migrationNeeded) { |
|
| 5395 | + if (!$migrationNeeded) { |
|
| 5396 | 5396 | print $langs->trans("AlreadyDone"); |
| 5397 | 5397 | print '</td></tr>'; |
| 5398 | 5398 | dolibarr_set_const($db, 'MIGRATION_FLAG_INVOICE_MODELS_V20', 1, 'chaine', 0, 'To flag the upgrade of invoice template has been set', 0); |
@@ -5406,7 +5406,7 @@ discard block |
||
| 5406 | 5406 | |
| 5407 | 5407 | $resql1 = $db->query($sql1); |
| 5408 | 5408 | |
| 5409 | - if (! $resql1) { |
|
| 5409 | + if (!$resql1) { |
|
| 5410 | 5410 | dol_print_error($db); |
| 5411 | 5411 | $db->rollback(); |
| 5412 | 5412 | print '</td></tr>'; |
@@ -5423,7 +5423,7 @@ discard block |
||
| 5423 | 5423 | |
| 5424 | 5424 | $resql2 = $db->query($sql2); |
| 5425 | 5425 | |
| 5426 | - if (! $resql2) { |
|
| 5426 | + if (!$resql2) { |
|
| 5427 | 5427 | dol_print_error($db); |
| 5428 | 5428 | $db->rollback(); |
| 5429 | 5429 | print '</td></tr>'; |
@@ -5480,7 +5480,7 @@ discard block |
||
| 5480 | 5480 | |
| 5481 | 5481 | $resql = $db->query($sql); |
| 5482 | 5482 | |
| 5483 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; |
|
| 5483 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; |
|
| 5484 | 5484 | $bookkeeping = new BookKeeping($db); |
| 5485 | 5485 | if ($resql) { |
| 5486 | 5486 | while ($obj = $db->fetch_object($resql)) { |
@@ -5622,9 +5622,9 @@ discard block |
||
| 5622 | 5622 | $hmac_encoded_secret_key = getDolGlobalString('BLOCKEDLOG_HMAC_KEY'); |
| 5623 | 5623 | if (empty($hmac_encoded_secret_key)) { |
| 5624 | 5624 | // Add key |
| 5625 | - $hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true); // This is using random_int for 32 chars |
|
| 5625 | + $hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true); // This is using random_int for 32 chars |
|
| 5626 | 5626 | |
| 5627 | - $result = dolibarr_set_const($db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', 0); // Will encrypt the value using dolCrypt and store it. |
|
| 5627 | + $result = dolibarr_set_const($db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', 0); // Will encrypt the value using dolCrypt and store it. |
|
| 5628 | 5628 | |
| 5629 | 5629 | if ($result < 0) { |
| 5630 | 5630 | dol_print_error($db); |
@@ -5639,7 +5639,7 @@ discard block |
||
| 5639 | 5639 | // Decode the HMAC key |
| 5640 | 5640 | $hmac_secret_key = dolDecrypt($hmac_encoded_secret_key); |
| 5641 | 5641 | |
| 5642 | - if (! preg_match('/^BLOCKEDLOGHMAC/', $hmac_secret_key)) { |
|
| 5642 | + if (!preg_match('/^BLOCKEDLOGHMAC/', $hmac_secret_key)) { |
|
| 5643 | 5643 | print 'Error: Failed to decode the crypted value of the parameter BLOCKEDLOG_HMAC_KEY using the $dolibarr_main_crypt_key. A value was found in config parameters in database but decoding failed. May be the database data were restored onto another environment and the coding/decoding key $dolibarr_main_dolcrypt_key was not restored with the same value in conf.php file.'; |
| 5644 | 5644 | print 'Restore the value of $dolibarr_main_crypt_key that was used for encryption in database and restart the migration.'; |
| 5645 | 5645 | print 'If you don\'t use the Unalterable Log module, you can also remove the BLOCKEDLOG_HMAC_KEY entry from llx_const table. If you use the Unalterable Log, this is not possible because this will invalidate all past record.'; |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php"; |
| 50 | 50 | require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; |
| 51 | 51 | } |
| 52 | -if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').".php")) { |
|
| 53 | - require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_" . getDolGlobalString('FICHEINTER_ADDON').'.php'; |
|
| 52 | +if (getDolGlobalString('FICHEINTER_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').".php")) { |
|
| 53 | + require_once DOL_DOCUMENT_ROOT."/core/modules/fichinter/mod_".getDolGlobalString('FICHEINTER_ADDON').'.php'; |
|
| 54 | 54 | } |
| 55 | 55 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
| 56 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $id = GETPOSTINT('id'); |
| 70 | 70 | $ref = GETPOST('ref', 'alpha'); |
| 71 | -$ref_client = GETPOST('ref_client', 'alpha'); |
|
| 71 | +$ref_client = GETPOST('ref_client', 'alpha'); |
|
| 72 | 72 | $socid = GETPOSTINT('socid'); |
| 73 | 73 | $contratid = GETPOSTINT('contratid'); |
| 74 | 74 | $action = GETPOST('action', 'alpha'); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 244 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 245 | 245 | exit; |
| 246 | 246 | } else { |
| 247 | 247 | $mesg = $object->error; |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 269 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 270 | 270 | exit; |
| 271 | 271 | } else { |
| 272 | 272 | $mesg = $object->error; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
| 294 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
| 295 | 295 | exit; |
| 296 | 296 | } else { |
| 297 | 297 | $mesg = $object->error; |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | |
| 388 | 388 | $classname = ucfirst($subelement); |
| 389 | 389 | $srcobject = new $classname($db); |
| 390 | - '@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 390 | + '@phan-var-force Commande|Propal|Contrat $srcobject'; // Can be other class, but CommonObject is too generic |
|
| 391 | 391 | /** @var Commande|Propal|Contrat $srcobject */ |
| 392 | 392 | |
| 393 | 393 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
| 869 | 869 | |
| 870 | 870 | if ($action == 'update_extras' && $permissiontoeditextra) { |
| 871 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 871 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 872 | 872 | |
| 873 | 873 | $attribute_name = GETPOST('attribute', 'aZ09'); |
| 874 | 874 | |
@@ -1195,7 +1195,7 @@ discard block |
||
| 1195 | 1195 | } else { |
| 1196 | 1196 | print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">'; |
| 1197 | 1197 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 1198 | - print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
| 1198 | + print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
| 1199 | 1199 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
| 1200 | 1200 | |
| 1201 | 1201 | print dol_get_fiche_head([]); |
@@ -1593,13 +1593,13 @@ discard block |
||
| 1593 | 1593 | $line_options = is_array($line_options) ? $line_options['subtotal'] : array(); |
| 1594 | 1594 | print '<td colspan="3" ><strong>'.dol_htmlentitiesbr($objp->description).'</strong>'; |
| 1595 | 1595 | if (array_key_exists('titleshowuponpdf', $line_options)) { |
| 1596 | - echo ' ' . img_picto($langs->trans("ShowUPOnPDF"), 'invoicing'); |
|
| 1596 | + echo ' '.img_picto($langs->trans("ShowUPOnPDF"), 'invoicing'); |
|
| 1597 | 1597 | } |
| 1598 | 1598 | if (array_key_exists('titleshowtotalexludingvatonpdf', $line_options)) { |
| 1599 | - echo ' <span title="' . $langs->trans("ShowTotalExludingVATOnPDF") . '">%</span>'; |
|
| 1599 | + echo ' <span title="'.$langs->trans("ShowTotalExludingVATOnPDF").'">%</span>'; |
|
| 1600 | 1600 | } |
| 1601 | 1601 | if (array_key_exists('titleforcepagebreak', $line_options)) { |
| 1602 | - echo ' ' . img_picto($langs->trans("ForcePageBreak"), 'file'); |
|
| 1602 | + echo ' '.img_picto($langs->trans("ForcePageBreak"), 'file'); |
|
| 1603 | 1603 | } |
| 1604 | 1604 | print "</td>"; |
| 1605 | 1605 | } else { |
@@ -1955,9 +1955,9 @@ discard block |
||
| 1955 | 1955 | // Sign |
| 1956 | 1956 | if ($object->status > Fichinter::STATUS_DRAFT) { |
| 1957 | 1957 | if ($object->signed_status != Fichinter::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
| 1958 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("InterventionSign") . '</a></div>'; |
|
| 1958 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("InterventionSign").'</a></div>'; |
|
| 1959 | 1959 | } else { |
| 1960 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("InterventionUnsign") . '</a></div>'; |
|
| 1960 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("InterventionUnsign").'</a></div>'; |
|
| 1961 | 1961 | } |
| 1962 | 1962 | } |
| 1963 | 1963 | |
@@ -180,31 +180,31 @@ discard block |
||
| 180 | 180 | $search_agenda_label = ''; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $backurlforlist = DOL_URL_ROOT . '/ticket/list.php'; |
|
| 183 | + $backurlforlist = DOL_URL_ROOT.'/ticket/list.php'; |
|
| 184 | 184 | |
| 185 | 185 | if (empty($backtopage) || ($cancel && empty($id))) { |
| 186 | 186 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
| 187 | 187 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 188 | 188 | $backtopage = $backurlforlist; |
| 189 | 189 | } else { |
| 190 | - $backtopage = DOL_URL_ROOT . '/ticket/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 190 | + $backtopage = DOL_URL_ROOT.'/ticket/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | if ($cancel) { |
| 196 | 196 | if (!empty($backtopageforcancel)) { |
| 197 | - header("Location: " . $backtopageforcancel); |
|
| 197 | + header("Location: ".$backtopageforcancel); |
|
| 198 | 198 | exit; |
| 199 | 199 | } elseif (!empty($backtopage)) { |
| 200 | - header("Location: " . $backtopage); |
|
| 200 | + header("Location: ".$backtopage); |
|
| 201 | 201 | exit; |
| 202 | 202 | } |
| 203 | 203 | $action = 'view'; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | if ((($action == 'add' && GETPOST('save', 'alpha')) || ($action == 'update' && $object->status < Ticket::STATUS_CLOSED)) && $permissiontoadd) { |
| 207 | - $ifErrorAction = ($action == 'add' ? 'create' : 'edit'); // Test on permission not required here |
|
| 207 | + $ifErrorAction = ($action == 'add' ? 'create' : 'edit'); // Test on permission not required here |
|
| 208 | 208 | if ($action == 'add') { // Test on permission already done |
| 209 | 209 | $object->track_id = null; |
| 210 | 210 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | if (!$error) { |
| 339 | 339 | // File transfer |
| 340 | - $object->copyFilesForTicket(''); // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was '' |
|
| 340 | + $object->copyFilesForTicket(''); // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was '' |
|
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | if (!$error) { |
@@ -347,13 +347,13 @@ discard block |
||
| 347 | 347 | if (empty($id)) { |
| 348 | 348 | $url = $backtopage; |
| 349 | 349 | } else { |
| 350 | - $url = 'card.php?track_id=' . urlencode($object->track_id); |
|
| 350 | + $url = 'card.php?track_id='.urlencode($object->track_id); |
|
| 351 | 351 | } |
| 352 | 352 | } else { |
| 353 | - $url = 'card.php?track_id=' . urlencode($object->track_id); |
|
| 353 | + $url = 'card.php?track_id='.urlencode($object->track_id); |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - header("Location: " . $url); |
|
| 356 | + header("Location: ".$url); |
|
| 357 | 357 | exit; |
| 358 | 358 | } else { |
| 359 | 359 | $db->rollback(); |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | if ($object->markAsRead($user) > 0) { |
| 372 | 372 | setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs'); |
| 373 | 373 | |
| 374 | - header("Location: card.php?track_id=" . $object->track_id); |
|
| 374 | + header("Location: card.php?track_id=".$object->track_id); |
|
| 375 | 375 | exit; |
| 376 | 376 | } else { |
| 377 | 377 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $object->fetch_user($usertoassign); |
| 428 | 428 | |
| 429 | 429 | setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs'); |
| 430 | - header("Location: card.php?track_id=" . $object->track_id); |
|
| 430 | + header("Location: card.php?track_id=".$object->track_id); |
|
| 431 | 431 | exit; |
| 432 | 432 | } else { |
| 433 | 433 | array_push($object->errors, $object->error); |
@@ -444,10 +444,10 @@ discard block |
||
| 444 | 444 | if (!empty($backtopage)) { |
| 445 | 445 | $url = $backtopage; |
| 446 | 446 | } else { |
| 447 | - $url = 'card.php?track_id=' . urlencode($object->track_id); |
|
| 447 | + $url = 'card.php?track_id='.urlencode($object->track_id); |
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | - header("Location: " . $url); |
|
| 450 | + header("Location: ".$url); |
|
| 451 | 451 | exit; |
| 452 | 452 | } else { |
| 453 | 453 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -464,8 +464,8 @@ discard block |
||
| 464 | 464 | if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) { // Test on pemrission already done |
| 465 | 465 | setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); |
| 466 | 466 | |
| 467 | - $url = 'card.php?track_id=' . GETPOST('track_id', 'alpha'); |
|
| 468 | - header("Location: " . $url); |
|
| 467 | + $url = 'card.php?track_id='.GETPOST('track_id', 'alpha'); |
|
| 468 | + header("Location: ".$url); |
|
| 469 | 469 | exit; |
| 470 | 470 | } else { |
| 471 | 471 | $action = ''; |
@@ -480,10 +480,10 @@ discard block |
||
| 480 | 480 | |
| 481 | 481 | $object->close($user); |
| 482 | 482 | |
| 483 | - setEventMessages('<div class="confirm">' . $langs->trans('TicketMarkedAsClosed') . '</div>', null, 'mesgs'); |
|
| 483 | + setEventMessages('<div class="confirm">'.$langs->trans('TicketMarkedAsClosed').'</div>', null, 'mesgs'); |
|
| 484 | 484 | |
| 485 | - $url = 'card.php?track_id=' . GETPOST('track_id', 'alpha'); |
|
| 486 | - header("Location: " . $url); |
|
| 485 | + $url = 'card.php?track_id='.GETPOST('track_id', 'alpha'); |
|
| 486 | + header("Location: ".$url); |
|
| 487 | 487 | exit; |
| 488 | 488 | } else { |
| 489 | 489 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) { |
| 496 | 496 | $newid = $object->createFromClone($user, $object->id); |
| 497 | 497 | if ($newid > 0) { |
| 498 | - header("Location: " . DOL_URL_ROOT . "/ticket/card.php?id=".$newid); |
|
| 498 | + header("Location: ".DOL_URL_ROOT."/ticket/card.php?id=".$newid); |
|
| 499 | 499 | exit; |
| 500 | 500 | } else { |
| 501 | 501 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -507,12 +507,12 @@ discard block |
||
| 507 | 507 | if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $permissiontodelete) { |
| 508 | 508 | if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) { |
| 509 | 509 | if ($object->delete($user) > 0) { |
| 510 | - setEventMessages('<div class="confirm">' . $langs->trans('TicketDeletedSuccess') . '</div>', null, 'mesgs'); |
|
| 511 | - header("Location: " . DOL_URL_ROOT . "/ticket/list.php"); |
|
| 510 | + setEventMessages('<div class="confirm">'.$langs->trans('TicketDeletedSuccess').'</div>', null, 'mesgs'); |
|
| 511 | + header("Location: ".DOL_URL_ROOT."/ticket/list.php"); |
|
| 512 | 512 | exit; |
| 513 | 513 | } else { |
| 514 | 514 | $langs->load("errors"); |
| 515 | - $mesg = '<div class="error">' . $langs->trans($object->error) . '</div>'; |
|
| 515 | + $mesg = '<div class="error">'.$langs->trans($object->error).'</div>'; |
|
| 516 | 516 | $action = ''; |
| 517 | 517 | } |
| 518 | 518 | } |
@@ -522,8 +522,8 @@ discard block |
||
| 522 | 522 | if ($action == 'set_thirdparty' && $user->hasRight('ticket', 'write')) { |
| 523 | 523 | if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) { |
| 524 | 524 | $result = $object->setCustomer(GETPOSTINT('editcustomer')); |
| 525 | - $url = $_SERVER["PHP_SELF"] . '?track_id=' . GETPOST('track_id', 'alpha'); |
|
| 526 | - header("Location: " . $url); |
|
| 525 | + $url = $_SERVER["PHP_SELF"].'?track_id='.GETPOST('track_id', 'alpha'); |
|
| 526 | + header("Location: ".$url); |
|
| 527 | 527 | exit(); |
| 528 | 528 | } |
| 529 | 529 | } |
@@ -533,8 +533,8 @@ discard block |
||
| 533 | 533 | if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) { |
| 534 | 534 | $result = $object->setProgression(GETPOSTINT('progress')); |
| 535 | 535 | |
| 536 | - $url = 'card.php?track_id=' . $object->track_id; |
|
| 537 | - header("Location: " . $url); |
|
| 536 | + $url = 'card.php?track_id='.$object->track_id; |
|
| 537 | + header("Location: ".$url); |
|
| 538 | 538 | exit(); |
| 539 | 539 | } |
| 540 | 540 | } |
@@ -544,8 +544,8 @@ discard block |
||
| 544 | 544 | if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) { |
| 545 | 545 | $result = $object->setCategories(GETPOST('categories', 'array')); |
| 546 | 546 | |
| 547 | - $url = 'card.php?track_id=' . $object->track_id; |
|
| 548 | - header("Location: " . $url); |
|
| 547 | + $url = 'card.php?track_id='.$object->track_id; |
|
| 548 | + header("Location: ".$url); |
|
| 549 | 549 | exit(); |
| 550 | 550 | } |
| 551 | 551 | } |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | } |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | - header("Location: " . $_SERVER['PHP_SELF'] . "?track_id=" . $object->track_id); |
|
| 572 | + header("Location: ".$_SERVER['PHP_SELF']."?track_id=".$object->track_id); |
|
| 573 | 573 | exit; |
| 574 | 574 | } |
| 575 | 575 | } |
@@ -584,8 +584,8 @@ discard block |
||
| 584 | 584 | $res = $object->setStatut(Ticket::STATUS_NOT_READ, null, '', $triggermodname); |
| 585 | 585 | } |
| 586 | 586 | if ($res) { |
| 587 | - $url = 'card.php?track_id=' . $object->track_id; |
|
| 588 | - header("Location: " . $url); |
|
| 587 | + $url = 'card.php?track_id='.$object->track_id; |
|
| 588 | + header("Location: ".$url); |
|
| 589 | 589 | exit(); |
| 590 | 590 | } else { |
| 591 | 591 | $error++; |
@@ -597,16 +597,16 @@ discard block |
||
| 597 | 597 | // Categorisation dans projet |
| 598 | 598 | if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) { |
| 599 | 599 | $object->setProject($projectid); |
| 600 | - $url = 'card.php?track_id=' . $object->track_id; |
|
| 601 | - header("Location: " . $url); |
|
| 600 | + $url = 'card.php?track_id='.$object->track_id; |
|
| 601 | + header("Location: ".$url); |
|
| 602 | 602 | exit(); |
| 603 | 603 | } |
| 604 | 604 | } elseif ($action == 'setcontract' && $permissiontoadd) { |
| 605 | 605 | // Categorisation dans contrat |
| 606 | 606 | if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) { |
| 607 | 607 | $object->setContract(GETPOSTINT('contractid')); |
| 608 | - $url = 'card.php?track_id=' . $object->track_id; |
|
| 609 | - header("Location: " . $url); |
|
| 608 | + $url = 'card.php?track_id='.$object->track_id; |
|
| 609 | + header("Location: ".$url); |
|
| 610 | 610 | exit(); |
| 611 | 611 | } |
| 612 | 612 | } elseif ($action == "set_message" && $user->hasRight('ticket', 'manage')) { |
@@ -637,8 +637,8 @@ discard block |
||
| 637 | 637 | //$old_status = $object->status; |
| 638 | 638 | $res = $object->setStatut($new_status); |
| 639 | 639 | if ($res) { |
| 640 | - $url = 'card.php?track_id=' . $object->track_id; |
|
| 641 | - header("Location: " . $url); |
|
| 640 | + $url = 'card.php?track_id='.$object->track_id; |
|
| 641 | + header("Location: ".$url); |
|
| 642 | 642 | exit(); |
| 643 | 643 | } else { |
| 644 | 644 | $error++; |
@@ -692,17 +692,17 @@ discard block |
||
| 692 | 692 | include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
| 693 | 693 | |
| 694 | 694 | $permissiondellink = $user->hasRight('ticket', 'write'); |
| 695 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 695 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
| 696 | 696 | |
| 697 | 697 | // Actions to build doc |
| 698 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
| 698 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
| 699 | 699 | |
| 700 | 700 | // Actions to send emails |
| 701 | 701 | $triggersendname = 'TICKET_SENTBYMAIL'; |
| 702 | 702 | $paramname = 'id'; |
| 703 | 703 | $autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add |
| 704 | - $trackid = 'tic' . $object->id; |
|
| 705 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
| 704 | + $trackid = 'tic'.$object->id; |
|
| 705 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
| 706 | 706 | |
| 707 | 707 | // Set $action to correct value for the case we used presend action to add a message |
| 708 | 708 | if (GETPOSTISSET('actionbis') && $action == 'presend') { // Test on permission not required here |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | |
| 739 | 739 | print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket'); |
| 740 | 740 | |
| 741 | - $formticket->trackid = ''; // TODO Use a unique key 'tic' to avoid conflict in upload file feature |
|
| 741 | + $formticket->trackid = ''; // TODO Use a unique key 'tic' to avoid conflict in upload file feature |
|
| 742 | 742 | $formticket->withfromsocid = $socid ? $socid : $user->socid; |
| 743 | 743 | $formticket->withfromcontactid = $contactid ? $contactid : ''; |
| 744 | 744 | $formticket->withtitletopic = 1; |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | |
| 772 | 772 | print dol_get_fiche_head($head, 'tabTicket', $langs->trans('Ticket'), -1, 'ticket'); |
| 773 | 773 | |
| 774 | - $formticket->trackid = $object->track_id; // TODO Use a unique key 'tic' to avoid conflict in upload file feature |
|
| 774 | + $formticket->trackid = $object->track_id; // TODO Use a unique key 'tic' to avoid conflict in upload file feature |
|
| 775 | 775 | $formticket->withfromsocid = $object->socid; |
| 776 | 776 | $formticket->withtitletopic = 1; |
| 777 | 777 | // $formticket->withnotifytiersatcreate = ($notifyTiers ? 1 : (getDolGlobalString('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION') ? 1 : 0)); |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | '-3' => $langs->trans('TicketNotNotifyTiersAtClose') |
| 807 | 807 | ); |
| 808 | 808 | foreach ($thirdparty_contacts as $thirdparty_contact) { |
| 809 | - $contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'] . ' ' . $thirdparty_contact['lastname'] . ' ' . $thirdparty_contact['firstname']; |
|
| 809 | + $contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'].' '.$thirdparty_contact['lastname'].' '.$thirdparty_contact['firstname']; |
|
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | // Default select all or no contact |
@@ -1061,8 +1061,8 @@ discard block |
||
| 1061 | 1061 | $morehtmlref .= $formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contract, 'contratid', 0, 1, 1, 1); |
| 1062 | 1062 | } else { |
| 1063 | 1063 | $morehtmlref .= '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit_contrat&token='.newToken().'&id='.$object->id.'">'; |
| 1064 | - $morehtmlref .= img_edit($langs->trans('SetContract')); |
|
| 1065 | - $morehtmlref .= '</a>'; |
|
| 1064 | + $morehtmlref .= img_edit($langs->trans('SetContract')); |
|
| 1065 | + $morehtmlref .= '</a>'; |
|
| 1066 | 1066 | } |
| 1067 | 1067 | } else { |
| 1068 | 1068 | if (!empty($object->fk_contract)) { |
@@ -1504,10 +1504,10 @@ discard block |
||
| 1504 | 1504 | // Link to create an intervention |
| 1505 | 1505 | // socid is needed otherwise fichinter ask it and forgot origin after form submit :\ |
| 1506 | 1506 | if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) { |
| 1507 | - print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1507 | + print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1508 | 1508 | } |
| 1509 | 1509 | if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->hasRight('ficheinter', 'creer')) { |
| 1510 | - print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, ''); |
|
| 1510 | + print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='.$object->fk_soc.'&origin=ticket_ticket&originid='.$object->id, ''); |
|
| 1511 | 1511 | } |
| 1512 | 1512 | |
| 1513 | 1513 | // Close ticket if status is read |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | $errors = 0; |
| 82 | 82 | $errorforhistory = 0; |
| 83 | 83 | $static_object = new Target($this->db); |
| 84 | - $target_url = $static_object->fetchAll(); // TODO Replace this with a search with filter on $action trigger to avoid to filter later. |
|
| 84 | + $target_url = $static_object->fetchAll(); // TODO Replace this with a search with filter on $action trigger to avoid to filter later. |
|
| 85 | 85 | |
| 86 | 86 | if (is_numeric($target_url) && $target_url < 0) { |
| 87 | - dol_syslog("Error Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); |
|
| 87 | + dol_syslog("Error Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); |
|
| 88 | 88 | $this->errors = array_merge($this->errors, $static_object->errors); |
| 89 | 89 | return -1; |
| 90 | 90 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $nbPosts++; |
| 136 | 136 | } else { |
| 137 | 137 | $errormsg = "The WebHook for ".$action." failed to get URL ".$tmpobject->url." with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : ""); |
| 138 | - $errorforhistory ++; |
|
| 138 | + $errorforhistory++; |
|
| 139 | 139 | |
| 140 | 140 | if ($tmpobject->type == Target::TYPE_BLOCKING) { |
| 141 | 141 | $errors++; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | $dbhistory->close(); |
| 173 | - dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id." -> nbPost=".$nbPosts); |
|
| 173 | + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id." -> nbPost=".$nbPosts); |
|
| 174 | 174 | |
| 175 | 175 | if (!empty($errors)) { |
| 176 | 176 | return $errors * -1; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * Only common components are here. |
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | $effs = array(); |
| 58 | 58 | |
| 59 | 59 | $sql = "SELECT id, code, libelle as label"; |
| 60 | - $sql .= " FROM " . $this->db->prefix() . "c_typent"; |
|
| 61 | - $sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = " . (empty($mysoc->country_id) ? '0' : $mysoc->country_id) . ")"; |
|
| 60 | + $sql .= " FROM ".$this->db->prefix()."c_typent"; |
|
| 61 | + $sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = ".(empty($mysoc->country_id) ? '0' : $mysoc->country_id).")"; |
|
| 62 | 62 | if ($filter) { |
| 63 | - $sql .= " " . $filter; |
|
| 63 | + $sql .= " ".$filter; |
|
| 64 | 64 | } |
| 65 | 65 | $sql .= " ORDER by position, id"; |
| 66 | - dol_syslog(get_class($this) . '::typent_array', LOG_DEBUG); |
|
| 66 | + dol_syslog(get_class($this).'::typent_array', LOG_DEBUG); |
|
| 67 | 67 | $resql = $this->db->query($sql); |
| 68 | 68 | if ($resql) { |
| 69 | 69 | $num = $this->db->num_rows($resql); |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | $effs = array(); |
| 107 | 107 | |
| 108 | 108 | $sql = "SELECT id, code, libelle as label"; |
| 109 | - $sql .= " FROM " . $this->db->prefix() . "c_effectif"; |
|
| 109 | + $sql .= " FROM ".$this->db->prefix()."c_effectif"; |
|
| 110 | 110 | $sql .= " WHERE active = 1"; |
| 111 | 111 | if ($filter) { |
| 112 | - $sql .= " " . $filter; |
|
| 112 | + $sql .= " ".$filter; |
|
| 113 | 113 | } |
| 114 | 114 | $sql .= " ORDER BY id ASC"; |
| 115 | - dol_syslog(get_class($this) . '::effectif_array', LOG_DEBUG); |
|
| 115 | + dol_syslog(get_class($this).'::effectif_array', LOG_DEBUG); |
|
| 116 | 116 | $resql = $this->db->query($sql); |
| 117 | 117 | if ($resql) { |
| 118 | 118 | $num = $this->db->num_rows($resql); |
@@ -153,13 +153,13 @@ discard block |
||
| 153 | 153 | // phpcs:enable |
| 154 | 154 | global $user, $langs; |
| 155 | 155 | |
| 156 | - print '<form method="post" action="' . $page . '">'; |
|
| 156 | + print '<form method="post" action="'.$page.'">'; |
|
| 157 | 157 | print '<input type="hidden" name="action" value="setprospectlevel">'; |
| 158 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 158 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 159 | 159 | |
| 160 | - dol_syslog(get_class($this) . '::form_prospect_level', LOG_DEBUG); |
|
| 160 | + dol_syslog(get_class($this).'::form_prospect_level', LOG_DEBUG); |
|
| 161 | 161 | $sql = "SELECT code, label"; |
| 162 | - $sql .= " FROM " . $this->db->prefix() . "c_prospectlevel"; |
|
| 162 | + $sql .= " FROM ".$this->db->prefix()."c_prospectlevel"; |
|
| 163 | 163 | $sql .= " WHERE active > 0"; |
| 164 | 164 | $sql .= " ORDER BY sortorder"; |
| 165 | 165 | $resql = $this->db->query($sql); |
@@ -185,9 +185,9 @@ discard block |
||
| 185 | 185 | dol_print_error($this->db); |
| 186 | 186 | } |
| 187 | 187 | if (!empty($htmlname) && $user->admin) { |
| 188 | - print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 188 | + print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 189 | 189 | } |
| 190 | - print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">'; |
|
| 190 | + print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">'; |
|
| 191 | 191 | print '</form>'; |
| 192 | 192 | } |
| 193 | 193 | |
@@ -204,13 +204,13 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | global $user, $langs; |
| 206 | 206 | |
| 207 | - print '<form method="post" action="' . $page . '">'; |
|
| 207 | + print '<form method="post" action="'.$page.'">'; |
|
| 208 | 208 | print '<input type="hidden" name="action" value="setprospectcontactlevel">'; |
| 209 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 209 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 210 | 210 | |
| 211 | 211 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 212 | 212 | $sql = "SELECT code, label"; |
| 213 | - $sql .= " FROM " . $this->db->prefix() . "c_prospectcontactlevel"; |
|
| 213 | + $sql .= " FROM ".$this->db->prefix()."c_prospectcontactlevel"; |
|
| 214 | 214 | $sql .= " WHERE active > 0"; |
| 215 | 215 | $sql .= " ORDER BY sortorder"; |
| 216 | 216 | $resql = $this->db->query($sql); |
@@ -236,9 +236,9 @@ discard block |
||
| 236 | 236 | dol_print_error($this->db); |
| 237 | 237 | } |
| 238 | 238 | if (!empty($htmlname) && $user->admin) { |
| 239 | - print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 239 | + print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 240 | 240 | } |
| 241 | - print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">'; |
|
| 241 | + print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">'; |
|
| 242 | 242 | print '</form>'; |
| 243 | 243 | } |
| 244 | 244 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | // phpcs:enable |
| 280 | 280 | global $conf, $langs, $user; |
| 281 | 281 | |
| 282 | - dol_syslog(get_class($this) . "::select_departement selected=" . $selected . ", country_codeid=" . $country_codeid, LOG_DEBUG); |
|
| 282 | + dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid, LOG_DEBUG); |
|
| 283 | 283 | |
| 284 | 284 | $langs->load("dict"); |
| 285 | 285 | |
@@ -287,28 +287,28 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | // Search departements/cantons/province active d'une region et pays actif |
| 289 | 289 | $sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM"; |
| 290 | - $sql .= " " . $this->db->prefix() . "c_departements as d, " . $this->db->prefix() . "c_regions as r," . $this->db->prefix() . "c_country as c"; |
|
| 290 | + $sql .= " ".$this->db->prefix()."c_departements as d, ".$this->db->prefix()."c_regions as r,".$this->db->prefix()."c_country as c"; |
|
| 291 | 291 | $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid"; |
| 292 | 292 | $sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1"; |
| 293 | 293 | if ($country_codeid && is_numeric($country_codeid)) { |
| 294 | - $sql .= " AND c.rowid = '" . $this->db->escape($country_codeid) . "'"; |
|
| 294 | + $sql .= " AND c.rowid = '".$this->db->escape($country_codeid)."'"; |
|
| 295 | 295 | } |
| 296 | 296 | if ($country_codeid && !is_numeric($country_codeid)) { |
| 297 | - $sql .= " AND c.code = '" . $this->db->escape($country_codeid) . "'"; |
|
| 297 | + $sql .= " AND c.code = '".$this->db->escape($country_codeid)."'"; |
|
| 298 | 298 | } |
| 299 | 299 | $sql .= " ORDER BY c.code, d.code_departement"; |
| 300 | 300 | |
| 301 | 301 | $result = $this->db->query($sql); |
| 302 | 302 | if ($result) { |
| 303 | 303 | if (!empty($htmlname)) { |
| 304 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 304 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 305 | 305 | } |
| 306 | 306 | if ($country_codeid) { |
| 307 | 307 | $out .= '<option value="0"> </option>'; |
| 308 | 308 | } |
| 309 | 309 | $num = $this->db->num_rows($result); |
| 310 | 310 | $i = 0; |
| 311 | - dol_syslog(get_class($this) . "::select_departement num=" . $num, LOG_DEBUG); |
|
| 311 | + dol_syslog(get_class($this)."::select_departement num=".$num, LOG_DEBUG); |
|
| 312 | 312 | if ($num) { |
| 313 | 313 | $country = ''; |
| 314 | 314 | while ($i < $num) { |
@@ -319,15 +319,15 @@ discard block |
||
| 319 | 319 | if (!$country || $country != $obj->country) { |
| 320 | 320 | // Show break if we are in list with multiple countries |
| 321 | 321 | if (!$country_codeid && $obj->country_code) { |
| 322 | - $out .= '<option value="-1" disabled data-html="----- ' . $obj->country . ' -----">----- ' . $obj->country . " -----</option>\n"; |
|
| 322 | + $out .= '<option value="-1" disabled data-html="----- '.$obj->country.' -----">----- '.$obj->country." -----</option>\n"; |
|
| 323 | 323 | $country = $obj->country; |
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | if (!empty($selected) && $selected == $obj->rowid) { |
| 328 | - $out .= '<option value="' . $obj->rowid . '" selected>'; |
|
| 328 | + $out .= '<option value="'.$obj->rowid.'" selected>'; |
|
| 329 | 329 | } else { |
| 330 | - $out .= '<option value="' . $obj->rowid . '">'; |
|
| 330 | + $out .= '<option value="'.$obj->rowid.'">'; |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
@@ -336,13 +336,13 @@ discard block |
||
| 336 | 336 | (getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || getDolGlobalString('MAIN_SHOW_STATE_CODE') === 'all') |
| 337 | 337 | ) { |
| 338 | 338 | if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) { |
| 339 | - $out .= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
| 339 | + $out .= $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
| 340 | 340 | } else { |
| 341 | - $out .= $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
| 341 | + $out .= $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
| 342 | 342 | } |
| 343 | 343 | } else { |
| 344 | 344 | if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) { |
| 345 | - $out .= $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
| 345 | + $out .= $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
| 346 | 346 | } else { |
| 347 | 347 | $out .= ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
| 348 | 348 | } |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $out .= '</select>'; |
| 358 | 358 | } |
| 359 | 359 | if (!empty($htmlname) && $user->admin) { |
| 360 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 360 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 361 | 361 | } |
| 362 | 362 | } else { |
| 363 | 363 | dol_print_error($this->db); |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | |
| 366 | 366 | // Make select dynamic |
| 367 | 367 | if (!empty($htmlname)) { |
| 368 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 368 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 369 | 369 | $out .= ajax_combobox($htmlname); |
| 370 | 370 | } |
| 371 | 371 | |
@@ -418,14 +418,14 @@ discard block |
||
| 418 | 418 | $langs->load("dict"); |
| 419 | 419 | |
| 420 | 420 | $sql = "SELECT r.rowid, r.code_region as code, r.nom as label, r.active, c.code as country_code, c.label as country"; |
| 421 | - $sql .= " FROM " . $this->db->prefix() . "c_regions as r, " . $this->db->prefix() . "c_country as c"; |
|
| 421 | + $sql .= " FROM ".$this->db->prefix()."c_regions as r, ".$this->db->prefix()."c_country as c"; |
|
| 422 | 422 | $sql .= " WHERE r.fk_pays=c.rowid AND r.active = 1 and c.active = 1"; |
| 423 | 423 | $sql .= " ORDER BY c.code, c.label ASC"; |
| 424 | 424 | |
| 425 | - dol_syslog(get_class($this) . "::select_region", LOG_DEBUG); |
|
| 425 | + dol_syslog(get_class($this)."::select_region", LOG_DEBUG); |
|
| 426 | 426 | $resql = $this->db->query($sql); |
| 427 | 427 | if ($resql) { |
| 428 | - print '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 428 | + print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 429 | 429 | $num = $this->db->num_rows($resql); |
| 430 | 430 | $i = 0; |
| 431 | 431 | if ($num) { |
@@ -437,16 +437,16 @@ discard block |
||
| 437 | 437 | } else { |
| 438 | 438 | if ($country == '' || $country != $obj->country) { |
| 439 | 439 | // Show break |
| 440 | - $key = $langs->trans("Country" . strtoupper($obj->country_code)); |
|
| 441 | - $valuetoshow = ($key != "Country" . strtoupper($obj->country_code)) ? $obj->country_code . " - " . $key : $obj->country; |
|
| 442 | - print '<option value="-2" disabled>----- ' . $valuetoshow . " -----</option>\n"; |
|
| 440 | + $key = $langs->trans("Country".strtoupper($obj->country_code)); |
|
| 441 | + $valuetoshow = ($key != "Country".strtoupper($obj->country_code)) ? $obj->country_code." - ".$key : $obj->country; |
|
| 442 | + print '<option value="-2" disabled>----- '.$valuetoshow." -----</option>\n"; |
|
| 443 | 443 | $country = $obj->country; |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | if ($selected > 0 && $selected == $obj->code) { |
| 447 | - print '<option value="' . $obj->code . '" selected>' . $obj->label . '</option>'; |
|
| 447 | + print '<option value="'.$obj->code.'" selected>'.$obj->label.'</option>'; |
|
| 448 | 448 | } else { |
| 449 | - print '<option value="' . $obj->code . '">' . $obj->label . '</option>'; |
|
| 449 | + print '<option value="'.$obj->code.'">'.$obj->label.'</option>'; |
|
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | $i++; |
@@ -477,13 +477,13 @@ discard block |
||
| 477 | 477 | |
| 478 | 478 | $out = ''; |
| 479 | 479 | |
| 480 | - $sql = "SELECT rowid, code, label, active FROM " . $this->db->prefix() . "c_civility"; |
|
| 480 | + $sql = "SELECT rowid, code, label, active FROM ".$this->db->prefix()."c_civility"; |
|
| 481 | 481 | $sql .= " WHERE active = 1"; |
| 482 | 482 | |
| 483 | 483 | dol_syslog("Form::select_civility", LOG_DEBUG); |
| 484 | 484 | $resql = $this->db->query($sql); |
| 485 | 485 | if ($resql) { |
| 486 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 486 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 487 | 487 | $out .= '<option value=""> </option>'; |
| 488 | 488 | $num = $this->db->num_rows($resql); |
| 489 | 489 | $i = 0; |
@@ -491,12 +491,12 @@ discard block |
||
| 491 | 491 | while ($i < $num) { |
| 492 | 492 | $obj = $this->db->fetch_object($resql); |
| 493 | 493 | if ($selected == $obj->code) { |
| 494 | - $out .= '<option value="' . $obj->code . '" selected>'; |
|
| 494 | + $out .= '<option value="'.$obj->code.'" selected>'; |
|
| 495 | 495 | } else { |
| 496 | - $out .= '<option value="' . $obj->code . '">'; |
|
| 496 | + $out .= '<option value="'.$obj->code.'">'; |
|
| 497 | 497 | } |
| 498 | 498 | // If translation exists, we use it, otherwise, we use the hard coded label |
| 499 | - $out .= ($langs->trans("Civility" . $obj->code) != "Civility" . $obj->code ? $langs->trans("Civility" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 499 | + $out .= ($langs->trans("Civility".$obj->code) != "Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 500 | 500 | $out .= '</option>'; |
| 501 | 501 | $i++; |
| 502 | 502 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | |
| 509 | 509 | if ($addjscombo) { |
| 510 | 510 | // Enhance with select2 |
| 511 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 511 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 512 | 512 | $out .= ajax_combobox($htmlname); |
| 513 | 513 | } |
| 514 | 514 | } else { |
@@ -558,22 +558,22 @@ discard block |
||
| 558 | 558 | |
| 559 | 559 | // Lookup the active juridical types for the active countries |
| 560 | 560 | $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code"; |
| 561 | - $sql .= " FROM " . $this->db->prefix() . "c_forme_juridique as f, " . $this->db->prefix() . "c_country as c"; |
|
| 561 | + $sql .= " FROM ".$this->db->prefix()."c_forme_juridique as f, ".$this->db->prefix()."c_country as c"; |
|
| 562 | 562 | $sql .= " WHERE f.fk_pays=c.rowid"; |
| 563 | 563 | $sql .= " AND f.active = 1 AND c.active = 1"; |
| 564 | 564 | if ($country_codeid) { |
| 565 | - $sql .= " AND c.code = '" . $this->db->escape((string) $country_codeid) . "'"; |
|
| 565 | + $sql .= " AND c.code = '".$this->db->escape((string) $country_codeid)."'"; |
|
| 566 | 566 | } |
| 567 | 567 | if ($filter) { |
| 568 | - $sql .= " " . $filter; |
|
| 568 | + $sql .= " ".$filter; |
|
| 569 | 569 | } |
| 570 | 570 | $sql .= " ORDER BY c.code"; |
| 571 | 571 | |
| 572 | - dol_syslog(get_class($this) . "::select_juridicalstatus", LOG_DEBUG); |
|
| 572 | + dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG); |
|
| 573 | 573 | $resql = $this->db->query($sql); |
| 574 | 574 | if ($resql) { |
| 575 | 575 | $out .= '<div id="particulier2" class="visible">'; |
| 576 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 576 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 577 | 577 | if ($country_codeid) { |
| 578 | 578 | $out .= '<option value="0"> </option>'; // When country_codeid is set, we force to add an empty line because it does not appears from select. When not set, we already get the empty line from select. |
| 579 | 579 | } |
@@ -588,9 +588,9 @@ discard block |
||
| 588 | 588 | $obj = $this->db->fetch_object($resql); |
| 589 | 589 | |
| 590 | 590 | if ($obj->code) { // We exclude empty line, we will add it later |
| 591 | - $labelcountry = (($langs->trans("Country" . $obj->country_code) != "Country" . $obj->country_code) ? $langs->trans("Country" . $obj->country_code) : $obj->country); |
|
| 592 | - $labeljs = (($langs->trans("JuridicalStatus" . $obj->code) != "JuridicalStatus" . $obj->code) ? $langs->trans("JuridicalStatus" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver) |
|
| 593 | - $arraydata[(int) $obj->code] = array('code' => (int) $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry . '_' . $labeljs, 'country_code' => (string) $obj->country_code, 'country' => $labelcountry); |
|
| 591 | + $labelcountry = (($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) ? $langs->trans("Country".$obj->country_code) : $obj->country); |
|
| 592 | + $labeljs = (($langs->trans("JuridicalStatus".$obj->code) != "JuridicalStatus".$obj->code) ? $langs->trans("JuridicalStatus".$obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver) |
|
| 593 | + $arraydata[(int) $obj->code] = array('code' => (int) $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry.'_'.$labeljs, 'country_code' => (string) $obj->country_code, 'country' => $labelcountry); |
|
| 594 | 594 | } |
| 595 | 595 | $i++; |
| 596 | 596 | } |
@@ -604,15 +604,15 @@ discard block |
||
| 604 | 604 | if (!$country || $country != $val['country']) { |
| 605 | 605 | // Show break when we are in multi country mode |
| 606 | 606 | if (empty($country_codeid) && $val['country_code']) { |
| 607 | - $out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- ' . $val['country'] . " -----</option>\n"; |
|
| 607 | + $out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- '.$val['country']." -----</option>\n"; |
|
| 608 | 608 | $country = $val['country']; |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | if ($selected > 0 && $selected == $val['code']) { |
| 613 | - $out .= '<option value="' . $val['code'] . '" selected>'; |
|
| 613 | + $out .= '<option value="'.$val['code'].'" selected>'; |
|
| 614 | 614 | } else { |
| 615 | - $out .= '<option value="' . $val['code'] . '">'; |
|
| 615 | + $out .= '<option value="'.$val['code'].'">'; |
|
| 616 | 616 | } |
| 617 | 617 | // If translation exists, we use it, otherwise we use default label in database |
| 618 | 618 | $out .= $val['label']; |
@@ -621,11 +621,11 @@ discard block |
||
| 621 | 621 | } |
| 622 | 622 | $out .= '</select>'; |
| 623 | 623 | if ($user->admin) { |
| 624 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 624 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | // Make select dynamic |
| 628 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 628 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 629 | 629 | $out .= ajax_combobox($htmlname); |
| 630 | 630 | |
| 631 | 631 | $out .= '</div>'; |
@@ -679,13 +679,13 @@ discard block |
||
| 679 | 679 | $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); |
| 680 | 680 | |
| 681 | 681 | if (count($events)) { // If there is some ajax events to run once selection is done, we add code here to run events |
| 682 | - print '<script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 682 | + print '<script nonce="'.getNonce().'" type="text/javascript"> |
|
| 683 | 683 | jQuery(document).ready(function() { |
| 684 | - $("#search_' . $htmlname . '").change(function() { |
|
| 685 | - var obj = ' . json_encode($events) . '; |
|
| 684 | + $("#search_' . $htmlname.'").change(function() { |
|
| 685 | + var obj = ' . json_encode($events).'; |
|
| 686 | 686 | $.each(obj, function(key,values) { |
| 687 | 687 | if (values.method.length) { |
| 688 | - runJsCodeForEvent' . $htmlname . '(values); |
|
| 688 | + runJsCodeForEvent' . $htmlname.'(values); |
|
| 689 | 689 | } |
| 690 | 690 | }); |
| 691 | 691 | |
@@ -693,13 +693,13 @@ discard block |
||
| 693 | 693 | }); |
| 694 | 694 | |
| 695 | 695 | // Function used to execute events when search_htmlname change |
| 696 | - function runJsCodeForEvent' . $htmlname . '(obj) { |
|
| 697 | - var id = $("#' . $htmlname . '").val(); |
|
| 696 | + function runJsCodeForEvent' . $htmlname.'(obj) { |
|
| 697 | + var id = $("#' . $htmlname.'").val(); |
|
| 698 | 698 | var method = obj.method; |
| 699 | 699 | var url = obj.url; |
| 700 | 700 | var htmlname = obj.htmlname; |
| 701 | 701 | var showempty = obj.showempty; |
| 702 | - console.log("Run runJsCodeForEvent-' . $htmlname . ' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname); |
|
| 702 | + console.log("Run runJsCodeForEvent-' . $htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname); |
|
| 703 | 703 | $.getJSON(url, |
| 704 | 704 | { |
| 705 | 705 | action: method, |
@@ -729,9 +729,9 @@ discard block |
||
| 729 | 729 | </script>'; |
| 730 | 730 | } |
| 731 | 731 | |
| 732 | - print "\n" . '<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->' . "\n"; |
|
| 733 | - print '<input type="text" size="30" id="search_' . $htmlname . '" name="search_' . $htmlname . '" value="' . $name . '" />'; |
|
| 734 | - print ajax_autocompleter((string) ($socid ? $socid : -1), $htmlname, DOL_URL_ROOT . '/societe/ajax/ajaxcompanies.php', '', $minLength, 0); |
|
| 732 | + print "\n".'<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->'."\n"; |
|
| 733 | + print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$name.'" />'; |
|
| 734 | + print ajax_autocompleter((string) ($socid ? $socid : -1), $htmlname, DOL_URL_ROOT.'/societe/ajax/ajaxcompanies.php', '', $minLength, 0); |
|
| 735 | 735 | return $socid; |
| 736 | 736 | } else { |
| 737 | 737 | // Search to list thirdparties |
@@ -743,18 +743,18 @@ discard block |
||
| 743 | 743 | $sql .= ", s.address, s.zip, s.town"; |
| 744 | 744 | $sql .= ", dictp.code as country_code"; |
| 745 | 745 | } |
| 746 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 746 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 747 | 747 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 748 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 748 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 749 | 749 | } |
| 750 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 750 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 751 | 751 | // For ajax search we limit here. For combo list, we limit later |
| 752 | 752 | if (is_array($limitto) && count($limitto)) { |
| 753 | - $sql .= " AND s.rowid IN (" . $this->db->sanitize(implode(',', $limitto)) . ")"; |
|
| 753 | + $sql .= " AND s.rowid IN (".$this->db->sanitize(implode(',', $limitto)).")"; |
|
| 754 | 754 | } |
| 755 | 755 | // filter user access |
| 756 | 756 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
| 757 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = ".(int) $user->id .")"; |
|
| 757 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = ".(int) $user->id.")"; |
|
| 758 | 758 | } |
| 759 | 759 | if ($user->socid > 0) { |
| 760 | 760 | $sql .= " AND s.rowid = ".((int) $user->socid); |
@@ -767,17 +767,17 @@ discard block |
||
| 767 | 767 | |
| 768 | 768 | $resql = $this->db->query($sql); |
| 769 | 769 | if ($resql) { |
| 770 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"'; |
|
| 770 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'; |
|
| 771 | 771 | if ($conf->use_javascript_ajax) { |
| 772 | - $javaScript = "window.location='" . dol_escape_js($_SERVER['PHP_SELF']) . "?" . $var_id . "=" . ($forceid > 0 ? $forceid : $object->id) . $moreparam . "&" . $htmlname . "=' + form." . $htmlname . ".options[form." . $htmlname . ".selectedIndex].value;"; |
|
| 773 | - print ' onChange="' . $javaScript . '"'; |
|
| 772 | + $javaScript = "window.location='".dol_escape_js($_SERVER['PHP_SELF'])."?".$var_id."=".($forceid > 0 ? $forceid : $object->id).$moreparam."&".$htmlname."=' + form.".$htmlname.".options[form.".$htmlname.".selectedIndex].value;"; |
|
| 773 | + print ' onChange="'.$javaScript.'"'; |
|
| 774 | 774 | } |
| 775 | 775 | print '>'; |
| 776 | 776 | print '<option value="-1"> </option>'; |
| 777 | 777 | |
| 778 | 778 | $num = $this->db->num_rows($resql); |
| 779 | 779 | $i = 0; |
| 780 | - $firstCompany = 0; // For static analysis |
|
| 780 | + $firstCompany = 0; // For static analysis |
|
| 781 | 781 | if ($num) { |
| 782 | 782 | while ($i < $num) { |
| 783 | 783 | $obj = $this->db->fetch_object($resql); |
@@ -789,18 +789,18 @@ discard block |
||
| 789 | 789 | $disabled = 1; |
| 790 | 790 | } |
| 791 | 791 | if ($selected > 0 && $selected == $obj->rowid) { |
| 792 | - print '<option value="' . $obj->rowid . '"'; |
|
| 792 | + print '<option value="'.$obj->rowid.'"'; |
|
| 793 | 793 | if ($disabled) { |
| 794 | 794 | print ' disabled'; |
| 795 | 795 | } |
| 796 | - print ' selected>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>'; |
|
| 796 | + print ' selected>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>'; |
|
| 797 | 797 | $firstCompany = $obj->rowid; |
| 798 | 798 | } else { |
| 799 | - print '<option value="' . $obj->rowid . '"'; |
|
| 799 | + print '<option value="'.$obj->rowid.'"'; |
|
| 800 | 800 | if ($disabled) { |
| 801 | 801 | print ' disabled'; |
| 802 | 802 | } |
| 803 | - print '>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>'; |
|
| 803 | + print '>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>'; |
|
| 804 | 804 | } |
| 805 | 805 | $i++; |
| 806 | 806 | } |
@@ -835,10 +835,10 @@ discard block |
||
| 835 | 835 | |
| 836 | 836 | $out = ''; |
| 837 | 837 | if (is_object($object) && method_exists($object, 'liste_type_contact')) { |
| 838 | - '@phan-var-force CommonObject $object'; // CommonObject has the method. |
|
| 839 | - $lesTypes = $object->liste_type_contact($source, $sortorder, 2, 1); // List of types into c_type_contact for element=$object->element |
|
| 838 | + '@phan-var-force CommonObject $object'; // CommonObject has the method. |
|
| 839 | + $lesTypes = $object->liste_type_contact($source, $sortorder, 2, 1); // List of types into c_type_contact for element=$object->element |
|
| 840 | 840 | |
| 841 | - $out .= '<select class="flat valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 841 | + $out .= '<select class="flat valignmiddle'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 842 | 842 | if ($showempty) { |
| 843 | 843 | $out .= '<option value="0"> </option>'; |
| 844 | 844 | } |
@@ -881,9 +881,9 @@ discard block |
||
| 881 | 881 | if ($rendermode === 'view') { |
| 882 | 882 | $toprint = array(); |
| 883 | 883 | foreach ($contact->roles as $key => $val) { |
| 884 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">' . $val['label'] . '</li>'; |
|
| 884 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">'.$val['label'].'</li>'; |
|
| 885 | 885 | } |
| 886 | - return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="' . $htmlname . '"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 886 | + return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="'.$htmlname.'"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | if ($rendermode === 'edit') { // A multiselect combo list |
@@ -929,14 +929,14 @@ discard block |
||
| 929 | 929 | |
| 930 | 930 | $size = ''; |
| 931 | 931 | if (!empty($fieldsize)) { |
| 932 | - $size = 'size="' . $fieldsize . '"'; |
|
| 932 | + $size = 'size="'.$fieldsize.'"'; |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 936 | - $out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT . '/core/ajax/ziptown.php') . "\n"; |
|
| 936 | + $out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n"; |
|
| 937 | 937 | $moreattrib .= ' autocomplete="off"'; |
| 938 | 938 | } |
| 939 | - $out .= '<input id="' . $htmlname . '" class="maxwidthonsmartphone' . ($morecss ? ' ' . $morecss : '') . '" type="text"' . ($moreattrib ? ' ' . $moreattrib : '') . ' name="' . $htmlname . '" ' . $size . ' value="' . $selected . '">' . "\n"; |
|
| 939 | + $out .= '<input id="'.$htmlname.'" class="maxwidthonsmartphone'.($morecss ? ' '.$morecss : '').'" type="text"'.($moreattrib ? ' '.$moreattrib : '').' name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n"; |
|
| 940 | 940 | |
| 941 | 941 | return $out; |
| 942 | 942 | } |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | $parameters = array('formlength' => $formlength, 'selected' => $preselected, 'idprof' => $idprof, 'htmlname' => $htmlname, 'country_code' => $country_code); |
| 1014 | 1014 | $reshook = $hookmanager->executeHooks('getInputIdProf', $parameters); |
| 1015 | 1015 | if (empty($reshook)) { |
| 1016 | - $out .= '<input type="text" ' . ($morecss ? 'class="' . $morecss . '" ' : '') . 'name="' . $htmlname . '" id="' . $htmlname . '" maxlength="' . $maxlength . '" value="' . $selected . '">'; |
|
| 1016 | + $out .= '<input type="text" '.($morecss ? 'class="'.$morecss.'" ' : '').'name="'.$htmlname.'" id="'.$htmlname.'" maxlength="'.$maxlength.'" value="'.$selected.'">'; |
|
| 1017 | 1017 | } |
| 1018 | 1018 | $out .= $hookmanager->resPrint; |
| 1019 | 1019 | |
@@ -1044,9 +1044,9 @@ discard block |
||
| 1044 | 1044 | $i = 0; |
| 1045 | 1045 | while ($i < $nbvalues) { |
| 1046 | 1046 | if ($selected == $valors[$i]) { |
| 1047 | - print '<option value="' . $valors[$i] . '" selected>'; |
|
| 1047 | + print '<option value="'.$valors[$i].'" selected>'; |
|
| 1048 | 1048 | } else { |
| 1049 | - print '<option value="' . $valors[$i] . '">'; |
|
| 1049 | + print '<option value="'.$valors[$i].'">'; |
|
| 1050 | 1050 | } |
| 1051 | 1051 | print $valors[$i]; |
| 1052 | 1052 | print '</option>'; |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | return ''; |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | - $out = '<select class="flat ' . $morecss . '" name="' . $htmlname . '" id="' . $htmlidname . '">'; |
|
| 1078 | + $out = '<select class="flat '.$morecss.'" name="'.$htmlname.'" id="'.$htmlidname.'">'; |
|
| 1079 | 1079 | if ($typeinput == 'form') { |
| 1080 | 1080 | if ($allowempty || ($selected == '' || $selected == '-1')) { |
| 1081 | 1081 | $out .= '<option value="-1">'; |
@@ -1087,33 +1087,33 @@ discard block |
||
| 1087 | 1087 | $out .= '</option>'; |
| 1088 | 1088 | } |
| 1089 | 1089 | if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { |
| 1090 | - $out .= '<option value="2"' . ($selected == 2 ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>'; |
|
| 1090 | + $out .= '<option value="2"'.($selected == 2 ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>'; |
|
| 1091 | 1091 | } |
| 1092 | 1092 | if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) { |
| 1093 | - $out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>'; |
|
| 1093 | + $out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>'; |
|
| 1094 | 1094 | } |
| 1095 | 1095 | if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { |
| 1096 | - $out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>'; |
|
| 1096 | + $out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>'; |
|
| 1097 | 1097 | } |
| 1098 | - $out .= '<option value="0"' . ((string) $selected == '0' ? ' selected' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>'; |
|
| 1098 | + $out .= '<option value="0"'.((string) $selected == '0' ? ' selected' : '').'>'.$langs->trans('NorProspectNorCustomer').'</option>'; |
|
| 1099 | 1099 | } elseif ($typeinput == 'list') { |
| 1100 | - $out .= '<option value="-1"' . (($selected == '' || $selected == '-1') ? ' selected' : '') . '> </option>'; |
|
| 1100 | + $out .= '<option value="-1"'.(($selected == '' || $selected == '-1') ? ' selected' : '').'> </option>'; |
|
| 1101 | 1101 | if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { |
| 1102 | - $out .= '<option value="2,3"' . ($selected == '2,3' ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>'; |
|
| 1102 | + $out .= '<option value="2,3"'.($selected == '2,3' ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>'; |
|
| 1103 | 1103 | } |
| 1104 | 1104 | if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { |
| 1105 | - $out .= '<option value="1,3"' . ($selected == '1,3' ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>'; |
|
| 1105 | + $out .= '<option value="1,3"'.($selected == '1,3' ? ' selected' : '').'>'.$langs->trans('Customer').'</option>'; |
|
| 1106 | 1106 | } |
| 1107 | 1107 | if (isModEnabled("fournisseur")) { |
| 1108 | - $out .= '<option value="4"' . ($selected == '4' ? ' selected' : '') . '>' . $langs->trans('Supplier') . '</option>'; |
|
| 1108 | + $out .= '<option value="4"'.($selected == '4' ? ' selected' : '').'>'.$langs->trans('Supplier').'</option>'; |
|
| 1109 | 1109 | } |
| 1110 | - $out .= '<option value="0"' . ($selected == '0' ? ' selected' : '') . '>' . $langs->trans('Other') . '</option>'; |
|
| 1110 | + $out .= '<option value="0"'.($selected == '0' ? ' selected' : '').'>'.$langs->trans('Other').'</option>'; |
|
| 1111 | 1111 | } elseif ($typeinput == 'admin') { |
| 1112 | 1112 | if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) { |
| 1113 | - $out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>'; |
|
| 1113 | + $out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>'; |
|
| 1114 | 1114 | } |
| 1115 | 1115 | if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { |
| 1116 | - $out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>'; |
|
| 1116 | + $out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>'; |
|
| 1117 | 1117 | } |
| 1118 | 1118 | } |
| 1119 | 1119 | $out .= '</select>'; |
@@ -1140,12 +1140,12 @@ discard block |
||
| 1140 | 1140 | |
| 1141 | 1141 | $out = ''; |
| 1142 | 1142 | if ($htmlname != "none") { |
| 1143 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1143 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1144 | 1144 | $out .= '<input type="hidden" name="action" value="set_thirdpartytype">'; |
| 1145 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1145 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1146 | 1146 | $sortparam = getDolGlobalString('SOCIETE_SORT_ON_TYPEENT', 'ASC'); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. |
| 1147 | 1147 | $out .= $this->selectarray($htmlname, $this->typent_array(0, $filter), $selected, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1); |
| 1148 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 1148 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 1149 | 1149 | $out .= '</form>'; |
| 1150 | 1150 | } else { |
| 1151 | 1151 | if ($selected > 0) { |
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | |
| 1185 | 1185 | //print $prospectstatic->LibProspCommStatut($statusprospect, 2, $prospectstatic->cacheprospectstatus[$statusprospect]['label'], $prospectstatic->cacheprospectstatus[$statusprospect]['picto']); |
| 1186 | 1186 | print img_action('', $actioncode, $actionpicto, 'class="inline-block valignmiddle paddingright pictoprospectstatus"'); |
| 1187 | - print '<select class="flat selectprospectstatus maxwidth150" id="'. $htmlname.$idprospect .'" data-socid="'.$idprospect.'" name="' . $htmlname .'"'; |
|
| 1187 | + print '<select class="flat selectprospectstatus maxwidth150" id="'.$htmlname.$idprospect.'" data-socid="'.$idprospect.'" name="'.$htmlname.'"'; |
|
| 1188 | 1188 | if (!$user->hasRight('societe', 'creer')) { |
| 1189 | 1189 | print ' disabled'; |
| 1190 | 1190 | } |
@@ -1214,8 +1214,8 @@ discard block |
||
| 1214 | 1214 | var image = $(this).prev(".pictoprospectstatus"); |
| 1215 | 1215 | $.ajax({ |
| 1216 | 1216 | type: "POST", |
| 1217 | - url: \'' . DOL_URL_ROOT . '/core/ajax/ajaxstatusprospect.php\', |
|
| 1218 | - data: { id: statusid, prospectid: prospectid, token: \''. newToken() .'\', action: \'updatestatusprospect\' }, |
|
| 1217 | + url: \'' . DOL_URL_ROOT.'/core/ajax/ajaxstatusprospect.php\', |
|
| 1218 | + data: { id: statusid, prospectid: prospectid, token: \''. newToken().'\', action: \'updatestatusprospect\' }, |
|
| 1219 | 1219 | success: function(response) { |
| 1220 | 1220 | console.log(response.img); |
| 1221 | 1221 | image.replaceWith(response.img); |