@@ -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; |
@@ -37,12 +37,12 @@ |
||
37 | 37 | /** |
38 | 38 | * @var string Id to identify managed objects |
39 | 39 | */ |
40 | - public $element = 'undefined'; // Will be defined into constructor |
|
40 | + public $element = 'undefined'; // Will be defined into constructor |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @var string Name of table without prefix where object is stored |
44 | 44 | */ |
45 | - public $table_element = 'undefined'; // Will be defined into constructor |
|
45 | + public $table_element = 'undefined'; // Will be defined into constructor |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @var CtyperesourceLine[] Lines |
@@ -158,7 +158,7 @@ |
||
158 | 158 | $maxphptoshow = $maxfilesizearray['maxphptoshow']; |
159 | 159 | $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; |
160 | 160 | if ($maxmin > 0) { |
161 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
161 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
162 | 162 | } |
163 | 163 | $out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"'; |
164 | 164 | $out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple'); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | // $type = "GIF" | "JPEG" |
137 | 137 | //$this->properties["PHOTO;MEDIATYPE=$type;ENCODING=BASE64"] = base64_encode($photo); |
138 | - $this->properties["PHOTO;MEDIATYPE=$type"] = $photo; // must be url of photo |
|
138 | + $this->properties["PHOTO;MEDIATYPE=$type"] = $photo; // must be url of photo |
|
139 | 139 | //$this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo); // must be content of image |
140 | 140 | } |
141 | 141 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | public function getVCard() |
360 | 360 | { |
361 | 361 | $text = "BEGIN:VCARD\r\n"; |
362 | - $text .= "VERSION:4.0\r\n"; // With V4, all encoding are UTF-8 |
|
362 | + $text .= "VERSION:4.0\r\n"; // With V4, all encoding are UTF-8 |
|
363 | 363 | //$text.= "VERSION:2.1\r\n"; |
364 | 364 | foreach ($this->properties as $key => $value) { |
365 | 365 | $newkey = preg_replace('/-.*$/', '', $key); // remove suffix -twitter, -facebook, ... |
@@ -886,7 +886,7 @@ |
||
886 | 886 | $maxfilesizearray = getMaxFileSizeArray(); |
887 | 887 | $maxmin = $maxfilesizearray['maxmin']; |
888 | 888 | if ($maxmin > 0) { |
889 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
889 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
890 | 890 | } |
891 | 891 | // Can add other files |
892 | 892 | if (!getDolGlobalString('FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE')) { |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | } else { |
1240 | 1240 | $out = $form->selectyesno($keyprefix . $key . $keysuffix, $value, 1, false, 1); |
1241 | 1241 | } |
1242 | - $out .= '<input type="hidden" name="' . $keyprefix . $key . $keysuffix . '_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
1242 | + $out .= '<input type="hidden" name="' . $keyprefix . $key . $keysuffix . '_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
1243 | 1243 | } elseif ($type == 'price') { |
1244 | 1244 | if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. |
1245 | 1245 | $value = price($value); |
@@ -1707,7 +1707,7 @@ discard block |
||
1707 | 1707 | |
1708 | 1708 | $tmparray = explode(':', $param_list[0]); |
1709 | 1709 | |
1710 | - $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
1710 | + $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
1711 | 1711 | if ($element == 'socpeople') { |
1712 | 1712 | $element = 'contact'; |
1713 | 1713 | } elseif ($element == 'projet') { |
@@ -1715,8 +1715,8 @@ discard block |
||
1715 | 1715 | } |
1716 | 1716 | |
1717 | 1717 | //$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 |
1718 | - $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. |
|
1719 | - $objectfield = $element . ':options_' . $key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
1718 | + $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. |
|
1719 | + $objectfield = $element . ':options_' . $key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
1720 | 1720 | |
1721 | 1721 | $out = $form->selectForForms($objectdesc, $keyprefix . $key . $keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield); |
1722 | 1722 | } elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) { |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | |
1782 | 1782 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
1783 | 1783 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
1784 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1784 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1785 | 1785 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
1786 | 1786 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
1787 | 1787 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -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 constant('DOL_DOCUMENT_ROOT') . '/core/class/dolgeophp.class.php'; |
2115 | 2115 | $dolgeophp = new DolGeoPHP($this->db); |
@@ -2300,7 +2300,7 @@ discard block |
||
2300 | 2300 | continue; |
2301 | 2301 | } |
2302 | 2302 | |
2303 | - 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')))) { |
|
2303 | + 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')))) { |
|
2304 | 2304 | //when unticking boolean field, it's not set in POST |
2305 | 2305 | continue; |
2306 | 2306 | } |
@@ -2330,7 +2330,7 @@ discard block |
||
2330 | 2330 | $onlykey === '@GETPOSTISSET' |
2331 | 2331 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
2332 | 2332 | && in_array(abs($enabled), array(2, 5)) |
2333 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
2333 | + && !GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
2334 | 2334 | ) |
2335 | 2335 | ) { |
2336 | 2336 | continue; |
@@ -428,7 +428,7 @@ |
||
428 | 428 | // Sanitize to avoid stream execution when calling file_size(). Not that this is a second security because |
429 | 429 | // most streams are already disabled by stream_wrapper_unregister() in filefunc.inc.php |
430 | 430 | $uploaded_file = preg_replace('/\s*(http|ftp)s?:/i', '', $uploaded_file); |
431 | - $uploaded_file = realpath($uploaded_file); // A hack to be sure the file point to an existing file on disk (and is not a SSRF attack) |
|
431 | + $uploaded_file = realpath($uploaded_file); // A hack to be sure the file point to an existing file on disk (and is not a SSRF attack) |
|
432 | 432 | |
433 | 433 | $validate = $this->validate($uploaded_file, $file, $error, $index); |
434 | 434 |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | } elseif ($this->type == 'html') { |
899 | 899 | $out .= $this->generateInputFieldHtml(); |
900 | 900 | } elseif ($this->type == 'color') { |
901 | - $out .= $this->generateInputFieldColor(); |
|
901 | + $out .= $this->generateInputFieldColor(); |
|
902 | 902 | } elseif ($this->type == 'yesno') { |
903 | 903 | if (!empty($conf->use_javascript_ajax)) { |
904 | 904 | $out .= ajax_constantonoff($this->confKey); |
@@ -1209,9 +1209,9 @@ discard block |
||
1209 | 1209 | } elseif ($this->type == 'selectUser') { |
1210 | 1210 | $out .= $this->generateOutputFieldSelectUser(); |
1211 | 1211 | } elseif ($this->type == 'html') { |
1212 | - $out .= $this->fieldValue; |
|
1212 | + $out .= $this->fieldValue; |
|
1213 | 1213 | } elseif ($this->type == 'color') { |
1214 | - $out .= $this->generateOutputFieldColor(); |
|
1214 | + $out .= $this->generateOutputFieldColor(); |
|
1215 | 1215 | } elseif ($this->type == 'yesno') { |
1216 | 1216 | if (!empty($conf->use_javascript_ajax)) { |
1217 | 1217 | $out .= ajax_constantonoff($this->confKey, array(), $this->entity); // TODO possibility to add $input parameter |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } |
366 | 366 | } |
367 | 367 | if ($emailtoadd && preg_match('/' . preg_quote($emailtoadd, '/') . '/i', $to)) { |
368 | - $emailtoadd = ''; // Email already in the "To" |
|
368 | + $emailtoadd = ''; // Email already in the "To" |
|
369 | 369 | } |
370 | 370 | if ($emailtoadd) { |
371 | 371 | $listofemailstoadd[$key] = $emailtoadd; |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | $this->buildCSS(); |
560 | 560 | } |
561 | 561 | $msg = $this->html; |
562 | - $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
562 | + $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
563 | 563 | } |
564 | 564 | |
565 | 565 | // Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | $this->buildCSS(); |
707 | 707 | } |
708 | 708 | $msg = $this->html; |
709 | - $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
709 | + $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | if ($this->atleastoneimage) { |
@@ -1149,8 +1149,8 @@ discard block |
||
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | $smtperrorcode = 0; |
1152 | - if (! $result) { |
|
1153 | - $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1152 | + if (!$result) { |
|
1153 | + $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1154 | 1154 | dol_syslog("CMailFile::sendfile: mail SMTP error code " . $smtperrorcode, LOG_WARNING); |
1155 | 1155 | |
1156 | 1156 | if ($smtperrorcode == '421') { // Try later |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | } |
1169 | 1169 | } |
1170 | 1170 | |
1171 | - $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1171 | + $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1172 | 1172 | if (empty($this->error) && empty($result)) { |
1173 | 1173 | dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG); |
1174 | 1174 | $res = true; |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | |
1419 | 1419 | if (@is_writable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir |
1420 | 1420 | $outputfile = $dolibarr_main_data_root . "/dolibarr_mail.log"; |
1421 | - $fp = fopen($outputfile, "w"); // overwrite |
|
1421 | + $fp = fopen($outputfile, "w"); // overwrite |
|
1422 | 1422 | |
1423 | 1423 | if ($this->sendmode == 'mail') { |
1424 | 1424 | fwrite($fp, $this->headers); |
@@ -1683,11 +1683,11 @@ discard block |
||
1683 | 1683 | // Similar code to forge a text from html is also in smtps.class.php |
1684 | 1684 | $strContentAltText = preg_replace("/<br\s*[^>]*>/", " ", $strContent); |
1685 | 1685 | // TODO We could replace <img ...> with [Filename.ext] like Gmail do. |
1686 | - $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1686 | + $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1687 | 1687 | $strContentAltText = trim(wordwrap($strContentAltText, 75, !getDolGlobalString('MAIN_FIX_FOR_BUGGED_MTA') ? "\r\n" : "\n")); |
1688 | 1688 | |
1689 | 1689 | // Check if html header already in message, if not complete the message |
1690 | - $strContent = $this->checkIfHTML($strContent); // This add a header and a body including custom CSS to the HTML content |
|
1690 | + $strContent = $this->checkIfHTML($strContent); // This add a header and a body including custom CSS to the HTML content |
|
1691 | 1691 | } |
1692 | 1692 | |
1693 | 1693 | // Make RFC2045 Compliant, split lines |
@@ -2075,7 +2075,7 @@ discard block |
||
2075 | 2075 | // We save the image to send in disk |
2076 | 2076 | $filecontent = $matches[2][$key]; |
2077 | 2077 | |
2078 | - $cid = 'cid000' . dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
2078 | + $cid = 'cid000' . dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
2079 | 2079 | |
2080 | 2080 | $destfiletmp = $images_dir . '/' . $cid . '.' . $ext; |
2081 | 2081 |