10 $serviceShowInfo =
true;
11 $serviceLoadMenu =
true;
12 $serviceShowMenu =
true;
15 require_once(dirname(__FILE__) .
'/../library/hcuService.i');
21 PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_BASIC);
29 require_once(dirname(__FILE__) .
'/../includes/hcuPreContent.i');
37 $live = $HB_ENV[
"live"];
39 # get the frag if there is one 43 $noticesAry = Get_NoticeInfo($dbh, $HB_ENV, $MC,
'D',
'profileDescNotice');
44 if ( $noticesAry[
"status"][
"code"] ==
"000" && HCU_array_key_exists(
'0', $noticesAry[
'notice'])) {
45 if ( $noticesAry[
'notice'][0][
'notice_text'] ) {
46 $settingsText = $noticesAry[
'notice'][0][
'notice_text'];
50 if ($settingsText ==
"") {
51 $settingsText = $MC->msg(
'Account Names Change', HCU_DISPLAY_AS_HTML);
54 <script type=
"text/javascript">
56 $(document).ready(
function() {
59 var FIRST_LOAD =
true;
68 var hcuWindow_help =
null;
71 var hcuGridDesktop_deposit =
null;
72 var hcuGridMobile_deposit =
null;
74 var hcuGridDesktop_loan =
null;
75 var hcuGridMobile_loan =
null;
77 var hcuGridDesktop_credit =
null;
78 var hcuGridMobile_credit =
null;
80 var hcuShowReset =
false;
81 var hcuResetConfirm =
null;
82 var hcuWindowStack = [];
85 $(
".hcuProfileDescDiv").on(
"click",
".accountClearBtn",
function() {
86 $(
this).closest(
".input-group").find(
"[name='accountName']").val(
null);
91 var hcuDataSource_read =
new kendo.data.DataSource({
96 url:
"hcuProfile.data?cu=<?php echo $HB_ENV["cu
"] ?>",
98 contentType:
"application/x-www-form-urlencoded",
101 action:
"acct_desc_read" 106 url:
"hcuProfile.data?cu=<?php echo $HB_ENV["cu
"] ?>",
108 contentType:
"application/x-www-form-urlencoded",
111 action:
"acct_desc_update" 117 model: { id:
"displayorder" },
118 parse:
function(response) {
123 if (response.hasOwnProperty(
'homecuErrors')) {
124 error = response.homecuErrors;
127 if (error && error.length > 0) {
128 $.homecuValidator.displayMessage(error, $.homecuValidator.settings.statusError);
131 }
else if (response.hasOwnProperty(
"homecuInfo")) {
132 ShowStatus(response.homecuInfo[0]);
136 success = response.homecuData;
142 data_dp = success.dp;
143 data_ln = success.ln;
144 data_cc = success.cc;
152 data_fl = data_fl.concat(data_dp);
153 data_fl = data_fl.concat(data_ln);
154 data_fl = data_fl.concat(data_cc);
157 hcuShowReset = canResetOrder(data_fl);
160 var
template= kendo.template($(
"#sortableTemplate").html());
161 $(
"#hcuSortableMobileDeposit").html(
template({theData: data_dp}));
162 $(
"#hcuSortableMobileLoan").html(
template({theData: data_ln}));
163 $(
"#hcuSortableMobileCredit").html(
template({theData: data_cc}));
175 $(
"#lnkCancel").show();
177 $(
"#lnkCancel").hide();
196 function buildSortable(key) {
197 var
template= kendo.template($(
"#sortableTemplate").html());
201 var selector= $(
"#hcuSortableMobileDeposit");
205 var selector= $(
"#hcuSortableMobileLoan");
209 var selector= $(
"#hcuSortableMobileCredit");
214 if (data.length == 0)
215 $(selector).closest(
".hcu-container-margin").remove();
218 $(selector).empty().html(
template({theData: data}));
221 $(selector).addClass(
"sortableArea").kendoSortable({
222 hint:
function(element) {
223 return $(element).clone().addClass(
"hintDiv").text($(element).find(
".hint").text().trim());
225 placeholder:
function(element) {
226 return $(element).clone().addClass(
"placeholderDiv k-info-colored").text(
'<?php echo $MC->msg("Drop Here", HCU_DISPLAY_AS_JS); ?>');
228 container: $(selector).closest(
".hcu-container-margin"),
231 handler:
".handler *,.handler",
233 change:
function(e) {
235 $(
"#lnkCancel").show();
237 }).data(
"kendoSortable");
242 function canResetOrder(data) {
243 for (var i = 0; i < data.length; i++) {
244 var cur_obj = data[i];
245 var cur_order = parseInt(cur_obj.displayorder);
257 function preOrder(ary_data, ary_type) {
260 for ( var i = 0; i < ary_data.length; i++) {
261 ary_data[i][
'grid'] = ary_type;
265 for (var i = 0; i < ary_data.length; i++) {
267 var cur_obj = ary_data[i];
268 var cur_order = parseInt(cur_obj.displayorder);
271 if (cur_order > 0) { hcuShowReset =
true; }
274 if (cur_order != i) {
275 var find_order = preOrderFind(ary_data, i);
277 if(find_order.length > 0) {
278 var find_index = find_order[0];
279 var find_obj = ary_data[find_index];
282 ary_data[i] = find_obj;
283 ary_data[find_index] = cur_obj;
285 cur_obj.displayorder = i;
291 function preOrderFind(ary_data, ary_order) {
294 for (var i = 0; i < ary_data.length; i++) {
295 var order = ary_data[i].displayorder;
298 ary_data[i].displayorder = parseInt(order);
300 if (order == ary_order) {
309 function ShowStatus( statusMessage ) {
310 $.homecuValidator.settings.formStatusField =
"formStatus";
311 $.homecuValidator.settings.formInfoTitle =
"";
312 $.homecuValidator.displayMessage(statusMessage);
315 function ClearStatus( ) {
316 $.homecuValidator.settings.formStatusField =
"formStatus";
317 $.homecuValidator.settings.formInfoTitle =
"";
318 $.homecuValidator.displayMessage(
null);
321 function ResetDisplayOrder() {
322 var accountData = [];
323 for(var i=0; i!= data_dp.length; i++)
325 accountData.push({displayname: data_dp[i].displayname, displayorder: 0, encryption: data_dp[i].encryption});
327 for(var i=0; i!= data_ln.length; i++)
329 accountData.push({displayname: data_ln[i].displayname, displayorder: 0, encryption: data_ln[i].encryption});
331 for(var i=0; i!= data_cc.length; i++)
333 accountData.push({displayname: data_cc[i].displayname, displayorder: 0, encryption: data_cc[i].encryption});
338 hcuDataSource_read.transport.options.update.data = {
339 action:
"acct_desc_update",
340 account_data: accountData
342 hcuDataSource_read.data()[0].dirty =
true;
343 hcuDataSource_read.sync();
346 setTimeout(
function() {
347 hcuDataSource_read.read();
351 hcuShowReset =
false;
354 $(
"#hcuResetConfirm").kendoDialog({
359 hcuWindowStack.push(
this);
362 hcuWindowStack.pop();
365 { text:
"<?php echo $MC->msg("Cancel
", HCU_DISPLAY_AS_JS); ?>",
366 action:
function(e) {}
369 text:
"<?php echo $MC->msg("Continue
", HCU_DISPLAY_AS_JS); ?>", primary:
true,
370 action: ResetDisplayOrder
375 $(
"#btnUpdate").click(
function() {
377 $.homecuValidator.homecuValidate =
true;
381 $(
"#hcuSortableMobileDeposit .sortable").each(
function() {
382 var orgindex= Number($(
this).data(
"orgindex"));
383 accountData.push({displayname: $(
this).find(
"[name='accountName']").val().trim(), displayorder: (hcuShowReset ? newIndex++ : 0), encryption: data_dp[orgindex].encryption});
386 $(
"#hcuSortableMobileLoan .sortable").each(
function() {
387 var orgindex= Number($(
this).data(
"orgindex"));
388 accountData.push({displayname: $(
this).find(
"[name='accountName']").val().trim(), displayorder: (hcuShowReset ? newIndex++ : 0), encryption: data_ln[orgindex].encryption});
391 $(
"#hcuSortableMobileCredit .sortable").each(
function() {
392 var orgindex= Number($(
this).data(
"orgindex"));
393 accountData.push({displayname: $(
this).find(
"[name='accountName']").val().trim(), displayorder: (hcuShowReset ? newIndex++ : 0), encryption: data_cc[orgindex].encryption});
400 accountDesc = Array();
401 for (var i = 0; i < accountData.length; i++) {
402 if (accountData[i].displayname !==
""){
403 accountDesc.push(accountData[i].displayname);
407 if ($.homecuValidator.homecuValidate) {
409 hcuDataSource_read.transport.options.update.data = {action:
"acct_desc_update", account_data: accountData};
410 hcuDataSource_read.data()[0].dirty =
true;
411 hcuDataSource_read.sync();
414 setTimeout(
function() {
415 hcuDataSource_read.read();
427 $(
'#lnkCancel').click(
function() {
428 $(
"#hcuResetConfirm").data(
"kendoDialog").open();
431 $(
'#btnHelp').click(
function(e) {
435 hcuWindow_help = $(
'#hcuWindowHelp').data(
'kendoWindow');
438 if (!hcuWindow_help) {
439 hcuWindow_help = $(
'#hcuWindowHelp').kendoWindow({
445 hcuWindow_help =
null;
446 hcuWindowStack.pop();
448 activate:
function() {
449 hcuWindowStack.push(
this);
451 }).data(
'kendoWindow');
455 var hcuContent_help = $(
'#hcuTemplateHelp').html();
456 var hcuContent_title =
"<?php echo $MC->msg("Help
", HCU_DISPLAY_AS_HTML); ?>";
459 hcuWindow_help.title(hcuContent_title);
460 hcuWindow_help.content(hcuContent_help);
461 hcuWindow_help.center();
462 hcuWindow_help.open();
466 hcuDataSource_read.read();
468 $(document).on(
'click',
'.k-overlay',
function() {
469 if (hcuWindowStack.length > 0) {
470 hcuWindowStack[0].close();
477 <!-- HTML STYLING -->
478 <style type=
"text/css">
486 .k-block > .k-header {
491 html .k-grid tr:hover {
492 background: transparent;
496 border-left: 0 !important;
497 border-right: 0 !important;
500 .hcu-info-margin, .hcu-error-margin {
504 .hcu-info-padding, .hcu-error-padding {
513 .hcu-container-margin {
522 <!-- HTML CONTENT -->
524 <div
class=
"container-fluid hcuProfileDescDiv">
525 <div
class=
"well well-sm col-xs-12">
528 <div
class=
"col-xs-11 col-sm-11 hcu-no-padding">
529 <h3><?php echo $MC->msg(
"Account Names", HCU_DISPLAY_AS_HTML); ?></h3>
533 <div
class=
"col-xs-1 col-sm-1 hcu-no-padding text-center">
534 <a href=
"#" id=
"btnHelp" class=
"hcu-full-width">
535 <span><?php echo $MC->msg(
"Help", HCU_DISPLAY_AS_HTML); ?></span>
541 <div
class=
"col-sm-12 hcu-container-margin">
542 <div><h4><?php echo $MC->msg(
"Deposit Accounts", HCU_DISPLAY_AS_HTML); ?></h4></div>
543 <div
id=
"hcuSortableMobileDeposit"></div>
546 <div
class=
"col-sm-12 hcu-container-margin">
547 <div><h4><?php echo $MC->msg(
"Loan Accounts", HCU_DISPLAY_AS_HTML); ?></h4></div>
548 <div
id=
"hcuSortableMobileLoan"></div>
551 <div
class=
"col-sm-12 hcu-container-margin">
552 <div><h4><?php echo $MC->msg(
"Credit Accounts", HCU_DISPLAY_AS_HTML); ?></h4></div>
553 <div
id=
"hcuSortableMobileCredit"></div>
557 <div
class=
"hcu-template">
558 <div
class=
"hcu-edit-buttons k-state-default">
559 <a href=
"##" id=
"lnkCancel"><?php echo $MC->msg(
"Reset Display Order", HCU_DISPLAY_AS_HTML); ?></a>
561 <a href=
"##" id=
"btnUpdate" class=
"k-button k-primary">
562 <i
class=
"fa fa-check fa-lg"></i><?php echo $MC->msg(
"Update", HCU_DISPLAY_AS_HTML); ?>
569 <div
id=
"hcuWindowHelp"></div>
571 <div
id=
"hcuResetConfirm">
572 <p><strong><?php echo $MC->msg(
"Reset Confirm", HCU_DISPLAY_AS_HTML); ?></strong></p>
573 <p><?php echo $MC->msg(
"wish to continue", HCU_DISPLAY_AS_HTML); ?></p>
576 <!-- MOBILE TEMPLATES -->
577 <script type=
"text/x-kendo-template" id=
"sortableTemplate">
578 # var length= theData.length; for(var i=0; i!= length; i++) { var row= theData[i]; # 579 <div
class=
"col-xs-12 sortable" data-orgindex=
"#: i #">
580 <div style=
"padding-top: 5px;"><span style=
'font-size: 10pt;' class=
"hint">#= row.title #</span></div>
581 <div
class=
"input-group">
582 # if (length > 1) { # 583 <div
class=
"input-group-addon handler"><span
class=
'fa fa-arrows-v'></span></div>
585 <input type=
'text' name=
'accountName' class=
'k-textbox hcu-full-width form-control' style=
'font-size: 9pt;' value=
'#: row.displayname #' maxlength=
"255" 586 placeholder=
"#= row.placeholder #">
587 <div
class=
"accountClearBtn input-group-addon">
588 <span
class=
'fa fa-times' aria-hidden=
'true'></span>
595 <!-- TEMPLATE: HELP WINDOW -->
596 <script type=
"text/x-kendo-template" id=
"hcuTemplateHelp">
598 <div
class=
"well k-info-colored">
599 <span><strong><?php echo $MC->msg(
"Account Names", HCU_DISPLAY_AS_HTML); ?>:</strong></span>
601 <span><?php echo $settingsText; ?></span>
603 <span><?php echo $MC->msg(
"Account Names Reset", HCU_DISPLAY_AS_HTML); ?></span>
605 <span><strong><?php echo $MC->msg(
"Display Order", HCU_DISPLAY_AS_HTML); ?>:</strong></span>
607 <span><?php echo $MC->msg(
"Display Order Change", HCU_DISPLAY_AS_HTML); ?></span>
610 <span><?php echo $MC->msg(
"Display Order Reset", HCU_DISPLAY_AS_HTML); ?></span>
620 require_once(dirname(__FILE__) .
'/../includes/hcuPostContent.i');