From 010c5af2457b5a9263cff9488da02aa771c06777 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 19 Jul 2018 16:48:20 +0200 Subject: [PATCH] Clean and update code --- htdocs/projet/tasks/contact.php | 7 +------ htdocs/ticket/class/actions_ticket.class.php | 20 ++++++++------------ htdocs/user/param_ihm.php | 12 ++++++------ 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 1ca25090876..4d78aad4764 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -352,8 +352,6 @@ if ($id > 0 || ! empty($ref)) print ' '; print "\n"; - $var = false; - print '
'; print ''; print ''; @@ -436,7 +434,6 @@ if ($id > 0 || ! empty($ref)) print "\n"; $companystatic = new Societe($db); - $var = true; foreach(array('internal','external') as $source) { @@ -446,9 +443,7 @@ if ($id > 0 || ! empty($ref)) $i = 0; while ($i < $num) { - $var = !$var; - - print ''; + print ''; // Source print ''; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 6dc946ebad3..f49325a5bc5 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -1001,7 +1001,7 @@ class ActionsTicket */ public function viewTicketLogs($show_user = true) { - global $conf, $langs, $bc; + global $conf, $langs; // Load logs in cache $ret = $this->dao->loadCacheLogsTicket(); @@ -1021,11 +1021,8 @@ class ActionsTicket print ''; } - $var = true; - foreach ($this->dao->cache_logs_ticket as $id => $arraylogs) { - $var = !$var; - print ""; + print ''; print ''; print dol_print_date($arraylogs['datec'], 'dayhour'); print ''; @@ -1042,7 +1039,7 @@ class ActionsTicket print ''; } print ''; - print ""; + print ''; print ''; print dol_nl2br($arraylogs['message']); @@ -1064,7 +1061,7 @@ class ActionsTicket */ public function viewTimelineTicketLogs($show_user = true, $object = true) { - global $conf, $langs, $bc; + global $conf, $langs; // Load logs in cache $ret = $object->loadCacheLogsTicket(); @@ -1171,7 +1168,7 @@ class ActionsTicket */ public function viewTicketMessages($show_private, $show_user = true) { - global $conf, $langs, $user, $bc; + global $conf, $langs, $user; global $object; // Load logs in cache @@ -1202,8 +1199,7 @@ class ActionsTicket || ($arraymsgs['private'] == "1" && $show_private) ) { //print ''; - $var = !$var; - print ""; + print ''; print ''; print dol_print_date($arraymsgs['datec'], 'dayhour'); print ''; @@ -1221,7 +1217,7 @@ class ActionsTicket print ''; } print ''; - print ""; + print ''; print ''; print $arraymsgs['message']; print ''; @@ -1244,7 +1240,7 @@ class ActionsTicket */ public function viewTicketTimelineMessages($show_private, $show_user, Ticket $object) { - global $conf, $langs, $user, $bc; + global $conf, $langs, $user; // Load logs in cache $ret = $object->loadCacheMsgsTicket(); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 76b25751806..1bf0dbbe785 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -244,7 +244,7 @@ if ($action == 'edit') print ''; print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE); print ''; - print 'conf->MAIN_LANDING_PAGE)?" checked":""); + print 'conf->MAIN_LANDING_PAGE)?" checked":""); print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print ''; @@ -259,7 +259,7 @@ if ($action == 'edit') print $s?$s.' ':''; print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; - print 'conf->MAIN_LANG_DEFAULT)?" checked":""); + print 'conf->MAIN_LANG_DEFAULT)?" checked":""); print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print ''; @@ -269,7 +269,7 @@ if ($action == 'edit') // Taille max des listes print ''.$langs->trans("MaxSizeList").''; print ''.$conf->global->MAIN_SIZE_LISTE_LIMIT.''; - print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":""); + print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":""); print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print ''; @@ -306,7 +306,7 @@ else print ''; print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE); print ''; - print 'conf->MAIN_LANDING_PAGE)?" checked":""); + print 'conf->MAIN_LANDING_PAGE)?" checked":""); print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print ''; @@ -326,7 +326,7 @@ else print ($s?$s.' ':''); print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; - print 'conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print 'conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; print ''; $s=(isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : ''); print ($s?$s.' ':''); @@ -336,7 +336,7 @@ else print ''.$langs->trans("MaxSizeList").''; print ''.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').''; - print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print 'conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").''; print '' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:' ') . ''; print '
';