From 88f6c71e884ebd48f74e7568b6f674b0372ff361 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jun 2020 16:05:04 +0200 Subject: [PATCH 01/23] Add tuto for live streaming --- live-streaming/README.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 live-streaming/README.txt diff --git a/live-streaming/README.txt b/live-streaming/README.txt new file mode 100644 index 00000000000..fdd0d8d25a9 --- /dev/null +++ b/live-streaming/README.txt @@ -0,0 +1,24 @@ +Tutorial to make streaming for the Dolibarr foundation with both +Powerpoint + Screen capture + Camera on speaker + +Prerequisites: +- Having 2 screens on Ubuntu desktop station. + +1) Install OBS Studio and launch OBS studio on the second screen +2) Create Scene - Camera only + micro +3) Create Scene - Screen + Camera in thumb (so 2 sources) + micro +4) Create Scene - Screen only + micro +5) Activer le mode "Toujours au dessus" (menu Fichier) et le "Mode Studio" + +6) Always on second screen, launch a brwoser to create a live stream on a platform (Exemple: Youtube) and +get the Stream key (For example by clicking on "View in Live Dashboard") + +7) On first screen, launch Chrome browser with 2 tabs only: Dolibarr web app and the Slides in Drive. +Open tab with the Web app and Click F11 to switch in screen mode +Then switch to second tab with CTRL+TAB +Click on start presentation then Click on the Cross "Exit full screen" (you leave the Fullscreen mode of Google slide but keep the full mode of browser). +You can now switch with CTRL+TAB between web application and slides without loosing the full screen. + +9) Sur OBS, Activer le "Mode Studio" Launch Start streaming. +10) Click on Scene + transition to switch between Camera and screen +11) Stop recording From eb7dd74026711f9ec2e79f014782992bbc136c63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jun 2020 16:05:40 +0200 Subject: [PATCH 02/23] Revert error --- live-streaming/README.txt | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 live-streaming/README.txt diff --git a/live-streaming/README.txt b/live-streaming/README.txt deleted file mode 100644 index fdd0d8d25a9..00000000000 --- a/live-streaming/README.txt +++ /dev/null @@ -1,24 +0,0 @@ -Tutorial to make streaming for the Dolibarr foundation with both -Powerpoint + Screen capture + Camera on speaker - -Prerequisites: -- Having 2 screens on Ubuntu desktop station. - -1) Install OBS Studio and launch OBS studio on the second screen -2) Create Scene - Camera only + micro -3) Create Scene - Screen + Camera in thumb (so 2 sources) + micro -4) Create Scene - Screen only + micro -5) Activer le mode "Toujours au dessus" (menu Fichier) et le "Mode Studio" - -6) Always on second screen, launch a brwoser to create a live stream on a platform (Exemple: Youtube) and -get the Stream key (For example by clicking on "View in Live Dashboard") - -7) On first screen, launch Chrome browser with 2 tabs only: Dolibarr web app and the Slides in Drive. -Open tab with the Web app and Click F11 to switch in screen mode -Then switch to second tab with CTRL+TAB -Click on start presentation then Click on the Cross "Exit full screen" (you leave the Fullscreen mode of Google slide but keep the full mode of browser). -You can now switch with CTRL+TAB between web application and slides without loosing the full screen. - -9) Sur OBS, Activer le "Mode Studio" Launch Start streaming. -10) Click on Scene + transition to switch between Camera and screen -11) Stop recording From 3148a181e7a0a1f8d499f8eb5e237d995e50f607 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 15 Jul 2020 17:45:34 +0200 Subject: [PATCH 03/23] fix display Commerce top menu if user only suppler order and MAIN_MENU_HIDE_UNAUTHORIZED=1 --- htdocs/core/menus/standard/eldy.lib.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 17edca45676..cf6b2233114 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -224,6 +224,15 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ); // Commercial + + $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && + empty($user->rights->propal->lire) && + empty($user->rights->commande->lire) && + empty($user->rights->supplier_order->lire) && + empty($user->rights->supplier_proposal->lire) && + empty($user->rights->contrat->lire) && + empty($user->rights->ficheinter->lire); + $tmpentry = array( 'enabled'=>(!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || @@ -239,19 +248,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = !empty($user->rights->supplier_proposal->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->contrat->lire) || - !empty($user->rights->ficheinter->lire) + !empty($user->rights->ficheinter->lire || + $onlysupplierorder) ), 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' ); - $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && - empty($user->rights->propal->lire) && - empty($user->rights->commande->lire) && - empty($user->rights->supplier_order->lire) && - empty($user->rights->supplier_proposal->lire) && - empty($user->rights->contrat->lire) && - empty($user->rights->ficheinter->lire); - $menu_arr[] = array( 'name' => 'Commercial', 'link' => ($onlysupplierorder ? '/fourn/commande/index.php?mainmenu=commercial&leftmenu=' : '/comm/index.php?mainmenu=commercial&leftmenu='), @@ -270,6 +272,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'loadLangs' => array("commercial"), 'submenus' => array(), ); + var_dump($onlysupplierorder,$showmode); // Billing - Financial $tmpentry = array( From d2e528d8c1a8d8a592c571aa6082f6a293c7563e Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 15 Jul 2020 17:45:45 +0200 Subject: [PATCH 04/23] fix display Commerce top menu if user only suppler order and MAIN_MENU_HIDE_UNAUTHORIZED=1 --- htdocs/core/menus/standard/eldy.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index cf6b2233114..019b4e85fc8 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -272,7 +272,6 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'loadLangs' => array("commercial"), 'submenus' => array(), ); - var_dump($onlysupplierorder,$showmode); // Billing - Financial $tmpentry = array( From 2c5e96bb28c7647b80c90cfc69586cac1e4910d9 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 20 Jul 2020 09:01:21 +0200 Subject: [PATCH 05/23] better fix --- htdocs/core/menus/standard/eldy.lib.php | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 019b4e85fc8..f6d8aa401a5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -224,15 +224,6 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ); // Commercial - - $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && - empty($user->rights->propal->lire) && - empty($user->rights->commande->lire) && - empty($user->rights->supplier_order->lire) && - empty($user->rights->supplier_proposal->lire) && - empty($user->rights->contrat->lire) && - empty($user->rights->ficheinter->lire); - $tmpentry = array( 'enabled'=>(!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || @@ -243,17 +234,26 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = !empty($conf->ficheinter->enabled) ) ? 1 : 0, 'perms'=>(!empty($user->rights->propal->lire) || - !empty($user->rights->commande->lire) || - !empty($user->rights->fournisseur->lire) || - !empty($user->rights->supplier_proposal->lire) || - !empty($user->rights->supplier_order->lire) || - !empty($user->rights->contrat->lire) || - !empty($user->rights->ficheinter->lire || - $onlysupplierorder) + !empty($user->rights->commande->lire) || + !empty($user->rights->fournisseur->lire) || + !empty($user->rights->supplier_proposal->lire) || + !empty($user->rights->supplier_order->lire) || + !empty($user->rights->contrat->lire) || + !empty($user->rights->ficheinter->lire) || + !empty($user->rights->supplier_order->lire) || + !empty($user->rights->fournisseur->commande->lire) ), 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' ); + $onlysupplierorder = ! empty($user->rights->fournisseur->commande->lire) && + empty($user->rights->propal->lire) && + empty($user->rights->commande->lire) && + empty($user->rights->supplier_order->lire) && + empty($user->rights->supplier_proposal->lire) && + empty($user->rights->contrat->lire) && + empty($user->rights->ficheinter->lire); + $menu_arr[] = array( 'name' => 'Commercial', 'link' => ($onlysupplierorder ? '/fourn/commande/index.php?mainmenu=commercial&leftmenu=' : '/comm/index.php?mainmenu=commercial&leftmenu='), From 255bd6b26c62923401e07cfb8de6db1e36a32692 Mon Sep 17 00:00:00 2001 From: quentin Date: Wed, 22 Jul 2020 11:52:25 +0200 Subject: [PATCH 06/23] FIX null required --- htdocs/core/class/commonobject.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e104b82642d..9d71fa663cd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7543,7 +7543,6 @@ abstract class CommonObject $now = dol_now(); $fieldvalues = $this->setSaveQuery(); - if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now); if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id; unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. @@ -7564,8 +7563,7 @@ abstract class CommonObject if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key] = ''; if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = ''; - //var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1)); - if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && !isset($values[$key]) && is_null($this->fields[$key]['default'])) + if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && (!isset($values[$key]) || $values[$key] === 'NULL') && is_null($this->fields[$key]['default'])) { $error++; $this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']); From 921e904acca2c8c0103c11165c196b69df95b9f7 Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 23 Jul 2020 20:34:11 +0200 Subject: [PATCH 07/23] Fix MySQL rank usage for column --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 7ebec468457..7055898ada6 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -98,7 +98,7 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0; ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0; ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0; -ALTER TABLE llx_bom_bomline DROP COLUMN rank; +ALTER TABLE llx_bom_bomline DROP COLUMN `rank`; create table llx_categorie_warehouse ( From 3d79950c27369c1f049863f6eae8233f0b3a4bbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 14:13:29 +0200 Subject: [PATCH 08/23] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9d71fa663cd..4786b5817fe 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7549,11 +7549,11 @@ abstract class CommonObject if (array_key_exists('ref', $fieldvalues)) $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data $keys = array(); - $values = array(); + $values = array(); // Array to store string forged for SQL syntax foreach ($fieldvalues as $k => $v) { $keys[$k] = $k; $value = $this->fields[$k]; - $values[$k] = $this->quote($v, $value); + $values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null } // Clean and check mandatory From 54410189bc912edad202ad97dd8dbb835657cd22 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 29 Jul 2020 17:00:39 +0200 Subject: [PATCH 09/23] Fix hidden option STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO When product ajax search used a dash is show, so virtual stock looks like being negative value. --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9c4e2526249..14db0028606 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2743,9 +2743,9 @@ class Form $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; if ($virtualstock > 0) { - $outval .= ' - '; + $outval .= ''; }elseif ($virtualstock <= 0) { - $outval .= ' - '; + $outval .= ''; } $outval .= $virtualstock; $outval .= ''; From 8b879ee23b58860733abc76a41f5ee8f66ef936f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Jul 2020 14:47:51 +0200 Subject: [PATCH 10/23] FIX Edit extrafield of type long text loose carriage returns --- htdocs/core/class/extrafields.class.php | 4 ++++ htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 90fc879bd17..1f38719dbb1 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2098,6 +2098,10 @@ class ExtraFields { $value_key = GETPOST("options_".$key, 'alpha'); } + elseif (in_array($key_type, array('text'))) + { + $value_key = GETPOST("options_".$key, 'alphanohtml'); + } else { $value_key = GETPOST("options_".$key); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 967849d775a..91a3061dd41 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -601,7 +601,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null // '"' is dangerous because param in url can close the href= or src= and add javascript functions. // '../' is dangerous because it allows dir transversals $out = str_replace(array('"', '../'), '', trim($out)); - $out = dol_string_nohtmltag($out, 1); + $out = dol_string_nohtmltag($out, 0); } break; case 'restricthtml': // Recommended for most html textarea From 618c85ceb141fa405d396696172bcbe669a4096f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Jul 2020 14:49:31 +0200 Subject: [PATCH 11/23] FIX Filter too large for extrafields with type text or html --- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index d6ebb8b919f..6e1dae186b1 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -43,7 +43,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e { // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') $morecss = ''; - if (in_array($typeofextrafield, array('link', 'sellist'))) $morecss = 'maxwidth200'; + if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) $morecss = 'maxwidth200'; echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1); } print ''; From 0bf678e09e734f3241c66aa0980ec827b0248c8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Jul 2020 14:57:33 +0200 Subject: [PATCH 12/23] Fix label of extrafields --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- htdocs/core/class/extrafields.class.php | 4 ++-- .../core/tpl/admin_extrafields_edit.tpl.php | 19 +++++++++++++++++++ htdocs/langs/en_US/admin.lang | 2 ++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 912c9953229..37a39e7d1f0 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -219,7 +219,7 @@ if ($action == "update_extras" && !empty($permissiontoadd)) $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; } else { - $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, ' alpha'); + $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); } $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 1f38719dbb1..eecb5b54330 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -154,8 +154,8 @@ class ExtraFields public static $type2label = array( - 'varchar'=>'String', - 'text'=>'TextLong', + 'varchar'=>'String1Line', + 'text'=>'TextLongNLines', 'html'=>'HtmlText', 'int'=>'Int', 'double'=>'Float', diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 80a7cac7de3..191b4cf40c8 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -186,8 +186,10 @@ elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($ ?> trans("LabelOrTranslationKey"); ?> + trans("AttributeCode"); ?> + trans("Type"); ?> array('varchar', 'phone', 'mail', 'url', 'select'), 'select'=>array('varchar', 'phone', 'mail', 'url', 'select') ); +/* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert +if ($size <= 255 && in_array($type, array('text', 'html'))) { + $typewecanchangeinto['text'][] = 'varchar'; +}*/ if (in_array($type, array_keys($typewecanchangeinto))) { @@ -225,8 +231,10 @@ else } ?> + trans("Size"); ?> + @@ -247,33 +255,44 @@ else + trans("Position"); ?> + trans("LanguageFile"); ?> + global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> + trans("Unique"); ?>> + trans("Required"); ?>> + trans("AlwaysEditable"); ?>> + textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> + textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?> textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?>> + textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> + multicompany->enabled) { ?> trans("AllEntities"); ?>> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c99c436915d..33590b17141 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -409,7 +409,9 @@ PriceBaseTypeToChange=Modify on prices with base reference value defined on MassConvert=Launch bulk conversion PriceFormatInCurrentLanguage=Price Format In Current Language String=String +String1Line=String (1 line) TextLong=Long text +TextLongNLines=Long text (n lines) HtmlText=Html text Int=Integer Float=Float From e7fedd5c2db7cca4fe884f82076f909e79461ca1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Jul 2020 19:14:40 +0200 Subject: [PATCH 13/23] FIX Sql error on stat by referring entries of a product --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d557dd90392..a202004ed02 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3603,7 +3603,7 @@ class Product extends CommonObject $sql = "SELECT sum(d.qty), date_format(d.date_valid, '%Y%m')"; if ($mode == 'bynumber') { - $sql .= ", count(DISTINCT c.rowid)"; + $sql .= ", count(DISTINCT d.rowid)"; } $sql .= " FROM ".MAIN_DB_PREFIX."mrp_mo as d LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON d.fk_soc = s.rowid"; if ($filteronproducttype >= 0) { From 9a9eef428be2ec9081e88010e4db4b4332e43022 Mon Sep 17 00:00:00 2001 From: altairis Date: Fri, 31 Jul 2020 12:22:21 +0200 Subject: [PATCH 14/23] fix duration fields size with firefox --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 627e5ee8a2b..d1a76c712e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5649,7 +5649,7 @@ class Form } elseif ($typehour=='text' || $typehour=='textselect') { - $retstring.=''; + $retstring.=''; } else return 'BadValueForParameterTypeHour'; @@ -5673,7 +5673,7 @@ class Form } elseif ($typehour=='text' ) { - $retstring.=''; + $retstring.=''; } if ($typehour!='text') $retstring.=' '.$langs->trans('MinuteShort'); From 255dc718238a5e9a4bf85d3d2765000407a2bb8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Jul 2020 13:20:05 +0200 Subject: [PATCH 15/23] Missing translation --- htdocs/langs/en_US/cashdesk.lang | 1 + htdocs/takepos/admin/receipt.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index c7d7dd95cb7..ce5cdaf4ba6 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -117,3 +117,4 @@ HideCategoryImages=Hide Category Images HideProductImages=Hide Product Images NumberOfLinesToShow=Number of lines of images to show DefineTablePlan=Define tables plan +ModuleReceiptPrinterMustBeEnabled=Module Receipt printer must have been enabled first diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 62e083110f1..d6d0574e0ed 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -92,7 +92,7 @@ print load_fiche_titre($langs->trans("PrintMethod"), '', ''); print ''; print ''; -print ''; +print ''; print "\n"; // Browser method @@ -100,7 +100,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").'
'; print $langs->trans('Browser'); print ''; print $langs->trans('BrowserMethodDescription'); -print ''; +print ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "browser") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -119,7 +119,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { print $langs->trans('ReceiptPrinterMethodDescription'); print '
'; print ''.$langs->trans("Setup").''; - print '
'; + print ''; if ($conf->receiptprinter->enabled) { if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { @@ -142,7 +142,7 @@ print '
'; print "TakePOS Connector"; print ''; print $langs->trans('TakeposConnectorMethodDescription'); -print ''; +print ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print img_picto($langs->trans("Activated"), 'switch_on'); From d4e21538db87183a71d5d24ab6e94782837f48d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Jul 2020 13:40:36 +0200 Subject: [PATCH 16/23] FIX Debug setup of receipt printer module --- htdocs/admin/receiptprinter.php | 132 ++++++++++-------- htdocs/core/class/dolreceiptprinter.class.php | 20 +++ htdocs/langs/en_US/admin.lang | 3 + 3 files changed, 100 insertions(+), 55 deletions(-) diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 76aaa14d84c..5951aeaf2b2 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -65,13 +65,13 @@ if (!function_exists('gzdecode')) { } } + /* * Action */ if ($action == 'addprinter' && $user->admin) { $error = 0; - $db->begin(); if (empty($printername)) { $error++; setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors'); @@ -82,7 +82,8 @@ if ($action == 'addprinter' && $user->admin) { } if (!$error) { - $result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); + $db->begin(); + $result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); if ($result > 0) $error++; if (!$error) @@ -101,14 +102,14 @@ if ($action == 'addprinter' && $user->admin) { if ($action == 'deleteprinter' && $user->admin) { $error = 0; - $db->begin(); if (empty($printerid)) { $error++; setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); } if (!$error) { - $result = $printer->deletePrinter($printerid); + $db->begin(); + $result = $printer->deletePrinter($printerid); if ($result > 0) $error++; if (!$error) @@ -127,14 +128,14 @@ if ($action == 'deleteprinter' && $user->admin) { if ($action == 'updateprinter' && $user->admin) { $error = 0; - $db->begin(); if (empty($printerid)) { $error++; setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); } if (!$error) { - $result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); + $db->begin(); + $result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); if ($result > 0) $error++; if (!$error) { @@ -193,14 +194,14 @@ if ($action == 'testtemplate' && $user->admin) { if ($action == 'updatetemplate' && $user->admin) { $error = 0; - $db->begin(); if (empty($templateid)) { $error++; setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors'); } if (!$error) { - $result = $printer->updateTemplate($templatename, $template, $templateid); + $db->begin(); + $result = $printer->updateTemplate($templatename, $template, $templateid); if ($result > 0) $error++; if (!$error) { @@ -216,14 +217,14 @@ if ($action == 'updatetemplate' && $user->admin) { if ($action == 'addtemplate' && $user->admin) { $error = 0; - $db->begin(); if (empty($templatename)) { $error++; setEventMessages($langs->trans("TemplateNameEmpty"), null, 'errors'); } if (!$error) { - $result = $printer->addTemplate($templatename, $template); + $db->begin(); + $result = $printer->addTemplate($templatename, $template); if ($result > 0) $error++; if (!$error) { @@ -237,6 +238,29 @@ if ($action == 'addtemplate' && $user->admin) { $action = ''; } +if ($action == 'deletetemplate' && $user->admin) { + $error = 0; + if (empty($templateid)) { + $error++; + setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors'); + } + + if (!$error) { + $db->begin(); + $result = $printer->deleteTemplate($templateid); + if ($result > 0) $error++; + + if (!$error) { + $db->commit(); + setEventMessages($langs->trans("TemplateDeleted", $templatename), null); + } else { + $db->rollback(); + dol_print_error($db); + } + } + $action = ''; +} + /* * View @@ -251,6 +275,7 @@ print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_s $head = receiptprinteradmin_prepare_head($mode); +// mode = config if ($mode == 'config' && $user->admin) { print '
'; print ''; @@ -263,7 +288,7 @@ if ($mode == 'config' && $user->admin) { dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic'); - print $langs->trans("ReceiptPrinterDesc")."

\n"; + print ''.$langs->trans("ReceiptPrinterDesc")."

\n"; print ''."\n"; print ''; @@ -276,6 +301,22 @@ if ($mode == 'config' && $user->admin) { $ret = $printer->listprinters(); $nbofprinters = count($printer->listprinters); + if ($action != 'editprinter') { + print ''; + print ''; + $ret = $printer->selectTypePrinter(); + print ''; + $ret = $printer->selectProfilePrinter(); + print ''; + print ''; + print ''; + print ''; + } + if ($ret > 0) { setEventMessages($printer->error, $printer->errors, 'errors'); } else { @@ -289,7 +330,9 @@ if ($mode == 'config' && $user->admin) { $ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']); print ''; print ''; - print ''; + print ''; print ''; } else { print ''; @@ -297,15 +340,15 @@ if ($mode == 'config' && $user->admin) { print ''; print ''; // edit icon - print ''; print ''; @@ -313,38 +356,10 @@ if ($mode == 'config' && $user->admin) { } } - if ($action != 'editprinter') { - if ($nbofprinters > 0) { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - } - - print ''; - print ''; - $ret = $printer->selectTypePrinter(); - print ''; - $ret = $printer->selectProfilePrinter(); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } print '
'.$printer->resprint.''.$printer->profileresprint.''; + if ($action != 'editprinter') { + print '
'; + } + print '
'.$printer->profileresprint.''; + print '
'; + print '
'.$printer->listprinters[$line]['name'].''.$langs->trans($printer->listprinters[$line]['fk_profile_name']).''.$printer->listprinters[$line]['parameter'].''; + print ''; print img_picto($langs->trans("Edit"), 'edit'); print ''; // delete icon - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; // test icon - print ''; + print ''; print img_picto($langs->trans("TestPrinter"), 'printer'); print '
'.$langs->trans("Name").''.$langs->trans("Type").''.$langs->trans("Profile").''.$langs->trans("Parameters").'
'.$printer->resprint.''.$printer->profileresprint.'
'; dol_fiche_end(); - if ($action != 'editprinter') { - print '
'; - } else { - print '
'; - } print '
'; print '
'; @@ -374,6 +389,7 @@ if ($mode == 'config' && $user->admin) { print '
'; } +// mode = template if ($mode == 'template' && $user->admin) { print '
'; print ''; @@ -383,16 +399,13 @@ if ($mode == 'template' && $user->admin) { print ''; } - - print load_fiche_titre($langs->trans("ReceiptPrinterTemplateDesc"), '', '')."

\n"; + print load_fiche_titre($langs->trans("ReceiptPrinterTemplateDesc"), '', ''); print ''."\n"; print ''; print ''; print ''; print ''; - print ''; - print ''; print "\n"; $ret = $printer->listPrintersTemplates(); //print '
'.print_r($printer->listprinterstemplates, true).'
'; @@ -405,22 +418,23 @@ if ($mode == 'template' && $user->admin) { if ($action == 'edittemplate' && $printer->listprinterstemplates[$line]['rowid'] == $templateid) { print ''; print ''; - print ''; print ''; } else { print ''; print ''; // edit icon - print ''; } @@ -428,15 +442,23 @@ if ($mode == 'template' && $user->admin) { } } - print '
'.$langs->trans("Name").''.$langs->trans("Template").'
'; + print ''; + print ''; print ''.$printer->listprinterstemplates[$line]['name'].''.nl2br(htmlentities($printer->listprinterstemplates[$line]['template'])).''; + print ''; print img_picto($langs->trans("Edit"), 'edit'); print ''; // delete icon - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; // test icon - print ''; + print ''; print img_picto($langs->trans("TestPrinterTemplate"), 'printer'); print '
'; if ($action != 'edittemplate') { - print ''; + print ''; print ''; - print ''; + print ''; + print ''; print ''; print ''; + print ''; + } - print '
'; + print ''; + + if ($action != 'edittemplate') { + print ''; + print '
'; } else { print '
'; } diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 8d9c449b972..09dcc3681b7 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -468,6 +468,26 @@ class dolReceiptPrinter extends Printer return $error; } + /** + * Function to delete a printer template in db + * + * @param int $templateid Template ID + * @return int 0 if OK; >0 if KO + */ + public function deleteTemplate($templateid) + { + global $conf; + $error = 0; + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt_template'; + $sql .= " WHERE rowid = ".((int) $this->db->escape($templateid)); + $sql .= " AND entity = ".$conf->entity; + $resql = $this->db->query($sql); + if (!$resql) { + $error++; + $this->errors[] = $this->db->lasterror; + } + return $error; + } /** * Function to Update a printer template in db diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 33590b17141..57d430fc9e4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2008,3 +2008,6 @@ RssNote=Note: Each RSS feed definition provides a widget that you must enable to JumpToBoxes=Jump to Setup -> Widgets MeasuringUnitTypeDesc=Use here a value like "size", "surface", "volume", "weight", "time" MeasuringScaleDesc=The scale is the number of places you have to move the decimal part to match the default reference unit. For "time" unit type, it is the number of seconds. Values between 80 and 99 are reserved values. +TemplateAdded=Template added +TemplateUpdated=Template updated +TemplateDeleted=Template deleted \ No newline at end of file From f80b54e573578022be5d1f8fd11598edf25494ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Jul 2020 13:44:55 +0200 Subject: [PATCH 17/23] Debug setup of receipt printer module --- htdocs/admin/receiptprinter.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 5951aeaf2b2..7af626ef0bb 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -391,7 +391,10 @@ if ($mode == 'config' && $user->admin) { // mode = template if ($mode == 'template' && $user->admin) { - print ''; + + dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic'); + + print ''; print ''; if ($action != 'edittemplate') { print ''; @@ -399,8 +402,6 @@ if ($mode == 'template' && $user->admin) { print ''; } - print load_fiche_titre($langs->trans("ReceiptPrinterTemplateDesc"), '', ''); - print ''."\n"; print ''; print ''; @@ -464,6 +465,8 @@ if ($mode == 'template' && $user->admin) { } print ''; + dol_fiche_end(); + print '
'; print '
'.$langs->trans("Name").'
'."\n"; From 0d71cd4279593e2e2c297d30109d88eb9173d815 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Jul 2020 13:51:49 +0200 Subject: [PATCH 18/23] Fix td not closed --- htdocs/takepos/admin/bar.php | 86 ++++++++++++++++++---------------- htdocs/takepos/public/menu.php | 4 +- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 3d4bd490dde..5afa8dc060b 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -105,14 +105,16 @@ print "\n"; if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") { print ''; + print ''; print ''; + print ''; @@ -120,14 +122,16 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD print ''; +print ''; print ''; +print ''; @@ -136,55 +140,30 @@ if ($conf->global->TAKEPOS_SUPPLEMENTS) { print ''; + print '\n"; } -print ''; - print ''; +print ''; +print ''; +print ''; + print '
'; print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')'; - print ''; + print ''; print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0); //print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1); print '
'; print $langs->trans("OrderNotes"); - print ''; + print ''; print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0); //print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1); print '
'; print $langs->trans("BasicPhoneLayout"); -print ''; +print ''; //print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1); print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0); print '
'; print $langs->trans("ProductSupplements"); -print ''; +print ''; //print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1); print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0); print '
'; print $langs->trans("SupplementCategory"); - print ''; + print ''; print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0); print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY'); print "
'; -print 'QR - '.$langs->trans("AutoOrder"); -print ''; -print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0); -print '
'; print 'QR - '.$langs->trans("CustomerMenu"); -print ''; +print ''; print ajax_constantonoff("TAKEPOS_QR_MENU", array(), $conf->entity, 0, 0, 1, 0); print '
'; +print 'QR - '.$langs->trans("AutoOrder"); +print ''; +print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0); +print '
'; -if ($conf->global->TAKEPOS_AUTO_ORDER) -{ - print '
'; - print ''; - print ''; - print ''; - print "\n"; - - //global $dolibarr_main_url_root; - $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); - $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables"; - $resql = $db->query($sql); - $rows = array(); - while ($row = $db->fetch_array($resql)) { - print ''; - } - - print '
'.$langs->trans("Table").''.$langs->trans("URL").''.$langs->trans("QR").'
'; - print $langs->trans("Table")." ".$row['label']; - print ''; - print "".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid']).""; - print ''; - print ""; - print '
'; -} - - if ($conf->global->TAKEPOS_QR_MENU) { $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -202,6 +181,33 @@ if ($conf->global->TAKEPOS_QR_MENU) print ''; } +if ($conf->global->TAKEPOS_AUTO_ORDER) +{ + print '
'; + print ''; + print ''; + print ''; + print "\n"; + + //global $dolibarr_main_url_root; + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables"; + $resql = $db->query($sql); + $rows = array(); + while ($row = $db->fetch_array($resql)) { + print ''; + } + + print '
'.$langs->trans("Table").''.$langs->trans("URL").''.$langs->trans("QR").'
'; + print $langs->trans("Table")." ".$row['label']; + print ''; + print "".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid']).""; + print ''; + print ""; + print '
'; +} + print ''; print '
'; diff --git a/htdocs/takepos/public/menu.php b/htdocs/takepos/public/menu.php index c051ae4d673..217da157c2f 100644 --- a/htdocs/takepos/public/menu.php +++ b/htdocs/takepos/public/menu.php @@ -45,7 +45,7 @@ if (!$conf->global->TAKEPOS_QR_MENU) accessforbidden(); // If Restaurant Menu is
From 0b46fcb4f899df0a5d060a529601654c14e16535 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Jul 2020 14:02:08 +0200 Subject: [PATCH 19/23] Debug --- htdocs/takepos/admin/bar.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 5afa8dc060b..b6a06dee9fb 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -171,11 +171,12 @@ if ($conf->global->TAKEPOS_QR_MENU) print '
'; print ''; print ''; - print ''; + print ''; print "\n"; print ''; + print ''; print '
'.$langs->trans("URL").''.$langs->trans("QR").''.$langs->trans("URL").''.$langs->trans("QR").'
'; print "".$urlwithroot."/takepos/public/menu.php"; - print ''; + print ''; print ""; print '
'; @@ -186,7 +187,7 @@ if ($conf->global->TAKEPOS_AUTO_ORDER) print '
'; print ''; print ''; - print ''; + print ''; print "\n"; //global $dolibarr_main_url_root; @@ -198,9 +199,11 @@ if ($conf->global->TAKEPOS_AUTO_ORDER) while ($row = $db->fetch_array($resql)) { print ''; print ''; + print ''; } From 3bfd7644a43b1ad58b539c30d9b539159a5c462b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Aug 2020 20:17:49 +0200 Subject: [PATCH 20/23] Fix return link --- htdocs/compta/prelevement/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 23b6fdac500..ab8b5b8ae40 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -86,7 +86,11 @@ if (empty($reshook)) $res = $object->delete($user); if ($res > 0) { - header("Location: index.php"); + if ($object->type == 'bank-transfer') { + header("Location: ".DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php'); + } else { + header("Location: ".DOL_URL_ROOT.'/compta/prelevement/index.php'); + } exit; } } From 328a25abeaa74a43b5c5cbbd3161d1f1cce418db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Aug 2020 00:59:53 +0200 Subject: [PATCH 21/23] FIX Bad back to link --- htdocs/bom/bom_agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index a5b66b9886f..e2386dcee0b 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -132,7 +132,7 @@ if ($object->id > 0) // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* From 817912ea40d1419859184e88a12ad3608ca05dfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Aug 2020 01:11:23 +0200 Subject: [PATCH 22/23] FIX #14291 --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a202004ed02..4dd4c7b3420 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -565,7 +565,7 @@ class Product extends CommonObject return -1; } - if (empty($this->ref)) { + if (empty($this->ref) || $this->ref == 'auto') { // Load object modCodeProduct $module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard'); if ($module != 'mod_codeproduct_leopard') // Do not load module file for leopard From 9aa9852e85423c5bebde431d4d3c8429379d593b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Aug 2020 01:35:03 +0200 Subject: [PATCH 23/23] Fix perms --- htdocs/product/stock/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 47c3ac9d1b5..f5121ea0089 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -659,8 +659,8 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n $urlsource .= str_replace('&', '&', $param); $filedir = $diroutputmassaction; - $genallowed = $user->rights->mymodule->read; - $delallowed = $user->rights->mymodule->create; + $genallowed = $user->rights->stock->read; + $delallowed = $user->rights->stock->create; print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); }
'.$langs->trans("Table").''.$langs->trans("URL").''.$langs->trans("QR").''.$langs->trans("Table").''.$langs->trans("URL").''.$langs->trans("QR").'
'; print $langs->trans("Table")." ".$row['label']; + print ''; print "".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid']).""; - print ''; + print ''; print ""; print '