pdfPrint.js 1.42 KB
Newer Older
1 2 3 4 5
/**
 * PDF PRINT function js
 *
 * @since cms:1.4.3.2&1.4.3.3 web:1.0
 **/
Kang Donghun committed
6 7 8

var PP = {};

9 10 11
/**
 * init
 */
12 13
PP.init = function () {
    //Check if user is logged in
14
    COMMON.showLoading();
15 16
    COMMON.checkAuth(false);

Kang Donghun committed
17
    PP.loadCommon();
18

19
    COMMON.closeLoading();
Kang Donghun committed
20 21
};

Takumi Imai committed
22 23 24
/**
 * load common
 */
25
PP.loadCommon = function () {
Kang Donghun committed
26 27
    TEMPLATE.loadHeader('#includedHeader');
    TEMPLATE.loadConfirmModal('#includedConfirmModal');
28 29 30 31 32 33 34
    let navs = [
        {
            titleLang: CONSTANT.PAGE_NAME.OPERATION_LIST,
            href: CONSTANT.URL_TREE_NAME.OPERATION_LIST,
        },
        {
            titleLang: CONSTANT.PAGE_NAME.REPORT_LIST,
35
            href: CONSTANT.URL_TREE_NAME.REPORT_LIST,
36 37 38 39 40
        },
        {
            titleLang: CONSTANT.PAGE_NAME.PDF_PRINT,
        }
    ];
41
    TEMPLATE.loadMainNavsTitle('#includedMainTitle', CONSTANT.PAGE_NAME.PDF_PRINT, navs, PP.initPdfList);
42
};
Kang Donghun committed
43

Takumi Imai committed
44 45 46
/**
 * init pdf list
 */
47
PP.initPdfList = function () {
48
    if (sessionStorage.getItem("operationId")) {
Kang Donghun committed
49 50
        let params = {};
        params.sid = COMMON.getSid();
51
        params.operationId = sessionStorage.getItem("operationId");
Kang Donghun committed
52
        let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.QUICK_REPORT_PRINT;
53
        $('#pdfPrintDiv').load(url, params);
Kang Donghun committed
54
    } else {
55
        COMMON.showAlert('error');
56
        COMMON.avwScreenMove('reportList.html');
Kang Donghun committed
57
    }
58
};