function print_status_option_list_plugin($p_select_label, $p_current_value = 0, $p_allow_close = false, $p_project_id = ALL_PROJECTS)
{
    $t_current_auth = access_get_project_level($p_project_id);
    #Changement de la fonction de récupération des statuts
    $t_enum_list = get_status_option_list_plugin($t_current_auth, $p_current_value, true, $p_allow_close, $p_project_id);
    if (count($t_enum_list) > 1) {
        # resort the list into ascending order
        ksort($t_enum_list);
        reset($t_enum_list);
        echo '<select ', helper_get_tab_index(), ' name="' . $p_select_label . '">';
        foreach ($t_enum_list as $key => $val) {
            #On ne veut pas afficher la valeur @0@
            if ($val == '@0@') {
                continue;
            }
            echo '<option value="' . $key . '"';
            check_selected($key, $p_current_value, false);
            #fix 1.3.0
            echo '>' . $val . '</option>';
        }
        echo '</select>';
    } else {
        if (count($t_enum_list) == 1) {
            echo array_pop($t_enum_list);
        } else {
            echo MantisEnum::getLabel(lang_get('status_enum_string'), $p_current_value);
        }
    }
}
示例#2
0
/**
 * Print Change Status to: AJAXified button
 * This code is similar to button_bug_change_status except that the 
 * button is AJAXified.
 * Uses projax.php
 *
 * @param int $p_bug_id
 * @param int $t_project_id
 * @param int $t_user_id
 * @return null
 */
function kanban_ajax_button_bug_change_status($p_bug_id, $t_project_id, $t_user_id)
{
    global $g_projax;
    $t_bug_project_id = bug_get_field($p_bug_id, 'project_id');
    $t_bug_current_state = bug_get_field($p_bug_id, 'status');
    $t_current_access = access_get_project_level($t_bug_project_id);
    $t_enum_list = get_status_option_list($t_current_access, $t_bug_current_state, false, bug_get_field($p_bug_id, 'reporter_id') == auth_get_current_user_id() && ON == config_get('allow_reporter_close'), $t_bug_project_id);
    if (count($t_enum_list) > 0) {
        # resort the list into ascending order after noting the key from the first element (the default)
        $t_default_arr = each($t_enum_list);
        $t_default = $t_default_arr['key'];
        ksort($t_enum_list);
        reset($t_enum_list);
        echo "<div id=\"ajax_statuschange\"><form method=\"post\" id=\"ajax_status_form\" action=\"xmlhttprequest.php\">";
        # CSRF protection not required here - form does not result in modifications
        echo "<input type=\"hidden\" name=\"project_id\" id=\"project_id\" value=\"{$t_project_id}\" />";
        echo "<input type=\"hidden\" name=\"user_id\" id=\"user_id\" value=\"{$t_user_id}\" />";
        echo "<input type=\"hidden\" name=\"entrypoint\" id=\"entrypoint\" value=\"bug_update_status\" />";
        $t_button_text = lang_get('bug_status_to_button');
        // AJAX button options
        $options = array('url' => plugin_page('kanban_ajax_request'), 'with' => true, 'confirm' => lang_get('confirm_change_status'), 'success' => 'location.reload()', 'failure' => 'alert("Error: " ' + request . status + ')');
        echo $g_projax->submit_to_remote('ajax_status', $t_button_text, $options);
        echo " <select name=\"new_status\">";
        # space at beginning of line is important
        foreach ($t_enum_list as $key => $val) {
            echo "<option value=\"{$key}\" ";
            check_selected($key, $t_default);
            echo ">{$val}</option>";
        }
        echo '</select>';
        $t_bug_id = string_attribute($p_bug_id);
        echo "<input type=\"hidden\" name=\"id\" value=\"{$t_bug_id}\" />\n";
        echo "</form></div>\n";
    }
}
示例#3
0
function print_option_list_from_array($p_array, $p_filter_value)
{
    foreach ($p_array as $t_key => $t_value) {
        echo "<option value='{$t_key}'";
        check_selected($p_filter_value, $t_key);
        echo '>' . string_attribute($t_value) . "</option>\n";
    }
}
示例#4
0
/**
 *  print project field
 */
