diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php index b4d77a12e05..eca64731d95 100644 --- a/htdocs/admin/dons.php +++ b/htdocs/admin/dons.php @@ -35,16 +35,13 @@ if (!$user->admin) accessforbidden(); -$dons_addon_var = DON_ADDON; - $typeconst=array('yesno','texte','chaine'); if ($_GET["action"] == 'setmodelbon') { - if (dolibarr_set_const($db, "DON_ADDON",$_GET["value"])) - $don_addon_var = $_GET["value"]; + dolibarr_set_const($db, "DON_ADDON_MODEL",$_GET["value"])) } @@ -91,7 +88,7 @@ while (($file = readdir($handle))!==false) echo "$file"; print ' '; - if ($dons_addon_var == "$name") + if ($conf->global->DON_ADDON_MODEL == $name) { print img_tick(); print ''; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index e3b3b7f008e..bb87fdb5a0d 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * * 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 @@ -160,10 +160,10 @@ if ($_GET["action"] == 'set_encaisse') /* * Générer ou regénérer le document */ -if ($_GET['action'] == 'build') +if ($_GET['action'] == 'builddoc') { require_once(DOL_DOCUMENT_ROOT ."/includes/modules/dons/modules_don.php"); - don_create($db, $_GET['rowid']); + $result=don_create($db, $_GET['rowid']); } @@ -313,7 +313,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') $form->select_types_paiements('', 'modepaiement', 'CRDT', 0); print "\n"; - print "".''.$langs->trans("Status").''.$don->getLibStatut().''; + print "".''.$langs->trans("Status").''.$don->getLibStatut(4).''; print "".''; @@ -379,7 +379,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit') print $don->modepaiement; print "\n"; - print "".''.$langs->trans("Status").''.$don->getLibStatut().''; + print "".''.$langs->trans("Status").''.$don->getLibStatut(4).''; print "\n"; print "\n"; @@ -412,7 +412,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit') if ($don->statut == 2 || $don->statut == 3) { - print ' '.$langs->trans('BuildDonationReceipt').''; + print ' '.$langs->trans('BuildDonationReceipt').''; } if ($don->statut == 0) diff --git a/htdocs/compta/dons/pre.inc.php b/htdocs/compta/dons/pre.inc.php index 98f047e7c8f..1161d7e085d 100644 --- a/htdocs/compta/dons/pre.inc.php +++ b/htdocs/compta/dons/pre.inc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * * 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 @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -42,26 +41,26 @@ $libelle[3] = $langs->trans("DonationsReceived"); function llxHeader($head = "") { - global $user, $conf, $langs; - - $langs->load("donations"); - - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/compta/dons/",$langs->trans("Donations")); - $menu->add_submenu(DOL_URL_ROOT."/compta/dons/fiche.php?action=create",$langs->trans("NewDonation")); - $menu->add_submenu(DOL_URL_ROOT."/compta/dons/liste.php",$langs->trans("List")); - $menu->add_submenu(DOL_URL_ROOT."/compta/dons/stats.php",$langs->trans("Statistics")); - - if ($conf->banque->enabled) { - $langs->load("banks"); - $menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("Bank")); - } - - left_menu($menu->liste); - + global $user, $conf, $langs; + + $langs->load("donations"); + + top_menu($head); + + $menu = new Menu(); + + $menu->add(DOL_URL_ROOT."/compta/dons/",$langs->trans("Donations")); + $menu->add_submenu(DOL_URL_ROOT."/compta/dons/fiche.php?action=create",$langs->trans("NewDonation")); + $menu->add_submenu(DOL_URL_ROOT."/compta/dons/liste.php",$langs->trans("List")); + $menu->add_submenu(DOL_URL_ROOT."/compta/dons/stats.php",$langs->trans("Statistics")); + + if ($conf->banque->enabled) + { + $langs->load("banks"); + $menu->add(DOL_URL_ROOT."/compta/bank/index.php",$langs->trans("Bank")); + } + + left_menu($menu->liste); } ?> diff --git a/htdocs/includes/modules/dons/html_cerfafr.modules.php b/htdocs/includes/modules/dons/html_cerfafr.modules.php index ce42e35dc28..50f00d78b80 100644 --- a/htdocs/includes/modules/dons/html_cerfafr.modules.php +++ b/htdocs/includes/modules/dons/html_cerfafr.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2005-2006 Laurent Destailleur * * 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 @@ -21,29 +21,26 @@ */ /** - \file htdocs/includes/dons/html_cerfafr.php + \file htdocs/includes/dons/html_cerfafr.modules.php \ingroup don \brief Formulaire de don \version $Revision$ */ - -require_once(DOL_DOCUMENT_ROOT."/master.inc.php"); require_once(DOL_DOCUMENT_ROOT."/projetdon.class.php"); require_once(DOL_DOCUMENT_ROOT."/don.class.php"); - /** \class html_cerfafr \brief Classe permettant de générer les propales au modèle Azur */ - class html_cerfafr extends ModeleDon { /** \brief Constructeur \param db Handler accès base de donnée */ + function html_cerfafr($db) { global $conf,$langs; @@ -60,7 +57,7 @@ class html_cerfafr extends ModeleDon */ function pdferror() { - return $this->error; + return $this->error; } @@ -118,6 +115,8 @@ class html_cerfafr extends ModeleDon return 1; } + } + ?> diff --git a/htdocs/includes/modules/dons/modules_don.php b/htdocs/includes/modules/dons/modules_don.php index 44208d3a550..6f64f4f013b 100644 --- a/htdocs/includes/modules/dons/modules_don.php +++ b/htdocs/includes/modules/dons/modules_don.php @@ -148,22 +148,19 @@ function don_create($db, $id, $message='', $modele='', $outputlangs='') { global $conf, $langs; $langs->load("bills"); - - // todo forcé ici - $conf->global->DON_ADDON='html_cerfafr'; - + $dir = DOL_DOCUMENT_ROOT . "/includes/modules/dons/"; // Positionne modele sur le nom du modele à utiliser if (! strlen($modele)) { - if ($conf->global->DON_ADDON_PDF) + if ($conf->global->DON_ADDON_MODEL) { - $modele = $conf->global->DON_ADDON_PDF; + $modele = $conf->global->DON_ADDON_MODEL; } else { - print $langs->trans("Error")." ".$langs->trans("Error_DON_ADDON_PDF_NotDefined"); + print $langs->trans("Error")." ".$langs->trans("Error_DON_ADDON_MODEL_NotDefined"); return 0; } } @@ -173,6 +170,7 @@ function don_create($db, $id, $message='', $modele='', $outputlangs='') if (file_exists($dir.$file)) { $classname = $modele; + require_once($dir.$file); $obj = new $classname($db); diff --git a/htdocs/includes/modules/societe/modules_societe.class.php b/htdocs/includes/modules/societe/modules_societe.class.php index e8534ed6bca..171a24b603e 100644 --- a/htdocs/includes/modules/societe/modules_societe.class.php +++ b/htdocs/includes/modules/societe/modules_societe.class.php @@ -32,7 +32,7 @@ /** - \class ModeleDon + \class ModeleThirdPartyCode \brief Classe mère des modèles de numérotation des codes tiers */ diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 0f5870e7c8b..a3b3ea98c6e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -279,7 +279,7 @@ if (! $user->societe_id) // Si utilisateur interne { $conf->top_menu=$conf->global->MAIN_MENU_BARRETOP; $conf->left_menu=$conf->global->MAIN_MENU_BARRELEFT; - // Pour compatibilite if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_backoffice.php'; + // Pour compatibilite if ($conf->left_menu == 'eldy.php') $conf->left_menu='eldy_backoffice.php'; } else // Si utilisateur externe diff --git a/mysql/data/data.sql b/mysql/data/data.sql index 55d102ea146..ff3c6229a5b 100644 --- a/mysql/data/data.sql +++ b/mysql/data/data.sql @@ -161,7 +161,7 @@ insert into llx_const (name, value, type) values ('OSC_CATALOG_URL','http://osc. -- -- Modeles de numerotation et generation document -- -insert into llx_const (name, value, type, visible) values ('DON_ADDON', 'html_cerfafr','chaine',0); +insert into llx_const (name, value, type, visible) values ('DON_ADDON_MODEL', 'html_cerfafr','chaine',0); insert into llx_const (name, value, type, visible) values ('PROPALE_ADDON', 'mod_propale_marbre','chaine',0); insert into llx_const (name, value, type, visible) values ('PROPALE_ADDON_PDF', 'azur','chaine',0); insert into llx_const (name, value, type, visible) values ('COMMANDE_ADDON', 'mod_commande_ivoire','chaine',0); diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 0093e8625e9..746f63da445 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -204,6 +204,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (29 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (292, 29, '0','0','VAT Rate 0',1); +update llx_const set name='DON_ADDON_MODEL' where name='DON_ADDON'; update llx_const set value='neptune' where value='pluton' and name = 'FACTURE_ADDON'; update llx_const set value='azur' where value='orange' and name = 'PROPALE_ADDON'; update llx_const set value='mod_commande_diamant' where value='mod_commande_jade' and name ='COMMANDE_ADDON';