@@ -2176,7 +2176,9 @@ discard block |
||
2176 | 2176 | } |
2177 | 2177 | } |
2178 | 2178 | } |
2179 | - if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
2179 | + if ($nbMandated > 0 ) { |
|
2180 | + $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
2181 | + } |
|
2180 | 2182 | |
2181 | 2183 | if (getDolGlobalInt('SALE_ORDER_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) { |
2182 | 2184 | // This is a hidden option: |
@@ -2841,9 +2843,12 @@ discard block |
||
2841 | 2843 | $parameters = array(); |
2842 | 2844 | // Note that $action and $object may be modified by hook |
2843 | 2845 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); |
2844 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2845 | - if (empty($reshook)) |
|
2846 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
2846 | + if ($reshook < 0) { |
|
2847 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2848 | + } |
|
2849 | + if (empty($reshook)) { |
|
2850 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
2851 | + } |
|
2847 | 2852 | } else { |
2848 | 2853 | $parameters = array(); |
2849 | 2854 | $reshook = $hookmanager->executeHooks('formEditObjectLine', $parameters, $object, $action); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | $id = GETPOST('id', 'int'); |
60 | 60 | $ref = GETPOST('ref', 'alpha'); |
61 | -$ref_client = GETPOST('ref_client', 'alpha'); |
|
61 | +$ref_client = GETPOST('ref_client', 'alpha'); |
|
62 | 62 | $socid = (int) GETPOST('socid', 'int'); |
63 | 63 | $contratid = (int) GETPOST('contratid', 'int'); |
64 | 64 | $action = GETPOST('action', 'alpha'); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $result = fichinter_create($db, $object, (!GETPOST('model', 'alpha')) ? $object->model_pdf : GETPOST('model', 'alpha'), $outputlangs); |
220 | 220 | } |
221 | 221 | |
222 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
222 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
223 | 223 | exit; |
224 | 224 | } else { |
225 | 225 | $mesg = $object->error; |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | } else { |
1066 | 1066 | print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">'; |
1067 | 1067 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
1068 | - print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
1068 | + print '<input type="hidden" name="action" value="create">'; // We go back to create action |
|
1069 | 1069 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
1070 | 1070 | |
1071 | 1071 | print dol_get_fiche_head(''); |
@@ -1187,8 +1187,8 @@ discard block |
||
1187 | 1187 | |
1188 | 1188 | $morehtmlref = '<div class="refidno">'; |
1189 | 1189 | // Ref customer |
1190 | - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', 0, 1); |
|
1191 | - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', null, null, '', 1); |
|
1190 | + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', 0, 1); |
|
1191 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', null, null, '', 1); |
|
1192 | 1192 | // Thirdparty |
1193 | 1193 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer'); |
1194 | 1194 | // Project |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $this->description = $obj->description; |
465 | 465 | $this->socid = $obj->fk_soc; |
466 | 466 | $this->status = $obj->status; |
467 | - $this->statut = $obj->status; // deprecated |
|
467 | + $this->statut = $obj->status; // deprecated |
|
468 | 468 | $this->duration = $obj->duree; |
469 | 469 | $this->datec = $this->db->jdate($obj->datec); |
470 | 470 | $this->dateo = $this->db->jdate($obj->dateo); |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | if (!$error) { |
652 | 652 | $this->ref = $num; |
653 | 653 | $this->status = self::STATUS_VALIDATED; |
654 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
654 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
655 | 655 | $this->date_validation = $now; |
656 | 656 | $this->db->commit(); |
657 | 657 | return 1; |
@@ -685,13 +685,13 @@ discard block |
||
685 | 685 | |
686 | 686 | $now = dol_now(); |
687 | 687 | |
688 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element; |
|
689 | - $sql .= ' SET fk_statut = ' . self::STATUS_CLOSED . ','; |
|
690 | - $sql .= " datet = '" . $this->db->idate($now) . "',"; |
|
691 | - $sql .= " fk_user_modif = " . ((int) $user->id); |
|
692 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
693 | - $sql .= " AND fk_statut > " . self::STATUS_DRAFT; |
|
694 | - $sql .= " AND entity = " . ((int) $conf->entity); |
|
688 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; |
|
689 | + $sql .= ' SET fk_statut = '.self::STATUS_CLOSED.','; |
|
690 | + $sql .= " datet = '".$this->db->idate($now)."',"; |
|
691 | + $sql .= " fk_user_modif = ".((int) $user->id); |
|
692 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
693 | + $sql .= " AND fk_statut > ".self::STATUS_DRAFT; |
|
694 | + $sql .= " AND entity = ".((int) $conf->entity); |
|
695 | 695 | |
696 | 696 | if ($this->db->query($sql)) { |
697 | 697 | if (!$notrigger) { |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | $label = $langs->trans("ShowIntervention"); |
896 | 896 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
897 | 897 | } |
898 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
898 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
899 | 899 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
900 | 900 | } else { |
901 | 901 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -1290,7 +1290,7 @@ discard block |
||
1290 | 1290 | $this->id = 0; |
1291 | 1291 | $this->ref = ''; |
1292 | 1292 | $this->status = self::STATUS_DRAFT; |
1293 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
1293 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
1294 | 1294 | |
1295 | 1295 | // Clear fields |
1296 | 1296 | $this->user_author_id = $user->id; |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | $line->fk_fichinter = $fichinterid; |
1362 | 1362 | $line->desc = $desc; |
1363 | 1363 | $line->date = $date_intervention; |
1364 | - $line->datei = $date_intervention; // For backward compatibility |
|
1364 | + $line->datei = $date_intervention; // For backward compatibility |
|
1365 | 1365 | $line->duration = $duration; |
1366 | 1366 | |
1367 | 1367 | if (is_array($array_options) && count($array_options) > 0) { |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | $line = new FichinterLigne($this->db); |
1414 | 1414 | $line->desc = $langs->trans("Description")." ".$xnbp; |
1415 | 1415 | $line->date = ($now - 3600 * (1 + $xnbp)); |
1416 | - $line->datei = ($now - 3600 * (1 + $xnbp)); // For backward compatibility |
|
1416 | + $line->datei = ($now - 3600 * (1 + $xnbp)); // For backward compatibility |
|
1417 | 1417 | $line->duration = 600; |
1418 | 1418 | $line->fk_fichinter = 0; |
1419 | 1419 | $this->lines[$xnbp] = $line; |
@@ -1456,7 +1456,7 @@ discard block |
||
1456 | 1456 | //For invoicing we calculing hours |
1457 | 1457 | $line->qty = round($objp->duree / 3600, 2); |
1458 | 1458 | $line->date = $this->db->jdate($objp->date); |
1459 | - $line->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
1459 | + $line->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
1460 | 1460 | $line->rang = $objp->rang; |
1461 | 1461 | $line->product_type = 1; |
1462 | 1462 | $line->fetch_optionals(); |
@@ -1606,19 +1606,19 @@ discard block |
||
1606 | 1606 | */ |
1607 | 1607 | public $fk_fichinter; |
1608 | 1608 | |
1609 | - public $desc; // Description ligne |
|
1609 | + public $desc; // Description ligne |
|
1610 | 1610 | |
1611 | 1611 | /** |
1612 | 1612 | * @var int Date of intervention |
1613 | 1613 | */ |
1614 | - public $date; // Date intervention |
|
1614 | + public $date; // Date intervention |
|
1615 | 1615 | /** |
1616 | 1616 | * @var int Date of intervention |
1617 | 1617 | * @deprecated |
1618 | 1618 | */ |
1619 | - public $datei; // Date intervention |
|
1619 | + public $datei; // Date intervention |
|
1620 | 1620 | |
1621 | - public $duration; // Duration of intervention |
|
1621 | + public $duration; // Duration of intervention |
|
1622 | 1622 | public $rang = 0; |
1623 | 1623 | public $tva_tx; |
1624 | 1624 | public $subprice; |
@@ -1668,10 +1668,10 @@ discard block |
||
1668 | 1668 | if ($resql) { |
1669 | 1669 | $objp = $this->db->fetch_object($resql); |
1670 | 1670 | $this->rowid = $objp->rowid; |
1671 | - $this->id = $objp->rowid; |
|
1671 | + $this->id = $objp->rowid; |
|
1672 | 1672 | $this->fk_fichinter = $objp->fk_fichinter; |
1673 | 1673 | $this->date = $this->db->jdate($objp->date); |
1674 | - $this->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
1674 | + $this->datei = $this->db->jdate($objp->date); // For backward compatibility |
|
1675 | 1675 | $this->desc = $objp->description; |
1676 | 1676 | $this->duration = $objp->duree; |
1677 | 1677 | $this->rang = $objp->rang; |
@@ -4205,7 +4205,9 @@ discard block |
||
4205 | 4205 | } |
4206 | 4206 | } |
4207 | 4207 | } |
4208 | - if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
4208 | + if ($nbMandated > 0 ) { |
|
4209 | + $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>'; |
|
4210 | + } |
|
4209 | 4211 | |
4210 | 4212 | |
4211 | 4213 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2); |
@@ -5485,9 +5487,12 @@ discard block |
||
5485 | 5487 | |
5486 | 5488 | $parameters = array(); |
5487 | 5489 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
5488 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
5489 | - if (empty($reshook)) |
|
5490 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
5490 | + if ($reshook < 0) { |
|
5491 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
5492 | + } |
|
5493 | + if (empty($reshook)) { |
|
5494 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
5495 | + } |
|
5491 | 5496 | } else { |
5492 | 5497 | $parameters = array(); |
5493 | 5498 | $reshook = $hookmanager->executeHooks('formEditObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |