Commit f77d8b43 by Takumi Imai

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

Reverting the function to display the pdfprint button

See merge request !73
parents 88802b88 4771234a
...@@ -1118,33 +1118,6 @@ COMMON.checkLogin = function (option) { ...@@ -1118,33 +1118,6 @@ 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 ]
*/ */
......
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
<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,18 +5,13 @@ ...@@ -5,18 +5,13 @@
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();
}; };
...@@ -111,24 +106,10 @@ RF.initBreadcrumb = function () { ...@@ -111,24 +106,10 @@ RF.initBreadcrumb = function () {
] ]
} }
} }
TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_FORM, navs, RF.loadMainTitleCallback); TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.REPORT_FORM, navs, null);
} }
/** /**
* 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 () {
......
...@@ -4,41 +4,36 @@ ...@@ -4,41 +4,36 @@
* @since cms:1.4.3.2&1.4.3.3 web:1.0 * @since cms:1.4.3.2&1.4.3.3 web:1.0
**/ **/
var RL = {}; var RL = {};
RL.isQuickReport; /**
/**
* init * init
*/ */
RL.init = function () { RL.init = function () {
//Check if user is logged in //Check if user is logged in
COMMON.showLoading(); COMMON.showLoading();
COMMON.checkAuth(false); COMMON.checkAuth(false);
console.log('ReportList init start'); console.log('ReportList init start');
const operationId = sessionStorage.getItem("operationId"); RL.checkQuickReport();
COMMON.checkQuickReport(operationId, function (result) {
RL.isQuickReport = result.isQuickReport;
})
RL.loadCommon(); RL.loadCommon();
RL.initTaskReportList(); RL.initTaskReportList();
COMMON.closeLoading(); COMMON.closeLoading();
}; };
/** /**
* load common * load common
*/ */
RL.loadCommon = function () { RL.loadCommon = function () {
TEMPLATE.loadHeader('#includedHeader'); TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal'); TEMPLATE.loadConfirmModal('#includedConfirmModal');
RL.initBreadcrumb(); RL.initBreadcrumb();
}; };
/** /**
* create breadcrumb menu on ReportList * create breadcrumb menu on ReportList
*/ */
RL.initBreadcrumb = function () { RL.initBreadcrumb = function () {
if (sessionStorage.activeHomePage == CONSTANT.PAGE_TAB.DASHBOARD) { if (sessionStorage.activeHomePage == CONSTANT.PAGE_TAB.DASHBOARD) {
navs = [ navs = [
{ {
...@@ -66,12 +61,41 @@ RL.initBreadcrumb = function () { ...@@ -66,12 +61,41 @@ 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
*/ */
RL.initTaskReportList = function () { RL.initTaskReportList = function () {
if (sessionStorage.getItem("operationId")) { if (sessionStorage.getItem("operationId")) {
let params = {}; let params = {};
params.sid = COMMON.getSid(); params.sid = COMMON.getSid();
...@@ -84,25 +108,26 @@ RL.initTaskReportList = function () { ...@@ -84,25 +108,26 @@ RL.initTaskReportList = function () {
COMMON.showAlert('error'); COMMON.showAlert('error');
COMMON.avwScreenMove('index.html'); COMMON.avwScreenMove('index.html');
} }
}; };
/** /**
* load main title callcack * load main title callcack
*/ */
RL.loadMainTitleCallback = function () { 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="pdfPrint">'); let elmImg = $('<img src="../common/img/icon_pdf.svg" alt="pdf出力" class="p-1 w-40px" data-toggle="tooltip" data-placement="bottom" title="pdf出力">');
elmImg.attr('title', I18N.i18nText('reportList')); elmImg.attr('title', I18N.i18nText('reportList'));
elmA.append(elmImg); elmA.append(elmImg);
$('#mainTitleHeader').after(elmA); $('#mainTitleHeader').after(elmA);
} }
}; };
/** /**
* go pdf print * go pdf print
*/ */
RL.goPdfPrint = function () { RL.goPdfPrint = function () {
COMMON.avwScreenMove('pdfPrint.html'); COMMON.avwScreenMove('pdfPrint.html');
}; };
\ No newline at end of file
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