diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 6b50768b3b8..753acc8801b 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -28,22 +28,22 @@ */ require("./pre.inc.php"); +include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php'); +if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php")) +{ + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"); +} $langs->load("propal"); $langs->load("projects"); $langs->load("companies"); - $user->getrights('propale'); $user->getrights('fichinter'); $user->getrights('commande'); $user->getrights('projet'); -if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php")) -{ - require(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"); -} llxHeader(); @@ -171,7 +171,6 @@ if ($_GET["action"] == 'create') print 'Modèle'; print ''; - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php'); $model=new ModelePDFPropales(); $liste=$model->liste_modeles($db); $form->select_array("modelpdf",$liste,$conf->global->PROPALE_ADDON_PDF); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 1888ecb52cc..e7e078bd4b5 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -29,6 +29,7 @@ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); $user->getrights('propale'); diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index de871535956..461725c1a91 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -67,6 +66,7 @@ if ($_POST["action"] == 'update') if ($don->update($user) > 0) { Header("Location: fiche.php?rowid=".$don->id); + exit; } } else @@ -80,7 +80,6 @@ if ($_POST["action"] == 'add') if ($_POST["amount"] > 0) { - $don = new Don($db); $don->prenom = $_POST["prenom"]; @@ -102,6 +101,7 @@ if ($_POST["action"] == 'add') if ($don->create($user) > 0) { Header("Location: index.php"); + exit; } } else @@ -116,6 +116,7 @@ if ($_GET["action"] == 'delete') $don = new Don($db); $don->delete($_GET["rowid"]); Header("Location: liste.php"); + exit; } if ($_POST["action"] == 'commentaire') { @@ -129,6 +130,7 @@ if ($_GET["action"] == 'valid_promesse') if ($don->valid_promesse($_GET["rowid"], $user->id)) { Header("Location: liste.php"); + exit; } } if ($_GET["action"] == 'set_payed') @@ -137,6 +139,7 @@ if ($_GET["action"] == 'set_payed') if ($don->set_paye($_GET["rowid"], $modepaiement)) { Header("Location: liste.php"); + exit; } } if ($_GET["action"] == 'set_encaisse') @@ -145,9 +148,19 @@ if ($_GET["action"] == 'set_encaisse') if ($don->set_encaisse($_GET["rowid"])) { Header("Location: liste.php"); + exit; } } +/* + * Générer ou regénérer le document + */ +if ($_GET['action'] == 'build') +{ + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/dons/modules_don.php"); + don_create($db, $_GET['rowid']); +} + llxHeader(); @@ -161,56 +174,58 @@ $html=new Form($db); /* */ /* ************************************************************************** */ -if ($_GET["action"] == 'create') { - - print_titre($langs->trans("AddDonation")); - - print '
'; - print ''; - - print ''; - - print ''; - - print '"; - print "\n"; - - if ($conf->projet->enabled) - { - // Si module projet actif - print "\n"; - } - - print "\n"; - - $langs->load("companies"); - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "
'.$langs->trans("Date").''; - $html->select_date(); - print ''.$langs->trans("Comments").' :
'; - print "
".$langs->trans("PaymentMode")."\n"; - - $paiement = new Paiement($db); - - $paiement->select("modepaiement","CRDT"); - - print "
".$langs->trans("Project").""; - $html->select_projects('','','',"projetid"); - print "
".$langs->trans("PublicDonation").""; - $html=new Form($db); - $html->selectyesno("public",1,1); - print "
'.$langs->trans("Company").'
'.$langs->trans("Firstname").'
'.$langs->trans("Lastname").'
'.$langs->trans("Address").''; - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").'
'.$langs->trans("Country").'
'.$langs->trans("EMail").'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).'
\n"; - print "
\n"; - +if ($_GET["action"] == 'create') +{ + print_titre($langs->trans("AddDonation")); + + print '
'; + print ''; + + print ''; + + print ''; + + $nbrows=11; + if ($conf->projet->enabled) $nbrows++; + + print '"; + print "\n"; + + if ($conf->projet->enabled) + { + // Si module projet actif + print "\n"; + } + + print "\n"; + + $langs->load("companies"); + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "
'.$langs->trans("Date").''; + $html->select_date(); + print ''.$langs->trans("Comments").' :
'; + print "
".$langs->trans("PaymentMode")."\n"; + + $paiement = new Paiement($db); + + $paiement->select("modepaiement","CRDT"); + + print "
".$langs->trans("Project").""; + $html->select_projects('','','',"projetid"); + print "
".$langs->trans("PublicDonation").""; + $html=new Form($db); + $html->selectyesno("public",1,1); + print "
'.$langs->trans("Company").'
'.$langs->trans("Firstname").'
'.$langs->trans("Lastname").'
'.$langs->trans("Address").''; + print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").'
'.$langs->trans("Country").'
'.$langs->trans("EMail").'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).'
\n"; + print "
\n"; } @@ -222,83 +237,88 @@ if ($_GET["action"] == 'create') { if ($_GET["rowid"] && $_GET["action"] == 'edit') { - - $don = new Don($db); - $don->id = $_GET["rowid"]; - $don->fetch($_GET["rowid"]); - - $h=0; - $head[$h][0] = DOL_URL_ROOT."/compta/dons/fiche.php?rowid=".$_GET["rowid"]; - $head[$h][1] = $langs->trans("Donation"); - $hselected=$h; - $h++; - - dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").": ".$_GET["rowid"]); - - print '
'; - print ''; - - print ''; - print ''; - - print "".''; - - print '"; - - if ($conf->projet->enabled) - { - print "".''; + + print "".''; + + print "
'.$langs->trans("Date").''; - $html->select_date($don->date); - print ''.$langs->trans("Comments").' :
'; - print "
".$langs->trans("Project")."'; + + print ''; + print ''; + + print "".''; + + $nbrows=12; + if ($conf->projet->enabled) $nbrows++; + + print '"; + + if ($conf->projet->enabled) + { + print "\n"; - } - - print ""; - print "\n"; + print "
"; + print "\n"; + } + + print ""; + print "\n"; + + $langs->load("companies"); + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + + print "\n"; - $langs->load("companies"); - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - - print "\n"; - - print "".''; - - print "
'.$langs->trans("Date").''; + $html->select_date($don->date); + print ''.$langs->trans("Comments").' :
'; + print "
".$langs->trans("Project")."
"; - print "
".$langs->trans("PublicDonation").""; - $html=new Form($db); - $html->selectyesno("public",1,1); - print "
".$langs->trans("PublicDonation").""; + $html=new Form($db); + $html->selectyesno("public",1,1); + print "
'.$langs->trans("Company").'
'.$langs->trans("Firstname").'
'.$langs->trans("Lastname").'
'.$langs->trans("Address").''; + print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").'
'.$langs->trans("Country").'
'.$langs->trans("EMail").'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).'
".$langs->trans("PaymentMode")."\n"; + $paiement = new Paiement($db); + $paiement->select("modepaiement","CRDT"); + print "
'.$langs->trans("Company").'
'.$langs->trans("Firstname").'
'.$langs->trans("Lastname").'
'.$langs->trans("Address").''; - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").'
'.$langs->trans("Country").'
'.$langs->trans("EMail").'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).'
".$langs->trans("PaymentMode")."\n"; - $paiement = new Paiement($db); - $paiement->select("modepaiement","CRDT"); - print "
\n"; - print "\n"; - - print "\n"; + print "
'.$langs->trans("Status").''.$don->getLibStatut().'
\n"; + print "\n"; + + print "\n"; } @@ -310,56 +330,61 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') /* ************************************************************ */ if ($_GET["rowid"] && $_GET["action"] != 'edit') { + $don = new Don($db); + $don->id = $_GET["rowid"]; + $don->fetch($_GET["rowid"]); + + + $h=0; + $head[$h][0] = DOL_URL_ROOT."/compta/dons/fiche.php?rowid=".$_GET["rowid"]; + $head[$h][1] = $langs->trans("Donation"); + $hselected=$h; + $h++; + + dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").": ".$_GET["rowid"]); + + print "
"; + print ''; + + print ""; + + $nbrows=12; + if ($conf->projet->enabled) $nbrows++; + + print ''; + + if ($conf->projet->enabled) + { + print "".''; + } + + print "\n"; + + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "".''; + print "\n"; - $don = new Don($db); - $don->id = $_GET["rowid"]; - $don->fetch($_GET["rowid"]); + print "".''; + + print "
".$langs->trans("Date").""; + print dolibarr_print_date($don->date,"%d %B %Y"); + print "'.$langs->trans("Comments").' :
'; + print nl2br($don->commentaire).'
'.$langs->trans("Project").''.$don->projet.'
".$langs->trans("PublicDonation").""; + print $yn[$don->public]; + print "
'.$langs->trans("Company").''.$don->societe.'
'.$langs->trans("Firstname").''.$don->prenom.'
'.$langs->trans("Lastname").''.$don->nom.'
'.$langs->trans("Address").''.nl2br($don->adresse).'
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$don->cp.' '.$don->ville.'
'.$langs->trans("Country").''.$don->pays.'
'.$langs->trans("EMail").''.$don->email.'
'.$langs->trans("Amount").''.price($don->amount).' '.$langs->trans("Currency".$conf->monnaie).'
".$langs->trans("PaymentMode").""; + print $don->modepaiement; + print "
'.$langs->trans("Status").''.$don->getLibStatut().'
\n"; + print "
\n"; + + print ""; - $h=0; - $head[$h][0] = DOL_URL_ROOT."/compta/dons/fiche.php?rowid=".$_GET["rowid"]; - $head[$h][1] = $langs->trans("Donation"); - $hselected=$h; - $h++; - - dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").": ".$_GET["rowid"]); - - print "
"; - print ''; - - print ""; - - print ''; - - if ($conf->projet->enabled) { - print "".''; - } - - print "\n"; - - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "".''; - print "\n"; - - print "
".$langs->trans("Date").""; - print dolibarr_print_date($don->date,"%d %B %Y"); - print "'.$langs->trans("Comments").' :
'; - print nl2br($don->commentaire).'
'.$langs->trans("Project").''.$don->projet.'
".$langs->trans("PublicDonation").""; - print $yn[$don->public]; - print "
'.$langs->trans("Company").''.$don->societe.'
'.$langs->trans("Firstname").''.$don->prenom.'
'.$langs->trans("Lastname").''.$don->nom.'
'.$langs->trans("Address").''.nl2br($don->adresse).'
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$don->cp.' '.$don->ville.'
'.$langs->trans("Country").''.$don->pays.'
'.$langs->trans("EMail").''.$don->email.'
'.$langs->trans("Amount").''.price($don->amount).' '.$langs->trans("Currency".$conf->monnaie).'
".$langs->trans("PaymentMode").""; - print $don->modepaiement; - print "
\n"; - print "
\n"; - - print ""; - - /** * Barre d'actions */ @@ -369,7 +394,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit') if ($don->statut == 0) { - print ''.$langs->trans("Valid").''; + print ''.$langs->trans("ValidPromess").''; } // \todo Gérer action émettre paiement @@ -385,7 +410,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit') if ($don->statut == 2 || $don->statut == 3) { - print "id\">".$langs->trans("Form").""; + print ' '.$langs->trans('BuildDoc').''; } if ($don->statut == 0) @@ -401,5 +426,6 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit') $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); + ?> diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d77cf72eca5..385efe00df2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -30,15 +30,7 @@ */ require('./pre.inc.php'); - -$user->getrights('facture'); -$user->getrights('banque'); - -if (!$user->rights->facture->lire) -accessforbidden(); - -$langs->load('bills'); - +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php'); @@ -47,6 +39,13 @@ if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT.'/propal.class.php' if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT.'/contrat/contrat.class.php'); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php'); +$user->getrights('facture'); +$user->getrights('banque'); + +if (!$user->rights->facture->lire) + accessforbidden(); + +$langs->load('bills'); $sall=isset($_GET['sall'])?$_GET['sall']:$_POST['sall']; if (isset($_GET['msg'])) { $msg=urldecode($_GET['msg']); } @@ -404,10 +403,7 @@ if ($_POST['action'] == 'confirm_canceled' && $_POST['confirm'] == 'yes') { $fac = new Facture($db); $fac->fetch($_GET['facid']); - $result = $fac->set_canceled(); - $_GET['facid'] = 0 ; - Header('Location: facture.php'); - exit; + $result = $fac->set_canceled($user); } } @@ -552,8 +548,6 @@ if ($_POST['action'] == 'send' || $_POST['action'] == 'relance') */ if ($_GET['action'] == 'pdf') { - // Generation de la facture définie dans /includes/modules/facture/modules_facture.php - // Génère également le fichier meta dans le meme répertoire (pour faciliter les recherches et indexation) facture_pdf_create($db, $_GET['facid']); } diff --git a/htdocs/don.class.php b/htdocs/don.class.php index 4d09af3d4d6..106db08b060 100644 --- a/htdocs/don.class.php +++ b/htdocs/don.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2002 Rodolphe Quiedeville + * Copyright (C) 2004-2005 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$ - * */ /** @@ -36,60 +35,67 @@ class Don { - var $id; - var $db; - var $date; - var $amount; - var $prenom; - var $nom; - var $societe; - var $adresse; - var $cp; - var $ville; - var $pays; - var $email; - var $public; - var $projetid; - var $modepaiement; - var $modepaiementid; - var $commentaire; - var $statut; - - var $projet; - var $errorstr; - - /* - * Statut du don - * 0 : promesse non validée - * 1 : promesse validée - * 2 : don validé - * 3 : don payé - * - */ - - /* - * \brief Constructeur - * \param DB handler d'accès base - * \param soc_idp id société - */ - function Don($DB, $soc_idp="") + var $id; + var $db; + var $date; + var $amount; + var $prenom; + var $nom; + var $societe; + var $adresse; + var $cp; + var $ville; + var $pays; + var $email; + var $public; + var $projetid; + var $modepaiement; + var $modepaiementid; + var $commentaire; + var $statut; + + var $projet; + var $errorstr; + + /** + * \brief Constructeur + * \param DB handler d'accès base + * \param soc_idp id sociét + */ + function Don($DB, $soc_idp="") { - $this->db = $DB ; - $this->modepaiementid = 0; + global $langs; + + $this->db = $DB ; + $this->modepaiementid = 0; + + $langs->load("donations"); + $this->labelstatut[0]=$langs->trans("DonationStatusPromessNotValidated"); + $this->labelstatut[1]=$langs->trans("DonationStatusPromessValidated"); + $this->labelstatut[2]=$langs->trans("DonationStatusValidated"); + $this->labelstatut[3]=$langs->trans("DonationStatusPayed"); } - - /* - * - */ - function print_error_list() - { + /** + * \brief Retourne le libellé du statut d'une propale (brouillon, validée, ...) + * \return string Libellé + */ + function getLibStatut() + { + return $this->labelstatut[$this->statut]; + } + + /* + * + */ + function print_error_list() + { $num = sizeof($this->errorstr); for ($i = 0 ; $i < $num ; $i++) { print "
  • " . $this->errorstr[$i]; } - } + } /* * @@ -277,53 +283,57 @@ class Don } } - /* - * \brief Charge l'objet don en mémoire depuis la base de donnée - * \param rowid id du don à charger - * - */ - function fetch($rowid) - { - $sql = "SELECT d.rowid, ".$this->db->pdate("d.datec")." as datec,"; - $sql.= " ".$this->db->pdate("d.datedon")." as datedon,"; - $sql.= " d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet"; - $sql.= " FROM ".MAIN_DB_PREFIX."don as d, ".MAIN_DB_PREFIX."c_paiement as cp LEFT JOIN ".MAIN_DB_PREFIX."don_projet as p"; - $sql.= " ON p.rowid = d.fk_don_projet WHERE cp.id = d.fk_paiement AND d.rowid = $rowid"; - - if ( $this->db->query( $sql) ) - { - if ($this->db->num_rows()) - { - - $obj = $this->db->fetch_object(); - - $this->id = $obj->rowid; - $this->datec = $obj->datec; - $this->date = $obj->datedon; - $this->prenom = stripslashes($obj->prenom); - $this->nom = stripslashes($obj->nom); - $this->societe = stripslashes($obj->societe); - $this->statut = $obj->fk_statut; - $this->adresse = stripslashes($obj->adresse); - $this->cp = stripslashes($obj->cp); - $this->ville = stripslashes($obj->ville); - $this->email = stripslashes($obj->email); - $this->pays = stripslashes($obj->pays); - $this->projet = $obj->projet; - $this->projetid = $obj->fk_don_projet; - $this->public = $obj->public; - $this->modepaiementid = $obj->fk_paiement; - $this->modepaiement = $obj->libelle; - $this->amount = $obj->amount; - $this->commentaire = stripslashes($obj->note); - } - } - else - { - dolibarr_print_error($this->db); - } + /* + * \brief Charge l'objet don en mémoire depuis la base de donnée + * \param rowid Id du don à charger + * \return int <0 si ko, >0 si ok + */ + function fetch($rowid) + { + $sql = "SELECT d.rowid, ".$this->db->pdate("d.datec")." as datec,"; + $sql.= " ".$this->db->pdate("d.datedon")." as datedon,"; + $sql.= " d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."don as d"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."don_projet as p"; + $sql.= " ON p.rowid = d.fk_don_projet"; + $sql.= " WHERE cp.id = d.fk_paiement AND d.rowid = ".$rowid; - } + if ( $this->db->query( $sql) ) + { + if ($this->db->num_rows()) + { + + $obj = $this->db->fetch_object(); + + $this->id = $obj->rowid; + $this->datec = $obj->datec; + $this->date = $obj->datedon; + $this->prenom = stripslashes($obj->prenom); + $this->nom = stripslashes($obj->nom); + $this->societe = stripslashes($obj->societe); + $this->statut = $obj->fk_statut; + $this->adresse = stripslashes($obj->adresse); + $this->cp = stripslashes($obj->cp); + $this->ville = stripslashes($obj->ville); + $this->email = stripslashes($obj->email); + $this->pays = stripslashes($obj->pays); + $this->projet = $obj->projet; + $this->projetid = $obj->fk_don_projet; + $this->public = $obj->public; + $this->modepaiementid = $obj->fk_paiement; + $this->modepaiement = $obj->libelle; + $this->amount = $obj->amount; + $this->commentaire = stripslashes($obj->note); + } + return 1; + } + else + { + dolibarr_print_error($this->db); + return -1; + } + + } /* * \brief Valide une promesse de don diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index a131bb845d6..d45d26a7704 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -767,7 +767,7 @@ class Facture dolibarr_syslog("Facture.class.php::set_canceled rowid=".$this->id); $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; $sql.= ' SET fk_statut=3 WHERE rowid = '.$this->id; - $resql = $this->db->query( $sql); + $resql = $this->db->query($sql); if ($resql) { @@ -1376,7 +1376,7 @@ class Facture } else { - dolibarr_print_error($db,"modules_facture::getNextNumRef ".$obj->error); + dolibarr_print_error($db,"Facture::getNextNumRef ".$obj->error); return ""; } } diff --git a/htdocs/includes/modules/commande/modules_commande.php b/htdocs/includes/modules/commande/modules_commande.php index 79b5c170cac..5c622fac5ff 100644 --- a/htdocs/includes/modules/commande/modules_commande.php +++ b/htdocs/includes/modules/commande/modules_commande.php @@ -111,7 +111,24 @@ class ModeleNumRefCommandes return $langs->trans("NoExample"); } + /** \brief Test si les numéros déjà en vigueur dans la base ne provoquent pas de + * de conflits qui empechera cette numérotation de fonctionner. + * \return boolean false si conflit, true si ok + */ + function canBeActivated() + { + return true; + } + + /** \brief Renvoi prochaine valeur attribuée + * \return string Valeur + */ + function getNextValue() + { + global $langs; + return $langs->trans("NotAvailable"); + } + } - ?> diff --git a/htdocs/includes/modules/facture/pdf_bernique.modules.php b/htdocs/includes/modules/facture/pdf_bernique.modules.php index 48ef80974ff..7d436815eb8 100644 --- a/htdocs/includes/modules/facture/pdf_bernique.modules.php +++ b/htdocs/includes/modules/facture/pdf_bernique.modules.php @@ -29,6 +29,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); + /** \class pdf_bernique diff --git a/htdocs/includes/modules/facture/pdf_bigorneau.modules.php b/htdocs/includes/modules/facture/pdf_bigorneau.modules.php index 62286fc2e6e..4909f51b616 100644 --- a/htdocs/includes/modules/facture/pdf_bigorneau.modules.php +++ b/htdocs/includes/modules/facture/pdf_bigorneau.modules.php @@ -28,6 +28,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); + /** \class pdf_bigorneau \brief Classe permettant de générer les factures au modèle Bigorneau diff --git a/htdocs/includes/modules/facture/pdf_bulot.modules.php b/htdocs/includes/modules/facture/pdf_bulot.modules.php index f765f19aeac..9e3ec799793 100644 --- a/htdocs/includes/modules/facture/pdf_bulot.modules.php +++ b/htdocs/includes/modules/facture/pdf_bulot.modules.php @@ -28,6 +28,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); + /** \class pdf_bulot \brief Classe permettant de générer les factures au modèle Bulot diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 5a626eac5f2..6675a18bfdd 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -28,6 +28,7 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/includes/modules/facture/pdf_huitre.modules.php b/htdocs/includes/modules/facture/pdf_huitre.modules.php index ebe1495d237..a4f8b98280f 100644 --- a/htdocs/includes/modules/facture/pdf_huitre.modules.php +++ b/htdocs/includes/modules/facture/pdf_huitre.modules.php @@ -29,6 +29,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); + /** \class pdf_huitre diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index af6d6570841..c09285d8a73 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -30,6 +30,7 @@ */ require_once(DOL_DOCUMENT_ROOT."/product.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); /** diff --git a/htdocs/includes/modules/facture/pdf_tourteau.modules.php b/htdocs/includes/modules/facture/pdf_tourteau.modules.php index 5d22fadcea8..4a3cc4b99ff 100644 --- a/htdocs/includes/modules/facture/pdf_tourteau.modules.php +++ b/htdocs/includes/modules/facture/pdf_tourteau.modules.php @@ -28,6 +28,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); + /** \class pdf_tourteau \brief Classe permettant de générer les factures au modèle Tourteau diff --git a/htdocs/includes/modules/fichinter/modules_fichinter.php b/htdocs/includes/modules/fichinter/modules_fichinter.php index 17d7be6b879..9a4f64c003e 100644 --- a/htdocs/includes/modules/fichinter/modules_fichinter.php +++ b/htdocs/includes/modules/fichinter/modules_fichinter.php @@ -116,6 +116,24 @@ class ModeleNumRefFicheinter return $langs->trans("NoExample"); } + /** \brief Test si les numéros déjà en vigueur dans la base ne provoquent pas de + * de conflits qui empechera cette numérotation de fonctionner. + * \return boolean false si conflit, true si ok + */ + function canBeActivated() + { + return true; + } + + /** \brief Renvoi prochaine valeur attribuée + * \return string Valeur + */ + function getNextValue() + { + global $langs; + return $langs->trans("NotAvailable"); + } + } diff --git a/htdocs/includes/modules/propale/modules_propale.php b/htdocs/includes/modules/propale/modules_propale.php index 50d33df11e2..aa88f0e38c1 100644 --- a/htdocs/includes/modules/propale/modules_propale.php +++ b/htdocs/includes/modules/propale/modules_propale.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2005 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 @@ -19,7 +19,6 @@ * * $Id$ * $Source$ - * */ /** @@ -119,6 +118,15 @@ class ModeleNumRefPropales return true; } + /** \brief Renvoi prochaine valeur attribuée + * \return string Valeur + */ + function getNextValue() + { + global $langs; + return $langs->trans("NotAvailable"); + } + } diff --git a/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php b/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php index fe7aff042d6..7c678e09633 100644 --- a/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php @@ -27,6 +27,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); + /** \class pdf_propale_adytek \brief Classe permettant de générer les propales au modèle Adytek diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 1acd9364b3d..35b90edb3b8 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -28,6 +28,7 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); diff --git a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php index 9c1f8364f12..d41962b36c9 100644 --- a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php @@ -27,6 +27,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); + /** \class pdf_propale_bleu \brief Classe permettant de générer les propales au modèle Bleu diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index c881bed57d0..fee44624b8a 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -27,6 +27,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); + /** \class pdf_propale_jaune \brief Classe permettant de générer les propales au modèle Jaune diff --git a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php index 1f6280f923f..c61096a69ab 100644 --- a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php @@ -28,6 +28,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); + /** \class pdf_propale_rouge diff --git a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php index e5dc9a026e5..cd7aba6cf59 100644 --- a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php @@ -28,6 +28,8 @@ \version $Revision$ */ +require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); + /** \class pdf_propale_vert \brief Classe permettant de générer les propales au modèle Vert diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 84cb7fb26c3..2dd8efe083f 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -32,8 +32,6 @@ Send=Send SendRemind=Send reminder DoPaiement=Do payment DoPayment=Do payment -BuildPDF=Build PDF -RebuildPDF=Rebuild PDF VAT=VAT VATRate=VAT Rate Amount=Amount diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 530192ebff8..8dc782921fb 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -285,6 +285,10 @@ Internals=Internal Externals=External Warning=Warning Warnings=Warnings +BuildPDF=Build PDF +RebuildPDF=Rebuild PDF +BuildDoc=Build Doc +RebuildDoc=Rebuild Doc # Countries CountryFR=France CountryBE=Belgium diff --git a/htdocs/langs/fr_BE/bills.lang b/htdocs/langs/fr_BE/bills.lang index 621f9d32f23..0fdcf4536c6 100644 --- a/htdocs/langs/fr_BE/bills.lang +++ b/htdocs/langs/fr_BE/bills.lang @@ -7,8 +7,6 @@ CreateBill=Cr Send=Envoyer SendRemind=Envoyer un rappel DoPaiement=Emettre un paiement -BuildPDF=Générer le PDF -RebuildPDF=Regénérer le PDF VAT=TVA VATRate=Taux TVA Amount=Montant diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 0e8951bef47..dbce650f459 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -32,8 +32,6 @@ Send=Envoyer SendRemind=Envoyer rappel DoPaiement=Émettre paiement DoPayment=Émettre paiement -BuildPDF=Générer le PDF -RebuildPDF=Regénérer le PDF VAT=TVA VATRate=Taux TVA Amount=Montant diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 49a1ad91266..672ab546454 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -285,6 +285,10 @@ Internals=Internes Externals=Externes Warning=Alerte Warnings=Alertes +BuildPDF=Générer le PDF +RebuildPDF=Regénérer le PDF +BuildDoc=Générer le doc +RebuildDoc=Regénérer le doc # Countries CountryFR=France CountryBE=Belgique diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 7a3e8b6ce0e..62dece4c98a 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -287,12 +287,18 @@ $conf->webcal->db->pass=defined('PHPWEBCALENDAR_PASS')?PHPWEBCALENDAR_PASS:''; $conf->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:''; $conf->facture->enabled=defined("MAIN_MODULE_FACTURE")?MAIN_MODULE_FACTURE:0; -if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); +// \todo Ajouter la ligne +// require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); +// dans le fichier facturation-emission.php du module telephonie afin de pouvoir +// supprimer celles qui suivent. +if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) +{ + require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); +} $conf->facture->dir_output=DOL_DATA_ROOT."/facture"; $conf->facture->dir_images=DOL_DATA_ROOT."/facture/images"; if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $conf->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par d?faut $conf->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0; -if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); if (!defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4); $conf->propal->dir_output=DOL_DATA_ROOT."/propale"; $conf->propal->dir_images=DOL_DATA_ROOT."/propale/images";