@@ -47,484 +47,484 @@ |
||
47 | 47 | </script>'; |
48 | 48 | |
49 | 49 | |
50 | - print_fiche_titre($langs->trans("AdvTgtTitle")); |
|
51 | - |
|
52 | - print '<div class="tabBar">' . "\n"; |
|
53 | - print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
54 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
55 | - print '<input type="hidden" name="action" value="">' . "\n"; |
|
56 | - print '<table class="border" width="100%">' . "\n"; |
|
57 | - |
|
58 | - print '<tr>' . "\n"; |
|
59 | - print '<td colspan="3" align="right">' . "\n"; |
|
60 | - |
|
61 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
62 | - |
|
63 | - print '</td>' . "\n"; |
|
64 | - print '</tr>' . "\n"; |
|
65 | - |
|
66 | - print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
67 | - if (! empty($template_id)) { |
|
68 | - $default_template = $template_id; |
|
69 | - } else { |
|
70 | - $default_template = $advTarget->id; |
|
71 | - } |
|
72 | - print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
73 | - print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
74 | - print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
75 | - print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
76 | - print $langs->trans('AdvTgtOrCreateNewFilter'); |
|
77 | - print '<input type="text" name="template_name" id="template_name" value=""/>'; |
|
78 | - print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
79 | - print '</td><td>' . "\n"; |
|
80 | - print '</td></tr>' . "\n"; |
|
81 | - |
|
82 | - print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
83 | - print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
|
84 | - print '</td><td>' . "\n"; |
|
85 | - print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
|
86 | - print '</td></tr>' . "\n"; |
|
87 | - |
|
88 | - // Customer name |
|
89 | - print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
90 | - if (! empty($array_query['cust_name'])) { |
|
91 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
92 | - } |
|
93 | - print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
94 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
95 | - print '</td></tr>' . "\n"; |
|
96 | - |
|
97 | - // Code Client |
|
98 | - print '<tr><td>' . $langs->trans('CustomerCode'); |
|
99 | - if (! empty($array_query['cust_code'])) { |
|
100 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
101 | - } |
|
102 | - print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
103 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
104 | - print '</td></tr>' . "\n"; |
|
105 | - |
|
106 | - // Address Client |
|
107 | - print '<tr><td>' . $langs->trans('Address'); |
|
108 | - if (! empty($array_query['cust_adress'])) { |
|
109 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
110 | - } |
|
111 | - print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
112 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
113 | - print '</td></tr>' . "\n"; |
|
114 | - |
|
115 | - // Zip Client |
|
116 | - print '<tr><td>' . $langs->trans('Zip'); |
|
117 | - if (! empty($array_query['cust_zip'])) { |
|
118 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
119 | - } |
|
120 | - print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
121 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
122 | - print '</td></tr>' . "\n"; |
|
123 | - |
|
124 | - // City Client |
|
125 | - print '<tr><td>' . $langs->trans('Town'); |
|
126 | - if (! empty($array_query['cust_city'])) { |
|
127 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
128 | - } |
|
129 | - print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
130 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
131 | - print '</td></tr>' . "\n"; |
|
132 | - |
|
133 | - // Customer Country |
|
134 | - print '<tr><td>' . $langs->trans("Country"); |
|
135 | - if (count($array_query['cust_country']) > 0) { |
|
136 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
137 | - } |
|
138 | - print '</td><td>' . "\n"; |
|
139 | - print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
|
140 | - print '</td><td>' . "\n"; |
|
141 | - print '</td></tr>' . "\n"; |
|
142 | - |
|
143 | - // State Customer |
|
144 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
145 | - if (count($array_query['cust_status']) > 0) { |
|
146 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
147 | - } |
|
148 | - print '</td><td>'; |
|
149 | - print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
150 | - '0' => $langs->trans('ActivityCeased'), |
|
151 | - '1' => $langs->trans('InActivity') |
|
152 | - ), $array_query['cust_status']); |
|
153 | - print '</td><td>' . "\n"; |
|
154 | - print '</td></tr>' . "\n"; |
|
155 | - |
|
156 | - // Mother Company |
|
157 | - print '<tr><td>' . $langs->trans("Maison mère"); |
|
158 | - if (! empty($array_query['cust_mothercompany'])) { |
|
159 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
160 | - } |
|
161 | - print '</td><td>' . "\n"; |
|
162 | - print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
163 | - print '</td><td>' . "\n"; |
|
164 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
165 | - print '</td></tr>' . "\n"; |
|
166 | - |
|
167 | - // Prospect/Customer |
|
168 | - $selected = $array_query['cust_typecust']; |
|
169 | - print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
170 | - if (count($array_query['cust_typecust']) > 0) { |
|
171 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
172 | - } |
|
173 | - print '</td><td>'; |
|
174 | - $options_array = array ( |
|
175 | - 2 => $langs->trans('Prospect'), |
|
176 | - 3 => $langs->trans('ProspectCustomer'), |
|
177 | - 1 => $langs->trans('Customer'), |
|
178 | - 0 => $langs->trans('NorProspectNorCustomer') |
|
179 | - ); |
|
180 | - print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
|
181 | - print '</td><td>' . "\n"; |
|
182 | - print '</td></tr>' . "\n"; |
|
183 | - |
|
184 | - // Prospection status |
|
185 | - print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
186 | - if (count($array_query['cust_prospect_status']) > 0) { |
|
187 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
188 | - } |
|
189 | - print '</td><td>'; |
|
190 | - print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
|
191 | - print '</td><td>' . "\n"; |
|
192 | - print '</td></tr>' . "\n"; |
|
193 | - |
|
194 | - // Prospection comm status |
|
195 | - print '<tr><td>' . $langs->trans('StatusProsp'); |
|
196 | - if (count($array_query['cust_comm_status']) > 0) { |
|
197 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
198 | - } |
|
199 | - print '</td><td>'; |
|
200 | - print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
|
201 | - print '</td><td>' . "\n"; |
|
202 | - print '</td></tr>' . "\n"; |
|
203 | - |
|
204 | - // Customer Type |
|
205 | - print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
206 | - if (count($array_query['cust_typeent']) > 0) { |
|
207 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
208 | - } |
|
209 | - print '</td><td>' . "\n"; |
|
210 | - print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
|
211 | - print '</td><td>' . "\n"; |
|
212 | - print '</td></tr>' . "\n"; |
|
213 | - |
|
214 | - // Staff number |
|
215 | - print '<td>' . $langs->trans("Staff"); |
|
216 | - if (count($array_query['cust_effectif_id']) > 0) { |
|
217 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
218 | - } |
|
219 | - print '</td><td>'; |
|
220 | - print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
|
221 | - print '</td><td>' . "\n"; |
|
222 | - print '</td></tr>' . "\n"; |
|
223 | - |
|
224 | - // Sales manager |
|
225 | - print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
226 | - if (count($array_query['cust_saleman']) > 0) { |
|
227 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
228 | - } |
|
229 | - print '</td><td>' . "\n"; |
|
230 | - print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
|
231 | - print '</td><td>' . "\n"; |
|
232 | - print '</td></tr>' . "\n"; |
|
233 | - |
|
234 | - // Customer Default Langauge |
|
235 | - if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
236 | - |
|
237 | - print '<tr><td>' . $langs->trans("DefaultLang"); |
|
238 | - if (count($array_query['cust_language']) > 0) { |
|
239 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
240 | - } |
|
241 | - print '</td><td>' . "\n"; |
|
242 | - print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
|
243 | - print '</td><td>' . "\n"; |
|
244 | - print '</td></tr>' . "\n"; |
|
245 | - } |
|
246 | - |
|
247 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
248 | - // Customer Categories |
|
249 | - print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
250 | - if (count($array_query['cust_categ']) > 0) { |
|
251 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
252 | - } |
|
253 | - print '</td><td>' . "\n"; |
|
254 | - print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
|
255 | - print '</td><td>' . "\n"; |
|
256 | - print '</td></tr>' . "\n"; |
|
257 | - } |
|
258 | - |
|
259 | - // Standard Extrafield feature |
|
260 | - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
261 | - // fetch optionals attributes and labels |
|
262 | - dol_include_once('/core/class/extrafields.class.php'); |
|
263 | - $extrafields = new ExtraFields($db); |
|
264 | - $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
|
265 | - foreach ( $extralabels as $key => $val ) { |
|
266 | - if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
|
267 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
268 | - if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
269 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
270 | - } |
|
271 | - print '</td><td>'; |
|
272 | - if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
273 | - print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
274 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
275 | - } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
276 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
277 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
278 | - print '</td><td>' . "\n"; |
|
279 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
280 | - } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
281 | - |
|
282 | - print '<table class="nobordernopadding"><tr>'; |
|
283 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
284 | - print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
285 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
286 | - print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
287 | - print '</td></tr></table>'; |
|
288 | - |
|
289 | - print '</td><td>' . "\n"; |
|
290 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
291 | - } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
292 | - print $form->selectarray('options_' . $key, array ( |
|
293 | - '' => '', |
|
294 | - '1' => $langs->trans('Yes'), |
|
295 | - '0' => $langs->trans('No') |
|
296 | - ), $array_query['options_' . $key]); |
|
297 | - print '</td><td>' . "\n"; |
|
298 | - } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
299 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
300 | - print '</td><td>' . "\n"; |
|
301 | - } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
302 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
303 | - print '</td><td>' . "\n"; |
|
304 | - } else { |
|
305 | - |
|
306 | - print '<table class="nobordernopadding"><tr>'; |
|
307 | - print '<td></td><td>'; |
|
308 | - if (is_array($array_query['options_' . $key])) { |
|
309 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
310 | - } else { |
|
311 | - print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
312 | - } |
|
313 | - print '</td></tr></table>'; |
|
314 | - |
|
315 | - print '</td><td>' . "\n"; |
|
316 | - } |
|
317 | - print '</td></tr>' . "\n"; |
|
318 | - } |
|
319 | - } |
|
320 | - } else { |
|
321 | - $std_soc = new Societe($db); |
|
322 | - $action_search = 'query'; |
|
323 | - |
|
324 | - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
|
325 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
326 | - $hookmanager = new HookManager($db); |
|
327 | - $hookmanager->initHooks(array ('thirdpartycard')); |
|
328 | - |
|
329 | - $parameters=array(); |
|
330 | - if (! empty($advTarget->id)) { |
|
331 | - $parameters = array('array_query' => $advTarget->filtervalue); |
|
332 | - } |
|
333 | - // Other attributes |
|
334 | - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); |
|
50 | + print_fiche_titre($langs->trans("AdvTgtTitle")); |
|
51 | + |
|
52 | + print '<div class="tabBar">' . "\n"; |
|
53 | + print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
54 | + print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
55 | + print '<input type="hidden" name="action" value="">' . "\n"; |
|
56 | + print '<table class="border" width="100%">' . "\n"; |
|
57 | + |
|
58 | + print '<tr>' . "\n"; |
|
59 | + print '<td colspan="3" align="right">' . "\n"; |
|
60 | + |
|
61 | + print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
62 | + |
|
63 | + print '</td>' . "\n"; |
|
64 | + print '</tr>' . "\n"; |
|
65 | + |
|
66 | + print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
67 | + if (! empty($template_id)) { |
|
68 | + $default_template = $template_id; |
|
69 | + } else { |
|
70 | + $default_template = $advTarget->id; |
|
71 | + } |
|
72 | + print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
73 | + print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
74 | + print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
75 | + print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
76 | + print $langs->trans('AdvTgtOrCreateNewFilter'); |
|
77 | + print '<input type="text" name="template_name" id="template_name" value=""/>'; |
|
78 | + print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
79 | + print '</td><td>' . "\n"; |
|
80 | + print '</td></tr>' . "\n"; |
|
81 | + |
|
82 | + print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
83 | + print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
|
84 | + print '</td><td>' . "\n"; |
|
85 | + print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
|
86 | + print '</td></tr>' . "\n"; |
|
87 | + |
|
88 | + // Customer name |
|
89 | + print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
90 | + if (! empty($array_query['cust_name'])) { |
|
91 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
92 | + } |
|
93 | + print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
94 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
95 | + print '</td></tr>' . "\n"; |
|
96 | + |
|
97 | + // Code Client |
|
98 | + print '<tr><td>' . $langs->trans('CustomerCode'); |
|
99 | + if (! empty($array_query['cust_code'])) { |
|
100 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
101 | + } |
|
102 | + print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
103 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
104 | + print '</td></tr>' . "\n"; |
|
105 | + |
|
106 | + // Address Client |
|
107 | + print '<tr><td>' . $langs->trans('Address'); |
|
108 | + if (! empty($array_query['cust_adress'])) { |
|
109 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
110 | + } |
|
111 | + print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
112 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
113 | + print '</td></tr>' . "\n"; |
|
114 | + |
|
115 | + // Zip Client |
|
116 | + print '<tr><td>' . $langs->trans('Zip'); |
|
117 | + if (! empty($array_query['cust_zip'])) { |
|
118 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
119 | + } |
|
120 | + print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
121 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
122 | + print '</td></tr>' . "\n"; |
|
123 | + |
|
124 | + // City Client |
|
125 | + print '<tr><td>' . $langs->trans('Town'); |
|
126 | + if (! empty($array_query['cust_city'])) { |
|
127 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
128 | + } |
|
129 | + print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
130 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
131 | + print '</td></tr>' . "\n"; |
|
132 | + |
|
133 | + // Customer Country |
|
134 | + print '<tr><td>' . $langs->trans("Country"); |
|
135 | + if (count($array_query['cust_country']) > 0) { |
|
136 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
137 | + } |
|
138 | + print '</td><td>' . "\n"; |
|
139 | + print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
|
140 | + print '</td><td>' . "\n"; |
|
141 | + print '</td></tr>' . "\n"; |
|
142 | + |
|
143 | + // State Customer |
|
144 | + print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
145 | + if (count($array_query['cust_status']) > 0) { |
|
146 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
147 | + } |
|
148 | + print '</td><td>'; |
|
149 | + print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
150 | + '0' => $langs->trans('ActivityCeased'), |
|
151 | + '1' => $langs->trans('InActivity') |
|
152 | + ), $array_query['cust_status']); |
|
153 | + print '</td><td>' . "\n"; |
|
154 | + print '</td></tr>' . "\n"; |
|
155 | + |
|
156 | + // Mother Company |
|
157 | + print '<tr><td>' . $langs->trans("Maison mère"); |
|
158 | + if (! empty($array_query['cust_mothercompany'])) { |
|
159 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
160 | + } |
|
161 | + print '</td><td>' . "\n"; |
|
162 | + print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
163 | + print '</td><td>' . "\n"; |
|
164 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
165 | + print '</td></tr>' . "\n"; |
|
166 | + |
|
167 | + // Prospect/Customer |
|
168 | + $selected = $array_query['cust_typecust']; |
|
169 | + print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
170 | + if (count($array_query['cust_typecust']) > 0) { |
|
171 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
172 | + } |
|
173 | + print '</td><td>'; |
|
174 | + $options_array = array ( |
|
175 | + 2 => $langs->trans('Prospect'), |
|
176 | + 3 => $langs->trans('ProspectCustomer'), |
|
177 | + 1 => $langs->trans('Customer'), |
|
178 | + 0 => $langs->trans('NorProspectNorCustomer') |
|
179 | + ); |
|
180 | + print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
|
181 | + print '</td><td>' . "\n"; |
|
182 | + print '</td></tr>' . "\n"; |
|
183 | + |
|
184 | + // Prospection status |
|
185 | + print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
186 | + if (count($array_query['cust_prospect_status']) > 0) { |
|
187 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
188 | + } |
|
189 | + print '</td><td>'; |
|
190 | + print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
|
191 | + print '</td><td>' . "\n"; |
|
192 | + print '</td></tr>' . "\n"; |
|
193 | + |
|
194 | + // Prospection comm status |
|
195 | + print '<tr><td>' . $langs->trans('StatusProsp'); |
|
196 | + if (count($array_query['cust_comm_status']) > 0) { |
|
197 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
198 | + } |
|
199 | + print '</td><td>'; |
|
200 | + print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
|
201 | + print '</td><td>' . "\n"; |
|
202 | + print '</td></tr>' . "\n"; |
|
203 | + |
|
204 | + // Customer Type |
|
205 | + print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
206 | + if (count($array_query['cust_typeent']) > 0) { |
|
207 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
208 | + } |
|
209 | + print '</td><td>' . "\n"; |
|
210 | + print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
|
211 | + print '</td><td>' . "\n"; |
|
212 | + print '</td></tr>' . "\n"; |
|
213 | + |
|
214 | + // Staff number |
|
215 | + print '<td>' . $langs->trans("Staff"); |
|
216 | + if (count($array_query['cust_effectif_id']) > 0) { |
|
217 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
218 | + } |
|
219 | + print '</td><td>'; |
|
220 | + print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
|
221 | + print '</td><td>' . "\n"; |
|
222 | + print '</td></tr>' . "\n"; |
|
223 | + |
|
224 | + // Sales manager |
|
225 | + print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
226 | + if (count($array_query['cust_saleman']) > 0) { |
|
227 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
228 | + } |
|
229 | + print '</td><td>' . "\n"; |
|
230 | + print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
|
231 | + print '</td><td>' . "\n"; |
|
232 | + print '</td></tr>' . "\n"; |
|
233 | + |
|
234 | + // Customer Default Langauge |
|
235 | + if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
236 | + |
|
237 | + print '<tr><td>' . $langs->trans("DefaultLang"); |
|
238 | + if (count($array_query['cust_language']) > 0) { |
|
239 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
240 | + } |
|
241 | + print '</td><td>' . "\n"; |
|
242 | + print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
|
243 | + print '</td><td>' . "\n"; |
|
244 | + print '</td></tr>' . "\n"; |
|
245 | + } |
|
246 | + |
|
247 | + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
248 | + // Customer Categories |
|
249 | + print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
250 | + if (count($array_query['cust_categ']) > 0) { |
|
251 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
252 | + } |
|
253 | + print '</td><td>' . "\n"; |
|
254 | + print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
|
255 | + print '</td><td>' . "\n"; |
|
256 | + print '</td></tr>' . "\n"; |
|
257 | + } |
|
258 | + |
|
259 | + // Standard Extrafield feature |
|
260 | + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
261 | + // fetch optionals attributes and labels |
|
262 | + dol_include_once('/core/class/extrafields.class.php'); |
|
263 | + $extrafields = new ExtraFields($db); |
|
264 | + $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
|
265 | + foreach ( $extralabels as $key => $val ) { |
|
266 | + if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
|
267 | + print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
268 | + if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
269 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
270 | + } |
|
271 | + print '</td><td>'; |
|
272 | + if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
273 | + print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
274 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
275 | + } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
276 | + print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
277 | + print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
278 | + print '</td><td>' . "\n"; |
|
279 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
280 | + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
281 | + |
|
282 | + print '<table class="nobordernopadding"><tr>'; |
|
283 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
284 | + print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
285 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
286 | + print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
287 | + print '</td></tr></table>'; |
|
288 | + |
|
289 | + print '</td><td>' . "\n"; |
|
290 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
291 | + } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
292 | + print $form->selectarray('options_' . $key, array ( |
|
293 | + '' => '', |
|
294 | + '1' => $langs->trans('Yes'), |
|
295 | + '0' => $langs->trans('No') |
|
296 | + ), $array_query['options_' . $key]); |
|
297 | + print '</td><td>' . "\n"; |
|
298 | + } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
299 | + print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
300 | + print '</td><td>' . "\n"; |
|
301 | + } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
302 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
303 | + print '</td><td>' . "\n"; |
|
304 | + } else { |
|
305 | + |
|
306 | + print '<table class="nobordernopadding"><tr>'; |
|
307 | + print '<td></td><td>'; |
|
308 | + if (is_array($array_query['options_' . $key])) { |
|
309 | + print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
310 | + } else { |
|
311 | + print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
312 | + } |
|
313 | + print '</td></tr></table>'; |
|
314 | + |
|
315 | + print '</td><td>' . "\n"; |
|
316 | + } |
|
317 | + print '</td></tr>' . "\n"; |
|
318 | + } |
|
319 | + } |
|
320 | + } else { |
|
321 | + $std_soc = new Societe($db); |
|
322 | + $action_search = 'query'; |
|
323 | + |
|
324 | + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
|
325 | + include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
326 | + $hookmanager = new HookManager($db); |
|
327 | + $hookmanager->initHooks(array ('thirdpartycard')); |
|
328 | + |
|
329 | + $parameters=array(); |
|
330 | + if (! empty($advTarget->id)) { |
|
331 | + $parameters = array('array_query' => $advTarget->filtervalue); |
|
332 | + } |
|
333 | + // Other attributes |
|
334 | + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); |
|
335 | 335 | print $hookmanager->resPrint; |
336 | - } |
|
337 | - |
|
338 | - // State Contact |
|
339 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
340 | - if (count($array_query['contact_status']) > 0) { |
|
341 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
342 | - } |
|
343 | - print '</td><td>'; |
|
344 | - print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
345 | - '0' => $langs->trans('ActivityCeased'), |
|
346 | - '1' => $langs->trans('InActivity') |
|
347 | - ), $array_query['contact_status']); |
|
348 | - print '</td><td>' . "\n"; |
|
349 | - print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
|
350 | - print '</td></tr>' . "\n"; |
|
351 | - |
|
352 | - // Civility |
|
353 | - print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
354 | - if (count($array_query['contact_civility']) > 0) { |
|
355 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
356 | - } |
|
357 | - print '</td><td>'; |
|
358 | - print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']); |
|
359 | - print '</td></tr>'; |
|
360 | - |
|
361 | - // contact name |
|
362 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
363 | - if (! empty($array_query['contact_lastname'])) { |
|
364 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
365 | - } |
|
366 | - print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
367 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
368 | - print '</td></tr>' . "\n"; |
|
369 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
370 | - if (! empty($array_query['contact_firstname'])) { |
|
371 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
372 | - } |
|
373 | - print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
374 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
375 | - print '</td></tr>' . "\n"; |
|
376 | - |
|
377 | - // Contact Country |
|
378 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
379 | - if (count($array_query['contact_country']) > 0) { |
|
380 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
381 | - } |
|
382 | - print '</td><td>' . "\n"; |
|
383 | - print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
|
384 | - print '</td><td>' . "\n"; |
|
385 | - print '</td></tr>' . "\n"; |
|
386 | - |
|
387 | - // Never send mass mailing |
|
388 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
389 | - if (! empty($array_query['contact_no_email'])) { |
|
390 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
391 | - } |
|
392 | - print '</td><td>' . "\n"; |
|
393 | - print $form->selectarray('contact_no_email', array ( |
|
394 | - '' => '', |
|
395 | - '1' => $langs->trans('Yes'), |
|
396 | - '0' => $langs->trans('No') |
|
397 | - ), $array_query['contact_no_email']); |
|
398 | - print '</td><td>' . "\n"; |
|
399 | - print '</td></tr>' . "\n"; |
|
400 | - |
|
401 | - // Contact Date Create |
|
402 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
403 | - if (! empty($array_query['contact_create_st_dt'])) { |
|
404 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
405 | - } |
|
406 | - print '</td><td>' . "\n"; |
|
407 | - print '<table class="nobordernopadding"><tr>'; |
|
408 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
409 | - print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
410 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
411 | - print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
412 | - print '</td></tr></table>'; |
|
413 | - print '</td><td>' . "\n"; |
|
414 | - print '</td></tr>' . "\n"; |
|
415 | - |
|
416 | - // Contact update Create |
|
417 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
418 | - if (! empty($array_query['contact_update_st_dt'])) { |
|
419 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
420 | - } |
|
421 | - print '</td><td>' . "\n"; |
|
422 | - print '<table class="nobordernopadding"><tr>'; |
|
423 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
424 | - print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
425 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
426 | - print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
427 | - print '</td></tr></table>'; |
|
428 | - print '</td><td>' . "\n"; |
|
429 | - print '</td></tr>' . "\n"; |
|
430 | - |
|
431 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
432 | - // Customer Categories |
|
433 | - print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
434 | - if (count($array_query['contact_categ']) > 0) { |
|
435 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
436 | - } |
|
437 | - print '</td><td>' . "\n"; |
|
438 | - print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
|
439 | - print '</td><td>' . "\n"; |
|
440 | - print '</td></tr>' . "\n"; |
|
441 | - } |
|
442 | - |
|
443 | - // Standard Extrafield feature |
|
444 | - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
445 | - // fetch optionals attributes and labels |
|
446 | - dol_include_once('/core/class/extrafields.class.php'); |
|
447 | - $extrafields = new ExtraFields($db); |
|
448 | - $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
|
336 | + } |
|
337 | + |
|
338 | + // State Contact |
|
339 | + print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
340 | + if (count($array_query['contact_status']) > 0) { |
|
341 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
342 | + } |
|
343 | + print '</td><td>'; |
|
344 | + print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
345 | + '0' => $langs->trans('ActivityCeased'), |
|
346 | + '1' => $langs->trans('InActivity') |
|
347 | + ), $array_query['contact_status']); |
|
348 | + print '</td><td>' . "\n"; |
|
349 | + print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
|
350 | + print '</td></tr>' . "\n"; |
|
351 | + |
|
352 | + // Civility |
|
353 | + print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
354 | + if (count($array_query['contact_civility']) > 0) { |
|
355 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
356 | + } |
|
357 | + print '</td><td>'; |
|
358 | + print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']); |
|
359 | + print '</td></tr>'; |
|
360 | + |
|
361 | + // contact name |
|
362 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
363 | + if (! empty($array_query['contact_lastname'])) { |
|
364 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
365 | + } |
|
366 | + print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
367 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
368 | + print '</td></tr>' . "\n"; |
|
369 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
370 | + if (! empty($array_query['contact_firstname'])) { |
|
371 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
372 | + } |
|
373 | + print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
374 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
375 | + print '</td></tr>' . "\n"; |
|
376 | + |
|
377 | + // Contact Country |
|
378 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
379 | + if (count($array_query['contact_country']) > 0) { |
|
380 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
381 | + } |
|
382 | + print '</td><td>' . "\n"; |
|
383 | + print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
|
384 | + print '</td><td>' . "\n"; |
|
385 | + print '</td></tr>' . "\n"; |
|
386 | + |
|
387 | + // Never send mass mailing |
|
388 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
389 | + if (! empty($array_query['contact_no_email'])) { |
|
390 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
391 | + } |
|
392 | + print '</td><td>' . "\n"; |
|
393 | + print $form->selectarray('contact_no_email', array ( |
|
394 | + '' => '', |
|
395 | + '1' => $langs->trans('Yes'), |
|
396 | + '0' => $langs->trans('No') |
|
397 | + ), $array_query['contact_no_email']); |
|
398 | + print '</td><td>' . "\n"; |
|
399 | + print '</td></tr>' . "\n"; |
|
400 | + |
|
401 | + // Contact Date Create |
|
402 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
403 | + if (! empty($array_query['contact_create_st_dt'])) { |
|
404 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
405 | + } |
|
406 | + print '</td><td>' . "\n"; |
|
407 | + print '<table class="nobordernopadding"><tr>'; |
|
408 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
409 | + print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
410 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
411 | + print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
412 | + print '</td></tr></table>'; |
|
413 | + print '</td><td>' . "\n"; |
|
414 | + print '</td></tr>' . "\n"; |
|
415 | + |
|
416 | + // Contact update Create |
|
417 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
418 | + if (! empty($array_query['contact_update_st_dt'])) { |
|
419 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
420 | + } |
|
421 | + print '</td><td>' . "\n"; |
|
422 | + print '<table class="nobordernopadding"><tr>'; |
|
423 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
424 | + print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
425 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
426 | + print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
427 | + print '</td></tr></table>'; |
|
428 | + print '</td><td>' . "\n"; |
|
429 | + print '</td></tr>' . "\n"; |
|
430 | + |
|
431 | + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
432 | + // Customer Categories |
|
433 | + print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
434 | + if (count($array_query['contact_categ']) > 0) { |
|
435 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
436 | + } |
|
437 | + print '</td><td>' . "\n"; |
|
438 | + print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
|
439 | + print '</td><td>' . "\n"; |
|
440 | + print '</td></tr>' . "\n"; |
|
441 | + } |
|
442 | + |
|
443 | + // Standard Extrafield feature |
|
444 | + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
445 | + // fetch optionals attributes and labels |
|
446 | + dol_include_once('/core/class/extrafields.class.php'); |
|
447 | + $extrafields = new ExtraFields($db); |
|
448 | + $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
|
449 | 449 | foreach($extrafields->attribute_type as $key=>&$value) { |
450 | 450 | if($value == 'radio')$value = 'select'; |
451 | 451 | } |
452 | 452 | |
453 | 453 | |
454 | - foreach ( $extralabels as $key => $val ) { |
|
455 | - |
|
456 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
457 | - if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
458 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
459 | - } |
|
460 | - print '</td><td>'; |
|
461 | - if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
462 | - print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
463 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
464 | - } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
465 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
466 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
467 | - print '</td><td>' . "\n"; |
|
468 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
469 | - } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
470 | - |
|
471 | - print '<table class="nobordernopadding"><tr>'; |
|
472 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
473 | - print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
474 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
475 | - print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
476 | - print '</td></tr></table>'; |
|
477 | - |
|
478 | - print '</td><td>' . "\n"; |
|
479 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
480 | - } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
481 | - print $form->selectarray('options_' . $key . '_cnct', array ( |
|
482 | - '' => '', |
|
483 | - '1' => $langs->trans('Yes'), |
|
484 | - '0' => $langs->trans('No') |
|
485 | - ), $array_query['options_' . $key . '_cnct']); |
|
486 | - print '</td><td>' . "\n"; |
|
487 | - } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
488 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
489 | - print '</td><td>' . "\n"; |
|
490 | - } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
491 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
492 | - print '</td><td>' . "\n"; |
|
493 | - } else { |
|
494 | - |
|
495 | - print '<table class="nobordernopadding"><tr>'; |
|
496 | - print '<td></td><td>'; |
|
497 | - if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
498 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
499 | - } else { |
|
500 | - print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
501 | - } |
|
502 | - print '</td></tr></table>'; |
|
503 | - |
|
504 | - print '</td><td>' . "\n"; |
|
505 | - } |
|
506 | - print '</td></tr>' . "\n"; |
|
507 | - } |
|
508 | - } |
|
509 | - |
|
510 | - print '<tr>' . "\n"; |
|
511 | - print '<td colspan="3" align="right">' . "\n"; |
|
512 | - |
|
513 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
514 | - |
|
515 | - print '</td>' . "\n"; |
|
516 | - print '</tr>' . "\n"; |
|
517 | - print '</table>' . "\n"; |
|
518 | - print '</form>' . "\n"; |
|
519 | - print '</div>' . "\n"; |
|
520 | - |
|
521 | - print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
522 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
523 | - print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
|
524 | - print '<table class="noborder" width="100%">'; |
|
525 | - print '<tr class="liste_titre">'; |
|
526 | - print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
527 | - print '</tr>'; |
|
528 | - print '</table>'; |
|
529 | - print '</form>'; |
|
530 | - print '<br>'; |
|
531 | 454 | \ No newline at end of file |
455 | + foreach ( $extralabels as $key => $val ) { |
|
456 | + |
|
457 | + print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
458 | + if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
459 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
460 | + } |
|
461 | + print '</td><td>'; |
|
462 | + if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
463 | + print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
464 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
465 | + } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
466 | + print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
467 | + print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
468 | + print '</td><td>' . "\n"; |
|
469 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
470 | + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
471 | + |
|
472 | + print '<table class="nobordernopadding"><tr>'; |
|
473 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
474 | + print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
475 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
476 | + print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
477 | + print '</td></tr></table>'; |
|
478 | + |
|
479 | + print '</td><td>' . "\n"; |
|
480 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
481 | + } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
482 | + print $form->selectarray('options_' . $key . '_cnct', array ( |
|
483 | + '' => '', |
|
484 | + '1' => $langs->trans('Yes'), |
|
485 | + '0' => $langs->trans('No') |
|
486 | + ), $array_query['options_' . $key . '_cnct']); |
|
487 | + print '</td><td>' . "\n"; |
|
488 | + } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
489 | + print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
490 | + print '</td><td>' . "\n"; |
|
491 | + } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
492 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
493 | + print '</td><td>' . "\n"; |
|
494 | + } else { |
|
495 | + |
|
496 | + print '<table class="nobordernopadding"><tr>'; |
|
497 | + print '<td></td><td>'; |
|
498 | + if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
499 | + print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
500 | + } else { |
|
501 | + print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
502 | + } |
|
503 | + print '</td></tr></table>'; |
|
504 | + |
|
505 | + print '</td><td>' . "\n"; |
|
506 | + } |
|
507 | + print '</td></tr>' . "\n"; |
|
508 | + } |
|
509 | + } |
|
510 | + |
|
511 | + print '<tr>' . "\n"; |
|
512 | + print '<td colspan="3" align="right">' . "\n"; |
|
513 | + |
|
514 | + print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
515 | + |
|
516 | + print '</td>' . "\n"; |
|
517 | + print '</tr>' . "\n"; |
|
518 | + print '</table>' . "\n"; |
|
519 | + print '</form>' . "\n"; |
|
520 | + print '</div>' . "\n"; |
|
521 | + |
|
522 | + print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
523 | + print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
524 | + print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
|
525 | + print '<table class="noborder" width="100%">'; |
|
526 | + print '<tr class="liste_titre">'; |
|
527 | + print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
528 | + print '</tr>'; |
|
529 | + print '</table>'; |
|
530 | + print '</form>'; |
|
531 | + print '<br>'; |
|
532 | 532 | \ No newline at end of file |
@@ -49,211 +49,211 @@ discard block |
||
49 | 49 | |
50 | 50 | print_fiche_titre($langs->trans("AdvTgtTitle")); |
51 | 51 | |
52 | - print '<div class="tabBar">' . "\n"; |
|
53 | - print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
54 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
55 | - print '<input type="hidden" name="action" value="">' . "\n"; |
|
56 | - print '<table class="border" width="100%">' . "\n"; |
|
52 | + print '<div class="tabBar">'."\n"; |
|
53 | + print '<form name="find_customer" id="find_customer" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'."\n"; |
|
54 | + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n"; |
|
55 | + print '<input type="hidden" name="action" value="">'."\n"; |
|
56 | + print '<table class="border" width="100%">'."\n"; |
|
57 | 57 | |
58 | - print '<tr>' . "\n"; |
|
59 | - print '<td colspan="3" align="right">' . "\n"; |
|
58 | + print '<tr>'."\n"; |
|
59 | + print '<td colspan="3" align="right">'."\n"; |
|
60 | 60 | |
61 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
61 | + print '<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans('AdvTgtAddContact').'" class="butAction"/>'."\n"; |
|
62 | 62 | |
63 | - print '</td>' . "\n"; |
|
64 | - print '</tr>' . "\n"; |
|
63 | + print '</td>'."\n"; |
|
64 | + print '</tr>'."\n"; |
|
65 | 65 | |
66 | - print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
67 | - if (! empty($template_id)) { |
|
66 | + print '<tr><td>'.$langs->trans('AdvTgtNameTemplate').'</td><td>'; |
|
67 | + if (!empty($template_id)) { |
|
68 | 68 | $default_template = $template_id; |
69 | 69 | } else { |
70 | 70 | $default_template = $advTarget->id; |
71 | 71 | } |
72 | - print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
73 | - print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
74 | - print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
75 | - print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
72 | + print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template, 0, $advTarget->type_element); |
|
73 | + print '<input type="button" name="loadfilter" id="loadfilter" value="'.$langs->trans('AdvTgtLoadFilter').'" class="butAction"/>'; |
|
74 | + print '<input type="button" name="deletefilter" id="deletefilter" value="'.$langs->trans('AdvTgtDeleteFilter').'" class="butAction"/>'; |
|
75 | + print '<input type="button" name="savefilter" id="savefilter" value="'.$langs->trans('AdvTgtSaveFilter').'" class="butAction"/>'; |
|
76 | 76 | print $langs->trans('AdvTgtOrCreateNewFilter'); |
77 | 77 | print '<input type="text" name="template_name" id="template_name" value=""/>'; |
78 | - print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
79 | - print '</td><td>' . "\n"; |
|
80 | - print '</td></tr>' . "\n"; |
|
78 | + print '<input type="button" name="createfilter" id="createfilter" value="'.$langs->trans('AdvTgtCreateFilter').'" class="butAction"/>'; |
|
79 | + print '</td><td>'."\n"; |
|
80 | + print '</td></tr>'."\n"; |
|
81 | 81 | |
82 | - print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
82 | + print '<tr><td>'.$langs->trans('AdvTgtTypeOfIncude').'</td><td>'; |
|
83 | 83 | print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
84 | - print '</td><td>' . "\n"; |
|
84 | + print '</td><td>'."\n"; |
|
85 | 85 | print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
86 | - print '</td></tr>' . "\n"; |
|
86 | + print '</td></tr>'."\n"; |
|
87 | 87 | |
88 | 88 | // Customer name |
89 | - print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
90 | - if (! empty($array_query['cust_name'])) { |
|
89 | + print '<tr><td>'.$langs->trans('ThirdPartyName'); |
|
90 | + if (!empty($array_query['cust_name'])) { |
|
91 | 91 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
92 | 92 | } |
93 | - print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
93 | + print '</td><td><input type="text" name="cust_name" value="'.$array_query['cust_name'].'"/></td><td>'."\n"; |
|
94 | 94 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
95 | - print '</td></tr>' . "\n"; |
|
95 | + print '</td></tr>'."\n"; |
|
96 | 96 | |
97 | 97 | // Code Client |
98 | - print '<tr><td>' . $langs->trans('CustomerCode'); |
|
99 | - if (! empty($array_query['cust_code'])) { |
|
98 | + print '<tr><td>'.$langs->trans('CustomerCode'); |
|
99 | + if (!empty($array_query['cust_code'])) { |
|
100 | 100 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
101 | 101 | } |
102 | - print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
102 | + print '</td><td><input type="text" name="cust_code" value="'.$array_query['cust_code'].'"/></td><td>'."\n"; |
|
103 | 103 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
104 | - print '</td></tr>' . "\n"; |
|
104 | + print '</td></tr>'."\n"; |
|
105 | 105 | |
106 | 106 | // Address Client |
107 | - print '<tr><td>' . $langs->trans('Address'); |
|
108 | - if (! empty($array_query['cust_adress'])) { |
|
107 | + print '<tr><td>'.$langs->trans('Address'); |
|
108 | + if (!empty($array_query['cust_adress'])) { |
|
109 | 109 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
110 | 110 | } |
111 | - print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
111 | + print '</td><td><input type="text" name="cust_adress" value="'.$array_query['cust_adress'].'"/></td><td>'."\n"; |
|
112 | 112 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
113 | - print '</td></tr>' . "\n"; |
|
113 | + print '</td></tr>'."\n"; |
|
114 | 114 | |
115 | 115 | // Zip Client |
116 | - print '<tr><td>' . $langs->trans('Zip'); |
|
117 | - if (! empty($array_query['cust_zip'])) { |
|
116 | + print '<tr><td>'.$langs->trans('Zip'); |
|
117 | + if (!empty($array_query['cust_zip'])) { |
|
118 | 118 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
119 | 119 | } |
120 | - print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
120 | + print '</td><td><input type="text" name="cust_zip" value="'.$array_query['cust_zip'].'"/></td><td>'."\n"; |
|
121 | 121 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
122 | - print '</td></tr>' . "\n"; |
|
122 | + print '</td></tr>'."\n"; |
|
123 | 123 | |
124 | 124 | // City Client |
125 | - print '<tr><td>' . $langs->trans('Town'); |
|
126 | - if (! empty($array_query['cust_city'])) { |
|
125 | + print '<tr><td>'.$langs->trans('Town'); |
|
126 | + if (!empty($array_query['cust_city'])) { |
|
127 | 127 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
128 | 128 | } |
129 | - print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
129 | + print '</td><td><input type="text" name="cust_city" value="'.$array_query['cust_city'].'"/></td><td>'."\n"; |
|
130 | 130 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
131 | - print '</td></tr>' . "\n"; |
|
131 | + print '</td></tr>'."\n"; |
|
132 | 132 | |
133 | 133 | // Customer Country |
134 | - print '<tr><td>' . $langs->trans("Country"); |
|
134 | + print '<tr><td>'.$langs->trans("Country"); |
|
135 | 135 | if (count($array_query['cust_country']) > 0) { |
136 | 136 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
137 | 137 | } |
138 | - print '</td><td>' . "\n"; |
|
138 | + print '</td><td>'."\n"; |
|
139 | 139 | print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
140 | - print '</td><td>' . "\n"; |
|
141 | - print '</td></tr>' . "\n"; |
|
140 | + print '</td><td>'."\n"; |
|
141 | + print '</td></tr>'."\n"; |
|
142 | 142 | |
143 | 143 | // State Customer |
144 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
144 | + print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('ThirdParty'); |
|
145 | 145 | if (count($array_query['cust_status']) > 0) { |
146 | 146 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
147 | 147 | } |
148 | 148 | print '</td><td>'; |
149 | - print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
149 | + print $formadvtargetemaling->advMultiselectarray('cust_status', array( |
|
150 | 150 | '0' => $langs->trans('ActivityCeased'), |
151 | 151 | '1' => $langs->trans('InActivity') |
152 | 152 | ), $array_query['cust_status']); |
153 | - print '</td><td>' . "\n"; |
|
154 | - print '</td></tr>' . "\n"; |
|
153 | + print '</td><td>'."\n"; |
|
154 | + print '</td></tr>'."\n"; |
|
155 | 155 | |
156 | 156 | // Mother Company |
157 | - print '<tr><td>' . $langs->trans("Maison mère"); |
|
158 | - if (! empty($array_query['cust_mothercompany'])) { |
|
157 | + print '<tr><td>'.$langs->trans("Maison mère"); |
|
158 | + if (!empty($array_query['cust_mothercompany'])) { |
|
159 | 159 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
160 | 160 | } |
161 | - print '</td><td>' . "\n"; |
|
162 | - print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
163 | - print '</td><td>' . "\n"; |
|
161 | + print '</td><td>'."\n"; |
|
162 | + print '<input type="text" name="cust_mothercompany" value="'.$array_query['cust_mothercompany'].'"/>'; |
|
163 | + print '</td><td>'."\n"; |
|
164 | 164 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
165 | - print '</td></tr>' . "\n"; |
|
165 | + print '</td></tr>'."\n"; |
|
166 | 166 | |
167 | 167 | // Prospect/Customer |
168 | 168 | $selected = $array_query['cust_typecust']; |
169 | - print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
169 | + print '<tr><td>'.$langs->trans('ProspectCustomer').' '.$langs->trans('ThirdParty'); |
|
170 | 170 | if (count($array_query['cust_typecust']) > 0) { |
171 | 171 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
172 | 172 | } |
173 | 173 | print '</td><td>'; |
174 | - $options_array = array ( |
|
174 | + $options_array = array( |
|
175 | 175 | 2 => $langs->trans('Prospect'), |
176 | 176 | 3 => $langs->trans('ProspectCustomer'), |
177 | 177 | 1 => $langs->trans('Customer'), |
178 | 178 | 0 => $langs->trans('NorProspectNorCustomer') |
179 | 179 | ); |
180 | 180 | print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
181 | - print '</td><td>' . "\n"; |
|
182 | - print '</td></tr>' . "\n"; |
|
181 | + print '</td><td>'."\n"; |
|
182 | + print '</td></tr>'."\n"; |
|
183 | 183 | |
184 | 184 | // Prospection status |
185 | - print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
185 | + print '<tr><td>'.$langs->trans('ProspectLevel'); |
|
186 | 186 | if (count($array_query['cust_prospect_status']) > 0) { |
187 | 187 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
188 | 188 | } |
189 | 189 | print '</td><td>'; |
190 | 190 | print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
191 | - print '</td><td>' . "\n"; |
|
192 | - print '</td></tr>' . "\n"; |
|
191 | + print '</td><td>'."\n"; |
|
192 | + print '</td></tr>'."\n"; |
|
193 | 193 | |
194 | 194 | // Prospection comm status |
195 | - print '<tr><td>' . $langs->trans('StatusProsp'); |
|
195 | + print '<tr><td>'.$langs->trans('StatusProsp'); |
|
196 | 196 | if (count($array_query['cust_comm_status']) > 0) { |
197 | 197 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
198 | 198 | } |
199 | 199 | print '</td><td>'; |
200 | 200 | print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
201 | - print '</td><td>' . "\n"; |
|
202 | - print '</td></tr>' . "\n"; |
|
201 | + print '</td><td>'."\n"; |
|
202 | + print '</td></tr>'."\n"; |
|
203 | 203 | |
204 | 204 | // Customer Type |
205 | - print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
205 | + print '<tr><td>'.$langs->trans("ThirdPartyType"); |
|
206 | 206 | if (count($array_query['cust_typeent']) > 0) { |
207 | 207 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
208 | 208 | } |
209 | - print '</td><td>' . "\n"; |
|
209 | + print '</td><td>'."\n"; |
|
210 | 210 | print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
211 | - print '</td><td>' . "\n"; |
|
212 | - print '</td></tr>' . "\n"; |
|
211 | + print '</td><td>'."\n"; |
|
212 | + print '</td></tr>'."\n"; |
|
213 | 213 | |
214 | 214 | // Staff number |
215 | - print '<td>' . $langs->trans("Staff"); |
|
215 | + print '<td>'.$langs->trans("Staff"); |
|
216 | 216 | if (count($array_query['cust_effectif_id']) > 0) { |
217 | 217 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
218 | 218 | } |
219 | 219 | print '</td><td>'; |
220 | 220 | print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
221 | - print '</td><td>' . "\n"; |
|
222 | - print '</td></tr>' . "\n"; |
|
221 | + print '</td><td>'."\n"; |
|
222 | + print '</td></tr>'."\n"; |
|
223 | 223 | |
224 | 224 | // Sales manager |
225 | - print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
225 | + print '<tr><td>'.$langs->trans("SalesRepresentatives"); |
|
226 | 226 | if (count($array_query['cust_saleman']) > 0) { |
227 | 227 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
228 | 228 | } |
229 | - print '</td><td>' . "\n"; |
|
229 | + print '</td><td>'."\n"; |
|
230 | 230 | print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
231 | - print '</td><td>' . "\n"; |
|
232 | - print '</td></tr>' . "\n"; |
|
231 | + print '</td><td>'."\n"; |
|
232 | + print '</td></tr>'."\n"; |
|
233 | 233 | |
234 | 234 | // Customer Default Langauge |
235 | - if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
235 | + if (!empty($conf->global->MAIN_MULTILANGS)) { |
|
236 | 236 | |
237 | - print '<tr><td>' . $langs->trans("DefaultLang"); |
|
237 | + print '<tr><td>'.$langs->trans("DefaultLang"); |
|
238 | 238 | if (count($array_query['cust_language']) > 0) { |
239 | 239 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
240 | 240 | } |
241 | - print '</td><td>' . "\n"; |
|
241 | + print '</td><td>'."\n"; |
|
242 | 242 | print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
243 | - print '</td><td>' . "\n"; |
|
244 | - print '</td></tr>' . "\n"; |
|
243 | + print '</td><td>'."\n"; |
|
244 | + print '</td></tr>'."\n"; |
|
245 | 245 | } |
246 | 246 | |
247 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
247 | + if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
248 | 248 | // Customer Categories |
249 | - print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
249 | + print '<tr><td>'.$langs->trans("CustomersCategoryShort"); |
|
250 | 250 | if (count($array_query['cust_categ']) > 0) { |
251 | 251 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
252 | 252 | } |
253 | - print '</td><td>' . "\n"; |
|
253 | + print '</td><td>'."\n"; |
|
254 | 254 | print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
255 | - print '</td><td>' . "\n"; |
|
256 | - print '</td></tr>' . "\n"; |
|
255 | + print '</td><td>'."\n"; |
|
256 | + print '</td></tr>'."\n"; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | // Standard Extrafield feature |
@@ -262,59 +262,59 @@ discard block |
||
262 | 262 | dol_include_once('/core/class/extrafields.class.php'); |
263 | 263 | $extrafields = new ExtraFields($db); |
264 | 264 | $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
265 | - foreach ( $extralabels as $key => $val ) { |
|
265 | + foreach ($extralabels as $key => $val) { |
|
266 | 266 | if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
267 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
268 | - if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
267 | + print '<tr><td>'.$extrafields->attribute_label[$key]; |
|
268 | + if (!empty($array_query['options_'.$key]) || (is_array($array_query['options_'.$key]) && count($array_query['options_'.$key]) > 0)) { |
|
269 | 269 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
270 | 270 | } |
271 | 271 | print '</td><td>'; |
272 | 272 | if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
273 | - print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
273 | + print '<input type="text" name="options_'.$key.'"/></td><td>'."\n"; |
|
274 | 274 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
275 | 275 | } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
276 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
277 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
278 | - print '</td><td>' . "\n"; |
|
276 | + print $langs->trans("AdvTgtMinVal").'<input type="text" name="options'.$key.'_min"/>'; |
|
277 | + print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options'.$key.'_max"/>'; |
|
278 | + print '</td><td>'."\n"; |
|
279 | 279 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
280 | 280 | } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
281 | 281 | |
282 | 282 | print '<table class="nobordernopadding"><tr>'; |
283 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
284 | - print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
285 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
286 | - print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
283 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
284 | + print $form->selectDate('', 'options_'.$key.'_st_dt'); |
|
285 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
286 | + print $form->selectDate('', 'options_'.$key.'_end_dt'); |
|
287 | 287 | print '</td></tr></table>'; |
288 | 288 | |
289 | - print '</td><td>' . "\n"; |
|
289 | + print '</td><td>'."\n"; |
|
290 | 290 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
291 | 291 | } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
292 | - print $form->selectarray('options_' . $key, array ( |
|
292 | + print $form->selectarray('options_'.$key, array( |
|
293 | 293 | '' => '', |
294 | 294 | '1' => $langs->trans('Yes'), |
295 | 295 | '0' => $langs->trans('No') |
296 | - ), $array_query['options_' . $key]); |
|
297 | - print '</td><td>' . "\n"; |
|
296 | + ), $array_query['options_'.$key]); |
|
297 | + print '</td><td>'."\n"; |
|
298 | 298 | } elseif (($extrafields->attribute_type[$key] == 'select')) { |
299 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
300 | - print '</td><td>' . "\n"; |
|
299 | + print $formadvtargetemaling->advMultiselectarray('options_'.$key, $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key]); |
|
300 | + print '</td><td>'."\n"; |
|
301 | 301 | } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
302 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
303 | - print '</td><td>' . "\n"; |
|
302 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key, $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key]); |
|
303 | + print '</td><td>'."\n"; |
|
304 | 304 | } else { |
305 | 305 | |
306 | 306 | print '<table class="nobordernopadding"><tr>'; |
307 | 307 | print '<td></td><td>'; |
308 | - if (is_array($array_query['options_' . $key])) { |
|
309 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
308 | + if (is_array($array_query['options_'.$key])) { |
|
309 | + print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key])); |
|
310 | 310 | } else { |
311 | - print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
311 | + print $extrafields->showInputField($key, $array_query['options_'.$key]); |
|
312 | 312 | } |
313 | 313 | print '</td></tr></table>'; |
314 | 314 | |
315 | - print '</td><td>' . "\n"; |
|
315 | + print '</td><td>'."\n"; |
|
316 | 316 | } |
317 | - print '</td></tr>' . "\n"; |
|
317 | + print '</td></tr>'."\n"; |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | } else { |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | $action_search = 'query'; |
323 | 323 | |
324 | 324 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
325 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
325 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
326 | 326 | $hookmanager = new HookManager($db); |
327 | - $hookmanager->initHooks(array ('thirdpartycard')); |
|
327 | + $hookmanager->initHooks(array('thirdpartycard')); |
|
328 | 328 | |
329 | - $parameters=array(); |
|
330 | - if (! empty($advTarget->id)) { |
|
329 | + $parameters = array(); |
|
330 | + if (!empty($advTarget->id)) { |
|
331 | 331 | $parameters = array('array_query' => $advTarget->filtervalue); |
332 | 332 | } |
333 | 333 | // Other attributes |
@@ -336,21 +336,21 @@ discard block |
||
336 | 336 | } |
337 | 337 | |
338 | 338 | // State Contact |
339 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
339 | + print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('Contact'); |
|
340 | 340 | if (count($array_query['contact_status']) > 0) { |
341 | 341 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
342 | 342 | } |
343 | 343 | print '</td><td>'; |
344 | - print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
344 | + print $formadvtargetemaling->advMultiselectarray('contact_status', array( |
|
345 | 345 | '0' => $langs->trans('ActivityCeased'), |
346 | 346 | '1' => $langs->trans('InActivity') |
347 | 347 | ), $array_query['contact_status']); |
348 | - print '</td><td>' . "\n"; |
|
348 | + print '</td><td>'."\n"; |
|
349 | 349 | print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
350 | - print '</td></tr>' . "\n"; |
|
350 | + print '</td></tr>'."\n"; |
|
351 | 351 | |
352 | 352 | // Civility |
353 | - print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
353 | + print '<tr><td width="15%">'.$langs->trans("UserTitle"); |
|
354 | 354 | if (count($array_query['contact_civility']) > 0) { |
355 | 355 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
356 | 356 | } |
@@ -359,85 +359,85 @@ discard block |
||
359 | 359 | print '</td></tr>'; |
360 | 360 | |
361 | 361 | // contact name |
362 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
363 | - if (! empty($array_query['contact_lastname'])) { |
|
362 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans('Lastname'); |
|
363 | + if (!empty($array_query['contact_lastname'])) { |
|
364 | 364 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
365 | 365 | } |
366 | - print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
366 | + print '</td><td><input type="text" name="contact_lastname" value="'.$array_query['contact_lastname'].'"/></td><td>'."\n"; |
|
367 | 367 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
368 | - print '</td></tr>' . "\n"; |
|
369 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
370 | - if (! empty($array_query['contact_firstname'])) { |
|
368 | + print '</td></tr>'."\n"; |
|
369 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans('Firstname'); |
|
370 | + if (!empty($array_query['contact_firstname'])) { |
|
371 | 371 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
372 | 372 | } |
373 | - print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
373 | + print '</td><td><input type="text" name="contact_firstname" value="'.$array_query['contact_firstname'].'"/></td><td>'."\n"; |
|
374 | 374 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
375 | - print '</td></tr>' . "\n"; |
|
375 | + print '</td></tr>'."\n"; |
|
376 | 376 | |
377 | 377 | // Contact Country |
378 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
378 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("Country"); |
|
379 | 379 | if (count($array_query['contact_country']) > 0) { |
380 | 380 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
381 | 381 | } |
382 | - print '</td><td>' . "\n"; |
|
382 | + print '</td><td>'."\n"; |
|
383 | 383 | print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
384 | - print '</td><td>' . "\n"; |
|
385 | - print '</td></tr>' . "\n"; |
|
384 | + print '</td><td>'."\n"; |
|
385 | + print '</td></tr>'."\n"; |
|
386 | 386 | |
387 | 387 | // Never send mass mailing |
388 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
389 | - if (! empty($array_query['contact_no_email'])) { |
|
388 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("No_Email"); |
|
389 | + if (!empty($array_query['contact_no_email'])) { |
|
390 | 390 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
391 | 391 | } |
392 | - print '</td><td>' . "\n"; |
|
393 | - print $form->selectarray('contact_no_email', array ( |
|
392 | + print '</td><td>'."\n"; |
|
393 | + print $form->selectarray('contact_no_email', array( |
|
394 | 394 | '' => '', |
395 | 395 | '1' => $langs->trans('Yes'), |
396 | 396 | '0' => $langs->trans('No') |
397 | 397 | ), $array_query['contact_no_email']); |
398 | - print '</td><td>' . "\n"; |
|
399 | - print '</td></tr>' . "\n"; |
|
398 | + print '</td><td>'."\n"; |
|
399 | + print '</td></tr>'."\n"; |
|
400 | 400 | |
401 | 401 | // Contact Date Create |
402 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
403 | - if (! empty($array_query['contact_create_st_dt'])) { |
|
402 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("DateCreation"); |
|
403 | + if (!empty($array_query['contact_create_st_dt'])) { |
|
404 | 404 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
405 | 405 | } |
406 | - print '</td><td>' . "\n"; |
|
406 | + print '</td><td>'."\n"; |
|
407 | 407 | print '<table class="nobordernopadding"><tr>'; |
408 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
408 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
409 | 409 | print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
410 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
410 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
411 | 411 | print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
412 | 412 | print '</td></tr></table>'; |
413 | - print '</td><td>' . "\n"; |
|
414 | - print '</td></tr>' . "\n"; |
|
413 | + print '</td><td>'."\n"; |
|
414 | + print '</td></tr>'."\n"; |
|
415 | 415 | |
416 | 416 | // Contact update Create |
417 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
418 | - if (! empty($array_query['contact_update_st_dt'])) { |
|
417 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("DateLastModification"); |
|
418 | + if (!empty($array_query['contact_update_st_dt'])) { |
|
419 | 419 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
420 | 420 | } |
421 | - print '</td><td>' . "\n"; |
|
421 | + print '</td><td>'."\n"; |
|
422 | 422 | print '<table class="nobordernopadding"><tr>'; |
423 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
423 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
424 | 424 | print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
425 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
425 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
426 | 426 | print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
427 | 427 | print '</td></tr></table>'; |
428 | - print '</td><td>' . "\n"; |
|
429 | - print '</td></tr>' . "\n"; |
|
428 | + print '</td><td>'."\n"; |
|
429 | + print '</td></tr>'."\n"; |
|
430 | 430 | |
431 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
431 | + if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
432 | 432 | // Customer Categories |
433 | - print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
433 | + print '<tr><td>'.$langs->trans("ContactCategoriesShort"); |
|
434 | 434 | if (count($array_query['contact_categ']) > 0) { |
435 | 435 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
436 | 436 | } |
437 | - print '</td><td>' . "\n"; |
|
437 | + print '</td><td>'."\n"; |
|
438 | 438 | print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
439 | - print '</td><td>' . "\n"; |
|
440 | - print '</td></tr>' . "\n"; |
|
439 | + print '</td><td>'."\n"; |
|
440 | + print '</td></tr>'."\n"; |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | // Standard Extrafield feature |
@@ -446,84 +446,84 @@ discard block |
||
446 | 446 | dol_include_once('/core/class/extrafields.class.php'); |
447 | 447 | $extrafields = new ExtraFields($db); |
448 | 448 | $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
449 | - foreach($extrafields->attribute_type as $key=>&$value) { |
|
450 | - if($value == 'radio')$value = 'select'; |
|
449 | + foreach ($extrafields->attribute_type as $key=>&$value) { |
|
450 | + if ($value == 'radio')$value = 'select'; |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | |
454 | - foreach ( $extralabels as $key => $val ) { |
|
454 | + foreach ($extralabels as $key => $val) { |
|
455 | 455 | |
456 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
457 | - if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
456 | + print '<tr><td>'.$extrafields->attribute_label[$key]; |
|
457 | + if ($array_query['options_'.$key.'_cnct'] != '' || (is_array($array_query['options_'.$key.'_cnct']) && count($array_query['options_'.$key.'_cnct']) > 0)) { |
|
458 | 458 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
459 | 459 | } |
460 | 460 | print '</td><td>'; |
461 | 461 | if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
462 | - print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
462 | + print '<input type="text" name="options_'.$key.'_cnct"/></td><td>'."\n"; |
|
463 | 463 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
464 | 464 | } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
465 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
466 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
467 | - print '</td><td>' . "\n"; |
|
465 | + print $langs->trans("AdvTgtMinVal").'<input type="text" name="options_'.$key.'_min_cnct"/>'; |
|
466 | + print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options_'.$key.'_max_cnct"/>'; |
|
467 | + print '</td><td>'."\n"; |
|
468 | 468 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
469 | 469 | } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
470 | 470 | |
471 | 471 | print '<table class="nobordernopadding"><tr>'; |
472 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
473 | - print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
474 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
475 | - print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
472 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
473 | + print $form->selectDate('', 'options_'.$key.'_st_dt'.'_cnct'); |
|
474 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
475 | + print $form->selectDate('', 'options_'.$key.'_end_dt'.'_cnct'); |
|
476 | 476 | print '</td></tr></table>'; |
477 | 477 | |
478 | - print '</td><td>' . "\n"; |
|
478 | + print '</td><td>'."\n"; |
|
479 | 479 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
480 | 480 | } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
481 | - print $form->selectarray('options_' . $key . '_cnct', array ( |
|
481 | + print $form->selectarray('options_'.$key.'_cnct', array( |
|
482 | 482 | '' => '', |
483 | 483 | '1' => $langs->trans('Yes'), |
484 | 484 | '0' => $langs->trans('No') |
485 | - ), $array_query['options_' . $key . '_cnct']); |
|
486 | - print '</td><td>' . "\n"; |
|
485 | + ), $array_query['options_'.$key.'_cnct']); |
|
486 | + print '</td><td>'."\n"; |
|
487 | 487 | } elseif (($extrafields->attribute_type[$key] == 'select')) { |
488 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
489 | - print '</td><td>' . "\n"; |
|
488 | + print $formadvtargetemaling->advMultiselectarray('options_'.$key.'_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key.'_cnct']); |
|
489 | + print '</td><td>'."\n"; |
|
490 | 490 | } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
491 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
492 | - print '</td><td>' . "\n"; |
|
491 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key.'_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key.'_cnct']); |
|
492 | + print '</td><td>'."\n"; |
|
493 | 493 | } else { |
494 | 494 | |
495 | 495 | print '<table class="nobordernopadding"><tr>'; |
496 | 496 | print '<td></td><td>'; |
497 | - if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
498 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
497 | + if (is_array($array_query['options_'.$key.'_cnct'])) { |
|
498 | + print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key.'_cnct']), '', '_cnct'); |
|
499 | 499 | } else { |
500 | - print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
500 | + print $extrafields->showInputField($key, $array_query['options_'.$key.'_cnct'], '', '_cnct'); |
|
501 | 501 | } |
502 | 502 | print '</td></tr></table>'; |
503 | 503 | |
504 | - print '</td><td>' . "\n"; |
|
504 | + print '</td><td>'."\n"; |
|
505 | 505 | } |
506 | - print '</td></tr>' . "\n"; |
|
506 | + print '</td></tr>'."\n"; |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
510 | - print '<tr>' . "\n"; |
|
511 | - print '<td colspan="3" align="right">' . "\n"; |
|
510 | + print '<tr>'."\n"; |
|
511 | + print '<td colspan="3" align="right">'."\n"; |
|
512 | 512 | |
513 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
513 | + print '<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans('AdvTgtAddContact').'" class="butAction"/>'."\n"; |
|
514 | 514 | |
515 | - print '</td>' . "\n"; |
|
516 | - print '</tr>' . "\n"; |
|
517 | - print '</table>' . "\n"; |
|
518 | - print '</form>' . "\n"; |
|
519 | - print '</div>' . "\n"; |
|
515 | + print '</td>'."\n"; |
|
516 | + print '</tr>'."\n"; |
|
517 | + print '</table>'."\n"; |
|
518 | + print '</form>'."\n"; |
|
519 | + print '</div>'."\n"; |
|
520 | 520 | |
521 | - print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
522 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
521 | + print '<form action="'.$_SERVER['PHP_SELF'].'?action=clear&id='.$object->id.'" method="POST">'; |
|
522 | + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
523 | 523 | print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
524 | 524 | print '<table class="noborder" width="100%">'; |
525 | 525 | print '<tr class="liste_titre">'; |
526 | - print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
526 | + print '<td class="liste_titre" align="right"><input type="submit" class="button" value="'.$langs->trans("TargetsReset").'"></td>'; |
|
527 | 527 | print '</tr>'; |
528 | 528 | print '</table>'; |
529 | 529 | print '</form>'; |
@@ -447,7 +447,9 @@ |
||
447 | 447 | $extrafields = new ExtraFields($db); |
448 | 448 | $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
449 | 449 | foreach($extrafields->attribute_type as $key=>&$value) { |
450 | - if($value == 'radio')$value = 'select'; |
|
450 | + if($value == 'radio') { |
|
451 | + $value = 'select'; |
|
452 | + } |
|
451 | 453 | } |
452 | 454 | |
453 | 455 |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | // Protection to avoid direct call of template |
22 | 22 | if (empty($conf) || ! is_object($conf)) |
23 | 23 | { |
24 | - print "Error, template page filemanager.tpl.php can't be called as URL"; |
|
25 | - exit; |
|
24 | + print "Error, template page filemanager.tpl.php can't be called as URL"; |
|
25 | + exit; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | ?> |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | $showroot = 0; |
42 | 42 | if ($module == 'ecm') |
43 | 43 | { |
44 | - $permtoadd = $user->rights->ecm->setup; |
|
45 | - $permtoupload = $user->rights->ecm->upload; |
|
46 | - $showroot = 0; |
|
44 | + $permtoadd = $user->rights->ecm->setup; |
|
45 | + $permtoupload = $user->rights->ecm->upload; |
|
46 | + $showroot = 0; |
|
47 | 47 | } |
48 | 48 | if ($module == 'medias') |
49 | 49 | { |
50 | - $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); |
|
51 | - $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); |
|
52 | - $showroot = 1; |
|
50 | + $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); |
|
51 | + $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); |
|
52 | + $showroot = 1; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | // Confirm remove file (for non javascript users) |
58 | 58 | if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->use_javascript_ajax)) |
59 | 59 | { |
60 | - // TODO Add website, pageid, filemanager if defined |
|
61 | - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
60 | + // TODO Add website, pageid, filemanager if defined |
|
61 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Start container of all panels |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // Toolbar |
75 | 75 | if ($permtoadd) |
76 | 76 | { |
77 | - print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
77 | + print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
78 | 78 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
79 | 79 | print '</a>'; |
80 | 80 | } |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | } |
87 | 87 | if ($module == 'ecm') |
88 | 88 | { |
89 | - $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
90 | - print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
|
91 | - print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
|
92 | - print '</a>'; |
|
89 | + $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
90 | + print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
|
91 | + print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
|
92 | + print '</a>'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | // Start "Add new file" area |
@@ -100,20 +100,20 @@ discard block |
||
100 | 100 | // To attach new file |
101 | 101 | if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) |
102 | 102 | { |
103 | - if ((empty($section) || $section == -1) && ($module != 'medias')) |
|
104 | - { |
|
105 | - ?> |
|
103 | + if ((empty($section) || $section == -1) && ($module != 'medias')) |
|
104 | + { |
|
105 | + ?> |
|
106 | 106 | <script type="text/javascript"> |
107 | 107 | jQuery(document).ready(function() { |
108 | 108 | jQuery('#<?php echo $nameforformuserfile ?>').hide(); |
109 | 109 | }); |
110 | 110 | </script> |
111 | 111 | <?php |
112 | - } |
|
112 | + } |
|
113 | 113 | |
114 | - $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
115 | - print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
|
116 | - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
114 | + $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
115 | + print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
|
116 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
117 | 117 | $formfile=new FormFile($db); |
118 | 118 | $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
119 | 119 | } |
@@ -143,39 +143,39 @@ discard block |
||
143 | 143 | |
144 | 144 | if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete') |
145 | 145 | { |
146 | - $langs->load("ecm"); |
|
146 | + $langs->load("ecm"); |
|
147 | 147 | |
148 | - print '<table width="100%" class="liste noborderbottom">'."\n"; |
|
148 | + print '<table width="100%" class="liste noborderbottom">'."\n"; |
|
149 | 149 | |
150 | - print '<!-- Title for manual directories -->'."\n"; |
|
151 | - print '<tr class="liste_titre">'."\n"; |
|
150 | + print '<!-- Title for manual directories -->'."\n"; |
|
151 | + print '<tr class="liste_titre">'."\n"; |
|
152 | 152 | print '<th class="liste_titre" align="left">'; |
153 | 153 | print ' '.$langs->trans("ECMSections"); |
154 | - print '</th></tr>'; |
|
154 | + print '</th></tr>'; |
|
155 | 155 | |
156 | 156 | $showonrightsize=''; |
157 | 157 | |
158 | - // Manual section |
|
159 | - $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
158 | + // Manual section |
|
159 | + $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
160 | 160 | |
161 | 161 | if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) |
162 | 162 | { |
163 | - // Show the link to "Root" |
|
164 | - if ($showroot) |
|
165 | - { |
|
166 | - print '<tr><td><div style="padding-left: 5px; padding-right: 5px;"><a href="'.$_SERVER["PHP_SELF"].'?file_manager=1&pageid='.$pageid.'">'.$langs->trans("Root").'</a></div></td></tr>'; |
|
167 | - } |
|
163 | + // Show the link to "Root" |
|
164 | + if ($showroot) |
|
165 | + { |
|
166 | + print '<tr><td><div style="padding-left: 5px; padding-right: 5px;"><a href="'.$_SERVER["PHP_SELF"].'?file_manager=1&pageid='.$pageid.'">'.$langs->trans("Root").'</a></div></td></tr>'; |
|
167 | + } |
|
168 | 168 | |
169 | 169 | |
170 | 170 | |
171 | - print '<tr><td>'; |
|
171 | + print '<tr><td>'; |
|
172 | 172 | |
173 | - // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
|
174 | - print '<div id="filetree" class="ecmfiletree"></div>'; |
|
173 | + // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
|
174 | + print '<div id="filetree" class="ecmfiletree"></div>'; |
|
175 | 175 | |
176 | - if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
176 | + if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
177 | 177 | |
178 | - print '</td></tr>'; |
|
178 | + print '</td></tr>'; |
|
179 | 179 | } |
180 | 180 | else // Show filtree when ajax is disabled (rare) |
181 | 181 | { |
@@ -195,12 +195,12 @@ discard block |
||
195 | 195 | if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
196 | 196 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirtree.php'; |
197 | 197 | |
198 | - print '</div>'; |
|
199 | - print '</td></tr>'; |
|
198 | + print '</div>'; |
|
199 | + print '</td></tr>'; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
203 | - print "</table>"; |
|
203 | + print "</table>"; |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -231,14 +231,14 @@ discard block |
||
231 | 231 | |
232 | 232 | if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
233 | 233 | { |
234 | - //var_dump($modulepart); |
|
235 | - // Variables that may be defined: |
|
236 | - // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
|
237 | - // $_POST['dir'] |
|
238 | - // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
|
239 | - if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
240 | - |
|
241 | - include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
|
234 | + //var_dump($modulepart); |
|
235 | + // Variables that may be defined: |
|
236 | + // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
|
237 | + // $_POST['dir'] |
|
238 | + // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
|
239 | + if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
240 | + |
|
241 | + include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | ?> |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | // Protection to avoid direct call of template |
22 | -if (empty($conf) || ! is_object($conf)) |
|
22 | +if (empty($conf) || !is_object($conf)) |
|
23 | 23 | { |
24 | 24 | print "Error, template page filemanager.tpl.php can't be called as URL"; |
25 | 25 | exit; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; |
36 | 36 | |
37 | -if (empty($module)) $module='ecm'; |
|
37 | +if (empty($module)) $module = 'ecm'; |
|
38 | 38 | |
39 | 39 | $permtoadd = 0; |
40 | 40 | $permtoupload = 0; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->use_javascript_ajax)) |
59 | 59 | { |
60 | 60 | // TODO Add website, pageid, filemanager if defined |
61 | - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
61 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Start container of all panels |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // Toolbar |
75 | 75 | if ($permtoadd) |
76 | 76 | { |
77 | - print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
77 | + print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey ? '&website='.$websitekey : '').($pageid ? '&pageid='.$pageid : '').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
78 | 78 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
79 | 79 | print '</a>'; |
80 | 80 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | if ($module == 'ecm') |
88 | 88 | { |
89 | - $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
89 | + $tmpurl = ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) ? '#' : ($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module ? '&module='.$module : '').($section ? '&section='.$section : ''))); |
|
90 | 90 | print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
91 | 91 | print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
92 | 92 | print '</a>'; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | print '<div class="inline-block valignmiddle floatright">'; |
99 | 99 | |
100 | 100 | // To attach new file |
101 | -if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) |
|
101 | +if ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || !empty($section)) |
|
102 | 102 | { |
103 | 103 | if ((empty($section) || $section == -1) && ($module != 'medias')) |
104 | 104 | { |
@@ -111,11 +111,11 @@ discard block |
||
111 | 111 | <?php |
112 | 112 | } |
113 | 113 | |
114 | - $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
114 | + $sectiondir = GETPOST('file', 'alpha') ?GETPOST('file', 'alpha') : GETPOST('section_dir', 'alpha'); |
|
115 | 115 | print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
116 | 116 | include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
117 | - $formfile=new FormFile($db); |
|
118 | - $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
|
117 | + $formfile = new FormFile($db); |
|
118 | + $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
|
119 | 119 | } |
120 | 120 | else print ' '; |
121 | 121 | |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | // Confirmation de la suppression d'une ligne categorie |
137 | 137 | if ($action == 'delete_section') |
138 | 138 | { |
139 | - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); |
|
139 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $ecmdir->label), 'confirm_deletesection', '', '', 1); |
|
140 | 140 | } |
141 | 141 | // End confirm |
142 | 142 | |
143 | 143 | |
144 | -if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete') |
|
144 | +if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'delete') |
|
145 | 145 | { |
146 | 146 | $langs->load("ecm"); |
147 | 147 | |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | print ' '.$langs->trans("ECMSections"); |
154 | 154 | print '</th></tr>'; |
155 | 155 | |
156 | - $showonrightsize=''; |
|
156 | + $showonrightsize = ''; |
|
157 | 157 | |
158 | 158 | // Manual section |
159 | - $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
159 | + $htmltooltip = $langs->trans("ECMAreaDesc2"); |
|
160 | 160 | |
161 | - if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) |
|
161 | + if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) |
|
162 | 162 | { |
163 | 163 | // Show the link to "Root" |
164 | 164 | if ($showroot) |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | $_POST['modulepart'] = $module; |
185 | 185 | $_POST['openeddir'] = GETPOST('openeddir'); |
186 | - $_POST['dir'] = empty($_POST['dir'])?'/':$_POST['dir']; |
|
186 | + $_POST['dir'] = empty($_POST['dir']) ? '/' : $_POST['dir']; |
|
187 | 187 | |
188 | 188 | // Show filemanager tree (will be filled by direct include of ajaxdirtree.php in mode noajax, this will return all dir - all levels - to show) |
189 | 189 | print '<div id="filetree" class="ecmfiletree">'; |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | // Variables that may be defined: |
192 | 192 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
193 | 193 | // $_POST['dir'] |
194 | - $mode='noajax'; |
|
195 | - if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
194 | + $mode = 'noajax'; |
|
195 | + if (empty($url)) $url = DOL_URL_ROOT.'/ecm/index.php'; |
|
196 | 196 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirtree.php'; |
197 | 197 | |
198 | 198 | print '</div>'; |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | // Start right panel |
215 | 215 | |
216 | 216 | |
217 | -$mode='noajax'; |
|
218 | -if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
219 | -include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; // Show content of a directory on right side |
|
217 | +$mode = 'noajax'; |
|
218 | +if (empty($url)) $url = DOL_URL_ROOT.'/ecm/index.php'; |
|
219 | +include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; // Show content of a directory on right side |
|
220 | 220 | |
221 | 221 | |
222 | 222 | // End right panel |
@@ -229,14 +229,14 @@ discard block |
||
229 | 229 | <?php |
230 | 230 | |
231 | 231 | |
232 | -if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
|
232 | +if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
|
233 | 233 | { |
234 | 234 | //var_dump($modulepart); |
235 | 235 | // Variables that may be defined: |
236 | 236 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
237 | 237 | // $_POST['dir'] |
238 | 238 | // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
239 | - if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
239 | + if (GETPOST('section_dir', 'alpha')) { $preopened = GETPOST('section_dir', 'alpha'); } |
|
240 | 240 | |
241 | 241 | include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
242 | 242 | } |
@@ -34,7 +34,9 @@ discard block |
||
34 | 34 | |
35 | 35 | require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; |
36 | 36 | |
37 | -if (empty($module)) $module='ecm'; |
|
37 | +if (empty($module)) { |
|
38 | + $module='ecm'; |
|
39 | +} |
|
38 | 40 | |
39 | 41 | $permtoadd = 0; |
40 | 42 | $permtoupload = 0; |
@@ -77,8 +79,7 @@ discard block |
||
77 | 79 | print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
78 | 80 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
79 | 81 | print '</a>'; |
80 | -} |
|
81 | -else |
|
82 | +} else |
|
82 | 83 | { |
83 | 84 | print '<a href="#" class="inline-block valignmiddle toolbarbutton" title="'.$langs->trans("NotAllowed").'">'; |
84 | 85 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
@@ -116,8 +117,9 @@ discard block |
||
116 | 117 | include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
117 | 118 | $formfile=new FormFile($db); |
118 | 119 | $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
120 | +} else { |
|
121 | + print ' '; |
|
119 | 122 | } |
120 | -else print ' '; |
|
121 | 123 | |
122 | 124 | print '</div>'; |
123 | 125 | // End "Add new file" area |
@@ -173,11 +175,12 @@ discard block |
||
173 | 175 | // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
174 | 176 | print '<div id="filetree" class="ecmfiletree"></div>'; |
175 | 177 | |
176 | - if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
178 | + if ($action == 'deletefile') { |
|
179 | + print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
180 | + } |
|
177 | 181 | |
178 | 182 | print '</td></tr>'; |
179 | - } |
|
180 | - else // Show filtree when ajax is disabled (rare) |
|
183 | + } else // Show filtree when ajax is disabled (rare) |
|
181 | 184 | { |
182 | 185 | print '<tr><td style="padding-left: 20px">'; |
183 | 186 | |
@@ -192,7 +195,9 @@ discard block |
||
192 | 195 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
193 | 196 | // $_POST['dir'] |
194 | 197 | $mode='noajax'; |
195 | - if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
198 | + if (empty($url)) { |
|
199 | + $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
200 | + } |
|
196 | 201 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirtree.php'; |
197 | 202 | |
198 | 203 | print '</div>'; |
@@ -215,7 +220,9 @@ discard block |
||
215 | 220 | |
216 | 221 | |
217 | 222 | $mode='noajax'; |
218 | -if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
223 | +if (empty($url)) { |
|
224 | + $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
225 | +} |
|
219 | 226 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; // Show content of a directory on right side |
220 | 227 | |
221 | 228 | |
@@ -229,14 +236,17 @@ discard block |
||
229 | 236 | <?php |
230 | 237 | |
231 | 238 | |
232 | -if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
|
239 | +if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { |
|
240 | + // Show filtree when ajax is enabled |
|
233 | 241 | { |
234 | 242 | //var_dump($modulepart); |
235 | 243 | // Variables that may be defined: |
236 | 244 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
237 | 245 | // $_POST['dir'] |
238 | 246 | // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
239 | - if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
247 | + if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); |
|
248 | +} |
|
249 | +} |
|
240 | 250 | |
241 | 251 | include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
242 | 252 | } |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | // Protection to avoid direct call of template |
27 | 27 | if (empty($conf) || ! is_object($conf)) |
28 | 28 | { |
29 | - print "Error, template page can't be called as URL"; |
|
30 | - exit; |
|
29 | + print "Error, template page can't be called as URL"; |
|
30 | + exit; |
|
31 | 31 | } |
32 | 32 | if (! is_object($form)) $form=new Form($db); |
33 | 33 | |
@@ -39,29 +39,29 @@ discard block |
||
39 | 39 | |
40 | 40 | foreach($object->fields as $key => $val) |
41 | 41 | { |
42 | - // Discard if extrafield is a hidden field on form |
|
43 | - if (abs($val['visible']) != 1) continue; |
|
42 | + // Discard if extrafield is a hidden field on form |
|
43 | + if (abs($val['visible']) != 1) continue; |
|
44 | 44 | |
45 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
46 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
45 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
46 | + if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
47 | 47 | |
48 | - $value=$object->$key; |
|
48 | + $value=$object->$key; |
|
49 | 49 | |
50 | - print '<tr><td'; |
|
51 | - print ' class="titlefield'; |
|
52 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
53 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
54 | - print '">'; |
|
55 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
56 | - else print $langs->trans($val['label']); |
|
57 | - print '</td>'; |
|
58 | - print '<td>'; |
|
59 | - print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
60 | - //print dol_escape_htmltag($object->$key, 1, 1); |
|
61 | - print '</td>'; |
|
62 | - print '</tr>'; |
|
50 | + print '<tr><td'; |
|
51 | + print ' class="titlefield'; |
|
52 | + if ($val['notnull'] > 0) print ' fieldrequired'; |
|
53 | + if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
54 | + print '">'; |
|
55 | + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
56 | + else print $langs->trans($val['label']); |
|
57 | + print '</td>'; |
|
58 | + print '<td>'; |
|
59 | + print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
60 | + //print dol_escape_htmltag($object->$key, 1, 1); |
|
61 | + print '</td>'; |
|
62 | + print '</tr>'; |
|
63 | 63 | |
64 | - if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
64 | + if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | print '</table>'; |
@@ -74,31 +74,31 @@ discard block |
||
74 | 74 | $alreadyoutput = 1; |
75 | 75 | foreach($object->fields as $key => $val) |
76 | 76 | { |
77 | - if ($alreadyoutput) |
|
78 | - { |
|
79 | - if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
80 | - continue; |
|
81 | - } |
|
77 | + if ($alreadyoutput) |
|
78 | + { |
|
79 | + if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
80 | + continue; |
|
81 | + } |
|
82 | 82 | |
83 | - if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
84 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
85 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
83 | + if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
84 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
85 | + if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
86 | 86 | |
87 | - $value=$object->$key; |
|
87 | + $value=$object->$key; |
|
88 | 88 | |
89 | - print '<tr><td'; |
|
90 | - print ' class="titlefield'; |
|
91 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
92 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
93 | - print '">'; |
|
94 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
95 | - else print $langs->trans($val['label']); |
|
96 | - print '</td>'; |
|
97 | - print '<td>'; |
|
98 | - print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
99 | - //print dol_escape_htmltag($object->$key, 1, 1); |
|
100 | - print '</td>'; |
|
101 | - print '</tr>'; |
|
89 | + print '<tr><td'; |
|
90 | + print ' class="titlefield'; |
|
91 | + if ($val['notnull'] > 0) print ' fieldrequired'; |
|
92 | + if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
93 | + print '">'; |
|
94 | + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
95 | + else print $langs->trans($val['label']); |
|
96 | + print '</td>'; |
|
97 | + print '<td>'; |
|
98 | + print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
99 | + //print dol_escape_htmltag($object->$key, 1, 1); |
|
100 | + print '</td>'; |
|
101 | + print '</tr>'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | ?> |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | // Protection to avoid direct call of template |
27 | -if (empty($conf) || ! is_object($conf)) |
|
27 | +if (empty($conf) || !is_object($conf)) |
|
28 | 28 | { |
29 | 29 | print "Error, template page can't be called as URL"; |
30 | 30 | exit; |
31 | 31 | } |
32 | -if (! is_object($form)) $form=new Form($db); |
|
32 | +if (!is_object($form)) $form = new Form($db); |
|
33 | 33 | |
34 | 34 | ?> |
35 | 35 | <!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php --> |
@@ -37,22 +37,22 @@ discard block |
||
37 | 37 | |
38 | 38 | $object->fields = dol_sort_array($object->fields, 'position'); |
39 | 39 | |
40 | -foreach($object->fields as $key => $val) |
|
40 | +foreach ($object->fields as $key => $val) |
|
41 | 41 | { |
42 | 42 | // Discard if extrafield is a hidden field on form |
43 | 43 | if (abs($val['visible']) != 1) continue; |
44 | 44 | |
45 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
46 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
45 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && !verifCond($val['enabled'])) continue; // We don't want this field |
|
46 | + if (in_array($key, array('ref', 'status'))) continue; // Ref and status are already in dol_banner |
|
47 | 47 | |
48 | - $value=$object->$key; |
|
48 | + $value = $object->$key; |
|
49 | 49 | |
50 | 50 | print '<tr><td'; |
51 | 51 | print ' class="titlefield'; |
52 | 52 | if ($val['notnull'] > 0) print ' fieldrequired'; |
53 | 53 | if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
54 | 54 | print '">'; |
55 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
55 | + if (!empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
56 | 56 | else print $langs->trans($val['label']); |
57 | 57 | print '</td>'; |
58 | 58 | print '<td>'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | print '</td>'; |
62 | 62 | print '</tr>'; |
63 | 63 | |
64 | - if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
64 | + if (!empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | print '</table>'; |
@@ -72,26 +72,26 @@ discard block |
||
72 | 72 | print '<table class="border centpercent">'; |
73 | 73 | |
74 | 74 | $alreadyoutput = 1; |
75 | -foreach($object->fields as $key => $val) |
|
75 | +foreach ($object->fields as $key => $val) |
|
76 | 76 | { |
77 | 77 | if ($alreadyoutput) |
78 | 78 | { |
79 | - if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
79 | + if (!empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
80 | 80 | continue; |
81 | 81 | } |
82 | 82 | |
83 | - if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
84 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
85 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
83 | + if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
84 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && !$val['enabled']) continue; // We don't want this field |
|
85 | + if (in_array($key, array('ref', 'status'))) continue; // Ref and status are already in dol_banner |
|
86 | 86 | |
87 | - $value=$object->$key; |
|
87 | + $value = $object->$key; |
|
88 | 88 | |
89 | 89 | print '<tr><td'; |
90 | 90 | print ' class="titlefield'; |
91 | 91 | if ($val['notnull'] > 0) print ' fieldrequired'; |
92 | 92 | if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
93 | 93 | print '">'; |
94 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
94 | + if (!empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
95 | 95 | else print $langs->trans($val['label']); |
96 | 96 | print '</td>'; |
97 | 97 | print '<td>'; |
@@ -29,7 +29,9 @@ discard block |
||
29 | 29 | print "Error, template page can't be called as URL"; |
30 | 30 | exit; |
31 | 31 | } |
32 | -if (! is_object($form)) $form=new Form($db); |
|
32 | +if (! is_object($form)) { |
|
33 | + $form=new Form($db); |
|
34 | +} |
|
33 | 35 | |
34 | 36 | ?> |
35 | 37 | <!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php --> |
@@ -40,20 +42,35 @@ discard block |
||
40 | 42 | foreach($object->fields as $key => $val) |
41 | 43 | { |
42 | 44 | // Discard if extrafield is a hidden field on form |
43 | - if (abs($val['visible']) != 1) continue; |
|
45 | + if (abs($val['visible']) != 1) { |
|
46 | + continue; |
|
47 | + } |
|
44 | 48 | |
45 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
46 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
49 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) { |
|
50 | + continue; |
|
51 | + } |
|
52 | + // We don't want this field |
|
53 | + if (in_array($key, array('ref','status'))) { |
|
54 | + continue; |
|
55 | + } |
|
56 | + // Ref and status are already in dol_banner |
|
47 | 57 | |
48 | 58 | $value=$object->$key; |
49 | 59 | |
50 | 60 | print '<tr><td'; |
51 | 61 | print ' class="titlefield'; |
52 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
53 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
62 | + if ($val['notnull'] > 0) { |
|
63 | + print ' fieldrequired'; |
|
64 | + } |
|
65 | + if ($val['type'] == 'text' || $val['type'] == 'html') { |
|
66 | + print ' tdtop'; |
|
67 | + } |
|
54 | 68 | print '">'; |
55 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
56 | - else print $langs->trans($val['label']); |
|
69 | + if (! empty($val['help'])) { |
|
70 | + print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
71 | + } else { |
|
72 | + print $langs->trans($val['label']); |
|
73 | + } |
|
57 | 74 | print '</td>'; |
58 | 75 | print '<td>'; |
59 | 76 | print $object->showOutputField($val, $key, $value, '', '', '', 0); |
@@ -61,7 +78,10 @@ discard block |
||
61 | 78 | print '</td>'; |
62 | 79 | print '</tr>'; |
63 | 80 | |
64 | - if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
81 | + if (! empty($keyforbreak) && $key == $keyforbreak) { |
|
82 | + break; |
|
83 | + } |
|
84 | + // key used for break on second column |
|
65 | 85 | } |
66 | 86 | |
67 | 87 | print '</table>'; |
@@ -76,23 +96,42 @@ discard block |
||
76 | 96 | { |
77 | 97 | if ($alreadyoutput) |
78 | 98 | { |
79 | - if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
99 | + if (! empty($keyforbreak) && $key == $keyforbreak) { |
|
100 | + $alreadyoutput = 0; |
|
101 | + } |
|
102 | + // key used for break on second column |
|
80 | 103 | continue; |
81 | 104 | } |
82 | 105 | |
83 | - if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
84 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
85 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
106 | + if (abs($val['visible']) != 1) { |
|
107 | + continue; |
|
108 | + } |
|
109 | + // Discard such field from form |
|
110 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) { |
|
111 | + continue; |
|
112 | + } |
|
113 | + // We don't want this field |
|
114 | + if (in_array($key, array('ref','status'))) { |
|
115 | + continue; |
|
116 | + } |
|
117 | + // Ref and status are already in dol_banner |
|
86 | 118 | |
87 | 119 | $value=$object->$key; |
88 | 120 | |
89 | 121 | print '<tr><td'; |
90 | 122 | print ' class="titlefield'; |
91 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
92 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
123 | + if ($val['notnull'] > 0) { |
|
124 | + print ' fieldrequired'; |
|
125 | + } |
|
126 | + if ($val['type'] == 'text' || $val['type'] == 'html') { |
|
127 | + print ' tdtop'; |
|
128 | + } |
|
93 | 129 | print '">'; |
94 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
95 | - else print $langs->trans($val['label']); |
|
130 | + if (! empty($val['help'])) { |
|
131 | + print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
132 | + } else { |
|
133 | + print $langs->trans($val['label']); |
|
134 | + } |
|
96 | 135 | print '</td>'; |
97 | 136 | print '<td>'; |
98 | 137 | print $object->showOutputField($val, $key, $value, '', '', '', 0); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | <?php |
3 | 3 | |
4 | 4 | // Protection to avoid direct call of template |
5 | -if (empty($conf) || ! is_object($conf)) |
|
5 | +if (empty($conf) || !is_object($conf)) |
|
6 | 6 | { |
7 | 7 | print "Error, template page can't be called as URL"; |
8 | 8 | exit; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | $out = '<div class="tagtable centpercent noborder allwidth nohover">'; |
18 | 18 | |
19 | -$out .= '<form class="tagtr nohover '.($var==true?'pair':'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
19 | +$out .= '<form class="tagtr nohover '.($var == true ? 'pair' : 'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
20 | 20 | $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
21 | 21 | $out .= '<input type="hidden" name="action" value="add_element_resource">'; |
22 | 22 | $out .= '<input type="hidden" name="element" value="'.$element.'">'; |
@@ -27,18 +27,18 @@ discard block |
||
27 | 27 | // Place |
28 | 28 | $out .= '<div class="tagtd">'.$langs->trans("SelectResource").'</div>'; |
29 | 29 | $out .= '<div class="tagtd">'; |
30 | -$events=array(); |
|
31 | -$out .= $formresources->select_resource_list('','fk_resource','',1,1,0,$events,'',2,null); |
|
30 | +$events = array(); |
|
31 | +$out .= $formresources->select_resource_list('', 'fk_resource', '', 1, 1, 0, $events, '', 2, null); |
|
32 | 32 | $out .= '</div>'; |
33 | 33 | |
34 | -$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy',(isset($_POST['busy'])?$_POST['busy']:1),1).'</div>'; |
|
35 | -$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory',(isset($_POST['mandatory'])?$_POST['mandatory']:0),1).'</div>'; |
|
34 | +$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy', (isset($_POST['busy']) ? $_POST['busy'] : 1), 1).'</div>'; |
|
35 | +$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory', (isset($_POST['mandatory']) ? $_POST['mandatory'] : 0), 1).'</div>'; |
|
36 | 36 | |
37 | 37 | $out .= '<div class="tagtd" align="right">'; |
38 | -$out .='<input type="submit" id="add-resource-place" class="button" value="'.$langs->trans("Add").'"/>'; |
|
38 | +$out .= '<input type="submit" id="add-resource-place" class="button" value="'.$langs->trans("Add").'"/>'; |
|
39 | 39 | $out .= '</div>'; |
40 | 40 | |
41 | -$out .='</form>'; |
|
41 | +$out .= '</form>'; |
|
42 | 42 | |
43 | 43 | $out .= '</div>'; |
44 | 44 | $out .= '<br>'; |
@@ -18,8 +18,8 @@ |
||
18 | 18 | // Protection to avoid direct call of template |
19 | 19 | if (empty($conf) || ! is_object($conf)) |
20 | 20 | { |
21 | - print "Error, template page can't be called as URL"; |
|
22 | - exit; |
|
21 | + print "Error, template page can't be called as URL"; |
|
22 | + exit; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | // Protection to avoid direct call of template |
41 | 41 | if (empty($object) || ! is_object($object)) |
42 | 42 | { |
43 | - print "Error, template page can't be called as URL"; |
|
44 | - exit; |
|
43 | + print "Error, template page can't be called as URL"; |
|
44 | + exit; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -72,126 +72,126 @@ discard block |
||
72 | 72 | <?php } ?> |
73 | 73 | <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> |
74 | 74 | <?php |
75 | - if (($line->info_bits & 2) == 2) { |
|
76 | - ?> |
|
75 | + if (($line->info_bits & 2) == 2) { |
|
76 | + ?> |
|
77 | 77 | <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>"> |
78 | 78 | <?php |
79 | - $txt=''; |
|
80 | - print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
81 | - if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
82 | - elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
83 | - elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
84 | - //else $txt=$langs->trans("Discount"); |
|
85 | - print $txt; |
|
86 | - ?> |
|
79 | + $txt=''; |
|
80 | + print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
81 | + if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
82 | + elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
83 | + elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
84 | + //else $txt=$langs->trans("Discount"); |
|
85 | + print $txt; |
|
86 | + ?> |
|
87 | 87 | </a> |
88 | 88 | <?php |
89 | - if ($line->description) |
|
90 | - { |
|
91 | - if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
|
92 | - { |
|
93 | - $discount=new DiscountAbsolute($this->db); |
|
94 | - $discount->fetch($line->fk_remise_except); |
|
95 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
96 | - } |
|
97 | - elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
98 | - { |
|
99 | - $discount=new DiscountAbsolute($this->db); |
|
100 | - $discount->fetch($line->fk_remise_except); |
|
101 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
102 | - // Add date of deposit |
|
103 | - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
104 | - echo ' ('.dol_print_date($discount->datec).')'; |
|
105 | - } |
|
106 | - elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
107 | - { |
|
108 | - $discount=new DiscountAbsolute($this->db); |
|
109 | - $discount->fetch($line->fk_remise_except); |
|
110 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
111 | - } |
|
112 | - elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
113 | - { |
|
114 | - $discount=new DiscountAbsolute($this->db); |
|
115 | - $discount->fetch($line->fk_remise_except); |
|
116 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
117 | - } |
|
118 | - else |
|
119 | - { |
|
120 | - echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
121 | - } |
|
122 | - } |
|
123 | - } |
|
124 | - else |
|
125 | - { |
|
126 | - $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
89 | + if ($line->description) |
|
90 | + { |
|
91 | + if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
|
92 | + { |
|
93 | + $discount=new DiscountAbsolute($this->db); |
|
94 | + $discount->fetch($line->fk_remise_except); |
|
95 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
96 | + } |
|
97 | + elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
98 | + { |
|
99 | + $discount=new DiscountAbsolute($this->db); |
|
100 | + $discount->fetch($line->fk_remise_except); |
|
101 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
102 | + // Add date of deposit |
|
103 | + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
104 | + echo ' ('.dol_print_date($discount->datec).')'; |
|
105 | + } |
|
106 | + elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
107 | + { |
|
108 | + $discount=new DiscountAbsolute($this->db); |
|
109 | + $discount->fetch($line->fk_remise_except); |
|
110 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
111 | + } |
|
112 | + elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
113 | + { |
|
114 | + $discount=new DiscountAbsolute($this->db); |
|
115 | + $discount->fetch($line->fk_remise_except); |
|
116 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
117 | + } |
|
118 | + else |
|
119 | + { |
|
120 | + echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
121 | + } |
|
122 | + } |
|
123 | + } |
|
124 | + else |
|
125 | + { |
|
126 | + $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
127 | 127 | |
128 | - if ($line->fk_product > 0) |
|
129 | - { |
|
130 | - echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
131 | - } |
|
132 | - else |
|
133 | - { |
|
134 | - if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
135 | - else $text = img_object($langs->trans('Product'),'product'); |
|
128 | + if ($line->fk_product > 0) |
|
129 | + { |
|
130 | + echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
131 | + } |
|
132 | + else |
|
133 | + { |
|
134 | + if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
135 | + else $text = img_object($langs->trans('Product'),'product'); |
|
136 | 136 | |
137 | - if (! empty($line->label)) { |
|
138 | - $text.= ' <strong>'.$line->label.'</strong>'; |
|
139 | - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
140 | - } else { |
|
141 | - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
142 | - echo $text.' '.dol_htmlentitiesbr($line->description); |
|
143 | - } |
|
144 | - } |
|
137 | + if (! empty($line->label)) { |
|
138 | + $text.= ' <strong>'.$line->label.'</strong>'; |
|
139 | + echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
140 | + } else { |
|
141 | + if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
142 | + echo $text.' '.dol_htmlentitiesbr($line->description); |
|
143 | + } |
|
144 | + } |
|
145 | 145 | |
146 | - // Show date range |
|
147 | - if ($line->element == 'facturedetrec') { |
|
148 | - if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
149 | - if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
150 | - if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
151 | - if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
152 | - if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
153 | - } |
|
154 | - else { |
|
155 | - if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
156 | - //echo get_date_range($line->date_start, $line->date_end, $format); |
|
157 | - } |
|
146 | + // Show date range |
|
147 | + if ($line->element == 'facturedetrec') { |
|
148 | + if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
149 | + if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
150 | + if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
151 | + if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
152 | + if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
153 | + } |
|
154 | + else { |
|
155 | + if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
156 | + //echo get_date_range($line->date_start, $line->date_end, $format); |
|
157 | + } |
|
158 | 158 | |
159 | - // Add description in form |
|
160 | - if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
161 | - { |
|
162 | - print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
163 | - } |
|
164 | - } |
|
159 | + // Add description in form |
|
160 | + if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
161 | + { |
|
162 | + print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
163 | + } |
|
164 | + } |
|
165 | 165 | |
166 | - if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
167 | - { |
|
168 | - $accountingaccount=new AccountingAccount($this->db); |
|
169 | - $accountingaccount->fetch($line->fk_accounting_account); |
|
170 | - echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
171 | - } |
|
166 | + if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
167 | + { |
|
168 | + $accountingaccount=new AccountingAccount($this->db); |
|
169 | + $accountingaccount->fetch($line->fk_accounting_account); |
|
170 | + echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
171 | + } |
|
172 | 172 | |
173 | - ?> |
|
173 | + ?> |
|
174 | 174 | </td> |
175 | 175 | <?php |
176 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
177 | - { |
|
178 | - ?> |
|
176 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
177 | + { |
|
178 | + ?> |
|
179 | 179 | <td class="linecolrefsupplier"><?php |
180 | - echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
181 | - ?></td> |
|
180 | + echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
181 | + ?></td> |
|
182 | 182 | <?php |
183 | - } |
|
184 | - // VAT Rate |
|
185 | - ?> |
|
183 | + } |
|
184 | + // VAT Rate |
|
185 | + ?> |
|
186 | 186 | <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php |
187 | - $positiverates=''; |
|
188 | - if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
189 | - if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
190 | - if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
191 | - if (empty($positiverates)) $positiverates='0'; |
|
192 | - echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
193 | - //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
|
194 | - ?></td> |
|
187 | + $positiverates=''; |
|
188 | + if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
189 | + if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
190 | + if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
191 | + if (empty($positiverates)) $positiverates='0'; |
|
192 | + echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
193 | + //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
|
194 | + ?></td> |
|
195 | 195 | |
196 | 196 | <td align="right" class="linecoluht nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td> |
197 | 197 | |
@@ -205,45 +205,45 @@ discard block |
||
205 | 205 | |
206 | 206 | <td align="right" class="linecolqty nowrap"><?php $coldisplay++; ?> |
207 | 207 | <?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { |
208 | - // I comment this because it shows info even when not required |
|
209 | - // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
210 | - // must also not be output for most entities (proposal, intervention, ...) |
|
211 | - //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
212 | - echo $line->qty; |
|
213 | - } else echo ' '; ?> |
|
208 | + // I comment this because it shows info even when not required |
|
209 | + // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
210 | + // must also not be output for most entities (proposal, intervention, ...) |
|
211 | + //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
212 | + echo $line->qty; |
|
213 | + } else echo ' '; ?> |
|
214 | 214 | </td> |
215 | 215 | |
216 | 216 | <?php |
217 | - if($conf->global->PRODUCT_USE_UNITS) |
|
218 | - { |
|
219 | - print '<td align="left" class="linecoluseunit nowrap">'; |
|
220 | - $label = $line->getLabelOfUnit('short'); |
|
221 | - if ($label !== '') { |
|
222 | - print $langs->trans($label); |
|
223 | - } |
|
224 | - print '</td>'; |
|
225 | - } |
|
226 | - ?> |
|
217 | + if($conf->global->PRODUCT_USE_UNITS) |
|
218 | + { |
|
219 | + print '<td align="left" class="linecoluseunit nowrap">'; |
|
220 | + $label = $line->getLabelOfUnit('short'); |
|
221 | + if ($label !== '') { |
|
222 | + print $langs->trans($label); |
|
223 | + } |
|
224 | + print '</td>'; |
|
225 | + } |
|
226 | + ?> |
|
227 | 227 | |
228 | 228 | <?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?> |
229 | 229 | <td class="linecoldiscount" align="right"><?php |
230 | - $coldisplay++; |
|
231 | - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
232 | - echo dol_print_reduction($line->remise_percent,$langs); |
|
233 | - ?></td> |
|
230 | + $coldisplay++; |
|
231 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
232 | + echo dol_print_reduction($line->remise_percent,$langs); |
|
233 | + ?></td> |
|
234 | 234 | <?php } else { ?> |
235 | 235 | <td class="linecoldiscount"><?php $coldisplay++; ?> </td> |
236 | 236 | <?php } |
237 | 237 | |
238 | - if ($this->situation_cycle_ref) { |
|
239 | - $coldisplay++; |
|
240 | - print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
241 | - } |
|
238 | + if ($this->situation_cycle_ref) { |
|
239 | + $coldisplay++; |
|
240 | + print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
241 | + } |
|
242 | 242 | |
243 | - if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
244 | - { |
|
245 | - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
246 | - ?> |
|
243 | + if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
244 | + { |
|
245 | + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
246 | + ?> |
|
247 | 247 | |
248 | 248 | <?php if (!empty($user->rights->margins->creer)) { ?> |
249 | 249 | <td align="right" class="linecolmargin1 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td> |
@@ -254,8 +254,8 @@ discard block |
||
254 | 254 | if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> |
255 | 255 | <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td> |
256 | 256 | <?php } |
257 | - } |
|
258 | - ?> |
|
257 | + } |
|
258 | + ?> |
|
259 | 259 | |
260 | 260 | <?php if ($line->special_code == 3) { ?> |
261 | 261 | <td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td> |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | |
273 | 273 | <?php |
274 | - if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
274 | + if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
275 | 275 | <td class="linecoledit" align="center"><?php $coldisplay++; ?> |
276 | 276 | <?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> |
277 | 277 | <?php } else { ?> |
@@ -283,16 +283,16 @@ discard block |
||
283 | 283 | |
284 | 284 | <td class="linecoldelete" align="center"><?php $coldisplay++; ?> |
285 | 285 | <?php |
286 | - if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
|
287 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
288 | - print img_delete(); |
|
289 | - print '</a>'; |
|
290 | - } |
|
291 | - ?> |
|
286 | + if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
|
287 | + print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
288 | + print img_delete(); |
|
289 | + print '</a>'; |
|
290 | + } |
|
291 | + ?> |
|
292 | 292 | </td> |
293 | 293 | |
294 | 294 | <?php |
295 | - if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> |
|
295 | + if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> |
|
296 | 296 | <td align="center" class="linecolmove tdlineupdown"><?php $coldisplay++; ?> |
297 | 297 | <?php if ($i > 0) { ?> |
298 | 298 | <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>"> |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | //Line extrafield |
322 | 322 | if (!empty($extrafieldsline)) |
323 | 323 | { |
324 | - print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
324 | + print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
325 | 325 | } |
326 | 326 | ?> |
327 | 327 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | |
40 | 40 | // Protection to avoid direct call of template |
41 | -if (empty($object) || ! is_object($object)) |
|
41 | +if (empty($object) || !is_object($object)) |
|
42 | 42 | { |
43 | 43 | print "Error, template page can't be called as URL"; |
44 | 44 | exit; |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | |
48 | 48 | global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; |
49 | 49 | |
50 | -$usemargins=0; |
|
51 | -if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; |
|
50 | +$usemargins = 0; |
|
51 | +if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) $usemargins = 1; |
|
52 | 52 | |
53 | -if (empty($dateSelector)) $dateSelector=0; |
|
54 | -if (empty($forceall)) $forceall=0; |
|
55 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
56 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
57 | -if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; |
|
53 | +if (empty($dateSelector)) $dateSelector = 0; |
|
54 | +if (empty($forceall)) $forceall = 0; |
|
55 | +if (empty($senderissupplier)) $senderissupplier = 0; |
|
56 | +if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0; |
|
57 | +if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax = 0; |
|
58 | 58 | |
59 | 59 | // add html5 elements |
60 | 60 | $domData = ' data-element="'.$line->element.'"'; |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | |
65 | 65 | |
66 | 66 | ?> |
67 | -<?php $coldisplay=0; ?> |
|
67 | +<?php $coldisplay = 0; ?> |
|
68 | 68 | <!-- BEGIN PHP TEMPLATE objectline_view.tpl.php --> |
69 | 69 | <tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> > |
70 | - <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
71 | - <td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> |
|
70 | + <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
71 | + <td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i + 1); ?></td> |
|
72 | 72 | <?php } ?> |
73 | 73 | <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> |
74 | 74 | <?php |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | ?> |
77 | 77 | <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>"> |
78 | 78 | <?php |
79 | - $txt=''; |
|
80 | - print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
81 | - if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
82 | - elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
83 | - elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
79 | + $txt = ''; |
|
80 | + print img_object($langs->trans("ShowReduc"), 'reduc').' '; |
|
81 | + if ($line->description == '(DEPOSIT)') $txt = $langs->trans("Deposit"); |
|
82 | + elseif ($line->description == '(EXCESS RECEIVED)') $txt = $langs->trans("ExcessReceived"); |
|
83 | + elseif ($line->description == '(EXCESS PAID)') $txt = $langs->trans("ExcessPaid"); |
|
84 | 84 | //else $txt=$langs->trans("Discount"); |
85 | 85 | print $txt; |
86 | 86 | ?> |
@@ -90,55 +90,55 @@ discard block |
||
90 | 90 | { |
91 | 91 | if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
92 | 92 | { |
93 | - $discount=new DiscountAbsolute($this->db); |
|
93 | + $discount = new DiscountAbsolute($this->db); |
|
94 | 94 | $discount->fetch($line->fk_remise_except); |
95 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
95 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0)); |
|
96 | 96 | } |
97 | 97 | elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
98 | 98 | { |
99 | - $discount=new DiscountAbsolute($this->db); |
|
99 | + $discount = new DiscountAbsolute($this->db); |
|
100 | 100 | $discount->fetch($line->fk_remise_except); |
101 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
101 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0)); |
|
102 | 102 | // Add date of deposit |
103 | - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
103 | + if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
104 | 104 | echo ' ('.dol_print_date($discount->datec).')'; |
105 | 105 | } |
106 | 106 | elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
107 | 107 | { |
108 | - $discount=new DiscountAbsolute($this->db); |
|
108 | + $discount = new DiscountAbsolute($this->db); |
|
109 | 109 | $discount->fetch($line->fk_remise_except); |
110 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
110 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0)); |
|
111 | 111 | } |
112 | 112 | elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
113 | 113 | { |
114 | - $discount=new DiscountAbsolute($this->db); |
|
114 | + $discount = new DiscountAbsolute($this->db); |
|
115 | 115 | $discount->fetch($line->fk_remise_except); |
116 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
116 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); |
|
117 | 117 | } |
118 | 118 | else |
119 | 119 | { |
120 | - echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
120 | + echo ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |
124 | 124 | else |
125 | 125 | { |
126 | - $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
126 | + $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day'; |
|
127 | 127 | |
128 | 128 | if ($line->fk_product > 0) |
129 | 129 | { |
130 | - echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
130 | + echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); |
|
131 | 131 | } |
132 | 132 | else |
133 | 133 | { |
134 | - if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
135 | - else $text = img_object($langs->trans('Product'),'product'); |
|
134 | + if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); |
|
135 | + else $text = img_object($langs->trans('Product'), 'product'); |
|
136 | 136 | |
137 | - if (! empty($line->label)) { |
|
138 | - $text.= ' <strong>'.$line->label.'</strong>'; |
|
139 | - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
137 | + if (!empty($line->label)) { |
|
138 | + $text .= ' <strong>'.$line->label.'</strong>'; |
|
139 | + echo $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); |
|
140 | 140 | } else { |
141 | - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
141 | + if (!empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
142 | 142 | echo $text.' '.dol_htmlentitiesbr($line->description); |
143 | 143 | } |
144 | 144 | } |
@@ -157,17 +157,17 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | // Add description in form |
160 | - if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
160 | + if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
161 | 161 | { |
162 | - print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
162 | + print (!empty($line->description) && $line->description != $line->product_label) ? '<br>'.dol_htmlentitiesbr($line->description) : ''; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
166 | - if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
166 | + if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
167 | 167 | { |
168 | - $accountingaccount=new AccountingAccount($this->db); |
|
168 | + $accountingaccount = new AccountingAccount($this->db); |
|
169 | 169 | $accountingaccount->fetch($line->fk_accounting_account); |
170 | - echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
170 | + echo '<div class="clearboth"></div><br><span class="opacitymedium">'.$langs->trans('AccountingAffectation').' : </span>'.$accountingaccount->getNomUrl(0, 1, 1); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | ?> |
@@ -177,19 +177,19 @@ discard block |
||
177 | 177 | { |
178 | 178 | ?> |
179 | 179 | <td class="linecolrefsupplier"><?php |
180 | - echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
180 | + echo ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier); |
|
181 | 181 | ?></td> |
182 | 182 | <?php |
183 | 183 | } |
184 | 184 | // VAT Rate |
185 | 185 | ?> |
186 | 186 | <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php |
187 | - $positiverates=''; |
|
188 | - if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
189 | - if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
190 | - if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
191 | - if (empty($positiverates)) $positiverates='0'; |
|
192 | - echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
187 | + $positiverates = ''; |
|
188 | + if (price2num($line->tva_tx)) $positiverates .= ($positiverates ? '/' : '').price2num($line->tva_tx); |
|
189 | + if (price2num($line->total_localtax1)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax1_tx); |
|
190 | + if (price2num($line->total_localtax2)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax2_tx); |
|
191 | + if (empty($positiverates)) $positiverates = '0'; |
|
192 | + echo vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), '%', $line->info_bits); |
|
193 | 193 | //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
194 | 194 | ?></td> |
195 | 195 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <?php } ?> |
201 | 201 | |
202 | 202 | <?php if ($inputalsopricewithtax) { ?> |
203 | - <td align="right" class="linecoluttc nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td> |
|
203 | + <td align="right" class="linecoluttc nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc) ?price($line->pu_ttc) : price($line->subprice)); ?></td> |
|
204 | 204 | <?php } ?> |
205 | 205 | |
206 | 206 | <td align="right" class="linecolqty nowrap"><?php $coldisplay++; ?> |
@@ -210,11 +210,11 @@ discard block |
||
210 | 210 | // must also not be output for most entities (proposal, intervention, ...) |
211 | 211 | //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
212 | 212 | echo $line->qty; |
213 | - } else echo ' '; ?> |
|
213 | + } else echo ' '; ?> |
|
214 | 214 | </td> |
215 | 215 | |
216 | 216 | <?php |
217 | - if($conf->global->PRODUCT_USE_UNITS) |
|
217 | + if ($conf->global->PRODUCT_USE_UNITS) |
|
218 | 218 | { |
219 | 219 | print '<td align="left" class="linecoluseunit nowrap">'; |
220 | 220 | $label = $line->getLabelOfUnit('short'); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | <td class="linecoldiscount" align="right"><?php |
230 | 230 | $coldisplay++; |
231 | 231 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
232 | - echo dol_print_reduction($line->remise_percent,$langs); |
|
232 | + echo dol_print_reduction($line->remise_percent, $langs); |
|
233 | 233 | ?></td> |
234 | 234 | <?php } else { ?> |
235 | 235 | <td class="linecoldiscount"><?php $coldisplay++; ?> </td> |
@@ -237,27 +237,27 @@ discard block |
||
237 | 237 | |
238 | 238 | if ($this->situation_cycle_ref) { |
239 | 239 | $coldisplay++; |
240 | - print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
240 | + print '<td align="right" class="linecolcycleref nowrap">'.$line->situation_percent.'%</td>'; |
|
241 | 241 | } |
242 | 242 | |
243 | - if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
243 | + if ($usemargins && !empty($conf->margin->enabled) && empty($user->societe_id)) |
|
244 | 244 | { |
245 | - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
245 | + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); |
|
246 | 246 | ?> |
247 | 247 | |
248 | 248 | <?php if (!empty($user->rights->margins->creer)) { ?> |
249 | 249 | <td align="right" class="linecolmargin1 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td> |
250 | 250 | <?php } ?> |
251 | - <?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> |
|
252 | - <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td> |
|
251 | + <?php if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> |
|
252 | + <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0) ? 'n/a' : price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td> |
|
253 | 253 | <?php } |
254 | - if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> |
|
254 | + if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> |
|
255 | 255 | <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td> |
256 | 256 | <?php } |
257 | 257 | } |
258 | 258 | ?> |
259 | 259 | |
260 | - <?php if ($line->special_code == 3) { ?> |
|
260 | + <?php if ($line->special_code == 3) { ?> |
|
261 | 261 | <td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td> |
262 | 262 | <?php } else { ?> |
263 | 263 | <td align="right" class="linecolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td> |
@@ -271,9 +271,9 @@ discard block |
||
271 | 271 | |
272 | 272 | |
273 | 273 | <?php |
274 | - if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
274 | + if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { ?> |
|
275 | 275 | <td class="linecoledit" align="center"><?php $coldisplay++; ?> |
276 | - <?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> |
|
276 | + <?php if (($line->info_bits & 2) == 2 || !empty($disableedit)) { ?> |
|
277 | 277 | <?php } else { ?> |
278 | 278 | <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id; ?>"> |
279 | 279 | <?php echo img_edit(); ?> |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | <td class="linecoldelete" align="center"><?php $coldisplay++; ?> |
285 | 285 | <?php |
286 | 286 | if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
287 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
287 | + print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&lineid='.$line->id.'">'; |
|
288 | 288 | print img_delete(); |
289 | 289 | print '</a>'; |
290 | 290 | } |
@@ -296,23 +296,23 @@ discard block |
||
296 | 296 | <td align="center" class="linecolmove tdlineupdown"><?php $coldisplay++; ?> |
297 | 297 | <?php if ($i > 0) { ?> |
298 | 298 | <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>"> |
299 | - <?php echo img_up('default',0,'imgupforline'); ?> |
|
299 | + <?php echo img_up('default', 0, 'imgupforline'); ?> |
|
300 | 300 | </a> |
301 | 301 | <?php } ?> |
302 | - <?php if ($i < $num-1) { ?> |
|
302 | + <?php if ($i < $num - 1) { ?> |
|
303 | 303 | <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>"> |
304 | - <?php echo img_down('default',0,'imgdownforline'); ?> |
|
304 | + <?php echo img_down('default', 0, 'imgdownforline'); ?> |
|
305 | 305 | </a> |
306 | 306 | <?php } ?> |
307 | 307 | </td> |
308 | 308 | <?php } else { ?> |
309 | - <td align="center"<?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown"':' class="linecolmove"'); ?>><?php $coldisplay++; ?></td> |
|
309 | + <td align="center"<?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown"' : ' class="linecolmove"'); ?>><?php $coldisplay++; ?></td> |
|
310 | 310 | <?php } ?> |
311 | 311 | <?php } else { ?> |
312 | - <td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td> |
|
312 | + <td colspan="3"><?php $coldisplay = $coldisplay + 3; ?></td> |
|
313 | 313 | <?php } ?> |
314 | - <?php if($action == 'selectlines'){ ?> |
|
315 | - <td class="linecolcheck" align="center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td> |
|
314 | + <?php if ($action == 'selectlines') { ?> |
|
315 | + <td class="linecolcheck" align="center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i + 1; ?>]" value="<?php echo $line->id; ?>" ></td> |
|
316 | 316 | <?php } ?> |
317 | 317 | |
318 | 318 | </tr> |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | //Line extrafield |
322 | 322 | if (!empty($extrafieldsline)) |
323 | 323 | { |
324 | - print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
324 | + print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"', 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD) ? 0 : 1); |
|
325 | 325 | } |
326 | 326 | ?> |
327 | 327 |
@@ -48,13 +48,25 @@ discard block |
||
48 | 48 | global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; |
49 | 49 | |
50 | 50 | $usemargins=0; |
51 | -if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; |
|
51 | +if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) { |
|
52 | + $usemargins=1; |
|
53 | +} |
|
52 | 54 | |
53 | -if (empty($dateSelector)) $dateSelector=0; |
|
54 | -if (empty($forceall)) $forceall=0; |
|
55 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
56 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
57 | -if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; |
|
55 | +if (empty($dateSelector)) { |
|
56 | + $dateSelector=0; |
|
57 | +} |
|
58 | +if (empty($forceall)) { |
|
59 | + $forceall=0; |
|
60 | +} |
|
61 | +if (empty($senderissupplier)) { |
|
62 | + $senderissupplier=0; |
|
63 | +} |
|
64 | +if (empty($inputalsopricewithtax)) { |
|
65 | + $inputalsopricewithtax=0; |
|
66 | +} |
|
67 | +if (empty($outputalsopricetotalwithtax)) { |
|
68 | + $outputalsopricetotalwithtax=0; |
|
69 | +} |
|
58 | 70 | |
59 | 71 | // add html5 elements |
60 | 72 | $domData = ' data-element="'.$line->element.'"'; |
@@ -78,9 +90,13 @@ discard block |
||
78 | 90 | <?php |
79 | 91 | $txt=''; |
80 | 92 | print img_object($langs->trans("ShowReduc"),'reduc').' '; |
81 | - if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
82 | - elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
83 | - elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
93 | + if ($line->description == '(DEPOSIT)') { |
|
94 | + $txt=$langs->trans("Deposit"); |
|
95 | + } elseif ($line->description == '(EXCESS RECEIVED)') { |
|
96 | + $txt=$langs->trans("ExcessReceived"); |
|
97 | + } elseif ($line->description == '(EXCESS PAID)') { |
|
98 | + $txt=$langs->trans("ExcessPaid"); |
|
99 | + } |
|
84 | 100 | //else $txt=$langs->trans("Discount"); |
85 | 101 | print $txt; |
86 | 102 | ?> |
@@ -93,66 +109,77 @@ discard block |
||
93 | 109 | $discount=new DiscountAbsolute($this->db); |
94 | 110 | $discount->fetch($line->fk_remise_except); |
95 | 111 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
96 | - } |
|
97 | - elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
112 | + } elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
98 | 113 | { |
99 | 114 | $discount=new DiscountAbsolute($this->db); |
100 | 115 | $discount->fetch($line->fk_remise_except); |
101 | 116 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
102 | 117 | // Add date of deposit |
103 | - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
104 | - echo ' ('.dol_print_date($discount->datec).')'; |
|
105 | - } |
|
106 | - elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
118 | + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { |
|
119 | + echo ' ('.dol_print_date($discount->datec).')'; |
|
120 | + } |
|
121 | + } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
107 | 122 | { |
108 | 123 | $discount=new DiscountAbsolute($this->db); |
109 | 124 | $discount->fetch($line->fk_remise_except); |
110 | 125 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
111 | - } |
|
112 | - elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
126 | + } elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
113 | 127 | { |
114 | 128 | $discount=new DiscountAbsolute($this->db); |
115 | 129 | $discount->fetch($line->fk_remise_except); |
116 | 130 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
117 | - } |
|
118 | - else |
|
131 | + } else |
|
119 | 132 | { |
120 | 133 | echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
121 | 134 | } |
122 | 135 | } |
123 | - } |
|
124 | - else |
|
136 | + } else |
|
125 | 137 | { |
126 | 138 | $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
127 | 139 | |
128 | 140 | if ($line->fk_product > 0) |
129 | 141 | { |
130 | 142 | echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
131 | - } |
|
132 | - else |
|
143 | + } else |
|
133 | 144 | { |
134 | - if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
135 | - else $text = img_object($langs->trans('Product'),'product'); |
|
145 | + if ($type==1) { |
|
146 | + $text = img_object($langs->trans('Service'),'service'); |
|
147 | + } else { |
|
148 | + $text = img_object($langs->trans('Product'),'product'); |
|
149 | + } |
|
136 | 150 | |
137 | 151 | if (! empty($line->label)) { |
138 | 152 | $text.= ' <strong>'.$line->label.'</strong>'; |
139 | 153 | echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
140 | 154 | } else { |
141 | - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
155 | + if (! empty($line->fk_parent_line)) { |
|
156 | + echo img_picto('', 'rightarrow'); |
|
157 | + } |
|
142 | 158 | echo $text.' '.dol_htmlentitiesbr($line->description); |
143 | 159 | } |
144 | 160 | } |
145 | 161 | |
146 | 162 | // Show date range |
147 | 163 | if ($line->element == 'facturedetrec') { |
148 | - if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
149 | - if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
150 | - if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
151 | - if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
152 | - if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
153 | - } |
|
154 | - else { |
|
155 | - if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
164 | + if ($line->date_start_fill || $line->date_end_fill) { |
|
165 | + echo '<br><div class="clearboth nowraponall">'; |
|
166 | + } |
|
167 | + if ($line->date_start_fill) { |
|
168 | + echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
169 | + } |
|
170 | + if ($line->date_start_fill && $line->date_end_fill) { |
|
171 | + echo ' - '; |
|
172 | + } |
|
173 | + if ($line->date_end_fill) { |
|
174 | + echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
175 | + } |
|
176 | + if ($line->date_start_fill || $line->date_end_fill) { |
|
177 | + echo '</div>'; |
|
178 | + } |
|
179 | + } else { |
|
180 | + if ($line->date_start || $line->date_end) { |
|
181 | + echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
182 | + } |
|
156 | 183 | //echo get_date_range($line->date_start, $line->date_end, $format); |
157 | 184 | } |
158 | 185 | |
@@ -173,11 +200,13 @@ discard block |
||
173 | 200 | ?> |
174 | 201 | </td> |
175 | 202 | <?php |
176 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
203 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
204 | + // We must have same test in printObjectLines |
|
177 | 205 | { |
178 | 206 | ?> |
179 | 207 | <td class="linecolrefsupplier"><?php |
180 | 208 | echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
209 | + } |
|
181 | 210 | ?></td> |
182 | 211 | <?php |
183 | 212 | } |
@@ -185,10 +214,18 @@ discard block |
||
185 | 214 | ?> |
186 | 215 | <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php |
187 | 216 | $positiverates=''; |
188 | - if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
189 | - if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
190 | - if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
191 | - if (empty($positiverates)) $positiverates='0'; |
|
217 | + if (price2num($line->tva_tx)) { |
|
218 | + $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
219 | + } |
|
220 | + if (price2num($line->total_localtax1)) { |
|
221 | + $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
222 | + } |
|
223 | + if (price2num($line->total_localtax2)) { |
|
224 | + $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
225 | + } |
|
226 | + if (empty($positiverates)) { |
|
227 | + $positiverates='0'; |
|
228 | + } |
|
192 | 229 | echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
193 | 230 | //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
194 | 231 | ?></td> |
@@ -210,7 +247,10 @@ discard block |
||
210 | 247 | // must also not be output for most entities (proposal, intervention, ...) |
211 | 248 | //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
212 | 249 | echo $line->qty; |
213 | - } else echo ' '; ?> |
|
250 | + } else { |
|
251 | + echo ' '; |
|
252 | + } |
|
253 | + ?> |
|
214 | 254 | </td> |
215 | 255 | |
216 | 256 | <?php |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | // Protection to avoid direct call of template |
20 | 20 | if (empty($conf) || ! is_object($conf)) |
21 | 21 | { |
22 | - print "Error, template page can't be called as URL"; |
|
23 | - exit; |
|
22 | + print "Error, template page can't be called as URL"; |
|
23 | + exit; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | ?> |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | print '<td align="right">'.$this->tpl['vat_rate'].'</td>'; |
34 | 34 | print '<td align="right">'.$this->tpl['price'].'</td>'; |
35 | 35 | if (!empty($conf->multicurrency->enabled)) |
36 | - print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>'; |
|
36 | + print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>'; |
|
37 | 37 | |
38 | 38 | print '<td align="right">'.$this->tpl['qty'].'</td>'; |
39 | 39 | if($conf->global->PRODUCT_USE_UNITS) |
40 | - print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>'; |
|
40 | + print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>'; |
|
41 | 41 | |
42 | 42 | print '<td align="right">'.$this->tpl['remise_percent'].'</td>'; |
43 | 43 | print '</tr>'."\n"; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | |
19 | 19 | // Protection to avoid direct call of template |
20 | -if (empty($conf) || ! is_object($conf)) |
|
20 | +if (empty($conf) || !is_object($conf)) |
|
21 | 21 | { |
22 | 22 | print "Error, template page can't be called as URL"; |
23 | 23 | exit; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | <!-- BEGIN PHP TEMPLATE originproductline.tpl.php --> |
29 | 29 | <?php |
30 | -print '<tr class="oddeven'.(empty($this->tpl['strike'])?'':' strikefordisabled').'">'; |
|
30 | +print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabled').'">'; |
|
31 | 31 | print '<td>'.$this->tpl['label'].'</td>'; |
32 | 32 | print '<td>'.$this->tpl['description'].'</td>'; |
33 | 33 | print '<td align="right">'.$this->tpl['vat_rate'].'</td>'; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>'; |
37 | 37 | |
38 | 38 | print '<td align="right">'.$this->tpl['qty'].'</td>'; |
39 | -if($conf->global->PRODUCT_USE_UNITS) |
|
39 | +if ($conf->global->PRODUCT_USE_UNITS) |
|
40 | 40 | print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>'; |
41 | 41 | |
42 | 42 | print '<td align="right">'.$this->tpl['remise_percent'].'</td>'; |
@@ -32,12 +32,14 @@ |
||
32 | 32 | print '<td>'.$this->tpl['description'].'</td>'; |
33 | 33 | print '<td align="right">'.$this->tpl['vat_rate'].'</td>'; |
34 | 34 | print '<td align="right">'.$this->tpl['price'].'</td>'; |
35 | -if (!empty($conf->multicurrency->enabled)) |
|
35 | +if (!empty($conf->multicurrency->enabled)) { |
|
36 | 36 | print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>'; |
37 | +} |
|
37 | 38 | |
38 | 39 | print '<td align="right">'.$this->tpl['qty'].'</td>'; |
39 | -if($conf->global->PRODUCT_USE_UNITS) |
|
40 | +if($conf->global->PRODUCT_USE_UNITS) { |
|
40 | 41 | print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>'; |
42 | +} |
|
41 | 43 | |
42 | 44 | print '<td align="right">'.$this->tpl['remise_percent'].'</td>'; |
43 | 45 | print '</tr>'."\n"; |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | // Protection to avoid direct call of template |
4 | 4 | if (empty($conf) || ! is_object($conf)) |
5 | 5 | { |
6 | - print "Error, template page can't be called as URL"; |
|
7 | - exit; |
|
6 | + print "Error, template page can't be called as URL"; |
|
7 | + exit; |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; |
@@ -12,37 +12,37 @@ discard block |
||
12 | 12 | // Loop to show all columns of extrafields for the search title line |
13 | 13 | if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... |
14 | 14 | { |
15 | - if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) |
|
16 | - { |
|
17 | - foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) |
|
18 | - { |
|
19 | - if (! empty($arrayfields["ef.".$key]['checked'])) { |
|
20 | - $align=$extrafields->getAlignFlag($key); |
|
21 | - $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; |
|
22 | - print '<td class="liste_titre'.($align?' '.$align:'').'">'; |
|
23 | - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) |
|
24 | - { |
|
25 | - $crit=$val; |
|
26 | - $tmpkey=preg_replace('/search_options_/','',$key); |
|
27 | - $searchclass=''; |
|
28 | - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; |
|
29 | - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; |
|
30 | - print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; |
|
31 | - } |
|
32 | - elseif (! in_array($typeofextrafield, array('datetime','timestamp'))) |
|
33 | - { |
|
34 | - // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') |
|
35 | - $morecss=''; |
|
36 | - if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; |
|
37 | - echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss); |
|
38 | - } |
|
39 | - elseif (in_array($typeofextrafield, array('datetime','timestamp'))) |
|
40 | - { |
|
41 | - // TODO |
|
42 | - // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes |
|
43 | - } |
|
44 | - print '</td>'; |
|
45 | - } |
|
46 | - } |
|
47 | - } |
|
15 | + if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) |
|
16 | + { |
|
17 | + foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) |
|
18 | + { |
|
19 | + if (! empty($arrayfields["ef.".$key]['checked'])) { |
|
20 | + $align=$extrafields->getAlignFlag($key); |
|
21 | + $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; |
|
22 | + print '<td class="liste_titre'.($align?' '.$align:'').'">'; |
|
23 | + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) |
|
24 | + { |
|
25 | + $crit=$val; |
|
26 | + $tmpkey=preg_replace('/search_options_/','',$key); |
|
27 | + $searchclass=''; |
|
28 | + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; |
|
29 | + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; |
|
30 | + print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; |
|
31 | + } |
|
32 | + elseif (! in_array($typeofextrafield, array('datetime','timestamp'))) |
|
33 | + { |
|
34 | + // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') |
|
35 | + $morecss=''; |
|
36 | + if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; |
|
37 | + echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss); |
|
38 | + } |
|
39 | + elseif (in_array($typeofextrafield, array('datetime','timestamp'))) |
|
40 | + { |
|
41 | + // TODO |
|
42 | + // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes |
|
43 | + } |
|
44 | + print '</td>'; |
|
45 | + } |
|
46 | + } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -1,42 +1,42 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Protection to avoid direct call of template |
4 | -if (empty($conf) || ! is_object($conf)) |
|
4 | +if (empty($conf) || !is_object($conf)) |
|
5 | 5 | { |
6 | 6 | print "Error, template page can't be called as URL"; |
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
10 | -if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; |
|
10 | +if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element; |
|
11 | 11 | |
12 | 12 | // Loop to show all columns of extrafields for the search title line |
13 | -if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... |
|
13 | +if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... |
|
14 | 14 | { |
15 | 15 | if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) |
16 | 16 | { |
17 | - foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) |
|
17 | + foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) |
|
18 | 18 | { |
19 | - if (! empty($arrayfields["ef.".$key]['checked'])) { |
|
20 | - $align=$extrafields->getAlignFlag($key); |
|
21 | - $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; |
|
22 | - print '<td class="liste_titre'.($align?' '.$align:'').'">'; |
|
19 | + if (!empty($arrayfields["ef.".$key]['checked'])) { |
|
20 | + $align = $extrafields->getAlignFlag($key); |
|
21 | + $typeofextrafield = $extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; |
|
22 | + print '<td class="liste_titre'.($align ? ' '.$align : '').'">'; |
|
23 | 23 | if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) |
24 | 24 | { |
25 | - $crit=$val; |
|
26 | - $tmpkey=preg_replace('/search_options_/','',$key); |
|
27 | - $searchclass=''; |
|
28 | - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; |
|
29 | - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; |
|
30 | - print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; |
|
25 | + $crit = $val; |
|
26 | + $tmpkey = preg_replace('/search_options_/', '', $key); |
|
27 | + $searchclass = ''; |
|
28 | + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass = 'searchstring'; |
|
29 | + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass = 'searchnum'; |
|
30 | + print '<input class="flat'.($searchclass ? ' '.$searchclass : '').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; |
|
31 | 31 | } |
32 | - elseif (! in_array($typeofextrafield, array('datetime','timestamp'))) |
|
32 | + elseif (!in_array($typeofextrafield, array('datetime', 'timestamp'))) |
|
33 | 33 | { |
34 | 34 | // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') |
35 | - $morecss=''; |
|
36 | - if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; |
|
35 | + $morecss = ''; |
|
36 | + if ($typeofextrafield == 'sellist') $morecss = 'maxwidth200'; |
|
37 | 37 | echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss); |
38 | 38 | } |
39 | - elseif (in_array($typeofextrafield, array('datetime','timestamp'))) |
|
39 | + elseif (in_array($typeofextrafield, array('datetime', 'timestamp'))) |
|
40 | 40 | { |
41 | 41 | // TODO |
42 | 42 | // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes |
@@ -7,10 +7,13 @@ discard block |
||
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
10 | -if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; |
|
10 | +if (empty($extrafieldsobjectkey) && is_object($object)) { |
|
11 | + $extrafieldsobjectkey=$object->table_element; |
|
12 | +} |
|
11 | 13 | |
12 | 14 | // Loop to show all columns of extrafields for the search title line |
13 | -if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... |
|
15 | +if (! empty($extrafieldsobjectkey)) { |
|
16 | + // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... |
|
14 | 17 | { |
15 | 18 | if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) |
16 | 19 | { |
@@ -18,6 +21,7 @@ discard block |
||
18 | 21 | { |
19 | 22 | if (! empty($arrayfields["ef.".$key]['checked'])) { |
20 | 23 | $align=$extrafields->getAlignFlag($key); |
24 | +} |
|
21 | 25 | $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; |
22 | 26 | print '<td class="liste_titre'.($align?' '.$align:'').'">'; |
23 | 27 | if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) |
@@ -25,18 +29,22 @@ discard block |
||
25 | 29 | $crit=$val; |
26 | 30 | $tmpkey=preg_replace('/search_options_/','',$key); |
27 | 31 | $searchclass=''; |
28 | - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; |
|
29 | - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; |
|
32 | + if (in_array($typeofextrafield, array('varchar', 'select'))) { |
|
33 | + $searchclass='searchstring'; |
|
34 | + } |
|
35 | + if (in_array($typeofextrafield, array('int', 'double'))) { |
|
36 | + $searchclass='searchnum'; |
|
37 | + } |
|
30 | 38 | print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; |
31 | - } |
|
32 | - elseif (! in_array($typeofextrafield, array('datetime','timestamp'))) |
|
39 | + } elseif (! in_array($typeofextrafield, array('datetime','timestamp'))) |
|
33 | 40 | { |
34 | 41 | // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') |
35 | 42 | $morecss=''; |
36 | - if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; |
|
43 | + if ($typeofextrafield == 'sellist') { |
|
44 | + $morecss='maxwidth200'; |
|
45 | + } |
|
37 | 46 | echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss); |
38 | - } |
|
39 | - elseif (in_array($typeofextrafield, array('datetime','timestamp'))) |
|
47 | + } elseif (in_array($typeofextrafield, array('datetime','timestamp'))) |
|
40 | 48 | { |
41 | 49 | // TODO |
42 | 50 | // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | // Protection to avoid direct call of template |
28 | 28 | if (empty($langs) || ! is_object($langs)) |
29 | 29 | { |
30 | - print "Error, template page can't be called as URL"; |
|
31 | - exit; |
|
30 | + print "Error, template page can't be called as URL"; |
|
31 | + exit; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -66,50 +66,50 @@ discard block |
||
66 | 66 | print '<td align="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>'; |
67 | 67 | print '<td align="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>'; |
68 | 68 | if ($conf->multicompany->enabled) { |
69 | - print '<td align="center">'.$langs->trans("Entities").'</td>'; |
|
69 | + print '<td align="center">'.$langs->trans("Entities").'</td>'; |
|
70 | 70 | } |
71 | 71 | print '<td width="80"> </td>'; |
72 | 72 | print "</tr>\n"; |
73 | 73 | |
74 | 74 | if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type'])) |
75 | 75 | { |
76 | - foreach($extrafields->attributes[$elementtype]['type'] as $key => $value) |
|
77 | - { |
|
78 | - // Load language if required |
|
79 | - if (! empty($extrafields->attributes[$elementtype]['langfile'][$key])) { |
|
80 | - $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); |
|
81 | - } |
|
76 | + foreach($extrafields->attributes[$elementtype]['type'] as $key => $value) |
|
77 | + { |
|
78 | + // Load language if required |
|
79 | + if (! empty($extrafields->attributes[$elementtype]['langfile'][$key])) { |
|
80 | + $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); |
|
81 | + } |
|
82 | 82 | |
83 | - print '<tr class="oddeven">'; |
|
84 | - print "<td>".$extrafields->attributes[$elementtype]['pos'][$key]."</td>\n"; |
|
85 | - print "<td>".$extrafields->attributes[$elementtype]['label'][$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value |
|
86 | - print "<td>".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; |
|
87 | - print "<td>".$key."</td>\n"; |
|
88 | - print "<td>".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."</td>\n"; |
|
89 | - print '<td align="right">'.$extrafields->attributes[$elementtype]['size'][$key]."</td>\n"; |
|
90 | - print '<td>'.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."</td>\n"; |
|
91 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['unique'][$key])."</td>\n"; |
|
92 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['required'][$key])."</td>\n"; |
|
93 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n"; |
|
94 | - print '<td align="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n"; |
|
95 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n"; |
|
96 | - if (! empty($conf->multicompany->enabled)) { |
|
97 | - print '<td align="center">'.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).'</td>'; |
|
98 | - } |
|
99 | - print '<td class="right nowraponall""><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>'; |
|
100 | - print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; |
|
101 | - print "</tr>"; |
|
102 | - } |
|
83 | + print '<tr class="oddeven">'; |
|
84 | + print "<td>".$extrafields->attributes[$elementtype]['pos'][$key]."</td>\n"; |
|
85 | + print "<td>".$extrafields->attributes[$elementtype]['label'][$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value |
|
86 | + print "<td>".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; |
|
87 | + print "<td>".$key."</td>\n"; |
|
88 | + print "<td>".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."</td>\n"; |
|
89 | + print '<td align="right">'.$extrafields->attributes[$elementtype]['size'][$key]."</td>\n"; |
|
90 | + print '<td>'.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."</td>\n"; |
|
91 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['unique'][$key])."</td>\n"; |
|
92 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['required'][$key])."</td>\n"; |
|
93 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n"; |
|
94 | + print '<td align="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n"; |
|
95 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n"; |
|
96 | + if (! empty($conf->multicompany->enabled)) { |
|
97 | + print '<td align="center">'.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).'</td>'; |
|
98 | + } |
|
99 | + print '<td class="right nowraponall""><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>'; |
|
100 | + print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; |
|
101 | + print "</tr>"; |
|
102 | + } |
|
103 | 103 | } |
104 | 104 | else |
105 | 105 | { |
106 | - $colspan=9; |
|
106 | + $colspan=9; |
|
107 | 107 | |
108 | - print '<tr class="oddeven">'; |
|
109 | - print '<td class="opacitymedium" colspan="'.$colspan.'">'; |
|
110 | - print $langs->trans("None"); |
|
111 | - print '</td>'; |
|
112 | - print '</tr>'; |
|
108 | + print '<tr class="oddeven">'; |
|
109 | + print '<td class="opacitymedium" colspan="'.$colspan.'">'; |
|
110 | + print $langs->trans("None"); |
|
111 | + print '</td>'; |
|
112 | + print '</tr>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | print "</table>"; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | |
27 | 27 | // Protection to avoid direct call of template |
28 | -if (empty($langs) || ! is_object($langs)) |
|
28 | +if (empty($langs) || !is_object($langs)) |
|
29 | 29 | { |
30 | 30 | print "Error, template page can't be called as URL"; |
31 | 31 | exit; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php --> |
40 | 40 | <?php |
41 | 41 | |
42 | -print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n"; |
|
42 | +print $langs->trans("DefineHereComplementaryAttributes", $textobject).'<br>'."\n"; |
|
43 | 43 | print '<br>'; |
44 | 44 | |
45 | 45 | // Load attribute_label |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | print '<td align="center">'.$langs->trans("AlwaysEditable").'</td>'; |
66 | 66 | print '<td align="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>'; |
67 | 67 | print '<td align="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>'; |
68 | -if ($conf->multicompany->enabled) { |
|
68 | +if ($conf->multicompany->enabled) { |
|
69 | 69 | print '<td align="center">'.$langs->trans("Entities").'</td>'; |
70 | 70 | } |
71 | 71 | print '<td width="80"> </td>'; |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | |
74 | 74 | if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type'])) |
75 | 75 | { |
76 | - foreach($extrafields->attributes[$elementtype]['type'] as $key => $value) |
|
76 | + foreach ($extrafields->attributes[$elementtype]['type'] as $key => $value) |
|
77 | 77 | { |
78 | 78 | // Load language if required |
79 | - if (! empty($extrafields->attributes[$elementtype]['langfile'][$key])) { |
|
79 | + if (!empty($extrafields->attributes[$elementtype]['langfile'][$key])) { |
|
80 | 80 | $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); |
81 | 81 | } |
82 | 82 | |
83 | 83 | print '<tr class="oddeven">'; |
84 | 84 | print "<td>".$extrafields->attributes[$elementtype]['pos'][$key]."</td>\n"; |
85 | - print "<td>".$extrafields->attributes[$elementtype]['label'][$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value |
|
85 | + print "<td>".$extrafields->attributes[$elementtype]['label'][$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value |
|
86 | 86 | print "<td>".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; |
87 | 87 | print "<td>".$key."</td>\n"; |
88 | 88 | print "<td>".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."</td>\n"; |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | print '<td align="center">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n"; |
94 | 94 | print '<td align="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n"; |
95 | 95 | print '<td align="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n"; |
96 | - if (! empty($conf->multicompany->enabled)) { |
|
97 | - print '<td align="center">'.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).'</td>'; |
|
96 | + if (!empty($conf->multicompany->enabled)) { |
|
97 | + print '<td align="center">'.($extrafields->attributes[$elementtype]['entityid'][$key] == 0 ? $langs->trans("All") : $extrafields->attributes[$elementtype]['entitylabel'][$key]).'</td>'; |
|
98 | 98 | } |
99 | 99 | print '<td class="right nowraponall""><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>'; |
100 | 100 | print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | else |
105 | 105 | { |
106 | - $colspan=9; |
|
106 | + $colspan = 9; |
|
107 | 107 | |
108 | 108 | print '<tr class="oddeven">'; |
109 | 109 | print '<td class="opacitymedium" colspan="'.$colspan.'">'; |
@@ -100,8 +100,7 @@ |
||
100 | 100 | print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; |
101 | 101 | print "</tr>"; |
102 | 102 | } |
103 | -} |
|
104 | -else |
|
103 | +} else |
|
105 | 104 | { |
106 | 105 | $colspan=9; |
107 | 106 |
@@ -10,31 +10,31 @@ discard block |
||
10 | 10 | dol_include_once($keyforclassfile); |
11 | 11 | if (class_exists($keyforclass)) |
12 | 12 | { |
13 | - $tmpobject=new $keyforclass($this->db); |
|
13 | + $tmpobject=new $keyforclass($this->db); |
|
14 | 14 | |
15 | - // Add common fields |
|
16 | - foreach($tmpobject->fields as $keyfield => $valuefield) |
|
17 | - { |
|
18 | - $fieldname = 't' . '.' . $keyfield; |
|
19 | - $fieldlabel = ucfirst($valuefield['label']); |
|
20 | - $typeFilter = "Text"; |
|
21 | - $typefield=preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double |
|
22 | - switch ($typefield) { |
|
23 | - case 'int': |
|
24 | - case 'integer': |
|
25 | - case 'double': |
|
26 | - case 'price': |
|
27 | - $typeFilter = "Numeric"; |
|
28 | - break; |
|
29 | - case 'date': |
|
30 | - case 'datetime': |
|
31 | - case 'timestamp': |
|
32 | - $typeFilter = "Date"; |
|
33 | - break; |
|
34 | - case 'boolean': |
|
35 | - $typeFilter = "Boolean"; |
|
36 | - break; |
|
37 | - /* |
|
15 | + // Add common fields |
|
16 | + foreach($tmpobject->fields as $keyfield => $valuefield) |
|
17 | + { |
|
18 | + $fieldname = 't' . '.' . $keyfield; |
|
19 | + $fieldlabel = ucfirst($valuefield['label']); |
|
20 | + $typeFilter = "Text"; |
|
21 | + $typefield=preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double |
|
22 | + switch ($typefield) { |
|
23 | + case 'int': |
|
24 | + case 'integer': |
|
25 | + case 'double': |
|
26 | + case 'price': |
|
27 | + $typeFilter = "Numeric"; |
|
28 | + break; |
|
29 | + case 'date': |
|
30 | + case 'datetime': |
|
31 | + case 'timestamp': |
|
32 | + $typeFilter = "Date"; |
|
33 | + break; |
|
34 | + case 'boolean': |
|
35 | + $typeFilter = "Boolean"; |
|
36 | + break; |
|
37 | + /* |
|
38 | 38 | * case 'sellist': |
39 | 39 | * $tmp=''; |
40 | 40 | * $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | * if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; |
46 | 46 | * break; |
47 | 47 | */ |
48 | - } |
|
49 | - if ($valuefield['enabled']) { |
|
50 | - $this->export_fields_array[$r][$fieldname] = $fieldlabel; |
|
51 | - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; |
|
52 | - $this->export_entities_array[$r][$fieldname] = $keyforelement; |
|
53 | - } |
|
54 | - } |
|
48 | + } |
|
49 | + if ($valuefield['enabled']) { |
|
50 | + $this->export_fields_array[$r][$fieldname] = $fieldlabel; |
|
51 | + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; |
|
52 | + $this->export_entities_array[$r][$fieldname] = $keyforelement; |
|
53 | + } |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | else |
57 | 57 | { |
58 | - dol_print_error($this->db, 'Failed to find class '.$keyforclass.', even after the include of '.$keyforclassfile); |
|
58 | + dol_print_error($this->db, 'Failed to find class '.$keyforclass.', even after the include of '.$keyforclassfile); |
|
59 | 59 | } |
60 | 60 | // End add common fields |
@@ -10,15 +10,15 @@ |
||
10 | 10 | dol_include_once($keyforclassfile); |
11 | 11 | if (class_exists($keyforclass)) |
12 | 12 | { |
13 | - $tmpobject=new $keyforclass($this->db); |
|
13 | + $tmpobject = new $keyforclass($this->db); |
|
14 | 14 | |
15 | 15 | // Add common fields |
16 | - foreach($tmpobject->fields as $keyfield => $valuefield) |
|
16 | + foreach ($tmpobject->fields as $keyfield => $valuefield) |
|
17 | 17 | { |
18 | - $fieldname = 't' . '.' . $keyfield; |
|
18 | + $fieldname = 't'.'.'.$keyfield; |
|
19 | 19 | $fieldlabel = ucfirst($valuefield['label']); |
20 | 20 | $typeFilter = "Text"; |
21 | - $typefield=preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double |
|
21 | + $typefield = preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double |
|
22 | 22 | switch ($typefield) { |
23 | 23 | case 'int': |
24 | 24 | case 'integer': |
@@ -52,8 +52,7 @@ |
||
52 | 52 | $this->export_entities_array[$r][$fieldname] = $keyforelement; |
53 | 53 | } |
54 | 54 | } |
55 | -} |
|
56 | -else |
|
55 | +} else |
|
57 | 56 | { |
58 | 57 | dol_print_error($this->db, 'Failed to find class '.$keyforclass.', even after the include of '.$keyforclassfile); |
59 | 58 | } |