@@ -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 : '').'>'; |
@@ -1072,25 +1072,25 @@ discard block |
||
| 1072 | 1072 | } elseif (in_array($type, array('mail', 'ip', 'phone', 'url'))) { |
| 1073 | 1073 | $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; |
| 1074 | 1074 | } elseif ($type == 'icon') { |
| 1075 | - $out ='<link rel="stylesheet" href="'.dol_buildpath('/myfield/css/fontawesome-iconpicker.min.css', 1).'">'; |
|
| 1076 | - $out.='<script src="'.dol_buildpath('/myfield/js/fontawesome-iconpicker.min.js', 1).'"></script>'; |
|
| 1077 | - $out.= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"'; |
|
| 1078 | - $out.= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; |
|
| 1079 | - $out.='<script>'; |
|
| 1080 | - $options="{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {"; |
|
| 1081 | - $options.="iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',"; |
|
| 1082 | - $options.="iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',"; |
|
| 1075 | + $out = '<link rel="stylesheet" href="'.dol_buildpath('/myfield/css/fontawesome-iconpicker.min.css', 1).'">'; |
|
| 1076 | + $out .= '<script src="'.dol_buildpath('/myfield/js/fontawesome-iconpicker.min.js', 1).'"></script>'; |
|
| 1077 | + $out .= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"'; |
|
| 1078 | + $out .= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; |
|
| 1079 | + $out .= '<script>'; |
|
| 1080 | + $options = "{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {"; |
|
| 1081 | + $options .= "iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',"; |
|
| 1082 | + $options .= "iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',"; |
|
| 1083 | 1083 | // $options.="buttons: '<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm\">".$langs->trans("Cancel")."</button>"; |
| 1084 | 1084 | // $options.="<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm\">".$langs->trans("Save")."</button>',"; |
| 1085 | - $options.="footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',"; |
|
| 1086 | - $options.="search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',"; |
|
| 1087 | - $options.="popover: '<div class=\"iconpicker-popover popover\">"; |
|
| 1088 | - $options.=" <div class=\"arrow\" ></div>"; |
|
| 1089 | - $options.=" <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>"; |
|
| 1090 | - $options.=" <div class=\"popover-content \" ></div>"; |
|
| 1091 | - $options.="</div>'}}"; |
|
| 1092 | - $out.="$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");"; |
|
| 1093 | - $out.='</script>'; |
|
| 1085 | + $options .= "footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',"; |
|
| 1086 | + $options .= "search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',"; |
|
| 1087 | + $options .= "popover: '<div class=\"iconpicker-popover popover\">"; |
|
| 1088 | + $options .= " <div class=\"arrow\" ></div>"; |
|
| 1089 | + $options .= " <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>"; |
|
| 1090 | + $options .= " <div class=\"popover-content \" ></div>"; |
|
| 1091 | + $options .= "</div>'}}"; |
|
| 1092 | + $out .= "$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");"; |
|
| 1093 | + $out .= '</script>'; |
|
| 1094 | 1094 | } elseif ($type == 'text') { |
| 1095 | 1095 | if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field |
| 1096 | 1096 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
@@ -1620,7 +1620,7 @@ discard block |
||
| 1620 | 1620 | |
| 1621 | 1621 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
| 1622 | 1622 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
| 1623 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1623 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1624 | 1624 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
| 1625 | 1625 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
| 1626 | 1626 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1642,7 +1642,7 @@ discard block |
||
| 1642 | 1642 | if ($type == 'date') { |
| 1643 | 1643 | $showsize = 10; |
| 1644 | 1644 | if ($value !== '') { |
| 1645 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1645 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1646 | 1646 | } |
| 1647 | 1647 | } elseif ($type == 'datetime') { |
| 1648 | 1648 | $showsize = 19; |
@@ -1786,13 +1786,13 @@ discard block |
||
| 1786 | 1786 | $toprint = array(); |
| 1787 | 1787 | $obj = $this->db->fetch_object($resql); |
| 1788 | 1788 | if ($obj->rowid) { |
| 1789 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1789 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1790 | 1790 | $c = new Categorie($this->db); |
| 1791 | 1791 | $result = $c->fetch($obj->rowid); |
| 1792 | 1792 | if ($result > 0) { |
| 1793 | 1793 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1794 | 1794 | foreach ($ways as $way) { |
| 1795 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1795 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1796 | 1796 | } |
| 1797 | 1797 | } |
| 1798 | 1798 | } |
@@ -2004,13 +2004,13 @@ discard block |
||
| 2004 | 2004 | { |
| 2005 | 2005 | global $conf, $langs; |
| 2006 | 2006 | |
| 2007 | - $tagtype='tr'; |
|
| 2008 | - $tagtype_dyn='td'; |
|
| 2007 | + $tagtype = 'tr'; |
|
| 2008 | + $tagtype_dyn = 'td'; |
|
| 2009 | 2009 | |
| 2010 | - if ($display_type=='line') { |
|
| 2011 | - $tagtype='div'; |
|
| 2012 | - $tagtype_dyn='span'; |
|
| 2013 | - $colspan=0; |
|
| 2010 | + if ($display_type == 'line') { |
|
| 2011 | + $tagtype = 'div'; |
|
| 2012 | + $tagtype_dyn = 'span'; |
|
| 2013 | + $colspan = 0; |
|
| 2014 | 2014 | } |
| 2015 | 2015 | |
| 2016 | 2016 | $extrafield_param = $this->attributes[$object->table_element]['param'][$key]; |
@@ -2030,12 +2030,12 @@ discard block |
||
| 2030 | 2030 | if ($mode == 'create') { |
| 2031 | 2031 | // On create mode, force separator group to not be collapsable |
| 2032 | 2032 | $extrafield_collapse_display_value = 1; |
| 2033 | - $expand_display = true; // We force group to be shown expanded |
|
| 2033 | + $expand_display = true; // We force group to be shown expanded |
|
| 2034 | 2034 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
| 2035 | 2035 | } |
| 2036 | 2036 | |
| 2037 | - $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">'; |
|
| 2038 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>'; |
|
| 2037 | + $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
|
| 2038 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
| 2039 | 2039 | // Some js code will be injected here to manage the collapsing of extrafields |
| 2040 | 2040 | // Output the picto |
| 2041 | 2041 | $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>'; |
@@ -2066,14 +2066,14 @@ discard block |
||
| 2066 | 2066 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
| 2067 | 2067 | } |
| 2068 | 2068 | } |
| 2069 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n"; |
|
| 2069 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n"; |
|
| 2070 | 2070 | $out .= ' console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n"; |
| 2071 | 2071 | $out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n"; |
| 2072 | 2072 | $out .= ' if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n"; |
| 2073 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
| 2073 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
| 2074 | 2074 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
| 2075 | 2075 | $out .= ' } else {'."\n"; |
| 2076 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
| 2076 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
| 2077 | 2077 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
| 2078 | 2078 | $out .= ' }'."\n"; |
| 2079 | 2079 | $out .= ' });'."\n"; |
@@ -2117,7 +2117,7 @@ discard block |
||
| 2117 | 2117 | continue; |
| 2118 | 2118 | } |
| 2119 | 2119 | |
| 2120 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
| 2120 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
| 2121 | 2121 | //when unticking boolean field, it's not set in POST |
| 2122 | 2122 | continue; |
| 2123 | 2123 | } |
@@ -2146,7 +2146,7 @@ discard block |
||
| 2146 | 2146 | $onlykey === '@GETPOSTISSET' |
| 2147 | 2147 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
| 2148 | 2148 | && in_array(abs($enabled), array(2, 5)) |
| 2149 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2149 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2150 | 2150 | ) |
| 2151 | 2151 | ) { |
| 2152 | 2152 | continue; |
@@ -2273,16 +2273,16 @@ discard block |
||
| 2273 | 2273 | } |
| 2274 | 2274 | |
| 2275 | 2275 | if (in_array($key_type, array('date'))) { |
| 2276 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
| 2277 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
| 2278 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
| 2276 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
| 2277 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
| 2278 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
| 2279 | 2279 | $value_key = array(); |
| 2280 | 2280 | // values provided as a component year, month, day, etc. |
| 2281 | - if (GETPOST($dateparamname_start . 'year')) { |
|
| 2282 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); |
|
| 2281 | + if (GETPOST($dateparamname_start.'year')) { |
|
| 2282 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int')); |
|
| 2283 | 2283 | } |
| 2284 | - if (GETPOST($dateparamname_start . 'year')) { |
|
| 2285 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); |
|
| 2284 | + if (GETPOST($dateparamname_start.'year')) { |
|
| 2285 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int')); |
|
| 2286 | 2286 | } |
| 2287 | 2287 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
| 2288 | 2288 | // Clean parameters |
@@ -2291,22 +2291,22 @@ discard block |
||
| 2291 | 2291 | continue; // Value was not provided, we should not set it. |
| 2292 | 2292 | } |
| 2293 | 2293 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
| 2294 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
| 2295 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
| 2296 | - if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { |
|
| 2294 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
| 2295 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
| 2296 | + if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) { |
|
| 2297 | 2297 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
| 2298 | - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; |
|
| 2299 | - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; |
|
| 2300 | - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; |
|
| 2298 | + $dateparamname_end_hour = GETPOST($dateparamname_end.'hour', 'int') != '-1' ? GETPOST($dateparamname_end.'hour', 'int') : '23'; |
|
| 2299 | + $dateparamname_end_min = GETPOST($dateparamname_end.'min', 'int') != '-1' ? GETPOST($dateparamname_end.'min', 'int') : '59'; |
|
| 2300 | + $dateparamname_end_sec = GETPOST($dateparamname_end.'sec', 'int') != '-1' ? GETPOST($dateparamname_end.'sec', 'int') : '59'; |
|
| 2301 | 2301 | if ($key_type == 'datetimegmt') { |
| 2302 | 2302 | $value_key = array( |
| 2303 | - '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'), |
|
| 2304 | - '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') |
|
| 2303 | + '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'), |
|
| 2304 | + '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') |
|
| 2305 | 2305 | ); |
| 2306 | 2306 | } else { |
| 2307 | 2307 | $value_key = array( |
| 2308 | - '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'), |
|
| 2309 | - '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') |
|
| 2308 | + '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'), |
|
| 2309 | + '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') |
|
| 2310 | 2310 | ); |
| 2311 | 2311 | } |
| 2312 | 2312 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
@@ -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>'; |
@@ -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) { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $maxfilesizearray = getMaxFileSizeArray(); |
| 182 | 182 | $maxmin = $maxfilesizearray['maxmin']; |
| 183 | 183 | if ($maxmin > 0) { |
| 184 | - $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 184 | + $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 185 | 185 | } |
| 186 | 186 | $texte .= ' <input type="file" name="uploadfile">'; |
| 187 | 187 | $texte .= '<input type="hidden" value="PRODUCT_ADDON_PDF_ODT_PATH" name="keyforuploaddir">'; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
| 279 | 279 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
| 280 | 280 | |
| 281 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
| 281 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
| 282 | 282 | |
| 283 | 283 | // Get extension (ods or odt) |
| 284 | 284 | $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); |
@@ -287,11 +287,11 @@ discard block |
||
| 287 | 287 | if ($format == '1') { |
| 288 | 288 | $format = '%Y%m%d%H%M%S'; |
| 289 | 289 | } |
| 290 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
| 290 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
| 291 | 291 | } else { |
| 292 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
| 292 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
| 293 | 293 | } |
| 294 | - $file = $dir . '/' . $filename; |
|
| 294 | + $file = $dir.'/'.$filename; |
|
| 295 | 295 | //print "newdir=".$dir; |
| 296 | 296 | //print "newfile=".$newfile; |
| 297 | 297 | //print "file=".$file; |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | dol_mkdir($conf->product->dir_temp); |
| 301 | 301 | if (!is_writable($conf->product->dir_temp)) { |
| 302 | 302 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->product->dir_temp); |
| 303 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
| 303 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
| 304 | 304 | return -1; |
| 305 | 305 | } |
| 306 | 306 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
| 298 | 298 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
| 299 | 299 | |
| 300 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
| 300 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
| 301 | 301 | |
| 302 | 302 | // Get extension (ods or odt) |
| 303 | 303 | $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); |
@@ -306,11 +306,11 @@ discard block |
||
| 306 | 306 | if ($format == '1') { |
| 307 | 307 | $format = '%Y%m%d%H%M%S'; |
| 308 | 308 | } |
| 309 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
| 309 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
| 310 | 310 | } else { |
| 311 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
| 311 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
| 312 | 312 | } |
| 313 | - $file = $dir . '/' . $filename; |
|
| 313 | + $file = $dir.'/'.$filename; |
|
| 314 | 314 | //print "newdir=".$dir; |
| 315 | 315 | //print "newfile=".$newfile; |
| 316 | 316 | //print "file=".$file; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | dol_mkdir($conf->supplier_proposal->dir_temp); |
| 320 | 320 | if (!is_writable($conf->supplier_proposal->dir_temp)) { |
| 321 | 321 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->supplier_proposal->dir_temp); |
| 322 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
| 322 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
| 323 | 323 | return -1; |
| 324 | 324 | } |
| 325 | 325 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $maxfilesizearray = getMaxFileSizeArray(); |
| 174 | 174 | $maxmin = $maxfilesizearray['maxmin']; |
| 175 | 175 | if ($maxmin > 0) { |
| 176 | - $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 176 | + $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 177 | 177 | } |
| 178 | 178 | $texte .= ' <input type="file" name="uploadfile">'; |
| 179 | 179 | $texte .= '<input type="hidden" value="MEMBER_ADDON_PDF_ODT_PATH" name="keyforuploaddir">'; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
| 269 | 269 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
| 270 | 270 | |
| 271 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
| 271 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
| 272 | 272 | |
| 273 | 273 | // Get extension (ods or odt) |
| 274 | 274 | $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); |
@@ -277,11 +277,11 @@ discard block |
||
| 277 | 277 | if ($format == '1') { |
| 278 | 278 | $format = '%Y%m%d%H%M%S'; |
| 279 | 279 | } |
| 280 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
| 280 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
| 281 | 281 | } else { |
| 282 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
| 282 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
| 283 | 283 | } |
| 284 | - $file = $dir . '/' . $filename; |
|
| 284 | + $file = $dir.'/'.$filename; |
|
| 285 | 285 | //print "newdir=".$dir; |
| 286 | 286 | //print "newfile=".$newfile; |
| 287 | 287 | //print "file=".$file; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | dol_mkdir($conf->adherent->dir_temp); |
| 291 | 291 | if (!is_writable($conf->adherent->dir_temp)) { |
| 292 | 292 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->adherent->dir_temp); |
| 293 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
| 293 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
| 294 | 294 | return -1; |
| 295 | 295 | } |
| 296 | 296 | |