@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | |
420 | 420 | $res = 1; |
421 | 421 | if (!is_object($line->product)) { |
422 | - $res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod() |
|
422 | + $res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod() |
|
423 | 423 | } |
424 | 424 | if ($res > 0) { |
425 | 425 | if ($line->product->isMandatoryPeriod() && $line->product->isService()) { |
@@ -437,11 +437,11 @@ discard block |
||
437 | 437 | |
438 | 438 | $res = 1; |
439 | 439 | if (!is_object($line->product)) { |
440 | - $res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod() |
|
440 | + $res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod() |
|
441 | 441 | } |
442 | - if ($res > 0) { |
|
442 | + if ($res > 0) { |
|
443 | 443 | if ($line->product->isMandatoryperiod() && $line->product->isService()) { |
444 | - print 'jQuery("#date_end").addClass("inputmandatory");'; // Do not add tag "required", this block the cancel action when value not set |
|
444 | + print 'jQuery("#date_end").addClass("inputmandatory");'; // Do not add tag "required", this block the cancel action when value not set |
|
445 | 445 | } |
446 | 446 | } |
447 | 447 | } |
@@ -34,11 +34,10 @@ discard block |
||
34 | 34 | } |
35 | 35 | $value = $datenotinstring; |
36 | 36 | } elseif (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('int'))) { |
37 | - $value = (!empty($obj->$tmpkey) || $obj->$tmpkey === '0' ? $obj->$tmpkey : ''); |
|
37 | + $value = (!empty($obj->$tmpkey) || $obj->$tmpkey === '0' ? $obj->$tmpkey : ''); |
|
38 | 38 | } else { |
39 | 39 | // The key may be in $obj->array_options if not in $obj |
40 | - $value = (isset($obj->$tmpkey) ? $obj->$tmpkey : |
|
41 | - (isset($obj->array_options[$tmpkey]) ? $obj->array_options[$tmpkey] : '') ); |
|
40 | + $value = (isset($obj->$tmpkey) ? $obj->$tmpkey : (isset($obj->array_options[$tmpkey]) ? $obj->array_options[$tmpkey] : '')); |
|
42 | 41 | } |
43 | 42 | // If field is a computed field, we make computation to get value |
44 | 43 | if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { |
@@ -52,7 +51,7 @@ discard block |
||
52 | 51 | $valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); |
53 | 52 | $title = dol_string_nohtmltag($valuetoshow); |
54 | 53 | |
55 | - print '<td' . ($cssclass ? ' class="' . $cssclass . '"' : ''); // TODO Add 'css' and 'cssview' and 'csslist' for extrafields and use here 'csslist' |
|
54 | + print '<td' . ($cssclass ? ' class="' . $cssclass . '"' : ''); // TODO Add 'css' and 'cssview' and 'csslist' for extrafields and use here 'csslist' |
|
56 | 55 | print ' data-key="' . $extrafieldsobjectkey . '.' . $key . '"'; |
57 | 56 | print($title ? ' title="' . dol_escape_htmltag($title) . '"' : ''); |
58 | 57 | print '>'; |
@@ -399,7 +399,7 @@ |
||
399 | 399 | ?> |
400 | 400 | <div class="center login_main_message"> |
401 | 401 | <?php |
402 | - $message = $_SESSION['dol_loginmesg']; // By default this is an error message |
|
402 | + $message = $_SESSION['dol_loginmesg']; // By default this is an error message |
|
403 | 403 | if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message |
404 | 404 | $message = str_replace('<!-- warning -->', '', $message); |
405 | 405 | print '<div class="warning" role="alert">'; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $result = $objecttmp->fetch($toselectid); |
190 | 190 | if ($result > 0) { |
191 | 191 | $listofselectedid[$toselectid] = $toselectid; |
192 | - $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ... |
|
192 | + $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ... |
|
193 | 193 | if (in_array($objecttmp->element, array('societe', 'conferenceorboothattendee'))) { |
194 | 194 | $thirdpartyid = $objecttmp->id; |
195 | 195 | } elseif ($objecttmp->element == 'contact') { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $formmail->withfile = 0; |
271 | 271 | $formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document" |
272 | 272 | } else { |
273 | - $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action |
|
273 | + $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action |
|
274 | 274 | // Add a checkbox "Attach also main document" |
275 | 275 | if (isset($withmaindocfilemail)) { |
276 | 276 | $formmail->withmaindocfile = $withmaindocfilemail; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | |
308 | 308 | // Tableau des parameters complementaires du post |
309 | 309 | $formmail->param['action'] = $action; |
310 | - $formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested. |
|
310 | + $formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested. |
|
311 | 311 | $formmail->param['models_id'] = GETPOSTINT('modelmailselected') ? GETPOSTINT('modelmailselected') : '-1'; |
312 | 312 | $formmail->param['id'] = implode(',', $arrayofselected); |
313 | 313 | // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; |
@@ -50,7 +50,7 @@ |
||
50 | 50 | case 'sellist': |
51 | 51 | $tmp = ''; |
52 | 52 | $tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null |
53 | - if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) { |
|
53 | + if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) { |
|
54 | 54 | $tmpkeys = array_keys($tmpparam['options']); |
55 | 55 | $tmp = array_shift($tmpkeys); |
56 | 56 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $title = $langs->trans("Search"); |
104 | 104 | |
105 | 105 | // URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests |
106 | -$head = '<!-- Quick access -->' . "\n"; // This is used by DoliDroid to know page is a search page |
|
106 | +$head = '<!-- Quick access -->' . "\n"; // This is used by DoliDroid to know page is a search page |
|
107 | 107 | $arrayofjs = array(); |
108 | 108 | $arrayofcss = array(); |
109 | 109 | top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $accesskey = ''; |
145 | 145 | if (empty($accesskeyalreadyassigned[$val['label'][0]])) { |
146 | - $accesskey = $val['label'][0]; // First char of string |
|
146 | + $accesskey = $val['label'][0]; // First char of string |
|
147 | 147 | $accesskeyalreadyassigned[$accesskey] = $accesskey; |
148 | 148 | } |
149 | 149 |
@@ -97,7 +97,7 @@ |
||
97 | 97 | $title = $langs->trans("Menu"); |
98 | 98 | |
99 | 99 | // URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests |
100 | -$head = '<!-- Menu -->' . "\n"; // This is used by DoliDroid to know page is a menu page |
|
100 | +$head = '<!-- Menu -->' . "\n"; // This is used by DoliDroid to know page is a menu page |
|
101 | 101 | $arrayofjs = array(); |
102 | 102 | $arrayofcss = array(); |
103 | 103 | top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); |
@@ -596,7 +596,7 @@ |
||
596 | 596 | $idprod = GETPOSTINT('idprod'); |
597 | 597 | } |
598 | 598 | |
599 | - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
599 | + $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' |
|
600 | 600 | |
601 | 601 | $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); |
602 | 602 | $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $search_date_endday = GETPOSTINT('search_date_endday'); |
81 | 81 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
82 | 82 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
83 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
83 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
84 | 84 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
85 | 85 | $search_date_valid_startday = GETPOSTINT('search_date_valid_startday'); |
86 | 86 | $search_date_valid_startmonth = GETPOSTINT('search_date_valid_startmonth'); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $search_date_valid_endday = GETPOSTINT('search_date_valid_endday'); |
89 | 89 | $search_date_valid_endmonth = GETPOSTINT('search_date_valid_endmonth'); |
90 | 90 | $search_date_valid_endyear = GETPOSTINT('search_date_valid_endyear'); |
91 | -$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
91 | +$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
92 | 92 | $search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear); |
93 | 93 | $search_type_thirdparty = GETPOST("search_type_thirdparty", 'intcomma'); |
94 | 94 | $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | $object->fields = dol_sort_array($object->fields, 'position'); |
200 | 200 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
201 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
201 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
202 | 202 | |
203 | 203 | if (!$user->hasRight('societe', 'client', 'voir')) { |
204 | 204 | $search_sale = $user->id; |