From 4902df7e3faf7d9ceb1018cecb28cef799129383 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Apr 2017 19:28:38 +0200 Subject: [PATCH] Work on look and feel v6 --- htdocs/langs/en_US/mails.lang | 4 +- htdocs/societe/agenda.php | 4 +- htdocs/societe/list.php | 2 +- htdocs/societe/notify/card.php | 62 +++++++++++++++-------- htdocs/user/card.php | 6 +-- htdocs/user/notify/card.php | 91 +++++++++++++++++++++++++++------- 6 files changed, 121 insertions(+), 48 deletions(-) diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 93c3e584ff6..e546965d60d 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -116,8 +116,8 @@ Notifications=Notifications NoNotificationsWillBeSent=No email notifications are planned for this event and company ANotificationsWillBeSent=1 notification will be sent by email SomeNotificationsWillBeSent=%s notifications will be sent by email -AddNewNotification=Activate a new email notification target -ListOfActiveNotifications=List all active targets for email notification +AddNewNotification=Activate a new email notification target/event +ListOfActiveNotifications=List all active targets/events for email notification ListOfNotificationsDone=List all email notifications sent MailSendSetupIs=Configuration of email sending has been setup to '%s'. This mode can't be used to send mass emailing. MailSendSetupIs2=You must first go, with an admin account, into menu %sHome - Setup - EMails%s to change parameter '%s' to use mode '%s'. With this mode, you can enter setup of the SMTP server provided by your Internet Service Provider and use Mass emailing feature. diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 36fbe790bf3..e1dc1c12671 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -58,7 +58,7 @@ if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield='a.datep, a.id'; +if (! $sortfield) $sortfield='a.datep,a.id'; if (! $sortorder) $sortorder='DESC'; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array @@ -190,7 +190,7 @@ if ($socid > 0) $filters=array(); $filters['search_agenda_label']=$search_agenda_label; - // TODO Replace this with smae code then into listactions.php + // TODO Replace this with same code than into listactions.php show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); } } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1a9980bbf12..9bde47887ed 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -88,7 +88,7 @@ $sortorder=GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="s.nom"; -if (empty($page) || $page == -1) { $page = 0 ; } +if (empty($page) || $page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index d7445233c71..8b77c8f52a4 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -44,15 +44,16 @@ $actionid=GETPOST('actionid'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'societe','',''); -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield=GETPOST("sortfield",'alpha'); +$sortorder=GETPOST("sortorder",'alpha'); +$page=GETPOST("page",'int'); if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="n.daten"; +if (empty($page) || $page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; $now=dol_now(); @@ -188,7 +189,7 @@ if ($result > 0) print ''; } - print ''.$langs->trans("NbOfActiveNotifications").''; // Notification for this thirdparty + /*print ''.$langs->trans("NbOfActiveNotifications").''; // Notification for this thirdparty print ''; $nbofrecipientemails=0; $notify=new Notify($db); @@ -198,7 +199,8 @@ if ($result > 0) if (! empty($tmpkey)) $nbofrecipientemails++; } print $nbofrecipientemails; - print ''; + print '';*/ + print ''; print ''; @@ -286,7 +288,7 @@ if ($result > 0) $sql.= " WHERE a.rowid = n.fk_action"; $sql.= " AND c.rowid = n.fk_contact"; $sql.= " AND c.fk_soc = ".$object->id; - + $resql=$db->query($sql); if ($resql) { @@ -299,8 +301,7 @@ if ($result > 0) // List of active notifications print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','',''); - $var=true; - + // Line with titles print ''; print ''; @@ -321,14 +322,12 @@ if ($result > 0) while ($i < $num) { - $var = !$var; - $obj = $db->fetch_object($resql); $contactstatic->id=$obj->contactid; $contactstatic->lastname=$obj->lastname; $contactstatic->firstname=$obj->firstname; - print '
'.$contactstatic->getNomUrl(1); + print '
'.$contactstatic->getNomUrl(1); if ($obj->type == 'email') { if (isValidEmail($obj->email)) @@ -425,6 +424,16 @@ if ($result > 0) $sql.= " AND n.fk_soc = ".$object->id; $sql.= $db->order($sortfield, $sortorder); + // Count total nb of records + $nbtotalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); + } + + $sql.= $db->plimit($limit+1, $offset); + $resql=$db->query($sql); if ($resql) { @@ -435,9 +444,20 @@ if ($result > 0) dol_print_error($db); } - // List of notifications done - print load_fiche_titre($langs->trans("ListOfNotificationsDone").' ('.$num.')','',''); - $var=true; + $param='&socid='.$object->id; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + + print '
'; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + // List of active notifications + print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); // Line with titles print ''; @@ -457,11 +477,9 @@ if ($result > 0) while ($i < $num) { - $var = !$var; - $obj = $db->fetch_object($resql); - print '
'; + print '
'; if ($obj->id > 0) { $contactstatic->id=$obj->id; @@ -501,6 +519,8 @@ if ($result > 0) } print '
'; + + print '
'; } else dol_print_error('','RecordNotFound'); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 37a0042c137..e213578b860 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -723,11 +723,10 @@ if (($action == 'create') || ($action == 'adduserldap')) print dol_set_focus('#lastname'); - print ''; - - print ''; + print '
'; // Lastname + print ''; print ''; print ''; print ''; }*/ - if ($user->admin) + /*if ($user->admin) { $var = ! $var; print ''; - } + }*/ print '
'.$langs->trans("Lastname").''; if (! empty($ldap_lastname)) @@ -1257,7 +1256,6 @@ else dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); - print '
'; print '
'; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 305bb3d226b..f18197dccc8 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -44,15 +44,16 @@ $actionid=GETPOST('actionid'); if ($user->societe_id) $id=$user->societe_id; $result = restrictedArea($user, 'societe','',''); -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield=GETPOST("sortfield",'alpha'); +$sortorder=GETPOST("sortorder",'alpha'); +$page=GETPOST("page",'int'); if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="n.daten"; +if (empty($page) || $page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; $now=dol_now(); @@ -135,12 +136,45 @@ if ($result > 0) $head = user_prepare_head($object); - dol_fiche_head($head, 'notify', $langs->trans("User"), 0, 'user'); + dol_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user'); $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', '', '', 0, '', '', 1, ''); + dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', '', '', 0, '', '', 0, ''); + print '
'; + + print '
'; + print ''; + + // Login + print ''; + if (! empty($object->ldap_sid) && $object->statut==0) + { + print ''; + } + else + { + print ''; + } + print ''."\n"; + + /*print ''; // Notification for this thirdparty + print '';*/ + + print '
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.'
'.$langs->trans("NbOfActiveNotifications").''; + $nbofrecipientemails=0; + $notify=new Notify($db); + $tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user')); + foreach($tmparray as $tmpkey => $tmpval) + { + $nbofrecipientemails++; + } + print $nbofrecipientemails; + print '
'; + + print '
'; + dol_fiche_end(); print "\n"; @@ -345,13 +379,13 @@ if ($result > 0) print '
'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'
'; print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).''; print '
'; @@ -364,12 +398,22 @@ if ($result > 0) $sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,"; $sql.= " a.code, a.label"; $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,"; - $sql.= " ".MAIN_DB_PREFIX."notify as n "; + $sql.= " ".MAIN_DB_PREFIX."notify as n"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid"; $sql.= " WHERE a.rowid = n.fk_action"; $sql.= " AND n.fk_user = ".$object->id; $sql.= $db->order($sortfield, $sortorder); + // Count total nb of records + $nbtotalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); + } + + $sql.= $db->plimit($limit+1, $offset); + $resql=$db->query($sql); if ($resql) { @@ -380,10 +424,21 @@ if ($result > 0) dol_print_error($db); } + $param='&id='.$object->id; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + + print '
'; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + // List of notifications done - print_fiche_titre($langs->trans("ListOfNotificationsDone").' ('.$num.')','',''); - $var=true; - + print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); + // Line with titles print ''; print ''; @@ -402,11 +457,9 @@ if ($result > 0) while ($i < $num) { - $var = !$var; - $obj = $db->fetch_object($resql); - print '
'; + print '
'; if ($obj->id > 0) { $userstatic->id=$obj->id; @@ -446,6 +499,8 @@ if ($result > 0) } print '
'; + + print '
'; } else dol_print_error('','RecordNotFound');