// ReportList function js

var RL = {};

RL.init = function() {
    COMMON.checkAuth(false);
    RL.loadCommon();
    
    RL.initTaskReportList();
};

RL.loadCommon = function() {
    $("#includedHeader").load("../html/common/header.html" , function() {
        I18N.initi18n();
        HEADER.init();
    }); 
    $("#includedConfirmModal").load("../html/common/confirm-modal.html", function() {
        I18N.initi18n();
    }); 
}

RL.initTaskReportList = function() {
    if (sessionStorage.OL_operationId) {
        let params = {};
        params.sid = COMMON.getSid();
        params.operationId = sessionStorage.OL_operationId;
        params.returnUrl = CONSTANT.URL.WEB.BASE + CONSTANT.URL.WEB.OPERATION_LIST;
        let url = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST;
        // COMMON.postCommunication(url, params);
        $("#task-list").load(url, params);
        // COMMON.cmsAjax(url, params, false, function(result) {
        //     $("#task-list").html(result);

        //     // $("#task-list").load(result);
        // }, function(XMLHttpRequest, textStatus, errorThrown) {
        // }, "text");
    } else {
        COMMON.displayAlert("error");
        COMMON.avwScreenMove("taskList.html");
    }
}
