From 10ab1a583a2ebd26a829abf98333a13f9a220f9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Apr 2013 01:13:20 +0200 Subject: [PATCH] Look: Optimize screens --- htdocs/comm/propal.php | 16 +++++++--- htdocs/comm/remx.php | 3 +- htdocs/commande/fiche.php | 26 ++++++++------- htdocs/compta/facture.php | 13 +++++--- htdocs/core/class/commonobject.class.php | 40 +++++++++++++++++------- htdocs/core/lib/functions.lib.php | 9 ++++-- htdocs/core/lib/project.lib.php | 9 ++++-- htdocs/core/tpl/objectline_view.tpl.php | 10 +++--- htdocs/fichinter/fiche.php | 14 ++++++--- htdocs/fourn/commande/fiche.php | 21 +++++++------ htdocs/fourn/facture/fiche.php | 13 +++++--- 11 files changed, 110 insertions(+), 64 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 9c77da67765..b2cae60f115 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -9,7 +9,7 @@ * Copyright (C) 2010-2011 Philippe Grand * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2013 Florian Henry - * + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -2124,8 +2124,9 @@ else if ($action != 'presend') { - print '
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* @@ -2147,14 +2148,19 @@ else */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; + + print '
'; + //print '
'; + // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'propal',$socid); - print '
'; + + //print '
'; + print ''; } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 1588a0761d3..7f92b7e65c0 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -269,7 +269,8 @@ if ($socid > 0) print_fiche_titre($langs->trans("NewGlobalDiscount"),'',''); print ''; print ''; - print ''; + print ''; print ''; print ''; // Private note @@ -3444,8 +3444,9 @@ else if ($id > 0 || ! empty($ref)) if ($action != 'prerelance' && $action != 'presend') { - print '
'.$langs->trans("AmountHT").' '.$langs->trans("Currency".$conf->currency).'
'; + print ' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("VAT").''; print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 150a55923dd..b8658408e48 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -9,17 +9,17 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Marcos GarcĂ­a * Copyright (C) 2013 Florian Henry - * + * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ @@ -272,7 +272,7 @@ else if ($action == 'add' && $user->rights->commande->creer) { $object->linked_objects = array_merge($object->linked_objects, $other_linked_objects); } - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -373,7 +373,7 @@ else if ($action == 'add' && $user->rights->commande->creer) { // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - + $object_id = $object->create($user); // If some invoice's lines already known @@ -2441,13 +2441,13 @@ else if ($action != 'presend') { - print '
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* * Documents generes - * - */ + */ $comref = dol_sanitizeFileName($object->ref); $file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf'; $relativepath = $comref.'/'.$comref.'.pdf'; @@ -2461,17 +2461,19 @@ else /* * Linked object block - */ + */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; + print '
'; + //print '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'order',$socid); - print '
'; + //print '
'; + print ''; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 3cc3677d301..76ecaa5b1ad 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2122,7 +2122,7 @@ if ($action == 'create') } $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); - + //print '
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* * Documents generes @@ -3472,7 +3473,8 @@ else if ($id > 0 || ! empty($ref)) print showPaypalPaymentUrl('invoice',$object->ref); } - print ''; + print '
'; + //print '
'; print '
'; @@ -3481,7 +3483,8 @@ else if ($id > 0 || ! empty($ref)) $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'invoice',$socid); - print '
'; + //print '
'; + print ''; } else { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 124447bb81c..013d80e350f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1418,7 +1418,7 @@ abstract class CommonObject dol_syslog(get_class($this)."::upate_note Parameter suffix must be empty, '_private' or '_public'", LOG_ERR); return -2; } - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= " SET note".$suffix." = ".(!empty($note)?("'".$this->db->escape($note)."'"):"NULL"); $sql.= " WHERE rowid =". $this->id; @@ -1441,7 +1441,7 @@ abstract class CommonObject /** * Update public note (kept for backward compatibility) - * + * * @param string $note New value for note * @return int <0 if KO, >0 if OK * @deprecated @@ -1450,7 +1450,7 @@ abstract class CommonObject { return $this->update_note($note,'_public'); } - + /** * Update total_ht, total_ttc and total_vat for an object (sum of lines) * @@ -2702,31 +2702,47 @@ abstract class CommonObject global $conf,$langs,$hookmanager; print ''; - if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) - { - print ' '; - } + + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ' '; + + // Description print ''.$langs->trans('Description').''; + + // VAT print ''.$langs->trans('VAT').''; + + // Price HT print ''.$langs->trans('PriceUHT').''; - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - print ' '; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) print ' '; + + // Qty print ''.$langs->trans('Qty').''; + + // Reduction short print ''.$langs->trans('ReductionShort').''; + if (! empty($conf->margin->enabled)) { if ($conf->global->MARGIN_TYPE == "1") print ''.$langs->trans('BuyingPrice').''; else print ''.$langs->trans('CostPrice').''; + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.$langs->trans('MarginRate').''; if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''.$langs->trans('MarkRate').''; } + + // Total HT print ''.$langs->trans('TotalHTShort').''; - print ' '; - print ' '; - print ' '; // No width to allow autodim + + print ''; + + print ''; + + print ''; // No width to allow autodim + print "\n"; $num = count($this->lines); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d1e6f216b2e..7ea8087613e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1216,9 +1216,14 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" } } - if (! empty($addlink)) + if (! empty($addlink)) // Link on phone number + link to add action (if conf->global->AGENDA_ADDACTIONFORPHONE set) { - if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') + if (! empty($conf->browser)) // If phone, we use link of phone + { + $newphone =''; + } + else if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url { if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial(); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ac8140a2239..7f4be0bc8a3 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -438,7 +438,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Tick to drag and drop if ($addordertick) { - print ' '; + print ' '; } print "\n"; @@ -459,13 +459,16 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($total>0) { - print ''.$langs->trans("Total").''; + print ''; + print ''.$langs->trans("Total").''; if ($showproject) print ''; print ''; print ''; print ''; print ''; - print ''.convertSecondToTime($total).''; + if ($addordertick) print ''; + print ''.convertSecondToTime($total).''; + print ''; } return $inc; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 051f4f98071..059cf7b83d4 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -125,8 +125,8 @@ global->DISPLAY_MARGIN_RATES)) {?> pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?> global->DISPLAY_MARK_RATES)) {?> + } + if (! empty($conf->global->DISPLAY_MARK_RATES)) {?> marque_tx).'%'; ?> @@ -152,7 +152,7 @@ - 1) { ?> + 1 && empty($conf->browser->phone)) { ?> 0) { ?> id; ?>"> @@ -166,10 +166,10 @@ -   + browser->phone)?' class="tdlineupdown"':''); ?>> -   + diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 4e8b9e2b1d8..70fed335c93 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1442,7 +1442,9 @@ else if ($id > 0 || ! empty($ref)) if ($action != 'presend') { - print '
'; + print '
'; + //print '"; - print "
'; + /* * Built documents */ @@ -1464,14 +1466,16 @@ else if ($id > 0 || ! empty($ref)) */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; + //print ''; + print '
'; + // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'fichinter',$socid); - print "
"; - print " 
\n"; + + print '
'; + //print "
\n"; } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 6d405305d6a..a97148ab531 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent @@ -999,7 +999,7 @@ if ($action=="create") print ''; print ''; - + print ''.$langs->trans('NotePublic').''; print ''; $doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); @@ -1016,7 +1016,7 @@ if ($action=="create") //print ''; print ''; - + // Other options $parameters=array(); @@ -1516,7 +1516,7 @@ elseif (! empty($object->id)) $parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i); $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action); } - + $nbrows=ROWS_2; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; $doleditor=new DolEditor('eldesc',$line->description,'',200,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); @@ -1671,7 +1671,7 @@ elseif (! empty($object->id)) */ if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete') { - print '
'; + print '
'; // Validate if ($object->statut == 0 && $num > 0) @@ -1763,8 +1763,9 @@ elseif (! empty($object->id)) print "
"; } - print '
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* * Documents generes @@ -1785,7 +1786,8 @@ elseif (! empty($object->id)) */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; + //print ''; + print '
'; if ($user->rights->fournisseur->commande->commander && $object->statut == 2) { @@ -1853,7 +1855,8 @@ elseif (! empty($object->id)) $somethingshown=$formactions->showactions($object,'order_supplier',$socid); */ - print '
'; + print '
'; + //print '
'; } /* diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 0264b6b3c3a..3c9b268e492 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -2057,8 +2057,9 @@ else if ($action != 'edit') { - print '
'; - print ''; // ancre + print '
'; + //print '
'; + //print ''; // ancre /* * Documents generes @@ -2081,15 +2082,17 @@ else */ $somethingshown=$object->showLinkedObjectBlock(); - print ''; - print '
'; + print '
'; + //print '
'; + //print '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'invoice_supplier',$socid); - print '
'; + print '
'; + //print '
'; } } /*