From aa4fc45650e3f0d18004a15c86189716052a2f02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Apr 2024 02:40:25 +0200 Subject: [PATCH 1/3] Fix regression in v19 migration --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 2 ++ htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 htdocs/install/mysql/migration/19.0.0-20.0.0.sql diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 70bf4fe7628..d35c9ad49f4 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -216,3 +216,5 @@ ALTER TABLE llx_prelevement_lignes ADD COLUMN tms timestamp DEFAULT CURRENT_TIME ALTER TABLE llx_bom_bomline ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; UPDATE llx_c_type_contact SET element = 'stocktransfer' WHERE element = 'StockTransfer'; + +UPDATE llx_c_units SET scale = 1 WHERE code = 'S'; diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql deleted file mode 100644 index e1f606be046..00000000000 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE llx_c_units SET scale = 1 WHERE code = 'S'; From e95e2b1c1b7635c20d7f99e886d5827c3ce29778 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:48:42 +0200 Subject: [PATCH 2/3] FIX : We should be able to add a workstation on bom lines (#29361) --- htdocs/bom/bom_card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 61a51b8f139..5068836f84e 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -169,6 +169,7 @@ if (empty($reshook)) { $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $fk_workstation = GETPOST('idworkstations', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); @@ -177,7 +178,8 @@ if (empty($reshook)) { $product = new Product($db); $res = $product->fetch($idprod); if ($res > 0 && $product->type == Product::TYPE_SERVICE) { - $fk_default_workstation = $product->fk_default_workstation; + if (!empty($fk_workstation)) $fk_default_workstation = $fk_workstation; + else $fk_default_workstation = $product->fk_default_workstation; } if (empty($fk_unit)) { $fk_unit = $product->fk_unit; From 557c723c272211145c17cf25164b0c5fa76e372b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Apr 2024 20:17:10 +0200 Subject: [PATCH 3/3] FIX logo and escape in RSS Conflicts: htdocs/admin/external_rss.php htdocs/core/lib/functions.lib.php --- htdocs/admin/external_rss.php | 12 +++++++++--- htdocs/core/lib/functions.lib.php | 30 +++++++++++++++++++++--------- htdocs/core/lib/xcal.lib.php | 6 +++--- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 7dd152fa3d1..4627abcf9de 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -223,7 +223,9 @@ print ''; print ''; print '

'; -print ''.$langs->trans('RssNote').' - '.$langs->trans('JumpToBoxes').''; +print ''.$langs->trans('RssNote').''; +print ' - '; +print ''.$langs->trans('JumpToBoxes').''; print '

'; $sql = "SELECT rowid, file, note FROM ".MAIN_DB_PREFIX."boxes_def"; @@ -281,7 +283,7 @@ if ($resql) { print "".$langs->trans("Status").""; print ""; if ($result > 0 && empty($rss->error)) { - print ''.$langs->trans("Online").''; + print ''.img_picto($langs->trans("Online"), 'tick', 'class="pictofixedwidth"').$langs->trans("Online").''; } else { print ''.$langs->trans("Offline"); $langs->load("errors"); @@ -320,7 +322,11 @@ if ($resql) { $active = _isInBoxList($idrss, $boxlist) ? 'yes' : 'no'; print ''; print ''.$langs->trans('WidgetAvailable').''; - print ''.yn($active).''; + print ''.yn($active); + print '   -   '; + print $langs->trans("JumpToBoxes"); + print ''; + print ''; print ''."\n"; print ''."\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4efa1c98b1b..850187c9dd3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1594,7 +1594,7 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0) * Returns text escaped for inclusion into javascript code * * @param string $stringtoescape String to escape - * @return string Escaped string for json content. + * @return string Escaped string for JSON content. */ function dol_escape_json($stringtoescape) { @@ -1605,8 +1605,8 @@ function dol_escape_json($stringtoescape) * Returns text escaped for inclusion into a php string, build with double quotes " or ' * * @param string $stringtoescape String to escape - * @param string $stringforquotes 2=String for doublequotes, 1=String for simple quotes - * @return string Escaped string for json content. + * @param int<1,2> $stringforquotes 2=String for doublequotes, 1=String for simple quotes + * @return string Escaped string for PHP content. */ function dol_escape_php($stringtoescape, $stringforquotes = 2) { @@ -1625,8 +1625,19 @@ function dol_escape_php($stringtoescape, $stringforquotes = 2) } /** - * Return a string label ready to be output on HTML content - * To use text inside an attribute, use can simply only dol_escape_htmltag() + * Returns text escaped for inclusion into a XML string + * + * @param string $stringtoescape String to escape + * @return string Escaped string for XML content. + */ +function dol_escape_xml($stringtoescape) +{ + return $stringtoescape; +} + +/** + * Return a string label (so on 1 line only and that should not contains any HTML) ready to be output on HTML page + * To use text that is not HTML content inside an attribute, use can simply only dol_escape_htmltag(). In doubt, use dolPrintHTMLForAttribute(). * * @param string $s String to print * @return string String ready for HTML output @@ -4448,7 +4459,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'margin', 'map-marker-alt', 'member', 'meeting', 'minus', 'money-bill-alt', 'movement', 'mrp', 'note', 'next', 'off', 'on', 'order', 'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'proposal', 'puce', - 'stock', 'resize', 'service', 'stats', 'trip', + 'stock', 'resize', 'service', 'stats', 'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_warning', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'user-tie', 'vcard', 'wrench', 'github', 'google', 'jabber', 'microsoft', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', @@ -4458,7 +4469,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'error', 'warning', 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss', 'shapes', 'skill', 'square', 'sort-numeric-down', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', - 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', + 'tick', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', 'conferenceorbooth', 'eventorganization', 'stamp', 'signature' @@ -4508,7 +4519,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'service'=>'concierge-bell', 'skill'=>'shapes', 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier'=>'building', 'technic'=>'cogs', - 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', + 'timespent'=>'clock', 'tick' => 'check', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uncheck'=>'times', 'uparrow'=>'share', 'url'=>'external-link-alt', 'vat'=>'money-check-alt', 'vcard'=>'arrow-alt-circle-down', 'jabber'=>'comment-o', @@ -4615,7 +4626,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'other'=>'#ddd', 'world'=>'#986c6a', 'partnership'=>'#6c6aa8', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba', //'shipment'=>'#a69944', - 'security'=>'#999', 'square'=>'#888', 'stop-circle'=>'#888', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555', + 'security'=>'#999', 'square'=>'#888', 'stop-circle'=>'#888', 'stats'=>'#444', 'switch_off'=>'#999', + 'technic' => '#999', 'tick' => '#282', 'timespent' => '#555', 'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', 'region'=>'#aaa', 'state'=>'#aaa', 'website'=>'#304', 'workstation'=>'#a69944' ); diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index bfca11682e4..0f6373a4f5a 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -347,9 +347,9 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fwrite($fichier, "\n"); fwrite($fichier, "\n"); - fwrite($fichier, "".$title."\n"); + fwrite($fichier, "".dol_escape_xml($title)."\n"); if ($langcode) { - fwrite($fichier, "".$langcode."\n"); + fwrite($fichier, "".dol_escape_xml($langcode)."\n"); } // Define $urlwithroot @@ -365,7 +365,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt // Image if (!empty($mysoc->logo_squarred_small)) { - $urlimage = $urlwithroot.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($mysoc->logo_squarred_small); + $urlimage = $urlwithroot.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_small); if ($urlimage) { fwrite($fichier, "'.$title.\n"); }