From 717cfb350a1f696b9e3725e7d0a21f3a675501ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2019 15:45:34 +0100 Subject: [PATCH 01/22] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cb38b4bb1d..fb9126fe4ed 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) git clone https://github.com/dolibarr/dolibarr -b x.y (where x.y is main version like 3.6, 9.0, ...) -- Set up your web server to use "*dolibarr/htdocs*" as root if you'r web server does not have directory to point to already defined. +- Set up your web server to use "*dolibarr/htdocs*" as root if your web server does not have an already defined directory to point to. - Create an empty `htdocs/conf/conf.php` file and set *write* permissions for your web server user (*write* permission will be removed once install is finished) From f326c75be7120b2b45e0330d297437c9d4245c59 Mon Sep 17 00:00:00 2001 From: Joan Louis Date: Mon, 11 Mar 2019 14:22:04 +0100 Subject: [PATCH 02/22] Update call to extrafields from cards --- htdocs/comm/propal/card.php | 4 ++-- htdocs/commande/card.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/fiche-rec.php | 4 ++-- htdocs/contrat/card.php | 4 ++-- htdocs/fichinter/card.php | 6 +++--- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/facture/card.php | 4 ++-- htdocs/supplier_proposal/card.php | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index ed1c5c627ee..01c28fdcd31 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -763,7 +763,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -1131,7 +1131,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 547b3803f7f..10629ec3452 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -662,7 +662,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -1025,7 +1025,7 @@ if (empty($reshook)) // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e37d2c3d2a9..9627aa54f24 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1686,7 +1686,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -2095,7 +2095,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index a96e2f5017e..8c45012085d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -452,7 +452,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { @@ -773,7 +773,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); $objectline = new FactureLigneRec($db); if ($objectline->fetch(GETPOST('lineid'))) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 6362759e6d0..6654d50d8ac 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -457,7 +457,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -738,7 +738,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); $objectline->array_options=$array_options; // TODO verifier price_min si fk_product et multiprix diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 756613d6a8f..4c1b414122a 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -363,7 +363,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); $result = $object->addline( $user, @@ -508,7 +508,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); $result=$object->addline( $user, @@ -621,7 +621,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); $objectline->array_options = $array_options; $result = $objectline->update($user); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 47cdf4a3c53..67acd23b633 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -308,7 +308,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -618,7 +618,7 @@ if (empty($reshook)) // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2f95dc82eab..a7b6fe32fb1 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1054,7 +1054,7 @@ if (empty($reshook)) // Extrafields Lines $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield POST Data if (is_array($extralabelsline)) { foreach ($extralabelsline as $key => $value) { @@ -1131,7 +1131,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5f53e8de6c8..85297634ec3 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -551,7 +551,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields @@ -819,7 +819,7 @@ if (empty($reshook)) // Extrafields $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + $array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line); // Unset extrafield if (is_array($extralabelsline)) { // Get extra fields From 30c327c702281a782e4537fefe3fb0e6e91c57e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 17:19:58 +0100 Subject: [PATCH 03/22] CSS --- htdocs/societe/list.php | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 28a9b283d6d..7e106f387ae 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -662,76 +662,76 @@ if (! empty($arrayfields['s.nom']['checked'])) { print ''; if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.name_alias']['checked'])) { print ''; - print ''; + print ''; print ''; } // Barcode if (! empty($arrayfields['s.barcode']['checked'])) { print ''; - print ''; + print ''; print ''; } // Customer code if (! empty($arrayfields['s.code_client']['checked'])) { print ''; - print ''; + print ''; print ''; } // Supplier code if (! empty($arrayfields['s.code_fournisseur']['checked'])) { print ''; - print ''; + print ''; print ''; } // Account Customer code if (! empty($arrayfields['s.code_compta']['checked'])) { print ''; - print ''; + print ''; print ''; } // Account Supplier code if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) { print ''; - print ''; + print ''; print ''; } // Town if (! empty($arrayfields['s.town']['checked'])) { print ''; - print ''; + print ''; print ''; } // Zip if (! empty($arrayfields['s.zip']['checked'])) { print ''; - print ''; + print ''; print ''; } // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Region if (! empty($arrayfields['region.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Country @@ -759,77 +759,77 @@ if (! empty($arrayfields['s.email']['checked'])) { // Email print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.phone']['checked'])) { // Phone print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.fax']['checked'])) { // Fax print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.url']['checked'])) { // Url print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.siren']['checked'])) { // IdProf1 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.siret']['checked'])) { // IdProf2 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.ape']['checked'])) { // IdProf3 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.idprof4']['checked'])) { // IdProf4 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.idprof5']['checked'])) { // IdProf5 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.idprof6']['checked'])) { // IdProf6 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.tva_intra']['checked'])) { // Vat number print ''; - print ''; + print ''; print ''; } @@ -863,7 +863,7 @@ if (! empty($arrayfields['s.fk_stcomm']['checked'])) if (! empty($arrayfields['s2.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Extra fields From fe6b682ec0f8700e534c446112b0cad8de4d1100 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 17:45:19 +0100 Subject: [PATCH 04/22] NEW Add visibility with value 4 in framework to define fields to show on forms and list but not on creation forms. --- htdocs/bom/bom_card.php | 2 -- htdocs/bom/class/bom.class.php | 4 ++-- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- htdocs/langs/en_US/modulebuilder.lang | 2 +- htdocs/langs/en_US/mrp.lang | 5 +++-- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 3a1c3295bbd..7605dcae9c5 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -72,8 +72,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu /* * Actions - * - * Put here all code to do according to value of "action" parameter */ $parameters=array(); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 606693bbed6..349d4b03552 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -64,7 +64,7 @@ class BOM extends CommonObject * 'type' if the field format. * 'label' the translation key. * 'enabled' is a condition when the field must be managed. - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'default' is a default value for creation (can still be replaced by the global setup of default values) * 'index' if we want an index in database. @@ -85,7 +85,7 @@ class BOM extends CommonObject */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-1, 'position'=>61, 'notnull'=>-1,), diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 968abcb0687..2c32517285a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1587,7 +1587,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); } - // Receptions + // Receptions if (! empty($conf->reception->enabled)) { $langs->load("receptions"); @@ -1611,7 +1611,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { $langs->load("mrp"); - $newmenu->add("", $langs->trans("BOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write); $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read); } diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 4984c2d938e..d6b70d86a2d 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -38,7 +38,7 @@ $object->fields = dol_sort_array($object->fields, 'position'); foreach($object->fields as $key => $val) { // Discard if extrafield is a hidden field on form - if (abs($val['visible']) != 1) continue; + if (abs($val['visible']) != 1 && abs($val['visible']) != 4) continue; if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index b6b2e572e49..c7a61328c68 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -40,7 +40,7 @@ $object->fields = dol_sort_array($object->fields, 'position'); foreach($object->fields as $key => $val) { // Discard if extrafield is a hidden field on form - if (abs($val['visible']) != 1) continue; + if (abs($val['visible']) != 1 && abs($val['visible']) != 4) continue; if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index a8af38d5240..371bc0c6ee5 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -76,7 +76,7 @@ ListOfMenusEntries=List of menu entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only. Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example: preg_match('/public/', $_SERVER['PHP_SELF'])?0:1 +VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example: preg_match('/public/', $_SERVER['PHP_SELF'])?0:1 IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) SearchAllDesc=Is the field used to make a search from the quick search tool? (Examples: 1 or 0) SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax. diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 68e84aee8e3..77975a4333a 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -1,6 +1,7 @@ +MenuBOM=Bills Of Materials BOMsSetup=Setup of module BOM -ListOfBOMs=List of BOMs -NewBOM=New BOM +ListOfBOMs=List of Bills Of Materials +NewBOM=New bill of material ProductBOMHelp=Product to create with this BOM BOMsNumberingModules=BOMs numbering templates BOMsModelModule=BOMS document templates diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e23177dca11..bb29c13f46f 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -62,7 +62,7 @@ class MyObject extends CommonObject * 'type' if the field format. * 'label' the translation key. * 'enabled' is a condition when the field must be managed. - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'default' is a default value for creation (can still be replaced by the global setup of default values) * 'index' if we want an index in database. From c2063c5d0b4eaddb8d189700228d12db8d3a6ebb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 18:24:55 +0100 Subject: [PATCH 05/22] Fix bad translation --- htdocs/langs/fr_FR/main.lang | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 1c0c44406be..c36882a2ad1 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -269,12 +269,12 @@ DatePayment=Date paiement DateApprove=Date approbation DateApprove2=Date approbation (deuxième approbation) RegistrationDate=Date d'inscription -UserCreation=Création de l'utilisateur -UserModification=Modification de l'utilisateur -UserValidation=Validation de l'utilisateur -UserCreationShort=Création de l'utilisateur -UserModificationShort=Modification de l'utilisateur -UserValidationShort=Utilisateur actif +UserCreation=Utilisateur de création +UserModification=Utilisateur de modification +UserValidation=Utilisateur de validation +UserCreationShort=Util. de création +UserModificationShort=Util. de modification +UserValidationShort=Util. de validation DurationYear=an DurationMonth=mois DurationWeek=semaine From 6ae36ce6a7f4515d0ce2a29f6c5ea319f40f49c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 19:20:01 +0100 Subject: [PATCH 06/22] Work on BOM --- htdocs/bom/bom_card.php | 10 +- htdocs/bom/bom_list.php | 2 + htdocs/bom/class/bom.class.php | 225 ++++++++++++++++-- htdocs/core/actions_addupdatedelete.inc.php | 6 +- htdocs/core/class/commonobject.class.php | 15 ++ .../install/mysql/migration/9.0.0-10.0.0.sql | 2 + htdocs/install/mysql/tables/llx_bom_bom.sql | 2 + htdocs/langs/en_US/mrp.lang | 1 + .../template/class/myobject.class.php | 28 ++- .../modulebuilder/template/myobject_card.php | 2 +- 10 files changed, 250 insertions(+), 43 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 7605dcae9c5..e31276ff652 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -89,20 +89,20 @@ if (empty($reshook)) if (empty($id)) $backtopage = $backurlforlist; else $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.$id; } - $triggermodname = 'BILLOFMATERIALS_BILLOFMATERIALS_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, delete or clone include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; // Actions when linking object each other - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to send emails - $trigger_name='BILLOFMATERIALS_SENTBYMAIL'; - $autocopy='MAIN_MAIL_AUTOCOPY_BILLOFMATERIALS_TO'; + $trigger_name='BOM_SENTBYMAIL'; + $autocopy='MAIN_MAIL_AUTOCOPY_BOM_TO'; $trackid='bom'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -208,7 +208,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetch_optionals(); $head = bomPrepareHead($object); - dol_fiche_head($head, 'card', $langs->trans("NewBOM"), -1, 'bom'); + dol_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); $formconfirm = ''; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 9d7c00caf67..b9b8168fd62 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -375,7 +375,9 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; + var_dump($val); if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } // Extra fields diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 349d4b03552..47aae86db04 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -60,6 +60,11 @@ class BOM extends CommonObject public $table_element_line = 'bom_bomline'; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_DISABLED = -1; + + /** * 'type' if the field format. * 'label' the translation key. @@ -85,18 +90,20 @@ class BOM extends CommonObject */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-1, 'position'=>61, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-1, 'position'=>62, 'notnull'=>-1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), - 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), + 'date_valid' => array('type'=>'datetime', 'label'=>'DateValid', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,), + 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), + 'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), + 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), - 'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1',), + 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1',), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Enabled', '-1'=>'Disabled')), ); public $rowid; @@ -116,7 +123,6 @@ class BOM extends CommonObject // END MODULEBUILDER PROPERTIES - // If this object has a subtable with lines /** @@ -278,14 +284,14 @@ class BOM extends CommonObject * * @return int <0 if KO, 0 if not found, >0 if OK */ - /*public function fetchLines() + public function fetchLines() { $this->lines=array(); - // Load lines with object BillOfMaterialsLine + // Load lines with object BOMLine return count($this->lines)?1:0; - }*/ + } /** * Load list of objects in memory from the database. @@ -390,6 +396,189 @@ class BOM extends CommonObject //return $this->deleteCommon($user, $notrigger, 1); } + + /** + * Validate bom + * + * @param User $user User making status change + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <=0 if OK, 0=Nothing done, >0 if KO + */ + public function valid($user, $notrigger = 0) + { + global $conf, $langs; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $error=0; + + // Protection + if ($this->statut == self::STATUS_VALIDATED) + { + dol_syslog(get_class($this)."::valid action abandonned: already validated", LOG_WARNING); + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->create)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + { + $this->error='NotEnoughPermissions'; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + return -1; + }*/ + + $now=dol_now(); + + $this->db->begin(); + + // Define new ref + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life + { + $num = $this->getNextNumRef(); + } + else + { + $num = $this->ref; + } + $this->newref = $num; + + // Validate + $sql = "UPDATE ".MAIN_DB_PREFIX."bom_bom"; + $sql.= " SET ref = '".$this->db->escape($num)."',"; + $sql.= " status = ".self::STATUS_VALIDATED.","; + $sql.= " date_valid='".$this->db->idate($now)."',"; + $sql.= " fk_user_valid = ".$user->id; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::valid()", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) + { + dol_print_error($this->db); + $this->error=$this->db->lasterror(); + $error++; + } + + if (! $error && ! $notrigger) + { + // Call trigger + $result=$this->call_trigger('BOM_VALIDATE', $user); + if ($result < 0) $error++; + // End call triggers + } + + if (! $error) + { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) + // in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->bom->dir_output.'/'.$oldref; + $dirdest = $conf->bom->dir_output.'/'.$newref; + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles=dol_dir_list($conf->bom->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach($listoffiles as $fileentry) + { + $dirsource=$fileentry['name']; + $dirdest=preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource=$fileentry['path'].'/'.$dirsource; + $dirdest=$fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } + } + } + } + } + + // Set new ref and current status + if (! $error) + { + $this->ref = $num; + $this->status = self::STATUS_VALIDATED; + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set draft status + * + * @param User $user Object user that modify + * @return int <0 if KO, >0 if OK + */ + public function setDraft($user) + { + //phpcs:enable + global $conf,$langs; + + $error=0; + + // Protection + if ($this->status <= self::STATUS_DRAFT) + { + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."bom"; + $sql.= " SET status = ".self::STATUS_DRAFT; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::setDraft", LOG_DEBUG); + if ($this->db->query($sql)) + { + if (!$error) { + // Call trigger + $result=$this->call_trigger('BOM_UNVALIDATE', $user); + if ($result < 0) $error++; + } + + if (!$error) { + $this->status=self::STATUS_DRAFT; + $this->db->commit(); + return 1; + }else { + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } + /** * Return a link to the object card (with optionaly the picto) * @@ -628,9 +817,9 @@ class BOM extends CommonObject /** - * Class for BillOfMaterialsLine + * Class for BOMLine */ -class BillOfMaterialsLine extends CommonObject +class BOMLine extends CommonObject { /** * @var string ID to identify managed object @@ -853,24 +1042,10 @@ class BillOfMaterialsLine extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); return $result; } - /** - * Load object lines in memory from the database - * - * @return int <0 if KO, 0 if not found, >0 if OK - */ - /*public function fetchLines() - { - $this->lines=array(); - - // Load lines with object BillOfMaterialsLineLine - - return count($this->lines)?1:0; - }*/ - /** * Load list of objects in memory from the database. * diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index e36b80ce8ed..85d89c08e4b 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -63,6 +63,10 @@ if ($action == 'add' && ! empty($permissiontoadd)) if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field $object->$key=$value; + if ($val['notnull'] > 0 && $object->$key == '' && ! is_null($val['default']) && $val['default'] == '(PROV)') + { + $object->$key = '(PROV)'; + } if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { $error++; @@ -75,7 +79,7 @@ if ($action == 'add' && ! empty($permissiontoadd)) $result=$object->create($user); if ($result > 0) { - // Creation OK + // Creation OK $urltogo=$backtopage?str_replace('__ID__', $result, $backtopage):$backurlforlist; header("Location: ".$urltogo); exit; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 367fae984b6..73002dfceb4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7222,6 +7222,21 @@ abstract class CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); } + // If we have a field ref with a default value of (PROV) + if (! $error) + { + if (key_exists('ref', $this->fields) && $this->fields['ref']['notnull'] > 0 && ! is_null($this->fields['ref']['default']) && $this->fields['ref']['default'] == '(PROV)') + { + $sql="UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ref = '(PROV".$this->id.")' WHERE ref = '(PROV)' AND rowid = ".$this->id; + $resqlupdate = $this->db->query($sql); + if ($resqlupdate===false) + { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + } + // Create extrafields if (! $error) { 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 4b6a511d0e5..f88b7113037 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 @@ -186,8 +186,10 @@ CREATE TABLE llx_bom_bom( note_private text, date_creation datetime NOT NULL, tms timestamp NOT NULL, + date_valid datetime, fk_user_creat integer NOT NULL, fk_user_modif integer, + fk_user_valid integer, import_key varchar(14), status integer NOT NULL, fk_product integer, diff --git a/htdocs/install/mysql/tables/llx_bom_bom.sql b/htdocs/install/mysql/tables/llx_bom_bom.sql index 2bca889c970..89a2f8e8bab 100644 --- a/htdocs/install/mysql/tables/llx_bom_bom.sql +++ b/htdocs/install/mysql/tables/llx_bom_bom.sql @@ -25,8 +25,10 @@ CREATE TABLE llx_bom_bom( note_private text, date_creation datetime NOT NULL, tms timestamp NOT NULL, + date_valid datetime, fk_user_creat integer NOT NULL, fk_user_modif integer, + fk_user_valid integer, import_key varchar(14), status integer NOT NULL, fk_product integer, diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 77975a4333a..de156055335 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -1,4 +1,5 @@ MenuBOM=Bills Of Materials +BillOfMaterials=Bill of Materials BOMsSetup=Setup of module BOM ListOfBOMs=List of Bills Of Materials NewBOM=New bill of material diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index bb29c13f46f..00cb961fc90 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -58,8 +58,13 @@ class MyObject extends CommonObject public $picto = 'myobject@mymodule'; + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_DISABLED = -1; + + /** - * 'type' if the field format. + * 'type' if the field format ('integer', 'integer:Class:pathtoclass', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float') * 'label' the translation key. * 'enabled' is a condition when the field must be managed. * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) @@ -82,23 +87,24 @@ class MyObject extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields=array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1), - 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>'(PROV)', 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1), + 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'), + 'qty' =>array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity'), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>0, 'position'=>60), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), + 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>501), //'date_validation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Canceled')), + 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Canceled')), ); /** diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index de3b2ec8b99..2cf6d6d4a6a 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -130,7 +130,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; // Actions when linking object each other - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; From d33fb9eff09383161a803649ce0994ea05a0f725 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2019 19:30:32 +0100 Subject: [PATCH 07/22] Work on BOM module --- htdocs/bom/bom_list.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index b9b8168fd62..b078c29c99b 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -377,7 +377,6 @@ foreach($object->fields as $key => $val) if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - var_dump($val); if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } // Extra fields @@ -403,6 +402,7 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; if (! empty($arrayfields['t.'.$key]['checked'])) { @@ -454,9 +454,9 @@ while ($i < min($num, $limit)) $cssforfield=''; if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if (! empty($arrayfields['t.'.$key]['checked'])) { diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index a310f4258e9..d4193118c75 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -409,6 +409,7 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } @@ -435,6 +436,7 @@ foreach($object->fields as $key => $val) $cssforfield=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center'; if (! empty($arrayfields['t.'.$key]['checked'])) { @@ -490,6 +492,8 @@ while ($i < min($num, $limit)) if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap'; elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap'; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right'; + if (! empty($arrayfields['t.'.$key]['checked'])) { print ' Date: Tue, 12 Mar 2019 19:44:59 +0100 Subject: [PATCH 08/22] Reduce quantity of string to translates --- htdocs/admin/emailcollector_card.php | 2 +- htdocs/bom/bom_card.php | 2 +- htdocs/comm/action/card.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/compta/sociales/card.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/expensereport/card.php | 2 +- htdocs/fichinter/card.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/langs/en_US/agenda.lang | 1 - htdocs/langs/en_US/bills.lang | 1 - htdocs/langs/en_US/compta.lang | 1 - htdocs/langs/en_US/contracts.lang | 1 - htdocs/langs/en_US/interventions.lang | 1 - htdocs/langs/en_US/mails.lang | 1 - htdocs/langs/en_US/mrp.lang | 1 + htdocs/langs/en_US/orders.lang | 1 - htdocs/langs/en_US/products.lang | 1 - htdocs/langs/en_US/projects.lang | 1 - htdocs/langs/en_US/propal.lang | 1 - htdocs/langs/en_US/supplier_proposal.lang | 1 - htdocs/langs/en_US/trips.lang | 1 - htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/product/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- htdocs/variants/combinations.php | 17 +---------------- 30 files changed, 18 insertions(+), 44 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index de4959354db..fd74938d802 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -307,7 +307,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'clone') { // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneMyObject'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEmailCollector', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation of action process diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index e31276ff652..25bcb8a1b15 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -222,7 +222,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'clone') { // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneBillOfMaterials'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation of action xxxx diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6ad881d141c..c6a4c3d225c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1391,7 +1391,7 @@ if ($id > 0) // Clone event if($action == 'clone') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', $formquestion, 'yes', 1); print $formconfirm; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 9e8fb3a9964..b710ba4656b 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -961,7 +961,7 @@ else array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0) ); // Paiement incomplet. On demande si motif = escompte ou autre - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneEMailing'), $langs->trans('ConfirmCloneEMailing', $object->ref), 'confirm_clone', $formquestion, 'yes', 2, 240); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEMailing', $object->ref), 'confirm_clone', $formquestion, 'yes', 2, 240); } /* diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 32b802a941e..eb8ba5f0520 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1880,7 +1880,7 @@ if ($action == 'create') $formquestion[] = array('type' => 'date','name' => 'date_delivery','label' => $langs->trans("DeliveryDate"),'value' => $object->date_livraison); } // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ClonePropal'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } if ($action == 'statut') diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4df831f9793..33dc913fe45 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2047,7 +2047,7 @@ if ($action == 'create' && $user->rights->commande->creer) // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' // => 1), array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=3)'))); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Call Hook formConfirm diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 59fcb22d96d..ecd776ea75f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3608,7 +3608,7 @@ elseif ($id > 0 || ! empty($ref)) // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1))); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Call Hook formConfirm diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index fe29e133edc..d3093a6f374 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -419,7 +419,7 @@ if ($id > 0) ); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneTax'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formclone, 'yes'); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formclone, 'yes'); } // Confirmation de la suppression de la charge diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index ea74e0a73db..4f0022a7796 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1364,7 +1364,7 @@ else } elseif ($action == 'clone') { // Clone confirmation $formquestion = array(array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)'))); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneContract'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b7cb41f389a..15494a51758 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1606,7 +1606,7 @@ else array('type' => 'other','name' => 'fk_user_author','label' => $langs->trans("SelectTargetUser"),'value' => $form->select_dolusers((GETPOST('fk_user_author', 'int')> 0 ? GETPOST('fk_user_author', 'int') : $user->id), 'fk_user_author', 0, null, 0, $criteriaforfilter)) ); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneExpenseReport'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } if ($action == 'save') diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3230092b541..485a04b6a02 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1170,7 +1170,7 @@ elseif ($id > 0 || ! empty($ref)) // => 1), array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '', '', 0, 0, null, 0, 'minwidth200'))); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneIntervention'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } if (!$formconfirm) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 045beb3bb0c..971c745886f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1705,7 +1705,7 @@ elseif (! empty($object->id)) //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation de la validation diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 03f3442351d..b6e971bd4f5 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2232,7 +2232,7 @@ else //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation de la validation diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index a38f3d23932..d4cce020d00 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -126,7 +126,6 @@ AddEvent=Create event MyAvailability=My availability ActionType=Event type DateActionBegin=Start event date -CloneAction=Clone event ConfirmCloneEvent=Are you sure you want to clone the event %s? RepeatEvent=Repeat event EveryWeek=Every week diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 17853434ea9..0934b4c1e46 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -322,7 +322,6 @@ PaymentNumber=Payment number RemoveDiscount=Remove discount WatermarkOnDraftBill=Watermark on draft invoices (nothing if empty) InvoiceNotChecked=No invoice selected -CloneInvoice=Clone invoice ConfirmCloneInvoice=Are you sure you want to clone this invoice %s? DisabledBecauseReplacedInvoice=Action disabled because invoice has been replaced DescTaxAndDividendsArea=This area presents a summary of all payments made for special expenses. Only records with payments during the fixed year are included here. diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index c6c3921edea..02feb47ccb9 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -232,7 +232,6 @@ ACCOUNTING_ACCOUNT_CUSTOMER=Accounting account used for customer third parties ACCOUNTING_ACCOUNT_CUSTOMER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated customer accounting account on third party is not defined. ACCOUNTING_ACCOUNT_SUPPLIER=Accounting account used for vendor third parties ACCOUNTING_ACCOUNT_SUPPLIER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated vendor accounting account on third party is not defined. -CloneTax=Clone a social/fiscal tax ConfirmCloneTax=Confirm the clone of a social/fiscal tax CloneTaxForNextMonth=Clone it for next month SimpleReport=Simple report diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index b4e8d7c96d9..51b73423fb0 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -85,7 +85,6 @@ NoteListOfYourExpiredServices=This list contains only services of contracts for StandardContractsTemplate=Standard contracts template ContactNameAndSignature=For %s, name and signature: OnlyLinesWithTypeServiceAreUsed=Only lines with type "Service" will be cloned. -CloneContract=Clone contract ConfirmCloneContract=Are you sure you want to clone the contract %s? LowerDateEndPlannedShort=Lower planned end date of active services SendContractRef=Contract information __REF__ diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 2025fb03181..e7667ef6946 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -15,7 +15,6 @@ DeleteIntervention=Delete intervention ValidateIntervention=Validate intervention ModifyIntervention=Modify intervention DeleteInterventionLine=Delete intervention line -CloneIntervention=Clone intervention ConfirmDeleteIntervention=Are you sure you want to delete this intervention? ConfirmValidateIntervention=Are you sure you want to validate this intervention under name %s? ConfirmModifyIntervention=Are you sure you want to modify this intervention? diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index b055b38268a..b50faffe2fa 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -58,7 +58,6 @@ EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions MailingAddFile=Attach this file NoAttachedFiles=No attached files BadEMail=Bad value for Email -CloneEMailing=Clone Emailing ConfirmCloneEMailing=Are you sure you want to clone this emailing? CloneContent=Clone message CloneReceivers=Cloner recipients diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index de156055335..dfc8437d08a 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -8,3 +8,4 @@ BOMsNumberingModules=BOMs numbering templates BOMsModelModule=BOMS document templates FreeLegalTextOnBOMs=Free text on document of BOMs WatermarkOnDraftBOMs=Watermark on draft BOMs +ConfirmCloneBillOfMaterials diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 1f53d0c050a..ad895845488 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -110,7 +110,6 @@ OrderMode=Order method AuthorRequest=Request author UserWithApproveOrderGrant=Users granted with "approve orders" permission. PaymentOrderRef=Payment of order %s -CloneOrder=Clone order ConfirmCloneOrder=Are you sure you want to clone this order %s? DispatchSupplierOrder=Receiving purchase order %s FirstApprovalAlreadyDone=First approval already done diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 401ccc5462e..325297b6d1f 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -144,7 +144,6 @@ ListProductByPopularity=List of products by popularity ListServiceByPopularity=List of services by popularity Finished=Manufactured product RowMaterial=Raw Material -CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s? CloneContentProduct=Clone all main information of product/service ClonePricesProduct=Clone prices diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 8cb78975066..4f395925cdd 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -131,7 +131,6 @@ TaskIsNotAssignedToUser=Task not assigned to user. Use button '%s%s tasks at the moment) and all inputs of time spent. IfNeedToUseOtherObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties. -CloneProject=Clone project CloneTasks=Clone tasks CloneContacts=Clone contacts CloneNotes=Clone notes diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 44da81357ef..7fce5107356 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -56,7 +56,6 @@ CopyPropalFrom=Create commercial proposal by copying existing proposal CreateEmptyPropal=Create empty commercial proposal or from list of products/services DefaultProposalDurationValidity=Default commercial proposal validity duration (in days) UseCustomerContactAsPropalRecipientIfExist=Use contact/address with type 'Contact following-up proposal' if defined instead of third party address as proposal recipient address -ClonePropal=Clone commercial proposal ConfirmClonePropal=Are you sure you want to clone the commercial proposal %s? ConfirmReOpenProp=Are you sure you want to open back the commercial proposal %s? ProposalsAndProposalsLines=Commercial proposal and lines diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index 501b6d907e3..ff738a949a6 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -34,7 +34,6 @@ SupplierProposalStatusSignedShort=Accepted SupplierProposalStatusNotSignedShort=Refused CopyAskFrom=Create price request by copying existing a request CreateEmptyAsk=Create blank request -CloneAsk=Clone price request ConfirmCloneAsk=Are you sure you want to clone the price request %s? ConfirmReOpenAsk=Are you sure you want to open back the price request %s? SendAskByMail=Send price request by mail diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 3072dae1df6..19710e8915d 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -109,7 +109,6 @@ NoTripsToExportCSV=No expense report to export for this period. ExpenseReportPayment=Expense report payment ExpenseReportsToApprove=Expense reports to approve ExpenseReportsToPay=Expense reports to pay -CloneExpenseReport=Clone expense report ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ? ExpenseReportsIk=Expense report milles index ExpenseReportsRules=Expense report rules diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 2cf6d6d4a6a..283e0a29749 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -257,7 +257,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'clone') { // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneMyObject'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation of action xxxx diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 18ea87cb03a..dc286faa36c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2000,7 +2000,7 @@ if (($action == 'delete' && (empty($conf->use_javascript_ajax) || ! empty($conf- if (($action == 'clone' && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js || (! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) // Always output when not jmobile nor js { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloneProduct'), $langs->trans('ConfirmCloneProduct', $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'action-clone', 260, 600); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneProduct', $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'action-clone', 260, 600); } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 933faf3b34a..d60175e3639 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1328,7 +1328,7 @@ if ($action == 'create') // 1), array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', 's.fournisseur=1'))); // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneAsk'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirm delete diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index c53193411ff..278d3656a6f 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -640,22 +640,7 @@ if (! empty($id) || ! empty($ref)) ); } } elseif ($action === 'copy') { - - print $form->formconfirm( - 'combinations.php?id='.$id, - $langs->trans('CloneCombinationsProduct'), - $langs->trans('ConfirmCloneProductCombinations'), - 'confirm_copycombination', - array( - array( - 'type' => 'text', - 'label' => $langs->trans('CloneDestinationReference'), - 'name' => 'dest_product' - ) - ), - 0, - 1 - ); + print $form->formconfirm('combinations.php?id='.$id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneProductCombinations'), 'confirm_copycombination', array(array('type' => 'text', 'label' => $langs->trans('CloneDestinationReference'), 'name' => 'dest_product')), 0, 1); } $comb2val = new ProductCombination2ValuePair($db); From 0e1479ef4ea7320fcc26395f511cd611f94e75ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 11:04:14 +0100 Subject: [PATCH 09/22] Lang --- htdocs/langs/en_US/mrp.lang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index dfc8437d08a..fcfcaba700a 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -1,11 +1,11 @@ -MenuBOM=Bills Of Materials -BillOfMaterials=Bill of Materials +MenuBOM=Bills of material +BillOfMaterials=Bill of Material BOMsSetup=Setup of module BOM -ListOfBOMs=List of Bills Of Materials +ListOfBOMs=List of bills of material (BOM) NewBOM=New bill of material ProductBOMHelp=Product to create with this BOM -BOMsNumberingModules=BOMs numbering templates +BOMsNumberingModules=BOM numbering templates BOMsModelModule=BOMS document templates -FreeLegalTextOnBOMs=Free text on document of BOMs -WatermarkOnDraftBOMs=Watermark on draft BOMs -ConfirmCloneBillOfMaterials +FreeLegalTextOnBOMs=Free text on document of BOM +WatermarkOnDraftBOMs=Watermark on draft BOM +ConfirmCloneBillOfMaterials=Are you sure you want to clone this bill of material ? From 10f572b4004b138b012addf66c2404ac402bdae8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 11:13:03 +0100 Subject: [PATCH 10/22] Remove warning --- htdocs/datapolicy/class/actions_datapolicy.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index e336e8d6df6..1243b5d057e 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -448,6 +448,8 @@ class ActionsDatapolicy } } - echo $jsscript; + $this->resprint = $jsscript; + + return 0; } } From 88c02143fac8043ce2befc7f6d80758c951cf707 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 13:40:57 +0100 Subject: [PATCH 11/22] Fix missing fields --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 6 +++--- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index d72777db230..f749e57b432 100644 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -42,9 +42,9 @@ ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax2_type varchar(10) UPDATE llx_user set api_key = null where api_key = ''; -ALTER TABLE llx_actioncomm ADD COLUMN email_subject varchar(256) after email_msgid; -ALTER TABLE llx_actioncomm ADD COLUMN email_tocc varchar(256) after email_to; -ALTER TABLE llx_actioncomm ADD COLUMN email_tobcc varchar(256) after email_tocc; +ALTER TABLE llx_actioncomm ADD COLUMN email_subject varchar(255) after email_msgid; +ALTER TABLE llx_actioncomm ADD COLUMN email_tocc varchar(255) after email_to; +ALTER TABLE llx_actioncomm ADD COLUMN email_tobcc varchar(255) after email_tocc; ALTER TABLE llx_user MODIFY COLUMN pass varchar(128); diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 31689120cfc..643e411ee5e 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -48,6 +48,9 @@ create table llx_facture_rec_extrafields import_key varchar(14) ) ENGINE=innodb; +ALTER TABLE llx_actioncomm ADD COLUMN email_subject varchar(255) after email_msgid; +ALTER TABLE llx_actioncomm ADD COLUMN email_tocc varchar(255) after email_to; +ALTER TABLE llx_actioncomm ADD COLUMN email_tobcc varchar(255) after email_tocc; -- For 9.0 ALTER TABLE llx_extrafields ADD COLUMN help text NULL; From c32551cb6238a3e4aaed77b5e0f5a3ef3b8ff326 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 13:42:14 +0100 Subject: [PATCH 12/22] Fix size of varchar --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 +- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 0d48fa89718..0f84c92ef22 100644 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -111,7 +111,7 @@ ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(255) NOT NULL DEFAUL -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; -- VPGSQL8.2 DROP table llx_c_shipment_mode; --- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(256) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL); +-- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(255) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL); -- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (1,'CATCH','Catch','Catch by client','',1); -- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (2,'TRANS','Transporter','Generic transporter','',1); -- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi','',0); diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 891f79edc0f..ebcca580870 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -666,11 +666,11 @@ ALTER TABLE llx_actioncomm DROP INDEX idx_actioncomm_datea; ALTER TABLE llx_actioncomm DROP COLUMN datea2; -- Email tracking -ALTER TABLE llx_actioncomm ADD COLUMN email_msgid varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN email_from varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN email_sender varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN email_to varchar(256); -ALTER TABLE llx_actioncomm ADD COLUMN errors_to varchar(256); +ALTER TABLE llx_actioncomm ADD COLUMN email_msgid varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN email_from varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN email_sender varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN email_to varchar(255); +ALTER TABLE llx_actioncomm ADD COLUMN errors_to varchar(255); -- Recurring events ALTER TABLE llx_actioncomm ADD COLUMN recurid varchar(128); From 68cc7f0e8969cbb6898da868acff4e72ab05160d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 13:53:29 +0100 Subject: [PATCH 13/22] Fix css --- htdocs/theme/eldy/badges.inc.php | 26 ++++++++++++++------------ htdocs/theme/eldy/theme_vars.inc.php | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 7384fffed5f..ab4be871d7c 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -25,13 +25,13 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .badge-pill, .tabs .badge { padding-right: .6em; padding-left: .6em; - border-radius: 10rem; + border-radius: 0.25rem; } .badge-dot { padding: 0; border-radius: 50%; - padding: 0.6em; + padding: 0.25rem; vertical-align: middle; } @@ -39,8 +39,10 @@ a.badge:focus, a.badge:hover { text-decoration: none; } - - +.liste_titre .badge { + background-color: ; + color: #fff; +} /* PRIMARY */ @@ -155,7 +157,7 @@ a.badge-dark:focus, a.badge-dark:hover { background-color: ; } -/* +/* * STATUS BADGES */ @@ -164,32 +166,32 @@ a.badge-dark:focus, a.badge-dark:hover { Date: Wed, 13 Mar 2019 14:10:36 +0100 Subject: [PATCH 14/22] Standardize translation of amount --- htdocs/comm/propal/card.php | 13 ++++++++++--- htdocs/commande/card.php | 12 ++++++------ htdocs/compta/facture/card.php | 6 +++--- htdocs/fichinter/card.php | 12 ++++++------ htdocs/fourn/commande/card.php | 12 ++++++------ htdocs/fourn/facture/card.php | 12 ++++++------ htdocs/supplier_proposal/card.php | 12 ++++++------ 7 files changed, 43 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index eb8ba5f0520..44c05629744 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1764,8 +1764,8 @@ if ($action == 'create') $newclassname = 'Intervention'; print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0 ) // Localtax1 { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . ""; @@ -1775,7 +1775,14 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . ""; + + if (!empty($conf->multicurrency->enabled)) + { + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + } } print "\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 33dc913fe45..65dba5049f4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1836,8 +1836,8 @@ if ($action == 'create' && $user->rights->commande->creer) print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; // Amount - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1848,13 +1848,13 @@ if ($action == 'create' && $user->rights->commande->creer) print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ecd776ea75f..e3fea0200dc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3245,8 +3245,8 @@ if ($action == 'create') echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; } echo ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -3256,7 +3256,7 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 485a04b6a02..d9434d018c3 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1013,8 +1013,8 @@ if ($action == 'create') // Amount /* Hide amount because we only copy services so amount may differ than source - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1025,13 +1025,13 @@ if ($action == 'create') print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } */ } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 971c745886f..7c4b09a6f6c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1611,8 +1611,8 @@ if ($action=='create') $newclassname = $classname; print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1623,13 +1623,13 @@ if ($action=='create') print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ''; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ''; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ''; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ''; } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b6e971bd4f5..2fc36516bc6 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2093,8 +2093,8 @@ if ($action == 'create') echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['invoice_supplier'])->getNomUrl(1).')'; } echo ''; - print ''.$langs->trans('TotalHT').''.price($objectsrc->total_ht).''; - print ''.$langs->trans('TotalVAT').''.price($objectsrc->total_tva).""; + print ''.$langs->trans('AmountHT').''.price($objectsrc->total_ht).''; + print ''.$langs->trans('AmountVAT').''.price($objectsrc->total_tva).""; if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1 { print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($objectsrc->total_localtax1).""; @@ -2104,13 +2104,13 @@ if ($action == 'create') { print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($objectsrc->total_localtax2).""; } - print ''.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc).""; + print ''.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc).""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index d60175e3639..d5370a7361e 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1209,8 +1209,8 @@ if ($action == 'create') print ''; print '' . $langs->trans('CommRequest') . '' . $objectsrc->getNomUrl(1) . ''; - print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; - print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; + print '' . $langs->trans('AmountHT') . '' . price($objectsrc->total_ht) . ''; + print '' . $langs->trans('AmountVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0 ) // Localtax1 { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . ""; @@ -1220,13 +1220,13 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } - print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; + print '' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . ""; if (!empty($conf->multicurrency->enabled)) { - print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; - print '' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; - print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; + print '' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; + print '' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . ""; + print '' . $langs->trans('MulticurrencyAmountTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } From 9da84f68c7e466cd5ca5e2bcb94c3f8fc17c5075 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 14:23:27 +0100 Subject: [PATCH 15/22] Bad language file for civility order --- htdocs/core/class/notify.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e7cd7cabe53..3ae3c9acf32 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -459,7 +459,7 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_APPROVE': @@ -467,7 +467,7 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': @@ -475,7 +475,7 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': From 1bd9d6a8e5ebad40b3b1aedaf19965791dfb7565 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 15:02:43 +0100 Subject: [PATCH 16/22] Fix font awesome 5 picto for notes --- htdocs/core/lib/functions.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2a3410eae56..53bac454c8c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2979,7 +2979,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( - 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', + 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', 'jabber','skype','twitter','facebook','linkedin' ) @@ -3050,6 +3050,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } elseif ($pictowithoutext == 'note') { $fakey = 'fa-sticky-note-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-sticky-note'; $fa = 'far'; + } $facolor = '#999'; $marginleftonlyshort=1; } From ae6b672204bddd187bf3d8d2fea0ff62fee89e8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 15:04:38 +0100 Subject: [PATCH 17/22] Look and feel v10 --- htdocs/admin/menus.php | 2 +- htdocs/admin/menus/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index f18b09b7d05..4c3c306cc59 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -155,7 +155,7 @@ print ''; dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1); -print $langs->trans("MenusDesc")."
\n"; +print ''.$langs->trans("MenusDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 7fda7fca2ec..5283d9a3aca 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -237,7 +237,7 @@ $h++; dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1); -print $langs->trans("MenusEditorDesc")."
\n"; +print ''.$langs->trans("MenusEditorDesc")."
\n"; print "
\n"; From e0208cb3d66ae1c921e91feb222f5015a324d591 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 18:11:15 +0100 Subject: [PATCH 18/22] Generation of PDF doc --- htdocs/core/class/utils.class.php | 3 +-- htdocs/langs/en_US/modulebuilder.lang | 2 +- htdocs/modulebuilder/index.php | 23 ++++++++++++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 4e6a989e12f..d3f8e55832a 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -705,9 +705,8 @@ class Utils $result = ($resarray['result'] == 0) ? 1 : 0; // Build PDF doc - $command=$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOC; + $command=$conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF; $outfile=$dirofmoduletmp.'/outpdf.tmp'; - $resarray = $utils->executeCLI($command, $outfile); if ($resarray['result'] != '0') { diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 371bc0c6ee5..329c4921ca3 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -40,7 +40,7 @@ PageForAgendaTab=PHP page for event tab PageForDocumentTab=PHP page for document tab PageForNoteTab=PHP page for note tab PathToModulePackage=Path to zip of module/application package -PathToModuleDocumentation=Path to file of module/application documentation +PathToModuleDocumentation=Path to file of module/application documentation (%s) SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed. FileNotYetGenerated=File not yet generated RegenerateClassAndSql=Erase and regenerate class and sql files diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index af51071d674..b5559534a3b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -930,7 +930,7 @@ if ($dirins && $action == 'generatepackage') if ($dirins && $action == 'generatedoc') { - $FILENAMEDOC=strtolower($module).'.html'; // TODO Use/text PDF + $FILENAMEDOC=strtolower($module).'.html'; $dirofmodule = dol_buildpath(strtolower($module), 0).'/doc'; $outputfiledoc = $dirofmodule.'/'.$FILENAMEDOC; @@ -947,6 +947,7 @@ if ($dirins && $action == 'generatedoc') } } + // Save file if ($action == 'savefile' && empty($cancel)) { @@ -2814,9 +2815,11 @@ elseif (! empty($module)) $outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP; $FILENAMEDOC=$modulelowercase.'.html'; + $FILENAMEDOCPDF=$modulelowercase.'.pdf'; $outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC; $outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC; - // TODO Use/test PDF + $outputfiledocpdf = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOCPDF; + $outputfiledocurlpdf = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOCPDF; } print '
'; @@ -2842,7 +2845,8 @@ elseif (! empty($module)) print '


'; - print ' '. $langs->trans("PathToModuleDocumentation") . ' : '; + // HTML + print ' '. $langs->trans("PathToModuleDocumentation", "HTML") . ' : '; if (! dol_is_file($outputfiledoc)) print ''.$langs->trans("FileNotYetGenerated").''; else { print ''; @@ -2854,6 +2858,19 @@ elseif (! empty($module)) } print '
'; + // PDF + print ' '. $langs->trans("PathToModuleDocumentation", "PDF") . ' : '; + if (! dol_is_file($outputfiledocpdf)) print ''.$langs->trans("FileNotYetGenerated").''; + else { + print ''; + print ''; + print $outputfiledocpdf; + print ''; + print ''; + print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')'; + } + print '

'; + print '
'; print '
'; From e7cd8d690ce795494f0e2e4b5efa23f47b8aa14a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 19:06:45 +0100 Subject: [PATCH 19/22] Remove warnings --- htdocs/comm/action/list.php | 4 ++-- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/hrm/index.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 4 +++- htdocs/ticket/list.php | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 8bf84f45cde..ded7d4fd238 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -691,11 +691,11 @@ if ($resql) // Date creation if (! empty($arrayfields['a.datec']['checked'])) { // Status/Percent - print ''.dol_print_date($obj->datec, 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->datec), 'dayhour').''; } // Date update if (! empty($arrayfields['a.tms']['checked'])) { - print ''.dol_print_date($obj->datem, 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->datem), 'dayhour').''; } if (! empty($arrayfields['a.percent']['checked'])) { // Status/Percent diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 53bac454c8c..dddd8506eb1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1790,9 +1790,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg) || preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 { - // TODO Remove this. - // This part of code should not be used. + // TODO Remove this. This part of code should not be used. dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR); + //if (function_exists('debug_print_backtrace')) debug_print_backtrace(); // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' $syear = (! empty($reg[1]) ? $reg[1] : ''); $smonth = (! empty($reg[2]) ? $reg[2] : ''); @@ -1801,7 +1801,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang $smin = (! empty($reg[5]) ? $reg[5] : ''); $ssec = (! empty($reg[6]) ? $reg[6] : ''); - $time=dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); + $time=²($shour, $smin, $ssec, $smonth, $sday, $syear, true); $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); } else diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 3751935b81c..2985386676f 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -226,8 +226,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning'; $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon'; - print ''.dol_print_date($obj->date_start, 'day').' '.$langs->trans($listhalfday[$starthalfday]); - print ''.dol_print_date($obj->date_end, 'day').' '.$langs->trans($listhalfday[$endhalfday]); + print ''.dol_print_date($db->jdate($obj->date_start), 'day').' '.$langs->trans($listhalfday[$starthalfday]); + print ''.dol_print_date($db->jdate($obj->date_end), 'day').' '.$langs->trans($listhalfday[$endhalfday]); print ''.dol_print_date($db->jdate($obj->dm), 'day').''; print ''.$holidaystatic->LibStatut($obj->status, 3).''; print ''; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index d4193118c75..35c60248ccf 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -503,7 +503,9 @@ while ($i < min($num, $limit)) print $val['css']; if ($cssforfield || $val['css']) print '"'; print '>'; - print $object->showOutputField($val, $key, $obj->$key, ''); + if ($key == 'status') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); + else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; if (! empty($val['isameasure'])) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 7b61bd7c1b5..02e441adba0 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -640,6 +640,7 @@ while ($i < min($num, $limit)) if ($cssforfield || $val['css']) print '"'; print '>'; if ($key == 'fk_statut') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; From fcbd39fda9966510d6d683c801be6c87c8df1749 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 19:07:19 +0100 Subject: [PATCH 20/22] Fix typo --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dddd8506eb1..305b53dc37f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1801,7 +1801,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang $smin = (! empty($reg[5]) ? $reg[5] : ''); $ssec = (! empty($reg[6]) ? $reg[6] : ''); - $time=²($shour, $smin, $ssec, $smonth, $sday, $syear, true); + $time=dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); } else From c3c7e3c1fb8180c169ffc2917ecc4c73d52f5839 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Mar 2019 19:08:45 +0100 Subject: [PATCH 21/22] Remove warning on date --- htdocs/bom/bom_list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index b078c29c99b..b0ffd62155c 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -467,7 +467,9 @@ while ($i < min($num, $limit)) print $val['css']; if ($cssforfield || $val['css']) print '"'; print '>'; - print $object->showOutputField($val, $key, $obj->$key, ''); + if ($key == 'status') print $object->getLibStatut(5); + elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); + else print $object->showOutputField($val, $key, $obj->$key, ''); print ''; if (! $i) $totalarray['nbfield']++; if (! empty($val['isameasure'])) From f8a4d9075ba22c8dbf52e6c2d3d7b53b25b970ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Mar 2019 11:48:25 +0100 Subject: [PATCH 22/22] Fix css for fontawesome 5 --- htdocs/admin/bank.php | 62 ++++++++++----------------- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 12 +++++- 3 files changed, 35 insertions(+), 41 deletions(-) diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 9fc256540a2..2a0a66fe269 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -50,8 +50,8 @@ $type = 'bankaccount'; //Order display of bank account if ($action == 'setbankorder') { - if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", - GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -62,8 +62,8 @@ if ($action == 'setbankorder') { //Auto report last num releve on conciliate if ($action == 'setreportlastnumreleve') { - if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, - '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -72,8 +72,8 @@ if ($action == 'setreportlastnumreleve') { } } elseif ($action == 'unsetreportlastnumreleve') { - if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, - '', $conf->entity) > 0) { + if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, '', $conf->entity) > 0) + { header("Location: " . $_SERVER["PHP_SELF"]); exit; } @@ -100,8 +100,7 @@ if ($action == 'specimen') { $filefound = 0; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php", - 0); + $file = dol_buildpath($reldir . "core/modules/bank/doc/pdf_" . $modele . ".modules.php", 0); if (file_exists($file)) { $filefound = 1; $classname = "pdf_" . $modele; @@ -142,8 +141,7 @@ elseif ($action == 'del') { } // Set default model elseif ($action == 'setdoc') { - if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '', - $conf->entity)) { + if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // The constant that was read before the new set // We therefore requires a variable to have a coherent view $conf->global->BANKADDON_PDF = $value; @@ -169,8 +167,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader("", $langs->trans("BankSetupModule")); $linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, - 'title_setup'); +print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); @@ -252,7 +249,7 @@ if ($resql) { while ($i < $num_rows) { $array = $db->fetch_array($resql); array_push($def, $array[0]); - $i ++; + $i++; } } else { @@ -285,8 +282,7 @@ foreach ($dirmodels as $reldir) { arsort($filelist); foreach ($filelist as $file) { - if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', - $file)) { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir . '/' . $file)) { $name = substr($file, 4, dol_strlen($file) - 16); @@ -296,11 +292,9 @@ foreach ($dirmodels as $reldir) { $module = new $classname($db); $modulequalified = 1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL - < 2) + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL - < 1) + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; if ($modulequalified) { @@ -317,27 +311,23 @@ foreach ($dirmodels as $reldir) { if (in_array($name, $def)) { print '' . "\n"; print ''; - print img_picto($langs->trans("Enabled"), - 'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print '' . "\n"; - print '' . img_picto($langs->trans("Disabled"), - 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; print ""; } // Default print ''; if ($conf->global->BANKADDON_PDF == $name) { - print img_picto($langs->trans("Default"), - 'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print '' . img_picto($langs->trans("Disabled"), - 'off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; } print ''; @@ -348,30 +338,25 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= '
' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur; } $htmltooltip .= '

