本文整理匯總了PHP中Flyspray::UsernameToId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flyspray::UsernameToId方法的具體用法?PHP Flyspray::UsernameToId怎麽用?PHP Flyspray::UsernameToId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flyspray
的用法示例。
在下文中一共展示了Flyspray::UsernameToId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$db->Query("DELETE from {attachments} WHERE attachment_id = ?", array($attachment['attachment_id']));
@unlink(BASEDIR . '/attachments/' . $attachment['file_name']);
Flyspray::logEvent($attachment['task_id'], 8, $attachment['orig_name']);
}
$_SESSION['SUCCESS'] = L('commentdeletedmsg');
break;
// ##################
// adding a reminder
// ##################
// ##################
// adding a reminder
// ##################
case 'details.addreminder':
$how_often = Post::val('timeamount1', 1) * Post::val('timetype1');
$start_time = Flyspray::strtotime(Post::val('timeamount2', 0));
$userId = Flyspray::UsernameToId(Post::val('to_user_id'));
if (!Backend::add_reminder($task['task_id'], Post::val('reminder_message'), $how_often, $start_time, $userId)) {
Flyspray::show_error(L('usernotexist'));
break;
}
// TODO: Log event in a later version.
$_SESSION['SUCCESS'] = L('reminderaddedmsg');
break;
// ##################
// removing a reminder
// ##################
// ##################
// removing a reminder
// ##################
case 'deletereminder':
if (!$user->perms('manage_project') || !is_array(Post::val('reminder_id'))) {
示例2: action_addreminder
function action_addreminder($task)
{
global $user, $db, $fs, $proj;
$how_often = Post::val('timeamount1', 1) * Post::val('timetype1');
$start_time = Flyspray::strtotime(Post::val('timeamount2', 0));
$userId = Flyspray::UsernameToId(Post::val('to_user_id'));
if (!Backend::add_reminder($task['task_id'], Post::val('reminder_message'), $how_often, $start_time, $userId)) {
return array(ERROR_RECOVER, L('usernotexist'));
}
return array(SUBMIT_OK, L('reminderaddedmsg'));
}