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) { ...@@ -1118,6 +1118,33 @@ COMMON.checkLogin = function (option) {
return true; 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 ] * Operations for session storage [ end ]
*/ */
......
...@@ -16,6 +16,7 @@ var HEADER = {}; ...@@ -16,6 +16,7 @@ var HEADER = {};
}; };
HEADER.initLogout = function() { HEADER.initLogout = function() {
$("#btnLogout").click(HEADER.logoutFunction); $("#btnLogout").click(HEADER.logoutFunction);
} }
...@@ -37,12 +38,7 @@ HEADER.goToHomePage = function (pageId) { ...@@ -37,12 +38,7 @@ HEADER.goToHomePage = function (pageId) {
*/ */
HEADER.logoutFunction = function () { HEADER.logoutFunction = function () {
console.log('clicked logout'); console.log('clicked logout');
COMMON.showConfirm('msgLogoutConfirm', HEADER.processLogout); COMMON.showConfirm(I18N.i18nText('msgLogoutConfirm'), HEADER.processLogout, {title: I18N.i18nText("confirmation")});
// $('#modalTitle').text(I18N.i18nText("confirmation"));
// $('#msgModel').text(I18N.i18nText('msgLogoutConfirm'));
// $('#confirmYes').show();
// $('#confirmYes').click(HEADER.processLogout);
// $('#confirmNo').text(I18N.i18nText("confirmNo"));
}; };
/** /**
...@@ -67,7 +63,7 @@ HEADER.processLogout = function () { ...@@ -67,7 +63,7 @@ HEADER.processLogout = function () {
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN); COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} else { } else {
if (data.errorMessage) { if (data.errorMessage) {
COMMON.showAlert(data.errorMessage); COMMON.showAlert(null, {message: data.errorMessage});
} else { } else {
COMMON.showAlert('errorOccured'); COMMON.showAlert('errorOccured');
} }
...@@ -75,7 +71,7 @@ HEADER.processLogout = function () { ...@@ -75,7 +71,7 @@ HEADER.processLogout = function () {
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.errorMessage) { if (xmlHttpRequest.errorMessage) {
COMMON.showAlert(xmlHttpRequest.errorMessage); COMMON.showAlert(null, {message: xmlHttpRequest.errorMessage});
} else { } else {
COMMON.showAlert('errorOccured'); COMMON.showAlert('errorOccured');
} }
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
"msgEssential": "{0} is required", "msgEssential": "{0} is required",
"pdfPrint":"PDF Print", "pdfPrint":"PDF Print",
"msgOperationEmpty": "Operation data is Empty.", "msgOperationEmpty": "Operation data is Empty.",
"success": "Success",
"dashboard":"Dashboard", "dashboard":"Dashboard",
"dashboardSettings":"Dashboard Settings", "dashboardSettings":"Dashboard Settings",
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
"msgEssential": "{0}は必須です。", "msgEssential": "{0}は必須です。",
"pdfPrint":"PDF出力", "pdfPrint":"PDF出力",
"msgOperationEmpty": "作業データがありません。", "msgOperationEmpty": "作業データがありません。",
"success": "成功",
"dashboard":"ダッシュボード", "dashboard":"ダッシュボード",
"dashboardSettings":"ダッシュボード設定", "dashboardSettings":"ダッシュボード設定",
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
"msgLogoutConfirm": "로그아웃 하시겠습니까?", "msgLogoutConfirm": "로그아웃 하시겠습니까?",
"pdfPrint":"PDF 출력", "pdfPrint":"PDF 출력",
"msgOperationEmpty": "작업 데이터가 없습니다.", "msgOperationEmpty": "작업 데이터가 없습니다.",
"success": "성공",
"dashboard":"대시보드", "dashboard":"대시보드",
"dashboardSettings":"대시보드 설정", "dashboardSettings":"대시보드 설정",
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
<div id="includedMainTitle"></div> <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 --> <!-- report list -->
<div class="mb-5" id="report-form"></div> <div class="mb-5" id="report-form"></div>
......
...@@ -5,13 +5,18 @@ ...@@ -5,13 +5,18 @@
var RF = {}; var RF = {};
RF.isQuickReport;
/** /**
* init * init
*/ */
RF.init = function () { RF.init = function () {
//Check if user is logged in //Check if user is logged in
COMMON.checkAuth(false); COMMON.checkAuth(false);
const operationId = sessionStorage.getItem("operationId");
COMMON.checkQuickReport(operationId, function (result) {
RF.isQuickReport = result.isQuickReport;
})
RF.loadCommon(); RF.loadCommon();
RF.initFormView(); RF.initFormView();
}; };
...@@ -106,10 +111,24 @@ RF.initBreadcrumb = function () { ...@@ -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 * iinit form view
*/ */
RF.initFormView = function () { RF.initFormView = function () {
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
var RL = {}; var RL = {};
RL.isQuickReport;
/** /**
* init * init
*/ */
...@@ -14,7 +16,10 @@ RL.init = function () { ...@@ -14,7 +16,10 @@ RL.init = function () {
COMMON.showLoading(); COMMON.showLoading();
COMMON.checkAuth(false); COMMON.checkAuth(false);
console.log('ReportList init start'); console.log('ReportList init start');
RL.checkQuickReport(); const operationId = sessionStorage.getItem("operationId");
COMMON.checkQuickReport(operationId, function (result) {
RL.isQuickReport = result.isQuickReport;
})
RL.loadCommon(); RL.loadCommon();
RL.initTaskReportList(); RL.initTaskReportList();
COMMON.closeLoading(); COMMON.closeLoading();
...@@ -63,35 +68,6 @@ RL.initBreadcrumb = function () { ...@@ -63,35 +68,6 @@ RL.initBreadcrumb = function () {
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_LIST, navs, RL.loadMainTitleCallback); 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 * init task report list
*/ */
...@@ -117,7 +93,7 @@ RL.loadMainTitleCallback = function () { ...@@ -117,7 +93,7 @@ RL.loadMainTitleCallback = function () {
//add dashboard setting item //add dashboard setting item
if (RL.isQuickReport) { if (RL.isQuickReport) {
var elmA = $('<div id="btnPdfPrint" onclick="RL.goPdfPrint();">'); 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')); elmImg.attr('title', I18N.i18nText('reportList'));
elmA.append(elmImg); elmA.append(elmImg);
$('#mainTitleHeader').after(elmA); $('#mainTitleHeader').after(elmA);
......
...@@ -28,14 +28,14 @@ SETTINGS.getToken = function () { ...@@ -28,14 +28,14 @@ SETTINGS.getToken = function () {
if (data.token) { if (data.token) {
$('#getToken').val(data.token); $('#getToken').val(data.token);
} else { } else {
COMMON.showAlert("token error.."); COMMON.showAlert("errorGetToken");
} }
}, },
function(data) { function(data) {
if (data.errorMessage) { if (data.errorMessage) {
COMMON.showAlert(data.errorMessage); COMMON.showAlert(data.errorMessage);
} else { } else {
COMMON.showAlert('msgPwdChangeNG'); COMMON.showAlert("errorGetToken");
} }
}); });
}; };
...@@ -134,7 +134,7 @@ SETTINGS.avwCmsApi_passwordChange_success = function (data) { ...@@ -134,7 +134,7 @@ SETTINGS.avwCmsApi_passwordChange_success = function (data) {
$('#txtPwdNew').val(''); $('#txtPwdNew').val('');
$('#txtPwdNewRe').val(''); $('#txtPwdNewRe').val('');
/* show messages */ /* 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