@@ -115,9 +115,9 @@ |
||
115 | 115 | |
116 | 116 | $now = dol_now(); |
117 | 117 | |
118 | -$title = $object->ref . ' - ' . $langs->trans("Notes"); |
|
118 | +$title = $object->ref.' - '.$langs->trans("Notes"); |
|
119 | 119 | if (!empty($withproject)) { |
120 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
120 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
121 | 121 | } |
122 | 122 | $help_url = ''; |
123 | 123 |
@@ -121,9 +121,9 @@ |
||
121 | 121 | */ |
122 | 122 | $form = new Form($db); |
123 | 123 | |
124 | -$title = $object->ref . ' - ' . $langs->trans("Documents"); |
|
124 | +$title = $object->ref.' - '.$langs->trans("Documents"); |
|
125 | 125 | if (!empty($withproject)) { |
126 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
126 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
127 | 127 | } |
128 | 128 | $help_url = ''; |
129 | 129 |
@@ -146,9 +146,9 @@ |
||
146 | 146 | $userstatic = new User($db); |
147 | 147 | $result = $projectstatic->fetch($object->fk_project); |
148 | 148 | |
149 | -$title = $object->ref . ' - ' . $langs->trans("Contacts"); |
|
149 | +$title = $object->ref.' - '.$langs->trans("Contacts"); |
|
150 | 150 | if (!empty($withproject)) { |
151 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
151 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
152 | 152 | } |
153 | 153 | $help_url = ''; |
154 | 154 |
@@ -181,7 +181,9 @@ discard block |
||
181 | 181 | $sql .= " WHERE datef between ".$wheretail; |
182 | 182 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
183 | 183 | $sql .= " AND t.fk_statut <> ".Facture::STATUS_DRAFT; |
184 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
184 | + if (!empty($projectid)) { |
|
185 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
186 | + } |
|
185 | 187 | } |
186 | 188 | // Vendor invoices |
187 | 189 | if (GETPOST('selectsupplierinvoices') && !empty($listofchoices['selectsupplierinvoices']['perms'])) { |
@@ -193,7 +195,9 @@ discard block |
||
193 | 195 | $sql .= " WHERE datef between ".$wheretail; |
194 | 196 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
195 | 197 | $sql .= " AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT; |
196 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
198 | + if (!empty($projectid)) { |
|
199 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
200 | + } |
|
197 | 201 | } |
198 | 202 | // Expense reports |
199 | 203 | if (GETPOST('selectexpensereports') && !empty($listofchoices['selectexpensereports']['perms']) && empty($projectid)) { |
@@ -216,7 +220,9 @@ discard block |
||
216 | 220 | $sql .= " WHERE datedon between ".$wheretail; |
217 | 221 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
218 | 222 | $sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT; |
219 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
223 | + if (!empty($projectid)) { |
|
224 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
225 | + } |
|
220 | 226 | } |
221 | 227 | // Payments of salaries |
222 | 228 | if (GETPOST('selectpaymentsofsalaries') && !empty($listofchoices['selectpaymentsofsalaries']['perms'])) { |
@@ -228,7 +234,9 @@ discard block |
||
228 | 234 | $sql .= " WHERE datep between ".$wheretail; |
229 | 235 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
230 | 236 | //$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT; |
231 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
237 | + if (!empty($projectid)) { |
|
238 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
239 | + } |
|
232 | 240 | } |
233 | 241 | // Social contributions |
234 | 242 | if (GETPOST('selectsocialcontributions') && !empty($listofchoices['selectsocialcontributions']['perms'])) { |
@@ -240,7 +248,9 @@ discard block |
||
240 | 248 | $sql .= " WHERE t.date_ech between ".$wheretail; |
241 | 249 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
242 | 250 | //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; |
243 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
251 | + if (!empty($projectid)) { |
|
252 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
253 | + } |
|
244 | 254 | } |
245 | 255 | // Various payments |
246 | 256 | if (GETPOST('selectvariouspayment') && !empty($listofchoices['selectvariouspayment']['perms'])) { |
@@ -251,7 +261,9 @@ discard block |
||
251 | 261 | $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t"; |
252 | 262 | $sql .= " WHERE datep between ".$wheretail; |
253 | 263 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
254 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
264 | + if (!empty($projectid)) { |
|
265 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
266 | + } |
|
255 | 267 | } |
256 | 268 | // Loan payments |
257 | 269 | if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms']) && empty($projectid)) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)), |
143 | 143 | 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)), |
144 | 144 | 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => !empty($user->rights->banque->lire)), |
145 | - 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)), |
|
145 | + 'selectloanspayment'=>array('label'=>'PaymentLoan', 'picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)), |
|
146 | 146 | ); |
147 | 147 | |
148 | 148 | |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | $zipname .= '_'.$project->ref; |
511 | 511 | } |
512 | 512 | } |
513 | - $zipname .='_export.zip'; |
|
513 | + $zipname .= '_export.zip'; |
|
514 | 514 | |
515 | 515 | dol_delete_file($zipname); |
516 | 516 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $actionType = 'delete'; |
63 | 63 | $n++; |
64 | 64 | $id = 'mybuttonid'.$n; |
65 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
65 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
66 | 66 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
67 | 67 | |
68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $actionType = 'danger'; |
71 | 71 | $n++; |
72 | 72 | $id = 'mybuttonid'.$n; |
73 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
73 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
74 | 74 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
75 | 75 | |
76 | 76 | ?> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $actionType = 'delete'; |
96 | 96 | $n++; |
97 | 97 | $id = 'mybuttonid'.$n; |
98 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
98 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
99 | 99 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
100 | 100 | |
101 | 101 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $actionType = 'danger'; |
104 | 104 | $n++; |
105 | 105 | $id = 'mybuttonid'.$n; |
106 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
106 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
107 | 107 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
108 | 108 | |
109 | 109 | ?> |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $actionType = 'delete'; |
135 | 135 | $n++; |
136 | 136 | $id = 'mybuttonid'.$n; |
137 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
137 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
138 | 138 | |
139 | 139 | $params = array( |
140 | 140 | 'confirm' => array( |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $actionType = 'delete'; |
174 | 174 | $n++; |
175 | 175 | $id = 'mybuttonid'.$n; |
176 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
176 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
177 | 177 | |
178 | 178 | $params = array( |
179 | 179 | 'confirm' => array( |
@@ -1860,7 +1860,9 @@ |
||
1860 | 1860 | } |
1861 | 1861 | } |
1862 | 1862 | } |
1863 | - if (!empty($toprint)) $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
1863 | + if (!empty($toprint)) { |
|
1864 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
1865 | + } |
|
1864 | 1866 | } else { |
1865 | 1867 | dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING); |
1866 | 1868 | } |
@@ -1027,9 +1027,9 @@ discard block |
||
1027 | 1027 | // search filter on a date extrafield shows two inputs to select a date range |
1028 | 1028 | $prefill = array( |
1029 | 1029 | 'start' => isset($value['start']) ? $value['start'] : '', |
1030 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
1030 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
1031 | 1031 | ); |
1032 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1032 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1033 | 1033 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
1034 | 1034 | $out .= '</div><div class="nowrap">'; |
1035 | 1035 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1052,9 +1052,9 @@ discard block |
||
1052 | 1052 | // search filter on a date extrafield shows two inputs to select a date range |
1053 | 1053 | $prefill = array( |
1054 | 1054 | 'start' => isset($value['start']) ? $value['start'] : '', |
1055 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
1055 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
1056 | 1056 | ); |
1057 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1057 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1058 | 1058 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
1059 | 1059 | $out .= '</div><div class="nowrap">'; |
1060 | 1060 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | // TODO Must also support $moreparam |
1064 | 1064 | $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel'); |
1065 | 1065 | } |
1066 | - } elseif (in_array($type, array('int', 'integer'))) { |
|
1066 | + } elseif (in_array($type, array('int', 'integer'))) { |
|
1067 | 1067 | $tmp = explode(',', $size); |
1068 | 1068 | $newsize = $tmp[0]; |
1069 | 1069 | $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>'; |
@@ -1077,24 +1077,24 @@ discard block |
||
1077 | 1077 | $out ='<link rel="stylesheet" href="'.dol_buildpath('/myfield/css/fontawesome-iconpicker.min.css', 1).'">'; |
1078 | 1078 | $out.='<script src="'.dol_buildpath('/myfield/js/fontawesome-iconpicker.min.js', 1).'"></script>'; |
1079 | 1079 | */ |
1080 | - $out.= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"'; |
|
1081 | - $out.= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; |
|
1080 | + $out .= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"'; |
|
1081 | + $out .= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; |
|
1082 | 1082 | if (getDolGlobalInt('MAIN_ADD_ICONPICKER_JS')) { |
1083 | - $out.='<script>'; |
|
1084 | - $options="{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {"; |
|
1085 | - $options.="iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',"; |
|
1086 | - $options.="iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',"; |
|
1083 | + $out .= '<script>'; |
|
1084 | + $options = "{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {"; |
|
1085 | + $options .= "iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',"; |
|
1086 | + $options .= "iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',"; |
|
1087 | 1087 | // $options.="buttons: '<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm\">".$langs->trans("Cancel")."</button>"; |
1088 | 1088 | // $options.="<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm\">".$langs->trans("Save")."</button>',"; |
1089 | - $options.="footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',"; |
|
1090 | - $options.="search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',"; |
|
1091 | - $options.="popover: '<div class=\"iconpicker-popover popover\">"; |
|
1092 | - $options.=" <div class=\"arrow\" ></div>"; |
|
1093 | - $options.=" <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>"; |
|
1094 | - $options.=" <div class=\"popover-content \" ></div>"; |
|
1095 | - $options.="</div>'}}"; |
|
1096 | - $out.="$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");"; |
|
1097 | - $out.='</script>'; |
|
1089 | + $options .= "footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',"; |
|
1090 | + $options .= "search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',"; |
|
1091 | + $options .= "popover: '<div class=\"iconpicker-popover popover\">"; |
|
1092 | + $options .= " <div class=\"arrow\" ></div>"; |
|
1093 | + $options .= " <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>"; |
|
1094 | + $options .= " <div class=\"popover-content \" ></div>"; |
|
1095 | + $options .= "</div>'}}"; |
|
1096 | + $out .= "$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");"; |
|
1097 | + $out .= '</script>'; |
|
1098 | 1098 | } |
1099 | 1099 | } elseif ($type == 'text') { |
1100 | 1100 | if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field |
@@ -1625,7 +1625,7 @@ discard block |
||
1625 | 1625 | |
1626 | 1626 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
1627 | 1627 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
1628 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1628 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1629 | 1629 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
1630 | 1630 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
1631 | 1631 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | if ($type == 'date') { |
1648 | 1648 | $showsize = 10; |
1649 | 1649 | if ($value !== '') { |
1650 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1650 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1651 | 1651 | } |
1652 | 1652 | } elseif ($type == 'datetime') { |
1653 | 1653 | $showsize = 19; |
@@ -1791,13 +1791,13 @@ discard block |
||
1791 | 1791 | $toprint = array(); |
1792 | 1792 | $obj = $this->db->fetch_object($resql); |
1793 | 1793 | if ($obj->rowid) { |
1794 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1794 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1795 | 1795 | $c = new Categorie($this->db); |
1796 | 1796 | $result = $c->fetch($obj->rowid); |
1797 | 1797 | if ($result > 0) { |
1798 | 1798 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1799 | 1799 | foreach ($ways as $way) { |
1800 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1800 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
1801 | 1801 | } |
1802 | 1802 | } |
1803 | 1803 | } |
@@ -2009,13 +2009,13 @@ discard block |
||
2009 | 2009 | { |
2010 | 2010 | global $conf, $langs; |
2011 | 2011 | |
2012 | - $tagtype='tr'; |
|
2013 | - $tagtype_dyn='td'; |
|
2012 | + $tagtype = 'tr'; |
|
2013 | + $tagtype_dyn = 'td'; |
|
2014 | 2014 | |
2015 | - if ($display_type=='line') { |
|
2016 | - $tagtype='div'; |
|
2017 | - $tagtype_dyn='span'; |
|
2018 | - $colspan=0; |
|
2015 | + if ($display_type == 'line') { |
|
2016 | + $tagtype = 'div'; |
|
2017 | + $tagtype_dyn = 'span'; |
|
2018 | + $colspan = 0; |
|
2019 | 2019 | } |
2020 | 2020 | |
2021 | 2021 | $extrafield_param = $this->attributes[$object->table_element]['param'][$key]; |
@@ -2035,12 +2035,12 @@ discard block |
||
2035 | 2035 | if ($mode == 'create') { |
2036 | 2036 | // On create mode, force separator group to not be collapsable |
2037 | 2037 | $extrafield_collapse_display_value = 1; |
2038 | - $expand_display = true; // We force group to be shown expanded |
|
2038 | + $expand_display = true; // We force group to be shown expanded |
|
2039 | 2039 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
2040 | 2040 | } |
2041 | 2041 | |
2042 | - $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">'; |
|
2043 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>'; |
|
2042 | + $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
|
2043 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
2044 | 2044 | // Some js code will be injected here to manage the collapsing of extrafields |
2045 | 2045 | // Output the picto |
2046 | 2046 | $out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>'; |
@@ -2071,14 +2071,14 @@ discard block |
||
2071 | 2071 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2072 | 2072 | } |
2073 | 2073 | } |
2074 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n"; |
|
2074 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n"; |
|
2075 | 2075 | $out .= ' console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n"; |
2076 | 2076 | $out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n"; |
2077 | 2077 | $out .= ' if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n"; |
2078 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
2078 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
2079 | 2079 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2080 | 2080 | $out .= ' } else {'."\n"; |
2081 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
2081 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
2082 | 2082 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2083 | 2083 | $out .= ' }'."\n"; |
2084 | 2084 | $out .= ' });'."\n"; |
@@ -2122,7 +2122,7 @@ discard block |
||
2122 | 2122 | continue; |
2123 | 2123 | } |
2124 | 2124 | |
2125 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
2125 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
2126 | 2126 | //when unticking boolean field, it's not set in POST |
2127 | 2127 | continue; |
2128 | 2128 | } |
@@ -2151,7 +2151,7 @@ discard block |
||
2151 | 2151 | $onlykey === '@GETPOSTISSET' |
2152 | 2152 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
2153 | 2153 | && in_array(abs($enabled), array(2, 5)) |
2154 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
2154 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
2155 | 2155 | ) |
2156 | 2156 | ) { |
2157 | 2157 | continue; |
@@ -2278,16 +2278,16 @@ discard block |
||
2278 | 2278 | } |
2279 | 2279 | |
2280 | 2280 | if (in_array($key_type, array('date'))) { |
2281 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
2282 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
2283 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
2281 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
2282 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
2283 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
2284 | 2284 | $value_key = array(); |
2285 | 2285 | // values provided as a component year, month, day, etc. |
2286 | - if (GETPOST($dateparamname_start . 'year')) { |
|
2287 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); |
|
2286 | + if (GETPOST($dateparamname_start.'year')) { |
|
2287 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int')); |
|
2288 | 2288 | } |
2289 | - if (GETPOST($dateparamname_start . 'year')) { |
|
2290 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); |
|
2289 | + if (GETPOST($dateparamname_start.'year')) { |
|
2290 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int')); |
|
2291 | 2291 | } |
2292 | 2292 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
2293 | 2293 | // Clean parameters |
@@ -2296,22 +2296,22 @@ discard block |
||
2296 | 2296 | continue; // Value was not provided, we should not set it. |
2297 | 2297 | } |
2298 | 2298 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
2299 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
2300 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
2301 | - if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { |
|
2299 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
2300 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
2301 | + if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) { |
|
2302 | 2302 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
2303 | - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; |
|
2304 | - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; |
|
2305 | - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; |
|
2303 | + $dateparamname_end_hour = GETPOST($dateparamname_end.'hour', 'int') != '-1' ? GETPOST($dateparamname_end.'hour', 'int') : '23'; |
|
2304 | + $dateparamname_end_min = GETPOST($dateparamname_end.'min', 'int') != '-1' ? GETPOST($dateparamname_end.'min', 'int') : '59'; |
|
2305 | + $dateparamname_end_sec = GETPOST($dateparamname_end.'sec', 'int') != '-1' ? GETPOST($dateparamname_end.'sec', 'int') : '59'; |
|
2306 | 2306 | if ($key_type == 'datetimegmt') { |
2307 | 2307 | $value_key = array( |
2308 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'), |
|
2309 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'gmt') |
|
2308 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'gmt'), |
|
2309 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'gmt') |
|
2310 | 2310 | ); |
2311 | 2311 | } else { |
2312 | 2312 | $value_key = array( |
2313 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'), |
|
2314 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel') |
|
2313 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'tzuserrel'), |
|
2314 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'tzuserrel') |
|
2315 | 2315 | ); |
2316 | 2316 | } |
2317 | 2317 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
@@ -328,7 +328,7 @@ |
||
328 | 328 | |
329 | 329 | foreach ($arrayofvat[$key] as $k => $mt) { |
330 | 330 | if ($mt) { |
331 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
331 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
332 | 332 | $account_label = $accountingaccount->label; |
333 | 333 | |
334 | 334 | // get compte id and label |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $error = 0; |
47 | 47 | $connect_id = null; |
48 | 48 | $newsectioniso = ''; |
49 | - $mesg=""; |
|
49 | + $mesg = ""; |
|
50 | 50 | |
51 | 51 | if (!is_numeric($ftp_port)) { |
52 | 52 | $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServer", $ftp_server, $ftp_port); |
@@ -191,7 +191,7 @@ |
||
191 | 191 | } |
192 | 192 | |
193 | 193 | $out = ''; |
194 | - $out .= '<select id="select'.$htmlname.'" class="selectSampleOfContainer'.($morecss? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
194 | + $out .= '<select id="select'.$htmlname.'" class="selectSampleOfContainer'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
195 | 195 | |
196 | 196 | if ($useempty == 1 || $useempty == 2) { |
197 | 197 | $out .= '<option value="-1"> </option>'; |