function print_filter_project_id()
{
    global $t_select_modifier, $t_filter, $f_view_type;
    ?>
		<!-- Project -->
		<select<?php 
    echo $t_select_modifier;
    ?>
 name="<?php 
    echo FILTER_PROPERTY_PROJECT_ID;
    ?>
[]">
			<option value="<?php 
    echo META_FILTER_CURRENT;
    ?>
"<?php 
    check_selected($t_filter[FILTER_PROPERTY_PROJECT_ID], META_FILTER_CURRENT);
    ?>
>[<?php 
    echo lang_get('current');
    ?>
]</option>
			<?php 
    print_project_option_list($t_filter[FILTER_PROPERTY_PROJECT_ID]);
    ?>
		</select>
		<?php 
}
示例#5
0
/**
 * 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";
}
示例#6
0
/**
 * Print the option list for time zones
 * @param string $p_timezone Selected time zone.
 * @return void
 */
function print_timezone_option_list($p_timezone)
{
    if (!function_exists('timezone_identifiers_list')) {
        echo "\t" . '<option value="' . $p_timezone . '" selected="selected">' . $p_timezone . '</option>' . "\n";
        return;
    }
    $t_identifiers = timezone_identifiers_list(DateTimeZone::ALL);
    foreach ($t_identifiers as $t_identifier) {
        $t_zone = explode('/', $t_identifier);
        if (isset($t_zone[1]) != '') {
            $t_locations[$t_zone[0]][$t_zone[0] . '/' . $t_zone[1]] = array(str_replace('_', ' ', $t_zone[1]), $t_identifier);
        }
    }
    foreach ($t_locations as $t_continent => $t_locations) {
        echo "\t" . '<optgroup label="' . $t_continent . '">' . "\n";
        foreach ($t_locations as $t_location) {
            echo "\t\t" . '<option value="' . $t_location[1] . '"';
            check_selected($p_timezone, $t_location[1]);
            echo '>' . $t_location[0] . '</option>' . "\n";
        }
        echo "\t" . '</optgroup>' . "\n";
    }
}
<td><select name="bugfix_status_pvm">
<option value="0" <?php 
    echo check_selected(0, plugin_config_get('bugfix_status_pvm'));
    ?>
><?php 
    echo plugin_lang_get('bugfix_status_off');
    ?>
</option>
<?php 
    foreach (config_get('plugin_ProductMatrix_status') as $t_status => $t_name) {
        ?>
<option value="<?php 
        echo string_attribute($t_status);
        ?>
" <?php 
        echo check_selected($t_status, plugin_config_get('bugfix_status_pvm'));
        ?>
><?php 
        echo string_display_line($t_name);
        ?>
</option>
<?php 
    }
    ?>
</select></td>
</tr>
<?php 
}
?>

<tr <?php 
</label>
		</th>
		<td>
			<select <?php 
    echo helper_get_tab_index();
    ?>
 name="status">
			<?php 
    $t_resolution_options = get_status_option_list(access_get_project_level($t_project_id), config_get('bug_submit_status'), true, ON == config_get('allow_reporter_close'), $t_project_id);
    foreach ($t_resolution_options as $t_key => $t_value) {
        ?>
				<option value="<?php 
        echo $t_key;
        ?>
" <?php 
        check_selected($t_key, config_get('bug_submit_status'));
        ?>
 >
					<?php 
        echo $t_value;
        ?>
				</option>
			<?php 
    }
    ?>
			</select>
		</td>
	</tr>
<?php 
}
?>
示例#9
0
/**
 * Print the option list for time zones
 * @param string $p_timezone Selected time zone.
 * @return void
 */
function print_timezone_option_list($p_timezone)
{
    $t_identifiers = timezone_identifiers_list(DateTimeZone::ALL);
    foreach ($t_identifiers as $t_identifier) {
        $t_zone = explode('/', $t_identifier, 2);
        if (isset($t_zone[1])) {
            $t_id = $t_zone[1];
        } else {
            $t_id = $t_identifier;
        }
        $t_locations[$t_zone[0]][$t_identifier] = array(str_replace('_', ' ', $t_id), $t_identifier);
    }
    foreach ($t_locations as $t_continent => $t_locations) {
        echo "\t" . '<optgroup label="' . $t_continent . '">' . "\n";
        foreach ($t_locations as $t_location) {
            echo "\t\t" . '<option value="' . $t_location[1] . '"';
            check_selected($p_timezone, $t_location[1]);
            echo '>' . $t_location[0] . '</option>' . "\n";
        }
        echo "\t" . '</optgroup>' . "\n";
    }
}
示例#10
0
><?php 
        echo plugin_lang_get('na');
        ?>
