trim trailing

This commit is contained in:
Frédéric FRANCE 2018-07-26 19:05:34 +02:00
parent f8e7d71ae8
commit 6cb0fb10d6
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
56 changed files with 584 additions and 612 deletions

View File

@ -15,14 +15,14 @@ else return 0;
function highlightTOC(str) {
if (StopProcess()) return;
try {
str = str || parent.BODY.document.location.href;
uri = last(str);
list = parent.TOC.document.getElementsByTagName("a");
@ -33,7 +33,7 @@ function highlightTOC(str) {
list[i].style.backgroundColor = "#6697cc";
list[i].style.padding = "2px";
list[i].style.color = "#ffffff";
} else {
list[i].style.backgroundColor = "#ffffff";
list[i].style.color = "#003380";

View File

@ -12,7 +12,7 @@
.atn { color: #606; }
.atv { color: #080; }
.dec { color: #606; }
pre.preformatted {
pre.preformatted {
display: block;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;

View File

@ -1116,7 +1116,7 @@ window['_pr_isIE6'] = function () {
for (var i = 0; i < 10; ++i) {
lineBreaks[i] = lineBreakHtml + '</li><li class="L' + i + '">';
}
var lineNum = numberLines[1] && numberLines[1].length
var lineNum = numberLines[1] && numberLines[1].length
? numberLines[1] - 1 : 0; // Lines are 1-indexed
html.push('<ol class="linenums"><li class="L', (lineNum) % 10, '"');
if (lineNum) {

View File

@ -1,5 +1,5 @@
body
{
{
background: #FFFFFF
}
@ -100,7 +100,7 @@ li.listalpha3 {
width: auto;
height: auto;
white-space: normal;
}
}
/*li.listalpha2, li.listalpha, li.listalpha3
{
@ -207,7 +207,7 @@ p.listcontinue3 {
height: auto;
}
.prcontinuous
.prcontinuous
{font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-style: normal;
font-variant: normal;
@ -237,7 +237,7 @@ p.listcontinue3 {
height: auto;
}
.prefblue
.prefblue
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-size: 10pt;
@ -253,7 +253,7 @@ p.listcontinue3 {
padding-left: 0pt;
padding-right: 0pt;
}
.prefred
.prefred
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-size: 10pt;
@ -269,7 +269,7 @@ p.listcontinue3 {
padding-left: 0pt;
padding-right: 0pt;
}
.prefdarkblue
.prefdarkblue
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-weight: bold;
@ -286,7 +286,7 @@ p.listcontinue3 {
padding-left: 0pt;
padding-right: 0pt;
}
.prefgrey
.prefgrey
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-size: 10pt;
@ -303,7 +303,7 @@ p.listcontinue3 {
padding-right: 0pt;
}
.expandingblock
.expandingblock
{font-family: "Tahoma", verdana, arial, helvetica, sans-serif;
border-color: #AFAFAF;
border-top-style: dotted;
@ -363,7 +363,7 @@ p.listcontinue3 {
.pagenavigation a, .pagenavigation a:link, .pagenavigation a:visited {
color: #000000;
text-decoration: none;
text-decoration: none;
}
.pagenavigation a:hover {
text-decoration: none;
@ -387,7 +387,7 @@ p.listcontinue3 {
}
.nav a, .nav a:link, .nav a:visited {
color: #000000;
text-decoration: none;
text-decoration: none;
}
.nav a:hover {
text-decoration: none;
@ -400,9 +400,9 @@ td.navTabActive {
vertical-align: middle;
font-family: tahoma, verdana, arial, helvetica, sans-serif;
font-size: 8pt;
padding-top: 4px;
padding-bottom: 0px;
padding-left: 8px;
padding-top: 4px;
padding-bottom: 0px;
padding-left: 8px;
padding-right: 8px;
font-weight: bold;
background-image: url('nav_bg_active.gif');
@ -567,7 +567,7 @@ a:visited,
border-right-color: #FFFFFF;
border-bottom-style: solid;
border-bottom-width: 2px;
border-bottom-color: #ffffff;
border-bottom-color: #ffffff;
}
.bodytext {
font-family: verdana, tahoma, arial, helvetica, sans-serif;
@ -582,7 +582,7 @@ a:visited,
font-weight: bold;
font-size: 8pt;
line-height: 12px;
color: #2f739b;
color: #2f739b;
line-height: 11px;
margin: 0px;
padding: 3px;
@ -1303,7 +1303,7 @@ li.listnumber2 {
font-style: normal;
font-variant: normal;
font-size: 12pt;
color: #5c5b64;
color: #5c5b64;
background-color: inherit;
word-spacing: normal;
letter-spacing: normal;
@ -1512,7 +1512,7 @@ li.listnumber2 {
span.toc {
line-height: 19px;
}
.searchDetails {
font-family: tahoma, verdana, arial, helvetica, sans-serif;
font-size: 11px;
@ -1561,11 +1561,11 @@ form {
font-weight: bold;
}
.searchFoundWord {
background-color: #fffdce;
background-color: #fffdce;
}
.searchToTop {
text-align: left;
border-top: 1px solid #cfcfcf;
padding: 7px 0px 15px 0px;
margin: 0px;
}
}

View File

@ -31,9 +31,9 @@ include '../master.inc.php';
$phone = GETPOST('phone');
$notfound = $langs->trans("Unknown");
// Security check
if (empty($conf->clicktodial->enabled))
if (empty($conf->clicktodial->enabled))
{
print "Error: Module Click to dial is not enabled.\n";
exit;

View File

@ -93,7 +93,7 @@ abstract class CommonStickerGenerator
{
$this->db = $db;
}
/**
* Function to build PDF on disk, then output on HTTP strem.
*
@ -114,7 +114,7 @@ abstract class CommonStickerGenerator
* @return void
*/
abstract function addSticker(&$pdf,$outputlangs,$param);
/**
* Methode qui permet de modifier la taille des caracteres
* Cela modiera aussi l'espace entre chaque ligne
@ -130,7 +130,7 @@ abstract class CommonStickerGenerator
$this->_Line_Height = $this->_Get_Height_Chars($pt);
$pdf->SetFont('','',$pt);
}
}
}
/**
* protected Print dot line
@ -251,7 +251,7 @@ abstract class CommonStickerGenerator
* @param string $format Format
* @return void
*/
function _Set_Format(&$pdf, $format)
function _Set_Format(&$pdf, $format)
{
$this->_Metric = $format['metric'];
$this->_Avery_Name = $format['name'];

View File

@ -1,6 +1,6 @@
<?php
/* EXPERIMENTAL
*
*
* Copyright (C) 2016 ATM Consulting <support@atm-consulting.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -22,7 +22,7 @@
* \ingroup core
* \brief File of class to manage all object. Might be replace or merge into commonobject
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class CoreObject extends CommonObject
@ -54,7 +54,7 @@ class CoreObject extends CommonObject
$this->id = 0;
$this->datec = 0;
$this->tms = 0;
if (!empty($this->fields))
{
foreach ($this->fields as $field=>$info)
@ -68,14 +68,14 @@ class CoreObject extends CommonObject
$this->to_delete=false;
$this->is_clone=false;
return true;
}
else
{
return false;
}
}
/**
@ -110,7 +110,7 @@ class CoreObject extends CommonObject
if($res>0) {
if ($loadChild) $this->fetchChild();
}
return $res;
}
@ -133,14 +133,14 @@ class CoreObject extends CommonObject
if($object->{$key} === $id) return $k;
}
}
$k = count($this->{$tabName});
$className = ucfirst($tabName);
$this->{$tabName}[$k] = new $className($this->db);
if($id>0 && $key==='id' && $try_to_load)
{
$this->{$tabName}[$k]->fetch($id);
$this->{$tabName}[$k]->fetch($id);
}
return $k;
@ -220,7 +220,7 @@ class CoreObject extends CommonObject
foreach($this->{$className} as $i => &$object)
{
$object->{$this->fk_element} = $this->id;
$object->update($user);
if($this->unsetChildDeleted && isset($object->to_delete) && $object->to_delete==true) unset($this->{$className}[$i]);
}

View File

@ -59,10 +59,10 @@ class FormPropal
$prefix='';
$listofstatus=array();
if ($mode == 'supplier')
if ($mode == 'supplier')
{
$prefix='SupplierProposalStatus';
$langs->load("supplier_proposal");
$listofstatus=array(
0=>array('id'=>0, 'code'=>'PR_DRAFT'),
@ -75,7 +75,7 @@ class FormPropal
else
{
$prefix="PropalStatus";
$sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst";
$sql .= " WHERE active = 1";
dol_syslog(get_class($this)."::selectProposalStatus", LOG_DEBUG);
@ -139,4 +139,3 @@ class FormPropal
print '</select>';
}
}

View File

@ -24,7 +24,7 @@
/**
* CombinePaths
*
*
* @param string $sBasePath sBasePath
* @param string $sFolder sFolder
* @return string Combined path
@ -393,7 +393,7 @@ EOF;
// This is the function that sends the results of the uploading process to CKE.
/**
* SendCKEditorResults
*
*
* @param string $callback callback
* @param string $sFileUrl sFileUrl
* @param string $customMsg customMsg
@ -409,5 +409,3 @@ function SendCKEditorResults ($callback, $sFileUrl, $customMsg = '')
echo '</script>';
}

View File

@ -251,7 +251,7 @@ function barcode_encode_genbarcode($code,$encoding)
$command=escapeshellarg($genbarcode_loc);
//$paramclear=" \"".str_replace("\"", "\\\"",$code)."\" \"".str_replace("\"", "\\\"",strtoupper($encoding))."\"";
$paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding));
$fullcommandclear=$command." ".$paramclear." 2>&1";
//print $fullcommandclear."<br>\n";exit;
@ -277,8 +277,8 @@ function barcode_encode_genbarcode($code,$encoding)
"error" => ""
);
//var_dump($ret);
if (preg_match('/permission denied/i',$ret['bars']))
{
if (preg_match('/permission denied/i',$ret['bars']))
{
$ret['error']=$ret['bars']; $ret['bars']='';
return $ret;
}

View File

@ -48,8 +48,8 @@ function emailing_prepare_head(Mailing $object)
$h++;
}
if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR))
if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR))
{
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/advtargetemailing.php?id=".$object->id;
$head[$h][1] = $langs->trans("MailAdvTargetRecipients");

View File

@ -67,7 +67,7 @@ function expensereport_prepare_head($object)
$head[$h][2] = 'note';
$h++;
}
$head[$h][0] = DOL_URL_ROOT . '/expensereport/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
@ -81,7 +81,7 @@ function expensereport_prepare_head($object)
/**
* Returns an array with the tabs for the "Expense report payment" section
* It loads tabs from modules looking for the entity payment
*
*
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
*/
@ -139,7 +139,7 @@ function expensereport_admin_prepare_head()
$head[$h][2] = 'expenseik';
$h++;
}
if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php";
@ -147,7 +147,7 @@ function expensereport_admin_prepare_head()
$head[$h][2] = 'expenserules';
$h++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -36,7 +36,7 @@ $sql = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, t
$resql = $db->query($sql);
if ($resql)
{
while ($row = $db->fetch_array($resql))
while ($row = $db->fetch_array($resql))
{
$_Avery_Labels[$row['code']]['name']=$row['name'];
$_Avery_Labels[$row['code']]['paper-size']=$row['paper_size'];

View File

@ -21,12 +21,12 @@
* \brief A set of functions for Dolibarr
* This file contains all frequently used functions.
*/
/**
* Function to return number in text.
*
*
*
*
* @param float $num Number to convert
* @param Lang $langs Language
* @param boolean $currency 0=number to translate | 1=currency to translate
@ -36,7 +36,7 @@
function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
{
global $conf;
$num = str_replace(array(',', ' '), '', trim($num));
if(! $num) {
return false;
@ -48,49 +48,49 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
$num = (int) $TNum[0];
$words = array();
$list1 = array(
'',
$langs->transnoentitiesnoconv('one'),
$langs->transnoentitiesnoconv('two'),
$langs->transnoentitiesnoconv('three'),
$langs->transnoentitiesnoconv('four'),
$langs->transnoentitiesnoconv('five'),
$langs->transnoentitiesnoconv('six'),
$langs->transnoentitiesnoconv('seven'),
$langs->transnoentitiesnoconv('eight'),
$langs->transnoentitiesnoconv('nine'),
$langs->transnoentitiesnoconv('ten'),
'',
$langs->transnoentitiesnoconv('one'),
$langs->transnoentitiesnoconv('two'),
$langs->transnoentitiesnoconv('three'),
$langs->transnoentitiesnoconv('four'),
$langs->transnoentitiesnoconv('five'),
$langs->transnoentitiesnoconv('six'),
$langs->transnoentitiesnoconv('seven'),
$langs->transnoentitiesnoconv('eight'),
$langs->transnoentitiesnoconv('nine'),
$langs->transnoentitiesnoconv('ten'),
$langs->transnoentitiesnoconv('eleven'),
$langs->transnoentitiesnoconv('twelve'),
$langs->transnoentitiesnoconv('thirteen'),
$langs->transnoentitiesnoconv('fourteen'),
$langs->transnoentitiesnoconv('fifteen'),
$langs->transnoentitiesnoconv('sixteen'),
$langs->transnoentitiesnoconv('seventeen'),
$langs->transnoentitiesnoconv('eighteen'),
$langs->transnoentitiesnoconv('twelve'),
$langs->transnoentitiesnoconv('thirteen'),
$langs->transnoentitiesnoconv('fourteen'),
$langs->transnoentitiesnoconv('fifteen'),
$langs->transnoentitiesnoconv('sixteen'),
$langs->transnoentitiesnoconv('seventeen'),
$langs->transnoentitiesnoconv('eighteen'),
$langs->transnoentitiesnoconv('nineteen')
);
$list2 = array(
'',
$langs->transnoentitiesnoconv('ten'),
$langs->transnoentitiesnoconv('twenty'),
$langs->transnoentitiesnoconv('thirty'),
$langs->transnoentitiesnoconv('forty'),
$langs->transnoentitiesnoconv('fifty'),
$langs->transnoentitiesnoconv('sixty'),
$langs->transnoentitiesnoconv('seventy'),
$langs->transnoentitiesnoconv('eighty'),
$langs->transnoentitiesnoconv('ninety'),
'',
$langs->transnoentitiesnoconv('ten'),
$langs->transnoentitiesnoconv('twenty'),
$langs->transnoentitiesnoconv('thirty'),
$langs->transnoentitiesnoconv('forty'),
$langs->transnoentitiesnoconv('fifty'),
$langs->transnoentitiesnoconv('sixty'),
$langs->transnoentitiesnoconv('seventy'),
$langs->transnoentitiesnoconv('eighty'),
$langs->transnoentitiesnoconv('ninety'),
$langs->transnoentitiesnoconv('hundred')
);
$list3 = array(
'',
$langs->transnoentitiesnoconv('thousand'),
$langs->transnoentitiesnoconv('million'),
$langs->transnoentitiesnoconv('billion'),
$langs->transnoentitiesnoconv('trillion'),
'',
$langs->transnoentitiesnoconv('thousand'),
$langs->transnoentitiesnoconv('million'),
$langs->transnoentitiesnoconv('billion'),
$langs->transnoentitiesnoconv('trillion'),
$langs->transnoentitiesnoconv('quadrillion')
);
$num_length = strlen($num);
$levels = (int) (($num_length + 2) / 3);
$max_length = $levels * 3;
@ -120,11 +120,11 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
$concatWords = implode(' ', $words);
// Delete multi whitespaces
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
if(!empty($currency)) {
$concatWords .= ' '.$currency;
}
// If we need to write cents call again this function for cents
if(!empty($TNum[1])) {
if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
@ -133,11 +133,11 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false)
}
return $concatWords;
}
/**
* Function to return number or amount in text.
*
*
* @deprecated
* @param float $numero Number to convert
* @param Lang $langs Language
@ -164,7 +164,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number')
/*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and
in case exist why ask $lang like a parameter?*/
if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
{
{
if ($numero>=1 && $numero<2) {
return ("UN PESO ".$parte_decimal." / 100 M.N.");
}
@ -229,7 +229,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number')
/**
* hundreds2text
*
*
* @param integer $hundreds Hundreds
* @param integer $tens Tens
* @param integer $units Units

View File

@ -18,7 +18,7 @@
/**
* \file htdocs/core/lib/hrm.lib.php
* \ingroup HRM
* \brief Library for hrm
* \brief Library for hrm
*/
$langs->load('hrm');

View File

@ -36,7 +36,7 @@
function facture_prepare_head($object)
{
global $db, $langs, $conf;
$h = 0;
$head = array();
@ -63,7 +63,7 @@ function facture_prepare_head($object)
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql .= " WHERE pfd.fk_facture = ".$object->id;
$resql=$db->query($sql);
if ($resql)
if ($resql)
{
$obj=$db->fetch_object($resql);
if ($obj) $nbStandingOrders = $obj->nb;
@ -152,12 +152,12 @@ function invoice_admin_prepare_head()
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec");
$head[$h][2] = 'attributesrec';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLinesRec");
$head[$h][2] = 'attributeslinesrec';
@ -172,7 +172,7 @@ function invoice_admin_prepare_head()
function invoice_rec_prepare_head($object)
{
global $db, $langs, $conf;
$h = 0;
$head = array();
@ -191,5 +191,3 @@ function invoice_rec_prepare_head($object)
return $head;
}

View File

@ -59,7 +59,7 @@ function loan_prepare_head($object)
$tab++;
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
{
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
$head[$tab][1] = $langs->trans("Notes");

View File

@ -258,13 +258,13 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
foreach($object->fields as $key => $val)
{
$i++;
$type = $val['type'];
$type = $val['type'];
$type = preg_replace('/:.*$/', '', $type); // For case type = 'integer:Societe:societe/class/societe.class.php'
if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database
else if ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
else if ($type == 'link' || $type == 'sellist') $type = 'integer';
else if ($type == 'link' || $type == 'sellist') $type = 'integer';
$texttoinsert.= "\t".$key." ".$type;
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
@ -343,5 +343,3 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
return $error ? -1 : 1;
}

View File

@ -20,14 +20,14 @@
/**
* Returns an array with the tabs for the "salaries" section
* It loads tabs from modules looking for the entity salaries
*
*
* @param Paiement $object Current salaries object
* @return array Tabs for the salaries section
*/
function salaries_prepare_head($object) {
global $db, $langs, $conf;
$h = 0;
$head = array();
@ -57,7 +57,7 @@ function salaries_prepare_head($object) {
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries', 'remove');
return $head;

View File

@ -64,7 +64,7 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
&& $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60){
$hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
$mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
$ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
$ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
}
@ -520,4 +520,3 @@ function quotedPrintDecode($str)
$out = quoted_printable_decode($out); // Available with PHP 4+
return trim($out);
}

View File

@ -109,7 +109,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $encoding Mode of encoding
* @param string $readable Code can be read
* @param integer $scale Scale
* @param integer $nooutputiferror No output if error
* @param integer $nooutputiferror No output if error
* @return int <0 if KO, >0 if OK
*/
function buildBarCode($code,$encoding,$readable='Y',$scale=1,$nooutputiferror=0)
@ -150,7 +150,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $encoding Mode of encoding
* @param string $readable Code can be read
* @param integer $scale Scale
* @param integer $nooutputiferror No output if error
* @param integer $nooutputiferror No output if error
* @return int <0 if KO, >0 if OK
*/
function writeBarCode($code,$encoding,$readable='Y',$scale=1,$nooutputiferror=0)
@ -169,4 +169,3 @@ class modPhpbarcode extends ModeleBarCode
}
}

View File

@ -34,7 +34,7 @@ class modTcpdfbarcode extends ModeleBarCode
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $error='';
var $is2d = false;
/**
* Return description of numbering model
*
@ -55,8 +55,8 @@ class modTcpdfbarcode extends ModeleBarCode
function isEnabled()
{
return true;
}
}
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
@ -66,10 +66,10 @@ class modTcpdfbarcode extends ModeleBarCode
function canBeActivated()
{
global $langs;
return true;
}
/**
* Return true if encoding is supported
*
@ -83,7 +83,7 @@ class modTcpdfbarcode extends ModeleBarCode
return 0;
} else {
return 1;
}
}
}
/**
@ -99,17 +99,17 @@ class modTcpdfbarcode extends ModeleBarCode
function buildBarCode($code,$encoding,$readable='Y',$scale=1,$nooutputiferror=0)
{
global $_GET;
$tcpdfEncoding = $this->getTcpdfEncodingType($encoding);
if (empty($tcpdfEncoding)) return -1;
$color = array(0,0,0);
$_GET["code"]=$code;
$_GET["type"]=$encoding;
$_GET["height"]=$height;
$_GET["readable"]=$readable;
if ($code) {
// Load the tcpdf barcode class
if ($this->is2d) {
@ -122,15 +122,15 @@ class modTcpdfbarcode extends ModeleBarCode
$width = 1;
require_once TCPDF_PATH.'tcpdf_barcodes_1d.php';
$barcodeobj = new TCPDFBarcode($code, $tcpdfEncoding);
}
}
dol_syslog("buildBarCode::TCPDF.getBarcodePNG");
$barcodeobj->getBarcodePNG($width, $height, $color);
return 1;
} else {
return -2;
}
}
}
/**
@ -172,8 +172,8 @@ class modTcpdfbarcode extends ModeleBarCode
$width = 1;
require_once TCPDF_PATH.'tcpdf_barcodes_1d.php';
$barcodeobj = new TCPDFBarcode($code, $tcpdfEncoding);
}
}
dol_syslog("writeBarCode::TCPDF.getBarcodePngData");
if ($imageData = $barcodeobj->getBarcodePngData($width, $height, $color)) {
if (function_exists('imagecreate')) {
@ -186,16 +186,16 @@ class modTcpdfbarcode extends ModeleBarCode
}
} else {
return -4;
}
}
} else {
return -2;
}
}
/**
* get available output_modes for tcpdf class wth its translated description
*
* @param string $dolEncodingType dolibarr barcode encoding type
* @param string $dolEncodingType dolibarr barcode encoding type
* @return string tcpdf encoding type
*/
public function getTcpdfEncodingType($dolEncodingType)
@ -232,7 +232,7 @@ class modTcpdfbarcode extends ModeleBarCode
'PHARMA' => 'PHARMA',
'PHARMA2T' => 'PHARMA2T'
);
$tcpdf2dEncodingTypes = array(
'DATAMATRIX' => 'DATAMATRIX',
'PDF417' => 'PDF417',
@ -240,9 +240,9 @@ class modTcpdfbarcode extends ModeleBarCode
'QRCODE,L' => 'QRCODE,L',
'QRCODE,M' => 'QRCODE,M',
'QRCODE,Q' => 'QRCODE,Q',
'QRCODE,H' => 'QRCODE,H'
'QRCODE,H' => 'QRCODE,H'
);
if (array_key_exists($dolEncodingType, $tcpdf1dEncodingTypes)) {
$this->is2d = false;
return $tcpdf1dEncodingTypes[$dolEncodingType];
@ -251,6 +251,6 @@ class modTcpdfbarcode extends ModeleBarCode
return $tcpdf2dEncodingTypes[$dolEncodingType];
} else {
return '';
}
}
}
}

View File

@ -44,7 +44,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
function __construct($db)
{
global $conf,$langs,$mysoc;
// Load traductions files requiredby by page
$langs->loadLangs(array("main", "bills"));
@ -77,7 +77,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/**
* Fonction to generate document on disk
*
* @param RemiseCheque $object Object RemiseCheque
* @param RemiseCheque $object Object RemiseCheque
* @param string $_dir Directory
* @param string $number Number
* @param Translate $outputlangs Lang output object
@ -91,7 +91,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
$sav_charset_output=$outputlangs->charset_output;
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "companies", "bills", "products", "compta"));
@ -191,7 +191,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
$outputlangs->charset_output=$sav_charset_output;
return 1; // Pas d'erreur
}
@ -210,7 +210,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
{
global $langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("compta", "banks"));
@ -384,7 +384,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
{
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
}
return pdf_pagefoot($pdf,$outputlangs,$newfreetext,$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}
}

View File

@ -115,7 +115,7 @@ abstract class ModeleNumRefChequeReceipts
/**
* \class ModeleChequeReceipts
* \brief Classe mere des modeles de
* \brief Classe mere des modeles de
*/
abstract class ModeleChequeReceipts extends CommonDocGenerator
{
@ -209,4 +209,3 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
return -1;
}
}

View File

@ -43,17 +43,17 @@ class pdf_strato extends ModelePDFContract
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
@ -63,8 +63,8 @@ class pdf_strato extends ModelePDFContract
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
@ -75,32 +75,32 @@ class pdf_strato extends ModelePDFContract
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
@ -177,7 +177,7 @@ class pdf_strato extends ModelePDFContract
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';
// Translations
$outputlangs->loadLangs(array("main", "dict", "companies", "contracts"));
@ -537,9 +537,9 @@ class pdf_strato extends ModelePDFContract
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $conf,$langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Translations
$outputlangs->loadLangs(array("main", "dict", "contract", "companies"));
@ -721,4 +721,3 @@ class pdf_strato extends ModelePDFContract
}
}

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/**
* Class to build sending documents with model Merou
* Class to build sending documents with model Merou
*/
class pdf_merou extends ModelePdfExpedition
{
@ -41,17 +41,17 @@ class pdf_merou extends ModelePdfExpedition
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
@ -61,8 +61,8 @@ class pdf_merou extends ModelePdfExpedition
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
@ -73,37 +73,37 @@ class pdf_merou extends ModelePdfExpedition
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
@ -162,10 +162,10 @@ class pdf_merou extends ModelePdfExpedition
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';
// Translations
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
if ($conf->expedition->dir_output)
{
$object->fetch_thirdparty();
@ -331,7 +331,7 @@ class pdf_merou extends ModelePdfExpedition
$pdf->SetDrawColor(120,120,120);
$pdf->Rect(10+3, $curY, 3, 3);
$pdf->Rect(20+3, $curY, 3, 3);
//Insertion de la reference du produit
$pdf->SetXY(30, $curY);
$pdf->SetFont('','B', $default_font_size - 3);
@ -424,7 +424,7 @@ class pdf_merou extends ModelePdfExpedition
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}
else
@ -456,7 +456,7 @@ class pdf_merou extends ModelePdfExpedition
{
global $langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Translations
$langs->loadLangs(array("main", "bills"));

View File

@ -40,17 +40,17 @@ class pdf_rouget extends ModelePdfExpedition
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
@ -60,8 +60,8 @@ class pdf_rouget extends ModelePdfExpedition
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
@ -72,37 +72,37 @@ class pdf_rouget extends ModelePdfExpedition
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
@ -193,7 +193,7 @@ class pdf_rouget extends ModelePdfExpedition
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';
// Translations
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
@ -1100,4 +1100,3 @@ class pdf_rouget extends ModelePdfExpedition
}
}

View File

@ -52,7 +52,7 @@ class pdf_standard extends ModeleExpenseReport
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
@ -62,8 +62,8 @@ class pdf_standard extends ModeleExpenseReport
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
@ -74,37 +74,37 @@ class pdf_standard extends ModeleExpenseReport
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
@ -120,7 +120,7 @@ class pdf_standard extends ModeleExpenseReport
function __construct($db)
{
global $conf, $langs, $mysoc;
// Translations
$langs->loadLangs(array("main", "trips", "projects"));
@ -208,7 +208,7 @@ class pdf_standard extends ModeleExpenseReport
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';
// Translations
$outputlangs->loadLangs(array("main", "trips", "projects", "dict"));
@ -567,7 +567,7 @@ class pdf_standard extends ModeleExpenseReport
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $conf,$langs,$hookmanager;
// Translations
$outputlangs->loadLangs(array("main", "trips", "companies"));
@ -919,4 +919,3 @@ class pdf_standard extends ModeleExpenseReport
}
}

View File

@ -71,8 +71,8 @@ class pdf_crabe extends ModelePDFFactures
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
@ -83,37 +83,37 @@ class pdf_crabe extends ModelePDFFactures
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
@ -1843,4 +1843,3 @@ class pdf_crabe extends ModelePDFFactures
}
}

View File

@ -78,7 +78,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskreplacement" value="'.$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT.'">',$tooltip,1,1).'</td>';
$texte.= '</tr>';
// Parametrage du prefix des avoirs
$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskcredit" value="'.$conf->global->FACTURE_MERCURE_MASK_CREDIT.'">',$tooltip,1,1).'</td>';
@ -135,7 +135,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
// Get Mask value
$mask = '';
if (is_object($facture) && $facture->type == 1)
if (is_object($facture) && $facture->type == 1)
{
$mask=$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT;
if (! $mask)

View File

@ -52,7 +52,7 @@ class pdf_soleil extends ModelePDFFicheinter
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
@ -62,8 +62,8 @@ class pdf_soleil extends ModelePDFFicheinter
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
@ -74,37 +74,37 @@ class pdf_soleil extends ModelePDFFicheinter
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
@ -169,7 +169,7 @@ class pdf_soleil extends ModelePDFFicheinter
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';
// Translations
$outputlangs->loadLangs(array("main", "interventions", "dict", "companies"));
@ -552,7 +552,7 @@ class pdf_soleil extends ModelePDFFicheinter
{
global $conf,$langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "interventions"));
@ -732,4 +732,3 @@ class pdf_soleil extends ModelePDFFicheinter
}
}

View File

@ -629,8 +629,8 @@ class ImportCsv extends ModeleImports
}
} else {
// We have a last INSERT ID. Check if we have a row referencing this foreign key.
// This is required when updating table with some extrafields. When inserting a record in parent table, we can make
// a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record
// This is required when updating table with some extrafields. When inserting a record in parent table, we can make
// a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record
// may already exists. So we rescan the extrafield table to be know if record exists or not for the rowid.
$sqlSelect = 'SELECT rowid FROM '.$tablename;
@ -752,5 +752,3 @@ function cleansep($value)
{
return str_replace(array(',',';'),'/',$value);
};

View File

@ -653,8 +653,8 @@ class ImportXlsx extends ModeleImports
}
} else {
// We have a last INSERT ID. Check if we have a row referencing this foreign key.
// This is required when updating table with some extrafields. When inserting a record in parent table, we can make
// a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record
// This is required when updating table with some extrafields. When inserting a record in parent table, we can make
// a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record
// may already exists. So we rescan the extrafield table to be know if record exists or not for the rowid.
$sqlSelect = 'SELECT rowid FROM '.$tablename;

View File

@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/**
* Class to build Delivery Order documents with typhon model
* Class to build Delivery Order documents with typhon model
*/
class pdf_typhon extends ModelePDFDeliveryOrder
{
@ -43,69 +43,69 @@ class pdf_typhon extends ModelePDFDeliveryOrder
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
public $type;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
@ -120,7 +120,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
function __construct($db)
{
global $conf,$langs,$mysoc;
// Translations
$langs->loadLangs(array("main", "bills", "sendings", "companies"));
@ -192,7 +192,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
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';
// Translations
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "sendings", "deliveries"));
@ -953,4 +953,3 @@ class pdf_typhon extends ModelePDFDeliveryOrder
}
}

View File

@ -32,9 +32,9 @@ class mailing_example extends MailingTargets
var $desc='Put here a description';
// CHANGE THIS: Set to 1 if selector is available for admin users only
var $require_admin=0;
// CHANGE THIS: Add a tooltip language key to add a tooltip help icon after the email target selector
// CHANGE THIS: Add a tooltip language key to add a tooltip help icon after the email target selector
var $tooltip='MyTooltipLangKey';
var $require_module=array();
var $picto='';
var $db;
@ -144,4 +144,3 @@ class mailing_example extends MailingTargets
}
}

View File

@ -118,7 +118,7 @@ class mailing_pomme extends MailingTargets
$s.='<option value="1">'.$langs->trans("Enabled").'</option>';
$s.='<option value="0">'.$langs->trans("Disabled").'</option>';
$s.='</select>';
$s.=' ';
$s.=$langs->trans("Employee").': ';
$s.='<select name="filteremployee" class="flat">';
@ -126,7 +126,7 @@ class mailing_pomme extends MailingTargets
$s.='<option value="1">'.$langs->trans("Yes").'</option>';
$s.='<option value="0">'.$langs->trans("No").'</option>';
$s.='</select>';
return $s;
}
@ -156,7 +156,7 @@ class mailing_pomme extends MailingTargets
if ($filtersarray) {
dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);
}
global $conf, $langs;
$langs->load("companies");
@ -169,10 +169,10 @@ class mailing_pomme extends MailingTargets
$sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test
$sql.= " AND u.entity IN (0,".$conf->entity.")";
$sql.= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if (isset($_POST["filter"]) && $_POST["filter"] == '1') $sql.= " AND u.statut=1";
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND u.statut=0";
if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '1') $sql.= " AND u.employee=1";
if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '0') $sql.= " AND u.employee=0";
if (isset($_POST["filter"]) && $_POST["filter"] == '1') $sql.= " AND u.statut=1";
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND u.statut=0";
if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '1') $sql.= " AND u.employee=1";
if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '0') $sql.= " AND u.employee=0";
$sql.= " ORDER BY u.email";
// Stocke destinataires dans cibles
@ -222,4 +222,3 @@ class mailing_pomme extends MailingTargets
}
}

