3 $monLibrary = dirname(__FILE__) .
"/../library";
4 $billingLibrary = dirname(__FILE__) .
"/../../billing/library";
5 require_once(
"$monLibrary/cu_top.i");
6 require_once(
"$monLibrary/ck_hticket.i");
8 require_once(
"$billingLibrary/configuration.i");
10 if (!CheckPerm($link, $Hu, basename($_SERVER[
'SCRIPT_NAME']), $_SERVER[
'REMOTE_ADDR'])) {
13 header(
"Location: /hcuadm/hcu_noperm.prg");
17 $dms_ok=array(
'act'=>
'string',
'addRows'=>
'string',
'btn_act'=>
'string',
18 'btnAddRows'=>
'string',
'btn_stop'=>
'string',
'direction_to_move'=>
'string',
19 'iid'=>
'string',
'iss_code'=>
'string',
'iss_id'=>
'string',
20 'iss_prod'=>
'string',
'iss_owner'=>
'string',
'item_del_'=>
'prefix_s',
'item_desc_'=>
'prefix_s',
21 'item_id_'=>
'prefix_s',
'item_title_'=>
'prefix_s',
'item_owner_'=>
'prefix_s',
'item_parent_'=>
'prefix_s',
22 'row_to_move'=>
'string',
'saveForm'=>
'string',
'total_rows'=>
'string',
'sales_item_id_'=>
'prefix_s');
26 $iss_id = isset($iss_id) ? $iss_id : 0;
27 $iss_code = isset($iss_code) ? $iss_code :
"";
28 $iss_prod = isset($iss_prod) ? $iss_prod :
"";
29 $iss_owner = isset($iss_owner) ? $iss_owner :
"";
36 if ($act == 1 && isset($saveForm)) {
38 } elseif ($act == 4 && intval($iid) > 0 && isset($btn_act)) {
40 } elseif ($act == 4 && isset($btn_stop)) {
59 if (strlen(trim($iss_code)) == 0) {
60 $form_err .=
"<li>You must enter a code to be saved.<br>";
63 if (strlen(trim($iss_owner)) == 0) {
64 $form_err .=
"<li>You must enter a default owner to be saved.<br>";
67 for ($row_idx = 1; $row_idx <= $total_rows; $row_idx++) {
69 $item_id = isset(${
'item_id_' . $row_idx}) ? intval(${
'item_id_' . $row_idx}) : 0;
70 $item_title = isset(${
'item_title_' . $row_idx}) ? trim(${
'item_title_' . $row_idx}) :
"";
71 $item_desc = isset(${
'item_desc_' . $row_idx}) ? trim(${
'item_desc_' . $row_idx}) :
"";
72 $item_owner = isset(${
'item_owner_' . $row_idx}) ? trim(${
'item_owner_' . $row_idx}) :
"";
73 $item_del = isset(${
'item_del_' . $row_idx}) ? ${
'item_del_' . $row_idx} :
"";
74 $sales_item_id= isset(${
'sales_item_id_' . $row_idx}) ? intval(${
'sales_item_id_' . $row_idx}) : 0;
78 if ($item_del !=
"Y") {
84 if (strlen($item_title) > 0 || strlen($item_desc) > 0 ) {
90 if (strlen($item_title) == 0) {
91 $form_err .=
"<li>Row $row_idx does not contain an item title.<br>";
93 if (strlen($item_desc) == 0) {
94 $form_err .=
"<li>Row $row_idx does not contain an item description.<br>";
98 if (strlen($form_err) == 0) {
101 if (isset($iss_id) && intval($iss_id) > 0 ) {
102 $save_issue_id = intval($iss_id);
104 $sql =
"UPDATE cuissues 105 SET code = '" . prep_save($iss_code, 80) .
"', 106 gen_for_product = '" . prep_save($iss_prod, 10) .
"', 107 owner = '" . prep_save($iss_owner, 12) .
"' 108 WHERE issue_id = '$save_issue_id'; ";
111 $sql =
"SELECT nextval('cuissues_issue_id_seq');";
112 if ($seq_rs = db_query($sql, $link)) {
114 list($save_issue_id) = db_fetch_array($seq_rs, 0);
115 $sql =
"INSERT INTO cuissues 116 (issue_id, code, gen_for_product, owner) 118 ('$save_issue_id', '" . prep_save($iss_code, 80) .
"', '" . prep_save($iss_prod, 10) .
"', '" . prep_save($iss_owner, 12) .
"'); ";
120 trigger_error(
"SQL Failure: $sql :: " . pg_errormessage($link), E_USER_NOTICE);
122 $form_err =
"Unable to save the CU Job Template at this time.<br><br>Please try again.";
125 db_free_result($seq_rs);
129 if (isset($save_issue_id) && $save_issue_id > 0) {
130 for ($row_idx = 1; $row_idx <= $total_rows; $row_idx++) {
132 $item_id = isset(${
'item_id_' . $row_idx}) ? intval(${
'item_id_' . $row_idx}) : 0;
133 $item_parent = isset(${
'item_parent_' . $row_idx}) ? intval(${
'item_parent_' . $row_idx}) :
"";
134 $item_title = isset(${
'item_title_' . $row_idx}) ? prep_save(${
'item_title_' . $row_idx}, 50) :
"";
135 $item_desc = isset(${
'item_desc_' . $row_idx}) ? prep_save(${
'item_desc_' . $row_idx}) :
"";
136 $item_owner = isset(${
'item_owner_' . $row_idx}) ? prep_save(${
'item_owner_' . $row_idx}) :
"";
137 $item_del = isset(${
'item_del_' . $row_idx}) ? ${
'item_del_' . $row_idx} :
"";
138 $sales_item_id = isset(${
'sales_item_id_' . $row_idx}) ? intval(${
'sales_item_id_' . $row_idx}) : 0;
142 if ($item_del ==
"Y" && $item_id > 0) {
143 $sql .=
"DELETE FROM cuissuesitem WHERE item_id = $item_id; ";
144 } elseif ($item_del !=
"Y" && strlen($item_title) > 0) {
147 $sql .=
"UPDATE cuissuesitem 148 SET title = '$item_title', 149 item_desc = '$item_desc', 150 view_order = '$row_idx', 151 owner = '$item_owner', 152 parent = $item_parent, 153 sales_item_id= $sales_item_id 154 WHERE item_id = $item_id; ";
157 $sql .=
"INSERT INTO cuissuesitem 158 (issue_id, title, item_desc, view_order, owner, parent, sales_item_id) 160 ($save_issue_id, '$item_title', '$item_desc', '$row_idx', '$item_owner', $item_parent, $sales_item_id); ";
167 if (!($db_result=db_query($sql, $link))) {
168 trigger_error(
"SQL Failure: $sql ::" . pg_errormessage($link) , E_USER_NOTICE);
169 $form_err =
"Unable to save the CU Job Template at this time.<br><br>Please try again.";
172 $form_msg =
"The code '{$iss_code}' was saved successfully.";
180 } elseif ($act == 6) {
182 if (intval($iid) > 0) {
183 $sql =
"DELETE FROM cuissues WHERE issue_id = '" . intval($iid) .
"'; ";
184 $sql .=
"DELETE FROM cuissuesitem WHERE issue_id = '" . intval($iid) .
"'; ";
185 if ($del_rs = db_query($sql, $link)) {
186 $form_msg =
"The record was successfully deleted.";
188 $form_err =
"Something happened, and the record was NOT deleted. Sorry for any inconvenience.";
199 if (isset($iss_id)) {
201 $load_issue_id = intval($iss_id);
206 WHERE issue_id= '{$iss_id}'";
207 $result = db_query($sql, $link);
209 $cuissues_row = db_fetch_object($result);
210 $num_rows = db_num_rows($result);
214 cu_header(
"$formmode CU Job Templates");
216 <form action=
"<?php echo $_SERVER['PHP_SELF']; ?>" method=
"post">
217 <input type=
"hidden" name=
"act" value=
"<?php echo $act ?>">
221 <table cellpadding=
"3" cellspacing=
"0" border=
"0" width=
"500" class=
"dmsbg"><tr><td>
222 <table cellpadding=
"1" cellspacing=
"0" border=
"0" width=
"100%" bgcolor=white>
224 <td colspan=
"7" class=
"bar" align=
"center">
225 <?php echo strtoupper($formmode); ?> CU Job Template
229 if (strlen($form_err) > 0) {
232 <td
class=
'err' colspan=
'6' align=
'center'>
233 Errors were found saving the information. Please review errors and
try again<br>
238 } elseif (strlen($form_msg) > 0) {
241 <td
class=
'msg' colspan=
'6' align=
'center'>
249 <td nowrap colspan=
'3' align=
"right" class=
"hdr" width=
"10%">
250 CU Job Template<sup>*</sup>:
252 <td nowrap colspan=
"4" class=
'dtl' width=
"90%">
256 $value = htmlspecialchars(trim($cuissues_row->code));
258 $value = set_string($iss_code);
261 <input type=
"text" name=
"iss_code" size=
"50" maxlength=
"80" value=
"<?php echo $value?>">
262 <input type=
"hidden" name=
"iss_id" value=
"<?php echo $iss_id ?>">
266 <td nowrap colspan=
'3' align=
"right" class=
"hdr" width=
"10%">
267 Auto-Generate
for this Product:
269 <td nowrap colspan=
"4" class=
'dtl' width=
"90%">
273 $value = htmlspecialchars(trim($cuissues_row->gen_for_product));
275 $value = set_string($iss_prod);
278 <select name=
"iss_prod">
279 <option value=
"">No Product Selected</option>
282 $sql =
"SELECT DISTINCT gen_for_product FROM cuissues";
283 $prod_rs = db_query($sql, $link);
285 $inUseList = array();
286 while ($row = db_fetch_array($prod_rs, $prod_row++)) {
287 $inUseList[] = trim( $row[
"gen_for_product"] );
292 ORDER BY home_cu_code ";
293 $hcu_rs = db_query($sql, $link);
295 while ($hcu_row = db_fetch_array($hcu_rs, $prod_row++)) {
296 $hcu_row[
'home_cu_code'] = trim($hcu_row[
'home_cu_code']);
297 $selected = ($hcu_row[
'home_cu_code'] == $value ?
"SELECTED" :
"");
299 if ( in_array( $hcu_row[
"home_cu_code"], $inUseList ) &&
300 $selected ===
"" )
continue;
302 $hcu_row[
'home_cu_desc'] = dms_disphtml($hcu_row[
'home_cu_desc']);
303 print
"<option value=\"{$hcu_row['home_cu_code']}\" $selected >{$hcu_row['home_cu_desc']}</option>\n";
305 db_free_result($hcu_rs);
311 <td nowrap colspan=
'3' align=
"right" class=
"hdr" width=
"10%">
312 Default Owner<sup>*</sup>:
314 <td nowrap colspan=
"4" class=
'dtl' width=
"90%">
318 $value = htmlspecialchars(trim($cuissues_row->owner));
320 $value = set_string($iss_owner);
323 <select name=
"iss_owner">
324 <option value=
"">No Owner Selected</option>
326 $sql =
"SELECT user_name 328 ORDER BY user_name ";
329 $hcu_rs = db_query($sql, $link);
331 $savedUsers = array();
332 while ($hcu_row = db_fetch_array($hcu_rs, $owner_row++)) {
333 $selected = (trim($hcu_row[
'user_name']) == $value ?
"SELECTED" :
"");
334 print
"<option value=\"{$hcu_row['user_name']}\" $selected >{$hcu_row['user_name']}</option>\n";
336 $savedUsers[] = $hcu_row[
'user_name'];
338 db_free_result($hcu_rs);
344 <td nowrap colspan=
'3' align=
"right" class=
"hdr" width=
"10%">
346 <td nowrap colspan=
"4" class=
'dtl' width=
"90%">
347 <sup>*</sup>Required fields
351 <td colspan=7 nowrap align=
"right" class=
"hdr">
352 <a href=
"/hcuadm/cuilist.prg">Return to Monitor</a>
357 <td colspan=7 nowrap align=
"center" class=
"bar">
358 Items Required
for Job Template
362 <td colspan=7 nowrap align=
"center" class=
"dtl" style=
"font-size:small;">
363 (If wanting to indent a
new task with a
new parent, please save first so have ids to work with.)
367 <td nowrap align=
"left" class=
"hdr" width=
"5%">
370 <td nowrap align=
"left" class=
"hdr" width=
"5%">
373 <td nowrap align=
"left" class=
"hdr" width=
"25%">
376 <td nowrap align=left
class=
'hdr' width=
"60%">
379 <td nowrap align=left
class=
'hdr' width=
"10%">
382 <td nowrap align=left
class=
'hdr' width=
"15%">
385 <td
class=
"hdr" width=
"10%">Delete?</td>
387 <input type=
"hidden" name=
"row_to_move" value=
"">
388 <input type=
"hidden" name=
"direction_to_move" value=
"">
389 <script language=
"javascript">
391 function move_row(direction, row_num) {
394 document.forms[0].row_to_move.value = row_num;
395 document.forms[0].direction_to_move.value = direction;
397 document.forms[0].submit();
406 .salesItemDDL option {
407 text-overflow: ellipsis;
416 if (isset($total_rows)) {
423 $taskArray = array();
425 for ($loop_idx = 1; $loop_idx <= $total_rows; $loop_idx++) {
426 $row_idx = $loop_idx + $row_up;
427 $field_idx = $loop_idx + $row_dwn;
432 if (($direction_to_move ==
"UP" &&
433 intval($row_to_move) > $skip_rows) &&
434 intval($row_to_move) == ($loop_idx + $skip_rows)) {
435 $taskArray[] = array(
"id" => isset(${
"item_id_" . ($row_idx + $skip_rows)}) ? intval(${
"item_id_" . ($row_idx + $skip_rows)}) : 0,
436 "parent" => isset(${
"item_parent_" . ($row_idx + $skip_rows)}) ? ${
"item_parent_" . ($row_idx + $skip_rows)} :
"",
437 "title" => isset(${
"item_title_" . ($row_idx + $skip_rows)}) ? ${
"item_title_" . ($row_idx + $skip_rows)} :
"",
438 "desc" => isset(${
"item_desc_" . ($row_idx + $skip_rows)}) ? ${
"item_desc_" . ($row_idx + $skip_rows)} :
"",
439 "owner" => isset(${
"item_owner_" . ($row_idx + $skip_rows)}) ? ${
"item_owner_" . ($row_idx + $skip_rows)} :
"",
440 "del" => isset(${
"item_del_" . ($row_idx + $skip_rows)}) ? ${
"item_del_" . ($row_idx + $skip_rows)} :
"",
441 "sales_item_id" => isset(${
"sales_item_" . ($row_idx + $skip_rows)}) ? intval(${
"sales_item_" . ($row_idx + $skip_rows)}) : 0 );
446 $row_idx = $loop_idx + $row_up;
447 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
453 if (($direction_to_move ==
"DOWN" &&
454 intval($row_to_move) > 0) &&
455 intval($row_to_move) == $loop_idx &&
456 intval($row_to_move) < $total_rows) {
458 $field_idx = $loop_idx + $row_dwn;
462 if ( $direction_to_move ==
"RIGHT" &&
463 intval( $row_to_move ) > 1 &&
464 intval( $row_to_move ) == $loop_idx ) {
466 $taskArray[] = array(
"id" => isset(${
"item_id_" . ($row_idx)}) ? intval(${
"item_id_" . ($row_idx)}) : 0,
467 "parent" => $lastParent,
468 "title" => isset(${
"item_title_" . ($row_idx)}) ? ${
"item_title_" . ($row_idx)} :
"",
469 "desc" => isset(${
"item_desc_" . ($row_idx)}) ? ${
"item_desc_" . ($row_idx)} :
"",
470 "owner" => isset(${
"item_owner_" . ($row_idx)}) ? ${
"item_owner_" . ($row_idx)} :
"",
471 "del" => isset(${
"item_del_" . ($row_idx)}) ? ${
"item_del_" . ($row_idx)} :
"",
472 "sales_item_id" => isset(${
"sales_item_id_" . ($row_idx)}) ? intval(${
"sales_item_id_" . ($row_idx)}) : 0 );
476 if ( $direction_to_move ==
"LEFT" &&
477 intval( $row_to_move ) == $loop_idx ) {
479 $taskArray[] = array(
"id" => isset(${
"item_id_" . ($row_idx)}) ? intval(${
"item_id_" . ($row_idx)}) : 0,
481 "title" => isset(${
"item_title_" . ($row_idx)}) ? ${
"item_title_" . ($row_idx)} :
"",
482 "desc" => isset(${
"item_desc_" . ($row_idx)}) ? ${
"item_desc_" . ($row_idx)} :
"",
483 "owner" => isset(${
"item_owner_" . ($row_idx)}) ? ${
"item_owner_" . ($row_idx)} :
"",
484 "del" => isset(${
"item_del_" . ($row_idx)}) ? ${
"item_del_" . ($row_idx)} :
"",
485 "sales_item_id" => isset(${
"sales_item_id_" . ($row_idx)}) ? intval(${
"sales_item_id_" . ($row_idx)}) : 0 );
489 if ($direction_to_move ==
"" ||
490 ($direction_to_move ==
"UP" && intval($row_to_move) <= 1) ||
491 ($direction_to_move ==
"UP" && intval($row_to_move) != $loop_idx) ||
492 ($direction_to_move ==
"DOWN" && $loop_idx != (intval($row_to_move) + $skip_rows)) ||
493 ($direction_to_move ==
"RIGHT" && (intval( $row_to_move ) != $loop_idx)) ||
494 ($direction_to_move ==
"RIGHT" && (intval( $row_to_move ) == 1)) ||
495 ($direction_to_move ==
"LEFT" && (intval( $row_to_move ) != $loop_idx)) ) {
496 $taskArray[] = array(
"id" => isset(${
"item_id_" . $field_idx}) ? intval(${
"item_id_" . $field_idx}) : 0,
497 "parent" => isset(${
"item_parent_" . $field_idx}) ? ${
"item_parent_" . $field_idx} :
"",
498 "title" => isset(${
"item_title_" . $field_idx}) ? ${
"item_title_" . $field_idx} :
"",
499 "desc" => isset(${
"item_desc_" . $field_idx}) ? ${
"item_desc_" . $field_idx} :
"",
500 "owner" => isset(${
"item_owner_" . $field_idx}) ? ${
"item_owner_" . $field_idx} :
"",
501 "sales_item_id" => isset(${
"sales_item_id_" . $field_idx}) ? intval(${
"sales_item_id_" . $field_idx}) : 0,
502 "del" => isset(${
"item_del_" . $field_idx}) ? ${
"item_del_" . $field_idx} :
"" );
506 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
511 if (($direction_to_move ==
"DOWN" && intval($row_to_move) > 0) && intval($row_to_move) == ($loop_idx - $skip_rows)) {
512 $taskArray[] = array(
"id" => isset(${
"item_id_" . ($row_idx - $skip_rows)}) ? ${
"item_id_" . ($row_idx - $skip_rows)} : 0,
513 "parent" => isset(${
"item_parent_" . ($row_idx - $skip_rows)}) ? ${
"item_parent_" . ($row_idx - $skip_rows)} :
"",
514 "title" => isset(${
"item_title_" . ($row_idx - $skip_rows)}) ? ${
"item_title_" . ($row_idx - $skip_rows)} :
"",
515 "desc" => isset(${
"item_desc_" . ($row_idx - $skip_rows)}) ? ${
"item_desc_" . ($row_idx - $skip_rows)} :
"",
516 "owner" => isset(${
"item_owner_" . ($row_idx - $skip_rows)}) ? ${
"item_owner_" . ($row_idx - $skip_rows)} :
"",
517 "sales_item_id" => isset(${
"sales_item_id_" . ($row_idx - $skip_rows)}) ? intval(${
"sales_item_id_" . ($row_idx - $skip_rows)}) : 0,
518 "del" => isset(${
"item_del_" . ($row_idx - $skip_rows)}) ? ${
"item_del_" . ($row_idx - $skip_rows)} :
"");
523 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
529 if (($direction_to_move ==
"UP" && intval($row_to_move) == $loop_idx)) {
534 if ( $taskArray[count($taskArray)-1][
"parent"] == 0 ) {
535 $lastParent = $taskArray[count($taskArray)-1][
"id"];
540 $taskArray[0][
"parent"] = 0;
548 WHERE issue_id = '$load_issue_id' 549 ORDER BY view_order ";
550 $item_rs = db_query($sql, $link);
552 while ($item_row = db_fetch_array($item_rs, $item_rows++)) {
553 $taskArray[] = array(
"id" => $item_row[
'item_id'],
554 "parent" => $item_row[
'parent'],
555 "title" => trim(dms_disphtml($item_row[
'title'])),
556 "desc" => trim(dms_disphtml($item_row[
'item_desc'])),
557 "owner" => trim(dms_disphtml($item_row[
'owner'])),
558 "sales_item_id" => intval(dms_disphtml($item_row[
'sales_item_id'])),
563 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
566 db_free_result($item_rs);
570 if (isset($addRows) && isset($btnAddRows)) {
571 $addblankrows = $addRows;
573 if ($addblankrows > 0) {
575 for ($loop_idx = 1; $loop_idx <= $addblankrows; $loop_idx++) {
577 $taskArray[] = array(
"id" =>
"",
582 "sales_item_id" => 0,
585 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
589 $prodId = isset($iss_prod) && trim($iss_prod) !=
"" ? strtolower(set_string($iss_prod)) : strtolower(trim($cuissues_row->gen_for_product));
590 $issueId = isset($iss_id) && trim($iss_id) !=
"" ? intval($iss_id) : 0;
591 $sql =
"select si.id, si.display_name, si.billing_template, ii.issue_id, si.billing_system_id from cubillsalesitem si 592 left join cuissuesitem ii on si.id = ii.sales_item_id 593 where lower(prod_id) = '$prodId' and (ii.issue_id is null or ii.issue_id = $issueId) ";
595 $results = db_query($sql, $link);
596 $savedSalesItems = array();
597 $usedSalesItemsInTemplate = array();
598 $setupRecurring = getSetupRecurring();
600 while ($thisRow = db_fetch_array($results, $thisI++)) {
601 $setupLabel = $setupRecurring[$thisRow[
"billing_system_id"]];
602 if (!isset($setupLabel) || $setupLabel !=
"triggered") {
605 $template = HCU_JsonDecode($thisRow[
"billing_template"]);
606 $text = trim($thisRow[
"display_name"]);
607 $value = trim($thisRow[
"id"]);
609 switch(trim($thisRow[
"issue_id"])) {
611 $usedSalesItemsInTemplate[$value] = $text;
614 $savedSalesItems[$value] = $text;
618 db_free_result($results);
623 for ( $i = 0; $i < count( $taskArray ); $i++ ) {
624 if ( $taskArray[$i][
"parent"] == 0 ) {
632 print_item_line($i + 1, $parentNumber, $childNumber, $taskArray[$i][
'id'], $taskArray[$i][
'parent'],
633 $taskArray[$i][
'title'], $taskArray[$i][
'desc'],
634 $taskArray[$i][
'owner'], $taskArray[$i][
'del'], $taskArray[$i][
'sales_item_id'], $RGB, $savedUsers, $savedSalesItems, $usedSalesItemsInTemplate);
636 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
641 <td colspan=7 nowrap align=
"right" class=
"dtl">
646 <td align=
"left" colspan=
'2' class=
"dtl">
647 <input type=
"submit" name=
"saveForm" value=
"Save Job Template">
649 <td nowrap align=
"left" class=
"dtl">
650 <input type=
"button" name=
"Cancel" Value=
"Cancel" onClick=
"document.location='<?php echo $_SERVER['PHP_SELF']; ?>'">
652 <td
class=
"dtl"> </td>
653 <td nowrap align=
"right" class=
"dtl" colspan=
"3">
654 <input type=
"hidden" name=
"total_rows" value=
"<?php echo $total_rows; ?>">
655 <select name=
"addRows" size=
"1">
656 <option value=
"1">1</option>
657 <option value=
"2">2</option>
658 <option value=
"3">3</option>
659 <option value=
"4">4</option>
660 <option value=
"5">5</option>
662 <input type=
"submit" name=
"btnAddRows" value=
"Add Item Rows">
671 cu_header(
"CU Job Templates");
679 LEFT JOIN cuprodlist cupl ON cupl.home_cu_code = cui.gen_for_product 681 $prod_result = db_query($query, $link);
685 <!-- Print out the top of the table -->
687 <table border=
"0" cellpadding=
"3" cellspacing=
"0" align=
"center" class=
"dmsbg" width=
"500"><tr><td>
688 <table border=
"0" cellpadding=
"1" cellspacing=
"0" align=
"center" width=
"100%" bgcolor=white>
690 <td colspan=
"5" class=
"bar" align=
"center">
696 if (strlen($form_msg) > 0) {
699 <td
class=
'msg' colspan=
'4' align=
'center'>
704 } elseif (strlen($form_err) > 0) {
707 <td
class=
'err' colspan=
'4' align=
'center'>
715 <td
class=
"hdr" align=
"left">
718 <td
class=
"hdr" align=
"left">
721 <td
class=
"hdr" align=
"left">
724 <td
class=
"hdr" align=
"center">
731 while ($prod_row = db_fetch_object($prod_result, $row)):
734 <tr
class=
"<?php echo $RGB; ?>">
736 <?php echo trim($prod_row->code) ?>
739 <?php echo trim($prod_row->owner) ?>
742 <?php echo trim($prod_row->home_cu_desc) ?>
745 <a href=
"<?php echo $_SERVER['PHP_SELF']; ?>?act=1&iss_id=<?php echo trim($prod_row->issue_id) ?>">Edit</a>
746 | <a href=
"<?php echo $_SERVER['PHP_SELF']; ?>?act=4&iid=<?php echo $prod_row->issue_id; ?>">Delete</a>
750 $RGB = ($RGB ==
"odd" ?
"even" :
"odd");
755 <a href=
"<?php echo $_SERVER['PHP_SELF']; ?>?act=1">Add CU Job Template</a>
757 <a href=
"<?php echo $infourl ?>/hcuadm/cuilist.prg" target=
"parent">Return to Monitor</a>
776 $self = $_SERVER[
'PHP_SELF'];
781 WHERE issue_id = " . intval($iid);
782 $del_rs = db_query($sql, $link);
783 $del_row = db_fetch_array($del_rs, 0);
784 cu_header(
"Delete CU Issues");
787 <table cellpadding=
"3" cellspacing=
"0" border=
"0" width=
"500" class=
"dmsbg"><tr><td>
788 <form action=
"<?php echo $self; ?>" method=
"post">
789 <input type=
"hidden" name=
"iid" value=
"<?php echo $del_row['issue_id']; ?>">
790 <input type=
"hidden" name=
"act" value=
"4">
791 <table border=
"0" cellpadding=
"1" cellspacing=
"0" align=
"center" width=
"100%" bgcolor=white>
792 <tr><td
class=
"bar" colspan=
"2" align=
"center">Confirm CU Job Template Deletion</td></tr>
794 <td
class=
"ahd" colspan=
"2" align=
'center'>
795 Hi there, you are about to
delete the job
template '<?php echo dms_disphtml($del_row['code
']); ?>' from the Job Template table.<br>
799 <tr><td
class=
"ileft" colspan=
"2" align=
"center"> </td></tr>
801 <td width=
"20%" class=
"ileft">
805 <?php echo dms_disphtml($del_row[
'code']); ?>
809 <tr><td colspan=
"2" class=
"ahd"><hr></td></tr>
811 <td
class=
"ahd" colspan=
"2" align=
'center'>
812 You are only one step away from deleting
this record.<br>
813 Are you sure you want to
continue?<br>
814 <input type=
"submit" name=
"btn_act" value=
"Yes, delete the record">
815 <input type=
"submit" name=
"btn_stop" value=
"No, I changed my mind">
824 cu_header(
"Error Displaying Form");
826 printError(
"Requested form not found!<br>Cancelling action.");
834 function print_item_line($row_id, $taskNum, $childNum, $field_id, $parentId, $title_val, $desc_val, $taskOwner, $del_val, $salesItemId, $row_class, $ownerList,
835 $savedSalesItems, $usedSalesItemsInTemplate) {
838 $del_val = ($del_val ==
"Y" ?
"CHECKED" :
"");
843 $shift_up =
"<a href=\"javascript:move_row('UP', '$row_id');\" onMouseOver=\"status='Shift Row Up'; return true;\" onMouseOut=\"status='';\"><img border=0 src=\"/monitor/images/admin_up.gif\" alt=\"Move Up\"></a>";
844 $shift_down =
"<a href=\"javascript:move_row('DOWN', '$row_id');\" onMouseOver=\"status='Shift Row Down'; return true;\" onMouseOut=\"status='';\"><img border=0 src=\"/monitor/images/admin_down.gif\" alt=\"Move Down\"></a>";
847 $shiftLeft =
"<a href=\"javascript:move_row('LEFT', '$row_id');\" onMouseOver=\"status='Shift Row Left'; return true;\" onMouseOut=\"status='';\" style=\"text-decoration:none;\"><</a>";
848 $shiftRight =
"<a href=\"javascript:move_row('RIGHT', '$row_id');\" onMouseOver=\"status='Shift Row Right'; return true;\" onMouseOut=\"status='';\" style=\"text-decoration:none;\">></a>";
850 if ( $childNum > 0 ) {
851 $rowString =
" $taskNum.$childNum";
853 $rowString =
"$taskNum";
856 $salesItemOptions= array();
858 if ($salesItemId != 0 && !isset($savedSalesItems[$salesItemId]))
860 $salesItemOptions[]=
"<option value='$salesItemId' selected=selected>" . (isset($usedSalesItemsInTemplate[$salesItemId]) ? $usedSalesItemsInTemplate[$salesItemId] : $salesItemId) .
"</option>";
863 foreach($savedSalesItems as $value => $text)
866 if ($salesItemId == $value)
869 $selected=
"selected=selected";
871 $salesItemOptions[]=
"<option value='$value' $selected>$text</option>";
873 $selected= $found ?
"" :
"selected=selected";
874 array_splice($salesItemOptions, 0,0,
"<option value='0' $selected>None</option>");
875 $salesItemsDDL=
"<select name='sales_item_id_$row_id' class='salesItemDDL'>" . implode(
"\n", $salesItemOptions) .
"</select>";
878 <tr
class=
"$row_class">
879 <td
class=
"usu" style=
"font-style:italic;">
885 <td nowrap align=
"left" class=
"">
886 <input type=
"hidden" name=
"item_id_$row_id" value=
"$field_id">
887 <input type=
"hidden" name=
"item_parent_$row_id" value=
"$parentId">
888 <input type=
"text" name=
"item_title_$row_id" size=
"35" maxlength=
"50" value=
"$title_val">
890 <td nowrap align=left
class=
''>
891 <textarea rows=3 cols=40 name=
"item_desc_$row_id">$desc_val</textarea>
893 <td nowrap align=
"left" class=
"">
894 <select name=
"item_owner_$row_id">
" 895 <option value="">Default Owner</option> 897 for ( $i = 0; $i < count( $ownerList ); $i++ ) { 898 $selected = (trim($ownerList[$i]) == $taskOwner ? "SELECTED
" : ""); 899 print "<option value=\
"{$ownerList[$i]}\" $selected >{$ownerList[$i]}</option>\n";
905 <td nowrap align=
"left" class=
"">$salesItemsDDL</td>
906 <td valign=
"top"nowrap>
907 <input type=
"checkbox" name=
"item_del_$row_id" value=
"Y" $del_val>