From 64b28020c8ee5633c321251951dcb83e855f1e98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Sep 2020 13:14:14 +0200 Subject: [PATCH] Look and feel v13 --- htdocs/bom/class/bom.class.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/core/lib/functions.lib.php | 3 +- htdocs/don/class/don.class.php | 2 +- .../class/expensereport.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/holiday/class/holiday.class.php | 20 +++++---- htdocs/holiday/list.php | 41 ++++++++++--------- .../template/class/myobject.class.php | 2 +- htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/mo_production.php | 14 ++++--- htdocs/product/stock/class/entrepot.class.php | 2 +- 15 files changed, 56 insertions(+), 44 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index b5c0f9e8310..bd67f311d19 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -745,7 +745,7 @@ class BOM extends CommonObject $result = ''; - $label = ''.$langs->trans("BillOfMaterials").''; + $label = img_picto('', $this->picto).' '.$langs->trans("BillOfMaterials").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; if (isset($this->status)) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f844189fac9..f806a786b73 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3541,7 +3541,7 @@ class Propal extends CommonObject if ($user->rights->propal->lire) { - $label = ''.$langs->trans("Proposal").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Proposal").''; if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->ref_client)) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3e027cef919..45523fab1e2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3605,7 +3605,7 @@ class Commande extends CommonOrder $label = ''; if ($user->rights->commande->lire) { - $label = ''.$langs->trans("Order").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Order").''; $label .= '
'.$langs->trans('Ref').': '.$this->ref; $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); if (!empty($this->total_ht)) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index cb86caa91a9..a6bb6a12cec 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1411,7 +1411,7 @@ class Facture extends CommonInvoice $label = ''; if ($user->rights->facture->lire) { - $label = ''.$langs->trans("Invoice").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Invoice").''; if ($this->type == self::TYPE_REPLACEMENT) $label = ''.$langs->transnoentitiesnoconv("ReplacementInvoice").''; if ($this->type == self::TYPE_CREDIT_NOTE) $label = ''.$langs->transnoentitiesnoconv("CreditNote").''; if ($this->type == self::TYPE_DEPOSIT) $label = ''.$langs->transnoentitiesnoconv("Deposit").''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index c475c1b439d..3922dc9069f 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1284,7 +1284,7 @@ class Contact extends CommonObject $label .= '
'; } - $label .= ''.$langs->trans("Contact").''; + $label .= img_picto('', $this->picto).' '.$langs->trans("Contact").''; $label .= '
'.$langs->trans("Name").': '.$this->getFullName($langs); //if ($this->civility_id) $label.= '
' . $langs->trans("Civility") . ': '.$this->civility_id; // TODO Translate cibilty_id code if (!empty($this->poste)) $label .= '
'.$langs->trans("Poste").': '.$this->poste; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 71d5cbe3fa6..37bbfc9f3f4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3014,7 +3014,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'accountancy', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building', 'cash-register', 'category', 'check', 'clock', 'close_title', 'company', 'contact', 'contract', 'cubes', 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'email', 'external-link-alt', 'external-link-square-alt', - 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help', + 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', + 'help', 'holiday', 'intervention', 'label', 'language', 'list', 'listlight', 'lot', 'map-marker-alt', 'money-bill-alt', 'mrp', 'note', 'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index d4f0871b94c..3ccaa573e8c 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -899,7 +899,7 @@ class Don extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; - $label = ''.$langs->trans("Donation").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Donation").''; if (!empty($this->id)) { $label .= '
'.$langs->trans('Ref').': '.$this->id; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index e6834244810..1cfeba0d33e 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1556,7 +1556,7 @@ class ExpenseReport extends CommonObject if ($short) return $url; - $label = ''.$langs->trans("ShowExpenseReport").''; + $label = img_picto('', $this->picto).' '.$langs->trans("ShowExpenseReport").''; if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->total_ht)) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 6ac136c5b4d..5c73985cbf8 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -765,7 +765,7 @@ class Fichinter extends CommonObject $result = ''; - $label = ''.$langs->trans("ShowIntervention").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Intervention").''; $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (isset($this->status)) { $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index ce4c74d786a..d2aa54664cc 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1178,7 +1178,11 @@ class Holiday extends CommonObject $result = ''; - $label = $langs->trans("Show").': '.$this->ref; + $label = img_picto('', $this->picto).' '.$langs->trans("Holiday").''; + $label .= '
'.$langs->trans('Ref').': '.$this->ref; + if (isset($this->statut)) { + $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); + } $url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id; @@ -1269,20 +1273,22 @@ class Holiday extends CommonObject $nb = count($name) + 1; // Select HTML - $statut = ''."\n"; + $out .= ''."\n"; // Boucle des statuts for ($i = 1; $i < $nb; $i++) { if ($i == $selected) { - $statut .= ''."\n"; + $out .= ''."\n"; } else { - $statut .= ''."\n"; + $out .= ''."\n"; } } - $statut .= ''."\n"; - print $statut; + $out .= ''."\n"; + $out .= ajax_combobox($htmlname); + + print $out; } /** diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 5a4f782deac..e5d20b9f12f 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -106,7 +106,7 @@ $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); $search_employee = GETPOST('search_employee', 'int'); $search_valideur = GETPOST('search_valideur', 'int'); -$search_statut = GETPOST('search_statut', 'int'); +$search_status = GETPOST('search_status', 'int'); $search_type = GETPOST('search_type', 'int'); // Initialize technical objects @@ -182,7 +182,7 @@ if (empty($reshook)) $search_year_end = ""; $search_employee = ""; $search_valideur = ""; - $search_statut = ""; + $search_status = ""; $search_type = ''; $toselect = ''; $search_array_options = array(); @@ -253,7 +253,7 @@ $sql .= " cp.description,"; $sql .= " cp.date_debut,"; $sql .= " cp.date_fin,"; $sql .= " cp.halfday,"; -$sql .= " cp.statut,"; +$sql .= " cp.statut as status,"; $sql .= " cp.fk_validator,"; $sql .= " cp.date_valid,"; $sql .= " cp.fk_user_valid,"; @@ -268,7 +268,7 @@ $sql .= " uu.firstname as user_firstname,"; $sql .= " uu.admin as user_admin,"; $sql .= " uu.email as user_email,"; $sql .= " uu.login as user_login,"; -$sql .= " uu.statut as user_statut,"; +$sql .= " uu.statut as user_status,"; $sql .= " uu.photo as user_photo,"; $sql .= " ua.lastname as validator_lastname,"; @@ -276,7 +276,7 @@ $sql .= " ua.firstname as validator_firstname,"; $sql .= " ua.admin as validator_admin,"; $sql .= " ua.email as validator_email,"; $sql .= " ua.login as validator_login,"; -$sql .= " ua.statut as validator_statut,"; +$sql .= " ua.statut as validator_status,"; $sql .= " ua.photo as validator_photo"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -314,8 +314,8 @@ if (!empty($search_type) && $search_type != -1) { $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; } // Status -if (!empty($search_statut) && $search_statut != -1) { - $sql .= " AND cp.statut = '".$db->escape($search_statut)."'\n"; +if (!empty($search_status) && $search_status != -1) { + $sql .= " AND cp.statut = '".$db->escape($search_status)."'\n"; } if (empty($user->rights->holiday->read_all)) $sql .= ' AND cp.fk_user IN ('.join(',', $childids).')'; @@ -371,7 +371,7 @@ if ($resql) if ($search_employee > 0) $param .= '&search_employee='.urlencode($search_employee); if ($search_valideur > 0) $param .= '&search_valideur='.urlencode($search_valideur); if ($search_type > 0) $param .= '&search_type='.urlencode($search_type); - if ($search_statut > 0) $param .= '&search_statut='.urlencode($search_statut); + if ($search_status > 0) $param .= '&search_status='.urlencode($search_status); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -504,7 +504,7 @@ if ($resql) } print ''; - print $form->select_dolusers($search_employee, "search_employee", 1, "", $disabled, $include, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200'); + print $form->select_dolusers($search_employee, "search_employee", 1, "", $disabled, $include, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth150'); print ''; } @@ -519,7 +519,7 @@ if ($resql) $valideurobjects = $validator->listUsersForGroup($excludefilter); $valideurarray = array(); foreach ($valideurobjects as $val) $valideurarray[$val->id] = $val->id; - print $form->select_dolusers($search_valideur, "search_valideur", 1, "", 0, $valideurarray, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200'); + print $form->select_dolusers($search_valideur, "search_valideur", 1, "", 0, $valideurarray, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth150'); print ''; } else { print ' '; @@ -541,7 +541,7 @@ if ($resql) //$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':''); $arraytypeleaves[$val['rowid']] = $labeltoshow; } - print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1); + print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', '', 1); } print ''; } @@ -599,7 +599,7 @@ if ($resql) if (!empty($arrayfields['cp.statut']['checked'])) { print ''; - $object->selectStatutCP($search_statut, 'search_statut'); + $object->selectStatutCP($search_status, 'search_status'); print ''; } @@ -616,7 +616,7 @@ if ($resql) if (!empty($arrayfields['cp.fk_user']['checked'])) print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], "cp.fk_user", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['cp.fk_validator']['checked'])) print_liste_field_titre($arrayfields['cp.fk_validator']['label'], $_SERVER["PHP_SELF"], "cp.fk_validator", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['cp.fk_type']['checked'])) print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); - if (!empty($arrayfields['duration']['checked'])) print_liste_field_titre($arrayfields['duration']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['duration']['checked'])) print_liste_field_titre($arrayfields['duration']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right maxwidth100'); if (!empty($arrayfields['cp.date_debut']['checked'])) print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], "cp.date_debut", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['cp.date_fin']['checked'])) print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], "cp.date_fin", "", $param, '', $sortfield, $sortorder, 'center '); // Extra fields @@ -656,6 +656,7 @@ if ($resql) // Leave request $holidaystatic->id = $obj->rowid; $holidaystatic->ref = ($obj->ref ? $obj->ref : $obj->rowid); + $holidaystatic->statut = $obj->status; // User $userstatic->id = $obj->fk_user; @@ -664,7 +665,7 @@ if ($resql) $userstatic->admin = $obj->user_admin; $userstatic->email = $obj->user_email; $userstatic->login = $obj->user_login; - $userstatic->statut = $obj->user_statut; + $userstatic->statut = $obj->user_status; $userstatic->photo = $obj->user_photo; // Validator @@ -674,7 +675,7 @@ if ($resql) $approbatorstatic->admin = $obj->validator_admin; $approbatorstatic->email = $obj->validator_email; $approbatorstatic->login = $obj->validator_login; - $approbatorstatic->statut = $obj->validator_statut; + $approbatorstatic->statut = $obj->validator_status; $approbatorstatic->photo = $obj->validator_photo; $date = $obj->date_create; @@ -694,12 +695,12 @@ if ($resql) } if (!empty($arrayfields['cp.fk_user']['checked'])) { - print ''.$userstatic->getNomUrl(-1, 'leave').''; + print ''.$userstatic->getNomUrl(-1, 'leave').''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['cp.fk_validator']['checked'])) { - print ''.$approbatorstatic->getNomUrl(-1).''; + print ''.$approbatorstatic->getNomUrl(-1).''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['cp.fk_type']['checked'])) @@ -722,7 +723,7 @@ if ($resql) { print ''; print dol_print_date($db->jdate($obj->date_debut), 'day'); - print ' ('.$langs->trans($listhalfday[$starthalfday]).')'; + print ' ('.$langs->trans($listhalfday[$starthalfday]).')'; print ''; if (!$i) $totalarray['nbfield']++; } @@ -730,7 +731,7 @@ if ($resql) { print ''; print dol_print_date($db->jdate($obj->date_fin), 'day'); - print ' ('.$langs->trans($listhalfday[$endhalfday]).')'; + print ' ('.$langs->trans($listhalfday[$endhalfday]).')'; print ''; if (!$i) $totalarray['nbfield']++; } @@ -755,7 +756,7 @@ if ($resql) } if (!empty($arrayfields['cp.statut']['checked'])) { - print ''.$holidaystatic->LibStatut($obj->statut, 5).''; + print ''.$holidaystatic->getLibStatut(5).''; if (!$i) $totalarray['nbfield']++; } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 95672655825..681133ea064 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -735,7 +735,7 @@ class MyObject extends CommonObject $result = ''; - $label = ''.$langs->trans("MyObject").''; + $label = img_picto('', $this->picto).' '.$langs->trans("MyObject").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; if (isset($this->status)) { diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 0b7150f7f9e..c0d6658cab7 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -987,7 +987,7 @@ class Mo extends CommonObject $result = ''; - $label = ''.$langs->trans("MO").''; + $label = img_picto('', $this->picto).' '.$langs->trans("MO").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; if (isset($this->status)) { diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index f6791c83e85..e86fdc8348d 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2019-2020 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -254,7 +254,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); $error++; } - if ($tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { + if (!empty($conf->productbatch->enabled) && $tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); $error++; @@ -681,7 +681,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; - $newlinetext = ''.$langs->trans("AddNewConsumeLines").''; + $newlinetext = ''; + if ($action != 'consumeorproduce' && $action != 'consumeandproduceall') { + $newlinetext = ''.$langs->trans("AddNewConsumeLines").''; + } print load_fiche_titre($langs->trans('Consumption'), '', '', 0, '', '', $newlinetext); print '
'; @@ -812,7 +815,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $i = 1; print ''."\n"; print ''; - print ''.$langs->trans("ToConsume").''; + print ''.$langs->trans("ToConsume").''; $preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed)); if ($action == 'consumeorproduce' && !GETPOSTISSET('qty-'.$line->id.'-'.$i)) $preselected = 0; print ''; @@ -960,8 +963,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { + print ''."\n"; print ''; - print ''.$langs->trans("ToProduce").''; + print ''.$langs->trans("ToProduce").''; $preselected = (GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i) ? GETPOST('qtytoproduce-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyproduced)); if ($action == 'consumeorproduce' && !GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i)) $preselected = 0; print ''; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 3dc8693897a..a16b1ee189c 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -707,7 +707,7 @@ class Entrepot extends CommonObject $result = ''; - $label = ''.$langs->trans("Warehouse").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Warehouse").''; $label .= '
'.$langs->trans('Ref').': '.(empty($this->ref) ? (empty($this->label) ? $this->libelle : $this->label) : $this->ref); if (!empty($this->lieu)) { $label .= '
'.$langs->trans('LocationSummary').': '.$this->lieu;