' . $langs->trans("FeaturesSupported") . ':'; - $htmltooltip .= '
' . $langs->trans("Logo") . ': ' . yn($module->option_logo, - 1, 1); + $htmltooltip .= '
' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1); //$htmltooltip .= '
' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1); //$htmltooltip .= '
' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1); - $htmltooltip .= '
' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, - 1, 1); + $htmltooltip .= '
' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1); // $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); // $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); //$htmltooltip .= '
' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('', $htmltooltip, 1, - 0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview print ''; if ($module->type == 'pdf') { - print '' . img_object($langs->trans("Preview"), - 'bill') . ''; + print '' . img_object($langs->trans("Preview"), 'bill') . ''; } else { - print img_object($langs->trans("PreviewNotAvailable"), - 'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -423,8 +408,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { else { print '' . "\n"; - print '' . img_picto($langs->trans("Disabled"), - 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; print ""; } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 56ae3405a98..f8cb32896f2 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -944,7 +944,7 @@ class Translate * If mb_convert_encoding is not available, return currency code. * * @param string $currency_code Currency code - * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. + * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only the requested currency. * @return string Currency symbol encoded into UTF8 */ public function getCurrencySymbol($currency_code, $forceloadall = 0) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 305b53dc37f..8750b943685 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3005,10 +3005,20 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } elseif ($pictowithoutext == 'off') { $fakey = 'fa-square-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-square'; + $fa='far'; + } $fasize = '1.3em'; } elseif ($pictowithoutext == 'on') { $fakey = 'fa-check-square-o'; + if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) + { + $fakey = 'fa-check-square'; + $fa='far'; + } $fasize = '1.3em'; } elseif ($pictowithoutext == 'bank') { @@ -4385,7 +4395,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ { if ($currency_code == 'auto') $currency_code=$conf->currency; - $listofcurrenciesbefore=array('USD','GBP','AUD','MXN','PEN','CNY'); + $listofcurrenciesbefore=array('USD','GBP','AUD','HKD','MXN','PEN','CNY'); $listoflanguagesbefore=array('nl_NL'); if (in_array($currency_code, $listofcurrenciesbefore) || in_array($outlangs->defaultlang, $listoflanguagesbefore)) {