Odyssey
mEstmntMntc.prg
1 <?php
2 /*
3  * FILE: mEstmntMntc.prg
4  * This is a maintenance form for adding estatement files globally.
5  */
6 
7  $monLibrary = dirname(__FILE__) . "/../library";
8  $monIncludes = dirname(__FILE__) . "/../includes";
9  require_once("$monLibrary/cu_top.i");
10  require_once("$monLibrary/ck_hticket.i");
11  require_once("./mcEstmntMntc.data");
12 
13  if (!CheckPerm($link, $Hu, basename($_SERVER['SCRIPT_NAME']), $_SERVER['REMOTE_ADDR'])) {
14  // ** Permissions failed
15  // ** redirect to new page
16  header("Location: /hcuadm/hcu_noperm.prg");
17  exit;
18  }
19 
20  $string = array("filter" => FILTER_SANITIZE_STRING);
21  $array = array("filter" => FILTER_DEFAULT);
22  $parameters = array();
23  HCU_ImportVars($parameters, "a", array("operation" => $string, "dataItem" => $array, "docid" => $string, "contents" => $array));
24  extract($parameters["a"]);
25 
26  $operation = isset($operation) ? trim($operation) : "";
27  $dataItem = isset($dataItem) ? trim($dataItem) : "";
28  $docid = isset($docid) ? trim($docid) : "";
29  $contents = isset($contents) ? trim($contents) : "";
30 
31  if ($operation != "") {
32  switch ($operation) {
33  case "readEstmntDefinitions":
34  $returnArray = ReadEstmntDefinitions($dbh, "", "");
35  break;
36  case "updateEstmntDefinitionsMntc":
37  $returnArray = UpdateEstmntDefinitionsMntc($dbh, $dataItem);
38  break;
39  case "removeEstmntDefinitionsMntc":
40  $returnArray = RemoveEstmntDefinitionsMntc($dbh, $docid, "", "");
41  break;
42  case "readEstmntFile":
43  $returnArray = ReadEstmntFileGlobal($dbh, $docid, false, "", "");
44  break;
45  case "updateEstmntFile":
46  $returnArray = UpdateEstmntFile($dbh, $docid, $contents, "", "");
47  break;
48  case "revertEstmntFile":
49  $returnArray = RevertEstmntFile($dbh, $docid, "", "");
50  break;
51  default: // Won't get here
52  $returnArray = array("status" => "001", "error" => "Operation not specified: '$operation'", "data" => array());
53  break;
54  }
55 
56  header('Content-type: application/json');
57  print HCU_JsonEncode($returnArray);
58  } else {
59  PrintMainPage($homecuKendoVersion, $cloudfrontDomainName, $bootstrapVersion, $fontawesomeVersion);
60  }
61 
62  /**
63  * function PrintMainPage($homecuKendoVersion, $cloudfrontDomainName, $bootstrapVersion, $fontawesomeVersion)
64  * Prints out the main page for the global maintenance of the E-statement script.
65  *
66  * @param $homecuKendoVersion -- the current Kendo version
67  * @param $cloudfrontDomainName -- the cloudfront domain name
68  * @param $bootstrapVersion -- the bootstrap version
69  * @param $fontawesomeVersion -- the font awesome version
70  */
71  function PrintMainPage($homecuKendoVersion, $cloudfrontDomainName, $bootstrapVersion, $fontawesomeVersion) {
72  $pageTitle = GetEstatementText() . " Maintenance";
73  printMonitorPageTop($pageTitle, $homecuKendoVersion, $cloudfrontDomainName, $bootstrapVersion, $fontawesomeVersion, true);
74  printMonitorPageMiddle($pageTitle, null);
75  ?>
76  <?php
77  /**
78  * Here is all the local CSS rules for the page.
79  */
80  ?>
81  <style>
82  #filecontents {
83  height: 400px;
84  }
85 
86  .k-grid tr td {
87  overflow: visible;
88  }
89 
90  .k-grid td .k-menu .k-item > .k-link {
91  line-height: initial;
92  padding-bottom: 0.5em; <?php // I know that some of the criticism will be that it takes up a lot of space. ?>
93  padding-top: 0.5em;
94  }
95  </style>
96 
97  <?php
98  /**
99  * Here is the Javascript for the page.
100  */
101  ?>
102  <script type="text/javascript">
103  <?php
104  /**
105  * @var self -- the name of this script for data calls.
106  */
107  ?>
108  var self = "<?php echo $_SERVER['PHP_SELF']; ?>";
109 
110  <?php
111  /**
112  * @var vendorList -- Retrieved on the read: list of configurations.
113  */
114  ?>
115  var vendorList = null;
116 
117  <?php
118  /**
119  * @var docnameList -- Retrieved on the read: list of docnames.
120  */
121  ?>
122  var docnameList = null;
123 
124  <?php
125  /**
126  * @var initialized -- If true, destroy menu controls before rereading.
127  */
128  ?>
129  var initialized = false;
130 
131  <?php
132  /**
133  * @var mainGridIndex -- Makes the menus unique.
134  */
135  ?>
136  var mainGridIndex = 0;
137 
138  <?php
139  /**
140  * function InitMainGrid()
141  * This initialize the main grid and any controls directly within the grid.
142  */
143  ?>
144  function InitMainGrid() {
145 
146  <?php
147  /**
148  * @var menuDef -- the definition for the kendoMenu controls in the grid.
149  */
150  ?>
151  var menuDef = {
152  orientation: "vertical",
153  direction: "bottom left",
154  select: function(e) {
155  var grid = $("#globalEstatementGrid").data("kendoGrid");
156  var tr = $(e.item).closest("tr");
157  var dataItem = grid.dataItem(tr);
158  switch ($(e.item).text().trim()) {
159  case "Action...":
160  break; <?php // Nothing to do. ?>
161  case "Edit File":
162  fileDataSource.read({docid: dataItem.docid});
163  break;
164  case "Delete":
165  $("#deleteDialog").data("dataItem", dataItem);
166  $("#deleteDialog").data("kendoDialog").open().center();
167  break;
168  case "Edit Settings":
169  $("#addWindow").data("dataItem", dataItem);
170  $("#addWindow").data("kendoWindow").title("Edit Document").open().center();
171  break;
172  }
173  }
174  }
175 
176  <?php
177  /**
178  * @var globalEstatementGrid -- the declaration of the grid.
179  */
180  ?>
181  var globalEstatementGrid = $("#globalEstatementGrid").kendoGrid({
182  dataSource: {
183  batch: true,
184  transport: {
185  read: {
186  url: self,
187  dataType: "json",
188  type: "POST"
189  },
190  create: {
191  url: self,
192  dataType: "json",
193  type: "POST"
194  },
195  update: {
196  url: self,
197  dataType: "json",
198  type: "POST"
199  },
200  destroy: {
201  url: self,
202  dataType: "json",
203  type: "POST"
204  },
205  parameterMap: function(data, type) {
206  ShowWaitWindow();
207 
208  switch (type) {
209  case "create":
210  case "update":
211  data = {operation: "updateEstmntDefinitionsMntc", dataItem: kendo.stringify(data.models[0])};
212  break;
213  case "destroy":
214  data = {operation: "removeEstmntDefinitionsMntc", docid: data.models[0].docid};
215  break;
216  case "read":
217  data = {operation: "readEstmntDefinitions"};
218  break;
219  default:
220  break;
221  }
222 
223  return data;
224  }
225  },
226  schema: {
227  model: {
228  id: "docid",
229  fields: {
230  docid: {type: "number"},
231  docname: {type: "string"},
232  sort: {type: "number"},
233  descr: {type: "string"},
234  vendor: {type: "string"},
235  section: {type: "string"},
236  invalid: {type: "boolean"}
237  }
238  },
239  parse: function (data) {
240  CloseWaitWindow();
241  if (data.status != "000") {
242  $.homecuValidator.displayMessage(data.error, $.homecuValidator.settings.statusError );
243  if (data.operation == "create") {
244  return {docid: "", invalid: true};
245  }
246  } else if (data.info != "") {
247  $.homecuValidator.displayMessage(data.info, $.homecuValidator.settings.statusInfo );
248  }
249  if (data.operation == "readInit") {
250  vendorList = data.data.vendorData;
251  docnameList = data.data.docnameData;
252  return data.data.gridData;
253  } else {
254 
255  <?php // Add custom Doc Name and Core Vendor to the list. ?>
256  var docnameCBX = $("#docnameCBX").data("kendoComboBox");
257  var vendorCBX = $("#vendorCBX").data("kendoComboBox");
258  if (docnameCBX.select() == -1) {
259  var docData = docnameCBX.dataSource.data();
260  docData.push(docnameCBX.value());
261  docData.sort();
262  docnameCBX.dataSource.data(docData);
263  }
264  if (vendorCBX.select() == -1) {
265  var vendorData = vendorCBX.dataSource.data();
266  vendorData.push(vendorCBX.value());
267  vendorData.sort();
268  vendorCBX.dataSource.data(vendorData);
269  }
270  return data.data;
271  }
272  }
273  },
274  group: {field: "vendor"},
275  filter: {field: "invalid", operator: "neq", value: true},
276  sort: [{field: "sort", dir: "asc"}, {field: "docname", dir: "asc"}]
277  },
278  columns: [
279  {field: "docname", title: "Doc Name"},
280  {field: "sort", title: "Sort", width: 50},
281  {field: "descr", title: "Description"},
282  {field: "section", title: "Section"},
283  {title: "", width: 150, template: "<div id='actionMenu_#: window.mainGridIndex #'></div>"},
284  {field: "vendor", hidden: true, groupHeaderTemplate: "#: value #"}
285  ],
286  rowTemplate: $("#rowTemplate").html(),
287  toolbar: "<a href='\\#' class='k-button addButton'><i class='fa fa-plus'></i> Add</a>",
288  noRecords: {
289  template: "<tr><td>No records were found</td></tr>"
290  },
291  editable: "inline",
292  scrollable: false,
293  dataBinding: function (e) {
294  if (e.action == "add" || e.action == "remove" || e.action == "itemchange") {
295  <?php // Do not fire. I will have to set the "dirty" flag and sync which will fire the bind. ?>
296  e.preventDefault();
297  } else if (initialized) {
298  $("#globalEstatementGrid [id^='actionMenu_']").each(function() { <?php // Destroy all custom DDLs that are created on the grid. ?>
299  var ddl = $(this).data("kendoMenu");
300  if (ddl != null) {
301  ddl.destroy();
302  }
303  });
304  }
305 
306  mainGridIndex = 0;
307  },
308  dataBound: function (e) {
309  $("#globalEstatementGrid [id^='actionMenu_']").each(function() { <?php // Destroy all custom DDLs that are created on the grid. ?>
310  var ddl = $(this).kendoMenu(menuDef).data("kendoMenu");
311  });
312  initialized = true;
313  }
314  }).data("kendoGrid");
315  }
316 
317  <?php
318  /**
319  * function InitDeleteDialog()
320  * Initializes the delete dialog.
321  */
322  ?>
323  function InitDeleteDialog() {
324 
325  <?php
326  /**
327  * @var deleteDialog -- This is the dialog that shows up when the "delete" option is clicked.
328  */
329  ?>
330  var deleteDialog = $("<div id='deleteDialog'></div>").appendTo("body").kendoDialog({
331  title: "Confirm Delete",
332  content: "Are you sure you want to delete this custom content?",
333  visible: false,
334  actions: [
335  {text: "No"},
336  {text: "Yes", primary: true, action: function() {
337  var dataItem = $("#deleteDialog").data("dataItem");
338  var dataSource = $("#globalEstatementGrid").data("kendoGrid").dataSource;
339  dataSource.remove(dataItem);
340  dataSource.sync();
341  }}
342  ],
343  open: function () {
344  if (window.activeWindows != null) {
345  window.activeWindows.push(this);
346  }
347  },
348  close: function () {
349  if (window.activeWindows != null) {
350  window.activeWindows.pop();
351  }
352  }
353  }).data("kendoDialog");
354  }
355 
356  <?php
357  /**
358  * @var addWindowInitialized -- if false, then create the controls inside the window and then set to true.
359  */
360  ?>
361  var addWindowInitialized = false;
362 
363  <?php
364  /**
365  * function InitAddWindow()
366  * Initializes the add window and click events for the update and cancel button therein.
367  */
368  ?>
369  function InitAddWindow() {
370  <?php
371  /**
372  * @var addWindow -- The kendoWindow for adding or updating the document settings.
373  */
374  ?>
375  var addWindow = $("<div id='addWindow'></div>").appendTo("body").kendoWindow({
376  modal: true,
377  visible: false,
378  width: 350,
379  content: {
380  template: $("#addWindowTemplate").html()
381  },
382  open: function() {
383 
384  <?php // Need to prevent user from entering a duplicate docname / vendor combo. ?>
385  $.homecuValidator.setup({formValidate:'addWindowForm', formStatusField: 'addWindowErrorDiv', homecuCustomRules: {
386  duplicateCheck: function (input) {
387  if ($(input).is("[name='duplicateCheck']")) {
388  var docnameCBX = $("#docnameCBX").data("kendoComboBox");
389  var vendorCBX = $("#vendorCBX").data("kendoComboBox");
390  var docname = docnameCBX.value().trim();
391  var vendor = vendorCBX.value().trim();
392  var docid = $("[name='docid']").val().trim();
393  var data = $("#globalEstatementGrid").data("kendoGrid").dataSource.data();
394  if ($.grep(data, function (n, i) {
395  return n.docid != docid && n.docname == docname && n.vendor == vendor;
396  }).length > 0) {
397  $(input).attr("data-duplicateCheck-msg", "Cannot save a duplicate");
398  return false;
399  }
400  }
401  return true;
402  }
403  }});
404 
405  if (window.activeWindows != null) {
406  window.activeWindows.push(this);
407  }
408 
409  <?php // Initialize all controls or give handles. ?>
410  var sectionDDL = null;
411  var vendorCBX = null;
412  var docnameCBX = null;
413  var sortNTB = null;
414  if (!addWindowInitialized) {
415  addWindowInitialized = true;
416 
417  sortNTB = $("#sortNTB").kendoNumericTextBox({
418  decimals: 0,
419  format: "n0",
420  min: 0,
421  spinners: false
422  }).data("kendoNumericTextBox");
423 
424  sectionDDL = $("#sectionDDL").kendoDropDownList({
425  dataSource: ["<?php echo GetEstatementText(); ?>s", "Credit Card", "Disclosure", "Utility"]
426  }).data("kendoDropDownList");
427 
428  vendorCBX = $("#vendorCBX").kendoComboBox({
429  dataSource: vendorList
430  }).data("kendoComboBox");
431 
432  docnameCBX = $("#docnameCBX").kendoComboBox({
433  dataSource: docnameList
434  }).data("kendoComboBox");
435  } else {
436  sectionDDL = $("#sectionDDL").data("kendoDropDownList");
437  vendorCBX = $("#vendorCBX").data("kendoComboBox");
438  sortNTB = $("#sortNTB").data("kendoNumericTextBox");
439  docnameCBX = $("#docnameCBX").data("kendoComboBox");
440  }
441 
442  <?php // Set values. ?>
443  var dataItem = $("#addWindow").data("dataItem");
444  sortNTB.value(dataItem.sort);
445  sectionDDL.value(dataItem.section);
446  vendorCBX.value(dataItem.vendor);
447  $("[name='docid']").val(dataItem.docid);
448  $("[name='descr']").val(dataItem.descr);
449  docnameCBX.value(dataItem.docname);
450 
451 
452  },
453  close: function() {
454  $.homecuValidator.setup({formValidate:'estmntForm', formStatusField: 'estmntErrorDiv'});
455  if (window.activeWindows != null) {
456  window.activeWindows.pop();
457  }
458  }
459  }).data("kendoWindow");
460 
461  <?php
462  /**
463  * Anonymous function
464  * When the "add button" is clicked, then open the add window.
465  */
466  ?>
467  $("#globalEstatementGrid").on("click", ".addButton", function() {
468  var dataItem = {docid: 0, docname: "", sort: "", descr: "", vendor: "", section: ""};
469  $("#addWindow").data("dataItem", dataItem);
470  addWindow.title("Add Document").open().center();
471  });
472 
473  <?php
474  /**
475  * Anonymous function
476  * When the "cancel button" is clicked, close the window.
477  */
478  ?>
479  $("#addWindow").on("click", ".cancelBtn", function() {
480  addWindow.close();
481  });
482 
483  <?php
484  /**
485  * Anonymous function
486  * When the "update button" is clicked, save the record and then close the window.
487  */
488  ?>
489  $("#addWindow").on("click", ".updateBtn", function() {
490  if ($.homecuValidator.validate()) {
491  var vendorCBX = $("#vendorCBX").data("kendoComboBox");
492  if (vendorCBX.select() == -1) {
493  var confirmNewVendorDialog = $("#confirmNewVendorDialog").data("kendoDialog");
494  if (confirmNewVendorDialog == null) {
495  <?php
496  /**
497  * @var confirmNewVendorDialog -- Dialog to confirm that user is about to create a new configuration type by creating this record.
498  */
499  ?>
500  confirmNewVendorDialog = $("<div id='confirmNewVendorDialog'></div>").appendTo("body").kendoDialog({
501  title: "Confirm New Vendor",
502  visible: false,
503  actions: [
504  {text: "No"},
505  {text: "Yes", primary: true, action: function() {
506  DoUpdateRecord();
507  confirmNewVendorDialog.close();
508  addWindow.close();
509  return false;
510  }}
511  ],
512  open: function () {
513  if (window.activeWindows != null) {
514  window.activeWindows.push(this);
515  }
516  },
517  close: function () {
518  if (window.activeWindows != null) {
519  window.activeWindows.pop();
520  }
521  }
522  }).data("kendoDialog");
523  }
524 
525  confirmNewVendorDialog.content("Are you sure you want to add a new vendor configuration? <br>Configuration is \"" + vendorCBX.value() + ".\"");
526  confirmNewVendorDialog.open().center();
527  } else {
528  DoUpdateRecord();
529  addWindow.close();
530  }
531  }
532  });
533  }
534 
535  <?php
536  /**
537  * function DoUpdateRecord()
538  * This adds or updates an estatement record. It is now in two places: when user confirms that they are going to create a new configuration type, and on a save without a change here.
539  */
540  ?>
541  function DoUpdateRecord() {
542  <?php // First: get the dataItem from the window. ?>
543  var docid = $("[name='docid']").val();
544  var docname = $("#docnameCBX").data("kendoComboBox").value();
545  var sort = $("#sortNTB").data("kendoNumericTextBox").value();
546  var descr = $("[name='descr']").val();
547  var section = $("#sectionDDL").val();
548  var vendor = $("#vendorCBX").data("kendoComboBox").value();
549 
550  <?php // Then: add it to the grid. dataSource.sync() should apply the correct CRUD operation. ?>
551  var dataSource = $("#globalEstatementGrid").data("kendoGrid").dataSource;
552 
553  if (docid == 0) {
554  dataSource.add({docname: docname, sort: sort, descr: descr, section: section, vendor: vendor});
555  } else {
556  var gridData = dataSource.data();
557  var indexToUpdate = -1;
558  for(var i = 0, count = gridData.length; i != count; i++) {
559  var row = gridData[i];
560  if (row.docid == docid) {
561  indexToUpdate = i;
562  break;
563  }
564  }
565 
566  dataSource.at(indexToUpdate).set("docname", docname);
567  dataSource.at(indexToUpdate).set("sort", sort);
568  dataSource.at(indexToUpdate).set("descr", descr);
569  dataSource.at(indexToUpdate).set("section", section);
570  dataSource.at(indexToUpdate).set("vendor", vendor);
571  }
572  dataSource.sync();
573  }
574 
575  <?php
576  /**
577  * @var fileDataSource -- Since the dataSource is used in multiple places, put it in global scope.
578  */
579  ?>
580  var fileDataSource = null;
581 
582  <?php
583  /**
584  * function InitFileOperations()
585  * This function initializes the dataSource for reading/editing files and the window to edit the file.
586  */
587  ?>
588  function InitFileOperations() {
589 
590  <?php
591  /**
592  * @var fileDataSource -- Set up a dataSource to read and update files which do not change the record in the database.
593  */
594  ?>
595  fileDataSource = new kendo.data.DataSource({
596  batch: true,
597  transport: {
598  read: {
599  url: self,
600  dataType: "json",
601  type: "POST",
602  data: {
603  operation: "readEstmntFile"
604  }
605  },
606  create: {
607  url: self,
608  dataType: "json",
609  type: "POST",
610  data: {
611  operation: "updateEstmntFile"
612  }
613  },
614  update: {
615  url: self,
616  dataType: "json",
617  type: "POST",
618  data: {
619  operation: "updateEstmntFile"
620  }
621  },
622  parameterMap: function(data, type) {
623  ShowWaitWindow();
624 
625  switch (type) {
626  case "create":
627  case "update":
628  data = {operation: data.operation, docid: data.models[0].docid, contents: data.models[0].contents};
629  break;
630  case "read": <?php // Just return the data. ?>
631  break;
632  default:
633  break;
634  }
635 
636  return data;
637  }
638  },
639  schema: {
640  model: {
641  id: "docid",
642  fields: {
643  docid: {type: "number"},
644  filename: {type: "string"},
645  contents: {type: "string"}
646  }
647  },
648  parse: function (data) {
649  CloseWaitWindow();
650  if (data.status !== "000") {
651  $.homecuValidator.displayMessage(data.error, $.homecuValidator.settings.statusError );
652  } else {
653  if (data.operation != "read") {
654  $("#fileWindow").data("kendoWindow").close();
655  }
656 
657  if (data.info != "") {
658  $.homecuValidator.displayMessage(data.info, $.homecuValidator.settings.statusInfo );
659  }
660 
661  if (data.operation == "read") {
662  var template = kendo.template($("#fileWindowTemplate").html());
663  var dataItem = data.data[0];
664  $("#fileWindow").data("kendoWindow").content(template(dataItem)).title("Edit File \"" + dataItem.filename + "\"").open().center();
665  } else if (data.operation == "create" || data.operation == "update") {
666  $("#fileWindow").data("kendoWindow").close();
667  }
668  }
669 
670  return data.data;
671  }
672  }
673  });
674 
675  <?php
676  /**
677  * @var fileWindow -- This contains a textfield for editing the file.
678  */
679  ?>
680  var fileWindow = $("<div id='fileWindow'></div>").appendTo("body").kendoWindow({
681  modal: true,
682  visible: false,
683  width: 700,
684  open: function() {
685  if (window.activeWindows != null) {
686  window.activeWindows.push(this);
687  }
688  $.homecuValidator.setup({formValidate:'fileWindowForm', formStatusField: 'fileWindowErrorDiv'});
689  },
690  close: function () {
691  if (window.activeWindows != null) {
692  window.activeWindows.pop();
693  }
694  $.homecuValidator.setup({formValidate:'estmntForm', formStatusField: 'estmntErrorDiv'});
695  }
696  }).data("kendoWindow");
697 
698  <?php
699  /**
700  * Anonymous function
701  * When the cancel button is clicked, close the window.
702  */
703  ?>
704  $("#fileWindow").on("click", ".cancelBtn", function() {
705  $("#fileWindow").data("kendoWindow").close();
706  });
707 
708  <?php
709  /**
710  * Anonymous function
711  When the update button is clicked, update the file and then close the window.
712  */
713  ?>
714  $("#fileWindow").on("click", ".updateBtn", function() {
715  fileDataSource.at(0).set("contents", $("#filecontents").val());
716  fileDataSource.sync();
717  });
718  }
719 
720  <?php
721  /**
722  * @var activeWindows -- needed to reference current windows when the background is clicked.
723  */
724  ?>
725  var activeWindows = [];
726 
727  <?php
728  /**
729  * Anonymous function
730  * Run everything when the document is ready.
731  */
732  ?>
733  $(document).ready(function() {
734  $.homecuValidator.setup({formValidate:'estmntForm', formStatusField: 'estmntErrorDiv'});
735  InitMainGrid();
736  InitAddWindow();
737  InitDeleteDialog();
738  InitFileOperations();
739 
740  <?php
741  /**
742  * Anonymous function
743  * Be sure and close the window when the background is clicked.
744  */
745  ?>
746  $("body").on("click", ".k-overlay", function() {
747  if (activeWindows.length > 0) {
748  activeWindows [activeWindows.length - 1].close();
749  return false;
750  }
751  });
752  });
753  </script>
754 
755  <?php
756  /**
757  * fileWindowTemplate
758  * This is the template to follow for the default template.
759  */
760  ?>
761  <script type="type/x-kendo-script" id="fileWindowTemplate">
762  <div class="container-fluid hcu-template" id="fileWindowForm">
763  <div id="fileWindowErrorDiv"></div>
764  <div class="row hcuSpacer">
765  <textarea class="col-xs-12 k-textbox hcu-all-100" id="filecontents">#: contents #</textarea>
766  </div>
767  <div class="hcu-edit-buttons k-state-default">
768  <a class="cancelBtn" href="\\#">Cancel</a>
769  &nbsp;&nbsp;&nbsp;
770  <a class="updateBtn k-button k-primary" href="\\#"><i class="fa fa-check"></i>Update</a>
771  </div>
772  </div>
773 
774  </script>
775 
776  <?php
777  /**
778  * rowTemplate
779  * This is the template to follow when the kendo grid is creating rows.
780  */
781  ?>
782  <script type="type/x-kendo-script" id="rowTemplate">
783  <tr data-uid="#= uid #">
784  <td></td>
785  <td>#: docname #</td>
786  <td>#: sort #</td>
787  <td>#: descr #</td>
788  <td>#: section #</td>
789  <td>
790  <ul id='actionMenu_#: window.mainGridIndex #'>
791  <li>Action...
792  <ul>
793  <li>Edit File</li>
794  <li>Edit Settings</li>
795  <li>Delete</li>
796  </ul>
797  </li>
798  </ul>
799  </td>
800  </tr>
801  # window.mainGridIndex++; #
802  </script>
803 
804  <?php
805  /**
806  * addWindowTemplate
807  * This is the template to follow for the contents of the add window.
808  */
809  ?>
810  <script type="type/x-kendo-script" id="addWindowTemplate">
811  <div class="container-fluid hcu-template" id="addWindowForm">
812  <div id='addWindowErrorDiv'></div>
813  <input type='hidden' name='docid' required>
814  <input type='hidden' name='duplicateCheck'>
815  <div class="row hcuSpacer hcu-secondary">
816  <div class="col-xs-12 vsgSecondary">You may enter custom text in the Doc Name and Core Vendor controls.</div>
817  </div>
818  <div class="row hcuSpacer">
819  <div class="col-xs-4">
820  <label>Doc Name</label>
821  </div>
822  <div class="col-xs-8">
823  <input id='docnameCBX' name='docname' type='text' class='hcu-all-100' required data-required-msg="Doc Name is required">
824  </div>
825  </div>
826  <div class="row hcuSpacer">
827  <div class="col-xs-4">
828  <label>Sort</label>
829  </div>
830  <div class="col-xs-8">
831  <input id='sortNTB' name='sort' class="hcu-all-100">
832  </div>
833  </div>
834  <div class="row hcuSpacer">
835  <div class="col-xs-4">
836  <label>Description</label>
837  </div>
838  <div class="col-xs-8">
839  <input name='descr' class='k-textbox hcu-all-100' maxlength='250'>
840  </div>
841  </div>
842  <div class="row hcuSpacer">
843  <div class="col-xs-4">
844  <label>Section</label>
845  </div>
846  <div class="col-xs-8">
847  <input id="sectionDDL" name='section' required class='hcu-all-100' data-required-msg="Section is required">
848  </div>
849  </div>
850  <div class="row hcuSpacer">
851  <div class="col-xs-4">
852  <label>Core Vendor</label>
853  </div>
854  <div class="col-xs-8">
855  <input id="vendorCBX" name='vendor' required class='hcu-all-100' data-required-msg="Vendor is required">
856  </div>
857  </div>
858  <div class="hcu-edit-buttons k-state-default">
859  <a class="cancelBtn" href="\\#">Cancel</a>
860  &nbsp;&nbsp;&nbsp;
861  <a class="updateBtn k-button k-primary" href="\\#"><i class="fa fa-check"></i>Update</a>
862  </div>
863  </div>
864  </script>
865 
866  <?php
867  /**
868  * This is the HTML that is outside of a template. It shows up directly on load on the page.
869  */
870  ?>
871  <div id='hideSubmitWait' style='position:relative; left:-2000px;top:-2000px;'>
872  <div id='homecuSubmitWait' class='k-block' >
873  <div class='k-loading-image'></div>
874  </div>
875  </div>
876  <div class="container-fluid" id="estmntForm">
877  <div id="estmntErrorDiv"></div>
878  <div class="row hcuSpacer">
879  &nbsp;
880  </div>
881  <div class="row hcuSpacer">
882  <div class="col-xs-12">
883  <div id="globalEstatementGrid" class="hcu-no-td-border"></div>
884  </div>
885  </div>
886  </div>
887  <?php
888  printMonitorPageBottom();
889  }