forked from Wavyzz/dolibarr
Qual: Mise en commun dans la methode html->show_documents du code des zones d'affichages des documents PDF gnrs.
(Afin de prparer la gnration des PDF incluant le choix du model la vole).
This commit is contained in:
@@ -29,7 +29,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require("./propal_model_pdf.class.php");
|
|
||||||
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
@@ -197,9 +196,10 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
print '<td>Mod<6F>le</td>';
|
print '<td>Mod<6F>le</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$html = new Form($db);
|
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php');
|
||||||
$modelpdf = new Propal_Model_pdf($db);
|
$model=new ModelePDFPropales();
|
||||||
$html->select_array("modelpdf",$modelpdf->liste_array(),PROPALE_ADDON_PDF);
|
$liste=$model->liste_modeles($this->db);
|
||||||
|
$html->select_array("modelpdf",$liste,PROPALE_ADDON_PDF);
|
||||||
print "</td></tr></table>";
|
print "</td></tr></table>";
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ $langs->load('bills');
|
|||||||
|
|
||||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
|
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
|
||||||
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
|
||||||
require_once('./propal_model_pdf.class.php');
|
|
||||||
require_once('../propal.class.php');
|
require_once('../propal.class.php');
|
||||||
require_once('../actioncomm.class.php');
|
require_once('../actioncomm.class.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
||||||
@@ -883,51 +882,25 @@ if ($_GET['propalid'] > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
||||||
|
*/
|
||||||
/*
|
$filename=sanitize_string($propal->ref);
|
||||||
* Documents
|
$filedir=$conf->propal->dir_output . "/" . sanitize_string($propal->ref);
|
||||||
*/
|
$urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id;
|
||||||
if ($propal->brouillon == 1)
|
$genallowed=$user->rights->propale->creer;
|
||||||
{
|
$delallowed=$user->rights->propale->supprimer;
|
||||||
print '<form action="propal.php?propalid='.$propal->id.'" method="post">';
|
|
||||||
print '<input type="hidden" name="action" value="setpdfmodel">';
|
$var=true;
|
||||||
}
|
|
||||||
print_titre($langs->trans('Documents'));
|
print "<br>\n";
|
||||||
|
$form->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$propal->modelpdf);
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
$propref = sanitize_string($propal->ref);
|
|
||||||
$file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
|
||||||
$relativepath = $propref.'/'.$propref.'.pdf';
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans('Propal').' PDF</td>';
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$propal->ref.'.pdf</a></td>';
|
|
||||||
print '<td align="right">'.filesize($file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.strftime('%d %B %Y %H:%M:%S',filemtime($file)).'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($propal->brouillon == 1 && $user->rights->propale->creer)
|
|
||||||
{
|
|
||||||
print '<tr '.$bc[$var].'><td>Mod<6F>le</td><td align="right">';
|
|
||||||
$html = new Form($db);
|
|
||||||
$modelpdf = new Propal_Model_pdf($db);
|
|
||||||
$html->select_array('modelpdf',$modelpdf->liste_array(),$propal->modelpdf);
|
|
||||||
print '</td><td colspan="2"><input type="submit" value="'.$langs->trans('Save').'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
if ($propal->brouillon == 1)
|
|
||||||
{
|
|
||||||
print '</form>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Source$
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Propal_Model_Pdf {
|
|
||||||
|
|
||||||
var $nom;
|
|
||||||
|
|
||||||
function Propal_Model_Pdf($DB)
|
|
||||||
{
|
|
||||||
$this->db = $DB ;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
function liste_array()
|
|
||||||
{
|
|
||||||
$projets = array();
|
|
||||||
|
|
||||||
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf";
|
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
|
||||||
{
|
|
||||||
$nump = $this->db->num_rows();
|
|
||||||
|
|
||||||
if ($nump)
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $nump)
|
|
||||||
{
|
|
||||||
$obj = $this->db->fetch_object();
|
|
||||||
|
|
||||||
$projets[$obj->nom] = $obj->nom;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $projets;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $this->db->error();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1389,48 +1389,19 @@ else
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
||||||
* Le fichier de facture d<>taill<6C>e est de la forme
|
|
||||||
* REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse
|
|
||||||
*/
|
*/
|
||||||
|
$filename=sanitize_string($fac->ref);
|
||||||
$facref = sanitize_string($fac->ref);
|
$filedir=$conf->facture->dir_output . "/" . sanitize_string($fac->ref);
|
||||||
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
$urlsource=$_SERVER["PHP_SELF"]."?facid=".$fac->id;
|
||||||
$relativepath = "${facref}/${facref}.pdf";
|
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
|
||||||
|
// $delallowed=$user->rights->facture->supprimer;
|
||||||
|
$genallowed=0;
|
||||||
|
$delallowed=0;
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
if (file_exists($file))
|
print "<br>\n";
|
||||||
{
|
$html->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed);
|
||||||
print "<br>\n";
|
|
||||||
print_titre("Documents");
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
print "<tr $bc[$var]><td>".$langs->trans("Bill")." PDF</td>";
|
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepath).'">'.$fac->ref.'.pdf</a></td>';
|
|
||||||
print '<td align="right">'.filesize($file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
|
|
||||||
$dir = $conf->facture->dir_output . "/" . $facref . "/";
|
|
||||||
$handle=opendir($dir);
|
|
||||||
|
|
||||||
while (($file = readdir($handle))!==false)
|
|
||||||
{
|
|
||||||
if (is_readable($dir.$file) && substr($file, -10) == 'detail.pdf')
|
|
||||||
{
|
|
||||||
print "<tr $bc[$var]><td>Facture d<>taill<6C>e</td>";
|
|
||||||
$relativepathdetail = "${facref}/$file";
|
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$file.'</a></td>';
|
|
||||||
print '<td align="right">'.filesize($dir.$file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($dir.$file)).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -453,30 +453,21 @@ if ($_GET["propalid"])
|
|||||||
|
|
||||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Documents
|
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
||||||
*/
|
*/
|
||||||
|
$filename=sanitize_string($propal->ref);
|
||||||
|
$filedir=$conf->propal->dir_output . "/" . sanitize_string($propal->ref);
|
||||||
|
$urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id;
|
||||||
|
$genallowed=0;
|
||||||
|
$delallowed=0;
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
$form->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed);
|
||||||
|
|
||||||
|
|
||||||
print_titre($langs->trans('Documents'));
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
$propref = sanitize_string($propal->ref);
|
|
||||||
$file = $conf->propal->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
|
||||||
$relativepath = $propref.'/'.$propref.'.pdf';
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans('Propal').' PDF</td>';
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$propal->ref.'.pdf</a></td>';
|
|
||||||
print '<td align="right">'.filesize($file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.strftime('%d %B %Y %H:%M:%S',filemtime($file)).'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commandes rattach<63>es
|
* Commandes rattach<63>es
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -104,11 +104,12 @@ if ($_GET["id"] > 0)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected, $soc->nom." / ".$langs->trans("Order")." : $commande->ref");
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Order").": $commande->ref");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la validation
|
* Confirmation de la validation
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'cloture')
|
if ($_GET["action"] == 'cloture')
|
||||||
{
|
{
|
||||||
$html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture");
|
$html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture");
|
||||||
@@ -143,13 +144,14 @@ if ($_GET["id"] > 0)
|
|||||||
print '<tr><td colspan="3">'.nl2br($commande->note)."</td></tr>";
|
print '<tr><td colspan="3">'.nl2br($commande->note)."</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table><br />';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lignes de commandes
|
* Lignes de commandes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
echo '<table class="liste" width="100%">';
|
echo '<br><table class="liste" width="100%">';
|
||||||
|
|
||||||
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";
|
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as l ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as l ";
|
||||||
@@ -233,7 +235,6 @@ if ($_GET["id"] > 0)
|
|||||||
if (! $num)
|
if (! $num)
|
||||||
{
|
{
|
||||||
print $langs->trans("None").'<br>';
|
print $langs->trans("None").'<br>';
|
||||||
print '<br>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -248,7 +249,6 @@ if ($_GET["id"] > 0)
|
|||||||
*/
|
*/
|
||||||
if ($reste_a_livrer_total > 0 && $commande->brouillon == 0)
|
if ($reste_a_livrer_total > 0 && $commande->brouillon == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<form method="post" action="fiche.php">';
|
print '<form method="post" action="fiche.php">';
|
||||||
print '<input type="hidden" name="action" value="create">';
|
print '<input type="hidden" name="action" value="create">';
|
||||||
print '<input type="hidden" name="commande_id" value="'.$commande->id.'">';
|
print '<input type="hidden" name="commande_id" value="'.$commande->id.'">';
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
if (!$user->rights->expedition->lire)
|
if (!$user->rights->expedition->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@@ -444,28 +445,10 @@ else
|
|||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table><br>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "\n</div>\n";
|
print "\n</div>\n";
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$file = $expedition->pdf_filename;
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
|
||||||
print_titre($langs->trans("Documents"));
|
|
||||||
print '<table class="border" width="50%">';
|
|
||||||
print "<tr $bc[$var]><td>".$langs->trans("Sending")." PDF</td>";
|
|
||||||
|
|
||||||
$b = ereg_replace($conf->expedition->dir_output."/","",$file);
|
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=expedition&file='.urlencode($b).'">'.basename($file).'</a></td>';
|
|
||||||
print '<td align="right">'.filesize($file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.dolibarr_print_date(filemtime($file),"%d %B %Y %H:%M:%S").'</td></tr>';
|
|
||||||
print "</table>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -489,10 +472,27 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
||||||
|
*/
|
||||||
|
$filename=sanitize_string($expedition->id);
|
||||||
|
$filedir=$conf->expedition->dir_output . "/" .get_exdir($expedition->id);
|
||||||
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||||
|
//$genallowed=$user->rights->expedition->creer;
|
||||||
|
//$delallowed=$user->rights->expedition->supprimer;
|
||||||
|
$genallowed=0;
|
||||||
|
$delallowed=0;
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
$html->show_documents('expedition',$filename,$filedir,$urlsource,$genallowed,$delallowed,$propal->modelpdf);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* D<>j<EFBFBD> livr<76>
|
* D<>j<EFBFBD> livr<76>
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande";
|
$sql = "SELECT cd.fk_product, cd.description, cd.rowid, cd.qty as qty_commande";
|
||||||
$sql .= " , ed.qty as qty_livre, e.ref";
|
$sql .= " , ed.qty as qty_livre, e.ref";
|
||||||
|
|||||||
@@ -1386,11 +1386,15 @@ class Form
|
|||||||
$liste=array();
|
$liste=array();
|
||||||
if ($modulepart == 'propal')
|
if ($modulepart == 'propal')
|
||||||
{
|
{
|
||||||
$liste=$this->select("ee","select nom as id, nom as lib from ".MAIN_DB_PREFIX."propal_model_pdf");
|
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php');
|
||||||
|
$model=new ModelePDFPropales();
|
||||||
|
$liste=$model->liste_modeles($this->db);
|
||||||
}
|
}
|
||||||
elseif ($modulepart == 'facture')
|
elseif ($modulepart == 'facture')
|
||||||
{
|
{
|
||||||
$liste=$this->select("");
|
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php');
|
||||||
|
$model=new ModelePDFFactures();
|
||||||
|
$liste=$model->liste_modeles($this->db);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -23,7 +23,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file htdocs/includes/modules/commande/modules_commande.php
|
/**
|
||||||
|
\file htdocs/includes/modules/commande/modules_commande.php
|
||||||
\ingroup commande
|
\ingroup commande
|
||||||
\brief Fichier contenant la classe m<>re de generation des commandes en PDF
|
\brief Fichier contenant la classe m<>re de generation des commandes en PDF
|
||||||
et la classe m<>re de num<75>rotation des commandes
|
et la classe m<>re de num<75>rotation des commandes
|
||||||
@@ -32,8 +33,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** \class ModelePDFCommandes
|
/**
|
||||||
\brief Classe m<>re des mod<6F>les de commandes
|
\class ModelePDFCommandes
|
||||||
|
\brief Classe m<>re des mod<6F>les de commandes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ModelePDFCommandes extends FPDF
|
class ModelePDFCommandes extends FPDF
|
||||||
@@ -48,12 +50,40 @@ class ModelePDFCommandes extends FPDF
|
|||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoi la liste des mod<6F>les actifs
|
||||||
|
*/
|
||||||
|
function liste_modeles($db)
|
||||||
|
{
|
||||||
|
$liste=array();
|
||||||
|
$sql ="";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
$liste[$row[0]]=$row[1];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return $liste;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** \class ModeleNumRefCommandes
|
/**
|
||||||
\brief Classe m<>re des mod<EFBFBD>les de num<75>rotation des r<>f<EFBFBD>rences de commandes
|
\class ModeleNumRefCommandes
|
||||||
|
\brief Classe m<>re des mod<6F>les de num<75>rotation des r<>f<EFBFBD>rences de commandes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ModeleNumRefCommandes
|
class ModeleNumRefCommandes
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis ca
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** \class ModelePDFFactures
|
/**
|
||||||
\brief Classe m<>re des mod<EFBFBD>les de facture
|
\class ModelePDFFactures
|
||||||
|
\brief Classe m<>re des mod<6F>les de facture
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ModelePDFFactures extends FPDF
|
class ModelePDFFactures extends FPDF
|
||||||
@@ -45,13 +46,40 @@ class ModelePDFFactures extends FPDF
|
|||||||
var $error='';
|
var $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoi le dernier message d'erreur de cr<63>ation de facture
|
* \brief Renvoi le dernier message d'erreur de cr<63>ation de facture
|
||||||
*/
|
*/
|
||||||
function pdferror()
|
function pdferror()
|
||||||
{
|
{
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoi la liste des mod<6F>les actifs
|
||||||
|
*/
|
||||||
|
function liste_modeles($db)
|
||||||
|
{
|
||||||
|
$liste=array();
|
||||||
|
$sql ="";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
$liste[$row[0]]=$row[1];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return $liste;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,26 +40,55 @@ class ModelePDFFicheinter extends FPDF
|
|||||||
{
|
{
|
||||||
var $error='';
|
var $error='';
|
||||||
|
|
||||||
/** \brief Constructeur
|
/**
|
||||||
|
\brief Constructeur
|
||||||
*/
|
*/
|
||||||
function ModelePDFFicheinter()
|
function ModelePDFFicheinter()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoi le dernier message d'erreur de cr<63>ation de fiche intervention
|
\brief Renvoi le dernier message d'erreur de cr<63>ation de fiche intervention
|
||||||
*/
|
*/
|
||||||
function pdferror()
|
function pdferror()
|
||||||
{
|
{
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoi la liste des mod<6F>les actifs
|
||||||
|
*/
|
||||||
|
function liste_modeles($db)
|
||||||
|
{
|
||||||
|
$liste=array();
|
||||||
|
$sql ="";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
$liste[$row[0]]=$row[1];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return $liste;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** \class ModeleNumRefFicheinter
|
/**
|
||||||
\brief Classe m<>re des mod<6F>les de num<75>rotation des r<>f<EFBFBD>rences de fiches d'intervention
|
\class ModeleNumRefFicheinter
|
||||||
|
\brief Classe m<>re des mod<6F>les de num<75>rotation des r<>f<EFBFBD>rences de fiches d'intervention
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ModeleNumRefFicheinter
|
class ModeleNumRefFicheinter
|
||||||
|
|||||||
@@ -38,21 +38,49 @@
|
|||||||
|
|
||||||
class ModelePDFPropales extends FPDF
|
class ModelePDFPropales extends FPDF
|
||||||
{
|
{
|
||||||
var $error='';
|
var $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoi le dernier message d'erreur de cr<63>ation de propale
|
* \brief Renvoi le dernier message d'erreur de cr<63>ation de propale
|
||||||
*/
|
*/
|
||||||
function pdferror()
|
function pdferror()
|
||||||
{
|
{
|
||||||
return $this->error;
|
return $this->error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoi la liste des mod<6F>les actifs
|
||||||
|
*/
|
||||||
|
function liste_modeles($db)
|
||||||
|
{
|
||||||
|
$liste=array();
|
||||||
|
$sql ="SELECT nom as id, nom as lib";
|
||||||
|
$sql.=" FROM ".MAIN_DB_PREFIX."propal_model_pdf";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
$liste[$row[0]]=$row[1];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return $liste;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**\class ModeleNumRefPropales
|
/**
|
||||||
\brief Classe m<>re des mod<6F>les de num<75>rotation des r<>f<EFBFBD>rences de propales
|
\class ModeleNumRefPropales
|
||||||
|
\brief Classe m<>re des mod<6F>les de num<75>rotation des r<>f<EFBFBD>rences de propales
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ModeleNumRefPropales
|
class ModeleNumRefPropales
|
||||||
|
|||||||
Reference in New Issue
Block a user