Example #1
0
function show_buglist($result, $offset, $set = 'open')
{
    global $sys_datefmt, $group_id, $PHP_SELF;
    /*
    	Accepts a result set from the bugs table. Should include all columns from
    	the table, and it should be joined to USER to get the user_name.
    */
    $IS_BUG_ADMIN = user_ismember($group_id, 'B2');
    echo '
		<FORM ACTION="' . $PHP_SELF . '" METHOD="POST">
		<INPUT TYPE="HIDDEN" NAME="group_id" VALUE="' . $group_id . '">
		<INPUT TYPE="HIDDEN" NAME="func" VALUE="massupdate">';
    $rows = db_numrows($result);
    $url = "/bugs/?group_id={$group_id}&set={$set}&order=";
    $title_arr = array();
    $title_arr[] = 'Bug ID';
    $title_arr[] = 'Summary';
    $title_arr[] = 'Category';
    $title_arr[] = 'Group';
    $title_arr[] = 'Status';
    $title_arr[] = 'Date';
    $title_arr[] = 'Assigned To';
    $title_arr[] = 'Submitted By';
    $links_arr = array();
    $links_arr[] = $url . 'bug_id';
    $links_arr[] = $url . 'summary';
    $links_arr[] = $url . 'category_id';
    $links_arr[] = $url . 'bug_group_id';
    $links_arr[] = $url . 'status_id';
    $links_arr[] = $url . 'date';
    $links_arr[] = $url . 'assigned_to_user';
    $links_arr[] = $url . 'submitted_by';
    echo html_build_list_table_top($title_arr, $links_arr);
    //see if the bugs are too old - so we can highlight them
    $then = time() - 2592000;
    for ($i = 0; $i < $rows && $i < 50; $i++) {
        echo '
		<TR BGCOLOR="' . get_priority_color(db_result($result, $i, 'priority')) . '">' . '<TD NOWRAP>' . ($IS_BUG_ADMIN ? '<INPUT TYPE="CHECKBOX" NAME="bug_id[]" VALUE="' . db_result($result, $i, 'bug_id') . '"> ' : '') . sprintf("%06d", db_result($result, $i, 'bug_id')) . '</TD>' . '<TD><A HREF="/bugs/?func=detailbug&bug_id=' . db_result($result, $i, 'bug_id') . '&group_id=' . db_result($result, $i, 'group_id') . '">' . db_result($result, $i, 'summary') . '</A></TD>' . '<TD>' . db_result($result, $i, 'category_name') . '</TD>' . '<TD>' . db_result($result, $i, 'group_name') . '</TD>' . '<TD>' . db_result($result, $i, 'status_name') . '</TD>' . '<TD>' . ($set != 'closed' && db_result($result, $i, 'date') < $then ? '<B>* ' : '&nbsp; ') . date($sys_datefmt, db_result($result, $i, 'date')) . '</TD>' . '<TD>' . db_result($result, $i, 'assigned_to_user') . '</TD>' . '<TD>' . db_result($result, $i, 'submitted_by') . '</TD></TR>';
    }
    /*
    	Show extra rows for <-- Prev / Next -->
    */
    echo '
		<TR><TD COLSPAN="2">';
    if ($offset > 0) {
        echo '<A HREF="' . $PHP_SELF . '?func=browse&group_id=' . $group_id . '&set=' . $set . '&offset=' . ($offset - 50) . '"><B><-- Previous 50</B></A>';
    } else {
        echo '&nbsp;';
    }
    echo '</TD><TD>&nbsp;</TD><TD COLSPAN="2">';
    if ($rows > 50) {
        echo '<A HREF="' . $PHP_SELF . '?func=browse&group_id=' . $group_id . '&set=' . $set . '&offset=' . ($offset + 50) . '"><B>Next 50 --></B></A>';
    } else {
        echo '&nbsp;';
    }
    echo '</TD></TR>';
    /*
    	Mass Update Code
    */
    if ($IS_BUG_ADMIN) {
        echo '<TR><TD COLSPAN="5">
		<FONT COLOR="#FF0000"><B>Bug Admin:</B></FONT>  If you wish to apply changes to all bugs selected above, use these controls to change their properties and click once on "Mass Update".
		<TABLE WIDTH="100%" BORDER="0">

		<TR><TD><B>Category:</B><BR>' . bug_category_box('bug_category_id', $group_id, 'xyz', 'No Change') . '</TD>
		<TD><B>Priority:</B><BR>';
        echo build_priority_select_box('priority', '5', true);
        echo '</TD></TR>

		<TR><TD><B>Bug Group:</B><BR>' . bug_group_box('bug_group_id', $group_id, 'xtz', 'No Change') . '</TD>
		<TD><B>Resolution:</B><BR>' . bug_resolution_box('resolution_id', 'xyz', 'No Change') . '</TD></TR>

		<TR><TD><B>Assigned To:</B><BR>' . bug_technician_box('assigned_to', $group_id, 'xyz', 'No Change') . '</TD>
		<TD><B>Status:</B><BR>' . bug_status_box('status_id', 'xyz', 'No Change') . '</TD></TR>

		<TR><TD COLSPAN="2" ALIGN="MIDDLE"><INPUT TYPE="SUBMIT" name="submit" VALUE="Mass Update"></TD></TR>

		</TABLE>	
		</TD></TR>';
    }
    echo '</TABLE>';
}
Example #2
0
    ?>
	</TD></TR>

	<TR><TD><B>Group:</B><BR>
	<?php 
    /*
    	List of possible bug_groups for this project
    */
    echo bug_group_box('bug_group_id', $group_id, db_result($result, 0, 'bug_group_id'));
    ?>
	</TD><TD><B>Resolution:</B><BR>
	<?php 
    /*
    	List of possible bug_resolutions
    */
    echo bug_resolution_box('resolution_id', db_result($result, 0, 'resolution_id'));
    ?>
	</TD></TR>
	<TR><TD>
		<B>Assigned To:</B><BR>
		<?php 
    /*
    	List of people that can be assigned this bug
    */
    echo bug_technician_box('assigned_to', $group_id, db_result($result, 0, 'assigned_to'));
    ?>
	</TD>
	<TD>
		<B>Status:</B><BR>
		<?php 
    /*