View File

@ -50,7 +50,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
'fontsize' => 8,
'stretchtext' => 4
);
// set style for 2d barcode
private $_style2d = array(
'border' => false,
@ -61,24 +61,24 @@ class pdf_tcpdflabel extends CommonStickerGenerator
'module_width' => 1, // width of a single module in points
'module_height' => 1 // height of a single module in points
);
private $_align2d = 'N';
private $_xres = 0.4;
/**
* write barcode to pdf
*
*
* @param PDF $pdf PDF reference
* @param string $code code to print
* @param string $encoding type of barcode
* @param boolean $is2d true if 2d barcode
* @param int $x x position in user units
* @param int $x x position in user units
* @param int $y y position in user units
* @param int $w width in user units
* @param int $h height in user units
*/
private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h)
*/
private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h)
{
if ($is2d) {
$pdf->write2DBarcode($code, $encoding, $x, $y, $w, $h, $this->_style2d, $this->_align2d);
@ -86,7 +86,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$pdf->write1DBarcode($code, $encoding, $x, $y, $w, $h, $this->_xres, $this->_style1d);
}
}
/**
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
*
@ -95,10 +95,10 @@ class pdf_tcpdflabel extends CommonStickerGenerator
* @param array $param Associative array containing label content and optional parameters
* @return void
*/
function addSticker(&$pdf,$outputlangs,$param)
function addSticker(&$pdf,$outputlangs,$param)
{
global $mysoc,$conf;
$textleft = $param['textleft'];
$header = $param['textheader'];
$footer = $param['textfooter'];
@ -106,8 +106,8 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$code = $param['code'];
$encoding = $param['encoding'];
$is2d = $param['is2d'];
// We are in a new page, then we must add a page
if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) {
@ -132,7 +132,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
}
}
$xleft = 2;
$xleft = 2;
$ytop = 2;
// Top
@ -154,7 +154,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$heighttouse = $maxheighttouse;
$logoHeight = $heighttouse;
$logoWidth = $heighttouse;
//var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit;
// Center
@ -162,7 +162,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
{
// Output left area
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, 0, $logoHeight);
else if ($code && !empty($encoding))
else if ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse, $heighttouse);
}
@ -177,7 +177,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%') ) // left part logo/barcode right part text
{
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, 0);
else if ($code && !empty($encoding))
else if ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, $heighttouse);
}
@ -187,7 +187,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
else if (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text
{
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, 0);
else if ($code && !empty($encoding))
else if ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, $heighttouse);
}
@ -203,7 +203,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
} else {
$pdf->SetXY($_PosX+$xleft+$logoWidth+1, $_PosY+$ytop);
$pdf->MultiCell($widthtouse-$logoWidth1-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright),0,'R');
}
}
}
else if ($textright == '%LOGO%') // right part logo left part text/barcode
{
@ -214,7 +214,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
} else {
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
$pdf->MultiCell($widthtouse-$logoWidth-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L');
}
}
}
else // text on halft left and text on half right
{
@ -228,7 +228,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
{
// Output right area
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, 0, $logoHeight);
else if ($code && !empty($encoding))
else if ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, $widthtouse, $heighttouse);
}
@ -295,7 +295,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
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';
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "admin"));

