Merge branch 'Dolibarr:develop' into develop
This commit is contained in:
commit
f135135d0b
@ -84,7 +84,7 @@ print "<br>\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';
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ print "<br>\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';
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup
|
||||
print '<br>';
|
||||
$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
|
||||
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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';
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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 = '';
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5, $this->alreadypaid);
|
||||
}
|
||||
|
||||
$ref = $this->ref;
|
||||
if (empty($ref)) {
|
||||
@ -2567,8 +2568,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
$result .= '<a href="'.DOL_URL_ROOT.'/fourn/facture/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
|
||||
$result .= img_picto('', 'note');
|
||||
$result .= '</a>';
|
||||
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
|
||||
//$result.='</a>';
|
||||
$result .= '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
print '<table class="noborder small">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
@ -3044,51 +3044,51 @@ if ($module == 'initmodule') {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $menu['type'];
|
||||
print dol_escape_htmltag($menu['type']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['fk_menu'];
|
||||
print dol_escape_htmltag($menu['fk_menu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['titre'];
|
||||
print dol_escape_htmltag($menu['titre']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['mainmenu'];
|
||||
print dol_escape_htmltag($menu['mainmenu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['leftmenu'];
|
||||
print dol_escape_htmltag($menu['leftmenu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($menu['url']).'">';
|
||||
print dol_escape_htmltag($menu['url']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['url'];
|
||||
print dol_escape_htmltag($menu['langs']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['langs'];
|
||||
print dol_escape_htmltag($menu['position']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['enabled']).'">';
|
||||
print dol_escape_htmltag($menu['enabled']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['perms']).'">';
|
||||
print dol_escape_htmltag($menu['perms']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['position'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['enabled'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['perms'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['target'];
|
||||
print dol_escape_htmltag($menu['target']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">';
|
||||
print $menu['user'];
|
||||
print dol_escape_htmltag($menu['user']);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -3447,7 +3447,7 @@ if ($module == 'initmodule') {
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoWidget");
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("WidgetFile").' : <span class="opacitymedium">'.$langs->trans("NoWidget").'</span>';
|
||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initwidget&format=php">'.img_picto('Generate', 'generate', 'class="paddingleft"').'</a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -3792,7 +3792,7 @@ if ($module == 'initmodule') {
|
||||
print $outputfiledoc;
|
||||
print '</a>';
|
||||
print '</strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
@ -3806,7 +3806,7 @@ if ($module == 'initmodule') {
|
||||
print $outputfiledocpdf;
|
||||
print '</a>';
|
||||
print '</strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
@ -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 '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
|
||||
@ -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 .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
@ -1331,7 +1341,7 @@ if ($action == 'create') {
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) {
|
||||
@ -1495,11 +1505,11 @@ if ($action == 'create') {
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Reception method
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('ReceptionMethod');
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -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 .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
@ -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 .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user