</option>
<option value="">--</option>
<?php 
        foreach ($t_repo->branches as $t_branch) {
            if ($t_branch == $t_changeset->branch) {
                continue;
            }
            ?>
<option value="<?php 
            echo string_attribute($t_branch);
            ?>
" <?php 
            echo check_selected($t_branch, $t_changeset->ported);
            ?>
><?php 
            echo string_display_line($t_branch);
            ?>
</option>
<?php 
        }
        ?>
</select>
<input type="submit" value="<?php 
        echo plugin_lang_get('update');
        ?>
"/>
<?php 
    } else {
示例#11
0
function ERP_custom_function_print_tag_attach_option_list($p_sel_value)
{
    require_api('tag_api.php');
    $t_rows = tag_get_candidates_for_bug(0);
    foreach ($t_rows as $row) {
        $t_string = $row['name'];
        if (!empty($row['description'])) {
            $t_string .= ' - ' . utf8_substr($row['description'], 0, 20);
        }
        echo '<option value="', $row['id'], '" title="', string_attribute($row['name']), '"';
        check_selected((array) $p_sel_value, (int) $row['id']);
        echo '>', string_attribute($t_string), '</option>';
    }
}
示例#12
0
function print_language_option_list($p_language)
{
    $t_arr = config_get('language_choices_arr');
    $enum_count = count($t_arr);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_language = string_attribute($t_arr[$i]);
        print "<option value=\"{$t_language}\"";
        check_selected($t_language, $p_language);
        print ">{$t_language}</option>";
    }
    # end for
}
示例#13
0
function print_filter_custom_field_date($p_field_num, $p_field_id)
{
    global $t_filter, $t_accessible_custom_fields_names, $t_accessible_custom_fields_types, $t_accessible_custom_fields_values, $t_accessible_custom_fields_ids, $t_select_modifier;
    $t_js_toggle_func = "toggle_custom_date_field_" . $p_field_id . "_controls";
    # Resort the values so there ordered numerically, they are sorted as strings otherwise which
    # may be wrong for dates before early 2001.
    if (is_array($t_accessible_custom_fields_values[$p_field_num])) {
        array_multisort($t_accessible_custom_fields_values[$p_field_num], SORT_NUMERIC, SORT_ASC);
    }
    if (isset($t_accessible_custom_fields_values[$p_field_num][0])) {
        $t_sel_start_year = date('Y', $t_accessible_custom_fields_values[$p_field_num][0]);
    }
    $t_count = count($t_accessible_custom_fields_values[$p_field_num]);
    if (isset($t_accessible_custom_fields_values[$p_field_num][$t_count - 1])) {
        $t_sel_end_year = date('Y', $t_accessible_custom_fields_values[$p_field_num][$t_count - 1]);
    }
    $t_start = date('U');
    # Default to today in filters..
    $t_end = $t_start;
    if (isset($t_filter['custom_fields'][$p_field_id][1])) {
        $t_start_time = $t_filter['custom_fields'][$p_field_id][1];
    } else {
        $t_start_time = 0;
    }
    if (isset($t_filter['custom_fields'][$p_field_id][2])) {
        $t_end_time = $t_filter['custom_fields'][$p_field_id][2];
    } else {
        $t_end_time = 0;
    }
    $t_start_disable = true;
    $t_end_disable = true;
    // if $t_filter['custom_fields'][$p_field_id][0] is not set (ie no filter), we will drop through the
    // following switch and use the default values above, so no need to check if stuff is set or not.
    switch ($t_filter['custom_fields'][$p_field_id][0]) {
        case CUSTOM_FIELD_DATE_ANY:
        case CUSTOM_FIELD_DATE_NONE:
            break;
        case CUSTOM_FIELD_DATE_BETWEEN:
            $t_start_disable = false;
            $t_end_disable = false;
            $t_start = $t_start_time;
            $t_end = $t_end_time;
            break;
        case CUSTOM_FIELD_DATE_ONORBEFORE:
            $t_start_disable = false;
            $t_start = $t_end_time;
            break;
        case CUSTOM_FIELD_DATE_BEFORE:
            $t_start_disable = false;
            $t_start = $t_end_time;
            break;
        case CUSTOM_FIELD_DATE_ON:
            $t_start_disable = false;
            $t_start = $t_start_time;
            break;
        case CUSTOM_FIELD_DATE_AFTER:
            $t_start_disable = false;
            $t_start = $t_start_time;
            break;
        case CUSTOM_FIELD_DATE_ONORAFTER:
            $t_start_disable = false;
            $t_start = $t_start_time;
            break;
    }
    echo "\n<table cellspacing=\"0\" cellpadding=\"0\"><tr><td>\n";
    echo "<select size=\"1\" name=\"custom_field_" . $p_field_id . "_control\" OnChange=\"" . $t_js_toggle_func . "();\">\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_ANY . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ANY);
    echo '>' . lang_get('any') . '</option>' . "\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_NONE . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_NONE);
    echo '>' . lang_get('none') . '</option>' . "\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_BETWEEN . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_BETWEEN);
    echo '>' . lang_get('between') . '</option>' . "\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_ONORBEFORE . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ONORBEFORE);
    echo '>' . lang_get('on_or_before') . '</option>' . "\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_BEFORE . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_BEFORE);
    echo '>' . lang_get('before') . '</option>' . "\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_ON . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ON);
    echo '>' . lang_get('on') . '</option>' . "\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_AFTER . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_AFTER);
    echo '>' . lang_get('after') . '</option>' . "\n";
    echo '<option value="' . CUSTOM_FIELD_DATE_ONORAFTER . '"';
    check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ONORAFTER);
    echo '>' . lang_get('on_or_after') . '</option>' . "\n";
    echo '</select>' . "\n";
    echo "</td></tr>\n<tr><td>";
    print_date_selection_set("custom_field_" . $p_field_id . "_start", config_get('short_date_format'), $t_start, $t_start_disable, false, $t_sel_start_year, $t_sel_end_year);
    print "</td></tr>\n<tr><td>";
    print_date_selection_set("custom_field_" . $p_field_id . "_end", config_get('short_date_format'), $t_end, $t_end_disable, false, $t_sel_start_year, $t_sel_end_year);
    print "</td></tr>\n</table>";
}
示例#14
0
<?php if( $t_show_status ) { ?>
			<div class="field-container">
				<label><span><?php echo lang_get( 'status' ) ?></span></label>
				<span class="select">
					<select <?php echo helper_get_tab_index() ?> name="status">
					<?php
					$t_resolution_options = get_status_option_list(
						access_get_project_level( $t_project_id ),
						config_get( 'bug_submit_status' ),
						true,
						ON == config_get( 'allow_reporter_close' ),
						$t_project_id );
					foreach ( $t_resolution_options as $t_key => $t_value ) {
					?>
						<option value="<?php echo $t_key ?>" <?php check_selected( $t_key, config_get( 'bug_submit_status' ) ); ?> >
							<?php echo $t_value ?>
						</option>
					<?php } ?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>
<?php } ?>