View File

@ -42,69 +42,69 @@ class pdf_baleine extends ModelePDFProjects
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
public $type;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
@ -119,7 +119,7 @@ class pdf_baleine extends ModelePDFProjects
function __construct($db)
{
global $conf,$langs,$mysoc;
// Translations
$langs->loadLangs(array("main", "projects", "companies"));
@ -179,7 +179,7 @@ class pdf_baleine extends ModelePDFProjects
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';
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));

View File

@ -64,7 +64,7 @@ class pdf_beluga extends ModelePDFProjects
function __construct($db)
{
global $conf,$langs,$mysoc;
// Translations
$langs->loadLangs(array("main", "projects", "companies"));
@ -126,7 +126,7 @@ class pdf_beluga extends ModelePDFProjects
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';
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
@ -253,7 +253,7 @@ class pdf_beluga extends ModelePDFProjects
$iniY = $tab_top + $heightoftitleline + 1;
$curY = $tab_top + $heightoftitleline + 1;
$nexY = $tab_top + $heightoftitleline + 1;
$listofreferent=array(
'propal'=>array(
'name'=>"Proposals",
@ -368,8 +368,8 @@ class pdf_beluga extends ModelePDFProjects
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
if ($key == 'agenda')
if ($key == 'agenda')
{
// var_dump($elementarray);
}
@ -378,11 +378,11 @@ class pdf_beluga extends ModelePDFProjects
if ($num >= 0)
{
$nexY = $pdf->GetY() + 5;
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
@ -418,7 +418,7 @@ class pdf_beluga extends ModelePDFProjects
$num = count($elementarray);
// Loop on each lines
for ($i = 0; $i < $num; $i ++)
for ($i = 0; $i < $num; $i ++)
{
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
@ -496,10 +496,10 @@ class pdf_beluga extends ModelePDFProjects
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$curY = $tab_top_newpage + $heightoftitleline + 1;
// Label
$pdf->SetXY($this->posxref, $curY);
$posybefore=$pdf->GetY();
@ -557,7 +557,7 @@ class pdf_beluga extends ModelePDFProjects
{
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty)?$element->thirdparty->name:''), 1, 'L');
}
// Amount without tax
if (empty($value['disableamount'])) {
$pdf->SetXY($this->posxamountht, $curY);
@ -610,7 +610,7 @@ class pdf_beluga extends ModelePDFProjects
$curY = $nexY;
}
}
$nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages
@ -775,7 +775,7 @@ class pdf_beluga extends ModelePDFProjects
$pdf->SetXY($posx,$posy);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $object->thirdparty->getFullName($outputlangs), '', 'R');
}
$pdf->SetTextColor(0,0,60);
}

