From 05c0bc4facefd0fdd23f82bd3c059f4df1989064 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Jun 2021 10:44:49 +0200 Subject: [PATCH 1/4] css --- htdocs/comm/action/list.php | 6 +++--- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 8bf35df622d..e95cc3366c5 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -391,7 +391,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) "; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object)"; if (!$user->rights->societe->client->voir && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } @@ -578,8 +578,8 @@ if ($resql) { //print dol_get_fiche_end(); // Add link to show birthdays - $link = ''; /* + $link = ''; if (empty($conf->use_javascript_ajax)) { $newparam=$param; // newparam is for birthday links @@ -841,7 +841,7 @@ if ($resql) { // Ref if (!empty($arrayfields['a.id']['checked'])) { - print ''; + print ''; print $actionstatic->getNomUrl(1, -1); print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d223a70fbc9..754fcd930a5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6064,6 +6064,9 @@ dl.dropdown { display:inline-block; padding: 0 3px 2px 0; } +.maxwidthsearch .dropdown dt a span, .multiSel span { + padding: 0 3px 2px 3px; +} .dropdown span.value { display:none; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 5027c1501e9..9a04b44c96d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5931,6 +5931,9 @@ dl.dropdown { display:inline-block; padding: 0 3px 2px 0; } +.maxwidthsearch .dropdown dt a span, .multiSel span { + padding: 0 3px 2px 3px; +} .dropdown span.value { display:none; } From 8887f71c261ee4914059bae91e5d7d4300f7c30a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Jun 2021 10:57:16 +0200 Subject: [PATCH 2/4] Doc --- htdocs/core/lib/functions.lib.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fed3f697cb6..08c8a303cc9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5672,16 +5672,16 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi } /** - * Return vat rate of a product in a particular selling country or default country vat if product is unknown - * Function called by get_default_tva + * Return vat rate of a product in a particular country, or default country vat if product is unknown. + * Function called by get_default_tva(). * * @param int $idprod Id of product or 0 if not a predefined product - * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) + * @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...) * @param int $idprodfournprice Id product_fournisseur_price (for "supplier" proposal/order/invoice) * @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)' * @see get_product_localtax_for_country() */ -function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice = 0) +function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournprice = 0) { global $db, $conf, $mysoc; @@ -5695,7 +5695,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr $product = new Product($db); $result = $product->fetch($idprod); - if ($mysoc->country_code == $thirdparty_seller->country_code) { // If selling country is ours + if ($mysoc->country_code == $thirdpartytouse->country_code) { // If country to consider is ours if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object $product->get_buyprice($idprodfournprice, 0, 0, 0); $ret = $product->vatrate_supplier; @@ -5710,8 +5710,8 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr } $found = 1; } else { - // TODO Read default product vat according to countrycode and product. Vat for couple countrycode/product is a feature not implemeted yet. - // May be usefull/required if hidden option SERVICE_ARE_ECOMMERCE_200238EC is on + // TODO Read default product vat according to product and another countrycode. + // Vat for couple anothercountrycode/product is data that is not managed and store yet, so we will fallback on next rule. } } @@ -5720,7 +5720,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr // If vat of product for the country not found or not defined, we return the first higher vat of country. $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdparty_seller->country_code)."'"; + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdpartytouse->country_code)."'"; $sql .= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC"; $sql .= $db->plimit(1); @@ -5747,15 +5747,15 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr } /** - * Return localtax vat rate of a product in a particular selling country or default country vat if product is unknown + * Return localtax vat rate of a product in a particular country or default country vat if product is unknown * * @param int $idprod Id of product * @param int $local 1 for localtax1, 2 for localtax 2 - * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) + * @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...) * @return int <0 if KO, Vat rate if OK * @see get_product_vat_for_country() */ -function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) +function get_product_localtax_for_country($idprod, $local, $thirdpartytouse) { global $db, $mysoc; @@ -5771,14 +5771,15 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) $product = new Product($db); $result = $product->fetch($idprod); - if ($mysoc->country_code == $thirdparty_seller->country_code) { // If selling country is ours + if ($mysoc->country_code == $thirdpartytouse->country_code) { // If selling country is ours /* Not defined yet, so we don't use this if ($local==1) $ret=$product->localtax1_tx; elseif ($local==2) $ret=$product->localtax2_tx; $found=1; */ } else { - // TODO Read default product vat according to countrycode and product + // TODO Read default product vat according to product and another countrycode. + // Vat for couple anothercountrycode/product is data that is not managed and store yet, so we will fallback on next rule. } } @@ -5786,7 +5787,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) // If vat of product for the country not found or not defined, we return higher vat of country. $sql = "SELECT taux as vat_rate, localtax1, localtax2"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdparty_seller->country_code)."'"; + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdpartytouse->country_code)."'"; $sql .= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql .= $db->plimit(1); From 312968eeac06c75415ec59f42141d3cfa6265585 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Jun 2021 11:38:02 +0200 Subject: [PATCH 3/4] Clean code --- htdocs/comm/action/class/actioncomm.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 04b631b7ee1..7fd294b89b2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -382,6 +382,7 @@ class ActionComm extends CommonObject */ const EVENT_FINISHED = 100; + /** * Constructor * @@ -752,7 +753,7 @@ class ActionComm extends CommonObject $sql .= " a.durationp,"; // deprecated $sql .= " a.datec,"; $sql .= " a.tms as datem,"; - $sql .= " a.code, a.label, a.note,"; + $sql .= " a.code, a.label, a.note as note_private,"; $sql .= " a.fk_soc,"; $sql .= " a.fk_project,"; $sql .= " a.fk_user_author, a.fk_user_mod,"; @@ -811,8 +812,8 @@ class ActionComm extends CommonObject $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); - $this->note = $obj->note; // deprecated - $this->note_private = $obj->note; + $this->note = $obj->note_private; // deprecated + $this->note_private = $obj->note_private; $this->percentage = $obj->percentage; $this->authorid = $obj->fk_user_author; @@ -1822,7 +1823,7 @@ class ActionComm extends CommonObject $sql .= " a.datep2,"; // End $sql .= " a.durationp,"; // deprecated $sql .= " a.datec, a.tms as datem,"; - $sql .= " a.label, a.code, a.note, a.fk_action as type_id,"; + $sql .= " a.label, a.code, a.note as note_private, a.fk_action as type_id,"; $sql .= " a.fk_soc,"; $sql .= " a.fk_user_author, a.fk_user_mod,"; $sql .= " a.fk_user_action,"; @@ -1950,7 +1951,7 @@ class ActionComm extends CommonObject $duration = ($datestart && $dateend) ? ($dateend - $datestart) : 0; $event['summary'] = $obj->label.($obj->socname ? " (".$obj->socname.")" : ""); - $event['desc'] = $obj->note; + $event['desc'] = $obj->note_private; $event['startdate'] = $datestart; $event['enddate'] = $dateend; // Not required with type 'journal' $event['duration'] = $duration; // Not required with type 'journal' From d6e9947cd440771e76da1e27df92f38c4a0a03cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Jun 2021 12:30:50 +0200 Subject: [PATCH 4/4] CSS --- htdocs/core/boxes/box_graph_product_distribution.php | 2 +- htdocs/core/boxes/modules_boxes.php | 2 +- htdocs/theme/eldy/global.inc.php | 6 ++++++ htdocs/theme/md/style.css.php | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index c9ab7372c4c..2db8dd287b3 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -408,7 +408,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ''; } $this->info_box_contents[0][0] = array( - 'tr'=>'class="oddeven nohover"', + 'tr' => 'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow, ); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 45cc02ac67e..246bec42ba4 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -229,7 +229,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box $out .= '>'; if (!empty($conf->use_javascript_ajax)) { //$out.= '
'; - $out .= '
'; + $out .= '
'; } if (!empty($head['text'])) { $s = dol_trunc($head['text'], isset($head['limit']) ? $head['limit'] : $MAXLENGTHBOX); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 754fcd930a5..7847088dfa1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1136,6 +1136,12 @@ select.flat.selectlimit { text-overflow: ellipsis; white-space: nowrap; } +.tdoverflowmax250 { /* For tdoverflow, the max-midth become a minimum ! */ + max-width: 250px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .tdoverflowmax300 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 300px; overflow: hidden; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9a04b44c96d..9e7501f58ec 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1211,6 +1211,12 @@ select.flat.selectlimit { text-overflow: ellipsis; white-space: nowrap; } +.tdoverflowmax250 { /* For tdoverflow, the max-midth become a minimum ! */ + max-width: 250px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .tdoverflowmax300 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 300px; overflow: hidden;