\n";
-
+
dol_fiche_end();
//if ($object->statut == 0) // only if draft
// print '
';
-
+
print '';
-
+
/*
* Boutons actions
@@ -706,7 +706,7 @@ else
{
print '
';
- if ($object->statut == 0 && $num_prod > 0)
+ if ($object->statut == 0 && $num_prod > 0)
{
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison_advance->validate)))
diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php
index 56ffa78f429..837b0af77f5 100644
--- a/htdocs/livraison/class/livraison.class.php
+++ b/htdocs/livraison/class/livraison.class.php
@@ -295,13 +295,13 @@ class Livraison extends CommonObject
//Incoterms
$this->fk_incoterms = $obj->fk_incoterms;
- $this->location_incoterms = $obj->location_incoterms;
+ $this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms;
$this->db->free($result);
if ($this->statut == 0) $this->brouillon = 1;
-
-
+
+
// Retrieve all extrafields for delivery
// fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@@ -524,7 +524,7 @@ class Livraison extends CommonObject
$this->fk_delivery_address = $expedition->fk_delivery_address;
$this->socid = $expedition->socid;
$this->ref_customer = $expedition->ref_customer;
-
+
//Incoterms
$this->fk_incoterms = $expedition->fk_incoterms;
$this->location_incoterms = $expedition->location_incoterms;
@@ -543,26 +543,26 @@ class Livraison extends CommonObject
{
global $conf;
$error = 0;
-
+
if ($id > 0 && !$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options)>0) // For avoid conflicts if trigger used
{
$livraisonline = new LivraisonLigne($this->db);
$livraisonline->array_options=$array_options;
$livraisonline->id=$id;
$result=$livraisonline->insertExtraFields();
-
+
if ($result < 0)
{
$this->error[]=$livraisonline->error;
$error++;
}
}
-
+
if (! $error) return 1;
else return -1;
}
-
-
+
+
/**
* Add line
*
@@ -696,26 +696,36 @@ class Livraison extends CommonObject
/**
* Return clicable name (with picto eventually)
*
- * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
- * @return string Chaine avec URL
+ * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string Chaine avec URL
*/
- function getNomUrl($withpicto=0)
+ function getNomUrl($withpicto=0, $save_lastsearch_value=-1)
{
global $langs;
$result='';
- $urlOption='';
- $label=$langs->trans("ShowReceiving").': '.$this->ref;
-
-
- $link = '
';
- $linkend='';
-
$picto='sending';
- if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
+ $label=$langs->trans("ShowReceiving").': '.$this->ref;
+
+ $url=DOL_URL_ROOT.'/livraison/card.php?id='.$this->id;
+
+ //if ($option !== 'nolink')
+ //{
+ // Add param to save lastsearch_values or not
+ $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
+ if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
+ if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
+ //}
+
+
+ $linkstart = '
';
+ $linkend='';
+
+ if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
- $result.=$link.$this->ref.$linkend;
+ $result.=$linkstart.$this->ref.$linkend;
return $result;
}
@@ -1052,7 +1062,7 @@ class Livraison extends CommonObject
class LivraisonLigne extends CommonObjectLine
{
var $db;
-
+
// From llx_expeditiondet
var $qty;
var $qty_asked;
@@ -1075,7 +1085,7 @@ class LivraisonLigne extends CommonObjectLine
public $product_ref;
public $product_label;
-
+
public $element='livraisondet';
public $table_element='livraisondet';
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index 9175736d5db..605a4272081 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -95,7 +95,7 @@ if ($id > 0 || ! empty($ref))
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'margin', $titre, -1, $picto);
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index bc8928bdc6e..5753760df66 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -91,7 +91,7 @@ if ($socid > 0)
dol_fiche_head($head, 'margin', $langs->trans("ThirdParty"), -1, 'company');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index e91a9751b60..ef4dff5ed49 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -268,7 +268,7 @@ class MyObject extends CommonObject
* Return a link to the object card (with optionaly the picto)
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
- * @param string $option On what the link point to
+ * @param string $option On what the link point to ('nolink', ...)
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
@@ -289,11 +289,10 @@ class MyObject extends CommonObject
$label.= '
';
$label.= '
' . $langs->trans('Ref') . ': ' . $this->ref;
- $url='';
+ $url = dol_buildpath('/mymodule/myobject_card.php',1).'?id='.$this->id;
+
if ($option != 'nolink')
{
- $url = dol_buildpath('/mymodule/myobject_card.php',1).'?id='.$this->id;
-
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index f5e6c906e7d..cdf903639c5 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1488,7 +1488,7 @@ else
dol_fiche_head($head, 'card', $titre, -1, $picto);
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 0dd16fd99dc..d2c52ec4255 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -3416,12 +3416,13 @@ class Product extends CommonObject
/**
* Return clicable link of object (with eventually picto)
*
- * @param int $withpicto Add picto into link
- * @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '')
- * @param int $maxlength Maxlength of ref
- * @return string String with URL
+ * @param int $withpicto Add picto into link
+ * @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '')
+ * @param int $maxlength Maxlength of ref
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string String with URL
*/
- function getNomUrl($withpicto=0,$option='',$maxlength=0)
+ function getNomUrl($withpicto=0, $option='', $maxlength=0, $save_lastsearch_value=-1)
{
global $conf, $langs, $hookmanager;
include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
@@ -3458,7 +3459,6 @@ class Product extends CommonObject
if ($this->nbphoto > 0) $label .= '
' . $tmpphoto;
}
-
$linkclose='';
if (empty($notooltip))
{
@@ -3469,7 +3469,7 @@ class Product extends CommonObject
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1, 1).'"';
- $linkclose.=' class="classfortooltip"';
+ $linkclose.= ' class="classfortooltip"';
if (! is_object($hookmanager))
{
@@ -3492,6 +3492,14 @@ class Product extends CommonObject
$url = DOL_URL_ROOT.'/product/card.php?id='.$this->id;
}
+ if ($option !== 'nolink')
+ {
+ // Add param to save lastsearch_values or not
+ $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
+ if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
+ if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
+ }
+
$linkstart = '
';
$linkend='';
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index a4012b7d3c4..a6cc3427243 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -203,7 +203,7 @@ if ($id > 0 || ! empty($ref))
*/
if ($user->rights->produit->lire || $user->rights->service->lire)
{
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index 53bbbfeeabb..fd67cd72504 100644
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -212,7 +212,7 @@ if ($object->id)
}
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index cb295012795..6124bc9161a 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -308,7 +308,7 @@ if ($id > 0 || $ref)
dol_fiche_head($head, 'suppliers', $titre, -1, $picto);
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
diff --git a/htdocs/product/info.php b/htdocs/product/info.php
index c8af676ed0a..1887e96df47 100644
--- a/htdocs/product/info.php
+++ b/htdocs/product/info.php
@@ -94,7 +94,7 @@ if ($id > 0 || $ref)
dol_fiche_head($head, 'info', $titre, -1, $picto);
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
diff --git a/htdocs/product/note.php b/htdocs/product/note.php
index 19496eeb860..5e73548579c 100644
--- a/htdocs/product/note.php
+++ b/htdocs/product/note.php
@@ -93,7 +93,7 @@ if ($id > 0 || ! empty($ref))
dol_fiche_head($head, 'note', $titre, -1, $picto);
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index af9fa2a927f..e00973902dd 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -690,7 +690,7 @@ $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
dol_fiche_head($head, 'price', $titre, -1, $picto);
-$linkback = '
'.$langs->trans("BackToList").'';
+$linkback = '
'.$langs->trans("BackToList").'';
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index 6389c5a8b8b..8f08e0b0317 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -138,7 +138,7 @@ if ($result && (! empty($id) || ! empty($ref)))
dol_fiche_head($head, 'stats', $titre, -1, $picto);
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index 4eb8992d837..dc3d9a9b7d6 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -100,7 +100,7 @@ if ($id > 0 || ! empty($ref))
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php
index 17d4bb5f962..4526af86f96 100644
--- a/htdocs/product/stats/commande_fournisseur.php
+++ b/htdocs/product/stats/commande_fournisseur.php
@@ -107,7 +107,7 @@ if ($id > 0 || ! empty($ref)) {
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php
index 8780a8a6a3b..7882f251dbd 100644
--- a/htdocs/product/stats/contrat.php
+++ b/htdocs/product/stats/contrat.php
@@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref))
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index 36359d1bd35..794d939bc6e 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -117,7 +117,7 @@ if ($id > 0 || ! empty($ref))
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php
index 6618d8deac8..2e6b8d19677 100644
--- a/htdocs/product/stats/facture_fournisseur.php
+++ b/htdocs/product/stats/facture_fournisseur.php
@@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index aa2c9a8e603..3173a04ee55 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php
index 9406ade286f..07e8015d846 100644
--- a/htdocs/product/stats/supplier_proposal.php
+++ b/htdocs/product/stats/supplier_proposal.php
@@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref))
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 2963f5e278d..faee4d05a6a 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -544,7 +544,7 @@ if ($id > 0 || $ref)
dol_htmloutput_events();
- $linkback = '
'.$langs->trans("BackToList").'';
+ $linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('stock', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 791da80c05d..fd13aee1ea2 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -200,7 +200,7 @@ if (! empty($object->multilangs))
dol_fiche_head($head, 'translation', $titre, 0, $picto);
-$linkback = '
'.$langs->trans("BackToList").'';
+$linkback = '
'.$langs->trans("BackToList").'';
$shownav = 1;
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 77ccbbcb219..a7c2d0f1a6b 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2040,17 +2040,18 @@ class User extends CommonObject
* Return a link to the user card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
*
- * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
- * @param string $option On what the link point to
- * @param integer $infologin Add complete info tooltip
- * @param integer $notooltip 1=Disable tooltip on picto and name
- * @param int $maxlen Max length of visible user name
- * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user
- * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login
- * @param string $morecss Add more css on link
- * @return string String with URL
+ * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
+ * @param string $option On what the link point to
+ * @param integer $infologin Add complete info tooltip
+ * @param integer $notooltip 1=Disable tooltip on picto and name
+ * @param int $maxlen Max length of visible user name
+ * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user
+ * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login
+ * @param string $morecss Add more css on link
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string String with URL
*/
- function getNomUrl($withpictoimg=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='')
+ function getNomUrl($withpictoimg=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='', $save_lastsearch_value=-1)
{
global $langs, $conf, $db, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -2108,10 +2109,18 @@ class User extends CommonObject
if (! empty($_SESSION["disablemodules"])) $label.= '
'.$langs->trans("DisabledModules").': '.join(', ',explode(',',$_SESSION["disablemodules"]));
}
+ if ($option == 'leave') $url.= DOL_URL_ROOT.'/holiday/list.php?id='.$this->id;
+ else $link.= $url.= DOL_URL_ROOT.'/user/card.php?id='.$this->id;
- if ($option == 'leave') $link.= '