View File

@ -44,79 +44,79 @@ class pdf_azur extends ModelePDFPropales
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string Save the name of generated file as the main doc when generating a doc with this template
*/
public $update_main_doc_field;
/**
* @var string document type
*/
public $type;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Objet societe qui emet
*/
public $emetteur;
public $emetteur;
/**
@ -127,7 +127,7 @@ class pdf_azur extends ModelePDFPropales
function __construct($db)
{
global $conf,$langs,$mysoc;
// Translations
$langs->loadLangs(array("main", "bills"));
@ -219,7 +219,7 @@ class pdf_azur extends ModelePDFPropales
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';
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "propal", "products"));
@ -1432,7 +1432,7 @@ class pdf_azur extends ModelePDFPropales
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $conf,$langs;
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "propal", "companies", "bills"));
@ -1691,4 +1691,3 @@ class pdf_azur extends ModelePDFPropales
return ($tab_hl*7);
}
}

View File

@ -87,7 +87,7 @@ class pdf_standard extends ModelePDFStock
public function __construct($db)
{
global $conf,$langs,$mysoc;
// Load traductions files requiredby by page
$langs->loadLangs(array("main", "companies"));
@ -114,12 +114,12 @@ class pdf_standard extends ModelePDFStock
// Recupere emetteur
$this->emetteur=$mysoc;
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
// Define position of columns
$this->wref = 15;
$this->posxdesc=$this->marge_gauche+1;
$this->posxlabel=$this->posxdesc+$this->wref;
$this->posxtva=80;
$this->posxtva=80;
$this->posxqty=95;
$this->posxup=115;
$this->posxunit=135;
@ -164,7 +164,7 @@ class pdf_standard extends ModelePDFStock
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';
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries"));
@ -188,7 +188,7 @@ class pdf_standard extends ModelePDFStock
$stockFournisseur = new ProductFournisseur($this->db);
$supplierprices = $stockFournisseur->list_product_fournisseur_price($object->id);
$object->supplierprices = $supplierprices;
$productstatic=new Product($db);
if (! file_exists($dir))
@ -268,8 +268,8 @@ class pdf_standard extends ModelePDFStock
/* Affichage de la liste des produits de l'entrepot */
/* */
/* ************************************************************************** */
$nexY+=5;
$nexY+=5;
$nexY = $pdf->GetY();
$nexY+=10;
@ -311,7 +311,7 @@ class pdf_standard extends ModelePDFStock
if ($objtp->label != '') $objp->produit = $objtp->label;
}
}
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
@ -319,7 +319,7 @@ class pdf_standard extends ModelePDFStock
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
$curX = $this->posxdesc-1;
@ -372,13 +372,13 @@ class pdf_standard extends ModelePDFStock
}
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$productstatic->id=$objp->rowid;
$productstatic->ref = $objp->ref;
$productstatic->label = $objp->produit;
$productstatic->type=$objp->type;
$productstatic->entity=$objp->entity;
$productstatic->status_batch=$objp->tobatch;
$productstatic->status_batch=$objp->tobatch;
// Ref.
$pdf->SetXY($this->posxdesc, $curY);
@ -391,12 +391,12 @@ class pdf_standard extends ModelePDFStock
// Quantity
$valtoshow=price2num($objp->value, 'MS');
$towrite = (empty($valtoshow)?'0':$valtoshow);
$pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->posxup-$this->posxqty-0.8, 3, $towrite, 0, 'R');
$pdf->MultiCell($this->posxup-$this->posxqty-0.8, 3, $towrite, 0, 'R');
$totalunit+=$objp->value;
$pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxunit-$this->posxup-0.8, 3, price(price2num($objp->ppmp,'MU'), 0, $outputlangs), 0, 'R');
@ -429,7 +429,7 @@ class pdf_standard extends ModelePDFStock
}
$nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
@ -466,20 +466,20 @@ class pdf_standard extends ModelePDFStock
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
}
}
$db->free($resql);
/**
* footer table
*/
$nexY = $pdf->GetY();
$nexY+=2;
$curY = $nexY;
$pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26)));
$curY = $nexY;
$pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26)));
$pdf->line($this->marge_gauche, $curY-1, $this->page_largeur-$this->marge_droite, $curY-1);
$pdf->SetLineStyle(array('dash'=>0));
$pdf->SetFont('','B',$default_font_size-1);
$pdf->SetTextColor(0,0,120);
@ -487,7 +487,7 @@ class pdf_standard extends ModelePDFStock
$pdf->SetXY($this->posxdesc, $curY);
$pdf->MultiCell($this->wref, 3, $langs->trans("Total"), 0, 'L');
// Quantity
// Quantity
$valtoshow=price2num($totalunit, 'MS');
$towrite = empty($valtoshow)?'0':$valtoshow;
@ -736,8 +736,8 @@ class pdf_standard extends ModelePDFStock
}
}
*/
$tab_top = $tab_top_newpage+21;
$tab_top = $tab_top_newpage+21;
// Show square
if ($pagenb == 1)
{
@ -749,7 +749,7 @@ class pdf_standard extends ModelePDFStock
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
// Affiche zone infos
@ -836,21 +836,21 @@ class pdf_standard extends ModelePDFStock
// Output Rect
//$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
$pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26)));
$pdf->SetDrawColor(220,26,26);
$pdf->SetDrawColor(220,26,26);
$pdf->line($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite, $tab_top);
$pdf->SetLineStyle(array('dash'=>0));
$pdf->SetDrawColor(128,128,128);
$pdf->SetTextColor(0,0,120);
if (empty($hidetop))
{
//$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
$pdf->MultiCell($this->wref,3, $outputlangs->transnoentities("Ref"),'','L');
}
//$pdf->line($this->posxlabel-1, $tab_top, $this->posxlabel-1, $tab_top + $tab_height);
if (empty($hidetop))
{
@ -860,7 +860,7 @@ class pdf_standard extends ModelePDFStock
//$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
if (empty($hidetop))
{
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
$pdf->MultiCell($this->posxup-$this->posxqty-1,2, $outputlangs->transnoentities("Units"),'','C');
}
@ -873,7 +873,7 @@ class pdf_standard extends ModelePDFStock
}
//$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop))
if (empty($hidetop))
{
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("EstimatedStockValueShort"), '',
@ -887,18 +887,18 @@ class pdf_standard extends ModelePDFStock
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("SellPriceMin"),'','C');
}
//$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
//$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->postotalht-1, $tab_top+1);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht,2, $outputlangs->transnoentities("EstimatedStockValueSellShort"),'','C');
}
$pdf->SetDrawColor(220,26,26);
$pdf->SetDrawColor(220,26,26);
$pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26)));
$pdf->line($this->marge_gauche, $tab_top+11, $this->page_largeur-$this->marge_droite, $tab_top+11);
$pdf->line($this->marge_gauche, $tab_top+11, $this->page_largeur-$this->marge_droite, $tab_top+11);
$pdf->SetLineStyle(array('dash'=>0));
}
/**
@ -914,7 +914,7 @@ class pdf_standard extends ModelePDFStock
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="")
{
global $conf,$langs,$db,$hookmanager;
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders", "stocks"));
@ -961,7 +961,7 @@ class pdf_standard extends ModelePDFStock
$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);
@ -981,22 +981,22 @@ class pdf_standard extends ModelePDFStock
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("LocationSummary").' :', '', 'R');
$posy+=4;
$pdf->SetXY($posx-50,$posy);
$pdf->MultiCell(150, 3, $object->lieu, '', 'R');
// Parent entrepot
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ParentWarehouse").' :', '', 'R');
$posy+=4;
$pdf->SetXY($posx-50,$posy);
$e = new Entrepot($db);
if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0)
if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0)
{
$pdf->MultiCell(150, 3, $e->libelle, '', 'R');
}
@ -1004,14 +1004,14 @@ class pdf_standard extends ModelePDFStock
{
$pdf->MultiCell(150, 3, $outputlangs->transnoentities("None"), '', 'R');
}
// Description
$nexY = $pdf->GetY();
$nexY+=5;
$pdf->SetXY($posx,$posy);
$pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, '<b>'.$outputlangs->transnoentities("Description").' : </b>'.nl2br($object->description), 0, 1);
$nexY = $pdf->GetY();
$calcproductsunique=$object->nb_different_products();
$calcproducts=$object->nb_products();
@ -1023,12 +1023,12 @@ class pdf_standard extends ModelePDFStock
$valtoshow=price2num($calcproducts['nb'], 'MS');
$pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, '<b>'.$outputlangs->transnoentities("NumberOfProducts").' : </b>'.(empty($valtoshow)?'0':$valtoshow), 0, 1);
$nexY = $pdf->GetY();
// Value
$pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, '<b>'.$outputlangs->transnoentities("EstimatedStockValueShort").' : </b>'. price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency), 0, 1);
$nexY = $pdf->GetY();
// Last movement
$sql = "SELECT max(m.datem) as datem";
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
@ -1056,7 +1056,7 @@ class pdf_standard extends ModelePDFStock
$pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, '<b>'.$outputlangs->transnoentities("LastMovement").' : </b>'.$toWrite, 0, 1);
$nexY = $pdf->GetY();
/*if ($object->ref_client)
{
$posy+=5;
@ -1147,4 +1147,3 @@ class pdf_standard extends ModelePDFStock
}
}

View File

@ -40,75 +40,75 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
public $type;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Objet societe qui emet
*/
public $emetteur;
public $emetteur;
/**
@ -1249,4 +1249,3 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
}
}

View File

@ -42,17 +42,17 @@ class pdf_standard extends ModelePDFSuppliersPayments
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
@ -62,54 +62,54 @@ class pdf_standard extends ModelePDFSuppliersPayments
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
*/
public $version = 'dolibarr';
/**
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
public $marge_basse;
/**
* Issuer
* @var Societe
*/
public $emetteur;
public $emetteur;
/**
@ -120,7 +120,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
function __construct($db)
{
global $conf,$langs,$mysoc;
// Translations
$langs->loadLangs(array("main", "bills"));
@ -814,4 +814,3 @@ class pdf_standard extends ModelePDFSuppliersPayments
}
}

View File

@ -42,17 +42,17 @@ class pdf_aurore extends ModelePDFSupplierProposal
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
@ -62,8 +62,8 @@ class pdf_aurore extends ModelePDFSupplierProposal
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
@ -74,32 +74,32 @@ class pdf_aurore extends ModelePDFSupplierProposal
* @var int page_largeur
*/
public $page_largeur;
/**
* @var int page_hauteur
*/
public $page_hauteur;
/**
* @var array format
*/
public $format;
/**
* @var int marge_gauche
*/
public $marge_gauche;
/**
* @var int marge_droite
*/
public $marge_droite;
/**
* @var int marge_haute
*/
public $marge_haute;
/**
* @var int marge_basse
*/
@ -120,7 +120,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
public function __construct($db)
{
global $conf, $langs, $mysoc;
// Translations
$langs->loadLangs(array("main", "bills"));
@ -160,7 +160,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->posxdesc=$this->marge_gauche+1;
$this->posxdiscount=162;
$this->postotalht=174;
if ($conf->global->PRODUCT_USE_UNITS)
{
$this->posxtva=101;
@ -172,7 +172,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->posxup=126;
$this->posxqty=145;
}
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format
@ -211,7 +211,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
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';
// Translations
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal"));
@ -524,7 +524,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R');
}
// Unit
if($conf->global->PRODUCT_USE_UNITS)
{
@ -1232,7 +1232,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
}
if($conf->global->PRODUCT_USE_UNITS) {
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
@ -1274,7 +1274,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $conf,$langs;
// Translations
$outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies"));
@ -1496,4 +1496,3 @@ class pdf_aurore extends ModelePDFSupplierProposal
}
}

