diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 8ddd453b458..29043720dee 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -193,14 +193,14 @@ $enabledisablehtml .= $langs->trans("EnableDefaultValues").' '; if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 58808c00410..d76f77dd018 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -201,7 +201,7 @@ dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending'); // Shipment numbering model -print load_fiche_titre($langs->trans("SendingsNumberingModules")); +print load_fiche_titre($langs->trans("SendingsNumberingModules"), '', ''); print ''; print ''; @@ -304,7 +304,7 @@ print '

'; /* * Documents models for Sendings Receipt */ -print load_fiche_titre($langs->trans("SendingsReceiptModel")); +print load_fiche_titre($langs->trans("SendingsReceiptModel"), '', ''); // Defini tableau def de modele invoice $type="shipping"; @@ -463,7 +463,7 @@ print '
'; * Other options * */ -print load_fiche_titre($langs->trans("OtherOptions")); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'; print ''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index c3b38ca7a45..5e98d7c5503 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -208,14 +208,14 @@ $enabledisablehtml .= $langs->trans("EnableOverwriteTranslation").' '; if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 79446183685..7f8de19e2e5 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -119,7 +119,7 @@ function shipping_prepare_head($object) */ function delivery_prepare_head($object) { - global $langs, $conf, $user; + global $langs, $db, $conf, $user; // Load translation files required by the page $langs->loadLangs(array("sendings","deliveries")); @@ -140,29 +140,56 @@ function delivery_prepare_head($object) $head[$h][2] = 'delivery'; $h++; - $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->origin_id; + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + // complete_head_from_modules use $object->id for this link so we temporary change it + + $savObjectId = $object->id; + + // Get parent object + $tmpobject = null; + if ($object->origin) { + $tmpobject = new Expedition($db); + $tmpobject->fetch($object->origin_id); + } else { + $tmpobject = $object; + } + + $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$tmpobject->id; $head[$h][1] = $langs->trans("ContactsAddresses"); $head[$h][2] = 'contact'; $h++; - $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->origin_id; + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($tmpobject->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks=Link::count($db, $tmpobject->element, $tmpobject->id); + $head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$tmpobject->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; + $head[$h][2] = 'documents'; + $h++; + + $nbNote = 0; + if (!empty($tmpobject->note_private)) $nbNote++; + if (!empty($tmpobject->note_public)) $nbNote++; + $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$tmpobject->id; $head[$h][1] = $langs->trans("Notes"); + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab - // $this->tabs = array('entity:-tabname); to remove a tab - // complete_head_from_modules use $object->id for this link so we temporary change it - $tmpObjectId = $object->id; - $object->id = $object->origin_id; + $object->id = $tmpobject->id; complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery', 'remove'); - $object->id = $tmpObjectId; + $object->id = $savObjectId; return $head; } diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 478d4287a82..146f4b54962 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -211,7 +211,7 @@ if ($id > 0 || !empty($ref)) //print '
'; print '
'; - print ''; + print '
'; // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 5717eecf83a..b879f3d740f 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -24,7 +24,7 @@ /** * \file htdocs/livraison/card.php * \ingroup livraison - * \brief Fiche descriptive d'un bon de livraison=reception + * \brief Page to describe a delivery receipt */ require '../main.inc.php'; @@ -247,50 +247,9 @@ $upload_dir = $conf->expedition->dir_output.'/receipt'; $permissiontoadd = $user->rights->expedition->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - -/* - * Build document - */ -/* -if ($action == 'builddoc') // En get ou en post -{ - // Save last template used to generate document - if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); - - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - $result= $object->generateDocument($object->modelpdf, $outputlangs); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } -} - -// Delete file in doc form -elseif ($action == 'remove_file') -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $upload_dir = $conf->expedition->dir_output . "/receipt"; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); -} -*/ - include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + /* * View */ @@ -300,20 +259,10 @@ llxHeader('', $langs->trans('Delivery'), 'Livraison'); $form = new Form($db); $formfile = new FormFile($db); -/********************************************************************* - * - * Mode creation - * - *********************************************************************/ -if ($action == 'create') // Seems to no be used +if ($action == 'create') // Create. Seems to no be used { } -else -/* *************************************************************************** */ -/* */ -/* Mode vue et edition */ -/* */ -/* *************************************************************************** */ +else // View { if ($object->id > 0) { diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index e28f2e7324f..c8a3275dced 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -838,8 +838,8 @@ class Livraison extends CommonObject /** * Renvoi le libelle d'un statut donne * - * @param int $status Id status - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label */ public function LibStatut($status, $mode) @@ -847,36 +847,23 @@ class Livraison extends CommonObject // phpcs:enable global $langs; - if ($mode==0) + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - if ($status==-1) return $langs->trans('StatusDeliveryCanceled'); - elseif ($status==0) return $langs->trans('StatusDeliveryDraft'); - elseif ($status==1) return $langs->trans('StatusDeliveryValidated'); - } - elseif ($mode==1) - { - if ($status==-1) return $langs->trans($this->statuts[$status]); - elseif ($status==0) return $langs->trans($this->statuts[$status]); - elseif ($status==1) return $langs->trans($this->statuts[$status]); - } - elseif ($mode == 3) - { - if ($status==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5'); - if ($status==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0'); - if ($status==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4'); - } - elseif ($mode == 4) - { - if ($status==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5').' '.$langs->trans('StatusDeliveryCanceled'); - elseif ($status==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0').' '.$langs->trans('StatusDeliveryDraft'); - elseif ($status==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4').' '.$langs->trans('StatusDeliveryValidated'); - } - elseif ($mode == 6) - { - if ($status==-1) return $langs->trans('StatusDeliveryCanceled').' '.img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5'); - elseif ($status==0) return $langs->trans('StatusDeliveryDraft').' '.img_picto($langs->trans('StatusDeliveryDraft'), 'statut0'); - elseif ($status==1) return $langs->trans('StatusDeliveryValidated').' '.img_picto($langs->trans('StatusDeliveryValidated'), 'statut4'); + global $langs; + //$langs->load("mymodule"); + $this->labelStatus[-1] = $langs->trans('StatusDeliveryCanceled'); + $this->labelStatus[0] = $langs->trans('StatusDeliveryDraft'); + $this->labelStatus[1] = $langs->trans('StatusDeliveryValidated'); + $this->labelStatusShort[-1] = $langs->trans('StatusDeliveryCanceled'); + $this->labelStatusShort[0] = $langs->trans('StatusDeliveryDraft'); + $this->labelStatusShort[1] = $langs->trans('StatusDeliveryValidated'); } + + $statusType = 'status0'; + if ($status == -1) $statusType = 'status5'; + if ($status == 1) $statusType = 'status4'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index fe42bcfc995..c6386ba7ea2 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2377,9 +2377,14 @@ div.tabs { div.tabsElem { margin-top: 1px; } /* To avoid overlap of tabs when not browser */ -div.tabsElem a { - /* font-weight: normal !important; */ +/* +div.tabsElem a.tabactive::before, div.tabsElem a.tabunactive::before { + content: "\f0da"; + font-family: "Font Awesome 5 Free"; + padding-right: 2px; + font-weight: 900; } +*/ div.tabBar { color: #; padding-top: 16px;