<?php if( $t_show_resolution ) { ?>
			<div class="field-container">
				<label><span><?php echo lang_get( 'resolution' ) ?></span></label>
				<span class="select">
					<select <?php echo helper_get_tab_index() ?> name="resolution">
						<?php
echo helper_alternate_class();
?>
 >
	<td class="category" width="60%">
		<?php 
echo lang_get('custom_field');
?>
	</td>
	<td width="20%">
		<select name="customid_field_id">
			<?php 
$t_custom_fields = custom_field_get_ids();
foreach ($t_custom_fields as $t_field_id) {
    $t_desc = custom_field_get_definition($t_field_id);
    echo "<option value=\"{$t_field_id}\"";
    check_selected($t_field_id, plugin_config_get('field_id'));
    echo ">" . string_attribute($t_desc['name']) . '</option>';
}
?>
		</select>
	</td>
</tr>

<tr <?php 
echo helper_alternate_class();
?>
 >
	<td class="category" width="60%">
		<?php 
echo plugin_lang_get('config_prefix');
?>
示例#16
0
/**
 * Generate an html option list for the given array
 * @param array  $p_array        Array.
 * @param string $p_filter_value The selected value.
 * @return void
 */
function print_option_list_from_array(array $p_array, $p_filter_value)
{
    foreach ($p_array as $t_key => $t_value) {
        echo '<option value="' . $t_key . '"';
        check_selected((string) $p_filter_value, (string) $t_key);
        echo '>' . string_attribute($t_value) . '</option>' . "\n";
    }
}
示例#17
0
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";
}
示例#18
0
function html_option_list_access_level($p_access_level = '')
{
    $ids = enum_get_ids_array('access_levels');
    foreach ($ids as $id) {
        if (NOBODY == $id || EVERYBODY == $id) {
            continue;
        }
        echo '<option value="' . $id . '" ';
        check_selected($p_access_level, $id);
        echo '>' . enum_get_element('access_levels', $id) . '</option>';
    }
}
示例#19
0
/**
 * Print filter match type selector
 * @return void
 */