View File

@ -126,8 +126,8 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
if (is_object($langs)) // $langs may not be defined yet.
{
$errors[] = $langs->trans("ErrorFailedToOpenFile", self::$firephp_class_path);
}
else
}
else
{
$errors[] = "ErrorFailedToOpenFile " . self::$firephp_class_path;
}

View File

@ -93,7 +93,7 @@ class MultiCurrency extends CommonObject
public function __construct(DoliDB $db)
{
$this->db = &$db;
return 1;
}
@ -108,21 +108,21 @@ class MultiCurrency extends CommonObject
public function create(User $user, $trigger = true)
{
global $conf,$langs;
dol_syslog('Currency::create', LOG_DEBUG);
$error = 0;
if (self::checkCodeAlreadyExists($this->code))
{
$error++;
$this->errors[] = $langs->trans('multicurrency_code_already_added');
return -1;
}
if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity;
$now=date('Y-m-d H:i:s');
// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
$sql .= ' code,';
@ -152,7 +152,7 @@ class MultiCurrency extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
$this->date_create = $now;
$this->fk_user = $user->id;
if ($trigger) {
$result=$this->call_trigger('CURRENCY_CREATE', $user);
if ($result < 0) $error++;
@ -181,7 +181,7 @@ class MultiCurrency extends CommonObject
public function fetch($id, $code = null)
{
dol_syslog('Currency::fetch', LOG_DEBUG);
global $conf;
$sql = 'SELECT';
@ -192,7 +192,7 @@ class MultiCurrency extends CommonObject
dol_syslog(__METHOD__,LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$numrows = $this->db->num_rows($resql);
if ($numrows) {
@ -204,7 +204,7 @@ class MultiCurrency extends CommonObject
$this->entity = $obj->entity;
$this->date_create = $obj->date_create;
$this->fk_user = $obj->fk_user;
$this->fetchAllCurrencyRate();
$this->getRate();
}
@ -234,7 +234,7 @@ class MultiCurrency extends CommonObject
$sql.= ' FROM ' . MAIN_DB_PREFIX . $this->table_element_line. ' as cr';
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
$sql.= ' ORDER BY cr.date_sync DESC';
$this->rates = array();
dol_syslog(__METHOD__,LOG_DEBUG);
@ -245,7 +245,7 @@ class MultiCurrency extends CommonObject
while ($obj = $this->db->fetch_object($resql)) {
$rate = new CurrencyRate($this->db);
$rate->fetch($obj->rowid);
$this->rates[] = $rate;
}
$this->db->free($resql);
@ -272,19 +272,19 @@ class MultiCurrency extends CommonObject
$error = 0;
dol_syslog('Currency::update', LOG_DEBUG);
// Clean parameters
$this->name = trim($this->name);
$this->code = trim($this->code);
// Check parameters
if (empty($this->code)) {
$error++;
dol_syslog('Currency::update $this->code can not be empty', LOG_ERR);
return -1;
}
// Update request
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
$sql .= ' name=\''.$this->db->escape($this->name).'\'';
@ -328,7 +328,7 @@ class MultiCurrency extends CommonObject
public function delete($trigger = true)
{
global $user;
dol_syslog('Currency::delete', LOG_DEBUG);
$error = 0;
@ -347,7 +347,7 @@ class MultiCurrency extends CommonObject
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog('Currency::delete ' . join(',', $this->errors), LOG_ERR);
}
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
$sql .= ' WHERE rowid=' . $this->id;
@ -371,7 +371,7 @@ class MultiCurrency extends CommonObject
return 1;
}
}
/**
* Delete rates in database
*
@ -386,85 +386,85 @@ class MultiCurrency extends CommonObject
return false;
}
}
return true;
}
/**
* Delete rate in database
*
* Delete rate in database
*
* @param double $rate rate value
*
*
* @return int -1 if KO, 1 if OK
*/
public function addRate($rate)
{
$currencyRate = new CurrencyRate($this->db);
$currencyRate->rate = $rate;
if ($currencyRate->create($this->id) > 0)
if ($currencyRate->create($this->id) > 0)
{
$this->rate = $currencyRate;
return 1;
}
else
else
{
$this->rate = null;
return -1;
}
}
/**
* Try get label of code in llx_currency then add rate
*
*
* @param string $code currency code
* @param double $rate new rate
*
*
* @return int -1 if KO, 1 if OK, 2 if label found and OK
*/
function addRateFromDolibarr($code, $rate)
{
global $db, $user;
$currency = new MultiCurrency($db);
$currency->code = $code;
$currency->name = $code;
$sql = 'SELECT label FROM '.MAIN_DB_PREFIX.'c_currencies WHERE code_iso = \''.$db->escape($code).'\'';
dol_syslog(__METHOD__,LOG_DEBUG);
$resql = $db->query($sql);
if ($resql && ($line = $db->fetch_object($resql)))
{
$currency->name = $line->label;
}
if ($currency->create($user) > 0)
{
$currency->addRate($rate);
if (!empty($line)) return 2;
else return 1;
}
return -1;
return -1;
}
/**
* Add new entry into llx_multicurrency_rate to historise
*
*
* @param double $rate rate value
*
*
* @return int <0 if KO, >0 if OK
*/
public function updateRate($rate)
{
return $this->addRate($rate);
}
/**
* Fetch CurrencyRate object in $this->rate
*
* Fetch CurrencyRate object in $this->rate
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function getRate()
@ -473,50 +473,50 @@ class MultiCurrency extends CommonObject
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as cr';
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
$sql.= ' AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM '.MAIN_DB_PREFIX.$this->table_element_line.' AS cr2 WHERE cr2.fk_multicurrency = '.$this->id.')';
dol_syslog(__METHOD__,LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql && ($obj = $this->db->fetch_object($resql))) {
$this->rate = new CurrencyRate($this->db);
return $this->rate->fetch($obj->rowid);
}
}
/**
* Get id of currency from code
* Get id of currency from code
*
* @param DoliDB $db object db
* @param string $code code value search
*
*
* @return 0 if not found, >0 if OK
*/
public static function getIdFromCode(&$db, $code)
{
global $conf;
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE code = \''.$db->escape($code).'\' AND entity = '.$conf->entity;
dol_syslog(__METHOD__,LOG_DEBUG);
$resql = $db->query($sql);
if ($resql && $obj = $db->fetch_object($resql)) return $obj->rowid;
else return 0;
}
/**
* Get id and rate of currency from code
*
* Get id and rate of currency from code
*
* @param DoliDB $db object db
* @param string $code code value search
* @param date $date_document date from document (propal, order, invoice, ...)
*
*
* @return array [0] => id currency
* [1] => rate
*/
public static function getIdAndTxFromCode(&$db, $code, $date_document='')
{
global $conf;
$sql1 = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m';
$sql1.= ' LEFT JOIN '.MAIN_DB_PREFIX.'multicurrency_rate mc ON (m.rowid = mc.fk_multicurrency)';
$sql1.= ' WHERE m.code = \''.$db->escape($code).'\'';
@ -524,10 +524,10 @@ class MultiCurrency extends CommonObject
$sql2= '';
if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"';
$sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1';
dol_syslog(__METHOD__,LOG_DEBUG);
$resql = $db->query($sql1.$sql2.$sql3);
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate);
else
{
@ -536,67 +536,67 @@ class MultiCurrency extends CommonObject
$resql = $db->query($sql1.$sql3);
if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate);
}
return array(0, 1);
}
}
}
/**
* Get the conversion of amount with invoice rate
*
*
* @param int $fk_facture id of facture
* @param double $amount amount to convert
* @param string $way dolibarr mean the amount is in dolibarr currency
* @param string $table facture or facture_fourn
*
*
* @return double amount converted
*/
public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way='dolibarr', $table='facture')
{
global $db;
$multicurrency_tx = self::getInvoiceRate($fk_facture, $table);
if ($multicurrency_tx)
if ($multicurrency_tx)
{
if ($way == 'dolibarr') return $amount * $multicurrency_tx;
else return $amount / $multicurrency_tx;
}
else return $amount;
}
/**
* Get current invoite rate
*
*
* @param int $fk_facture id of facture
* @param string $table facture or facture_fourn
*/
public static function getInvoiceRate($fk_facture, $table='facture')
{
global $db;
$sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture;
dol_syslog(__METHOD__,LOG_DEBUG);
$resql = $db->query($sql);
if ($resql && ($line = $db->fetch_object($resql)))
{
return $line->multicurrency_tx;
}
return false;
}
/**
* With free account we can't set source then recalcul all rates to force another source
*
* @param stdClass $TRate Object containing all currencies rates
*
* @param stdClass $TRate Object containing all currencies rates
* @return -1 if KO, 0 if nothing, 1 if OK
*/
public static function recalculRates(&$TRate)
{
global $conf;
if (!empty($conf->global->MULTICURRENCY_ALTERNATE_SOURCE))
{
$alternate_source = 'USD'.$conf->global->MULTICURRENCY_ALTERNATE_SOURCE;
@ -607,25 +607,25 @@ class MultiCurrency extends CommonObject
{
$rate *= $coef;
}
return 1;
}
return -1; // Alternate souce not found
}
return 0; // Nothing to do
}
/**
* Sync rates from api
*
*
* @param array $response array of reponse from api to sync dolibarr rates
*/
public static function syncRates($response)
{
global $db,$conf;
$ch = curl_init('http://apilayer.net/api/live?access_key='.$key.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
@ -634,11 +634,11 @@ class MultiCurrency extends CommonObject
if ($response->success)
{
$TRate = $response->quotes;
$timestamp = $response->timestamp;
if (self::recalculRates($TRate) >= 0)
if (self::recalculRates($TRate) >= 0)
{
foreach ($TRate as $currency_code => $rate)
{
@ -648,11 +648,11 @@ class MultiCurrency extends CommonObject
{
$obj->updateRate($rate);
}
else
else
{
self::addRateFromDolibarr($code, $rate);
}
}
}
}
}
else
@ -660,17 +660,17 @@ class MultiCurrency extends CommonObject
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
}
}
/**
* Check in database if the current code already exists
*
*
* @param string $code current code to search
* @return boolean True if exists, false if not exists
*/
public static function checkCodeAlreadyExists($code)
{
global $db;
$currency = new MultiCurrency($db);
if ($currency->fetch('', $code) > 0) return true;
else return false;
@ -710,7 +710,7 @@ class CurrencyRate extends CommonObjectLine
* @var int Id of entity
*/
public $entity;
/**
* Constructor
*
@ -719,10 +719,10 @@ class CurrencyRate extends CommonObjectLine
public function __construct(DoliDB $db)
{
$this->db = &$db;
return 1;
}
/**
* Create object into database
*
@ -734,14 +734,14 @@ class CurrencyRate extends CommonObjectLine
public function create($fk_multicurrency, $trigger = true)
{
global $conf, $user;
dol_syslog('CurrencyRate::create', LOG_DEBUG);
$error = 0;
$this->rate = price2num($this->rate);
if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity;
$now=date('Y-m-d H:i:s');
// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
$sql .= ' rate,';
@ -769,7 +769,7 @@ class CurrencyRate extends CommonObjectLine
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
$this->fk_multicurrency = $fk_multicurrency;
$this->date_sync = $now;
if ($trigger) {
$result=$this->call_trigger('CURRENCYRATE_CREATE', $user);
if ($result < 0) $error++;
@ -829,7 +829,7 @@ class CurrencyRate extends CommonObjectLine
return - 1;
}
}
/**
* Update object into database
*
@ -840,13 +840,13 @@ class CurrencyRate extends CommonObjectLine
public function update($trigger = true)
{
global $user;
$error = 0;
dol_syslog('CurrencyRate::update', LOG_DEBUG);
$this->rate = price2num($this->rate);
// Update request
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
$sql .= ' rate='.$this->rate;
@ -878,7 +878,7 @@ class CurrencyRate extends CommonObjectLine
return 1;
}
}
/**
* Delete object in database
*
@ -889,7 +889,7 @@ class CurrencyRate extends CommonObjectLine
public function delete($trigger = true)
{
global $user;
dol_syslog('CurrencyRate::delete', LOG_DEBUG);
$error = 0;
@ -925,5 +925,5 @@ class CurrencyRate extends CommonObjectLine
return 1;
}
}
}

View File

@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Page to set how to autocalculate price for each level when option
* PRODUCT_MULTIPRICE is on.
*/
@ -190,14 +190,14 @@ $genPriceOptions = function($level) use ($price_options) {
<?php endfor ?>
</table>
<?php
<?php
dol_fiche_end();
print '<div style="text-align: center">
<input type="submit" value="'.$langs->trans('Save').'" class="button">
</div>';
print '</form>';
llxFooter();

View File

@ -340,7 +340,7 @@ class Products extends DolibarrApi
}
if ($result < 0) {
throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors));
throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors));
}
return $result;

