From ff214dd295c5105d11c3eebef7527255c5e02600 Mon Sep 17 00:00:00 2001 From: fhenry Date: Thu, 14 Feb 2013 16:25:43 +0100 Subject: [PATCH 1/3] Manage tabs (add/remove by external module) for mass emalings screen --- htdocs/core/lib/emailing.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index e3d1b790f6e..766886af2c0 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -31,6 +31,12 @@ function emailing_prepare_head($object) { global $user, $langs, $conf; + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab + complete_head_from_modules($conf,$langs,$object,$head,$h,'mailling'); + $h = 0; $head = array(); @@ -53,6 +59,8 @@ function emailing_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf,$langs,$object,$head,$h,'mailling','remove'); + return $head; } From c02bd0871159f2fdf4ce1d0dc91de050c6e703a5 Mon Sep 17 00:00:00 2001 From: fhenry Date: Thu, 14 Feb 2013 16:35:54 +0100 Subject: [PATCH 2/3] Checkstyle --- htdocs/core/lib/emailing.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index 766886af2c0..e68a62a2768 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -35,7 +35,7 @@ function emailing_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab - complete_head_from_modules($conf,$langs,$object,$head,$h,'mailling'); + complete_head_from_modules($conf,$langs,$object,$head,$h,'emailing'); $h = 0; $head = array(); @@ -59,7 +59,7 @@ function emailing_prepare_head($object) $head[$h][2] = 'info'; $h++; - complete_head_from_modules($conf,$langs,$object,$head,$h,'mailling','remove'); + complete_head_from_modules($conf,$langs,$object,$head,$h,'emailing','remove'); return $head; } From 37e9b04d8389844ad56e0c57c222f1015a452bb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Feb 2013 12:57:14 +0100 Subject: [PATCH 3/3] Fix: Check id field are mandatory --- htdocs/societe/soc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index c1dd0c4c09d..a83ac0ca517 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -222,19 +222,20 @@ if (empty($reshook)) { $langs->load("errors"); $error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel); - $action = ($action=='add'?'create':'edit'); + $action = (($action=='add'||$action=='create')?'create':'edit'); } } $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; + if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) { $langs->load("errors"); $error++; $errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code)); - $action = ($action=='add'?'create':'edit'); + $action = (($action=='add'||$action=='create')?'create':'edit'); } - } + } } if (! $error) @@ -712,8 +713,7 @@ else print "
\n"; } - - dol_htmloutput_errors($error,$errors); + dol_htmloutput_mesg(is_numeric($error)?'':$error, $errors, 'error'); print '
';