@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | $this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace'; |
| 140 | 140 | |
| 141 | 141 | // For dolistore modules |
| 142 | - $this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/'); // 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/' |
|
| 142 | + $this->dolistore_api_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV', 'https://www.dolistore.com/api/'); // 'https://www.dolistore.com/api/', 'https://admin2.dolibarr.org/api/index.php/marketplace/' |
|
| 143 | 143 | $this->dolistore_api_key = getDolGlobalString('MAIN_MODULE_DOLISTORE_API_KEY', 'dolistorepublicapi'); |
| 144 | - $this->shop_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com'); |
|
| 144 | + $this->shop_url = getDolGlobalString('MAIN_MODULE_DOLISTORE_SHOP_URL', 'https://www.dolistore.com'); |
|
| 145 | 145 | |
| 146 | 146 | // For community modules |
| 147 | 147 | $this->file_source_url = "https://raw.githubusercontent.com/Dolibarr/dolibarr-community-modules/refs/heads/main/index.yaml"; |
@@ -204,12 +204,12 @@ discard block |
||
| 204 | 204 | $httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - $url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource; |
|
| 207 | + $url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource; |
|
| 208 | 208 | |
| 209 | 209 | $options['apikey'] = $this->dolistore_api_key; |
| 210 | 210 | |
| 211 | 211 | if ($options) { |
| 212 | - $url .= '?' . http_build_query($options); |
|
| 212 | + $url .= '?'.http_build_query($options); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | $response = getURLContent($url, 'GET', '', 1, $httpheader, array('https'), 0, -1, 5, 5); |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | $modules = array(); |
| 252 | 252 | |
| 253 | 253 | if (!empty($this->cache_file) && file_exists($this->cache_file)) { |
| 254 | - dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG); |
|
| 254 | + dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG); |
|
| 255 | 255 | |
| 256 | 256 | $content = file_get_contents($this->cache_file); |
| 257 | 257 | if ($content !== false) { |
| 258 | 258 | $modules = $this->readYaml($content); |
| 259 | 259 | } else { |
| 260 | - dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR); |
|
| 260 | + dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR); |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
@@ -285,20 +285,20 @@ discard block |
||
| 285 | 285 | if (isset($resCategories['response']) && is_array($resCategories['response'])) { |
| 286 | 286 | $organized_tree = $resCategories['response']; |
| 287 | 287 | } else { |
| 288 | - return $html ; |
|
| 288 | + return $html; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $html = ''; |
| 292 | 292 | foreach ($organized_tree as $key => $value) { |
| 293 | 293 | if ($value['label'] != "Versions" && $value['label'] != "Specials") { |
| 294 | - $html .= '<li' . ($current == $value['rowid'] ? ' class="active"' : '') . '>'; |
|
| 295 | - $html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>'; |
|
| 294 | + $html .= '<li'.($current == $value['rowid'] ? ' class="active"' : '').'>'; |
|
| 295 | + $html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>'; |
|
| 296 | 296 | if (isset($value['children'])) { |
| 297 | 297 | $html .= '<ul>'; |
| 298 | 298 | usort($value['children'], $this->buildSorter('position')); |
| 299 | 299 | foreach ($value['children'] as $key_children => $value_children) { |
| 300 | - $html .= '<li' . ($current == $value_children['rowid'] ? ' class="active"' : '') . '>'; |
|
| 301 | - $html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>'; |
|
| 300 | + $html .= '<li'.($current == $value_children['rowid'] ? ' class="active"' : '').'>'; |
|
| 301 | + $html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>'; |
|
| 302 | 302 | $html .= '</li>'; |
| 303 | 303 | } |
| 304 | 304 | $html .= '</ul>'; |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | $html = ""; |
| 323 | 323 | $last_month = dol_now() - (30 * 24 * 60 * 60); |
| 324 | - $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
| 324 | + $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
| 325 | 325 | |
| 326 | 326 | $this->products = array(); |
| 327 | 327 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | $this->no_page = $options['no_page'] ?? 1; |
| 331 | 331 | $this->search = $options['search'] ?? ''; |
| 332 | 332 | |
| 333 | - $this->per_page = 11; // We fix number of products per page to 11 |
|
| 333 | + $this->per_page = 11; // We fix number of products per page to 11 |
|
| 334 | 334 | |
| 335 | 335 | // Length of $search must be at least 2 characters |
| 336 | 336 | if (!empty($this->search) && strlen(str_replace(' ', '', (string) $this->search)) < 2) { |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $fileProducts = array(); |
| 372 | 372 | $fileProductsTotal = 0; |
| 373 | 373 | if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) { |
| 374 | - $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
| 374 | + $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
| 375 | 375 | |
| 376 | 376 | $fileProducts = $this->adaptData($fileProducts, 'githubcommunity'); |
| 377 | 377 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | $download_link .= img_picto('', 'file-code', 'class="size2x paddingright colorgrey"'); |
| 430 | 430 | $download_link .= '</a>'; |
| 431 | 431 | |
| 432 | - $urlview = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
| 432 | + $urlview = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
| 433 | 433 | if ($urlview) { |
| 434 | 434 | $download_link .= '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'" rel="noopener noreferrer">'; |
| 435 | 435 | $download_link .= img_picto('', 'url', 'class="size2x"'); |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | } elseif ($product['source'] === 'dolistore') { |
| 450 | - $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id']; |
|
| 450 | + $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$product['id']; |
|
| 451 | 451 | $download_link = '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$this->shop_url.'/product.php?id='.((int) $product["id"]).'">'; |
| 452 | 452 | $download_link .= img_picto('', 'url', 'class="size2x"'); |
| 453 | 453 | $download_link .= '</a>'; |
@@ -505,12 +505,12 @@ discard block |
||
| 505 | 505 | // Output the line |
| 506 | 506 | $html .= '<tr class="app oddeven nohover '.dol_escape_htmltag($compatible).'">'; |
| 507 | 507 | $html .= '<td class="center width150"><div class="newAppParent">'; |
| 508 | - $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
| 508 | + $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
| 509 | 509 | $html .= '</div></td>'; |
| 510 | 510 | $html .= '<td class="margeCote"><h2 class="appTitle">'; |
| 511 | 511 | $html .= dolPrintHTML(dol_string_nohtmltag($product["label"])); |
| 512 | 512 | $html .= '<br><small>'; |
| 513 | - $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
| 513 | + $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
| 514 | 514 | $html .= '</small></h2>'; |
| 515 | 515 | $html .= '<small> '; |
| 516 | 516 | if (empty($product['tms'])) { |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | $this->numberOfProducts = count($this->products); |
| 545 | 545 | |
| 546 | - return $html ; |
|
| 546 | + return $html; |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | /** |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | * @param array<string, mixed> $b |
| 561 | 561 | * @return int |
| 562 | 562 | */ |
| 563 | - function (array $a, array $b) use ($key) { |
|
| 563 | + function(array $a, array $b) use ($key) { |
|
| 564 | 564 | $valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : ''; |
| 565 | 565 | $valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : ''; |
| 566 | 566 | |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | $pagelist .= '<li class="pagination">'; |
| 722 | 722 | $pagelist .= '<label for="page_input">Page </label>'; |
| 723 | 723 | if ($this->categorie != 0) { |
| 724 | - $pagelist .= '<input type="hidden" name="categorie" value="' . $this->categorie . '">'; |
|
| 724 | + $pagelist .= '<input type="hidden" name="categorie" value="'.$this->categorie.'">'; |
|
| 725 | 725 | } |
| 726 | 726 | $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.'">'; |
| 727 | 727 | $pagelist .= ' / '.$nbpages; |
@@ -771,17 +771,17 @@ discard block |
||
| 771 | 771 | } |
| 772 | 772 | |
| 773 | 773 | // Get the predefined error message or use a default one |
| 774 | - $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code']; |
|
| 774 | + $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code']; |
|
| 775 | 775 | |
| 776 | 776 | // Append error details if available |
| 777 | 777 | if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) { |
| 778 | 778 | foreach ($request['response']['errors'] as $error) { |
| 779 | - $error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message']; |
|
| 779 | + $error_message .= ' - (Code '.$error['code'].'): '.$error['message']; |
|
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | if (!empty($request['curl_error_msg'])) { |
| 784 | - $error_message .= ' - ' . $request['curl_error_msg']; |
|
| 784 | + $error_message .= ' - '.$request['curl_error_msg']; |
|
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | // Return the formatted error message |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | if (!file_exists($cache_file) || filemtime($cache_file) < (dol_now() - $cache_time)) { |
| 810 | 810 | // We get remote url |
| 811 | 811 | $addheaders = array(); |
| 812 | - $result = getURLContent($file_source_url, 'GET', '', 1, $addheaders); // TODO Force timeout to 5 s on both connect and response. |
|
| 812 | + $result = getURLContent($file_source_url, 'GET', '', 1, $addheaders); // TODO Force timeout to 5 s on both connect and response. |
|
| 813 | 813 | if (!empty($result) && $result['http_code'] == 200) { |
| 814 | 814 | $yaml = $result['content']; |
| 815 | 815 | file_put_contents($cache_file, $yaml); |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | continue; |
| 915 | 915 | } |
| 916 | 916 | $adaptedPackage = [ |
| 917 | - 'ref' => str_replace(' ', '', $package['modulename'] . '-' . $package['current_version'] . '@' . |
|
| 917 | + 'ref' => str_replace(' ', '', $package['modulename'].'-'.$package['current_version'].'@'. |
|
| 918 | 918 | (array_key_exists('author', $package) ? $package['author'] : 'unkownauthor')), |
| 919 | 919 | 'label' => !empty($package['label'][substr($this->lang, 0, 2)]) |
| 920 | 920 | ? $package['label'][substr($this->lang, 0, 2)] |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | * |
| 1020 | 1020 | * @return int |
| 1021 | 1021 | */ |
| 1022 | - static function ($a, $b) { |
|
| 1022 | + static function($a, $b) { |
|
| 1023 | 1023 | return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); |
| 1024 | 1024 | } |
| 1025 | 1025 | ); |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | * |
| 1035 | 1035 | * @return bool |
| 1036 | 1036 | */ |
| 1037 | - static function ($package) use ($options) { |
|
| 1037 | + static function($package) use ($options) { |
|
| 1038 | 1038 | return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false; |
| 1039 | 1039 | } |
| 1040 | 1040 | ); |
@@ -1050,7 +1050,7 @@ discard block |
||
| 1050 | 1050 | * |
| 1051 | 1051 | * @return bool |
| 1052 | 1052 | */ |
| 1053 | - static function ($package) use ($options) { |
|
| 1053 | + static function($package) use ($options) { |
|
| 1054 | 1054 | return in_array($options['categorieid'], $package['category']); |
| 1055 | 1055 | } |
| 1056 | 1056 | ); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $id = GETPOSTINT('id'); |
| 112 | 112 | $rowid = GETPOST('rowid', 'alpha'); |
| 113 | -$entity = GETPOST('entity', 'alpha'); // Do not use GETPOSTINT here. Should be '', 0 or >0. |
|
| 113 | +$entity = GETPOST('entity', 'alpha'); // Do not use GETPOSTINT here. Should be '', 0 or >0. |
|
| 114 | 114 | $code = GETPOST('code', 'alpha'); |
| 115 | 115 | $from = GETPOST('from', 'alpha'); |
| 116 | 116 | |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | $tabcond[DICT_STCOMM] = isModEnabled("societe"); |
| 580 | 580 | $tabcond[DICT_HOLIDAY_TYPES] = isModEnabled('holiday'); |
| 581 | 581 | $tabcond[DICT_LEAD_STATUS] = isModEnabled('project'); |
| 582 | -$tabcond[DICT_FORMAT_CARDS] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('member')); // stickers format dictionary |
|
| 582 | +$tabcond[DICT_FORMAT_CARDS] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('member')); // stickers format dictionary |
|
| 583 | 583 | $tabcond[DICT_INVOICE_SUBTYPE] = ((isModEnabled('invoice') || isModEnabled('supplier_invoice')) && $mysoc->country_code == 'GR'); |
| 584 | 584 | $tabcond[DICT_HRM_PUBLIC_HOLIDAY] = (isModEnabled('holiday') || isModEnabled('hrm')); |
| 585 | 585 | $tabcond[DICT_HRM_DEPARTMENT] = isModEnabled('hrm'); |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | 'project_task' => img_picto('', 'projecttask', 'class="pictofixedwidth"').$langs->trans('Task'), |
| 717 | 717 | 'propal' => img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans('Proposal'), |
| 718 | 718 | 'commande' => img_picto('', 'order', 'class="pictofixedwidth"').$langs->trans('Order'), |
| 719 | - 'shipping' => img_picto('', 'dolly', 'class="pictofixedwidth"') . $langs->trans('Shipment'), |
|
| 719 | + 'shipping' => img_picto('', 'dolly', 'class="pictofixedwidth"').$langs->trans('Shipment'), |
|
| 720 | 720 | 'facture' => img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('Bill'), |
| 721 | 721 | 'fichinter' => img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterventionCard'), |
| 722 | 722 | 'contrat' => img_picto('', 'contract', 'class="pictofixedwidth"').$langs->trans('Contract'), |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | if ($value == 'price' || preg_match('/^amount/i', $value)) { |
| 998 | 998 | $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); |
| 999 | 999 | } elseif ($value == 'taux' || $value == 'localtax1') { |
| 1000 | - $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
| 1000 | + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
| 1001 | 1001 | } elseif ($value == 'entity') { |
| 1002 | 1002 | $_POST[$keycode] = getEntity($tablename); |
| 1003 | 1003 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | if ($field == 'price' || preg_match('/^amount/i', $field)) { |
| 1067 | 1067 | $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); |
| 1068 | 1068 | } elseif ($field == 'taux' || $field == 'localtax1') { |
| 1069 | - $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
| 1069 | + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z |
|
| 1070 | 1070 | } elseif ($field == 'entity') { |
| 1071 | 1071 | $_POST[$keycode] = getEntity($tablename); |
| 1072 | 1072 | } |
@@ -2645,7 +2645,7 @@ discard block |
||
| 2645 | 2645 | } |
| 2646 | 2646 | // Show value for field |
| 2647 | 2647 | if ($showfield) { |
| 2648 | - print '<!-- field value '. $value .' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dolPrintHTMLForAttribute($titletoshow).'"' : '').'>'.$valuetoshow.'</td>'; |
|
| 2648 | + print '<!-- field value '.$value.' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dolPrintHTMLForAttribute($titletoshow).'"' : '').'>'.$valuetoshow.'</td>'; |
|
| 2649 | 2649 | } |
| 2650 | 2650 | } |
| 2651 | 2651 | |
@@ -2841,7 +2841,7 @@ discard block |
||
| 2841 | 2841 | // Special case for c_actioncomm (field that should not be modified) |
| 2842 | 2842 | $hidden = (!empty($obj->{$value}) ? $obj->{$value} : ''); |
| 2843 | 2843 | print '<td>'; |
| 2844 | - print '<input type="hidden" name="'. $value .'" value="'.$hidden.'">'; |
|
| 2844 | + print '<input type="hidden" name="'.$value.'" value="'.$hidden.'">'; |
|
| 2845 | 2845 | print $langs->trans($hidden); |
| 2846 | 2846 | print '</td>'; |
| 2847 | 2847 | } elseif ($value == 'country') { |
@@ -2862,7 +2862,7 @@ discard block |
||
| 2862 | 2862 | if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate) |
| 2863 | 2863 | $country_id = (!empty($obj->{$value}) ? $obj->{$value} : 0); |
| 2864 | 2864 | print '<td class="tdoverflowmax100">'; |
| 2865 | - print '<input type="hidden" name="'. $value .'" value="'.$country_id.'">'; |
|
| 2865 | + print '<input type="hidden" name="'.$value.'" value="'.$country_id.'">'; |
|
| 2866 | 2866 | print '</td>'; |
| 2867 | 2867 | } |
| 2868 | 2868 | } elseif ($value == 'region') { |
@@ -2872,7 +2872,7 @@ discard block |
||
| 2872 | 2872 | } elseif ($value == 'region_id') { |
| 2873 | 2873 | $region_id = (!empty($obj->{$value}) ? $obj->{$value} : 0); |
| 2874 | 2874 | print '<td>'; |
| 2875 | - print '<input type="hidden" name="'. $value .'" value="'.$region_id.'">'; |
|
| 2875 | + print '<input type="hidden" name="'.$value.'" value="'.$region_id.'">'; |
|
| 2876 | 2876 | print '</td>'; |
| 2877 | 2877 | } elseif ($value == 'department_buyer') { |
| 2878 | 2878 | if ($context == 'edit') { |
@@ -2946,7 +2946,7 @@ discard block |
||
| 2946 | 2946 | $class = "center"; // Fields aligned on right |
| 2947 | 2947 | } |
| 2948 | 2948 | print '<td class="'.$class.'">'; |
| 2949 | - print '<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} : '').'" size="3" name="'. $value .'">'; |
|
| 2949 | + print '<input type="text" class="flat" value="'.(isset($obj->{$value}) ? $obj->{$value} : '').'" size="3" name="'.$value.'">'; |
|
| 2950 | 2950 | print '</td>'; |
| 2951 | 2951 | } elseif (in_array($value, array('libelle_facture'))) { |
| 2952 | 2952 | print '<td>'; |
@@ -2956,7 +2956,7 @@ discard block |
||
| 2956 | 2956 | if ($tabname == 'c_payment_term') { |
| 2957 | 2957 | $langs->load("bills"); |
| 2958 | 2958 | if (isset($obj->code) && !empty($obj->code)) { |
| 2959 | - $transkey = "PaymentCondition" . strtoupper($obj->code); |
|
| 2959 | + $transkey = "PaymentCondition".strtoupper($obj->code); |
|
| 2960 | 2960 | if ($langs->trans($transkey) != $transkey) { |
| 2961 | 2961 | $transfound = 1; |
| 2962 | 2962 | print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis")); |
@@ -2964,21 +2964,21 @@ discard block |
||
| 2964 | 2964 | } |
| 2965 | 2965 | } |
| 2966 | 2966 | if (!$transfound) { |
| 2967 | - print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'. $value .'">'.(empty($obj->{$value}) ? '' : $obj->{$value}).'</textarea>'; |
|
| 2967 | + print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$value.'">'.(empty($obj->{$value}) ? '' : $obj->{$value}).'</textarea>'; |
|
| 2968 | 2968 | } else { |
| 2969 | - print '<input type="hidden" name="'. $value .'" value="'.$transkey.'">'; |
|
| 2969 | + print '<input type="hidden" name="'.$value.'" value="'.$transkey.'">'; |
|
| 2970 | 2970 | } |
| 2971 | 2971 | print '</td>'; |
| 2972 | 2972 | } elseif ($value == 'price' || preg_match('/^amount/i', (string) $value)) { |
| 2973 | - print '<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} : '')).'" name="'. $value .'"></td>'; |
|
| 2973 | + print '<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$value}) ? $obj->{$value} : '')).'" name="'.$value.'"></td>'; |
|
| 2974 | 2974 | } elseif ($value == 'code' && isset($obj->{$value})) { |
| 2975 | 2975 | print '<td>'; |
| 2976 | 2976 | if ($tabname == 'c_paiement' && in_array($obj->{$value}, array('LIQ', 'CB', 'CHQ', 'VIR'))) { |
| 2977 | 2977 | // Case of code that should not be modified |
| 2978 | - print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">'; |
|
| 2978 | + print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'.$value.'">'; |
|
| 2979 | 2979 | print $obj->{$value}; |
| 2980 | 2980 | } else { |
| 2981 | - print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">'; |
|
| 2981 | + print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'.$value.'">'; |
|
| 2982 | 2982 | } |
| 2983 | 2983 | print '</td>'; |
| 2984 | 2984 | } elseif ($value == 'unit') { |
@@ -3006,10 +3006,10 @@ discard block |
||
| 3006 | 3006 | if (isModEnabled('accounting')) { |
| 3007 | 3007 | $fieldname = $value; |
| 3008 | 3008 | $accountancy_account = (empty($obj->$fieldname) ? 0 : $obj->$fieldname); |
| 3009 | - print $formaccounting->select_account($accountancy_account, '.'. $value, 1, array(), 1, 1, 'maxwidth125 maxwidthonsmartphone'); |
|
| 3009 | + print $formaccounting->select_account($accountancy_account, '.'.$value, 1, array(), 1, 1, 'maxwidth125 maxwidthonsmartphone'); |
|
| 3010 | 3010 | } else { |
| 3011 | 3011 | $fieldname = $value; |
| 3012 | - print '<input type="text" class="flat minwidth100" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'. $value .'">'; |
|
| 3012 | + print '<input type="text" class="flat minwidth100" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'.$value.'">'; |
|
| 3013 | 3013 | } |
| 3014 | 3014 | print '</td>'; |
| 3015 | 3015 | } elseif ($value == 'fk_tva') { |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), |
| 109 | 109 | 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 1010), |
| 110 | 110 | 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 2, 'position' => 1000, 'default' => '0', 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '2' => 'InProgress', '3' => 'StatusMOProduced', '9' => 'Canceled')), |
| 111 | - 'fk_parent_line' => array('type' => 'integer:MoLine:mrp/class/mo.class.php', 'label' => 'ParentMo', 'enabled' => 1, 'visible' => 0, 'position' => 1020, 'default' => '0', 'notnull' => 0, 'index' => 1,'showoncombobox' => 0), |
|
| 111 | + 'fk_parent_line' => array('type' => 'integer:MoLine:mrp/class/mo.class.php', 'label' => 'ParentMo', 'enabled' => 1, 'visible' => 0, 'position' => 1020, 'default' => '0', 'notnull' => 0, 'index' => 1, 'showoncombobox' => 0), |
|
| 112 | 112 | ); |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | if (!$error) { |
| 353 | - $result = $this->createProduction($user, $notrigger); // Insert lines from BOM |
|
| 353 | + $result = $this->createProduction($user, $notrigger); // Insert lines from BOM |
|
| 354 | 354 | if ($result <= 0) { |
| 355 | 355 | $error++; |
| 356 | 356 | } |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | $oldQty = $this->oldQty; |
| 854 | 854 | $newQty = $this->qty; |
| 855 | 855 | if ($newQty != $oldQty && !empty($this->oldQty)) { |
| 856 | - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "mrp_production WHERE fk_mo = " . (int) $this->id; |
|
| 856 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."mrp_production WHERE fk_mo = ".(int) $this->id; |
|
| 857 | 857 | $resql = $this->db->query($sql); |
| 858 | 858 | if ($resql) { |
| 859 | 859 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | } |
| 943 | 943 | $productstatic = new Product($this->db); |
| 944 | 944 | |
| 945 | - $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consumed under the one to delete |
|
| 945 | + $arrayoflines = $this->fetchLinesLinked('consumed', $idline); // Get lines consumed under the one to delete |
|
| 946 | 946 | |
| 947 | 947 | $result = 0; |
| 948 | 948 | |
@@ -1045,7 +1045,7 @@ discard block |
||
| 1045 | 1045 | if (getDolGlobalString('MRP_MO_ADDON')) { |
| 1046 | 1046 | $mybool = false; |
| 1047 | 1047 | |
| 1048 | - $file = getDolGlobalString('MRP_MO_ADDON') . ".php"; |
|
| 1048 | + $file = getDolGlobalString('MRP_MO_ADDON').".php"; |
|
| 1049 | 1049 | $classname = getDolGlobalString('MRP_MO_ADDON'); |
| 1050 | 1050 | |
| 1051 | 1051 | // Include file with class |
@@ -1319,8 +1319,8 @@ discard block |
||
| 1319 | 1319 | return 1; |
| 1320 | 1320 | } |
| 1321 | 1321 | |
| 1322 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 1323 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php'; |
|
| 1322 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 1323 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; |
|
| 1324 | 1324 | $error = 0; |
| 1325 | 1325 | $langs->load('stocks'); |
| 1326 | 1326 | |
@@ -1441,13 +1441,13 @@ discard block |
||
| 1441 | 1441 | $datas['qty'] = '<br><b>'.$langs->trans('QtyToProduce').':</b> '.$this->qty; |
| 1442 | 1442 | } |
| 1443 | 1443 | if (!$nofetch && isset($this->fk_product)) { |
| 1444 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 1444 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 1445 | 1445 | $product = new Product($this->db); |
| 1446 | 1446 | $product->fetch($this->fk_product); |
| 1447 | 1447 | $datas['product'] = '<br><b>'.$langs->trans('Product').':</b> '.$product->getNomUrl(1, '', 0, -1, 1); |
| 1448 | 1448 | } |
| 1449 | 1449 | if (!$nofetch && isset($this->fk_warehouse)) { |
| 1450 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 1450 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 1451 | 1451 | $warehouse = new Entrepot($this->db); |
| 1452 | 1452 | $warehouse->fetch($this->fk_warehouse); |
| 1453 | 1453 | $datas['warehouse'] = '<br><b>'.$langs->trans('WarehouseForProduction').':</b> '.$warehouse->getNomUrl(1, '', 0, 1); |
@@ -1835,7 +1835,7 @@ discard block |
||
| 1835 | 1835 | $this->tpl['efficiency'] = $line->efficiency; |
| 1836 | 1836 | |
| 1837 | 1837 | |
| 1838 | - global $conf; // used into template |
|
| 1838 | + global $conf; // used into template |
|
| 1839 | 1839 | include DOL_DOCUMENT_ROOT.'/mrp/tpl/originproductline.tpl.php'; |
| 1840 | 1840 | } |
| 1841 | 1841 | |
@@ -1996,14 +1996,14 @@ discard block |
||
| 1996 | 1996 | $now = dol_now(); |
| 1997 | 1997 | |
| 1998 | 1998 | $sql = "SELECT rowid, date_end_planned FROM ".$this->db->prefix()."mrp_mo"; |
| 1999 | - $sql .= " WHERE status IN (" . self::STATUS_VALIDATED . ", " . self::STATUS_INPROGRESS .")"; // 1 = Ouvert, 2 = En cours |
|
| 1999 | + $sql .= " WHERE status IN (".self::STATUS_VALIDATED.", ".self::STATUS_INPROGRESS.")"; // 1 = Ouvert, 2 = En cours |
|
| 2000 | 2000 | $sql .= " AND entity IN (".getEntity('mrp_mo').")"; |
| 2001 | 2001 | |
| 2002 | 2002 | $resql = $this->db->query($sql); |
| 2003 | 2003 | if ($resql) { |
| 2004 | 2004 | $langs->load("mrp"); |
| 2005 | 2005 | $response = new WorkboardResponse(); |
| 2006 | - $warning_delay = $conf->mrp->progress->warning_delay ; |
|
| 2006 | + $warning_delay = $conf->mrp->progress->warning_delay; |
|
| 2007 | 2007 | $response->warning_delay = $warning_delay / 86400; |
| 2008 | 2008 | $response->label = $langs->trans("MOProgress"); |
| 2009 | 2009 | $response->labelShort = $langs->trans("MOProgress"); |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | $sql .= " FROM ".$this->db->prefix().$objectline->table_element." as l"; |
| 462 | 462 | $sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = l.fk_product"; |
| 463 | 463 | $sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id); |
| 464 | - $sql .= " AND p.fk_product_type = ". ((int) $typeproduct); |
|
| 464 | + $sql .= " AND p.fk_product_type = ".((int) $typeproduct); |
|
| 465 | 465 | if (isset($objectline->fields['position'])) { |
| 466 | 466 | $sql .= $this->db->order('position', 'ASC'); |
| 467 | 467 | } |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | if (getDolGlobalString('BOM_ADDON')) { |
| 880 | 880 | $mybool = false; |
| 881 | 881 | |
| 882 | - $file = getDolGlobalString('BOM_ADDON') . ".php"; |
|
| 882 | + $file = getDolGlobalString('BOM_ADDON').".php"; |
|
| 883 | 883 | $classname = getDolGlobalString('BOM_ADDON'); |
| 884 | 884 | |
| 885 | 885 | // Include file with class |
@@ -997,15 +997,15 @@ discard block |
||
| 997 | 997 | // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments |
| 998 | 998 | $oldref = dol_sanitizeFileName($this->ref); |
| 999 | 999 | $newref = dol_sanitizeFileName($num); |
| 1000 | - $dirsource = getMultidirOutput($this) . '/'.$oldref; |
|
| 1001 | - $dirdest = getMultidirOutput($this) . '/'.$newref; |
|
| 1000 | + $dirsource = getMultidirOutput($this).'/'.$oldref; |
|
| 1001 | + $dirdest = getMultidirOutput($this).'/'.$newref; |
|
| 1002 | 1002 | if (!$error && file_exists($dirsource)) { |
| 1003 | 1003 | dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); |
| 1004 | 1004 | |
| 1005 | 1005 | if (@rename($dirsource, $dirdest)) { |
| 1006 | 1006 | dol_syslog("Rename ok"); |
| 1007 | 1007 | // Rename docs starting with $oldref with $newref |
| 1008 | - $listoffiles = dol_dir_list(getMultidirOutput($this) . '/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); |
|
| 1008 | + $listoffiles = dol_dir_list(getMultidirOutput($this).'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); |
|
| 1009 | 1009 | foreach ($listoffiles as $fileentry) { |
| 1010 | 1010 | $dirsource = $fileentry['name']; |
| 1011 | 1011 | $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | foreach ($this->lines as &$line) { |
| 1416 | 1416 | $tmpproduct->cost_price = 0; |
| 1417 | 1417 | $tmpproduct->pmp = 0; |
| 1418 | - $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading |
|
| 1418 | + $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading |
|
| 1419 | 1419 | |
| 1420 | 1420 | $unit_cost = (float) (is_null($tmpproduct->cost_price) ? $tmpproduct->pmp : $tmpproduct->cost_price); |
| 1421 | 1421 | if (empty($unit_cost)) { // @phpstan-ignore-line phpstan thinks this is always false. No,if unit_cost is 0, it is not. |
@@ -1643,7 +1643,7 @@ discard block |
||
| 1643 | 1643 | $return .= img_picto('', $this->picto); |
| 1644 | 1644 | $return .= '</span>'; |
| 1645 | 1645 | $return .= '<div class="info-box-content">'; |
| 1646 | - $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>'; |
|
| 1646 | + $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>'; |
|
| 1647 | 1647 | if ($selected >= 0) { |
| 1648 | 1648 | $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>'; |
| 1649 | 1649 | } |
@@ -498,9 +498,9 @@ discard block |
||
| 498 | 498 | if (!empty($object->date_rappro)) { // Note: date_rappro is not found on Dolibarr classes |
| 499 | 499 | print ' - '; |
| 500 | 500 | print '<div class="valignmiddle inline-block">'; |
| 501 | - print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 501 | + print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 502 | 502 | if ($deltadateforuser) { |
| 503 | - print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' <span class="opacitymedium">'.$langs->trans("ClientHour").'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 503 | + print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' <span class="opacitymedium">'.$langs->trans("ClientHour").'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 504 | 504 | } |
| 505 | 505 | print '</div>'; |
| 506 | 506 | } |
@@ -1022,13 +1022,13 @@ discard block |
||
| 1022 | 1022 | } |
| 1023 | 1023 | } else { // if reset is for a specific month in year, we need year |
| 1024 | 1024 | if (preg_match('/^(.*)\{(m+)\}\{(y+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1025 | - $posy = 3; //index in regex |
|
| 1025 | + $posy = 3; //index in regex |
|
| 1026 | 1026 | $posm = 2; |
| 1027 | 1027 | } elseif (preg_match('/^(.*)\{(y+)\}\{(m+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1028 | - $posy = 2; //index in regex |
|
| 1028 | + $posy = 2; //index in regex |
|
| 1029 | 1029 | $posm = 3; |
| 1030 | 1030 | } elseif (preg_match('/^(.*)\{(y+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1031 | - $posy = 2; //index in regex |
|
| 1031 | + $posy = 2; //index in regex |
|
| 1032 | 1032 | $posm = 0; |
| 1033 | 1033 | } else { |
| 1034 | 1034 | return 'ErrorCantUseRazIfNoYearInMask'; |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | $maskLike = preg_replace('/\{yyyy\}/i', $yearcomp, $maskLike); |
| 1131 | 1131 | $maskLike = preg_replace('/\{yy\}/i', $yearcomp, $maskLike); |
| 1132 | 1132 | $maskLike = preg_replace('/\{y\}/i', $yearcomp, $maskLike); |
| 1133 | - $maskLike = preg_replace('/\{mm\}/i', '__', $maskLike); // we can't include the month in the filter |
|
| 1133 | + $maskLike = preg_replace('/\{mm\}/i', '__', $maskLike); // we can't include the month in the filter |
|
| 1134 | 1134 | } else { |
| 1135 | 1135 | $maskLike = preg_replace('/\{yyyy\}/i', '____', $maskLike); |
| 1136 | 1136 | $maskLike = preg_replace('/\{yy\}/i', '__', $maskLike); |
@@ -1161,14 +1161,14 @@ discard block |
||
| 1161 | 1161 | $counter = 0; |
| 1162 | 1162 | $sql = "SELECT MAX(".$sqlstring.") as val"; |
| 1163 | 1163 | $sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table); |
| 1164 | - $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1164 | + $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1165 | 1165 | $sql .= " AND ".$db->sanitize($field)." NOT LIKE '(PROV%)'"; |
| 1166 | 1166 | |
| 1167 | 1167 | // To ensure that all variables within the MAX() brackets are integers |
| 1168 | 1168 | // This avoid bad detection of max when data are noised with non numeric values at the position of the numero |
| 1169 | 1169 | if (getDolGlobalInt('MAIN_NUMBERING_FILTER_ON_INT_ONLY')) { |
| 1170 | 1170 | // @phan-suppress-next-line PhanPluginSuspiciousParamPosition |
| 1171 | - $sql .= " AND ". $db->regexpsql($sqlstring, '^[0-9]+$', 1); |
|
| 1171 | + $sql .= " AND ".$db->regexpsql($sqlstring, '^[0-9]+$', 1); |
|
| 1172 | 1172 | } |
| 1173 | 1173 | |
| 1174 | 1174 | if ($bentityon) { // only if entity enable |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | $ref = ''; |
| 1231 | 1231 | $sql = "SELECT ".$db->sanitize($field)." as ref"; |
| 1232 | 1232 | $sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table); |
| 1233 | - $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1233 | + $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1234 | 1234 | $sql .= " AND ".$db->sanitize($field)." NOT LIKE '%PROV%'"; |
| 1235 | 1235 | if ($bentityon) { // only if entity enable |
| 1236 | 1236 | $sql .= " AND entity IN (".getEntity($sharetable).")"; |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | // Get counter in database |
| 1294 | 1294 | $maskrefclient_sql = "SELECT MAX(".$maskrefclient_sqlstring.") as val"; |
| 1295 | 1295 | $maskrefclient_sql .= " FROM ".MAIN_DB_PREFIX.$table; |
| 1296 | - $maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1296 | + $maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1297 | 1297 | if ($bentityon) { // only if entity enable |
| 1298 | 1298 | $maskrefclient_sql .= " AND entity IN (".getEntity($sharetable).")"; |
| 1299 | 1299 | } elseif (!empty($forceentity)) { |
@@ -2956,7 +2956,7 @@ discard block |
||
| 2956 | 2956 | $string = trim($string); |
| 2957 | 2957 | |
| 2958 | 2958 | // If string does not start and end with parenthesis, we return $string as is. |
| 2959 | - if (! preg_match('/^\(.*\)$/', $string)) { |
|
| 2959 | + if (!preg_match('/^\(.*\)$/', $string)) { |
|
| 2960 | 2960 | return $string; |
| 2961 | 2961 | } |
| 2962 | 2962 | |
@@ -2994,15 +2994,15 @@ discard block |
||
| 2994 | 2994 | function getArrayOfEmojiBis() |
| 2995 | 2995 | { |
| 2996 | 2996 | $arrayofcommonemoji = array( |
| 2997 | - 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 2998 | - 'ding' => array('2700', '27BF'), // Dingbats |
|
| 2999 | - '????' => array('9989', '9989'), // Variation Selectors |
|
| 3000 | - 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 3001 | - 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 3002 | - 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 3003 | - 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 3004 | - 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 3005 | - 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 2997 | + 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 2998 | + 'ding' => array('2700', '27BF'), // Dingbats |
|
| 2999 | + '????' => array('9989', '9989'), // Variation Selectors |
|
| 3000 | + 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 3001 | + 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 3002 | + 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 3003 | + 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 3004 | + 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 3005 | + 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 3006 | 3006 | ); |
| 3007 | 3007 | |
| 3008 | 3008 | return $arrayofcommonemoji; |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | // Load Dolibarr environment |
| 29 | 29 | require '../main.inc.php'; |
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
| 32 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * @var Conf $conf |
@@ -99,18 +99,18 @@ discard block |
||
| 99 | 99 | // Add parameter for sorting |
| 100 | 100 | $param = ''; |
| 101 | 101 | if ($socid > 0) { |
| 102 | - $param .= '&socid=' . $socid; |
|
| 102 | + $param .= '&socid='.$socid; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | print '<table class="noborder tagtable liste centpercent">'; |
| 106 | 106 | print '<tr class="liste_titre">'; |
| 107 | 107 | print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); |
| 108 | - print '<td>' . $langs->trans("Element") . '</td>'; |
|
| 109 | - print '<td>' . $langs->trans("Status") . '</td>'; |
|
| 110 | - print '<td class="right">' . $langs->trans("Debit") . '</td>'; |
|
| 111 | - print '<td class="right">' . $langs->trans("Credit") . '</td>'; |
|
| 112 | - print '<td class="right">' . $langs->trans("Balance") . '</td>'; |
|
| 113 | - print '<td class="right">' . $langs->trans("Author") . '</td>'; |
|
| 108 | + print '<td>'.$langs->trans("Element").'</td>'; |
|
| 109 | + print '<td>'.$langs->trans("Status").'</td>'; |
|
| 110 | + print '<td class="right">'.$langs->trans("Debit").'</td>'; |
|
| 111 | + print '<td class="right">'.$langs->trans("Credit").'</td>'; |
|
| 112 | + print '<td class="right">'.$langs->trans("Balance").'</td>'; |
|
| 113 | + print '<td class="right">'.$langs->trans("Author").'</td>'; |
|
| 114 | 114 | print '</tr>'; |
| 115 | 115 | |
| 116 | 116 | /** @var array<string|int,mixed> $TData */ |
@@ -119,9 +119,9 @@ discard block |
||
| 119 | 119 | $sql = "SELECT s.nom, s.rowid as socid, f.ref_supplier, f.total_ttc, f.datef as df,"; |
| 120 | 120 | $sql .= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; |
| 121 | 121 | $sql .= " u.login, u.rowid as userid"; |
| 122 | - $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s," . MAIN_DB_PREFIX . "facture_fourn as f," . MAIN_DB_PREFIX . "user as u"; |
|
| 123 | - $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = " . ((int) $societe->id); |
|
| 124 | - $sql .= " AND f.entity IN (" . getEntity("facture_fourn") . ")"; // Recognition of the entity attributed to this invoice for Multicompany |
|
| 122 | + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."user as u"; |
|
| 123 | + $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $societe->id); |
|
| 124 | + $sql .= " AND f.entity IN (".getEntity("facture_fourn").")"; // Recognition of the entity attributed to this invoice for Multicompany |
|
| 125 | 125 | $sql .= " AND f.fk_user_valid = u.rowid"; |
| 126 | 126 | $sql .= $db->order($sortfield, $sortorder); |
| 127 | 127 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $fac = new FactureFournisseur($db); |
| 137 | 137 | $ret = $fac->fetch($objf->facid); |
| 138 | 138 | if ($ret < 0) { |
| 139 | - print $fac->error . "<br>"; |
|
| 139 | + print $fac->error."<br>"; |
|
| 140 | 140 | continue; |
| 141 | 141 | } |
| 142 | 142 | $totalpaid = $fac->getSommePaiement(); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $values = array( |
| 148 | 148 | 'fk_facture' => $objf->facid, |
| 149 | 149 | 'date' => $fac->date, |
| 150 | - 'datefieldforsort' => $fac->date . '-' . $fac->ref, |
|
| 150 | + 'datefieldforsort' => $fac->date.'-'.$fac->ref, |
|
| 151 | 151 | 'link' => $fac->getNomUrl(1), |
| 152 | 152 | 'status' => $fac->getLibStatut(2, $totalpaid), |
| 153 | 153 | 'amount' => $fac->total_ttc, |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | // Payments |
| 160 | 160 | $sql = "SELECT p.rowid, p.datep as dp, pf.amount, p.statut,"; |
| 161 | 161 | $sql .= " p.fk_user_author, u.login, u.rowid as userid"; |
| 162 | - $sql .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as pf,"; |
|
| 163 | - $sql .= " " . MAIN_DB_PREFIX . "paiementfourn as p"; |
|
| 164 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u ON p.fk_user_author = u.rowid"; |
|
| 162 | + $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf,"; |
|
| 163 | + $sql .= " ".MAIN_DB_PREFIX."paiementfourn as p"; |
|
| 164 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON p.fk_user_author = u.rowid"; |
|
| 165 | 165 | $sql .= " WHERE pf.fk_paiementfourn = p.rowid"; |
| 166 | - $sql .= " AND pf.fk_facturefourn = " . ((int) $fac->id); |
|
| 166 | + $sql .= " AND pf.fk_facturefourn = ".((int) $fac->id); |
|
| 167 | 167 | $sql .= " ORDER BY p.datep ASC, p.rowid ASC"; |
| 168 | 168 | |
| 169 | 169 | $resqlp = $db->query($sql); |
@@ -183,8 +183,8 @@ discard block |
||
| 183 | 183 | $values = array( |
| 184 | 184 | 'fk_paiement' => $objp->rowid, |
| 185 | 185 | 'date' => $db->jdate($objp->dp), |
| 186 | - 'datefieldforsort' => $db->jdate($objp->dp) . '-' . $fac->ref, |
|
| 187 | - 'link' => $langs->trans("Payment") . ' ' . $paymentstatic->getNomUrl(1), |
|
| 186 | + 'datefieldforsort' => $db->jdate($objp->dp).'-'.$fac->ref, |
|
| 187 | + 'link' => $langs->trans("Payment").' '.$paymentstatic->getNomUrl(1), |
|
| 188 | 188 | 'status' => '', |
| 189 | 189 | 'amount' => -$objp->amount, |
| 190 | 190 | 'author' => $userstatic->getLoginUrl(1) |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | if (empty($TData)) { |
| 208 | - print '<tr class="oddeven"><td colspan="7"><span class="opacitymedium">' . $langs->trans("NoInvoice") . '</span></td></tr>'; |
|
| 208 | + print '<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans("NoInvoice").'</span></td></tr>'; |
|
| 209 | 209 | } else { |
| 210 | 210 | // Sort array by date ASC to calculate balance |
| 211 | 211 | $TData = dol_sort_array($TData, 'datefieldforsort', 'ASC'); |
@@ -230,34 +230,34 @@ discard block |
||
| 230 | 230 | foreach ($TData as $data) { |
| 231 | 231 | $html_class = ''; |
| 232 | 232 | if (!empty($data['fk_facture'])) { |
| 233 | - $html_class = 'facid-' . $data['fk_facture']; |
|
| 233 | + $html_class = 'facid-'.$data['fk_facture']; |
|
| 234 | 234 | } elseif (!empty($data['fk_paiement'])) { |
| 235 | - $html_class = 'payid-' . $data['fk_paiement']; |
|
| 235 | + $html_class = 'payid-'.$data['fk_paiement']; |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - print '<tr class="oddeven ' . $html_class . '">'; |
|
| 238 | + print '<tr class="oddeven '.$html_class.'">'; |
|
| 239 | 239 | |
| 240 | 240 | $datedetail = dol_print_date($data['date'], 'dayhour'); |
| 241 | 241 | if (!empty($data['fk_facture'])) { |
| 242 | 242 | $datedetail = dol_print_date($data['date'], 'day'); |
| 243 | 243 | } |
| 244 | - print '<td class="center" title="' . dol_escape_htmltag($datedetail) . '">'; |
|
| 244 | + print '<td class="center" title="'.dol_escape_htmltag($datedetail).'">'; |
|
| 245 | 245 | print dol_print_date($data['date'], 'day'); |
| 246 | 246 | print "</td>\n"; |
| 247 | 247 | |
| 248 | - print '<td>' . $data['link'] . "</td>\n"; |
|
| 248 | + print '<td>'.$data['link']."</td>\n"; |
|
| 249 | 249 | |
| 250 | - print '<td class="left">' . $data['status'] . '</td>'; |
|
| 250 | + print '<td class="left">'.$data['status'].'</td>'; |
|
| 251 | 251 | |
| 252 | - print '<td class="right">' . (($data['amount'] > 0) ? price(abs($data['amount'])) : '') . "</td>\n"; |
|
| 252 | + print '<td class="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n"; |
|
| 253 | 253 | |
| 254 | 254 | $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; |
| 255 | 255 | |
| 256 | - print '<td class="right">' . (($data['amount'] > 0) ? '' : price(abs($data['amount']))) . "</td>\n"; |
|
| 256 | + print '<td class="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n"; |
|
| 257 | 257 | $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); |
| 258 | 258 | |
| 259 | 259 | // Balance |
| 260 | - print '<td class="right"><span class="amount">' . price($data['balance']) . "</span></td>\n"; |
|
| 260 | + print '<td class="right"><span class="amount">'.price($data['balance'])."</span></td>\n"; |
|
| 261 | 261 | |
| 262 | 262 | // Author |
| 263 | 263 | print '<td class="nowrap right">'; |
@@ -269,9 +269,9 @@ discard block |
||
| 269 | 269 | |
| 270 | 270 | print '<tr class="liste_total">'; |
| 271 | 271 | print '<td colspan="3"> </td>'; |
| 272 | - print '<td class="right">' . price($totalDebit) . '</td>'; |
|
| 273 | - print '<td class="right">' . price($totalCredit) . '</td>'; |
|
| 274 | - print '<td class="right">' . price(price2num($totalDebit - $totalCredit, 'MT')) . '</td>'; |
|
| 272 | + print '<td class="right">'.price($totalDebit).'</td>'; |
|
| 273 | + print '<td class="right">'.price($totalCredit).'</td>'; |
|
| 274 | + print '<td class="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>'; |
|
| 275 | 275 | print '<td></td>'; |
| 276 | 276 | print "</tr>\n"; |
| 277 | 277 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $navUserMenu['user_logout'] = array( |
| 117 | 117 | 'id' => 'user_logout', |
| 118 | 118 | 'rank' => 99999, |
| 119 | - 'url' => $context->getControllerUrl() . 'logout.php', |
|
| 119 | + 'url' => $context->getControllerUrl().'logout.php', |
|
| 120 | 120 | 'name' => img_picto($langs->trans('Logout'), 'logout', 'class="pictofixedwidth"'), |
| 121 | 121 | ); |
| 122 | 122 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | 'maxTopMenu' => & $maxTopMenu |
| 146 | 146 | ); |
| 147 | 147 | |
| 148 | -$reshook = $hookmanager->executeHooks('PrintTopMenu', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
| 148 | +$reshook = $hookmanager->executeHooks('PrintTopMenu', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook |
|
| 149 | 149 | if ($reshook < 0) { |
| 150 | 150 | $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 151 | 151 | } |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | $brandTitle = getDolGlobalString('WEBPORTAL_TITLE') ? getDolGlobalString('WEBPORTAL_TITLE') : getDolGlobalString('MAIN_INFO_SOCIETE_NOM'); |
| 207 | 207 | print '<a class="brand__logo-link" href="'.$context->getControllerUrl().'" >'; |
| 208 | 208 | if (!empty($context->theme->menuLogoUrl)) { |
| 209 | - print '<img class="brand__logo-img" src="' . dol_escape_htmltag($context->theme->menuLogoUrl) . '" alt="' . dol_escape_htmltag($brandTitle) . '">'; |
|
| 209 | + print '<img class="brand__logo-img" src="'.dol_escape_htmltag($context->theme->menuLogoUrl).'" alt="'.dol_escape_htmltag($brandTitle).'">'; |
|
| 210 | 210 | } else { |
| 211 | - print '<span class="brand__name">' . $brandTitle . '</span>'; |
|
| 211 | + print '<span class="brand__name">'.$brandTitle.'</span>'; |
|
| 212 | 212 | } |
| 213 | 213 | print '</a>'; |
| 214 | 214 | ?> |