function print_filter_match_type()
{
    global $g_select_modifier, $g_filter;
    ?>
		<!-- Project -->
		<select <?php 
    echo $g_select_modifier;
    ?>
 name="<?php 
    echo FILTER_PROPERTY_MATCH_TYPE;
    ?>
">
			<option value="<?php 
    echo FILTER_MATCH_ALL;
    ?>
" <?php 
    check_selected($g_filter[FILTER_PROPERTY_MATCH_TYPE], FILTER_MATCH_ALL);
    ?>
>[<?php 
    echo lang_get('filter_match_all');
    ?>
]</option>
			<option value="<?php 
    echo FILTER_MATCH_ANY;
    ?>
" <?php 
    check_selected($g_filter[FILTER_PROPERTY_MATCH_TYPE], FILTER_MATCH_ANY);
    ?>
>[<?php 
    echo lang_get('filter_match_any');
    ?>
]</option>
		</select>
		<?php 
}
function print_type($edit_page, $current_type, $version)
{
    $specmanagement_database_api = new specmanagement_database_api();
    echo '<td>';
    if ($edit_page) {
        $types = array();
        $types_rows = $specmanagement_database_api->get_full_types();
        foreach ($types_rows as $types_row) {
            $types[] = $types_row[1];
        }
        echo '<span class="select">';
        echo '<select ' . helper_get_tab_index() . ' id="proj-version-type" name="type[]">';
        echo '<option value=""></option>';
        foreach ($types as $type) {
            echo '<option value="' . $type . '"';
            check_selected(string_attribute($current_type), $type);
            echo '>' . $type . '</option>';
        }
        echo '</select>';
    } else {
        $type_id = $specmanagement_database_api->get_type_by_version($version['id']);
        $type_string = $specmanagement_database_api->get_type_string($type_id);
        echo string_display($type_string);
    }
    echo '</td>';
}
示例#21
0
function print_timezone_option_list($p_timezone)
{
    if (!function_exists('timezone_identifiers_list')) {
        echo "\t<option value=\"{$p_timezone}\" selected=\"selected\">{$p_timezone}</option>\n";
        return;
    }
    $t_identifiers = timezone_identifiers_list();
    foreach ($t_identifiers as $t_identifier) {
        $t_zone = explode('/', $t_identifier);
        // Only use "friendly" continent names - http://us.php.net/manual/en/timezones.others.php
        if ($t_zone[0] == 'Africa' || $t_zone[0] == 'America' || $t_zone[0] == 'Antarctica' || $t_zone[0] == 'Arctic' || $t_zone[0] == 'Asia' || $t_zone[0] == 'Atlantic' || $t_zone[0] == 'Australia' || $t_zone[0] == 'Europe' || $t_zone[0] == 'Indian' || $t_zone[0] == 'Pacific') {
            if (isset($t_zone[1]) != '') {
                $t_locations[$t_zone[0]][$t_zone[0] . '/' . $t_zone[1]] = array(str_replace('_', ' ', $t_zone[1]), $t_identifier);
            }
        }
    }
    foreach ($t_locations as $t_continent => $t_locations) {
        echo "\t<optgroup label=\"{$t_continent}\">\n";
        foreach ($t_locations as $t_location) {
            echo "\t\t<option value=\"" . $t_location[1] . '"';
            check_selected($p_timezone, $t_location[1]);
            echo '>' . $t_location[0] . "</option>\n";
        }
        echo "\t</optgroup>\n";
    }
}
示例#22
0
?>
				</select>

				<select name="category">
					<option value=""><?php 
echo plugin_lang_get('all');
?>
</option>
					<?php 
foreach (array_keys($categories) as $category_name) {
    ?>
					<option value="<?php 
    echo $category_name;
    ?>
" <?php 
    check_selected($category, $category_name);
    ?>
>
						<?php 
    echo $category_name;
    ?>
					</option>
					<?php 
}
?>
				</select>

				<input type="submit" value="Go" />
			</form>
		</td>
	</tr>