Commit 88802b88 by Takumi Imai

Merge branch 'feature/1.0_check_web_dev_kdh_2' into 'feature/1.0_check_web_dev'

edited logout button function and alert message on accountSetting screen

See merge request !71
parents 1aa9e820 c23f327c
......@@ -1118,6 +1118,33 @@ COMMON.checkLogin = function (option) {
return true;
}
/**
* check quick report
*/
COMMON.checkQuickReport = function (operationId, callback) {
if (operationId) {
let params = {};
params.sid = COMMON.getSid();
params.operationId = operationId;
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.IS_QUICK_REPORT;
COMMON.cmsAjax(
url,
params,
false,
function (result) {
if (callback) callback(result);
},
function () {
COMMON.showAlert('msgOperationEmpty');
COMMON.avwScreenMove('index.html');
},
);
} else {
COMMON.showAlert('error');
COMMON.avwScreenMove('index.html');
}
};
/*
* Operations for session storage [ end ]
*/
......
......@@ -16,6 +16,7 @@ var HEADER = {};
};
HEADER.initLogout = function() {
$("#btnLogout").click(HEADER.logoutFunction);
}
......@@ -37,12 +38,7 @@ HEADER.goToHomePage = function (pageId) {
*/
HEADER.logoutFunction = function () {
console.log('clicked logout');
COMMON.showConfirm('msgLogoutConfirm', HEADER.processLogout);
// $('#modalTitle').text(I18N.i18nText("confirmation"));
// $('#msgModel').text(I18N.i18nText('msgLogoutConfirm'));
// $('#confirmYes').show();
// $('#confirmYes').click(HEADER.processLogout);
// $('#confirmNo').text(I18N.i18nText("confirmNo"));
COMMON.showConfirm(I18N.i18nText('msgLogoutConfirm'), HEADER.processLogout, {title: I18N.i18nText("confirmation")});
};
/**
......@@ -67,7 +63,7 @@ HEADER.processLogout = function () {
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} else {
if (data.errorMessage) {
COMMON.showAlert(data.errorMessage);
COMMON.showAlert(null, {message: data.errorMessage});
} else {
COMMON.showAlert('errorOccured');
}
......@@ -75,7 +71,7 @@ HEADER.processLogout = function () {
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.errorMessage) {
COMMON.showAlert(xmlHttpRequest.errorMessage);
COMMON.showAlert(null, {message: xmlHttpRequest.errorMessage});
} else {
COMMON.showAlert('errorOccured');
}
......
......@@ -48,6 +48,7 @@
"msgEssential": "{0} is required",
"pdfPrint":"PDF Print",
"msgOperationEmpty": "Operation data is Empty.",
"success": "Success",
"dashboard":"Dashboard",
"dashboardSettings":"Dashboard Settings",
......
......@@ -46,6 +46,7 @@
"msgEssential": "{0}は必須です。",
"pdfPrint":"PDF出力",
"msgOperationEmpty": "作業データがありません。",
"success": "成功",
"dashboard":"ダッシュボード",
"dashboardSettings":"ダッシュボード設定",
......
......@@ -45,6 +45,7 @@
"msgLogoutConfirm": "로그아웃 하시겠습니까?",
"pdfPrint":"PDF 출력",
"msgOperationEmpty": "작업 데이터가 없습니다.",
"success": "성공",
"dashboard":"대시보드",
"dashboardSettings":"대시보드 설정",
......
......@@ -35,10 +35,6 @@
<div id="includedMainTitle"></div>
<div class="quickReportBtn" id="quickReportBtn" onclick="submitForm();">
<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom"
title="pdfPrint">
</div>
<!-- report list -->
<div class="mb-5" id="report-form"></div>
......
......@@ -5,13 +5,18 @@
var RF = {};
RF.isQuickReport;
/**
* init
*/
RF.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
const operationId = sessionStorage.getItem("operationId");
COMMON.checkQuickReport(operationId, function (result) {
RF.isQuickReport = result.isQuickReport;
})
RF.loadCommon();
RF.initFormView();
};
......@@ -106,10 +111,24 @@ RF.initBreadcrumb = function () {
]
}
}
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_FORM, navs, null);
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_FORM, navs, RF.loadMainTitleCallback);
}
/**
* load main title callcack
*/
RF.loadMainTitleCallback = function () {
//add dashboard setting item
if (RF.isQuickReport) {
var elmA = $('<div class="quickReportBtn" id="quickReportBtn" onclick="submitForm();">');
let elmImg = $('<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdfPrint">');
elmImg.attr('title', I18N.i18nText('reportForm'));
elmA.append(elmImg);
$('#mainTitleHeader').after(elmA);
}
};
/**
* iinit form view
*/
RF.initFormView = function () {
......
......@@ -6,6 +6,8 @@
var RL = {};
RL.isQuickReport;
/**
* init
*/
......@@ -14,7 +16,10 @@ RL.init = function () {
COMMON.showLoading();
COMMON.checkAuth(false);
console.log('ReportList init start');
RL.checkQuickReport();
const operationId = sessionStorage.getItem("operationId");
COMMON.checkQuickReport(operationId, function (result) {
RL.isQuickReport = result.isQuickReport;
})
RL.loadCommon();
RL.initTaskReportList();
COMMON.closeLoading();
......@@ -63,35 +68,6 @@ RL.initBreadcrumb = function () {
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_LIST, navs, RL.loadMainTitleCallback);
}
RL.isQuickReport;
/**
* check quick report
*/
RL.checkQuickReport = function () {
if (sessionStorage.getItem("operationId")) {
let params = {};
params.sid = COMMON.getSid();
params.operationId = sessionStorage.getItem("operationId");
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.IS_QUICK_REPORT;
COMMON.cmsAjax(
url,
params,
false,
function (result) {
RL.isQuickReport = result.isQuickReport;
},
function () {
COMMON.showAlert('msgOperationEmpty');
COMMON.avwScreenMove('index.html');
},
);
} else {
COMMON.showAlert('error');
COMMON.avwScreenMove('index.html');
}
};
/**
* init task report list
*/
......@@ -117,7 +93,7 @@ RL.loadMainTitleCallback = function () {
//add dashboard setting item
if (RL.isQuickReport) {
var elmA = $('<div id="btnPdfPrint" onclick="RL.goPdfPrint();">');
let elmImg = $('<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdf出力">');
let elmImg = $('<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdfPrint">');
elmImg.attr('title', I18N.i18nText('reportList'));
elmA.append(elmImg);
$('#mainTitleHeader').after(elmA);
......
......@@ -28,14 +28,14 @@ SETTINGS.getToken = function () {
if (data.token) {
$('#getToken').val(data.token);
} else {
COMMON.showAlert("token error..");
COMMON.showAlert("errorGetToken");
}
},
function(data) {
if (data.errorMessage) {
COMMON.showAlert(data.errorMessage);
} else {
COMMON.showAlert('msgPwdChangeNG');
COMMON.showAlert("errorGetToken");
}
});
};
......@@ -134,7 +134,7 @@ SETTINGS.avwCmsApi_passwordChange_success = function (data) {
$('#txtPwdNew').val('');
$('#txtPwdNewRe').val('');
/* show messages */
COMMON.showAlert('msgPwdChangeOK', 'success');
COMMON.showAlert('msgPwdChangeOK',{titleCode: I18N.i18nText('success')});
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment