Commit 0a9ab603 by Kang Donghun

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

# Conflicts:
#	abweb/js/reportList/reportList.js
#	abweb/js/template/template.js
parents d2c8d0c8 7ead4d21
<div class="modal fade" id="category-modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable overflow-auto" role="document">
<div class="modal-content">
<div class="modal-header bg-dark10">
<h5 class="modal-title lang" lang="categorySelection"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<ul class="list-menu" id="categoryListMenu">
<!-- <ul>
<li>
<label>
<input type="radio" name="category" checked>
<span class="lang" lang="categoryAll"></span>
</label>
</li>
</ul>
<li class="accordion" id="accordion1">
<div id="heading1">
<a href="#" class="list-menu-link">
<button type="button" class="collapsed" data-toggle="collapse" data-target="#collapse1" aria-expanded="true" aria-controls="collapse1">
<div class="arrow-icon"></div>
</button>
<label>
<input type="radio" name="category">
<span class="lang" lang="">全社</span>
</label>
</a>
</div>
<div id="collapse1" class="collapse" aria-labelledby="heading1" data-parent="#accordion1">
<ul>
<li>
<label>
<input type="radio" name="category">
<span>カテゴリー</span>
</label>
</li>
<li>
<label>
<input type="radio" name="category">
<span>カテゴリー</span>
</label>
</li>
<li class="accordion" id="accordion1-1">
<div id="heading1-1">
<a href="#" class="list-menu-link">
<button type="button" class="collapsed" data-toggle="collapse" data-target="#collapse1-1" aria-expanded="true" aria-controls="collapse1-1">
<div class="arrow-icon"></div>
</button>
<label>
<input type="radio" name="category">
<span>カテゴリー</span>
</label>
</a>
</div>
<div id="collapse1-1" class="collapse" aria-labelledby="heading1-1" data-parent="#accordion1-1">
<ul>
<li class="accordion" id="accordion1-2">
<div id="heading1-2">
<a href="#" class="list-menu-link">
<button type="button" class="collapsed" data-toggle="collapse" data-target="#collapse1-2" aria-expanded="true" aria-controls="collapse1-2">
<div class="arrow-icon"></div>
</button>
<label>
<input type="radio" name="category">
<span>カテゴリー</span>
</label>
</a>
</div>
<div id="collapse1-2" class="collapse" aria-labelledby="heading1-2" data-parent="#accordion1-2">
<ul>
<li class="accordion" id="accordion1-3">
<div id="heading1-3">
<a href="#" class="list-menu-link">
<button type="button" class="collapsed" data-toggle="collapse" data-target="#collapse1-3" aria-expanded="true" aria-controls="collapse1-3">
<div class="arrow-icon"></div>
</button>
<label>
<input type="radio" name="category">
<span>カテゴリー</span>
</label>
</a>
</div>
</li>
</ul>
</div>
</li>
</ul>
</div>
</li>
</ul>
</div>
</li> -->
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary lang" lang="selection" onclick="OL.onClickCategorySelection();"></button>
<button type="button" class="btn btn-tertiary lang" lang="dspCancel" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
......@@ -11038,7 +11038,7 @@ ul.card-list > li:not(.selected):not(.not-found):hover{
}
.select-card-list .arrow-icon {
background-image: url("../img/icon_arrow_down.svg");
background-image: url("/abweb/common/img/icon_arrow_down.svg");
background-size: contain;
background-repeat: no-repeat;
width: 14px;
......@@ -20590,7 +20590,7 @@ button {
list-style: none;
}
.list-menu button .arrow-icon{
background-image: url("../img/icon_arrow_right.svg");
background-image: url("/abweb/common/img/icon_arrow_right.svg");
background-size: contain;
width: 17px;
height: 17px;
......@@ -20689,7 +20689,7 @@ button {
.type-icon .report:before{
content: '';
background-image: url("../img/type_icon_report.svg");
background-image: url("/abweb/common/img/type_icon_report.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
......@@ -20699,7 +20699,7 @@ button {
}
.type-icon .questionary:before{
content: '';
background-image: url("../img/type_icon_questionary.svg");
background-image: url("/abweb/common/img/type_icon_questionary.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
......@@ -20709,7 +20709,7 @@ button {
}
.type-icon .inspection:before{
content: '';
background-image: url("../img/type_icon_inspection.svg");
background-image: url("/abweb/common/img/type_icon_inspection.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
......@@ -20719,7 +20719,7 @@ button {
}
.type-icon .proccess:before{
content: '';
background-image: url("../img/type_icon_proccess.svg");
background-image: url("/abweb/common/img/type_icon_proccess.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
......
<?xml version="1.0" encoding="UTF-8"?><svg id="_レイヤー_2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 119.14 125"><defs><style>.cls-1{fill:#a5d6a7;}</style></defs><g id="_レイヤー_1-2"><g><path class="cls-1" d="M48.17,121.12H9.29c-2.48,0-4.65-.93-6.5-2.79-1.86-1.86-2.79-4.03-2.79-6.5V21.68c0-2.48,.8-4.65,2.4-6.5,1.6-1.86,2.97-2.79,4.1-2.79h31.29c.72-3.61,2.5-6.58,5.34-8.91C45.97,1.16,49.25,0,52.97,0c3.72,0,7,1.16,9.83,3.48,2.84,2.32,4.62,5.29,5.34,8.91h31.29c2.48,0,4.65,.93,6.5,2.79,1.86,1.86,2.79,4.03,2.79,6.5v31.44h-9.29V21.68h-16.42v10.84c0,2.58-.9,4.78-2.71,6.58-1.81,1.81-4,2.71-6.58,2.71H35c-2.58,0-4.78-.9-6.58-2.71-1.81-1.81-2.71-4-2.71-6.58v-10.84H9.29V111.82H48.17v9.29Zm-13.4-55.34l16.51-16.51c.45-.45,.98-.67,1.59-.64,.61,.03,1.14,.27,1.59,.72s.68,1,.68,1.63-.23,1.17-.68,1.63l-18.1,18.1c-.45,.45-.98,.68-1.59,.68s-1.14-.23-1.59-.68l-8.94-8.94c-.45-.45-.67-1-.64-1.63,.03-.63,.27-1.17,.72-1.63,.45-.45,1-.68,1.63-.68,.63,0,1.17,.23,1.63,.68l7.2,7.27Zm0,26l16.51-16.51c.45-.45,.98-.67,1.59-.64,.61,.03,1.14,.27,1.59,.72s.68,1,.68,1.63-.23,1.17-.68,1.63l-18.1,18.1c-.45,.45-.98,.68-1.59,.68s-1.14-.23-1.59-.68l-8.94-8.94c-.45-.45-.67-1-.64-1.63,.03-.63,.27-1.17,.72-1.63,.45-.45,1-.68,1.63-.68,.63,0,1.17,.23,1.63,.68l7.2,7.27ZM55.76,21.06c1.76,0,3.23-.59,4.41-1.78,1.19-1.19,1.78-2.66,1.78-4.41s-.59-3.23-1.78-4.41c-1.19-1.19-2.66-1.78-4.41-1.78s-3.23,.59-4.41,1.78c-1.19,1.19-1.78,2.66-1.78,4.41s.59,3.23,1.78,4.41c1.19,1.19,2.66,1.78,4.41,1.78Z"/><g><path class="cls-1" d="M113.09,82.66l-11.61-11.61,4.74-4.74c.87-.87,2.02-1.31,3.43-1.31s2.56,.44,3.43,1.31l4.74,4.74c.87,.87,1.31,2.02,1.31,3.43s-.44,2.56-1.31,3.43l-4.74,4.74Z"/><path class="cls-1" d="M59.14,122.55v-7.19c0-.65,.11-1.25,.33-1.8,.22-.54,.6-1.09,1.14-1.63l33.84-33.84,11.61,11.61-33.84,33.84c-.54,.54-1.09,.93-1.63,1.14-.54,.22-1.14,.33-1.8,.33h-7.19c-.65,0-1.23-.25-1.72-.74-.49-.49-.74-1.06-.74-1.72Z"/></g></g></g></svg>
\ No newline at end of file
......@@ -19,7 +19,7 @@ CONSTANT.SORT_TYPE = {
CONSTANT.PAGE_NAME = {
DASHBOARD: 'dashboard',
OPERATION_LIST: 'operationList',
FOOTER: 'main-footer.html',
FOOTER: 'mainFooter.html',
DEFAULT: 'index.html',
LOGIN: './login.html',
};
......
......@@ -12,31 +12,30 @@
DashboardSetting.getSettingData(function (settings) {
if(settings.dashboardHome == 1)
{
HEADER.goDashboard();
sessionStorage.activeHomePage = CONSTANT.PAGE_NAME.DASHBOARD;
HEADER.goDashboard();
}
else
{
HEADER.goOperationList();
}
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.OPERATION_LIST;
HEADER.goOperationList();
}
});
}
/**
* Go page of operationList
*/
HEADER.goOperationList = function () {
$('#footer').load(CONSTANT.PAGE_NAME.FOOTER, function () {
sessionStorage.activeTab = CONSTANT.PAGE_TAB.OPERATION_LIST;
HEADER.activeInitBottomNav('operationListBottomNav');
TOP.showPage(CONSTANT.PAGE_NAME.OPERATION_LIST);
});
OL.init();
};
/**
* Go page of dashboard
*/
HEADER.goDashboard = function () {
sessionStorage.activeHomePage = CONSTANT.PAGE_NAME.DASHBOARD;
COMMON.avwScreenMove("dashboard.html");
};
......@@ -83,4 +82,4 @@
if (img && img.getAttribute('data-src')) {
img.src = img.getAttribute('data-src');
}
};
\ No newline at end of file
};
......@@ -98,6 +98,22 @@
"templateSelection":"Template selection",
"logo":"logo",
"listDisplay":"List display",
"gridDisplay":"Grid display"
"gridDisplay":"Grid display",
"operationListSearchPlacehoder":"Operation Name",
"searchIcon":"Search Icon",
"category":"Category",
"term":"Term",
"searchClear":"Search Clear",
"calendar":"Calendar",
"startDate":"Start Date",
"endDate":"End Date",
"sortBy":"Sort By",
"sortByName":"Name",
"sortByStartDate":"Start Date",
"sortByEndDate":"End Date",
"sortByLastEdit":"Last Edit",
"categorySelection":"Category Selection",
"categoryAll":"All",
"reportForm": "Report",
"periodicInspectionPeriod": "Periodic Inspection Period"
}
\ No newline at end of file
......@@ -96,5 +96,22 @@
"templateSelection":"テンプレート選択",
"logo":"ロゴ",
"listDisplay":"リスト表示",
"gridDisplay":"グリッド表示"
"gridDisplay":"グリッド表示",
"operationListSearchPlacehoder":"作業名",
"searchIcon":"検索アイコン",
"category":"カテゴリー",
"term":"期間",
"searchClear":"検索条件をクリア",
"calendar":"カレンダー",
"startDate":"開始日",
"endDate":"終了日",
"sortBy":"並び替え",
"sortByName":"作業名順",
"sortByStartDate":"新しい順",
"sortByEndDate":"古い順",
"sortByLastEdit":"閲覧日順",
"categorySelection":"カテゴリー選択",
"categoryAll":"すべて",
"reportForm": "報告",
"periodicInspectionPeriod": "定期点検期間"
}
\ No newline at end of file
......@@ -95,5 +95,22 @@
"templateSelection":"Template selection",
"logo":"logo",
"listDisplay":"list display",
"gridDisplay":"Grid display"
"gridDisplay":"Grid display",
"operationListSearchPlacehoder":"Operation Name",
"searchIcon":"Search Icon",
"category":"Category",
"term":"Term",
"searchClear":"Search Clear",
"calendar":"Calendar",
"startDate":"Start Date",
"endDate":"End Date",
"sortBy":"Sort By",
"sortByName":"Name",
"sortByStartDate":"Start Date",
"sortByEndDate":"End Date",
"sortByLastEdit":"Last Edit",
"categorySelection":"Category Selection",
"categoryAll":"All",
"reportForm": "보고서",
"periodicInspectionPeriod": "정기점검기간"
}
\ No newline at end of file
<header>
<nav class="navbar navbar-dark shadow-sm px-sm-auto px-0">
<div class="container-wrap">
......@@ -5,14 +6,14 @@
<img src="../common/img/logo.svg" type="image" alt="" class="img-fluid lang" lang="logo">
</a>
<ul class="mr-sm-auto ml-sm-0 ml-auto mb-0 pl-0 d-flex">
<li class="active nav-link">
<li class="active nav-link" id="iconHomeDashboard">
<a href="dashboard.html" class="d-block text-center text-decoration-none">
<img src="../common/img/nav_icon_dashboard.svg" type="image" alt="" class="p-sm-1 p-0 img-fluid lang" lang="dashboard">
<div class="fs-7 d-sm-block d-none lang" lang="dashboard"></div>
</a>
</li>
<li class="nav-link">
<a href="task-list.html" class="d-block text-center text-decoration-none">
<li class="nav-link" id="iconHomeWorkList">
<a href="index.html" class="d-block text-center text-decoration-none">
<img src="../common/img/nav_icon_task.svg" type="image" alt="" class="p-sm-1 p-0 img-fluid lang" lang="workList">
<div class="fs-7 d-sm-block d-none lang" lang="workList"></div>
</a>
......@@ -29,7 +30,7 @@
<img src="../common/img/menu_icon_account_setting.svg" type="image" alt="" class="navbar-dropdown-icon lang" lang="account_setting">
<span class="lang" style=" color: #6c757d;" lang="account_setting"></span>
</a>
<a class="dropdown-item " href="#" data-toggle="modal" data-target="#confirm-modal" id="btnLogout">
<a class="dropdown-item " href="login.html" id="btnLogout">
<img src="../common/img/menu_icon_logout.svg" type="image" alt="" class="navbar-dropdown-icon lang" lang="dspLogout">
<span class="lang" style=" color: #6c757d;" lang="dspLogout"></span>
</a>
......@@ -38,3 +39,4 @@
</div>
</nav>
</header>
......@@ -23,7 +23,7 @@
<script src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/header/header.js"></script>
<script type="text/javascript" src="../js/dashboardSetting/dashboard-setting.js"></script>
<script type="text/javascript" src="../js/dashboardSetting/dashboardSetting.js"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/dashboard/dashboard.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js"></script>
......@@ -36,13 +36,13 @@
</head>
<body>
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- dashboard -->
<main>
<div class="container-wrap">
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- sub title -->
<h2 class="fs-8 font-weight-bold lang" id="#pickupHeader" lang="pickup"></h2>
......
......@@ -3,192 +3,140 @@
<head>
<meta charset="utf-8">
<title calss="multi-lang" data-msg="operationListTitle"></title>
<meta name="robots" content="index, follow">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="description" content="A Book Check">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/header.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/footer.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/style.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/app.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/fontawesome_relative_path.css">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- favicons -->
<link href="../common/img/favicon.ico" rel="icon">
<link href="../common/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- main css -->
<link rel="stylesheet" type="text/css" href="../common/css/newdash/app.css">
<link rel="stylesheet" type="text/css" href="../common/css/newdash/header.css">
<link rel="stylesheet" type="text/css" href="../common/css/newdash/style.css">
<!-- vender css -->
<link rel="stylesheet" type="text/css" href="../common/css/newdash/fontawesome_relative_path.css">
<script src="../common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script src="../common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script src="../common/js/web/i18n.js?__UPDATEID__"></script>
<!-- <script src="../common/js/web/common.js?__UPDATEID__"></script>
<script src="../common/js/web/avweb.js?__UPDATEID__"></script> -->
<script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script>
<script src="../js/operationList/operationList.js?__UPDATEID__"></script>
<script src="../js/dashboardSetting/dashboard-setting.js?__UPDATEID__"></script>
<script src="../js/dashboardSetting/dashboardSetting.js?__UPDATEID__"></script>
<script src="../js/dashboard/dashboard.js?__UPDATEID__"></script>
<script src="../common/js/header.js?__UPDATEID__"></script>
<script src="../js/template/template.js?__UPDATEID__"></script>
<script src="../js/topPage/topPage.js?__UPDATEID__"></script>
<script src="../common/js/app.js?__UPDATEID__" defer></script>
<script src="../js/reportForm/reportForm.js?__UPDATEID__" defer></script>
<script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js"></script>
</head>
<body style="position: relative; margin-top: 53px;">
<!--作業一覧画面-->
<section id="operationList" class="page-content" style="display: none;">
<!--ヘッダー-->
<header style="position: fixed; width: 100%; top: 0px; left: 0; z-index: 999;">
<nav class="navbar navbar-dark bg-primary">
<div>
<a class="navbar-brand category-btn lht-0 d-none" onclick="OL.openCategory();" id="operationGroupMasterButton">
<i class="fa fa-folder fs-12 p-1" id="category-toggle-button"></i>
<span class="d-none d-md-inline fs-10 multi-lang" data-msg="buttonCategory"></span>
<body>
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- task list -->
<main>
<div class="container">
<!-- search condition -->
<nav aria-label="search" class="search search-condition">
<div class="d-flex align-items-center">
<div class="search-form mr-1">
<input type="text" class="form-control lang" lang="operationListSearchPlacehoder" placeholder="" id="searchTaskName">
<a href="#" class="search-form-btn" >
<img src="../common/img/icon_search.svg" type="image" alt="" class="lang" lang="searchIcon" onclick="OL.search();">
</a>
</div>
<h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang alignCenter_header" data-msg="operationListHeaderTitle"></h1>
</nav>
</header>
<!--カテゴリ-->
<section class="category-menu">
<div id="overlayDiv" class="overlay"></div>
<nav id="category-menu" class="drawer-menu">
<div class="d-flex justifyfont-weight-bold fs-13 p-3 mb-0 multi-lang" data-msg="buttonCategory"></h2>
<a class="category-content-between border-bottom">
<h2 class="text-nowrap -btn p-3" onclick="OL.openCategory();" href="#"><i class="fa fa-times"></i></a>
</div>
</nav>
</section>
<section class="container-fluid main-section">
<main>
<!--パンくずリスト-->
<nav aria-label="breadcrumb">
<ol class="breadcrumb border-bottom px-0" id="groupMasterPath">
</ol>
</nav>
<!--検索欄-->
<nav aria-label="search">
<div class="row">
<div class="col-7 col-md-5 col-lg-4">
<div class="form-group has-search input-group">
<input type="text" class="form-control multi-lang" data-msg="placeholderOperationName" placeholder="placeholderOperationName" id="searchTaskName">
<div class="input-group-append">
<i class="fas fa-search input-group-text" onclick="OL.search();"></i>
</div>
<a href="#" class="mx-1 d-none" id="operationGroupMasterButton" data-toggle="modal" data-target="#category-modal">
<img class="serarch-icon lang" lang="category" src="../common/img/icon_folder.svg" type="image" alt="" data-toggle="tooltip" data-placement="bottom" title="" onclick="OL.openCategory();">
</a>
<div class="c-dropdown">
<a href="#" class="mx-1">
<img class="serarch-icon c-dropdown-trigger lang" lang="term" id="dropdown-term" src="../common/img/icon_calendar.svg" type="image" alt="" data-toggle="tooltip" data-placement="bottom" title="">
</a>
<div class="c-dropdown-menu dropdown-menu-right" data-animation="true" data-target="dropdown-term">
<div class="form-group p-2 mb-0">
<label class="lang" lang="startDate"></label>
<div class="input-group date" id="datetimepicker1" data-target-input="nearest">
<input type="text" name="start" class="form-control form-control-sm datetimepicker-input" data-target="#datetimepicker1" placeholder="選択" id="searchStartDate">
<div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
<div class="input-group-text py-1 px-2">
<img src="../common/img/icon_calendar.svg" type="image" alt="" class="calendar-icon lang" lang="calendar">
</div>
</div>
</div>
</div>
</div>
<!--カレンダー-->
<div class="col-1 col-md-2 duration-area">
<a href="#" class="d-inline-block text-decoration-none py-2 lht-0" data-toggle="modal" data-target="#exampleModal">
<img class="icon" src="../img/operationList/icon_calendar.svg">
<span class="d-none d-md-inline text-black fs-10 align-middle multi-lang" data-msg="labelPeriod"></span>
</a>
<div class="modal modal-duration fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<!--開始日付-->
<div class="form-group">
<label class="multi-lang" data-msg="labelStartDate"></label>
<div class="input-group date" id="datetimepicker1" data-target-input="nearest">
<input type="search" name="start" class="form-control form-control-sm datetimepicker-input multi-lang" data-msg="placeholderSelect" data-target="#datetimepicker1" placeholder="placeholderSelect" inputmode="none" id="searchStartDate">
<div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar"></i></div>
</div>
</div>
</div>
<!--終了日付-->
<div class="form-group">
<label class="multi-lang" data-msg="labelEndDate"></label>
<div class="input-group date" id="datetimepicker2" data-target-input="nearest">
<input type="search" name="end" class="form-control form-control-sm datetimepicker-input multi-lang" data-msg="placeholderSelect" data-target="#datetimepicker2" placeholder="placeholderSelect" inputmode="none" id="searchEndDate">
<div class="input-group-append" data-target="#datetimepicker2" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group p-2 mb-0">
<label class="lang" lang="endDate"></label>
<div class="input-group date" id="datetimepicker2" data-target-input="nearest">
<input type="text" name="end" class="form-control form-control-sm datetimepicker-input" data-target="#datetimepicker2" placeholder="選択" id="searchEndDate">
<div class="input-group-append" data-target="#datetimepicker2" data-toggle="datetimepicker">
<div class="input-group-text py-1 px-2">
<img src="../common/img/icon_calendar.svg" type="image" alt="" class="calendar-icon lang" lang="calendar">
</div>
</div>
</div>
</div>
</div>
<!--ソート-->
<div class="col-4 col-md-5 col-lg-6 text-right">
<a href="#" class="text-decoration-none py-2 lht-0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-offset="-120, 0">
<img class="icon" src="../img/operationList/icon_swap.svg">
<span class="d-none d-md-inline text-dark fs-10 align-middle multi-lang" data-msg="labelSort"></span>
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item sort-type multi-lang" data-msg="labelSortName" data-sort="0" onclick="OL.changeSortType(this);"></a>
<a class="dropdown-item sort-type active multi-lang" data-msg="labelSortNew" data-sort="1" id="defaultSort" onclick="OL.changeSortType(this);"></a>
<a class="dropdown-item sort-type multi-lang" data-msg="labelSortOld" data-sort="2" onclick="OL.changeSortType(this);"></a>
<a class="dropdown-item sort-type multi-lang" data-msg="labelSortOpen" data-sort="4" onclick="OL.changeSortType(this);"></a>
</div>
<a href="javascript:OL.resetSearch();" class="text-decoration-none py-2 lht-0 d-inline-block ml-3">
<img class="icon" src="../img/operationList/icon_clear.svg">
<span class="d-none d-md-inline text-dark fs-10 align-middle multi-lang" data-msg="labelReset" lnag="labelReset"></span>
</a>
<div class="mask hide"></div>
</div>
<div class="dropdown">
<a href="#" class="mx-1" id="dropdown-term" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-offset="-120, 0">
<img class="serarch-icon lang" lang="sortBy" src="../common/img/icon_swap.svg" type="image" alt="" data-toggle="tooltip" data-placement="bottom" title="">
</a>
<div class="dropdown-menu dropdown-menu-right sort" data-animation="true" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item sort-type lang" lang="sortByName" href="#" data-sort="0" onclick="OL.changeSortType(this);"></a>
<a class="dropdown-item sort-type lang active" lang="sortByStartDate" href="#" data-sort="1" id="defaultSort" onclick="OL.changeSortType(this);"></a>
<a class="dropdown-item sort-type lang" lang="sortByEndDate" href="#" data-sort="2" onclick="OL.changeSortType(this);"></a>
<a class="dropdown-item sort-type lang" lang="sortByLastEdit" href="#" data-sort="4" onclick="OL.changeSortType(this);"></a>
</div>
</div>
</nav>
<!--一覧表示-->
<section>
<table class="table">
<thead>
<tr>
<th class="multi-lang" data-msg="headerItemName"></th>
<th class="d-none d-md-table-cell multi-lang" data-msg="headerStartDate"></th>
<th class="d-none d-md-table-cell multi-lang" data-msg="headerEndDate"></th>
</tr>
</thead>
<tbody id="operationTable">
</tbody>
</table>
</section>
</main>
</section>
</section>
<section id="dashboard" class="page-content" style="display: none;">
<header>
<nav class="navbar navbar-dark bg-primary position-fixed fixed-top w-100">
<div></div>
<h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang alignCenter_header" data-msg="dashboardHeaderTitle"></h1>
<div class="d-flex align-items-center">
<a href="javascript:CHK.goUrlWithCurrentParams('dashboard-setting.html');" class="nav-link text-white lht-0 p-1 mr-2">
<img class="icon" src="../img/dashboard/icon_dashboard_setting.svg" alt="">
<span class="d-none d-md-inline fs-10 align-middle multi-lang" data-msg="buttonDashboardSetting"></span>
<a href="javascript:OL.resetSearch();" class="mx-1">
<img class="serarch-icon lang" lang="searchClear" src="../common/img/icon_close.svg" type="image" alt="" data-toggle="tooltip" data-placement="bottom" title="">
</a>
</div>
</nav>
</header>
<!-- dashboard -->
<section class="container-fluid main-section">
<main>
<!--ピックアップエリア-->
<h2 id="pickupHeader" class="fs-8 font-weight-bold mt-4 pb-2 border-bottom text-dark multi-lang" data-msg="pickupHeaderTitle"></h2>
<div class="item-wrap" id="pickupItems">
</div>
<!--コミュニケーションのエリア-->
<h2 class="fs-8 font-weight-bold mt-4 pb-2 border-bottom text-dark multi-lang" data-msg="communicationHeaderTitle"></h2>
<div class="item-wrap" id="communicationItems">
<!-- category -->
<nav aria-label="breadcrumb">
<ol class="breadcrumb px-0 pb-0 mb-0" id="groupMasterPath">
</ol>
</nav>
<!-- view menu -->
<nav aria-label="view" class="view-menu mt-2">
<div class="d-flex justify-content-between align-items-center">
<div class="fs-9"><span id="operationCount">0</span><span class="lang" lang="display"></span></div>
<div class="view">
<a href="#" class="text-decoration-none view-btn view-list-btn">
<img src="../common/img/icon_view_list.svg" type="image" alt="" class="list-block-icon mx-1 lang" lang="listDisplay" data-toggle="tooltip" data-placement="bottom" title="">
</a>
<a href="#" class="text-decoration-none view-btn view-block-btn active">
<img src="../common/img/icon_view_block.svg" type="image" alt="" class="list-block-icon mx-1 lang" lang="gridDisplay" data-toggle="tooltip" data-placement="bottom" title="">
</a>
</div>
</div>
</main>
</section>
</section>
</nav>
<!--フッター-->
<div id="footer"></div>
<!-- task list -->
<ul class="p-0 mt-3 card-list task-list view-content view-block" id="operationTable">
</ul>
</div>
</main>
<!-- category modal -->
<div id="includedCategoryModal"></div>
<!-- confirm -->
<div id="includedConfirmModal"></div>
<!--アラート-->
<div class="alert-overlay d-none"></div>
<div class="alert-area d-none">
......@@ -199,7 +147,10 @@
<!--ローディング-->
<div id="check_loading" style="display:none; position: relative; overflow:hidden;">
<p id="checkLoadingMessage"></p>
<div id="checkLoadingImage"><img src='/abweb/img/loading.svg' /></div>
<div id="checkLoadingImage"><img src='######' /></div>
</div>
<script type="text/javascript" src="../common/js/newdash/common.js?__UPDATEID__"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -26,7 +26,7 @@
<!-- main js -->
<script type="text/javascript" src="../js/operationList/operationList.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/dashboardSetting/dashboard-setting.js"></script>
<script type="text/javascript" src="../js/dashboardSetting/dashboardSetting.js"></script>
<script type="text/javascript" src="../js/dashboard/dashboard.js"></script>
<script type="text/javascript" src="../js/header/header.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
......@@ -44,13 +44,13 @@
</head>
<body >
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- pickup -->
<main>
<div class="container-wrap">
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- tab -->
<ul class="nav nav-tabs line" id="myTab" role="tablist">
<li class="nav-item" id="liTabNewReport">
......
......@@ -26,7 +26,7 @@
<script type="text/javascript" src="../js/header/header.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/pushMessageDetail/push-message-detail.js"></script>
<script type="text/javascript" src="../js/pushMessageDetail/pushMessageDetail.js"></script>
<script type="text/javascript">
$(document).ready(function(){
......
......@@ -26,7 +26,7 @@
<script type="text/javascript" src="../js/header/header.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/pushMessageList/push-message-list.js"></script>
<script type="text/javascript" src="../js/pushMessageList/pushMessageList.js"></script>
<script type="text/javascript">
$(document).ready(function(){
......@@ -37,12 +37,13 @@
<body>
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- message list -->
<main>
<div class="container-wrap">
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- message -->
<ul class="card-list message-list p-0" id="messageList">
<li class="card mb-2 not-found d-none">
......
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta charset="utf-8">
<title class="lang" lang="reportForm"></title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- favicons -->
<link href="../common/img/favicon.ico" rel="icon">
<link href="../common/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- main css -->
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/app.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/header.css">
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/style.css">
<!-- vender css -->
<link rel="stylesheet" type="text/css" href="../common/css/appCommon/fontawesome_relative_path.css">
<script type="text/javascript" src="../common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/web/i18n.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/constant.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/header/header.js?__UPDATEID__"></script>
<script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@2.1.7/dist/loadingoverlay.min.js"></script>
</head>
<body onload="RF.init();">
<!-- header -->
<div id="includedHeader"></div>
<!-- report list -->
<main>
<div class="container-wrap">
<!-- breadcrumb -->
<nav aria-label="breadcrumb">
<ol class="breadcrumb px-0 mb-0">
<li class="breadcrumb-item"><a href="task-list.html" class="text-decoration-none text-underline">作業一覧</a></li>
<li class="breadcrumb-item active" aria-current="page"><span>報告一覧</span></li>
<li class="breadcrumb-item active" aria-current="page"><span>報告</span></li>
</ol>
</nav>
<!-- title -->
<div class="d-flex align-items-center">
<h1 class="fs-14 font-weight-bold pt-sm-4 pt-2 pb-3 mb-0 mr-auto" lang="reportForm"></h1>
<div style="display: none;">
<div><span style="font-size:18px;" lang="periodicInspectionPeriod"></span></div>
<div><span id="inspectDate"></span></div>
</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>
</div>
</div>
</main>
<div class="mb-5" id="report-form"></div>
<!-- confirm -->
<div id="includedConfirmModal"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="../common/js/newdash/app.js?__UPDATEID__"></script>
<script type="text/javascript" src="../common/js/newdash/common.js?__UPDATEID__"></script>
</body>
</html>
\ No newline at end of file
......@@ -25,10 +25,10 @@
<script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/operationSelect/operation-select.js"></script>
<script type="text/javascript" src="../js/notification-content/notification-content.js"></script>
<script type="text/javascript" src="../js/operationSelect/operationSelect.js"></script>
<script type="text/javascript" src="../js/notificationContent/notificationContent.js"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/sendMessage/send-message.js"></script>
<script type="text/javascript" src="../js/sendMessage/sendMessage.js"></script>
<script type="text/javascript">
$(document).ready(function(){
......@@ -39,12 +39,13 @@
<body>
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- send message -->
<main>
<div class="container-wrap">
<!-- header -->
<div id="includedHeader"></div>
<div id="includedMainTitle"></div>
<!-- content -->
<div class="py-2">
<div class="row">
......
......@@ -121,6 +121,10 @@ DASHBOARD.initHtmlItem = function (item) {
/** Initialization dashboard screen */
DASHBOARD.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
DASHBOARD.loadCommon();
DashboardSetting.getSettingData(function (settings) {
DASHBOARD.getDashboardData(function (dataDashboard) {
......@@ -173,14 +177,14 @@ DASHBOARD.goPickup = function (pickupId) {
/** Direct to Message list screen */
DASHBOARD.goMessageList = function () {
COMMON.goUrlWithCurrentParams('push-message-list.html', {});
COMMON.goUrlWithCurrentParams('pushMessageList.html', {});
};
/**
* Direct to send message screen
*/
DASHBOARD.goSendMessage = function () {
COMMON.goUrlWithCurrentParams('send-message.html', {});
COMMON.goUrlWithCurrentParams('sendMessage.html', {});
};
/**
......
/**
* Dashboard Setting js in dashboard.html
*
* @since 1.0 check web
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var DashboardSetting = {};
DashboardSetting.changeSettingCallback = function() {};
DashboardSetting.changeSettingCallback = function () {};
/**
* Html element array, map with json key from setting data API
......@@ -27,33 +27,33 @@ DashboardSetting.defaultSetting = {
continousWork: 1,
warningReport: 1,
dashboardHome: 0,
}
};
/** dummy setting json reponse */
DashboardSetting.dummySettingJson = {
dashboardSettingList: [
{
"id": 1,
"settingName": "New Report",
"settingValue": 1
id: 1,
settingName: 'New Report',
settingValue: 1,
},
{
"id": 2,
"settingName": "Continous Work",
"settingValue": 1
id: 2,
settingName: 'Continous Work',
settingValue: 1,
},
{
"id": 3,
"settingName": "Warning Report",
"settingValue": 1
id: 3,
settingName: 'Warning Report',
settingValue: 1,
},
{
"id": 4,
"settingName": "Dashboard Home",
"settingValue": 0
}
id: 4,
settingName: 'Dashboard Home',
settingValue: 0,
},
],
}
};
/**
* get setting data from cms
......@@ -64,34 +64,40 @@ DashboardSetting.getSettingData = function (callback) {
sid: COMMON.getSid(),
};
const url = DashboardSetting.baseApiUrl;
COMMON.cmsAjax(url, param, false, function (json) {
let settings = {};
//map id with key when save setting
const mapKeys = {
1: 'newReport',
2: 'continousWork',
3: 'warningReport',
4: 'dashboardHome'
};
if (json && json.dashboardSettingList) {
for (const item of json.dashboardSettingList) {
if (mapKeys.hasOwnProperty(item.id)) {
const settingKey = mapKeys[item.id];
settings[settingKey] = item.settingValue;
COMMON.cmsAjax(
url,
param,
false,
function (json) {
let settings = {};
//map id with key when save setting
const mapKeys = {
1: 'newReport',
2: 'continousWork',
3: 'warningReport',
4: 'dashboardHome',
};
if (json && json.dashboardSettingList) {
for (const item of json.dashboardSettingList) {
if (mapKeys.hasOwnProperty(item.id)) {
const settingKey = mapKeys[item.id];
settings[settingKey] = item.settingValue;
}
}
}
}
if (callback) {
callback(settings);
}
}, function() {
console.log('DashboardSetting.getSettingData error');
});
if (callback) {
callback(settings);
}
},
function () {
console.log('DashboardSetting.getSettingData error');
},
);
};
/**
* apply settings to screen
* @param {JSON} settings
* @param {JSON} settings
*/
DashboardSetting.applySettings = function (settings) {
for (const key in settings) {
......@@ -123,15 +129,21 @@ DashboardSetting.saveSetting = function () {
param[key] = element.enabled ? 1 : 0;
}
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.SAVE_DASHBOARD_SETTING;
COMMON.cmsAjax(url, param, false, function (json) {
DashboardSetting.closeModal();
if (DashboardSetting.changeSettingCallback && typeof DashboardSetting.changeSettingCallback === 'function') {
DashboardSetting.changeSettingCallback();
}
}, function() {
console.log('DashboardSetting.saveSetting error');
DashboardSetting.closeModal();
});
COMMON.cmsAjax(
url,
param,
false,
function (json) {
DashboardSetting.closeModal();
if (DashboardSetting.changeSettingCallback && typeof DashboardSetting.changeSettingCallback === 'function') {
DashboardSetting.changeSettingCallback();
}
},
function () {
console.log('DashboardSetting.saveSetting error');
DashboardSetting.closeModal();
},
);
};
/**
......
// prepared to use Global object(LOGIN)
/**
* prepared to use Global object(LOGIN)
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var LOGIN = {};
// var requirePasswordChange;
......@@ -9,579 +13,581 @@ LOGIN.optionList = [];
LOGIN.force_pw_change_on_login;
LOGIN.force_pw_change_periodically;
LOGIN.login_error_flag = false;
LOGIN.login_errorMessage = "";
LOGIN.login_errorMessage = '';
LOGIN.timeWaitSplashScreen = 2000;// wait splash screen 2 second
LOGIN.timeWaitSplashScreen = 2000; // wait splash screen 2 second
// Load login Info
LOGIN.loadLoginInfo = function() {
$('#chkRemember').attr('checked', 'checked');
if (ClientData.userInfo_accountPath() != null) {
$('#txtAccPath').val(ClientData.userInfo_accountPath());
}
if (ClientData.userInfo_loginId() != null) {
$('#txtAccId').val(ClientData.userInfo_loginId());
}
LOGIN.loadLoginInfo = function () {
$('#chkRemember').attr('checked', 'checked');
if (ClientData.userInfo_accountPath() != null) {
$('#txtAccPath').val(ClientData.userInfo_accountPath());
}
if (ClientData.userInfo_loginId() != null) {
$('#txtAccId').val(ClientData.userInfo_loginId());
}
};
// Initial Screen
LOGIN.initialScreen = function() {
if (ClientData.userInfo_rememberLogin()) {
LOGIN.loadLoginInfo();
} else {
$('#txtAccPath').val("");
$('#txtAccId').val("");
}
LOGIN.initialScreen = function () {
if (ClientData.userInfo_rememberLogin()) {
LOGIN.loadLoginInfo();
} else {
$('#txtAccPath').val('');
$('#txtAccId').val('');
}
};
// check Save Login Info
LOGIN.saveLoginInfo = function() {
var lang = I18N.getCurrentLanguage();
// load language
I18N.changeLanguage(lang);
var accountPath, loginId, password;
var chkRemember = $('#chkRemember').attr('checked');
accountPath = $('#txtAccPath').val();
loginId = $('#txtAccId').val();
password = $('#txtPassword').val();
// save user data to local storage
var date = new Date();
ClientData.userInfo_accountPath(accountPath);
ClientData.userInfo_loginId(loginId);
ClientData.userInfo_accountPath_session(accountPath);
ClientData.userInfo_loginId_session(loginId);
ClientData.userInfo_userName(LOGIN.userInfo_userName);
if (chkRemember == 'checked') {
ClientData.userInfo_rememberLogin(true);
} else {
ClientData.userInfo_rememberLogin(false);
}
ClientData.userInfo_lastLoginTime(date.jpDateTimeString());
ClientData.userInfo_sid_local(LOGIN.userinfo_sid);
// save sid for backup
ClientData.userInfo_sid_local_bak(LOGIN.userinfo_sid);
LOGIN.saveServiceUserOption();
// reset to paging function
ClientData.JumpQueue([]);
ClientData.IsJumpBack(false);
LOGIN.saveLoginInfo = function () {
var lang = I18N.getCurrentLanguage();
// load language
I18N.changeLanguage(lang);
var accountPath, loginId, password;
var chkRemember = $('#chkRemember').attr('checked');
accountPath = $('#txtAccPath').val();
loginId = $('#txtAccId').val();
password = $('#txtPassword').val();
// save user data to local storage
var date = new Date();
ClientData.userInfo_accountPath(accountPath);
ClientData.userInfo_loginId(loginId);
ClientData.userInfo_accountPath_session(accountPath);
ClientData.userInfo_loginId_session(loginId);
ClientData.userInfo_userName(LOGIN.userInfo_userName);
if (chkRemember == 'checked') {
ClientData.userInfo_rememberLogin(true);
} else {
ClientData.userInfo_rememberLogin(false);
}
ClientData.userInfo_lastLoginTime(date.jpDateTimeString());
ClientData.userInfo_sid_local(LOGIN.userinfo_sid);
// save sid for backup
ClientData.userInfo_sid_local_bak(LOGIN.userinfo_sid);
LOGIN.saveServiceUserOption();
// reset to paging function
ClientData.JumpQueue([]);
ClientData.IsJumpBack(false);
};
// Check validation
LOGIN.checkValidation = function() {
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var msgError = $('#main-error-message');
if (!ValidationUtil.CheckRequiredForText(accountPath)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
} else if (!ValidationUtil.CheckRequiredForText(loginId)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
} else if (!ValidationUtil.CheckRequiredForText(password)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
} else {
return true;
}
LOGIN.checkValidation = function () {
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var msgError = $('#main-error-message');
if (!ValidationUtil.CheckRequiredForText(accountPath)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
} else if (!ValidationUtil.CheckRequiredForText(loginId)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
} else if (!ValidationUtil.CheckRequiredForText(password)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
} else {
return true;
}
};
// Check Dialog validation
LOGIN.checkDialogValidation = function() {
var currentPass = $('#txtCurrentPass').val();
var newPass = $('#txtNewPass').val();
var confirmPass = $('#txtConfirmNew').val();
var msgError = $('#dialog-error-message');
if (!ValidationUtil.CheckRequiredForText(currentPass)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
return false;
} else if (!ValidationUtil.CheckRequiredForText(newPass)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
return false;
} else {
if (newPass != confirmPass) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgPwdNotMatch'));
msgError.attr('lang', 'msgPwdNotMatch');
msgError.show();
return false;
} else if (!ValidationUtil.CheckMinLengthForByte(newPass, 6)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgInvaildLength'));
msgError.attr('lang', 'msgInvaildLength');
msgError.show();
return false;
} else if (!ValidationUtil.CheckMaxLengthForByte(newPass, 16)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgInvaildLength'));
msgError.attr('lang', 'msgInvaildLength');
msgError.show();
return false;
} else if (ValidationUtil.HasSeqChar(newPass, 3)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgHasSeqChar'));
msgError.attr('lang', 'msgHasSeqChar');
msgError.show();
return false;
} else if (ValidationUtil.ContainSameSeqChar(newPass, currentPass, 4)) {
LOGIN.login_errorMessage = "";
msgError.html(I18N.i18nText('msgContainSameSeqChar'));
msgError.attr('lang', 'msgContainSameSeqChar');
msgError.show();
return false;
} else {
return true;
}
}
LOGIN.checkDialogValidation = function () {
var currentPass = $('#txtCurrentPass').val();
var newPass = $('#txtNewPass').val();
var confirmPass = $('#txtConfirmNew').val();
var msgError = $('#dialog-error-message');
if (!ValidationUtil.CheckRequiredForText(currentPass)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
return false;
} else if (!ValidationUtil.CheckRequiredForText(newPass)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
return false;
} else {
if (newPass != confirmPass) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgPwdNotMatch'));
msgError.attr('lang', 'msgPwdNotMatch');
msgError.show();
return false;
} else if (!ValidationUtil.CheckMinLengthForByte(newPass, 6)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgInvaildLength'));
msgError.attr('lang', 'msgInvaildLength');
msgError.show();
return false;
} else if (!ValidationUtil.CheckMaxLengthForByte(newPass, 16)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgInvaildLength'));
msgError.attr('lang', 'msgInvaildLength');
msgError.show();
return false;
} else if (ValidationUtil.HasSeqChar(newPass, 3)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgHasSeqChar'));
msgError.attr('lang', 'msgHasSeqChar');
msgError.show();
return false;
} else if (ValidationUtil.ContainSameSeqChar(newPass, currentPass, 4)) {
LOGIN.login_errorMessage = '';
msgError.html(I18N.i18nText('msgContainSameSeqChar'));
msgError.attr('lang', 'msgContainSameSeqChar');
msgError.show();
return false;
} else {
return true;
}
}
};
// Login Process
LOGIN.processLogin = function() {
var accountPath = "";
var loginId = "";
var password = "";
loginId = $('#txtAccId').val();
password = $('#txtPassword').val();
accountPath = $('#txtAccPath').val();
var requireChangePassword = 0;
var skipPwdDate;
var params = {
previousSid : '',
loginId : loginId,
password : password,
urlpath : accountPath
};
// Set sid for login, this will be checked authoring 2 sessions
if (ClientData.userInfo_sid_local()) {
params.previousSid = ClientData.userInfo_sid_local();
}
// Get url to login
url = COMMON.format(ClientData.conf_checkApiUrl(), accountPath) + CONSTANT.URL.CMS.API.LOGIN;
COMMON.cmsAjax(url, params, true, function(data) {
LOGIN.userinfo_sid = data.sid;
LOGIN.userInfo_userName = data.userName;
LOGIN.optionList = data.serviceOptionList;
LOGIN.getServiceOptionList();
if (data.result == 'success') {
// Save retrieved info
LOGIN.saveLoginInfo();
// set number new push message to 0
ClientData.pushInfo_newMsgNumber(0);
$('#main-error-message').css('display', 'none');
console.log("data.requirePasswordChange:" + data.requirePasswordChange);
COMMON.closeLoading();
if (data.requirePasswordChange == 0) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove("index.html");
} else if (data.requirePasswordChange == 1) {
if (LOGIN.force_pw_change_on_login == 2) { // force to change
// password
LOGIN.OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
$('#btnSkip').hide();
$("#txtPwdRemind").css('visibility', 'hidden');
} else if (LOGIN.force_pw_change_on_login == 1) { // recommend
// to change
// password
// Check 30 days
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
LOGIN.OpenChangePasswordDialog();
$('#btnSkip').show();
$(".ui-dialog-titlebar").hide();
} else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove("index.html");
} else if (numDay > 30) {
LOGIN.OpenChangePasswordDialog();
$('#btnSkip').show();
$(".ui-dialog-titlebar").hide();
}
}
} else { // no need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove("index.html");
}
} else if (data.requirePasswordChange == 2) {
if (LOGIN.force_pw_change_periodically == 1) { // recommend to
// change
// password
$('#btnSkip').show();
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
LOGIN.OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
} else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove("index.html");
} else if (numDay > 30) {
LOGIN.OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
}
}
} else if (LOGIN.force_pw_change_periodically == 2) { // Force
// to
// change
// password
LOGIN.OpenChangePasswordDialog();
$('#btnSkip').hide();
$(".ui-dialog-titlebar").hide();
$("#txtPwdRemind").css('visibility', 'hidden');
} else { // No need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove("index.html");
}
}
} else {
COMMON.closeLoading();
LOGIN.login_errorMessage = data.errorMessage;
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), data.errorMessage).toString());
$('#main-error-message').show();
}
}, function(result) {
LOGIN.login_error_flag = true;
COMMON.closeLoading();
if (result.errorMessage) {
LOGIN.login_errorMessage = result.errorMessage;
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), result.errorMessage).toString());
} else {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
}
$('#main-error-message').show();
});
LOGIN.processLogin = function () {
var accountPath = '';
var loginId = '';
var password = '';
loginId = $('#txtAccId').val();
password = $('#txtPassword').val();
accountPath = $('#txtAccPath').val();
var requireChangePassword = 0;
var skipPwdDate;
var params = {
previousSid: '',
loginId: loginId,
password: password,
urlpath: accountPath,
};
// Set sid for login, this will be checked authoring 2 sessions
if (ClientData.userInfo_sid_local()) {
params.previousSid = ClientData.userInfo_sid_local();
}
// Get url to login
url = COMMON.format(ClientData.conf_checkApiUrl(), accountPath) + CONSTANT.URL.CMS.API.LOGIN;
COMMON.cmsAjax(
url,
params,
true,
function (data) {
LOGIN.userinfo_sid = data.sid;
LOGIN.userInfo_userName = data.userName;
LOGIN.optionList = data.serviceOptionList;
LOGIN.getServiceOptionList();
if (data.result == 'success') {
// Save retrieved info
LOGIN.saveLoginInfo();
// set number new push message to 0
ClientData.pushInfo_newMsgNumber(0);
$('#main-error-message').css('display', 'none');
console.log('data.requirePasswordChange:' + data.requirePasswordChange);
COMMON.closeLoading();
if (data.requirePasswordChange == 0) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove('index.html');
} else if (data.requirePasswordChange == 1) {
if (LOGIN.force_pw_change_on_login == 2) {
// force to change
// password
LOGIN.OpenChangePasswordDialog();
$('.ui-dialog-titlebar').hide();
$('#btnSkip').hide();
$('#txtPwdRemind').css('visibility', 'hidden');
} else if (LOGIN.force_pw_change_on_login == 1) {
// recommend
// to change
// password
// Check 30 days
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
LOGIN.OpenChangePasswordDialog();
$('#btnSkip').show();
$('.ui-dialog-titlebar').hide();
} else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove('index.html');
} else if (numDay > 30) {
LOGIN.OpenChangePasswordDialog();
$('#btnSkip').show();
$('.ui-dialog-titlebar').hide();
}
}
} else {
// no need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove('index.html');
}
} else if (data.requirePasswordChange == 2) {
if (LOGIN.force_pw_change_periodically == 1) {
// recommend to
// change
// password
$('#btnSkip').show();
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
LOGIN.OpenChangePasswordDialog();
$('.ui-dialog-titlebar').hide();
} else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove('index.html');
} else if (numDay > 30) {
LOGIN.OpenChangePasswordDialog();
$('.ui-dialog-titlebar').hide();
}
}
} else if (LOGIN.force_pw_change_periodically == 2) {
// Force
// to
// change
// password
LOGIN.OpenChangePasswordDialog();
$('#btnSkip').hide();
$('.ui-dialog-titlebar').hide();
$('#txtPwdRemind').css('visibility', 'hidden');
} else {
// No need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// move to home.html page
COMMON.avwScreenMove('index.html');
}
}
} else {
COMMON.closeLoading();
LOGIN.login_errorMessage = data.errorMessage;
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), data.errorMessage).toString());
$('#main-error-message').show();
}
},
function (result) {
LOGIN.login_error_flag = true;
COMMON.closeLoading();
if (result.errorMessage) {
LOGIN.login_errorMessage = result.errorMessage;
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), result.errorMessage).toString());
} else {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
}
$('#main-error-message').show();
},
);
};
// Change Password Process
LOGIN.changePasswordProcess = function() {
var sid = ClientData.userInfo_sid_local();
var loginId = $('#txtAccId').val();
var password = $('#txtCurrentPass').val();
var confirmPass = $('#txtConfirmNew').val();
var params = {
sid : sid,
loginId : loginId,
password : password,
newPassword : confirmPass,
appId : 4
};
if (I18N.getCurrentLanguage()) {
params.language = I18N.getCurrentLanguage();
}
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE;
COMMON.cmsAjax(url, params, false, function(result) {
if (result.httpStatus == '200') {
LOGIN.CloseChangePasswordDialog();
$('#dialog-error-message').css('display', 'none');
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
if (ClientData.serviceOpt_abook_check() == 'Y') {
// move to home.html page
COMMON.avwScreenMove("index.html");
} else {
$('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG'));
$('#dialog-error-message').show();
}
} else if (result.httpStatus == '401') {
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} else if (result.httpStatus == '403') {
$('#dialog-error-message').html(data.message);
$('#dialog-error-message').show();
}
}, function(result) {
COMMON.closeLoading();
if (result.errorMessage) {
$('#dialog-error-message').html(result.errorMessage);
} else {
$('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG'));
}
$('#dialog-error-message').show();
});
LOGIN.changePasswordProcess = function () {
var sid = ClientData.userInfo_sid_local();
var loginId = $('#txtAccId').val();
var password = $('#txtCurrentPass').val();
var confirmPass = $('#txtConfirmNew').val();
var params = {
sid: sid,
loginId: loginId,
password: password,
newPassword: confirmPass,
appId: 4,
};
if (I18N.getCurrentLanguage()) {
params.language = I18N.getCurrentLanguage();
}
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE;
COMMON.cmsAjax(
url,
params,
false,
function (result) {
if (result.httpStatus == '200') {
LOGIN.CloseChangePasswordDialog();
$('#dialog-error-message').css('display', 'none');
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
if (ClientData.serviceOpt_abook_check() == 'Y') {
// move to home.html page
COMMON.avwScreenMove('index.html');
} else {
$('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG'));
$('#dialog-error-message').show();
}
} else if (result.httpStatus == '401') {
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} else if (result.httpStatus == '403') {
$('#dialog-error-message').html(data.message);
$('#dialog-error-message').show();
}
},
function (result) {
COMMON.closeLoading();
if (result.errorMessage) {
$('#dialog-error-message').html(result.errorMessage);
} else {
$('#dialog-error-message').html(I18N.i18nText('msgPwdChangeNG'));
}
$('#dialog-error-message').show();
},
);
};
// Change Language English
LOGIN.changeLanguage = function(lang) {
I18N.changeLanguage(lang);
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
if (LOGIN.login_errorMessage != "") {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
}
LOGIN.changeLanguage = function (lang) {
I18N.changeLanguage(lang);
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
if (LOGIN.login_errorMessage != '') {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
}
};
// Login click function
LOGIN.loginFunction = function() {
COMMON.showLoading();
if (LOGIN.checkValidation()) {
LOGIN.processLogin();
} else {
COMMON.closeLoading();
}
LOGIN.loginFunction = function () {
COMMON.showLoading();
if (LOGIN.checkValidation()) {
LOGIN.processLogin();
} else {
COMMON.closeLoading();
}
};
// Change Password function
LOGIN.changePassFunction = function() {
if (LOGIN.checkDialogValidation()) {
LOGIN.changePasswordProcess();
}
LOGIN.changePassFunction = function () {
if (LOGIN.checkDialogValidation()) {
LOGIN.changePasswordProcess();
}
};
// Skip Password function
LOGIN.skipPassFunction = function() {
var date = new Date();
ClientData.userInfo_pwdSkipDt(date);
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
if (ClientData.serviceOpt_abook_check() == 'Y') {
// move to home.html page
COMMON.avwScreenMove("index.html");
} else {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').show();
}
LOGIN.skipPassFunction = function () {
var date = new Date();
ClientData.userInfo_pwdSkipDt(date);
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
if (ClientData.serviceOpt_abook_check() == 'Y') {
// move to home.html page
COMMON.avwScreenMove('index.html');
} else {
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').show();
}
};
// Open Change Password Dialog
LOGIN.OpenChangePasswordDialog = function() {
$("#password-reset-modal").show();
COMMON.showLoading();
console.log("password open");
LOGIN.OpenChangePasswordDialog = function () {
$('#password-reset-modal').show();
COMMON.showLoading();
console.log('password open');
};
// Close Chnage Password Dialog
LOGIN.CloseChangePasswordDialog = function() {
$("#main-password-change").hide();
COMMON.closeLoading();
LOGIN.CloseChangePasswordDialog = function () {
$('#main-password-change').hide();
COMMON.closeLoading();
};
// Save Service Option
LOGIN.saveServiceUserOption = function() {
$.each(LOGIN.optionList, function(i, option) {
if (option.serviceOptionId == 22) {
ClientData.serviceOpt_force_pw_change_periodically(option.value);
} else if (option.serviceOptionId == 21) {
ClientData.serviceOpt_force_pw_change_on_login(option.value);
} else if (option.serviceOptionId == 49) {
ClientData.serviceOpt_usable_push_message(option.value);
} else if (option.serviceOptionId == 161) {
ClientData.serviceOpt_abook_check(option.value);
} else if (option.serviceOptionId == 183) {
ClientData.serviceOpt_chat_function(option.value);
}
});
LOGIN.saveServiceUserOption = function () {
$.each(LOGIN.optionList, function (i, option) {
if (option.serviceOptionId == 22) {
ClientData.serviceOpt_force_pw_change_periodically(option.value);
} else if (option.serviceOptionId == 21) {
ClientData.serviceOpt_force_pw_change_on_login(option.value);
} else if (option.serviceOptionId == 49) {
ClientData.serviceOpt_usable_push_message(option.value);
} else if (option.serviceOptionId == 161) {
ClientData.serviceOpt_abook_check(option.value);
} else if (option.serviceOptionId == 183) {
ClientData.serviceOpt_chat_function(option.value);
}
});
};
// Get Service Option
LOGIN.getServiceOptionList = function() {
$.each(LOGIN.optionList, function(i, option) {
if (option.serviceOptionId == 22) {
LOGIN.force_pw_change_periodically = option.value;
} else if (option.serviceOptionId == 21) {
LOGIN.force_pw_change_on_login = option.value;
}
});
LOGIN.getServiceOptionList = function () {
$.each(LOGIN.optionList, function (i, option) {
if (option.serviceOptionId == 22) {
LOGIN.force_pw_change_periodically = option.value;
} else if (option.serviceOptionId == 21) {
LOGIN.force_pw_change_on_login = option.value;
}
});
};
LOGIN.loginWhenClickEnter = function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) { // Enter keycode
$('#btnLogin').click();
}
LOGIN.loginWhenClickEnter = function (e) {
var code = e.keyCode ? e.keyCode : e.which;
if (code == 13) {
// Enter keycode
$('#btnLogin').click();
}
};
// init login for normal user
LOGIN.initLoginNormalUser = function() {
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
// Initial Screen
LOGIN.initialScreen();
// Change language
let selector = document.getElementById("languageSelect");
var lang = I18N.getCurrentLanguage();
if (lang) {
selector.value = lang;
}
selector.addEventListener("change", function() {
LOGIN.changeLanguage(this.value);
})
// Button login click event
$('#btnLogin').click(LOGIN.loginFunction);
// Button Change click event
$('#btnChange').click(LOGIN.changePassFunction);
// Button Skip click event
$('#btnSkip').click(LOGIN.skipPassFunction);
$('#txtPassword').keydown(LOGIN.loginWhenClickEnter);
LOGIN.initLoginNormalUser = function () {
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
// Initial Screen
LOGIN.initialScreen();
// Change language
let selector = document.getElementById('languageSelect');
var lang = I18N.getCurrentLanguage();
if (lang) {
selector.value = lang;
}
selector.addEventListener('change', function () {
LOGIN.changeLanguage(this.value);
});
// Button login click event
$('#btnLogin').click(LOGIN.loginFunction);
// Button Change click event
$('#btnChange').click(LOGIN.changePassFunction);
// Button Skip click event
$('#btnSkip').click(LOGIN.skipPassFunction);
$('#txtPassword').keydown(LOGIN.loginWhenClickEnter);
};
/* display alert screen */
LOGIN.showAlertScreen = function(errMes, scrMove) {
// アラートメッセージの表示
if (errMes == undefined || errMes == "") {
errMes = "message."; // I18N.i18nText('msgPageImgErr');
}
COMMON.lockLayout();
/* show error messages */
$().toastmessage({
position : 'middle-center'
});
$().toastmessage('showToast', {
type : 'error',
sticky : true,
text : errMes,
close : function() {
}
});
$('.toast-type-error').css('height', '100px');
$('.toast-type-error > p').css('padding-top', '35px');
$('.toast-item-close').live('click', function() {
COMMON.unlockLayout();
if (scrMove) {
COMMON.avwScreenMove(scrMove);
}
});
LOGIN.showAlertScreen = function (errMes, scrMove) {
// アラートメッセージの表示
if (errMes == undefined || errMes == '') {
errMes = 'message.'; // I18N.i18nText('msgPageImgErr');
}
COMMON.lockLayout();
/* show error messages */
$().toastmessage({
position: 'middle-center',
});
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: errMes,
close: function () {},
});
$('.toast-type-error').css('height', '100px');
$('.toast-type-error > p').css('padding-top', '35px');
$('.toast-item-close').live('click', function () {
COMMON.unlockLayout();
if (scrMove) {
COMMON.avwScreenMove(scrMove);
}
});
};
// $(document).ready(function (e) {
LOGIN.ready = function() {
// Session Storage clear
SessionStorageUtils.clear();
COMMON.userSessionObj = null;
// create new session
COMMON.createUserSession();
I18N.initi18n();
var sysSettings = COMMON.sysSetting(); // get info in conf.json
// check an getits setting
if (sysSettings.apiUrl == "") {
// acquire parameters
var siteUrl = COMMON.getUrlParam('siteUrl', '');
var urlPath = COMMON.getUrlParam('urlPath', '');
var storeUrl = COMMON.getUrlParam('storeUrl', '');
if (siteUrl != "" && urlPath != "") {
// ClientData.siteUrl(siteUrl);
// set api connection
ClientData.conf_apiUrl(siteUrl + "{0}/abvapi");
ClientData.conf_apiLoginUrl(siteUrl + "nuabvapi");
ClientData.conf_checkApiUrl(siteUrl + "checkapi/web");
ClientData.conf_apiResourceDlUrl(siteUrl + "{0}/dl");
// set account setting value
ClientData.userInfo_accountPath(urlPath);
ClientData.userInfo_accountPath_session(urlPath);
ClientData.userInfo_loginId("");
ClientData.userInfo_loginId_session("");
}
} else {
// conf parameter set
ClientData.conf_apiUrl(sysSettings.apiUrl);
ClientData.conf_checkApiUrl(sysSettings.checkApiUrl);
ClientData.conf_apiLoginUrl(sysSettings.apiLoginUrl);
ClientData.conf_apiResourceDlUrl(sysSettings.apiResourceDlUrl);
}
// Set when you receive the account path with the argument
$('#normalUser').show();
$('#formlogin').hide();
$('#logologin').animate({
"margin-top" : 0
}, LOGIN.timeWaitSplashScreen, function() {
$('#formlogin').show();
$('#menu-language').animate({
opacity : 1
}, LOGIN.timeWaitSplashScreen);
$('#formlogin').animate({
opacity : 1
}, LOGIN.timeWaitSplashScreen);
$('.cnt_footer').animate({
opacity : 1
}, LOGIN.timeWaitSplashScreen);
});
LOGIN.initLoginNormalUser();
LOGIN.ready = function () {
// Session Storage clear
SessionStorageUtils.clear();
COMMON.userSessionObj = null;
// create new session
COMMON.createUserSession();
I18N.initi18n();
var sysSettings = COMMON.sysSetting(); // get info in conf.json
// check an getits setting
if (sysSettings.apiUrl == '') {
// acquire parameters
var siteUrl = COMMON.getUrlParam('siteUrl', '');
var urlPath = COMMON.getUrlParam('urlPath', '');
var storeUrl = COMMON.getUrlParam('storeUrl', '');
if (siteUrl != '' && urlPath != '') {
// ClientData.siteUrl(siteUrl);
// set api connection
ClientData.conf_apiUrl(siteUrl + '{0}/abvapi');
ClientData.conf_apiLoginUrl(siteUrl + 'nuabvapi');
ClientData.conf_checkApiUrl(siteUrl + 'checkapi/web');
ClientData.conf_apiResourceDlUrl(siteUrl + '{0}/dl');
// set account setting value
ClientData.userInfo_accountPath(urlPath);
ClientData.userInfo_accountPath_session(urlPath);
ClientData.userInfo_loginId('');
ClientData.userInfo_loginId_session('');
}
} else {
// conf parameter set
ClientData.conf_apiUrl(sysSettings.apiUrl);
ClientData.conf_checkApiUrl(sysSettings.checkApiUrl);
ClientData.conf_apiLoginUrl(sysSettings.apiLoginUrl);
ClientData.conf_apiResourceDlUrl(sysSettings.apiResourceDlUrl);
}
// Set when you receive the account path with the argument
$('#normalUser').show();
$('#formlogin').hide();
$('#logologin').animate(
{
'margin-top': 0,
},
LOGIN.timeWaitSplashScreen,
function () {
$('#formlogin').show();
$('#menu-language').animate(
{
opacity: 1,
},
LOGIN.timeWaitSplashScreen,
);
$('#formlogin').animate(
{
opacity: 1,
},
LOGIN.timeWaitSplashScreen,
);
$('.cnt_footer').animate(
{
opacity: 1,
},
LOGIN.timeWaitSplashScreen,
);
},
);
LOGIN.initLoginNormalUser();
};
/**
* Operation Select js in operation-select.html
* Operation Select js in operationSelect.html
*
* @since 1.0 check web
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var NotificationSelect = {};
NotificationSelect.nameSelected="";
NotificationSelect.valueSelected="";
NotificationSelect.nameSelected = '';
NotificationSelect.valueSelected = '';
/**
* default operation select data JSON
*/
......@@ -14,23 +14,29 @@ NotificationSelect.defaultNotificationSelectJson = [];
/**
* get operation select data from cms
* @param {function} callback
* @param {function} callback
*/
NotificationSelect.getNotificationSelectData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PUSH_MESSAGE_TEMPLATE;
COMMON.cmsAjax(url, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('NotificationSelect.getNotificationSelectData error');
if (callback) {
callback(NotificationSelect.defaultNotificationSelectJson);
}
});
COMMON.cmsAjax(
url,
param,
false,
function (json) {
if (callback) {
callback(json);
}
},
function () {
console.log('NotificationSelect.getNotificationSelectData error');
if (callback) {
callback(NotificationSelect.defaultNotificationSelectJson);
}
},
);
};
/**
......@@ -48,7 +54,7 @@ NotificationSelect.selectOperationClick = function () {
/**
* init data, action when screen onload
*/
NotificationSelect.init = function (selectedCallback) {
NotificationSelect.init = function (selectedCallback) {
NotificationSelect.getNotificationSelectData(function (data) {
if (typeof data === 'undefined' || data == null) return;
NotificationSelect.createNotificationSelectList(data.pushMessageTemplate);
......@@ -59,57 +65,59 @@ NotificationSelect.selectOperationClick = function () {
/**
* Implement notification select html
* @returns
* @returns
*/
NotificationSelect.createNotificationSelectList = function(pushMessageTemplate) {
$("#notificationSelectList").empty();
NotificationSelect.createNotificationSelectList = function (pushMessageTemplate) {
$('#notificationSelectList').empty();
if (typeof pushMessageTemplate === 'undefined' || pushMessageTemplate.length < 1) return;
let classSelected = "selected";
let classSelected = 'selected';
for (let i = 0; i < pushMessageTemplate.length; i++) {
let divName = $("<div class='pl-5 py-3 h-100 w-100 align-self-center select-label'>" + pushMessageTemplate[i].name + "</div>");
let divIcon = $("<div class='flex-shrink-1 mx-3 align-self-center'>"
+ "<button class='btn btn-link border collapsed' type='button' data-toggle='collapse' data-target='#collapse" + i + "' aria-expanded='true' aria-controls='collapse" + i + "'>"
+ "<div class='arrow-icon'></div>"
+ "</button></div>");
let divName = $("<div class='pl-5 py-3 h-100 w-100 align-self-center select-label'>" + pushMessageTemplate[i].name + '</div>');
let divIcon = $(
"<div class='flex-shrink-1 mx-3 align-self-center'>" +
"<button class='btn btn-link border collapsed' type='button' data-toggle='collapse' data-target='#collapse" +
i +
"' aria-expanded='true' aria-controls='collapse" +
i +
"'>" +
"<div class='arrow-icon'></div>" +
'</button></div>',
);
let ahrefName = $("<a href='#' class='d-flex text-decoration-none'></a>");
let divParentName = $("<div class='card mb-2 " + classSelected + "' id='heading" + i + "'></div>");
classSelected = "";
let ahrefName = $("<a href='#' class='d-flex text-decoration-none'></a>");
let divParentName = $("<div class='card mb-2 " + classSelected + "' id='heading" + i + "'></div>");
classSelected = '';
let divValue = $("<div id='collapse" + i + "' class='collapse' aria-labelledby='heading" + i + "' data-parent='#accordion" + i + "'></div>");
let divBodyValue = $("<div class='card-body'>" + pushMessageTemplate[i].value + "</div>");
let divValue = $("<div id='collapse" + i + "' class='collapse' aria-labelledby='heading" + i + "' data-parent='#accordion" + i + "'></div>");
let divBodyValue = $("<div class='card-body'>" + pushMessageTemplate[i].value + '</div>');
let messageli = $("<li class='accordion' id='accordion" + i + "'></li>");
ahrefName.append(divName);
ahrefName.append(divIcon);
let messageli = $("<li class='accordion' id='accordion" + i + "'></li>");
ahrefName.append(divName);
ahrefName.append(divIcon);
divParentName.append(ahrefName);
divValue.append(divBodyValue);
messageli.append(divParentName);
messageli.append(divValue);
if(i == 0)
{
messageli.append(divParentName);
messageli.append(divValue);
if (i == 0) {
NotificationSelect.nameSelected = pushMessageTemplate[i].name;
NotificationSelect.valueSelected = pushMessageTemplate[i].value;
}
$("#notificationSelectList").append(messageli);
}
}
$('#notificationSelectList').append(messageli);
}
};
/**
* handle click event of select button
*/
NotificationSelect.onClickTempalte = function () {
NotificationSelect.onClickTempalte = function () {
NotificationSelect.chooseTemplate();
};
/**
* Get operation select and call back function in main page
*/
NotificationSelect.chooseTemplate = function () {
NotificationSelect.chooseTemplate = function () {
let param = {};
param.nameSelected = NotificationSelect.nameSelected;
param.valueSelected = NotificationSelect.valueSelected;
......@@ -122,6 +130,6 @@ NotificationSelect.selectOperationClick = function () {
/**
* close setting dialog
*/
NotificationSelect.closeModal = function () {
NotificationSelect.closeModal = function () {
$('#select-template-modal .close').click();
};
\ No newline at end of file
};
......@@ -5,15 +5,22 @@
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var OL = {};
OL.operationList; //Operation json data
OL.operationGroupMaster; //category(operationGroupMaster) json data
OL.isOperationGroupMaster = 0; //0: category(operationGroupMaster) not exist 1: category(operationGroupMaster) exist
var OL = {};
OL.operationList; //Operation json data
OL.operationGroupMaster; //category(operationGroupMaster) json data
OL.isOperationGroupMaster = 0; //0: category(operationGroupMaster) not exist 1: category(operationGroupMaster) exist
OL.sortIndex;
OL.operationGroupMasterId;
OL.REPORT_TYPE = {
REPORTONLY: 0, //report only
INSPECT: 1, //rountine
WITHREPLY: 2, // report answer
WORKFLOW: 3 // continuous
}
/**
* process on page load.
* 1.get all data.
......@@ -22,7 +29,11 @@ OL.operationGroupMasterId;
*/
OL.init = function () {
console.log('OperationList start');
COMMON.showLoading();
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'workList', null, null);
TEMPLATE.loadConfirmModal("#includedConfirmModal");
//get all data of operation list scene
OL.getAllDataWeb(sessionStorage.OL_searchKeyWord, sessionStorage.OL_sortIndex, sessionStorage.OL_searchStartDate, sessionStorage.OL_searchEndDate, sessionStorage.OL_operationGroupMasterId);
......@@ -30,8 +41,10 @@ OL.init = function () {
OL.createOperationList(OL.operationList);
//show category(operationGroupMaster)
OL.createCategory();
COMMON.closeLoading();
$("#includedCategoryModal").load("../common/category-modal.html", function() {
OL.createCategory();
I18N.initi18n();
});
};
/**
......@@ -131,42 +144,61 @@ OL.createOperationList = function (operationList) {
//Initialization
OL.initActiveSortIndex();
$('#operationTable').empty();
$('#operationCount').text(0);
if (!operationList) {
return;
}
$('#operationCount').text(operationList.length);
//create & show
for (let i = 0; i < operationList.length; i++) {
let operationTR = $('<tr/>');
const operationNameTd = $(
"<td class='operationId_" +
operationList[i].operationId +
"'><a href=\"javascript:OL.sendOperation('" +
operationList[i].operationId +
"', '" +
operationList[i].operationType +
"', '" +
operationList[i].reportType +
"', '" +
operationList[i].enableAddReport +
"');\" class='d-block text-black text-decoration-none mb-1'>" +
operationList[i].operationName +
"</a><div class='fa-sm mobile_operation_date'><i class='far fa-clock fa-blue' style='color:blue;margin-right:10px'></i>" +
OL.setOperationDate(operationList[i].operationStartDate) +
' ~ ' +
OL.setOperationDate(operationList[i].operationEndDate) +
'</div></td>',
);
const operationStartDateTd = $('<td/>', { class: 'operationStartDate' }).text(OL.setOperationDate(operationList[i].operationStartDate));
const operationEndDateTd = $('<td/>', { class: 'operationEndDate' }).text(OL.setOperationDate(operationList[i].operationEndDate));
operationTR.append(operationNameTd);
operationTR.append(operationStartDateTd);
operationTR.append(operationEndDateTd);
$('.table tbody').append(operationTR);
let classIcon ;
switch (operationList[i].reportType)
{
case OL.REPORT_TYPE.REPORTONLY:
classIcon = "report";
break;
case OL.REPORT_TYPE.INSPECT:
classIcon = "inspection";
break;
case OL.REPORT_TYPE.WITHREPLY:
classIcon = "questionary";
break;
case OL.REPORT_TYPE.WORKFLOW:
classIcon = "proccess";
break;
}
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let ahrefRequiredFlg = $("<a href=\"javascript:OL.sendOperation('"
+ operationList[i].operationId
+ "', '"
+ operationList[i].operationType
+ "', '"
+ operationList[i].reportType
+ "', '"
+ operationList[i].enableAddReport
+ "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'>"
+ "<span class='" + classIcon + "'></span>"
+ "</div></div>")
let divDate = "<div class='fs-8 text-secondary text-truncate'>"
+ OL.setOperationDate(operationList[i].operationStartDate)
+ ' ~ '
+ OL.setOperationDate(operationList[i].operationEndDate)
+ "</div>";
let divText = $("<div class='pl-5 h-100 d-flex align-items-center'>"
+ "<div class='w-100'>"
+ "<div class='fs-12 text-truncate'>" + operationList[i].operationName + "</div>"
+ divDate
+ "</div></div>");
ahrefRequiredFlg.append(divIcon);
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
$('#operationTable').append(messageli);
}
};
......@@ -207,11 +239,9 @@ OL.createCategory = function () {
if (!OL.isOperationGroupMaster) {
return;
}
OL.initCategory();
OL.createBreadcrumbList();
OL.createCategoryList();
OL.acdMenu();
};
/**
......@@ -221,22 +251,7 @@ OL.initCategory = function () {
if (!OL.isOperationGroupMaster) {
return;
}
$('#operationGroupMasterButton').removeClass('d-none');
OL.setCategoryHeight();
$(window).resize(function () {
OL.setCategoryHeight();
});
};
/**
* change height category(operationGroupMaster)
*/
OL.setCategoryHeight = function () {
const CATEGORY_HEIGHT = $('footer').offset().top - $('#category-menu').offset().top;
$('#category-menu').css('overflow', 'scroll');
$('#category-menu').height(CATEGORY_HEIGHT);
$('#overlayDiv').height(CATEGORY_HEIGHT);
};
/**
......@@ -249,18 +264,26 @@ OL.createBreadcrumbList = function () {
$('#groupMasterPath').empty();
if (typeof OL.operationGroupMasterId === 'undefined' || OL.operationGroupMasterId == 0) {
$('#groupMasterPath').append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">' + COMMON.getMsg('all') + '</a></li>');
$('#groupMasterPath').append('<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-underline">' + I18N.i18nText('categoryAll') + '</a></li>');
} else {
let treeList = [];
OL.createBreadcrumbTree(treeList, OL.operationGroupMasterId);
treeList.forEach(function (operationGroupMaster) {
$('#groupMasterPath').append(
'<li class="breadcrumb-item"><a onclick="OL.changeOperationGroupMaster(' +
operationGroupMaster.operationGroupMasterId +
');" class="text-decoration-none text-dark">' +
operationGroupMaster.operationGroupMasterName +
'</a></li>',
);
if (operationGroupMaster.operationGroupMasterId != OL.operationGroupMasterId) {
$('#groupMasterPath').append(
'<li class="breadcrumb-item"><a onclick="OL.changeOperationGroupMaster(' +
operationGroupMaster.operationGroupMasterId +
');" class="text-decoration-none text-underline">' +
operationGroupMaster.operationGroupMasterName +
'</a></li>',
);
} else {
$('#groupMasterPath').append(
'<li class="breadcrumb-item active" aria-current="page"><span>' +
operationGroupMaster.operationGroupMasterName +
'</span></li>',
);
}
});
}
};
......@@ -290,87 +313,81 @@ OL.createCategoryList = function () {
if (!OL.isOperationGroupMaster) {
return;
}
//Create a side menu category structure
$('.group-category-list').remove();
var categoryListElement = $('#categoryListMenu');
categoryListElement.empty();
OL.operationGroupMaster.sort(function (a, b) {
if (a.operationGroupMasterLevel < b.operationGroupMasterLevel) return -1;
if (a.operationGroupMasterLevel > b.operationGroupMasterLevel) return 1;
return 1;
});
//common
const noCategory = $("<dl id='groupMasterId_0' class='group-category-list'><dt><a onclick='OL.changeOperationGroupMaster(0);'>" + COMMON.getMsg('all') + '</a></dt></dl>');
$('#category-menu').append(noCategory);
let allChecked = '';
if (typeof OL.operationGroupMasterId === 'undefined' || OL.operationGroupMasterId == 0) {
allChecked = ' checked';
}
const allCategory = $('<ul><li><label><input type="radio" name="category" value="0"' +
allChecked +
'><span class="lang" lang="categoryAll">' + I18N.i18nText('categoryAll') + '</span></label></li></ul>');
categoryListElement.append(allCategory);
//create category(operationGroupMaster) structure
for (let i = 0; i < OL.operationGroupMaster.length; i++) {
if (OL.operationGroupMaster[i].operationGroupMasterLevel == 0) {
const categoryParent = $(
'<dl id=groupMasterId_' +
OL.operationGroupMaster[i].operationGroupMasterId +
" class='group-category-list' style='overflow-x:auto;'><dt class='menu-ttl'><a onclick='OL.changeOperationGroupMaster(" +
OL.operationGroupMaster[i].operationGroupMasterId +
");'>" +
OL.operationGroupMaster[i].operationGroupMasterName +
'</a></dt></dl>',
);
$('#category-menu').append(categoryParent);
const item = OL.operationGroupMaster[i];
console.log(item);
let inputLabel = $('<label>');
let inputRadio = $('<input type="radio" name="category">');
inputRadio.val(item.operationGroupMasterId);
if (OL.operationGroupMasterId && OL.operationGroupMasterId == item.operationGroupMasterId) {
inputRadio.prop('checked', true);
}
let groupSpan = $('<span>' + item.operationGroupMasterName + '</span>');
inputLabel.append(inputRadio);
inputLabel.append(groupSpan);
if (item.operationGroupMasterLevel == 0) {
const accordionId = 'accordion' + item.operationGroupMasterId;
const headingId = 'heading' + item.operationGroupMasterId;
const collapseId = 'collapse' + item.operationGroupMasterId;
let categoryParentElm = $('<li class="accordion" id="' + accordionId + '" />');
let headingDiv = $('<div id="' + headingId + '" />');
let linkA = $('<a class="list-menu-link" />');
let collapseButton = $('<button type="button" class="collapsed" data-toggle="collapse" aria-expanded="true" />');
collapseButton.attr('data-target', '#' + collapseId);
collapseButton.attr('aria-controls', collapseId);
collapseButton.append('<div class="arrow-icon"></div>');
linkA.append(collapseButton);
linkA.append(inputLabel);
headingDiv.append(linkA);
categoryParentElm.append(headingDiv);
categoryListElement.append(categoryParentElm);
} else {
if ($('#groupMasterId_' + OL.operationGroupMaster[i].parentOperationGroupMasterId + '>ul').length > 0) {
const categoryChild = $(
"<li id='groupMasterId_" +
OL.operationGroupMaster[i].operationGroupMasterId +
"' class=''><p class='category-li group-level-" +
OL.operationGroupMaster[i].operationGroupMasterLevel +
"'><a class='category-a' onclick='OL.changeOperationGroupMaster(" +
OL.operationGroupMaster[i].operationGroupMasterId +
");'>" +
OL.operationGroupMaster[i].operationGroupMasterName +
'</a></p></li>',
);
$('#groupMasterId_' + OL.operationGroupMaster[i].parentOperationGroupMasterId + ' >ul').append(categoryChild);
let li = $('<li>');
li.append(inputLabel);
let parentElm = $('#collapse' + item.parentOperationGroupMasterId + ' > ul');
if (typeof parentElm === 'undefined' || !parentElm || parentElm.length < 1) {
const accordionParentId = 'accordion' + item.parentOperationGroupMasterId;
const headingParentId = 'heading' + item.parentOperationGroupMasterId;
const collapseParentId = 'collapse' + item.parentOperationGroupMasterId;
parentElm = $('<div id="' + collapseParentId + '" class="collapse">');
parentElm.attr('data-parent', '#' + accordionParentId);
parentElm.attr('aria-labelledby', headingParentId);
let ul = $('<ul>');
ul.append(li);
parentElm.append(ul);
$('#' + accordionParentId).append(parentElm);
} else {
const groupParents = '#groupMasterId_' + OL.operationGroupMaster[i].parentOperationGroupMasterId;
$(groupParents + ' > p').addClass('sub-menu-ttl');
const categoryChild = $(
"<ul style='display:none;' class=''><li class='' id='groupMasterId_" +
OL.operationGroupMaster[i].operationGroupMasterId +
"' class=''><p class='category-li group-level-" +
OL.operationGroupMaster[i].operationGroupMasterLevel +
"'><a class='category-a' onclick='OL.changeOperationGroupMaster(" +
OL.operationGroupMaster[i].operationGroupMasterId +
");'>" +
OL.operationGroupMaster[i].operationGroupMasterName +
'</a></p></li></ul>',
);
$('#groupMasterId_' + OL.operationGroupMaster[i].parentOperationGroupMasterId).append(categoryChild);
parentElm.append(li);
}
}
}
};
/**
* Open/close category(operationGroupMaster) drawer menu
* Handle onclick category selection button
*/
OL.acdMenu = function () {
//Hide accordion contents by default
$('.drawer-menu dd').css('display', 'none');
$('.drawer-menu2 ul').css('display', 'none');
//second accordion
$('.drawer-menu dt').on('click', function () {
$('.sub-menu-ttl').removeClass('openAcd').next().slideUp('fast');
$('.drawer-menu dt').not(this).removeClass('open').next().slideUp('fast');
$(this).toggleClass('open').next().slideToggle('fast');
});
//third accordion
$('.sub-menu-ttl').on('click', function () {
$('.sub-menu-ttl').not($(this)).not($(this).parents().siblings('p')).removeClass('openAcd').next().slideUp('fast');
$(this).toggleClass('openAcd').next().slideToggle('fast');
});
OL.onClickCategorySelection = function() {
const operationGroupMasterId = $('input[name="category"]:checked').val();
$('#category-modal .close').click();
OL.changeOperationGroupMaster(operationGroupMasterId);
};
/**
......@@ -395,6 +412,9 @@ OL.changeSortType = function (sortType) {
*/
OL.sortOperationList = function (sortNumber) {
if (!OL.operationList) {
return;
}
switch (sortNumber) {
case CONSTANT.SORT_TYPE.NAME:
OL.operationList.sort(function (a, b) {
......@@ -480,12 +500,6 @@ OL.changeOperationGroupMaster = function (operationGroupMasterId) {
* open the category(OperationGroupMaster)
*/
OL.openCategory = function () {
window.scrollTo(0, 0);
if ($('#category-menu').hasClass('open')) {
$('body').css('overflow', 'visible');
} else {
$('body').css('overflow', 'hidden');
}
};
/**
......@@ -507,8 +521,13 @@ OL.sendOperation = function (operationId, operationType, reportType, enableAddRe
//save operation logs. needed for sorting
OL.saveOperationReadingLog(operationId, operationType, reportType);
//Transition to the report form or operation list screen
sessionStorage.OL_operationId = operationId;
COMMON.avwScreenMove("reportList.html");
if (enableAddReport == '1' || reportType == CONSTANT.REPORT_TYPE.ROUTINE) {
sessionStorage.OL_operationId = operationId;
COMMON.avwScreenMove('reportList.html');
} else {
const url = 'reportForm.html?operationId=' + operationId;
COMMON.avwScreenMove(url);
}
};
/**
......@@ -542,6 +561,7 @@ OL.createUrlOfOperation = function (enableAddReport, reportType) {
if (reportType == CONSTANT.REPORT_TYPE.ROUTINE || enableAddReport == '1') {
return baseUrl + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST;
} else {
return baseUrl + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM + '/' + CONSTANT.REPLY_NO.REPORT;
return baseUrl + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
}
};
/**
* Operation Select js in operation-select.html
* Operation Select js in operationSelect.html
*
* @since 1.0 check web
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var OperationSelect = {};
OperationSelect.changeSelectCallback = function() {};
OperationSelect.changeSelectCallback = function () {};
OperationSelect.operationIdSelected="";
OperationSelect.operationNameSelected="";
OperationSelect.operationIdSelected = '';
OperationSelect.operationNameSelected = '';
/**
* default operation select data JSON
......@@ -16,23 +16,29 @@ OperationSelect.defaultOperationSelectJson = [];
/**
* get operation select data from cms
* @param {function} callback
* @param {function} callback
*/
OperationSelect.getOperationSelectData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.OPERATION_SELECT;
COMMON.cmsAjax(url, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('OperationSelect.getOperationSelectData error');
if (callback) {
callback(OperationSelect.defaultOperationSelectJson);
}
});
COMMON.cmsAjax(
url,
param,
false,
function (json) {
if (callback) {
callback(json);
}
},
function () {
console.log('OperationSelect.getOperationSelectData error');
if (callback) {
callback(OperationSelect.defaultOperationSelectJson);
}
},
);
};
/**
......@@ -61,50 +67,49 @@ OperationSelect.init = function (selectedCallback) {
/**
* Implement operation select html
* @returns
* @returns
*/
OperationSelect.createOperationSelectList = function(operationList) {
$("#operationSelectList").empty();
OperationSelect.createOperationSelectList = function (operationList) {
$('#operationSelectList').empty();
if (typeof operationList === 'undefined' || operationList.length < 1) return;
for (let i = 0; i < operationList.length; i++) {
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let ahrefRequiredFlg = $("<a href='#' class='d-block px-5 py-3 text-decoration-none select-label' data-key='" + operationList[i].operationId + "' data-name='" + operationList[i].operationName + "' ></a>");
let divText = $("<div class='fs-12 text-truncate d-block'>"+ operationList[i].operationName + "</div>");
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let ahrefRequiredFlg = $(
"<a href='#' class='d-block px-5 py-3 text-decoration-none select-label' data-key='" + operationList[i].operationId + "' data-name='" + operationList[i].operationName + "' ></a>",
);
let divText = $("<div class='fs-12 text-truncate d-block'>" + operationList[i].operationName + '</div>');
$("#operationSelectList").append(messageli);
}
$("#operationSelectList :first-child").addClass("selected");
}
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
$('#operationSelectList').append(messageli);
}
$('#operationSelectList :first-child').addClass('selected');
};
/**
* handle click event of select button
*/
OperationSelect.onClickSelect = function () {
OperationSelect.onClickSelect = function () {
OperationSelect.chooseOperationSelect();
};
/**
* Get operation select and call back function in main page
*/
OperationSelect.chooseOperationSelect = function () {
OperationSelect.chooseOperationSelect = function () {
let param = {};
param.operationIdSelected = OperationSelect.operationIdSelected;
param.operationNameSelected = OperationSelect.operationNameSelected;
OperationSelect.closeModal();
if (OperationSelect.changeSelectCallback && typeof OperationSelect.changeSelectCallback === 'function') {
OperationSelect.changeSelectCallback(param.operationIdSelected,param.operationNameSelected );
OperationSelect.changeSelectCallback(param.operationIdSelected, param.operationNameSelected);
}
};
/**
* close setting dialog
*/
OperationSelect.closeModal = function () {
OperationSelect.closeModal = function () {
$('#task-list-modal .close').click();
};
\ No newline at end of file
};
// PDF PRINT function js
/**
* PDF PRINT function js
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var PP = {};
PP.init = function() {
console.log("PP.init");
PP.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
console.log('PP.init');
PP.loadCommon();
PP.initPdfList();
};
PP.loadCommon = function() {
$("#includedHeader").load("../html/common/header.html" , function() {
PP.loadCommon = function () {
$('#includedHeader').load('../html/common/header.html', function () {
I18N.initi18n();
HEADER.init();
});
$("#includedConfirmModal").load("../html/common/confirm-modal.html", function() {
});
$('#includedConfirmModal').load('../html/common/confirmModal.html', function () {
I18N.initi18n();
});
}
});
};
PP.initPdfList = function() {
PP.initPdfList = 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 = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.QUICK_REPORT_PRINT;
$("#pdfPrint").load(url, params);
$('#pdfPrint').load(url, params);
} else {
COMMON.displayAlert("error");
COMMON.avwScreenMove("reportList.html");
COMMON.displayAlert('error');
COMMON.avwScreenMove('reportList.html');
}
}
\ No newline at end of file
};
......@@ -7,45 +7,45 @@ var PICKUP = {};
PICKUP.newReportList;
PICKUP.continousWorkReport;
PICKUP.reportWithWarning;
PICKUP.pickupDefault = "newReport";
PICKUP.pickupActive = "newReport";
PICKUP.pickupDefault = 'newReport';
PICKUP.pickupActive = 'newReport';
PICKUP.countNewReportList = 0;
PICKUP.countContinousWorkReport = 0;
PICKUP.countReportWithWarning= 0;
PICKUP.countReportWithWarning = 0;
/**
* Report type
*/
PICKUP.REPORT_TYPE = {
REPORTONLY: 0, //report only
INSPECT: 1, //rountine
WITHREPLY: 2, // report answer
WORKFLOW: 3 // continuous
}
REPORTONLY: 0, //report only
INSPECT: 1, //rountine
WITHREPLY: 2, // report answer
WORKFLOW: 3, // continuous
};
/**
* operation type
*/
PICKUP.OPERATION_TYPE = {
LIST: "0",
DRAWING: "1",
VTOUR: "2",
PDF: "3"
LIST: '0',
DRAWING: '1',
VTOUR: '2',
PDF: '3',
};
/**
* task type of report answer
*/
PICKUP.REPLYREPORT_TASK_TYPE = {
REPORT: 0,
ANSWER: 1
}
REPORT: 0,
ANSWER: 1,
};
/**
* default Pickup List
*/
PICKUP.defaultPickupList = {
operationList:[]
}
operationList: [],
};
PICKUP.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath());
PICKUP.getNewReportListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.NEW_REPORT;
......@@ -53,70 +53,92 @@ PICKUP.getContinuousWorkListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.WO
PICKUP.getReportWithWarningsListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.WARNING_WITH_REPORT;
/**
* Call get new report list api get data
* Call get new report list api get data
*/
PICKUP.getNewreportListData = function (callback) {
PICKUP.getNewreportListData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
COMMON.cmsAjax(PICKUP.getNewReportListApiUrl, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('DASHBOARD.getNewreportListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
});
COMMON.cmsAjax(
PICKUP.getNewReportListApiUrl,
param,
false,
function (json) {
if (callback) {
callback(json);
}
},
function () {
console.log('DASHBOARD.getNewreportListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
},
);
};
/**
* Call get Continuous Work list api get data
* @param {*} callback
* Call get Continuous Work list api get data
* @param {*} callback
*/
PICKUP.getContinuousWorkListData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
COMMON.cmsAjax(PICKUP.getContinuousWorkListApiUrl, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('DASHBOARD.getContinuousWorkListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
});
COMMON.cmsAjax(
PICKUP.getContinuousWorkListApiUrl,
param,
false,
function (json) {
if (callback) {
callback(json);
}
},
function () {
console.log('DASHBOARD.getContinuousWorkListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
},
);
};
/**
* Call get Report With Warnings list api get data
* @param {*} callback
* Call get Report With Warnings list api get data
* @param {*} callback
*/
PICKUP.getReportWithWarningsListData = function (callback) {
let param = {
sid: COMMON.getSid(),
};
COMMON.cmsAjax(PICKUP.getReportWithWarningsListApiUrl, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('DASHBOARD.getReportWithWarningListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
});
COMMON.cmsAjax(
PICKUP.getReportWithWarningsListApiUrl,
param,
false,
function (json) {
if (callback) {
callback(json);
}
},
function () {
console.log('DASHBOARD.getReportWithWarningListData error');
if (callback) {
callback(PICKUP.defaultPickupList);
}
},
);
};
/**
* Initialization pickup html
* Initialization pickup html
*/
PICKUP.init = function() {
console.log("PICKUP.init");
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadConfirmModal("#includedConfirmModal");
const navs = [
PICKUP.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
console.log('PICKUP.init');
sessionStorage.activeHomePage = CONSTANT.PAGE_TAB.DASHBOARD;
TEMPLATE.loadHearder('#includedHeader');
TEMPLATE.loadConfirmModal('#includedConfirmModal');
const navs = [
{
titleLang: 'dashboard',
href: 'dashboard.html',
......@@ -125,609 +147,645 @@ PICKUP.init = function() {
titleLang: 'pickup',
},
];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "pickup", navs, null);
PICKUP.initSettingActivePickup();
PICKUP.settingPickup();
}
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pickup', navs, null);
PICKUP.initSettingActivePickup();
PICKUP.settingPickup();
};
/**
* Setting pickup data
*/
PICKUP.settingPickup = function() {
DashboardSetting.getSettingData(function (settings) {
$("#liTabNewReport").addClass('d-none');
$("#liTabContinousWork").addClass('d-none');
$("#liTabReportWithWarning").addClass('d-none');
if(settings.newReport)
{
$("#liTabNewReport").removeClass('d-none');
PICKUP.initNewReportTab();
}
if(settings.continousWork)
{
$("#liTabContinousWork").removeClass('d-none');
PICKUP.initContinuosWorkTab();
}
if(settings.warningReport)
{
$("#liTabReportWithWarning").removeClass('d-none');
PICKUP.initReportWithWarningsTab();
}
PICKUP.settingPickup = function () {
DashboardSetting.getSettingData(function (settings) {
$('#liTabNewReport').addClass('d-none');
$('#liTabContinousWork').addClass('d-none');
$('#liTabReportWithWarning').addClass('d-none');
if (settings.newReport) {
$('#liTabNewReport').removeClass('d-none');
PICKUP.initNewReportTab();
}
if (settings.continousWork) {
$('#liTabContinousWork').removeClass('d-none');
PICKUP.initContinuosWorkTab();
}
if (settings.warningReport) {
$('#liTabReportWithWarning').removeClass('d-none');
PICKUP.initReportWithWarningsTab();
}
});
}
};
/**
* init Setting Active Pickup
*/
PICKUP.initSettingActivePickup = function() {
var urlParam = COMMON.getUrlParameter();
if(urlParam.pickupActive == undefined || urlParam.pickupActive == '' )
{
urlParam.pickupActive = PICKUP.pickupDefault;
}
PICKUP.pickupActive = urlParam.pickupActive;
PICKUP.settingActivePickup(PICKUP.pickupActive);
}
PICKUP.initSettingActivePickup = function () {
var urlParam = COMMON.getUrlParameter();
if (urlParam.pickupActive == undefined || urlParam.pickupActive == '') {
urlParam.pickupActive = PICKUP.pickupDefault;
}
PICKUP.pickupActive = urlParam.pickupActive;
PICKUP.settingActivePickup(PICKUP.pickupActive);
};
/**
* setting Active Pickup
* @param {*} pickupActive
* @returns
* @param {*} pickupActive
* @returns
*/
PICKUP.settingActivePickup = function(pickupActive) {
PICKUP.pickupActive = pickupActive;
$('#liTabNewReport a').removeClass('active');
$('#liTabContinousWork a').removeClass('active');
$('#liTabReportWithWarning a').removeClass('active');
$('#tab-content-NewReport').removeClass('active show');
$('#tab-content-ContinousWork').removeClass('active show');
$('#tab-content-ReportWithWarnings').removeClass('active show');
if(pickupActive == "newReport")
{
$('#liTabNewReport a').addClass('active');
$('#tab-content-NewReport').addClass('active show');
return;
}
if(pickupActive == "continousWork")
{
$('#liTabContinousWork a').addClass('active');
$('#tab-content-ContinousWork').addClass('active show');
return;
}
if(pickupActive == "reportWarning")
{
$('#liTabReportWithWarning a').addClass('active');
$('#tab-content-ReportWithWarnings').addClass('active show');
return;
}
}
PICKUP.settingActivePickup = function (pickupActive) {
PICKUP.pickupActive = pickupActive;
$('#liTabNewReport a').removeClass('active');
$('#liTabContinousWork a').removeClass('active');
$('#liTabReportWithWarning a').removeClass('active');
$('#tab-content-NewReport').removeClass('active show');
$('#tab-content-ContinousWork').removeClass('active show');
$('#tab-content-ReportWithWarnings').removeClass('active show');
if (pickupActive == 'newReport') {
$('#liTabNewReport a').addClass('active');
$('#tab-content-NewReport').addClass('active show');
return;
}
if (pickupActive == 'continousWork') {
$('#liTabContinousWork a').addClass('active');
$('#tab-content-ContinousWork').addClass('active show');
return;
}
if (pickupActive == 'reportWarning') {
$('#liTabReportWithWarning a').addClass('active');
$('#tab-content-ReportWithWarnings').addClass('active show');
return;
}
};
/**
* Initialization show not found pickup item html
* @param {*} elementId
* Initialization show not found pickup item html
* @param {*} elementId
*/
PICKUP.showNotFoundPickupItem = function(elementId) {
$(elementId).removeClass();
$(elementId).addClass('p-0 mt-3 card-list');
let li = $("<li class='card mb-2 not-found'></li>");
let div = $("<div class='text-dark mb-1 px-3 py-5 text-center m-auto'></div>");
let imgdiv = $("<img src=\"../common/img/icon_not_found.svg\" alt='" + I18N.i18nText('msgNotFound') +"' class='not-found-img mb-2'>");
let childDiv = $("<div class='fs-9 text-secondary font-weight-bold'>" + I18N.i18nText('msgNotFound') +"</div>");
div.append(imgdiv);
div.append(childDiv);
li.append(div);
$(elementId).append(li);
}
PICKUP.showNotFoundPickupItem = function (elementId) {
$(elementId).removeClass();
$(elementId).addClass('p-0 mt-3 card-list');
let li = $("<li class='card mb-2 not-found'></li>");
let div = $("<div class='text-dark mb-1 px-3 py-5 text-center m-auto'></div>");
let imgdiv = $('<img src="../common/img/icon_not_found.svg" alt=\'' + I18N.i18nText('msgNotFound') + "' class='not-found-img mb-2'>");
let childDiv = $("<div class='fs-9 text-secondary font-weight-bold'>" + I18N.i18nText('msgNotFound') + '</div>');
div.append(imgdiv);
div.append(childDiv);
li.append(div);
$(elementId).append(li);
};
/**
* Initialization view pickup menu html
* @param {*} elementId
* @param {*} count
* Initialization view pickup menu html
* @param {*} elementId
* @param {*} count
*/
PICKUP.showCountDisplayPickupItem = function(elementId, count) {
let span = $('<span>' + I18N.i18nText('display') +'</span>');
$(elementId).append(count);
$(elementId).append(span);
}
PICKUP.showCountDisplayPickupItem = function (elementId, count) {
let span = $('<span>' + I18N.i18nText('display') + '</span>');
$(elementId).append(count);
$(elementId).append(span);
};
/**
* Initialization new report list html
* Initialization new report list html
*/
PICKUP.initNewReportTab = function() {
PICKUP.getNewreportListData(function (json) {
PICKUP.createNewReportList(json.operationList);
});
}
PICKUP.initNewReportTab = function () {
PICKUP.getNewreportListData(function (json) {
PICKUP.createNewReportList(json.operationList);
});
};
/**
* Initialization continuous work list html
* Initialization continuous work list html
*/
PICKUP.initContinuosWorkTab = function() {
PICKUP.getContinuousWorkListData(function (json) {
PICKUP.createContinousWorkList(json.operationList);
});
}
PICKUP.initContinuosWorkTab = function () {
PICKUP.getContinuousWorkListData(function (json) {
PICKUP.createContinousWorkList(json.operationList);
});
};
/**
* Initialization continuous work list html
* Initialization continuous work list html
*/
PICKUP.initReportWithWarningsTab = function() {
PICKUP.getReportWithWarningsListData(function (json) {
PICKUP.createReportWithWarningList(json.operationList);
});
}
PICKUP.initReportWithWarningsTab = function () {
PICKUP.getReportWithWarningsListData(function (json) {
PICKUP.createReportWithWarningList(json.operationList);
});
};
/**
* sort New report operation list
* @param {*} operationList
* @returns
* @param {*} operationList
* @returns
*/
PICKUP.sortNewReportList = function(operationList) {
operationList = operationList.sort(function(a,b) {
if (a.operationId < b.operationId) return 1;
if (a.operationId > b.operationId) return -1;
return 0;
});
return operationList;
}
PICKUP.sortNewReportList = function (operationList) {
operationList = operationList.sort(function (a, b) {
if (a.operationId < b.operationId) return 1;
if (a.operationId > b.operationId) return -1;
return 0;
});
return operationList;
};
/**
* Implement new report list html
* @param {*} operationListOld
* @returns
* @param {*} operationListOld
* @returns
*/
PICKUP.createNewReportList = function(operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem("#newReport-list");
PICKUP.createNewReportList = function (operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem('#newReport-list');
$('#viewMenuNewReport').addClass('d-none');
return;
}
let operationList = PICKUP.sortNewReportList(operationListOld);
$('#viewMenuNewReport').removeClass('d-none');
$("#newReport-list").empty();
PICKUP.countNewReportList = 0;
let operationList = PICKUP.sortNewReportList(operationListOld);
$('#viewMenuNewReport').removeClass('d-none');
$('#newReport-list').empty();
PICKUP.countNewReportList = 0;
$('#newReport-list').addClass('task-list view-content view-block');
let classIcon ;
for (let i = 0; i < operationList.length; i++) {
switch (operationList[i].reportType)
{
case PICKUP.REPORT_TYPE.REPORTONLY:
classIcon = "report";
break;
case PICKUP.REPORT_TYPE.INSPECT:
classIcon = "inspection";
break;
case PICKUP.REPORT_TYPE.WITHREPLY:
classIcon = "questionary";
break;
case PICKUP.REPORT_TYPE.WORKFLOW:
classIcon = "proccess";
break;
}
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let ahrefRequiredFlg = $("<a href=\"javascript:PICKUP.sendReportFormFromNewReport ('"
+ operationList[i].operationId +"');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'>"
+ "<span class='" + classIcon + "'></span>"
+ "</div></div>")
let divText = $("<div class='pl-5 h-100 d-flex align-items-center'>"
+ "<div class='w-100'>"
+ "<div class='fs-12 text-truncate'>" + operationList[i].operationName + "</div>"
+ "</div></div>");
ahrefRequiredFlg.append(divIcon);
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
$("#newReport-list").append(messageli);
PICKUP.countNewReportList = PICKUP.countNewReportList + 1;
}
// show not found if
if (PICKUP.countNewReportList == 0) {
PICKUP.showNotFoundPickupItem("#newReport-list");
$('#viewMenuNewReport').addClass('d-none');
return;
let classIcon;
for (let i = 0; i < operationList.length; i++) {
switch (operationList[i].reportType) {
case PICKUP.REPORT_TYPE.REPORTONLY:
classIcon = 'report';
break;
case PICKUP.REPORT_TYPE.INSPECT:
classIcon = 'inspection';
break;
case PICKUP.REPORT_TYPE.WITHREPLY:
classIcon = 'questionary';
break;
case PICKUP.REPORT_TYPE.WORKFLOW:
classIcon = 'proccess';
break;
}
let messageli = $("<li class='card mb-2' name = 'operationId_" + operationList[i].operationId + "' ></li>");
let ahrefRequiredFlg = $(
'<a href="javascript:PICKUP.sendReportFormFromNewReport (\'' + operationList[i].operationId + "');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>",
);
let divIcon = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'>" + "<div class='type-icon'>" + "<span class='" + classIcon + "'></span>" + '</div></div>');
let divText = $(
"<div class='pl-5 h-100 d-flex align-items-center'>" + "<div class='w-100'>" + "<div class='fs-12 text-truncate'>" + operationList[i].operationName + '</div>' + '</div></div>',
);
ahrefRequiredFlg.append(divIcon);
ahrefRequiredFlg.append(divText);
messageli.append(ahrefRequiredFlg);
$('#newReport-list').append(messageli);
PICKUP.countNewReportList = PICKUP.countNewReportList + 1;
}
// show not found if
if (PICKUP.countNewReportList == 0) {
PICKUP.showNotFoundPickupItem('#newReport-list');
$('#viewMenuNewReport').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem("#count-NewReport", PICKUP.countNewReportList )
}
PICKUP.showCountDisplayPickupItem('#count-NewReport', PICKUP.countNewReportList);
};
/**
* sort continuous work operation list
* @param {*} operationList
* @returns
* @param {*} operationList
* @returns
*/
PICKUP.sortContinousWorkList = function(operationList) {
PICKUP.sortContinousWorkList = function (operationList) {
let newOperationList = [];
for (let i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3)
{
if(typeof operationList[i].processList === 'undefined' ) continue;
if (operationList[i].processList && operationList[i].processList.length != 0)
{
for( let j = 0; j < operationList[i].processList.length; j++ )
{
if(typeof operationList[i].processList[j].phaseList === 'undefined' ) continue;
for(let g = 0; g < operationList[i].processList[j].phaseList.length; g++ )
{
if(operationList[i].processList[j].phaseList[g].phaseStatus != 999)
{
let item = {reportType: operationList[i].reportType,
operationType: operationList[i].operationType,
phaseList: operationList[i].processList[j].phaseList,
processKey: operationList[i].processList[j].processKey,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
operationId: operationList[i].operationId,
contentId: operationList[i].contentId,
operationName: operationList[i].operationName,
taskCode: operationList[i].processList[j].taskCode,
taskKey: operationList[i].processList[j].taskKey,
taskName: operationList[i].processList[j].taskName,
updateDate: operationList[i].processList[j].phaseList[g].updateDate,
phaseNo: operationList[i].processList[j].phaseList[g].phaseNo,
phaseName: operationList[i].processList[j].phaseList[g].phaseName
};
for (let i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3) {
if (typeof operationList[i].processList === 'undefined') continue;
if (operationList[i].processList && operationList[i].processList.length != 0) {
for (let j = 0; j < operationList[i].processList.length; j++) {
if (typeof operationList[i].processList[j].phaseList === 'undefined') continue;
for (let g = 0; g < operationList[i].processList[j].phaseList.length; g++) {
if (operationList[i].processList[j].phaseList[g].phaseStatus != 999) {
let item = {
reportType: operationList[i].reportType,
operationType: operationList[i].operationType,
phaseList: operationList[i].processList[j].phaseList,
processKey: operationList[i].processList[j].processKey,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
operationId: operationList[i].operationId,
contentId: operationList[i].contentId,
operationName: operationList[i].operationName,
taskCode: operationList[i].processList[j].taskCode,
taskKey: operationList[i].processList[j].taskKey,
taskName: operationList[i].processList[j].taskName,
updateDate: operationList[i].processList[j].phaseList[g].updateDate,
phaseNo: operationList[i].processList[j].phaseList[g].phaseNo,
phaseName: operationList[i].processList[j].phaseList[g].phaseName,
};
newOperationList.push(item);
}
}
}
}
}
}
newOperationList = newOperationList.sort(function(a,b) {
if (!a.updateDate) {
a.updateDate = "1900-01-01 00:00:00";
}
if (!b.updateDate) {
b.updateDate = "1900-01-01 00:00:00";
}
if (a.updateDate < b.updateDate) return 1;
if (a.updateDate > b.updateDate) return -1;
return 0;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return newOperationList;
}
}
}
}
}
}
newOperationList = newOperationList.sort(function (a, b) {
if (!a.updateDate) {
a.updateDate = '1900-01-01 00:00:00';
}
if (!b.updateDate) {
b.updateDate = '1900-01-01 00:00:00';
}
if (a.updateDate < b.updateDate) return 1;
if (a.updateDate > b.updateDate) return -1;
return 0;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return newOperationList;
};
/**
* Implement continous work html
* @param {*} operationListOld
* @returns
* @param {*} operationListOld
* @returns
*/
PICKUP.createContinousWorkList = function(operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem("#continousWork-list");
PICKUP.createContinousWorkList = function (operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem('#continousWork-list');
$('#viewMenuContinuousWork').addClass('d-none');
return;
}
let operationList = PICKUP.sortContinousWorkList(operationListOld);
$('#viewMenuContinuousWork').removeClass('d-none');
$("#continousWork-list").empty();
$('#continousWork-list').empty();
PICKUP.countContinousWorkReport = 0;
$('#continousWork-list').addClass('task-list view-content view-block');
$('#continousWork-list').addClass('task-list view-content view-block');
for (let i = 0; i < operationList.length; i++) {
let directKey = operationList[i].processKey;
if (operationList[i].operationType == PICKUP.OPERATION_TYPE.VTOUR || operationList[i].operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = operationList[i].taskKey;
}
let messageli = $("<li class='card mb-2' id = 'list_" + operationList[i].processKey + "$" + operationList[i].phaseNo + "'></li>") ;
let ahrefRequiredFlg ;
if (operationList[i].permitCodeRequiredFlg == 1)
{
ahrefRequiredFlg = $("<a href=\"javascript:CHK.displayAlert('onlyRfid');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
let directKey = operationList[i].processKey;
if (operationList[i].operationType == PICKUP.OPERATION_TYPE.VTOUR || operationList[i].operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = operationList[i].taskKey;
}
else
{
ahrefRequiredFlg = $("<a href=\"javascript:PICKUP.sendReportFormFromContinuousWork ('"
+ operationList[i].operationId +"','" + operationList[i].taskKey + "','" + operationList[i].processKey + "'," + operationList[i].phaseNo + ");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
let messageli = $("<li class='card mb-2' id = 'list_" + operationList[i].processKey + '$' + operationList[i].phaseNo + "'></li>");
let ahrefRequiredFlg;
if (operationList[i].permitCodeRequiredFlg == 1) {
ahrefRequiredFlg = $("<a href=\"javascript:CHK.displayAlert('onlyRfid');\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>");
} else {
ahrefRequiredFlg = $(
'<a href="javascript:PICKUP.sendReportFormFromContinuousWork (\'' +
operationList[i].operationId +
"','" +
operationList[i].taskKey +
"','" +
operationList[i].processKey +
"'," +
operationList[i].phaseNo +
");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>",
);
}
let divProccess = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'><span class='proccess'></span></div></div>");
let divProccess = $("<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'><span class='proccess'></span></div></div>");
let divInfor = $("<div class='pl-5 h-100 d-flex align-items-center'></div>");
let divChildInfor = $("<div class='w-100'></div>");
let divOperationName = $("<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + operationList[i].phaseName + '</div>');
let divProcessName = $("<div class='fs-12 text-truncate'>" + operationList[i].operationName + '</div>');
let divReportInfor = $("<div class='d-flex justify-content-between align-items-center'></div>");
let divReportName = $("<div class='fs-10 text-truncate'>" + operationList[i].taskName + '</div>');
let divReportCode = $("<div class='fs-8 text-secondary text-truncate'>" + operationList[i].taskCode + '</div>');
let divInfor = $("<div class='pl-5 h-100 d-flex align-items-center'></div>");
let divChildInfor = $("<div class='w-100'></div>");
let divOperationName = $("<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + operationList[i].phaseName + "</div>");
let divProcessName = $("<div class='fs-12 text-truncate'>" + operationList[i].operationName + "</div>");
let divReportInfor = $("<div class='d-flex justify-content-between align-items-center'></div>");
let divReportName = $("<div class='fs-10 text-truncate'>" + operationList[i].taskName + "</div>");
let divReportCode = $("<div class='fs-8 text-secondary text-truncate'>" + operationList[i].taskCode + "</div>");
divReportInfor.append(divReportName);
divReportInfor.append(divReportCode);
divReportInfor.append(divReportName);
divReportInfor.append(divReportCode);
divChildInfor.append(divOperationName);
divChildInfor.append(divProcessName);
divChildInfor.append(divReportInfor);
divChildInfor.append(divOperationName);
divChildInfor.append(divProcessName);
divChildInfor.append(divReportInfor);
divInfor.append(divChildInfor);
divInfor.append(divChildInfor);
ahrefRequiredFlg.append(divProccess);
ahrefRequiredFlg.append(divInfor);
messageli.append(ahrefRequiredFlg);
ahrefRequiredFlg.append(divProccess);
ahrefRequiredFlg.append(divInfor);
messageli.append(ahrefRequiredFlg);
$("#continousWork-list").append(messageli);
$('#continousWork-list').append(messageli);
PICKUP.countContinousWorkReport = PICKUP.countContinousWorkReport + 1;
}
// show not found if
if (PICKUP.countContinousWorkReport == 0) {
PICKUP.showNotFoundPickupItem("#continousWork-list");
$('#viewMenuContinuousWork').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem("#count-ContinuousWork", PICKUP.countContinousWorkReport )
// show not found if
if (PICKUP.countContinousWorkReport == 0) {
PICKUP.showNotFoundPickupItem('#continousWork-list');
$('#viewMenuContinuousWork').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem('#count-ContinuousWork', PICKUP.countContinousWorkReport);
};
/**
* sort report with warnings list
* @param {*} operationList
* @returns
* @param {*} operationList
* @returns
*/
PICKUP.sortWarningList = function(operationList) {
PICKUP.sortWarningList = function (operationList) {
let newOperationList = [];
for (let i = 0; i < operationList.length; i++) {
if(typeof operationList[i].warningReportList === 'undefined' ) continue;
if (operationList[i].warningReportList && operationList[i].warningReportList.length != 0)
{
for( let j = 0; j < operationList[i].warningReportList.length; j++ )
{
let item = {reportType: operationList[i].reportType,
operationType: operationList[i].operationType,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
operationId: operationList[i].operationId,
contentId: operationList[i].contentId,
operationName: operationList[i].operationName,
taskCode: operationList[i].warningReportList[j].taskCode,
taskKey: operationList[i].warningReportList[j].taskKey,
taskName: operationList[i].warningReportList[j].taskName,
taskType: operationList[i].warningReportList[j].taskType,
updateDate: operationList[i].warningReportList[j].updateDate,
reportStartDateString: operationList[i].warningReportList[j].reportStartDateString,
reportEndDateString: operationList[i].warningReportList[j].reportEndDateString,
processKey: operationList[i].warningReportList[j].processKey,
phaseNo: operationList[i].warningReportList[j].phaseNo,
phaseName: operationList[i].warningReportList[j].phaseName
};
newOperationList.push(item);
}
}
}
newOperationList = newOperationList.sort(function(a,b) {
if (!a.updateDate) {
a.updateDate = "1900-01-01 00:00:00";
}
if (!b.updateDate) {
b.updateDate = "1900-01-01 00:00:00";
}
if (a.updateDate < b.updateDate) return 1;
if (a.updateDate > b.updateDate) return -1;
return 0;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return newOperationList;
}
for (let i = 0; i < operationList.length; i++) {
if (typeof operationList[i].warningReportList === 'undefined') continue;
if (operationList[i].warningReportList && operationList[i].warningReportList.length != 0) {
for (let j = 0; j < operationList[i].warningReportList.length; j++) {
let item = {
reportType: operationList[i].reportType,
operationType: operationList[i].operationType,
permitCodeRequiredFlg: operationList[i].permitCodeRequiredFlg,
operationId: operationList[i].operationId,
contentId: operationList[i].contentId,
operationName: operationList[i].operationName,
taskCode: operationList[i].warningReportList[j].taskCode,
taskKey: operationList[i].warningReportList[j].taskKey,
taskName: operationList[i].warningReportList[j].taskName,
taskType: operationList[i].warningReportList[j].taskType,
updateDate: operationList[i].warningReportList[j].updateDate,
reportStartDateString: operationList[i].warningReportList[j].reportStartDateString,
reportEndDateString: operationList[i].warningReportList[j].reportEndDateString,
processKey: operationList[i].warningReportList[j].processKey,
phaseNo: operationList[i].warningReportList[j].phaseNo,
phaseName: operationList[i].warningReportList[j].phaseName,
};
newOperationList.push(item);
}
}
}
newOperationList = newOperationList.sort(function (a, b) {
if (!a.updateDate) {
a.updateDate = '1900-01-01 00:00:00';
}
if (!b.updateDate) {
b.updateDate = '1900-01-01 00:00:00';
}
if (a.updateDate < b.updateDate) return 1;
if (a.updateDate > b.updateDate) return -1;
return 0;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return newOperationList;
};
/**
* init Warning Report With ReportOnly Type
* @param {*} report
* @returns
* @param {*} report
* @returns
*/
PICKUP.initWarningReportWithReportOnlyType = function(report) {
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('"
+ report.operationId +"'," + PICKUP.REPORT_TYPE.REPORTONLY + ",'" + report.taskKey + "', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'><span class='report'></span></div></div>"
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>"
+ "<div class='fs-8 text-secondary text-truncate'> " + report.taskCode + "</div>"
+ "</div></div></div></a></li>");
return ele;
}
PICKUP.initWarningReportWithInspectType = function(report) {
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('"
+ report.operationId +"'," + PICKUP.REPORT_TYPE.INSPECT + ",'" + report.taskKey + "', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'><span class='inspection'></span></div></div>"
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'></div>"
+ "<div class='fs-8 text-secondary text-truncate'>" + PICKUP.getInspectDate(report.reportStartDateString) + " ~ " + PICKUP.getInspectDate(report.reportEndDateString)
+ "</div></div></div></div></a></li>");
return ele;
}
PICKUP.initWarningReportWithReportOnlyType = function (report) {
let ele = $(
"<li class='card mb-2'>" +
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
report.operationId +
"'," +
PICKUP.REPORT_TYPE.REPORTONLY +
",'" +
report.taskKey +
"', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>" +
"<div class='type-icon'><span class='report'></span></div></div>" +
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
"<div class='fs-12 text-truncate'>" +
report.operationName +
'</div>' +
"<div class='d-flex justify-content-between align-items-center'>" +
"<div class='fs-10 text-truncate'>" +
report.taskName +
'</div>' +
"<div class='fs-8 text-secondary text-truncate'> " +
report.taskCode +
'</div>' +
'</div></div></div></a></li>',
);
return ele;
};
PICKUP.initWarningReportWithInspectType = function (report) {
let ele = $(
"<li class='card mb-2'>" +
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
report.operationId +
"'," +
PICKUP.REPORT_TYPE.INSPECT +
",'" +
report.taskKey +
"', null,null,null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>" +
"<div class='type-icon'><span class='inspection'></span></div></div>" +
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
"<div class='fs-12 text-truncate'>" +
report.operationName +
'</div>' +
"<div class='d-flex justify-content-between align-items-center'>" +
"<div class='fs-10 text-truncate'></div>" +
"<div class='fs-8 text-secondary text-truncate'>" +
PICKUP.getInspectDate(report.reportStartDateString) +
' ~ ' +
PICKUP.getInspectDate(report.reportEndDateString) +
'</div></div></div></div></a></li>',
);
return ele;
};
/**
* init Warning Report With AnswerReport Type
* @param {*} report
* @param {*} reportTypeMsg
* @returns
* @param {*} report
* @param {*} reportTypeMsg
* @returns
*/
PICKUP.initWarningReportWithAnswerReportType = function(report, reportTypeMsg) {
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('"
+ report.operationId +"'," + PICKUP.REPORT_TYPE.WITHREPLY + ",null, null,null," + report.replyNo +");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'>"
+ "<span class='questionary'></span></div></div><div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + reportTypeMsg + "</div>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>"
+ "<div class='fs-8 text-secondary text-truncate'>" + report.taskCode+ "</div>"
+ "</div></div></div></a></li>");
return ele;
}
PICKUP.initWarningReportWithAnswerReportType = function (report, reportTypeMsg) {
let ele = $(
"<li class='card mb-2'>" +
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
report.operationId +
"'," +
PICKUP.REPORT_TYPE.WITHREPLY +
',null, null,null,' +
report.replyNo +
");\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
"<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'>" +
"<span class='questionary'></span></div></div><div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" +
reportTypeMsg +
'</div>' +
"<div class='fs-12 text-truncate'>" +
report.operationName +
'</div>' +
"<div class='d-flex justify-content-between align-items-center'>" +
"<div class='fs-10 text-truncate'>" +
report.taskName +
'</div>' +
"<div class='fs-8 text-secondary text-truncate'>" +
report.taskCode +
'</div>' +
'</div></div></div></a></li>',
);
return ele;
};
/**
* init Warning Report With Continuous Report Type
* @param {*} report
* @returns
* @param {*} report
* @returns
*/
PICKUP.initWarningReportWithContinuousReportType = function(report) {
let directKey = report.processKey;
if (report.operationType == PICKUP.OPERATION_TYPE.VTOUR || report.operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = report.taskKey;
if (report.phaseNo > 1) {
//find taskKey of phaseNo 1
for (let k = 0; k < operationList.length; k++) {
if (operationList[k].phaseNo == 1 && operationList[k].processKey == report.processKey) {
directKey = operationList[k].taskKey;
break;
}
}
}
}
let ele = $("<li class='card mb-2'>"
+ "<a href=\"javascript:PICKUP.sendReportFormFromWarningReport ('"
+ report.operationId +"'," + PICKUP.REPORT_TYPE.WORKFLOW + ",null,'" + report.processKey +"' ,'"+ report.phaseNo +"',null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+ "<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+ "<div class='type-icon'><span class='proccess'></span></div></div>"
+ "<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+ "<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" + report.phaseName + "</div>"
+ "<div class='fs-12 text-truncate'>" + report.operationName + "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<div class='fs-10 text-truncate'>" + report.taskName+ "</div>"
+ "<div class='fs-8 text-secondary text-truncate'>" + report.taskCode+ "</div>"
+ "</div></div></div></a></li>");
return ele;
}
PICKUP.initWarningReportWithContinuousReportType = function (report) {
let directKey = report.processKey;
if (report.operationType == PICKUP.OPERATION_TYPE.VTOUR || report.operationType == PICKUP.OPERATION_TYPE.PDF) {
directKey = report.taskKey;
if (report.phaseNo > 1) {
//find taskKey of phaseNo 1
for (let k = 0; k < operationList.length; k++) {
if (operationList[k].phaseNo == 1 && operationList[k].processKey == report.processKey) {
directKey = operationList[k].taskKey;
break;
}
}
}
}
let ele = $(
"<li class='card mb-2'>" +
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (\'' +
report.operationId +
"'," +
PICKUP.REPORT_TYPE.WORKFLOW +
",null,'" +
report.processKey +
"' ,'" +
report.phaseNo +
"',null);\" class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>" +
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>" +
"<div class='type-icon'><span class='proccess'></span></div></div>" +
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>" +
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>" +
report.phaseName +
'</div>' +
"<div class='fs-12 text-truncate'>" +
report.operationName +
'</div>' +
"<div class='d-flex justify-content-between align-items-center'>" +
"<div class='fs-10 text-truncate'>" +
report.taskName +
'</div>' +
"<div class='fs-8 text-secondary text-truncate'>" +
report.taskCode +
'</div>' +
'</div></div></div></a></li>',
);
return ele;
};
/**
* create Report With Warnings List html
* @param {*} operationListOld
* @returns
* @param {*} operationListOld
* @returns
*/
PICKUP.createReportWithWarningList = function(operationListOld) {
PICKUP.createReportWithWarningList = function (operationListOld) {
if (typeof operationListOld === 'undefined' || operationListOld.length < 1) {
PICKUP.showNotFoundPickupItem("#reportWithWarnings-list");
PICKUP.showNotFoundPickupItem('#reportWithWarnings-list');
$('#viewMenuReportWithWarnings').addClass('d-none');
return;
}
let operationList = PICKUP.sortWarningList(operationListOld);
$('#viewMenuReportWithWarnings').removeClass('d-none');
$("#reportWithWarnings-list").empty();
PICKUP.countReportWithWarning = 0;
let operationList = PICKUP.sortWarningList(operationListOld);
$('#viewMenuReportWithWarnings').removeClass('d-none');
$('#reportWithWarnings-list').empty();
PICKUP.countReportWithWarning = 0;
$('#reportWithWarnings-list').addClass('task-list view-content view-block');
$('#reportWithWarnings-list').addClass('task-list view-content view-block');
const msgLevelReport = I18N.i18nText('reportLevelReport');
const msgLevelAnswer = I18N.i18nText('reportLevelAnswer');
const msgLevelReport = I18N.i18nText('reportLevelReport');
const msgLevelAnswer = I18N.i18nText('reportLevelAnswer');
for (let i = 0; i < operationList.length; i++) {
let operationNameLi;
switch (operationList[i].reportType)
{
case PICKUP.REPORT_TYPE.REPORTONLY:
operationNameLi = PICKUP.initWarningReportWithReportOnlyType(operationList[i]);
break;
case PICKUP.REPORT_TYPE.INSPECT:
operationNameLi = PICKUP.initWarningReportWithInspectType(operationList[i]);
break;
case PICKUP.REPORT_TYPE.WITHREPLY: // report answer
if( operationList[i].taskType == PICKUP.REPLYREPORT_TASK_TYPE.REPORT )
{
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelReport);
}
else
{
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelAnswer);
}
break;
case PICKUP.REPORT_TYPE.WORKFLOW: // continouswork
operationNameLi = PICKUP.initWarningReportWithContinuousReportType(operationList[i]);
break;
}
$("#reportWithWarnings-list").append(operationNameLi);
PICKUP.countReportWithWarning = PICKUP.countReportWithWarning + 1;
}
// show not found if
if (PICKUP.countReportWithWarning == 0) {
PICKUP.showNotFoundPickupItem("#reportWithWarnings-list");
$('#viewMenuReportWithWarnings').addClass('d-none');
return;
let operationNameLi;
switch (operationList[i].reportType) {
case PICKUP.REPORT_TYPE.REPORTONLY:
operationNameLi = PICKUP.initWarningReportWithReportOnlyType(operationList[i]);
break;
case PICKUP.REPORT_TYPE.INSPECT:
operationNameLi = PICKUP.initWarningReportWithInspectType(operationList[i]);
break;
case PICKUP.REPORT_TYPE.WITHREPLY: // report answer
if (operationList[i].taskType == PICKUP.REPLYREPORT_TASK_TYPE.REPORT) {
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelReport);
} else {
operationNameLi = PICKUP.initWarningReportWithAnswerReportType(operationList[i], msgLevelAnswer);
}
break;
case PICKUP.REPORT_TYPE.WORKFLOW: // continouswork
operationNameLi = PICKUP.initWarningReportWithContinuousReportType(operationList[i]);
break;
}
$('#reportWithWarnings-list').append(operationNameLi);
PICKUP.countReportWithWarning = PICKUP.countReportWithWarning + 1;
}
// show not found if
if (PICKUP.countReportWithWarning == 0) {
PICKUP.showNotFoundPickupItem('#reportWithWarnings-list');
$('#viewMenuReportWithWarnings').addClass('d-none');
return;
}
PICKUP.showCountDisplayPickupItem("#count-ReportWithWarnings", PICKUP.countReportWithWarning )
PICKUP.showCountDisplayPickupItem('#count-ReportWithWarnings', PICKUP.countReportWithWarning);
};
/**
* get Inspect Date format
* @param {*} dateString
* @returns
* @param {*} dateString
* @returns
*/
PICKUP.getInspectDate = function(dateString) {
let date = new Date(dateString)
return date.getFullYear() + "/" + ("0" + (date.getMonth() + 1)).slice(-2) + "/" + ("0" + date.getDate()).slice(-2) ;
}
PICKUP.getInspectDate = function (dateString) {
let date = new Date(dateString);
return date.getFullYear() + '/' + ('0' + (date.getMonth() + 1)).slice(-2) + '/' + ('0' + date.getDate()).slice(-2);
};
/**
* send data to open report form from New report pickup
* @returns
* @returns
*/
PICKUP.sendReportFormFromNewReport = function(operationId) {
//Transition to the report form or operation list screen
PICKUP.sendReportFormFromNewReport = function (operationId) {
//Transition to the report form or operation list screen
let params = {};
params.sid = COMMON.getSid();
params.operationId = operationId;
let url = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM + '/' + CONSTANT.REPLY_NO.REPORT;
params.sid = COMMON.getSid();
params.operationId = operationId;
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
COMMON.postCommunication(url, params);
}
};
/**
* send data to open report form of event click continuous work operation report
* @returns
* @returns
*/
PICKUP.sendReportFormFromContinuousWork = function(operationId, taskKey, processKey,phaseNo) {
//Transition to the report form or operation list screen
PICKUP.sendReportFormFromContinuousWork = function (operationId, taskKey, processKey, phaseNo) {
//Transition to the report form or operation list screen
let params = {};
params.sid = COMMON.getSid();
params.operationId = operationId;
params.processKey = processKey;
params.phaseNo = phaseNo;
let url = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM + '/' + CONSTANT.REPLY_NO.REPORT;
params.sid = COMMON.getSid();
params.operationId = operationId;
params.processKey = processKey;
params.phaseNo = phaseNo;
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
COMMON.postCommunication(url, params);
}
};
/**
* send data to open report form of event click warning operation report
* @returns
* @returns
*/
PICKUP.sendReportFormFromWarningReport = function(operationId,reportType, taskKey, processKey,phaseNo, replyNo) {
//Transition to the report form or operation list screen
PICKUP.sendReportFormFromWarningReport = function (operationId, reportType, taskKey, processKey, phaseNo, replyNo) {
//Transition to the report form or operation list screen
let params = {};
params.sid = COMMON.getSid();
params.operationId = operationId;
switch(reportType) {
case PICKUP.REPORT_TYPE.REPORTONLY:
params.taskKey = taskKey;
break;
case PICKUP.REPORT_TYPE.INSPECT:
params.taskKey = taskKey;
break;
case PICKUP.REPORT_TYPE.WITHREPLY:
params.replyNo = replyNo;
break;
case PICKUP.REPORT_TYPE.WORKFLOW:
params.processKey = processKey;
params.phaseNo = phaseNo;
break;
}
let url = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM + '/' + CONSTANT.REPLY_NO.REPORT;
params.sid = COMMON.getSid();
params.operationId = operationId;
switch (reportType) {
case PICKUP.REPORT_TYPE.REPORTONLY:
params.taskKey = taskKey;
break;
case PICKUP.REPORT_TYPE.INSPECT:
params.taskKey = taskKey;
break;
case PICKUP.REPORT_TYPE.WITHREPLY:
params.replyNo = replyNo;
break;
case PICKUP.REPORT_TYPE.WORKFLOW:
params.processKey = processKey;
params.phaseNo = phaseNo;
break;
}
let url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
COMMON.postCommunication(url, params);
}
};
/**
* js for pushing detailed messages
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var PushMessageDetail = {};
PushMessageDetail.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PUSH_MESSAGE_DETAIL;
......@@ -7,18 +12,20 @@ PushMessageDetail.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Clie
*/
PushMessageDetail.dummyMessageDetailJson = {
pushMessageId: 1,
pushMessage: "内容が入ります。内容が入ります。内容が入ります。内容が入ります。",
pushSendDate: "2022/07/06 14:14",
operationName: "絞り検索",
pushSendLoginId: "agentec"
}
pushMessage: '内容が入ります。内容が入ります。内容が入ります。内容が入ります。',
pushSendDate: '2022/07/06 14:14',
operationName: '絞り検索',
pushSendLoginId: 'agentec',
};
/**
* init when html loaded
*/
PushMessageDetail.init = function() {
PushMessageDetail.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
//load common html
TEMPLATE.loadHearder("#includedHeader");
TEMPLATE.loadHearder('#includedHeader');
const navs = [
{
titleLang: 'dashboard',
......@@ -26,50 +33,56 @@ PushMessageDetail.init = function() {
},
{
titleLang: 'messageListTitle',
href: 'push-message-list.html',
href: 'pushMessageList.html',
},
{
titleLang: 'messageDetail',
},
];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "messageDetail", navs, null);
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageDetail', navs, null);
//request message detail data
let urlParam = COMMON.getUrlParameter();
if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') {
return;
}
PushMessageDetail.getMessageDetail(urlParam.pushMessageId, function(message) {
return;
}
PushMessageDetail.getMessageDetail(urlParam.pushMessageId, function (message) {
PushMessageDetail.showMessage(message);
});
}
};
/**
* request message data
* @param {string} pushMessageId
* @param {object} callback
* @param {string} pushMessageId
* @param {object} callback
*/
PushMessageDetail.getMessageDetail = function(pushMessageId, callback) {
PushMessageDetail.getMessageDetail = function (pushMessageId, callback) {
let param = {
sid: COMMON.getSid(),
pushMessageId: pushMessageId
pushMessageId: pushMessageId,
};
const url = PushMessageDetail.baseApiUrl;
COMMON.cmsAjax(url, param, true, function (json) {
if (callback && json && json.pushMessage) {
callback(json.pushMessage);
}
}, function() {
console.log('PushMessageDetail.getMessageDetail error');
});
}
COMMON.cmsAjax(
url,
param,
true,
function (json) {
if (callback && json && json.pushMessage) {
callback(json.pushMessage);
}
},
function () {
console.log('PushMessageDetail.getMessageDetail error');
},
);
};
/**
* Show message data
* @param {object} message
* @param {object} message
*/
PushMessageDetail.showMessage = function(message) {
PushMessageDetail.showMessage = function (message) {
$('#content').text(message.pushMessage);
$('#sendDate').text(message.pushSendDate);
$('#operationName').text(message.operationName);
$('#sender').text(message.pushSendLoginId);
}
};
/**
* Push Message List JS in push-message-list.html
* Push Message List JS in pushMessageList.html
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var PushMessageList = {};
......@@ -8,8 +8,10 @@ PushMessageList.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Client
/**
* Init when html onload
*/
PushMessageList.init = function() {
TEMPLATE.loadHearder("#includedHeader");
PushMessageList.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHearder('#includedHeader');
const navs = [
{
titleLang: 'dashboard',
......@@ -19,44 +21,50 @@ PushMessageList.init = function() {
titleLang: 'messageListTitle',
},
];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "messageListTitle", navs, null);
PushMessageList.getMessageList(function(messageList) {
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageListTitle', navs, null);
PushMessageList.getMessageList(function (messageList) {
PushMessageList.generateMessageListHtml(messageList.pushMessageList);
});
}
};
/**
* get Message List from CMS
* @param {function} callback
* @param {function} callback
*/
PushMessageList.getMessageList = function (callback) {
let param = {
sid: COMMON.getSid(),
};
const url = PushMessageList.baseApiUrl;
COMMON.cmsAjax(url, param, true, function (json) {
if (callback) {
callback(json);
}
}, function() {
console.log('PushMessageList.getMessageList error');
});
COMMON.cmsAjax(
url,
param,
true,
function (json) {
if (callback) {
callback(json);
}
},
function () {
console.log('PushMessageList.getMessageList error');
},
);
};
/**
* handle click message event
* @param {string} pushMessageId
* @param {string} pushMessageId
*/
PushMessageList.clickMessage = function(pushMessageId) {
COMMON.goUrlWithCurrentParams('push-message-detail.html', {pushMessageId: pushMessageId});
}
PushMessageList.clickMessage = function (pushMessageId) {
COMMON.goUrlWithCurrentParams('pushMessageDetail.html', { pushMessageId: pushMessageId });
};
/**
* generate message list html
* @param {array} messageList
* @returns
* @param {array} messageList
* @returns
*/
PushMessageList.generateMessageListHtml = function(messageList) {
PushMessageList.generateMessageListHtml = function (messageList) {
if (typeof messageList === 'undefined' || messageList.length < 1) {
//show not found
$('#messageList .not-found').removeClass('d-none');
......@@ -69,42 +77,45 @@ PushMessageList.generateMessageListHtml = function(messageList) {
var mTitle = message.pushMessage;
var mDate = message.pushSendDate;
var mSubtitle = message.operationName;
var messageLi = $('<li class="card mb-2" id="pushMessageId_' + messageId + '"/>');
var messageLi = $('<li class="card mb-2" id="pushMessageId_' + messageId + '"/>');
if (message.readingFlg) {
messageLi.addClass('read');
} else {
messageLi.addClass('unread');
}
var messageA = $('<a class="d-block px-3 py-2 text-decoration-none text-dark"/>');
messageA.attr('href', "javascript:PushMessageList.clickMessage('" + messageId +"');");
messageA.attr('href', "javascript:PushMessageList.clickMessage('" + messageId + "');");
var titleDiv = $('<div class="fs-12 text-truncate">' + mTitle + '</div>');
var subTitleMainDiv = $('<div class="d-flex justify-content-between align-items-center"></div>');
var subTitleDiv = $('<div class="fs-10 text-truncate">' + mSubtitle + '</div>');
var subTitleDiv = $('<div class="fs-10 text-truncate">' + mSubtitle + '</div>');
var dateDiv = $('<div class="fs-8 text-secondary text-nowrap">' + mDate + '</div>');
subTitleMainDiv.append(subTitleDiv);
subTitleMainDiv.append(dateDiv);
messageA.append(titleDiv);
messageA.append(subTitleMainDiv);
messageLi.append(messageA);
$('#messageList').append(messageLi);
}
$('#messageList').append(messageLi);
}
};
/**
* dummy message list JSON for test
*/
PushMessageList.dummyMessageListJson = {
pushMessageList: [{
pushMessageId: 1,
pushMessage: 'メッセージ内容が入ります。',
pushSendDate: '2022/07/06 14:14',
operationName: '作業名が入ります。',
readingFlg: 0,
}, {
pushMessageId: 2,
pushMessage: 'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。',
pushSendDate: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
operationName: '作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。',
readingFlg: 1,
}]
pushMessageList: [
{
pushMessageId: 1,
pushMessage: 'メッセージ内容が入ります。',
pushSendDate: '2022/07/06 14:14',
operationName: '作業名が入ります。',
readingFlg: 0,
},
{
pushMessageId: 2,
pushMessage: 'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。',
pushSendDate: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
operationName: '作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。',
readingFlg: 1,
},
],
};
/**
* ReportForm function js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var RF = {};
RF.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
RF.loadCommon();
RF.initFormView();
};
RF.loadCommon = function () {
$('#includedHeader').load('../html/common/header.html', function () {
I18N.initi18n();
HEADER.init();
});
$('#includedConfirmModal').load('../html/common/confirm-modal.html', function () {
I18N.initi18n();
});
};
RF.initFormView = function () {
const urlParameterList = COMMON.getUrlParameter();
const operationId = urlParameterList['operationId'];
if (operationId) {
let params = {};
const taskKey = urlParameterList['taskKey'];
const replyNo = urlParameterList['replyNo'];
const processKey = urlParameterList['processKey'];
const phaseNo = urlParameterList['phaseNo'];
params.sid = COMMON.getSid();
params.operationId = operationId;
if (taskKey) params.taskKey = taskKey;
if (replyNo) params.replyNo = replyNo;
if (processKey) params.processKey = processKey;
if (phaseNo) params.phaseNo = phaseNo;
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.LIST_REPORT_FORM;
$('#report-form').load(url, params, function () {
initPageLoad();
});
} else {
COMMON.avwScreenMove('index.html');
}
};
// ReportList function js
/**
* ReportList function js
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var RL = {};
RL.init = function() {
console.log("ReportList init start");
// COMMON.checkAuth(true);
RL.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
console.log('ReportList init start');
RL.loadCommon();
RL.checkQuickReport();
RL.initTaskReportList();
......@@ -49,21 +54,20 @@ RL.checkQuickReport = function() {
}
}
RL.initTaskReportList = function() {
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 = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.HTML.BASE + CONSTANT.URL.CMS.HTML.TASK_REPORT_LIST;
$("#reportList").load(url, params);
$('#reportList').load(url, params);
} else {
COMMON.displayAlert("error");
COMMON.avwScreenMove("index.html");
COMMON.displayAlert('error');
COMMON.avwScreenMove('index.html');
}
}
RL.goPdfPrint = function() {
COMMON.avwScreenMove("pdfPrint.html");
}
};
RL.goPdfPrint = function () {
COMMON.avwScreenMove('pdfPrint.html');
};
/**
* Send Message js in send-message.html
* Send Message js in sendMessage.html
*
* @since 1.0 check web
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var SendMessage = {};
......@@ -12,49 +12,49 @@ SendMessage.contentMaxLength = 207;
* Get input content
* @returns string
*/
SendMessage.getCurrentMessageContent = function() {
SendMessage.getCurrentMessageContent = function () {
return $('#messageContent').val();
}
};
/**
* Get operation id selected
* @returns string
*/
SendMessage.getCurrentOperationId = function() {
SendMessage.getCurrentOperationId = function () {
return $('#operationSelected').attr('data-operation-id');
}
};
/**
* Get send type selected
* @returns string
*/
SendMessage.getCurrentSendType = function() {
SendMessage.getCurrentSendType = function () {
return $('input[name="sendType"]:checked').val();
}
};
/**
* Check data required when send message request to cms
* @returns boolean
*/
SendMessage.checkValidation = function() {
SendMessage.checkValidation = function () {
const message = SendMessage.getCurrentMessageContent();
if (!ValidationUtil.CheckRequiredForText(message)) {
alert(I18N.i18nText('msgContentRequired'));
return false;
}
return false;
}
if (!ValidationUtil.CheckMaxLengthForByte(message, SendMessage.contentMaxLength)) {
alert(COMMON.format(I18N.i18nText('msgContentInvalidLength'), SendMessage.contentMaxLength));
return false;
return false;
}
const operationId = SendMessage.getCurrentOperationId();
if (!ValidationUtil.IsNumber(operationId)) {
alert(I18N.i18nText('msgOperationRequired'));
return false;
return false;
}
const sendType = SendMessage.getCurrentSendType();
if (!ValidationUtil.IsNumber(sendType)) {
alert(I18N.i18nText('msgSendTypeRequired'));
return false;
return false;
}
return true;
};
......@@ -62,7 +62,7 @@ SendMessage.checkValidation = function() {
/**
* handle click event of send button
*/
SendMessage.onClickSend = function() {
SendMessage.onClickSend = function () {
if (!SendMessage.checkValidation()) {
return;
}
......@@ -74,39 +74,44 @@ SendMessage.onClickSend = function() {
/**
* post message data to cms
* @param {string} message
* @param {long} operationId
* @param {string} message
* @param {long} operationId
* @param {int} sendType - 0: Group, 1: All
*/
SendMessage.postMessage = function(message, operationId, sendType) {
SendMessage.postMessage = function (message, operationId, sendType) {
let param = {
sid: COMMON.getSid(),
message: message,
operationId: operationId,
sendType: sendType
sendType: sendType,
};
COMMON.cmsAjax(SendMessage.baseApiUrl, param, false, function (json) {
}, function() {
console.log('SendMessage.postMessage error');
});
COMMON.cmsAjax(
SendMessage.baseApiUrl,
param,
false,
function (json) {},
function () {
console.log('SendMessage.postMessage error');
},
);
};
SendMessage.operationSelectedCallback = function(operationId, operationName) {
SendMessage.operationSelectedCallback = function (operationId, operationName) {
$('#operationSelected').attr('data-operation-id', operationId);
$('#operationSelected').text(operationName);
}
};
SendMessage.templateSelectedCallback = function(template) {
SendMessage.templateSelectedCallback = function (template) {
$('#messageContent').val(template);
}
};
/**
* init data, action when screen onload
*/
SendMessage.init = function () {
TEMPLATE.loadHearder("#includedHeader");
//Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHearder('#includedHeader');
const navs = [
{
titleLang: 'dashboard',
......@@ -116,7 +121,7 @@ SendMessage.init = function () {
titleLang: 'sendMessageTitle',
},
];
TEMPLATE.loadMainNavsTitle("#includedMainTitle", "sendMessageTitle", navs, null);
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'sendMessageTitle', navs, null);
TEMPLATE.loadOperationSelect('#includeOperationSelect', SendMessage.operationSelectedCallback);
TEMPLATE.loadNotificationSelect('#includeTemplateModal', SendMessage.templateSelectedCallback);
$('#messageContent').attr('maxlength', SendMessage.contentMaxLength);
......@@ -124,4 +129,4 @@ SendMessage.init = function () {
I18N.initi18n();
$("label[for='sendTypeGroup']").append(I18N.i18nText('labelSendTypeGroup'));
$("label[for='sendTypeAll']").append(I18N.i18nText('labelSendTypeAll'));
};
\ No newline at end of file
};
/// Account Settings function js
/**
* Account Settings function js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
**/
var SETTINGS = {};
// Init function of page
$(document).ready(function () {
//Check if user is logged in
COMMON.checkAuth(false);
SETTINGS.initScreen();
$("#dspPwdUpd1").click(SETTINGS.dspPwdUpd1_Click);
$('#dspPwdUpd1').click(SETTINGS.dspPwdUpd1_Click);
});
// Process changing password
SETTINGS.dspPwdUpd1_Click = function(e) {
SETTINGS.dspPwdUpd1_Click = function (e) {
e.preventDefault();
var isOK = true;
var msgError = $('#main-error-message');
var msgError = $('#main-error-message');
// Check validation
if (!ValidationUtil.CheckRequiredForText(SETTINGS.getCurrentPassword())) {
isOK = false;
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdCurr')).toString());
msgError.show();
}
else {
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdCurr')).toString());
msgError.show();
} else {
if (!ValidationUtil.CheckRequiredForText(SETTINGS.getNewPassword())) {
isOK = false;
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdNew')).toString());
msgError.show();
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdNew')).toString());
msgError.show();
} else if (!ValidationUtil.CheckRequiredForText(SETTINGS.getNewPasswordRe())) {
isOK = false;
msgError.html(COMMON.format(I18N.i18nText('msgEssential'), I18N.i18nText('txtPwdNewRe')).toString());
......@@ -38,7 +41,6 @@ SETTINGS.dspPwdUpd1_Click = function(e) {
}
}
if (isOK) {
// Check min length
if (!ValidationUtil.CheckMinLengthForByte(SETTINGS.getNewPassword(), 6)) {
isOK = false;
......@@ -53,58 +55,53 @@ SETTINGS.dspPwdUpd1_Click = function(e) {
}
// Check at least 3 consecutive characters
if (ValidationUtil.HasSeqChar(SETTINGS.getNewPassword(), 3)) {
isOK = false;
isOK = false;
msgError.html(I18N.i18nText('msgHasSeqChar'));
msgError.show();
}
// Check 4 same characters in before password
if (ValidationUtil.ContainSameSeqChar(SETTINGS.getCurrentPassword(), SETTINGS.getNewPassword(), 4)) {
isOK = false;
isOK = false;
msgError.html(I18N.i18nText('msgContainSameSeqChar'));
msgError.show();
}
}
// Do changing password
if (isOK) {
var params = {
sid: ClientData.userInfo_sid(),
loginId: ClientData.userInfo_loginId_session(),
password: SETTINGS.getCurrentPassword(),
newPassword: SETTINGS.getNewPassword(),
language: I18N.getCurrentLanguage(),
appId: 4
appId: 4,
};
const url = COMMON.format(ClientData.conf_checkApiUrl(), ClientData.userInfo_accountPath()) + CONSTANT.URL.CMS.API.PASSWORD_CHANGE;
COMMON.cmsAjax(url, params, false,
SETTINGS.avwCmsApi_passwordChange_success,
SETTINGS.avwCmsApi_passwordChange_fail);
}
else {
COMMON.cmsAjax(url, params, false, SETTINGS.avwCmsApi_passwordChange_success, SETTINGS.avwCmsApi_passwordChange_fail);
} else {
//alert('error');
}
};
SETTINGS.avwCmsApi_passwordChange_success = function(data) {
SETTINGS.avwCmsApi_passwordChange_success = function (data) {
// OK
var msgError = $('#main-error-message');
var msgError = $('#main-error-message');
if (data.httpStatus != CONSTANT.HTTP_STATUS.OK) {
msgError.html(I18N.i18nText('msgPwdChangeNG'));
msgError.show();
}
else {
} else {
msgError.html('');
$("#txtPwdCur").val("");
$("#txtPwdNew").val("");
$("#txtPwdNewRe").val("");
$('#txtPwdCur').val('');
$('#txtPwdNew').val('');
$('#txtPwdNewRe').val('');
/* show messages */
COMMON.displayAlert('msgPwdChangeOK');
}
};
SETTINGS.avwCmsApi_passwordChange_fail = function(xhr, b, c) {
SETTINGS.avwCmsApi_passwordChange_fail = function (xhr, b, c) {
/* show error messages */
var msgError = $('#main-error-message');
if (xhr.errorMessage && xhr.httpStatus != 0) {
......@@ -115,7 +112,6 @@ SETTINGS.avwCmsApi_passwordChange_fail = function(xhr, b, c) {
msgError.show();
};
/*
----------------------------------------------------------------------------
Event groups [ end ]
......@@ -123,33 +119,32 @@ Event groups [ end ]
*/
// Get input current password
SETTINGS.getCurrentPassword = function() {
return $("#txtPwdCur").val();
SETTINGS.getCurrentPassword = function () {
return $('#txtPwdCur').val();
};
// Get input new password
SETTINGS.getNewPassword = function() {
return $("#txtPwdNew").val();
SETTINGS.getNewPassword = function () {
return $('#txtPwdNew').val();
};
// Get input new password
SETTINGS.getNewPasswordRe = function() {
return $("#txtPwdNewRe").val();
SETTINGS.getNewPasswordRe = function () {
return $('#txtPwdNewRe').val();
};
// Initalize screen
SETTINGS.initScreen = function() {
$("#includedHeader").load("../html/common/header.html" , function() {
SETTINGS.initScreen = function () {
$('#includedHeader').load('../html/common/header.html', function () {
I18N.initi18n();
HEADER.init();
});
$("#includedConfirmModal").load("../html/common/confirm-modal.html", function() {
});
$('#includedConfirmModal').load('../html/common/confirmModal.html', function () {
I18N.initi18n();
});
});
// Login ID
$("#txtLoginId").text(ClientData.userInfo_loginId_session());
$('#txtLoginId').text(ClientData.userInfo_loginId_session());
// Account Path
$("#txtLoginAccPath").text(ClientData.userInfo_accountPath_session());
$('#txtLoginAccPath').text(ClientData.userInfo_accountPath_session());
// Recent login date
$("#txtLastLoginTime").text(ClientData.userInfo_lastLoginTime());
$('#txtLastLoginTime').text(ClientData.userInfo_lastLoginTime());
};
/**
* template js
* template js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var TEMPLATE = {};
/** template load header */
TEMPLATE.loadHearder = function(elmentId) {
$(elmentId).load("../html/common/header.html" , function() {
TEMPLATE.loadHearder = function (elmentId) {
$(elmentId).load('../html/common/header.html', function () {
$('#iconHomeDashboard').removeClass('active');
$('#iconHomeWorkList').removeClass('active');
if (sessionStorage.activeHomePage == CONSTANT.PAGE_NAME.OPERATION_LIST) {
$('#iconHomeWorkList').addClass('active');
} else {
$('#iconHomeDashboard').addClass('active');
}
I18N.initi18n();
HEADER.init();
});
}
});
};
/**
* template load dashboard setting
* template load dashboard setting
* @param {string} elmentId - element to load setting html
* @param {*} changeCallback - callback when setting changed
*/
TEMPLATE.loadDashboardSetting = function(elmentId, changeCallback) {
$(elmentId).load("dashboard-setting.html", function() {
TEMPLATE.loadDashboardSetting = function (elmentId, changeCallback) {
$(elmentId).load('dashboardSetting.html', function () {
DashboardSetting.init(changeCallback);
I18N.initi18n();
});
}
});
};
/** Template load confirm model */
TEMPLATE.loadConfirmModal = function(elmentId) {
$(elmentId).load("../html/common/confirm-modal.html", function() {
TEMPLATE.loadConfirmModal = function (elmentId) {
$(elmentId).load('../html/common/confirmModal.html', function () {
I18N.initi18n();
});
}
});
};
/** Template load operation select */
TEMPLATE.loadOperationSelect = function(elmentId, selectCallback) {
$(elmentId).load("operation-select.html", function() {
TEMPLATE.loadOperationSelect = function (elmentId, selectCallback) {
$(elmentId).load('operationSelect.html', function () {
OperationSelect.init(selectCallback);
I18N.initi18n();
});
}
});
};
/**
* show confirm model
*/
TEMPLATE.showModalConfirm = function () {
$("#showConfirm").click(function(){
$("#confirm-modal").modal();
TEMPLATE.showModalConfirm = function () {
$('#showConfirm').click(function () {
$('#confirm-modal').modal();
});
};
/** Template load notification content*/
TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
$(elmentId).load("notification-content.html", function() {
TEMPLATE.loadNotificationSelect = function (elmentId, selectCallback) {
$(elmentId).load('notificationContent.html', function () {
NotificationSelect.init(selectCallback);
I18N.initi18n();
});
}
});
};
/**
* load main navs title html to a element by id
......@@ -62,15 +69,15 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
* @param {string} titleLang - lang of title
* @param {Array} navs - array nav items (titleLang, href)
*/
TEMPLATE.loadMainNavsTitle = function(elmentId, titleLang, navs, completeCallback) {
var titleHtmlPath = '../common/main-title.html';
TEMPLATE.loadMainNavsTitle = function (elmentId, titleLang, navs, completeCallback) {
var titleHtmlPath = '../common/html/mainTitle.html';
if (navs) {
titleHtmlPath = '../common/main-nav-title.html';
titleHtmlPath = '../common/html/mainNavTitle.html';
}
$(elmentId).load(titleHtmlPath , function(data) {
$(elmentId).load(titleHtmlPath, function (data) {
$(elmentId).replaceWith(data);
if (titleLang) {
$('#mainTitleHeader').attr("lang", titleLang);
$('#mainTitleHeader').attr('lang', titleLang);
}
if (navs) {
var olElm = $('#mainTitleNavs ol');
......@@ -100,4 +107,4 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
completeCallback();
}
});
}
};
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