diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 00830445ca6..34535b1d321 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -220,9 +220,8 @@ if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* - * Numbering module - */ -//print "
"; + * Expedition numbering model + */ print_titre($langs->trans("SendingsNumberingModules")); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index fa4b7b3c1d4..49cbeee9026 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -164,7 +164,7 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "LIVRAISON_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); } @@ -209,8 +209,9 @@ $h++; dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* - * Module numerotation + * Livraison numbering model */ + print_titre($langs->trans("DeliveryOrderNumberingModules")); print ''; @@ -240,16 +241,16 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file)-4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/livraison/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - - if ($module->isEnabled()) + + if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print ''."\n"; print '
'.$module->nom."\n"; print $module->info(); @@ -258,13 +259,15 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; + } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; - if ($conf->global->LIVRAISON_ADDON == "$file") + if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"),'switch_on'); } @@ -311,12 +314,12 @@ print '
'; /* - * Modeles de documents + * Documents Models for delivery */ print '
'; print_titre($langs->trans("DeliveryOrderModel")); -// Defini tableau def de modele invoice +// Defini tableau def de modele $type="delivery"; $def = array(); @@ -397,7 +400,7 @@ foreach ($dirmodels as $reldir) print ""; } - // Defaut + // Default print ""; if ($conf->global->LIVRAISON_ADDON_PDF == "$name") { diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 112173656c5..5704f96d0cc 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,7 +102,7 @@ class modExpedition extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON"; + $this->const[$r][0] = "LIVRAISON_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_livraison_jade"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des bons de reception';