diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 7d86c04869c..dc7266603ca 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -202,7 +202,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
+ print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
// Filter on categories
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index c623069cd85..8bd5407ef03 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -281,7 +281,7 @@ if ($result)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
//sort($fieldstosearchall);
- print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
+ print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
$i = 0;
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 2a1163111ed..ebe4c9c337d 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -287,7 +287,7 @@ if ($result)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
+ print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
if ($search_firstlast_only)
{
diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php
index 431ac89a94e..6dfd1122eac 100644
--- a/htdocs/core/actions_printing.inc.php
+++ b/htdocs/core/actions_printing.inc.php
@@ -46,7 +46,12 @@ if ($action == 'print_file' and $user->rights->printing->read)
if (! empty($conf->global->{$printer->active})) {
$subdir=(GETPOST('printer', 'alpha')=='expedition'?'sending':'');
- $errorprint = $printer->print_file(GETPOST('file', 'alpha'), GETPOST('printer', 'alpha'), $subdir);
+ $module = GETPOST('printer', 'alpha');
+ if ($module =='commande_fournisseur') {
+ $module = 'fournisseur';
+ $subdir = 'commande';
+ }
+ $errorprint = $printer->print_file(GETPOST('file', 'alpha'), $module, $subdir);
//if ($errorprint < 0) {
// setEventMessage($interface->errors, 'errors');
//}
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 230ffa99504..59a7c183d76 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -285,7 +285,7 @@ class FormFile
}
$printer=0;
- if (in_array($modulepart,array('facture','askpricesupplier','propal','proposal','order','commande','expedition'))) // The direct print feature is implemented only for such elements
+ if (in_array($modulepart,array('facture','askpricesupplier','propal','proposal','order','commande','expedition', 'commande_fournisseur'))) // The direct print feature is implemented only for such elements
{
$printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false;
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 5b990ac509c..fcadfb9e521 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -179,6 +179,7 @@ function getBrowserInfo($user_agent)
// OS
if (preg_match('/linux/i', $user_agent)) { $os='linux'; }
+ elseif (preg_match('/macintosh/i', $user_agent)) { $os='macintosh'; }
// Name
if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; }
@@ -703,7 +704,7 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0)
{
global $conf,$langs, $hookmanager;
-
+
$out="\n".'
'."\n";
// Show title
@@ -733,7 +734,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
$displaytab=0;
$nbintab=0;
$popuptab=0;
-
+
for ($i = 0 ; $i <= $maxkey ; $i++)
{
if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2]))
@@ -777,7 +778,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
else
{
// The popup with the other tabs
- if (! $popuptab)
+ if (! $popuptab)
{
$popuptab=1;
$outmore.='';
-
+
$nbintab++;
}
$displaytab=$i;
}
if ($popuptab) $outmore.='
';
-
+
if ($displaytab > $limittoshow)
{
$tabsname=str_replace("@", "", $picto);
@@ -817,7 +818,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
}
$out.="\n";
-
+
if (! $notab) $out.="\n".''."\n";
$parameters=array('tabname' => $active);
@@ -900,7 +901,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
print '
';
print '';
}
-
+
/**
* Show a string with the label tag dedicated to the HTML edit field.
*
@@ -1382,7 +1383,7 @@ function dol_print_size($size,$shortvalue=0,$shortunit=0)
function dol_print_url($url,$target='_blank',$max=32,$withpicto=0)
{
global $langs;
-
+
if (empty($url)) return '';
$link='';
}
-
+
$out.=$sortimg;
-
+
$out.=''.$tag.'>';
return $out;
@@ -2958,7 +2959,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
if ($cpt > 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...';
else if ($cpt == 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">2';
}
-
+
do
{
if ($cpt==$page)
@@ -2972,7 +2973,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
$cpt++;
}
while ($cpt < $nbpages && $cpt<=$page+$maxnbofpage);
-
+
if ($cpt<$nbpages)
{
if ($cpt<$nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...';
@@ -4402,7 +4403,7 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1)
}
else if ($nameorder == 2)
{
- $ret.=$firstname;
+ $ret.=$firstname;
}
else
{
@@ -5225,7 +5226,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
/**
* Return the filename of file to get the thumbs
- *
+ *
* @param string $file Original filename
* @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini')
* @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image.
@@ -5235,10 +5236,10 @@ function getImageFileNameForSize($file, $extName, $extImgTarget='')
{
$dirName = dirname($file);
if ($dirName == '.') $dirName='';
-
+
$fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse
$fileName = basename($fileName);
-
+
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':'');
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':'');
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':'');
@@ -5246,9 +5247,9 @@ function getImageFileNameForSize($file, $extName, $extImgTarget='')
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':'');
if (! $extImgTarget) return $file;
-
+
$subdir='';
if ($extName) $subdir = 'thumbs/';
-
+
return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb
}
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index cf580459a9c..d7344787623 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -121,26 +121,38 @@ class ProductFournisseur extends Product
*/
function remove_product_fournisseur_price($rowid)
{
- global $conf;
+ global $conf, $user;
$this->db->begin();
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
- $sql.= " WHERE rowid = ".$rowid;
+ // Call trigger
+ $result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_DELETE',$user);
+ if ($result < 0) $error++;
+ // End call triggers
- dol_syslog(get_class($this)."::remove_product_fournisseur_price", LOG_DEBUG);
- $resql = $this->db->query($sql);
- if ($resql)
+ if (empty($error))
{
+
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
+ $sql.= " WHERE rowid = ".$rowid;
+
+ dol_syslog(get_class($this)."::remove_product_fournisseur_price", LOG_DEBUG);
+ $resql = $this->db->query($sql);
+ if (!$resql)
+ {
+ $this->error=$this->db->lasterror();
+ $error++;
+ }
+ }
+
+ if (empty($error)){
$this->db->commit();
return 1;
- }
- else
- {
- $this->error=$this->db->lasterror();
+ }else{
$this->db->rollback();
return -1;
}
+
}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 37809f6bf87..cb1754fa8d3 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -872,6 +872,8 @@ if (empty($reshook))
}
}
+ include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
+
/*
* Create an order
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 72f8ed2b0b2..526b67b123c 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -95,9 +95,14 @@ if (empty($reshook))
{
if ($rowid)
{
- $result=$object->remove_product_fournisseur_price($rowid);
$action = '';
- setEventMessage($langs->trans("PriceRemoved"));
+ $result=$product->remove_product_fournisseur_price($rowid);
+ if($result > 0){
+ setEventMessage($langs->trans("PriceRemoved"));
+ }else{
+ $error++;
+ setEventMessages($product->error, $product->errors, 'errors');
+ }
}
}
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index dc9dcb7ed58..4e84508fbd6 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -333,7 +333,7 @@ else
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
+ print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
// Filter on categories
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 17aa5cac222..7481a6bf05c 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -259,7 +259,7 @@ if ($resql)
if ($search_all)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $search_all, join(', ',$fieldstosearchall));
+ print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
}
$colspan=8;
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 6c554aa5137..c8c25acdd24 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -445,7 +445,7 @@ if ($resql)
if ($search_all)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
- print $langs->trans("FilterOnInto", $search_all, join(', ',$fieldstosearchall));
+ print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
}
// Filter on categories