コード例 #1
0
function support_technician_box($group_id, $name = 'assigned_to', $checked = 'xzxz')
{
    if (!$group_id) {
        return 'ERROR - No group_id';
    } else {
        $result = support_data_get_technicians($group_id);
        return html_build_select_box($result, $name, $checked);
    }
}
コード例 #2
0
if ($_category && $_category != 100) {
    $category_str = "AND support.support_category_id='{$_category}'";
} else {
    //no assigned to was chosen, so don't add it to where clause
    $category_str = '';
}
//build page title to make bookmarking easier
//if a user was selected, add the user_name to the title
//same for status
support_header(array('title' => 'Browse Support Requests' . ($_assigned_to ? ' For: ' . user_getname($_assigned_to) : '') . ($_status && $_status != 100 ? ' By Status: ' . support_data_get_status_name($_status) : '')));
//now build the query using the criteria built above
$sql = "SELECT support.priority,support.group_id,support.support_id,support.summary," . "support_category.category_name,support_status.status_name," . "support.open_date AS date,users.user_name AS submitted_by,user2.user_name AS assigned_to_user " . "FROM support,support_category,support_status,users,users user2 " . "WHERE users.user_id=support.submitted_by " . " {$status_str} {$assigned_str} {$category_str} " . "AND user2.user_id=support.assigned_to " . "AND support_category.support_category_id=support.support_category_id " . "AND support_status.support_status_id=support.support_status_id " . "AND support.group_id='{$group_id}'" . $order_by;
/*
        creating a custom technician box which includes "any" and "unassigned"
*/
$res_tech = support_data_get_technicians($group_id);
$tech_id_arr = util_result_column_to_array($res_tech, 0);
$tech_id_arr[] = '0';
//this will be the 'any' row
$tech_name_arr = util_result_column_to_array($res_tech, 1);
$tech_name_arr[] = 'Any';
$tech_box = html_build_select_box_from_arrays($tech_id_arr, $tech_name_arr, '_assigned_to', $_assigned_to, true, 'Unassigned');
/*
	Show the new pop-up boxes to select assigned to and/or status
*/
echo '<H2>Browse Support Requests by</H2>
	<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="6"><FORM ACTION="' . $PHP_SELF . '" METHOD="GET">
	<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . $group_id . '">
	<INPUT TYPE="HIDDEN" NAME="set" VALUE="custom">
	<TR><TD><b>Assigned User:</b></TD><TD><b>Status:</b></TD><TD><b>Category:</b></TD></TR>
	<TR><TD><FONT SIZE="-1">' . $tech_box . '</TD><TD><FONT SIZE="-1">' . support_status_box('_status', $_status, 'Any') . '</TD>' . '<TD><FONT SIZE="-1">' . support_category_box($group_id, $name = '_category', $_category, 'Any') . '</TD>' . '<TD><FONT SIZE="-1"><INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Browse"></TD></TR></FORM></TABLE>';