Odyssey
hcuSecureMail.prg
1 <?php
2  /*
3  * File: hcuSecureMail
4  *
5  * Purpose: Allows messages to be sent between member and Credit Union admin. This is the member side.
6  *
7  */
8 
9 
10  // ** SET SCRIPT LEVEL VARIABLES
11  $serviceShowInfo = true;
12  $serviceLoadMenu = true;
13  $serviceShowMenu = true;
14 
15  // ** INCLUDE MAIN GLOBAL SCRIPT -- Handles security / global variable values
16  require_once(dirname(__FILE__) . '/../library/hcuService.i');
17 
18  /*
19  * ** CHECK USER FEATURE PERMISSIONS **
20  * NOTE: DOES NOT RETURN ON FAILURE
21  */
22  PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_SECURE_MSG);
23 
24 
25  // ** INSERT BUSINESS LOGIC FOR THIS FORM
26  $Cu = $HB_ENV["Cu"];
27  $Cn = $HB_ENV["Cn"];
28  $chome = $HB_ENV["chome"];
29  $Flang = $HB_ENV["Flang"];
30 
31  // ** SET VARIABLES FOR WEBSITE FLAGS
32 
33  // ** INCLUDE PRE CONTENT SCRIPT
34  require_once(dirname(__FILE__) . '/../includes/hcuPreContent.i');
35 
36  /********* functions ************/
37 
38  /********* end functions ********/
39  // make sure the feature is allowed
40  if ( ($HB_ENV['Fset2'] & GetFlagsetValue("CU2_ALLOWMESSAGE")) != GetFlagsetValue("CU2_ALLOWMESSAGE") ) {
41  // not allowed
42  $serviceErrorTitle = $MC->msg("Feature Unavailable", HCU_DISPLAY_AS_HTML);
43  $serviceErrorMsg = $MC->msg('Feature Not Set', HCU_DISPLAY_AS_HTML) . ". " . $MC->msg('Contact CU', HCU_DISPLAY_AS_HTML);
44 
45  $serviceErrorCode = 915;
46  require(dirname(__FILE__) . "/../includes/hcuErrorPage.i");
47  exit;
48  }
49 
50  /*
51  * List the headers for use by the grid (with necessary translation).
52  *
53  */
54  $gridHeaders = array( $MC->msg('Topic', HCU_DISPLAY_AS_RAW), $MC->msg('Date', HCU_DISPLAY_AS_RAW) );
55 
56 ?>
57 <style>
58  .k-grid td {
59  border-width: 0;
60  }
61 
62 </style>
63  <br>
64  <div class="container-fluid">
65  <h2><?php echo $MC->msg('Secure Messages', HCU_DISPLAY_AS_HTML) ?></h2>
66  <div id="hcuTableMessages"></div>
67  <div id="messageWindow" name="messageWindow"></div>
68  <div id="alertWindow" name="alertWindow"></div>
69  </div>
70 
71  <script>
72  var hcuGridHeaders = <?php echo HCU_JsonEncode($gridHeaders); ?>;
73  var currShow = "";
74 
75  $(document).ready(function(){
76  var openWindow = [];
77 
78  var dsMessages = new kendo.data.DataSource({
79  autoSync: false,
80  batch: false,
81  transport: {
82  create: {
83  url: "hcuSecureMail.data?cu=<?php echo $HB_ENV['cu']; ?>",
84  contentType: "application/x-www-form-urlencoded",
85  data: {
86  action: "create"
87  },
88  type: "POST",
89  cache: false
90  },
91  read: {
92  url: "hcuSecureMail.data?cu=<?php echo $HB_ENV['cu']; ?>",
93  dataType: "json",
94  contentType: "application/x-www-form-urlencoded",
95  data: {
96  action: "read_messages",
97  show: "",
98  what: ""
99  },
100  type: "POST",
101  cache: false
102  },
103  update: {
104  url: "hcuSecureMail.data?cu=<?php echo $HB_ENV['cu']; ?>",
105  contentType: "application/x-www-form-urlencoded",
106  data: {
107  action: "update"
108  },
109  type: "POST",
110  cache: false
111  },
112  destroy: {
113  url: "hcuSecureMail.data?cu=<?php echo $HB_ENV['cu']; ?>",
114  contentType: "application/x-www-form-urlencoded",
115  data: {
116  action: "destroy"
117  },
118  type: "POST",
119  cache: false
120  }
121  },
122  requestStart: function( e ) {
123  ShowWaitWindow();
124  },
125  requestEnd: function( e ) {
126  CloseWaitWindow();
127  var error = null;
128  // see if there is an error
129  if ( e.response && e.response.homecuErrors )
130  error = e.response.homecuErrors;
131 
132  if ( error && error.length > 0 ) {
133  e.preventDefault();
134  // make sure only old data
135  dsMessages.cancelChanges();
136  // show the error information
137  $.homecuValidator.displayMessage(error, $.homecuValidator.settings.statusError);
138  }
139  else {
140  if ( wnd ) {
141  wnd.close();
142  wnd = null;
143  }
144  }
145  },
146 
147  // code to run if the request fails; the raw request and
148  // status codes are passed to the function
149  error: function( e ) {
150  if ( e.errors ) {
151  this.cancelChanges();
152  }
153  },
154  schema: {
155  model: {
156  fields: {
157  threadId: {type: "number"},
158  newPic: {type: "string"},
159  subject: {type: "string"},
160  date: {type: "string"}
161  }
162  },
163  parse: function(response) {
164  var display = [];
165  if ( response.homecuData ) {
166  for (var i = 0; i < response.homecuData.length; i++) {
167  display.push(response.homecuData[i]);
168  }
169 
170  $("#hcuTableMessages").data("kendoGrid").dataSource.data(display);
171  }
172  return display;
173  },
174  errors: "homecuError"
175  }
176  });
177 
178  // for reading a thread of messages
179  var dsThread = new kendo.data.DataSource({
180  transport: {
181  read: {
182  url: "hcuSecureMail.data?cu=<?php echo $HB_ENV['cu']; ?>",
183  dataType: "json",
184  contentType: "application/json",
185  data: {
186  action: "read_thread",
187  parentid: 0 // filled in before request
188  },
189  type: "GET",
190  cache: false
191  }
192  },
193  schema: {
194  parse: function(response) {
195  var display = [];
196  if ( response.homecuData ) {
197  for (var i = 0; i < response.homecuData.length; i++) {
198  display.push(response.homecuData[i]);
199  }
200  }
201  return display;
202  },
203  },
204  requestEnd: function( e ) {
205  var error = null;
206  // see if there is an error
207  if ( e.response && e.response.error )
208  error = e.response.error;
209 
210  if ( error && error.length > 0 ) {
211  e.preventDefault();
212  // make sure only old data
213  this.cancelChanges();
214  // show the error information
215  $.homecuValidator.displayMessage(error, $.homecuValidator.settings.statusError);
216  } else {
217  if ( e.response && e.response.homecuData ) {
218  // show the data
219  var threadList = e.response.homecuData;
220  var orig;
221  var className;
222  for ( var i = 0; i < threadList.length; i++ ) {
223  // start a new message
224  var builtMessage = "";
225 
226  if ( threadList[i].origination == 0 ) {
227  className = "k-info-colored threadCU";
228  orig = "<?php echo $MC->msg('CU Said', HCU_DISPLAY_AS_JS) ?>";
229  } else {
230  className = "k-success-colored threadMember";
231  orig = "<?php echo $MC->msg('User', HCU_DISPLAY_AS_JS) ?>";
232  }
233 
234  builtMessage += "<div class='k-block k-shadow " + className + "' style='margin-top:5px;'>";
235  builtMessage += "<span style='display:block; float:left; width:50%; text-align:left; font-weight:bold;'>" + orig + "</span>";
236  builtMessage += "<span style='display:block; float:right; width:50%; text-align:right; font-size:x-small;'>" + threadList[i].date + "</span>";
237  builtMessage += "<br />" + threadList[i].message;
238  builtMessage += "</div>";
239  $("#showThread").append(builtMessage);
240  }
241 
242  // now put an element to scroll to
243  $("#showThread").append( "<span id='bottomOfScroll' />" );
244 
245  // and scroll to it after it is in the dom
246  window.setTimeout( scrollThread, 100 ); // 100 milliseconds
247 
248  // notify the apps that a message was read
249  var appInfo = JSON.stringify( { status: true } );
250 
251  <?php if ( $HB_ENV["platform"] == "ADA" ) : ?>
252  AndroidController.notifyCommand("READ_MESSAGE", appInfo);
253  <?php elseif ( $HB_ENV["platform"] == "APP" ) : ?>
254  var postObject = {
255  body: {
256  cmd: "READ_MESSAGE",
257  params: appInfo
258  }
259  };
260  window.webkit.messageHandlers.interOp.postMessage(postObject);
261  <?php endif ?>
262 
263  <?php if ( $HB_ENV["platform"] == "ADA" ) : ?>
264  AndroidController.notifyCommand("READ_MESSAGE", appInfo);
265  <?php elseif ( $HB_ENV["platform"] == "APP" ) : ?>
266  var postObject = {
267  body: {
268  cmd: "READ_MESSAGE",
269  params: appInfo
270  }
271  };
272  window.webkit.messageHandlers.interOp.postMessage(postObject);
273  <?php endif ?>
274 
275  }
276  }
277  },
278  });
279 
280  function scrollThread( ) {
281  var show = $("#showThread").height();
282  var test = $('#showThread').prop('scrollHeight');
283  $("#showThread").animate({ scrollTop: test }, { duration: 2000 } );
284  }
285 
286  $('#hcuTableMessages').kendoGrid({
287  dataSource: [],
288  sortable: {
289  mode: "single",
290  allowUnsort: false
291  },
292  toolbar: [{ template: kendo.template($("#gridToolbarTemplate").html()) }],
293  columns: [
294  { field: "origination",
295  title: "&nbsp;",
296  width: 50,
297  template: function( dataItem ) {
298  // bold if unread
299  var columnValue = "";
300 
301  if ( dataItem.origination === "1" ) {
302  columnValue += "<span class=\"fa fa-arrow-left directionOut\"></span>";
303  } else {
304  columnValue += "<span class=\"fa fa-arrow-right directionIn\"></span>";
305  }
306 
307  return columnValue;
308  }
309  },
310  { field: "date",
311  title: "<?php echo $MC->msg('Date', HCU_DISPLAY_AS_JS) ?>",
312  width: 150,
313  template: function( dataItem ) {
314  // bold if unread
315  var columnValue = "";
316 
317  if ( dataItem.unread ) {
318  columnValue += "<div style='font-weight:bold;'>";
319  }
320  columnValue += dataItem.date;
321 
322  if ( dataItem.unread ) {
323  columnValue += "</div>";
324  }
325 
326  return columnValue;
327  }
328  },
329  { field: "subject",
330  title: "<?php echo $MC->msg('Topic', HCU_DISPLAY_AS_JS) ?>",
331  template: function( dataItem ) {
332  // bold if unread
333  var columnValue = "";
334 
335  if ( dataItem.unread ) {
336  columnValue += "<div style='font-weight:bold;'>";
337  }
338  columnValue += dataItem.subject;
339 
340  if ( dataItem.unread ) {
341  columnValue += "</div>";
342  }
343 
344  return columnValue;
345  }
346  }
347  ],
348  selectable: "row",
349  change: function(e) {
350  var selectedRow = this.dataItem(this.select());
351 
352  // mark it read
353  selectedRow.unread = 0;
354 
355  // start the read
356  StartMessage( selectedRow.threadId, selectedRow.subject );
357 
358  var grid = $("#hcuTableMessages").data("kendoGrid");
359  grid.refresh();
360  },
361  dataBound: function(e) {
362  $("#hcuTableMessages").find("tbody tr").each(function(i) {
363  $(this).removeClass("k-alt");
364  $(this).css("cursor", "pointer");
365  });
366  }
367  });
368 
369  // keep these "global" so can reference them elsewhere
370  var wnd;
371 
372  // Show the requested data
373  // In box
374  $('#inBox').click( function() {
375  $('#inBox').addClass("k-state-focused");
376  $("#outBox").removeClass("k-state-focused");
377  $("#unread").removeClass("k-state-focused");
378  currShow = "IN";
379  // clear out the find
380  $("#findText").val("");
381  var request = { show: currShow };
382  dsMessages.read( request );
383  });
384 
385  // Out box
386  $('#outBox').click( function() {
387  $('#outBox').addClass("k-state-focused");
388  $("#inBox").removeClass("k-state-focused");
389  $("#unread").removeClass("k-state-focused");
390  currShow = "OUT";
391  // clear out the find
392  $("#findText").val("");
393  var request = { show: currShow };
394  dsMessages.read( request );
395  });
396 
397  // search in current box
398  $('#findTopic').click( function() {
399  var request = { what: $('#findText').val(), show: currShow };
400  dsMessages.read( request );
401  });
402 
403  // create a new message
404  $('#createNew').click( function() {
405  StartMessage( 0, "" );
406  });
407 
408  // toggle search fields
409  $("#showFind").on("click", function() {
410  $(".optionsFind").toggle();
411  });
412 
413  var messageTemplate = kendo.template($("#messageTemplate").html());
414 
415  // set up a view model for viewing the thread and/or starting a message
416  var currMessage = kendo.observable({
417  // common
418  threadId: 0,
419  subject: "",
420  message: "",
421  // save the current view attributes
422  show: currShow,
423  what: $('#findText').val(),
424  order: function () {
425  var grid = $("#hcuTableMessages").data("kendoGrid");
426  // Get the datasource bound to the grid
427  var ds = grid.dataSource;
428  // Get current sorting
429  var sort = ds.sort();
430 
431  var sortVal = "";
432  if ( sort ) {
433  if ( sort[0].field === "date" ) {
434  sortVal = "d";
435  } else {
436  sortVal = "t";
437  }
438 
439  if ( sort[0].dir === "desc" )
440  sortVal = sortVal.toUpperCase();
441  }
442 
443  return sortVal;
444  },
445  messageSend: function(e) {
446  var request;
447 
448  if ( $.homecuValidator.validate() ) {
449  request = { action: "send_message", parentid: this.threadId, subject: this.subject,
450  message: this.message, show: this.show, what: this.what, order: this.order };
451 
452  dsMessages.transport.read.type = "POST";
453  dsMessages.read( request );
454  }
455  },
456  closeThis: function(e) {
457  wnd.close();
458  },
459  confirmDelete: function(e) {
460  StartDelete( this.threadId );
461  }
462  });
463  // set up a view model for handling a delete confirmation
464  var deleteConfirm = kendo.observable({
465  threadId: 0,
466  // save the current view attributes
467  show: currShow,
468  what: $('#findText').val(),
469  order: function () {
470  var grid = $("#hcuTableMessages").data("kendoGrid");
471  // Get the datasource bound to the grid
472  var ds = grid.dataSource;
473  // Get current sorting
474  var sort = ds.sort();
475 
476  var sortVal = "";
477  if ( sort ) {
478  if ( sort[0].field === "date" ) {
479  sortVal = "d";
480  } else {
481  sortVal = "t";
482  }
483 
484  if ( sort[0].dir === "desc" )
485  sortVal = sortVal.toUpperCase();
486  }
487 
488  return sortVal;
489  },
490  deleteConfirm: function(e) {
491  var request;
492 
493  request = { action: "delete_message", parentid: this.threadId,
494  show: this.show, what: this.what, order: this.order };
495 
496  dsMessages.transport.type = "POST";
497  dsMessages.read( request );
498 
499  }
500  });
501 
502 
503  function StartMessage( threadId, subject ) {
504  var messageType;
505  if ( threadId > 0 ) {
506  messageType = "read";
507 
508  // make sure a reply starts with "Re:"
509  var re = "<?php echo $MC->msg('Re', HCU_DISPLAY_AS_JS) ?>";
510  var test = subject.substr( 0, re.length );
511  if ( test != re ) {
512  subject = re + ": " + subject;
513  }
514  } else {
515  messageType = "new";
516  }
517 
518  currMessage.threadId = threadId;
519  currMessage.subject = subject;
520  currMessage.message = "";
521 
522  wnd = $('#messageWindow').kendoWindow({
523  modal: true,
524  iframe: false,
525  visible: false,
526  width:"85%",
527  maxWidth:700,
528  animation: {
529  open: {
530  effects: "fadeIn",
531  duration: 500
532  },
533  close: {
534  effects: "fadeOut",
535  duration: 500
536  }
537  },
538  activate: function(e) {
539  // bind the Model View
540  kendo.bind($("#messageDisplay"), currMessage);
541 
542  // set up some validation
543  $.homecuValidator.setup({formValidate: "formSubmitMsg", validateOnClick: "sendMsg",
544  formErrorTitle: "<?php echo $MC->msg("Error Occurred", HCU_DISPLAY_AS_JS) ?>",
545  formStatusField: "secureMsgErrors"});
546 
547 
548  if ( currMessage.threadId > 0 ) {
549  // get the messages for this thread
550  var request = { action: "read_thread", parentid: currMessage.threadId };
551  dsThread.read( request );
552  }
553  onResize();
554 
555  // save the window reference
556  var latestWindow = $("#messageWindow").data("kendoWindow");
557  openWindow.push( latestWindow );
558  },
559  close: function(e) {
560  // just remove the latest
561  openWindow.pop();
562  }
563  }).data('kendoWindow');
564 
565 
566  var title;
567  if ( threadId === 0 )
568  title = "<?php echo $MC->msg("Create New Message", HCU_DISPLAY_AS_JS) ?>";
569  else
570  title = "<?php echo $MC->msg("User Messages", HCU_DISPLAY_AS_JS) ?>";
571 
572  wnd.content( messageTemplate( { messageType: messageType } ) );
573 
574  wnd.setOptions({title: title});
575 
576  wnd.center().open().toFront();
577 
578  }
579 
580  function onResize(e) {
581  var height = $('#messageWindow').height();
582  };
583 
584 
585  function StartDelete( threadId ) {
586  deleteConfirm.threadId = threadId;
587 
588  var wndDelete= $("#alertWindow").data("kendoDialog");
589  if (wndDelete == null)
590  {
591  wndDelete = $('#alertWindow').kendoDialog({
592  modal: true,
593  visible: false,
594  title: "<?php echo $MC->msg('Confirmation', HCU_DISPLAY_AS_JS) ?>",
595  content: "<p><?php echo $MC->msg('Delete All Messages', HCU_DISPLAY_AS_JS) ?></p><p><?php echo $MC->msg("ACH Continue", HCU_DISPLAY_AS_JS) ?></p>",
596  open: function(e) {
597  // save the window reference
598  var latestWindow = $("#alertWindow").data("kendoDialog");
599  openWindow.push( latestWindow );
600  },
601  close: function(e) {
602  // just remove the latest
603  openWindow.pop();
604  },
605  actions: [
606  {text: "<?php echo $MC->msg("Yes", HCU_DISPLAY_AS_JS); ?>", primary: true, action: function() { deleteConfirm.deleteConfirm(); }},
607  {text: "<?php echo $MC->msg("No", HCU_DISPLAY_AS_JS); ?>"}
608  ]
609  }).data('kendoDialog');
610  }
611  wndDelete.open();
612  }
613 
614  $(document).on("click", ".k-overlay", function () {
615  // close the currently open window
616  if ( openWindow.length > 0 ) {
617  openWindow[openWindow.length-1].close();
618  }
619  });
620 
621  // on document ready, check window size, hide find fields if small
622  if ($(window).width() > 767) {
623  $(".optionsFind").show();
624  $(".optionsAdd #showFind").hide();
625  } else {
626  $(".optionsFind").hide();
627  $(".optionsAdd #showFind").show();
628  }
629 
630  // on window resize, deal with visibility of find fields
631  var windowLastSize = $(window).width();
632  $(window).resize(function(e) {
633  var windowSize = $(window).width();
634  if (windowSize > 767) {
635  $(".optionsFind").show();
636  $(".optionsAdd #showFind").hide();
637  } else {
638  if ($(".optionsFind").is(":visible")) {
639  if (windowLastSize >= 768) {
640  $(".optionsFind").hide();
641  } else {
642  $(".optionsFind").show();
643  }
644  }
645  $(".optionsAdd #showFind").show();
646  }
647  windowLastSize = windowSize;
648  });
649 
650  var height = screen.height - 200;
651  $("#hcuTableMessages .k-grid-content").css({maxHeight: height});
652  dsMessages.read();
653  });
654 
655  </script>
656 
657  <style type="text/css">
658  .threadCU
659  {
660  width: 80%;
661  float: left;
662  }
663 
664  .threadMember
665  {
666  width: 80%;
667  float: right;
668  }
669 
670  .row {
671  margin: 10px 0 0 0;
672  }
673 
674  .k-grid tr td {
675  border-right: 0;
676  border-left: 0;
677  }
678 
679  .optionsAdd,
680  .optionsFind {
681  padding-top: 5px;
682  padding-bottom: 5px;
683  display: inline-block;
684  }
685 
686  .directionIn {
687  color: #507f50;
688  }
689 
690  .directionOut {
691  color: #50607f;
692  }
693  </style>
694  <script type="text/x-kendo-template" id="gridToolbarTemplate">
695  <div class="optionsAdd">
696  <a class="k-button" href="\#" id="createNew">
697  <span class="fa fa-plus btn-icon-custom btn-icon-custom"></span>
698  <span>&nbsp;<?php echo $MC->msg('Add Message', HCU_DISPLAY_AS_JS) ?></span>
699  </a>
700 
701  <a class="optionsShowFind k-button" href="\#" id="showFind">
702  <span class="fa fa-search btn-icon-custom"></span>
703  </a>
704  </div>
705  <div class="optionsFind">
706  <span><?php echo $MC->msg('Find', HCU_DISPLAY_AS_JS) . " " . $MC->msg('Topic', HCU_DISPLAY_AS_JS) ?>:</span><br>
707  <input type="text" id="findText" class="k-textbox" value="" />
708  <a class="k-button" href="\#" id="findTopic">
709  <span class="fa fa-search btn-icon-custom"></span>
710  <span><?php echo $MC->msg('Find', HCU_DISPLAY_AS_JS) . " " . $MC->msg('Topic', HCU_DISPLAY_AS_JS) ?></span>
711  </a>
712  </div>
713  <!--<div id="options">
714  <ul>
715  <li>
716  <div class="k-block" style="border:0;">
717  <br />
718  <a class="k-button" href="\#" id="createNew"><span class="fa fa-plus btn-icon-custom btn-icon-custom"></span>&nbsp;<?php echo $MC->msg('Add Message', HCU_DISPLAY_AS_JS) ?></a>
719  </div>
720  </li>
721  <li class="small-find">
722  <div class="k-block" style="border:0;">
723  <br />
724  <a class="k-button" href="\#" id="showFind"><span class="fa fa-search btn-icon-custom"></span></a>
725  </div
726  </li>
727  <li class="big-find">
728  <div class="k-block">
729  <?php echo $MC->msg('Find', HCU_DISPLAY_AS_JS) . " " . $MC->msg('Topic', HCU_DISPLAY_AS_JS) ?>:<br />
730  <input type="text" id="findText" class="k-textbox" value="" />
731  <a class="k-button" href="\#" id="findTopic"><span class="fa fa-search btn-icon-custom"></span> <?php echo $MC->msg('Find', HCU_DISPLAY_AS_JS) . " " . $MC->msg('Topic', HCU_DISPLAY_AS_JS) ?></a>
732  </div>
733  </li>
734  </ul>
735  </div>-->
736  <span id="displayStatus"></span>
737  </script>
738  <script type="text/x-kendo-template" id="messageTemplate">
739  <div class="container-fluid hcu-template">
740  <div id="messageDisplay">
741  <div id="secureMsgErrors" class="homecu-formStatus k-block k-error-colored" style="display: none;"></div>
742  <div class="row" style="height:100%">
743  <div class="col-xs-12 nopadding" style="height:100%;">
744  <div id="panes" style="height:100%; border:0;">
745  <div id="topPane">
746  # if ( messageType === "read" ) { #
747  <div id="showThread" />
748  # } else { #
749  <div style="text-align:center;"><?php echo $MC->msg("Create New Message", HCU_DISPLAY_AS_JS); ?></div>
750  # } #
751  </div>
752  <div id="middlePane" class="well well-sm">
753  <form id="formSubmitMsg" style="width:100%">
754  <div class="row" style="width:100%;">
755  <label for="msgTopic" class="control-label col-xs-12 col-sm-2 nopadding"><?php echo $MC->msg('Topic', HCU_DISPLAY_AS_JS); ?></label>
756  <div class="col-xs-12 col-sm-10 nopadding">
757  <input type="text" id="msgTopic" name="msgTopic" class="k-textbox" #if ( messageType == "read" ) {#readonly#}# data-bind="value: subject" style="width:100%;" placeholder="<?php echo $MC->msg("Topic", HCU_DISPLAY_AS_JS) ?>" required data-required-msg="<?php echo $MC->msg('Message subject cannot be blank', HCU_DISPLAY_AS_JS) ?>" />
758  <span class="k-invalid-msg" data-for="msgTopic"></span>
759  </div>
760  </div>
761  <div class="row" style="width:100%;">
762  <label for="msgMessage" class="control-label col-xs-12 col-sm-2 nopadding"><?php echo $MC->msg('Message', HCU_DISPLAY_AS_JS) ?></label>
763  <div class="col-xs-12 col-sm-10 nopadding">
764  <textarea class="k-textbox" id='msgMessage' name="msgMessage" rows='9' cols='75' wrap='physical'
765  style='width:100%; height:100%; padding:3px;'
766  placeholder="<?php echo $MC->msg('Message', HCU_DISPLAY_AS_JS) ?>"
767  data-bind="value: message"
768  required data-required-msg="<?php echo $MC->msg('Message body cannot be blank', HCU_DISPLAY_AS_JS) ?>" ></textarea>
769  <span class="k-invalid-msg" data-for="msgMessage"></span>
770  </div>
771  </div>
772  </form>
773  </div>
774 
775  <?php $send= $MC->msg("Send", HCU_DISPLAY_AS_JS); $cancel= $MC->msg("Cancel", HCU_DISPLAY_AS_JS); ?>
776 
777  <div id="bottomPane">
778  <div class="hcu-edit-buttons k-state-default row">
779  # if (messageType == "read") { #
780  <span class="hcu-icon-delete">
781  <a class="deleteBtn" data-bind="events:{ click: confirmDelete }"><i class="fa fa-trash-o fa-lg"></i></a>
782  </span>
783  # } #
784  <a class="cancelBtn" data-bind="events:{ click: closeThis }"><?php echo $cancel; ?></a>
785  &nbsp;&nbsp;&nbsp;
786  <a id="sendMsg" class="sendBtn k-button k-primary" data-bind="events:{ click: messageSend }"><i class="fa fa-check"></i><?php echo $send; ?></a>
787  </div>
788  </div>
789 
790  </div>
791  </div>
792  </div>
793  </div>
794  </div>
795  </script>
796 <?php
797  /*
798  * ** END CONTENT
799  */
800 
801 
802  // ** INCLUDE POST CONTENT SCRIPT
803  require_once(dirname(__FILE__) . '/../includes/hcuPostContent.i');
804 
805 ?>
Definition: User.php:7