View File

@ -1,51 +1,50 @@
<?php
require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$get = GETPOST('get');
$put = GETPOST('put');
require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$get = GETPOST('get');
$put = GETPOST('put');
switch ($put)
{
case 'qty':
if (empty($user->rights->stock->creer)) { echo -1; exit; }
$fk_det_inventory = GETPOST('fk_det_inventory');
$det = new Inventorydet($db);
if( $det->fetch( $fk_det_inventory))
{
$det->qty_view+=GETPOST('qty');
$res = $det->update($user);
echo $det->qty_view;
}
else
{
echo -2;
}
}
break;
case 'pmp':
if (empty($user->rights->stock->creer) || empty($user->rights->stock->changePMP)) { echo -1; exit; }
$fk_det_inventory = GETPOST('fk_det_inventory');
$det = new Inventorydet($db);
if( $det->fetch( $fk_det_inventory))
{
$det->new_pmp=price2num(GETPOST('pmp'));
$det->update($user);
echo $det->new_pmp;
}
else
{
echo -2;
}
}
break;
}

View File

@ -166,7 +166,7 @@ class Productlot extends CommonObject
$error++;
}
}
if (! $error && ! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
@ -234,7 +234,7 @@ class Productlot extends CommonObject
//$this->ref = $obj->fk_product.'_'.$obj->batch;
$this->batch = $obj->batch;
$this->entity = (!empty($obj->entity)?$obj->entity:$conf->entity); // Prevent "null" entity
$this->entity = (!empty($obj->entity)?$obj->entity:$conf->entity); // Prevent "null" entity
$this->fk_product = $obj->fk_product;
$this->eatby = $this->db->jdate($obj->eatby);
$this->sellby = $this->db->jdate($obj->sellby);
@ -300,7 +300,7 @@ class Productlot extends CommonObject
// Check parameters
// Put here code to add a control on parameters values
if (empty($this->oldcopy))
{
$org=new self($this->db);
@ -340,7 +340,7 @@ class Productlot extends CommonObject
$error++;
}
}
if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -582,4 +582,3 @@ class Productlot extends CommonObject
}
}

