📄 reports.php
字号:
'csv' => 'CSV File'),
'',
$stat[displaytype])
);
$table[] = array('<b>Date Affects</B> ' . ahelp('Reports','Date Affects'),
form_select('dateaffect',
array('none' => 'None',
'opened' => '[interval] Ticket Opened',
'closed' => '[interval] Ticket Closed',
'reply' => '[interval] Ticket Replied',
'1streply_less' => '[length] 1st Ticket Reply (less than)',
'1streply_greater' => '[length] 1st Ticket Reply (greater than)',
'span_less' => '[length] Ticket Lifetime (less than)',
'span_more' => '[length] Ticket Lifetime (greater than)'),
'',
$stat[dateaffect])
);
$intervals = explode(',', $stat[variable1times]);
if (isset($intervals[0])) {
$i_years = $intervals[0];
} else {
$i_years = 0;
}
if (isset($intervals[1])) {
$i_days = $intervals[1];
} else {
$i_days = 0;
}
if (isset($intervals[2])) {
$i_hours = $intervals[2];
} else {
$i_hours = 0;
}
if (isset($intervals[3])) {
$i_mins = $intervals[3];
} else {
$i_mins = 0;
}
$table[] = array('<b>Search Length/Interval</b> ' . ahelp('Reports', 'Search Length/Interval'),
form_input('txtYears', $i_years, 5) . ' Year(s)<BR>' .
form_input('txtDays', $i_days, 5) . ' Day(s)<BR>' .
form_input('txtHours', $i_hours, 5) . ' Hour(s)<BR>' .
form_input('txtMinutes', $i_mins, 5) . ' Minute(s)<BR>'
);
$array = array(
'is_open' => 'Ticket Status: open/closed',
'priority' => 'Ticket Priority',
'category' => 'Ticket Category',
'awaiting_tech' => 'Awaiting Response From: tech/user',
'tech' => 'Assigned Technician',
'userid' => 'User'
);
// get rest of ticket data
$db->query(
"SELECT * from ticket_def
ORDER by displayorder"
);
while ($result = $db->row_array()) {
unset($name, $description, $error, $html);
$tmp = unserialize($result[display_name]);
$name = $tmp[$settings[default_language]];
$array[$result[name]] = $name;
}
$table[] = array('<b>1st Variable</b> ' . ahelp('Reports', '1st Variable'),
form_select('variable1', $array, '', $stat[variable1])
);
$array = array_merge(array(''), $array);
$table[] = array('<b>2nd Variable</b> ' . ahelp('Reports', '2nd Variable'),
form_select('variable2', $array, '', $stat[variable2])
);
// <body onLoad="retrieveVals()"> <input type="button" name="Submit" value="Submit" onClick="postThis()">
$table[] = table_midheader('Ticket Search Restrictions');
$table[] = array('<b>Open/Closed</b><BR> [Optional] Search only for open
(or closed) tickets.',
form_select('open_status',
array('',
'closed' => 'Ticket Closed',
'open' => 'Ticket Open'
),
'',
$fixed_general[open_status],
1)
);
$table[] = array('<b>Awaiting Response From...</b><BR> [Optional] Search
only for tickets awaiting a response from a technician (or a user).',
form_select('awaiting_status',
array('',
'tech' => 'Awaiting Technician Reponse',
'user' => 'Awaiting User Response'
),
'',
$fixed_general[awaiting_status], 1)
);
$table[] = array('<b>Priority</b><BR> [Optional] Search only for tickets
with a priority of...',
form_select('priority',
$pri_array,
'',
$fixed_general[priority],
'',
'',
5)
);
$table[] = array('<b>Category</b><BR> [Optional] Search only for tickets
with a category of...',
form_select('category',
$cat_array,
'',
$fixed_general[category],
'',
'',
5)
);
// used for fields to display
$statarray = split(',', $stat[displayfields]);
unset($options, $options2);
if (!in_array('subject', $statarray)) {
$options .= "<option value=\"subject\">Subject</option>\n";
} else {
$options2 .= "<option value=\"subject\">Subject</option>\n";
}
if (!in_array('category', $statarray)) {
$options .= "<option value=\"category\">Category</option>\n";
} else {
$options2 .= "<option value=\"category\">Category</option>\n";
}
if (!in_array('priority', $statarray)) {
$options .= "<option value=\"priority\">Priority</option>\n";
} else {
$options2 .= "<option value=\"priority\">Priority</option>\n";
}
if (!in_array('tech', $statarray)) {
$options .= "<option value=\"tech\">Tech Owner</option>\n";
} else {
$options2 .= "<option value=\"tech\">Tech Owner</option>\n";
}
if (!in_array('user', $statarray)) {
$options .= "<option value=\"user\">User Owner</option>\n";
} else {
$options2 .= "<option value=\"user\">User Owner</option>\n";
}
// get rest of ticket data
$db->query(
"SELECT * from ticket_def
ORDER by displayorder"
);
while ($result = $db->row_array()) {
unset($name, $description, $error, $html);
$tmp = unserialize($result[display_name]);
$name = $tmp[$settings[default_language]];
// for fields
if (in_array($result[name], $statarray)) {
$options2 .= "<option value=\"$result[name]\">$name</option>\n";
} else {
$options .= "<option value=\"$result[name]\">$name</option>\n";
}
if ($_REQUEST['do'] == "editstat") {
$action = 1;
}
if ($fixed_ticket[$result[name]]) { // Function iff() doesn't quite do what we need it to here
$html = field_def($result, iff($action, 'edit', 'default'), '', '', $fixed_ticket[$result[name]], 'ticketfields', 1, $fixed_ticket["$result[name]_match"], $fixed_ticket["$result[name]_not"]);
} else {
$html = field_def($result, iff($action, 'edit', 'default'), '', '', '', 'ticketfields', 1, $fixed_ticket["$result[name]_match"], $fixed_ticket["$result[name]_not"]);
}
$description = unserialize($result[description]);
if ($description[1]) {
$description = "<BR>$description[1]";
} else {
$description = "<BR><I>No description</I>";
}
$table[] = array("<b>$name</b>$description", $html);
}
$table[] = table_midheader('User Search Restrictions');
$table[] = array('<I>Make selections here to restrict which users\' tickets are included by this statistic.</I>');
// get rest of ticket data
$db->query(
"SELECT * from user_def
ORDER by displayorder"
);
$custom = array();
while ($result = $db->row_array()) {
unset($name, $description, $error, $html);
$tmp = unserialize($result[display_name]);
$name = $tmp[$settings[default_language]];
if ($fixed_user[$result[name]]) { // Function iff() doesn't quite do what we need it to here
$html = field_def($result, iff($action, 'edit', 'default'), '', '', $fixed_user[$result[name]], 'userfields', 1, $fixed_user["$result[name]_match"], $fixed_user["$result[name]_not"]);
} else {
$html = field_def($result, iff($action, 'edit', 'default'), '', '', '', 'userfields', 1, $fixed_user["$result[name]_match"], $fixed_user["$result[name]_not"]);
}
$description = unserialize($result[description]);
if ($description[1]) {
$description = "<BR>[Custom] $description[1]";
} else {
$description = "<BR>[Custom] <I>No description</I>";
}
$table[] = array("<b>$name</b>$description", $html);
}
$display = array('ID', 'Subject', 'Category', 'Priority', 'Status');
$table[] = table_midheader('Detailed Ticket Listing');
$table[] = array('<b>List Matching Tickets After Statistic?</b><BR> If
"yes", a list of all tickets matched by this statistic will be shown
beneath the chart or graph of the data. <I>(Cannot be specified for CSV
display types</I>.',
form_radio_yn('appendix',
'',
$stat[appendix])
);
$table[] = array('<b>Fields to Display</b><BR> For each matched ticket,
display these fields... <I>(note: selecting too many fields here can
produce very wide reports, possibly causing formatting errors when
displaying or printing reports)</I>',
" <TABLE BORDER=0>
<TR>
<TD VALIGN=MIDDLE ALIGN=CENTER>
<b>Avaliable Fields</b><br />
<SELECT style=\"width:200px\" NAME=\"list11\" MULTIPLE SIZE=10 onDblClick=\"moveSelectedOptions(this.form.list11,this.form.list21,false)\">
$options
</SELECT>
</TD>
<TD VALIGN=MIDDLE ALIGN=CENTER>
<INPUT TYPE=\"button\" NAME=\"right\" VALUE=\">>\" onClick=\"moveSelectedOptions(document.forms[0].list11,document.forms[0].list21,false);return false;\"><BR><BR>
<INPUT TYPE=\"button\" NAME=\"right\" VALUE=\"All >>\" onClick=\"moveAllOptions(document.forms[0].list11,document.forms[0].list21,false); return false;\"><BR><BR>
<INPUT TYPE=\"button\" NAME=\"left\" VALUE=\"<<\" onClick=\"moveSelectedOptions(document.forms[0].list21,document.forms[0].list11,false); return false;\"><BR><BR>
<INPUT TYPE=\"button\" NAME=\"left\" VALUE=\"All <<\" onClick=\"moveAllOptions(document.forms[0].list21,document.forms[0].list11,false); return false;\">
</TD>
<TD VALIGN=MIDDLE ALIGN=CENTER>
<input type=\"hidden\" name=\"fields\">
<b>Selected Fields</b><br />
<SELECT style=\"width:200px\" NAME=\"list21\" MULTIPLE SIZE=10 onDblClick=\"moveSelectedOptions(this.form.list21,this.form.list11,false)\">
$options2
</SELECT>
</TD>
</TR>
</TABLE>");
if ($_REQUEST['do'] == 'editstat') {
$hidden = array('do' => 'editstat2', 'id' => $stat[id]);
$end = 'Edit Statistic';
} else {
$hidden = array('do' => 'newstat2');
$end = 'Create Statistic';
}
$width = array("40%", "60%");
table_header('Statistic', 'reports.php', $hidden, '', 'dpform');
table_content('', $table, '', '', '', '', $width);
table_footer($end, 'center', '', '', "onclick=\"submitAllOptions(this.form.list21, this.form.fields)\"");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -