Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [LL_WEBREPORT_EXCLUDEHTML /]<!DOCTYPE HTML>
- <html>
- <head>
- <title>Форма редактирования</title>
- <SCRIPT type="text/javascript" SRC="[LL_REPTAG_SUPPORTDIR /]core/jquery.min.js"></SCRIPT>
- <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]core/jquery-ui.min.js"></script>
- <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]style/jquery-ui.min.css">
- <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/jqxcore.js"></script>
- <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/jqx-all.js"></script>
- <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/zjs_plautcore.js"></script>
- <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jquery.validate.min.js"></script>
- <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]zmplautcore/css/zcss_plautcore.css">
- <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/styles/jqx.base.css">
- <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/styles/jqx.bootstrap.css">
- </head>
- <body>
- <script type="text/javascript" language="javascript">
- function leadZero(s){
- if (s.length < 2){
- s = '0'+s;
- }
- return s;
- }
- function setSelection(dropdownList, needToSelect) {
- var sel = document.getElementById(dropdownList);
- var val = needToSelect;
- for(var i = 0, j = sel.options.length; i < j; ++i) {
- if(sel.options[i].innerHTML === val) {
- sel.selectedIndex = i;
- break;
- }
- }
- }
- $(document).ready(function(){
- //var now = new Date();
- //var dd = leadZero(String(now.getDate()));
- //var mm = leadZero(String(now.getMonth() + 1));
- //var yyyy = now.getFullYear();
- //var card_status = "Новый";
- //var card_type = "Мероприятие. Ручное создание";
- var dd = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_actionCardCreationDate /]:4 /]";
- var mm = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_actionCardCreationDate /]:3 /]";
- var yyyy = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_actionCardCreationDate /]:2 /]";
- var card_status = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:6 /]";
- var card_type = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:3 /]";
- var card_fio = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:8 /]";
- var card_name = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:4 /]";
- var card_branch = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:2 /]";
- var card_be = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:7 /]";
- //console.log(card_branch);
- //console.log(card_name);
- document.getElementById("card_year").value = yyyy;
- document.getElementById("card_month").value = mm;
- document.getElementById("card_day").value = dd;
- document.getElementById("card_type").value = card_type;
- document.getElementById("card_status").value = card_status;
- document.getElementById("card_type").value = card_type;
- document.getElementById("card_fio").value = card_fio;
- document.getElementById("card_name").value = card_name;
- document.getElementById("card_name").innerHTML = card_name;
- //document.getElementById("card_branch").value = card_branch;
- //document.getElementById("card_be").value = card_be;
- setSelection("card_name", card_name);
- document.getElementById("card_name").selectedIndex = "3";
- loadEvents();
- })
- function sendForm() {
- if(!validateForm()){
- alert("Заполните все поля, отмеченные звездочкой.");
- return;
- }
- var yyyy = document.getElementById("card_year").value;
- var mm = document.getElementById("card_month").value;
- var dd = document.getElementById("card_day").value;
- var card_branch = document.getElementById("card_branch").value;
- var card_status = document.getElementById("card_status").value;
- var card_type = document.getElementById("card_type").value;
- var card_name = document.getElementById("card_name").value;
- var card_be = document.getElementById("card_be").value;
- var card_fio = document.getElementById("card_fio").value;
- var card_sap = document.getElementById("card_sap").value;
- plt_openLoader();
- $.ajax({url: '[LL_REPTAG_URLPREFIX /]',
- data: {
- "func":"ll",
- "objId":"[LL_REPTAG_'ZWR_edit_BWS' NODEINFO:ID /]",
- "objAction":"RunReport",
- "year": yyyy,
- "month": mm,
- "day": dd,
- "branch": card_branch,
- "name": card_name,
- "type": card_type,
- "status": card_status,
- "be": card_be,
- "fio": card_fio,
- "sap": card_sap,
- "dataid": "[LL_REPTAG_&dataid /]",
- "parentWKSPTypeID": "[LL_REPTAG_&workspaceTypeID /]",
- "OTCSTicket": "[LL_REPTAG_HTTPCOOKIE assoc:LLCOOKIE /]"
- },
- method: 'POST',
- dataType: 'text',
- success: function(data) {
- if(data.indexOf("noerror:") > -1) {
- var id = data.trim().replace("noerror:", "");
- var url = '[LL_REPTAG_URLPREFIX /]/app/nodes/' + id;
- window.opener.location.href = url;
- //window.opener.location.reload(true);
- //window.open(url, "_blank");
- window.close();
- plt_closeLoader();
- } else {
- alert(data);
- plt_closeLoader();
- }
- },
- error: function(data) {
- alert(data);
- plt_closeLoader();
- }
- });
- }
- function validateForm(){
- var card_branch = document.getElementById("card_branch").value;
- var card_status = document.getElementById("card_status").value;
- var card_type = document.getElementById("card_type").value;
- var card_name = document.getElementById("card_name").value;
- var card_be = document.getElementById("card_be").value;
- var card_fio = document.getElementById("card_fio").value;
- var card_sap = document.getElementById("card_sap").value;
- console.log(card_branch);
- console.log(card_status);
- console.log(card_type);
- console.log(card_name);
- console.log(card_be);
- console.log(card_fio);
- if(checkIsEmployment()){
- if(card_fio != "" && card_be!="" && card_name!="" && card_type!="" && card_status!="" && card_branch!="" ){
- return true;
- } else {
- return false;
- }
- }
- else {
- if(card_be!="" && card_name!="" && card_type!="" && card_status!="" && card_branch!="" ){
- return true;
- } else {
- return false;
- }
- }
- }
- function checkIsEmployment() {
- var card_name = document.getElementById("card_name").value;
- var index = $("#card_name")[0].selectedIndex;
- //document.getElementById("card_fio").style.backgroundColor = formConfig[index].ini.backFIO;
- //document.getElementById("label_fio").innerHTML = formConfig[index].ini.strFIO;
- if(typeof formConfig[index].ini.requiredFIO !== 'undefined'){
- $('#card_name').addClass("required");
- $('#card_name').addClass("disabled");
- document.getElementById("card_name").style.backgroundColor = formConfig[index].ini.backFIO;
- return true;
- }
- else {
- $('#card_name').removeClass("required");
- $('#card_name').removeClass("disabled");
- document.getElementById("card_name").style.backgroundColor = "#ffffff";
- return false;
- }
- }
- function isEmpty(obj) {
- for(var key in obj) {
- if(obj.hasOwnProperty(key))
- return false;
- }
- return true;
- }
- var formConfig;
- function loadEvents()
- {
- plt_openLoader();
- $.ajax({
- url: '[LL_REPTAG_URLPREFIX /]',
- method: 'POST',
- dataType: 'json',
- data: {
- "func":"ll",
- "objId":"[LL_REPTAG_'ZWR_getEventsNoGroups' NODEINFO:ID /]",
- "objAction":"RunReport"
- },
- success: function(response) {
- formConfig = response.events;
- //console.log(response.events);
- for(i=0; i<formConfig.length-1; i++){
- //console.log(response[i]);
- console.log(formConfig[i].eventType);
- $('#card_name').append('<option value = "'+ formConfig[i].eventType + '">' + formConfig[i].eventType + '</option>');
- }
- plt_closeLoader();
- },
- error: function(x, e) {
- plt_closeLoader();
- }
- });
- }
- function clearAll() {
- $(".filter").each(function() {
- if ($(this).attr("type") != "checkbox") {
- $(this).val("");
- } else {
- $(this).prop("checked", false);
- }
- })
- }
- function closeWindow()
- {
- self.close();
- }
- </script>
- <style>
- table {
- border: 1px solid #222222;
- padding: 20px;
- border-radius: 10px;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- -khtml-border-radius: 10px;
- display: block;
- }
- td {
- padding: 10px;
- border: 1px solid #eeeeee;
- }
- .btnback {
- background-image: url("[LL_REPTAG_SUPPORTDIR /]addons/icon.png");
- width:24px;
- height:22px;
- background-repeat: no-repeat;
- background-position: 3px 1px;
- vertical-align: middle;
- background-color: transparent;
- border: none;
- }
- .inputsize {
- height: 22px !important;
- width: 297px !important;
- }
- </style>
- <div style="font-size: 13px; font-family: Verdana;">
- <div style="margin: auto; display: table">
- <FORM id="createForm">
- <table class=" table-block" >
- <tbody>
- <tr>
- <th style="text-align: center;" colspan="2">Редактирование карточки [LL_REPTAG_&dataid /]</th>
- </tr>
- <tr>
- <td>
- <label class="col-sm-4 control-label">БЕ (код) <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
- </td>
- <td align="left">
- [LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /]
- <select name="card_be" id="card_be" style="background-color: #eeeeee; -webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack">
- <option value="[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:7 /]">[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:7 /]</option>
- </select>
- [LL_WEBREPORT_ELSE /]
- <select name="card_be" id="card_be" style="-webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack" readonly>
- <option value="1010">1010</option>
- <option value="2020">2020</option>
- <option value="3030">3030</option>
- <option value="4040">4040</option>
- <option value="5050">5050</option>
- </select>
- [LL_WEBREPORT_ENDIF /]
- </td>
- </tr>
- <tr>
- <td>
- <label class="col-sm-4 control-label">Структурное подразделение (код) <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
- </td>
- <td align="left">
- [LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /]
- <select name="card_branch" id="card_branch" style="background-color: #eeeeee; -webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack">
- <option>
- [LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:2 /]
- </option>
- </select>
- [LL_WEBREPORT_ELSE /]
- <select name="card_branch" id="card_branch" style="-webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack" readonly>
- <option>
- <option value="6600">6600</option>
- <option value="7700">7700</option>
- <option value="8800">8800</option>
- <option value="9900">9900</option>
- <option value="0000">0000</option>
- </option>
- </select>
- [LL_WEBREPORT_ENDIF /]
- </td>
- </tr>
- <td>
- <label class="col-sm-4 control-label">Тип карточки <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
- </td>
- <td align="left">
- <input type="text" name="card_type" id="card_type" value="Мероприятие" style="height: 22px; width: 297px; background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light;" readonly >
- </td>
- </tr>
- <tr>
- <td>
- <label class="col-sm-4 control-label">ФИО сотрудника <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
- </td>
- <td align="left">
- [LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /]
- <input type="text" name="card_fio" id="card_fio"
- value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:8 /][LL_WEBREPORT_ENDIF /]"
- style="height: 22px; width: 297px; background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light;" readonly >
- [LL_WEBREPORT_ELSE /]
- <input type="text" name="card_fio" id="card_fio"
- value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:8 /][LL_WEBREPORT_ENDIF /]"
- style="height: 22px; width: 297px;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light;" >
- [LL_WEBREPORT_ENDIF /]
- </td>
- </tr>
- <tr>
- <tr>
- <td>
- <label class="col-sm-4 control-label">Описание <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
- </td>
- <td align="left">
- <select name="card_name" id="card_name" style="-webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack">
- </select>
- </td>
- </tr>
- <tr class="hidden">
- <input type="text" name="card_status" id="card_status" value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:6 /][LL_WEBREPORT_ENDIF /]" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
- <input type="text" name="card_year" id="card_year" value="" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
- <input type="text" name="card_month" id="card_month" value="" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
- <input type="text" name="card_day" id="card_day" value="" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
- <input type="text" name="card_sap" id="card_sap" value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:5 /][LL_WEBREPORT_ENDIF /]" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
- </tr>
- <tr>
- <td class='text-center' colspan="2">
- <div class="btn-group" style="text-align: center;">
- <button type="button" class="jqx-rc-all jqx-rc-all-bootstrap jqx-button jqx-button-bootstrap jqx-widget jqx-widget-bootstrap jqx-fill-state-normal jqx-fill-state-normal-bootstrap" onclick="sendForm()">Сохранить</button>
- <button type="button" class="jqx-rc-all jqx-rc-all-bootstrap jqx-button jqx-button-bootstrap jqx-widget jqx-widget-bootstrap jqx-fill-state-normal jqx-fill-state-normal-bootstrap" onclick="closeWindow()">Отмена</button>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- <p><input hidden type="text" name="date" id="date" value="">
- </FORM>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement