diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php
index d0c7c85463e..ac8f4fced4d 100644
--- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php
+++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php
@@ -84,7 +84,7 @@ print "
\n";
$head = reception_admin_prepare_head();
-print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'sending');
+print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'reception');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php
index ab7d18b1331..8e4205a7bdc 100644
--- a/htdocs/admin/reception_extrafields.php
+++ b/htdocs/admin/reception_extrafields.php
@@ -84,7 +84,7 @@ print "
\n";
$head = reception_admin_prepare_head();
-print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'sending');
+print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'reception');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php
index 734c953a092..6ea6d195040 100644
--- a/htdocs/admin/reception_setup.php
+++ b/htdocs/admin/reception_setup.php
@@ -172,7 +172,7 @@ print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup
print '
';
$head = reception_admin_prepare_head();
-print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'sending');
+print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'reception');
// Reception numbering model
diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php
index 3bf3bcb07c2..a2ce199faee 100644
--- a/htdocs/core/boxes/box_factures_fourn.php
+++ b/htdocs/core/boxes/box_factures_fourn.php
@@ -142,6 +142,10 @@ class box_factures_fourn extends ModeleBoxes
$facturestatic->status = $objp->status;
$facturestatic->ref_supplier = $objp->ref_supplier;
+ $alreadypaid = $facturestatic->getSommePaiement();
+
+ $facturestatic->alreadypaid = $alreadypaid ? $alreadypaid : 0;
+
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
$thirdpartystatic->name_alias = $objp->name_alias;
@@ -188,9 +192,6 @@ class box_factures_fourn extends ModeleBoxes
'text' => dol_print_date($date, 'day'),
);
- $fac = new FactureFournisseur($this->db);
- $fac->fetch($objp->facid);
- $alreadypaid = $fac->getSommePaiement();
$this->info_box_contents[$line][] = array(
'td' => 'class="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php
index 826c89cf2de..aea07802fdf 100644
--- a/htdocs/core/boxes/box_factures_fourn_imp.php
+++ b/htdocs/core/boxes/box_factures_fourn_imp.php
@@ -134,6 +134,10 @@ class box_factures_fourn_imp extends ModeleBoxes
$facturestatic->statut = $objp->status;
$facturestatic->status = $objp->status;
+ $alreadypaid = $facturestatic->getSommePaiement();
+
+ $facturestatic->alreadypaid = $alreadypaid ? $alreadypaid : 0;
+
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
$thirdpartystatic->name_alias = $objp->name_alias;
@@ -174,9 +178,6 @@ class box_factures_fourn_imp extends ModeleBoxes
'text' => dol_print_date($datelimite, 'day'),
);
- $fac = new FactureFournisseur($this->db);
- $fac->fetch($objp->facid);
- $alreadypaid = $fac->getSommePaiement();
$this->info_box_contents[$line][] = array(
'td' => 'class="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php
index 54d3a950a79..1830dcd5c7a 100644
--- a/htdocs/core/boxes/box_factures_imp.php
+++ b/htdocs/core/boxes/box_factures_imp.php
@@ -132,7 +132,9 @@ class box_factures_imp extends ModeleBoxes
while ($line < $num) {
$objp = $this->db->fetch_object($result);
+
$datelimite = $this->db->jdate($objp->datelimite);
+
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->ref;
$facturestatic->type = $objp->type;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 77f0df8379b..727bfaee5b8 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3511,7 +3511,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
'error', 'warning',
- 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
+ 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'user-cog', 'website', 'workstation',
@@ -3598,7 +3598,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'info', 'project', 'workstation'))) {
$morecss = 'em088';
}
- if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) {
+ if (in_array($pictowithouttext, array('asset', 'intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) {
$morecss = 'em080';
}
diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php
index 12b58bfcc38..3a51a366970 100644
--- a/htdocs/core/modules/modAsset.class.php
+++ b/htdocs/core/modules/modAsset.class.php
@@ -69,7 +69,7 @@ class modAsset extends DolibarrModules
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
- $this->picto = 'accounting';
+ $this->picto = 'asset';
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
// for default path (eg: /asset/core/xxxxx) (0=disable, 1=enable)
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index c204afcef72..cc441d9f50f 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -82,21 +82,6 @@ if (empty($origin_id)) {
$ref = GETPOST('ref', 'alpha');
$line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : '';
-// Security check
-$socid = '';
-if ($user->socid) {
- $socid = $user->socid;
-}
-
-if ($origin == 'expedition') {
- $result = restrictedArea($user, $origin, $id);
-} else {
- $result = restrictedArea($user, 'expedition');
- if (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
- accessforbidden();
- }
-}
-
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
@@ -121,18 +106,24 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('expeditioncard', 'globalcard'));
-$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
-//var_dump($object->lines[0]->detail_batch);
-
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
+if ($id > 0 || !empty($ref)) {
+ $object->fetch($id, $ref);
+ $object->fetch_thirdparty();
+}
+
// Security check
+$socid = '';
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'expedition', $object->id, '');
+$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
+//var_dump($object->lines[0]->detail_batch);
+
/*
* Actions
@@ -1525,7 +1516,7 @@ if ($action == 'create') {
$res = $object->fetch_optionals();
$head = shipping_prepare_head($object);
- print dol_get_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, 'sending');
+ print dol_get_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, $object->picto);
$formconfirm = '';
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index cd9febc685d..164935a1437 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -108,13 +108,6 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) {
dol_print_error($db);
}
}
-/*
-elseif ($action == 'setaddress' && $user->rights->expedition->creer)
-{
- $object->fetch($id);
- $result=$object->setDeliveryAddress($_POST['fk_address']);
- if ($result < 0) dol_print_error($db,$object->error);
-}*/
/*
@@ -143,7 +136,7 @@ if ($id > 0 || !empty($ref)) {
$langs->trans("OrderCard");
$head = shipping_prepare_head($object);
- print dol_get_fiche_head($head, 'contact', $langs->trans("Shipment"), -1, 'sending');
+ print dol_get_fiche_head($head, 'contact', $langs->trans("Shipment"), -1, $object->picto);
// Shipment card
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index c5e13967abc..c392187d607 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -99,7 +99,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->expedition->dir_output.'/sending/'.dol_sanitizeFileName($object->ref);
$head = shipping_prepare_head($object);
- print dol_get_fiche_head($head, 'documents', $langs->trans("Shipment"), -1, 'sending');
+ print dol_get_fiche_head($head, 'documents', $langs->trans("Shipment"), -1, $object->picto);
// Build file list
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index db28e409309..a9076162015 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -89,7 +89,7 @@ $form = new Form($db);
if ($id > 0 || !empty($ref)) {
$head = shipping_prepare_head($object);
- print dol_get_fiche_head($head, 'note', $langs->trans("Shipment"), -1, 'sending');
+ print dol_get_fiche_head($head, 'note', $langs->trans("Shipment"), -1, $object->picto);
// Shipment card
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index dd1ea179553..78925c74b9f 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -2501,6 +2501,10 @@ class FactureFournisseur extends CommonInvoice
}
if (isset($this->status)) {
$alreadypaid = -1;
+ if (isset($this->alreadypaid)) {
+ $alreadypaid = $this->alreadypaid;
+ }
+
$label .= ' '.$this->getLibStatut(5, $alreadypaid);
}
if (!empty($this->ref)) {
@@ -2527,9 +2531,6 @@ class FactureFournisseur extends CommonInvoice
if ($moretitle) {
$label .= ' - '.$moretitle;
}
- if (isset($this->statut) && isset($this->alreadypaid)) {
- $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5, $this->alreadypaid);
- }
$ref = $this->ref;
if (empty($ref)) {
@@ -2567,8 +2568,6 @@ class FactureFournisseur extends CommonInvoice
$result .= '';
$result .= img_picto('', 'note');
$result .= '';
- //$result.=img_picto($langs->trans("ViewNote"),'object_generic');
- //$result.='';
$result .= '';
}
}
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 9cb22f735e6..f8ca876eafc 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -1521,7 +1521,7 @@ if ($dirins && $action == 'generatepackage') {
$arrayversion = explode('.', $moduleobj->version, 3);
if (count($arrayversion)) {
- $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].($arrayversion[1] ? '.'.$arrayversion[1] : '').($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip';
+ $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip';
$dirofmodule = dol_buildpath($modulelowercase, 0).'/bin';
$outputfilezip = $dirofmodule.'/'.$FILENAMEZIP;
@@ -3022,7 +3022,7 @@ if ($module == 'initmodule') {
print '';
print '
';
- print '
';
+ print '';
print '';
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
@@ -3044,51 +3044,51 @@ if ($module == 'initmodule') {
print '
';
print '| ';
- print $menu['type'];
+ print dol_escape_htmltag($menu['type']);
print ' | ';
print '';
- print $menu['fk_menu'];
+ print dol_escape_htmltag($menu['fk_menu']);
print ' | ';
print '';
- print $menu['titre'];
+ print dol_escape_htmltag($menu['titre']);
print ' | ';
print '';
- print $menu['mainmenu'];
+ print dol_escape_htmltag($menu['mainmenu']);
print ' | ';
print '';
- print $menu['leftmenu'];
+ print dol_escape_htmltag($menu['leftmenu']);
+ print ' | ';
+
+ print '';
+ print dol_escape_htmltag($menu['url']);
print ' | ';
print '';
- print $menu['url'];
+ print dol_escape_htmltag($menu['langs']);
print ' | ';
print '';
- print $menu['langs'];
+ print dol_escape_htmltag($menu['position']);
+ print ' | ';
+
+ print '';
+ print dol_escape_htmltag($menu['enabled']);
+ print ' | ';
+
+ print '';
+ print dol_escape_htmltag($menu['perms']);
print ' | ';
print '';
- print $menu['position'];
- print ' | ';
-
- print '';
- print $menu['enabled'];
- print ' | ';
-
- print '';
- print $menu['perms'];
- print ' | ';
-
- print '';
- print $menu['target'];
+ print dol_escape_htmltag($menu['target']);
print ' | ';
print '';
- print $menu['user'];
+ print dol_escape_htmltag($menu['user']);
print ' | ';
print '
';
@@ -3447,7 +3447,7 @@ if ($module == 'initmodule') {
print '';
}
} else {
- print '| '.$langs->trans("NoWidget");
+ print ' |
| '.$langs->trans("WidgetFile").' : '.$langs->trans("NoWidget").'';
print ' | '.img_picto('Generate', 'generate', 'class="paddingleft"').'';
print ' |
';
}
@@ -3792,7 +3792,7 @@ if ($module == 'initmodule') {
print $outputfiledoc;
print '';
print '';
- print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')';
+ print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')';
}
print '
';
@@ -3806,7 +3806,7 @@ if ($module == 'initmodule') {
print $outputfiledocpdf;
print '';
print '';
- print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')';
+ print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')';
}
print '
';
@@ -3860,7 +3860,7 @@ if ($module == 'initmodule') {
$arrayversion = explode('.', $moduleobj->version, 3);
if (count($arrayversion)) {
- $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2] ? ".".$arrayversion[2] : "").".zip";
+ $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? ".".$arrayversion[2] : '').".zip";
$outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP;
}
@@ -3872,7 +3872,7 @@ if ($module == 'initmodule') {
} else {
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
print ''.$outputfilezip.'';
- print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')';
+ print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')';
}
print '
';
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 07ddf19805c..75f5401d401 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -117,6 +117,26 @@ $permissiondellink = $user->rights->reception->creer; // Used by the include of
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
+$object = new Reception($db);
+if ($id > 0 || !empty($ref)) {
+ $object->fetch($id, $ref);
+ $object->fetch_thirdparty();
+
+ if (!empty($object->origin)) {
+ $origin = $object->origin;
+
+ $object->fetch_origin();
+ $typeobject = $object->origin;
+ }
+
+ // Linked documents
+ if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) {
+ $origin_id = $object->$typeobject->id;
+ $objectsrc = new CommandeFournisseur($db);
+ $objectsrc->fetch($object->$typeobject->id);
+ }
+}
+
// Security check
$socid = '';
if ($user->socid) {
@@ -124,13 +144,10 @@ if ($user->socid) {
}
if ($origin == 'reception') {
- $result = restrictedArea($user, $origin, $id);
+ $result = restrictedArea($user, 'reception', $id);
} else {
- $result = restrictedArea($user, 'reception');
- if ($origin == 'supplierorder') {
- if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
- accessforbidden();
- }
+ if ($origin == 'supplierorder' || $origin == 'order_supplier') {
+ $result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
accessforbidden();
}
@@ -150,14 +167,12 @@ if ($reshook < 0) {
if (empty($reshook)) {
if ($cancel) {
$action = '';
- $object->fetch($id); // show reception also after canceling modification
}
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
// Reopen
if ($action == 'reopen' && $user->rights->reception->creer) {
- $object->fetch($id);
$result = $object->reOpen();
}
@@ -192,7 +207,6 @@ if (empty($reshook)) {
}
if ($action == 'setref_supplier') {
- $result = $object->fetch($id);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -528,14 +542,12 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
} elseif ($action == 'classifybilled') {
- $object->fetch($id);
$result = $object->setBilled();
if ($result >= 0) {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit();
}
} elseif ($action == 'classifyclosed') {
- $object->fetch($id);
$result = $object->setClosed();
if ($result >= 0) {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
@@ -543,7 +555,6 @@ if (empty($reshook)) {
}
} elseif ($action == 'deleteline' && !empty($line_id)) {
// delete a line
- $object->fetch($id);
$lines = $object->lines;
$line = new CommandeFournisseurDispatch($db);
@@ -1323,7 +1334,6 @@ if ($action == 'create') {
}
$morehtmlref .= '';
- $object->picto = 'sending';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@@ -1331,7 +1341,7 @@ if ($action == 'create') {
print '';
print '
';
- print '
';
+ print '';
// Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) {
@@ -1495,11 +1505,11 @@ if ($action == 'create') {
print '';
print '
';
- print '
';
+ print '';
// Reception method
print '';
- print '';
+ print '| ';
print $langs->trans('ReceptionMethod');
print ' | ';
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index c99b44074eb..609cb0d12b7 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -35,9 +35,7 @@ if (!empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
-$langs->load("orders");
-$langs->load("receptions");
-$langs->load("companies");
+$langs->loadLangs(array("orders", "receptions", "companies"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
@@ -62,7 +60,6 @@ if ($id > 0 || !empty($ref)) {
}
}
-
// Security check
if ($user->socid > 0) {
$socid = $user->socid;
@@ -70,11 +67,8 @@ if ($user->socid > 0) {
if ($origin == 'reception') {
$result = restrictedArea($user, $origin, $object->id);
} else {
- $result = restrictedArea($user, 'reception');
- if ($origin == 'supplierorder') {
- if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
- accessforbidden();
- }
+ if ($origin == 'supplierorder' || $origin == 'order_supplier') {
+ $result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
accessforbidden();
}
@@ -119,13 +113,6 @@ if ($action == 'addcontact' && $user->rights->reception->creer) {
dol_print_error($db);
}
}
-/*
-elseif ($action == 'setaddress' && $user->rights->reception->creer)
-{
- $object->fetch($id);
- $result=$object->setDeliveryAddress($_POST['fk_address']);
- if ($result < 0) dol_print_error($db,$object->error);
-}*/
/*
@@ -141,11 +128,7 @@ $contactstatic = new Contact($db);
$userstatic = new User($db);
-/* *************************************************************************** */
-/* */
-/* Mode vue et edition */
-/* */
-/* *************************************************************************** */
+// View mode
if ($id > 0 || !empty($ref)) {
$langs->trans("OrderCard");
@@ -199,7 +182,6 @@ if ($id > 0 || !empty($ref)) {
}
$morehtmlref .= '';
- $object->picto = 'sending';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php
index a3a2b31589c..f343e56e14d 100644
--- a/htdocs/reception/note.php
+++ b/htdocs/reception/note.php
@@ -70,13 +70,14 @@ if ($user->socid > 0) {
if ($origin == 'reception') {
$result = restrictedArea($user, $origin, $object->id);
} else {
- $result = restrictedArea($user, 'reception');
- if ($origin == 'supplierorder') {
- if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
+ if ($origin == 'reception') {
+ $result = restrictedArea($user, $origin, $object->id);
+ } else {
+ if ($origin == 'supplierorder' || $origin == 'order_supplier') {
+ $result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
+ } elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
accessforbidden();
}
- } elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
- accessforbidden();
}
}
@@ -147,7 +148,6 @@ if ($id > 0 || !empty($ref)) {
}
$morehtmlref .= '';
- $object->picto = 'sending';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
|