View File

@ -1030,7 +1030,7 @@ if ($resql)
print '<td>'.'<a href="'
.DOL_URL_ROOT.'/product/stock/mouvement.php'
.'?id='.$objp->entrepot_id
.'&amp;search_inventorycode='.$objp->inventorycode
.'&amp;search_inventorycode='.$objp->inventorycode
.'&amp;search_type_mouvement='.$objp->type_mouvement
.'">'
.$objp->inventorycode
@ -1176,4 +1176,3 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0)
llxFooter();
$db->close();

View File

@ -83,7 +83,7 @@ if ($id > 0 || ! empty($ref))
}
if(empty($id) && !empty($object->id)) $id = $object->id;
if(empty($id) && !empty($object->id)) $id = $object->id;
$modulepart='product';
@ -989,8 +989,8 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
print "</table>";
if (!empty($user->rights->produit->creer)){
print '</form>';
if (!empty($user->rights->produit->creer)){
print '</form>';
}
}

View File

@ -118,14 +118,14 @@ if (! $rowid) {
$txn = \Stripe\BalanceTransaction::all(array("limit" => $limit));
}
foreach ($txn->data as $txn)
foreach ($txn->data as $txn)
{
//$charge = $txn;
//var_dump($txn);
// The metadata FULLTAG is defined by the online payment page
/*$FULLTAG=$charge->metadata->FULLTAG;
// Save into $tmparray all metadata
$tmparray = dolExplodeIntoArray($FULLTAG,'.','=');
// Load origin object according to metadata
@ -145,7 +145,7 @@ if (! $rowid) {
{
$memberstatic->id = 0;
}*/
$societestatic->fetch($charge->metadata->idcustomer);
$societestatic->id = $charge->metadata->idcustomer;
$societestatic->lastname = $obj->lastname;
@ -156,7 +156,7 @@ if (! $rowid) {
$societestatic->societe_id = $obj->fk_soc;
print '<TR class="oddeven">';
// Ref
print "<TD><A href='" . DOL_URL_ROOT . "/stripe/transaction.php?rowid=" . $txn->source . "'>" . $txn->source . "</A></TD>\n";
// Stripe customer

View File

@ -18,7 +18,7 @@ CKEDITOR.editorConfig = function( config )
//config.extraPlugins = 'docprops,scayt,showprotected';
config.removeDialogTabs = 'flash:advanced'; // config.removeDialogTabs = 'flash:advanced;image:Link';
config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // Prevent PHP Code to be formatted
//config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea'
//config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea'
//config.language = 'de';
//config.defaultLanguage = 'en';
//config.contentsLanguage = 'fr';
@ -29,7 +29,7 @@ CKEDITOR.editorConfig = function( config )
//config.autoParagraph = false;
//config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules
//config.forcePasteAsPlainText = true;
config.toolbar_Full =
[
['Templates','NewPage'],
@ -51,7 +51,7 @@ CKEDITOR.editorConfig = function( config )
];
// Used for mailing fields
config.toolbar_dolibarr_mailings =
config.toolbar_dolibarr_mailings =
[
['Maximize','Preview'],
['SpellChecker', 'Scayt'],
@ -64,7 +64,7 @@ CKEDITOR.editorConfig = function( config )
['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'],
['Source']
];
// Used for notes fields
config.toolbar_dolibarr_notes =
[
@ -78,7 +78,7 @@ CKEDITOR.editorConfig = function( config )
['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'],
['Source']
];
// Used for details lines
config.toolbar_dolibarr_details =
[
@ -91,12 +91,12 @@ CKEDITOR.editorConfig = function( config )
['Link','Unlink','SpecialChar'],
['Source']
];
// Used for mailing fields
config.toolbar_dolibarr_readonly =
[
['Maximize'],
['Find'],
['Source']
];
];
};

View File

@ -18,7 +18,7 @@ CKEDITOR.editorConfig = function( config )
//config.extraPlugins = 'docprops,scayt,showprotected';
config.removeDialogTabs = 'flash:advanced'; // config.removeDialogTabs = 'flash:advanced;image:Link';
config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // Prevent PHP Code to be formatted
//config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea'
//config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea'
//config.language = 'de';
//config.defaultLanguage = 'en';
//config.contentsLanguage = 'fr';
@ -29,7 +29,7 @@ CKEDITOR.editorConfig = function( config )
//config.autoParagraph = false;
//config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules
//config.forcePasteAsPlainText = true;
config.toolbar_Full =
[
['Templates','NewPage'],
@ -51,7 +51,7 @@ CKEDITOR.editorConfig = function( config )
];
// Used for mailing fields
config.toolbar_dolibarr_mailings =
config.toolbar_dolibarr_mailings =
[
['Maximize','Preview'],
['SpellChecker', 'Scayt'],
@ -64,7 +64,7 @@ CKEDITOR.editorConfig = function( config )
['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'],
['Source']
];
// Used for notes fields
config.toolbar_dolibarr_notes =
[
@ -78,7 +78,7 @@ CKEDITOR.editorConfig = function( config )
['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'],
['Source']
];
// Used for details lines
config.toolbar_dolibarr_details =
[
@ -91,12 +91,12 @@ CKEDITOR.editorConfig = function( config )
['Link','Unlink','SpecialChar'],
['Source']
];
// Used for mailing fields
config.toolbar_dolibarr_readonly =
[
['Maximize'],
['Find'],
['Source']
];
];
};

View File

@ -117,7 +117,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
/**
* testUserGroupCreate
*
*
* @return void
*/
public function testUserGroupCreate()
@ -139,7 +139,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
/**
* testUserGroupFetch
*
*
* @param int $id Id of group
* @return void
* @depends testUserGroupCreate
@ -163,7 +163,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
/**
* testUserGroupUpdate
*
*
* @param Object $localobject Group
* @return void
* @depends testUserGroupFetch
@ -187,7 +187,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
/**
* testUserGroupAddRight
*
*
* @param Object $localobject Object to show
* @return void
* @depends testUserGroupUpdate
@ -210,7 +210,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
/**
* testUserGroupDelRight
*
*
* @param Object $localobject Object
* @return void
* @depends testUserGroupAddRight
@ -233,7 +233,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
/**
* testUserGroupOther
*
*
* @param Object $localobject Object
* @return void
* @depends testUserGroupDelRight
@ -261,7 +261,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
/**
* testUserGroupDelete
*
*
* @param int $id Id of object
* @return void
* @depends testUserGroupOther