Look and feel v13

This commit is contained in:
Laurent Destailleur 2020-09-11 13:14:14 +02:00
parent 7e989c8902
commit 64b28020c8
15 changed files with 56 additions and 44 deletions

View File

@ -745,7 +745,7 @@ class BOM extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("BillOfMaterials").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("BillOfMaterials").'</u>';
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (isset($this->status)) {

View File

@ -3541,7 +3541,7 @@ class Propal extends CommonObject
if ($user->rights->propal->lire)
{
$label = '<u>'.$langs->trans("Proposal").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Proposal").'</u>';
if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_client))

View File

@ -3605,7 +3605,7 @@ class Commande extends CommonOrder
$label = '';
if ($user->rights->commande->lire) {
$label = '<u>'.$langs->trans("Order").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Order").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
if (!empty($this->total_ht)) {

View File

@ -1411,7 +1411,7 @@ class Facture extends CommonInvoice
$label = '';
if ($user->rights->facture->lire) {
$label = '<u>'.$langs->trans("Invoice").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Invoice").'</u>';
if ($this->type == self::TYPE_REPLACEMENT) $label = '<u>'.$langs->transnoentitiesnoconv("ReplacementInvoice").'</u>';
if ($this->type == self::TYPE_CREDIT_NOTE) $label = '<u>'.$langs->transnoentitiesnoconv("CreditNote").'</u>';
if ($this->type == self::TYPE_DEPOSIT) $label = '<u>'.$langs->transnoentitiesnoconv("Deposit").'</u>';

View File

@ -1284,7 +1284,7 @@ class Contact extends CommonObject
$label .= '</div><div style="clear: both;"></div>';
}
$label .= '<u>'.$langs->trans("Contact").'</u>';
$label .= img_picto('', $this->picto).' <u>'.$langs->trans("Contact").'</u>';
$label .= '<br><b>'.$langs->trans("Name").':</b> '.$this->getFullName($langs);
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
if (!empty($this->poste)) $label .= '<br><b>'.$langs->trans("Poste").':</b> '.$this->poste;

View File

@ -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',

View File

@ -899,7 +899,7 @@ class Don extends CommonObject
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
$result = '';
$label = '<u>'.$langs->trans("Donation").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Donation").'</u>';
if (!empty($this->id)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id;
}

View File

@ -1556,7 +1556,7 @@ class ExpenseReport extends CommonObject
if ($short) return $url;
$label = '<u>'.$langs->trans("ShowExpenseReport").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("ShowExpenseReport").'</u>';
if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->total_ht))

View File

@ -765,7 +765,7 @@ class Fichinter extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("ShowIntervention").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Intervention").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (isset($this->status)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);

View File

