@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $actionType = 'delete'; |
63 | 63 | $n++; |
64 | 64 | $id = 'mybuttonid'.$n; |
65 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
65 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
66 | 66 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
67 | 67 | |
68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $actionType = 'danger'; |
71 | 71 | $n++; |
72 | 72 | $id = 'mybuttonid'.$n; |
73 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
73 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
74 | 74 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
75 | 75 | |
76 | 76 | ?> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $actionType = 'delete'; |
96 | 96 | $n++; |
97 | 97 | $id = 'mybuttonid'.$n; |
98 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
98 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
99 | 99 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
100 | 100 | |
101 | 101 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $actionType = 'danger'; |
104 | 104 | $n++; |
105 | 105 | $id = 'mybuttonid'.$n; |
106 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
106 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
107 | 107 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
108 | 108 | |
109 | 109 | ?> |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $actionType = 'delete'; |
135 | 135 | $n++; |
136 | 136 | $id = 'mybuttonid'.$n; |
137 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
137 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
138 | 138 | |
139 | 139 | $params = array( |
140 | 140 | 'confirm' => array( |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $actionType = 'delete'; |
174 | 174 | $n++; |
175 | 175 | $id = 'mybuttonid'.$n; |
176 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
176 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
177 | 177 | |
178 | 178 | $params = array( |
179 | 179 | 'confirm' => array( |
@@ -1860,7 +1860,9 @@ |
||
1860 | 1860 | } |
1861 | 1861 | } |
1862 | 1862 | } |
1863 | - if (!empty($toprint)) $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
1863 | + if (!empty($toprint)) { |
|
1864 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
1865 | + } |
|
1864 | 1866 | } else { |
1865 | 1867 | dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING); |
1866 | 1868 | } |
@@ -1027,9 +1027,9 @@ discard block |
||
1027 | 1027 | // search filter on a date extrafield shows two inputs to select a date range |
1028 | 1028 | $prefill = array( |
1029 | 1029 | 'start' => isset($value['start']) ? $value['start'] : '', |
1030 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
1030 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
1031 | 1031 | ); |
1032 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1032 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1033 | 1033 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
1034 | 1034 | $out .= '</div><div class="nowrap">'; |
1035 | 1035 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1052,9 +1052,9 @@ discard block |
||
1052 | 1052 | // search filter on a date extrafield shows two inputs to select a date range |
1053 | 1053 | $prefill = array( |
1054 | 1054 | 'start' => isset($value['start']) ? $value['start'] : '', |
1055 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
1055 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
1056 | 1056 | ); |
1057 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1057 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1058 | 1058 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
1059 | 1059 | $out .= '</div><div class="nowrap">'; |
1060 | 1060 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | // TODO Must also support $moreparam |
1064 | 1064 | $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel'); |
1065 | 1065 | } |
1066 | - } elseif (in_array($type, array('int', 'integer'))) { |
|
1066 | + } elseif (in_array($type, array('int', 'integer'))) { |
|
1067 | 1067 | $tmp = explode(',', $size); |
1068 | 1068 | $newsize = $tmp[0]; |
1069 | 1069 | $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>'; |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | |
1599 | 1599 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
1600 | 1600 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
1601 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1601 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1602 | 1602 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
1603 | 1603 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
1604 | 1604 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1620,7 +1620,7 @@ discard block |
||
1620 | 1620 | if ($type == 'date') { |
1621 | 1621 | $showsize = 10; |
1622 | 1622 | if ($value !== '') { |
1623 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1623 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1624 | 1624 | } |
1625 | 1625 | } elseif ($type == 'datetime') { |
1626 | 1626 | $showsize = 19; |
@@ -1762,13 +1762,13 @@ discard block |
||
1762 | 1762 | $toprint = array(); |
1763 | 1763 | $obj = $this->db->fetch_object($resql); |
1764 | 1764 | if ($obj->rowid) { |
1765 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1765 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1766 | 1766 | $c = new Categorie($this->db); |
1767 | 1767 | $result = $c->fetch($obj->rowid); |
1768 | 1768 | if ($result > 0) { |
1769 | 1769 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1770 | 1770 | foreach ($ways as $way) { |
1771 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1771 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
1772 | 1772 | } |
1773 | 1773 | } |
1774 | 1774 | } |
@@ -1980,13 +1980,13 @@ discard block |
||
1980 | 1980 | { |
1981 | 1981 | global $conf, $langs; |
1982 | 1982 | |
1983 | - $tagtype='tr'; |
|
1984 | - $tagtype_dyn='td'; |
|
1983 | + $tagtype = 'tr'; |
|
1984 | + $tagtype_dyn = 'td'; |
|
1985 | 1985 | |
1986 | - if ($display_type=='line') { |
|
1987 | - $tagtype='div'; |
|
1988 | - $tagtype_dyn='span'; |
|
1989 | - $colspan=0; |
|
1986 | + if ($display_type == 'line') { |
|
1987 | + $tagtype = 'div'; |
|
1988 | + $tagtype_dyn = 'span'; |
|
1989 | + $colspan = 0; |
|
1990 | 1990 | } |
1991 | 1991 | |
1992 | 1992 | $extrafield_param = $this->attributes[$object->table_element]['param'][$key]; |
@@ -2006,12 +2006,12 @@ discard block |
||
2006 | 2006 | if ($mode == 'create') { |
2007 | 2007 | // On create mode, force separator group to not be collapsable |
2008 | 2008 | $extrafield_collapse_display_value = 1; |
2009 | - $expand_display = true; // We force group to be shown expanded |
|
2009 | + $expand_display = true; // We force group to be shown expanded |
|
2010 | 2010 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
2011 | 2011 | } |
2012 | 2012 | |
2013 | - $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">'; |
|
2014 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>'; |
|
2013 | + $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
|
2014 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
2015 | 2015 | // Some js code will be injected here to manage the collapsing of extrafields |
2016 | 2016 | // Output the picto |
2017 | 2017 | $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>'; |
@@ -2042,14 +2042,14 @@ discard block |
||
2042 | 2042 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2043 | 2043 | } |
2044 | 2044 | } |
2045 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n"; |
|
2045 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n"; |
|
2046 | 2046 | $out .= ' console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n"; |
2047 | 2047 | $out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n"; |
2048 | 2048 | $out .= ' if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n"; |
2049 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
2049 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
2050 | 2050 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2051 | 2051 | $out .= ' } else {'."\n"; |
2052 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
2052 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
2053 | 2053 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2054 | 2054 | $out .= ' }'."\n"; |
2055 | 2055 | $out .= ' });'."\n"; |
@@ -2093,7 +2093,7 @@ discard block |
||
2093 | 2093 | continue; |
2094 | 2094 | } |
2095 | 2095 | |
2096 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
2096 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
2097 | 2097 | //when unticking boolean field, it's not set in POST |
2098 | 2098 | continue; |
2099 | 2099 | } |
@@ -2122,7 +2122,7 @@ discard block |
||
2122 | 2122 | $onlykey === '@GETPOSTISSET' |
2123 | 2123 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
2124 | 2124 | && in_array(abs($enabled), array(2, 5)) |
2125 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
2125 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
2126 | 2126 | ) |
2127 | 2127 | ) { |
2128 | 2128 | continue; |
@@ -2250,16 +2250,16 @@ discard block |
||
2250 | 2250 | } |
2251 | 2251 | |
2252 | 2252 | if (in_array($key_type, array('date'))) { |
2253 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
2254 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
2255 | - if (GETPOSTISSET($dateparamname_start . 'year') || GETPOSTISSET($dateparamname_end . 'year')) { |
|
2253 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
2254 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
2255 | + if (GETPOSTISSET($dateparamname_start.'year') || GETPOSTISSET($dateparamname_end.'year')) { |
|
2256 | 2256 | $value_key = array(); |
2257 | 2257 | // values provided as a component year, month, day, etc. |
2258 | - if (GETPOSTISSET($dateparamname_start . 'year')) { |
|
2259 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); |
|
2258 | + if (GETPOSTISSET($dateparamname_start.'year')) { |
|
2259 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int')); |
|
2260 | 2260 | } |
2261 | - if (GETPOSTISSET($dateparamname_start . 'year')) { |
|
2262 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); |
|
2261 | + if (GETPOSTISSET($dateparamname_start.'year')) { |
|
2262 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int')); |
|
2263 | 2263 | } |
2264 | 2264 | } elseif (GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) { |
2265 | 2265 | // Clean parameters |
@@ -2268,22 +2268,22 @@ discard block |
||
2268 | 2268 | continue; // Value was not provided, we should not set it. |
2269 | 2269 | } |
2270 | 2270 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
2271 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
2272 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
2273 | - if (GETPOSTISSET($dateparamname_start . 'year') && GETPOSTISSET($dateparamname_end . 'year')) { |
|
2271 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
2272 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
2273 | + if (GETPOSTISSET($dateparamname_start.'year') && GETPOSTISSET($dateparamname_end.'year')) { |
|
2274 | 2274 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
2275 | - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; |
|
2276 | - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; |
|
2277 | - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; |
|
2275 | + $dateparamname_end_hour = GETPOST($dateparamname_end.'hour', 'int') != '-1' ? GETPOST($dateparamname_end.'hour', 'int') : '23'; |
|
2276 | + $dateparamname_end_min = GETPOST($dateparamname_end.'min', 'int') != '-1' ? GETPOST($dateparamname_end.'min', 'int') : '59'; |
|
2277 | + $dateparamname_end_sec = GETPOST($dateparamname_end.'sec', 'int') != '-1' ? GETPOST($dateparamname_end.'sec', 'int') : '59'; |
|
2278 | 2278 | if ($key_type == 'datetimegmt') { |
2279 | 2279 | $value_key = array( |
2280 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'), |
|
2281 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'gmt') |
|
2280 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'gmt'), |
|
2281 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'gmt') |
|
2282 | 2282 | ); |
2283 | 2283 | } else { |
2284 | 2284 | $value_key = array( |
2285 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'), |
|
2286 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel') |
|
2285 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'tzuserrel'), |
|
2286 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'tzuserrel') |
|
2287 | 2287 | ); |
2288 | 2288 | } |
2289 | 2289 | } elseif (GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) { |
@@ -220,7 +220,7 @@ |
||
220 | 220 | // Clean data |
221 | 221 | // $this->partnership->abc = sanitizeVal($this->partnership->abc, 'alphanohtml'); |
222 | 222 | |
223 | - if ($this->partnership->create(DolibarrApiAccess::$user)<0) { |
|
223 | + if ($this->partnership->create(DolibarrApiAccess::$user) < 0) { |
|
224 | 224 | throw new RestException(500, "Error creating Partnership", array_merge(array($this->partnership->error), $this->partnership->errors)); |
225 | 225 | } |
226 | 226 | return $this->partnership->id; |
@@ -328,7 +328,7 @@ |
||
328 | 328 | |
329 | 329 | foreach ($arrayofvat[$key] as $k => $mt) { |
330 | 330 | if ($mt) { |
331 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
331 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
332 | 332 | $account_label = $accountingaccount->label; |
333 | 333 | |
334 | 334 | // get compte id and label |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $error = 0; |
47 | 47 | $connect_id = null; |
48 | 48 | $newsectioniso = ''; |
49 | - $mesg=""; |
|
49 | + $mesg = ""; |
|
50 | 50 | |
51 | 51 | if (!is_numeric($ftp_port)) { |
52 | 52 | $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServer", $ftp_server, $ftp_port); |
@@ -191,7 +191,7 @@ |
||
191 | 191 | } |
192 | 192 | |
193 | 193 | $out = ''; |
194 | - $out .= '<select id="select'.$htmlname.'" class="selectSampleOfContainer'.($morecss? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
194 | + $out .= '<select id="select'.$htmlname.'" class="selectSampleOfContainer'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
195 | 195 | |
196 | 196 | if ($useempty == 1 || $useempty == 2) { |
197 | 197 | $out .= '<option value="-1"> </option>'; |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | global $conf; |
283 | 283 | |
284 | 284 | $sql = "SELECT rowid, fk_product_parent, fk_product_child, variation_price, variation_price_percentage, variation_ref_ext, variation_weight"; |
285 | - $sql.= " FROM ".MAIN_DB_PREFIX."product_attribute_combination"; |
|
286 | - $sql.= " WHERE fk_product_parent = ".((int) $fk_product_parent)." AND entity IN (".getEntity('product').")"; |
|
285 | + $sql .= " FROM ".MAIN_DB_PREFIX."product_attribute_combination"; |
|
286 | + $sql .= " WHERE fk_product_parent = ".((int) $fk_product_parent)." AND entity IN (".getEntity('product').")"; |
|
287 | 287 | |
288 | 288 | $query = $this->db->query($sql); |
289 | 289 | |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | $prodcomb2val = new ProductCombination2ValuePair($this->db); |
611 | 611 | $prodcomb = new ProductCombination($this->db); |
612 | 612 | |
613 | - $features = array_filter($features, function ($v) { |
|
613 | + $features = array_filter($features, function($v) { |
|
614 | 614 | return !empty($v); |
615 | 615 | }); |
616 | 616 |
@@ -93,7 +93,7 @@ |
||
93 | 93 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetcard'; // To manage different context of search |
94 | 94 | $backtopage = GETPOST('backtopage', 'alpha'); |
95 | 95 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
96 | -$lineid = GETPOST('lineid', 'int'); |
|
96 | +$lineid = GETPOST('lineid', 'int'); |
|
97 | 97 | |
98 | 98 | // Initialize technical objects |
99 | 99 | $object = new Target($db); |
@@ -95,8 +95,12 @@ discard block |
||
95 | 95 | //if ($user->socid > 0) $socid = $user->socid; |
96 | 96 | //$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
97 | 97 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
98 | -if (empty($conf->webhook->enabled)) accessforbidden(); |
|
99 | -if (!$permissiontoread) accessforbidden(); |
|
98 | +if (empty($conf->webhook->enabled)) { |
|
99 | + accessforbidden(); |
|
100 | +} |
|
101 | +if (!$permissiontoread) { |
|
102 | + accessforbidden(); |
|
103 | +} |
|
100 | 104 | |
101 | 105 | |
102 | 106 | /* |
@@ -433,8 +437,9 @@ discard block |
||
433 | 437 | if ($reshook < 0) { |
434 | 438 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
435 | 439 | } |
436 | - if (empty($reshook)) |
|
437 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
440 | + if (empty($reshook)) { |
|
441 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
442 | + } |
|
438 | 443 | } |
439 | 444 | } |
440 | 445 |
@@ -1079,8 +1079,8 @@ discard block |
||
1079 | 1079 | $stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport); |
1080 | 1080 | $stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport); |
1081 | 1081 | $stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport); |
1082 | - $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1083 | - $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1082 | + $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1083 | + $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1084 | 1084 | $stringtoexport = str_replace('"js/'.$website->ref.'/', '"js/__WEBSITE_KEY__/', $stringtoexport); |
1085 | 1085 | $stringtoexport = str_replace('"/js/'.$website->ref.'/', '"/js/__WEBSITE_KEY__/', $stringtoexport); |
1086 | 1086 | |
@@ -1351,7 +1351,7 @@ discard block |
||
1351 | 1351 | foreach ($aliasesarray as $aliasshortcuttocreate) { |
1352 | 1352 | if (trim($aliasshortcuttocreate)) { |
1353 | 1353 | $filealias = $conf->website->dir_output.'/'.$object->ref.'/'.trim($aliasshortcuttocreate).'.php'; |
1354 | - $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1354 | + $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1355 | 1355 | if (!$result) { |
1356 | 1356 | $this->errors[] = 'Failed to write file '.basename($filealias); |
1357 | 1357 | $error++; |
@@ -1372,7 +1372,7 @@ discard block |
||
1372 | 1372 | $filetpl = $pathofwebsite.'/page'.$object->fk_default_home.'.tpl.php'; |
1373 | 1373 | } |
1374 | 1374 | $filewrapper = $pathofwebsite.'/wrapper.php'; |
1375 | - dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1375 | + dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1376 | 1376 | } |
1377 | 1377 | |
1378 | 1378 | if ($error) { |