mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed adduser bug
Always show notification bubble Added tooltip to archive's sticky button
This commit is contained in:
@ -110,7 +110,7 @@ function adduser($username, $password, $level, $email='', $realname='', $can_mod
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach (dbFetchRows('select notifications.* from notifications where not exists( select 1 from notifications_attribs where notifications.notifications_id = notifications_attribs.notifications_id and notifications_attribs.user_id = ?) order by notifications.notifications_id desc',array($userid)) as $notif) {
|
foreach (dbFetchRows('select notifications.* from notifications where not exists( select 1 from notifications_attribs where notifications.notifications_id = notifications_attribs.notifications_id and notifications_attribs.user_id = ?) order by notifications.notifications_id desc',array($userid)) as $notif) {
|
||||||
dbInsert(array('notifications_id'=>$notif['notification_id'],'user_id'=>$userid,'key'=>'read','value'=>1),'notifications_attribs');
|
dbInsert(array('notifications_id'=>$notif['notifications_id'],'user_id'=>$userid,'key'=>'read','value'=>1),'notifications_attribs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $userid;
|
return $userid;
|
||||||
|
@ -490,9 +490,7 @@ if(is_file("includes/print-menubar-custom.inc.php")) {
|
|||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<?php
|
<?php
|
||||||
$notifications = new ObjCache('notifications');
|
$notifications = new ObjCache('notifications');
|
||||||
if (($notifications['sticky_count']+$notifications['count']) != 0) {
|
echo ' <li><a href="notifications/"><span class="badge count-notif">'.($notifications['sticky_count']+$notifications['count']).'</span></a></li>';
|
||||||
echo ' <li><a href="notifications/"><span class="badge count-notif">'.($notifications['sticky_count']+$notifications['count']).'</span></a></li>';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-cog fa-fw fa-lg fa-nav-icons"></i></a>
|
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-cog fa-fw fa-lg fa-nav-icons"></i></a>
|
||||||
|
@ -127,7 +127,7 @@ $notifications = new ObjCache('notifications');
|
|||||||
<div class="well">
|
<div class="well">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h4 id="<?php echo $notif['notifications_id']; ?>"><?php echo $notif['title']; ?><button class="btn btn-primary fa fa-bell-o pull-right stick-notif" style="margin-top:-10px;"></button></h4>
|
<h4 id="<?php echo $notif['notifications_id']; ?>"><?php echo $notif['title']; echo ($_SESSION['userlevel'] == 10 ? '<span class="pull-right"><button class="btn btn-primary fa fa-bell-o stick-notif" data-toggle="tooltip" data-placement="bottom" title="Mark as Sticky" style="margin-top:-10px;"></button></span>' : ''); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -175,6 +175,7 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on( "click", ".read-notif", function() {
|
$(document).on( "click", ".read-notif", function() {
|
||||||
|
$(this).attr("disabled", true);
|
||||||
var notif = $(this).parent().parent().attr('id');
|
var notif = $(this).parent().parent().attr('id');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@ -190,6 +191,7 @@ $(function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$(this).attr("disabled", false);
|
||||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user