diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 3f47731316c..9d42b9995f6 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -88,18 +88,21 @@ if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($ // index.php/xxx called by any REST client to run API +$reg=array(); preg_match('/index\.php\/([^\/]+)(.*)$/', $_SERVER["PHP_SELF"], $reg); // .../index.php/categories?sortfield=t.rowid&sortorder=ASC -// Set the flag to say to refresh (when we reload the explorer, production must be for API call only) -$refreshcache=false; +// When in production mode, a file api/temp/routes.php is created with the API available of current call. +// But, if we set $refreshcache to false, so it may have only one API in the routes.php file if we make a call for one API without +// using the explorer. And when we make another call for another API, the API is not into the api/temp/routes.php and a 404 is returned. +// So we force refresh to each call. +$refreshcache=(empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false); if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { $refreshcache=true; } - $api = new DolibarrApi($db, '', $refreshcache); //var_dump($api->r->apiVersionMap); @@ -115,7 +118,7 @@ UploadFormat::$allowedMimeTypes = array('image/jpeg', 'image/png', 'text/plain', -// Call Explorer file for all APIs definitions +// Call Explorer file for all APIs definitions (this part is slow) if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { // Scan all API files to load them @@ -254,5 +257,6 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' && //var_dump($api->r->apiVersionMap); //exit; -// Call API (we suppose we found it) +// Call API (we suppose we found it). +// The handle will use the file api/temp/routes.php to get data to run the API. If the file exists and the entry for API is not found, it will return 404. $api->r->handle(); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 721aba20de8..285ed03e7c3 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -694,7 +694,7 @@ if ($object->id > 0) if ($num > 0) { print '
'; - print ''; + print '
'; print ''; print '
'; @@ -779,7 +779,7 @@ if ($object->id > 0) $db->free($resql2); print '
'; - print '
'.$langs->trans("LastPropals", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' '.$num.'
'; + print '
'; print ''; print '
'; @@ -855,7 +855,7 @@ if ($object->id > 0) $num = $db->num_rows($resql); if ($num > 0) { print '
'; - print '
'.$langs->trans("LastCustomerOrders", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' '.$num.'
'; + print '
'; print ''; print '
'; @@ -919,7 +919,7 @@ if ($object->id > 0) if ($num >0) { print '
'; - print '
'.$langs->trans("LastSendings", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSendings").' '.$num.'
'; + print '
'; print ''; print '
'; @@ -989,7 +989,7 @@ if ($object->id > 0) if ($num > 0) { print '
'; - print '
'.$langs->trans("LastContracts", ($num<=$MAXLIST?"":$MAXLIST)).'
'; + print '
'; print ''; print '
'; @@ -1062,7 +1062,7 @@ if ($object->id > 0) if ($num > 0) { print '
'; - print '
'.$langs->trans("LastInterventions", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllInterventions").' '.$num.'
'; + print '
'; print ''; print '
'; @@ -1167,7 +1167,7 @@ if ($object->id > 0) if ($num > 0) { print '
'; - print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.'
'; + print '
'; print ''; print '
'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a3ca781cd94..67c3f0f9630 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6382,7 +6382,7 @@ abstract class CommonObject * @param array $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan) * @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names) - * @param string $onetrtd All fields in same tr td + * @param string $onetrtd All fields in same tr td (TODO field not used ?) * @return string */ public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0) @@ -6494,10 +6494,7 @@ abstract class CommonObject $out .= ''; - if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) - { - if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; } - } + if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; } if ($action == 'selectlines') { $colspan++; } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 0d95646c441..07cfc9d4a14 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1217,6 +1217,8 @@ class pdf_einstein extends ModelePDFCommandes } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Show top header of page. * @@ -1227,8 +1229,9 @@ class pdf_einstein extends ModelePDFCommandes * @param string $titlekey Translation key to show as title of document * @return void */ - private function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle") + protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle") { + // phpcs:enable global $conf,$langs,$hookmanager; // Load traductions files requiredby by page @@ -1437,6 +1440,8 @@ class pdf_einstein extends ModelePDFCommandes return $top_shift; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Show footer of page. Need this->emetteur object * @@ -1446,8 +1451,9 @@ class pdf_einstein extends ModelePDFCommandes * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text */ - private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) + protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) { + // phpcs:enable global $conf; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index ad9f2f5fbf4..4ca0cf36391 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1352,6 +1352,8 @@ class pdf_eratosthene extends ModelePDFCommandes } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Show top header of page. * @@ -1362,8 +1364,9 @@ class pdf_eratosthene extends ModelePDFCommandes * @param string $titlekey Translation key to show as title of document * @return void */ - private function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle") + protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle") { + // phpcs:enable global $conf,$langs,$hookmanager; // Translations @@ -1564,6 +1567,8 @@ class pdf_eratosthene extends ModelePDFCommandes return $top_shift; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Show footer of page. Need this->emetteur object * @@ -1573,8 +1578,9 @@ class pdf_eratosthene extends ModelePDFCommandes * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text */ - private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) + protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) { + // phpcs:enable global $conf; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; return pdf_pagefoot($pdf, $outputlangs, 'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext); diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index b426cc77d5e..2adec21a865 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -57,6 +57,8 @@ class pdf_proforma extends pdf_einstein } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Show top header of page. * @@ -67,8 +69,9 @@ class pdf_proforma extends pdf_einstein * @param string $titlekey Translation key to show as title of document * @return void */ - private function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "InvoiceProForma") + protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "InvoiceProForma") { + // phpcs:enable global $conf,$langs,$hookmanager; parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 429a70530c7..da14554f40f 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1132,11 +1132,10 @@ class ExpenseReport extends CommonObject $resql=$this->db->query($sql); if ($resql) { - if (!$notrigger) + if (! $error && ! $notrigger) { // Call trigger $result=$this->call_trigger('EXPENSE_REPORT_VALIDATE', $fuser); - if ($result < 0) { $error++; } @@ -1160,7 +1159,7 @@ class ExpenseReport extends CommonObject $dirdest = $conf->expensereport->dir_output.'/'.$newref; if (file_exists($dirsource)) { - dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest); + dol_syslog(get_class($this)."::setValidate() rename dir ".$dirsource." into ".$dirdest); if (@rename($dirsource, $dirdest)) { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 2c6580be662..c65c1fde57f 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -469,7 +469,7 @@ if ($object->id > 0) $num = $db->num_rows($query); - print '
'.$langs->trans("LastCustomersBills", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' '.$num.'
'; + print '
'; print ''; print '
'.$langs->trans("ProductsAndServices").''; print ''.$langs->trans("AllProductReferencesOfSupplier").' '.$object->nbOfProductRefs().''; @@ -541,7 +541,7 @@ if ($object->id > 0) if ($num > 0) { - print ''; + print '
'; print ''; print '
'; @@ -644,7 +644,7 @@ if ($object->id > 0) if ($num > 0) { - print ''; + print '
'; print ''; print '
'; @@ -717,7 +717,7 @@ if ($object->id > 0) $num = $db->num_rows($resql); if ($num > 0) { - print ''; + print '
'; print ''; print '' . $line->product_label . '' . $line->product_label . 'special_code == "4") { $htmlforlines.= ' order'; } $htmlforlines.= '" id="' . $line->id . '">'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index f33ede5ba4c..902a2117e36 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2523,7 +2523,7 @@ table.liste tr:last-of-type td, table.noborder:not(#tablelines) tr:last-of-type border-bottom-color: rgb(); border-bottom-style: solid; } -div.tabBar div.fichehalfright table.noborder:not(.margintable):not(.paymenttable):last-of-type { +div.tabBar div.fichehalfright table.noborder:not(.margintable):not(.paymenttable):not(.lastrecordtable):last-of-type { border-bottom: 1px solid rgb(); } div.tabBar table.border>tbody>tr:last-of-type>td { diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 0f415ddbf33..f40d3afce33 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -450,8 +450,10 @@ if ($projectid) print '' . $langs->trans('TicketAssignedToMeInfos') . '
';
'; diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index eb66c37bb4f..ac98c8adbc4 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -399,5 +399,8 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v ALTER TABLE llx_ticket_extrafields ADD INDEX idx_ticket_extrafields (fk_object); +-- Use special_code=3 in Takepos +-- VMYSQL4.1 UPDATE llx_facturedet AS fd LEFT JOIN llx_facture AS f ON f.rowid = fd.fk_facture SET fd.special_code = 4 WHERE f.module_source = 'takepos' AND fd.special_code = 3; + UPDATE llx_website_page set fk_user_creat = fk_user_modif WHERE fk_user_creat IS NULL and fk_user_modif IS NOT NULL; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index a69b98a9ac1..1d0897a72b0 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -18,7 +18,7 @@ /** * \file htdocs/margin/tabs/thirdpartyMargins.php * \ingroup product margins - * \brief Page des marges des factures clients pour un tiers + * \brief Page for invoice margins of a thirdparty */ require '../../main.inc.php'; @@ -170,7 +170,7 @@ if ($socid > 0) { $num = $db->num_rows($result); - print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "&socid=".$object->id, $sortfield, $sortorder, '', 0, 0, ''); + print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "&socid=".$object->id, $sortfield, $sortorder, '', $num, $num, ''); $i = 0; print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index aac6f7ecaf8..48b637ee9fa 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -331,14 +331,14 @@ if ($action == "order" and $placeid != 0) $catsprinter2 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_2); foreach($invoice->lines as $line) { - if ($line->special_code == "3") { continue; + if ($line->special_code == "4") { continue; } $c = new Categorie($db); $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id'); $result = array_intersect($catsprinter1, $existing); $count = count($result); if ($count > 0) { - $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='3' where rowid=$line->rowid"; + $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='4' where rowid=$line->rowid"; $db->query($sql); $order_receipt_printer1.= '
' . $line->qty; if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer1.="
(".$line->array_options['options_order_notes'].")"; @@ -348,14 +348,14 @@ if ($action == "order" and $placeid != 0) foreach($invoice->lines as $line) { - if ($line->special_code == "3") { continue; + if ($line->special_code == "4") { continue; } $c = new Categorie($db); $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id'); $result = array_intersect($catsprinter2, $existing); $count = count($result); if ($count > 0) { - $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='3' where rowid=$line->rowid"; + $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='4' where rowid=$line->rowid"; $db->query($sql); $order_receipt_printer2.= '
' . $line->qty; if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer2.="
(".$line->array_options['options_order_notes'].")"; @@ -612,7 +612,7 @@ if ($placeid > 0) $htmlforlines = ''; $htmlforlines.= '