@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $confirm = GETPOST('confirm', 'alpha'); |
51 | 51 | $cancel = GETPOST('cancel', 'aZ09'); |
52 | 52 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search |
53 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
54 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
53 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
54 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
55 | 55 | $qty = GETPOSTINT('qty'); |
56 | 56 | $fk_product = GETPOSTINT('fk_product'); |
57 | 57 | $fk_warehouse_source = GETPOSTINT('fk_warehouse_source'); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
196 | - if ($prod->status_batch==2 && abs($qty)>1) { |
|
196 | + if ($prod->status_batch == 2 && abs($qty) > 1) { |
|
197 | 197 | $error++; |
198 | 198 | setEventMessages($langs->transnoentities('TooManyQtyForSerialNumber', $prod->ref), null, 'errors'); |
199 | 199 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
259 | - if ($prod->status_batch==2 && abs($qty)>1) { |
|
259 | + if ($prod->status_batch == 2 && abs($qty) > 1) { |
|
260 | 260 | $error++; |
261 | 261 | setEventMessages($langs->transnoentities('TooManyQtyForSerialNumber', $prod->ref), null, 'errors'); |
262 | 262 | $action = 'editline'; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $date_prevue_depart = $object->date_prevue_depart; |
423 | 423 | $date_prevue_depart_plus_delai = $date_prevue_depart; |
424 | 424 | if ($object->lead_time_for_warning > 0) { |
425 | - $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart) . ' + '.$object->lead_time_for_warning.' day'); |
|
425 | + $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart).' + '.$object->lead_time_for_warning.' day'); |
|
426 | 426 | } |
427 | 427 | if (!empty($date_prevue_depart) && $date_prevue_depart_plus_delai < strtotime(date('Y-m-d'))) { |
428 | 428 | print "$('.valuefield.fieldname_date_prevue_depart').append('"; |
@@ -497,28 +497,28 @@ discard block |
||
497 | 497 | |
498 | 498 | // Part to edit record |
499 | 499 | if (($id || $ref) && $action == 'edit') { |
500 | - print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_' . $object->picto); |
|
500 | + print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_'.$object->picto); |
|
501 | 501 | |
502 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
503 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
502 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
503 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
504 | 504 | print '<input type="hidden" name="action" value="update">'; |
505 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
505 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
506 | 506 | if ($backtopage) { |
507 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
507 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
508 | 508 | } |
509 | 509 | if ($backtopageforcancel) { |
510 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
510 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | print dol_get_fiche_head(); |
514 | 514 | |
515 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
515 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
516 | 516 | |
517 | 517 | // Common attributes |
518 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
518 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
519 | 519 | |
520 | 520 | // Other attributes |
521 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
521 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
522 | 522 | |
523 | 523 | print '</table>'; |
524 | 524 | |
@@ -554,28 +554,28 @@ discard block |
||
554 | 554 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
555 | 555 | } elseif ($action == 'destock') { // Destock confirmation |
556 | 556 | // Create an array for form |
557 | - $formquestion = array( 'text' => '', |
|
557 | + $formquestion = array('text' => '', |
|
558 | 558 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size' => 40), |
559 | 559 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
560 | 560 | ); |
561 | 561 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1); |
562 | 562 | } elseif ($action == 'destockcancel') { // Destock confirmation cancel |
563 | 563 | // Create an array for form |
564 | - $formquestion = array( 'text' => '', |
|
564 | + $formquestion = array('text' => '', |
|
565 | 565 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size' => 40), |
566 | 566 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
567 | 567 | ); |
568 | 568 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1); |
569 | 569 | } elseif ($action == 'addstock') { // Addstock confirmation |
570 | 570 | // Create an array for form |
571 | - $formquestion = array( 'text' => '', |
|
571 | + $formquestion = array('text' => '', |
|
572 | 572 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size' => 40), |
573 | 573 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
574 | 574 | ); |
575 | 575 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1); |
576 | 576 | } elseif ($action == 'addstockcancel') { // Addstock confirmation cancel |
577 | 577 | // Create an array for form |
578 | - $formquestion = array( 'text' => '', |
|
578 | + $formquestion = array('text' => '', |
|
579 | 579 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size' => 40), |
580 | 580 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
581 | 581 | ); |
@@ -890,11 +890,11 @@ discard block |
||
890 | 890 | print '<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'"></td>'; |
891 | 891 | } else { |
892 | 892 | print '<td class="right">'; |
893 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=editline&lineid=' . $line->id . '#line_' . $line->id . '">'; |
|
894 | - print img_edit() . '</a>'; |
|
893 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id.'">'; |
|
894 | + print img_edit().'</a>'; |
|
895 | 895 | print '</td>'; |
896 | 896 | print '<td class="right">'; |
897 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=deleteline&lineid=' . $line->id . '">' . img_delete($langs->trans("Remove")) . '</a>'; |
|
897 | + print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=deleteline&lineid='.$line->id.'">'.img_delete($langs->trans("Remove")).'</a>'; |
|
898 | 898 | print '</td>'; |
899 | 899 | } |
900 | 900 | |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | print '<td></td>'; |
999 | 999 | |
1000 | 1000 | // Button to add line |
1001 | - print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="' . dol_escape_htmltag($langs->trans('Add')) . '"></td>'; |
|
1001 | + print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($langs->trans('Add')).'"></td>'; |
|
1002 | 1002 | |
1003 | 1003 | // Grad and drop lines |
1004 | 1004 | print '<td></td>'; |
@@ -1102,9 +1102,9 @@ discard block |
||
1102 | 1102 | // Documents |
1103 | 1103 | if ($includedocgeneration) { |
1104 | 1104 | $objref = dol_sanitizeFileName($object->ref); |
1105 | - $relativepath = $objref . '/' . $objref . '.pdf'; |
|
1105 | + $relativepath = $objref.'/'.$objref.'.pdf'; |
|
1106 | 1106 | $filedir = $conf->stocktransfer->dir_output.'/'.$object->element.'/'.$objref; |
1107 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
1107 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
1108 | 1108 | $genallowed = $permissiontoread; // If you can read, you can build the PDF to read content |
1109 | 1109 | $delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card |
1110 | 1110 | print $formfile->showdocuments('stocktransfer:StockTransfer', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $perm = $hookmanager->resArray['perm']; |
143 | 143 | } |
144 | 144 | |
145 | - if (! $perm) { |
|
145 | + if (!$perm) { |
|
146 | 146 | // We should not be here. If we are not allowed to reorder rows, feature should not be visible on script. |
147 | 147 | // If we are here, it is a hack attempt, so we report a warning. |
148 | 148 | print 'Bad permission to modify position of lines for object in table '.$table_element_line; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | // Reorder line to have position of children lines sharing same counter than parent lines |
167 | 167 | // This should be useless because there is no need to have children sharing same counter than parent, but well, it's cleaner into database. |
168 | - if (in_array($fk_element, array('fk_facture', 'fk_propal', 'fk_commande','fk_contrat'))) { |
|
168 | + if (in_array($fk_element, array('fk_facture', 'fk_propal', 'fk_commande', 'fk_contrat'))) { |
|
169 | 169 | $result = $row->line_order(true); |
170 | 170 | } |
171 | 171 | } else { |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | 'start' => isset($value['start']) ? $value['start'] : '', |
1143 | 1143 | 'end' => isset($value['end']) ? $value['end'] : '' |
1144 | 1144 | ); |
1145 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1145 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1146 | 1146 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
1147 | 1147 | $out .= '</div><div class="nowrap">'; |
1148 | 1148 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | 'start' => isset($value['start']) ? $value['start'] : '', |
1168 | 1168 | 'end' => isset($value['end']) ? $value['end'] : '' |
1169 | 1169 | ); |
1170 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1170 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1171 | 1171 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
1172 | 1172 | $out .= '</div><div class="nowrap">'; |
1173 | 1173 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | } else { |
1238 | 1238 | $out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1, 1, 'width75 yesno'); |
1239 | 1239 | } |
1240 | - $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
1240 | + $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
1241 | 1241 | } elseif ($type == 'price') { |
1242 | 1242 | if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. |
1243 | 1243 | $value = price($value); |
@@ -1705,7 +1705,7 @@ discard block |
||
1705 | 1705 | |
1706 | 1706 | $tmparray = explode(':', $param_list[0]); |
1707 | 1707 | |
1708 | - $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
1708 | + $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
1709 | 1709 | if ($element == 'socpeople') { |
1710 | 1710 | $element = 'contact'; |
1711 | 1711 | } elseif ($element == 'projet') { |
@@ -1713,8 +1713,8 @@ discard block |
||
1713 | 1713 | } |
1714 | 1714 | |
1715 | 1715 | //$objectdesc = $param_list[0]; // Example: 'ObjectName:classPath:1:(status:=:1)' Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF |
1716 | - $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
1717 | - $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
1716 | + $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
1717 | + $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
1718 | 1718 | |
1719 | 1719 | $out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield); |
1720 | 1720 | } elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) { |
@@ -1779,7 +1779,7 @@ discard block |
||
1779 | 1779 | |
1780 | 1780 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
1781 | 1781 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
1782 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1782 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1783 | 1783 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
1784 | 1784 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
1785 | 1785 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | if ($type == 'date') { |
1804 | 1804 | $showsize = 10; |
1805 | 1805 | if ($value !== '') { |
1806 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1806 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1807 | 1807 | } |
1808 | 1808 | } elseif ($type == 'datetime') { |
1809 | 1809 | $showsize = 19; |
@@ -1928,9 +1928,9 @@ discard block |
||
1928 | 1928 | $translabel = $outputlangs->trans($obj->$field_toshow); |
1929 | 1929 | |
1930 | 1930 | if ($translabel != $obj->$field_toshow) { |
1931 | - $value .= dol_trunc($translabel, 24) . ' '; |
|
1931 | + $value .= dol_trunc($translabel, 24).' '; |
|
1932 | 1932 | } else { |
1933 | - $value .= $obj->$field_toshow . ' '; |
|
1933 | + $value .= $obj->$field_toshow.' '; |
|
1934 | 1934 | } |
1935 | 1935 | } |
1936 | 1936 | } |
@@ -1951,13 +1951,13 @@ discard block |
||
1951 | 1951 | $toprint = array(); |
1952 | 1952 | $obj = $this->db->fetch_object($resql); |
1953 | 1953 | if ($obj->rowid) { |
1954 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1954 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1955 | 1955 | $c = new Categorie($this->db); |
1956 | 1956 | $result = $c->fetch($obj->rowid); |
1957 | 1957 | if ($result > 0) { |
1958 | 1958 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1959 | 1959 | foreach ($ways as $way) { |
1960 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1960 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
1961 | 1961 | } |
1962 | 1962 | } |
1963 | 1963 | } |
@@ -2109,7 +2109,7 @@ discard block |
||
2109 | 2109 | } else { |
2110 | 2110 | $value = ''; |
2111 | 2111 | } |
2112 | - } elseif (in_array($type, ['multipts','linestrg', 'polygon'])) { |
|
2112 | + } elseif (in_array($type, ['multipts', 'linestrg', 'polygon'])) { |
|
2113 | 2113 | if (!empty($value)) { |
2114 | 2114 | require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php'; |
2115 | 2115 | $dolgeophp = new DolGeoPHP($this->db); |
@@ -2211,12 +2211,12 @@ discard block |
||
2211 | 2211 | if ($mode == 'create') { |
2212 | 2212 | // On create mode, force separator group to not be collapsible |
2213 | 2213 | $extrafield_collapse_display_value = 1; |
2214 | - $expand_display = true; // We force group to be shown expanded |
|
2214 | + $expand_display = true; // We force group to be shown expanded |
|
2215 | 2215 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
2216 | 2216 | } |
2217 | 2217 | |
2218 | 2218 | $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
2219 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>'; |
|
2219 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
2220 | 2220 | // Some js code will be injected here to manage the collapsing of extrafields |
2221 | 2221 | // Output the picto |
2222 | 2222 | $out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>'; |
@@ -2298,7 +2298,7 @@ discard block |
||
2298 | 2298 | continue; |
2299 | 2299 | } |
2300 | 2300 | |
2301 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) { |
|
2301 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) { |
|
2302 | 2302 | //when unticking boolean field, it's not set in POST |
2303 | 2303 | continue; |
2304 | 2304 | } |
@@ -2327,7 +2327,7 @@ discard block |
||
2327 | 2327 | $onlykey === '@GETPOSTISSET' |
2328 | 2328 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
2329 | 2329 | && in_array(abs($enabled), array(2, 5)) |
2330 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
2330 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
2331 | 2331 | ) |
2332 | 2332 | ) { |
2333 | 2333 | continue; |
@@ -2464,16 +2464,16 @@ discard block |
||
2464 | 2464 | } |
2465 | 2465 | |
2466 | 2466 | if (in_array($key_type, array('date'))) { |
2467 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
2468 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
2469 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
2467 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
2468 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
2469 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
2470 | 2470 | $value_key = array(); |
2471 | 2471 | // values provided as a component year, month, day, etc. |
2472 | - if (GETPOST($dateparamname_start . 'year')) { |
|
2473 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year')); |
|
2472 | + if (GETPOST($dateparamname_start.'year')) { |
|
2473 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year')); |
|
2474 | 2474 | } |
2475 | - if (GETPOST($dateparamname_start . 'year')) { |
|
2476 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year')); |
|
2475 | + if (GETPOST($dateparamname_start.'year')) { |
|
2476 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year')); |
|
2477 | 2477 | } |
2478 | 2478 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
2479 | 2479 | // Clean parameters |
@@ -2482,23 +2482,23 @@ discard block |
||
2482 | 2482 | continue; // Value was not provided, we should not set it. |
2483 | 2483 | } |
2484 | 2484 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
2485 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
2486 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
2485 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
2486 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
2487 | 2487 | |
2488 | - if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { |
|
2488 | + if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) { |
|
2489 | 2489 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
2490 | - $dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23'; |
|
2491 | - $dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59'; |
|
2492 | - $dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59'; |
|
2490 | + $dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23'; |
|
2491 | + $dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59'; |
|
2492 | + $dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59'; |
|
2493 | 2493 | if ($key_type == 'datetimegmt') { |
2494 | 2494 | $value_key = array( |
2495 | - 'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'), |
|
2496 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt') |
|
2495 | + 'start' => dol_mktime(GETPOSTINT($dateparamname_start.'hour'), GETPOSTINT($dateparamname_start.'min'), GETPOSTINT($dateparamname_start.'sec'), GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'), |
|
2496 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt') |
|
2497 | 2497 | ); |
2498 | 2498 | } else { |
2499 | 2499 | $value_key = array( |
2500 | - 'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'), |
|
2501 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel') |
|
2500 | + 'start' => dol_mktime(GETPOSTINT($dateparamname_start.'hour'), GETPOSTINT($dateparamname_start.'min'), GETPOSTINT($dateparamname_start.'sec'), GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'), |
|
2501 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel') |
|
2502 | 2502 | ); |
2503 | 2503 | } |
2504 | 2504 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
283 | 283 | // Set path to the background PDF File |
284 | 284 | if (!getDolGlobalString('MAIN_DISABLE_FPDI') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { |
285 | - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
285 | + $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
286 | 286 | $tplidx = $pdf->importPage(1); |
287 | 287 | } |
288 | 288 | |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | // Show recipient |
1419 | 1419 | $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; |
1420 | 1420 | if ($this->page_largeur < 210) { |
1421 | - $widthrecbox = 84; // To work with US executive format |
|
1421 | + $widthrecbox = 84; // To work with US executive format |
|
1422 | 1422 | } |
1423 | 1423 | $posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; |
1424 | 1424 | $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; |