Qual: Uniformize all document generation into function write_file

Doxygen
This commit is contained in:
Laurent Destailleur
2010-11-11 01:09:41 +00:00
parent e50c375a8f
commit d018d4be8b
13 changed files with 39 additions and 31 deletions

View File

@@ -54,7 +54,7 @@ $result = restrictedArea($user, 'agenda', $socid, '', 'myactions');
if ($_GET["action"] == 'builddoc') if ($_GET["action"] == 'builddoc')
{ {
$cat = new CommActionRapport($db, $_GET["month"], $_GET["year"]); $cat = new CommActionRapport($db, $_GET["month"], $_GET["year"]);
$result=$cat->generate($_GET["id"]); $result=$cat->write_file(GETPOST("id"));
if ($result < 0) if ($result < 0)
{ {
$mesg=$cat->error; $mesg=$cat->error;

View File

@@ -70,7 +70,14 @@ class CommActionRapport
$this->subject=$langs->trans("ActionsReport").' '.$this->year."-".$this->month; $this->subject=$langs->trans("ActionsReport").' '.$this->year."-".$this->month;
} }
function generate($socid = 0, $catid = 0, $outputlangs='') /**
* Write the object to document file to disk
* @param socid
* @param catid
* @param outputlangs Lang object for output language
* @return int 1=OK, 0=KO
*/
function write_file($socid = 0, $catid = 0, $outputlangs='')
{ {
global $user,$conf,$langs; global $user,$conf,$langs;

View File

@@ -77,11 +77,11 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
} }
/** /**
* \brief Fonction generant le rapport sur le disque * Fonction generant le rapport sur le disque
* \param _dir Directory * @param _dir Directory
* \param number Number * @param number Number
* \param outputlangs Lang output object * @param outputlangs Lang output object
* \return int 1=ok, 0=ko * @return int 1=ok, 0=ko
*/ */
function write_file($_dir, $number, $outputlangs) function write_file($_dir, $number, $outputlangs)
{ {

View File

@@ -61,10 +61,11 @@ class html_cerfafr extends ModeleDon
/** /**
\brief Fonction generant le recu sur le disque * Write the object to document file to disk
\param id Id du recu a generer * @param don Donation object
\return int >0 si ok, <0 si ko * @param outputlangs Lang object for output language
*/ * @return int >0 if OK, <0 if KO
*/
function write_file($don,$outputlangs) function write_file($don,$outputlangs)
{ {
global $user,$conf,$langs,$mysoc; global $user,$conf,$langs,$mysoc;

View File

@@ -68,7 +68,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
/** /**
* \brief Fonction generant le document sur le disque * \brief Fonction generant le document sur le disque
* \param obj Objet expedition a generer (ou id si ancienne methode) * \param object Objet expedition a generer (ou id si ancienne methode)
* \param outputlangs Lang output object * \param outputlangs Lang output object
* \return int 1=ok, 0=ko * \return int 1=ok, 0=ko
*/ */

View File

@@ -210,7 +210,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
/** /**
* \brief Fonction generant le document sur le disque * \brief Fonction generant le document sur le disque
* \param obj Objet expedition a generer (ou id si ancienne methode) * \param object Objet expedition a generer (ou id si ancienne methode)
* \param outputlangs Lang output object * \param outputlangs Lang output object
* \return int 1=ok, 0=ko * \return int 1=ok, 0=ko
*/ */

View File

@@ -103,7 +103,7 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Write the invoice to disk * Write the object to document file to disk
* @param object Object invoice to build (or id if old method) * @param object Object invoice to build (or id if old method)
* @param outputlangs Lang object for output language * @param outputlangs Lang object for output language
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO

View File

@@ -74,10 +74,10 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
/** /**
* \brief Fonction generant le bon de livraison sur le disque * Fonction generant le bon de livraison sur le disque
* \param delivery Object livraison a generer * @param object Object livraison a generer
* \param outputlangs Lang output object * @param outputlangs Lang output object
* \return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs)
{ {

View File

@@ -95,10 +95,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/** /**
* \brief Fonction generant le bon de livraison sur le disque * Fonction generant le bon de livraison sur le disque
* \param delivery Object livraison a generer * @param object Object livraison a generer
* \param outputlangs Lang output object * @param outputlangs Lang output object
* \return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs)
{ {

View File

@@ -85,7 +85,7 @@ class pdf_baleine extends ModelePDFProjects
/** /**
* \brief Fonction generant le projet sur le disque * \brief Fonction generant le projet sur le disque
* \param delivery Object project a generer * \param object Object project a generer
* \param outputlangs Lang output object * \param outputlangs Lang output object
* \return int 1 if OK, <=0 if KO * \return int 1 if OK, <=0 if KO
*/ */

View File

@@ -77,7 +77,7 @@ class pdf_propale_jaune extends ModelePDFPropales
/** /**
* \brief Fonction generant la propale sur le disque * \brief Fonction generant la propale sur le disque
* \param propale Objet propal * \param object Objet propal
* \param outputlangs Lang object for output language * \param outputlangs Lang object for output language
* \return int 1=ok, 0=ko * \return int 1=ok, 0=ko
*/ */

View File

@@ -92,7 +92,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
/** /**
* Write the invoice to disk * Write the invoice as a document onto disk
* @param object Object invoice to build (or id if old method) * @param object Object invoice to build (or id if old method)
* @param outputlangs Lang object for output language * @param outputlangs Lang object for output language
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO

View File

@@ -91,12 +91,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
} }
/** /**
* \brief Fonction generant la commande sur le disque * Write the order as a document onto disk
* \param id Id de la commande a generer * @param object Object invoice to build (or id if old method)
* \param outputlangs Lang output object * @param outputlangs Lang object for output language
* \return int 1=ok, 0=ko * @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs='') function write_file($object,$outputlangs='')
{ {
global $user,$langs,$conf; global $user,$langs,$conf;