@ -1178,7 +1178,11 @@ class Holiday extends CommonObject
$result = '';
$label = $langs->trans("Show").': '.$this->ref;
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Holiday").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (isset($this->statut)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$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 = '<select name="'.$htmlname.'" class="flat">'."\n";
$statut .= '<option value="-1">&nbsp;</option>'."\n";
$out = '<select name="'.$htmlname.'" id="'.$htmlname.'" class="flat">'."\n";
$out .= '<option value="-1">&nbsp;</option>'."\n";
// Boucle des statuts
for ($i = 1; $i < $nb; $i++) {
if ($i == $selected) {
$statut .= '<option value="'.$i.'" selected>'.$langs->trans($name[$i - 1]).'</option>'."\n";
$out .= '<option value="'.$i.'" selected>'.$langs->trans($name[$i - 1]).'</option>'."\n";
} else {
$statut .= '<option value="'.$i.'">'.$langs->trans($name[$i - 1]).'</option>'."\n";
$out .= '<option value="'.$i.'">'.$langs->trans($name[$i - 1]).'</option>'."\n";
}
}
$statut .= '</select>'."\n";
print $statut;
$out .= '</select>'."\n";
$out .= ajax_combobox($htmlname);
print $out;
}
/**

View File

@ -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 '<td class="liste_titre maxwidthonsmartphone left">';
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 '</td>';
}
@ -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 '</td>';
} else {
print '<td class="liste_titre">&nbsp;</td>';
@ -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 '</td>';
}
@ -599,7 +599,7 @@ if ($resql)
if (!empty($arrayfields['cp.statut']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone maxwidth200 right">';
$object->selectStatutCP($search_statut, 'search_statut');
$object->selectStatutCP($search_status, 'search_status');
print '</td>';
}
@ -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 '<td>'.$userstatic->getNomUrl(-1, 'leave').'</td>';
print '<td class="tdoverflowmax150">'.$userstatic->getNomUrl(-1, 'leave').'</td>';
if (!$i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['cp.fk_validator']['checked']))
{
print '<td>'.$approbatorstatic->getNomUrl(-1).'</td>';
print '<td class="tdoverflowmax150">'.$approbatorstatic->getNomUrl(-1).'</td>';
if (!$i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['cp.fk_type']['checked']))
@ -722,7 +723,7 @@ if ($resql)
{
print '<td class="center">';
print dol_print_date($db->jdate($obj->date_debut), 'day');
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
print ' <span class="opacitymedium nowraponall">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
@ -730,7 +731,7 @@ if ($resql)
{
print '<td class="center">';
print dol_print_date($db->jdate($obj->date_fin), 'day');
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
print ' <span class="opacitymedium nowraponall">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
@ -755,7 +756,7 @@ if ($resql)
}
if (!empty($arrayfields['cp.statut']['checked']))
{
print '<td class="right nowrap">'.$holidaystatic->LibStatut($obj->statut, 5).'</td>';
print '<td class="right nowrap">'.$holidaystatic->getLibStatut(5).'</td>';
if (!$i) $totalarray['nbfield']++;
}

View File

@ -735,7 +735,7 @@ class MyObject extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("MyObject").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("MyObject").'</u>';
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (isset($this->status)) {

View File

@ -987,7 +987,7 @@ class Mo extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("MO").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("MO").'</u>';
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (isset($this->status)) {

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2019-2020 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '<div class="fichehalfleft">';
print '<div class="clearboth"></div>';
$newlinetext = '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addconsumeline">'.$langs->trans("AddNewConsumeLines").'</a>';
$newlinetext = '';
if ($action != 'consumeorproduce' && $action != 'consumeandproduceall') {
$newlinetext = '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addconsumeline">'.$langs->trans("AddNewConsumeLines").'</a>';
}
print load_fiche_titre($langs->trans('Consumption'), '', '', 0, '', '', $newlinetext);
print '<div class="div-table-responsive-no-min">';
@ -812,7 +815,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$i = 1;
print '<!-- Enter line to consume -->'."\n";
print '<tr>';
print '<td>'.$langs->trans("ToConsume").'</td>';
print '<td><span class="opacitymedium">'.$langs->trans("ToConsume").'</span></td>';
$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 '<td class="right"><input type="text" class="width50 right" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
@ -960,8 +963,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print '<!-- Enter line to produce -->'."\n";
print '<tr name="batch_'.$line->id.'_'.$i.'">';
print '<td>'.$langs->trans("ToProduce").'</td>';
print '<td><span class="opacitymedium">'.$langs->trans("ToProduce").'</span></td>';
$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 '<td class="right"><input type="text" class="width50 right" id="qtytoproduce-'.$line->id.'-'.$i.'" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';

View File

@ -707,7 +707,7 @@ class Entrepot extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("Warehouse").'</u>';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Warehouse").'</u>';
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.(empty($this->ref) ? (empty($this->label) ? $this->libelle : $this->label) : $this->ref);
if (!empty($this->lieu)) {
$label .= '<br><b>'.$langs->trans('LocationSummary').':</b> '.$this->lieu;