diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 00830445ca63d81dbba6e314bfeebc798fb6068a..34535b1d321e792ae5ec10c1548a847c105b9808 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> - * Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com> + * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * * 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 "<br>"; + * Expedition numbering model + */ print_titre($langs->trans("SendingsNumberingModules")); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index fa4b7b3c1d40edc0408846ed9f4941e7e8dc98f8..49cbeee902633144c365b5da7c44def23446b527 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> - * Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com> + * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * * 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 '<table class="noborder" width="100%">'; @@ -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 '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n"; print $module->info(); @@ -258,13 +259,15 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print '<td nowrap="nowrap">'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; + } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '</td>'."\n"; print '<td align="center">'; - 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 '</table>'; /* - * Modeles de documents + * Documents Models for delivery */ print '<br>'; 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 "</td>"; } - // Defaut + // Default print "<td align=\"center\">"; if ($conf->global->LIVRAISON_ADDON_PDF == "$name") { diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 112173656c54da5646563c27648658daea9021c8..5704f96d0cc5c1ee9120cafa814dbb983c8d1010 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 <eldy@users.sourceforge.net> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * * 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';