NEW Add last activation author and ip of modules

This commit is contained in:
Laurent Destailleur 2017-05-06 20:43:14 +02:00
parent d948447600
commit 910a925167
19 changed files with 84 additions and 24 deletions

View File

@ -330,6 +330,24 @@ if ($mode == 'desc')
else $text.=$langs->trans("Disabled");
$text.='<br>';
$tmp = $objMod->getLastActivationInfo();
$authorid = $tmp['authorid'];
if ($authorid > 0)
{
$tmpuser = new User($db);
$tmpuser->fetch($authorid);
$text.='<strong>'.$langs->trans("LastActivationAuthor").':</strong> ';
$text.= $tmpuser->getNomUrl(1);
$text.='<br>';
}
$ip = $tmp['ip'];
if ($ip)
{
$text.='<strong>'.$langs->trans("LastActivationIP").':</strong> ';
$text.= $ip;
$text.='<br>';
}
$moduledesclong=$objMod->getDescLong();
if ($moduledesclong) $text.='<br><hr><div class="moduledesclong">'.$moduledesclong.'<div>';
}

View File

@ -402,9 +402,9 @@ if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouM
print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup');
// Start to show page
if ($mode=='common') print $langs->trans("ModulesDesc")."<br>\n";
if ($mode=='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."<br>\n";
if ($mode=='deploy') print $langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."<br>\n";
if ($mode=='common') print '<span class="opacitymedium">'.$langs->trans("ModulesDesc")."</span><br>\n";
if ($mode=='marketplace') print '<span class="opacitymedium">'.$langs->trans("ModulesMarketPlaceDesc")."</span><br>\n";
if ($mode=='deploy') print '<span class="opacitymedium">'.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."</span><br>\n";
$h = 0;

View File

@ -167,7 +167,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
$head=user_admin_prepare_head();
dol_fiche_head($head,'card', $langs->trans("MenuUsersAndGroups"), 0, 'user');
dol_fiche_head($head,'card', $langs->trans("MenuUsersAndGroups"), -1, 'user');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -205,7 +205,7 @@ print '</td></tr>';
print '</table>';
print '<br>';
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);

View File

@ -151,7 +151,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
$head=user_admin_prepare_head();
dol_fiche_head($head,'usergroupcard', $langs->trans("MenuUsersAndGroups"), 0, 'user');
dol_fiche_head($head,'usergroupcard', $langs->trans("MenuUsersAndGroups"), -1, 'user');
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);

View File

@ -1057,7 +1057,7 @@ else
// Print mail content
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
dol_fiche_head('');
dol_fiche_head('', '', '', -1);
print '<table class="border" width="100%">';

View File

