mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 00:53:00 +01:00
Merge remote-tracking branch 'origin/3.7' into develop
Conflicts: htdocs/commande/card.php htdocs/compta/facture.php htdocs/compta/facture/class/facture.class.php htdocs/core/class/commonobject.class.php htdocs/core/modules/expedition/modules_expedition.php htdocs/core/modules/modContrat.class.php htdocs/expedition/class/expedition.class.php
This commit is contained in:
@@ -143,14 +143,17 @@ abstract class ModelNumRefExpedition
|
||||
}
|
||||
|
||||
/**
|
||||
* Cree un bon d'expedition sur disque
|
||||
* Create a document onto disk according to template module.
|
||||
*
|
||||
* @param DoliDB $db Objet base de donnee
|
||||
* @param Expedition $object Object expedition
|
||||
* @param string $modele Force le modele a utiliser ('' to not force)
|
||||
* @param Translate $outputlangs Objet lang a utiliser pour traduction
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @deprecated Use the new function generateDocument of Expedition class
|
||||
* @param DoliDB $db Objet base de donnee
|
||||
* @param Object $object Object expedition
|
||||
* @param string $modele Force le modele a utiliser ('' to not force)
|
||||
* @param Translate $outputlangs Objet lang a utiliser pour traduction
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @return int 1 if OK -1 if KO
|
||||
* @deprecated Use the new function generateDocument of Expedition class
|
||||
*/
|
||||
function expedition_pdf_create(DoliDB $db, Expedition $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ class modContrat extends DolibarrModules
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
$this->numero = 54;
|
||||
@@ -118,12 +118,10 @@ class modContrat extends DolibarrModules
|
||||
|
||||
// Exports
|
||||
//--------
|
||||
$langs->load("contracts");
|
||||
|
||||
$r=1;
|
||||
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]=$langs->trans('ContractsAndLine'); // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_label[$r]='ContractsAndLine'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r]='contract';
|
||||
$this->export_permission[$r]=array(array("contrat","export"));
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
*
|
||||
@@ -169,28 +169,60 @@ class pdf_azur extends ModelePDFPropales
|
||||
$realpatharray=array();
|
||||
if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
|
||||
{
|
||||
$objphoto = new Product($this->db);
|
||||
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
if (empty($object->lines[$i]->fk_product)) continue;
|
||||
|
||||
$objphoto = new Product($this->db);
|
||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product,2) . $object->lines[$i]->fk_product ."/photos/";
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
|
||||
$realpath='';
|
||||
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
||||
{
|
||||
$filename=$obj['photo'];
|
||||
//if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette'];
|
||||
$realpath = $dir.$filename;
|
||||
break;
|
||||
$pdir[0] = get_exdir($objphoto->id,2) . $objphoto->id ."/photos/";
|
||||
$pdir[1] = dol_sanitizeFileName($objphoto->ref).'/';
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdir[0] = dol_sanitizeFileName($objphoto->ref).'/';
|
||||
$pdir[1] = get_exdir($objphoto->id,2) . $objphoto->id ."/photos/";
|
||||
}
|
||||
|
||||
if ($realpath) $realpatharray[$i]=$realpath;
|
||||
$arephoto = false;
|
||||
foreach ($pdir as $midir)
|
||||
{
|
||||
if (! $arephoto)
|
||||
{
|
||||
$dir = $conf->product->dir_output.'/'.$midir;
|
||||
|
||||
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
||||
{
|
||||
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
|
||||
{
|
||||
if ($obj['photo_vignette'])
|
||||
{
|
||||
$filename= $obj['photo_vignette'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename=$obj['photo'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename=$obj['photo'];
|
||||
}
|
||||
|
||||
$realpath = $dir.$filename;
|
||||
$arephoto = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($realpath && $arephoto) $realpatharray[$i]=$realpath;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
|
||||
Reference in New Issue
Block a user