Skip to content
Snippets Groups Projects
Commit 7ab60078 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

NEW Move login information on home page into a widget

parent 992f292a
Branches
Tags
No related merge requests found
......@@ -120,7 +120,7 @@ print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Nature").'</td>';
print '<td align="right">'.$langs->trans("NbOfMembers").'</td>';
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
print '<td align="center">'.$langs->trans("LatestSubscriptionDate").'</td>';
print '</tr>';
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
......
<?php
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014-2015 Frederic France <frederic.france@free.fr>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \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);
}
}
......@@ -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();
......
......@@ -113,6 +113,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
/*
* Informations area
*/
/* Was moved into a widget
$boxinfo='';
$boxinfo.= '<div class="box">';
$boxinfo.= '<table summary="'.dol_escape_htmltag($langs->trans("LoginInformation")).'" class="noborder boxtable" width="100%">';
......@@ -127,8 +128,7 @@ $boxinfo.= '</td>';
$boxinfo.= "</tr>\n";
$boxinfo.= "</table>\n";
$boxinfo.= '</div>';
//print $boxinfo;
*/
/*
* Dashboard Dolibarr states (statistics)
......@@ -593,7 +593,7 @@ $boxlist.='<tr><td class="notopnoleftnoright">'."\n";
$boxlist.='<div class="fichehalfleft">';
$boxlist.=$boxinfo;
//$boxlist.=$boxinfo;
$boxlist.=$boxstat;
$boxlist.=$resultboxes['boxlista'];
......
......@@ -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)
{
......
# 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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment