@@ -602,8 +602,8 @@ |
||
602 | 602 | $total = 0; |
603 | 603 | $total_ttc = 0; |
604 | 604 | $totalrecu = 0; |
605 | - $totalrecucreditnote = 0; // PHP Warning: Undefined variable $totalrecucreditnote |
|
606 | - $totalrecudeposits = 0; // PHP Warning: Undefined variable $totalrecudeposits |
|
605 | + $totalrecucreditnote = 0; // PHP Warning: Undefined variable $totalrecucreditnote |
|
606 | + $totalrecudeposits = 0; // PHP Warning: Undefined variable $totalrecudeposits |
|
607 | 607 | while ($i < $num) { |
608 | 608 | $objp = $db->fetch_object($resql); |
609 | 609 |
@@ -38,8 +38,8 @@ |
||
38 | 38 | accessforbidden('Auto order is not allowed'); // If Auto Order is disabled never allow access to this page (that is a NO LOGIN access) |
39 | 39 | } |
40 | 40 | |
41 | -$_SESSION["basiclayout"] = 1; // For the simple layout for public submission |
|
42 | -$_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', 1); // Default terminal for public submission is 1 |
|
41 | +$_SESSION["basiclayout"] = 1; // For the simple layout for public submission |
|
42 | +$_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', 1); // Default terminal for public submission is 1 |
|
43 | 43 | |
44 | 44 | define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1); |
45 | 45 | if (GETPOSTISSET("mobilepage")) { |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | |
54 | 54 | // Load Dolibarr environment |
55 | 55 | require '../../main.inc.php'; |
56 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
57 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php'; |
|
58 | -require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
59 | -require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php'; |
|
60 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
61 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
62 | -require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php'; |
|
63 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
64 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php'; |
|
65 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php'; |
|
56 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
57 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; |
|
58 | +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
59 | +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; |
|
60 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
61 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
62 | +require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; |
|
63 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
64 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; |
|
65 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/public.lib.php'; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * @var Conf $conf |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | // permissions |
96 | 96 | |
97 | -$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
97 | +$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
98 | 98 | |
99 | 99 | // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context |
100 | 100 | $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | print '<body id="mainbody" class="publicnewmemberform">'; |
128 | 128 | |
129 | 129 | // Define urllogo |
130 | - $urllogo = DOL_URL_ROOT . '/theme/common/login_logo.png'; |
|
131 | - |
|
132 | - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { |
|
133 | - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/thumbs/' . $mysoc->logo_small); |
|
134 | - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) { |
|
135 | - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/' . $mysoc->logo); |
|
136 | - } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) { |
|
137 | - $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.svg'; |
|
130 | + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; |
|
131 | + |
|
132 | + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { |
|
133 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); |
|
134 | + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { |
|
135 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); |
|
136 | + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { |
|
137 | + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | print '<header class="center">'; |
@@ -143,17 +143,17 @@ discard block |
||
143 | 143 | // if ($urllogo) { // test always true |
144 | 144 | print '<div class="backgreypublicpayment">'; |
145 | 145 | print '<div class="logopublicpayment">'; |
146 | - print '<img id="dolpaymentlogo" src="' . $urllogo . '">'; |
|
146 | + print '<img id="dolpaymentlogo" src="'.$urllogo.'">'; |
|
147 | 147 | print '</div>'; |
148 | 148 | if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { |
149 | - print '<div class="poweredbypublicpayment opacitymedium right"><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>'; |
|
149 | + print '<div class="poweredbypublicpayment opacitymedium right"><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>'; |
|
150 | 150 | } |
151 | 151 | print '</div>'; |
152 | 152 | // } |
153 | 153 | |
154 | 154 | if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { |
155 | 155 | print '<div class="backimagepublicregistration">'; |
156 | - print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION') . '">'; |
|
156 | + print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION').'">'; |
|
157 | 157 | print '</div>'; |
158 | 158 | } |
159 | 159 | |
@@ -176,8 +176,8 @@ discard block |
||
176 | 176 | printCommonFooter('public'); |
177 | 177 | |
178 | 178 | if (!empty($conf->use_javascript_ajax)) { |
179 | - print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n"; |
|
180 | - print '<script src="' . DOL_URL_ROOT . '/core/js/lib_foot.js.php?lang=' . $langs->defaultlang . '"></script>' . "\n"; |
|
179 | + print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n"; |
|
180 | + print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'"></script>'."\n"; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | print "</body>\n"; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code')))); |
216 | 216 | if (!$ok) { |
217 | 217 | $error++; |
218 | - $errmsg .= $langs->trans("ErrorBadValueForCode") . "<br>\n"; |
|
218 | + $errmsg .= $langs->trans("ErrorBadValueForCode")."<br>\n"; |
|
219 | 219 | $action = ''; |
220 | 220 | } |
221 | 221 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $societe->phone = GETPOST('phone', 'alpha'); |
231 | 231 | $societe->fax = GETPOST('fax', 'alpha'); |
232 | 232 | $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
233 | - $societe->client = 2 ; // our client is a prospect |
|
233 | + $societe->client = 2; // our client is a prospect |
|
234 | 234 | $societe->code_client = '-1'; |
235 | 235 | $societe->name_alias = GETPOST('name_alias', 'alphanohtml'); |
236 | 236 | $societe->note_private = GETPOST('note_private', 'alphanohtml'); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | if (!$error) { |
256 | 256 | $result = $societe->create($user); |
257 | 257 | if ($result > 0) { |
258 | - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; |
|
258 | + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; |
|
259 | 259 | $objectsoc = $societe; |
260 | 260 | |
261 | 261 | if (!empty($backtopage)) { |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $urlback = getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION'); |
265 | 265 | // TODO Make replacement of __AMOUNT__, etc... |
266 | 266 | } else { |
267 | - $urlback = $_SERVER["PHP_SELF"] . "?action=added&token=" . newToken(); |
|
267 | + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); |
|
268 | 268 | } |
269 | 269 | } else { |
270 | 270 | $error++; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | if (!$error) { |
277 | 277 | $db->commit(); |
278 | 278 | |
279 | - header("Location: " . $urlback); |
|
279 | + header("Location: ".$urlback); |
|
280 | 280 | exit; |
281 | 281 | } else { |
282 | 282 | $db->rollback(); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | llxHeaderVierge($langs->trans("ContactUs")); |
317 | 317 | |
318 | 318 | print '<br>'; |
319 | -print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . ' ' . $langs->trans("ContactUs"), '', '', 0, '', 'center'); |
|
319 | +print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"').' '.$langs->trans("ContactUs"), '', '', 0, '', 'center'); |
|
320 | 320 | |
321 | 321 | |
322 | 322 | print '<div align="center">'; |
@@ -324,9 +324,9 @@ discard block |
||
324 | 324 | |
325 | 325 | print '<div class="center subscriptionformhelptext opacitymedium justify">'; |
326 | 326 | if (getDolGlobalString('COMPANY_NEWFORM_TEXT')) { |
327 | - print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT')) . "<br>\n"; |
|
327 | + print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT'))."<br>\n"; |
|
328 | 328 | } else { |
329 | - print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL")) . "<br>\n"; |
|
329 | + print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."<br>\n"; |
|
330 | 330 | } |
331 | 331 | print '</div>'; |
332 | 332 | |
@@ -334,13 +334,13 @@ discard block |
||
334 | 334 | dol_htmloutput_events(); |
335 | 335 | |
336 | 336 | // Print form |
337 | -print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newprospect">' . "\n"; |
|
338 | -print '<input type="hidden" name="token" value="' . newToken() . '" / >'; |
|
339 | -print '<input type="hidden" name="entity" value="' . $entity . '" />'; |
|
337 | +print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newprospect">'."\n"; |
|
338 | +print '<input type="hidden" name="token" value="'.newToken().'" / >'; |
|
339 | +print '<input type="hidden" name="entity" value="'.$entity.'" />'; |
|
340 | 340 | print '<input type="hidden" name="action" value="add" />'; |
341 | 341 | print '<br>'; |
342 | 342 | |
343 | -$messagemandatory = '<span class="">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span>'; |
|
343 | +$messagemandatory = '<span class="">'.$langs->trans("FieldsWithAreMandatory", '*').'</span>'; |
|
344 | 344 | //print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>'; |
345 | 345 | //print $langs->trans("FieldsWithIsForPublic",'**').'<br>'; |
346 | 346 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | </script>'; |
377 | 377 | |
378 | 378 | |
379 | -print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n"; |
|
379 | +print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n"; |
|
380 | 380 | //Third party name |
381 | 381 | /* |
382 | 382 | if ($objectsoc->particulier || $private) { |
@@ -386,30 +386,30 @@ discard block |
||
386 | 386 | } |
387 | 387 | */ |
388 | 388 | print '<tr class="tr-field-thirdparty-name"><td class="titlefieldcreate">'; // text appreas left |
389 | -print '<input type="hidden" name="ThirdPartyName" value="' . $langs->trans('ThirdPartyName') . '">'; |
|
390 | -print '<span id="TypeName" class="fieldrequired" title="' .dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')) . '" >' . $form->editfieldkey('Company', 'name', '', $objectsoc, 0) . '<span class="star"> *</span></span>'; |
|
389 | +print '<input type="hidden" name="ThirdPartyName" value="'.$langs->trans('ThirdPartyName').'">'; |
|
390 | +print '<span id="TypeName" class="fieldrequired" title="'.dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')).'" >'.$form->editfieldkey('Company', 'name', '', $objectsoc, 0).'<span class="star"> *</span></span>'; |
|
391 | 391 | print '</td><td>'; // inline input |
392 | -print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="' . dol_escape_htmltag($objectsoc->name) . '" autofocus="autofocus">'; |
|
392 | +print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($objectsoc->name).'" autofocus="autofocus">'; |
|
393 | 393 | // |
394 | 394 | |
395 | 395 | // Name and lastname |
396 | -print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Firstname") . ' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('firstname')) . '"></td></tr>' . "\n"; |
|
396 | +print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Firstname").' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'"></td></tr>'."\n"; |
|
397 | 397 | |
398 | -print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Lastname") . ' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('lastname')) . '"></td></tr>' . "\n"; |
|
398 | +print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Lastname").' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n"; |
|
399 | 399 | |
400 | 400 | // Address |
401 | 401 | print '<tr><td class="tdtop">'; |
402 | 402 | print $form->editfieldkey('Address', 'address', '', $objectsoc, 0); |
403 | 403 | print '</td>'; |
404 | 404 | print '<td>'; |
405 | -print '<textarea name="address" id="address" class="quatrevingtpercent" rows="' . ROWS_2 . '" wrap="soft">'; |
|
405 | +print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_2.'" wrap="soft">'; |
|
406 | 406 | print dol_escape_htmltag($objectsoc->address, 0, 1); |
407 | 407 | print '</textarea>'; |
408 | 408 | print $form->widgetForTranslation("address", $objectsoc, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent'); |
409 | 409 | print '</td></tr>'; |
410 | 410 | |
411 | 411 | // Country |
412 | -print '<tr><td>' . $form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0) . '</td><td class="maxwidthonsmartphone">'; |
|
412 | +print '<tr><td>'.$form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0).'</td><td class="maxwidthonsmartphone">'; |
|
413 | 413 | print img_picto('', 'country', 'class="pictofixedwidth"'); |
414 | 414 | print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $objectsoc->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx'); |
415 | 415 | if ($user->admin) { |
@@ -418,40 +418,40 @@ discard block |
||
418 | 418 | print '</td></tr>'; |
419 | 419 | |
420 | 420 | // Phone / Fax |
421 | -print '<tr><td>' . $form->editfieldkey('Phone', 'phone', '', $objectsoc, 0) . '</td>'; |
|
422 | -print '<td>' . img_picto('', 'object_phoning', 'class="pictofixedwidth"') . ' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone) . '"></td>'; |
|
421 | +print '<tr><td>'.$form->editfieldkey('Phone', 'phone', '', $objectsoc, 0).'</td>'; |
|
422 | +print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone).'"></td>'; |
|
423 | 423 | print '</tr>'; |
424 | 424 | |
425 | 425 | print '<tr>'; |
426 | -print '<td>' . $form->editfieldkey('Fax', 'fax', '', $objectsoc, 0) . '</td>'; |
|
427 | -print '<td>' . img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"') . ' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax) . '"></td>'; |
|
426 | +print '<td>'.$form->editfieldkey('Fax', 'fax', '', $objectsoc, 0).'</td>'; |
|
427 | +print '<td>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax).'"></td>'; |
|
428 | 428 | print '</tr>'; |
429 | 429 | |
430 | 430 | // Email / Web |
431 | -print '<tr><td>' . $form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY) . '</td>'; |
|
432 | -print '<td>' . img_picto('', 'object_email', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="' . $objectsoc->email . '"></td>'; |
|
431 | +print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY).'</td>'; |
|
432 | +print '<td>'.img_picto('', 'object_email', 'class="pictofixedwidth"').' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="'.$objectsoc->email.'"></td>'; |
|
433 | 433 | if (isModEnabled('mailing') && getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) { |
434 | 434 | if ($conf->browser->layout == 'phone') { |
435 | 435 | print '</tr><tr>'; |
436 | 436 | } |
437 | - print '<td class="individualline noemail">' . $form->editfieldkey($langs->trans('No_Email') . ' (' . $langs->trans('Contact') . ')', 'contact_no_email', '', $objectsoc, 0) . '</td>'; |
|
438 | - print '<td class="individualline" ' . (($conf->browser->layout == 'phone') /* || !isModEnabled('mailing') */ ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1) . '</td>'; |
|
437 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $objectsoc, 0).'</td>'; |
|
438 | + print '<td class="individualline" '.(($conf->browser->layout == 'phone') /* || !isModEnabled('mailing') */ ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
|
439 | 439 | } |
440 | 440 | print '</tr>'; |
441 | 441 | |
442 | -print '<tr><td>' . $form->editfieldkey('Web', 'url', '', $objectsoc, 0) . '</td>'; |
|
443 | -print '<td>' . img_picto('', 'globe', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="' . $objectsoc->url . '"></td></tr>'; |
|
442 | +print '<tr><td>'.$form->editfieldkey('Web', 'url', '', $objectsoc, 0).'</td>'; |
|
443 | +print '<td>'.img_picto('', 'globe', 'class="pictofixedwidth"').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="'.$objectsoc->url.'"></td></tr>'; |
|
444 | 444 | |
445 | 445 | |
446 | 446 | // Comments |
447 | 447 | print '<tr>'; |
448 | -print '<td class="tdtop">' . $langs->trans("Comments") . '</td>'; |
|
449 | -print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1) . '</textarea></td>'; |
|
450 | -print '</tr>' . "\n"; |
|
448 | +print '<td class="tdtop">'.$langs->trans("Comments").'</td>'; |
|
449 | +print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1).'</textarea></td>'; |
|
450 | +print '</tr>'."\n"; |
|
451 | 451 | |
452 | 452 | |
453 | 453 | // Other attributes |
454 | -$parameters['tpl_context'] = 'public'; // define template context to public |
|
454 | +$parameters['tpl_context'] = 'public'; // define template context to public |
|
455 | 455 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
456 | 456 | |
457 | 457 | |
@@ -459,14 +459,14 @@ discard block |
||
459 | 459 | |
460 | 460 | // Display Captcha code if is enabled |
461 | 461 | if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { |
462 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
|
463 | - print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">' . $langs->trans("SecurityCode") . '</span></label></td><td>'; |
|
462 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
|
463 | + print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>'; |
|
464 | 464 | print '<span class="span-icon-security inline-block">'; |
465 | - print '<input id="securitycode" placeholder="' . $langs->trans("SecurityCode") . '" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />'; |
|
465 | + print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />'; |
|
466 | 466 | print '</span>'; |
467 | 467 | print '<span class="nowrap inline-block">'; |
468 | - print '<img class="inline-block valignmiddle" src="' . DOL_URL_ROOT . '/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />'; |
|
469 | - print '<a class="inline-block valignmiddle" href="' . $_SERVER['PHP_SELF'] . '" tabindex="4" data-role="button">' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . '</a>'; |
|
468 | + print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />'; |
|
469 | + print '<a class="inline-block valignmiddle" href="'.$_SERVER['PHP_SELF'].'" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>'; |
|
470 | 470 | print '</span>'; |
471 | 471 | print '</td></tr>'; |
472 | 472 | } |
@@ -477,9 +477,9 @@ discard block |
||
477 | 477 | |
478 | 478 | // Save / Submit |
479 | 479 | print '<div class="center">'; |
480 | -print '<input type="submit" value="' . $langs->trans("Send") . '" id="submitsave" class="button">'; |
|
480 | +print '<input type="submit" value="'.$langs->trans("Send").'" id="submitsave" class="button">'; |
|
481 | 481 | if (!empty($backtopage)) { |
482 | - print ' <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">'; |
|
482 | + print ' <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">'; |
|
483 | 483 | } |
484 | 484 | print '</div>'; |
485 | 485 |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | $month_current = (int) dol_print_date(dol_now(), "%m"); |
63 | 63 | $year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1); |
64 | 64 | } |
65 | -$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere |
|
66 | -$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere |
|
65 | +$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere |
|
66 | +$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere |
|
67 | 67 | |
68 | 68 | // We define date_start and date_end |
69 | 69 | if (empty($date_start) || empty($date_end)) { // We define date_start and date_end |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $sql .= " AND b.doc_type = 'customer_invoice'"; |
294 | 294 | $sql .= " AND aa.entity = ".$conf->entity; |
295 | 295 | $sql .= " AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'"; |
296 | - $sql .= " AND aa.pcg_type = 'INCOME'"; // TODO Be able to use a custom group |
|
296 | + $sql .= " AND aa.pcg_type = 'INCOME'"; // TODO Be able to use a custom group |
|
297 | 297 | } |
298 | 298 | $sql .= " GROUP BY dm"; |
299 | 299 | $sql .= " ORDER BY dm"; |
@@ -498,12 +498,12 @@ discard block |
||
498 | 498 | //var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end); |
499 | 499 | if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) { |
500 | 500 | if ($annee_decalage > $minyear && $case <= $casenow) { |
501 | - if ($modecompta=='CREANCES-DETTES') { |
|
502 | - $cumulative_previous_year = (!empty($cumulative_ht[$caseprev])?$cumulative_ht[$caseprev]:0); |
|
503 | - $cumulative_year = (!empty($cumulative_ht[$case])?$cumulative_ht[$case]:0); |
|
501 | + if ($modecompta == 'CREANCES-DETTES') { |
|
502 | + $cumulative_previous_year = (!empty($cumulative_ht[$caseprev]) ? $cumulative_ht[$caseprev] : 0); |
|
503 | + $cumulative_year = (!empty($cumulative_ht[$case]) ? $cumulative_ht[$case] : 0); |
|
504 | 504 | } else { |
505 | - $cumulative_previous_year = (!empty($cumulative[$caseprev])?$cumulative[$caseprev]:0); |
|
506 | - $cumulative_year = (!empty($cumulative[$case])?$cumulative[$case]:0); |
|
505 | + $cumulative_previous_year = (!empty($cumulative[$caseprev]) ? $cumulative[$caseprev] : 0); |
|
506 | + $cumulative_year = (!empty($cumulative[$case]) ? $cumulative[$case] : 0); |
|
507 | 507 | } |
508 | 508 | if (!empty($cumulative_previous_year) && !empty($cumulative_year)) { |
509 | 509 | $percent = (round(($cumulative_year - $cumulative_previous_year) / $cumulative_previous_year, 4) * 100); |
@@ -646,11 +646,11 @@ discard block |
||
646 | 646 | // Pourcentage total |
647 | 647 | if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) { |
648 | 648 | if ($modecompta == 'CREANCES-DETTES') { |
649 | - $total_previous_year = (!empty($total_ht[$annee - 1])?$total_ht[$annee - 1]:0); |
|
650 | - $total_year = (!empty($total_ht[$annee])?$total_ht[$annee]:0); |
|
649 | + $total_previous_year = (!empty($total_ht[$annee - 1]) ? $total_ht[$annee - 1] : 0); |
|
650 | + $total_year = (!empty($total_ht[$annee]) ? $total_ht[$annee] : 0); |
|
651 | 651 | } else { |
652 | - $total_previous_year = (!empty($total[$annee - 1])?$total[$annee - 1]:0); |
|
653 | - $total_year = (!empty($total[$annee])?$total[$annee]:0); |
|
652 | + $total_previous_year = (!empty($total[$annee - 1]) ? $total[$annee - 1] : 0); |
|
653 | + $total_year = (!empty($total[$annee]) ? $total[$annee] : 0); |
|
654 | 654 | } |
655 | 655 | if (!empty($total_previous_year) && !empty($total_year)) { |
656 | 656 | $percent = (round(($total_year - $total_previous_year) / $total_previous_year, 4) * 100); |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | $cancel = GETPOST('cancel', 'alpha'); |
66 | 66 | $toselect = GETPOST('toselect', 'array'); |
67 | 67 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search |
68 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
69 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
68 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
69 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
70 | 70 | |
71 | 71 | |
72 | 72 | $id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if ($ret < 0) { |
109 | 109 | dol_print_error($db, $object->error, $object->errors); |
110 | 110 | exit; |
111 | - } elseif (! $ret) { |
|
111 | + } elseif (!$ret) { |
|
112 | 112 | setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); |
113 | 113 | } |
114 | 114 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
253 | 253 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
254 | - $object->fk_societe_rib = GETPOSTINT('accountcustomerid'); |
|
254 | + $object->fk_societe_rib = GETPOSTINT('accountcustomerid'); |
|
255 | 255 | |
256 | 256 | $object->frequency = $frequency; |
257 | 257 | $object->unit_frequency = GETPOST('unit_frequency', 'alpha'); |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | // Define special_code for special lines |
841 | 841 | $special_code = GETPOSTINT('special_code'); |
842 | 842 | if ($special_code == 3) { |
843 | - $special_code = 0; // Options should not exists on invoices |
|
843 | + $special_code = 0; // Options should not exists on invoices |
|
844 | 844 | } |
845 | 845 | |
846 | 846 | /*$line = new FactureLigne($db); |
@@ -1116,11 +1116,11 @@ discard block |
||
1116 | 1116 | |
1117 | 1117 | print '<script> |
1118 | 1118 | $(document).ready(function() { |
1119 | - if($("#selectmode_reglement_id option:selected").data("code") != "' . $factureRec::PAYMENTCODETOEDITSOCIETERIB . '") { |
|
1119 | + if($("#selectmode_reglement_id option:selected").data("code") != "' . $factureRec::PAYMENTCODETOEDITSOCIETERIB.'") { |
|
1120 | 1120 | hideselectfksocieterib(); |
1121 | 1121 | } |
1122 | 1122 | $("#selectmode_reglement_id").change(function() { |
1123 | - if($("#selectmode_reglement_id option:selected").data("code") != "'. $factureRec::PAYMENTCODETOEDITSOCIETERIB .'") { |
|
1123 | + if($("#selectmode_reglement_id option:selected").data("code") != "'. $factureRec::PAYMENTCODETOEDITSOCIETERIB.'") { |
|
1124 | 1124 | hideselectfksocieterib(1); |
1125 | 1125 | } else { |
1126 | 1126 | showselectfksocieterib(); |
@@ -1460,15 +1460,15 @@ discard block |
||
1460 | 1460 | print '<td>'; |
1461 | 1461 | |
1462 | 1462 | if (($action != 'editbankaccountcustomer') && $user->hasRight('facture', 'creer') && $object->statut == FactureRec::STATUS_DRAFT) { |
1463 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editbankaccountcustomer&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetDebitBankAccount'), 1) . '</a></td>'; |
|
1463 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccountcustomer&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDebitBankAccount'), 1).'</a></td>'; |
|
1464 | 1464 | } |
1465 | 1465 | print '</tr></table>'; |
1466 | 1466 | print '</td><td>'; |
1467 | 1467 | |
1468 | 1468 | if ($action == 'editbankaccountcustomer') { |
1469 | - $form->formRib($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_societe_rib, 'accountcustomerid', 'fk_soc='.$object->socid, 1, 1); |
|
1469 | + $form->formRib($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_societe_rib, 'accountcustomerid', 'fk_soc='.$object->socid, 1, 1); |
|
1470 | 1470 | } else { |
1471 | - $form->formRib($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_societe_rib, 'none', '', 0, 1); |
|
1471 | + $form->formRib($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_societe_rib, 'none', '', 0, 1); |
|
1472 | 1472 | } |
1473 | 1473 | print "</td>"; |
1474 | 1474 | print '</tr>'; |
@@ -1688,10 +1688,10 @@ discard block |
||
1688 | 1688 | |
1689 | 1689 | // Lines |
1690 | 1690 | print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOSTINT('lineid')).'" method="POST">'; |
1691 | - print '<input type="hidden" name="token" value="' . newToken().'">'; |
|
1692 | - print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1691 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1692 | + print '<input type="hidden" name="action" value="'.(($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1693 | 1693 | print '<input type="hidden" name="mode" value="">'; |
1694 | - print '<input type="hidden" name="id" value="' . $object->id.'">'; |
|
1694 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
1695 | 1695 | print '<input type="hidden" name="page_y" value="">'; |
1696 | 1696 | |
1697 | 1697 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
@@ -1746,16 +1746,16 @@ discard block |
||
1746 | 1746 | if (empty($object->suspended)) { |
1747 | 1747 | if ($user->hasRight('facture', 'creer')) { |
1748 | 1748 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
1749 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1749 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1750 | 1750 | } else { |
1751 | 1751 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
1752 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1752 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1753 | 1753 | } else { |
1754 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1754 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1755 | 1755 | } |
1756 | 1756 | } |
1757 | 1757 | } else { |
1758 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1758 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
1759 | 1759 | } |
1760 | 1760 | } |
1761 | 1761 | |
@@ -1768,7 +1768,7 @@ discard block |
||
1768 | 1768 | } |
1769 | 1769 | |
1770 | 1770 | // Delete |
1771 | - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
1771 | + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
1772 | 1772 | } |
1773 | 1773 | print '</div>'; |
1774 | 1774 |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $object->delivery_date = $date_delivery; |
229 | 229 | foreach ($object->lines as $line) { |
230 | 230 | if (isset($line->date_start)) { |
231 | - $line->date_start += $difference; |
|
231 | + $line->date_start += $difference; |
|
232 | 232 | } |
233 | 233 | if (isset($line->date_end)) { |
234 | 234 | $line->date_end += $difference; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | |
577 | 577 | $classname = ucfirst($subelement); |
578 | 578 | $srcobject = new $classname($db); |
579 | - '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
579 | + '@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic |
|
580 | 580 | |
581 | 581 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
582 | 582 | $result = $srcobject->fetch($object->origin_id); |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | $error++; |
767 | 767 | } else { |
768 | 768 | // Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded) |
769 | - $locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id; |
|
769 | + $locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; |
|
770 | 770 | } |
771 | 771 | |
772 | 772 | $deposit = null; |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on' |
778 | 778 | && !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer') |
779 | 779 | ) { |
780 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
780 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
781 | 781 | |
782 | 782 | $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); |
783 | 783 | $forceFields = array(); |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | |
791 | 791 | if ($deposit) { |
792 | 792 | setEventMessage('DepositGenerated'); |
793 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
793 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
794 | 794 | } else { |
795 | 795 | $error++; |
796 | 796 | setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors'); |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | } |
819 | 819 | |
820 | 820 | if ($locationTarget) { |
821 | - header('Location: ' . $locationTarget); |
|
821 | + header('Location: '.$locationTarget); |
|
822 | 822 | exit; |
823 | 823 | } |
824 | 824 | } else { |
@@ -1172,8 +1172,8 @@ discard block |
||
1172 | 1172 | $pricebycustomerexist = true; |
1173 | 1173 | $pu_ht = price($prodcustprice->lines[0]->price); |
1174 | 1174 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
1175 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
1176 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
1175 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
1176 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
1177 | 1177 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
1178 | 1178 | /*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); |
1179 | 1179 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -1229,8 +1229,8 @@ discard block |
||
1229 | 1229 | if (count($prodcustprice->lines) > 0) { |
1230 | 1230 | $pu_ht = price($prodcustprice->lines[0]->price); |
1231 | 1231 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
1232 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
1233 | - $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
1232 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
1233 | + $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc); |
|
1234 | 1234 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
1235 | 1235 | /*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); |
1236 | 1236 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -1738,8 +1738,8 @@ discard block |
||
1738 | 1738 | } elseif ($action == 'setconditions' && $usercancreate) { |
1739 | 1739 | // Terms of payment |
1740 | 1740 | $sql = "SELECT code "; |
1741 | - $sql .= "FROM " . $db->prefix() . "c_payment_term"; |
|
1742 | - $sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int')); |
|
1741 | + $sql .= "FROM ".$db->prefix()."c_payment_term"; |
|
1742 | + $sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int')); |
|
1743 | 1743 | $result = $db->query($sql); |
1744 | 1744 | if ($result) { |
1745 | 1745 | $obj = $db->fetch_object($result); |
@@ -1924,7 +1924,7 @@ discard block |
||
1924 | 1924 | |
1925 | 1925 | $classname = ucfirst($subelement); |
1926 | 1926 | $objectsrc = new $classname($db); |
1927 | - '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
1927 | + '@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic |
|
1928 | 1928 | $objectsrc->fetch($originid); |
1929 | 1929 | if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { |
1930 | 1930 | $objectsrc->fetch_lines(); |
@@ -1938,7 +1938,7 @@ discard block |
||
1938 | 1938 | |
1939 | 1939 | $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); |
1940 | 1940 | $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); |
1941 | - $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); |
|
1941 | + $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); |
|
1942 | 1942 | |
1943 | 1943 | // Replicate extrafields |
1944 | 1944 | $objectsrc->fetch_optionals(); |
@@ -2002,7 +2002,7 @@ discard block |
||
2002 | 2002 | print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
2003 | 2003 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
2004 | 2004 | print '<input type="hidden" name="action" value="add">'; |
2005 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
2005 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
2006 | 2006 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
2007 | 2007 | if ($origin != 'project' && $originid) { |
2008 | 2008 | print '<input type="hidden" name="origin" value="'.$origin.'">'; |
@@ -2164,7 +2164,7 @@ discard block |
||
2164 | 2164 | $sday = date("d", $tmpdte); |
2165 | 2165 | print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop"); |
2166 | 2166 | } else { |
2167 | - $tmp_date_delivery = GETPOST('date_delivery') ? : -1; |
|
2167 | + $tmp_date_delivery = GETPOST('date_delivery') ?: -1; |
|
2168 | 2168 | print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1); |
2169 | 2169 | } |
2170 | 2170 | print '</td></tr>'; |
@@ -2396,7 +2396,7 @@ discard block |
||
2396 | 2396 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
2397 | 2397 | $formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED))); |
2398 | 2398 | } |
2399 | - $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
2399 | + $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) |
|
2400 | 2400 | |
2401 | 2401 | if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) { |
2402 | 2402 | // This is a hidden option: |
@@ -2406,7 +2406,7 @@ discard block |
||
2406 | 2406 | $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
2407 | 2407 | |
2408 | 2408 | if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { |
2409 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
2409 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
2410 | 2410 | |
2411 | 2411 | $object->fetchObjectLinked(); |
2412 | 2412 | |
@@ -2490,7 +2490,7 @@ discard block |
||
2490 | 2490 | 'type' => 'onecolumn', |
2491 | 2491 | 'value' => ' |
2492 | 2492 | <script> |
2493 | - let signedValue = ' . $object::STATUS_SIGNED . '; |
|
2493 | + let signedValue = ' . $object::STATUS_SIGNED.'; |
|
2494 | 2494 | |
2495 | 2495 | $(document).ready(function() { |
2496 | 2496 | $("[name=generate_deposit]").change(function () { |
@@ -2540,7 +2540,7 @@ discard block |
||
2540 | 2540 | if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { |
2541 | 2541 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
2542 | 2542 | } else { |
2543 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
2543 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); |
|
2544 | 2544 | } |
2545 | 2545 | } elseif ($action == 'cancel') { |
2546 | 2546 | // Confirm cancel |
@@ -2582,7 +2582,7 @@ discard block |
||
2582 | 2582 | $nbMandated = 0; |
2583 | 2583 | foreach ($object->lines as $line) { |
2584 | 2584 | $res = $line->fetch_product(); |
2585 | - if ($res > 0) { |
|
2585 | + if ($res > 0) { |
|
2586 | 2586 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
2587 | 2587 | $nbMandated++; |
2588 | 2588 | break; |
@@ -2623,7 +2623,7 @@ discard block |
||
2623 | 2623 | $morehtmlref = '<div class="refidno">'; |
2624 | 2624 | // Ref customer |
2625 | 2625 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); |
2626 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
2626 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
2627 | 2627 | // Thirdparty |
2628 | 2628 | $morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer'); |
2629 | 2629 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) { |
@@ -2965,50 +2965,50 @@ discard block |
||
2965 | 2965 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php'; |
2966 | 2966 | |
2967 | 2967 | print '<tr>'; |
2968 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
2969 | - print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
2968 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
2969 | + print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
2970 | 2970 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2971 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2971 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
2972 | 2972 | } |
2973 | 2973 | print '</tr>'; |
2974 | 2974 | |
2975 | 2975 | print '<tr>'; |
2976 | - print '<td>' . $langs->trans('AmountVAT') . '</td>'; |
|
2977 | - print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
2976 | + print '<td>'.$langs->trans('AmountVAT').'</td>'; |
|
2977 | + print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
2978 | 2978 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2979 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2979 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
2980 | 2980 | } |
2981 | 2981 | print '</tr>'; |
2982 | 2982 | |
2983 | 2983 | if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { |
2984 | 2984 | print '<tr>'; |
2985 | - print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
2986 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
2985 | + print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
2986 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
2987 | 2987 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
2988 | 2988 | $object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
2989 | 2989 | |
2990 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
2990 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
2991 | 2991 | } |
2992 | 2992 | print '</tr>'; |
2993 | 2993 | } |
2994 | 2994 | |
2995 | 2995 | if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { |
2996 | 2996 | print '<tr>'; |
2997 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
2998 | - print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
2997 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
2998 | + print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
2999 | 2999 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3000 | 3000 | $object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
3001 | 3001 | |
3002 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3002 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
3003 | 3003 | } |
3004 | 3004 | print '</tr>'; |
3005 | 3005 | } |
3006 | 3006 | |
3007 | 3007 | print '<tr>'; |
3008 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
3009 | - print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
3008 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
3009 | + print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
3010 | 3010 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
3011 | - print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>'; |
|
3011 | + print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>'; |
|
3012 | 3012 | } |
3013 | 3013 | print '</tr>'; |
3014 | 3014 | |
@@ -3151,7 +3151,7 @@ discard block |
||
3151 | 3151 | 'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED), |
3152 | 3152 | 'perm' => $usercancreateorder, |
3153 | 3153 | 'label' => 'AddOrder', |
3154 | - 'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
3154 | + 'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
3155 | 3155 | ); |
3156 | 3156 | /*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) { |
3157 | 3157 | if ($usercancreateorder) { |
@@ -3166,7 +3166,7 @@ discard block |
||
3166 | 3166 | 'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")), |
3167 | 3167 | 'perm' => $usercancreatepurchaseorder, |
3168 | 3168 | 'label' => 'AddPurchaseOrder', |
3169 | - 'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
3169 | + 'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
3170 | 3170 | ); |
3171 | 3171 | /*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) { |
3172 | 3172 | if ($usercancreatepurchaseorder) { |
@@ -3181,7 +3181,7 @@ discard block |
||
3181 | 3181 | 'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED), |
3182 | 3182 | 'perm' => $usercancreateintervention, |
3183 | 3183 | 'label' => 'AddIntervention', |
3184 | - 'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
3184 | + 'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
3185 | 3185 | ); |
3186 | 3186 | /*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) { |
3187 | 3187 | if ($usercancreateintervention) { |
@@ -3196,7 +3196,7 @@ discard block |
||
3196 | 3196 | 'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED), |
3197 | 3197 | 'perm' => $usercancreatecontract, |
3198 | 3198 | 'label' => 'AddContract', |
3199 | - 'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid) |
|
3199 | + 'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid) |
|
3200 | 3200 | ); |
3201 | 3201 | /*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) { |
3202 | 3202 | $langs->load("contracts"); |
@@ -3222,7 +3222,7 @@ discard block |
||
3222 | 3222 | |
3223 | 3223 | $actionButtonsParameters = [ |
3224 | 3224 | "areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"), |
3225 | - "backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id) |
|
3225 | + "backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id) |
|
3226 | 3226 | ]; |
3227 | 3227 | |
3228 | 3228 | if ($numlines > 0) { |
@@ -3256,8 +3256,8 @@ discard block |
||
3256 | 3256 | } else { |
3257 | 3257 | // Set not signed (close) |
3258 | 3258 | if ($object->status == Propal::STATUS_DRAFT && $usercanclose) { |
3259 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"'; |
|
3260 | - print '>' . $langs->trans('SetRefusedAndClose') . '</a>'; |
|
3259 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"'; |
|
3260 | + print '>'.$langs->trans('SetRefusedAndClose').'</a>'; |
|
3261 | 3261 | } |
3262 | 3262 | } |
3263 | 3263 |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | /** |
226 | 226 | * @var int ID |
227 | 227 | */ |
228 | - public $fk_account; // default bank account |
|
228 | + public $fk_account; // default bank account |
|
229 | 229 | |
230 | 230 | /** |
231 | 231 | * @var int Transport mode id |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | if ($this->fac_rec > 0) { |
438 | 438 | $this->fk_fac_rec_source = $this->fac_rec; |
439 | 439 | |
440 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php'; |
|
440 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php'; |
|
441 | 441 | $_facrec = new FactureFournisseurRec($this->db); |
442 | 442 | $result = $_facrec->fetch($this->fac_rec); |
443 | 443 | $result = $_facrec->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); // This load $_facrec->linkedObjectsIds |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $this->location_incoterms = $_facrec->location_incoterms; |
473 | 473 | |
474 | 474 | // Clean parameters |
475 | - if (! $this->type) { |
|
475 | + if (!$this->type) { |
|
476 | 476 | $this->type = self::TYPE_STANDARD; |
477 | 477 | } |
478 | 478 | $this->note_public = trim($this->note_public); |
@@ -481,11 +481,11 @@ discard block |
||
481 | 481 | |
482 | 482 | $this->array_options = $_facrec->array_options; |
483 | 483 | |
484 | - if (! $this->mode_reglement_id) { |
|
484 | + if (!$this->mode_reglement_id) { |
|
485 | 485 | $this->mode_reglement_id = 0; |
486 | 486 | } |
487 | 487 | $this->status = self::STATUS_DRAFT; |
488 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
488 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
489 | 489 | |
490 | 490 | $this->linked_objects = $_facrec->linkedObjectsIds; |
491 | 491 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | |
496 | 496 | // For recurring invoices, update date and number of last generation of recurring template invoice, before inserting new invoice |
497 | 497 | if ($_facrec->frequency > 0) { |
498 | - $this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1)); |
|
498 | + $this->ref_supplier = trim($this->ref_supplier.'_'.($_facrec->nb_gen_done + 1)); |
|
499 | 499 | dol_syslog("This is a recurring invoice so we set date_last_gen and next date_when"); |
500 | 500 | if (empty($_facrec->date_when)) { |
501 | 501 | $_facrec->date_when = $now; |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | /* |
732 | 732 | * Insert lines of template invoices |
733 | 733 | */ |
734 | - if (! $error && $this->fac_rec > 0 && $_facrec instanceof FactureFournisseurRec) { |
|
734 | + if (!$error && $this->fac_rec > 0 && $_facrec instanceof FactureFournisseurRec) { |
|
735 | 735 | foreach ($_facrec->lines as $i => $val) { |
736 | 736 | $product_type = $_facrec->lines[$i]->product_type; |
737 | 737 | if ($_facrec->lines[$i]->fk_product) { |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | $localtax1_tx=get_localtax($tva_tx,1,$soc,$mysoc,$tva_npr); |
748 | 748 | $localtax2_tx=get_localtax($tva_tx,2,$soc,$mysoc,$tva_npr); |
749 | 749 | */ |
750 | - $tva_tx = $_facrec->lines[$i]->tva_tx . ($_facrec->lines[$i]->vat_src_code ? '(' . $_facrec->lines[$i]->vat_src_code . ')' : ''); |
|
750 | + $tva_tx = $_facrec->lines[$i]->tva_tx.($_facrec->lines[$i]->vat_src_code ? '('.$_facrec->lines[$i]->vat_src_code.')' : ''); |
|
751 | 751 | $tva_npr = $_facrec->lines[$i]->info_bits; |
752 | 752 | if (empty($tva_tx)) { |
753 | 753 | $tva_npr = 0; |
@@ -760,8 +760,8 @@ discard block |
||
760 | 760 | $buyprice = empty($_facrec->lines[$i]->buyprice) ? 0 : $_facrec->lines[$i]->buyprice; |
761 | 761 | |
762 | 762 | // If buyprice not defined from template invoice, we try to guess the best value |
763 | - if (! $buyprice && $_facrec->lines[$i]->fk_product > 0) { |
|
764 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; |
|
763 | + if (!$buyprice && $_facrec->lines[$i]->fk_product > 0) { |
|
764 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; |
|
765 | 765 | $producttmp = new ProductFournisseur($this->db); |
766 | 766 | $producttmp->fetch($_facrec->lines[$i]->fk_product); |
767 | 767 | |
@@ -947,11 +947,11 @@ discard block |
||
947 | 947 | $this->id = $obj->rowid; |
948 | 948 | $this->ref = $obj->ref ? $obj->ref : $obj->rowid; // We take rowid if ref is empty for backward compatibility |
949 | 949 | |
950 | - $this->ref_supplier = $obj->ref_supplier; |
|
951 | - $this->ref_ext = $obj->ref_ext; |
|
952 | - $this->entity = $obj->entity; |
|
950 | + $this->ref_supplier = $obj->ref_supplier; |
|
951 | + $this->ref_ext = $obj->ref_ext; |
|
952 | + $this->entity = $obj->entity; |
|
953 | 953 | $this->type = empty($obj->type) ? self::TYPE_STANDARD : $obj->type; |
954 | - $this->subtype = (int) $obj->subtype; |
|
954 | + $this->subtype = (int) $obj->subtype; |
|
955 | 955 | $this->socid = $obj->fk_soc; |
956 | 956 | $this->datec = $this->db->jdate($obj->datec); |
957 | 957 | $this->date = $this->db->jdate($obj->datef); |
@@ -969,13 +969,13 @@ discard block |
||
969 | 969 | $this->total_tva = $obj->total_tva; |
970 | 970 | $this->total_ttc = $obj->total_ttc; |
971 | 971 | $this->status = $obj->status; |
972 | - $this->statut = $obj->status; // For backward compatibility |
|
973 | - $this->fk_statut = $obj->status; // For backward compatibility |
|
972 | + $this->statut = $obj->status; // For backward compatibility |
|
973 | + $this->fk_statut = $obj->status; // For backward compatibility |
|
974 | 974 | $this->user_creation_id = $obj->fk_user_author; |
975 | - $this->author = $obj->fk_user_author; // deprecated |
|
975 | + $this->author = $obj->fk_user_author; // deprecated |
|
976 | 976 | $this->user_validation_id = $obj->fk_user_valid; |
977 | 977 | $this->fk_facture_source = $obj->fk_facture_source; |
978 | - $this->vat_reverse_charge = empty($obj->vat_reverse_charge) ? 0 : 1; |
|
978 | + $this->vat_reverse_charge = empty($obj->vat_reverse_charge) ? 0 : 1; |
|
979 | 979 | $this->fk_fac_rec_source = $obj->fk_fac_rec_source; |
980 | 980 | $this->fk_project = $obj->fk_project; |
981 | 981 | $this->cond_reglement_id = $obj->fk_cond_reglement; |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | |
1012 | 1012 | $this->extraparams = isset($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array(); |
1013 | 1013 | |
1014 | - $this->socid = $obj->socid; |
|
1014 | + $this->socid = $obj->socid; |
|
1015 | 1015 | |
1016 | 1016 | // Retrieve all extrafield |
1017 | 1017 | // fetch optionals attributes and labels |
@@ -1078,11 +1078,11 @@ discard block |
||
1078 | 1078 | $line->date_end = $obj->date_end; |
1079 | 1079 | $line->product_ref = $obj->product_ref; |
1080 | 1080 | $line->ref = $obj->product_ref; |
1081 | - $line->ref_supplier = $obj->ref_supplier; |
|
1081 | + $line->ref_supplier = $obj->ref_supplier; |
|
1082 | 1082 | $line->libelle = $obj->label; |
1083 | 1083 | $line->label = $obj->label; |
1084 | 1084 | $line->product_barcode = $obj->product_barcode; |
1085 | - $line->product_desc = $obj->product_desc; |
|
1085 | + $line->product_desc = $obj->product_desc; |
|
1086 | 1086 | $line->subprice = $obj->pu_ht; |
1087 | 1087 | $line->pu_ht = $obj->pu_ht; |
1088 | 1088 | $line->pu_ttc = $obj->pu_ttc; |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | $line->localtax2_tx = $obj->localtax2_tx; |
1093 | 1093 | $line->localtax1_type = $obj->localtax1_type; |
1094 | 1094 | $line->localtax2_type = $obj->localtax2_type; |
1095 | - $line->qty = $obj->qty; |
|
1095 | + $line->qty = $obj->qty; |
|
1096 | 1096 | $line->remise_percent = $obj->remise_percent; |
1097 | 1097 | $line->fk_remise_except = $obj->fk_remise_except; |
1098 | 1098 | //$line->tva = $obj->total_tva; // deprecated |
@@ -2457,7 +2457,7 @@ discard block |
||
2457 | 2457 | |
2458 | 2458 | $line->qty = ($this->type == self::TYPE_CREDIT_NOTE ? abs((float) $qty) : (float) $qty); // For credit note, quantity is always positive and unit price negative |
2459 | 2459 | $line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs((float) $pu_ht) : (float) $pu_ht); // For credit note, unit price always negative, always positive otherwise |
2460 | - $line->pu_ht = $line->subprice; // deprecated |
|
2460 | + $line->pu_ht = $line->subprice; // deprecated |
|
2461 | 2461 | $line->pu_ttc = ($this->type == self::TYPE_CREDIT_NOTE ? -abs((float) $pu_ttc) : (float) $pu_ttc); // For credit note, unit price always negative, always positive otherwise |
2462 | 2462 | |
2463 | 2463 | $line->remise_percent = $remise_percent; |
@@ -2742,7 +2742,7 @@ discard block |
||
2742 | 2742 | |
2743 | 2743 | while ($obj = $this->db->fetch_object($resql)) { |
2744 | 2744 | $facturestatic->date_echeance = $this->db->jdate($obj->datefin); |
2745 | - $facturestatic->statut = $obj->status; // For backward compatibility |
|
2745 | + $facturestatic->statut = $obj->status; // For backward compatibility |
|
2746 | 2746 | $facturestatic->status = $obj->status; |
2747 | 2747 | |
2748 | 2748 | $response->nbtodo++; |
@@ -2955,7 +2955,7 @@ discard block |
||
2955 | 2955 | } |
2956 | 2956 | } |
2957 | 2957 | global $action; |
2958 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
2958 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
2959 | 2959 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
2960 | 2960 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
2961 | 2961 | if ($reshook > 0) { |
@@ -2986,7 +2986,7 @@ discard block |
||
2986 | 2986 | |
2987 | 2987 | $mybool = false; |
2988 | 2988 | |
2989 | - $file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER') . ".php"; |
|
2989 | + $file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER').".php"; |
|
2990 | 2990 | $classname = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER'); |
2991 | 2991 | |
2992 | 2992 | // Include file with class |
@@ -3073,7 +3073,7 @@ discard block |
||
3073 | 3073 | $xnbp = 0; |
3074 | 3074 | if (empty($option) || $option != 'nolines') { |
3075 | 3075 | // Lines |
3076 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
3076 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
3077 | 3077 | while ($xnbp < $nbp) { |
3078 | 3078 | $line = new SupplierInvoiceLine($this->db); |
3079 | 3079 | $line->desc = $langs->trans("Description")." ".$xnbp; |
@@ -3177,15 +3177,15 @@ discard block |
||
3177 | 3177 | // Load source object |
3178 | 3178 | $object->fetch($fromid); |
3179 | 3179 | $object->id = 0; |
3180 | - $object->statut = self::STATUS_DRAFT; // For backward compatibility |
|
3180 | + $object->statut = self::STATUS_DRAFT; // For backward compatibility |
|
3181 | 3181 | $object->status = self::STATUS_DRAFT; |
3182 | 3182 | |
3183 | 3183 | $object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor |
3184 | 3184 | |
3185 | 3185 | // Clear fields |
3186 | 3186 | $object->ref_supplier = (empty($this->ref_supplier) ? $langs->trans("CopyOf").' '.$object->ref_supplier : $this->ref_supplier); |
3187 | - $object->author = $user->id; // FIXME? user_validation_id is replacement for author |
|
3188 | - $object->user_validation_id = 0; // FIXME? user_validation_id is replacement for author |
|
3187 | + $object->author = $user->id; // FIXME? user_validation_id is replacement for author |
|
3188 | + $object->user_validation_id = 0; // FIXME? user_validation_id is replacement for author |
|
3189 | 3189 | $object->fk_facture_source = 0; |
3190 | 3190 | $object->date_creation = ''; |
3191 | 3191 | $object->date_validation = ''; |
@@ -3488,14 +3488,14 @@ discard block |
||
3488 | 3488 | if (!empty($paymentmode) && $paymentmode != 'all') { |
3489 | 3489 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
3490 | 3490 | } |
3491 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
3492 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
3491 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
3492 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
3493 | 3493 | if ($datetouse == 'invoicedate') { |
3494 | 3494 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
3495 | 3495 | } else { |
3496 | 3496 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
3497 | 3497 | } |
3498 | - $sql .= " AND f.entity IN (".getEntity('supplier_invoice', 0).")"; // One batch process only one company (no sharing) |
|
3498 | + $sql .= " AND f.entity IN (".getEntity('supplier_invoice', 0).")"; // One batch process only one company (no sharing) |
|
3499 | 3499 | if (!empty($paymentmode) && $paymentmode != 'all') { |
3500 | 3500 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
3501 | 3501 | } |
@@ -3715,7 +3715,7 @@ discard block |
||
3715 | 3715 | $actioncomm->create($user); |
3716 | 3716 | } |
3717 | 3717 | |
3718 | - $this->db->commit(); // We always commit |
|
3718 | + $this->db->commit(); // We always commit |
|
3719 | 3719 | } |
3720 | 3720 | |
3721 | 3721 | if ($errormesg) { |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | // Load color of the theme |
220 | - $color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; |
|
220 | + $color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; |
|
221 | 221 | if (is_readable($color_file)) { |
222 | 222 | include $color_file; |
223 | 223 | if (isset($theme_bordercolor)) { |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | foreach ($this->data as $x) { // Loop on each x |
733 | 733 | for ($i = 0; $i < $nbseries; $i++) { // Loop on each series |
734 | 734 | if (is_null($max)) { |
735 | - $max = $x[$i + 1]; // $i+1 because the index 0 is the legend |
|
735 | + $max = $x[$i + 1]; // $i+1 because the index 0 is the legend |
|
736 | 736 | } elseif ($max < $x[$i + 1]) { |
737 | 737 | $max = $x[$i + 1]; |
738 | 738 | } |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | foreach ($this->data as $x) { // Loop on each x |
763 | 763 | for ($i = 0; $i < $nbseries; $i++) { // Loop on each series |
764 | 764 | if (is_null($min)) { |
765 | - $min = $x[$i + 1]; // $i+1 because the index 0 is the legend |
|
765 | + $min = $x[$i + 1]; // $i+1 because the index 0 is the legend |
|
766 | 766 | } elseif ($min > $x[$i + 1]) { |
767 | 767 | $min = $x[$i + 1]; |
768 | 768 | } |
@@ -840,19 +840,19 @@ discard block |
||
840 | 840 | { |
841 | 841 | if (empty($file)) { |
842 | 842 | $this->error = "Call to draw method was made with empty value for parameter file."; |
843 | - dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR); |
|
843 | + dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR); |
|
844 | 844 | return -2; |
845 | 845 | } |
846 | 846 | if (!is_array($this->data)) { |
847 | 847 | $this->error = "Call to draw method was made but SetData was not called or called with an empty dataset for parameters"; |
848 | - dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR); |
|
848 | + dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR); |
|
849 | 849 | return -1; |
850 | 850 | } |
851 | 851 | if (count($this->data) < 1) { |
852 | 852 | $this->error = "Call to draw method was made but SetData was is an empty dataset"; |
853 | - dol_syslog(get_class($this) . "::draw " . $this->error, LOG_WARNING); |
|
853 | + dol_syslog(get_class($this)."::draw ".$this->error, LOG_WARNING); |
|
854 | 854 | } |
855 | - $call = "draw_" . $this->_library; // Example "draw_jflot" |
|
855 | + $call = "draw_".$this->_library; // Example "draw_jflot" |
|
856 | 856 | |
857 | 857 | return call_user_func_array(array($this, $call), array($file, $fileurl)); |
858 | 858 | } |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | // phpcs:enable |
880 | 880 | global $langs; |
881 | 881 | |
882 | - dol_syslog(get_class($this) . "::draw_jflot this->type=" . implode(',', $this->type) . " this->MaxValue=" . $this->MaxValue); |
|
882 | + dol_syslog(get_class($this)."::draw_jflot this->type=".implode(',', $this->type)." this->MaxValue=".$this->MaxValue); |
|
883 | 883 | |
884 | 884 | if (empty($this->width) && empty($this->height)) { |
885 | 885 | print 'Error width or height not set'; |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | $series = array(); |
903 | 903 | while ($i < $nblot) { // Loop on each series |
904 | 904 | $values = array(); // Array with horizontal y values (specific values of a series) for each abscisse x |
905 | - $series[$i] = "var d" . $i . " = [];\n"; |
|
905 | + $series[$i] = "var d".$i." = [];\n"; |
|
906 | 906 | |
907 | 907 | // Fill array $values |
908 | 908 | $x = 0; |
@@ -915,13 +915,13 @@ discard block |
||
915 | 915 | if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar'))) { |
916 | 916 | foreach ($values as $x => $y) { |
917 | 917 | if (isset($y)) { |
918 | - $series[$i] .= 'd' . $i . '.push({"label":"' . dol_escape_js($legends[$x]) . '", "data":' . $y . '});' . "\n"; |
|
918 | + $series[$i] .= 'd'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n"; |
|
919 | 919 | } |
920 | 920 | } |
921 | 921 | } else { |
922 | 922 | foreach ($values as $x => $y) { |
923 | 923 | if (isset($y)) { |
924 | - $series[$i] .= 'd' . $i . '.push([' . $x . ', ' . $y . ']);' . "\n"; |
|
924 | + $series[$i] .= 'd'.$i.'.push(['.$x.', '.$y.']);'."\n"; |
|
925 | 925 | } |
926 | 926 | } |
927 | 927 | } |
@@ -931,13 +931,13 @@ discard block |
||
931 | 931 | } |
932 | 932 | $tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.')))); |
933 | 933 | |
934 | - $this->stringtoshow = '<!-- Build using jflot -->' . "\n"; |
|
934 | + $this->stringtoshow = '<!-- Build using jflot -->'."\n"; |
|
935 | 935 | if (!empty($this->title)) { |
936 | - $this->stringtoshow .= '<div class="center dolgraphtitle' . (empty($this->cssprefix) ? '' : ' dolgraphtitle' . $this->cssprefix) . '">' . $this->title . '</div>'; |
|
936 | + $this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>'; |
|
937 | 937 | } |
938 | 938 | if (!empty($this->shownographyet)) { |
939 | - $this->stringtoshow .= '<div style="width:' . $this->width . 'px;height:' . $this->height . 'px;" class="nographyet"></div>'; |
|
940 | - $this->stringtoshow .= '<div class="nographyettext margintoponly">' . $langs->trans("NotEnoughDataYet") . '...</div>'; |
|
939 | + $this->stringtoshow .= '<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>'; |
|
940 | + $this->stringtoshow .= '<div class="nographyettext margintoponly">'.$langs->trans("NotEnoughDataYet").'...</div>'; |
|
941 | 941 | return; |
942 | 942 | } |
943 | 943 | |
@@ -946,17 +946,17 @@ discard block |
||
946 | 946 | if (count($this->data) > 20) { |
947 | 947 | $dolxaxisvertical = 'dol-xaxis-vertical'; |
948 | 948 | } |
949 | - $this->stringtoshow .= '<div id="placeholder_' . $tag . '" style="width:' . $this->width . 'px;height:' . $this->height . 'px;" class="dolgraph' . (empty($dolxaxisvertical) ? '' : ' ' . $dolxaxisvertical) . (empty($this->cssprefix) ? '' : ' dolgraph' . $this->cssprefix) . ' center"></div>' . "\n"; |
|
949 | + $this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center"></div>'."\n"; |
|
950 | 950 | |
951 | - $this->stringtoshow .= '<script nonce="'.getNonce().'" id="' . $tag . '">' . "\n"; |
|
952 | - $this->stringtoshow .= '$(function () {' . "\n"; |
|
951 | + $this->stringtoshow .= '<script nonce="'.getNonce().'" id="'.$tag.'">'."\n"; |
|
952 | + $this->stringtoshow .= '$(function () {'."\n"; |
|
953 | 953 | $i = $firstlot; |
954 | 954 | if ($nblot < 0) { |
955 | - $this->stringtoshow .= '<!-- No series of data -->' . "\n"; |
|
955 | + $this->stringtoshow .= '<!-- No series of data -->'."\n"; |
|
956 | 956 | } else { |
957 | 957 | while ($i < $nblot) { |
958 | - $this->stringtoshow .= '<!-- Series ' . $i . ' -->' . "\n"; |
|
959 | - $this->stringtoshow .= $series[$i] . "\n"; |
|
958 | + $this->stringtoshow .= '<!-- Series '.$i.' -->'."\n"; |
|
959 | + $this->stringtoshow .= $series[$i]."\n"; |
|
960 | 960 | $i++; |
961 | 961 | } |
962 | 962 | } |
@@ -967,9 +967,9 @@ discard block |
||
967 | 967 | $datacolor = array(); |
968 | 968 | foreach ($this->datacolor as $val) { |
969 | 969 | if (is_array($val)) { |
970 | - $datacolor[] = "#" . sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]); // If datacolor is array(R, G, B) |
|
970 | + $datacolor[] = "#".sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]); // If datacolor is array(R, G, B) |
|
971 | 971 | } else { |
972 | - $datacolor[] = "#" . str_replace(array('#', '-'), '', $val); // If $val is '124' or '#124' |
|
972 | + $datacolor[] = "#".str_replace(array('#', '-'), '', $val); // If $val is '124' or '#124' |
|
973 | 973 | } |
974 | 974 | } |
975 | 975 | |
@@ -979,8 +979,8 @@ discard block |
||
979 | 979 | $showpercent = $this->showpercent; |
980 | 980 | |
981 | 981 | $this->stringtoshow .= ' |
982 | - function plotWithOptions_' . $tag . '() { |
|
983 | - $.plot($("#placeholder_' . $tag . '"), d0, |
|
982 | + function plotWithOptions_' . $tag.'() { |
|
983 | + $.plot($("#placeholder_' . $tag.'"), d0, |
|
984 | 984 | { |
985 | 985 | series: { |
986 | 986 | pie: { |
@@ -988,8 +988,8 @@ discard block |
||
988 | 988 | radius: 0.8, |
989 | 989 | ' . ($this->combine ? ' |
990 | 990 | combine: { |
991 | - threshold: ' . $this->combine . ' |
|
992 | - },' : '') . ' |
|
991 | + threshold: ' . $this->combine.' |
|
992 | + },' : '').' |
|
993 | 993 | label: { |
994 | 994 | show: true, |
995 | 995 | radius: 0.9, |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | return \''; |
1000 | 1000 | $this->stringtoshow .= '<span style="font-size:8pt;text-align:center;padding:2px;color:black;">'; |
1001 | 1001 | if ($urltemp) { |
1002 | - $this->stringtoshow .= '<a style="color: #FFFFFF;" border="0" href="' . $urltemp . '">'; |
|
1002 | + $this->stringtoshow .= '<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">'; |
|
1003 | 1003 | } |
1004 | 1004 | $this->stringtoshow .= '\'+'; |
1005 | 1005 | $this->stringtoshow .= ($showlegend ? '' : 'label+\' \'+'); // Hide label if already shown in legend |
@@ -1025,9 +1025,9 @@ discard block |
||
1025 | 1025 | interactive: true |
1026 | 1026 | },'; |
1027 | 1027 | if (count($datacolor)) { |
1028 | - $this->stringtoshow .= 'colors: ' . json_encode($datacolor) . ','; |
|
1028 | + $this->stringtoshow .= 'colors: '.json_encode($datacolor).','; |
|
1029 | 1029 | } |
1030 | - $this->stringtoshow .= 'legend: {show: ' . ($showlegend ? 'true' : 'false') . ', position: \'ne\' } |
|
1030 | + $this->stringtoshow .= 'legend: {show: '.($showlegend ? 'true' : 'false').', position: \'ne\' } |
|
1031 | 1031 | }); |
1032 | 1032 | }' . "\n"; |
1033 | 1033 | } else { |
@@ -1035,8 +1035,8 @@ discard block |
||
1035 | 1035 | // Add code to support tooltips |
1036 | 1036 | // TODO: remove js css and use graph-tooltip-inner class instead by adding css in each themes |
1037 | 1037 | $this->stringtoshow .= ' |
1038 | - function showTooltip_' . $tag . '(x, y, contents) { |
|
1039 | - $(\'<div class="graph-tooltip-inner" id="tooltip_' . $tag . '">\' + contents + \'</div>\').css({ |
|
1038 | + function showTooltip_' . $tag.'(x, y, contents) { |
|
1039 | + $(\'<div class="graph-tooltip-inner" id="tooltip_' . $tag.'">\' + contents + \'</div>\').css({ |
|
1040 | 1040 | position: \'absolute\', |
1041 | 1041 | display: \'none\', |
1042 | 1042 | top: y + 10, |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | var previousPoint = null; |
1055 | - $("#placeholder_' . $tag . '").bind("plothover", function (event, pos, item) { |
|
1055 | + $("#placeholder_' . $tag.'").bind("plothover", function (event, pos, item) { |
|
1056 | 1056 | $("#x").text(pos.x.toFixed(2)); |
1057 | 1057 | $("#y").text(pos.y.toFixed(2)); |
1058 | 1058 | |
@@ -1068,27 +1068,27 @@ discard block |
||
1068 | 1068 | '; |
1069 | 1069 | if ($this->showpointvalue > 0) { |
1070 | 1070 | $this->stringtoshow .= ' |
1071 | - showTooltip_' . $tag . '(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y); |
|
1071 | + showTooltip_' . $tag.'(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y); |
|
1072 | 1072 | '; |
1073 | 1073 | } |
1074 | 1074 | $this->stringtoshow .= ' |
1075 | 1075 | } |
1076 | 1076 | } |
1077 | 1077 | else { |
1078 | - $("#tooltip_' . $tag . '").remove(); |
|
1078 | + $("#tooltip_' . $tag.'").remove(); |
|
1079 | 1079 | previousPoint = null; |
1080 | 1080 | } |
1081 | 1081 | }); |
1082 | 1082 | '; |
1083 | 1083 | |
1084 | - $this->stringtoshow .= 'var stack = null, steps = false;' . "\n"; |
|
1084 | + $this->stringtoshow .= 'var stack = null, steps = false;'."\n"; |
|
1085 | 1085 | |
1086 | - $this->stringtoshow .= 'function plotWithOptions_' . $tag . '() {' . "\n"; |
|
1087 | - $this->stringtoshow .= '$.plot($("#placeholder_' . $tag . '"), [ ' . "\n"; |
|
1086 | + $this->stringtoshow .= 'function plotWithOptions_'.$tag.'() {'."\n"; |
|
1087 | + $this->stringtoshow .= '$.plot($("#placeholder_'.$tag.'"), [ '."\n"; |
|
1088 | 1088 | $i = $firstlot; |
1089 | 1089 | while ($i < $nblot) { |
1090 | 1090 | if ($i > $firstlot) { |
1091 | - $this->stringtoshow .= ', ' . "\n"; |
|
1091 | + $this->stringtoshow .= ', '."\n"; |
|
1092 | 1092 | } |
1093 | 1093 | $color = sprintf("%02x%02x%02x", $this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]); |
1094 | 1094 | $this->stringtoshow .= '{ '; |
@@ -1101,46 +1101,46 @@ discard block |
||
1101 | 1101 | } else { |
1102 | 1102 | $align = 'left'; |
1103 | 1103 | } |
1104 | - $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "' . $align . '", barWidth: 0.45 }, '; |
|
1104 | + $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.$align.'", barWidth: 0.45 }, '; |
|
1105 | 1105 | } else { |
1106 | - $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "' . ($i == $firstlot ? 'center' : 'left') . '", barWidth: 0.5 }, '; |
|
1106 | + $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.($i == $firstlot ? 'center' : 'left').'", barWidth: 0.5 }, '; |
|
1107 | 1107 | } |
1108 | 1108 | } |
1109 | 1109 | if (isset($this->type[$i]) && ($this->type[$i] == 'lines' || $this->type[$i] == 'linesnopoint')) { |
1110 | - $this->stringtoshow .= 'lines: { show: true, fill: false }, points: { show: ' . ($this->type[$i] == 'linesnopoint' ? 'false' : 'true') . ' }, '; |
|
1110 | + $this->stringtoshow .= 'lines: { show: true, fill: false }, points: { show: '.($this->type[$i] == 'linesnopoint' ? 'false' : 'true').' }, '; |
|
1111 | 1111 | } |
1112 | - $this->stringtoshow .= 'color: "#' . $color . '", label: "' . (isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '') . '", data: d' . $i . ' }'; |
|
1112 | + $this->stringtoshow .= 'color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }'; |
|
1113 | 1113 | $i++; |
1114 | 1114 | } |
1115 | 1115 | // shadowSize: 0 -> Drawing is faster without shadows |
1116 | - $this->stringtoshow .= "\n" . ' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6, fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }' . "\n"; |
|
1116 | + $this->stringtoshow .= "\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6, fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }'."\n"; |
|
1117 | 1117 | |
1118 | 1118 | // Xaxis |
1119 | - $this->stringtoshow .= ', xaxis: { ticks: [' . "\n"; |
|
1119 | + $this->stringtoshow .= ', xaxis: { ticks: ['."\n"; |
|
1120 | 1120 | $x = 0; |
1121 | 1121 | foreach ($this->data as $key => $valarray) { |
1122 | 1122 | if ($x > 0) { |
1123 | - $this->stringtoshow .= ', ' . "\n"; |
|
1123 | + $this->stringtoshow .= ', '."\n"; |
|
1124 | 1124 | } |
1125 | - $this->stringtoshow .= ' [' . $x . ', "' . $valarray[0] . '"]'; |
|
1125 | + $this->stringtoshow .= ' ['.$x.', "'.$valarray[0].'"]'; |
|
1126 | 1126 | $x++; |
1127 | 1127 | } |
1128 | - $this->stringtoshow .= '] }' . "\n"; |
|
1128 | + $this->stringtoshow .= '] }'."\n"; |
|
1129 | 1129 | |
1130 | 1130 | // Yaxis |
1131 | - $this->stringtoshow .= ', yaxis: { min: ' . $this->MinValue . ', max: ' . ($this->MaxValue) . ' }' . "\n"; |
|
1131 | + $this->stringtoshow .= ', yaxis: { min: '.$this->MinValue.', max: '.($this->MaxValue).' }'."\n"; |
|
1132 | 1132 | |
1133 | 1133 | // Background color |
1134 | 1134 | $color1 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[0], $this->bgcolorgrid[2]); |
1135 | 1135 | $color2 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[1], $this->bgcolorgrid[2]); |
1136 | - $this->stringtoshow .= ', grid: { hoverable: true, backgroundColor: { colors: ["#' . $color1 . '", "#' . $color2 . '"] }, borderWidth: 1, borderColor: \'#e6e6e6\', tickColor : \'#e6e6e6\' }' . "\n"; |
|
1137 | - $this->stringtoshow .= '});' . "\n"; |
|
1138 | - $this->stringtoshow .= '}' . "\n"; |
|
1136 | + $this->stringtoshow .= ', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#e6e6e6\', tickColor : \'#e6e6e6\' }'."\n"; |
|
1137 | + $this->stringtoshow .= '});'."\n"; |
|
1138 | + $this->stringtoshow .= '}'."\n"; |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | - $this->stringtoshow .= 'plotWithOptions_' . $tag . '();' . "\n"; |
|
1142 | - $this->stringtoshow .= '});' . "\n"; |
|
1143 | - $this->stringtoshow .= '</script>' . "\n"; |
|
1141 | + $this->stringtoshow .= 'plotWithOptions_'.$tag.'();'."\n"; |
|
1142 | + $this->stringtoshow .= '});'."\n"; |
|
1143 | + $this->stringtoshow .= '</script>'."\n"; |
|
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | // phpcs:enable |
1167 | 1167 | global $langs; |
1168 | 1168 | |
1169 | - dol_syslog(get_class($this) . "::draw_chart this->type=" . implode(',', $this->type) . " this->MaxValue=" . $this->MaxValue); |
|
1169 | + dol_syslog(get_class($this)."::draw_chart this->type=".implode(',', $this->type)." this->MaxValue=".$this->MaxValue); |
|
1170 | 1170 | |
1171 | 1171 | if (empty($this->width) && empty($this->height)) { |
1172 | 1172 | print 'Error width or height not set'; |
@@ -1209,15 +1209,15 @@ discard block |
||
1209 | 1209 | $alabelexists = 1; |
1210 | 1210 | $tmpykey = explode('_', (string) ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3); |
1211 | 1211 | if (isset($tmpykey[2]) && (!empty($tmpykey[2]) || $tmpykey[2] == '0')) { // This is a 'Group by' array |
1212 | - $tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]); |
|
1212 | + $tmpvalue = (array_key_exists('y_'.$tmpykey[1].'_'.$tmpykey[2], $valarray) ? $valarray['y_'.$tmpykey[1].'_'.$tmpykey[2]] : $valarray[$i + 1]); |
|
1213 | 1213 | $values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null); |
1214 | 1214 | $arrayofgroupslegend[$i] = array( |
1215 | 1215 | 'stacknum' => (int) $tmpykey[1], |
1216 | 1216 | 'legend' => $this->Legend[$tmpykey[1]] ?? '', |
1217 | - 'legendwithgroup' => ($this->Legend[$tmpykey[1]] ?? '') . ' - ' . $tmpykey[2] |
|
1217 | + 'legendwithgroup' => ($this->Legend[$tmpykey[1]] ?? '').' - '.$tmpykey[2] |
|
1218 | 1218 | ); |
1219 | 1219 | } else { |
1220 | - $tmpvalue = (array_key_exists('y_' . $i, $valarray) ? $valarray['y_' . $i] : $valarray[$i + 1]); |
|
1220 | + $tmpvalue = (array_key_exists('y_'.$i, $valarray) ? $valarray['y_'.$i] : $valarray[$i + 1]); |
|
1221 | 1221 | //var_dump($i.'_'.$x.'_'.$tmpvalue); |
1222 | 1222 | $values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null); |
1223 | 1223 | } |
@@ -1227,9 +1227,9 @@ discard block |
||
1227 | 1227 | $j = 0; |
1228 | 1228 | foreach ($values as $x => $y) { |
1229 | 1229 | if (isset($y)) { |
1230 | - $series[$i] .= ($j > 0 ? ", " : "") . $y; |
|
1230 | + $series[$i] .= ($j > 0 ? ", " : "").$y; |
|
1231 | 1231 | } else { |
1232 | - $series[$i] .= ($j > 0 ? ", " : "") . 'null'; |
|
1232 | + $series[$i] .= ($j > 0 ? ", " : "").'null'; |
|
1233 | 1233 | } |
1234 | 1234 | $j++; |
1235 | 1235 | } |
@@ -1242,13 +1242,13 @@ discard block |
||
1242 | 1242 | |
1243 | 1243 | $tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.')))); |
1244 | 1244 | |
1245 | - $this->stringtoshow = '<!-- Build using chart -->' . "\n"; |
|
1245 | + $this->stringtoshow = '<!-- Build using chart -->'."\n"; |
|
1246 | 1246 | if (!empty($this->title)) { |
1247 | - $this->stringtoshow .= '<div class="center dolgraphtitle' . (empty($this->cssprefix) ? '' : ' dolgraphtitle' . $this->cssprefix) . '">' . $this->title . '</div>'; |
|
1247 | + $this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>'; |
|
1248 | 1248 | } |
1249 | 1249 | if (!empty($this->shownographyet)) { |
1250 | - $this->stringtoshow .= '<div style="width:' . $this->width . (strpos($this->width, '%') > 0 ? '' : 'px') . '; height:' . $this->height . 'px;" class="nographyet"></div>'; |
|
1251 | - $this->stringtoshow .= '<div class="nographyettext margintoponly">' . $langs->trans("NotEnoughDataYet") . '...</div>'; |
|
1250 | + $this->stringtoshow .= '<div style="width:'.$this->width.(strpos($this->width, '%') > 0 ? '' : 'px').'; height:'.$this->height.'px;" class="nographyet"></div>'; |
|
1251 | + $this->stringtoshow .= '<div class="nographyettext margintoponly">'.$langs->trans("NotEnoughDataYet").'...</div>'; |
|
1252 | 1252 | return; |
1253 | 1253 | } |
1254 | 1254 | |
@@ -1260,12 +1260,12 @@ discard block |
||
1260 | 1260 | // No height for the pie graph |
1261 | 1261 | $cssfordiv = 'dolgraphchart'; |
1262 | 1262 | if (isset($this->type[$firstlot])) { |
1263 | - $cssfordiv .= ' dolgraphchar' . $this->type[$firstlot]; |
|
1263 | + $cssfordiv .= ' dolgraphchar'.$this->type[$firstlot]; |
|
1264 | 1264 | } |
1265 | - $this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="min-height: '.$this->height.(strpos((string) $this->height, '%') > 0 ? '' : 'px').'; max-height: '.(strpos((string) $this->height, '%') > 0 ? $this->height : ((int) $this->height + 100) . 'px').'; width:'.$this->width.(strpos((string) $this->width, '%') > 0 ? '' : 'px').';" class="'.$cssfordiv.' dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center">'."\n"; |
|
1265 | + $this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="min-height: '.$this->height.(strpos((string) $this->height, '%') > 0 ? '' : 'px').'; max-height: '.(strpos((string) $this->height, '%') > 0 ? $this->height : ((int) $this->height + 100).'px').'; width:'.$this->width.(strpos((string) $this->width, '%') > 0 ? '' : 'px').';" class="'.$cssfordiv.' dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center">'."\n"; |
|
1266 | 1266 | $this->stringtoshow .= '<canvas id="canvas_'.$tag.'"></canvas></div>'."\n"; |
1267 | 1267 | |
1268 | - $this->stringtoshow .= '<script nonce="'.getNonce().'" id="' . $tag . '">' . "\n"; |
|
1268 | + $this->stringtoshow .= '<script nonce="'.getNonce().'" id="'.$tag.'">'."\n"; |
|
1269 | 1269 | $i = $firstlot; |
1270 | 1270 | if ($nblot < 0) { |
1271 | 1271 | $this->stringtoshow .= '<!-- No series of data -->'; |
@@ -1291,11 +1291,11 @@ discard block |
||
1291 | 1291 | if (empty($showlegend)) { |
1292 | 1292 | $this->stringtoshow .= 'legend: { display: false }, '; |
1293 | 1293 | } else { |
1294 | - $this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \'' . ($showlegend == 2 ? 'right' : 'top') . '\''; |
|
1294 | + $this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \''.($showlegend == 2 ? 'right' : 'top').'\''; |
|
1295 | 1295 | if (!empty($legendMaxLines)) { |
1296 | - $this->stringtoshow .= ', maxLines: ' . $legendMaxLines; |
|
1296 | + $this->stringtoshow .= ', maxLines: '.$legendMaxLines; |
|
1297 | 1297 | } |
1298 | - $this->stringtoshow .= ' }, ' . "\n"; |
|
1298 | + $this->stringtoshow .= ' }, '."\n"; |
|
1299 | 1299 | } |
1300 | 1300 | |
1301 | 1301 | /* For Chartjs v3.5 */ |
@@ -1303,50 +1303,50 @@ discard block |
||
1303 | 1303 | if (empty($showlegend)) { |
1304 | 1304 | $this->stringtoshow .= 'legend: { display: false }, '; |
1305 | 1305 | } else { |
1306 | - $this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \'' . ($showlegend == 2 ? 'right' : 'top') . '\''; |
|
1306 | + $this->stringtoshow .= 'legend: { labels: { boxWidth: 15 }, position: \''.($showlegend == 2 ? 'right' : 'top').'\''; |
|
1307 | 1307 | if (!empty($legendMaxLines)) { |
1308 | - $this->stringtoshow .= ', maxLines: ' . $legendMaxLines; |
|
1308 | + $this->stringtoshow .= ', maxLines: '.$legendMaxLines; |
|
1309 | 1309 | } |
1310 | - $this->stringtoshow .= ' }, ' . "\n"; |
|
1310 | + $this->stringtoshow .= ' }, '."\n"; |
|
1311 | 1311 | } |
1312 | - $this->stringtoshow .= ' }, ' . "\n"; |
|
1312 | + $this->stringtoshow .= ' }, '."\n"; |
|
1313 | 1313 | |
1314 | 1314 | |
1315 | 1315 | if ($this->type[$firstlot] == 'piesemicircle') { |
1316 | - $this->stringtoshow .= 'circumference: Math.PI,' . "\n"; |
|
1317 | - $this->stringtoshow .= 'rotation: -Math.PI,' . "\n"; |
|
1316 | + $this->stringtoshow .= 'circumference: Math.PI,'."\n"; |
|
1317 | + $this->stringtoshow .= 'rotation: -Math.PI,'."\n"; |
|
1318 | 1318 | } |
1319 | - $this->stringtoshow .= 'elements: { arc: {' . "\n"; |
|
1319 | + $this->stringtoshow .= 'elements: { arc: {'."\n"; |
|
1320 | 1320 | // Color of each arc |
1321 | 1321 | $this->stringtoshow .= 'backgroundColor: ['; |
1322 | 1322 | $i = 0; |
1323 | 1323 | $foundnegativecolor = 0; |
1324 | 1324 | foreach ($legends as $val) { // Loop on each series |
1325 | 1325 | if ($i > 0) { |
1326 | - $this->stringtoshow .= ', ' . "\n"; |
|
1326 | + $this->stringtoshow .= ', '."\n"; |
|
1327 | 1327 | } |
1328 | 1328 | if (is_array($this->datacolor[$i])) { |
1329 | - $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')'; // If datacolor is array(R, G, B) |
|
1329 | + $color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')'; // If datacolor is array(R, G, B) |
|
1330 | 1330 | } else { |
1331 | 1331 | $tmp = str_replace('#', '', $this->datacolor[$i]); |
1332 | 1332 | if (strpos($tmp, '-') !== false) { |
1333 | 1333 | $foundnegativecolor++; |
1334 | 1334 | $color = 'rgba(0,0,0,.0)'; // If $val is '-123' |
1335 | 1335 | } else { |
1336 | - $color = "#" . $tmp; // If $val is '123' or '#123' |
|
1336 | + $color = "#".$tmp; // If $val is '123' or '#123' |
|
1337 | 1337 | } |
1338 | 1338 | } |
1339 | - $this->stringtoshow .= "'" . $color . "'"; |
|
1339 | + $this->stringtoshow .= "'".$color."'"; |
|
1340 | 1340 | $i++; |
1341 | 1341 | } |
1342 | - $this->stringtoshow .= '], ' . "\n"; |
|
1342 | + $this->stringtoshow .= '], '."\n"; |
|
1343 | 1343 | // Border color |
1344 | 1344 | if ($foundnegativecolor) { |
1345 | 1345 | $this->stringtoshow .= 'borderColor: ['; |
1346 | 1346 | $i = 0; |
1347 | 1347 | foreach ($legends as $val) { // Loop on each series |
1348 | 1348 | if ($i > 0) { |
1349 | - $this->stringtoshow .= ', ' . "\n"; |
|
1349 | + $this->stringtoshow .= ', '."\n"; |
|
1350 | 1350 | } |
1351 | 1351 | if ($this->datacolor !== null) { |
1352 | 1352 | $datacolor_item = $this->datacolor[$i]; |
@@ -1359,23 +1359,23 @@ discard block |
||
1359 | 1359 | } else { |
1360 | 1360 | $tmpcolor = str_replace('#', '', $datacolor_item); |
1361 | 1361 | if (strpos($tmpcolor, '-') !== false) { |
1362 | - $color = '#' . str_replace('-', '', $tmpcolor); // If $val is '-123' |
|
1362 | + $color = '#'.str_replace('-', '', $tmpcolor); // If $val is '-123' |
|
1363 | 1363 | } else { |
1364 | 1364 | $color = 'null'; // If $val is '123' or '#123' |
1365 | 1365 | } |
1366 | 1366 | } |
1367 | - $this->stringtoshow .= ($color == 'null' ? "'rgba(0,0,0,0.2)'" : "'" . $color . "'"); |
|
1367 | + $this->stringtoshow .= ($color == 'null' ? "'rgba(0,0,0,0.2)'" : "'".$color."'"); |
|
1368 | 1368 | $i++; |
1369 | 1369 | } |
1370 | 1370 | $this->stringtoshow .= ']'; |
1371 | 1371 | } |
1372 | - $this->stringtoshow .= '} } };' . "\n"; |
|
1372 | + $this->stringtoshow .= '} } };'."\n"; |
|
1373 | 1373 | |
1374 | 1374 | $this->stringtoshow .= ' |
1375 | - var ctx = document.getElementById("canvas_' . $tag . '").getContext("2d"); |
|
1375 | + var ctx = document.getElementById("canvas_' . $tag.'").getContext("2d"); |
|
1376 | 1376 | var chart = new Chart(ctx, { |
1377 | 1377 | // The type of chart we want to create |
1378 | - type: \'' . (in_array($type, array('pie', 'piesemicircle')) ? 'doughnut' : 'polarArea') . '\', |
|
1378 | + type: \'' . (in_array($type, array('pie', 'piesemicircle')) ? 'doughnut' : 'polarArea').'\', |
|
1379 | 1379 | // Configuration options go here |
1380 | 1380 | options: options, |
1381 | 1381 | data: { |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | if ($i > 0) { |
1387 | 1387 | $this->stringtoshow .= ', '; |
1388 | 1388 | } |
1389 | - $this->stringtoshow .= "'" . dol_escape_js(dol_trunc($val, 25)) . "'"; // Lower than 25 make some important label (that we can't shorten) to be truncated |
|
1389 | + $this->stringtoshow .= "'".dol_escape_js(dol_trunc($val, 25))."'"; // Lower than 25 make some important label (that we can't shorten) to be truncated |
|
1390 | 1390 | $i++; |
1391 | 1391 | } |
1392 | 1392 | |
@@ -1394,21 +1394,21 @@ discard block |
||
1394 | 1394 | datasets: ['; |
1395 | 1395 | $i = 0; |
1396 | 1396 | while ($i < $nblot) { // Loop on each series |
1397 | - $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')'; |
|
1397 | + $color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')'; |
|
1398 | 1398 | |
1399 | 1399 | if ($i > 0) { |
1400 | - $this->stringtoshow .= ', ' . "\n"; |
|
1400 | + $this->stringtoshow .= ', '."\n"; |
|
1401 | 1401 | } |
1402 | - $this->stringtoshow .= '{' . "\n"; |
|
1402 | + $this->stringtoshow .= '{'."\n"; |
|
1403 | 1403 | //$this->stringtoshow .= 'borderColor: \''.$color.'\', '; |
1404 | 1404 | //$this->stringtoshow .= 'backgroundColor: \''.$color.'\', '; |
1405 | - $this->stringtoshow .= ' data: [' . $series[$i] . ']'; |
|
1406 | - $this->stringtoshow .= '}' . "\n"; |
|
1405 | + $this->stringtoshow .= ' data: ['.$series[$i].']'; |
|
1406 | + $this->stringtoshow .= '}'."\n"; |
|
1407 | 1407 | $i++; |
1408 | 1408 | } |
1409 | - $this->stringtoshow .= ']' . "\n"; |
|
1410 | - $this->stringtoshow .= '}' . "\n"; |
|
1411 | - $this->stringtoshow .= '});' . "\n"; |
|
1409 | + $this->stringtoshow .= ']'."\n"; |
|
1410 | + $this->stringtoshow .= '}'."\n"; |
|
1411 | + $this->stringtoshow .= '});'."\n"; |
|
1412 | 1412 | } else { |
1413 | 1413 | // Other cases, graph of type 'bars', 'lines', 'linesnopoint' |
1414 | 1414 | $type = 'bar'; |
@@ -1442,7 +1442,7 @@ discard block |
||
1442 | 1442 | if (empty($showlegend)) { |
1443 | 1443 | $this->stringtoshow .= 'legend: { display: false }, '."\n"; |
1444 | 1444 | } else { |
1445 | - $this->stringtoshow .= 'legend: { maxWidth: '.round(intval($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n"; |
|
1445 | + $this->stringtoshow .= 'legend: { maxWidth: '.round(intval($this->width) / 2).', labels: { boxWidth: 15 }, position: \''.(($showlegend && $showlegend == 2) ? 'right' : 'top').'\' },'."\n"; |
|
1446 | 1446 | } |
1447 | 1447 | if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) { |
1448 | 1448 | $this->stringtoshow .= 'tooltip: { mode: \'nearest\', |
@@ -1504,10 +1504,10 @@ discard block |
||
1504 | 1504 | } |
1505 | 1505 | $this->stringtoshow .= '};'; |
1506 | 1506 | $this->stringtoshow .= ' |
1507 | - var ctx = document.getElementById("canvas_' . $tag . '").getContext("2d"); |
|
1507 | + var ctx = document.getElementById("canvas_' . $tag.'").getContext("2d"); |
|
1508 | 1508 | var chart = new Chart(ctx, { |
1509 | 1509 | // The type of chart we want to create |
1510 | - type: \'' . $type . '\', |
|
1510 | + type: \'' . $type.'\', |
|
1511 | 1511 | // Configuration options go here |
1512 | 1512 | options: options, |
1513 | 1513 | data: { |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | if ($i > 0) { |
1519 | 1519 | $this->stringtoshow .= ', '; |
1520 | 1520 | } |
1521 | - $this->stringtoshow .= "'" . dol_escape_js(dol_trunc($val, 32)) . "'"; |
|
1521 | + $this->stringtoshow .= "'".dol_escape_js(dol_trunc($val, 32))."'"; |
|
1522 | 1522 | $i++; |
1523 | 1523 | } |
1524 | 1524 | |
@@ -1576,19 +1576,19 @@ discard block |
||
1576 | 1576 | } |
1577 | 1577 | $oldstacknum = $arrayofgroupslegend[$i]['stacknum']; |
1578 | 1578 | |
1579 | - $color = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ', 0.9)'; |
|
1580 | - $bordercolor = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ')'; |
|
1579 | + $color = 'rgb('.$newcolor[0].', '.$newcolor[1].', '.$newcolor[2].', 0.9)'; |
|
1580 | + $bordercolor = 'rgb('.$newcolor[0].', '.$newcolor[1].', '.$newcolor[2].')'; |
|
1581 | 1581 | } else { // We do not use a 'group by' |
1582 | 1582 | if (!empty($this->datacolor[$i])) { |
1583 | 1583 | if (is_array($this->datacolor[$i])) { |
1584 | - $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ', 0.9)'; |
|
1584 | + $color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].', 0.9)'; |
|
1585 | 1585 | } else { |
1586 | 1586 | $color = $this->datacolor[$i]; |
1587 | 1587 | } |
1588 | 1588 | } |
1589 | 1589 | // else: $color will be undefined |
1590 | 1590 | if (!empty($this->bordercolor[$i]) && is_array($this->bordercolor[$i])) { |
1591 | - $bordercolor = 'rgb(' . $this->bordercolor[$i][0] . ', ' . $this->bordercolor[$i][1] . ', ' . $this->bordercolor[$i][2] . ', 0.9)'; |
|
1591 | + $bordercolor = 'rgb('.$this->bordercolor[$i][0].', '.$this->bordercolor[$i][1].', '.$this->bordercolor[$i][2].', 0.9)'; |
|
1592 | 1592 | } else { |
1593 | 1593 | if ($type != 'horizontalBar') { |
1594 | 1594 | $bordercolor = $color; |
@@ -1610,34 +1610,34 @@ discard block |
||
1610 | 1610 | } |
1611 | 1611 | $this->stringtoshow .= "\n"; |
1612 | 1612 | $this->stringtoshow .= '{'; |
1613 | - $this->stringtoshow .= 'dolibarrinfo: \'y_' . $i . '\', '; |
|
1614 | - $this->stringtoshow .= 'label: \'' . dol_escape_js(dol_string_nohtmltag($textoflegend)) . '\', '; |
|
1615 | - $this->stringtoshow .= 'pointStyle: \'' . ((!empty($this->type[$i]) && $this->type[$i] == 'linesnopoint') ? 'line' : 'circle') . '\', '; |
|
1616 | - $this->stringtoshow .= 'fill: ' . ($type == 'bar' ? 'true' : 'false') . ', '; |
|
1613 | + $this->stringtoshow .= 'dolibarrinfo: \'y_'.$i.'\', '; |
|
1614 | + $this->stringtoshow .= 'label: \''.dol_escape_js(dol_string_nohtmltag($textoflegend)).'\', '; |
|
1615 | + $this->stringtoshow .= 'pointStyle: \''.((!empty($this->type[$i]) && $this->type[$i] == 'linesnopoint') ? 'line' : 'circle').'\', '; |
|
1616 | + $this->stringtoshow .= 'fill: '.($type == 'bar' ? 'true' : 'false').', '; |
|
1617 | 1617 | if ($type == 'bar' || $type == 'horizontalBar') { |
1618 | 1618 | $this->stringtoshow .= 'borderWidth: \''.$this->borderwidth.'\', '; |
1619 | 1619 | } |
1620 | - $this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', '; |
|
1621 | - $this->stringtoshow .= 'borderSkipped: \'' . $this->borderskip . '\', '; |
|
1622 | - $this->stringtoshow .= 'backgroundColor: \'' . $color . '\', '; |
|
1620 | + $this->stringtoshow .= 'borderColor: \''.$bordercolor.'\', '; |
|
1621 | + $this->stringtoshow .= 'borderSkipped: \''.$this->borderskip.'\', '; |
|
1622 | + $this->stringtoshow .= 'backgroundColor: \''.$color.'\', '; |
|
1623 | 1623 | if (!empty($arrayofgroupslegend) && !empty($arrayofgroupslegend[$i])) { |
1624 | - $this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', '; |
|
1624 | + $this->stringtoshow .= 'stack: \''.$arrayofgroupslegend[$i]['stacknum'].'\', '; |
|
1625 | 1625 | } |
1626 | 1626 | $this->stringtoshow .= 'data: ['; |
1627 | 1627 | |
1628 | - $this->stringtoshow .= $this->mirrorGraphValues ? '[-' . $series[$i] . ',' . $series[$i] . ']' : $series[$i]; |
|
1628 | + $this->stringtoshow .= $this->mirrorGraphValues ? '[-'.$series[$i].','.$series[$i].']' : $series[$i]; |
|
1629 | 1629 | $this->stringtoshow .= ']'; |
1630 | - $this->stringtoshow .= '}' . "\n"; |
|
1630 | + $this->stringtoshow .= '}'."\n"; |
|
1631 | 1631 | |
1632 | 1632 | $i++; |
1633 | 1633 | $iinstack++; |
1634 | 1634 | } |
1635 | - $this->stringtoshow .= ']' . "\n"; |
|
1636 | - $this->stringtoshow .= '}' . "\n"; |
|
1637 | - $this->stringtoshow .= '});' . "\n"; |
|
1635 | + $this->stringtoshow .= ']'."\n"; |
|
1636 | + $this->stringtoshow .= '}'."\n"; |
|
1637 | + $this->stringtoshow .= '});'."\n"; |
|
1638 | 1638 | } |
1639 | 1639 | |
1640 | - $this->stringtoshow .= '</script>' . "\n"; |
|
1640 | + $this->stringtoshow .= '</script>'."\n"; |
|
1641 | 1641 | } |
1642 | 1642 | |
1643 | 1643 | |
@@ -1666,12 +1666,12 @@ discard block |
||
1666 | 1666 | global $langs; |
1667 | 1667 | |
1668 | 1668 | if ($shownographyet) { |
1669 | - $s = '<div class="nographyet" style="width:' . (preg_match('/%/', $this->width) ? $this->width : $this->width . 'px') . '; height:' . (preg_match('/%/', $this->height) ? $this->height : $this->height . 'px') . ';"></div>'; |
|
1669 | + $s = '<div class="nographyet" style="width:'.(preg_match('/%/', $this->width) ? $this->width : $this->width.'px').'; height:'.(preg_match('/%/', $this->height) ? $this->height : $this->height.'px').';"></div>'; |
|
1670 | 1670 | $s .= '<div class="nographyettext margintoponly">'; |
1671 | 1671 | if (is_numeric($shownographyet)) { |
1672 | - $s .= $langs->trans("NotEnoughDataYet") . '...'; |
|
1672 | + $s .= $langs->trans("NotEnoughDataYet").'...'; |
|
1673 | 1673 | } else { |
1674 | - $s .= $shownographyet . '...'; |
|
1674 | + $s .= $shownographyet.'...'; |
|
1675 | 1675 | } |
1676 | 1676 | $s .= '</div>'; |
1677 | 1677 | return $s; |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | $out .= $this->htmlBeforeOutputForm; |
164 | 164 | |
165 | 165 | if ($editMode) { |
166 | - $out .= '<form ' . self::generateAttributesStringFromArray($this->formAttributes) . ' >'; |
|
166 | + $out .= '<form '.self::generateAttributesStringFromArray($this->formAttributes).' >'; |
|
167 | 167 | |
168 | 168 | // generate hidden values from $this->formHiddenInputs |
169 | 169 | if (!empty($this->formHiddenInputs) && is_array($this->formHiddenInputs)) { |
170 | 170 | foreach ($this->formHiddenInputs as $hiddenKey => $hiddenValue) { |
171 | - $out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="' . dol_escape_htmltag($hiddenValue) . '">'; |
|
171 | + $out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="'.dol_escape_htmltag($hiddenValue).'">'; |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } elseif ($editMode) { |
188 | 188 | $out .= '<div class="form-setup-button-container center">'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes |
189 | 189 | $out .= $this->htmlOutputMoreButton; |
190 | - $out .= '<input class="button button-save" type="submit" value="' . $this->langs->trans("Save") . '">'; // Todo fix dolibarr style for <button and use <button instead of input |
|
190 | + $out .= '<input class="button button-save" type="submit" value="'.$this->langs->trans("Save").'">'; // Todo fix dolibarr style for <button and use <button instead of input |
|
191 | 191 | /*$out .= ' '; |
192 | 192 | $out .= '<a class="button button-cancel" type="submit" href="' . $this->formAttributes['action'] . '">'.$this->langs->trans('Cancel').'</a>'; |
193 | 193 | */ |
@@ -231,8 +231,8 @@ discard block |
||
231 | 231 | if (empty($hideTitle)) { |
232 | 232 | $out .= '<thead>'; |
233 | 233 | $out .= '<tr class="liste_titre">'; |
234 | - $out .= ' <td>' . $this->langs->trans("Parameter") . '</td>'; |
|
235 | - $out .= ' <td>' . $this->langs->trans("Value") . '</td>'; |
|
234 | + $out .= ' <td>'.$this->langs->trans("Parameter").'</td>'; |
|
235 | + $out .= ' <td>'.$this->langs->trans("Value").'</td>'; |
|
236 | 236 | $out .= '</tr>'; |
237 | 237 | $out .= '</thead>'; |
238 | 238 | } |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | if (!empty($this->helpText)) { |
838 | 838 | return $this->helpText; |
839 | 839 | } |
840 | - return (($this->langs->trans($this->confKey . 'Tooltip') != $this->confKey . 'Tooltip') ? $this->langs->trans($this->confKey . 'Tooltip') : ''); |
|
840 | + return (($this->langs->trans($this->confKey.'Tooltip') != $this->confKey.'Tooltip') ? $this->langs->trans($this->confKey.'Tooltip') : ''); |
|
841 | 841 | } |
842 | 842 | |
843 | 843 | /** |
@@ -854,7 +854,7 @@ discard block |
||
854 | 854 | |
855 | 855 | // if conf defined on entity 0, prepend a picto to indicate it will apply across all entities |
856 | 856 | if (isModEnabled('multicompany') && $this->entity == 0) { |
857 | - $out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh') . ' ' . $out; |
|
857 | + $out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh').' '.$out; |
|
858 | 858 | } |
859 | 859 | |
860 | 860 | return $out; |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | } elseif ($this->type == 'html') { |
903 | 903 | $out .= $this->generateInputFieldHtml(); |
904 | 904 | } elseif ($this->type == 'color') { |
905 | - $out .= $this->generateInputFieldColor(); |
|
905 | + $out .= $this->generateInputFieldColor(); |
|
906 | 906 | } elseif ($this->type == 'yesno') { |
907 | 907 | if (!empty($conf->use_javascript_ajax)) { |
908 | 908 | $input = $this->fieldParams['input'] ?? array(); |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | */ |
965 | 965 | public function generateInputFieldTextarea() |
966 | 966 | { |
967 | - $out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">' . "\n"; |
|
967 | + $out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
968 | 968 | $out .= dol_htmlentities($this->fieldValue); |
969 | 969 | $out .= "</textarea>\n"; |
970 | 970 | return $out; |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | public function generateInputFieldHtml() |
979 | 979 | { |
980 | 980 | global $conf; |
981 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
981 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
982 | 982 | $doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
983 | 983 | return $doleditor->Create(1); |
984 | 984 | } |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | |
1017 | 1017 | $out = ''; |
1018 | 1018 | if (preg_match('/emailtemplate:/', $this->type)) { |
1019 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
1019 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
1020 | 1020 | $formmail = new FormMail($this->db); |
1021 | 1021 | |
1022 | 1022 | $tmp = explode(':', $this->type); |
@@ -1026,10 +1026,10 @@ discard block |
||
1026 | 1026 | foreach ($formmail->lines_model as $modelMail) { |
1027 | 1027 | $moreonlabel = ''; |
1028 | 1028 | if (!empty($arrayOfMessageName[$modelMail->label])) { |
1029 | - $moreonlabel = ' <span class="opacitymedium">(' . $this->langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
1029 | + $moreonlabel = ' <span class="opacitymedium">('.$this->langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
1030 | 1030 | } |
1031 | 1031 | // The 'label' is the key that is unique if we exclude the language |
1032 | - $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)) . $moreonlabel; |
|
1032 | + $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)).$moreonlabel; |
|
1033 | 1033 | } |
1034 | 1034 | } |
1035 | 1035 | $out .= $this->form->selectarray($this->confKey, $arrayOfMessageName, $this->fieldValue, 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -1088,10 +1088,10 @@ discard block |
||
1088 | 1088 | } |
1089 | 1089 | $out = '<input required="required" type="password" class="flat" id="'.$this->confKey.'" name="'.$this->confKey.'" value="'.(GETPOST($this->confKey, 'alpha') ? GETPOST($this->confKey, 'alpha') : $this->fieldValue).'"'; |
1090 | 1090 | if ($min) { |
1091 | - $out .= ' minlength="' . $min . '"'; |
|
1091 | + $out .= ' minlength="'.$min.'"'; |
|
1092 | 1092 | } |
1093 | 1093 | if ($max) { |
1094 | - $out .= ' maxlength="' . $max . '"'; |
|
1094 | + $out .= ' maxlength="'.$max.'"'; |
|
1095 | 1095 | } |
1096 | 1096 | $out .= '>'; |
1097 | 1097 | return $out; |
@@ -1218,9 +1218,9 @@ discard block |
||
1218 | 1218 | } elseif ($this->type == 'selectUser') { |
1219 | 1219 | $out .= $this->generateOutputFieldSelectUser(); |
1220 | 1220 | } elseif ($this->type == 'html') { |
1221 | - $out .= $this->fieldValue; |
|
1221 | + $out .= $this->fieldValue; |
|
1222 | 1222 | } elseif ($this->type == 'color') { |
1223 | - $out .= $this->generateOutputFieldColor(); |
|
1223 | + $out .= $this->generateOutputFieldColor(); |
|
1224 | 1224 | } elseif ($this->type == 'yesno') { |
1225 | 1225 | if (!empty($conf->use_javascript_ajax)) { |
1226 | 1226 | $revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0; |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | } |
1237 | 1237 | } elseif (preg_match('/emailtemplate:/', $this->type)) { |
1238 | 1238 | if ($this->fieldValue > 0) { |
1239 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
1239 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
1240 | 1240 | $formmail = new FormMail($this->db); |
1241 | 1241 | |
1242 | 1242 | $tmp = explode(':', $this->type); |
@@ -1257,9 +1257,9 @@ discard block |
||
1257 | 1257 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1258 | 1258 | $toprint = array(); |
1259 | 1259 | foreach ($ways as $way) { |
1260 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
1260 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
1261 | 1261 | } |
1262 | - $out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
1262 | + $out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
1263 | 1263 | } elseif (preg_match('/thirdparty_type/', $this->type)) { |
1264 | 1264 | if ($this->fieldValue == 2) { |
1265 | 1265 | $out .= $this->langs->trans("Prospect"); |
@@ -1340,13 +1340,13 @@ discard block |
||
1340 | 1340 | $useDefaultColor = true; |
1341 | 1341 | } |
1342 | 1342 | if ($color) { |
1343 | - $out.= '<input type="color" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; " value="#'.$color.'">'; |
|
1343 | + $out .= '<input type="color" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; " value="#'.$color.'">'; |
|
1344 | 1344 | } |
1345 | 1345 | |
1346 | 1346 | if ($useDefaultColor) { |
1347 | - $out.= ' '.$langs->trans("Default"); |
|
1347 | + $out .= ' '.$langs->trans("Default"); |
|
1348 | 1348 | } else { |
1349 | - $out.= ' #'.$color; |
|
1349 | + $out .= ' #'.$color; |
|
1350 | 1350 | } |
1351 | 1351 | |
1352 | 1352 | return $out; |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | $outPut = ''; |
1391 | 1391 | $user = new User($this->db); |
1392 | 1392 | $user->fetch($this->fieldValue); |
1393 | - $outPut = $user->firstname . " " . $user->lastname; |
|
1393 | + $outPut = $user->firstname." ".$user->lastname; |
|
1394 | 1394 | return $outPut; |
1395 | 1395 | } |
1396 | 1396 |