Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
42ee2f529c
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
@ -107,7 +107,7 @@ if ($action == 'specimen')
|
||||
$inter->initAsSpecimen();
|
||||
|
||||
// Charge le modele
|
||||
$dir = "/core/modules/fichinter/";
|
||||
$dir = "/core/modules/fichinter/doc/";
|
||||
$file = "pdf_".$modele.".modules.php";
|
||||
$file = dol_buildpath($dir.$file);
|
||||
if (file_exists($file))
|
||||
@ -363,7 +363,7 @@ clearstatcache();
|
||||
$var=true;
|
||||
foreach ($conf->file->dol_document_root as $dirroot)
|
||||
{
|
||||
$dir = $dirroot . "/core/modules/fichinter/";
|
||||
$dir = $dirroot . "/core/modules/fichinter/doc/";
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
|
||||
@ -45,17 +45,21 @@ top_httphead();
|
||||
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
|
||||
|
||||
// Registering the location of boxes
|
||||
if((isset($_GET['action']) && ! empty($_GET['action'])) && (isset($_GET['name']) && ! empty($_GET['name'])) )
|
||||
if ((isset($_GET['action']) && ! empty($_GET['action'])) && (isset($_GET['name']) && ! empty($_GET['name'])) )
|
||||
{
|
||||
$entity = (GETPOST('entity','int') ? GETPOST('entity','int') : $conf->entity);
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$name = GETPOST('name', 'alpha');
|
||||
|
||||
if ($user->admin)
|
||||
{
|
||||
if ($_GET['action'] == 'set')
|
||||
if ($action == 'set')
|
||||
{
|
||||
dolibarr_set_const($db, GETPOST('name','alpha'), 1, 'chaine', 0, '', GETPOST('entity','int'));
|
||||
dolibarr_set_const($db, $name, 1, 'chaine', 0, '', $entity);
|
||||
}
|
||||
else if ($_GET['action'] == 'del')
|
||||
else if ($action == 'del')
|
||||
{
|
||||
dolibarr_del_const($db, GETPOST('name','alpha'), GETPOST('entity','int'));
|
||||
dolibarr_del_const($db, $name, $entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -35,11 +35,6 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/genericobject.class.php");
|
||||
* View
|
||||
*/
|
||||
|
||||
// Ajout directives pour resoudre bug IE
|
||||
//header('Cache-Control: Public, must-revalidate');
|
||||
//header('Pragma: public');
|
||||
|
||||
//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
|
||||
top_httphead();
|
||||
|
||||
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
|
||||
@ -52,21 +47,16 @@ if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['tabl
|
||||
|
||||
foreach($roworder as $value)
|
||||
{
|
||||
if (!empty($value))
|
||||
{
|
||||
$newroworder[] = $value;
|
||||
}
|
||||
if (! empty($value)) $newroworder[] = $value;
|
||||
}
|
||||
|
||||
$roworder = implode(',',$newroworder);
|
||||
|
||||
dol_syslog("AjaxRow roworder=".$_GET['roworder']." neworder=".$roworder." element=".$_GET['element'], LOG_DEBUG);
|
||||
dol_syslog("AjaxRow roworder=".$_GET['roworder']." fk_element=".$_GET['fk_element'], LOG_DEBUG);
|
||||
|
||||
$row=new GenericObject($db);
|
||||
$row->table_element_line = $_GET['table_element_line'];
|
||||
$row->fk_element = $_GET['fk_element'];
|
||||
$row->id = $_GET['element_id'];
|
||||
$result=$row->line_ajaxorder($roworder);
|
||||
$result=$row->line_ajaxorder($newroworder);
|
||||
$result=$row->line_order(true);
|
||||
}
|
||||
|
||||
|
||||
@ -890,25 +890,75 @@ abstract class CommonObject
|
||||
}
|
||||
if ($nl > 0)
|
||||
{
|
||||
$rows=array();
|
||||
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$sql.= ' AND fk_parent_line IS NULL';
|
||||
$sql.= ' ORDER BY rang ASC, rowid '.$rowidorder;
|
||||
|
||||
dol_syslog(get_class($this)."::line_order sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i=0;
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$this->updateRangOfLine($row[0], ($i+1));
|
||||
$rows[] = $row[0];
|
||||
$childrens = $this->getChildrensOfLine($row[0]);
|
||||
if (! empty($childrens))
|
||||
{
|
||||
foreach($childrens as $child)
|
||||
{
|
||||
array_push($rows, $child);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (! empty($rows))
|
||||
{
|
||||
foreach($rows as $key => $row)
|
||||
{
|
||||
$this->updateRangOfLine($row, ($key+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get childrens of line
|
||||
*
|
||||
* @param int $id Id of parent line
|
||||
*/
|
||||
function getChildrensOfLine($id)
|
||||
{
|
||||
$rows=array();
|
||||
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$sql.= ' AND fk_parent_line = '.$id;
|
||||
$sql.= ' ORDER BY rang ASC';
|
||||
|
||||
dol_syslog(get_class($this)."::getChildrenOfLines sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i=0;
|
||||
$num = $this->db->num_rows($resql);
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$rows[$i] = $row[0];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a line to have a lower rank
|
||||
@ -966,13 +1016,11 @@ abstract class CommonObject
|
||||
/**
|
||||
* Update position of line with ajax (rang)
|
||||
*
|
||||
* @param int $roworder
|
||||
* @param array $rows Array of rows
|
||||
*/
|
||||
function line_ajaxorder($roworder)
|
||||
function line_ajaxorder($rows)
|
||||
{
|
||||
$rows = explode(',',$roworder);
|
||||
$num = count($rows);
|
||||
|
||||
for ($i = 0 ; $i < $num ; $i++)
|
||||
{
|
||||
$this->updateRangOfLine($rows[$i], ($i+1));
|
||||
|
||||
@ -232,12 +232,12 @@ class CommActionRapport
|
||||
}
|
||||
|
||||
/**
|
||||
* Show page head
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Translate $outputlangs Object langs
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $pagenb Page nb
|
||||
* @return int Pos y
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $outputlangs, $pagenb)
|
||||
{
|
||||
|
||||
@ -333,11 +333,12 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf Object PDF
|
||||
* \param object Object cheque receipt
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -88,7 +88,7 @@ class pdf_edison extends ModelePDFCommandes
|
||||
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
*
|
||||
* @param int $object Id of object to generate
|
||||
* @param object $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
@ -182,7 +182,7 @@ class pdf_edison extends ModelePDFCommandes
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$pdf->SetXY(10, $tab_top + 10 );
|
||||
$pdf->SetXY(10, $tab_top + 10);
|
||||
|
||||
$iniY = $pdf->GetY();
|
||||
$curY = $pdf->GetY();
|
||||
@ -307,12 +307,13 @@ class pdf_edison extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Affiche infos divers
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet commande
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -441,13 +442,14 @@ class pdf_edison extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
* Show table for lines
|
||||
*
|
||||
* @param $pdf
|
||||
* @param $tab_top
|
||||
* @param $tab_height
|
||||
* @param $nexY
|
||||
* @param $outputlangs
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -494,14 +496,15 @@ class pdf_edison extends ModelePDFCommandes
|
||||
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet commande
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
$langs->load("orders");
|
||||
@ -624,12 +627,12 @@ class pdf_edison extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page
|
||||
* Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param pdf PDF factory
|
||||
* @param object Object invoice
|
||||
* @param outputlangs Object lang for output
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -119,7 +119,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
*
|
||||
* @param int $object Id of object to generate
|
||||
* @param object $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
@ -433,13 +433,13 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
|
||||
/**
|
||||
* Affiche infos divers
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object order
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -567,14 +567,14 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
|
||||
/**
|
||||
* Affiche le total a payer
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet commande
|
||||
* @param deja_regle Montant deja regle
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
* Show total to pay
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@ -763,8 +763,14 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Affiche la grille des lignes de commandes
|
||||
* \param pdf objet PDF
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -822,14 +828,15 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param $pdf Object PDF
|
||||
* @param $object Object order
|
||||
* @param $showaddress 0=no, 1=yes
|
||||
* @param $outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -981,12 +988,12 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page
|
||||
* Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param pdf PDF factory
|
||||
* @param object Object invoice
|
||||
* @param outputlangs Object lang for output
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -270,9 +270,16 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
|
||||
}
|
||||
|
||||
//********************************
|
||||
// Generation du tableau
|
||||
//********************************
|
||||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
@ -300,11 +307,12 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page
|
||||
*
|
||||
* @param pdf PDF factory
|
||||
* @param object Object invoice
|
||||
* @param outputlangs Object lang for output
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf, $object, $outputlangs)
|
||||
{
|
||||
@ -327,14 +335,15 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object invoice
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlang Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
@ -39,8 +39,9 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param db Database handler
|
||||
* Constructor
|
||||
*
|
||||
* @param db Database handler
|
||||
*/
|
||||
function pdf_expedition_rouget($db=0)
|
||||
{
|
||||
@ -260,8 +261,14 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
}
|
||||
|
||||
/**
|
||||
* Build table
|
||||
* @param pdf objet PDF
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -292,14 +299,15 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of document
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object commercial proposal
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -526,11 +534,12 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -559,13 +559,13 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
|
||||
/**
|
||||
* Show other information
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $posy Position start
|
||||
* @param Translate $outputlangs Object langs
|
||||
* @return int Position pour suite
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -689,7 +689,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $posy;
|
||||
}
|
||||
|
||||
@ -918,9 +918,14 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the lines of invoice
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF $pdf object PDF
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -979,14 +984,15 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object invoice
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -1231,12 +1237,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -442,12 +442,13 @@ class pdf_oursin extends ModelePDFFactures
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Affiche infos divers
|
||||
* \param pdf Objet PDF
|
||||
* \param object Objet facture
|
||||
* \param posy Position depart
|
||||
* \param outputlangs Objet langs
|
||||
* \return y Position pour suite
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -578,14 +579,14 @@ class pdf_oursin extends ModelePDFFactures
|
||||
|
||||
|
||||
/**
|
||||
* Affiche le total a payer
|
||||
* Show total to pay
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet facture
|
||||
* @param deja_regle Montant deja regle
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@ -726,9 +727,15 @@ class pdf_oursin extends ModelePDFFactures
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
|
||||
/*
|
||||
* Affiche la grille des lignes de factures
|
||||
* @param pdf objet PDF
|
||||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $object, $outputlangs)
|
||||
{
|
||||
@ -777,13 +784,16 @@ class pdf_oursin extends ModelePDFFactures
|
||||
return $pdf->GetY();
|
||||
}
|
||||
|
||||
/*
|
||||
* Affiche en-tete facture
|
||||
/**
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param pdf objet PDF
|
||||
* @param fac objet facture
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=0, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs,$conf;
|
||||
$langs->load("main");
|
||||
@ -1028,11 +1038,12 @@ class pdf_oursin extends ModelePDFFactures
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlang Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf, $object, $outputlangs)
|
||||
{
|
||||
|
||||
579
htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
Normal file
579
htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
Normal file
@ -0,0 +1,579 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011 Fabrice CHERRIER
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
|
||||
* \ingroup ficheinter
|
||||
* \brief Fichier de la classe permettant de generer les fiches d'intervention au modele Soleil
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/fichinter/modules_fichinter.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
* \class pdf_soleil
|
||||
* \brief Class to build interventions documents with model Soleil
|
||||
*/
|
||||
class pdf_soleil extends ModelePDFFicheinter
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function pdf_soleil($db)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = 'soleil';
|
||||
$this->description = $langs->trans("DocumentModelStandard");
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Affiche mode reglement
|
||||
$this->option_condreg = 0; // Affiche conditions reglement
|
||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
||||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // By default, if not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
* @param object $object Object to generate
|
||||
* @param object $outputlangs Lang output object
|
||||
* @return int 1=ok, 0=ko
|
||||
*/
|
||||
function write_file($object,$outputlangs)
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("interventions");
|
||||
|
||||
if ($conf->ficheinter->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir = $conf->ficheinter->dir_output;
|
||||
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
|
||||
$file = $dir . "/" . $objectref . ".pdf";
|
||||
|
||||
if (! file_exists($dir))
|
||||
{
|
||||
if (create_exdir($dir) < 0)
|
||||
{
|
||||
$this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
$pdf->setPrintHeader(false);
|
||||
$pdf->setPrintFooter(false);
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
|
||||
$pdf->Open();
|
||||
$pagenb=0;
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
||||
$pdf->SetSubject($outputlangs->transnoentities("InterventionCard"));
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("InterventionCard"));
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
|
||||
$tab_top = 100;
|
||||
$tab_top_middlepage = 50;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_height = 110;
|
||||
$tab_height_newpage = 150;
|
||||
$tab_height_middlepage = 200;
|
||||
$tab_height_endpage = 170;
|
||||
|
||||
// Affiche notes
|
||||
if (! empty($object->note_public))
|
||||
{
|
||||
$tab_top = 88;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top);
|
||||
$pdf->MultiCell(190, 3, $outputlangs->convToOutputCharset($object->note_public), 0, 'L');
|
||||
$nexY = $pdf->GetY();
|
||||
$height_note=$nexY-$tab_top;
|
||||
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||
|
||||
$tab_height = $tab_height - $height_note;
|
||||
$tab_top = $nexY+6;
|
||||
}
|
||||
else
|
||||
{
|
||||
$height_note=0;
|
||||
}
|
||||
|
||||
$iniY = $tab_top + 7;
|
||||
$curY = $tab_top + 7;
|
||||
$nexY = $tab_top + 7;
|
||||
/*
|
||||
$pdf->SetXY($this->marge_gauche, $tab_top);
|
||||
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
|
||||
$pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8 );
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetXY($this->marge_gauche, $tab_top + 8 );
|
||||
$text=$object->description;
|
||||
if ($object->duree > 0)
|
||||
{
|
||||
$totaltime=ConvertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
||||
}
|
||||
$desc=dol_htmlentitiesbr($text,1);
|
||||
//print $outputlangs->convToOutputCharset($desc); exit;
|
||||
|
||||
$pdf->writeHTMLCell(180, 3, 10, $tab_top + 8, $outputlangs->convToOutputCharset($desc), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY);
|
||||
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
|
||||
*/
|
||||
$nblines = count($object->lines);
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0; $i < $nblines; $i++)
|
||||
{
|
||||
$objectligne = $object->lines[$i];
|
||||
|
||||
$valide = $objectligne->id ? $objectligne->fetch($objectligne->id) : 0;
|
||||
if ($valide > 0 || $object->specimen)
|
||||
{
|
||||
$curY = $nexY;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $curY);
|
||||
$txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".ConvertSecondToTime($objectligne->duration),1,$outputlangs->charset_output);
|
||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $curY + 3);
|
||||
$desc = dol_htmlentitiesbr($objectligne->desc,1);
|
||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY + 3, $desc, 0, 1, 0);
|
||||
//$nexY+=dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)*3;
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Cherche nombre de lignes a venir pour savoir si place suffisante
|
||||
if ($i < ($nblines - 1) && empty($hidedesc)) // If it's not last line
|
||||
{
|
||||
//on recupere la description du produit suivant
|
||||
$follow_descproduitservice = $objectligne->desc;
|
||||
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
|
||||
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*3);
|
||||
}
|
||||
else // If it's last line
|
||||
{
|
||||
$nblineFollowDesc = 0;
|
||||
}
|
||||
|
||||
// Test if a new page is required
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top;
|
||||
$tab_height_in_current_page=$tab_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tab_top_in_current_page=$tab_top_newpage;
|
||||
$tab_height_in_current_page=$tab_height_middlepage;
|
||||
}
|
||||
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage, $tab_height_middlepage, $nexY, $outputlangs);
|
||||
}
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$nexY = $tab_top_newpage + 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
//$pdf->line(10, $tab_top+$tab_height+3, 200, $tab_top+$tab_height+3);
|
||||
|
||||
// Rectangle for title and all lines
|
||||
/*
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, ($this->page_largeur-$this->marge_gauche-$this->marge_droite), $tab_height+3);
|
||||
$pdf->SetXY($this->marge_gauche, $pdf->GetY() + 20);
|
||||
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
|
||||
|
||||
$pdf->SetXY(20,220);
|
||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(20,225);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
|
||||
$pdf->SetXY(110,220);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(110,225);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
*/
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$pdf->Close();
|
||||
|
||||
$pdf->Output($file,'F');
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorConstantNotDefined","FICHEINTER_OUTPUTDIR");
|
||||
return 0;
|
||||
}
|
||||
$this->error=$langs->trans("ErrorUnknown");
|
||||
return 0; // Erreur par defaut
|
||||
}
|
||||
|
||||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $tab_top);
|
||||
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
|
||||
$pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetXY($this->marge_gauche, $tab_top + 8);
|
||||
$text=$object->description;
|
||||
if ($object->duree > 0)
|
||||
{
|
||||
$totaltime=ConvertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
||||
}
|
||||
$desc=dol_htmlentitiesbr($text,1);
|
||||
//print $outputlangs->convToOutputCharset($desc); exit;
|
||||
|
||||
$pdf->writeHTMLCell(180, 3, 10, $tab_top + 8, $outputlangs->convToOutputCharset($desc), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY);
|
||||
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
|
||||
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, ($this->page_largeur-$this->marge_gauche-$this->marge_droite), $tab_height+3);
|
||||
$pdf->SetXY($this->marge_gauche, $pdf->GetY() + 20);
|
||||
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
|
||||
|
||||
$pdf->SetXY(20,220);
|
||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(20,225);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
|
||||
$pdf->SetXY(110,220);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(110,225);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("interventions");
|
||||
|
||||
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
||||
|
||||
//Affiche le filigrane brouillon - Print Draft Watermark
|
||||
if($object->statut==0 && (! empty($conf->global->FICHINTER_DRAFT_WATERMARK)) )
|
||||
{
|
||||
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FICHINTER_DRAFT_WATERMARK);
|
||||
}
|
||||
|
||||
//Prepare la suite
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
|
||||
// Logo
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, 24);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('','B',$default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$text=$this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
}
|
||||
|
||||
$pdf->SetFont('','B',$default_font_size + 3);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$title=$outputlangs->transnoentities("InterventionCard");
|
||||
$pdf->MultiCell(100, 4, $title, '', 'R');
|
||||
|
||||
$pdf->SetFont('','B',$default_font_size + 2);
|
||||
|
||||
$posy+=5;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||
|
||||
$posy+=1;
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->datec,"day",false,$outputlangs,true), '', 'R');
|
||||
|
||||
if ($object->client->code_client)
|
||||
{
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
|
||||
}
|
||||
|
||||
if ($showaddress)
|
||||
{
|
||||
// Sender properties
|
||||
$carac_emetteur='';
|
||||
// Add internal contact of proposal if defined
|
||||
$arrayidcontact=$object->getIdContact('internal','INTERREPFOLL');
|
||||
if (count($arrayidcontact) > 0)
|
||||
{
|
||||
$object->fetch_user($arrayidcontact[0]);
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
|
||||
}
|
||||
|
||||
$carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur);
|
||||
|
||||
// Show sender
|
||||
$posy=42;
|
||||
$posx=$this->marge_gauche;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
||||
$hautcadre=40;
|
||||
|
||||
// Show sender frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFillColor(230,230,230);
|
||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||
|
||||
// Show sender name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B',$default_font_size);
|
||||
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
||||
|
||||
// Show sender information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+8);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
|
||||
|
||||
// If CUSTOMER contact defined, we use it
|
||||
$usecontact=false;
|
||||
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
|
||||
if (count($arrayidcontact) > 0)
|
||||
{
|
||||
$usecontact=true;
|
||||
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||
}
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->rect($posx, $posy, 100, $hautcadre);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(100,4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+8);
|
||||
$pdf->MultiCell(100,4, $carac_client, 0, 'L');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -145,7 +145,7 @@ function fichinter_create($db, $object, $modele='', $outputlangs='')
|
||||
global $conf,$langs;
|
||||
$langs->load("ficheinter");
|
||||
|
||||
$dir = "/core/modules/fichinter/";
|
||||
$dir = "/core/modules/fichinter/doc/";
|
||||
|
||||
// Positionne modele sur le nom du modele de facture a utiliser
|
||||
if (! dol_strlen($modele))
|
||||
|
||||
@ -1,387 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011 Fabrice CHERRIER (12/05/2011) http://www.fcinc.fr
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/fichinter/pdf_soleil.modules.php
|
||||
* \ingroup ficheinter
|
||||
* \brief Fichier de la classe permettant de generer les fiches d'intervention au modele Soleil
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/fichinter/modules_fichinter.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php');
|
||||
|
||||
|
||||
/**
|
||||
* \class pdf_soleil
|
||||
* \brief Class to build interventions documents with model Soleil
|
||||
*/
|
||||
class pdf_soleil extends ModelePDFFicheinter
|
||||
{
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param db Handler acces base de donnee
|
||||
*/
|
||||
function pdf_soleil($db=0)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = 'soleil';
|
||||
$this->description = $langs->trans("DocumentModelStandard");
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$formatarray=pdf_getFormat();
|
||||
$this->page_largeur = $formatarray['width'];
|
||||
$this->page_hauteur = $formatarray['height'];
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=10;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Affiche mode reglement
|
||||
$this->option_condreg = 0; // Affiche conditions reglement
|
||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||
$this->option_multilang = 0; // Dispo en plusieurs langues
|
||||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // By default, if not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Fonction generant la fiche d'intervention sur le disque
|
||||
* \param fichinter Object fichinter
|
||||
* \param outputlangs Lang output object
|
||||
* \return int 1=ok, 0=ko
|
||||
*/
|
||||
function write_file($fichinter,$outputlangs)
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("interventions");
|
||||
|
||||
if ($conf->ficheinter->dir_output)
|
||||
{
|
||||
// If $fichinter is id instead of object
|
||||
if (! is_object($fichinter))
|
||||
{
|
||||
$id = $fichinter;
|
||||
$fichinter = new Fichinter($this->db);
|
||||
$result=$fichinter->fetch($id);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($this->db,$fichinter->error);
|
||||
}
|
||||
}
|
||||
|
||||
$fichinter->fetch_thirdparty();
|
||||
|
||||
$fichref = dol_sanitizeFileName($fichinter->ref);
|
||||
$dir = $conf->ficheinter->dir_output;
|
||||
if (! preg_match('/specimen/i',$fichref)) $dir.= "/" . $fichref;
|
||||
$file = $dir . "/" . $fichref . ".pdf";
|
||||
|
||||
if (! file_exists($dir))
|
||||
{
|
||||
if (create_exdir($dir) < 0)
|
||||
{
|
||||
$this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
{
|
||||
$pdf->setPrintHeader(false);
|
||||
$pdf->setPrintFooter(false);
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
|
||||
$pdf->Open();
|
||||
$pagenb=0;
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
|
||||
// Pagehead
|
||||
|
||||
//Affiche le filigrane brouillon - Print Draft Watermark
|
||||
if($fichinter->statut==0 && (! empty($conf->global->FICHINTER_DRAFT_WATERMARK)) )
|
||||
{
|
||||
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FICHINTER_DRAFT_WATERMARK);
|
||||
}
|
||||
|
||||
$posy=$this->marge_haute;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
|
||||
// Logo
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
|
||||
if ($mysoc->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, 24);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||
}
|
||||
}
|
||||
|
||||
// Nom emetteur
|
||||
$posy=40;
|
||||
$hautcadre=40;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
$pdf->SetFillColor(230,230,230);
|
||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||
|
||||
|
||||
$pdf->SetXY($this->marge_gauche+2,$posy+3);
|
||||
|
||||
// Sender name
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
||||
|
||||
// Sender properties
|
||||
$carac_emetteur = pdf_build_address($outputlangs,$this->emetteur);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($this->marge_gauche+2,$posy+9);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
|
||||
$object=$fichinter;
|
||||
|
||||
// Recipient name
|
||||
if (! empty($usecontact))
|
||||
{
|
||||
// On peut utiliser le nom de la societe du contact
|
||||
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
|
||||
else $socname = $object->client->nom;
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||
}
|
||||
else
|
||||
{
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
|
||||
// Client destinataire
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$fichinter->fetch_thirdparty();
|
||||
$pdf->SetXY(102,42);
|
||||
$pdf->MultiCell(86,4, $carac_client_name, 0, 'L');
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY(102,$pdf->GetY());
|
||||
$pdf->MultiCell(66,4, $carac_client, 0, 'L');
|
||||
$pdf->rect(100, 40, 100, 40);
|
||||
|
||||
|
||||
$pdf->SetTextColor(0,0,100);
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
$pdf->SetXY(10,86);
|
||||
$pdf->MultiCell(120, 4, $outputlangs->transnoentities("InterventionCard")." : ".$outputlangs->convToOutputCharset($fichinter->ref), 0, 'L');
|
||||
|
||||
$pdf->SetFillColor(220,220,220);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
|
||||
|
||||
$tab_top = 100;
|
||||
$tab_top_newpage = 50;
|
||||
$tab_height = 110;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
// Affiche notes
|
||||
if (! empty($fichinter->note_public))
|
||||
{
|
||||
$tab_top = 98;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->SetXY($this->posxdesc-1, $tab_top);
|
||||
$pdf->MultiCell(190, 3, $outputlangs->convToOutputCharset($fichinter->note_public), 0, 'L');
|
||||
$nexY = $pdf->GetY();
|
||||
$height_note=$nexY-$tab_top;
|
||||
|
||||
// Rect prend une longueur en 3eme param
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||
|
||||
$tab_height = $tab_height - $height_note;
|
||||
$tab_top = $nexY+6;
|
||||
}
|
||||
else
|
||||
{
|
||||
$height_note=0;
|
||||
}
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $tab_top);
|
||||
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
|
||||
$pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8 );
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetXY($this->marge_gauche, $tab_top + 8 );
|
||||
$text=$fichinter->description;
|
||||
if ($fichinter->duree > 0)
|
||||
{
|
||||
$totaltime=ConvertSecondToTime($fichinter->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
||||
}
|
||||
$desc=dol_htmlentitiesbr($text,1);
|
||||
//print $outputlangs->convToOutputCharset($desc); exit;
|
||||
|
||||
$pdf->writeHTMLCell(180, 3, 10, $tab_top + 8, $outputlangs->convToOutputCharset($desc), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY);
|
||||
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
|
||||
|
||||
//dol_syslog("desc=".dol_htmlentitiesbr($fichinter->description));
|
||||
$nblignes = count($fichinter->lines);
|
||||
|
||||
$curY = $pdf->GetY();
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
$fichinterligne = $fichinter->lines[$i];
|
||||
|
||||
$valide = $fichinterligne->id ? $fichinterligne->fetch($fichinterligne->id) : 0;
|
||||
if ($valide>0 || $fichinter->specimen)
|
||||
{
|
||||
$curY = $nexY+3;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $curY);
|
||||
$txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($fichinterligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".ConvertSecondToTime($fichinterligne->duration),1,$outputlangs->charset_output);
|
||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $curY + 3);
|
||||
$desc = dol_htmlentitiesbr($fichinterligne->desc,1);
|
||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY + 3, $desc, 0, 1, 0);
|
||||
$nexY+=dol_nboflines_bis($fichinterligne->desc,52,$outputlangs->charset_output)*3;
|
||||
}
|
||||
}
|
||||
//$pdf->line(10, $tab_top+$tab_height+3, 200, $tab_top+$tab_height+3);
|
||||
|
||||
// Rectangle for title and all lines
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, ($this->page_largeur-$this->marge_gauche-$this->marge_droite), $tab_height+3);
|
||||
$pdf->SetXY($this->marge_gauche, $pdf->GetY() + 20);
|
||||
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
|
||||
|
||||
$pdf->SetXY(20,220);
|
||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(20,225);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
|
||||
$pdf->SetXY(110,220);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
|
||||
|
||||
$pdf->SetXY(110,225);
|
||||
$pdf->MultiCell(80,30, '', 1);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
$this->_pagefoot($pdf,$fichinter,$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$pdf->Close();
|
||||
|
||||
$pdf->Output($file,'F');
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorConstantNotDefined","FICHEINTER_OUTPUTDIR");
|
||||
return 0;
|
||||
}
|
||||
$this->error=$langs->trans("ErrorUnknown");
|
||||
return 0; // Erreur par defaut
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -294,8 +294,14 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Affiche la grille des lignes
|
||||
* \param pdf objet PDF
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -313,14 +319,15 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param $pdf Object PDF
|
||||
* @param $object Object delivery
|
||||
* @param $showaddress 0=no, 1=yes
|
||||
* @param $outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -444,11 +451,12 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -345,7 +345,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
// TODO doit etre modifie
|
||||
//$waitingDelivery = $object->getRemainingDelivered();
|
||||
$waitingDelivery='';
|
||||
|
||||
|
||||
if (is_array($waitingDelivery) & !empty($waitingDelivery))
|
||||
{
|
||||
$pdf->AddPage('P', 'A4');
|
||||
@ -385,7 +385,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
|
||||
$pdf-> SetY(40);
|
||||
|
||||
|
||||
$num = count($header);
|
||||
for($i = 0; $i < $num; $i++)
|
||||
{
|
||||
@ -422,9 +422,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche la grille des lignes
|
||||
* \param pdf objet PDF
|
||||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -468,14 +474,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param $pdf Object PDF
|
||||
* @param $object Object order
|
||||
* @param $showaddress 0=no, 1=yes
|
||||
* @param $outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -649,12 +656,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page
|
||||
* Need this->emetteur object
|
||||
*
|
||||
* @param pdf PDF factory
|
||||
* @param object Object invoice
|
||||
* @param outputlangs Object lang for output
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -289,9 +289,15 @@ class pdf_baleine extends ModelePDFProjects
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Affiche la grille des lignes
|
||||
* \param pdf objet PDF
|
||||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -315,14 +321,15 @@ class pdf_baleine extends ModelePDFProjects
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param $pdf Object PDF
|
||||
* @param $object Object project
|
||||
* @param $showaddress 0=no, 1=yes
|
||||
* @param $outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
@ -399,12 +406,12 @@ class pdf_baleine extends ModelePDFProjects
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page
|
||||
* Need this->emetteur object
|
||||
*
|
||||
* @param pdf PDF factory
|
||||
* @param object Object invoice
|
||||
* @param outputlangs Object lang for output
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -427,13 +427,13 @@ class pdf_azur extends ModelePDFPropales
|
||||
|
||||
|
||||
/**
|
||||
* Affiche infos divers
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet facture
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -581,12 +581,12 @@ class pdf_azur extends ModelePDFPropales
|
||||
/**
|
||||
* Show total to pay
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet propale
|
||||
* @param deja_regle Montant deja regle
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@ -792,9 +792,14 @@ class pdf_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche la grille des lignes de propales
|
||||
* Show table for lines
|
||||
*
|
||||
* @param pdf objet PDF
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -852,14 +857,15 @@ class pdf_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of document
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object commercial proposal
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -1041,11 +1047,12 @@ class pdf_azur extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -427,13 +427,13 @@ class pdf_jaune extends ModelePDFPropales
|
||||
|
||||
|
||||
/**
|
||||
* Affiche infos divers
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet facture
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -581,12 +581,12 @@ class pdf_jaune extends ModelePDFPropales
|
||||
/**
|
||||
* Show total to pay
|
||||
*
|
||||
* @param pdf Objet PDF
|
||||
* @param object Objet propale
|
||||
* @param deja_regle Montant deja regle
|
||||
* @param posy Position depart
|
||||
* @param outputlangs Objet langs
|
||||
* @return y Position pour suite
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@ -792,9 +792,14 @@ class pdf_jaune extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche la grille des lignes de propales
|
||||
* Show table for lines
|
||||
*
|
||||
* @param pdf objet PDF
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -852,14 +857,15 @@ class pdf_jaune extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of document
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param pdf Object PDF
|
||||
* @param object Object commercial proposal
|
||||
* @param showaddress 0=no, 1=yes
|
||||
* @param outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
@ -1041,11 +1047,12 @@ class pdf_jaune extends ModelePDFPropales
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
|
||||
@ -205,14 +205,15 @@ class pdf_paiement
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param $pdf Object PDF
|
||||
* @param $object Object
|
||||
* @param $showaddress 0=no, 1=yes
|
||||
* @param $outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $page, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $page, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
@ -357,7 +357,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
$amount_credit_notes_included=0;
|
||||
$amount_deposits_included=0;
|
||||
|
||||
|
||||
if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included)
|
||||
{
|
||||
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
||||
@ -391,11 +391,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show total to pay
|
||||
* \param pdf Object PDF
|
||||
* \param object Object invoice
|
||||
* \param deja_regle Amount payed
|
||||
* \return y Next position
|
||||
* Show total to pay
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@ -579,8 +582,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the lines of invoice
|
||||
* @param pdf object PDF
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -718,14 +727,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param $pdf Object PDF
|
||||
* @param $object Object order
|
||||
* @param $showaddress 0=no, 1=yes
|
||||
* @param $outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
@ -871,11 +881,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlang Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf, $object, $outputlangs)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -427,13 +427,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
|
||||
|
||||
/**
|
||||
* Show other information
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $posy Position start
|
||||
* @param Translate $outputlangs Object langs
|
||||
* @return int Position pour suite
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -571,7 +571,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
@ -761,9 +761,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the lines of order
|
||||
|
||||
* @param PDF $pdf object PDF
|
||||
* Show table for lines
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
@ -822,14 +827,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
}
|
||||
|
||||
/**
|
||||
* Show header of page
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param $pdf Object PDF
|
||||
* @param $object Object order
|
||||
* @param $showaddress 0=no, 1=yes
|
||||
* @param $outputlangs Object lang for output
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
@ -984,12 +990,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
}
|
||||
|
||||
/**
|
||||
* Show footer of page
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* \param pdf PDF factory
|
||||
* \param object Object invoice
|
||||
* \param outputlang Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
* @param PDF &$pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
*/
|
||||
function _pagefoot(&$pdf, $object, $outputlangs)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -21,22 +21,22 @@
|
||||
<!-- BEGIN PHP TEMPLATE FOR JQUERY -->
|
||||
<?php if (count($object->lines) > 1 && $_GET['action'] != 'editline') { ?>
|
||||
<script>
|
||||
jQuery(document).ready(function(){
|
||||
jQuery(".imgup").hide();
|
||||
jQuery(".imgdown").hide();
|
||||
jQuery(".lineupdown").removeAttr('href');
|
||||
jQuery(".tdlineupdown").css("background-image",'url(<?php echo DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/grip.png'; ?>)');
|
||||
jQuery(".tdlineupdown").css("background-repeat","no-repeat");
|
||||
jQuery(".tdlineupdown").css("background-position","center center");
|
||||
$(document).ready(function(){
|
||||
$(".imgup").hide();
|
||||
$(".imgdown").hide();
|
||||
$(".lineupdown").removeAttr('href');
|
||||
$(".tdlineupdown").css("background-image",'url(<?php echo DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/grip.png'; ?>)');
|
||||
$(".tdlineupdown").css("background-repeat","no-repeat");
|
||||
$(".tdlineupdown").css("background-position","center center");
|
||||
|
||||
jQuery("#tablelines").tableDnD({
|
||||
$("#tablelines").tableDnD({
|
||||
onDrop: function(table, row) {
|
||||
var reloadpage = "<?php echo $conf->global->MAIN_FORCE_RELOAD_PAGE; ?>";
|
||||
var roworder = cleanSerialize(jQuery("#tablelines").tableDnDSerialize());
|
||||
var roworder = cleanSerialize($("#tablelines").tableDnDSerialize());
|
||||
var table_element_line = "<?php echo $object->table_element_line; ?>";
|
||||
var fk_element = "<?php echo $object->fk_element; ?>";
|
||||
var element_id = "<?php echo $object->id; ?>";
|
||||
jQuery.get("<?php echo DOL_URL_ROOT; ?>/core/ajax/row.php",
|
||||
$.get("<?php echo DOL_URL_ROOT; ?>/core/ajax/row.php",
|
||||
{
|
||||
roworder: roworder,
|
||||
table_element_line: table_element_line,
|
||||
@ -47,11 +47,11 @@ jQuery(document).ready(function(){
|
||||
if (reloadpage == 1) {
|
||||
location.href = '<?php echo $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; ?>';
|
||||
} else {
|
||||
jQuery("#tablelines .drag").each(
|
||||
$("#tablelines .drag").each(
|
||||
function( intIndex ) {
|
||||
jQuery(this).removeClass("pair impair");
|
||||
if (intIndex % 2 == 0) jQuery(this).addClass('impair');
|
||||
if (intIndex % 2 == 1) jQuery(this).addClass('pair');
|
||||
$(this).removeClass("pair impair");
|
||||
if (intIndex % 2 == 0) $(this).addClass('impair');
|
||||
if (intIndex % 2 == 1) $(this).addClass('pair');
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -59,17 +59,17 @@ jQuery(document).ready(function(){
|
||||
onDragClass: "dragClass",
|
||||
dragHandle: "tdlineupdown"
|
||||
});
|
||||
jQuery(".tdlineupdown").hover( function() { jQuery(this).addClass('showDragHandle'); },
|
||||
function() { jQuery(this).removeClass('showDragHandle'); }
|
||||
$(".tdlineupdown").hover( function() { $(this).addClass('showDragHandle'); },
|
||||
function() { $(this).removeClass('showDragHandle'); }
|
||||
);
|
||||
});
|
||||
</script>
|
||||
<?php } else { ?>
|
||||
<script>
|
||||
jQuery(document).ready(function(){
|
||||
jQuery(".imgup").hide();
|
||||
jQuery(".imgdown").hide();
|
||||
jQuery(".lineupdown").removeAttr('href');
|
||||
$(document).ready(function(){
|
||||
$(".imgup").hide();
|
||||
$(".imgdown").hide();
|
||||
$(".lineupdown").removeAttr('href');
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -42,7 +43,7 @@ require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/doc/pdf_jaune
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/pdf_edison.modules.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/pdf_einstein.modules.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/project/pdf/pdf_baleine.modules.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/pdf_soleil.modules.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php';
|
||||
// Mother classes of pdf generators
|
||||
|
||||
Loading…
Reference in New Issue
Block a user