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

This commit is contained in:
Laurent Destailleur
2018-06-22 22:54:11 +02:00
21 changed files with 64 additions and 52 deletions

View File

@@ -319,7 +319,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6+$height_incoterms;
$tab_top = $nexY+6;
}
}
@@ -353,7 +353,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_top = $nexY+6+$height_note;
$tab_top = $nexY+6;
}
$iniY = $tab_top + 7;

View File

@@ -228,7 +228,7 @@ class pdf_strato extends ModelePDFContract
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_top = $nexY+6+$height_note;
$tab_top = $nexY+6;
}
$iniY = $tab_top + 7;

View File

@@ -384,7 +384,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6+$height_incoterms;
$tab_top = $nexY+6;
}
}
@@ -418,7 +418,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_top = $nexY+6+$height_note;
$tab_top = $nexY+6;
}
$iniY = $tab_top + 7;

View File

@@ -357,7 +357,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6+$height_incoterms;
$tab_top = $nexY+6;
}
}
@@ -399,7 +399,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_top = $nexY+6+$height_note;
$tab_top = $nexY+6;
}
$iniY = $tab_top + 7;

View File

@@ -285,7 +285,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6+$height_incoterms;
$tab_top = $nexY+6;
}
}
@@ -303,7 +303,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_top = $nexY+6+$height_note;
$tab_top = $nexY+6;
}
$iniY = $tab_top + 7;

View File

@@ -335,7 +335,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
$tab_top = $nexY+6+$height_incoterms;
$tab_top = $nexY+6;
}
}

View File

@@ -388,7 +388,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_top = $nexY+6+$height_note;
$tab_top = $nexY+6;
}
$iniY = $tab_top + 7;

View File

@@ -503,12 +503,16 @@ if (empty($reshook))
}
// Action update
else if ($action == 'settracking_number' || $action == 'settracking_url'
|| $action == 'settrueWeight'
|| $action == 'settrueWidth'
|| $action == 'settrueHeight'
|| $action == 'settrueDepth'
|| $action == 'setshipping_method_id')
else if (
($action == 'settracking_number'
|| $action == 'settracking_url'
|| $action == 'settrueWeight'
|| $action == 'settrueWidth'
|| $action == 'settrueHeight'
|| $action == 'settrueDepth'
|| $action == 'setshipping_method_id')
&& $user->rights->expedition->creer
)
{
$error=0;

View File

@@ -234,8 +234,6 @@ else
$idrss = $reg[0];
//print "x".join(',',$reg)."=".$obj->name."=".$idrss;
$var=true;
print "<form name=\"externalrssconfig\" action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="numero_entry" value="'.$idrss.'">';

View File

@@ -509,7 +509,6 @@ else
}
$nboflines=count($contents);
$var=true;
$rawlisthasfailed=false;
$i=0;
while ($i < $nboflines && $i < 1000)
@@ -553,7 +552,7 @@ else
}
print '<tr '.$bc[$var].' height="18">';
print '<tr class="oddeven" height="18">';
// Name
print '<td>';
$newsection=$section.(preg_match('@[\\\/]$@',$section)?'':'/').$file;

View File

@@ -98,8 +98,6 @@ if ($result)
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"e.status","","",'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$var=true;
if ($num > 0)
{
$establishmentstatic=new Establishment($db);

View File

@@ -71,7 +71,6 @@ class Import
dol_syslog(get_class($this)."::load_arrays user=".$user->id." filter=".$filter);
$var=true;
$i=0;
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@@ -440,7 +440,6 @@ if ($step == 2 && $datatoimport)
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
$filetoimport='';
$var=true;
// Add format informations and link to download example
print '<tr class="liste_titre"><td colspan="6">';
@@ -556,14 +555,12 @@ if ($step == 3 && $datatoimport)
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
$filetoimport='';
$var=true;
print '<tr><td colspan="6">'.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'</td></tr>';
//print '<tr class="liste_titre"><td colspan="6">'.$langs->trans("FileWithDataToImport").'</td></tr>';
// Input file name box
$var=false;
print '<tr class="oddeven"><td colspan="6">';
print '<input type="file" name="userfile" size="20" maxlength="80"> &nbsp; &nbsp; ';
$out = (empty($conf->global->MAIN_UPLOAD_DOC)?' disabled':'');
@@ -907,13 +904,12 @@ if ($step == 4 && $datatoimport)
// List of targets fields
$height=24;
$i = 0;
$var=true;
$mandatoryfieldshavesource=true;
print '<table width="100%" class="nobordernopadding">';
foreach($fieldstarget as $code=>$label)
{
print '<tr '.$bc[$var].' height="'.$height.'">';
print '<tr class="oddeven" height="'.$height.'">';
$i++;
$entity=(! empty($objimport->array_import_entities[0][$code])?$objimport->array_import_entities[0][$code]:$objimport->array_import_icon[0]);
@@ -1128,7 +1124,7 @@ if ($step == 4 && $datatoimport)
print '<td>'.$langs->trans("ImportModelName").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
$var=false;
print '<tr class="oddeven">';
print '<td><input name="import_name" size="48" value=""></td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("SaveImportProfile").'">';
@@ -1144,7 +1140,6 @@ if ($step == 4 && $datatoimport)
{
$num = $db->num_rows($resql);
$i = 0;
$var=false;
while ($i < $num)
{

View File

@@ -60,13 +60,12 @@ print '<td>'.$langs->trans("Module").'</td>';
print '<td>'.$langs->trans("ImportableDatas").'</td>';
//print '<td>&nbsp;</td>';
print '</tr>';
$val=true;
if (count($import->array_import_code))
{
foreach ($import->array_import_code as $key => $value)
{
$val=!$val;
print '<tr '.$bc[$val].'><td>';
print '<tr class="oddeven"><td>';
print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' ';
print $import->array_import_module[$key]->getName();
print '</td><td>';
@@ -108,7 +107,6 @@ print '<br>';
// List of available import format
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
@@ -122,7 +120,6 @@ $liste=$model->liste_modeles($db);
foreach($liste as $key)
{
print '<tr class="oddeven">';
print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'</td>';
$text=$model->getDriverDescForKey($key);

View File

@@ -97,7 +97,8 @@ delete from llx_usergroup_rights where fk_id not in (select id from llx_rights_d
ALTER TABLE llx_inventory ADD COLUMN fk_product integer DEFAULT NULL;
ALTER TABLE llx_inventory MODIFY COLUMN fk_warehouse integer DEFAULT NULL;
ALTER TABLE llx_c_type_fees ADD COLUMN llx_c_type_fees integer DEFAULT 0;
ALTER TABLE llx_c_type_fees DROP COLUMN llx_c_type_fees;
ALTER TABLE llx_c_type_fees ADD COLUMN type integer DEFAULT 0;
ALTER TABLE llx_product_fournisseur_price DROP COLUMN unitcharges;

View File

@@ -1033,7 +1033,8 @@ else
if ($type == 1)
{
print '<tr><td>' . $langs->trans("Duration") . '</td><td colspan="3"><input name="duration_value" size="6" maxlength="5" value="' . $duration_value . '"> &nbsp;';
print '<input name="duration_unit" type="radio" value="h">'.$langs->trans("Hour").'&nbsp;';
print '<input name="duration_unit" type="radio" value="i">'.$langs->trans("Minute").'&nbsp;';
print '<input name="duration_unit" type="radio" value="h">'.$langs->trans("Hour").'&nbsp;';
print '<input name="duration_unit" type="radio" value="d">'.$langs->trans("Day").'&nbsp;';
print '<input name="duration_unit" type="radio" value="w">'.$langs->trans("Week").'&nbsp;';
print '<input name="duration_unit" type="radio" value="m">'.$langs->trans("Month").'&nbsp;';
@@ -1401,6 +1402,8 @@ else
// Duration
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3"><input name="duration_value" size="3" maxlength="5" value="'.$object->duration_value.'">';
print '&nbsp; ';
print '<input name="duration_unit" type="radio" value="i"'.($object->duration_unit=='i'?' checked':'').'>'.$langs->trans("Minute");
print '&nbsp; ';
print '<input name="duration_unit" type="radio" value="h"'.($object->duration_unit=='h'?' checked':'').'>'.$langs->trans("Hour");
print '&nbsp; ';
print '<input name="duration_unit" type="radio" value="d"'.($object->duration_unit=='d'?' checked':'').'>'.$langs->trans("Day");
@@ -1807,11 +1810,11 @@ else
print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.'&nbsp;';
if ($object->duration_value > 1)
{
$dur=array("h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
$dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
}
else if ($object->duration_value > 0)
{
$dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
$dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
}
print (! empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')."&nbsp;";

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@@ -342,6 +342,7 @@ if ($id > 0 || ! empty($ref))
$class='pair';
$totalsell=0;
if (count($prods_arbo))
{
foreach($prods_arbo as $value)
@@ -369,11 +370,16 @@ if ($id > 0 || ! empty($ref))
}
print '</td>';
$totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) - $product_fourn->fourn_remise), 'MT');
// For avoid a non-numeric value
$fourn_unitprice = (!empty($product_fourn->fourn_unitprice)?$product_fourn->fourn_unitprice:0);
$fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0);
$fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0);
$totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT');
$total+=$totalline;
print '<td align="right">';
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency));
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice,'','',0,0,-1,$conf->currency));
print '</td>';
// Best selling price
@@ -382,10 +388,15 @@ if ($id > 0 || ! empty($ref))
{
$pricesell='Variable';
}
$totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
$totalsell+=$totallinesell;
else
{
$totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
$totalsell+=$totallinesell;
}
print '<td align="right" colspan="2">';
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($pricesell,'','',0,0,-1,$conf->currency));
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '');
if (is_numeric($pricesell)) print price($pricesell,'','',0,0,-1,$conf->currency));
else print $langs->trans($pricesell);
print '</td>';
// Stock

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
@@ -57,6 +57,7 @@ $page = GETPOST("page",'int');
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page ;
// Load sale and categ filters

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
@@ -61,6 +61,7 @@ $page = GETPOST("page",'int');
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page ;
// Load sale and categ filters

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2014 Henry Florian <florian.henry@open-concept.pro>
@@ -205,7 +205,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_value
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, shownav, 'ref', '', '', '', 0, '', '', 1);
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', '', '', '', 0, '', '', 1);
dol_fiche_end();

View File

@@ -186,8 +186,13 @@ if ($result >= 0)
foreach($ldapgroup[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] as $key => $userdn) {
if($key === 'count') continue;
if(empty($userList[$userdn])) { // Récupération de l'utilisateur
$userFilter = explode(',', $userdn);
$userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS);
// Schéma rfc2307: les membres sont listés dans l'attribut memberUid sous form de login uniquement
if ($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS === 'memberUid'){
$userKey = array($userdn);
} else { // Pour les autres schémas, les membres sont listés sous forme de DN complets
$userFilter = explode(',', $userdn);
$userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS);
}
if(!is_array($userKey)) continue;
$fuser = new User($db);