diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 6b7c1c003a9..c717d20be84 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -120,7 +120,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>''); diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php new file mode 100644 index 00000000000..7211877a593 --- /dev/null +++ b/htdocs/core/boxes/box_lastlogin.php @@ -0,0 +1,113 @@ + + * Copyright (C) 2005-2017 Laurent Destailleur + * Copyright (C) 2014-2015 Frederic France + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_lastlogin.php + * \ingroup core + * \brief Module to show box of bills, orders & propal of the current year + */ + +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + +/** + * Class to manage the box of last login + */ +class box_lastlogin extends ModeleBoxes +{ + var $boxcode="lastlogin"; + var $boximg="object_user"; + var $boxlabel='BoxLoginInformation'; + var $depends = array("user"); + + var $db; + var $param; + var $enabled = 1; + + var $info_box_head = array(); + var $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; + } + + /** + * Charge les donnees en memoire pour affichage ulterieur + * + * @param int $max Maximum number of records to load + * @return void + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $textHead = $langs->trans("BoxLoginInformation"); + $this->info_box_head = array( + 'text' => $textHead, + 'limit'=> dol_strlen($textHead), + ); + + $line=0; + $this->info_box_contents[$line][0] = array( + 'td' => '', + 'text' => $langs->trans("User"), + ); + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $user->getNomUrl(1), + 'asis' => 1 + ); + + $line=1; + $this->info_box_contents[$line][0] = array( + 'td' => '', + 'text' => $langs->trans("PreviousConnexion"), + ); + if ($user->datepreviouslogin) $tmp= dol_print_date($user->datepreviouslogin,"dayhour",'tzuser'); + else $tmp= $langs->trans("Unknown"); + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $tmp, + ); + + } + + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return void + */ + function showBox($head = null, $contents = null, $nooutput=0) + { + parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index f481cdffb8e..f4e9b0d7356 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -74,7 +74,9 @@ class modUser extends DolibarrModules $this->const = array(); // Boxes - $this->boxes = array(); + $this->boxes = array( + 0=>array('file'=>'box_lastlogin.php','enabledbydefaulton'=>'Home'), + ); // Permissions $this->rights = array(); diff --git a/htdocs/index.php b/htdocs/index.php index 233f94ea22c..4e2fac98fa5 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -113,6 +113,7 @@ print '
'; /* * Informations area */ +/* Was moved into a widget $boxinfo=''; $boxinfo.= '
'; $boxinfo.= '
'.$langs->trans("Nature").''.$langs->trans("NbOfMembers").''.$langs->trans("LastMemberDate").''.$langs->trans("LatestSubscriptionDate").'
'; @@ -127,8 +128,7 @@ $boxinfo.= ''; $boxinfo.= "\n"; $boxinfo.= "
\n"; $boxinfo.= ''; -//print $boxinfo; - +*/ /* * Dashboard Dolibarr states (statistics) @@ -593,7 +593,7 @@ $boxlist.=''."\n"; $boxlist.='
'; -$boxlist.=$boxinfo; +//$boxlist.=$boxinfo; $boxlist.=$boxstat; $boxlist.=$resultboxes['boxlista']; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 09aa85d48c3..c9391256f66 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -431,6 +431,21 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) migrate_reload_menu($db,$langs,$conf,$versionto); } + // Scripts for last version + $afterversionarray=explode('.','5.0.9'); + $beforeversionarray=explode('.','6.0.9'); + if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0) + { + // Reload modules (this must be always and only into last targeted version) + $listofmodule=array( + 'MAIN_MODULE_USER'=>'newboxdefonly', + ); + migrate_reload_modules($db,$langs,$conf,$listofmodule); + + // Reload menus (this must be always and only into last targeted version) + migrate_reload_menu($db,$langs,$conf,$versionto); + } + // Can force activation of some module during migration with third paramater = MAIN_MODULE_XXX,MAIN_MODULE_YYY,... if ($enablemodules) { diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 38b03b4268d..0e6c5019cac 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -1,4 +1,5 @@ # Dolibarr language file - Source file is en_US - boxes +BoxLoginInformation=Login information BoxLastRssInfos=Rss information BoxLastProducts=Latest %s products/services BoxProductsAlertStock=Stock alerts for products diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 21feb74c829..d306d6e4998 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -150,6 +150,7 @@ MembersByTownDesc=This screen show you statistics on members by town. MembersStatisticsDesc=Choose statistics you want to read... MenuMembersStats=Statistics LastMemberDate=Latest member date +LatestSubscriptionDate=Latest subscription date Nature=Nature Public=Information are public NewMemberbyWeb=New member added. Awaiting approval