@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | $httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword); |
203 | 203 | } |
204 | 204 | |
205 | - $url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource; |
|
205 | + $url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource; |
|
206 | 206 | |
207 | 207 | $options['apikey'] = $this->dolistore_api_key; |
208 | 208 | |
209 | 209 | if ($options) { |
210 | - $url .= '?' . http_build_query($options); |
|
210 | + $url .= '?'.http_build_query($options); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $url .= (preg_match('/\?/', $url) ? '&' : '?').'apikey='.$this->dolistore_api_key; |
@@ -235,13 +235,13 @@ discard block |
||
235 | 235 | $modules = array(); |
236 | 236 | |
237 | 237 | if (!empty($this->cache_file) && file_exists($this->cache_file)) { |
238 | - dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG); |
|
238 | + dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG); |
|
239 | 239 | |
240 | 240 | $content = file_get_contents($this->cache_file); |
241 | 241 | if ($content !== false) { |
242 | 242 | $modules = $this->readYaml($content); |
243 | 243 | } else { |
244 | - dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR); |
|
244 | + dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR); |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
@@ -269,20 +269,20 @@ discard block |
||
269 | 269 | if (isset($resCategories['response']) && is_array($resCategories['response'])) { |
270 | 270 | $organized_tree = $resCategories['response']; |
271 | 271 | } else { |
272 | - return $html ; |
|
272 | + return $html; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | $html = ''; |
276 | 276 | foreach ($organized_tree as $key => $value) { |
277 | 277 | if ($value['label'] != "Versions" && $value['label'] != "Specials") { |
278 | - $html .= '<li' . ($current == $value['rowid'] ? ' class="active"' : '') . '>'; |
|
279 | - $html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>'; |
|
278 | + $html .= '<li'.($current == $value['rowid'] ? ' class="active"' : '').'>'; |
|
279 | + $html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>'; |
|
280 | 280 | if (isset($value['children'])) { |
281 | 281 | $html .= '<ul>'; |
282 | 282 | usort($value['children'], $this->buildSorter('position')); |
283 | 283 | foreach ($value['children'] as $key_children => $value_children) { |
284 | - $html .= '<li' . ($current == $value_children['rowid'] ? ' class="active"' : '') . '>'; |
|
285 | - $html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>'; |
|
284 | + $html .= '<li'.($current == $value_children['rowid'] ? ' class="active"' : '').'>'; |
|
285 | + $html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>'; |
|
286 | 286 | $html .= '</li>'; |
287 | 287 | } |
288 | 288 | $html .= '</ul>'; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | |
306 | 306 | $html = ""; |
307 | 307 | $last_month = dol_now() - (30 * 24 * 60 * 60); |
308 | - $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
308 | + $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
309 | 309 | |
310 | 310 | $this->products = array(); |
311 | 311 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $this->no_page = $options['no_page'] ?? 1; |
315 | 315 | $this->search = $options['search'] ?? ''; |
316 | 316 | |
317 | - $this->per_page = 11; // We fix number of products per page to 11 |
|
317 | + $this->per_page = 11; // We fix number of products per page to 11 |
|
318 | 318 | |
319 | 319 | // Length of $search must be at least 2 characters |
320 | 320 | if (!empty($this->search) && strlen(str_replace(' ', '', (string) $this->search)) < 2) { |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $fileProducts = array(); |
356 | 356 | $fileProductsTotal = 0; |
357 | 357 | if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) { |
358 | - $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
358 | + $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
359 | 359 | |
360 | 360 | $fileProducts = $this->adaptData($fileProducts, 'githubcommunity'); |
361 | 361 | |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | if ($product['source'] === 'githubcommunity') { |
409 | 409 | $download_link = '<a class="paddingleft paddingright" target="_blank" href="'.$product["link"].'"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/follow.png" /></a>'; |
410 | 410 | if (!empty($product['direct-download']) && $product['direct-download'] == 'yes') { |
411 | - $urldownload = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
411 | + $urldownload = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
412 | 412 | $reg = array(); |
413 | 413 | if (preg_match('/https:.*\?id=(\d+)$/', $urldownload, $reg)) { |
414 | 414 | $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$reg[1]; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | if ($product['source'] === 'dolistore') { |
421 | - $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id']; |
|
421 | + $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$product['id']; |
|
422 | 422 | $download_link = '<a class="paddingleft paddingright" target="_blank" href="'.$this->shop_url.'/product.php?id='.((int) $product["id"]).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/follow.png" /></a>'; |
423 | 423 | $download_link .= '<a class="paddingleft paddingright" target="_blank" href="'.$urldownload.'" rel="noopener noreferrer"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/Download-128.png" /></a>'; |
424 | 424 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $version = '<span class="notcompatible">'.$langs->trans( |
442 | 442 | 'NotCompatible', |
443 | 443 | $dolibarrversiontouse, |
444 | - (float) $product["dolibarr_min"], |
|
444 | + (float) $product["dolibarr_min"], |
|
445 | 445 | (float) $product["dolibarr_max"] |
446 | 446 | ).'</span>'; |
447 | 447 | $compatible = 'NotCompatible'; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $version = '<span class="notcompatible">'.$langs->trans( |
453 | 453 | 'NotCompatible', |
454 | 454 | $dolibarrversiontouse, |
455 | - (float) $product["dolibarr_min"], |
|
455 | + (float) $product["dolibarr_min"], |
|
456 | 456 | (float) $product["dolibarr_max"] |
457 | 457 | ).'</span>'; |
458 | 458 | $compatible = 'NotCompatible'; |
@@ -471,12 +471,12 @@ discard block |
||
471 | 471 | // Output the line |
472 | 472 | $html .= '<tr class="app oddeven nohover '.dol_escape_htmltag($compatible).'">'; |
473 | 473 | $html .= '<td class="center width150"><div class="newAppParent">'; |
474 | - $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
474 | + $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
475 | 475 | $html .= '</div></td>'; |
476 | 476 | $html .= '<td class="margeCote"><h2 class="appTitle">'; |
477 | 477 | $html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"])); |
478 | 478 | $html .= '<br><small>'; |
479 | - $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
479 | + $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
480 | 480 | $html .= '</small></h2>'; |
481 | 481 | $html .= '<small> '; |
482 | 482 | if (empty($product['tms'])) { |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | |
510 | 510 | $this->numberOfProducts = count($this->products); |
511 | 511 | |
512 | - return $html ; |
|
512 | + return $html; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | /** |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | * @param array<string, mixed> $b |
527 | 527 | * @return int |
528 | 528 | */ |
529 | - function (array $a, array $b) use ($key) { |
|
529 | + function(array $a, array $b) use ($key) { |
|
530 | 530 | $valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : ''; |
531 | 531 | $valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : ''; |
532 | 532 | |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | $pagelist .= '<li class="pagination">'; |
686 | 686 | $pagelist .= '<label for="page_input">Page </label>'; |
687 | 687 | if ($this->categorie != 0) { |
688 | - $pagelist .= '<input type="hidden" name="categorie" value="' . $this->categorie . '">'; |
|
688 | + $pagelist .= '<input type="hidden" name="categorie" value="'.$this->categorie.'">'; |
|
689 | 689 | } |
690 | 690 | $pagelist .= '<input type="text" id="page_input" name="no_page" value="'.($page).'" min="1" max="'.$nbpages.'" class="width40 page_input" oninput="if(this.value > '.$nbpages.') this.value='.$nbpages.'">'; |
691 | 691 | $pagelist .= ' / '.$nbpages; |
@@ -735,12 +735,12 @@ discard block |
||
735 | 735 | } |
736 | 736 | |
737 | 737 | // Get the predefined error message or use a default one |
738 | - $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code']; |
|
738 | + $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code']; |
|
739 | 739 | |
740 | 740 | // Append error details if available |
741 | 741 | if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) { |
742 | 742 | foreach ($request['response']['errors'] as $error) { |
743 | - $error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message']; |
|
743 | + $error_message .= ' - (Code '.$error['code'].'): '.$error['message']; |
|
744 | 744 | } |
745 | 745 | } |
746 | 746 | |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | * |
972 | 972 | * @return int |
973 | 973 | */ |
974 | - static function ($a, $b) { |
|
974 | + static function($a, $b) { |
|
975 | 975 | return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); |
976 | 976 | } |
977 | 977 | ); |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | * |
987 | 987 | * @return bool |
988 | 988 | */ |
989 | - static function ($package) use ($options) { |
|
989 | + static function($package) use ($options) { |
|
990 | 990 | return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false; |
991 | 991 | } |
992 | 992 | ); |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | * |
1003 | 1003 | * @return bool |
1004 | 1004 | */ |
1005 | - static function ($package) use ($options) { |
|
1005 | + static function($package) use ($options) { |
|
1006 | 1006 | return in_array($options['categorieid'], $package['category']); |
1007 | 1007 | } |
1008 | 1008 | ); |
@@ -326,7 +326,7 @@ |
||
326 | 326 | } |
327 | 327 | |
328 | 328 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
329 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
329 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
330 | 330 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
331 | 331 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
332 | 332 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); |
83 | 83 | $remindertype = GETPOST('selectremindertype', 'aZ09'); |
84 | 84 | $modelmail = GETPOSTINT('actioncommsendmodel_mail'); |
85 | -$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
85 | +$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
86 | 86 | $private = GETPOST('private', 'alphanohtml'); |
87 | 87 | if ($complete == 'na' || $complete == -2) { |
88 | 88 | $complete = -1; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | if (is_array($listofresourceid) && count($listofresourceid)) { |
564 | 564 | foreach ($listofresourceid as $resource_id => $val) { |
565 | 565 | $resource_type = 'dolresource'; |
566 | - $busy = 1;//GETPOSTINT('busy'); |
|
566 | + $busy = 1; //GETPOSTINT('busy'); |
|
567 | 567 | |
568 | 568 | // Resources association |
569 | 569 | if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) { |
@@ -579,24 +579,24 @@ discard block |
||
579 | 579 | } |
580 | 580 | |
581 | 581 | $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; |
582 | - $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; |
|
583 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'"; |
|
584 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; |
|
585 | - $sql .= " WHERE er.resource_id = " . ((int) $resource_id); |
|
582 | + $sql .= " FROM ".MAIN_DB_PREFIX."element_resources as er"; |
|
583 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($resource_type)."'"; |
|
584 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($object->element)."'"; |
|
585 | + $sql .= " WHERE er.resource_id = ".((int) $resource_id); |
|
586 | 586 | $sql .= " AND er.busy = 1"; |
587 | 587 | $sql .= " AND ("; |
588 | 588 | |
589 | 589 | // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) |
590 | - $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; |
|
590 | + $sql .= " (ac.datep <= '".$db->idate($eventDateStart)."' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart)."'))"; |
|
591 | 591 | // event date end between ac.datep and ac.datep2 |
592 | 592 | if (!empty($eventDateEnd)) { |
593 | - $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; |
|
593 | + $sql .= " OR (ac.datep <= '".$db->idate($eventDateEnd)."' AND (ac.datep2 >= '".$db->idate($eventDateEnd)."'))"; |
|
594 | 594 | } |
595 | 595 | // event date start before ac.datep and event date end after ac.datep2 |
596 | 596 | $sql .= " OR ("; |
597 | - $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; |
|
597 | + $sql .= "ac.datep >= '".$db->idate($eventDateStart)."'"; |
|
598 | 598 | if (!empty($eventDateEnd)) { |
599 | - $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; |
|
599 | + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd)."')"; |
|
600 | 600 | } |
601 | 601 | $sql .= ")"; |
602 | 602 | |
@@ -610,9 +610,9 @@ discard block |
||
610 | 610 | if ($db->num_rows($resql) > 0) { |
611 | 611 | // Resource already in use |
612 | 612 | $error++; |
613 | - $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; |
|
613 | + $object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : '; |
|
614 | 614 | while ($obj = $db->fetch_object($resql)) { |
615 | - $object->error .= '<br> - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); |
|
615 | + $object->error .= '<br> - '.$langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.' ['.$obj->ac_id.']'); |
|
616 | 616 | } |
617 | 617 | $object->errors[] = $object->error; |
618 | 618 | |
@@ -723,12 +723,12 @@ discard block |
||
723 | 723 | if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) { |
724 | 724 | $firstdatearray = dol_get_first_day_week(GETPOSTINT("apday"), GETPOSTINT("apmonth"), GETPOSTINT("apyear")); |
725 | 725 | $datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel'); |
726 | - $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after |
|
726 | + $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd'); //We begin the week after |
|
727 | 727 | $dayoffset = 7; |
728 | 728 | $monthoffset = 0; |
729 | 729 | } elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) { |
730 | 730 | $firstday = $selectedrecurrulebymonthday; |
731 | - $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth");//We begin the week after |
|
731 | + $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth"); //We begin the week after |
|
732 | 732 | $datep = dol_mktime($fulldayevent ? 0 : GETPOSTINT("aphour"), $fulldayevent ? 0 : GETPOSTINT("apmin"), $fulldayevent ? 0 : GETPOSTINT("apsec"), $firstmonth, $firstday, GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); |
733 | 733 | $dayoffset = 0; |
734 | 734 | $monthoffset = 1; |
@@ -832,9 +832,9 @@ discard block |
||
832 | 832 | |
833 | 833 | // increment date for recurrent events |
834 | 834 | $datep = dol_time_plus_duree($datep, $dayoffset, 'd'); |
835 | - $datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
835 | + $datep = dol_time_plus_duree($datep, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
836 | 836 | $datef = dol_time_plus_duree($datef, $dayoffset, 'd'); |
837 | - $datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
837 | + $datef = dol_time_plus_duree($datef, $monthoffset, 'm'); // @phan-suppress-current-line PhanPluginSuspiciousParamOrder |
|
838 | 838 | } |
839 | 839 | } |
840 | 840 | if (!empty($backtopage) && !$error) { |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | $object->fetch($id); |
877 | 877 | $object->fetch_optionals(); |
878 | 878 | $object->fetch_userassigned(); |
879 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
879 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
880 | 880 | |
881 | 881 | // Clean parameters |
882 | 882 | if ($fulldayevent) { |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | $object->fetch($id); |
1156 | 1156 | $object->fetch_optionals(); |
1157 | 1157 | $object->fetch_userassigned(); |
1158 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
1158 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
1159 | 1159 | |
1160 | 1160 | if ($user->hasRight('agenda', 'myactions', 'delete') |
1161 | 1161 | || $user->hasRight('agenda', 'allactions', 'delete')) { |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { |
1178 | 1178 | $error = 0; |
1179 | 1179 | |
1180 | - $shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
1180 | + $shour = (int) dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
1181 | 1181 | $smin = (int) dol_print_date($object->datep, "%M", 'tzuserrel'); |
1182 | 1182 | |
1183 | 1183 | $newdate = GETPOST('newdate', 'alpha'); |
@@ -1351,7 +1351,7 @@ discard block |
||
1351 | 1351 | if (new_startdate > old_enddate) { |
1352 | 1352 | var timeDiff = old_enddate - old_startdate; |
1353 | 1353 | var new_enddate = new Date(new_startdate.getTime() + timeDiff); |
1354 | - $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '")); |
|
1354 | + $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'")); |
|
1355 | 1355 | $("#p2day").val(new_enddate.getDate()); |
1356 | 1356 | $("#p2month").val(new_enddate.getMonth() + 1); |
1357 | 1357 | $("#p2year").val(new_enddate.getFullYear()); |
@@ -1419,7 +1419,7 @@ discard block |
||
1419 | 1419 | $default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV'); |
1420 | 1420 | print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); |
1421 | 1421 | $selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default); |
1422 | - print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
1422 | + print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
1423 | 1423 | print '</td></tr>'; |
1424 | 1424 | } |
1425 | 1425 | |
@@ -1504,7 +1504,7 @@ discard block |
||
1504 | 1504 | */ |
1505 | 1505 | |
1506 | 1506 | // limit date |
1507 | - $repeateventlimitdate = empty($repeateventlimitdate) ? (dol_now() + ((24 * 3600 * 365) + 1)) : $repeateventlimitdate; |
|
1507 | + $repeateventlimitdate = empty($repeateventlimitdate) ? (dol_now() + ((24 * 3600 * 365) + 1)) : $repeateventlimitdate; |
|
1508 | 1508 | |
1509 | 1509 | print '<div class="hidden marginrightonly inline-block repeateventlimitdate">'; |
1510 | 1510 | print $langs->trans("Until")." "; |
@@ -1762,7 +1762,7 @@ discard block |
||
1762 | 1762 | } |
1763 | 1763 | //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); |
1764 | 1764 | |
1765 | - if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
1765 | + if (!in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
1766 | 1766 | // We do not use link for object that already contains a hard coded field to make links with agenda events |
1767 | 1767 | print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>'; |
1768 | 1768 | print '<td colspan="3">'; |
@@ -1851,7 +1851,7 @@ discard block |
||
1851 | 1851 | $("#addreminder").prop("checked", true); |
1852 | 1852 | |
1853 | 1853 | // Set period with default reminder period |
1854 | - $("[name=\"offsetvalue\"]").val(\'' . dol_escape_js((string) $reminderDefaultOffset) . '\'); |
|
1854 | + $("[name=\"offsetvalue\"]").val(\'' . dol_escape_js((string) $reminderDefaultOffset).'\'); |
|
1855 | 1855 | $("#select_offsetunittype_duration").select2("destroy"); |
1856 | 1856 | $("#select_offsetunittype_duration").val(\''.dol_escape_js($reminderDefaultUnit).'\'); |
1857 | 1857 | $("#select_offsetunittype_duration").select2(); |
@@ -1948,7 +1948,7 @@ discard block |
||
1948 | 1948 | $object->socpeopleassigned[$id] = array('id' => $tmpid); |
1949 | 1949 | } |
1950 | 1950 | $object->contact_id = GETPOSTINT("contactid"); |
1951 | - $object->fk_project = GETPOSTINT("projectid"); |
|
1951 | + $object->fk_project = GETPOSTINT("projectid"); |
|
1952 | 1952 | |
1953 | 1953 | $object->note_private = GETPOST("note", 'restricthtml'); |
1954 | 1954 | } |
@@ -2015,7 +2015,7 @@ discard block |
||
2015 | 2015 | if (new_startdate > old_enddate) { |
2016 | 2016 | var timeDiff = old_enddate - old_startdate; |
2017 | 2017 | var new_enddate = new Date(new_startdate.getTime() + timeDiff); |
2018 | - $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput') . '")); |
|
2018 | + $("#p2").val(formatDate(new_enddate, "' . $langs->trans('FormatDateShortJavaInput').'")); |
|
2019 | 2019 | $("#p2day").val(new_enddate.getDate()); |
2020 | 2020 | $("#p2month").val(new_enddate.getMonth() + 1); |
2021 | 2021 | $("#p2year").val(new_enddate.getFullYear()); |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | if ($backtopage) { |
2041 | 2041 | print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : '').'">'; |
2042 | 2042 | } |
2043 | - if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) { |
|
2043 | + if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && !preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) { |
|
2044 | 2044 | print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">'; |
2045 | 2045 | } |
2046 | 2046 | |
@@ -2466,7 +2466,7 @@ discard block |
||
2466 | 2466 | }); |
2467 | 2467 | })'; |
2468 | 2468 | print '</script>'."\n"; |
2469 | - print '</div>'; // End of div for reminderparameters |
|
2469 | + print '</div>'; // End of div for reminderparameters |
|
2470 | 2470 | } |
2471 | 2471 | |
2472 | 2472 | print dol_get_fiche_end(); |
@@ -2744,7 +2744,7 @@ discard block |
||
2744 | 2744 | |
2745 | 2745 | // Priority |
2746 | 2746 | if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) { |
2747 | - print '<tr><td class="nowrap" class="titlefield">' . $langs->trans("Priority") . '</td><td>'; |
|
2747 | + print '<tr><td class="nowrap" class="titlefield">'.$langs->trans("Priority").'</td><td>'; |
|
2748 | 2748 | print($object->priority ? $object->priority : ''); |
2749 | 2749 | print '</td></tr>'; |
2750 | 2750 | } |
@@ -180,7 +180,6 @@ |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | - |
|
184 | 183 | * Create an event attendee |
185 | 184 | * |
186 | 185 | * Example: {"module":"adherent","type_template":"member","active": 1,"ref":"(SendingEmailOnAutoSubscription)","fk_user":0,"joinfiles": "0", ... } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $head[$h][1] = $langs->trans("ExtraFields"); |
52 | 52 | $nbExtrafields = is_countable($extrafields->attributes['bom_bom']['label']) ? count($extrafields->attributes['bom_bom']['label']) : 0; |
53 | 53 | if ($nbExtrafields > 0) { |
54 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>'; |
|
54 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>'; |
|
55 | 55 | } |
56 | 56 | $head[$h][2] = 'bom_extrafields'; |
57 | 57 | $h++; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $head[$h][1] = $langs->trans("ExtraFieldsLines"); |
61 | 61 | $nbExtrafields = is_countable($extrafields->attributes['bom_bomline']['label']) ? count($extrafields->attributes['bom_bomline']['label']) : 0; |
62 | 62 | if ($nbExtrafields > 0) { |
63 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>'; |
|
63 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>'; |
|
64 | 64 | } |
65 | 65 | $head[$h][2] = 'bomline_extrafields'; |
66 | 66 | $h++; |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $algo .= 'sitefiles'; |
342 | 342 | } |
343 | 343 | |
344 | -$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same as $searchstring |
|
344 | +$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same as $searchstring |
|
345 | 345 | |
346 | 346 | if ($sortfield == '') { |
347 | 347 | if ($action == 'file_manager') { // Test on permission not required |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } |
370 | 370 | |
371 | 371 | $usercanedit = $user->hasRight('website', 'write'); |
372 | -$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
372 | +$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
373 | 373 | $permissiontodelete = $user->hasRight('website', 'delete'); |
374 | 374 | |
375 | 375 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | if ($sortorder) { |
437 | 437 | $backtopage .= '&sortorder='.urlencode($sortorder); |
438 | 438 | } |
439 | -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
439 | +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
440 | 440 | |
441 | 441 | $backtopage = $savbacktopage; |
442 | 442 | //var_dump($backtopage); |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | |
602 | 602 | // Replacement of string into pages |
603 | 603 | if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { |
604 | - $replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring |
|
604 | + $replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring |
|
605 | 605 | |
606 | 606 | $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); |
607 | 607 | $allowimportsite = true; |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | $objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha'); |
1176 | 1176 | $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); |
1177 | 1177 | $objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0; |
1178 | - $objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>' |
|
1178 | + $objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>' |
|
1179 | 1179 | $objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'); |
1180 | 1180 | $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS'); |
1181 | 1181 | $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID'); |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | $content = ''; |
1209 | 1209 | if (GETPOSTISSET('content')) { |
1210 | 1210 | //$content = GETPOST('content', 'restricthtmlallowunvalid'); // @TODO Use a restricthtmlallowunvalidwithphp |
1211 | - $content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp |
|
1211 | + $content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp |
|
1212 | 1212 | |
1213 | 1213 | $objectpage->content = make_substitutions($content, $substitutionarray); |
1214 | 1214 | } else { |
@@ -1586,7 +1586,7 @@ discard block |
||
1586 | 1586 | $error++; |
1587 | 1587 | setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors'); |
1588 | 1588 | } |
1589 | - if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1589 | + if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1590 | 1590 | $error++; |
1591 | 1591 | setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors'); |
1592 | 1592 | } |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1599 | 1599 | $action = 'preview'; |
1600 | 1600 | if ($backtopage) { |
1601 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1601 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1602 | 1602 | header("Location: ".$backtopage); |
1603 | 1603 | exit; |
1604 | 1604 | } |
@@ -1622,7 +1622,7 @@ discard block |
||
1622 | 1622 | } |
1623 | 1623 | |
1624 | 1624 | |
1625 | - $dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
1625 | + $dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
1626 | 1626 | |
1627 | 1627 | $dataposted = preg_replace(array('/<html>\n*/ims', '/<\/html>\n*/ims'), array('', ''), $dataposted); |
1628 | 1628 | $dataposted = str_replace('<?=', '<?php', $dataposted); |
@@ -1632,7 +1632,7 @@ discard block |
||
1632 | 1632 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1633 | 1633 | |
1634 | 1634 | // Security analysis |
1635 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1635 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1636 | 1636 | |
1637 | 1637 | if (!$errorphpcheck) { |
1638 | 1638 | $htmlheadercontent = ''; |
@@ -1670,7 +1670,7 @@ discard block |
||
1670 | 1670 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1671 | 1671 | |
1672 | 1672 | // Security analysis |
1673 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1673 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1674 | 1674 | |
1675 | 1675 | if (!$errorphpcheck) { |
1676 | 1676 | $csscontent = ''; |
@@ -1713,7 +1713,7 @@ discard block |
||
1713 | 1713 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1714 | 1714 | |
1715 | 1715 | // Security analysis |
1716 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1716 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1717 | 1717 | |
1718 | 1718 | if (!$errorphpcheck) { |
1719 | 1719 | $jscontent = ''; |
@@ -1751,7 +1751,7 @@ discard block |
||
1751 | 1751 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1752 | 1752 | |
1753 | 1753 | // Security analysis |
1754 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1754 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1755 | 1755 | |
1756 | 1756 | if (!$errorphpcheck) { |
1757 | 1757 | $robotcontent = ''; |
@@ -1789,7 +1789,7 @@ discard block |
||
1789 | 1789 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1790 | 1790 | |
1791 | 1791 | // Security analysis |
1792 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1792 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1793 | 1793 | |
1794 | 1794 | if (!$errorphpcheck) { |
1795 | 1795 | if ($dataposted) { |
@@ -1817,7 +1817,7 @@ discard block |
||
1817 | 1817 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1818 | 1818 | |
1819 | 1819 | // Security analysis |
1820 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1820 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1821 | 1821 | |
1822 | 1822 | if (!$errorphpcheck) { |
1823 | 1823 | $manifestjsoncontent = ''; |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1857 | 1857 | |
1858 | 1858 | // Security analysis |
1859 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1859 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1860 | 1860 | |
1861 | 1861 | if (!$errorphpcheck) { |
1862 | 1862 | $readmecontent = ''; |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1896 | 1896 | |
1897 | 1897 | // Security analysis |
1898 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1898 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1899 | 1899 | |
1900 | 1900 | if (!$errorphpcheck) { |
1901 | 1901 | $licensecontent = ''; |
@@ -1937,7 +1937,7 @@ discard block |
||
1937 | 1937 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1938 | 1938 | $action = 'preview'; |
1939 | 1939 | if ($backtopage) { |
1940 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1940 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1941 | 1941 | header("Location: ".$backtopage); |
1942 | 1942 | exit; |
1943 | 1943 | } |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | $sourcestring .= " ".$source; |
1999 | 1999 | } |
2000 | 2000 | } |
2001 | - $securityspstring .= $directive . $sourcestring; |
|
2001 | + $securityspstring .= $directive.$sourcestring; |
|
2002 | 2002 | } |
2003 | 2003 | $res = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securityspstring, 'chaine', 0, '', $conf->entity); |
2004 | 2004 | if ($res <= 0) { |
@@ -2043,7 +2043,7 @@ discard block |
||
2043 | 2043 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
2044 | 2044 | $action = 'preview'; |
2045 | 2045 | if ($backtopage) { |
2046 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
2046 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
2047 | 2047 | header("Location: ".$backtopage); |
2048 | 2048 | exit; |
2049 | 2049 | } |
@@ -2061,7 +2061,7 @@ discard block |
||
2061 | 2061 | |
2062 | 2062 | $object->fk_default_home = $pageid; |
2063 | 2063 | $res = $object->update($user); |
2064 | - if (! ($res > 0)) { |
|
2064 | + if (!($res > 0)) { |
|
2065 | 2065 | $error++; |
2066 | 2066 | setEventMessages($object->error, $object->errors, 'errors'); |
2067 | 2067 | } |
@@ -2176,7 +2176,7 @@ discard block |
||
2176 | 2176 | $objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha'); |
2177 | 2177 | $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); |
2178 | 2178 | $objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0; |
2179 | - $objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
2179 | + $objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>' |
|
2180 | 2180 | $objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); |
2181 | 2181 | $objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml')); |
2182 | 2182 | $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha'); |
@@ -2455,7 +2455,7 @@ discard block |
||
2455 | 2455 | |
2456 | 2456 | $phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content); |
2457 | 2457 | |
2458 | - $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2458 | + $objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed |
|
2459 | 2459 | |
2460 | 2460 | $phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content); |
2461 | 2461 | |
@@ -2684,7 +2684,7 @@ discard block |
||
2684 | 2684 | $fileofzip = ''; |
2685 | 2685 | if (GETPOSTISSET('templateuserfile')) { |
2686 | 2686 | // Case we selected one template |
2687 | - $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2687 | + $fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite() |
|
2688 | 2688 | } elseif (!empty($_FILES) && is_array($_FILES['userfile'])) { |
2689 | 2689 | // Case we upload a new template |
2690 | 2690 | if (is_array($_FILES['userfile']['tmp_name'])) { |
@@ -2766,7 +2766,7 @@ discard block |
||
2766 | 2766 | if ($website->virtualhost) { |
2767 | 2767 | $domainname = $website->virtualhost; |
2768 | 2768 | } |
2769 | - if (! preg_match('/^http/i', $domainname)) { |
|
2769 | + if (!preg_match('/^http/i', $domainname)) { |
|
2770 | 2770 | $domainname = 'https://'.$domainname; |
2771 | 2771 | } |
2772 | 2772 | |
@@ -2832,7 +2832,7 @@ discard block |
||
2832 | 2832 | $url->appendChild($lastmod); |
2833 | 2833 | // Add suggested frequency for refresh |
2834 | 2834 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
2835 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2835 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2836 | 2836 | $url->appendChild($changefreq); |
2837 | 2837 | } |
2838 | 2838 | // Add higher priority for home page |
@@ -2937,7 +2937,7 @@ discard block |
||
2937 | 2937 | $url->appendChild($lastmod); |
2938 | 2938 | // Add suggested frequency for refresh |
2939 | 2939 | if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) { |
2940 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2940 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2941 | 2941 | $url->appendChild($changefreq); |
2942 | 2942 | } |
2943 | 2943 | |
@@ -3022,7 +3022,7 @@ discard block |
||
3022 | 3022 | $sourcestring .= " ".$source; |
3023 | 3023 | } |
3024 | 3024 | } |
3025 | - $securityspstring .= $directive . $sourcestring; |
|
3025 | + $securityspstring .= $directive.$sourcestring; |
|
3026 | 3026 | } |
3027 | 3027 | $res = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securityspstring, 'chaine', 0, '', $conf->entity); |
3028 | 3028 | if ($res <= 0) { |
@@ -3294,11 +3294,11 @@ discard block |
||
3294 | 3294 | |
3295 | 3295 | // // Export web site |
3296 | 3296 | $extraCssClass = getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE') ? 'hideobject' : ''; |
3297 | - print '<input type="submit" class="button bordertransp ' . $extraCssClass . '" ' . $disabledexport . ' value="' . dol_escape_htmltag($exportlabel) . '" name="exportsite">'; |
|
3297 | + print '<input type="submit" class="button bordertransp '.$extraCssClass.'" '.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">'; |
|
3298 | 3298 | |
3299 | 3299 | if (getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')) { |
3300 | 3300 | // Overwrite template in sources |
3301 | - $overwriteGitUrl = $_SERVER["PHP_SELF"] . '?action=overwritesite&website=' . urlencode($website->ref); |
|
3301 | + $overwriteGitUrl = $_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref); |
|
3302 | 3302 | print dolButtonToOpenExportDialog('exportpopup', $langs->trans('ExportOptions'), $langs->trans('ExportSite'), 'exportsite', $overwriteGitUrl, $website); |
3303 | 3303 | //print '<a href="'.$_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref).'" class="button bordertransp hideobject" title="'.dol_escape_htmltag($langs->trans("ExportIntoGIT").". Directory ".getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')).'">'.dol_escape_htmltag($langs->trans("ExportIntoGIT")).'</a>'; |
3304 | 3304 | } |
@@ -3683,7 +3683,7 @@ discard block |
||
3683 | 3683 | print '<!-- button EditInLine and ShowSubcontainers -->'."\n"; |
3684 | 3684 | print '<div class="websiteselectionsection inline-block">'; |
3685 | 3685 | |
3686 | - print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
3686 | + print '<div class="inline-block marginrightonly">'; // Button includes dynamic content |
|
3687 | 3687 | print $langs->trans("ShowSubcontainers"); |
3688 | 3688 | if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) { |
3689 | 3689 | print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', 0, 0, 0, '', 'nomarginleft').'</a>'; |
@@ -3692,7 +3692,7 @@ discard block |
||
3692 | 3692 | } |
3693 | 3693 | print '</div>'; |
3694 | 3694 | |
3695 | - print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3695 | + print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3696 | 3696 | |
3697 | 3697 | print '<span id="switchckeditorinline">'."\n"; |
3698 | 3698 | // Enable CKEditor inline with js on section and div with conteneditable=true |
@@ -3792,15 +3792,15 @@ discard block |
||
3792 | 3792 | // Sending data via AJAX to update section |
3793 | 3793 | $.ajax({ |
3794 | 3794 | type: \'POST\', |
3795 | - url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\', |
|
3795 | + url: \'' . DOL_URL_ROOT.'/core/ajax/editinline.php\', |
|
3796 | 3796 | data: { |
3797 | 3797 | website_ref: \''.dol_escape_js($website->ref).'\', |
3798 | - page_id: \'' . ((int) $websitepage->id) . '\', |
|
3798 | + page_id: \'' . ((int) $websitepage->id).'\', |
|
3799 | 3799 | content: content, |
3800 | 3800 | element_id: elementId, |
3801 | 3801 | element_type: elementType, |
3802 | 3802 | action: \'updatedElementContent\', |
3803 | - token: \'' . newToken() . '\' |
|
3803 | + token: \'' . newToken().'\' |
|
3804 | 3804 | }, |
3805 | 3805 | success: function(response) { |
3806 | 3806 | console.log(response); |
@@ -3891,7 +3891,7 @@ discard block |
||
3891 | 3891 | } else { |
3892 | 3892 | $disabled = ''; |
3893 | 3893 | $title = ''; |
3894 | - $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3894 | + $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website |
|
3895 | 3895 | } |
3896 | 3896 | print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>'; |
3897 | 3897 | print '</span>'; |
@@ -4084,7 +4084,7 @@ discard block |
||
4084 | 4084 | // Clean the php htmlheader file to remove php code and get only html part |
4085 | 4085 | $htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htmlheadercontent); |
4086 | 4086 | } else { |
4087 | - $htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>' |
|
4087 | + $htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>' |
|
4088 | 4088 | } |
4089 | 4089 | if (!trim($htmlheadercontent)) { |
4090 | 4090 | $htmlheadercontent = "<html>\n"; |
@@ -4115,7 +4115,7 @@ discard block |
||
4115 | 4115 | // Clean the php htaccesscontent file to remove php code and get only html part |
4116 | 4116 | $htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htaccesscontent); |
4117 | 4117 | } else { |
4118 | - $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
4118 | + $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " |
|
4119 | 4119 | } |
4120 | 4120 | |
4121 | 4121 | if (!GETPOSTISSET('WEBSITE_MANIFEST_JSON')) { |
@@ -4215,7 +4215,7 @@ discard block |
||
4215 | 4215 | $maxfilesizearray = getMaxFileSizeArray(); |
4216 | 4216 | $maxmin = $maxfilesizearray['maxmin']; |
4217 | 4217 | if ($maxmin > 0) { |
4218 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4218 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4219 | 4219 | } |
4220 | 4220 | print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>'; |
4221 | 4221 | |
@@ -4257,7 +4257,7 @@ discard block |
||
4257 | 4257 | print '<tr><td class="tdtop">'; |
4258 | 4258 | print $langs->trans('WEBSITE_HTML_HEADER'); |
4259 | 4259 | $htmlhelp = $langs->trans("Example").' :<br>'; |
4260 | - $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
4260 | + $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
4261 | 4261 | $textwithhelp = $form->textwithpicto('', $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip'); |
4262 | 4262 | $htmlhelp2 = $langs->trans("LinkAndScriptsHereAreNotLoadedInEditor").'<br>'; |
4263 | 4263 | print $form->textwithpicto($textwithhelp, $htmlhelp2, 1, 'warning', '', 0, 2, 'htmlheadertooltip2'); |
@@ -4655,7 +4655,7 @@ discard block |
||
4655 | 4655 | $maxfilesizearray = getMaxFileSizeArray(); |
4656 | 4656 | $maxmin = $maxfilesizearray['maxmin']; |
4657 | 4657 | if ($maxmin > 0) { |
4658 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4658 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
4659 | 4659 | } |
4660 | 4660 | print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">'; |
4661 | 4661 | print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">'; |
@@ -5178,7 +5178,7 @@ discard block |
||
5178 | 5178 | print '<tr><td class="tdhtmlheader tdtop">'; |
5179 | 5179 | $htmlhelp = $langs->trans("EditTheWebSiteForACommonHeader").'<br><br>'; |
5180 | 5180 | $htmlhelp .= $langs->trans("Example").' :<br>'; |
5181 | - $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
5181 | + $htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction. |
|
5182 | 5182 | print $form->textwithpicto($langs->transnoentitiesnoconv('HtmlHeaderPage'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip'); |
5183 | 5183 | print '</td><td>'; |
5184 | 5184 | $poscursor = array('x' => GETPOST('htmlheader_x'), 'y' => GETPOST('htmlheader_y')); |
@@ -5315,7 +5315,7 @@ discard block |
||
5315 | 5315 | print '<div class="fiche"><br>'; |
5316 | 5316 | |
5317 | 5317 | $module = 'medias'; |
5318 | - $formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php |
|
5318 | + $formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php |
|
5319 | 5319 | if (empty($url)) { |
5320 | 5320 | $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param |
5321 | 5321 | } |
@@ -5552,8 +5552,8 @@ discard block |
||
5552 | 5552 | print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
5553 | 5553 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
5554 | 5554 | print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n"; |
5555 | - print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation |
|
5556 | - print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
5555 | + print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation |
|
5556 | + print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
5557 | 5557 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
5558 | 5558 | // Action column |
5559 | 5559 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * \brief Module Dolibarr state base |
27 | 27 | */ |
28 | 28 | |
29 | -include_once DOL_DOCUMENT_ROOT . '/core/boxes/modules_boxes.php'; |
|
29 | +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; |
|
30 | 30 | |
31 | 31 | |
32 | 32 | /** |
@@ -159,54 +159,54 @@ discard block |
||
159 | 159 | 'dolresource' => 'Dolresource' |
160 | 160 | ); |
161 | 161 | $includes = array( |
162 | - 'users' => DOL_DOCUMENT_ROOT . "/user/class/user.class.php", |
|
163 | - 'members' => DOL_DOCUMENT_ROOT . "/adherents/class/adherent.class.php", |
|
164 | - 'customers' => DOL_DOCUMENT_ROOT . "/societe/class/client.class.php", |
|
165 | - 'prospects' => DOL_DOCUMENT_ROOT . "/societe/class/client.class.php", |
|
166 | - 'suppliers' => DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.class.php", |
|
167 | - 'contacts' => DOL_DOCUMENT_ROOT . "/contact/class/contact.class.php", |
|
168 | - 'products' => DOL_DOCUMENT_ROOT . "/product/class/product.class.php", |
|
169 | - 'services' => DOL_DOCUMENT_ROOT . "/product/class/product.class.php", |
|
170 | - 'proposals' => DOL_DOCUMENT_ROOT . "/comm/propal/class/propal.class.php", |
|
171 | - 'orders' => DOL_DOCUMENT_ROOT . "/commande/class/commande.class.php", |
|
172 | - 'invoices' => DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php", |
|
173 | - 'donations' => DOL_DOCUMENT_ROOT . "/don/class/don.class.php", |
|
174 | - 'contracts' => DOL_DOCUMENT_ROOT . "/contrat/class/contrat.class.php", |
|
175 | - 'interventions' => DOL_DOCUMENT_ROOT . "/fichinter/class/fichinter.class.php", |
|
176 | - 'supplier_orders' => DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.commande.class.php", |
|
177 | - 'supplier_invoices' => DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.facture.class.php", |
|
178 | - 'supplier_proposals' => DOL_DOCUMENT_ROOT . "/supplier_proposal/class/supplier_proposal.class.php", |
|
179 | - 'projects' => DOL_DOCUMENT_ROOT . "/projet/class/project.class.php", |
|
180 | - 'expensereports' => DOL_DOCUMENT_ROOT . "/expensereport/class/expensereport.class.php", |
|
181 | - 'holidays' => DOL_DOCUMENT_ROOT . "/holiday/class/holiday.class.php", |
|
182 | - 'ticket' => DOL_DOCUMENT_ROOT . "/ticket/class/ticket.class.php", |
|
183 | - 'knowledgebase' => DOL_DOCUMENT_ROOT . "/knowledgemanagement/class/knowledgerecord.class.php", |
|
184 | - 'dolresource' => DOL_DOCUMENT_ROOT . "/resource/class/dolresource.class.php" |
|
162 | + 'users' => DOL_DOCUMENT_ROOT."/user/class/user.class.php", |
|
163 | + 'members' => DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php", |
|
164 | + 'customers' => DOL_DOCUMENT_ROOT."/societe/class/client.class.php", |
|
165 | + 'prospects' => DOL_DOCUMENT_ROOT."/societe/class/client.class.php", |
|
166 | + 'suppliers' => DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php", |
|
167 | + 'contacts' => DOL_DOCUMENT_ROOT."/contact/class/contact.class.php", |
|
168 | + 'products' => DOL_DOCUMENT_ROOT."/product/class/product.class.php", |
|
169 | + 'services' => DOL_DOCUMENT_ROOT."/product/class/product.class.php", |
|
170 | + 'proposals' => DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php", |
|
171 | + 'orders' => DOL_DOCUMENT_ROOT."/commande/class/commande.class.php", |
|
172 | + 'invoices' => DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php", |
|
173 | + 'donations' => DOL_DOCUMENT_ROOT."/don/class/don.class.php", |
|
174 | + 'contracts' => DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php", |
|
175 | + 'interventions' => DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php", |
|
176 | + 'supplier_orders' => DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php", |
|
177 | + 'supplier_invoices' => DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php", |
|
178 | + 'supplier_proposals' => DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php", |
|
179 | + 'projects' => DOL_DOCUMENT_ROOT."/projet/class/project.class.php", |
|
180 | + 'expensereports' => DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", |
|
181 | + 'holidays' => DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php", |
|
182 | + 'ticket' => DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php", |
|
183 | + 'knowledgebase' => DOL_DOCUMENT_ROOT."/knowledgemanagement/class/knowledgerecord.class.php", |
|
184 | + 'dolresource' => DOL_DOCUMENT_ROOT."/resource/class/dolresource.class.php" |
|
185 | 185 | ); |
186 | 186 | $links = array( |
187 | - 'users' => DOL_URL_ROOT . '/user/list.php', |
|
188 | - 'members' => DOL_URL_ROOT . '/adherents/list.php?statut=1&mainmenu=members', |
|
189 | - 'customers' => DOL_URL_ROOT . '/societe/list.php?type=c&mainmenu=companies', |
|
190 | - 'prospects' => DOL_URL_ROOT . '/societe/list.php?type=p&mainmenu=companies', |
|
191 | - 'suppliers' => DOL_URL_ROOT . '/societe/list.php?type=f&mainmenu=companies', |
|
192 | - 'contacts' => DOL_URL_ROOT . '/contact/list.php?mainmenu=companies', |
|
193 | - 'products' => DOL_URL_ROOT . '/product/list.php?type=0&mainmenu=products', |
|
194 | - 'services' => DOL_URL_ROOT . '/product/list.php?type=1&mainmenu=products', |
|
195 | - 'proposals' => DOL_URL_ROOT . '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', |
|
196 | - 'orders' => DOL_URL_ROOT . '/commande/list.php?mainmenu=commercial&leftmenu=orders', |
|
197 | - 'invoices' => DOL_URL_ROOT . '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', |
|
198 | - 'donations' => DOL_URL_ROOT . '/don/list.php?leftmenu=donations', |
|
199 | - 'contracts' => DOL_URL_ROOT . '/contrat/list.php?mainmenu=commercial&leftmenu=contracts', |
|
200 | - 'interventions' => DOL_URL_ROOT . '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', |
|
201 | - 'supplier_orders' => DOL_URL_ROOT . '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', |
|
202 | - 'supplier_invoices' => DOL_URL_ROOT . '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', |
|
203 | - 'supplier_proposals' => DOL_URL_ROOT . '/supplier_proposal/list.php?mainmenu=commercial&leftmenu=', |
|
204 | - 'projects' => DOL_URL_ROOT . '/projet/list.php?mainmenu=project', |
|
205 | - 'expensereports' => DOL_URL_ROOT . '/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', |
|
206 | - 'holidays' => DOL_URL_ROOT . '/holiday/list.php?mainmenu=hrm&leftmenu=holiday', |
|
207 | - 'ticket' => DOL_URL_ROOT . '/ticket/list.php?leftmenu=ticket', |
|
208 | - 'knowledgebase' => DOL_URL_ROOT . '/knowledgemanagement/knowledgerecord_list.php?leftmenu=knowledgebase', |
|
209 | - 'dolresource' => DOL_URL_ROOT . '/resource/list.php?mainmenu=agenda', |
|
187 | + 'users' => DOL_URL_ROOT.'/user/list.php', |
|
188 | + 'members' => DOL_URL_ROOT.'/adherents/list.php?statut=1&mainmenu=members', |
|
189 | + 'customers' => DOL_URL_ROOT.'/societe/list.php?type=c&mainmenu=companies', |
|
190 | + 'prospects' => DOL_URL_ROOT.'/societe/list.php?type=p&mainmenu=companies', |
|
191 | + 'suppliers' => DOL_URL_ROOT.'/societe/list.php?type=f&mainmenu=companies', |
|
192 | + 'contacts' => DOL_URL_ROOT.'/contact/list.php?mainmenu=companies', |
|
193 | + 'products' => DOL_URL_ROOT.'/product/list.php?type=0&mainmenu=products', |
|
194 | + 'services' => DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products', |
|
195 | + 'proposals' => DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', |
|
196 | + 'orders' => DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial&leftmenu=orders', |
|
197 | + 'invoices' => DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', |
|
198 | + 'donations' => DOL_URL_ROOT.'/don/list.php?leftmenu=donations', |
|
199 | + 'contracts' => DOL_URL_ROOT.'/contrat/list.php?mainmenu=commercial&leftmenu=contracts', |
|
200 | + 'interventions' => DOL_URL_ROOT.'/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', |
|
201 | + 'supplier_orders' => DOL_URL_ROOT.'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', |
|
202 | + 'supplier_invoices' => DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', |
|
203 | + 'supplier_proposals' => DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=', |
|
204 | + 'projects' => DOL_URL_ROOT.'/projet/list.php?mainmenu=project', |
|
205 | + 'expensereports' => DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', |
|
206 | + 'holidays' => DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday', |
|
207 | + 'ticket' => DOL_URL_ROOT.'/ticket/list.php?leftmenu=ticket', |
|
208 | + 'knowledgebase' => DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_list.php?leftmenu=knowledgebase', |
|
209 | + 'dolresource' => DOL_URL_ROOT.'/resource/list.php?mainmenu=agenda', |
|
210 | 210 | ); |
211 | 211 | $titres = array( |
212 | 212 | 'users' => "Users", |
@@ -277,10 +277,10 @@ discard block |
||
277 | 277 | $langs->load(empty($langfile[$val]) ? $val : $langfile[$val]); |
278 | 278 | |
279 | 279 | $text = $langs->trans($titres[$val]); |
280 | - $boxstatItem .= '<a href="' . $links[$val] . '" class="boxstatsindicator thumbstat nobold nounderline">'; |
|
280 | + $boxstatItem .= '<a href="'.$links[$val].'" class="boxstatsindicator thumbstat nobold nounderline">'; |
|
281 | 281 | $boxstatItem .= '<div class="boxstats">'; |
282 | - $boxstatItem .= '<span class="boxstatstext" title="' . dol_escape_htmltag($text) . '">' . $text . '</span><br>'; |
|
283 | - $boxstatItem .= '<span class="boxstatsindicator">' . img_object("", $board->picto, 'class="inline-block"') . ' ' . (!empty($board->nb[$val]) ? $board->nb[$val] : 0) . '</span>'; |
|
282 | + $boxstatItem .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>'; |
|
283 | + $boxstatItem .= '<span class="boxstatsindicator">'.img_object("", $board->picto, 'class="inline-block"').' '.(!empty($board->nb[$val]) ? $board->nb[$val] : 0).'</span>'; |
|
284 | 284 | $boxstatItem .= '</div>'; |
285 | 285 | $boxstatItem .= '</a>'; |
286 | 286 |
@@ -359,10 +359,10 @@ discard block |
||
359 | 359 | if (getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { |
360 | 360 | if ($tmpsource && $REF) { |
361 | 361 | // Use the source in the hash to avoid duplicates if the references are identical |
362 | - $tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $tmpsource.$REF, $SECUREKEY, '2'); |
|
362 | + $tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$tmpsource.$REF, $SECUREKEY, '2'); |
|
363 | 363 | // Do a second test for retro-compatibility (token may have been hashed with membersubscription in external module) |
364 | 364 | if ($tmpsource != $source) { |
365 | - $tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $source.$REF, $SECUREKEY, '2'); |
|
365 | + $tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$source.$REF, $SECUREKEY, '2'); |
|
366 | 366 | } |
367 | 367 | } else { |
368 | 368 | $tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), $SECUREKEY, '2'); |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $tokenisok = (getDolGlobalString('PAYMENT_SECURITY_TOKEN') == $SECUREKEY); |
372 | 372 | } |
373 | 373 | |
374 | - if (! $tokenisok) { |
|
374 | + if (!$tokenisok) { |
|
375 | 375 | if (!getDolGlobalString('PAYMENT_SECURITY_ACCEPT_ANY_TOKEN')) { |
376 | 376 | $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility |
377 | 377 | } else { |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | $paramcreditor = 'ONLINE_PAYMENT_CREDITOR'; |
402 | 402 | $paramcreditorlong = 'ONLINE_PAYMENT_CREDITOR_'.$suffix; |
403 | 403 | if (getDolGlobalString($paramcreditorlong)) { |
404 | - $creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show |
|
404 | + $creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show |
|
405 | 405 | } elseif (getDolGlobalString($paramcreditor)) { |
406 | - $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show |
|
406 | + $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | $mesg = ''; |
@@ -792,13 +792,13 @@ discard block |
||
792 | 792 | } |
793 | 793 | |
794 | 794 | if ($error) { |
795 | - $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
796 | - $_SESSION['paymentkosessioncode'] = $randomseckey; // key between newpayment.php to paymentko.php |
|
795 | + $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
796 | + $_SESSION['paymentkosessioncode'] = $randomseckey; // key between newpayment.php to paymentko.php |
|
797 | 797 | |
798 | 798 | $urlko .= '&paymentkosessioncode='.urlencode($randomseckey); |
799 | 799 | } else { |
800 | - $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
801 | - $_SESSION['paymentoksessioncode'] = $randomseckey; // key between newpayment.php to paymentok.php |
|
800 | + $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
801 | + $_SESSION['paymentoksessioncode'] = $randomseckey; // key between newpayment.php to paymentok.php |
|
802 | 802 | |
803 | 803 | $urlok .= '&paymentoksessioncode='.urlencode($randomseckey); |
804 | 804 | } |
@@ -845,8 +845,8 @@ discard block |
||
845 | 845 | setEventMessages($paymentintent->status, null, 'errors'); |
846 | 846 | $action = ''; |
847 | 847 | |
848 | - $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
849 | - $_SESSION['paymentkosessioncode'] = $randomseckey; // key between newpayment.php to paymentko.php |
|
848 | + $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
849 | + $_SESSION['paymentkosessioncode'] = $randomseckey; // key between newpayment.php to paymentko.php |
|
850 | 850 | |
851 | 851 | $urlko .= '&paymentkosessioncode='.urlencode($randomseckey); |
852 | 852 | } else { |
@@ -872,8 +872,8 @@ discard block |
||
872 | 872 | |
873 | 873 | dol_syslog("StatusOfRetrievedIntent is succeeded for amount = ".$amount." currency = ".$currency, LOG_DEBUG, 0, '_payment'); |
874 | 874 | |
875 | - $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
876 | - $_SESSION['paymentoksessioncode'] = $randomseckey; // key between newpayment.php to paymentok.php |
|
875 | + $randomseckey = getRandomPassword(true, null, 20); // TODO Generate a key including fulltag to avoid forging URL. |
|
876 | + $_SESSION['paymentoksessioncode'] = $randomseckey; // key between newpayment.php to paymentok.php |
|
877 | 877 | |
878 | 878 | $urlok .= '&paymentoksessioncode='.urlencode($randomseckey); |
879 | 879 | } |
@@ -883,8 +883,8 @@ discard block |
||
883 | 883 | $remoteip = getUserRemoteIP(); |
884 | 884 | |
885 | 885 | $_SESSION["onlinetoken"] = $stripeToken; |
886 | - $_SESSION["FinalPaymentAmt"] = $amount; // amount really paid (coming from Stripe). Will be used for check in paymentok.php. |
|
887 | - $_SESSION["currencyCodeType"] = $currency; // currency really used for payment (coming from Stripe). Will be used for check in paymentok.php. |
|
886 | + $_SESSION["FinalPaymentAmt"] = $amount; // amount really paid (coming from Stripe). Will be used for check in paymentok.php. |
|
887 | + $_SESSION["currencyCodeType"] = $currency; // currency really used for payment (coming from Stripe). Will be used for check in paymentok.php. |
|
888 | 888 | $_SESSION["paymentType"] = ''; |
889 | 889 | $_SESSION['ipaddress'] = ($remoteip ? $remoteip : 'unknown'); // Payer ip |
890 | 890 | $_SESSION['payerID'] = is_object($customer) ? $customer->id : ''; |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | |
932 | 932 | $head = ''; |
933 | 933 | if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) { |
934 | - $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.(!empty($getpostlang) ? $getpostlang : $langs->defaultlang).'">'."\n"; |
|
934 | + $head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.(!empty($getpostlang) ? $getpostlang : $langs->defaultlang).'">'."\n"; |
|
935 | 935 | } |
936 | 936 | |
937 | 937 | $conf->dol_hide_topmenu = 1; |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | // Output html code for logo |
1005 | 1005 | if ($ws) { |
1006 | 1006 | // Look for a personalized header file (htmlheaderpayment.html) if the payment system is called from a website |
1007 | - $filehtmlheader = dol_sanitizePathName(DOL_DATA_ROOT . ($conf->entity > 1 ? '/' . $conf->entity : '') . '/website/' . $ws . '/htmlheaderpayment.html'); |
|
1007 | + $filehtmlheader = dol_sanitizePathName(DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/'.$ws.'/htmlheaderpayment.html'); |
|
1008 | 1008 | if (dol_is_file($filehtmlheader)) { |
1009 | 1009 | print file_get_contents(dol_osencode($filehtmlheader)); |
1010 | 1010 | } |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | if (preg_match('/^\((.*)\)$/', getDolGlobalString('PAYMENT_NEWFORM_TEXT'), $reg)) { |
1066 | 1066 | $text .= $langs->trans($reg[1])."<br>\n"; |
1067 | 1067 | } else { |
1068 | - $text .= getDolGlobalString('PAYMENT_NEWFORM_TEXT') . "<br>\n"; |
|
1068 | + $text .= getDolGlobalString('PAYMENT_NEWFORM_TEXT')."<br>\n"; |
|
1069 | 1069 | } |
1070 | 1070 | $text = '<tr><td align="center"><br>'.$text.'<br></td></tr>'."\n"; |
1071 | 1071 | } |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | print $text; |
1077 | 1077 | |
1078 | 1078 | // Output payment summary form |
1079 | -print '<tr><td align="center">'; // class=center does not have the payment button centered so we keep align here. |
|
1079 | +print '<tr><td align="center">'; // class=center does not have the payment button centered so we keep align here. |
|
1080 | 1080 | print '<table class="centpercent left" id="tablepublicpayment">'; |
1081 | 1081 | print '<tr class="hideonsmartphone"><td colspan="2" align="left" class="opacitymedium">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n"; |
1082 | 1082 | |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | // Currency |
1119 | 1119 | print ' <b>'.$langs->trans("Currency".$currency).'</b>'; |
1120 | 1120 | } else { |
1121 | - print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1121 | + print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1122 | 1122 | print '<input type="hidden" name="amount" value="'.$amount.'">'; |
1123 | 1123 | print '<input type="hidden" name="newamount" value="'.$amount.'">'; |
1124 | 1124 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | // Currency |
1220 | 1220 | print ' <b>'.$langs->trans("Currency".$currency).'</b>'; |
1221 | 1221 | } else { |
1222 | - print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1222 | + print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1223 | 1223 | print '<input type="hidden" name="amount" value="'.$amount.'">'; |
1224 | 1224 | print '<input type="hidden" name="newamount" value="'.$amount.'">'; |
1225 | 1225 | } |
@@ -1351,12 +1351,12 @@ discard block |
||
1351 | 1351 | print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">'; |
1352 | 1352 | print ' <b>'.$langs->trans("Currency".$currency).'</b>'; |
1353 | 1353 | } else { |
1354 | - print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1354 | + print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1355 | 1355 | print '<input type="hidden" name="amount" value="'.$amount.'">'; |
1356 | 1356 | print '<input type="hidden" name="newamount" value="'.$amount.'">'; |
1357 | 1357 | } |
1358 | 1358 | } else { |
1359 | - print '<b class="amount">'.price($object->total_ttc, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1359 | + print '<b class="amount">'.price($object->total_ttc, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1360 | 1360 | } |
1361 | 1361 | print '<input type="hidden" name="currency" value="'.$currency.'">'; |
1362 | 1362 | print '</td></tr>'."\n"; |
@@ -1560,7 +1560,7 @@ discard block |
||
1560 | 1560 | // Currency |
1561 | 1561 | print ' <b>'.$langs->trans("Currency".$currency).'</b>'; |
1562 | 1562 | } else { |
1563 | - print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1563 | + print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1564 | 1564 | print '<input type="hidden" name="amount" value="'.$amount.'">'; |
1565 | 1565 | print '<input type="hidden" name="newamount" value="'.$amount.'">'; |
1566 | 1566 | } |
@@ -1622,7 +1622,7 @@ discard block |
||
1622 | 1622 | $member = new Adherent($db); |
1623 | 1623 | $adht = new AdherentType($db); |
1624 | 1624 | |
1625 | - $result = $member->fetch(0, $ref, 0, '', true, true); // This fetch also ->last_subscription_amount |
|
1625 | + $result = $member->fetch(0, $ref, 0, '', true, true); // This fetch also ->last_subscription_amount |
|
1626 | 1626 | if ($result <= 0) { |
1627 | 1627 | $mesg = $member->error; |
1628 | 1628 | $error++; |
@@ -1726,7 +1726,7 @@ discard block |
||
1726 | 1726 | $newtypeid = (int) (GETPOSTISSET("typeid") ? GETPOSTINT("typeid") : $member->typeid); |
1727 | 1727 | if (getDolGlobalString('MEMBER_ALLOW_CHANGE_OF_TYPE')) { |
1728 | 1728 | $typeid = $newtypeid; |
1729 | - $adht->fetch($typeid); // Reload with the new type id |
|
1729 | + $adht->fetch($typeid); // Reload with the new type id |
|
1730 | 1730 | } |
1731 | 1731 | |
1732 | 1732 | $caneditamount = $adht->caneditamount; |
@@ -1786,7 +1786,7 @@ discard block |
||
1786 | 1786 | print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount"); |
1787 | 1787 | // This place no longer allows amount edition |
1788 | 1788 | if (getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO')) { |
1789 | - print ' - <a href="' . getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>'; |
|
1789 | + print ' - <a href="'.getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>'; |
|
1790 | 1790 | } |
1791 | 1791 | print '</td><td class="CTableRow2">'; |
1792 | 1792 | |
@@ -1800,9 +1800,9 @@ discard block |
||
1800 | 1800 | print '<input type="text" class="width75" name="newamount" value="'.price($amount, 1, $langs, 1, -1, -1).'">'; |
1801 | 1801 | } |
1802 | 1802 | } else { |
1803 | - print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1803 | + print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1804 | 1804 | if ($minimumamount > $amount) { |
1805 | - print ' <span class="opacitymedium small">'. $langs->trans("AmountIsLowerToMinimumNotice", price($minimumamount, 1, $langs, 1, -1, -1, $currency)).'</span>'; |
|
1805 | + print ' <span class="opacitymedium small">'.$langs->trans("AmountIsLowerToMinimumNotice", price($minimumamount, 1, $langs, 1, -1, -1, $currency)).'</span>'; |
|
1806 | 1806 | } |
1807 | 1807 | print '<input type="hidden" name="newamount" value="'.$amount.'">'; |
1808 | 1808 | } |
@@ -1923,7 +1923,7 @@ discard block |
||
1923 | 1923 | print ' ('.$langs->trans("ToComplete"); |
1924 | 1924 | } |
1925 | 1925 | if (getDolGlobalString('DONATION_EXT_URL_SUBSCRIPTION_INFO')) { |
1926 | - print ' - <a href="' . getDolGlobalString('DONATION_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>'; |
|
1926 | + print ' - <a href="'.getDolGlobalString('DONATION_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>'; |
|
1927 | 1927 | } |
1928 | 1928 | if (!getDolGlobalString('DONATION_NEWFORM_AMOUNT')) { |
1929 | 1929 | print ')'; |
@@ -1961,7 +1961,7 @@ discard block |
||
1961 | 1961 | $valtoshow = max(getDolGlobalString('DONATION_MIN_AMOUNT'), $valtoshow); |
1962 | 1962 | $amount = $valtoshow; |
1963 | 1963 | } |
1964 | - print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1964 | + print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
1965 | 1965 | print '<input type="hidden" name="amount" value="'.$valtoshow.'">'; |
1966 | 1966 | print '<input type="hidden" name="newamount" value="'.$valtoshow.'">'; |
1967 | 1967 | } |
@@ -2037,7 +2037,7 @@ discard block |
||
2037 | 2037 | print '</b>'; |
2038 | 2038 | print '</td></tr>'."\n"; |
2039 | 2039 | |
2040 | - if (! is_object($attendee->project)) { |
|
2040 | + if (!is_object($attendee->project)) { |
|
2041 | 2041 | $text = 'ErrorProjectNotFound'; |
2042 | 2042 | } else { |
2043 | 2043 | $text = $langs->trans("PaymentEvent").' - '.$attendee->project->title; |
@@ -2054,7 +2054,7 @@ discard block |
||
2054 | 2054 | print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount"); |
2055 | 2055 | print '</td><td class="CTableRow2">'; |
2056 | 2056 | $valtoshow = $amount; |
2057 | - print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
2057 | + print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
2058 | 2058 | print '<input type="hidden" name="amount" value="'.$valtoshow.'">'; |
2059 | 2059 | print '<input type="hidden" name="newamount" value="'.$valtoshow.'">'; |
2060 | 2060 | print '<input type="hidden" name="currency" value="'.$currency.'">'; |
@@ -2138,7 +2138,7 @@ discard block |
||
2138 | 2138 | print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount"); |
2139 | 2139 | print '</td><td class="CTableRow2">'; |
2140 | 2140 | $valtoshow = $amount; |
2141 | - print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
2141 | + print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency |
|
2142 | 2142 | print '<input type="hidden" name="amount" value="'.$valtoshow.'">'; |
2143 | 2143 | print '<input type="hidden" name="newamount" value="'.$valtoshow.'">'; |
2144 | 2144 | print '<input type="hidden" name="currency" value="'.$currency.'">'; |
@@ -2396,7 +2396,7 @@ discard block |
||
2396 | 2396 | |
2397 | 2397 | //print '<br>'; |
2398 | 2398 | |
2399 | - print '<!-- Show Stripe form payment-form STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = ' . getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION').' STRIPE_USE_NEW_CHECKOUT = ' . getDolGlobalString('STRIPE_USE_NEW_CHECKOUT').' -->'."\n"; |
|
2399 | + print '<!-- Show Stripe form payment-form STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = '.getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION').' STRIPE_USE_NEW_CHECKOUT = '.getDolGlobalString('STRIPE_USE_NEW_CHECKOUT').' -->'."\n"; |
|
2400 | 2400 | print '<form action="'.$_SERVER['REQUEST_URI'].'" method="POST" id="payment-form">'."\n"; |
2401 | 2401 | |
2402 | 2402 | print '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
@@ -194,12 +194,12 @@ discard block |
||
194 | 194 | if (!empty($user->email)) { |
195 | 195 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
196 | 196 | } else { |
197 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
197 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
198 | 198 | } |
199 | 199 | $replyto = $sendto; |
200 | 200 | $sendtocc = ''; |
201 | 201 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
202 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
202 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." should arrive in your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -297,12 +297,12 @@ discard block |
||
297 | 297 | if (!empty($user->email)) { |
298 | 298 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
299 | 299 | } else { |
300 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
300 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
301 | 301 | } |
302 | 302 | $replyto = $sendto; |
303 | 303 | $sendtocc = ''; |
304 | 304 | if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { |
305 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
305 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -348,19 +348,19 @@ discard block |
||
348 | 348 | dol_syslog("object = ".var_export($event->data, true)); |
349 | 349 | dol_syslog("object = ".var_export($event->data, true), LOG_DEBUG, 0, '_payment'); |
350 | 350 | |
351 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
351 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
352 | 352 | global $stripearrayofkeysbyenv; |
353 | 353 | $error = 0; |
354 | 354 | $object = $event->data->object; |
355 | - $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
355 | + $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
356 | 356 | $ipaddress = $object->metadata->ipaddress; |
357 | 357 | $now = dol_now(); |
358 | 358 | $currencyCodeType = strtoupper($object->currency); |
359 | 359 | $paymentmethodstripeid = $object->payment_method; |
360 | 360 | $customer_id = $object->customer; |
361 | 361 | $invoice_id = ""; |
362 | - $paymentTypeCode = ""; // payment type according to Stripe |
|
363 | - $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
362 | + $paymentTypeCode = ""; // payment type according to Stripe |
|
363 | + $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
364 | 364 | $payment_amount = 0; |
365 | 365 | $payment_amountInDolibarr = 0; |
366 | 366 | |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | $s = new \Stripe\StripeClient($stripeacc); |
433 | 433 | |
434 | 434 | $paymentmethodstripe = $s->paymentMethods->retrieve($paymentmethodstripeid); |
435 | - $paymentTypeCode = $paymentmethodstripe->type; |
|
435 | + $paymentTypeCode = $paymentmethodstripe->type; |
|
436 | 436 | if ($paymentTypeCode == "ban" || $paymentTypeCode == "sepa_debit") { |
437 | 437 | $paymentTypeCode = "PRE"; |
438 | 438 | } elseif ($paymentTypeCode == "card") { |
@@ -459,9 +459,9 @@ discard block |
||
459 | 459 | $paiement->datepaye = $now; |
460 | 460 | $paiement->date = $now; |
461 | 461 | if ($currencyCodeType == $conf->currency) { |
462 | - $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
462 | + $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
463 | 463 | } else { |
464 | - $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
464 | + $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
465 | 465 | |
466 | 466 | $postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')'; |
467 | 467 | $ispostactionok = -1; |
@@ -484,8 +484,8 @@ discard block |
||
484 | 484 | |
485 | 485 | $paiement->num_payment = ''; |
486 | 486 | $paiement->note_public = ''; |
487 | - $paiement->note_private = 'StripeSepa payment received by IPN webhook - ' . dol_print_date($now, 'standard') . ' (TZ server) using servicestatus=' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; |
|
488 | - $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
487 | + $paiement->note_private = 'StripeSepa payment received by IPN webhook - '.dol_print_date($now, 'standard').' (TZ server) using servicestatus='.$servicestatus.($ipaddress ? ' from ip '.$ipaddress : '').' - Transaction ID = '.$TRANSACTIONID; |
|
488 | + $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
489 | 489 | $paiement->ext_payment_site = $service; |
490 | 490 | |
491 | 491 | $ispaymentdone = 0; |
@@ -504,23 +504,23 @@ discard block |
||
504 | 504 | $db->begin(); |
505 | 505 | |
506 | 506 | if (!$error && !$ispaymentdone) { |
507 | - dol_syslog('* Record payment type PRE for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document.'); |
|
508 | - dol_syslog('* Record payment type PRE for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document.', LOG_DEBUG, 0, '_payment'); |
|
507 | + dol_syslog('* Record payment type PRE for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document.'); |
|
508 | + dol_syslog('* Record payment type PRE for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document.', LOG_DEBUG, 0, '_payment'); |
|
509 | 509 | |
510 | 510 | // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document |
511 | 511 | $paiement_id = $paiement->create($user, 1); |
512 | 512 | if ($paiement_id < 0) { |
513 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
513 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
514 | 514 | $ispostactionok = -1; |
515 | 515 | $error++; |
516 | 516 | |
517 | - dol_syslog("Failed to create the payment for invoice id " . $invoice_id); |
|
518 | - dol_syslog("Failed to create the payment for invoice id " . $invoice_id, LOG_DEBUG, 0, '_payment'); |
|
517 | + dol_syslog("Failed to create the payment for invoice id ".$invoice_id); |
|
518 | + dol_syslog("Failed to create the payment for invoice id ".$invoice_id, LOG_DEBUG, 0, '_payment'); |
|
519 | 519 | } else { |
520 | 520 | $postactionmessages[] = 'Payment created'; |
521 | 521 | |
522 | - dol_syslog("The payment has been created for invoice id " . $invoice_id); |
|
523 | - dol_syslog("The payment has been created for invoice id " . $invoice_id, LOG_DEBUG, 0, '_payment'); |
|
522 | + dol_syslog("The payment has been created for invoice id ".$invoice_id); |
|
523 | + dol_syslog("The payment has been created for invoice id ".$invoice_id, LOG_DEBUG, 0, '_payment'); |
|
524 | 524 | } |
525 | 525 | } |
526 | 526 | |
@@ -552,14 +552,14 @@ discard block |
||
552 | 552 | $label = '(CustomerInvoicePayment)'; |
553 | 553 | $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $customer_id, ''); |
554 | 554 | if ($result < 0) { |
555 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors); |
|
555 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors); |
|
556 | 556 | $ispostactionok = -1; |
557 | 557 | $error++; |
558 | 558 | } else { |
559 | 559 | $postactionmessages[] = 'Bank transaction of payment created (by ipn.php file)'; |
560 | 560 | } |
561 | 561 | } else { |
562 | - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; |
|
562 | + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; |
|
563 | 563 | $ispostactionok = -1; |
564 | 564 | $error++; |
565 | 565 | } |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | $error++; |
732 | 732 | } |
733 | 733 | |
734 | - if (! $error) { |
|
734 | + if (!$error) { |
|
735 | 735 | $db->commit(); |
736 | 736 | } else { |
737 | 737 | $db->rollback(); |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | $companypaymentmode->card_type = $event->data->object->card->branding; |
766 | 766 | |
767 | 767 | $companypaymentmode->owner_name = $event->data->object->billing_details->name; |
768 | - $companypaymentmode->proprio = $companypaymentmode->owner_name; // We may still need this formodulebuilder because name of field is "proprio" |
|
768 | + $companypaymentmode->proprio = $companypaymentmode->owner_name; // We may still need this formodulebuilder because name of field is "proprio" |
|
769 | 769 | |
770 | 770 | $companypaymentmode->exp_date_month = (int) $event->data->object->card->exp_month; |
771 | 771 | $companypaymentmode->exp_date_year = (int) $event->data->object->card->exp_year; |
@@ -862,12 +862,12 @@ discard block |
||
862 | 862 | $paymentmethodstripeid = $object->payment_method; |
863 | 863 | $customer_id = $object->customer; |
864 | 864 | $reason = $object->reason; |
865 | - $amountdisputestripe = $object->amoutndispute; // In stripe format |
|
866 | - $amountdispute = $amountdisputestripe; // In real currency format |
|
865 | + $amountdisputestripe = $object->amoutndispute; // In stripe format |
|
866 | + $amountdispute = $amountdisputestripe; // In real currency format |
|
867 | 867 | |
868 | 868 | $invoice_id = 0; |
869 | - $paymentTypeCode = ""; // payment type according to Stripe |
|
870 | - $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
869 | + $paymentTypeCode = ""; // payment type according to Stripe |
|
870 | + $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr |
|
871 | 871 | $payment_amount = 0; |
872 | 872 | $payment_amountInDolibarr = 0; |
873 | 873 | |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | $paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching |
950 | 950 | */ |
951 | 951 | $paiement->paiementid = dol_getIdFromCode($db, 'PRE', 'c_paiement', 'code', 'id', 1); |
952 | - $paiement->num_payment = $object->id; // A string like 'du_...' |
|
952 | + $paiement->num_payment = $object->id; // A string like 'du_...' |
|
953 | 953 | $paiement->note_public = 'Fund withdrawn by bank. Reason: '.$reason; |
954 | 954 | $paiement->note_private = ''; |
955 | 955 | $paiement->fk_account = $accountfrom->id; |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | $error++; |
966 | 966 | } |
967 | 967 | |
968 | - if (! $error && $tmpinvoice->status == Facture::STATUS_CLOSED) { |
|
968 | + if (!$error && $tmpinvoice->status == Facture::STATUS_CLOSED) { |
|
969 | 969 | // Switch back the invoice to status validated |
970 | 970 | $result = $tmpinvoice->setStatut(Facture::STATUS_VALIDATED); |
971 | 971 | if ($result < 0) { |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | } |
975 | 975 | } |
976 | 976 | |
977 | - if (! $error) { |
|
977 | + if (!$error) { |
|
978 | 978 | $paiement_id = $paiement->create($user, 0, $tmpinvoice->thirdparty); // This include regenerating documents |
979 | 979 | if ($paiement_id < 0) { |
980 | 980 | $errormsg = $paiement->error.implode(', ', $paiement->errors); |