@ -812,7 +812,7 @@ function activateModule($value,$withdeps=1)
return $ret;
}
$result=$objMod->init();
$result=$objMod->init(); // Enable module
if ($result <= 0)
{
$ret['errors'][]=$objMod->error;

View File

@ -269,7 +269,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
print '<div class="menu_titre" id="menu_titre_logo"></div>';
print '<div class="menu_top" id="menu_top_logo"></div>';
print '<div class="menu_contenu" id="menu_contenu_logo">';
print '<div class="center"><img title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 80%"></div>'."\n";
print '<div class="center"><img title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 70%"></div>'."\n";
print '</div>';
print '<div class="menu_end" id="menu_end_logo"></div>';
print '</div>'."\n";

View File

@ -478,7 +478,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
print '<div class="menu_titre" id="menu_titre_logo"></div>';
print '<div class="menu_top" id="menu_top_logo"></div>';
print '<div class="menu_contenu" id="menu_contenu_logo">';
print '<div class="center"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 80%"></div>'."\n";
print '<div class="center"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 70%"></div>'."\n";
print '</div>';
print '<div class="menu_end" id="menu_end_logo"></div>';
print '</div>'."\n";

View File

@ -795,6 +795,37 @@ class DolibarrModules // Can not be abstract, because we need to insta
}
/**
* Gives the last author of activation
*
* @return array Array array('authorid'=>Id of last activation user, 'lastactivationdate'=>Date of last activation)
*/
function getLastActivationInfo()
{
global $conf;
$sql = "SELECT tms, note FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE ".$this->db->decrypt('name')." = '".$this->const_name."'";
$sql.= " AND entity IN (0, ".$conf->entity.")";
dol_syslog(get_class($this)."::getLastActiveDate", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) $err++;
else
{
$obj=$this->db->fetch_object($resql);
$tmp=array();
if ($obj->note)
{
$tmp=json_decode($obj->note, true);
}
if ($obj) return array('authorid'=>$tmp['authorid'], 'ip'=>$tmp['ip'], 'lastactivationdate'=>$this->db->jdate($obj->tms));
}
return array();
}
/**
* Insert constants for module activation
*
@ -802,7 +833,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
*/
function _active()
{
global $conf;
global $conf, $user;
$err = 0;
@ -817,10 +848,13 @@ class DolibarrModules // Can not be abstract, because we need to insta
$resql=$this->db->query($sql);
if (! $resql) $err++;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible,entity) VALUES";
$note=json_encode(array('authorid'=>$user->id, 'ip'=>$_SERVER['REMOTE_ADDR']));
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name, value, visible, entity, note) VALUES";
$sql.= " (".$this->db->encrypt($this->const_name,1);
$sql.= ",".$this->db->encrypt('1',1);
$sql.= ",0,".$entity.")";
$sql.= ", ".$this->db->encrypt('1',1);
$sql.= ", 0, ".$entity;
$sql.= ", '".$this->db->escape($note)."')";
dol_syslog(get_class($this)."::_active", LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@ -258,7 +258,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
<?php if ($main_home)
{
?>
<div class="center login_main_home" style="max-width: 80%">
<div class="center login_main_home" style="max-width: 70%">
<?php echo $main_home; ?>
</div><br>
<?php

View File

@ -151,7 +151,7 @@ if (! empty($hookmanager->resArray['options'])) {
</form>
<div class="center login_main_home" style="max-width: 80%">
<div class="center login_main_home" style="max-width: 70%">
<?php if ($mode == 'dolibarr' || ! $disabled) { ?>
<font style="font-size: 12px;">
<?php echo $langs->trans('SendNewPasswordDesc'); ?>

View File

@ -302,6 +302,8 @@ CurrentVersion=Dolibarr current version
CallUpdatePage=Go to the page that updates the database structure and data: %s.
LastStableVersion=Latest stable version
LastActivationDate=Latest activation date
LastActivationAuthor=Latest activation author
LastActivationIP=Latest activation IP
UpdateServerOffline=Update server offline
WithCounter=Manage a counter
GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags could be used:<br><b>{000000}</b> corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask. <br><b>{000000+000}</b> same as previous but an offset corresponding to the number to the right of the + sign is applied starting on first %s. <br><b>{000000@x}</b> same as previous but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then sequence {yy}{mm} or {yyyy}{mm} is also required. <br><b>{dd}</b> day (01 to 31).<br><b>{mm}</b> month (01 to 12).<br><b>{yy}</b>, <b>{yyyy}</b> or <b>{y}</b> year over 2, 4 or 1 numbers. <br>
@ -1099,7 +1101,7 @@ WarningAtLeastKeyOrTranslationRequired=A search criteria is required at least fo
NewTranslationStringToShow=New translation string to show
OriginalValueWas=The original translation is overwritten. Original value was:<br><br>%s
TransKeyWithoutOriginalValue=You forced a new translation for the translation key '<strong>%s</strong>' that does not exists in any language files
TotalNumberOfActivatedModules=Total number of activated feature modules: <b>%s</b> / <b>%s</b>
TotalNumberOfActivatedModules=Activated feature/modules: <b>%s</b> / <b>%s</b>
YouMustEnableOneModule=You must at least enable 1 module
ClassNotFoundIntoPathWarning=Class %s not found into PHP path
YesInSummer=Yes in summer

View File

@ -70,7 +70,7 @@ print load_fiche_titre($langs->trans("CompanySetup"),$linkback,'title_setup');
$head = societe_admin_prepare_head();
dol_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), 0, 'company');
dol_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), -1, 'company');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -307,7 +307,7 @@ print load_fiche_titre($langs->trans("CompanySetup"),$linkback,'title_setup');
$head = societe_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("ThirdParties"), 0, 'company');
dol_fiche_head($head, 'general', $langs->trans("ThirdParties"), -1, 'company');
$dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']);

View File

@ -71,7 +71,7 @@ print load_fiche_titre($langs->trans("CompanySetup"),$linkback,'title_setup');
$head = societe_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("ThirdParties"), 0, 'company');
dol_fiche_head($head, 'attributes', $langs->trans("ThirdParties"), -1, 'company');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

BIN
htdocs/theme/dolibarr_logo.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -90,7 +90,7 @@ $colorbacklinepair1='248,248,248'; // line pair
$colorbacklinepair2='248,248,248'; // line pair
$colorbacklinepairhover='238,246,252'; // line pair
$colorbackbody='255,255,255';
$colortexttitlenotab='60,60,20';
$colortexttitlenotab='100,60,20';
$colortexttitle='0,0,0';
$colortext='0,0,0';
$colortextlink='0,0,120';
@ -988,6 +988,9 @@ div.fiche {
<?php if (! empty($conf->dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?>
<?php if (! empty($conf->dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
}
div.fiche>table:first-child {
margin-bottom: 15px !important;
}
div.fichecenter {
/* margin-top: 10px; */
width: 100%;
@ -2018,6 +2021,9 @@ a.tabTitle {
white-space: nowrap;
}
a.tabunactive {
color: rgb(<?php print $colortextlink; ?>) !important;
}
a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
font-family: <?php print $fontlist ?>;
padding: 12px 9px 12px;
@ -3034,7 +3040,7 @@ td.legendLabel { padding: 2px 2px 2px 0 !important; }
div.titre {
font-family: <?php print $fontlist ?>;
font-size: 14px;
/* font-weight: bold; */
font-weight: bold;
color: rgb(<?php print $colortexttitlenotab; ?>);
text-decoration: none;
padding-top: 5px;

View File

@ -71,7 +71,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
$head = user_admin_prepare_head();
dol_fiche_head($head, 'attributes_group', $langs->trans("MenuUsersAndGroups"), 0, 'user');
dol_fiche_head($head, 'attributes_group', $langs->trans("MenuUsersAndGroups"), -1, 'user');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -70,7 +70,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup');
$head = user_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("MenuUsersAndGroups"), 0, 'user');
dol_fiche_head($head, 'attributes', $langs->trans("MenuUsersAndGroups"), -1, 'user');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';