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

Conflicts:
	htdocs/core/modules/barcode/modules_barcode.class.php
	htdocs/product/admin/product.php
This commit is contained in:
Laurent Destailleur 2016-08-05 00:42:40 +02:00
commit 782ab6a02b
5 changed files with 37 additions and 24 deletions

View File

@ -3144,7 +3144,7 @@ class Commande extends CommonOrder
*/
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
{
global $conf, $langs;
global $conf, $langs, $user;
$result='';
@ -3154,17 +3154,29 @@ class Commande extends CommonOrder
if ($short) return $url;
$picto = 'order';
$label = '<u>' . $langs->trans("ShowOrder") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->ref_client))
$label.= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client;
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
$label = '';
if ($user->rights->commande->lire) {
$label = '<u>'.$langs->trans("ShowOrder").'</u>';
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
}
if (!empty($this->ref_client)) {
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
}
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1,
$conf->currency);
}
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1,
$conf->currency);
}
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1,
$conf->currency);
}
}
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';

View File

@ -141,7 +141,7 @@ if ($prev_id)
print price($row[0]);
print '</td><td align="right">';
print round($row[0]/$bon->amount*100,2)." %";
if ($bon->amount) print round($row[0]/$bon->amount*100,2)." %";
print '</td>';
print "</tr>\n";

View File

@ -109,7 +109,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
*/
function getExample($langs,$objproduct=0)
{
$examplebarcode = $this->getNextValue($objproduct,0);
$examplebarcode = $this->getNextValue($objproduct,'');
if (! $examplebarcode)
{
$examplebarcode = $langs->trans('NotConfigured');
@ -127,7 +127,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* Return next value
*
* @param Product $objproduct Object product
* @param string $type type of barcode (EAN, ISBN, ...)
* @param string $type Type of barcode (EAN, ISBN, ...)
* @return string Value if OK, '' if module not configured, <0 if KO
*/
function getNextValue($objproduct=null,$type='')
@ -278,7 +278,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
}
dol_syslog(get_class($this).'::verif_syntax codefortest='.$codefortest." typefortest=".$typefortest);
$newcodefortest=$codefortest;
// Special case, if mask is on 12 digits instead of 13, we remove last char into code to test
@ -290,7 +290,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
dol_syslog(get_class($this).'::verif_syntax newcodefortest='.$newcodefortest);
}
}
$result=check_value($mask,$newcodefortest);
return $result;

View File

@ -87,11 +87,11 @@ abstract class ModeleNumRefBarCode
/**
* Return next value available
*
* @param Societe $objsoc Object thirdparty
* @param int $type Type
* @param Product $objproduct Object Product
* @param string $type Type of barcode (EAN, ISBN, ...)
* @return string Value
*/
function getNextValue($objsoc=null,$type=-1)
function getNextValue($objproduct,$type='')
{
global $langs;
return $langs->trans("Function_getNextValue_InModuleNotWorking");
@ -165,7 +165,7 @@ abstract class ModeleNumRefBarCode
$s.=$langs->trans("AutomaticCode").': '.yn($this->code_auto,1,2).'<br>';
$s.='<br>';
$nextval=$this->getNextValue($soc,0);
$nextval=$this->getNextValue($soc,'');
if (empty($nextval)) $nextval=$langs->trans("Undefined");
$s.=$langs->trans("NextValue").': <b>'.$nextval.'</b><br>';

View File

@ -5,9 +5,10 @@
* Copyright (C) 2007 Auguria SARL <info@auguria.org>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -114,7 +115,7 @@ if ($action == 'setModuleOptions')
}
}
if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') > 0)
if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') >= 0)
{
$res = dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", GETPOST('value_PRODUIT_LIMIT_SIZE'),'chaine',0,'',$conf->entity);
}