Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-02-25 01:34:44 +01:00
commit 7f1ea8520d
5 changed files with 61 additions and 57 deletions

View File

@ -383,7 +383,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
echo "$name";
print "</td><td>\n";
require_once($dir.$file);
$module = new $classname();
$module = new $classname($db);
print $module->description;
print '</td>';
@ -391,16 +391,9 @@ foreach ($conf->file->dol_document_root as $dirroot)
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
//if ($conf->global->FICHEINTER_ADDON_PDF != "$name")
//{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
//}
//else
//{
// print img_picto($langs->trans("Enabled"),'switch_on');
//}
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else

View File

@ -223,25 +223,25 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if ($targetcompany->tva_intra) $stringaddress.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra);
// Professionnal Ids
if ($conf->global->MAIN_PROFID1_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID1_IN_ADDRESS) && ! empty($targetcompany->idprof1))
{
$tmp=$outputlangs->transcountrynoentities("ProfId1",$targetcompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof1);
}
if ($conf->global->MAIN_PROFID2_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID2_IN_ADDRESS) && ! empty($targetcompany->idprof2))
{
$tmp=$outputlangs->transcountrynoentities("ProfId2",$targetcompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof2);
}
if ($conf->global->MAIN_PROFID3_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID3_IN_ADDRESS) && ! empty($targetcompany->idprof3))
{
$tmp=$outputlangs->transcountrynoentities("ProfId3",$targetcompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof3);
}
if ($conf->global->MAIN_PROFID4_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID4_IN_ADDRESS) && ! empty($targetcompany->idprof4))
{
$tmp=$outputlangs->transcountrynoentities("ProfId4",$targetcompany->country_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];

View File

@ -37,13 +37,28 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php');
*/
class pdf_soleil extends ModelePDFFicheinter
{
var $db;
var $name;
var $description;
var $type;
var $phpmin = array(4,3,0); // Minimum version of PHP required by module
var $version = 'dolibarr';
var $page_largeur;
var $page_hauteur;
var $format;
var $marge_gauche;
var $marge_droite;
var $marge_haute;
var $marge_basse;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function pdf_soleil($db)
function __construct($db)
{
global $conf,$langs,$mysoc;
@ -153,7 +168,7 @@ class pdf_soleil extends ModelePDFFicheinter
$tab_top = 100;
$tab_top_middlepage = 50;
$tab_top_newpage = 50;
$tab_height = 110;
$tab_height = 120;
$tab_height_newpage = 150;
$tab_height_middlepage = 200;
$tab_height_endpage = 170;
@ -184,7 +199,7 @@ class pdf_soleil extends ModelePDFFicheinter
$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 );
@ -208,7 +223,7 @@ class pdf_soleil extends ModelePDFFicheinter
$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
@ -221,15 +236,17 @@ class pdf_soleil extends ModelePDFFicheinter
{
$curY = $nexY;
$pdf->SetFont('','B', $default_font_size - 1);
$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();
$curY = $pdf->GetY();
$pdf->SetFont('','', $default_font_size - 1);
$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+=dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)*3;
$nexY+=2; // Passe espace entre les lignes
@ -282,26 +299,19 @@ class pdf_soleil extends ModelePDFFicheinter
}
}
}
//$pdf->line(10, $tab_top+$tab_height+3, 200, $tab_top+$tab_height+3);
// Show square
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1;
}
// 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);
@ -344,7 +354,7 @@ class pdf_soleil extends ModelePDFFicheinter
{
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);
@ -368,21 +378,21 @@ class pdf_soleil extends ModelePDFFicheinter
$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->SetXY(20,230);
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
$pdf->SetXY(20,225);
$pdf->SetXY(20,235);
$pdf->MultiCell(80,30, '', 1);
$pdf->SetXY(110,220);
$pdf->SetXY(110,230);
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
$pdf->SetXY(110,225);
$pdf->SetXY(110,235);
$pdf->MultiCell(80,30, '', 1);
}

View File

@ -38,8 +38,9 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
/**
* \brief Return list of active generation modules
* \param $db Database handler
* Return list of active generation modules
*
* @param DoliDB $db Database handler
*/
function liste_modeles($db)
{

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -60,11 +60,11 @@ class Fichinter extends CommonObject
/**
* Constructor
*
* @param DoliDB $DB Database handler
* @param DoliDB $db Database handler
*/
function Fichinter($DB)
function __construct($db)
{
$this->db = $DB ;
$this->db = $db ;
$this->products = array();
$this->fk_project = 0;
$this->statut = 0;
@ -814,9 +814,9 @@ class Fichinter extends CommonObject
{
$sql = 'SELECT rowid, description, duree, date, rang';
$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet';
$sql.= ' where fk_fichinter = '.$this->id;
$sql.= ' WHERE fk_fichinter = '.$this->id;
dol_syslog("Fichinter::fetch_lines sql=".$sql);
dol_syslog(get_class($this)."::fetch_lines sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
@ -872,11 +872,11 @@ class FichinterLigne
/**
* Constructor
*
* @param DoliDB $DB Database handler
* @param DoliDB $db Database handler
*/
function FichinterLigne($DB)
function __construct($db)
{
$this->db= $DB;
$this->db = $db;
}
/**