@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $disablejs = 0; |
70 | 70 | $disablehead = 0; |
71 | 71 | |
72 | -$head='<link rel="stylesheet" href="css/pos.css.php">'; |
|
72 | +$head = '<link rel="stylesheet" href="css/pos.css.php">'; |
|
73 | 73 | if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) { |
74 | 74 | $head .= '<link rel="stylesheet" href="css/colorful.css">'; |
75 | 75 | } |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | |
678 | 678 | <?php |
679 | 679 | // Add code from hooks |
680 | -$parameters=array(); |
|
680 | +$parameters = array(); |
|
681 | 681 | $hookmanager->executeHooks('completePayment', $parameters, $invoice); |
682 | 682 | print $hookmanager->resPrint; |
683 | 683 | ?> |
@@ -231,7 +231,9 @@ discard block |
||
231 | 231 | $arrayOfValidPaymentModes[] = $obj; |
232 | 232 | } |
233 | 233 | if (!isModEnabled('banque')) { |
234 | - if ($paycode == 'CASH' || $paycode == 'CB') $arrayOfValidPaymentModes[] = $obj; |
|
234 | + if ($paycode == 'CASH' || $paycode == 'CB') { |
|
235 | + $arrayOfValidPaymentModes[] = $obj; |
|
236 | + } |
|
235 | 237 | } |
236 | 238 | } |
237 | 239 | } |
@@ -338,7 +340,9 @@ discard block |
||
338 | 340 | const bodyContent = JSON.stringify({ amount : amount, invoiceid : invoiceid }); |
339 | 341 | <?php |
340 | 342 | $urlpaymentintent = DOL_URL_ROOT.'/stripe/ajax/ajax.php?action=createPaymentIntent&token='.newToken().'&servicestatus='.$servicestatus; |
341 | - if (!empty($stripeacc)) $urlpaymentintent .= '&stripeacc='.$stripeacc; |
|
343 | + if (!empty($stripeacc)) { |
|
344 | + $urlpaymentintent .= '&stripeacc='.$stripeacc; |
|
345 | + } |
|
342 | 346 | ?> |
343 | 347 | return fetch('<?php echo $urlpaymentintent; ?>', { |
344 | 348 | method: "POST", |
@@ -668,7 +672,9 @@ discard block |
||
668 | 672 | |
669 | 673 | $parameters = array(); |
670 | 674 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $invoice, $action); // Note that $action and $object may have been modified by hook |
671 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
675 | +if ($reshook < 0) { |
|
676 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
677 | +} |
|
672 | 678 | |
673 | 679 | $class = ($i == 3) ? "calcbutton3" : "calcbutton2"; |
674 | 680 | foreach ($action_buttons as $button) { |
@@ -161,21 +161,21 @@ |
||
161 | 161 | if (isModEnabled('societe')) { |
162 | 162 | print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnContactActive").'</td><td>'; |
163 | 163 | print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_CONTACT_ACTIVE'), 'activecontact', array(Ldap::SYNCHRO_LDAP_TO_DOLIBARR)); |
164 | - print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnContactActiveExample") . '</span></td></tr>'; |
|
164 | + print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>'; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // Synchro member active |
168 | 168 | if (isModEnabled('adherent')) { |
169 | - print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberActive") . '</td><td>'; |
|
169 | + print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>'; |
|
170 | 170 | print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2); |
171 | - print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberActiveExample") . '</span></td></tr>'; |
|
171 | + print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>'; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | // Synchro member type active |
175 | 175 | if (isModEnabled('adherent')) { |
176 | - print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberTypeActive") . '</td><td>'; |
|
176 | + print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberTypeActive").'</td><td>'; |
|
177 | 177 | print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2); |
178 | - print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberTypeActiveExample") . '</span></td></tr>'; |
|
178 | + print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>'; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | // Fields from hook |
@@ -348,15 +348,15 @@ discard block |
||
348 | 348 | print '</td><td>'; |
349 | 349 | // SuperAdministrator access only |
350 | 350 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
351 | - print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="' . $mainserver . '">'; |
|
352 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="' . $mainserver . '">'; |
|
353 | - print '<span id="smtp_server_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>'; |
|
354 | - print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>'; |
|
351 | + print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">'; |
|
352 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">'; |
|
353 | + print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; |
|
354 | + print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>'; |
|
355 | 355 | } else { |
356 | 356 | $text = !empty($mainserver) ? $mainserver : $smtpserver; |
357 | 357 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
358 | 358 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
359 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="' . $mainserver . '">'; |
|
359 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">'; |
|
360 | 360 | } |
361 | 361 | print '</td>'; |
362 | 362 | } |
@@ -380,14 +380,14 @@ discard block |
||
380 | 380 | print '</td><td>'; |
381 | 381 | // SuperAdministrator access only |
382 | 382 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
383 | - print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="' . $mainport . '">'; |
|
384 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="' . $mainport . '">'; |
|
385 | - print '<span id="smtp_port_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>'; |
|
383 | + print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">'; |
|
384 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">'; |
|
385 | + print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; |
|
386 | 386 | } else { |
387 | 387 | $text = (!empty($mainport) ? $mainport : $smtpport); |
388 | 388 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
389 | 389 | print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); |
390 | - print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="' . $mainport . '">'; |
|
390 | + print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="'.$mainport.'">'; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | print '</td></tr>'; |
@@ -395,14 +395,14 @@ discard block |
||
395 | 395 | // ID |
396 | 396 | if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { |
397 | 397 | $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : ''); |
398 | - print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_ID") . '</td><td>'; |
|
398 | + print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'; |
|
399 | 399 | // SuperAdministrator access only |
400 | 400 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
401 | - print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="' . $mainstmpid . '">'; |
|
401 | + print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">'; |
|
402 | 402 | } else { |
403 | 403 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
404 | 404 | print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); |
405 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="' . $mainstmpid . '">'; |
|
405 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">'; |
|
406 | 406 | } |
407 | 407 | print '</td></tr>'; |
408 | 408 | } |
@@ -428,14 +428,14 @@ discard block |
||
428 | 428 | // PW |
429 | 429 | if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { |
430 | 430 | $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING : ''); |
431 | - print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_PW") . '</td><td>'; |
|
431 | + print '<tr class="drag drop oddeven smtp_pw hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'; |
|
432 | 432 | // SuperAdministrator access only |
433 | 433 | if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { |
434 | - print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="' . $mainsmtppw . '">'; |
|
434 | + print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">'; |
|
435 | 435 | } else { |
436 | 436 | $htmltext = $langs->trans("ContactSuperAdminForChange"); |
437 | 437 | print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); |
438 | - print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="' . $mainsmtppw . '">'; |
|
438 | + print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">'; |
|
439 | 439 | } |
440 | 440 | print '</td></tr>'; |
441 | 441 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | // AUTH method |
553 | 553 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { |
554 | 554 | $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING', 'LOGIN'); |
555 | - $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; |
|
555 | + $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : ''); |
|
556 | 556 | print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>'; |
557 | 557 | } |
558 | 558 | |
@@ -641,16 +641,16 @@ discard block |
||
641 | 641 | if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { |
642 | 642 | if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) { |
643 | 643 | if (function_exists('fsockopen') && $port && $server) { |
644 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testconnect">' . $langs->trans("DoTestServerAvailability") . '</a>'; |
|
644 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>'; |
|
645 | 645 | } |
646 | 646 | } else { |
647 | - print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("FeatureNotAvailableOnLinux") . '">' . $langs->trans("DoTestServerAvailability") . '</a>'; |
|
647 | + print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>'; |
|
648 | 648 | } |
649 | 649 | |
650 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=test&mode=init">' . $langs->trans("DoTestSend") . '</a>'; |
|
650 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>'; |
|
651 | 651 | |
652 | 652 | if (isModEnabled('fckeditor')) { |
653 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testhtml&mode=init">' . $langs->trans("DoTestSendHTML") . '</a>'; |
|
653 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&mode=init">'.$langs->trans("DoTestSendHTML").'</a>'; |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 |
@@ -520,7 +520,7 @@ |
||
520 | 520 | // AUTH method |
521 | 521 | if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { |
522 | 522 | $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET', 'LOGIN'); |
523 | - $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; |
|
523 | + $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : ''); |
|
524 | 524 | print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>'; |
525 | 525 | } |
526 | 526 |
@@ -100,14 +100,14 @@ |
||
100 | 100 | |
101 | 101 | // Param |
102 | 102 | $label = $langs->trans($key); |
103 | - print '<td><label for="' . $key . '">' . $label . '</label></td>'; |
|
103 | + print '<td><label for="'.$key.'">'.$label.'</label></td>'; |
|
104 | 104 | |
105 | 105 | // Value |
106 | 106 | print '<td>'; |
107 | 107 | if (isModEnabled('accounting')) { |
108 | 108 | print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); |
109 | 109 | } else { |
110 | - print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . getDolGlobalString($key) . '">'; |
|
110 | + print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">'; |
|
111 | 111 | } |
112 | 112 | print '</td></tr>'; |
113 | 113 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | accessforbidden(); |
74 | 74 | } |
75 | 75 | |
76 | -$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); |
|
76 | +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
|
77 | 77 | $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); |
78 | 78 | |
79 | 79 | $permissiontoread = $user->rights->eventorganization->read; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if ($user->socid > 0) { |
88 | 88 | accessforbidden(); |
89 | 89 | } |
90 | -$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); |
|
90 | +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
|
91 | 91 | $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); |
92 | 92 | |
93 | 93 | if (!$permissiontoread) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); |
112 | 112 | |
113 | 113 | if ($result >= 0) { |
114 | - header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':'')); |
|
114 | + header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject) ? '&withproject=1' : '')); |
|
115 | 115 | exit; |
116 | 116 | } else { |
117 | 117 | if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $result = $object->delete_contact($lineid); |
130 | 130 | |
131 | 131 | if ($result >= 0) { |
132 | - header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':'')); |
|
132 | + header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject) ? '&withproject=1' : '')); |
|
133 | 133 | exit; |
134 | 134 | } else { |
135 | 135 | dol_print_error($db); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if (!empty($projectstatic->socid)) { |
166 | 166 | $projectstatic->fetch_thirdparty(); |
167 | 167 | } |
168 | -$withProjectUrl=''; |
|
168 | +$withProjectUrl = ''; |
|
169 | 169 | $object->project = clone $projectstatic; |
170 | 170 | |
171 | 171 | if (!empty($withproject)) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
105 | 105 | */ |
106 | - public $fields=array( |
|
106 | + public $fields = array( |
|
107 | 107 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), |
108 | 108 | 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>1, 'default'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), |
109 | 109 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | */ |
352 | 352 | public function fetchLines() |
353 | 353 | { |
354 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/stocktransfer/class/stocktransferline.class.php'; |
|
354 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransferline.class.php'; |
|
355 | 355 | $this->lines = array(); |
356 | 356 | |
357 | 357 | $result = $this->fetchLinesCommon(); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | |
387 | 387 | if (empty($this->lines)) $this->fetchLines(); |
388 | 388 | if (!empty($this->lines)) { |
389 | - foreach ($this->lines as $l) $total_pmp+= ($l->pmp * $l->qty); |
|
389 | + foreach ($this->lines as $l) $total_pmp += ($l->pmp * $l->qty); |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | return $total_pmp; |
@@ -182,8 +182,12 @@ discard block |
||
182 | 182 | $this->db = $db; |
183 | 183 | $this->origin_type = 'StockTransfer@product/stock/stocktransfer'; |
184 | 184 | |
185 | - if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; |
|
186 | - if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; |
|
185 | + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { |
|
186 | + $this->fields['rowid']['visible'] = 0; |
|
187 | + } |
|
188 | + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { |
|
189 | + $this->fields['entity']['enabled'] = 0; |
|
190 | + } |
|
187 | 191 | |
188 | 192 | // Example to show how to set values of fields definition dynamically |
189 | 193 | /*if ($user->rights->stocktransfer->stocktransfer->read) { |
@@ -220,10 +224,16 @@ discard block |
||
220 | 224 | public function create(User $user, $notrigger = false) |
221 | 225 | { |
222 | 226 | $model_pdf = GETPOST('model'); |
223 | - if (!empty($model_pdf)) $this->model_pdf = $model_pdf; |
|
227 | + if (!empty($model_pdf)) { |
|
228 | + $this->model_pdf = $model_pdf; |
|
229 | + } |
|
224 | 230 | $this->status = (int) $this->status; |
225 | - if ($this->fk_warehouse_source <= 0) $this->fk_warehouse_source = 0; |
|
226 | - if ($this->fk_warehouse_destination <= 0) $this->fk_warehouse_destination = 0; |
|
231 | + if ($this->fk_warehouse_source <= 0) { |
|
232 | + $this->fk_warehouse_source = 0; |
|
233 | + } |
|
234 | + if ($this->fk_warehouse_destination <= 0) { |
|
235 | + $this->fk_warehouse_destination = 0; |
|
236 | + } |
|
227 | 237 | return $this->createCommon($user, $notrigger); |
228 | 238 | } |
229 | 239 | |
@@ -247,7 +257,9 @@ discard block |
||
247 | 257 | |
248 | 258 | // Load source object |
249 | 259 | $result = $object->fetchCommon($fromid); |
250 | - if ($result > 0 && !empty($object->table_element_line)) $object->fetchLines(); |
|
260 | + if ($result > 0 && !empty($object->table_element_line)) { |
|
261 | + $object->fetchLines(); |
|
262 | + } |
|
251 | 263 | |
252 | 264 | // get lines so they will be clone |
253 | 265 | //foreach($this->lines as $line) |
@@ -299,8 +311,9 @@ discard block |
||
299 | 311 | if (!$error) { |
300 | 312 | // copy external contacts if same company |
301 | 313 | if (property_exists($this, 'socid') && $this->socid == $object->socid) { |
302 | - if ($this->copy_linked_contact($object, 'external') < 0) |
|
303 | - $error++; |
|
314 | + if ($this->copy_linked_contact($object, 'external') < 0) { |
|
315 | + $error++; |
|
316 | + } |
|
304 | 317 | } |
305 | 318 | } |
306 | 319 | |
@@ -326,7 +339,9 @@ discard block |
||
326 | 339 | public function fetch($id, $ref = null) |
327 | 340 | { |
328 | 341 | $result = $this->fetchCommon($id, $ref); |
329 | - if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); |
|
342 | + if ($result > 0 && !empty($this->table_element_line)) { |
|
343 | + $this->fetchLines(); |
|
344 | + } |
|
330 | 345 | return $result; |
331 | 346 | } |
332 | 347 | |
@@ -370,9 +385,13 @@ discard block |
||
370 | 385 | |
371 | 386 | $total_pmp = 0; |
372 | 387 | |
373 | - if (empty($this->lines)) $this->fetchLines(); |
|
388 | + if (empty($this->lines)) { |
|
389 | + $this->fetchLines(); |
|
390 | + } |
|
374 | 391 | if (!empty($this->lines)) { |
375 | - foreach ($this->lines as $l) $total_pmp+= ($l->pmp * $l->qty); |
|
392 | + foreach ($this->lines as $l) { |
|
393 | + $total_pmp+= ($l->pmp * $l->qty); |
|
394 | + } |
|
376 | 395 | } |
377 | 396 | |
378 | 397 | return $total_pmp; |
@@ -400,8 +419,11 @@ discard block |
||
400 | 419 | $sql = 'SELECT '; |
401 | 420 | $sql .= $this->getFieldList(); |
402 | 421 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
403 | - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' WHERE t.entity IN ('.getEntity($this->element).')'; |
|
404 | - else $sql .= ' WHERE 1 = 1'; |
|
422 | + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { |
|
423 | + $sql .= ' WHERE t.entity IN ('.getEntity($this->element).')'; |
|
424 | + } else { |
|
425 | + $sql .= ' WHERE 1 = 1'; |
|
426 | + } |
|
405 | 427 | // Manage filter |
406 | 428 | $sqlwhere = array(); |
407 | 429 | if (count($filter) > 0) { |
@@ -464,8 +486,12 @@ discard block |
||
464 | 486 | { |
465 | 487 | $this->tms = ''; // Will be done automatically because tms field is on update cascade |
466 | 488 | $res = $this->updateCommon($user, $notrigger); |
467 | - if ($this->socid > 0 || $this->fk_soc > 0 && empty($this->thirdparty)) $this->fetch_thirdparty(); |
|
468 | - if (empty($this->socid) && empty($this->fk_soc)) unset($this->thirdparty); |
|
489 | + if ($this->socid > 0 || $this->fk_soc > 0 && empty($this->thirdparty)) { |
|
490 | + $this->fetch_thirdparty(); |
|
491 | + } |
|
492 | + if (empty($this->socid) && empty($this->fk_soc)) { |
|
493 | + unset($this->thirdparty); |
|
494 | + } |
|
469 | 495 | return $res; |
470 | 496 | } |
471 | 497 | |
@@ -552,8 +578,12 @@ discard block |
||
552 | 578 | $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; |
553 | 579 | $sql .= " SET ref = '".$this->db->escape($num)."',"; |
554 | 580 | $sql .= " status = ".self::STATUS_VALIDATED; |
555 | - if (!empty($this->fields['date_validation'])) $sql .= ", date_validation = '".$this->db->idate($now)."',"; |
|
556 | - if (!empty($this->fields['fk_user_valid'])) $sql .= ", fk_user_valid = ".((int) $user->id); |
|
581 | + if (!empty($this->fields['date_validation'])) { |
|
582 | + $sql .= ", date_validation = '".$this->db->idate($now)."',"; |
|
583 | + } |
|
584 | + if (!empty($this->fields['fk_user_valid'])) { |
|
585 | + $sql .= ", fk_user_valid = ".((int) $user->id); |
|
586 | + } |
|
557 | 587 | $sql .= " WHERE rowid = ".((int) $this->id); |
558 | 588 | |
559 | 589 | dol_syslog(get_class($this)."::validate()", LOG_DEBUG); |
@@ -567,7 +597,9 @@ discard block |
||
567 | 597 | if (!$error && !$notrigger) { |
568 | 598 | // Call trigger |
569 | 599 | $result = $this->call_trigger('STOCKTRANSFER_VALIDATE', $user); |
570 | - if ($result < 0) $error++; |
|
600 | + if ($result < 0) { |
|
601 | + $error++; |
|
602 | + } |
|
571 | 603 | // End call triggers |
572 | 604 | } |
573 | 605 | } |
@@ -709,7 +741,10 @@ discard block |
||
709 | 741 | { |
710 | 742 | global $conf, $langs, $hookmanager; |
711 | 743 | |
712 | - if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips |
|
744 | + if (!empty($conf->dol_no_mouse_hover)) { |
|
745 | + $notooltip = 1; |
|
746 | + } |
|
747 | + // Force disable tooltips |
|
713 | 748 | |
714 | 749 | $result = ''; |
715 | 750 | |
@@ -725,8 +760,12 @@ discard block |
||
725 | 760 | if ($option != 'nolink') { |
726 | 761 | // Add param to save lastsearch_values or not |
727 | 762 | $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); |
728 | - if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; |
|
729 | - if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; |
|
763 | + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { |
|
764 | + $add_save_lastsearch_values = 1; |
|
765 | + } |
|
766 | + if ($add_save_lastsearch_values) { |
|
767 | + $url .= '&save_lastsearch_values=1'; |
|
768 | + } |
|
730 | 769 | } |
731 | 770 | |
732 | 771 | $linkclose = ''; |
@@ -737,7 +776,9 @@ discard block |
||
737 | 776 | } |
738 | 777 | $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; |
739 | 778 | $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; |
740 | - } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
779 | + } else { |
|
780 | + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
|
781 | + } |
|
741 | 782 | |
742 | 783 | $linkstart = '<a href="'.$url.'"'; |
743 | 784 | $linkstart .= $linkclose.'>'; |
@@ -746,7 +787,9 @@ discard block |
||
746 | 787 | $result .= $linkstart; |
747 | 788 | |
748 | 789 | if (empty($this->showphoto_on_popup)) { |
749 | - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
790 | + if ($withpicto) { |
|
791 | + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); |
|
792 | + } |
|
750 | 793 | } else { |
751 | 794 | if ($withpicto) { |
752 | 795 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
@@ -772,7 +815,9 @@ discard block |
||
772 | 815 | } |
773 | 816 | } |
774 | 817 | |
775 | - if ($withpicto != 2) $result .= $this->ref; |
|
818 | + if ($withpicto != 2) { |
|
819 | + $result .= $this->ref; |
|
820 | + } |
|
776 | 821 | |
777 | 822 | $result .= $linkend; |
778 | 823 | //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); |
@@ -781,8 +826,11 @@ discard block |
||
781 | 826 | $hookmanager->initHooks(array('stocktransferdao')); |
782 | 827 | $parameters = array('id'=>$this->id, 'getnomurl'=>$result); |
783 | 828 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
784 | - if ($reshook > 0) $result = $hookmanager->resPrint; |
|
785 | - else $result .= $hookmanager->resPrint; |
|
829 | + if ($reshook > 0) { |
|
830 | + $result = $hookmanager->resPrint; |
|
831 | + } else { |
|
832 | + $result .= $hookmanager->resPrint; |
|
833 | + } |
|
786 | 834 | |
787 | 835 | return $result; |
788 | 836 | } |
@@ -824,7 +872,9 @@ discard block |
||
824 | 872 | |
825 | 873 | $statusType = 'status'.$status; |
826 | 874 | //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; |
827 | - if ($status == self::STATUS_CLOSED) $statusType = 'status6'; |
|
875 | + if ($status == self::STATUS_CLOSED) { |
|
876 | + $statusType = 'status6'; |
|
877 | + } |
|
828 | 878 | |
829 | 879 | return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); |
830 | 880 | } |
@@ -53,11 +53,17 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // Security check (enable the most restrictive one) |
56 | -if ($user->socid > 0) accessforbidden(); |
|
56 | +if ($user->socid > 0) { |
|
57 | + accessforbidden(); |
|
58 | +} |
|
57 | 59 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
58 | 60 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
59 | -if (!isModEnabled('asset')) accessforbidden(); |
|
60 | -if (!empty($object->not_depreciated)) accessforbidden(); |
|
61 | +if (!isModEnabled('asset')) { |
|
62 | + accessforbidden(); |
|
63 | +} |
|
64 | +if (!empty($object->not_depreciated)) { |
|
65 | + accessforbidden(); |
|
66 | +} |
|
61 | 67 | |
62 | 68 | $object->asset_depreciation_options = &$assetdepreciationoptions; |
63 | 69 | $result = $assetdepreciationoptions->fetchDeprecationOptions($object->id); |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | |
25 | 25 | // Load Dolibarr environment |
26 | 26 | require '../main.inc.php'; |
27 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php'; |
|
28 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php'; |
|
29 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php'; |
|
27 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; |
|
28 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; |
|
29 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php'; |
|
30 | 30 | |
31 | 31 | // Load translation files required by the page |
32 | 32 | $langs->loadLangs(array("assets", "companies")); |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | $extrafields->fetch_name_optionals_label($object->table_element); |
49 | 49 | |
50 | 50 | // Load object |
51 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
51 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
52 | 52 | if ($id > 0 || !empty($ref)) { |
53 | - $upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id; |
|
53 | + $upload_dir = $conf->asset->multidir_output[$object->entity]."/".$object->id; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // Security check (enable the most restrictive one) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | // Object card |
100 | 100 | // ------------------------------------------------------------ |
101 | - $linkback = '<a href="' . DOL_URL_ROOT . '/asset/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
101 | + $linkback = '<a href="'.DOL_URL_ROOT.'/asset/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
102 | 102 | |
103 | 103 | $morehtmlref = '<div class="refidno">'; |
104 | 104 | $morehtmlref .= '</div>'; |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | print '<div class="fichecenter">'; |
135 | 135 | print '<div class="fichehalfleft">'; |
136 | 136 | print '<div class="underbanner clearboth"></div>'; |
137 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
138 | - print '<tr><td class="titlefield">' . $langs->trans('AssetBaseDepreciationHT') . '</td><td>' . price($depreciation_info['base_depreciation_ht']) . '</td></tr>'; |
|
139 | - print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationBeginDate') . '</td><td>' . dol_print_date($object->date_start > $object->date_acquisition ? $object->date_start : $object->date_acquisition, 'day') . '</td></tr>'; |
|
137 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
138 | + print '<tr><td class="titlefield">'.$langs->trans('AssetBaseDepreciationHT').'</td><td>'.price($depreciation_info['base_depreciation_ht']).'</td></tr>'; |
|
139 | + print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationBeginDate').'</td><td>'.dol_print_date($object->date_start > $object->date_acquisition ? $object->date_start : $object->date_acquisition, 'day').'</td></tr>'; |
|
140 | 140 | print '</table>'; |
141 | 141 | |
142 | 142 | // We close div and reopen for second column |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | |
146 | 146 | print '<div class="underbanner clearboth"></div>'; |
147 | 147 | print '<table class="border centpercent tableforfield">'; |
148 | - print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationDuration') . '</td><td>' . $depreciation_info['duration'] . ' ( ' . $depreciation_info['duration_type'] . ' )</td></tr>'; |
|
149 | - print '<tr><td class="titlefield">' . $langs->trans('AssetDepreciationRate') . '</td><td>' . $depreciation_info['rate'] . '</td></tr>'; |
|
148 | + print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationDuration').'</td><td>'.$depreciation_info['duration'].' ( '.$depreciation_info['duration_type'].' )</td></tr>'; |
|
149 | + print '<tr><td class="titlefield">'.$langs->trans('AssetDepreciationRate').'</td><td>'.$depreciation_info['rate'].'</td></tr>'; |
|
150 | 150 | print '</table>'; |
151 | 151 | print '</div>'; |
152 | 152 | print '</div>'; |
@@ -160,21 +160,21 @@ discard block |
||
160 | 160 | |
161 | 161 | print '<tr class="liste_titre">'; |
162 | 162 | print '<td class="width20"></td>'; |
163 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
164 | - print '<td class="center">' . $langs->trans("AssetDepreciationDate") . '</td>'; |
|
165 | - print '<td class="right">' . $langs->trans("AssetDepreciationHT") . '</td>'; |
|
166 | - print '<td class="right">' . $langs->trans("AssetCumulativeDepreciationHT") . '</td>'; |
|
167 | - print '<td class="right">' . $langs->trans("AssetResidualHT") . '</td>'; |
|
163 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
164 | + print '<td class="center">'.$langs->trans("AssetDepreciationDate").'</td>'; |
|
165 | + print '<td class="right">'.$langs->trans("AssetDepreciationHT").'</td>'; |
|
166 | + print '<td class="right">'.$langs->trans("AssetCumulativeDepreciationHT").'</td>'; |
|
167 | + print '<td class="right">'.$langs->trans("AssetResidualHT").'</td>'; |
|
168 | 168 | print '</tr>'; |
169 | 169 | |
170 | 170 | if (empty($lines)) { |
171 | - print '<tr><td class="impair center" colspan="6"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
171 | + print '<tr><td class="impair center" colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
172 | 172 | } else { |
173 | 173 | foreach ($lines as $line) { |
174 | 174 | print '<tr class="oddeven">'; |
175 | - print '<td>' . ($line['bookkeeping'] ? $bookkeeping_icon : ($line['depreciation_date'] > $now ? $future_icon : '')) . '</td>'; |
|
176 | - print '<td >' . (empty($line['ref']) ? $langs->trans('AssetDepreciationReversal') : $line['ref']) . '</td>'; |
|
177 | - print '<td class="center">' . dol_print_date($line['depreciation_date'], 'day') . '</td>'; |
|
175 | + print '<td>'.($line['bookkeeping'] ? $bookkeeping_icon : ($line['depreciation_date'] > $now ? $future_icon : '')).'</td>'; |
|
176 | + print '<td >'.(empty($line['ref']) ? $langs->trans('AssetDepreciationReversal') : $line['ref']).'</td>'; |
|
177 | + print '<td class="center">'.dol_print_date($line['depreciation_date'], 'day').'</td>'; |
|
178 | 178 | print '<td class="right">'; |
179 | 179 | print price($line['depreciation_ht']); |
180 | 180 | print '</td>'; |
@@ -76,12 +76,20 @@ |
||
76 | 76 | $upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1]; |
77 | 77 | |
78 | 78 | // Security check (enable the most restrictive one) |
79 | -if ($user->socid > 0) accessforbidden(); |
|
80 | -if ($user->socid > 0) $socid = $user->socid; |
|
79 | +if ($user->socid > 0) { |
|
80 | + accessforbidden(); |
|
81 | +} |
|
82 | +if ($user->socid > 0) { |
|
83 | + $socid = $user->socid; |
|
84 | +} |
|
81 | 85 | $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
82 | 86 | restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
83 | -if (!isModEnabled('asset')) accessforbidden(); |
|
84 | -if (!$permissiontoread) accessforbidden(); |
|
87 | +if (!isModEnabled('asset')) { |
|
88 | + accessforbidden(); |
|
89 | +} |
|
90 | +if (!$permissiontoread) { |
|
91 | + accessforbidden(); |
|
92 | +} |
|
85 | 93 | |
86 | 94 | |
87 | 95 | /* |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | if (GETPOSTISSET('supplier_invoice_id')) { |
183 | 183 | $object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => '1', 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',); |
184 | - print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOST('supplier_invoice_id', 'int') . '">'; |
|
184 | + print '<input type="hidden" name="supplier_invoice_id" value="'.GETPOST('supplier_invoice_id', 'int').'">'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | print dol_get_fiche_head(array(), ''); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated), |
285 | 285 | array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat), |
286 | 286 | ); |
287 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1); |
|
287 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref.' - '.$object->label), 'confirm_disposal', $formquestion, 'yes', 1); |
|
288 | 288 | } elseif ($action == 'reopen') { |
289 | 289 | // Re-open |
290 | 290 | // Create an array for form |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | print '<table class="border centpercent tableforfield">'."\n"; |
329 | 329 | |
330 | 330 | // Common attributes |
331 | - $keyforbreak='date_acquisition'; // We change column just before this field |
|
331 | + $keyforbreak = 'date_acquisition'; // We change column just before this field |
|
332 | 332 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
333 | 333 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
334 | 334 | include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | |
347 | 347 | // Buttons for actions |
348 | 348 | if ($action != 'presend' && $action != 'editline') { |
349 | - print '<div class="tabsAction">' . "\n"; |
|
349 | + print '<div class="tabsAction">'."\n"; |
|
350 | 350 | $parameters = array(); |
351 | 351 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
352 | 352 | if ($reshook < 0) { |
@@ -356,26 +356,26 @@ discard block |
||
356 | 356 | if (empty($reshook)) { |
357 | 357 | // Send |
358 | 358 | if (empty($user->socid)) { |
359 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); |
|
359 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | if ($object->status == $object::STATUS_DRAFT) { |
363 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
363 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | // Clone |
367 | 367 | //print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', false && $permissiontoadd); |
368 | 368 | |
369 | 369 | if ($object->status == $object::STATUS_DRAFT) { |
370 | - print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disposal&token=' . newToken(), '', $permissiontoadd); |
|
370 | + print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disposal&token='.newToken(), '', $permissiontoadd); |
|
371 | 371 | } else { |
372 | - print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen&token=' . newToken(), '', $permissiontoadd); |
|
372 | + print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | // Delete (need delete permission, or if draft, just need create/modify permission) |
376 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
376 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
377 | 377 | } |
378 | - print '</div>' . "\n"; |
|
378 | + print '</div>'."\n"; |
|
379 | 379 | } |
380 | 380 | |
381 | 381 | // Select mail models is same action as presend |