/** * print the handler field * @return void */ function print_filter_handler_id() { global $g_select_modifier, $g_filter, $f_view_type; ?> <!-- Handler --> <select<?php echo $g_select_modifier; ?> name="<?php echo FILTER_PROPERTY_HANDLER_ID; ?> []"> <option value="<?php echo META_FILTER_ANY; ?> "<?php check_selected($g_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_ANY); ?> >[<?php echo lang_get('any'); ?> ]</option> <?php if (access_has_project_level(config_get('view_handler_threshold'))) { ?> <option value="<?php echo META_FILTER_NONE; ?> "<?php check_selected($g_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_NONE); ?> >[<?php echo lang_get('none'); ?> ]</option> <?php if (access_has_project_level(config_get('handle_bug_threshold'))) { echo '<option value="' . META_FILTER_MYSELF . '" '; check_selected($g_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_MYSELF); echo '>[' . lang_get('myself') . ']</option>'; } print_assign_to_option_list($g_filter[FILTER_PROPERTY_HANDLER_ID]); } ?> </select> <?php }
?> <tr> <th class="category"> <label for="handler_id"><?php echo lang_get('assign_to'); ?> </label> </th> <td> <select <?php echo helper_get_tab_index(); ?> id="handler_id" name="handler_id"> <option value="0" selected="selected"></option> <?php print_assign_to_option_list($f_handler_id); ?> </select> </td> </tr> <?php } ?> <?php if ($t_show_status) { ?> <tr> <th class="category"> <label for="status"><?php echo lang_get('status');
echo '<td colspan="', $t_spacer, '"> </td>'; echo '</tr>'; } # # Assigned To, Due Date # if ($t_show_handler || $t_show_due_date) { echo '<tr>'; $t_spacer = 2; # Assigned To echo '<th class="category"><label for="handler_id">' . lang_get('assigned_to') . '</label></th>'; echo '<td>'; if (access_has_project_level(config_get('update_bug_assign_threshold', config_get('update_bug_threshold')))) { echo '<select ' . helper_get_tab_index() . ' id="handler_id" name="handler_id">'; echo '<option value="0"></option>'; print_assign_to_option_list($t_bug->handler_id, $t_bug->project_id); echo '</select>'; } else { echo $t_handler_name; } echo '</td>'; if ($t_show_due_date) { # Due Date echo '<th class="category"><label for="due_date">' . lang_get('due_date') . '</label></th>'; if (bug_is_overdue($t_bug_id)) { echo '<td class="overdue">'; } else { echo '<td>'; } if (access_has_bug_level(config_get('due_date_update_threshold'), $t_bug_id)) { $t_date_to_display = '';
<fieldset> <legend><span><?php echo lang_get( 'edit_project_category_title' ) ?></span></legend> <?php echo form_security_field( 'manage_proj_cat_update' ) ?> <input type="hidden" name="project_id" value="<?php echo $f_project_id ?>"/> <input type="hidden" name="category_id" value="<?php echo string_attribute( $f_category_id ) ?>" /> <div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>"> <label for="proj-category-name"><span><?php echo lang_get( 'category' ) ?></span></label> <span class="input"><input type="text" id="proj-category-name" name="name" size="32" maxlength="128" value="<?php echo string_attribute( $t_name ) ?>" /></span> <span class="label-style"></span> </div> <div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>"> <label for="proj-category-assigned-to"><span><?php echo lang_get( 'assigned_to' ) ?></span></label> <span class="select"> <select id="proj-category-assigned-to" name="assigned_to"> <option value="0"></option> <?php print_assign_to_option_list( $t_assigned_to, $t_project_id ) ?> </select> </span> <span class="label-style"></span> </div> <span class="submit-button"><input type="submit" class="button" value="<?php echo lang_get( 'update_category_button' ) ?>" /></span> </fieldset> </form> </div> <div class="form-container"> <form method="post" action="manage_proj_cat_delete.php" class="action-button"> <fieldset> <?php echo form_security_field( 'manage_proj_cat_delete' ) ?> <input type="hidden" name="id" value="<?php echo string_attribute( $f_category_id ) ?>" /> <input type="hidden" name="project_id" value="<?php echo string_attribute( $f_project_id ) ?>" />
function html_button_bug_assign_to($p_bug_id) { # make sure status is allowed of assign would cause auto-set-status $t_status = bug_get_field($p_bug_id, 'status'); # workflow implementation if (ON == config_get('auto_set_status_to_assigned') && !bug_check_workflow($t_status, config_get('bug_assigned_status'))) { # workflow return; } # make sure current user has access to modify bugs. if (!access_has_bug_level(config_get('update_bug_assign_threshold', config_get('update_bug_threshold')), $p_bug_id)) { return; } $t_reporter_id = bug_get_field($p_bug_id, 'reporter_id'); $t_handler_id = bug_get_field($p_bug_id, 'handler_id'); $t_current_user_id = auth_get_current_user_id(); $t_new_status = ON == config_get('auto_set_status_to_assigned') ? config_get('bug_assigned_status') : $t_status; $t_options = array(); $t_default_assign_to = null; if ($t_handler_id != $t_current_user_id && access_has_bug_level(config_get('handle_bug_threshold'), $p_bug_id, $t_current_user_id)) { $t_options[] = array($t_current_user_id, '[' . lang_get('myself') . ']'); $t_default_assign_to = $t_current_user_id; } if ($t_handler_id != $t_reporter_id && user_exists($t_reporter_id) && access_has_bug_level(config_get('handle_bug_threshold'), $p_bug_id, $t_reporter_id)) { $t_options[] = array($t_reporter_id, '[' . lang_get('reporter') . ']'); if ($t_default_assign_to === null) { $t_default_assign_to = $t_reporter_id; } } print "<form method=\"post\" action=\"bug_assign.php\">"; $t_button_text = lang_get('bug_assign_to_button'); print "<input type=\"submit\" class=\"button\" value=\"{$t_button_text}\" />"; print " <select name=\"handler_id\">"; # space at beginning of line is important $t_already_selected = false; foreach ($t_options as $t_entry) { $t_id = string_attribute($t_entry[0]); $t_caption = string_attribute($t_entry[1]); # if current user and reporter can't be selected, then select the first # user in the list. if ($t_default_assign_to === null) { $t_default_assign_to = $t_id; } print "<option value=\"{$t_id}\" "; if ($t_id == $t_default_assign_to && !$t_already_selected) { check_selected($t_id, $t_default_assign_to); $t_already_selected = true; } print ">{$t_caption}</option>"; } # allow un-assigning if already assigned. if ($t_handler_id != 0) { print "<option value=\"0\"></option>"; } $t_project_id = bug_get_field($p_bug_id, 'project_id'); # 0 means currently selected print_assign_to_option_list(0, $t_project_id); print "</select>"; $t_bug_id = string_attribute($p_bug_id); print "<input type=\"hidden\" name=\"bug_id\" value=\"{$t_bug_id}\" />\n"; print "</form>\n"; }
$t_bug_id = null; # if there is only one issue, use its current value as default, otherwise, # use the default value specified in custom field definition. if (sizeof($f_bug_arr) == 1) { $t_bug_id = $f_bug_arr[0]; } print_custom_field_input($t_custom_field_def, $t_bug_id); } else { echo "<select name=\"{$t_form}\">"; switch ($f_action) { case 'COPY': case 'MOVE': print_project_option_list(null, false); break; case 'ASSIGN': print_assign_to_option_list(0, $t_project_id); break; case 'VIEW_STATUS': print_enum_string_option_list('view_state', config_get('default_bug_view_status')); break; case 'UP_CATEGORY': print_category_option_list(); break; case 'UP_TARGET_VERSION': case 'UP_FIXED_IN_VERSION': print_version_option_list('', $t_project_id, VERSION_ALL); break; } # other forms use the same function to display the list if ($t_request > '') { print_enum_string_option_list($t_request, FIXED);
/** * Print Assign To: combo box of possible handlers * @param BugData $p_bug Bug object. * @return void */ function html_button_bug_assign_to(BugData $p_bug) { # make sure status is allowed of assign would cause auto-set-status # workflow implementation if (ON == config_get('auto_set_status_to_assigned') && !bug_check_workflow($p_bug->status, config_get('bug_assigned_status'))) { return; } # make sure current user has access to modify bugs. if (!access_has_bug_level(config_get('update_bug_assign_threshold', config_get('update_bug_threshold')), $p_bug->id)) { return; } $t_current_user_id = auth_get_current_user_id(); $t_options = array(); $t_default_assign_to = null; if ($p_bug->handler_id != $t_current_user_id && access_has_bug_level(config_get('handle_bug_threshold'), $p_bug->id, $t_current_user_id)) { $t_options[] = array($t_current_user_id, '[' . lang_get('myself') . ']'); $t_default_assign_to = $t_current_user_id; } if ($p_bug->handler_id != $p_bug->reporter_id && user_exists($p_bug->reporter_id) && access_has_bug_level(config_get('handle_bug_threshold'), $p_bug->id, $p_bug->reporter_id)) { $t_options[] = array($p_bug->reporter_id, '[' . lang_get('reporter') . ']'); if ($t_default_assign_to === null) { $t_default_assign_to = $p_bug->reporter_id; } } echo '<form method="post" action="bug_update.php">'; echo form_security_field('bug_update'); $t_button_text = lang_get('bug_assign_to_button'); echo '<input type="submit" class="button" value="' . $t_button_text . '" />'; echo ' <select name="handler_id">'; # space at beginning of line is important $t_already_selected = false; foreach ($t_options as $t_entry) { $t_id = (int) $t_entry[0]; $t_caption = string_attribute($t_entry[1]); # if current user and reporter can't be selected, then select the first # user in the list. if ($t_default_assign_to === null) { $t_default_assign_to = $t_id; } echo '<option value="' . $t_id . '" '; if ($t_id == $t_default_assign_to && !$t_already_selected) { check_selected($t_id, $t_default_assign_to); $t_already_selected = true; } echo '>' . $t_caption . '</option>'; } # allow un-assigning if already assigned. if ($p_bug->handler_id != 0) { echo '<option value="0"></option>'; } # 0 means currently selected print_assign_to_option_list(0, $p_bug->project_id); echo '</select>'; $t_bug_id = string_attribute($p_bug->id); echo '<input type="hidden" name="bug_id" value="' . $t_bug_id . '" />' . "\n"; echo '</form>' . "\n"; }
</td> </tr> <tr <?php echo helper_alternate_class(); ?> > <td class="category"> <?php echo lang_get('assigned_to'); ?> </td> <td> <select name="assigned_to"> <option value="0"></option> <?php print_assign_to_option_list($t_assigned_to, $f_project_id); ?> </select> </td> </tr> <tr> <td> </td> <td> <input type="submit" class="button" value="<?php echo lang_get('update_category_button'); ?> " /> </td> </tr>
if ( access_has_bug_level( config_get( 'update_bug_assign_threshold', config_get( 'update_bug_threshold' ) ), $f_bug_id ) ) { $t_suggested_handler_id = $t_bug->handler_id; if ( $t_suggested_handler_id == NO_USER && access_has_bug_level( config_get( 'handle_bug_threshold' ), $f_bug_id ) ) { $t_suggested_handler_id = $t_current_user_id; } ?> <!-- Assigned To --> <tr <?php echo helper_alternate_class() ?>> <th class="category"> <?php echo lang_get( 'assigned_to' ) ?> </th> <td> <select name="handler_id"> <option value="0"></option> <?php print_assign_to_option_list( $t_suggested_handler_id, $t_bug->project_id ) ?> </select> </td> </tr> <?php } ?> <!-- Due date --> <?php if ( $t_can_update_due_date ) { $t_date_to_display = ''; if ( !date_is_null( $t_bug->due_date ) ) { $t_date_to_display = date( config_get( 'calendar_date_format' ), $t_bug->due_date ); } ?> <tr <?php echo helper_alternate_class() ?>> <th class="category"> <?php print_documentation_link( 'due_date' ) ?>