@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | * \ingroup expedition |
24 | 24 | * \brief Library for expedition module |
25 | 25 | */ |
26 | -require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; |
|
27 | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
28 | -require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
26 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; |
|
27 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
28 | +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
29 | 29 | |
30 | 30 | |
31 | 31 | /** |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | $h = 0; |
45 | 45 | $head = array(); |
46 | 46 | |
47 | - $head[$h][0] = DOL_URL_ROOT . "/expedition/card.php?id=" . $object->id; |
|
47 | + $head[$h][0] = DOL_URL_ROOT."/expedition/card.php?id=".$object->id; |
|
48 | 48 | $head[$h][1] = $langs->trans("SendingCard"); |
49 | 49 | $head[$h][2] = 'shipping'; |
50 | 50 | $h++; |
51 | 51 | |
52 | 52 | if ($object->status == Expedition::STATUS_DRAFT) { |
53 | - $head[$h][0] = DOL_URL_ROOT . "/expedition/dispatch.php?id=" . $object->id; |
|
53 | + $head[$h][0] = DOL_URL_ROOT."/expedition/dispatch.php?id=".$object->id; |
|
54 | 54 | $head[$h][1] = $langs->trans("ShipmentDistribution"); |
55 | 55 | $head[$h][2] = 'dispatch'; |
56 | 56 | $h++; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // Take first element of array |
64 | 64 | $tmp = reset($object->linkedObjectsIds['delivery']); |
65 | 65 | |
66 | - $head[$h][0] = DOL_URL_ROOT . "/delivery/card.php?id=" . ((int) $tmp); |
|
66 | + $head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".((int) $tmp); |
|
67 | 67 | $head[$h][1] = $langs->trans("DeliveryCard"); |
68 | 68 | $head[$h][2] = 'delivery'; |
69 | 69 | $h++; |
@@ -77,24 +77,24 @@ discard block |
||
77 | 77 | $objectsrc->fetch($object->origin_id); |
78 | 78 | } |
79 | 79 | $nbContact = count($objectsrc->liste_contact(-1, 'internal')) + count($objectsrc->liste_contact(-1, 'external')); |
80 | - $head[$h][0] = DOL_URL_ROOT . "/expedition/contact.php?id=" . ((int) $object->id); |
|
80 | + $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".((int) $object->id); |
|
81 | 81 | $head[$h][1] = $langs->trans("ContactsAddresses"); |
82 | 82 | if ($nbContact > 0) { |
83 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>'; |
|
83 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>'; |
|
84 | 84 | } |
85 | 85 | $head[$h][2] = 'contact'; |
86 | 86 | $h++; |
87 | 87 | } |
88 | 88 | |
89 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
90 | - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; |
|
91 | - $upload_dir = $conf->expedition->dir_output . "/sending/" . dol_sanitizeFileName($object->ref); |
|
89 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
90 | + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
91 | + $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref); |
|
92 | 92 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
93 | 93 | $nbLinks = Link::count($db, $object->element, $object->id); |
94 | - $head[$h][0] = DOL_URL_ROOT . '/expedition/document.php?id=' . $object->id; |
|
94 | + $head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$object->id; |
|
95 | 95 | $head[$h][1] = $langs->trans('Documents'); |
96 | 96 | if (($nbFiles + $nbLinks) > 0) { |
97 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>'; |
|
97 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
98 | 98 | } |
99 | 99 | $head[$h][2] = 'documents'; |
100 | 100 | $h++; |
@@ -106,45 +106,45 @@ discard block |
||
106 | 106 | if (!empty($object->note_public)) { |
107 | 107 | $nbNote++; |
108 | 108 | } |
109 | - $head[$h][0] = DOL_URL_ROOT . "/expedition/note.php?id=" . $object->id; |
|
109 | + $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id; |
|
110 | 110 | $head[$h][1] = $langs->trans("Notes"); |
111 | 111 | if ($nbNote > 0) { |
112 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>'; |
|
112 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
113 | 113 | } |
114 | 114 | $head[$h][2] = 'note'; |
115 | 115 | $h++; |
116 | 116 | |
117 | 117 | |
118 | 118 | //MODIF PICHINOV AGENDA |
119 | - $head[$h][0] = DOL_URL_ROOT . '/expedition/agenda.php?id=' . $object->id; |
|
119 | + $head[$h][0] = DOL_URL_ROOT.'/expedition/agenda.php?id='.$object->id; |
|
120 | 120 | $head[$h][1] = $langs->trans("Events"); |
121 | 121 | if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { |
122 | 122 | $nbEvent = 0; |
123 | 123 | // Enable caching of thirdparty count actioncomm |
124 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
125 | - $cachekey = 'count_events_expedition_' . $object->id; // CHANGED: 'propal' to 'expedition' |
|
124 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
125 | + $cachekey = 'count_events_expedition_'.$object->id; // CHANGED: 'propal' to 'expedition' |
|
126 | 126 | $dataretrieved = dol_getcache($cachekey); |
127 | 127 | if (!is_null($dataretrieved)) { |
128 | 128 | $nbEvent = $dataretrieved; |
129 | 129 | } else { |
130 | 130 | $sql = "SELECT COUNT(id) as nb"; |
131 | - $sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm"; |
|
132 | - $sql .= " WHERE fk_element = " . ((int) $object->id); |
|
131 | + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm"; |
|
132 | + $sql .= " WHERE fk_element = ".((int) $object->id); |
|
133 | 133 | $sql .= " AND elementtype = 'shipping'"; // CHANGED: 'order' to 'shipping' |
134 | 134 | $resql = $db->query($sql); |
135 | 135 | if ($resql) { |
136 | 136 | $obj = $db->fetch_object($resql); |
137 | 137 | $nbEvent = $obj->nb; |
138 | 138 | } else { |
139 | - dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR); |
|
139 | + dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); |
|
140 | 140 | } |
141 | - dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
141 | + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | $head[$h][1] .= '/'; |
145 | 145 | $head[$h][1] .= $langs->trans("Agenda"); |
146 | 146 | if ($nbEvent > 0) { |
147 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbEvent . '</span>'; |
|
147 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>'; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | $head[$h][2] = 'agenda'; |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | $head = array(); |
180 | 180 | |
181 | 181 | if (getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) { |
182 | - $head[$h][0] = DOL_URL_ROOT . "/expedition/card.php?id=" . $object->origin_id; |
|
182 | + $head[$h][0] = DOL_URL_ROOT."/expedition/card.php?id=".$object->origin_id; |
|
183 | 183 | $head[$h][1] = $langs->trans("SendingCard"); |
184 | 184 | $head[$h][2] = 'shipping'; |
185 | 185 | $h++; |
186 | 186 | } |
187 | 187 | |
188 | - $head[$h][0] = DOL_URL_ROOT . "/delivery/card.php?id=" . $object->id; |
|
188 | + $head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".$object->id; |
|
189 | 189 | $head[$h][1] = $langs->trans("DeliveryCard"); |
190 | 190 | $head[$h][2] = 'delivery'; |
191 | 191 | $h++; |
@@ -214,24 +214,24 @@ discard block |
||
214 | 214 | $objectsrc->fetch($tmpobject->origin_id); |
215 | 215 | } |
216 | 216 | $nbContact = count($objectsrc->liste_contact(-1, 'internal')) + count($objectsrc->liste_contact(-1, 'external')); |
217 | - $head[$h][0] = DOL_URL_ROOT . "/expedition/contact.php?id=" . $tmpobject->id; |
|
217 | + $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$tmpobject->id; |
|
218 | 218 | $head[$h][1] = $langs->trans("ContactsAddresses"); |
219 | 219 | if ($nbContact > 0) { |
220 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>'; |
|
220 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>'; |
|
221 | 221 | } |
222 | 222 | $head[$h][2] = 'contact'; |
223 | 223 | $h++; |
224 | 224 | } |
225 | 225 | |
226 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
227 | - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; |
|
228 | - $upload_dir = $conf->expedition->dir_output . "/sending/" . dol_sanitizeFileName($tmpobject->ref); |
|
226 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
227 | + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
228 | + $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($tmpobject->ref); |
|
229 | 229 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
230 | 230 | $nbLinks = Link::count($db, $tmpobject->element, $tmpobject->id); |
231 | - $head[$h][0] = DOL_URL_ROOT . '/expedition/document.php?id=' . $tmpobject->id; |
|
231 | + $head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$tmpobject->id; |
|
232 | 232 | $head[$h][1] = $langs->trans('Documents'); |
233 | 233 | if (($nbFiles + $nbLinks) > 0) { |
234 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>'; |
|
234 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
235 | 235 | } |
236 | 236 | $head[$h][2] = 'documents'; |
237 | 237 | $h++; |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | if (!empty($tmpobject->note_public)) { |
244 | 244 | $nbNote++; |
245 | 245 | } |
246 | - $head[$h][0] = DOL_URL_ROOT . "/expedition/note.php?id=" . $tmpobject->id; |
|
246 | + $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$tmpobject->id; |
|
247 | 247 | $head[$h][1] = $langs->trans("Notes"); |
248 | 248 | if ($nbNote > 0) { |
249 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>'; |
|
249 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
250 | 250 | } |
251 | 251 | $head[$h][2] = 'note'; |
252 | 252 | $h++; |
@@ -283,16 +283,16 @@ discard block |
||
283 | 283 | $sql .= " e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition, e.billed, e.fk_statut as status, e.signed_status,"; |
284 | 284 | $sql .= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch,'; |
285 | 285 | $sql .= ' p.description as product_desc'; |
286 | - $sql .= " FROM " . MAIN_DB_PREFIX . "expeditiondet as ed,"; |
|
287 | - $sql .= " " . MAIN_DB_PREFIX . "expedition as e,"; |
|
288 | - $sql .= " " . MAIN_DB_PREFIX . $origin . "det as obj"; // for example llx_commandedet |
|
289 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON obj.fk_product = p.rowid"; |
|
286 | + $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed,"; |
|
287 | + $sql .= " ".MAIN_DB_PREFIX."expedition as e,"; |
|
288 | + $sql .= " ".MAIN_DB_PREFIX.$origin."det as obj"; // for example llx_commandedet |
|
289 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; |
|
290 | 290 | //TODO Add link to expeditiondet_batch |
291 | - $sql .= " WHERE e.entity IN (" . getEntity('expedition') . ")"; |
|
292 | - $sql .= " AND obj.fk_" . $origin . " = " . ((int) $origin_id); |
|
291 | + $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; |
|
292 | + $sql .= " AND obj.fk_".$origin." = ".((int) $origin_id); |
|
293 | 293 | $sql .= " AND obj.rowid = ed.fk_elementdet"; |
294 | 294 | if (isModEnabled('subtotals')) { |
295 | - $sql .= " AND obj.special_code <> " . SUBTOTALS_SPECIAL_CODE; |
|
295 | + $sql .= " AND obj.special_code <> ".SUBTOTALS_SPECIAL_CODE; |
|
296 | 296 | } |
297 | 297 | $sql .= " AND ed.fk_expedition = e.rowid"; |
298 | 298 | if ($filter) { |
@@ -317,13 +317,13 @@ discard block |
||
317 | 317 | print '<table class="liste centpercent">'; |
318 | 318 | print '<tr class="liste_titre">'; |
319 | 319 | //print '<td class="left">'.$langs->trans("QtyOrdered").'</td>'; |
320 | - print '<td>' . $langs->trans("SendingSheet") . '</td>'; |
|
321 | - print '<td>' . $langs->trans("Description") . '</td>'; |
|
322 | - print '<td class="center">' . $langs->trans("DateCreation") . '</td>'; |
|
323 | - print '<td class="center">' . $langs->trans("DateDeliveryPlanned") . '</td>'; |
|
324 | - print '<td class="center">' . $langs->trans("QtyPreparedOrShipped") . '</td>'; |
|
320 | + print '<td>'.$langs->trans("SendingSheet").'</td>'; |
|
321 | + print '<td>'.$langs->trans("Description").'</td>'; |
|
322 | + print '<td class="center">'.$langs->trans("DateCreation").'</td>'; |
|
323 | + print '<td class="center">'.$langs->trans("DateDeliveryPlanned").'</td>'; |
|
324 | + print '<td class="center">'.$langs->trans("QtyPreparedOrShipped").'</td>'; |
|
325 | 325 | if (isModEnabled('stock')) { |
326 | - print '<td>' . $langs->trans("Warehouse") . '</td>'; |
|
326 | + print '<td>'.$langs->trans("Warehouse").'</td>'; |
|
327 | 327 | } |
328 | 328 | /*TODO Add link to expeditiondet_batch |
329 | 329 | if (isModEnabled('productbatch')) |
@@ -332,9 +332,9 @@ discard block |
||
332 | 332 | print '</td>'; |
333 | 333 | }*/ |
334 | 334 | if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) { |
335 | - print '<td>' . $langs->trans("DeliveryOrder") . '</td>'; |
|
335 | + print '<td>'.$langs->trans("DeliveryOrder").'</td>'; |
|
336 | 336 | //print '<td class="center">'.$langs->trans("QtyReceived").'</td>'; |
337 | - print '<td class="right">' . $langs->trans("DeliveryDate") . '</td>'; |
|
337 | + print '<td class="right">'.$langs->trans("DeliveryDate").'</td>'; |
|
338 | 338 | } |
339 | 339 | print "</tr>\n"; |
340 | 340 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $product_static->status_batch = $objp->product_tobatch; |
397 | 397 | |
398 | 398 | $text = $product_static->getNomUrl(1); |
399 | - $text .= ' - ' . $label; |
|
399 | + $text .= ' - '.$label; |
|
400 | 400 | $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); |
401 | 401 | print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i); |
402 | 402 | |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | |
406 | 406 | // Add description in form |
407 | 407 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { |
408 | - print(!empty($objp->description) ? ((empty($objp->product) || $objp->description != $objp->product) ? '<br>' . dol_htmlentitiesbr($objp->description) : '') : ''); |
|
408 | + print(!empty($objp->description) ? ((empty($objp->product) || $objp->description != $objp->product) ? '<br>'.dol_htmlentitiesbr($objp->description) : '') : ''); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | print '</td>'; |
@@ -418,10 +418,10 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | if (!empty($objp->label)) { |
421 | - $text .= ' <strong>' . $objp->label . '</strong>'; |
|
421 | + $text .= ' <strong>'.$objp->label.'</strong>'; |
|
422 | 422 | print $form->textwithtooltip($text, $objp->description, 3, 0, '', (string) $i); |
423 | 423 | } else { |
424 | - print $text . ' ' . nl2br($objp->description); |
|
424 | + print $text.' '.nl2br($objp->description); |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | // Show range |
@@ -432,13 +432,13 @@ discard block |
||
432 | 432 | //print '<td class="center">'.$objp->qty_asked.'</td>'; |
433 | 433 | |
434 | 434 | // Date creation |
435 | - print '<td class="nowrap center">' . dol_print_date($db->jdate($objp->date_creation), 'day') . '</td>'; |
|
435 | + print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->date_creation), 'day').'</td>'; |
|
436 | 436 | |
437 | 437 | // Date shipping creation |
438 | - print '<td class="nowrap center">' . dol_print_date($db->jdate($objp->date_delivery), 'day') . '</td>'; |
|
438 | + print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->date_delivery), 'day').'</td>'; |
|
439 | 439 | |
440 | 440 | // Qty shipped |
441 | - print '<td class="center">' . $objp->qty_shipped . '</td>'; |
|
441 | + print '<td class="center">'.$objp->qty_shipped.'</td>'; |
|
442 | 442 | |
443 | 443 | // Warehouse |
444 | 444 | if (isModEnabled('stock')) { |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | |
485 | 485 | // Information on receipt |
486 | 486 | if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) { |
487 | - include_once DOL_DOCUMENT_ROOT . '/delivery/class/delivery.class.php'; |
|
487 | + include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; |
|
488 | 488 | $expedition->fetchObjectLinked($expedition->id, $expedition->element, null, 'delivery'); |
489 | 489 | //var_dump($expedition->linkedObjects); |
490 | 490 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $h = 0; |
49 | 49 | $head = array(); |
50 | 50 | |
51 | - $head[$h][0] = DOL_URL_ROOT . '/societe/card.php?socid=' . $object->id; |
|
51 | + $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id; |
|
52 | 52 | $head[$h][1] = $langs->trans("ThirdParty"); |
53 | 53 | $head[$h][2] = 'card'; |
54 | 54 | $h++; |
@@ -58,21 +58,21 @@ discard block |
||
58 | 58 | //$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); |
59 | 59 | $nbContact = 0; |
60 | 60 | // Enable caching of thirdrparty count Contacts |
61 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
62 | - $cachekey = 'count_contacts_thirdparty_' . $object->id; |
|
61 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
62 | + $cachekey = 'count_contacts_thirdparty_'.$object->id; |
|
63 | 63 | $dataretrieved = dol_getcache($cachekey); |
64 | 64 | |
65 | 65 | if (!is_null($dataretrieved)) { |
66 | 66 | $nbContact = $dataretrieved; |
67 | 67 | } else { |
68 | 68 | $sql = "SELECT COUNT(p.rowid) as nb"; |
69 | - $sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as p"; |
|
69 | + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; |
|
70 | 70 | // Add table from hooks |
71 | 71 | $parameters = array('contacttab' => true); |
72 | 72 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook |
73 | 73 | $sql .= $hookmanager->resPrint; |
74 | - $sql .= " WHERE p.fk_soc = " . ((int) $object->id); |
|
75 | - $sql .= " AND p.entity IN (" . getEntity($object->element) . ")"; |
|
74 | + $sql .= " WHERE p.fk_soc = ".((int) $object->id); |
|
75 | + $sql .= " AND p.entity IN (".getEntity($object->element).")"; |
|
76 | 76 | // Add where from hooks |
77 | 77 | $parameters = array('contacttab' => true); |
78 | 78 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -83,31 +83,31 @@ discard block |
||
83 | 83 | $nbContact = $obj->nb; |
84 | 84 | } |
85 | 85 | |
86 | - dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
86 | + dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
87 | 87 | } |
88 | 88 | |
89 | - $head[$h][0] = DOL_URL_ROOT . '/societe/contact.php?socid=' . $object->id; |
|
89 | + $head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id; |
|
90 | 90 | $head[$h][1] = $langs->trans('ContactsAddresses'); |
91 | 91 | if ($nbContact > 0) { |
92 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>'; |
|
92 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>'; |
|
93 | 93 | } |
94 | 94 | $head[$h][2] = 'contact'; |
95 | 95 | $h++; |
96 | 96 | } |
97 | 97 | if (getDolGlobalString('MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES')) { |
98 | 98 | // Some features may be unstable with this option, like permissions rules, import contact, ... |
99 | - $head[$h][0] = DOL_URL_ROOT . '/societe/societecontact.php?socid=' . $object->id; |
|
99 | + $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; |
|
100 | 100 | $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); |
101 | 101 | $head[$h][1] = $langs->trans("ContactsAddressesExt"); |
102 | 102 | if ($nbContact > 0) { |
103 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbContact . '</span>'; |
|
103 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>'; |
|
104 | 104 | } |
105 | 105 | $head[$h][2] = 'contactext'; |
106 | 106 | $h++; |
107 | 107 | } |
108 | 108 | |
109 | 109 | if ($object->client == 1 || $object->client == 2 || $object->client == 3) { |
110 | - $head[$h][0] = DOL_URL_ROOT . '/comm/card.php?socid=' . $object->id; |
|
110 | + $head[$h][0] = DOL_URL_ROOT.'/comm/card.php?socid='.$object->id; |
|
111 | 111 | $head[$h][1] = ''; |
112 | 112 | if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && ($object->client == 2 || $object->client == 3)) { |
113 | 113 | $head[$h][1] .= $langs->trans("Prospect"); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { |
125 | 125 | $langs->load("products"); |
126 | 126 | // price |
127 | - $head[$h][0] = DOL_URL_ROOT . '/societe/price.php?socid=' . $object->id; |
|
127 | + $head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id; |
|
128 | 128 | $head[$h][1] = $langs->trans("CustomerPrices"); |
129 | 129 | $head[$h][2] = 'price'; |
130 | 130 | $h++; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $supplier_module_enabled = 1; |
136 | 136 | } |
137 | 137 | if ($supplier_module_enabled == 1 && $object->fournisseur && $user->hasRight('fournisseur', 'lire')) { |
138 | - $head[$h][0] = DOL_URL_ROOT . '/fourn/card.php?socid=' . $object->id; |
|
138 | + $head[$h][0] = DOL_URL_ROOT.'/fourn/card.php?socid='.$object->id; |
|
139 | 139 | $head[$h][1] = $langs->trans("Supplier"); |
140 | 140 | $head[$h][2] = 'supplier'; |
141 | 141 | $h++; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $mode = 'customer'; |
155 | 155 | } |
156 | 156 | |
157 | - $head[$h][0] = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?socid=' . $object->id . '&mode=' . $mode . '&type=sub&search_accountancy_code_start=' . $subledger_start_account . '&search_accountancy_code_end=' . $subledger_end_account; |
|
157 | + $head[$h][0] = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?socid='.$object->id.'&mode='.$mode.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account; |
|
158 | 158 | $head[$h][1] = $langs->trans("Accounting"); |
159 | 159 | $head[$h][2] = 'accounting'; |
160 | 160 | $h++; |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | if (isModEnabled('project') && ($user->hasRight('projet', 'lire'))) { |
164 | 164 | $nbProject = 0; |
165 | 165 | // Enable caching of thirdrparty count projects |
166 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
167 | - $cachekey = 'count_projects_thirdparty_' . $object->id; |
|
166 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
167 | + $cachekey = 'count_projects_thirdparty_'.$object->id; |
|
168 | 168 | $dataretrieved = dol_getcache($cachekey); |
169 | 169 | |
170 | 170 | if (!is_null($dataretrieved)) { |
171 | 171 | $nbProject = $dataretrieved; |
172 | 172 | } else { |
173 | 173 | $sql = "SELECT COUNT(n.rowid) as nb"; |
174 | - $sql .= " FROM " . MAIN_DB_PREFIX . "projet as n"; |
|
175 | - $sql .= " WHERE fk_soc = " . ((int) $object->id); |
|
176 | - $sql .= " AND entity IN (" . getEntity('project') . ")"; |
|
174 | + $sql .= " FROM ".MAIN_DB_PREFIX."projet as n"; |
|
175 | + $sql .= " WHERE fk_soc = ".((int) $object->id); |
|
176 | + $sql .= " AND entity IN (".getEntity('project').")"; |
|
177 | 177 | $resql = $db->query($sql); |
178 | 178 | if ($resql) { |
179 | 179 | $obj = $db->fetch_object($resql); |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | } else { |
182 | 182 | dol_print_error($db); |
183 | 183 | } |
184 | - dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
184 | + dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
185 | 185 | } |
186 | - $head[$h][0] = DOL_URL_ROOT . '/societe/project.php?socid=' . $object->id; |
|
186 | + $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; |
|
187 | 187 | $head[$h][1] = $langs->trans("Projects"); |
188 | 188 | if ($nbProject > 0) { |
189 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbProject . '</span>'; |
|
189 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbProject.'</span>'; |
|
190 | 190 | } |
191 | 191 | $head[$h][2] = 'project'; |
192 | 192 | $h++; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | // Tab to link resources |
196 | 196 | if (isModEnabled('resource') && getDolGlobalString('RESOURCE_ON_THIRDPARTIES')) { |
197 | - $head[$h][0] = DOL_URL_ROOT . '/resource/element_resource.php?element=societe&element_id=' . $object->id; |
|
197 | + $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id; |
|
198 | 198 | $head[$h][1] = $langs->trans("Resources"); |
199 | 199 | $head[$h][2] = 'resources'; |
200 | 200 | $h++; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | if ((isModEnabled('order') || isModEnabled('propal') || isModEnabled('invoice') || isModEnabled('intervention') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) |
205 | 205 | && !getDolGlobalString('THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB') |
206 | 206 | ) { |
207 | - $head[$h][0] = DOL_URL_ROOT . '/societe/consumption.php?socid=' . $object->id; |
|
207 | + $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; |
|
208 | 208 | $head[$h][1] = $langs->trans("Referers"); |
209 | 209 | $head[$h][2] = 'consumption'; |
210 | 210 | $h++; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $servicestatus = 1; |
225 | 225 | } |
226 | 226 | |
227 | - include_once DOL_DOCUMENT_ROOT . '/societe/class/societeaccount.class.php'; |
|
227 | + include_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; |
|
228 | 228 | $societeaccount = new SocieteAccount($db); |
229 | 229 | $stripecu = $societeaccount->getCustomerAccount($object->id, 'stripe', $servicestatus); // Get thirdparty cu_... |
230 | 230 | if ($stripecu) { |
@@ -233,12 +233,12 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | $sql = "SELECT COUNT(n.rowid) as nb"; |
236 | - $sql .= " FROM " . MAIN_DB_PREFIX . "societe_rib as n"; |
|
237 | - $sql .= " WHERE n.fk_soc = " . ((int) $object->id); |
|
236 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n"; |
|
237 | + $sql .= " WHERE n.fk_soc = ".((int) $object->id); |
|
238 | 238 | if (!isModEnabled('stripe')) { |
239 | 239 | $sql .= " AND n.stripe_card_ref IS NULL"; |
240 | 240 | } else { |
241 | - $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = " . ((int) $servicestatus) . "))"; |
|
241 | + $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))"; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $resql = $db->query($sql); |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | |
252 | 252 | //if (isModEnabled('stripe') && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number |
253 | 253 | |
254 | - $head[$h][0] = DOL_URL_ROOT . '/societe/paymentmodes.php?socid=' . urlencode((string) ($object->id)); |
|
254 | + $head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode((string) ($object->id)); |
|
255 | 255 | $head[$h][1] = $title; |
256 | 256 | if ($foundonexternalonlinesystem) { |
257 | 257 | $head[$h][1] .= '<span class="badge marginleftonlyshort">...</span>'; |
258 | 258 | } elseif ($nbBankAccount > 0) { |
259 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbBankAccount . '</span>'; |
|
259 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbBankAccount.'</span>'; |
|
260 | 260 | } |
261 | 261 | $head[$h][2] = 'rib'; |
262 | 262 | $h++; |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | $site_filter_list[] = 'dolibarr_portal'; |
272 | 272 | } |
273 | 273 | |
274 | - $head[$h][0] = DOL_URL_ROOT . '/societe/website.php?id=' . urlencode((string) ($object->id)); |
|
274 | + $head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode((string) ($object->id)); |
|
275 | 275 | $head[$h][1] = $langs->trans("WebSiteAccounts"); |
276 | 276 | $nbNote = 0; |
277 | 277 | $sql = "SELECT COUNT(n.rowid) as nb"; |
278 | - $sql .= " FROM " . MAIN_DB_PREFIX . "societe_account as n"; |
|
279 | - $sql .= " WHERE fk_soc = " . ((int) $object->id); |
|
280 | - $sql .= " AND entity IN (" . getEntity('thirdpartyaccount') . ")"; |
|
278 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe_account as n"; |
|
279 | + $sql .= " WHERE fk_soc = ".((int) $object->id); |
|
280 | + $sql .= " AND entity IN (".getEntity('thirdpartyaccount').")"; |
|
281 | 281 | if (!empty($site_filter_list)) { |
282 | - $sql .= " AND n.site IN (" . $db->sanitize("'" . implode("','", $site_filter_list) . "'", 1) . ")"; |
|
282 | + $sql .= " AND n.site IN (".$db->sanitize("'".implode("','", $site_filter_list)."'", 1).")"; |
|
283 | 283 | } |
284 | 284 | $resql = $db->query($sql); |
285 | 285 | if ($resql) { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | dol_print_error($db); |
290 | 290 | } |
291 | 291 | if ($nbNote > 0) { |
292 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>'; |
|
292 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
293 | 293 | } |
294 | 294 | $head[$h][2] = 'website'; |
295 | 295 | $h++; |
@@ -299,13 +299,13 @@ discard block |
||
299 | 299 | if ($user->hasRight('partnership', 'read')) { |
300 | 300 | $langs->load("partnership"); |
301 | 301 | $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; |
302 | - $head[$h][0] = DOL_URL_ROOT . '/partnership/partnership_list.php?socid=' . $object->id; |
|
302 | + $head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?socid='.$object->id; |
|
303 | 303 | $head[$h][1] = $langs->trans("Partnerships"); |
304 | 304 | $nbNote = 0; |
305 | 305 | $sql = "SELECT COUNT(n.rowid) as nb"; |
306 | - $sql .= " FROM " . MAIN_DB_PREFIX . "partnership as n"; |
|
307 | - $sql .= " WHERE fk_soc = " . ((int) $object->id); |
|
308 | - $sql .= " AND entity IN (" . getEntity('partnership') . ")"; |
|
306 | + $sql .= " FROM ".MAIN_DB_PREFIX."partnership as n"; |
|
307 | + $sql .= " WHERE fk_soc = ".((int) $object->id); |
|
308 | + $sql .= " AND entity IN (".getEntity('partnership').")"; |
|
309 | 309 | $resql = $db->query($sql); |
310 | 310 | if ($resql) { |
311 | 311 | $obj = $db->fetch_object($resql); |
@@ -314,11 +314,11 @@ discard block |
||
314 | 314 | dol_print_error($db); |
315 | 315 | } |
316 | 316 | if ($nbNote > 0) { |
317 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>'; |
|
317 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
318 | 318 | } |
319 | 319 | $head[$h][2] = 'partnerships'; |
320 | 320 | if ($nbPartnership > 0) { |
321 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbPartnership . '</span>'; |
|
321 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>'; |
|
322 | 322 | } |
323 | 323 | $h++; |
324 | 324 | } |
@@ -329,16 +329,16 @@ discard block |
||
329 | 329 | //$langs->load('ticket'); |
330 | 330 | $nbTicket = 0; |
331 | 331 | // Enable caching of thirdparty count notifications |
332 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
333 | - $cachekey = 'count_ticket_thirdparty_' . $object->id; |
|
332 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
333 | + $cachekey = 'count_ticket_thirdparty_'.$object->id; |
|
334 | 334 | $nbticketretreived = dol_getcache($cachekey); |
335 | 335 | if (!is_null($nbticketretreived)) { |
336 | 336 | $nbTicket = $nbticketretreived; |
337 | 337 | } else { |
338 | 338 | // List of notifications enabled for contacts of the third party |
339 | 339 | $sql = "SELECT COUNT(t.rowid) as nb"; |
340 | - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; |
|
341 | - $sql .= " WHERE t.fk_soc = " . ((int) $object->id); |
|
340 | + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; |
|
341 | + $sql .= " WHERE t.fk_soc = ".((int) $object->id); |
|
342 | 342 | $resql = $db->query($sql); |
343 | 343 | if ($resql) { |
344 | 344 | $obj = $db->fetch_object($resql); |
@@ -346,13 +346,13 @@ discard block |
||
346 | 346 | } else { |
347 | 347 | dol_print_error($db); |
348 | 348 | } |
349 | - dol_setcache($cachekey, $nbTicket, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
349 | + dol_setcache($cachekey, $nbTicket, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
350 | 350 | } |
351 | 351 | |
352 | - $head[$h][0] = DOL_URL_ROOT . '/ticket/list.php?socid=' . urlencode((string) ($object->id)); |
|
352 | + $head[$h][0] = DOL_URL_ROOT.'/ticket/list.php?socid='.urlencode((string) ($object->id)); |
|
353 | 353 | $head[$h][1] = $langs->trans("Tickets"); |
354 | 354 | if ($nbTicket > 0) { |
355 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbTicket . '</span>'; |
|
355 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbTicket.'</span>'; |
|
356 | 356 | } |
357 | 357 | $head[$h][2] = 'ticket'; |
358 | 358 | $h++; |
@@ -371,20 +371,20 @@ discard block |
||
371 | 371 | $langs->load('mails'); |
372 | 372 | $nbNotif = 0; |
373 | 373 | // Enable caching of thirdparty count notifications |
374 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
375 | - $cachekey = 'count_notifications_thirdparty_' . $object->id; |
|
374 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
375 | + $cachekey = 'count_notifications_thirdparty_'.$object->id; |
|
376 | 376 | $dataretrieved = dol_getcache($cachekey); |
377 | 377 | if (!is_null($dataretrieved)) { |
378 | 378 | $nbNotif = $dataretrieved; |
379 | 379 | } else { |
380 | 380 | // List of notifications enabled for contacts of the third party |
381 | 381 | $sql = "SELECT COUNT(n.rowid) as nb"; |
382 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_action_trigger as a,"; |
|
383 | - $sql .= " " . MAIN_DB_PREFIX . "notify_def as n,"; |
|
384 | - $sql .= " " . MAIN_DB_PREFIX . "socpeople as c"; |
|
382 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,"; |
|
383 | + $sql .= " ".MAIN_DB_PREFIX."notify_def as n,"; |
|
384 | + $sql .= " ".MAIN_DB_PREFIX."socpeople as c"; |
|
385 | 385 | $sql .= " WHERE a.rowid = n.fk_action"; |
386 | 386 | $sql .= " AND c.rowid = n.fk_contact"; |
387 | - $sql .= " AND c.fk_soc = " . ((int) $object->id); |
|
387 | + $sql .= " AND c.fk_soc = ".((int) $object->id); |
|
388 | 388 | $resql = $db->query($sql); |
389 | 389 | if ($resql) { |
390 | 390 | $obj = $db->fetch_object($resql); |
@@ -392,13 +392,13 @@ discard block |
||
392 | 392 | } else { |
393 | 393 | dol_print_error($db); |
394 | 394 | } |
395 | - dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
395 | + dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
396 | 396 | } |
397 | 397 | |
398 | - $head[$h][0] = DOL_URL_ROOT . '/societe/notify/card.php?socid=' . urlencode((string) ($object->id)); |
|
398 | + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode((string) ($object->id)); |
|
399 | 399 | $head[$h][1] = $langs->trans("Notifications"); |
400 | 400 | if ($nbNotif > 0) { |
401 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNotif . '</span>'; |
|
401 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNotif.'</span>'; |
|
402 | 402 | } |
403 | 403 | $head[$h][2] = 'notify'; |
404 | 404 | $h++; |
@@ -412,10 +412,10 @@ discard block |
||
412 | 412 | if (!empty($object->note_public)) { |
413 | 413 | $nbNote++; |
414 | 414 | } |
415 | - $head[$h][0] = DOL_URL_ROOT . '/societe/note.php?id=' . urlencode((string) ($object->id)); |
|
415 | + $head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.urlencode((string) ($object->id)); |
|
416 | 416 | $head[$h][1] = $langs->trans("Notes"); |
417 | 417 | if ($nbNote > 0) { |
418 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>'; |
|
418 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
419 | 419 | } |
420 | 420 | $head[$h][2] = 'note'; |
421 | 421 | $h++; |
@@ -423,59 +423,59 @@ discard block |
||
423 | 423 | // Attached files and Links |
424 | 424 | $totalAttached = 0; |
425 | 425 | // Enable caching of thirdrparty count attached files and links |
426 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
427 | - $cachekey = 'count_attached_thirdparty_' . $object->id; |
|
426 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
427 | + $cachekey = 'count_attached_thirdparty_'.$object->id; |
|
428 | 428 | $dataretrieved = dol_getcache($cachekey); |
429 | 429 | if (!is_null($dataretrieved)) { |
430 | 430 | $totalAttached = $dataretrieved; |
431 | 431 | } else { |
432 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
433 | - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; |
|
434 | - $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id; |
|
432 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
433 | + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
434 | + $upload_dir = $conf->societe->multidir_output[$object->entity]."/".$object->id; |
|
435 | 435 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
436 | 436 | $nbLinks = Link::count($db, $object->element, $object->id); |
437 | 437 | $totalAttached = $nbFiles + $nbLinks; |
438 | - dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
438 | + dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
439 | 439 | } |
440 | 440 | |
441 | - $head[$h][0] = DOL_URL_ROOT . '/societe/document.php?socid=' . $object->id; |
|
441 | + $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; |
|
442 | 442 | $head[$h][1] = $langs->trans("Documents"); |
443 | 443 | if (($totalAttached) > 0) { |
444 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($totalAttached) . '</span>'; |
|
444 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($totalAttached).'</span>'; |
|
445 | 445 | } |
446 | 446 | $head[$h][2] = 'document'; |
447 | 447 | $h++; |
448 | 448 | } |
449 | 449 | |
450 | - $head[$h][0] = DOL_URL_ROOT . '/societe/messaging.php?socid=' . $object->id; |
|
450 | + $head[$h][0] = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id; |
|
451 | 451 | $head[$h][1] = $langs->trans("Events"); |
452 | 452 | if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { |
453 | 453 | $nbEvent = 0; |
454 | 454 | // Enable caching of thirdparty count actioncomm |
455 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
456 | - $cachekey = 'count_events_thirdparty_' . $object->id; |
|
455 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
456 | + $cachekey = 'count_events_thirdparty_'.$object->id; |
|
457 | 457 | $dataretrieved = dol_getcache($cachekey); |
458 | 458 | if (!is_null($dataretrieved)) { |
459 | 459 | $nbEvent = $dataretrieved; |
460 | 460 | } else { |
461 | 461 | $sql = "SELECT COUNT(id) as nb"; |
462 | - $sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm"; |
|
463 | - $sql .= " WHERE fk_soc = " . ((int) $object->id); |
|
464 | - $sql .= " AND entity IN (" . getEntity('agenda') . ")"; |
|
462 | + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm"; |
|
463 | + $sql .= " WHERE fk_soc = ".((int) $object->id); |
|
464 | + $sql .= " AND entity IN (".getEntity('agenda').")"; |
|
465 | 465 | $resql = $db->query($sql); |
466 | 466 | if ($resql) { |
467 | 467 | $obj = $db->fetch_object($resql); |
468 | 468 | $nbEvent = $obj->nb; |
469 | 469 | } else { |
470 | - dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR); |
|
470 | + dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); |
|
471 | 471 | } |
472 | - dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
472 | + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | $head[$h][1] .= '/'; |
476 | 476 | $head[$h][1] .= $langs->trans("Agenda"); |
477 | 477 | if ($nbEvent > 0) { |
478 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbEvent . '</span>'; |
|
478 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>'; |
|
479 | 479 | } |
480 | 480 | } |
481 | 481 | $head[$h][2] = 'agenda'; |
@@ -505,12 +505,12 @@ discard block |
||
505 | 505 | $h = 0; |
506 | 506 | $head = array(); |
507 | 507 | |
508 | - $head[$h][0] = DOL_URL_ROOT . '/societe/card.php?socid=' . $object->id; |
|
508 | + $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id; |
|
509 | 509 | $head[$h][1] = $langs->trans("ThirdParty"); |
510 | 510 | $head[$h][2] = 'company'; |
511 | 511 | $h++; |
512 | 512 | |
513 | - $head[$h][0] = 'commerciaux.php?socid=' . $object->id; |
|
513 | + $head[$h][0] = 'commerciaux.php?socid='.$object->id; |
|
514 | 514 | $head[$h][1] = $langs->trans("SalesRepresentative"); |
515 | 515 | $head[$h][2] = 'salesrepresentative'; |
516 | 516 | $h++; |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | $h = 0; |
537 | 537 | $head = array(); |
538 | 538 | |
539 | - $head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe.php'; |
|
539 | + $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe.php'; |
|
540 | 540 | $head[$h][1] = $langs->trans("Miscellaneous"); |
541 | 541 | $head[$h][2] = 'general'; |
542 | 542 | $h++; |
@@ -547,20 +547,20 @@ discard block |
||
547 | 547 | // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
548 | 548 | complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin'); |
549 | 549 | |
550 | - $head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe_extrafields.php'; |
|
550 | + $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php'; |
|
551 | 551 | $head[$h][1] = $langs->trans("ExtraFieldsThirdParties"); |
552 | 552 | $nbExtrafields = $extrafields->attributes['societe']['count']; |
553 | 553 | if ($nbExtrafields > 0) { |
554 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>'; |
|
554 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>'; |
|
555 | 555 | } |
556 | 556 | $head[$h][2] = 'attributes'; |
557 | 557 | $h++; |
558 | 558 | |
559 | - $head[$h][0] = DOL_URL_ROOT . '/societe/admin/contact_extrafields.php'; |
|
559 | + $head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php'; |
|
560 | 560 | $head[$h][1] = $langs->trans("ExtraFieldsContacts"); |
561 | 561 | $nbExtrafields = $extrafields->attributes['socpeople']['count']; |
562 | 562 | if ($nbExtrafields > 0) { |
563 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>'; |
|
563 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>'; |
|
564 | 564 | } |
565 | 565 | $head[$h][2] = 'attributes_contacts'; |
566 | 566 | $h++; |
@@ -608,13 +608,13 @@ discard block |
||
608 | 608 | $outputlangs = $langs; |
609 | 609 | } |
610 | 610 | |
611 | - $sql = "SELECT rowid, code, label FROM " . MAIN_DB_PREFIX . "c_country"; |
|
611 | + $sql = "SELECT rowid, code, label FROM ".MAIN_DB_PREFIX."c_country"; |
|
612 | 612 | if (is_numeric($searchkey)) { |
613 | - $sql .= " WHERE rowid = " . ((int) $searchkey); |
|
613 | + $sql .= " WHERE rowid = ".((int) $searchkey); |
|
614 | 614 | } elseif (!empty($searchkey)) { |
615 | - $sql .= " WHERE code = '" . $db->escape($searchkey) . "'"; |
|
615 | + $sql .= " WHERE code = '".$db->escape($searchkey)."'"; |
|
616 | 616 | } else { |
617 | - $sql .= " WHERE label = '" . $db->escape($searchlabel) . "'"; |
|
617 | + $sql .= " WHERE label = '".$db->escape($searchlabel)."'"; |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | $resql = $dbtouse->query($sql); |
@@ -625,9 +625,9 @@ discard block |
||
625 | 625 | if (is_object($outputlangs)) { |
626 | 626 | $outputlangs->load("dict"); |
627 | 627 | if ($entconv) { |
628 | - $label = ($obj->code && ($outputlangs->trans("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->trans("Country" . $obj->code) : $label; |
|
628 | + $label = ($obj->code && ($outputlangs->trans("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->trans("Country".$obj->code) : $label; |
|
629 | 629 | } else { |
630 | - $label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->transnoentitiesnoconv("Country" . $obj->code) : $label; |
|
630 | + $label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->transnoentitiesnoconv("Country".$obj->code) : $label; |
|
631 | 631 | } |
632 | 632 | } |
633 | 633 | if ($withcode == '1') { |
@@ -676,8 +676,8 @@ discard block |
||
676 | 676 | } |
677 | 677 | |
678 | 678 | $sql = "SELECT d.rowid as id, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.code_region as region_code, r.nom as region_name FROM"; |
679 | - $sql .= " " . MAIN_DB_PREFIX . "c_departements as d, " . MAIN_DB_PREFIX . "c_regions as r," . MAIN_DB_PREFIX . "c_country as c"; |
|
680 | - $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and d.rowid=" . ((int) $id); |
|
679 | + $sql .= " ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c"; |
|
680 | + $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and d.rowid=".((int) $id); |
|
681 | 681 | $sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1"; |
682 | 682 | $sql .= " ORDER BY c.code, d.code_departement"; |
683 | 683 | |
@@ -690,21 +690,21 @@ discard block |
||
690 | 690 | if (is_object($outputlangs)) { |
691 | 691 | $outputlangs->load("dict"); |
692 | 692 | if ($entconv) { |
693 | - $label = ($obj->code && ($outputlangs->trans("State" . $obj->code) != "State" . $obj->code)) ? $outputlangs->trans("State" . $obj->code) : $label; |
|
693 | + $label = ($obj->code && ($outputlangs->trans("State".$obj->code) != "State".$obj->code)) ? $outputlangs->trans("State".$obj->code) : $label; |
|
694 | 694 | } else { |
695 | - $label = ($obj->code && ($outputlangs->transnoentitiesnoconv("State" . $obj->code) != "State" . $obj->code)) ? $outputlangs->transnoentitiesnoconv("State" . $obj->code) : $label; |
|
695 | + $label = ($obj->code && ($outputlangs->transnoentitiesnoconv("State".$obj->code) != "State".$obj->code)) ? $outputlangs->transnoentitiesnoconv("State".$obj->code) : $label; |
|
696 | 696 | } |
697 | 697 | } |
698 | 698 | |
699 | 699 | if ($withcode == 1) { |
700 | 700 | if ($withregion == 1) { |
701 | - return $label = $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
701 | + return $label = $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
702 | 702 | } else { |
703 | - return $label = $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
703 | + return $label = $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
704 | 704 | } |
705 | 705 | } elseif ($withcode == 2) { |
706 | 706 | if ($withregion == 1) { |
707 | - return $label = $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
707 | + return $label = $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
708 | 708 | } else { |
709 | 709 | return $label = ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
710 | 710 | } |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | } |
717 | 717 | } else { |
718 | 718 | if ($withregion == 1) { |
719 | - return $label = $obj->region_name . ' - ' . $label; |
|
719 | + return $label = $obj->region_name.' - '.$label; |
|
720 | 720 | } else { |
721 | 721 | return $label; |
722 | 722 | } |
@@ -750,13 +750,13 @@ discard block |
||
750 | 750 | $outputlangs->load("dict"); |
751 | 751 | |
752 | 752 | // If there is a translation, we can send immediately the label |
753 | - if ($outputlangs->trans("Currency" . $code_iso) != "Currency" . $code_iso) { |
|
754 | - return ($withcode ? $code_iso . ' - ' : '') . $outputlangs->trans("Currency" . $code_iso); |
|
753 | + if ($outputlangs->trans("Currency".$code_iso) != "Currency".$code_iso) { |
|
754 | + return ($withcode ? $code_iso.' - ' : '').$outputlangs->trans("Currency".$code_iso); |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | // If no translation, we read table to get label by default |
758 | - $sql = "SELECT label FROM " . MAIN_DB_PREFIX . "c_currencies"; |
|
759 | - $sql .= " WHERE code_iso='" . $db->escape($code_iso) . "'"; |
|
758 | + $sql = "SELECT label FROM ".MAIN_DB_PREFIX."c_currencies"; |
|
759 | + $sql .= " WHERE code_iso='".$db->escape($code_iso)."'"; |
|
760 | 760 | |
761 | 761 | $resql = $db->query($sql); |
762 | 762 | if ($resql) { |
@@ -792,12 +792,12 @@ discard block |
||
792 | 792 | return ''; |
793 | 793 | } |
794 | 794 | |
795 | - if (!empty($conf->cache["legalform_" . $langs->defaultlang . '_' . $code])) { |
|
796 | - return $conf->cache["legalform_" . $langs->defaultlang . '_' . $code]; |
|
795 | + if (!empty($conf->cache["legalform_".$langs->defaultlang.'_'.$code])) { |
|
796 | + return $conf->cache["legalform_".$langs->defaultlang.'_'.$code]; |
|
797 | 797 | } |
798 | 798 | |
799 | - $sql = "SELECT libelle as label FROM " . MAIN_DB_PREFIX . "c_forme_juridique"; |
|
800 | - $sql .= " WHERE code = '" . $db->escape($code) . "'"; |
|
799 | + $sql = "SELECT libelle as label FROM ".MAIN_DB_PREFIX."c_forme_juridique"; |
|
800 | + $sql .= " WHERE code = '".$db->escape($code)."'"; |
|
801 | 801 | |
802 | 802 | dol_syslog("Company.lib::getFormeJuridiqueLabel", LOG_DEBUG); |
803 | 803 | |
@@ -809,14 +809,14 @@ discard block |
||
809 | 809 | |
810 | 810 | $label = ($obj->label != '-' ? $obj->label : ''); |
811 | 811 | |
812 | - $conf->cache["legalform_" . $langs->defaultlang . '_' . $code] = $label; |
|
812 | + $conf->cache["legalform_".$langs->defaultlang.'_'.$code] = $label; |
|
813 | 813 | |
814 | 814 | return $langs->trans($label); |
815 | 815 | } else { |
816 | 816 | return $langs->trans("NotDefined"); |
817 | 817 | } |
818 | 818 | } else { |
819 | - return 'Error ' . $db->lasterror(); |
|
819 | + return 'Error '.$db->lasterror(); |
|
820 | 820 | } |
821 | 821 | } |
822 | 822 | |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | // Use of cache to reduce number of database requests |
839 | 839 | $country_code_in_EEC = $conf->cache['country_code_in_EEC']; |
840 | 840 | } else { |
841 | - $sql = "SELECT cc.code FROM " . MAIN_DB_PREFIX . "c_country as cc"; |
|
841 | + $sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc"; |
|
842 | 842 | $sql .= " WHERE cc.eec = 1"; |
843 | 843 | |
844 | 844 | $resql = $db->query($sql); |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | return false; |
871 | 871 | } |
872 | 872 | |
873 | - $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
873 | + $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
874 | 874 | |
875 | 875 | //print "dd".$object->country_code; |
876 | 876 | return in_array($object->country_code, $country_code_in_EEC); |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | // Use of cache to reduce number of database requests |
894 | 894 | $country_code_in_SEPA = $conf->cache['country_code_in_SEPA']; |
895 | 895 | } else { |
896 | - $sql = "SELECT cc.code FROM " . MAIN_DB_PREFIX . "c_country as cc"; |
|
896 | + $sql = "SELECT cc.code FROM ".MAIN_DB_PREFIX."c_country as cc"; |
|
897 | 897 | $sql .= " WHERE cc.sepa = 1"; |
898 | 898 | |
899 | 899 | $resql = $db->query($sql); |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | return false; |
926 | 926 | } |
927 | 927 | |
928 | - $country_code_in_SEPA = getCountriesInSEPA(); // This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA'] |
|
928 | + $country_code_in_SEPA = getCountriesInSEPA(); // This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA'] |
|
929 | 929 | |
930 | 930 | //print "dd".$object->country_code; |
931 | 931 | return in_array($object->country_code, $country_code_in_SEPA); |
@@ -955,21 +955,21 @@ discard block |
||
955 | 955 | |
956 | 956 | $newcardbutton = ''; |
957 | 957 | if (isModEnabled('project') && $user->hasRight('projet', 'creer') && empty($nocreatelink)) { |
958 | - $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/projet/card.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage)); |
|
958 | + $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); |
|
959 | 959 | } |
960 | 960 | |
961 | 961 | print "\n"; |
962 | - print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $newcardbutton . $morehtmlright, ''); |
|
962 | + print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $newcardbutton.$morehtmlright, ''); |
|
963 | 963 | |
964 | - print '<div class="div-table-responsive">' . "\n"; |
|
964 | + print '<div class="div-table-responsive">'."\n"; |
|
965 | 965 | print '<table class="noborder centpercent">'; |
966 | 966 | |
967 | 967 | $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount"; |
968 | 968 | $sql .= ", cls.code as opp_status_code"; |
969 | - $sql .= " FROM " . MAIN_DB_PREFIX . "projet as p"; |
|
970 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_lead_status as cls on p.fk_opp_status = cls.rowid"; |
|
971 | - $sql .= " WHERE p.fk_soc = " . ((int) $object->id); |
|
972 | - $sql .= " AND p.entity IN (" . getEntity('project') . ")"; |
|
969 | + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; |
|
970 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; |
|
971 | + $sql .= " WHERE p.fk_soc = ".((int) $object->id); |
|
972 | + $sql .= " AND p.entity IN (".getEntity('project').")"; |
|
973 | 973 | $sql .= " ORDER BY p.dateo DESC"; |
974 | 974 | |
975 | 975 | $result = $db->query($sql); |
@@ -983,14 +983,14 @@ discard block |
||
983 | 983 | print $selectedfields; |
984 | 984 | print '</td>'; |
985 | 985 | } |
986 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
987 | - print '<td>' . $langs->trans("Name") . '</td>'; |
|
988 | - print '<td class="center">' . $langs->trans("DateStart") . '</td>'; |
|
989 | - print '<td class="center">' . $langs->trans("DateEnd") . '</td>'; |
|
990 | - print '<td class="right">' . $langs->trans("OpportunityAmountShort") . '</td>'; |
|
991 | - print '<td class="center">' . $langs->trans("OpportunityStatusShort") . '</td>'; |
|
992 | - print '<td class="right">' . $langs->trans("OpportunityProbabilityShort") . '</td>'; |
|
993 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
986 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
987 | + print '<td>'.$langs->trans("Name").'</td>'; |
|
988 | + print '<td class="center">'.$langs->trans("DateStart").'</td>'; |
|
989 | + print '<td class="center">'.$langs->trans("DateEnd").'</td>'; |
|
990 | + print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>'; |
|
991 | + print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>'; |
|
992 | + print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>'; |
|
993 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
994 | 994 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
995 | 995 | print '<td class="center">'; |
996 | 996 | $selectedfields = (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
@@ -1000,7 +1000,7 @@ discard block |
||
1000 | 1000 | print '</tr>'; |
1001 | 1001 | |
1002 | 1002 | if ($num > 0) { |
1003 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
1003 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
1004 | 1004 | |
1005 | 1005 | $projecttmp = new Project($db); |
1006 | 1006 | |
@@ -1023,41 +1023,41 @@ discard block |
||
1023 | 1023 | if (in_array($obj->id, $arrayofselected)) { |
1024 | 1024 | $selected = 1; |
1025 | 1025 | } |
1026 | - print '<input id="cb' . $obj->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj->id . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
1026 | + print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
1027 | 1027 | } |
1028 | 1028 | print '</td>'; |
1029 | 1029 | } |
1030 | 1030 | // Ref |
1031 | 1031 | print '<td class="nowraponall">'; |
1032 | - print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:' . $_SERVER["PHP_SELF"] . '?socid=__SOCID__'); |
|
1032 | + print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__'); |
|
1033 | 1033 | print '</td>'; |
1034 | 1034 | |
1035 | 1035 | // Label |
1036 | - print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->title) . '">' . dol_escape_htmltag($obj->title) . '</td>'; |
|
1036 | + print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>'; |
|
1037 | 1037 | // Date start |
1038 | - print '<td class="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>'; |
|
1038 | + print '<td class="center">'.dol_print_date($db->jdate($obj->do), "day").'</td>'; |
|
1039 | 1039 | // Date end |
1040 | - print '<td class="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>'; |
|
1040 | + print '<td class="center">'.dol_print_date($db->jdate($obj->de), "day").'</td>'; |
|
1041 | 1041 | // Opp amount |
1042 | 1042 | print '<td class="right">'; |
1043 | 1043 | if ($obj->opp_status_code) { |
1044 | - print '<span class="amount">' . price($obj->opp_amount, 1, '', 1, -1, -1, '') . '</span>'; |
|
1044 | + print '<span class="amount">'.price($obj->opp_amount, 1, '', 1, -1, -1, '').'</span>'; |
|
1045 | 1045 | } |
1046 | 1046 | print '</td>'; |
1047 | 1047 | // Opp status |
1048 | 1048 | print '<td class="center">'; |
1049 | 1049 | if ($obj->opp_status_code) { |
1050 | - print $langs->trans("OppStatus" . $obj->opp_status_code); |
|
1050 | + print $langs->trans("OppStatus".$obj->opp_status_code); |
|
1051 | 1051 | } |
1052 | 1052 | print '</td>'; |
1053 | 1053 | // Opp percent |
1054 | 1054 | print '<td class="right">'; |
1055 | 1055 | if ($obj->opp_percent) { |
1056 | - print price($obj->opp_percent, 1, '', 1, 0) . '%'; |
|
1056 | + print price($obj->opp_percent, 1, '', 1, 0).'%'; |
|
1057 | 1057 | } |
1058 | 1058 | print '</td>'; |
1059 | 1059 | // Status |
1060 | - print '<td class="right">' . $projecttmp->getLibStatut(5) . '</td>'; |
|
1060 | + print '<td class="right">'.$projecttmp->getLibStatut(5).'</td>'; |
|
1061 | 1061 | |
1062 | 1062 | // Action column |
1063 | 1063 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -1067,7 +1067,7 @@ discard block |
||
1067 | 1067 | if (in_array($obj->id, $arrayofselected)) { |
1068 | 1068 | $selected = 1; |
1069 | 1069 | } |
1070 | - print '<input id="cb' . $obj->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj->id . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
1070 | + print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
1071 | 1071 | } |
1072 | 1072 | print '</td>'; |
1073 | 1073 | } |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | $i++; |
1077 | 1077 | } |
1078 | 1078 | } else { |
1079 | - print '<tr class="oddeven"><td colspan="9"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
1079 | + print '<tr class="oddeven"><td colspan="9"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
1080 | 1080 | } |
1081 | 1081 | $db->free($result); |
1082 | 1082 | } else { |
@@ -1089,18 +1089,18 @@ discard block |
||
1089 | 1089 | print load_fiche_titre($langs->trans("ProjectsLinkedToThisThirdParty"), '', ''); |
1090 | 1090 | |
1091 | 1091 | |
1092 | - print '<div class="div-table-responsive">' . "\n"; |
|
1092 | + print '<div class="div-table-responsive">'."\n"; |
|
1093 | 1093 | print '<table class="noborder centpercent">'; |
1094 | 1094 | |
1095 | 1095 | $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; |
1096 | 1096 | $sql .= ", cls.code as opp_status_code"; |
1097 | - $sql .= " FROM " . MAIN_DB_PREFIX . "projet as p"; |
|
1098 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_lead_status as cls on p.fk_opp_status = cls.rowid"; |
|
1099 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "element_contact as ec on p.rowid = ec.element_id"; |
|
1100 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sc on ec.fk_socpeople = sc.rowid"; |
|
1101 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc on ec.fk_c_type_contact = tc.rowid"; |
|
1102 | - $sql .= " WHERE sc.fk_soc = " . ((int) $object->id); |
|
1103 | - $sql .= " AND p.entity IN (" . getEntity('project') . ")"; |
|
1097 | + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; |
|
1098 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; |
|
1099 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec on p.rowid = ec.element_id"; |
|
1100 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sc on ec.fk_socpeople = sc.rowid"; |
|
1101 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid"; |
|
1102 | + $sql .= " WHERE sc.fk_soc = ".((int) $object->id); |
|
1103 | + $sql .= " AND p.entity IN (".getEntity('project').")"; |
|
1104 | 1104 | $sql .= " AND tc.element = 'project' AND tc.source = 'external'"; |
1105 | 1105 | $sql .= " ORDER BY p.dateo DESC"; |
1106 | 1106 | |
@@ -1109,18 +1109,18 @@ discard block |
||
1109 | 1109 | $num = $db->num_rows($result); |
1110 | 1110 | |
1111 | 1111 | print '<tr class="liste_titre">'; |
1112 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
1113 | - print '<td>' . $langs->trans("Name") . '</td>'; |
|
1114 | - print '<td class="center">' . $langs->trans("DateStart") . '</td>'; |
|
1115 | - print '<td class="center">' . $langs->trans("DateEnd") . '</td>'; |
|
1116 | - print '<td class="right">' . $langs->trans("OpportunityAmountShort") . '</td>'; |
|
1117 | - print '<td class="center">' . $langs->trans("OpportunityStatusShort") . '</td>'; |
|
1118 | - print '<td class="right">' . $langs->trans("OpportunityProbabilityShort") . '</td>'; |
|
1119 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
1112 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
1113 | + print '<td>'.$langs->trans("Name").'</td>'; |
|
1114 | + print '<td class="center">'.$langs->trans("DateStart").'</td>'; |
|
1115 | + print '<td class="center">'.$langs->trans("DateEnd").'</td>'; |
|
1116 | + print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>'; |
|
1117 | + print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>'; |
|
1118 | + print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>'; |
|
1119 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
1120 | 1120 | print '</tr>'; |
1121 | 1121 | |
1122 | 1122 | if ($num > 0) { |
1123 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
1123 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
1124 | 1124 | |
1125 | 1125 | $projecttmp = new Project($db); |
1126 | 1126 | |
@@ -1138,42 +1138,42 @@ discard block |
||
1138 | 1138 | |
1139 | 1139 | // Ref |
1140 | 1140 | print '<td class="nowraponall">'; |
1141 | - print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:' . $_SERVER["PHP_SELF"] . '?socid=__SOCID__'); |
|
1141 | + print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__'); |
|
1142 | 1142 | print '</td>'; |
1143 | 1143 | |
1144 | 1144 | // Label |
1145 | - print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->title) . '">' . dol_escape_htmltag($obj->title) . '</td>'; |
|
1145 | + print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">'.dol_escape_htmltag($obj->title).'</td>'; |
|
1146 | 1146 | // Date start |
1147 | - print '<td class="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>'; |
|
1147 | + print '<td class="center">'.dol_print_date($db->jdate($obj->do), "day").'</td>'; |
|
1148 | 1148 | // Date end |
1149 | - print '<td class="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>'; |
|
1149 | + print '<td class="center">'.dol_print_date($db->jdate($obj->de), "day").'</td>'; |
|
1150 | 1150 | // Opp amount |
1151 | 1151 | print '<td class="right">'; |
1152 | 1152 | if ($obj->opp_status_code) { |
1153 | - print '<span class="amount">' . price($obj->opp_amount, 1, '', 1, -1, -1, '') . '</span>'; |
|
1153 | + print '<span class="amount">'.price($obj->opp_amount, 1, '', 1, -1, -1, '').'</span>'; |
|
1154 | 1154 | } |
1155 | 1155 | print '</td>'; |
1156 | 1156 | // Opp status |
1157 | 1157 | print '<td class="center">'; |
1158 | 1158 | if ($obj->opp_status_code) { |
1159 | - print $langs->trans("OppStatus" . $obj->opp_status_code); |
|
1159 | + print $langs->trans("OppStatus".$obj->opp_status_code); |
|
1160 | 1160 | } |
1161 | 1161 | print '</td>'; |
1162 | 1162 | // Opp percent |
1163 | 1163 | print '<td class="right">'; |
1164 | 1164 | if ($obj->opp_percent) { |
1165 | - print price($obj->opp_percent, 1, '', 1, 0) . '%'; |
|
1165 | + print price($obj->opp_percent, 1, '', 1, 0).'%'; |
|
1166 | 1166 | } |
1167 | 1167 | print '</td>'; |
1168 | 1168 | // Status |
1169 | - print '<td class="right">' . $projecttmp->getLibStatut(5) . '</td>'; |
|
1169 | + print '<td class="right">'.$projecttmp->getLibStatut(5).'</td>'; |
|
1170 | 1170 | |
1171 | 1171 | print '</tr>'; |
1172 | 1172 | } |
1173 | 1173 | $i++; |
1174 | 1174 | } |
1175 | 1175 | } else { |
1176 | - print '<tr class="oddeven"><td colspan="8"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
1176 | + print '<tr class="oddeven"><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
1177 | 1177 | } |
1178 | 1178 | $db->free($result); |
1179 | 1179 | } else { |
@@ -1211,7 +1211,7 @@ discard block |
||
1211 | 1211 | global $user, $conf, $extrafields, $hookmanager; |
1212 | 1212 | global $contextpage; |
1213 | 1213 | |
1214 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
1214 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
1215 | 1215 | $formcompany = new FormCompany($db); |
1216 | 1216 | $form = new Form($db); |
1217 | 1217 | |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | 't.rowid' => array('label' => "TechnicalID", 'checked' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? '1' : '0'), 'enabled' => (getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') ? '1' : '0'), 'position' => 1), |
1297 | 1297 | 't.name' => array('label' => "Name", 'checked' => '1', 'position' => 10), |
1298 | 1298 | 't.poste' => array('label' => "PostOrFunction", 'checked' => '1', 'position' => 20), |
1299 | - 't.address' => array('label' => (empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address") . ' / ' . $langs->trans("Phone") . ' / ' . $langs->trans("Email") : $langs->trans("Address")), 'checked' => '1', 'position' => 30), |
|
1299 | + 't.address' => array('label' => (empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked' => '1', 'position' => 30), |
|
1300 | 1300 | 't.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'position' => 35), |
1301 | 1301 | 'sc.role' => array('label' => "ContactByDefaultFor", 'checked' => '1', 'position' => 40), |
1302 | 1302 | 't.birthday' => array('label' => "Birthday", 'checked' => '0', 'position' => 45), |
@@ -1307,12 +1307,12 @@ discard block |
||
1307 | 1307 | $extrafieldsobjectkey = $contactstatic->table_element; |
1308 | 1308 | $extrafieldsobjectprefix = 'ef.'; |
1309 | 1309 | $extrafieldspositionoffset = 1000; |
1310 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1310 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1311 | 1311 | |
1312 | 1312 | // Initialize array of search criteria |
1313 | 1313 | $search = array(); |
1314 | 1314 | foreach ($arrayfields as $key => $val) { |
1315 | - $queryName = 'search_' . substr($key, 2); |
|
1315 | + $queryName = 'search_'.substr($key, 2); |
|
1316 | 1316 | if (GETPOST($queryName, 'alpha')) { |
1317 | 1317 | $search[substr($key, 2)] = GETPOST($queryName, 'alpha'); |
1318 | 1318 | } |
@@ -1347,7 +1347,7 @@ discard block |
||
1347 | 1347 | if (empty($reshook)) { |
1348 | 1348 | if ($user->hasRight('societe', 'contact', 'creer')) { |
1349 | 1349 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
1350 | - $newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT . '/contact/card.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage)); |
|
1350 | + $newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); |
|
1351 | 1351 | } |
1352 | 1352 | } else { |
1353 | 1353 | $newcardbutton = $hookmanager->resPrint; |
@@ -1358,75 +1358,75 @@ discard block |
||
1358 | 1358 | $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany")); |
1359 | 1359 | print load_fiche_titre($title, $newcardbutton, 'contact'); |
1360 | 1360 | |
1361 | - print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '" name="formfilter">'; |
|
1362 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1361 | + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">'; |
|
1362 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1363 | 1363 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
1364 | - print '<input type="hidden" name="socid" value="' . $object->id . '">'; |
|
1365 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
1366 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
1367 | - print '<input type="hidden" name="page" value="' . $page . '">'; |
|
1364 | + print '<input type="hidden" name="socid" value="'.$object->id.'">'; |
|
1365 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
1366 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
1367 | + print '<input type="hidden" name="page" value="'.$page.'">'; |
|
1368 | 1368 | |
1369 | 1369 | $arrayofmassactions = array(); |
1370 | 1370 | $mode = 'view'; |
1371 | 1371 | |
1372 | 1372 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1373 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1373 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1374 | 1374 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
1375 | 1375 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1376 | 1376 | |
1377 | 1377 | print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table |
1378 | - print "\n" . '<table class="tagtable liste noborder">' . "\n"; |
|
1378 | + print "\n".'<table class="tagtable liste noborder">'."\n"; |
|
1379 | 1379 | |
1380 | - $param = "socid=" . urlencode((string) ($object->id)); |
|
1380 | + $param = "socid=".urlencode((string) ($object->id)); |
|
1381 | 1381 | if ($search_rowid != '') { |
1382 | - $param .= '&search_rowid=' . urlencode((string) ($search_rowid)); |
|
1382 | + $param .= '&search_rowid='.urlencode((string) ($search_rowid)); |
|
1383 | 1383 | } |
1384 | 1384 | if ($search_status != '') { |
1385 | - $param .= '&search_status=' . urlencode((string) ($search_status)); |
|
1385 | + $param .= '&search_status='.urlencode((string) ($search_status)); |
|
1386 | 1386 | } |
1387 | 1387 | if (count($search_roles) > 0) { |
1388 | 1388 | $param .= implode('&search_roles[]=', $search_roles); |
1389 | 1389 | } |
1390 | 1390 | if ($search_name != '') { |
1391 | - $param .= '&search_name=' . urlencode($search_name); |
|
1391 | + $param .= '&search_name='.urlencode($search_name); |
|
1392 | 1392 | } |
1393 | 1393 | if ($search_poste != '') { |
1394 | - $param .= '&search_poste=' . urlencode($search_poste); |
|
1394 | + $param .= '&search_poste='.urlencode($search_poste); |
|
1395 | 1395 | } |
1396 | 1396 | if ($search_address != '') { |
1397 | - $param .= '&search_address=' . urlencode($search_address); |
|
1397 | + $param .= '&search_address='.urlencode($search_address); |
|
1398 | 1398 | } |
1399 | 1399 | if ($search_note_private != '') { |
1400 | - $param .= '&search_note_private=' . urlencode($search_note_private); |
|
1400 | + $param .= '&search_note_private='.urlencode($search_note_private); |
|
1401 | 1401 | } |
1402 | 1402 | if ($search_birthday_dtstart != '') { |
1403 | - $param .= '&search_birthday_dtstart=' . urlencode((string) $search_birthday_dtstart); |
|
1403 | + $param .= '&search_birthday_dtstart='.urlencode((string) $search_birthday_dtstart); |
|
1404 | 1404 | } |
1405 | 1405 | if ($search_birthday_dtend != '') { |
1406 | - $param .= '&search_birthday_dtend=' . urlencode((string) $search_birthday_dtend); |
|
1406 | + $param .= '&search_birthday_dtend='.urlencode((string) $search_birthday_dtend); |
|
1407 | 1407 | } |
1408 | 1408 | if ($optioncss != '') { |
1409 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
1409 | + $param .= '&optioncss='.urlencode($optioncss); |
|
1410 | 1410 | } |
1411 | 1411 | |
1412 | 1412 | // Add $param from extra fields |
1413 | 1413 | $extrafieldsobjectkey = $contactstatic->table_element; |
1414 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php'; |
|
1414 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
|
1415 | 1415 | |
1416 | 1416 | $sql = "SELECT t.rowid, t.entity, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste,"; |
1417 | 1417 | $sql .= " t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo, t.fk_soc,"; |
1418 | 1418 | $sql .= " t.civility as civility_id, t.address, t.zip, t.town, t.birthday,"; |
1419 | 1419 | $sql .= " t.note_private"; |
1420 | - $sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as t"; |
|
1421 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
1422 | - $sql .= " WHERE t.fk_soc = " . ((int) $object->id); |
|
1423 | - $sql .= " AND t.entity IN (" . getEntity('socpeople') . ")"; |
|
1424 | - $sql .= " AND ((t.fk_user_creat = " . ((int) $user->id) . " AND t.priv = 1) OR t.priv = 0)"; |
|
1420 | + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; |
|
1421 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; |
|
1422 | + $sql .= " WHERE t.fk_soc = ".((int) $object->id); |
|
1423 | + $sql .= " AND t.entity IN (".getEntity('socpeople').")"; |
|
1424 | + $sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)"; |
|
1425 | 1425 | if ($search_rowid) { |
1426 | 1426 | $sql .= natural_search('t.rowid', $search_rowid); |
1427 | 1427 | } |
1428 | 1428 | if ($search_status != '' && $search_status != '-1') { |
1429 | - $sql .= " AND t.statut = " . ((int) $search_status); |
|
1429 | + $sql .= " AND t.statut = ".((int) $search_status); |
|
1430 | 1430 | } |
1431 | 1431 | if ($search_name) { |
1432 | 1432 | $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name); |
@@ -1441,17 +1441,17 @@ discard block |
||
1441 | 1441 | $sql .= natural_search('t.note_private', $search_note_private); |
1442 | 1442 | } |
1443 | 1443 | if ($search_birthday_dtstart != '') { |
1444 | - $sql .= " AND t.birthday >= '" . $db->idate($search_birthday_dtstart) . "'"; |
|
1444 | + $sql .= " AND t.birthday >= '".$db->idate($search_birthday_dtstart)."'"; |
|
1445 | 1445 | } |
1446 | 1446 | if ($search_birthday_dtend != '') { |
1447 | - $sql .= " AND t.birthday <= '" . $db->idate($search_birthday_dtend) . "'"; |
|
1447 | + $sql .= " AND t.birthday <= '".$db->idate($search_birthday_dtend)."'"; |
|
1448 | 1448 | } |
1449 | 1449 | if (count($search_roles) > 0) { |
1450 | - $sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM " . MAIN_DB_PREFIX . "societe_contacts as sc WHERE sc.fk_c_type_contact IN (" . $db->sanitize(implode(',', $search_roles)) . "))"; |
|
1450 | + $sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; |
|
1451 | 1451 | } |
1452 | 1452 | // Add where from extra fields |
1453 | 1453 | $extrafieldsobjectkey = $contactstatic->table_element; |
1454 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
1454 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; |
|
1455 | 1455 | // Add where from hooks |
1456 | 1456 | $parameters = array('socid' => $object->id); |
1457 | 1457 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook |
@@ -1482,16 +1482,16 @@ discard block |
||
1482 | 1482 | foreach ($contactstatic->fields as $key => $val) { |
1483 | 1483 | $align = ''; |
1484 | 1484 | if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
1485 | - $align .= ($align ? ' ' : '') . 'center'; |
|
1485 | + $align .= ($align ? ' ' : '').'center'; |
|
1486 | 1486 | } |
1487 | 1487 | if (in_array($val['type'], array('timestamp'))) { |
1488 | - $align .= ($align ? ' ' : '') . 'nowrap'; |
|
1488 | + $align .= ($align ? ' ' : '').'nowrap'; |
|
1489 | 1489 | } |
1490 | 1490 | if ($key == 'status' || $key == 'statut') { |
1491 | - $align .= ($align ? ' ' : '') . 'center'; |
|
1491 | + $align .= ($align ? ' ' : '').'center'; |
|
1492 | 1492 | } |
1493 | - if (!empty($arrayfields['t.' . $key]['checked']) || !empty($arrayfields['sc.' . $key]['checked'])) { |
|
1494 | - print '<td class="liste_titre' . ($align ? ' ' . $align : '') . '">'; |
|
1493 | + if (!empty($arrayfields['t.'.$key]['checked']) || !empty($arrayfields['sc.'.$key]['checked'])) { |
|
1494 | + print '<td class="liste_titre'.($align ? ' '.$align : '').'">'; |
|
1495 | 1495 | if (in_array($key, array('statut'))) { |
1496 | 1496 | print $form->selectarray('search_status', array('-1' => '', '0' => $contactstatic->LibStatut(0, 1), '1' => $contactstatic->LibStatut(1, 1)), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage'); |
1497 | 1497 | } elseif (in_array($key, array('role'))) { |
@@ -1504,7 +1504,7 @@ discard block |
||
1504 | 1504 | print $form->selectDate($search_birthday_dtend ? $search_birthday_dtend : '', "search_birthday_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); |
1505 | 1505 | print '</div>'; |
1506 | 1506 | } else { |
1507 | - print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . (!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '') . '">'; |
|
1507 | + print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.(!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '').'">'; |
|
1508 | 1508 | } |
1509 | 1509 | print '</td>'; |
1510 | 1510 | } |
@@ -1514,7 +1514,7 @@ discard block |
||
1514 | 1514 | } |
1515 | 1515 | // Extra fields |
1516 | 1516 | $extrafieldsobjectkey = $contactstatic->table_element; |
1517 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php'; |
|
1517 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; |
|
1518 | 1518 | |
1519 | 1519 | // Fields from hook |
1520 | 1520 | $parameters = array('arrayfields' => $arrayfields); |
@@ -1526,7 +1526,7 @@ discard block |
||
1526 | 1526 | print $form->showFilterButtons(); |
1527 | 1527 | print '</td>'; |
1528 | 1528 | } |
1529 | - print '</tr>' . "\n"; |
|
1529 | + print '</tr>'."\n"; |
|
1530 | 1530 | |
1531 | 1531 | |
1532 | 1532 | // Fields title label |
@@ -1534,44 +1534,44 @@ discard block |
||
1534 | 1534 | print '<tr class="liste_titre">'; |
1535 | 1535 | // Action column |
1536 | 1536 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
1537 | - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ') . "\n"; |
|
1537 | + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n"; |
|
1538 | 1538 | } |
1539 | 1539 | foreach ($contactstatic->fields as $key => $val) { |
1540 | 1540 | $align = ''; |
1541 | 1541 | if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { |
1542 | - $align .= ($align ? ' ' : '') . 'center'; |
|
1542 | + $align .= ($align ? ' ' : '').'center'; |
|
1543 | 1543 | } |
1544 | 1544 | if (in_array($val['type'], array('timestamp'))) { |
1545 | - $align .= ($align ? ' ' : '') . 'nowrap'; |
|
1545 | + $align .= ($align ? ' ' : '').'nowrap'; |
|
1546 | 1546 | } |
1547 | 1547 | if ($key == 'status' || $key == 'statut') { |
1548 | - $align .= ($align ? ' ' : '') . 'center'; |
|
1548 | + $align .= ($align ? ' ' : '').'center'; |
|
1549 | 1549 | } |
1550 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
1551 | - print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($align ? 'class="' . $align . '"' : ''), $sortfield, $sortorder, $align . ' ') . "\n"; |
|
1550 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
1551 | + print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; |
|
1552 | 1552 | } |
1553 | 1553 | if ($key == 'role') { |
1554 | - $align .= ($align ? ' ' : '') . 'left'; |
|
1554 | + $align .= ($align ? ' ' : '').'left'; |
|
1555 | 1555 | } |
1556 | - if (!empty($arrayfields['sc.' . $key]['checked'])) { |
|
1557 | - print getTitleFieldOfList($arrayfields['sc.' . $key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="' . $align . '"' : ''), $sortfield, $sortorder, $align . ' ') . "\n"; |
|
1556 | + if (!empty($arrayfields['sc.'.$key]['checked'])) { |
|
1557 | + print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; |
|
1558 | 1558 | } |
1559 | 1559 | } |
1560 | 1560 | if ($showuserlogin) { |
1561 | - print '<th class="wrapcolumntitle liste_titre">' . $langs->trans("DolibarrLogin") . '</th>'; |
|
1561 | + print '<th class="wrapcolumntitle liste_titre">'.$langs->trans("DolibarrLogin").'</th>'; |
|
1562 | 1562 | } |
1563 | 1563 | // Extra fields |
1564 | 1564 | $extrafieldsobjectkey = $contactstatic->table_element; |
1565 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php'; |
|
1565 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; |
|
1566 | 1566 | // Hook fields |
1567 | 1567 | $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); |
1568 | 1568 | $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook |
1569 | 1569 | print $hookmanager->resPrint; |
1570 | 1570 | // Action column |
1571 | 1571 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
1572 | - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ') . "\n"; |
|
1572 | + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n"; |
|
1573 | 1573 | } |
1574 | - print '</tr>' . "\n"; |
|
1574 | + print '</tr>'."\n"; |
|
1575 | 1575 | |
1576 | 1576 | $i = -1; |
1577 | 1577 | |
@@ -1626,21 +1626,21 @@ discard block |
||
1626 | 1626 | |
1627 | 1627 | // Add to agenda |
1628 | 1628 | if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) { |
1629 | - print '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&actioncode=&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">'; |
|
1629 | + print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'; |
|
1630 | 1630 | print img_object($langs->trans("Event"), "action"); |
1631 | 1631 | print '</a> '; |
1632 | 1632 | } |
1633 | 1633 | |
1634 | 1634 | // Edit |
1635 | 1635 | if ($user->hasRight('societe', 'contact', 'creer')) { |
1636 | - print '<a class="editfielda paddingleft" href="' . DOL_URL_ROOT . '/contact/card.php?action=edit&token=' . newToken() . '&id=' . $obj->rowid . '&backtopage=' . urlencode($backtopage) . '">'; |
|
1636 | + print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">'; |
|
1637 | 1637 | print img_edit(); |
1638 | 1638 | print '</a>'; |
1639 | 1639 | } |
1640 | 1640 | |
1641 | 1641 | // Delete |
1642 | 1642 | if ($user->hasRight('societe', 'contact', 'delete')) { |
1643 | - print '<a class="marginleftonly right" href="' . DOL_URL_ROOT . '/societe/contact.php?action=delete&token=' . newToken() . '&id=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">'; |
|
1643 | + print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'; |
|
1644 | 1644 | print img_delete(); |
1645 | 1645 | print '</a>'; |
1646 | 1646 | } |
@@ -1659,13 +1659,13 @@ discard block |
||
1659 | 1659 | if (!empty($arrayfields['t.name']['checked'])) { |
1660 | 1660 | print '<td class="tdoverflowmax150">'; |
1661 | 1661 | print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 'user'); |
1662 | - print $contactstatic->getNomUrl(0, '', 0, '&backtopage=' . urlencode($backtopage)); |
|
1662 | + print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage)); |
|
1663 | 1663 | print '</td>'; |
1664 | 1664 | } |
1665 | 1665 | |
1666 | 1666 | // Job position |
1667 | 1667 | if (!empty($arrayfields['t.poste']['checked'])) { |
1668 | - print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($obj->poste) . '">'; |
|
1668 | + print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->poste).'">'; |
|
1669 | 1669 | if ($obj->poste) { |
1670 | 1670 | print dol_escape_htmltag($obj->poste); |
1671 | 1671 | } |
@@ -1675,7 +1675,7 @@ discard block |
||
1675 | 1675 | // Address - Phone - Email |
1676 | 1676 | if (!empty($arrayfields['t.address']['checked'])) { |
1677 | 1677 | $addresstoshow = $contactstatic->getBannerAddress('contact', $object); |
1678 | - print '<td class="tdoverflowmax150" title="' . dolPrintHTMLForAttribute($addresstoshow) . '">'; |
|
1678 | + print '<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute($addresstoshow).'">'; |
|
1679 | 1679 | print $addresstoshow; |
1680 | 1680 | print '</td>'; |
1681 | 1681 | } |
@@ -1703,7 +1703,7 @@ discard block |
||
1703 | 1703 | |
1704 | 1704 | // Status |
1705 | 1705 | if (!empty($arrayfields['t.statut']['checked'])) { |
1706 | - print '<td class="center">' . $contactstatic->getLibStatut(5) . '</td>'; |
|
1706 | + print '<td class="center">'.$contactstatic->getLibStatut(5).'</td>'; |
|
1707 | 1707 | } |
1708 | 1708 | |
1709 | 1709 | if ($showuserlogin) { |
@@ -1719,7 +1719,7 @@ discard block |
||
1719 | 1719 | |
1720 | 1720 | // Extra fields |
1721 | 1721 | $extrafieldsobjectkey = $contactstatic->table_element; |
1722 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
1722 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; |
|
1723 | 1723 | |
1724 | 1724 | // Actions |
1725 | 1725 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -1727,21 +1727,21 @@ discard block |
||
1727 | 1727 | |
1728 | 1728 | // Add to agenda |
1729 | 1729 | if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) { |
1730 | - print '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&actioncode=&contactid=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">'; |
|
1730 | + print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'; |
|
1731 | 1731 | print img_object($langs->trans("Event"), "action"); |
1732 | 1732 | print '</a> '; |
1733 | 1733 | } |
1734 | 1734 | |
1735 | 1735 | // Edit |
1736 | 1736 | if ($user->hasRight('societe', 'contact', 'creer')) { |
1737 | - print '<a class="editfielda paddingleft" href="' . DOL_URL_ROOT . '/contact/card.php?action=edit&token=' . newToken() . '&id=' . $obj->rowid . '&backtopage=' . urlencode($backtopage) . '">'; |
|
1737 | + print '<a class="editfielda paddingleft" href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">'; |
|
1738 | 1738 | print img_edit(); |
1739 | 1739 | print '</a>'; |
1740 | 1740 | } |
1741 | 1741 | |
1742 | 1742 | // Delete |
1743 | 1743 | if ($user->hasRight('societe', 'contact', 'delete')) { |
1744 | - print '<a class="marginleftonly right" href="' . DOL_URL_ROOT . '/societe/contact.php?action=delete&token=' . newToken() . '&id=' . $obj->rowid . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">'; |
|
1744 | + print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'; |
|
1745 | 1745 | print img_delete(); |
1746 | 1746 | print '</a>'; |
1747 | 1747 | } |
@@ -1760,7 +1760,7 @@ discard block |
||
1760 | 1760 | $colspan++; |
1761 | 1761 | } |
1762 | 1762 | } |
1763 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
1763 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
1764 | 1764 | } |
1765 | 1765 | } else { |
1766 | 1766 | $colspan = 1 + ($showuserlogin ? 1 : 0); |
@@ -1769,12 +1769,12 @@ discard block |
||
1769 | 1769 | $colspan++; |
1770 | 1770 | } |
1771 | 1771 | } |
1772 | - print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
1772 | + print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
1773 | 1773 | } |
1774 | 1774 | print "\n</table>\n"; |
1775 | 1775 | print '</div>'; |
1776 | 1776 | |
1777 | - print '</form>' . "\n"; |
|
1777 | + print '</form>'."\n"; |
|
1778 | 1778 | |
1779 | 1779 | return $i; |
1780 | 1780 | } |
@@ -1849,7 +1849,7 @@ discard block |
||
1849 | 1849 | $tms_start = ''; |
1850 | 1850 | $tms_end = ''; |
1851 | 1851 | } |
1852 | - require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; |
|
1852 | + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
1853 | 1853 | |
1854 | 1854 | // Check parameters |
1855 | 1855 | if (!is_object($filterobj) && !is_object($objcon)) { |
@@ -1904,7 +1904,7 @@ discard block |
||
1904 | 1904 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { |
1905 | 1905 | $sql .= ", o.ref"; |
1906 | 1906 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Expedition') { //MODIF PICHINOV MESSAGING |
1907 | - $sql .= ", s.ref"; //END MODIF |
|
1907 | + $sql .= ", s.ref"; //END MODIF |
|
1908 | 1908 | } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && $filterobj->table_element && $filterobj->element) { |
1909 | 1909 | if (!empty($filterobj->fields['ref'])) { |
1910 | 1910 | $sql .= ", o.ref"; |
@@ -1915,16 +1915,16 @@ discard block |
||
1915 | 1915 | |
1916 | 1916 | // Fields from hook |
1917 | 1917 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
1918 | - $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook |
|
1918 | + $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook |
|
1919 | 1919 | if (!empty($hookmanager->resPrint)) { |
1920 | 1920 | $sql .= $hookmanager->resPrint; |
1921 | 1921 | } |
1922 | 1922 | |
1923 | - $sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm as a"; |
|
1923 | + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; |
|
1924 | 1924 | // Link to the owner of action |
1925 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on u.rowid = a.fk_user_action"; |
|
1925 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; |
|
1926 | 1926 | // Link to action types |
1927 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_actioncomm as c ON a.fk_action = c.id"; |
|
1927 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; |
|
1928 | 1928 | |
1929 | 1929 | // Set $force_filter_contact: |
1930 | 1930 | // - true for a filter on a user or a contact, so a link on table llx_actioncomm_resources or llx_actioncomm.fk_user_action |
@@ -1939,98 +1939,98 @@ discard block |
||
1939 | 1939 | |
1940 | 1940 | // Fields from hook |
1941 | 1941 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
1942 | - $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
1942 | + $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
1943 | 1943 | if (!empty($hookmanager->resPrint)) { |
1944 | 1944 | $sql .= $hookmanager->resPrint; |
1945 | 1945 | } |
1946 | 1946 | if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) { |
1947 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sp ON a.fk_contact = sp.rowid"; |
|
1947 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; |
|
1948 | 1948 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') { |
1949 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "element_resources as er"; |
|
1949 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er"; |
|
1950 | 1950 | $sql .= " ON er.resource_type = 'dolresource'"; |
1951 | 1951 | $sql .= " AND er.element_id = a.id"; |
1952 | - $sql .= " AND er.resource_id = " . ((int) $filterobj->id); |
|
1952 | + $sql .= " AND er.resource_id = ".((int) $filterobj->id); |
|
1953 | 1953 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Project') { |
1954 | 1954 | /* Nothing */ |
1955 | 1955 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { |
1956 | - $sql .= ", " . MAIN_DB_PREFIX . "adherent as m"; |
|
1956 | + $sql .= ", ".MAIN_DB_PREFIX."adherent as m"; |
|
1957 | 1957 | } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { |
1958 | - $sql .= ", " . MAIN_DB_PREFIX . "commande_fournisseur as o"; |
|
1958 | + $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; |
|
1959 | 1959 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { |
1960 | - $sql .= ", " . MAIN_DB_PREFIX . "product as o"; |
|
1960 | + $sql .= ", ".MAIN_DB_PREFIX."product as o"; |
|
1961 | 1961 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { |
1962 | - $sql .= ", " . MAIN_DB_PREFIX . "ticket as o"; |
|
1962 | + $sql .= ", ".MAIN_DB_PREFIX."ticket as o"; |
|
1963 | 1963 | } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { |
1964 | - $sql .= ", " . MAIN_DB_PREFIX . "bom_bom as o"; |
|
1964 | + $sql .= ", ".MAIN_DB_PREFIX."bom_bom as o"; |
|
1965 | 1965 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { |
1966 | - $sql .= ", " . MAIN_DB_PREFIX . "contrat as o"; |
|
1966 | + $sql .= ", ".MAIN_DB_PREFIX."contrat as o"; |
|
1967 | 1967 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Expedition') { //MODIF PICHINOV MESSAGING |
1968 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expedition as s ON a.fk_element = s.rowid AND a.elementtype = 'shipping'"; // Jointure sur la table des expéditions avec condition ON |
|
1968 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expedition as s ON a.fk_element = s.rowid AND a.elementtype = 'shipping'"; // Jointure sur la table des expéditions avec condition ON |
|
1969 | 1969 | } elseif ( //END MODIF |
1970 | 1970 | is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) |
1971 | 1971 | && ((!empty($filterobj->fields['ref']) && is_array($filterobj->fields['ref'])) || (!empty($filterobj->fields['label']) && is_array($filterobj->fields['label'])) || (!empty($filterobj->fields['titre']) && is_array($filterobj->fields['titre']))) // @phan-suppress-current-line PhanTypeInvalidDimOffset |
1972 | 1972 | && $filterobj->table_element && $filterobj->element |
1973 | 1973 | ) { |
1974 | - $sql .= ", " . MAIN_DB_PREFIX . $filterobj->table_element . " as o"; |
|
1974 | + $sql .= ", ".MAIN_DB_PREFIX.$filterobj->table_element." as o"; |
|
1975 | 1975 | } |
1976 | 1976 | |
1977 | - $sql .= " WHERE a.entity IN (" . getEntity('agenda') . ")"; |
|
1977 | + $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; |
|
1978 | 1978 | if (!$force_filter_contact) { |
1979 | 1979 | if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) { |
1980 | - $sql .= " AND a.fk_soc = " . ((int) $filterobj->id); |
|
1980 | + $sql .= " AND a.fk_soc = ".((int) $filterobj->id); |
|
1981 | 1981 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') { |
1982 | 1982 | /* Nothing */ |
1983 | 1983 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) { |
1984 | - $sql .= " AND a.fk_project = " . ((int) $filterobj->id); |
|
1984 | + $sql .= " AND a.fk_project = ".((int) $filterobj->id); |
|
1985 | 1985 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { |
1986 | 1986 | $sql .= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; |
1987 | 1987 | if ($filterobj->id) { |
1988 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
1988 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
1989 | 1989 | } |
1990 | 1990 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Commande') { |
1991 | 1991 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order'"; |
1992 | 1992 | if ($filterobj->id) { |
1993 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
1993 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
1994 | 1994 | } |
1995 | 1995 | } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { |
1996 | 1996 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; |
1997 | 1997 | if ($filterobj->id) { |
1998 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
1998 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
1999 | 1999 | } |
2000 | 2000 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Facture') { |
2001 | 2001 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice'"; |
2002 | 2002 | if ($filterobj->id) { |
2003 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2003 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2004 | 2004 | } |
2005 | 2005 | } elseif (is_object($filterobj) && get_class($filterobj) == 'FactureFournisseur') { |
2006 | 2006 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'invoice_supplier'"; |
2007 | 2007 | if ($filterobj->id) { |
2008 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2008 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2009 | 2009 | } |
2010 | 2010 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { |
2011 | 2011 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'"; |
2012 | 2012 | if ($filterobj->id) { |
2013 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2013 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2014 | 2014 | } |
2015 | 2015 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { |
2016 | 2016 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'"; |
2017 | 2017 | if ($filterobj->id) { |
2018 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2018 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2019 | 2019 | } |
2020 | 2020 | } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { |
2021 | 2021 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'"; |
2022 | 2022 | if ($filterobj->id) { |
2023 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2023 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2024 | 2024 | } |
2025 | 2025 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { |
2026 | 2026 | $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'"; |
2027 | 2027 | if ($filterobj->id) { |
2028 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2028 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2029 | 2029 | } |
2030 | 2030 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Expedition') { //MODIF PICHINOV MESSAGING |
2031 | 2031 | $sql .= " AND a.fk_element = s.rowid AND a.elementtype = 'shipping'"; //expedition filter |
2032 | 2032 | if ($filterobj->id) { |
2033 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2033 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2034 | 2034 | } |
2035 | 2035 | } elseif ( //END MODIF |
2036 | 2036 | is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) |
@@ -2038,32 +2038,32 @@ discard block |
||
2038 | 2038 | && $filterobj->table_element && $filterobj->element |
2039 | 2039 | ) { |
2040 | 2040 | // Generic case (if there is a $filterobj and a field rowid and (ref or label) exists. |
2041 | - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '" . $db->escape($filterobj->element) . ($module ? "@" . $module : "") . "'"; |
|
2041 | + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? "@".$module : "")."'"; |
|
2042 | 2042 | if ($filterobj->id) { |
2043 | - $sql .= " AND a.fk_element = " . ((int) $filterobj->id); |
|
2043 | + $sql .= " AND a.fk_element = ".((int) $filterobj->id); |
|
2044 | 2044 | } |
2045 | 2045 | } elseif (is_object($filterobj)) { |
2046 | 2046 | return 'Bad value for $filterobj'; |
2047 | 2047 | } |
2048 | 2048 | } else { |
2049 | 2049 | if (is_object($filterobj) && $filterobj->id > 0 && get_class($filterobj) == 'User') { |
2050 | - $sql .= " AND (u.rowid = " . ((int) $filterobj->id) . ' OR '; |
|
2051 | - $sql .= " EXISTS (SELECT r.rowid FROM " . MAIN_DB_PREFIX . "actioncomm_resources as r WHERE a.id = r.fk_actioncomm"; |
|
2052 | - $sql .= " AND r.element_type = '" . $db->escape($filterobj->table_element) . "' AND r.fk_element = " . ((int) $filterobj->id) . ')'; |
|
2050 | + $sql .= " AND (u.rowid = ".((int) $filterobj->id).' OR '; |
|
2051 | + $sql .= " EXISTS (SELECT r.rowid FROM ".MAIN_DB_PREFIX."actioncomm_resources as r WHERE a.id = r.fk_actioncomm"; |
|
2052 | + $sql .= " AND r.element_type = '".$db->escape($filterobj->table_element)."' AND r.fk_element = ".((int) $filterobj->id).')'; |
|
2053 | 2053 | $sql .= ")"; |
2054 | 2054 | } |
2055 | 2055 | if (is_object($objcon) && $objcon->id > 0) { |
2056 | - $sql .= " AND EXISTS (SELECT r.rowid FROM " . MAIN_DB_PREFIX . "actioncomm_resources as r WHERE a.id = r.fk_actioncomm"; |
|
2057 | - $sql .= " AND r.element_type = '" . $db->escape($objcon->table_element) . "' AND r.fk_element = " . ((int) $objcon->id) . ')'; |
|
2056 | + $sql .= " AND EXISTS (SELECT r.rowid FROM ".MAIN_DB_PREFIX."actioncomm_resources as r WHERE a.id = r.fk_actioncomm"; |
|
2057 | + $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id).')'; |
|
2058 | 2058 | } |
2059 | 2059 | } |
2060 | 2060 | |
2061 | 2061 | if (!empty($tms_start) && !empty($tms_end)) { |
2062 | - $sql .= " AND ((a.datep BETWEEN '" . $db->idate($tms_start) . "' AND '" . $db->idate($tms_end) . "') OR (a.datep2 BETWEEN '" . $db->idate($tms_start) . "' AND '" . $db->idate($tms_end) . "'))"; |
|
2062 | + $sql .= " AND ((a.datep BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."') OR (a.datep2 BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."'))"; |
|
2063 | 2063 | } elseif (empty($tms_start) && !empty($tms_end)) { |
2064 | - $sql .= " AND ((a.datep <= '" . $db->idate($tms_end) . "') OR (a.datep2 <= '" . $db->idate($tms_end) . "'))"; |
|
2064 | + $sql .= " AND ((a.datep <= '".$db->idate($tms_end)."') OR (a.datep2 <= '".$db->idate($tms_end)."'))"; |
|
2065 | 2065 | } elseif (!empty($tms_start) && empty($tms_end)) { |
2066 | - $sql .= " AND ((a.datep >= '" . $db->idate($tms_start) . "') OR (a.datep2 >= '" . $db->idate($tms_start) . "'))"; |
|
2066 | + $sql .= " AND ((a.datep >= '".$db->idate($tms_start)."') OR (a.datep2 >= '".$db->idate($tms_start)."'))"; |
|
2067 | 2067 | } |
2068 | 2068 | |
2069 | 2069 | if (is_array($actioncode) && !empty($actioncode)) { |
@@ -2093,7 +2093,7 @@ discard block |
||
2093 | 2093 | |
2094 | 2094 | // Fields from hook |
2095 | 2095 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module); |
2096 | - $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
2096 | + $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
2097 | 2097 | if (!empty($hookmanager->resPrint)) { |
2098 | 2098 | $sql .= $hookmanager->resPrint; |
2099 | 2099 | } |
@@ -2104,7 +2104,7 @@ discard block |
||
2104 | 2104 | $sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj); |
2105 | 2105 | if (!empty($sql2)) { |
2106 | 2106 | if (!empty($sql)) { |
2107 | - $sql = $sql . " UNION " . $sql2; |
|
2107 | + $sql = $sql." UNION ".$sql2; |
|
2108 | 2108 | } elseif (empty($sql)) { |
2109 | 2109 | $sql = $sql2; |
2110 | 2110 | } |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | } else { |
2115 | 2115 | $sql2 = addMailingEventTypeSQL($actioncode, $objcon, $filterobj); |
2116 | 2116 | if (!empty($sql) && !empty($sql2)) { |
2117 | - $sql = $sql . " UNION " . $sql2; |
|
2117 | + $sql = $sql." UNION ".$sql2; |
|
2118 | 2118 | } elseif (empty($sql) && !empty($sql2)) { |
2119 | 2119 | $sql = $sql2; |
2120 | 2120 | } |
@@ -2225,10 +2225,10 @@ discard block |
||
2225 | 2225 | if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) { |
2226 | 2226 | $delay_warning = getDolGlobalInt('MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60; |
2227 | 2227 | |
2228 | - require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; |
|
2229 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
2230 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
2231 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
2228 | + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
2229 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
2230 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
2231 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
2232 | 2232 | |
2233 | 2233 | $formactions = new FormActions($db); |
2234 | 2234 | |
@@ -2238,20 +2238,20 @@ discard block |
||
2238 | 2238 | $contactstatic = new Contact($db); |
2239 | 2239 | $elementlinkcache = array(); |
2240 | 2240 | |
2241 | - $out .= '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; |
|
2242 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
2241 | + $out .= '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
2242 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
2243 | 2243 | if ( |
2244 | 2244 | $objcon && get_class($objcon) == 'Contact' && |
2245 | 2245 | (is_null($filterobj) || get_class($filterobj) == 'Societe') |
2246 | 2246 | ) { |
2247 | - $out .= '<input type="hidden" name="id" value="' . $objcon->id . '" />'; |
|
2247 | + $out .= '<input type="hidden" name="id" value="'.$objcon->id.'" />'; |
|
2248 | 2248 | } else { |
2249 | - $out .= '<input type="hidden" name="id" value="' . $filterobj->id . '" />'; |
|
2249 | + $out .= '<input type="hidden" name="id" value="'.$filterobj->id.'" />'; |
|
2250 | 2250 | } |
2251 | 2251 | if ($filterobj && get_class($filterobj) == 'Societe') { |
2252 | - $out .= '<input type="hidden" name="socid" value="' . $filterobj->id . '" />'; |
|
2252 | + $out .= '<input type="hidden" name="socid" value="'.$filterobj->id.'" />'; |
|
2253 | 2253 | } else { |
2254 | - $out .= '<input type="hidden" name="userid" value="' . $filterobj->id . '" />'; |
|
2254 | + $out .= '<input type="hidden" name="userid" value="'.$filterobj->id.'" />'; |
|
2255 | 2255 | } |
2256 | 2256 | |
2257 | 2257 | $out .= "\n"; |
@@ -2274,7 +2274,7 @@ discard block |
||
2274 | 2274 | } |
2275 | 2275 | |
2276 | 2276 | // ID |
2277 | - $out .= '<td class="liste_titre"><input type="text" class="width50" name="search_rowid" value="' . (isset($filters['search_rowid']) ? $filters['search_rowid'] : '') . '"></td>'; |
|
2277 | + $out .= '<td class="liste_titre"><input type="text" class="width50" name="search_rowid" value="'.(isset($filters['search_rowid']) ? $filters['search_rowid'] : '').'"></td>'; |
|
2278 | 2278 | // Date |
2279 | 2279 | $out .= '<td class="liste_titre center">'; |
2280 | 2280 | $out .= $form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1); |
@@ -2286,7 +2286,7 @@ discard block |
||
2286 | 2286 | $out .= $formactions->select_type_actions($actioncode, "actioncode", '', getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1, 0, (getDolGlobalString('AGENDA_USE_MULTISELECT_TYPE') ? 1 : 0), 1, 'selecttype combolargeelem minwidth100 maxwidth150', 1); |
2287 | 2287 | $out .= '</td>'; |
2288 | 2288 | // Label |
2289 | - $out .= '<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="' . $filters['search_agenda_label'] . '"></td>'; |
|
2289 | + $out .= '<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>'; |
|
2290 | 2290 | $out .= '<td class="liste_titre"></td>'; |
2291 | 2291 | $out .= '<td class="liste_titre"></td>'; |
2292 | 2292 | $out .= '<td class="liste_titre"></td>'; |
@@ -2307,10 +2307,10 @@ discard block |
||
2307 | 2307 | if ($donetodo && $filterobj !== null) { |
2308 | 2308 | $tmp = ''; |
2309 | 2309 | if (get_class($filterobj) == 'Societe') { |
2310 | - $tmp .= '<a href="' . DOL_URL_ROOT . '/comm/action/list.php?mode=show_list&socid=' . $filterobj->id . '&status=done">'; |
|
2310 | + $tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&socid='.$filterobj->id.'&status=done">'; |
|
2311 | 2311 | } |
2312 | 2312 | if (get_class($filterobj) == 'User') { |
2313 | - $tmp .= '<a href="' . DOL_URL_ROOT . '/comm/action/list.php?mode=show_list&userid=' . $filterobj->id . '&status=done">'; |
|
2313 | + $tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&userid='.$filterobj->id.'&status=done">'; |
|
2314 | 2314 | } |
2315 | 2315 | $tmp .= ($donetodo != 'done' ? $langs->trans("ActionsToDoShort") : ''); |
2316 | 2316 | $tmp .= ($donetodo != 'done' && $donetodo != 'todo' ? ' / ' : ''); |
@@ -2338,7 +2338,7 @@ discard block |
||
2338 | 2338 | } |
2339 | 2339 | $out .= '</tr>'; |
2340 | 2340 | |
2341 | - require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php'; |
|
2341 | + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; |
|
2342 | 2342 | $caction = new CActionComm($db); |
2343 | 2343 | $arraylist = $caction->liste_array(1, 'code', '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? 0 : 1), '', 1); |
2344 | 2344 | |
@@ -2367,7 +2367,7 @@ discard block |
||
2367 | 2367 | // Ref |
2368 | 2368 | $out .= '<td class="nowraponall">'; |
2369 | 2369 | if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') { |
2370 | - $out .= '<a href="' . DOL_URL_ROOT . '/comm/mailing/card.php?id=' . $histo[$key]['id'] . '">' . img_object($langs->trans("ShowEMailing"), "email") . ' '; |
|
2370 | + $out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' '; |
|
2371 | 2371 | $out .= $histo[$key]['id']; |
2372 | 2372 | $out .= '</a>'; |
2373 | 2373 | } else { |
@@ -2382,9 +2382,9 @@ discard block |
||
2382 | 2382 | $tmpa = dol_getdate($histo[$key]['datestart'], true); |
2383 | 2383 | $tmpb = dol_getdate($histo[$key]['dateend'], true); |
2384 | 2384 | if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) { |
2385 | - $out .= '-' . dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel'); |
|
2385 | + $out .= '-'.dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel'); |
|
2386 | 2386 | } else { |
2387 | - $out .= '-' . dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel'); |
|
2387 | + $out .= '-'.dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel'); |
|
2388 | 2388 | } |
2389 | 2389 | } |
2390 | 2390 | $late = 0; |
@@ -2401,7 +2401,7 @@ discard block |
||
2401 | 2401 | $late = 1; |
2402 | 2402 | } |
2403 | 2403 | if ($late) { |
2404 | - $out .= img_warning($langs->trans("Late")) . ' '; |
|
2404 | + $out .= img_warning($langs->trans("Late")).' '; |
|
2405 | 2405 | } |
2406 | 2406 | $out .= "</td>\n"; |
2407 | 2407 | |
@@ -2439,7 +2439,7 @@ discard block |
||
2439 | 2439 | $labelOfTypeToShow = $langs->trans("Emailing"); |
2440 | 2440 | } |
2441 | 2441 | if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labelOfTypeToShow && !empty($arraylist[$actionstatic->code])) { |
2442 | - $labelOfTypeToShow .= ' - ' . $arraylist[$actionstatic->code]; // Show also detailed code |
|
2442 | + $labelOfTypeToShow .= ' - '.$arraylist[$actionstatic->code]; // Show also detailed code |
|
2443 | 2443 | } |
2444 | 2444 | } |
2445 | 2445 | |
@@ -2448,7 +2448,7 @@ discard block |
||
2448 | 2448 | $labelOfTypeToShowLong .= ' (auto)'; |
2449 | 2449 | } |
2450 | 2450 | |
2451 | - $out .= '<td class="tdoverflowmax125" title="' . $labelOfTypeToShowLong . '">'; |
|
2451 | + $out .= '<td class="tdoverflowmax125" title="'.$labelOfTypeToShowLong.'">'; |
|
2452 | 2452 | $out .= $actionstatic->getTypePicto(); |
2453 | 2453 | //if (empty($conf->dol_optimize_smallscreen)) { |
2454 | 2454 | $out .= $labelOfTypeToShow; |
@@ -2458,19 +2458,19 @@ discard block |
||
2458 | 2458 | // Title/Label of event |
2459 | 2459 | $out .= '<td class="tdoverflowmax300"'; |
2460 | 2460 | if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') { |
2461 | - $transcode = $langs->trans("Action" . $histo[$key]['acode']); |
|
2461 | + $transcode = $langs->trans("Action".$histo[$key]['acode']); |
|
2462 | 2462 | //$libelle = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : $histo[$key]['alabel']); |
2463 | 2463 | $label = $histo[$key]['note']; |
2464 | 2464 | $actionstatic->id = $histo[$key]['id']; |
2465 | - $out .= ' title="' . dol_escape_htmltag($label) . '">'; |
|
2465 | + $out .= ' title="'.dol_escape_htmltag($label).'">'; |
|
2466 | 2466 | $out .= dol_trunc($label, 120); |
2467 | 2467 | } |
2468 | 2468 | if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') { |
2469 | - $transcode = $langs->trans("Action" . $histo[$key]['acode']); |
|
2470 | - $label = ($transcode != "Action" . $histo[$key]['acode'] ? $transcode : 'Send mass mailing'); |
|
2471 | - $label .= ' - ' . $histo[$key]['note']; |
|
2472 | - $out .= '<a href="' . DOL_URL_ROOT . '/comm/mailing/card.php?id=' . $histo[$key]['id'] . '"'; |
|
2473 | - $out .= ' title="' . dol_escape_htmltag($label) . '">'; |
|
2469 | + $transcode = $langs->trans("Action".$histo[$key]['acode']); |
|
2470 | + $label = ($transcode != "Action".$histo[$key]['acode'] ? $transcode : 'Send mass mailing'); |
|
2471 | + $label .= ' - '.$histo[$key]['note']; |
|
2472 | + $out .= '<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'"'; |
|
2473 | + $out .= ' title="'.dol_escape_htmltag($label).'">'; |
|
2474 | 2474 | //$out .= img_object($langs->trans("EMailing").'<br>'.$histo[$key]['note'], "email").' '; |
2475 | 2475 | $out .= dol_trunc($label, 120); |
2476 | 2476 | $out .= '</a>'; |
@@ -2508,7 +2508,7 @@ discard block |
||
2508 | 2508 | $out .= $contact->getNomUrl(-3, '', 10, '', -1, 0, 'paddingright'); |
2509 | 2509 | if (isset($histo[$key]['acode']) && $histo[$key]['acode'] == 'AC_TEL') { |
2510 | 2510 | if (!empty($contact->phone_pro)) { |
2511 | - $out .= '(' . dol_print_phone($contact->phone_pro) . ')'; |
|
2511 | + $out .= '('.dol_print_phone($contact->phone_pro).')'; |
|
2512 | 2512 | } |
2513 | 2513 | } |
2514 | 2514 | $out .= '<div class="paddingright"></div>'; |
@@ -2520,13 +2520,13 @@ discard block |
||
2520 | 2520 | $contactstatic->firstname = $histo[$key]['firstname']; |
2521 | 2521 | $contactstatic->id = $histo[$key]['contact_id']; |
2522 | 2522 | $contactstatic->photo = $histo[$key]['contact_photo']; |
2523 | - $out .= '<td width="120">' . $contactstatic->getNomUrl(-1, '', 10) . '</td>'; |
|
2523 | + $out .= '<td width="120">'.$contactstatic->getNomUrl(-1, '', 10).'</td>'; |
|
2524 | 2524 | } else { |
2525 | 2525 | $out .= '<td> </td>'; |
2526 | 2526 | } |
2527 | 2527 | |
2528 | 2528 | // Status / Progression |
2529 | - $out .= '<td class="nowrap center">' . $actionstatic->LibStatut($histo[$key]['percent'], 2, 0, $histo[$key]['datestart']) . '</td>'; |
|
2529 | + $out .= '<td class="nowrap center">'.$actionstatic->LibStatut($histo[$key]['percent'], 2, 0, $histo[$key]['datestart']).'</td>'; |
|
2530 | 2530 | |
2531 | 2531 | // Action column |
2532 | 2532 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -2537,7 +2537,7 @@ discard block |
||
2537 | 2537 | } |
2538 | 2538 | if (empty($histo)) { |
2539 | 2539 | $colspan = 9; |
2540 | - $out .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
2540 | + $out .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
2541 | 2541 | } |
2542 | 2542 | |
2543 | 2543 | $out .= "</table>\n"; |
@@ -2570,9 +2570,9 @@ discard block |
||
2570 | 2570 | $i = -1; |
2571 | 2571 | |
2572 | 2572 | $sql = "SELECT s.rowid, s.client, s.fournisseur, s.nom as name, s.name_alias, s.email, s.address, s.zip, s.town, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.canvas, s.status"; |
2573 | - $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; |
|
2574 | - $sql .= " WHERE s.parent = " . ((int) $object->id); |
|
2575 | - $sql .= " AND s.entity IN (" . getEntity('societe') . ")"; |
|
2573 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; |
|
2574 | + $sql .= " WHERE s.parent = ".((int) $object->id); |
|
2575 | + $sql .= " AND s.entity IN (".getEntity('societe').")"; |
|
2576 | 2576 | $sql .= " ORDER BY s.nom"; |
2577 | 2577 | |
2578 | 2578 | $result = $db->query($sql); |
@@ -2583,12 +2583,12 @@ discard block |
||
2583 | 2583 | |
2584 | 2584 | print load_fiche_titre($langs->trans("Subsidiaries"), '', ''); |
2585 | 2585 | |
2586 | - print "\n" . '<div class="div-table-responsive-no-min">' . "\n"; |
|
2587 | - print '<table class="noborder centpercent">' . "\n"; |
|
2586 | + print "\n".'<div class="div-table-responsive-no-min">'."\n"; |
|
2587 | + print '<table class="noborder centpercent">'."\n"; |
|
2588 | 2588 | |
2589 | - print '<tr class="liste_titre"><td>' . $langs->trans("Company") . '</td>'; |
|
2590 | - print '<td>' . $langs->trans("Address") . '</td><td>' . $langs->trans("Zip") . '</td>'; |
|
2591 | - print '<td>' . $langs->trans("Town") . '</td><td>' . $langs->trans("CustomerCode") . '</td>'; |
|
2589 | + print '<tr class="liste_titre"><td>'.$langs->trans("Company").'</td>'; |
|
2590 | + print '<td>'.$langs->trans("Address").'</td><td>'.$langs->trans("Zip").'</td>'; |
|
2591 | + print '<td>'.$langs->trans("Town").'</td><td>'.$langs->trans("CustomerCode").'</td>'; |
|
2592 | 2592 | print "<td> </td>"; |
2593 | 2593 | print "</tr>"; |
2594 | 2594 | |
@@ -2618,13 +2618,13 @@ discard block |
||
2618 | 2618 | print $socstatic->getNomUrl(1); |
2619 | 2619 | print '</td>'; |
2620 | 2620 | |
2621 | - print '<td class="tdoverflowmax400" title="' . dol_escape_htmltag($obj->address) . '">' . dol_escape_htmltag($obj->address) . '</td>'; |
|
2622 | - print '<td class="tdoverflowmax100" title="' . dol_escape_htmltag($obj->zip) . '">' . $obj->zip . '</td>'; |
|
2623 | - print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->town) . '">' . $obj->town . '</td>'; |
|
2624 | - print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag($obj->code_client) . '">' . $obj->code_client . '</td>'; |
|
2621 | + print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->address).'">'.dol_escape_htmltag($obj->address).'</td>'; |
|
2622 | + print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).'">'.$obj->zip.'</td>'; |
|
2623 | + print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).'">'.$obj->town.'</td>'; |
|
2624 | + print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->code_client).'">'.$obj->code_client.'</td>'; |
|
2625 | 2625 | |
2626 | 2626 | print '<td class="center">'; |
2627 | - print '<a class="editfielda" href="' . DOL_URL_ROOT . '/societe/card.php?socid=' . ((int) $obj->rowid) . '&action=edit&token=' . newToken() . '">'; |
|
2627 | + print '<a class="editfielda" href="'.DOL_URL_ROOT.'/societe/card.php?socid='.((int) $obj->rowid).'&action=edit&token='.newToken().'">'; |
|
2628 | 2628 | print img_edit(); |
2629 | 2629 | print '</a></td>'; |
2630 | 2630 | |
@@ -2632,7 +2632,7 @@ discard block |
||
2632 | 2632 | $i++; |
2633 | 2633 | } |
2634 | 2634 | print "\n</table>\n"; |
2635 | - print '</div>' . "\n"; |
|
2635 | + print '</div>'."\n"; |
|
2636 | 2636 | } |
2637 | 2637 | |
2638 | 2638 | print "<br>\n"; |
@@ -2675,7 +2675,7 @@ discard block |
||
2675 | 2675 | } elseif ($actioncode == 'AC_ALL_AUTO') { |
2676 | 2676 | $sql .= " $sqlANDOR c.type = 'systemauto'"; |
2677 | 2677 | } else { |
2678 | - $sql .= " $sqlANDOR c.code = '" . $db->escape($actioncode) . "'"; |
|
2678 | + $sql .= " $sqlANDOR c.code = '".$db->escape($actioncode)."'"; |
|
2679 | 2679 | } |
2680 | 2680 | } |
2681 | 2681 | |
@@ -2696,9 +2696,9 @@ discard block |
||
2696 | 2696 | global $db; |
2697 | 2697 | |
2698 | 2698 | if ($donetodo == 'todo') { |
2699 | - $sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '" . $db->idate($now) . "'))"; |
|
2699 | + $sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; |
|
2700 | 2700 | } elseif ($donetodo == 'done') { |
2701 | - $sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '" . $db->idate($now) . "'))"; |
|
2701 | + $sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; |
|
2702 | 2702 | } |
2703 | 2703 | if (is_array($filters) && !empty($filters['search_agenda_label'])) { |
2704 | 2704 | $sql .= natural_search('a.label', $filters['search_agenda_label']); |
@@ -2739,8 +2739,8 @@ discard block |
||
2739 | 2739 | } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { |
2740 | 2740 | $sql2 .= ", '' as ref"; |
2741 | 2741 | } |
2742 | - $sql2 .= " FROM " . MAIN_DB_PREFIX . "mailing as m, " . MAIN_DB_PREFIX . "mailing_cibles as mc, " . MAIN_DB_PREFIX . "user as u"; |
|
2743 | - $sql2 .= " WHERE mc.email = '" . $db->escape($objcon->email) . "'"; // Search is done on email. |
|
2742 | + $sql2 .= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u"; |
|
2743 | + $sql2 .= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email. |
|
2744 | 2744 | $sql2 .= " AND mc.statut = 1"; |
2745 | 2745 | $sql2 .= " AND u.rowid = m.fk_user_valid"; |
2746 | 2746 | $sql2 .= " AND mc.fk_mailing=m.rowid"; |
@@ -2782,15 +2782,15 @@ discard block |
||
2782 | 2782 | //$urllogo = ''; |
2783 | 2783 | $urllogopublic = ''; |
2784 | 2784 | if ($showlogo) { |
2785 | - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $logosmall)) { |
|
2785 | + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { |
|
2786 | 2786 | //$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$logosmall); |
2787 | - $urllogopublic = $dolibarr_main_url_root . '/viewimage.php?modulepart=mycompany&entity=' . $conf->entity . '&file=' . urlencode('logos/thumbs/' . $logosmall); |
|
2788 | - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $logo)) { |
|
2787 | + $urllogopublic = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); |
|
2788 | + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { |
|
2789 | 2789 | //$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$logo); |
2790 | - $urllogopublic = $dolibarr_main_url_root . '/viewimage.php?modulepart=mycompany&entity=' . $conf->entity . '&file=' . urlencode('logos/' . $logo); |
|
2791 | - } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) { |
|
2790 | + $urllogopublic = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); |
|
2791 | + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { |
|
2792 | 2792 | //$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; |
2793 | - $urllogopublic = $dolibarr_main_url_root . '/theme/dolibarr_logo.svg'; |
|
2793 | + $urllogopublic = $dolibarr_main_url_root.'/theme/dolibarr_logo.svg'; |
|
2794 | 2794 | } |
2795 | 2795 | } |
2796 | 2796 | |
@@ -2802,19 +2802,19 @@ discard block |
||
2802 | 2802 | print '<div class="logopublicpayment">'; |
2803 | 2803 | if ($urllogopublic) { |
2804 | 2804 | if (!is_numeric($showlogo)) { |
2805 | - print '<a href="' . $showlogo . '">'; |
|
2805 | + print '<a href="'.$showlogo.'">'; |
|
2806 | 2806 | } |
2807 | - print '<img id="dolpaymentlogo" src="' . $urllogopublic . '">'; |
|
2807 | + print '<img id="dolpaymentlogo" src="'.$urllogopublic.'">'; |
|
2808 | 2808 | if (!is_numeric($showlogo)) { |
2809 | 2809 | print '</a>'; |
2810 | 2810 | } |
2811 | 2811 | } |
2812 | 2812 | if ($alttext) { |
2813 | - print '<div class="clearboth"></div><strong>' . $alttext . '</strong>'; |
|
2813 | + print '<div class="clearboth"></div><strong>'.$alttext.'</strong>'; |
|
2814 | 2814 | } |
2815 | 2815 | print '</div>'; |
2816 | 2816 | if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { |
2817 | - print '<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">' . $langs->trans("PoweredBy") . '<br><img class="poweredbyimg" src="' . DOL_URL_ROOT . '/theme/dolibarr_logo.svg" width="80px"></a></div>'; |
|
2817 | + print '<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>'; |
|
2818 | 2818 | } |
2819 | 2819 | print '</div>'; |
2820 | 2820 | } |
@@ -2822,7 +2822,7 @@ discard block |
||
2822 | 2822 | // Add an optional image under the ban with logo/title |
2823 | 2823 | if (getDolGlobalString($subimageconst)) { |
2824 | 2824 | print '<div class="backimagepublicsubimage">'; |
2825 | - print '<img id="id' . $subimageconst . '" src="' . getDolGlobalString($subimageconst) . '">'; |
|
2825 | + print '<img id="id'.$subimageconst.'" src="'.getDolGlobalString($subimageconst).'">'; |
|
2826 | 2826 | print '</div>'; |
2827 | 2827 | } |
2828 | 2828 | |
@@ -2849,11 +2849,11 @@ discard block |
||
2849 | 2849 | // Juridical status |
2850 | 2850 | $line1 = ""; |
2851 | 2851 | if ($fromcompany->forme_juridique_code) { |
2852 | - $line1 .= ($line1 ? " - " : "") . getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code); |
|
2852 | + $line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code); |
|
2853 | 2853 | } |
2854 | 2854 | // Capital |
2855 | 2855 | if ($fromcompany->capital) { |
2856 | - $line1 .= ($line1 ? " - " : "") . $langs->transnoentities("CapitalOf", (string) $fromcompany->capital) . " " . $langs->transnoentities("Currency" . $conf->currency); |
|
2856 | + $line1 .= ($line1 ? " - " : "").$langs->transnoentities("CapitalOf", (string) $fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); |
|
2857 | 2857 | } |
2858 | 2858 | // Prof Id 1 |
2859 | 2859 | if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) { |
@@ -2861,7 +2861,7 @@ discard block |
||
2861 | 2861 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
2862 | 2862 | $field = $reg[1]; |
2863 | 2863 | } |
2864 | - $line1 .= ($line1 ? " - " : "") . $field . ": " . $fromcompany->idprof1; |
|
2864 | + $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof1; |
|
2865 | 2865 | } |
2866 | 2866 | // Prof Id 2 |
2867 | 2867 | if ($fromcompany->idprof2) { |
@@ -2869,7 +2869,7 @@ discard block |
||
2869 | 2869 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
2870 | 2870 | $field = $reg[1]; |
2871 | 2871 | } |
2872 | - $line1 .= ($line1 ? " - " : "") . $field . ": " . $fromcompany->idprof2; |
|
2872 | + $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof2; |
|
2873 | 2873 | } |
2874 | 2874 | |
2875 | 2875 | // Second line of company infos |
@@ -2880,7 +2880,7 @@ discard block |
||
2880 | 2880 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
2881 | 2881 | $field = $reg[1]; |
2882 | 2882 | } |
2883 | - $line2 .= ($line2 ? " - " : "") . $field . ": " . $fromcompany->idprof3; |
|
2883 | + $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof3; |
|
2884 | 2884 | } |
2885 | 2885 | // Prof Id 4 |
2886 | 2886 | if ($fromcompany->idprof4) { |
@@ -2888,33 +2888,33 @@ discard block |
||
2888 | 2888 | if (preg_match('/\((.*)\)/i', $field, $reg)) { |
2889 | 2889 | $field = $reg[1]; |
2890 | 2890 | } |
2891 | - $line2 .= ($line2 ? " - " : "") . $field . ": " . $fromcompany->idprof4; |
|
2891 | + $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof4; |
|
2892 | 2892 | } |
2893 | 2893 | // IntraCommunautary VAT |
2894 | 2894 | if ($fromcompany->tva_intra != '') { |
2895 | - $line2 .= ($line2 ? " - " : "") . $langs->transnoentities("VATIntraShort") . ": " . $fromcompany->tva_intra; |
|
2895 | + $line2 .= ($line2 ? " - " : "").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra; |
|
2896 | 2896 | } |
2897 | 2897 | |
2898 | - print '<!-- htmlPrintOnlineFooter -->' . "\n"; |
|
2898 | + print '<!-- htmlPrintOnlineFooter -->'."\n"; |
|
2899 | 2899 | |
2900 | 2900 | // css centpercent has been removed from class="..." because not compatible with paddingleft/right and there is an horizontal scroll appearring on payment page for example. |
2901 | - print '<footer class="center centpercent opacitymedium">' . "\n"; |
|
2901 | + print '<footer class="center centpercent opacitymedium">'."\n"; |
|
2902 | 2902 | print '<br>'; |
2903 | 2903 | if ($addformmessage) { |
2904 | - print '<!-- object = ' . (empty($object) ? 'undefined' : $object->element) . ' -->'; |
|
2904 | + print '<!-- object = '.(empty($object) ? 'undefined' : $object->element).' -->'; |
|
2905 | 2905 | print '<br>'; |
2906 | 2906 | |
2907 | - $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_' . $suffix; |
|
2907 | + $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; |
|
2908 | 2908 | if (getDolGlobalString($parammessageform) !== '') { |
2909 | 2909 | print $langs->transnoentities(getDolGlobalString($parammessageform)); |
2910 | - } elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM') !== '') { |
|
2910 | + } elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM') !== '') { |
|
2911 | 2911 | print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM')); |
2912 | 2912 | } |
2913 | 2913 | |
2914 | 2914 | // Add other message if VAT exists |
2915 | 2915 | if (!empty($object->total_vat) || !empty($object->total_tva)) { |
2916 | - $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_' . $suffix; |
|
2917 | - if (getDolGlobalString($parammessageform) !== '') { |
|
2916 | + $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; |
|
2917 | + if (getDolGlobalString($parammessageform) !== '') { |
|
2918 | 2918 | print $langs->transnoentities(getDolGlobalString($parammessageform)); |
2919 | 2919 | } elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT') !== '') { |
2920 | 2920 | print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT')); |
@@ -2922,15 +2922,15 @@ discard block |
||
2922 | 2922 | } |
2923 | 2923 | } |
2924 | 2924 | |
2925 | - print '<span style="font-size: 10px;"><br><hr>' . "\n"; |
|
2926 | - print $fromcompany->name . '<br>'; |
|
2925 | + print '<span style="font-size: 10px;"><br><hr>'."\n"; |
|
2926 | + print $fromcompany->name.'<br>'; |
|
2927 | 2927 | print $line1; |
2928 | - if (strlen($line1 . $line2) > 50) { |
|
2928 | + if (strlen($line1.$line2) > 50) { |
|
2929 | 2929 | print '<br>'; |
2930 | 2930 | } else { |
2931 | 2931 | print ' - '; |
2932 | 2932 | } |
2933 | 2933 | print $line2; |
2934 | 2934 | print '</span>'; |
2935 | - print '</footer>' . "\n"; |
|
2935 | + print '</footer>'."\n"; |
|
2936 | 2936 | } |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | * |
477 | 477 | * Note: cond_reglement can not be aliased to cond_reglement!!! |
478 | 478 | */ |
479 | - private $cond_reglement; // Private to call DolDeprecationHandler |
|
479 | + private $cond_reglement; // Private to call DolDeprecationHandler |
|
480 | 480 | /** |
481 | 481 | * @var int|string Internal to detect deprecated access |
482 | 482 | */ |
483 | - protected $depr_cond_reglement; // Internal value for deprecation |
|
483 | + protected $depr_cond_reglement; // Internal value for deprecation |
|
484 | 484 | |
485 | 485 | /** |
486 | 486 | * @var int Delivery address ID |
@@ -532,12 +532,12 @@ discard block |
||
532 | 532 | /** |
533 | 533 | * @var float|string Multicurrency total localtax1 |
534 | 534 | */ |
535 | - public $multicurrency_total_localtax1; // not in database |
|
535 | + public $multicurrency_total_localtax1; // not in database |
|
536 | 536 | |
537 | 537 | /** |
538 | 538 | * @var float|string Multicurrency total localtax2 |
539 | 539 | */ |
540 | - public $multicurrency_total_localtax2; // not in database |
|
540 | + public $multicurrency_total_localtax2; // not in database |
|
541 | 541 | |
542 | 542 | /** |
543 | 543 | * @var float Multicurrency total amount including taxes (TTC = "Toutes Taxes Comprises" in French) |
@@ -1034,17 +1034,17 @@ discard block |
||
1034 | 1034 | } |
1035 | 1035 | $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); |
1036 | 1036 | if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { |
1037 | - $data[$key] = '<br><b><u>'. $labelextra . '</u></b>'; |
|
1037 | + $data[$key] = '<br><b><u>'.$labelextra.'</u></b>'; |
|
1038 | 1038 | } else { |
1039 | - $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); |
|
1040 | - $data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1039 | + $value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]); |
|
1040 | + $data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1041 | 1041 | $count++; |
1042 | 1042 | } |
1043 | 1043 | } |
1044 | 1044 | $data['closedivextra'] = '</div>'; |
1045 | 1045 | } |
1046 | 1046 | |
1047 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1047 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1048 | 1048 | $parameters = array( |
1049 | 1049 | 'tooltipcontentarray' => &$data, |
1050 | 1050 | 'params' => $params, |
@@ -1264,8 +1264,8 @@ discard block |
||
1264 | 1264 | |
1265 | 1265 | if ($this->restrictiononfksoc && property_exists($this, 'socid') && !empty($this->socid) && !$user->hasRight('societe', 'client', 'voir')) { |
1266 | 1266 | $sql_allowed_contacts = 'SELECT COUNT(*) as cnt FROM '.$this->db->prefix().'societe_commerciaux as sc'; |
1267 | - $sql_allowed_contacts.= ' WHERE sc.fk_soc = '.(int) $this->socid; |
|
1268 | - $sql_allowed_contacts.= ' AND sc.fk_user = '.(int) $user->id; |
|
1267 | + $sql_allowed_contacts .= ' WHERE sc.fk_soc = '.(int) $this->socid; |
|
1268 | + $sql_allowed_contacts .= ' AND sc.fk_user = '.(int) $user->id; |
|
1269 | 1269 | |
1270 | 1270 | $resql_allowed_contacts = $this->db->query($sql_allowed_contacts); |
1271 | 1271 | |
@@ -1564,7 +1564,7 @@ discard block |
||
1564 | 1564 | $sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")"; |
1565 | 1565 | } |
1566 | 1566 | if ($status >= 0) { |
1567 | - $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1567 | + $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1568 | 1568 | } |
1569 | 1569 | if ($statusoflink >= 0) { |
1570 | 1570 | $sql .= " AND ec.statut = ".((int) $statusoflink); |
@@ -1953,7 +1953,7 @@ discard block |
||
1953 | 1953 | } |
1954 | 1954 | |
1955 | 1955 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element; |
1956 | - $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1956 | + $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1957 | 1957 | $sql .= " LIMIT 1"; |
1958 | 1958 | |
1959 | 1959 | $query = $this->db->query($sql); |
@@ -2272,9 +2272,9 @@ discard block |
||
2272 | 2272 | |
2273 | 2273 | $oldvalue = null; |
2274 | 2274 | if ($trigkey) { |
2275 | - $sql = "SELECT " . $field; |
|
2276 | - $sql .= " FROM " . MAIN_DB_PREFIX . $table; |
|
2277 | - $sql .= " WHERE " . $id_field . " = " . ((int) $id); |
|
2275 | + $sql = "SELECT ".$field; |
|
2276 | + $sql .= " FROM ".MAIN_DB_PREFIX.$table; |
|
2277 | + $sql .= " WHERE ".$id_field." = ".((int) $id); |
|
2278 | 2278 | |
2279 | 2279 | $resql = $this->db->query($sql); |
2280 | 2280 | if ($resql) { |
@@ -2654,7 +2654,7 @@ discard block |
||
2654 | 2654 | // Triggers |
2655 | 2655 | if (!$error && !$notrigger) { |
2656 | 2656 | // Call triggers |
2657 | - $result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user); |
|
2657 | + $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); |
|
2658 | 2658 | if ($result < 0) { |
2659 | 2659 | $error++; |
2660 | 2660 | } //Do also here what you must do to rollback action if trigger fail |
@@ -3066,7 +3066,7 @@ discard block |
||
3066 | 3066 | $sql = 'UPDATE '.$this->db->prefix().$this->table_element; |
3067 | 3067 | $sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL'); |
3068 | 3068 | if (in_array($this->table_element, array('propal', 'commande', 'societe'))) { |
3069 | - $sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'"); |
|
3069 | + $sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'"); |
|
3070 | 3070 | } |
3071 | 3071 | $sql .= ' WHERE rowid='.((int) $this->id); |
3072 | 3072 | |
@@ -3413,10 +3413,10 @@ discard block |
||
3413 | 3413 | $sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line; |
3414 | 3414 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3415 | 3415 | if (!$renum) { |
3416 | - $sql .= " AND " . $fieldposition . " = 0"; |
|
3416 | + $sql .= " AND ".$fieldposition." = 0"; |
|
3417 | 3417 | } |
3418 | 3418 | if ($renum) { |
3419 | - $sql .= " AND " . $fieldposition . " <> 0"; |
|
3419 | + $sql .= " AND ".$fieldposition." <> 0"; |
|
3420 | 3420 | } |
3421 | 3421 | |
3422 | 3422 | dol_syslog(get_class($this)."::line_order", LOG_DEBUG); |
@@ -3437,7 +3437,7 @@ discard block |
||
3437 | 3437 | if ($fk_parent_line) { |
3438 | 3438 | $sql .= ' AND fk_parent_line IS NULL'; |
3439 | 3439 | } |
3440 | - $sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder; |
|
3440 | + $sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder; |
|
3441 | 3441 | |
3442 | 3442 | dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); |
3443 | 3443 | $resql = $this->db->query($sql); |
@@ -3491,7 +3491,7 @@ discard block |
||
3491 | 3491 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3492 | 3492 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3493 | 3493 | $sql .= ' AND fk_parent_line = '.((int) $id); |
3494 | - $sql .= " ORDER BY " . $fieldposition . " ASC"; |
|
3494 | + $sql .= " ORDER BY ".$fieldposition." ASC"; |
|
3495 | 3495 | |
3496 | 3496 | dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG); |
3497 | 3497 | |
@@ -3618,7 +3618,7 @@ discard block |
||
3618 | 3618 | |
3619 | 3619 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3620 | 3620 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3621 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1)); |
|
3621 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang - 1)); |
|
3622 | 3622 | if (!$this->db->query($sql)) { |
3623 | 3623 | $this->error = $this->db->lasterror(); |
3624 | 3624 | return -1; |
@@ -3655,7 +3655,7 @@ discard block |
||
3655 | 3655 | |
3656 | 3656 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3657 | 3657 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3658 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1)); |
|
3658 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang + 1)); |
|
3659 | 3659 | if (!$this->db->query($sql)) { |
3660 | 3660 | $this->error = $this->db->lasterror(); |
3661 | 3661 | return -1; |
@@ -3684,7 +3684,7 @@ discard block |
||
3684 | 3684 | $fieldposition = 'position'; |
3685 | 3685 | } |
3686 | 3686 | |
3687 | - $sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line; |
|
3687 | + $sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line; |
|
3688 | 3688 | $sql .= " WHERE rowid = ".((int) $rowid); |
3689 | 3689 | |
3690 | 3690 | dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); |
@@ -3712,7 +3712,7 @@ discard block |
||
3712 | 3712 | |
3713 | 3713 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3714 | 3714 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3715 | - $sql .= " AND " . $fieldposition . " = ".((int) $rang); |
|
3715 | + $sql .= " AND ".$fieldposition." = ".((int) $rang); |
|
3716 | 3716 | $resql = $this->db->query($sql); |
3717 | 3717 | if (!$resql) { |
3718 | 3718 | return 0; |
@@ -3826,7 +3826,7 @@ discard block |
||
3826 | 3826 | $newsuffix = ''; |
3827 | 3827 | } |
3828 | 3828 | if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) { |
3829 | - $fieldusermod = "fk_user_mod"; |
|
3829 | + $fieldusermod = "fk_user_mod"; |
|
3830 | 3830 | } elseif ($this->table_element == 'ecm_files') { |
3831 | 3831 | $fieldusermod = "fk_user_m"; |
3832 | 3832 | } else { |
@@ -3868,7 +3868,7 @@ discard block |
||
3868 | 3868 | $trigger_name = 'EXPENSE_REPORT_MODIFY'; |
3869 | 3869 | break; |
3870 | 3870 | default: |
3871 | - $trigger_name = strtoupper($this->element) . '_MODIFY'; |
|
3871 | + $trigger_name = strtoupper($this->element).'_MODIFY'; |
|
3872 | 3872 | } |
3873 | 3873 | $ret = $this->call_trigger($trigger_name, $user); |
3874 | 3874 | if ($ret < 0) { |
@@ -4166,7 +4166,7 @@ discard block |
||
4166 | 4166 | // Situations totals |
4167 | 4167 | if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) { // @phan-suppress-current-line PhanUndeclaredProperty |
4168 | 4168 | '@phan-var-force Facture $this'; |
4169 | - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded |
|
4169 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded |
|
4170 | 4170 | if ($this->type != Facture::TYPE_CREDIT_NOTE) { // @phpstan-ignore-line |
4171 | 4171 | if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) { |
4172 | 4172 | $prev_sits = $this->get_prev_sits(); |
@@ -4292,19 +4292,19 @@ discard block |
||
4292 | 4292 | $this->db->begin(); |
4293 | 4293 | $error = 0; |
4294 | 4294 | |
4295 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
4295 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
4296 | 4296 | $sql .= "fk_source"; |
4297 | 4297 | $sql .= ", sourcetype"; |
4298 | 4298 | $sql .= ", fk_target"; |
4299 | 4299 | $sql .= ", targettype"; |
4300 | 4300 | $sql .= ") VALUES ("; |
4301 | 4301 | $sql .= ((int) $origin_id); |
4302 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
4303 | - $sql .= ", " . ((int) $this->id); |
|
4304 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
4302 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
4303 | + $sql .= ", ".((int) $this->id); |
|
4304 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
4305 | 4305 | $sql .= ")"; |
4306 | 4306 | |
4307 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
4307 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
4308 | 4308 | if ($this->db->query($sql)) { |
4309 | 4309 | if (!$notrigger) { |
4310 | 4310 | // Call trigger |
@@ -4575,20 +4575,20 @@ discard block |
||
4575 | 4575 | $this->db->begin(); |
4576 | 4576 | $error = 0; |
4577 | 4577 | |
4578 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
4578 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
4579 | 4579 | if ($updatesource) { |
4580 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
4581 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4582 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
4583 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4580 | + $sql .= "fk_source = ".((int) $sourceid); |
|
4581 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4582 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
4583 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
4584 | 4584 | } elseif ($updatetarget) { |
4585 | - $sql .= "fk_target = " . ((int) $targetid); |
|
4586 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
4587 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
4588 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4585 | + $sql .= "fk_target = ".((int) $targetid); |
|
4586 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
4587 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
4588 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4589 | 4589 | } |
4590 | 4590 | |
4591 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
4591 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
4592 | 4592 | if ($this->db->query($sql)) { |
4593 | 4593 | if (!$notrigger) { |
4594 | 4594 | // Call trigger |
@@ -4665,25 +4665,25 @@ discard block |
||
4665 | 4665 | } |
4666 | 4666 | |
4667 | 4667 | if (!$error) { |
4668 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
4668 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
4669 | 4669 | $sql .= " WHERE"; |
4670 | 4670 | if ($rowid > 0) { |
4671 | - $sql .= " rowid = " . ((int) $rowid); |
|
4671 | + $sql .= " rowid = ".((int) $rowid); |
|
4672 | 4672 | } else { |
4673 | 4673 | if ($deletesource) { |
4674 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4675 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "'"; |
|
4674 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4675 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."'"; |
|
4676 | 4676 | } elseif ($deletetarget) { |
4677 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
4678 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "'"; |
|
4677 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
4678 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."'"; |
|
4679 | 4679 | } else { |
4680 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "')"; |
|
4680 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."')"; |
|
4681 | 4681 | $sql .= " OR"; |
4682 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "')"; |
|
4682 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."')"; |
|
4683 | 4683 | } |
4684 | 4684 | } |
4685 | 4685 | |
4686 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
4686 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
4687 | 4687 | if (!$this->db->query($sql)) { |
4688 | 4688 | $this->error = $this->db->lasterror(); |
4689 | 4689 | $this->errors[] = $this->error; |
@@ -4848,14 +4848,14 @@ discard block |
||
4848 | 4848 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
4849 | 4849 | } |
4850 | 4850 | $sql .= " WHERE rowid = ".((int) $elementId); |
4851 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4851 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4852 | 4852 | |
4853 | 4853 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
4854 | 4854 | $resql = $this->db->query($sql); |
4855 | 4855 | if ($resql) { |
4856 | 4856 | $error = 0; |
4857 | 4857 | |
4858 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4858 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4859 | 4859 | |
4860 | 4860 | if ($nb_rows_affected > 0) { |
4861 | 4861 | if (empty($trigkey)) { |
@@ -4902,9 +4902,9 @@ discard block |
||
4902 | 4902 | if ($fieldstatus == 'tosell') { |
4903 | 4903 | $this->status = $status; |
4904 | 4904 | } elseif ($fieldstatus == 'tobuy') { |
4905 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
4905 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
4906 | 4906 | } elseif ($fieldstatus == 'tobatch') { |
4907 | - $this->status_batch = $status; // @phpstan-ignore-line |
|
4907 | + $this->status_batch = $status; // @phpstan-ignore-line |
|
4908 | 4908 | } else { |
4909 | 4909 | $this->status = $status; |
4910 | 4910 | } |
@@ -5010,7 +5010,7 @@ discard block |
||
5010 | 5010 | return -1; |
5011 | 5011 | } |
5012 | 5012 | |
5013 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
5013 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
5014 | 5014 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
5015 | 5015 | $tmparray = array_keys($this->childtables); |
5016 | 5016 | if (is_numeric($tmparray[0])) { |
@@ -6063,7 +6063,7 @@ discard block |
||
6063 | 6063 | } else { |
6064 | 6064 | // TODO: Try to set type above again |
6065 | 6065 | '@phan-var-force ModeleBarCode|ModeleExports|ModeleImports|ModelePDFAsset|ModelePDFContract|ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|ModelePDFRecruitmentJobPosition|ModelePDFStock|ModelePDFStockTransfer|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePDFTask|ModelePDFTicket|ModelePDFUser|ModelePDFUserGroup|ModelePdfExpedition|ModelePdfReception|ModeleThirdPartyDoc $obj'; |
6066 | - $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument |
|
6066 | + $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument |
|
6067 | 6067 | } |
6068 | 6068 | // After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index. |
6069 | 6069 | |
@@ -6136,7 +6136,7 @@ discard block |
||
6136 | 6136 | $setsharekey = false; |
6137 | 6137 | if ($this->element == 'propal' || $this->element == 'proposal') { |
6138 | 6138 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
6139 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
6139 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
6140 | 6140 | } |
6141 | 6141 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
6142 | 6142 | $setsharekey = true; |
@@ -6196,7 +6196,7 @@ discard block |
||
6196 | 6196 | $ecmfile->gen_or_uploaded = 'generated'; |
6197 | 6197 | $ecmfile->description = ''; // indexed content |
6198 | 6198 | $ecmfile->keywords = ''; // keyword content |
6199 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
6199 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
6200 | 6200 | $ecmfile->src_object_id = $this->id; |
6201 | 6201 | |
6202 | 6202 | $result = $ecmfile->create($user); |
@@ -6499,7 +6499,7 @@ discard block |
||
6499 | 6499 | $savDisableCompute = $conf->disable_compute; |
6500 | 6500 | $conf->disable_compute = 1; |
6501 | 6501 | |
6502 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6502 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6503 | 6503 | |
6504 | 6504 | $conf->disable_compute = $savDisableCompute; |
6505 | 6505 | |
@@ -6561,7 +6561,7 @@ discard block |
||
6561 | 6561 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
6562 | 6562 | $sql = "SELECT rowid"; |
6563 | 6563 | foreach ($optionsArray as $name => $label) { |
6564 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
6564 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
6565 | 6565 | $sql .= ", ".$name; |
6566 | 6566 | } |
6567 | 6567 | // use geo sql fonction to read as text |
@@ -6606,7 +6606,7 @@ discard block |
||
6606 | 6606 | **/ |
6607 | 6607 | if (is_array($extrafields->attributes[$this->table_element]['label'])) { |
6608 | 6608 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
6609 | - $this->array_options['options_' . $key] = null; |
|
6609 | + $this->array_options['options_'.$key] = null; |
|
6610 | 6610 | } |
6611 | 6611 | } |
6612 | 6612 | } |
@@ -6618,9 +6618,9 @@ discard block |
||
6618 | 6618 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
6619 | 6619 | //var_dump($conf->disable_compute); |
6620 | 6620 | if (empty($conf->disable_compute)) { |
6621 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
6622 | - $objectoffield = $this; // we can use it inside computed formula |
|
6623 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6621 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
6622 | + $objectoffield = $this; // we can use it inside computed formula |
|
6623 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6624 | 6624 | } |
6625 | 6625 | } |
6626 | 6626 | } |
@@ -6806,7 +6806,7 @@ discard block |
||
6806 | 6806 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
6807 | 6807 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6808 | 6808 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6809 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6809 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6810 | 6810 | } else { |
6811 | 6811 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6812 | 6812 | } |
@@ -6817,7 +6817,7 @@ discard block |
||
6817 | 6817 | // If value has changed |
6818 | 6818 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6819 | 6819 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6820 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6820 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6821 | 6821 | } else { |
6822 | 6822 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6823 | 6823 | } |
@@ -6829,7 +6829,7 @@ discard block |
||
6829 | 6829 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
6830 | 6830 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
6831 | 6831 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
6832 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6832 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6833 | 6833 | } else { |
6834 | 6834 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6835 | 6835 | } |
@@ -6874,9 +6874,9 @@ discard block |
||
6874 | 6874 | |
6875 | 6875 | $sqlFetchObject = "SELECT rowid FROM ".$this->db->prefix().$object->table_element; |
6876 | 6876 | if (is_numeric($value)) { |
6877 | - $sqlFetchObject .= " WHERE rowid = " . (int) $value; |
|
6877 | + $sqlFetchObject .= " WHERE rowid = ".(int) $value; |
|
6878 | 6878 | } else { |
6879 | - $sqlFetchObject .= " WHERE ref = '" . $this->db->escape($value) . "'"; |
|
6879 | + $sqlFetchObject .= " WHERE ref = '".$this->db->escape($value)."'"; |
|
6880 | 6880 | } |
6881 | 6881 | |
6882 | 6882 | $obj = $this->db->getRow($sqlFetchObject); |
@@ -6921,7 +6921,7 @@ discard block |
||
6921 | 6921 | } |
6922 | 6922 | $geoDataType = ExtraFields::$geoDataTypes[$attributeType] ?? null; |
6923 | 6923 | // Add field of attribute |
6924 | - if (! $geoDataType) { |
|
6924 | + if (!$geoDataType) { |
|
6925 | 6925 | // not a geodata type |
6926 | 6926 | if ($newValue != '') { |
6927 | 6927 | $sqlColumnValues[$attributeKey] = "'".$this->db->escape($newValue)."'"; |
@@ -6957,7 +6957,7 @@ discard block |
||
6957 | 6957 | if ($table_element == 'categorie') { |
6958 | 6958 | $table_element = 'categories'; // For compatibility |
6959 | 6959 | } |
6960 | - $extrafieldsTable = $this->db->prefix() . $table_element . '_extrafields'; |
|
6960 | + $extrafieldsTable = $this->db->prefix().$table_element.'_extrafields'; |
|
6961 | 6961 | |
6962 | 6962 | dol_syslog(get_class($this)."::insertExtraFields delete then insert", LOG_DEBUG); |
6963 | 6963 | |
@@ -6970,7 +6970,7 @@ discard block |
||
6970 | 6970 | * @param string $key |
6971 | 6971 | * @return string |
6972 | 6972 | */ |
6973 | - array_map(function ($key) use ($sqlColumnValues) { |
|
6973 | + array_map(function($key) use ($sqlColumnValues) { |
|
6974 | 6974 | return "{$key} = {$sqlColumnValues[$key]}"; |
6975 | 6975 | }, array_keys($sqlColumnValues)) |
6976 | 6976 | ); |
@@ -7266,7 +7266,7 @@ discard block |
||
7266 | 7266 | if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
7267 | 7267 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
7268 | 7268 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
7269 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7269 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7270 | 7270 | } else { |
7271 | 7271 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7272 | 7272 | } |
@@ -7286,7 +7286,7 @@ discard block |
||
7286 | 7286 | } |
7287 | 7287 | } else { |
7288 | 7288 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
7289 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7289 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7290 | 7290 | } else { |
7291 | 7291 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7292 | 7292 | } |
@@ -7875,7 +7875,7 @@ discard block |
||
7875 | 7875 | // 7 : sort field |
7876 | 7876 | |
7877 | 7877 | // If there is filter |
7878 | - if (! empty($InfoFieldList[4])) { |
|
7878 | + if (!empty($InfoFieldList[4])) { |
|
7879 | 7879 | $pos = 0; |
7880 | 7880 | $parenthesisopen = 0; |
7881 | 7881 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7939,8 +7939,8 @@ discard block |
||
7939 | 7939 | } |
7940 | 7940 | |
7941 | 7941 | $sqlwhere = ''; |
7942 | - $sql = "SELECT " . $keyList; |
|
7943 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
7942 | + $sql = "SELECT ".$keyList; |
|
7943 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
7944 | 7944 | |
7945 | 7945 | if (!empty($InfoFieldList[4])) { |
7946 | 7946 | // can use SELECT request |
@@ -7958,11 +7958,11 @@ discard block |
||
7958 | 7958 | // We have to join on extrafield table |
7959 | 7959 | $errstr = ''; |
7960 | 7960 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7961 | - $sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra"; |
|
7962 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
7963 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7961 | + $sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra"; |
|
7962 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
7963 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7964 | 7964 | } else { |
7965 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7965 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7966 | 7966 | } |
7967 | 7967 | } else { |
7968 | 7968 | $sqlwhere .= ' WHERE 1=1'; |
@@ -7983,7 +7983,7 @@ discard block |
||
7983 | 7983 | |
7984 | 7984 | // Some tables may have field, some other not. For the moment we disable it. |
7985 | 7985 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7986 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7986 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7987 | 7987 | } |
7988 | 7988 | $sql .= $sqlwhere; |
7989 | 7989 | |
@@ -7993,10 +7993,10 @@ discard block |
||
7993 | 7993 | } else { |
7994 | 7994 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
7995 | 7995 | } |
7996 | - $sql .= ' LIMIT ' . getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000); |
|
7996 | + $sql .= ' LIMIT '.getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000); |
|
7997 | 7997 | // print $sql; |
7998 | 7998 | |
7999 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
7999 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
8000 | 8000 | $resql = $this->db->query($sql); |
8001 | 8001 | if ($resql) { |
8002 | 8002 | $out .= '<option value="0"> </option>'; |
@@ -8012,7 +8012,7 @@ discard block |
||
8012 | 8012 | if (count($fields_label) > 1) { |
8013 | 8013 | $notrans = true; |
8014 | 8014 | foreach ($fields_label as $field_toshow) { |
8015 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
8015 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
8016 | 8016 | } |
8017 | 8017 | } else { |
8018 | 8018 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -8023,12 +8023,12 @@ discard block |
||
8023 | 8023 | foreach ($fields_label as $field_toshow) { |
8024 | 8024 | $translabel = $langs->trans($obj->$field_toshow); |
8025 | 8025 | if ($translabel != $obj->$field_toshow) { |
8026 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
8026 | + $labeltoshow = dol_trunc($translabel).' '; |
|
8027 | 8027 | } else { |
8028 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
8028 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
8029 | 8029 | } |
8030 | 8030 | } |
8031 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
8031 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
8032 | 8032 | } else { |
8033 | 8033 | if (!$notrans) { |
8034 | 8034 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -8042,25 +8042,25 @@ discard block |
||
8042 | 8042 | $labeltoshow = '(not defined)'; |
8043 | 8043 | } |
8044 | 8044 | if ($value == $obj->rowid) { |
8045 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
8045 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
8046 | 8046 | } |
8047 | 8047 | |
8048 | 8048 | if (!empty($InfoFieldList[3]) && $parentField) { |
8049 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
8049 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
8050 | 8050 | $isDependList = 1; |
8051 | 8051 | } |
8052 | 8052 | |
8053 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
8053 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
8054 | 8054 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
8055 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
8056 | - $out .= '>' . $labeltoshow . '</option>'; |
|
8055 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
8056 | + $out .= '>'.$labeltoshow.'</option>'; |
|
8057 | 8057 | } |
8058 | 8058 | |
8059 | 8059 | $i++; |
8060 | 8060 | } |
8061 | 8061 | $this->db->free($resql); |
8062 | 8062 | } else { |
8063 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
8063 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
8064 | 8064 | } |
8065 | 8065 | } else { |
8066 | 8066 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
@@ -8071,9 +8071,9 @@ discard block |
||
8071 | 8071 | $data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1); |
8072 | 8072 | $out .= '<option value="0"> </option>'; |
8073 | 8073 | foreach ($data as $data_key => $data_value) { |
8074 | - $out .= '<option value="' . $data_key . '"'; |
|
8074 | + $out .= '<option value="'.$data_key.'"'; |
|
8075 | 8075 | $out .= ($value == $data_key ? ' selected' : ''); |
8076 | - $out .= '>' . $data_value . '</option>'; |
|
8076 | + $out .= '>'.$data_value.'</option>'; |
|
8077 | 8077 | } |
8078 | 8078 | } |
8079 | 8079 | } |
@@ -8113,7 +8113,7 @@ discard block |
||
8113 | 8113 | // 7 : sort field |
8114 | 8114 | |
8115 | 8115 | // If there is a filter |
8116 | - if (! empty($InfoFieldList[4])) { |
|
8116 | + if (!empty($InfoFieldList[4])) { |
|
8117 | 8117 | $pos = 0; |
8118 | 8118 | $parenthesisopen = 0; |
8119 | 8119 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -8179,8 +8179,8 @@ discard block |
||
8179 | 8179 | } |
8180 | 8180 | |
8181 | 8181 | $sqlwhere = ''; |
8182 | - $sql = "SELECT " . $keyList; |
|
8183 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
8182 | + $sql = "SELECT ".$keyList; |
|
8183 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
8184 | 8184 | |
8185 | 8185 | if (!empty($InfoFieldList[4])) { |
8186 | 8186 | // can use SELECT request |
@@ -8198,11 +8198,11 @@ discard block |
||
8198 | 8198 | // We have to join on extrafield table |
8199 | 8199 | $errstr = ''; |
8200 | 8200 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
8201 | - $sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra'; |
|
8202 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
8203 | - $sqlwhere .= " AND " . $InfoFieldList[4]; |
|
8201 | + $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
|
8202 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
8203 | + $sqlwhere .= " AND ".$InfoFieldList[4]; |
|
8204 | 8204 | } else { |
8205 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
8205 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
8206 | 8206 | } |
8207 | 8207 | } else { |
8208 | 8208 | $sqlwhere .= ' WHERE 1=1'; |
@@ -8223,14 +8223,14 @@ discard block |
||
8223 | 8223 | |
8224 | 8224 | // Some tables may have field, some other not. For the moment we disable it. |
8225 | 8225 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
8226 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
8226 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
8227 | 8227 | } |
8228 | 8228 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
8229 | 8229 | // print $sql; |
8230 | 8230 | |
8231 | 8231 | $sql .= $sqlwhere; |
8232 | 8232 | |
8233 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
8233 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
8234 | 8234 | |
8235 | 8235 | $resql = $this->db->query($sql); |
8236 | 8236 | if ($resql) { |
@@ -8249,7 +8249,7 @@ discard block |
||
8249 | 8249 | if (count($fields_label) > 1) { |
8250 | 8250 | $notrans = true; |
8251 | 8251 | foreach ($fields_label as $field_toshow) { |
8252 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
8252 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
8253 | 8253 | } |
8254 | 8254 | } else { |
8255 | 8255 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -8260,9 +8260,9 @@ discard block |
||
8260 | 8260 | foreach ($fields_label as $field_toshow) { |
8261 | 8261 | $translabel = $langs->trans($obj->$field_toshow); |
8262 | 8262 | if ($translabel != $obj->$field_toshow) { |
8263 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
8263 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
8264 | 8264 | } else { |
8265 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
8265 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
8266 | 8266 | } |
8267 | 8267 | } |
8268 | 8268 | |
@@ -8285,7 +8285,7 @@ discard block |
||
8285 | 8285 | } |
8286 | 8286 | |
8287 | 8287 | if (!empty($InfoFieldList[3]) && $parentField) { |
8288 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
8288 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
8289 | 8289 | $isDependList = 1; |
8290 | 8290 | } |
8291 | 8291 | |
@@ -8296,9 +8296,9 @@ discard block |
||
8296 | 8296 | } |
8297 | 8297 | $this->db->free($resql); |
8298 | 8298 | |
8299 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8299 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8300 | 8300 | } else { |
8301 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
8301 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
8302 | 8302 | } |
8303 | 8303 | } else { |
8304 | 8304 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
@@ -8307,7 +8307,7 @@ discard block |
||
8307 | 8307 | $categcode = Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]]; |
8308 | 8308 | } |
8309 | 8309 | $data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1); |
8310 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8310 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8311 | 8311 | } |
8312 | 8312 | } |
8313 | 8313 | } elseif ($type == 'link') { |
@@ -8342,7 +8342,7 @@ discard block |
||
8342 | 8342 | // $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller. |
8343 | 8343 | |
8344 | 8344 | //$objectfield = $valparent; |
8345 | - $objectfield = $val; // Is better than using old method $valparent |
|
8345 | + $objectfield = $val; // Is better than using old method $valparent |
|
8346 | 8346 | |
8347 | 8347 | // @phan-suppress-next-line PhanTypeMismatchArgumentNullable |
8348 | 8348 | $out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield); |
@@ -8555,7 +8555,7 @@ discard block |
||
8555 | 8555 | $value = $this->getLibStatut(3); |
8556 | 8556 | } elseif ($type == 'date') { |
8557 | 8557 | if (!empty($value)) { |
8558 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8558 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8559 | 8559 | } else { |
8560 | 8560 | $value = ''; |
8561 | 8561 | } |
@@ -8656,7 +8656,7 @@ discard block |
||
8656 | 8656 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
8657 | 8657 | if (strpos($value, "|") !== false) { |
8658 | 8658 | $value = $langs->trans(explode('|', $value)[0]); |
8659 | - } elseif (! is_numeric($value)) { |
|
8659 | + } elseif (!is_numeric($value)) { |
|
8660 | 8660 | $value = $langs->trans($value); |
8661 | 8661 | } |
8662 | 8662 | } elseif ($type == 'sellist') { |
@@ -8718,9 +8718,9 @@ discard block |
||
8718 | 8718 | $translabel = $langs->trans($obj->$field_toshow); |
8719 | 8719 | } |
8720 | 8720 | if ($translabel != $field_toshow) { |
8721 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
8721 | + $value .= dol_trunc($translabel, 18).' '; |
|
8722 | 8722 | } else { |
8723 | - $value .= $obj->$field_toshow . ' '; |
|
8723 | + $value .= $obj->$field_toshow.' '; |
|
8724 | 8724 | } |
8725 | 8725 | } |
8726 | 8726 | } else { |
@@ -8736,7 +8736,7 @@ discard block |
||
8736 | 8736 | } |
8737 | 8737 | } |
8738 | 8738 | } else { |
8739 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8739 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8740 | 8740 | |
8741 | 8741 | $toprint = array(); |
8742 | 8742 | $obj = $this->db->fetch_object($resql); |
@@ -8744,7 +8744,7 @@ discard block |
||
8744 | 8744 | $c->fetch($obj->rowid); |
8745 | 8745 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8746 | 8746 | foreach ($ways as $way) { |
8747 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8747 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8748 | 8748 | } |
8749 | 8749 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
8750 | 8750 | } |
@@ -8760,11 +8760,11 @@ discard block |
||
8760 | 8760 | $toprint = array(); |
8761 | 8761 | foreach ($value_arr as $keyval => $valueval) { |
8762 | 8762 | if (!empty($valueval)) { |
8763 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
8763 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
8764 | 8764 | } |
8765 | 8765 | } |
8766 | 8766 | if (!empty($toprint)) { |
8767 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8767 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8768 | 8768 | } |
8769 | 8769 | } |
8770 | 8770 | } elseif ($type == 'chkbxlst') { |
@@ -8819,9 +8819,9 @@ discard block |
||
8819 | 8819 | $translabel = $langs->trans($obj->$field_toshow); |
8820 | 8820 | } |
8821 | 8821 | if ($translabel != $field_toshow) { |
8822 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8822 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8823 | 8823 | } else { |
8824 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
8824 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
8825 | 8825 | } |
8826 | 8826 | } |
8827 | 8827 | } else { |
@@ -8830,15 +8830,15 @@ discard block |
||
8830 | 8830 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
8831 | 8831 | } |
8832 | 8832 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
8833 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8833 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8834 | 8834 | } else { |
8835 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
8835 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
8836 | 8836 | } |
8837 | 8837 | } |
8838 | 8838 | } |
8839 | 8839 | } |
8840 | 8840 | } else { |
8841 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8841 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8842 | 8842 | |
8843 | 8843 | $toprint = array(); |
8844 | 8844 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8847,7 +8847,7 @@ discard block |
||
8847 | 8847 | $c->fetch($obj->rowid); |
8848 | 8848 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8849 | 8849 | foreach ($ways as $way) { |
8850 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8850 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8851 | 8851 | } |
8852 | 8852 | } |
8853 | 8853 | } |
@@ -9017,7 +9017,7 @@ discard block |
||
9017 | 9017 | global $langs; |
9018 | 9018 | |
9019 | 9019 | if (!class_exists('Validate')) { |
9020 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
9020 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
9021 | 9021 | } |
9022 | 9022 | |
9023 | 9023 | $this->clearFieldError($fieldKey); |
@@ -9256,7 +9256,7 @@ discard block |
||
9256 | 9256 | $out .= "\n"; |
9257 | 9257 | |
9258 | 9258 | $nbofextrafieldsshown = 0; |
9259 | - $e = 0; // var to manage the modulo (odd/even) |
|
9259 | + $e = 0; // var to manage the modulo (odd/even) |
|
9260 | 9260 | |
9261 | 9261 | $lastseparatorkeyfound = ''; |
9262 | 9262 | $extrafields_collapse_num = ''; |
@@ -9294,9 +9294,9 @@ discard block |
||
9294 | 9294 | continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list |
9295 | 9295 | } elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) { |
9296 | 9296 | // We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost |
9297 | - $ef_name = 'options_' . $key; |
|
9297 | + $ef_name = 'options_'.$key; |
|
9298 | 9298 | $ef_value = $this->array_options[$ef_name]; |
9299 | - $out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n"; |
|
9299 | + $out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n"; |
|
9300 | 9300 | continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation |
9301 | 9301 | } elseif ($mode == 'view' && empty($visibility)) { |
9302 | 9302 | continue; |
@@ -10386,7 +10386,7 @@ discard block |
||
10386 | 10386 | continue; |
10387 | 10387 | } |
10388 | 10388 | } |
10389 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
10389 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
10390 | 10390 | } |
10391 | 10391 | return implode(', ', $keys_with_alias); |
10392 | 10392 | } else { |
@@ -10527,7 +10527,7 @@ discard block |
||
10527 | 10527 | if (!$error) { |
10528 | 10528 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
10529 | 10529 | $sql .= " (".implode(", ", $keys).')'; |
10530 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10530 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10531 | 10531 | |
10532 | 10532 | $res = $this->db->query($sql); |
10533 | 10533 | if (!$res) { |
@@ -10841,7 +10841,7 @@ discard block |
||
10841 | 10841 | |
10842 | 10842 | // Update extrafield |
10843 | 10843 | if (!$error) { |
10844 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10844 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10845 | 10845 | if ($result < 0) { |
10846 | 10846 | $error++; |
10847 | 10847 | } |
@@ -11065,12 +11065,12 @@ discard block |
||
11065 | 11065 | $error++; |
11066 | 11066 | } else { |
11067 | 11067 | while ($obj = $this->db->fetch_object($resql)) { |
11068 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
11068 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
11069 | 11069 | if ($result < 0) { |
11070 | 11070 | $error++; |
11071 | 11071 | $this->errors[] = $this->error; |
11072 | 11072 | } else { |
11073 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
11073 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
11074 | 11074 | if ($result < 0) { |
11075 | 11075 | $error++; |
11076 | 11076 | $this->errors[] = $this->error; |
@@ -11236,7 +11236,7 @@ discard block |
||
11236 | 11236 | ); |
11237 | 11237 | foreach ($fields as $key => $value) { |
11238 | 11238 | if (array_key_exists($key, $this->fields)) { |
11239 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
11239 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
11240 | 11240 | } |
11241 | 11241 | } |
11242 | 11242 |
@@ -62,8 +62,8 @@ |
||
62 | 62 | // phpcs:enable |
63 | 63 | global $langs, $conf; |
64 | 64 | |
65 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
66 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
65 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
66 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
67 | 67 | exit; |
68 | 68 | } |
69 | 69 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $this->situationinvoice = false; |
176 | 176 | |
177 | 177 | if ($mysoc === null) { |
178 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
178 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
179 | 179 | return; |
180 | 180 | } |
181 | 181 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
338 | 338 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
339 | 339 | } |
340 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
340 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
341 | 341 | $tplidx = $pdf->importPage(1); |
342 | 342 | } |
343 | 343 | |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
452 | 452 | |
453 | 453 | // $tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
454 | - $tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
454 | + $tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
455 | 455 | $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
456 | 456 | |
457 | 457 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -783,11 +783,11 @@ discard block |
||
783 | 783 | if (!isset($this->tva[$vatrate])) { |
784 | 784 | $this->tva[$vatrate] = 0; |
785 | 785 | } |
786 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
786 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
787 | 787 | $vatcode = $object->lines[$i]->vat_src_code; |
788 | 788 | if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { |
789 | 789 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) { |
790 | - $this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0; |
|
790 | + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0; |
|
791 | 791 | } |
792 | 792 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht); |
793 | 793 | } else { |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | // Pagefoot |
878 | 878 | $this->_pagefoot($pdf, $object, $outputlangs, 0, $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs)); |
879 | 879 | if (method_exists($pdf, 'AliasNbPages')) { |
880 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
880 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
881 | 881 | } |
882 | 882 | |
883 | 883 | // Add terms to sale |
@@ -1194,7 +1194,7 @@ discard block |
||
1194 | 1194 | foreach ($this->tva_array as $tvakey => $tvaval) { |
1195 | 1195 | $pdf->SetFont('', '', $default_font_size - 2); |
1196 | 1196 | $pdf->SetXY($this->marge_gauche, $posy); |
1197 | - $titre = round((float) $tvakey, 2) . "%"; |
|
1197 | + $titre = round((float) $tvakey, 2)."%"; |
|
1198 | 1198 | $pdf->MultiCell(25, 4, $titre, 0, 'L'); |
1199 | 1199 | |
1200 | 1200 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | } |
1237 | 1237 | |
1238 | 1238 | $posxval = 52; |
1239 | - $posxend = 110; // End of x for text on left side |
|
1239 | + $posxend = 110; // End of x for text on left side |
|
1240 | 1240 | if ($this->page_largeur < 210) { // To work with US executive format |
1241 | 1241 | $posxend -= 10; |
1242 | 1242 | } |
@@ -1245,13 +1245,13 @@ discard block |
||
1245 | 1245 | if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) { |
1246 | 1246 | // All customer previous invoices |
1247 | 1247 | $sql = "SELECT f.rowid, f.datef, f.total_ttc"; |
1248 | - $sql.= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
1249 | - $sql.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1250 | - $sql.= " AND f.entity IN (" . getEntity('invoice') . ")"; |
|
1251 | - $sql.= " AND f.datef <= '" . $this->db->idate($object->date) . "'"; |
|
1252 | - $sql.= " AND f.rowid < " . ((int) $object->id); |
|
1253 | - $sql.= " AND f.fk_statut > 0"; |
|
1254 | - $sql.= " ORDER BY f.datef ASC"; |
|
1248 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
1249 | + $sql .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1250 | + $sql .= " AND f.entity IN (".getEntity('invoice').")"; |
|
1251 | + $sql .= " AND f.datef <= '".$this->db->idate($object->date)."'"; |
|
1252 | + $sql .= " AND f.rowid < ".((int) $object->id); |
|
1253 | + $sql .= " AND f.fk_statut > 0"; |
|
1254 | + $sql .= " ORDER BY f.datef ASC"; |
|
1255 | 1255 | |
1256 | 1256 | $old_balance = 0; |
1257 | 1257 | $invoices = array(); |
@@ -1266,12 +1266,12 @@ discard block |
||
1266 | 1266 | |
1267 | 1267 | // All payments before current date |
1268 | 1268 | $sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
1269 | - $sql_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
1270 | - $sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
1271 | - $sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
1272 | - $sql_payments.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1273 | - $sql_payments.= " AND p.datep < '" . $this->db->idate($object->date) . "'"; |
|
1274 | - $sql_payments.= " ORDER BY p.datep ASC"; |
|
1269 | + $sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
1270 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
1271 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
1272 | + $sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1273 | + $sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'"; |
|
1274 | + $sql_payments .= " ORDER BY p.datep ASC"; |
|
1275 | 1275 | |
1276 | 1276 | $total_payments = 0; |
1277 | 1277 | $resql_payments = $this->db->query($sql_payments); |
@@ -1284,11 +1284,11 @@ discard block |
||
1284 | 1284 | |
1285 | 1285 | // Payments made on current invoice date (including current invoice) |
1286 | 1286 | $sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
1287 | - $sql_current_date_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
1288 | - $sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
1289 | - $sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
1290 | - $sql_current_date_payments.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1291 | - $sql_current_date_payments.= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')"; |
|
1287 | + $sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
1288 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
1289 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
1290 | + $sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1291 | + $sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')"; |
|
1292 | 1292 | |
1293 | 1293 | $current_date_payments = 0; |
1294 | 1294 | $resql_current_date = $this->db->query($sql_current_date_payments); |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | $pdf->MultiCell($posxval - $this->marge_gauche + 8, 4, $titre, 0, 'L', true); |
1313 | 1313 | |
1314 | 1314 | $pdf->SetFont('', '', $default_font_size - 2); |
1315 | - $pdf->SetXY($posxval+8, $posy); |
|
1315 | + $pdf->SetXY($posxval + 8, $posy); |
|
1316 | 1316 | $titre = $outputlangs->transnoentities("NewBalance").' : '.price($new_balance); |
1317 | 1317 | $pdf->MultiCell($posxend - $posxval - 8, 4, $titre, 0, 'L', true); |
1318 | 1318 | |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); |
1333 | 1333 | $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); |
1334 | 1334 | |
1335 | - $posy = $pdf->GetY() + 3; // We need spaces for 2 lines payment conditions |
|
1335 | + $posy = $pdf->GetY() + 3; // We need spaces for 2 lines payment conditions |
|
1336 | 1336 | } |
1337 | 1337 | |
1338 | 1338 | // Show category of operations |
@@ -1344,7 +1344,7 @@ discard block |
||
1344 | 1344 | |
1345 | 1345 | $pdf->SetFont('', '', $default_font_size - 2); |
1346 | 1346 | $pdf->SetXY($posxval, $posy); |
1347 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
1347 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
1348 | 1348 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
1349 | 1349 | |
1350 | 1350 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; |
1497 | 1497 | $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); |
1498 | 1498 | |
1499 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
1499 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
1500 | 1500 | } |
1501 | 1501 | } |
1502 | 1502 | } |
@@ -1952,7 +1952,7 @@ discard block |
||
1952 | 1952 | if (empty($hidetop)) { |
1953 | 1953 | // Show category of operations |
1954 | 1954 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
1955 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
1955 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
1956 | 1956 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
1957 | 1957 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
1958 | 1958 | } |
@@ -2121,7 +2121,7 @@ discard block |
||
2121 | 2121 | } |
2122 | 2122 | if ($this->situationinvoice) { |
2123 | 2123 | $outputlangs->loadLangs(array("other")); |
2124 | - $title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -"; |
|
2124 | + $title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -"; |
|
2125 | 2125 | } |
2126 | 2126 | if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { |
2127 | 2127 | $title .= ' - '; |
@@ -2356,7 +2356,7 @@ discard block |
||
2356 | 2356 | |
2357 | 2357 | $carac_client_name = is_object($thirdparty) ? pdfBuildThirdpartyName($thirdparty, $outputlangs) : ''; |
2358 | 2358 | |
2359 | - $mode = 'target'; |
|
2359 | + $mode = 'target'; |
|
2360 | 2360 | $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); |
2361 | 2361 | |
2362 | 2362 | // Show recipient |
@@ -2411,7 +2411,7 @@ discard block |
||
2411 | 2411 | if (!empty($carac_client_shipping)) { |
2412 | 2412 | $posy += $hautcadre; |
2413 | 2413 | |
2414 | - $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
2414 | + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
2415 | 2415 | |
2416 | 2416 | // Show shipping frame |
2417 | 2417 | $pdf->SetXY($posx + 2, $posy - 5); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->watermark = ''; |
161 | 161 | |
162 | 162 | if ($mysoc === null) { |
163 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
163 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
364 | 364 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
365 | 365 | } |
366 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
366 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
367 | 367 | $tplidx = $pdf->importPage(1); |
368 | 368 | } |
369 | 369 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
461 | 461 | |
462 | 462 | // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
463 | - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
463 | + $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
464 | 464 | $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
465 | 465 | |
466 | 466 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | $bg_color = colorStringToArray(getDolGlobalString("SUBTOTAL_BACK_COLOR_LEVEL_".abs($object->lines[$i]->qty))); |
808 | 808 | $pdf->SetFillColor($bg_color[0], $bg_color[1], $bg_color[2]); |
809 | 809 | $pdf->SetXY($pdf->GetX(), $curY); |
810 | - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 6, '', 0, '', true); |
|
810 | + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 6, '', 0, '', true); |
|
811 | 811 | $previous_align = array(); |
812 | 812 | $previous_align['align'] = $this->cols['desc']['content']['align']; |
813 | 813 | if ($object->lines[$i]->qty < 0) { |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs); |
911 | 911 | $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue); |
912 | 912 | |
913 | - $this->setAfterColsLinePositionsData('options_' . $extrafieldColKey, $pdf->GetY(), $pdf->getPage()); |
|
913 | + $this->setAfterColsLinePositionsData('options_'.$extrafieldColKey, $pdf->GetY(), $pdf->getPage()); |
|
914 | 914 | } |
915 | 915 | } |
916 | 916 | } |
@@ -989,11 +989,11 @@ discard block |
||
989 | 989 | if (!isset($this->tva[$vatrate])) { |
990 | 990 | $this->tva[$vatrate] = 0; |
991 | 991 | } |
992 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
992 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
993 | 993 | $vatcode = $object->lines[$i]->vat_src_code; |
994 | 994 | if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { |
995 | 995 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) { |
996 | - $this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0; |
|
996 | + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0; |
|
997 | 997 | } |
998 | 998 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht); |
999 | 999 | } else { |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | |
1104 | 1104 | // Add number of pages in footer |
1105 | 1105 | if (method_exists($pdf, 'AliasNbPages')) { |
1106 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
1106 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
1107 | 1107 | } |
1108 | 1108 | // Add terms to sale |
1109 | 1109 | if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) { |
@@ -1357,7 +1357,7 @@ discard block |
||
1357 | 1357 | foreach ($this->tva_array as $tvakey => $tvaval) { |
1358 | 1358 | $pdf->SetFont('', '', $default_font_size - 2); |
1359 | 1359 | $pdf->SetXY($this->marge_gauche, $posy); |
1360 | - $titre = round((float) $tvakey, 2) . "%"; |
|
1360 | + $titre = round((float) $tvakey, 2)."%"; |
|
1361 | 1361 | $pdf->MultiCell(25, 4, $titre, 0, 'L'); |
1362 | 1362 | |
1363 | 1363 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -1398,8 +1398,8 @@ discard block |
||
1398 | 1398 | $posy = $pdf->GetY() + 4; |
1399 | 1399 | } |
1400 | 1400 | |
1401 | - $posxval = 52; // Position of values of properties shown on left side |
|
1402 | - $posxend = 110; // End of x for text on left side |
|
1401 | + $posxval = 52; // Position of values of properties shown on left side |
|
1402 | + $posxend = 110; // End of x for text on left side |
|
1403 | 1403 | if ($this->page_largeur < 210) { // To work with US executive format |
1404 | 1404 | $posxend -= 10; |
1405 | 1405 | } |
@@ -1408,13 +1408,13 @@ discard block |
||
1408 | 1408 | if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) { |
1409 | 1409 | // All customer previous invoices |
1410 | 1410 | $sql = "SELECT f.rowid, f.datef, f.total_ttc"; |
1411 | - $sql.= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
1412 | - $sql.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1413 | - $sql.= " AND f.entity IN (" . getEntity('invoice') . ")"; |
|
1414 | - $sql.= " AND f.datef <= '" . $this->db->idate($object->date) . "'"; |
|
1415 | - $sql.= " AND f.rowid < " . ((int) $object->id); |
|
1416 | - $sql.= " AND f.fk_statut > 0"; |
|
1417 | - $sql.= " ORDER BY f.datef ASC"; |
|
1411 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
1412 | + $sql .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1413 | + $sql .= " AND f.entity IN (".getEntity('invoice').")"; |
|
1414 | + $sql .= " AND f.datef <= '".$this->db->idate($object->date)."'"; |
|
1415 | + $sql .= " AND f.rowid < ".((int) $object->id); |
|
1416 | + $sql .= " AND f.fk_statut > 0"; |
|
1417 | + $sql .= " ORDER BY f.datef ASC"; |
|
1418 | 1418 | |
1419 | 1419 | $old_balance = 0; |
1420 | 1420 | $invoices = array(); |
@@ -1429,12 +1429,12 @@ discard block |
||
1429 | 1429 | |
1430 | 1430 | // All payments before current date |
1431 | 1431 | $sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
1432 | - $sql_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
1433 | - $sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
1434 | - $sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
1435 | - $sql_payments.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1436 | - $sql_payments.= " AND p.datep < '" . $this->db->idate($object->date) . "'"; |
|
1437 | - $sql_payments.= " ORDER BY p.datep ASC"; |
|
1432 | + $sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
1433 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
1434 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
1435 | + $sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1436 | + $sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'"; |
|
1437 | + $sql_payments .= " ORDER BY p.datep ASC"; |
|
1438 | 1438 | |
1439 | 1439 | $total_payments = 0; |
1440 | 1440 | $resql_payments = $this->db->query($sql_payments); |
@@ -1447,11 +1447,11 @@ discard block |
||
1447 | 1447 | |
1448 | 1448 | // Payments made on current invoice date (including current invoice) |
1449 | 1449 | $sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
1450 | - $sql_current_date_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
1451 | - $sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
1452 | - $sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
1453 | - $sql_current_date_payments.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1454 | - $sql_current_date_payments.= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')"; |
|
1450 | + $sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
1451 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
1452 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
1453 | + $sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1454 | + $sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')"; |
|
1455 | 1455 | |
1456 | 1456 | $current_date_payments = 0; |
1457 | 1457 | $resql_current_date = $this->db->query($sql_current_date_payments); |
@@ -1475,7 +1475,7 @@ discard block |
||
1475 | 1475 | $pdf->MultiCell($posxval - $this->marge_gauche + 8, 4, $titre, 0, 'L', true); |
1476 | 1476 | |
1477 | 1477 | $pdf->SetFont('', '', $default_font_size - 2); |
1478 | - $pdf->SetXY($posxval+8, $posy); |
|
1478 | + $pdf->SetXY($posxval + 8, $posy); |
|
1479 | 1479 | $titre = $outputlangs->transnoentities("NewBalance").' : '.price($new_balance); |
1480 | 1480 | $pdf->MultiCell($posxend - $posxval - 8, 4, $titre, 0, 'L', true); |
1481 | 1481 | |
@@ -1507,7 +1507,7 @@ discard block |
||
1507 | 1507 | |
1508 | 1508 | $pdf->SetFont('', '', $default_font_size - 2); |
1509 | 1509 | $pdf->SetXY($posxval, $posy); |
1510 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
1510 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
1511 | 1511 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
1512 | 1512 | |
1513 | 1513 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1685,7 +1685,7 @@ discard block |
||
1685 | 1685 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; |
1686 | 1686 | $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); |
1687 | 1687 | |
1688 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
1688 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
1689 | 1689 | } |
1690 | 1690 | } |
1691 | 1691 | } |
@@ -2371,7 +2371,7 @@ discard block |
||
2371 | 2371 | if (empty($hidetop)) { |
2372 | 2372 | // Show category of operations |
2373 | 2373 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
2374 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
2374 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
2375 | 2375 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
2376 | 2376 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
2377 | 2377 | } |
@@ -2487,7 +2487,7 @@ discard block |
||
2487 | 2487 | } |
2488 | 2488 | if ($this->situationinvoice) { |
2489 | 2489 | $outputlangs->loadLangs(array("other")); |
2490 | - $title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -"; |
|
2490 | + $title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -"; |
|
2491 | 2491 | } |
2492 | 2492 | if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { |
2493 | 2493 | $title .= ' - '; |
@@ -2777,7 +2777,7 @@ discard block |
||
2777 | 2777 | if (!empty($carac_client_shipping)) { |
2778 | 2778 | $posy += $hautcadre; |
2779 | 2779 | |
2780 | - $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
2780 | + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
2781 | 2781 | |
2782 | 2782 | // Show shipping frame |
2783 | 2783 | $pdf->SetXY($posx + 2, $posy - 5); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * Dolibarr version of the loaded document |
79 | 79 | * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' |
80 | 80 | */ |
81 | - public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
81 | + public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * @var int height for info total |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | } |
249 | 249 | |
250 | 250 | if ($mysoc === null) { |
251 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
251 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
252 | 252 | return; |
253 | 253 | } |
254 | 254 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies", "compta")); |
299 | 299 | } |
300 | 300 | |
301 | - if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
301 | + if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
302 | 302 | setEventMessage($langs->trans('WarningsObjectIsNotASituation'), 'warnings'); |
303 | 303 | return 1; |
304 | 304 | } |
@@ -418,15 +418,15 @@ discard block |
||
418 | 418 | $pdf->setAutoPageBreak(true, 0); |
419 | 419 | |
420 | 420 | // compute height for situation invoices |
421 | - $this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part |
|
421 | + $this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part |
|
422 | 422 | if (!getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS') && $nbpayments > 0) { |
423 | 423 | $this->heightforinfotot += 4 * ($nbpayments + 3); |
424 | 424 | } |
425 | 425 | if ($nbprevsituation > 0) { |
426 | 426 | $this->heightforinfotot += 4 * ($nbprevsituation + 3); |
427 | 427 | } |
428 | - $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page |
|
429 | - $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
428 | + $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page |
|
429 | + $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
430 | 430 | |
431 | 431 | if (class_exists('TCPDF')) { |
432 | 432 | $pdf->setPrintHeader(false); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
441 | 441 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
442 | 442 | } |
443 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
443 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
444 | 444 | $this->tplidx = $pdf->importPage(1); |
445 | 445 | } |
446 | 446 | |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
533 | 533 | |
534 | 534 | // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
535 | - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
535 | + $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
536 | 536 | $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
537 | 537 | |
538 | 538 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -1032,11 +1032,11 @@ discard block |
||
1032 | 1032 | if (!isset($this->tva[$vatrate])) { |
1033 | 1033 | $this->tva[$vatrate] = 0; |
1034 | 1034 | } |
1035 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
1035 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
1036 | 1036 | $vatcode = $object->lines[$i]->vat_src_code; |
1037 | 1037 | if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { |
1038 | 1038 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) { |
1039 | - $this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0; |
|
1039 | + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0; |
|
1040 | 1040 | } |
1041 | 1041 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht); |
1042 | 1042 | } else { |
@@ -1128,7 +1128,7 @@ discard block |
||
1128 | 1128 | // Pagefoot |
1129 | 1129 | $this->_pagefoot($pdf, $object, $outputlangs); |
1130 | 1130 | if (method_exists($pdf, 'AliasNbPages')) { |
1131 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
1131 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | $this->resumeLastPage($pdf, $object, 0, $tab_top, $outputlangs, $outputlangsbis); |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | foreach ($this->tva_array as $tvakey => $tvaval) { |
1365 | 1365 | $pdf->SetFont('', '', $default_font_size - 2); |
1366 | 1366 | $pdf->SetXY($this->marge_gauche, $posy); |
1367 | - $titre = round((float) $tvakey, 2) . "%"; |
|
1367 | + $titre = round((float) $tvakey, 2)."%"; |
|
1368 | 1368 | $pdf->MultiCell(25, 4, $titre, 0, 'L'); |
1369 | 1369 | |
1370 | 1370 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -1405,8 +1405,8 @@ discard block |
||
1405 | 1405 | $posy = $pdf->GetY() + 4; |
1406 | 1406 | } |
1407 | 1407 | |
1408 | - $posxval = 52; // Position of values of properties shown on left side |
|
1409 | - $posxend = 110; // End of x for text on left side |
|
1408 | + $posxval = 52; // Position of values of properties shown on left side |
|
1409 | + $posxend = 110; // End of x for text on left side |
|
1410 | 1410 | if ($this->page_largeur < 210) { // To work with US executive format |
1411 | 1411 | $posxend -= 10; |
1412 | 1412 | } |
@@ -1415,13 +1415,13 @@ discard block |
||
1415 | 1415 | if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) { |
1416 | 1416 | // All customer previous invoices |
1417 | 1417 | $sql = "SELECT f.rowid, f.datef, f.total_ttc"; |
1418 | - $sql.= " FROM " . MAIN_DB_PREFIX . "facture as f"; |
|
1419 | - $sql.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1420 | - $sql.= " AND f.entity IN (" . getEntity('invoice') . ")"; |
|
1421 | - $sql.= " AND f.datef <= '" . $this->db->idate($object->date) . "'"; |
|
1422 | - $sql.= " AND f.rowid < " . ((int) $object->id); |
|
1423 | - $sql.= " AND f.fk_statut > 0"; |
|
1424 | - $sql.= " ORDER BY f.datef ASC"; |
|
1418 | + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
|
1419 | + $sql .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1420 | + $sql .= " AND f.entity IN (".getEntity('invoice').")"; |
|
1421 | + $sql .= " AND f.datef <= '".$this->db->idate($object->date)."'"; |
|
1422 | + $sql .= " AND f.rowid < ".((int) $object->id); |
|
1423 | + $sql .= " AND f.fk_statut > 0"; |
|
1424 | + $sql .= " ORDER BY f.datef ASC"; |
|
1425 | 1425 | |
1426 | 1426 | $old_balance = 0; |
1427 | 1427 | $invoices = array(); |
@@ -1436,12 +1436,12 @@ discard block |
||
1436 | 1436 | |
1437 | 1437 | // All payments before current date |
1438 | 1438 | $sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
1439 | - $sql_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
1440 | - $sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
1441 | - $sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
1442 | - $sql_payments.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1443 | - $sql_payments.= " AND p.datep < '" . $this->db->idate($object->date) . "'"; |
|
1444 | - $sql_payments.= " ORDER BY p.datep ASC"; |
|
1439 | + $sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
1440 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
1441 | + $sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
1442 | + $sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1443 | + $sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'"; |
|
1444 | + $sql_payments .= " ORDER BY p.datep ASC"; |
|
1445 | 1445 | |
1446 | 1446 | $total_payments = 0; |
1447 | 1447 | $resql_payments = $this->db->query($sql_payments); |
@@ -1454,11 +1454,11 @@ discard block |
||
1454 | 1454 | |
1455 | 1455 | // Payments made on current invoice date (including current invoice) |
1456 | 1456 | $sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount"; |
1457 | - $sql_current_date_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf"; |
|
1458 | - $sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement"; |
|
1459 | - $sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture"; |
|
1460 | - $sql_current_date_payments.= " WHERE f.fk_soc = " . ((int) $object->socid); |
|
1461 | - $sql_current_date_payments.= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')"; |
|
1457 | + $sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf"; |
|
1458 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement"; |
|
1459 | + $sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture"; |
|
1460 | + $sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid); |
|
1461 | + $sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')"; |
|
1462 | 1462 | |
1463 | 1463 | $current_date_payments = 0; |
1464 | 1464 | $resql_current_date = $this->db->query($sql_current_date_payments); |
@@ -1482,7 +1482,7 @@ discard block |
||
1482 | 1482 | $pdf->MultiCell($posxval - $this->marge_gauche + 8, 4, $titre, 0, 'L', true); |
1483 | 1483 | |
1484 | 1484 | $pdf->SetFont('', '', $default_font_size - 2); |
1485 | - $pdf->SetXY($posxval+8, $posy); |
|
1485 | + $pdf->SetXY($posxval + 8, $posy); |
|
1486 | 1486 | $titre = $outputlangs->transnoentities("NewBalance").' : '.price($new_balance); |
1487 | 1487 | $pdf->MultiCell($posxend - $posxval - 8, 4, $titre, 0, 'L', true); |
1488 | 1488 | |
@@ -1514,7 +1514,7 @@ discard block |
||
1514 | 1514 | |
1515 | 1515 | $pdf->SetFont('', '', $default_font_size - 2); |
1516 | 1516 | $pdf->SetXY($posxval, $posy); |
1517 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
1517 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
1518 | 1518 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
1519 | 1519 | |
1520 | 1520 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1681,7 +1681,7 @@ discard block |
||
1681 | 1681 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; |
1682 | 1682 | $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); |
1683 | 1683 | |
1684 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
1684 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); |
|
1685 | 1685 | } |
1686 | 1686 | } |
1687 | 1687 | } |
@@ -1852,7 +1852,7 @@ discard block |
||
1852 | 1852 | if (($object->lines[$i]->info_bits & 0x01) == 0x01) { |
1853 | 1853 | $vatrate .= '*'; |
1854 | 1854 | } |
1855 | - if (! isset($tvas[$vatrate])) { |
|
1855 | + if (!isset($tvas[$vatrate])) { |
|
1856 | 1856 | $tvas[$vatrate] = 0; |
1857 | 1857 | } |
1858 | 1858 | $tvas[$vatrate] += $tvaligne; |
@@ -2121,7 +2121,7 @@ discard block |
||
2121 | 2121 | if (empty($hidetop)) { |
2122 | 2122 | // Show category of operations |
2123 | 2123 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
2124 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
2124 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
2125 | 2125 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
2126 | 2126 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
2127 | 2127 | } |
@@ -2141,7 +2141,7 @@ discard block |
||
2141 | 2141 | $pdf->SetFont('', '', $default_font_size - 1); |
2142 | 2142 | |
2143 | 2143 | // Output Rect |
2144 | - $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
2144 | + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
2145 | 2145 | |
2146 | 2146 | // situation invoice |
2147 | 2147 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -2181,7 +2181,7 @@ discard block |
||
2181 | 2181 | $pdf->SetFont('', '', $default_font_size - 1); |
2182 | 2182 | |
2183 | 2183 | if (empty($hidetop)) { |
2184 | - $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param |
|
2184 | + $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param |
|
2185 | 2185 | } |
2186 | 2186 | } |
2187 | 2187 | |
@@ -2760,7 +2760,7 @@ discard block |
||
2760 | 2760 | 'overtitle' => array( |
2761 | 2761 | 'textkey' => 'Chantier', // use lang key is useful in somme case with module |
2762 | 2762 | 'align' => 'C', |
2763 | - 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
2763 | + 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
2764 | 2764 | 'width' => 18 |
2765 | 2765 | ), |
2766 | 2766 | ); |
@@ -2785,13 +2785,13 @@ discard block |
||
2785 | 2785 | ), |
2786 | 2786 | 'border-left' => true, // add left line separator |
2787 | 2787 | 'overtitle' => array( |
2788 | - 'textkey' => 'S'.$derniere_situation->situation_counter . ' - ' . dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
2788 | + 'textkey' => 'S'.$derniere_situation->situation_counter.' - '.dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
2789 | 2789 | 'align' => 'C', |
2790 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2790 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2791 | 2791 | 'width' => 10 + 15 //current width + amount cell width |
2792 | 2792 | ), |
2793 | 2793 | ); |
2794 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
2794 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
2795 | 2795 | $this->cols['prev_progress']['status'] = true; |
2796 | 2796 | } |
2797 | 2797 | |
@@ -2806,7 +2806,7 @@ discard block |
||
2806 | 2806 | ), |
2807 | 2807 | 'border-left' => true, // add left line separator |
2808 | 2808 | ); |
2809 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
2809 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
2810 | 2810 | $this->cols['prev_progress_amount']['status'] = true; |
2811 | 2811 | } |
2812 | 2812 | |
@@ -2821,9 +2821,9 @@ discard block |
||
2821 | 2821 | ), |
2822 | 2822 | 'border-left' => true, // add left line separator |
2823 | 2823 | 'overtitle' => array( |
2824 | - 'textkey' => 'S'.$object->situation_counter . ' - ' . dol_print_date($object->date, "%d/%m/%Y"), |
|
2824 | + 'textkey' => 'S'.$object->situation_counter.' - '.dol_print_date($object->date, "%d/%m/%Y"), |
|
2825 | 2825 | 'align' => 'C', |
2826 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2826 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
2827 | 2827 | 'width' => 10 + 15 |
2828 | 2828 | ), |
2829 | 2829 | ); |
@@ -2947,7 +2947,7 @@ discard block |
||
2947 | 2947 | |
2948 | 2948 | // Output Rect |
2949 | 2949 | // KEEPTHIS => Affiche les bords extérieurs |
2950 | - $this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
2950 | + $this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
2951 | 2951 | |
2952 | 2952 | $pdf->line($this->posx_cumul_anterieur - 1, $tab_top, $this->posx_cumul_anterieur - 1, $tab_top + $tab_height); |
2953 | 2953 | if (empty($hidetop)) { |
@@ -3004,7 +3004,7 @@ discard block |
||
3004 | 3004 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 24 + $i); |
3005 | 3005 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("TotalHT").' '.$TVatInfo['label'], '', 'L'); |
3006 | 3006 | |
3007 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
3007 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
3008 | 3008 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 28 + $i); |
3009 | 3009 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("VAT").' '.$TVatInfo['label'], '', 'L'); |
3010 | 3010 | } else { |
@@ -3068,7 +3068,7 @@ discard block |
||
3068 | 3068 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['HT'], 0, '', 1, -1, 2), '', 'R'); |
3069 | 3069 | |
3070 | 3070 | // Total TVA |
3071 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
3071 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
3072 | 3072 | $pdf->SetXY($x, $tab_top + 28 + $i); |
3073 | 3073 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['TVA'], 0, '', 1, -1, 2), '', 'R'); |
3074 | 3074 | } else { |
@@ -3145,7 +3145,7 @@ discard block |
||
3145 | 3145 | |
3146 | 3146 | $TDataSituation = array(); |
3147 | 3147 | |
3148 | - if (! empty($facDerniereSituation)) { |
|
3148 | + if (!empty($facDerniereSituation)) { |
|
3149 | 3149 | $TDataSituation['derniere_situation'] = $facDerniereSituation; |
3150 | 3150 | $TDataSituation['date_derniere_situation'] = $facDerniereSituation->date; |
3151 | 3151 | } |
@@ -3154,9 +3154,9 @@ discard block |
||
3154 | 3154 | $retenue_garantie_anterieure = 0; |
3155 | 3155 | // Init tous les champs à 0 |
3156 | 3156 | $TDataSituation['cumul_anterieur'] = array( |
3157 | - 'HT' => 0, //montant HT normal |
|
3158 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
3159 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
3157 | + 'HT' => 0, //montant HT normal |
|
3158 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
3159 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
3160 | 3160 | 'retenue_garantie' => 0, |
3161 | 3161 | 'travaux_sup' => 0, |
3162 | 3162 | 'HTnet' => 0, //montant HT |
@@ -3186,7 +3186,7 @@ discard block |
||
3186 | 3186 | $isFirstSituation = false; |
3187 | 3187 | if (!empty($l->fk_prev_id)) { |
3188 | 3188 | $prevSituationPercent = $l->get_prev_progress($previousInvoice->id, true); |
3189 | - } elseif (! array_key_exists($i + 1, $TPreviousInvoices)) { |
|
3189 | + } elseif (!array_key_exists($i + 1, $TPreviousInvoices)) { |
|
3190 | 3190 | $isFirstSituation = true; |
3191 | 3191 | } |
3192 | 3192 | |
@@ -3196,7 +3196,7 @@ discard block |
||
3196 | 3196 | |
3197 | 3197 | //1ere ligne |
3198 | 3198 | $amounttva = $calc_ht * ($ltvatx / 100); |
3199 | - if (! isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
3199 | + if (!isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
3200 | 3200 | $TDataSituation['cumul_anterieur'][$ltvatx]['HT'] = $calc_ht; |
3201 | 3201 | $TDataSituation['cumul_anterieur'][$ltvatx]['TVA'] = $amounttva; |
3202 | 3202 | } else { |
@@ -3208,14 +3208,14 @@ discard block |
||
3208 | 3208 | //le grand total de TVA |
3209 | 3209 | // $TDataSituation['cumul_anterieur']['TVA'] += $amounttva; |
3210 | 3210 | |
3211 | - if (empty($l->fk_prev_id) && ! $isFirstSituation) { |
|
3211 | + if (empty($l->fk_prev_id) && !$isFirstSituation) { |
|
3212 | 3212 | // TODO: à clarifier, mais pour moi, un facture de situation précédente qui a des progressions à 0% c'est pas logique |
3213 | 3213 | $TDataSituation['cumul_anterieur']['travaux_sup'] += $calc_ht; |
3214 | 3214 | } |
3215 | 3215 | } |
3216 | 3216 | } |
3217 | 3217 | |
3218 | - if (! empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
3218 | + if (!empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
3219 | 3219 | $retenue_garantie_anterieure += $previousInvoice->getRetainedWarrantyAmount(); |
3220 | 3220 | } |
3221 | 3221 | |
@@ -3229,7 +3229,7 @@ discard block |
||
3229 | 3229 | // print json_encode($facDerniereSituation->lines);exit; |
3230 | 3230 | $TDataSituation['current'] = $this->btpGetInvoiceAmounts($object->id); |
3231 | 3231 | |
3232 | - if (! empty($facDerniereSituation->lines)) { |
|
3232 | + if (!empty($facDerniereSituation->lines)) { |
|
3233 | 3233 | $TFacLinesKey = array_keys($facDerniereSituation->lines); |
3234 | 3234 | $TObjectLinesKey = array_keys($object->lines); |
3235 | 3235 | $TDiffKey = array_diff($TObjectLinesKey, $TFacLinesKey); |
@@ -3441,16 +3441,16 @@ discard block |
||
3441 | 3441 | $facDerniereSituation = $TPreviousInvoices[0]; |
3442 | 3442 | |
3443 | 3443 | $ret = array( |
3444 | - 'HT' => 0, //montant HT normal |
|
3444 | + 'HT' => 0, //montant HT normal |
|
3445 | 3445 | 'HTnet' => 0, //montant HT |
3446 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
3447 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
3446 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
3447 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
3448 | 3448 | 'retenue_garantie' => 0, |
3449 | 3449 | 'travaux_sup' => 0, |
3450 | 3450 | 'total_a_payer' => 0 //montant "a payer" sur la facture |
3451 | 3451 | ); |
3452 | 3452 | |
3453 | - if (! empty($facDerniereSituation)) { |
|
3453 | + if (!empty($facDerniereSituation)) { |
|
3454 | 3454 | $ret['derniere_situation'] = $facDerniereSituation; |
3455 | 3455 | $ret['date_derniere_situation'] = $facDerniereSituation->date; |
3456 | 3456 | } |
@@ -3584,7 +3584,7 @@ discard block |
||
3584 | 3584 | $label = $outputlangs->transnoentities("SituationInvoiceTotalProposal"); |
3585 | 3585 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', false, 1, $posx, $posy + 1); |
3586 | 3586 | |
3587 | - $amount = price($sign * ($total_ht + (! empty($propal->remise) ? $propal->remise : 0))); |
|
3587 | + $amount = price($sign * ($total_ht + (!empty($propal->remise) ? $propal->remise : 0))); |
|
3588 | 3588 | $pdf->MultiCell($width2, 3, $amount, 0, 'R', false, 1, $posx + $width, $posy + 1); |
3589 | 3589 | |
3590 | 3590 | $pdf->SetFont('', '', $default_font_size - 1); |
@@ -3627,7 +3627,7 @@ discard block |
||
3627 | 3627 | |
3628 | 3628 | $force_to_zero = false; |
3629 | 3629 | |
3630 | - $idinv = 0;//count($previousinvoices); |
|
3630 | + $idinv = 0; //count($previousinvoices); |
|
3631 | 3631 | while ($idinv < count($previousinvoices)) { |
3632 | 3632 | $invoice = $previousinvoices[$idinv]; |
3633 | 3633 | |
@@ -3649,7 +3649,7 @@ discard block |
||
3649 | 3649 | $force_to_zero = true; |
3650 | 3650 | } |
3651 | 3651 | |
3652 | - $ref .= ' - '. $invoice->ref; |
|
3652 | + $ref .= ' - '.$invoice->ref; |
|
3653 | 3653 | $ref .= ' ('.dol_print_date($invoice->date, "%d/%m/%Y", false, $outputlangs).')'; |
3654 | 3654 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', false); |
3655 | 3655 | |
@@ -3680,7 +3680,7 @@ discard block |
||
3680 | 3680 | if (($invoice->lines[$i]->info_bits & 0x01) == 0x01) { |
3681 | 3681 | $vatrate .= '*'; |
3682 | 3682 | } |
3683 | - if (! isset($tvas[$vatrate])) { |
|
3683 | + if (!isset($tvas[$vatrate])) { |
|
3684 | 3684 | $tvas[$vatrate] = 0; |
3685 | 3685 | } |
3686 | 3686 | $tvas[$vatrate] += $tvaligne; |
@@ -3858,7 +3858,7 @@ discard block |
||
3858 | 3858 | $pdf->SetXY($posx + $width4, $posy + $height * $index + $y); |
3859 | 3859 | $pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', false); |
3860 | 3860 | $pdf->SetXY($posx + $width4 * 2, $posy + $height * $index + $y); |
3861 | - $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $payment['type']); |
|
3861 | + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$payment['type']); |
|
3862 | 3862 | |
3863 | 3863 | $pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', false); |
3864 | 3864 | $pdf->SetXY($posx + $width4 * 3, $posy + $height * $index + $y); |
@@ -3889,7 +3889,7 @@ discard block |
||
3889 | 3889 | $this->_pagehead($pdf, $object, 0, $outputlangs); |
3890 | 3890 | } |
3891 | 3891 | $pdf->setPage($pageposafter + 1); |
3892 | - $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
3892 | + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
3893 | 3893 | |
3894 | 3894 | $posy = $this->tab_top_newpage + 1; |
3895 | 3895 | } else { |
@@ -3921,7 +3921,7 @@ discard block |
||
3921 | 3921 | |
3922 | 3922 | $posy += 10; |
3923 | 3923 | |
3924 | - $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
3924 | + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. |
|
3925 | 3925 | |
3926 | 3926 | $pdf->SetTextColor(0, 0, 60); |
3927 | 3927 | $pdf->SetFont('', '', $default_font_size - 1); |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | |
27 | 27 | // Load Dolibarr environment |
28 | 28 | require '../main.inc.php'; |
29 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
30 | -require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; // Changed from commande.class.php |
|
31 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/expedition.lib.php'; // Changed from order.lib.php |
|
32 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/sendings.lib.php'; |
|
29 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Changed from commande.class.php |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; // Changed from order.lib.php |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | */ |
123 | 123 | |
124 | 124 | $form = new Form($db); |
125 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; |
|
126 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Shipping uses ref primarily |
|
125 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; |
|
126 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Shipping uses ref primarily |
|
127 | 127 | |
128 | 128 | if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/shippingrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { // New constant or fallback |
129 | - $title = $object->ref . ' - ' . $langs->trans("Info"); |
|
129 | + $title = $object->ref.' - '.$langs->trans("Info"); |
|
130 | 130 | } |
131 | 131 | $help_url = "EN:Module_Shippings|FR:Module_Expeditions|ES:Módulo_Expediciones"; // Changed help URL |
132 | 132 | llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-shipping page-card_messaging'); // Changed mod-order |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['expedition'])) { // Changed from order |
142 | 142 | $tmpurl = $_SESSION['pageforbacktolist']['expedition']; // Changed from order |
143 | 143 | $tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); |
144 | - $linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; |
|
144 | + $linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
|
145 | 145 | } else { |
146 | - $linkback = '<a href="' . DOL_URL_ROOT . '/expedition/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; // Changed from commande |
|
146 | + $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; // Changed from commande |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | $morehtmlref = '<div class="refidno">'; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $morehtmlref .= $object->ref; |
152 | 152 | // Thirdparty |
153 | 153 | if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
154 | - $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'shipping'); // Changed from order |
|
154 | + $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'shipping'); // Changed from order |
|
155 | 155 | } |
156 | 156 | $morehtmlref .= '</div>'; |
157 | 157 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $out = ''; |
179 | 179 | $permok = $user->hasRight('agenda', 'myactions', 'create'); |
180 | 180 | if ($permok) { |
181 | - $out .= '&shippingid=' . $object->id; // Changed from orderid |
|
181 | + $out .= '&shippingid='.$object->id; // Changed from orderid |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | |
@@ -189,35 +189,35 @@ discard block |
||
189 | 189 | $morehtmlright = ''; |
190 | 190 | |
191 | 191 | // Show link to change view in message |
192 | - $messagingUrl = DOL_URL_ROOT . '/expedition/messaging.php?id=' . $object->id; // Changed from commande |
|
192 | + $messagingUrl = DOL_URL_ROOT.'/expedition/messaging.php?id='.$object->id; // Changed from commande |
|
193 | 193 | $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); // Status 2 for "current page" |
194 | 194 | |
195 | 195 | // Show link to change view in agenda |
196 | - $messagingUrl = DOL_URL_ROOT . '/expedition/agenda.php?id=' . $object->id; // Changed from commande |
|
196 | + $messagingUrl = DOL_URL_ROOT.'/expedition/agenda.php?id='.$object->id; // Changed from commande |
|
197 | 197 | $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); // Status 1 for "not current page" |
198 | 198 | |
199 | 199 | |
200 | 200 | // Show link to add event |
201 | 201 | if (isModEnabled('agenda')) { |
202 | 202 | $addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); |
203 | - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); |
|
203 | + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); |
|
204 | 204 | } |
205 | 205 | |
206 | - $param = '&id=' . $object->id; |
|
206 | + $param = '&id='.$object->id; |
|
207 | 207 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
208 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
208 | + $param .= '&contextpage='.urlencode($contextpage); |
|
209 | 209 | } |
210 | 210 | if ($limit > 0 && $limit != $conf->liste_limit) { |
211 | - $param .= '&limit=' . ((int) $limit); |
|
211 | + $param .= '&limit='.((int) $limit); |
|
212 | 212 | } |
213 | 213 | |
214 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
215 | - $cachekey = 'count_events_expedition_' . $object->id; // Changed from commande |
|
214 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
215 | + $cachekey = 'count_events_expedition_'.$object->id; // Changed from commande |
|
216 | 216 | $nbEvent = dol_getcache($cachekey); |
217 | 217 | |
218 | - $titlelist = $langs->trans("ActionsOnShipping") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); // Changed from ActionsOnOrder |
|
218 | + $titlelist = $langs->trans("ActionsOnShipping").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); // Changed from ActionsOnOrder |
|
219 | 219 | if (!empty($conf->dol_optimize_smallscreen)) { |
220 | - $titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); |
|
220 | + $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); |
@@ -26,16 +26,16 @@ discard block |
||
26 | 26 | |
27 | 27 | // Load Dolibarr environment |
28 | 28 | require '../main.inc.php'; |
29 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
30 | -require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
31 | -require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; |
|
32 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/sendings.lib.php'; |
|
29 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; |
|
34 | 34 | |
35 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; // Keep if you use project linking in expedition |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/expedition.lib.php'; // Changed from order.lib.php |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; // Added for form->form_project |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Keep if you use project linking in expedition |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; // Changed from order.lib.php |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; // Added for form->form_project |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @var Conf $conf |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | */ |
126 | 126 | |
127 | 127 | $form = new Form($db); |
128 | -$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : ''; |
|
129 | -$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Shipping uses ref primarily |
|
128 | +$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; |
|
129 | +$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Shipping uses ref primarily |
|
130 | 130 | |
131 | 131 | if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/shippingrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { // New constant or fallback |
132 | - $title = $object->ref . ' - ' . $langs->trans("Info"); |
|
132 | + $title = $object->ref.' - '.$langs->trans("Info"); |
|
133 | 133 | } |
134 | 134 | $help_url = "EN:Module_Shippings|FR:Module_Expeditions|ES:Módulo_Expediciones"; // Changed help URL |
135 | 135 | llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-shipping page-card_agenda'); // Changed mod-order |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['expedition'])) { // Changed from order |
144 | 144 | $tmpurl = $_SESSION['pageforbacktolist']['expedition']; // Changed from order |
145 | 145 | $tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); |
146 | - $linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; |
|
146 | + $linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
|
147 | 147 | } else { |
148 | - $linkback = '<a href="' . DOL_URL_ROOT . '/expedition/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; // Changed from commande |
|
148 | + $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; // Changed from commande |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | $morehtmlref = '<div class="refidno">'; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $morehtmlref .= $object->ref; |
154 | 154 | // Thirdparty |
155 | 155 | if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
156 | - $morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'shipping'); // Changed from order |
|
156 | + $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'shipping'); // Changed from order |
|
157 | 157 | } |
158 | 158 | // Project - Keep as is if shipping can be linked to projects |
159 | 159 | if (isModEnabled('project')) { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $proj->fetch($object->fk_project); |
165 | 165 | $morehtmlref .= $proj->getNomUrl(1); |
166 | 166 | if ($proj->title) { |
167 | - $morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>'; |
|
167 | + $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>'; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $out = ''; |
193 | 193 | $permok = $user->hasRight('agenda', 'myactions', 'create'); |
194 | 194 | if ($permok) { |
195 | - $out .= '&shippingid=' . $object->id; // Changed from orderid |
|
195 | + $out .= '&shippingid='.$object->id; // Changed from orderid |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | |
@@ -202,35 +202,35 @@ discard block |
||
202 | 202 | $morehtmlright = ''; |
203 | 203 | |
204 | 204 | // Show link to change view in message |
205 | - $messagingUrl = DOL_URL_ROOT . '/expedition/messaging.php?id=' . $object->id; // Changed from commande |
|
205 | + $messagingUrl = DOL_URL_ROOT.'/expedition/messaging.php?id='.$object->id; // Changed from commande |
|
206 | 206 | $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); // Status 1 for "not current page" |
207 | 207 | |
208 | 208 | // Show link to change view in agenda |
209 | - $messagingUrl = DOL_URL_ROOT . '/expedition/agenda.php?id=' . $object->id; // Changed from commande |
|
209 | + $messagingUrl = DOL_URL_ROOT.'/expedition/agenda.php?id='.$object->id; // Changed from commande |
|
210 | 210 | $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); // Status 2 for "current page" |
211 | 211 | |
212 | 212 | |
213 | 213 | // Show link to add event |
214 | 214 | if (isModEnabled('agenda')) { |
215 | 215 | $addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create'); |
216 | - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight); |
|
216 | + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight); |
|
217 | 217 | } |
218 | 218 | |
219 | - $param = '&id=' . $object->id; |
|
219 | + $param = '&id='.$object->id; |
|
220 | 220 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
221 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
221 | + $param .= '&contextpage='.urlencode($contextpage); |
|
222 | 222 | } |
223 | 223 | if ($limit > 0 && $limit != $conf->liste_limit) { |
224 | - $param .= '&limit=' . ((int) $limit); |
|
224 | + $param .= '&limit='.((int) $limit); |
|
225 | 225 | } |
226 | 226 | |
227 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
228 | - $cachekey = 'count_events_expedition_' . $object->id; // Changed from commande |
|
227 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
228 | + $cachekey = 'count_events_expedition_'.$object->id; // Changed from commande |
|
229 | 229 | $nbEvent = dol_getcache($cachekey); |
230 | 230 | |
231 | - $titlelist = $langs->trans("ActionsOnShipping") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); // Changed from ActionsOnOrder |
|
231 | + $titlelist = $langs->trans("ActionsOnShipping").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); // Changed from ActionsOnOrder |
|
232 | 232 | if (!empty($conf->dol_optimize_smallscreen)) { |
233 | - $titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); |
|
233 | + $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); |