当前位置: 首页>>代码示例>>PHP>>正文


PHP get_enum_element函数代码示例

本文整理汇总了PHP中get_enum_element函数的典型用法代码示例。如果您正苦于以下问题:PHP get_enum_element函数的具体用法?PHP get_enum_element怎么用?PHP get_enum_element使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_enum_element函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayResultsCore

function displayResultsCore($query, $fields)
{
    $result = db_query_bound($query);
    $nbRows = 0;
    while ($row = db_fetch_array($result)) {
        $nbRows++;
        $t_bug = bug_get($row['id']);
        print "<tr> \n";
        print '<td><a href="' . string_get_bug_view_url($row['id']) . '">' . bug_format_id($row['id']) . '</a></td>';
        //print "<td> ".string_get_bug_view_url( ))." </td>\n";
        print "<td> " . string_display_line(get_enum_element('status', $t_bug->status)) . " </td>\n";
        print "<td> " . category_get_row($t_bug->category_id)['name'] . " </td>\n";
        print "<td> " . $t_bug->summary . " </td>\n";
        print "<td> " . user_get_field($t_bug->reporter_id, 'username') . " </td>\n";
        if ($t_bug->handler_id != null) {
            print "<td> " . user_get_field($t_bug->handler_id, 'username') . " </td>\n";
        }
        if (sizeof($fields) > 0) {
            for ($i = 0; $i < sizeof($fields); $i++) {
                print "<td> " . $row[$fields[$i]] . " </td>\n";
            }
        }
        print "</tr>\n";
    }
    return $nbRows;
}
开发者ID:bcramet,项目名称:CAMOSInternal,代码行数:26,代码来源:plugin_bug_util.php

示例2: action_add_note_print_fields

/**
 * Prints the field within the custom action form.  This has an entry for
 * every field the user need to supply + the submit button.  The fields are
 * added as rows in a table that is already created by the calling code.
 * A row has two columns.
 */
function action_add_note_print_fields()
{
    echo '<tr class="row-1" valign="top"><td class="category">', lang_get('add_bugnote_title'), '</td><td><textarea name="bugnote_text" cols="80" rows="10"></textarea></td></tr>';
    ?>
	<!-- View Status -->
	<tr class="row-2">
	<td class="category">
		<?php 
    echo lang_get('view_status');
    ?>
	</td>
	<td>
<?php 
    $t_default_state = config_get('default_bugnote_view_status');
    if (access_has_project_level(config_get('set_view_status_threshold'))) {
        ?>
			<select name="view_state">
				<?php 
        print_enum_string_option_list('view_state', $t_default_state);
        ?>
			</select>
<?php 
    } else {
        echo get_enum_element('view_state', $t_default_state);
        echo '<input type="hidden" name="view_state" value="', $t_default_state, '" />';
    }
    ?>
	</td>
	</tr>
	<?php 
    echo '<tr><td colspan="2"><center><input type="submit" class="button" value="' . lang_get('add_bugnote_button') . ' " /></center></td></tr>';
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:38,代码来源:bug_actiongroup_add_note_inc.php

示例3: icon_get_status_icon

/**
 * gets the status icon
 * @param string $p_icon
 * @return string html img tag containing status icon
 * @access public
 */
function icon_get_status_icon( $p_icon ) {
	$t_icon_path = config_get( 'icon_path' );
	$t_status_icon_arr = config_get( 'status_icon_arr' );
	$t_priotext = get_enum_element( 'priority', $p_icon );
	if( isset( $t_status_icon_arr[$p_icon] ) && !is_blank( $t_status_icon_arr[$p_icon] ) ) {
		return "<img src=\"$t_icon_path$t_status_icon_arr[$p_icon]\" alt=\"\" title=\"$t_priotext\" />";
	} else {
		return "&#160;";
	}
}
开发者ID:rombert,项目名称:mantisbt,代码行数:16,代码来源:icon_api.php

示例4: icon_get_status_icon

/**
 * gets the status icon
 * @param string $p_icon Icon file name.
 * @return string html img tag containing status icon
 * @access public
 */
function icon_get_status_icon($p_icon)
{
    $t_icon_path = config_get('icon_path');
    $t_status_icon_arr = config_get('status_icon_arr');
    $t_priotext = get_enum_element('priority', $p_icon);
    if (isset($t_status_icon_arr[$p_icon]) && !is_blank($t_status_icon_arr[$p_icon])) {
        return '<img src="' . $t_icon_path . $t_status_icon_arr[$p_icon] . '" alt="" title="' . $t_priotext . '" />';
    } else {
        return '&#160;';
    }
}
开发者ID:gtn,项目名称:mantisbt,代码行数:17,代码来源:icon_api.php

示例5: reminder_print_status_option_list

function reminder_print_status_option_list($p_name)
{
    $t_enum_values = MantisEnum::getValues(config_get('status_enum_string'));
    $t_selection = plugin_config_get($p_name);
    echo '<select name="' . $p_name . '[]" multiple="multiple" size="' . count($t_enum_values) . '">';
    foreach ($t_enum_values as $t_key) {
        $t_elem2 = get_enum_element('status', $t_key);
        echo '<option value="' . $t_key . '"';
        reminder_check_selected($t_selection, $t_key);
        echo '>' . $t_elem2 . '</option>';
    }
    echo '</select>';
}
开发者ID:rahmanjis,项目名称:dipstart-development,代码行数:13,代码来源:config.php

示例6: custom_function_default_roadmap_print_issue

function custom_function_default_roadmap_print_issue($p_issue_id, $p_issue_level = 0)
{
    $t_bug = bug_get($p_issue_id);
    if (bug_is_resolved($p_issue_id)) {
        $t_strike_start = '<strike>';
        $t_strike_end = '</strike>';
    } else {
        $t_strike_start = $t_strike_end = '';
    }
    $t_category = is_blank($t_bug->category) ? '' : '<b>[' . $t_bug->category . ']</b> ';
    echo str_pad('', $p_issue_level * 6, '&nbsp;'), '- ', $t_strike_start, string_get_bug_view_link($p_issue_id), ': ', $t_category, string_display_line_links($t_bug->summary);
    if ($t_bug->handler_id != 0) {
        echo ' (', prepare_user_name($t_bug->handler_id), ')';
    }
    echo ' - ', get_enum_element('status', $t_bug->status), $t_strike_end, '.<br />';
}
开发者ID:amjadtbssm,项目名称:website,代码行数:16,代码来源:custom_function_api.php

示例7: buildNotificationEmails

 /**
  * Builds notification emails for the selected customers about changes made in bugs reports they are linked to
  *
  * @param array $customer_ids the ids of the customer to notify
  * @param string $from the start of the interval
  * @param string $to the end of the interval
  *
  * @return array notified customers
  */
 static function buildNotificationEmails($customer_ids, $from, $to)
 {
     $emails = array();
     lang_push(plugin_config_get('email_notification_language'));
     $fromDate = self::startOfDay(strtotime($from));
     $toDate = self::endOfDay(strtotime($to));
     $changedBugIds = CustomerManagementDao::findAllChangedBugIds($customer_ids, $fromDate, $toDate);
     $dateFormat = config_get('short_date_format');
     foreach ($customer_ids as $customer_id) {
         $changesForCustomer = array();
         foreach ($changedBugIds as $changedBugId) {
             if ($changedBugId['customer_id'] == $customer_id) {
                 $changesForCustomer[] = array('bug' => bug_get($changedBugId['bug_id']));
             }
         }
         if (count($changesForCustomer) > 0) {
             $counter = 0;
             $text = '';
             foreach ($changesForCustomer as $changeForCustomer) {
                 $counter++;
                 $bugId = $changeForCustomer['bug']->id;
                 $text .= $counter . '. ';
                 $text .= sprintf(plugin_lang_get('email_notification_bug_header'), $changeForCustomer['bug']->id, $changeForCustomer['bug']->summary, date($dateFormat, $changeForCustomer['bug']->date_submitted), get_enum_element('status', $changeForCustomer['bug']->status));
                 $text .= "\n";
                 $reporterName = user_get_name($changeForCustomer['bug']->reporter_id);
                 $reporterEmail = user_get_email($changeForCustomer['bug']->reporter_id);
                 $text .= sprintf(plugin_lang_get('email_notification_bug_reported_by'), $reporterName, $reporterEmail);
                 $text .= "\n";
                 $text .= sprintf(plugin_lang_get('email_notification_bug_description'), $changeForCustomer['bug']->description);
                 $text .= "\n\n";
             }
             $customer = CustomerManagementDao::getCustomer($customer_id);
             $email = new EmailData();
             $email->email = $customer['email'];
             $email->subject = sprintf(plugin_lang_get('email_notification_title'), $customer['name'], $from, $to);
             $email->body = $text;
             $email->metadata['priority'] = config_get('mail_priority');
             $email->metadata['charset'] = 'utf-8';
             array_push($emails, $email);
         }
     }
     lang_pop();
     return $emails;
 }
开发者ID:WilfriedMartin,项目名称:customer-management,代码行数:53,代码来源:CustomerNotifier.php

示例8: addExtraBugData

function addExtraBugData($bug)
{
    $bug["project_name"] = project_get_name($bug["project_id"]);
    if ($bug["reporter_id"] != "") {
        $bug["reporter_name"] = user_get_field($bug["reporter_id"], 'username');
    }
    $bug["severity_name"] = get_enum_element('severity', $bug["severity"]);
    $bug["priority_name"] = get_enum_element('priority', $bug["priority"]);
    $bug["status_name"] = get_enum_element('status', $bug["status"]);
    $bug["reproducibility_name"] = get_enum_element('reproducibility', $bug["reproducibility"]);
    if ($bug["handler_id"] == "") {
        $bug["handler_name"] = user_get_field($bug["handler_id"], 'username');
    }
    $bug["projection_name"] = get_enum_element('projection', $bug["projection"]);
    $bug["eta_name"] = get_enum_element('eta', $bug["eta"]);
    $bug["resolution_name"] = get_enum_element('resolution', $bug["resolution"]);
    $bug["description"] = bug_get_text_field($bug["id"], 'description');
    return $bug;
}
开发者ID:n2i,项目名称:xvnkb,代码行数:19,代码来源:mantishelper.php

示例9: get_status_option_list_plugin

function get_status_option_list_plugin($p_user_auth = 0, $p_current_value = 0, $p_show_current = true, $p_add_close = false, $p_project_id = ALL_PROJECTS)
{
    $t_config_var_value = config_get('status_enum_string', null, null, $p_project_id);
    $t_enum_workflow = config_get('status_enum_workflow', null, null, $p_project_id);
    $t_enum_values = MantisEnum::getValues($t_config_var_value);
    $t_enum_list = array();
    foreach ($t_enum_values as $t_enum_value) {
        if (($p_show_current || $p_current_value != $t_enum_value) && access_compare_level($p_user_auth, access_get_status_threshold($t_enum_value, $p_project_id))) {
            $t_enum_list[$t_enum_value] = get_enum_element('status', $t_enum_value);
        }
    }
    if ($p_show_current) {
        $t_enum_list[$p_current_value] = get_enum_element('status', $p_current_value);
    }
    if ($p_add_close && access_compare_level($p_current_value, config_get('bug_resolved_status_threshold', null, null, $p_project_id))) {
        $t_closed = config_get('bug_closed_status_threshold', null, null, $p_project_id);
        if ($p_show_current || $p_current_value != $t_closed) {
            $t_enum_list[$t_closed] = get_enum_element('status', $t_closed);
        }
    }
    return $t_enum_list;
}
开发者ID:nenes25,项目名称:mantisbt_autochangestatus,代码行数:22,代码来源:functions.php

示例10: renderLists

 function renderLists()
 {
     $content = '';
     $status_codes = config_get('status_enum_string');
     $t_status_array = MantisEnum::getAssocArrayIndexedByValues($status_codes);
     foreach ($t_status_array as $status => $statusCode) {
         if ($statusCode != "backlog" && $statusCode != "closed") {
             $issues = $this->renderIssues($status);
             $statusName = string_display_line(get_enum_element('status', $status));
             $content .= '<div class="column">
                                 <div class="inside"
                                 style="background-color: ' . get_status_color($status) . '"
                                 id="' . $status . '">
                                 <h5 title="' . $status . '">' . $statusName . ' (' . sizeof($issues) . ')</h5>';
             $content .= implode("\n", $issues);
             $content .= '</div>';
             // inside
             $content .= '</div>';
             // column
         }
     }
     return $content;
 }
开发者ID:pedroresende,项目名称:MantisBTKanbanBoard,代码行数:23,代码来源:kanban.php

示例11: display_commit_message

 function display_commit_message($event, $bugid)
 {
     if (!$bugid) {
         return;
     }
     $t_fields = config_get('bug_view_page_fields');
     $t_fields = columns_filter_disabled($t_fields);
     $tpl_show_id = in_array('id', $t_fields);
     $tpl_show_description = in_array('description', $t_fields);
     $tpl_show_status = in_array('status', $t_fields);
     if ($tpl_show_id && $tpl_show_description && $tpl_show_status) {
         bug_ensure_exists($bugid);
         $bug = bug_get($bugid, true);
         access_ensure_bug_level(VIEWER, $bugid);
         $tpl_description = string_display_links($bug->summary);
         $tpl_status = get_enum_element('status', $bug->status);
         $tpl_link = config_get('path') . string_get_bug_view_url($bugid, null);
         $message = sprintf('%s - #JJ%d: %s<br/>%s', strtoupper($tpl_status), $bugid, $tpl_description, $tpl_link);
         echo '<tr ', helper_alternate_class(), '>';
         echo '<td class="category">', plugin_lang_get('commit_message'), '</td>';
         echo '<td colspan="5">' . $message . '</td>';
         echo '</tr>';
     }
 }
开发者ID:jon48,项目名称:webtrees-tools,代码行数:24,代码来源:PersoDevTools.php

示例12: lang_get

    echo lang_get('status');
    ?>
</td>
	</tr>
<?php 
    $t_bug_list = array();
    $t_total_owing = 0;
    $t_total_paid = 0;
    for ($i = 0; $i < $t_sponsor_count; ++$i) {
        $t_sponsor_row = $t_sponsors[$i];
        $t_bug = bug_get($t_sponsor_row['bug']);
        $t_sponsor = sponsorship_get($t_sponsor_row['sponsor']);
        $t_buglist[] = $t_sponsor_row['bug'] . ':' . $t_sponsor_row['sponsor'];
        # describe bug
        $t_status = string_attribute(get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id));
        $t_resolution = string_attribute(get_enum_element('resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id));
        $t_version_id = version_get_id($t_bug->fixed_in_version, $t_bug->project_id);
        if (false !== $t_version_id && VERSION_RELEASED == version_get_field($t_version_id, 'released')) {
            $t_released_label = '<a title="' . lang_get('released') . '">' . $t_bug->fixed_in_version . '</a>';
        } else {
            $t_released_label = $t_bug->fixed_in_version;
        }
        # choose color based on status
        $t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
        echo '<tr class="' . $t_status_label . '">';
        echo '<td><a href="' . string_get_bug_view_url($t_sponsor_row['bug']) . '">' . bug_format_id($t_sponsor_row['bug']) . '</a></td>';
        echo '<td>' . string_display_line(project_get_field($t_bug->project_id, 'name')) . '&#160;</td>';
        echo '<td class="right">' . $t_released_label . '&#160;</td>';
        echo '<td><a title="' . $t_resolution . '"><span class="underline">' . $t_status . '</span>&#160;</a></td>';
        # summary
        echo '<td>' . string_display_line($t_bug->summary);
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:account_sponsor_page.php

示例13: print_formatted_severity_string

function print_formatted_severity_string($p_bug)
{
    $t_sev_str = get_enum_element('severity', $p_bug->severity, auth_get_current_user_id(), $p_bug->project_id);
    $t_severity_threshold = config_get('severity_significant_threshold');
    if ($t_severity_threshold >= 0 && $p_bug->severity >= $t_severity_threshold && $p_bug->status < config_get('bug_closed_status_threshold')) {
        echo "<span class=\"bold\">{$t_sev_str}</span>";
    } else {
        echo $t_sev_str;
    }
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:10,代码来源:print_api.php

示例14: relationship_get_details

/**
 * return formatted string with all the details on the requested relationship
 * @param integer             $p_bug_id       A bug identifier.
 * @param BugRelationshipData $p_relationship A bug relationship object.
 * @param boolean             $p_html         Whether to return html or text output.
 * @param boolean             $p_html_preview Whether to include style/hyperlinks - if preview is false, we prettify the output.
 * @param boolean             $p_show_project Show Project details.
 * @return string
 */
function relationship_get_details($p_bug_id, BugRelationshipData $p_relationship, $p_html = false, $p_html_preview = false, $p_show_project = false)
{
    $t_summary_wrap_at = utf8_strlen(config_get('email_separator2')) - 28;
    $t_icon_path = config_get('icon_path');
    if ($p_bug_id == $p_relationship->src_bug_id) {
        # root bug is in the source side, related bug in the destination side
        $t_related_bug_id = $p_relationship->dest_bug_id;
        $t_related_project_name = project_get_name($p_relationship->dest_project_id);
        $t_relationship_descr = relationship_get_description_src_side($p_relationship->type);
    } else {
        # root bug is in the dest side, related bug in the source side
        $t_related_bug_id = $p_relationship->src_bug_id;
        $t_related_project_name = project_get_name($p_relationship->src_project_id);
        $t_relationship_descr = relationship_get_description_dest_side($p_relationship->type);
    }
    # related bug not existing...
    if (!bug_exists($t_related_bug_id)) {
        return '';
    }
    # user can access to the related bug at least as a viewer
    if (!access_has_bug_level(VIEWER, $t_related_bug_id)) {
        return '';
    }
    if ($p_html_preview == false) {
        $t_td = '<td>';
    } else {
        $t_td = '<td class="print">';
    }
    # get the information from the related bug and prepare the link
    $t_bug = bug_get($t_related_bug_id, false);
    $t_status_string = get_enum_element('status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
    $t_resolution_string = get_enum_element('resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id);
    $t_relationship_info_html = $t_td . string_no_break($t_relationship_descr) . '&#160;</td>';
    if ($p_html_preview == false) {
        $t_relationship_info_html .= '<td><a href="' . string_get_bug_view_url($t_related_bug_id) . '">' . string_display_line(bug_format_id($t_related_bug_id)) . '</a></td>';
        $t_relationship_info_html .= '<td><span class="issue-status" title="' . string_attribute($t_resolution_string) . '">' . string_display_line($t_status_string) . '</span></td>';
    } else {
        $t_relationship_info_html .= $t_td . string_display_line(bug_format_id($t_related_bug_id)) . '</td>';
        $t_relationship_info_html .= $t_td . string_display_line($t_status_string) . '&#160;</td>';
    }
    $t_relationship_info_text = utf8_str_pad($t_relationship_descr, 20);
    $t_relationship_info_text .= utf8_str_pad(bug_format_id($t_related_bug_id), 8);
    # get the handler name of the related bug
    $t_relationship_info_html .= $t_td;
    if ($t_bug->handler_id > 0) {
        $t_relationship_info_html .= string_no_break(prepare_user_name($t_bug->handler_id));
    }
    $t_relationship_info_html .= '&#160;</td>';
    # add project name
    if ($p_show_project) {
        $t_relationship_info_html .= $t_td . string_display_line($t_related_project_name) . '&#160;</td>';
    }
    # add summary
    if ($p_html == true) {
        $t_relationship_info_html .= $t_td . string_display_line_links($t_bug->summary);
        if (VS_PRIVATE == $t_bug->view_state) {
            $t_relationship_info_html .= sprintf(' <img src="%s" alt="(%s)" title="%s" />', $t_icon_path . 'protected.gif', lang_get('private'), lang_get('private'));
        }
    } else {
        if (utf8_strlen($t_bug->summary) <= $t_summary_wrap_at) {
            $t_relationship_info_text .= string_email_links($t_bug->summary);
        } else {
            $t_relationship_info_text .= utf8_substr(string_email_links($t_bug->summary), 0, $t_summary_wrap_at - 3) . '...';
        }
    }
    # add delete link if bug not read only and user has access level
    if (!bug_is_readonly($p_bug_id) && !current_user_is_anonymous() && $p_html_preview == false) {
        if (access_has_bug_level(config_get('update_bug_threshold'), $p_bug_id)) {
            $t_relationship_info_html .= ' [<a class="small" href="bug_relationship_delete.php?bug_id=' . $p_bug_id . '&amp;rel_id=' . $p_relationship->id . htmlspecialchars(form_security_param('bug_relationship_delete')) . '">' . lang_get('delete_link') . '</a>]';
        }
    }
    $t_relationship_info_html .= '&#160;</td>';
    $t_relationship_info_text .= "\n";
    if ($p_html_preview == false) {
        # choose color based on status
        $t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
        $t_relationship_info_html = '<tr class="' . $t_status_label . '">' . $t_relationship_info_html . '</tr>' . "\n";
    } else {
        $t_relationship_info_html = '<tr>' . $t_relationship_info_html . '</tr>';
    }
    if ($p_html == true) {
        return $t_relationship_info_html;
    } else {
        return $t_relationship_info_text;
    }
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:95,代码来源:relationship_api.php

示例15: filter_draw_selection_area2


//.........这里部分代码省略.........
                    $t_any_found = true;
                } else {
                    $t_this_string = $t_current;
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . string_display_line($t_this_string);
            }
            if (true == $t_any_found) {
                echo lang_get('any');
            } else {
                echo $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" id="show_severity_filter_target">
		<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter[FILTER_PROPERTY_SEVERITY]) == 0) {
            echo lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter[FILTER_PROPERTY_SEVERITY] as $t_current) {
                echo '<input type="hidden" name="', FILTER_PROPERTY_SEVERITY, '[]" value="', string_attribute($t_current), '" />';
                $t_this_string = '';
                if (filter_field_is_any($t_current)) {
                    $t_any_found = true;
                } else {
                    $t_this_string = get_enum_element('severity', $t_current);
                }
                if ($t_first_flag != true) {
                    $t_output = $t_output . '<br />';
                } else {
                    $t_first_flag = false;
                }
                $t_output = $t_output . string_display_line($t_this_string);
            }
            if (true == $t_any_found) {
                echo lang_get('any');
            } else {
                echo $t_output;
            }
        }
        ?>
			</td>
			<td class="small-caption" id="show_resolution_filter_target">
		<?php 
        $t_output = '';
        $t_any_found = false;
        if (count($t_filter[FILTER_PROPERTY_RESOLUTION]) == 0) {
            echo lang_get('any');
        } else {
            $t_first_flag = true;
            foreach ($t_filter[FILTER_PROPERTY_RESOLUTION] as $t_current) {
                echo '<input type="hidden" name="', FILTER_PROPERTY_RESOLUTION, '[]" value="', string_attribute($t_current), '" />';
                $t_this_string = '';
                if (filter_field_is_any($t_current)) {
                    $t_any_found = true;
                } else {
                    $t_this_string = get_enum_element('resolution', $t_current);
                }
开发者ID:vipjaven,项目名称:mantisbt,代码行数:67,代码来源:filter_api.php


注:本文中的get_enum_element函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。