From e74b833d7f64241d07802f418824f5a89d0189cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Oct 2020 15:40:52 +0200 Subject: [PATCH] Look and feel v13 --- htdocs/comm/index.php | 73 ++++++++++++++++---- htdocs/core/class/html.form.class.php | 4 +- htdocs/core/class/html.formcompany.class.php | 1 + htdocs/core/lib/agenda.lib.php | 8 +-- htdocs/societe/index.php | 22 +++--- htdocs/societe/list.php | 8 +-- htdocs/ticket/index.php | 17 +++-- htdocs/ticket/list.php | 14 +++- 8 files changed, 103 insertions(+), 44 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 1e09d3f0beb..b305858bd93 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -181,7 +181,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { print ''; print ''.$propalstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'customer').''; - print ''.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).''; + print ''.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).''; print ''; $i++; @@ -245,7 +245,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa print ''; print ''.$supplierproposalstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'supplier').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''; $i++; @@ -310,7 +310,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { print ''; print ''.$orderstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'customer').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''; $i++; @@ -375,7 +375,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''; print ''.$supplierorderstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'supplier').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''; $i++; @@ -442,8 +442,28 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { print ''; print ''.$companystatic->getNomUrl(1, 'customer').''; - print ''.$companystatic->getLibCustProspStatut().''; - print ''.dol_print_date($db->jdate($objp->tms), 'day').''; + print ''; + //print $companystatic->getLibCustProspStatut(); + + $obj = $companystatic; + $s = ''; + if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; + } + if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; + } + /* + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) + { + $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; + }*/ + print $s; + + print ''; + print ''.dol_print_date($db->jdate($objp->tms), 'day').''; print ''; $i++; @@ -464,7 +484,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { * Last suppliers */ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) { - $sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm, s.code_fournisseur, s.entity, s.email"; + $sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm, s.code_fournisseur, s.entity, s.email, s.fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")"; @@ -477,7 +497,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - startSimpleTable($langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)), "societe/list.php", "type=f"); + startSimpleTable($langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)), "societe/list.php", "type=f", 1); if ($num) { $i = 0; @@ -491,17 +511,37 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $companystatic->canvas = $objp->canvas; $companystatic->entity = $objp->entity; $companystatic->email = $objp->email; + $companystatic->fournisseur = $objp->fournisseur; print ''; print ''.$companystatic->getNomUrl(1, 'supplier').''; - print ''.dol_print_date($db->jdate($objp->dm), 'day').''; + print ''; + + $obj = $companystatic; + $s = ''; + /*if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; + } + if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; + }*/ + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) + { + $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; + } + print $s; + + print ''; + print ''.dol_print_date($db->jdate($objp->dm), 'day').''; print ''; $i++; } } - addSummaryTableLine(2, $num); + addSummaryTableLine(3, $num); finishSimpleTable(true); $db->free($resql); @@ -566,8 +606,11 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T $companystatic->entity = $objp->entity; $companystatic->email = $objp->email; + $staticcontrat->id = $obj->contratid; + $staticcontrat->ref = $obj->ref; + print ''; - print 'contratid."\">".img_object($langs->trans("ShowContract","contract"), "contract")." ".$obj->ref."'; + print ''.$staticcontrat->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'customer', 44).''; print ''.$staticcontrat->LibStatut($obj->statut, 3).''; print ''; @@ -657,8 +700,8 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { print ''; print ''.$companystatic->getNomUrl(1, 'customer', 44).''; - print ''.dol_print_date($db->jdate($obj->dp), 'day').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.dol_print_date($db->jdate($obj->dp), 'day').''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''.$propalstatic->LibStatut($obj->fk_statut, 3).''; print ''; @@ -758,8 +801,8 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { print ''; print ''.$companystatic->getNomUrl(1, 'customer', 44).''; - print ''.dol_print_date($db->jdate($obj->dp), 'day').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.dol_print_date($db->jdate($obj->dp), 'day').''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).''; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f30e8e327ae..be7fde5d874 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -811,7 +811,7 @@ class Form $out .= ''; if ($mysoc->isInEEC()) $out .= ''; $out .= ''; - $out .= ''; + $out .= ''; } foreach ($countryArray as $row) @@ -824,7 +824,7 @@ class Form if (empty($row['favorite']) && $atleastonefavorite) { $atleastonefavorite = 0; - $out .= ''; + $out .= ''; } if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index b43df3753dc..3d2a2e57e3c 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -1003,6 +1003,7 @@ class FormCompany extends Form } } $out .= ''; + $out .= ajax_combobox($htmlidname); return $out; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 19ce8e33fdc..0a4d57658d7 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -223,7 +223,7 @@ function show_array_actions_to_do($max = 5) $datep2 = $db->jdate($obj->dp2); // Date - print ''.dol_print_date($datep, 'day').' '; + print ''.dol_print_date($datep, 'day').' '; $late = 0; if ($obj->percent == 0 && $datep && $datep < time()) $late = 1; if ($obj->percent == 0 && !$datep && $datep2 && $datep2 < time()) $late = 1; @@ -315,11 +315,11 @@ function show_array_last_actions_done($max = 5) print ''; // Date - print ''.dol_print_date($db->jdate($obj->da2), 'day'); + print ''.dol_print_date($db->jdate($obj->da2), 'day'); print ""; - // Statut - print "".$staticaction->LibStatut($obj->percent, 3)."\n"; + // Status + print ''.$staticaction->LibStatut($obj->percent, 3)."\n"; print "\n"; $i++; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 447f57ee40d..24538c78d66 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -289,26 +289,24 @@ if ($result) print "\n"; // Type print ''; - if ($thirdparty_static->client == 1 || $thirdparty_static->client == 3) + $obj = $thirdparty_static; + $s = ''; + if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - $thirdparty_static->name = $langs->trans("Customer"); - print $thirdparty_static->getNomUrl(0, 'customer', 0, 1); + $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; } - if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / "; - if (($thirdparty_static->client == 2 || $thirdparty_static->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { - $thirdparty_static->name = $langs->trans("Prospect"); - print $thirdparty_static->getNomUrl(0, 'prospect', 0, 1); + $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $thirdparty_static->fournisseur) + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) { - if ($thirdparty_static->client) print " / "; - $thirdparty_static->name = $langs->trans("Supplier"); - print $thirdparty_static->getNomUrl(0, 'supplier', 0, 1); + $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; } + print $s; print ''; // Last modified date - print ''; + print ''; print dol_print_date($thirdparty_static->date_modification, 'day'); print ""; print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ed861220816..b1cd367f258 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -807,14 +807,14 @@ if (!empty($arrayfields['country.code_iso']['checked'])) if (!empty($arrayfields['typent.code']['checked'])) { print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT)); + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1); print ''; } // Staff if (!empty($arrayfields['staff.code']['checked'])) { print ''; - print $form->selectarray("search_staff", $formcompany->effectif_array(0), $search_staff, 0, 0, 0, '', 0, 0, 0, $sort, 'maxwidth100'); + print $form->selectarray("search_staff", $formcompany->effectif_array(0), $search_staff, 0, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100', 1); print ''; } if (!empty($arrayfields['s.email']['checked'])) @@ -919,7 +919,7 @@ if (!empty($arrayfields['s.fk_stcomm']['checked'])) { $arraystcomm[$val['id']] = ($langs->trans("StatusProspect".$val['id']) != "StatusProspect".$val['id'] ? $langs->trans("StatusProspect".$val['id']) : $val['label']); } - print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); + print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2, 0, 0, '', 0, 0, 0, '', '', 1); print ''; } if (!empty($arrayfields['s2.nom']['checked'])) @@ -951,7 +951,7 @@ if (!empty($arrayfields['s.tms']['checked'])) if (!empty($arrayfields['s.status']['checked'])) { print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $search_status, 1); + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $search_status, 1, 0, 0, '', 0, 0, 0, '', '', 1); print ''; } if (!empty($arrayfields['s.import_key']['checked'])) diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index a6d9ad3d0b0..5e2d8587dd0 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -289,7 +289,9 @@ print '
'; $max = 10; $sql = "SELECT t.rowid, t.ref, t.track_id, t.datec, t.subject, t.type_code, t.category_code, t.severity_code, t.fk_statut, t.progress,"; -$sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label"; +$sql .= " type.code as type_code, type.label as type_label,"; +$sql .= " category.code as category_code, category.label as category_label,"; +$sql .= " severity.code as severity_code, severity.label as severity_label"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code"; @@ -358,18 +360,23 @@ if ($result) { print "\n"; // Type - print ''; - print $objp->type_label; + print ''; + $s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$objp->type_code, 'c_ticket_type', 'code', 'label', $objp->type_code); + print ''.$s.''; print ''; // Category print ''; - print $objp->category_label; + $s = $langs->getLabelFromKey($db, 'TicketCategoryShort'.$objp->category_code, 'c_ticket_category', 'code', 'label', $objp->category_code); + print ''.$s.''; + //print $objp->category_label; print ""; // Severity print ''; - print $objp->severity_label; + $s = $langs->getLabelFromKey($db, 'TicketSeverityShort'.$objp->severity_code, 'c_ticket_severity', 'code', 'label', $objp->severity_code); + print ''.$s.''; + //print $objp->severity_label; print ""; print ''; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 7fae1848bf5..93f8cd1ea8f 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -765,8 +765,18 @@ while ($i < min($num, $limit)) print $s; print ''; } - elseif ($key == 'category_code') print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code); - elseif ($key == 'severity_code') print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code); + elseif ($key == 'category_code') { + $s = $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code); + print ''; + print $s; + print ''; + } + elseif ($key == 'severity_code') { + $s = $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code); + print ''; + print $s; + print ''; + } elseif ($key == 'tms') print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); elseif ($key == 'fk_user_create') { if ($object->fk_user_create > 0) {