1 <script type=
"text/javascript">
5 getShowWaitFunctions(); ?>
11 function InitDashboard() {
12 $(
"body").addClass(
"dashboardBody");
14 $.homecuValidator.setup({formValidate:
"dashboardForm", formStatusField:
"dashboardFormStatus"});
15 var grid = $(
"#dashboardGrid").kendoGrid({
19 url:
"index.prg?operation=readDashboard",
23 parameterMap:
function(data, type) {
32 sortingId: {type:
"number"},
33 templateId: {type:
"number"},
34 textDescription: {type:
"string"},
35 statusLabel: {type:
"string"},
36 billHalf: {type:
"boolean"},
37 initialCosts: {type:
"string"},
38 recurringCosts: {type:
"string"},
40 cuName: {type:
"string"},
41 salesItemDescr: {type:
"string"},
42 orderId: {type:
"number"}
45 parse:
function (data) {
47 if (data.status !==
"000") {
48 $.homecuValidator.displayMessage(data.error, $.homecuValidator.settings.statusError );
56 sort: {field:
"sortingId", dir:
"asc"}
60 {title:
"Split", width:
"75px"},
61 {title:
"Status", width:
"20%"},
62 {title:
"Initial Costs", width:
"20%"},
63 {title:
"recurring Costs", width:
"20%"},
64 {field:
"cu", hidden:
true}
66 rowTemplate: kendo.template($(
"#rowTemplate").html()),
67 altRowTemplate: kendo.template($(
"#altRowTemplate").html()),
68 dataBound:
function (e) {
69 $(
"#dashboardGrid .k-grid-header").
remove();
71 $(
"#dashboardGrid .k-grouping-row").each(
function () {
72 $(
this).find(
"td").html($(
this).next().find(
".tempGroupLine").html());
73 $(
this).hover(
function () {
74 $(
this).toggleClass(
"k-state-hover");
76 $(
this).after($(
"#headerRowTemplate").html());
77 $(
this).prev().find(
"td:not(.spacerTd)").css({borderBottom:
"1px solid black"});
78 $(
this).next().find(
"td:not(.spacerTd)").css({borderTop:
"1px solid black"});
81 $(
"#dashboardGrid .tempGroupLine").
remove();
87 function OnMouseEnter(td) {
88 $(td).data(
"timer", setTimeout($.proxy(
function() { OpenStatusPopup($(td))}, $(td)), 3000));
92 function OnMouseExit(td) {
93 clearTimeout($(td).data(
"timer"));
97 function OpenStatusPopup(td) {
98 clearTimeout($(td).data(
"timer"));
99 if ($(td).data(
"hasNotification") ==
true) {
103 var notification = $(
"<div></div>").kendoNotification({
106 top: $(td).offset().top - $(
"body").scrollTop(),
107 left: $(td).offset().left - $(
"body").scrollLeft()
111 $(td).data(
"hasNotification",
true);
112 $(
".k-icon.k-i-note").
remove();
113 $(
".k-notification:last").mouseleave(
function () {
118 $(td).data(
"hasNotification",
false);
120 }).data(
"kendoNotification");
123 $.post(
"index.prg?operation=readWorkflowStatusInfo", {featureId: $(td).parent().data(
"template_id")},
function (data) {
125 if (data.status !==
"000") {
126 $.homecuValidator.displayMessage(data.error, $.homecuValidator.settings.statusError );
128 if (data.record.length == 0) {
129 notification.info(
"No workflow attached");
131 var firstColumn =
"grid_5 alpha";
132 var secondColumn =
"grid_7 omega";
133 var preRow =
"<div class='grid_12'><div class='" + firstColumn +
"'><b>";
134 var midRow =
"</b></div> <div class='" + secondColumn +
"'>";
135 var postRow =
"</div></div>";
136 var message =
"<br><div class='container_12 workflowStatusInfo'>";
137 message += preRow +
"Job Id:" + midRow + data.record[0].trackId + postRow;
138 message += preRow +
"Job:" + midRow + data.record[0].issue + postRow;
139 message += preRow +
"Job Owner:" + midRow + data.record[0].issueOwner + postRow;
140 message += preRow +
"Job Status:" + midRow + data.record[0].issueStatus + postRow;
141 message += preRow +
"Next Task:" + midRow + data.record[0].nextTask + postRow;
142 message += preRow +
"Next Task Owner:" + midRow + data.record[0].nextTaskOwner + postRow;
143 message += preRow +
"Entry Date:" + midRow + kendo.toString(
new Date(data.record[0].entryDate),
"MM/dd/yyyy") + postRow;
144 message += preRow +
"Last Activity Date:" + midRow + kendo.toString(
new Date(data.record[0].lastActivityDate),
"MM/dd/yyyy") + postRow;
145 message +=
"<div class='grid_12'> </div>";
146 message +=
"<div class='grid_12'><a href='/hcuadm/cuissues_edit.prg?trackId=" + data.record[0].trackId +
"' target='_blank'>Go to job</a></div></div>";
147 notification.info(message);
154 $(document).ready(
function () {
158 <script
id=
"headerRowTemplate" type=
"text/k-kendo-template">
159 <tr
class=
"header" onclick=
"addNewRow();">
160 <td
class=
"spacerTd"> </td>
168 <script
id=
"rowTemplate" type=
"text/x-kendo-template">
169 <tr
class=
"normalRow" data-uid=
"#: uid #" data-template_id=
"#: templateId #">
170 <td
class=
"spacerTd"> </td>
171 <td>#: salesItemDescr #</td>
172 <td>#
if (billHalf) { # Yes # }
else { # No # } #</td>
173 # if (statusLabel == "Pending") { # 174 <td
class=
"statusLabel" onclick=
"OpenStatusPopup(this);" onmouseenter=
"OnMouseEnter(this);" onmouseleave=
"OnMouseExit(this);">#: statusLabel #</td>
176 <td>#: statusLabel #</td>
178 <td>#: initialCosts #</td>
179 <td>#: recurringCosts #</td>
180 <td
class=
"tempGroupLine"><a href=
"<?php echo $produrl . GetBillingURL(); ?>?page=salesOrderDetails&salesOrderId=#: orderId #">#: cuName # (#: cu #)</a></td>
183 <script
id=
"altRowTemplate" type=
"text/x-kendo-template">
184 <tr
class=
"k-alt normalRow" data-uid=
"#: uid #" data-template_id=
"#: templateId #">
185 <td
class=
"spacerTd"> </td>
186 <td>#: salesItemDescr #</td>
187 <td>#
if (billHalf) { # Yes # }
else { # No # } #</td>
188 # if (statusLabel == "Pending") { # 189 <td
class=
"statusLabel" onclick=
"OpenStatusPopup(this);" onmouseenter=
"OnMouseEnter(this);" onmouseleave=
"OnMouseExit(this);">#: statusLabel #</td>
191 <td>#: statusLabel #</td>
193 <td>#: initialCosts #</td>
194 <td>#: recurringCosts #</td>
197 <div
class=
"container_12" id=
"dashboardForm">
198 <div
id=
"dashboardFormStatus"></div>
199 <div
class=
"grid_12">
200 <div
id=
"formValidateMainDiv" class=
"k-block k-error-colored" style=
"display:none;"></div>
202 <div
class=
"grid_12">
203 <div
id=
"dashboardGrid" class=
"cuIndexGrid"></div>