init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
247
KretaWeb/Views/Shared/JavascriptTemplates/UserMenu.cshtml
Normal file
247
KretaWeb/Views/Shared/JavascriptTemplates/UserMenu.cshtml
Normal file
|
@ -0,0 +1,247 @@
|
|||
@using Kreta.BusinessLogic.Security
|
||||
@using Kreta.Web.Security
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<script type="text/javascript">
|
||||
function popupCheck() {
|
||||
MasterLayoutHelper.checkNeedDashboardPopup();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var deleteCookie = function (name) {
|
||||
$.cookie(name, null, { path: '/' });
|
||||
};
|
||||
|
||||
function setCookie(actDate, frequencyRate) {
|
||||
actDate.setTime(actDate.getTime() + (frequencyRate));
|
||||
$.cookie("EUgyUzenetekRecheck", actDate.getTime(), { expires: actDate, secure: true });
|
||||
|
||||
var newDate = new Date();
|
||||
var difference = actDate - newDate.getTime();
|
||||
|
||||
setTimeout(function () {
|
||||
EUgyCall();
|
||||
}, difference);
|
||||
};
|
||||
|
||||
function setCookieFrissitesDatum(actDate, frequencyRate) {
|
||||
actDate.setTime(actDate.getTime() + (frequencyRate));
|
||||
$.cookie("FrissitesiDatum", actDate.getTime(), { expires: actDate, secure: true });
|
||||
|
||||
var newDate = new Date();
|
||||
var difference = actDate - newDate.getTime();
|
||||
|
||||
setTimeout(function () {
|
||||
FrissitesiDatumCall();
|
||||
}, difference);
|
||||
};
|
||||
|
||||
function EUgyCall() {
|
||||
if ("@ClaimData.IsAktivUzenetekMenu.ToString()" === "True") {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "@Url.Action("EUgyUzenetekRecheck", "Home", new { area = "" })", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
|
||||
xhr.onreadystatechange = function () {
|
||||
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
|
||||
EUgyCallSuccess(this.responseText);
|
||||
}
|
||||
}
|
||||
xhr.send();
|
||||
}
|
||||
};
|
||||
|
||||
function FrissitesiDatumCall() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "@Url.Action("GetIsFrissitesWarrning", "Home", new { area = "" })", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
|
||||
xhr.onreadystatechange = function () {
|
||||
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
|
||||
FrissitesiDatumCallSuccess(this.responseText);
|
||||
}
|
||||
}
|
||||
xhr.send();
|
||||
};
|
||||
|
||||
function EUgyCallSuccess(data) {
|
||||
var obj = jQuery.parseJSON(data);
|
||||
var date = new Date();
|
||||
setCookie(date, obj.frequencyRate);
|
||||
|
||||
if (obj) {
|
||||
var element = $(".messageCountBadge");
|
||||
if (element.length == 0) {
|
||||
setTimeout(function () { $(".messageCountBadge").attr('data-badge', obj.cnt); }, 2000);
|
||||
}
|
||||
else {
|
||||
$(".messageCountBadge").attr('data-badge', obj.cnt);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var interval = 0;
|
||||
|
||||
function FrissitesiDatumCallSuccess(data) {
|
||||
var obj = jQuery.parseJSON(data);
|
||||
var date = new Date();
|
||||
setCookieFrissitesDatum(date, obj.frequencyRate);
|
||||
|
||||
if (obj != null && obj.isFrissites) {
|
||||
$("#frissitesDatumDiv").show();
|
||||
var duration = obj.duration;
|
||||
|
||||
if (duration <= 900 && duration >= 300) {
|
||||
$(".main-header, #frissitesDatumDiv").css("background", "#FFECC7"); $(".selectTanev span span").css("background", "#FFECC7");
|
||||
}
|
||||
if (duration <= 300) {
|
||||
$(".main-header, #frissitesDatumDiv").css("background", "#FFBFC4"); $(".selectTanev span span").css("background", "#FFBFC4");
|
||||
}
|
||||
|
||||
var countDownTimer = 0;
|
||||
var actualTime = duration;
|
||||
resetInterval();
|
||||
interval = setInterval(function () {
|
||||
var minutes = parseInt(actualTime / 60, 10);
|
||||
var seconds = parseInt(actualTime % 60, 10);
|
||||
|
||||
minutes = minutes < 10 ? "0" + minutes : minutes;
|
||||
seconds = seconds < 10 ? "0" + seconds : seconds;
|
||||
$(".frissitesDatumText").text(minutes + ":" + seconds);
|
||||
countDownTimer = countDownTimer + 1;
|
||||
actualTime = duration - countDownTimer;
|
||||
|
||||
if (actualTime == 900) { $(".main-header, #frissitesDatumDiv").css("background", "#FFECC7"); $(".selectTanev span span").css("background", "#FFECC7"); KretaWindowHelper.notification("@AdminisztracioResource.Frissitesig15Perc", "warning"); }
|
||||
if (actualTime == 600) { $(".main-header, #frissitesDatumDiv").css("background", "#FFECC7"); $(".selectTanev span span").css("background", "#FFECC7"); KretaWindowHelper.notification("@AdminisztracioResource.Frissitesig10Perc", "warning"); }
|
||||
if (actualTime == 300) { $(".main-header, #frissitesDatumDiv").css("background", "#FFBFC4"); $(".selectTanev span span").css("background", "#FFBFC4"); KretaWindowHelper.notification("@AdminisztracioResource.Frissitesig5Perc", "error"); }
|
||||
}, 1000);
|
||||
}
|
||||
else {
|
||||
$("#frissitesDatumDiv").hide();
|
||||
}
|
||||
};
|
||||
|
||||
function resetInterval() {
|
||||
clearInterval(interval);
|
||||
interval = 0;
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
deleteCookie('EUgyUzenetekRecheck');
|
||||
EUgyCall();
|
||||
|
||||
deleteCookie('FrissitesiDatum');
|
||||
FrissitesiDatumCall();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script id="UserMenuTemplate" type="text/x-jQuery-tmpl">
|
||||
<div class="usermenu">
|
||||
<div class="pull-right topnotif">
|
||||
<div title="@LayoutResource.Termekportal">
|
||||
<a href="@Url.Action("Index", Constants.Controllers.Termekportal, new {area = Constants.Areas.Nyomtatvanyok})">
|
||||
<i class="fa fa-question"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right topnotif">
|
||||
<div title="@LayoutResource.Tudasbazis">
|
||||
<a target="_blank" href="https://tudasbazis.ekreta.hu/"><i class="fa fa-book"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
@if (ClaimData.IsActivTanev && !ClaimData.IsDefaultAdminUser)
|
||||
{
|
||||
<div class="pull-right topnotif">
|
||||
<div title="@LayoutResource.Elearning">
|
||||
<a href="@Url.Action("Index", Constants.Controllers.ELearning, new { area = Constants.Areas.Adminisztracio })">
|
||||
<i class="fa fa-tasks"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (ClaimData.FelhasznaloSzerepkor == Kreta.Enums.SzerepkorTipusEnum.Adminisztrator)
|
||||
{
|
||||
<div class="pull-right topnotif ugyfelszolgalat_icon" title="@LayoutResource.Ugyfelszolgalat" onclick="JiraRestHelper.popUpUgyfelSzolgalatWindow();">
|
||||
</div>
|
||||
}
|
||||
@if (!ClaimData.IsDefaultAdminUser && !(ClaimData.BelepesiNev.ToUpper() == Constants.General.KretaTechnicalUserNev.ToUpper())
|
||||
&& ClaimData.IsAktivUzenetekMenu && !(ClaimData.FelhasznaloSzerepCsomagok.Contains(KretaClaimPackages.CsokkentettGondviselo.ClaimValue)))
|
||||
{
|
||||
<div class="pull-right topnotif">
|
||||
<div title="@LayoutResource.Uzenetek">
|
||||
<a href="@Url.Action("Uzenetek", Constants.Controllers.Home, new { area = string.Empty })" target="_blank">
|
||||
<i class="fa fa-envelope-o messageCountBadge" data-badge="${MessageCount}"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="pull-right topnotif disabledMenuItem">
|
||||
<div title="@LayoutResource.Ertesitesek">
|
||||
<a href="${EventUrl}">
|
||||
<i class="fa fa-bell-o" data-badge="${EventCount}"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@if (ClaimData.FelhasznaloSzerepkor == Kreta.Enums.SzerepkorTipusEnum.Naplo && !ClaimData.IsArchivIntezmeny)
|
||||
{
|
||||
<div class="pull-right topnotif">
|
||||
<div title="@LayoutResource.NemNaplozottTanorak">
|
||||
<a href="@Url.Action("Index", Constants.Controllers.NemNaplozottTanorak, new { area = Constants.Areas.Tanar})">
|
||||
<i class="fa fa-clock-o" id="NemNaplozottTanorakCount" data-badge="@ClaimData.NemNaplozottTanorakCount"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{%if AdminHomePageUrl != "" %}
|
||||
@if (!ClaimData.IsArchivIntezmeny)
|
||||
{
|
||||
<div class="pull-right topnotif">
|
||||
<div title="@LayoutResource.Rendszeruzenetek">
|
||||
<a href="${AdminHomePageUrl}">
|
||||
<i class="fa fa-exclamation-triangle"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{%/if%}
|
||||
@if (ClaimData.FelhasznaloSzerepkor == Kreta.Enums.SzerepkorTipusEnum.Naplo && !ClaimData.IsArchivIntezmeny)
|
||||
{
|
||||
<div class="pull-right topnotif">
|
||||
<div title="@LayoutResource.TanarDashboard">
|
||||
<a href="@Url.Action("Index", Constants.Controllers.TanarDashboard, new { area = Constants.Areas.Tanar})">
|
||||
<i class="fa fa-television"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="dropdown" title="@LayoutResource.ProfilMenu">
|
||||
<button class="userbar dropdown-toggle" type="button" id="usermenu_dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<div class="username">
|
||||
<p class="headeruserNameSpan xs-username sm-userName md-userName lg-userName">${UserName}</p>
|
||||
<p id="usermenu_timer" role="timer" aria-live="off" class="usermenu_timer"></p>
|
||||
</div>
|
||||
|
||||
<div class="userimg-sm">
|
||||
<img class="userimg-sm" style="border-width: 0px;" alt="" src="${ProfilImgSrc}" />
|
||||
</div>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="usermenu_dropdown">
|
||||
{%each(i, menu) UserMenuItems%}
|
||||
<li>
|
||||
<a href="${menu.Url}" onclick="${menu.ClientAction}">
|
||||
<i class="fa ${menu.CssClass}"></i>
|
||||
<span>${menu.Name}</span>
|
||||
</a>
|
||||
</li>
|
||||
{%/each%}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pull-right topnotif hidden">
|
||||
<div title="Popup">
|
||||
<input id="popupId" type="hidden" value="${NeedPopupId}" />
|
||||
<input id="popupAzonosito" type="hidden" value="${NeedPopupAzonosito}" />
|
||||
${ popupCheck() }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue