From a26f88084326c5b4f0d7674848a66370678bd5f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Mar 2016 00:59:42 +0100 Subject: [PATCH] Fix missing declarion of form Fix by adding MAIN_USE_OLD_SEARCH_FORM to restore a way for backward compatibility Fix to have delay for payment term at least 1 day (to avoid immediate warning after creation of an invoice) --- htdocs/don/list.php | 1 + htdocs/expedition/list.php | 1 + htdocs/fourn/commande/list.php | 1 + htdocs/index.php | 2 ++ htdocs/install/mysql/data/llx_c_payment_term.sql | 8 ++++---- htdocs/main.inc.php | 6 +++--- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 83e1db184a557..3db04cdb7cca9 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -79,6 +79,7 @@ * View */ +$form=new Form($db); if (! empty($conf->projet->enabled)) $projectstatic=new Project($db); llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones'); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index ccd10d7c550ce..36dfb1db55e42 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -76,6 +76,7 @@ * View */ +$form=new Form($db); $companystatic=new Societe($db); $shipment=new Expedition($db); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index a3e0d8c9c3351..9f99df55adde3 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -93,6 +93,7 @@ * View */ +$form=new Form($db); $thirdpartytmp = new Fournisseur($db); $commandestatic=new CommandeFournisseur($db); $formfile = new FormFile($db); diff --git a/htdocs/index.php b/htdocs/index.php index 6058e5a70c839..0b6bbbbc4a91b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -65,6 +65,8 @@ * View */ +if (! is_object($form)) $form=new Form($db); + // Title $title=$langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION; if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE; diff --git a/htdocs/install/mysql/data/llx_c_payment_term.sql b/htdocs/install/mysql/data/llx_c_payment_term.sql index 1e61b31a2b83e..68aae57ff4fbf 100644 --- a/htdocs/install/mysql/data/llx_c_payment_term.sql +++ b/htdocs/install/mysql/data/llx_c_payment_term.sql @@ -27,11 +27,11 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (1,'RECEP', 1,1, 'A réception de facture','Réception de facture',0,0); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (1,'RECEP', 1,1, 'A réception de facture','Réception de facture',0,1); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (2,'30D', 2,1, '30 jours','Réglement à 30 jours',0,30); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (3,'30DENDMONTH', 3,1, '30 jours fin de mois','Réglement à 30 jours fin de mois',1,30); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (4,'60D', 4,1, '60 jours','Réglement à 60 jours',0,60); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (5,'60DENDMONTH', 5,1, '60 jours fin de mois','Réglement à 60 jours fin de mois',1,60); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (6,'PT_ORDER', 6,1, 'A réception de commande','A réception de commande',0,0); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (7,'PT_DELIVERY', 7,1, 'Livraison','Règlement à la livraison',0,0); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (8,'PT_5050', 8,1, '50 et 50','Règlement 50% à la commande, 50% à la livraison',0,0); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (6,'PT_ORDER', 6,1, 'A réception de commande','A réception de commande',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (7,'PT_DELIVERY', 7,1, 'Livraison','Règlement à la livraison',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (8,'PT_5050', 8,1, '50 et 50','Règlement 50% à la commande, 50% à la livraison',0,1); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1127b6dc5cfae..07a6ae7dc8cc7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1445,7 +1445,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Show menu entries print '
'."\n"; $menumanager->atarget=$target; - $menumanager->showmenu('top'); // This contains a \n + $menumanager->showmenu('top', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // This contains a \n print "
\n"; //$form=new Form($db); @@ -1609,7 +1609,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra print "\n"; - if ($conf->use_javascript_ajax && $conf->browser->layout != 'phone') + if ($conf->use_javascript_ajax && $conf->browser->layout != 'phone' && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) { if (! is_object($form)) $form=new Form($db); $selected=-1; @@ -1655,7 +1655,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user')); } } - + // Execute hook printSearchForm $parameters=array('searchform'=>$searchform); $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks