本文整理汇总了PHP中sponsorship_get函数的典型用法代码示例。如果您正苦于以下问题:PHP sponsorship_get函数的具体用法?PHP sponsorship_get怎么用?PHP sponsorship_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sponsorship_get函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bug_get_field
$t_total_sponsorship = bug_get_field($f_bug_id, 'sponsorship_total');
if ($t_total_sponsorship > 0) {
?>
<tr class="row-2">
<th class="category" width="15%"><?php
echo lang_get('sponsors_list');
?>
</th>
<td>
<?php
echo sprintf(lang_get('total_sponsorship_amount'), sponsorship_format_amount($t_total_sponsorship));
if (access_has_bug_level(config_get('view_sponsorship_details_threshold'), $f_bug_id)) {
echo '<br /><br />';
$i = 0;
foreach ($t_sponsorship_ids as $id) {
$t_sponsorship = sponsorship_get($id);
$t_date_added = date(config_get('normal_date_format'), $t_sponsorship->date_submitted);
echo $i > 0 ? '<br />' : '';
$i++;
echo sprintf(lang_get('label'), $t_date_added) . lang_get('word_separator');
print_user($t_sponsorship->user_id);
echo ' (' . sponsorship_format_amount($t_sponsorship->amount) . ')';
if (access_has_bug_level(config_get('handle_sponsored_bugs_threshold'), $f_bug_id)) {
echo ' ' . get_enum_element('sponsorship', $t_sponsorship->paid);
}
}
}
?>
</td>
</tr>
<?php
示例2: lang_get
echo lang_get('amount');
?>
</td>
<td class="form-title"><?php
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')) . ' </td>';
示例3: sponsorship_update_paid
/**
* updates the paid field
* @param int $p_sponsorship_id
* @param int $p_paid
* @return true
*/
function sponsorship_update_paid($p_sponsorship_id, $p_paid)
{
$c_sponsorship_id = db_prepare_int($p_sponsorship_id);
$t_sponsorship = sponsorship_get($c_sponsorship_id);
$c_paid = db_prepare_int($p_paid);
$t_sponsorship_table = db_get_table('sponsorship');
$query = "UPDATE {$t_sponsorship_table}\n\t\t\t\t SET last_updated= " . db_param() . ", paid=" . db_param() . "\n\t\t\t\t WHERE id=" . db_param();
db_query_bound($query, array(db_now(), $c_paid, $c_sponsorship_id));
history_log_event_special($t_sponsorship->bug_id, BUG_PAID_SPONSORSHIP, $t_sponsorship->user_id, $p_paid);
sponsorship_clear_cache($p_sponsorship_id);
return true;
}
示例4: require_api
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('sponsorship_api.php');
if (!config_get('enable_sponsorship')) {
trigger_error(ERROR_SPONSORSHIP_NOT_ENABLED, ERROR);
}
form_security_validate('account_sponsor_update');
auth_ensure_user_authenticated();
$f_bug_list = gpc_get_string('buglist', '');
$t_bug_list = explode(',', $f_bug_list);
foreach ($t_bug_list as $t_bug) {
list($t_bug_id, $t_sponsor_id) = explode(':', $t_bug);
$c_bug_id = (int) $t_bug_id;
bug_ensure_exists($c_bug_id);
# dies if bug doesn't exist
access_ensure_bug_level(config_get('handle_sponsored_bugs_threshold'), $c_bug_id);
# dies if user can't handle bug
$t_bug = bug_get($c_bug_id);
$t_sponsor = sponsorship_get((int) $t_sponsor_id);
$t_new_payment = gpc_get_int('sponsor_' . $c_bug_id . '_' . $t_sponsor->id, $t_sponsor->paid);
if ($t_new_payment != $t_sponsor->paid) {
sponsorship_update_paid($t_sponsor_id, $t_new_payment);
}
}
form_security_purge('account_sponsor_update');
$t_redirect_url = 'account_sponsor_page.php';
html_page_top(null, $t_redirect_url);
html_operation_successful($t_redirect_url, lang_get('payment_updated'));
html_page_bottom();
示例5: sponsorship_update_paid
function sponsorship_update_paid($p_sponsorship_id, $p_paid)
{
$c_sponsorship_id = db_prepare_int($p_sponsorship_id);
$t_sponsorship = sponsorship_get($c_sponsorship_id);
$c_paid = db_prepare_int($p_paid);
$t_sponsorship_table = config_get('mantis_sponsorship_table');
$query = "UPDATE {$t_sponsorship_table}\r\n\t\t\t\t SET last_updated= " . db_now() . ", paid={$c_paid}\r\n\t\t\t\t WHERE id='{$c_sponsorship_id}'";
db_query($query);
history_log_event_special($t_sponsorship->bug_id, BUG_PAID_SPONSORSHIP, $t_sponsorship->user_id, $p_paid);
sponsorship_clear_cache($p_sponsorship_id);
return true;
}
示例6: sponsorship_update_paid
/**
* updates the paid field
* @param integer $p_sponsorship_id The sponsorship identifier to update.
* @param integer $p_paid The value to set to paid database field to.
* @return boolean
*/
function sponsorship_update_paid($p_sponsorship_id, $p_paid)
{
$t_sponsorship = sponsorship_get($p_sponsorship_id);
$t_query = 'UPDATE {sponsorship} SET last_updated=' . db_param() . ', paid=' . db_param() . ' WHERE id=' . db_param();
db_query($t_query, array(db_now(), (int) $p_paid, (int) $p_sponsorship_id));
history_log_event_special($t_sponsorship->bug_id, BUG_PAID_SPONSORSHIP, $t_sponsorship->user_id, $p_paid);
sponsorship_clear_cache($p_sponsorship_id);
return true;
}