本文整理匯總了PHP中Flyspray::show_error方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flyspray::show_error方法的具體用法?PHP Flyspray::show_error怎麽用?PHP Flyspray::show_error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flyspray
的用法示例。
在下文中一共展示了Flyspray::show_error方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addEffort
/**
* Manually add effort to the effort table for this issue / user.
*
* @param $effort_to_add int Amount of Effort in hours to add to effort table.
*/
public function addEffort($effort_to_add, $proj)
{
global $db;
$effort = self::EditStringToSeconds($effort_to_add, $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']);
if ($effort === FALSE) {
Flyspray::show_error(L('invalideffort'));
return;
}
$db->Query('INSERT INTO {effort}
(task_id, date_added, user_id,start_timestamp,end_timestamp,effort)
VALUES ( ?, ?, ?, ?,?,? )', array($this->_task_id, time(), $this->_userId, time(), time(), $effort));
}
示例2: addEffort
/**
* Manually add effort to the effort table for this issue / user.
*
* @param $effort_to_add int amount of effort in hh:mm to add to effort table.
*/
public function addEffort($effort_to_add, $proj)
{
global $db;
# note: third parameter seem useless, not used by EditStringToSeconds().., maybe drop it..
$effort = self::EditStringToSeconds($effort_to_add, $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']);
if ($effort === FALSE) {
Flyspray::show_error(L('invalideffort'));
return false;
}
# quickfix to avoid useless table entries.
if ($effort == 0) {
Flyspray::show_error(L('zeroeffort'));
return false;
} else {
$db->Query('INSERT INTO {effort}
(task_id, date_added, user_id,start_timestamp,end_timestamp,effort)
VALUES ( ?, ?, ?, ?,?,? )', array($this->_task_id, time(), $this->_userId, time(), time(), $effort));
return true;
}
}
示例3: die
<?php
/*
* Multiple Tasks Creation
*/
if (!defined('IN_FS')) {
die('Do not access this file directly.');
}
if (!$user->can_open_task($proj) && !$user->perms('add_multiple_tasks')) {
Flyspray::show_error(15);
}
$page->setTitle($fs->prefs['page_title'] . $proj->prefs['project_title'] . ': ' . L('newtask'));
$page->assign('old_assigned', '');
$page->pushTpl('newmultitasks.tpl');
示例4: task
/*************************************************************\
| Details a task (and edit it) |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| This script displays task details when in view mode, |
| and allows the user to edit task details when in edit mode. |
| It also shows comments, attachments, notifications etc. |
\*************************************************************/
if (!defined('IN_FS')) {
die('Do not access this file directly.');
}
$task_id = Req::num('task_id');
if (!($task_details = Flyspray::GetTaskDetails($task_id))) {
Flyspray::show_error(10);
}
if (!$user->can_view_task($task_details)) {
Flyspray::show_error($user->isAnon() ? 102 : 101, false);
} else {
require_once BASEDIR . '/includes/events.inc.php';
if ($proj->prefs['use_effort_tracking']) {
require_once BASEDIR . '/includes/class.effort.php';
$effort = new effort($task_id, $user->id);
$effort->populateDetails();
$page->assign('effort', $effort);
}
$page->uses('task_details');
// Send user variables to the template
$page->assign('assigned_users', $task_details['assigned_to']);
$page->assign('old_assigned', implode(' ', $task_details['assigned_to']));
$page->assign('tags', $task_details['tags']);
$page->setTitle(sprintf('FS#%d : %s', $task_details['task_id'], $task_details['item_summary']));
if ((Get::val('edit') || Post::has('item_summary') && !isset($_SESSION['SUCCESS'])) && $user->can_edit_task($task_details)) {
示例5: die
// make sure people are not attempting to manually fiddle with projects they are not allowed to play with
if (Req::has('project') && Req::val('project') != 0 && !$user->can_view_project(Req::val('project'))) {
Flyspray::show_error(L('nopermission'));
exit;
}
if ($show_task = Get::val('show_task')) {
// If someone used the 'show task' form, redirect them
if (is_numeric($show_task)) {
Flyspray::Redirect(CreateURL('details', $show_task));
} else {
Flyspray::Redirect($baseurl . '?string=' . $show_task);
}
}
if (Flyspray::requestDuplicated()) {
// Check that this page isn't being submitted twice
Flyspray::show_error(3);
}
# handle all forms request that modify data
if (Req::has('action')) {
# enforcing if the form sent the correct anti csrf token
# only allow token by post
if (!Post::has('csrftoken')) {
die('missingtoken');
} elseif (Post::val('csrftoken') == $_SESSION['csrftoken']) {
require_once BASEDIR . '/includes/modify.inc.php';
} else {
die('wrongtoken');
}
}
# start collecting infos for the answer page
if ($proj->id && $user->perms('manage_project')) {
示例6: die
<?php
if (!defined('IN_FS')) {
die('Do not access this file directly.');
}
# let also project managers allow translation of flyspray
if (!$user->perms('manage_project')) {
Flyspray::show_error(28);
}
ob_start();
?>
<style type="text/css">
body{font-size:100%;}
pre { margin : 0; }
table{border-collapse:collapse;}
.progress_bar_container{height:20px;}
.progress_bar_container span{font-size:100%;}
.progress_bar_container span:first-child{display:inline-block;margin-top:2px;}
.overview{margin-left:auto;margin-right:auto;}
.overview td, .overview th{border:none;padding:0;}
a.button{padding:2px 10px 2px 10px;margin:2px;}
table th{text-align:center;}
table th, table td {
vertical-align:middle;
border: 1px solid #ccc;
padding: 2px;
}
tr:hover td, tr:hover th { background : #e0e0e0; }
</style>
<?php
require_once dirname(dirname(__FILE__)) . '/includes/fix.inc.php';
示例7: L
if (!$group_details || $group_details['project_id'] != $proj->id) {
Flyspray::show_error(L('groupnotexist'));
Flyspray::Redirect(CreateURL('pm', 'groups', $proj->id));
}
$page->uses('group_details');
}
case 'groups':
case 'newuser':
case 'newuserbulk':
case 'editallusers':
$page->assign('groups', Flyspray::ListGroups());
case 'userrequest':
$sql = $db->Query("SELECT *\n FROM {admin_requests}\n WHERE request_type = 3 AND project_id = 0 AND resolved_by = 0\n ORDER BY time_submitted ASC");
$page->assign('pendings', $db->fetchAllArray($sql));
case 'newproject':
case 'os':
case 'prefs':
case 'resolution':
case 'tasktype':
case 'status':
case 'version':
case 'newgroup':
$page->setTitle($fs->prefs['page_title'] . L('admintoolboxlong'));
$page->pushTpl('admin.' . $area . '.tpl');
break;
case 'translations':
require_once BASEDIR . '/scripts/langdiff.php';
break;
default:
Flyspray::show_error(6);
}
示例8: user
<?php
/*********************************************************\
| Register a new user (when confirmation codes is used) |
| ~~~~~~~~~~~~~~~~~~~ |
\*********************************************************/
if (!defined('IN_FS')) {
die('Do not access this file directly.');
}
$page->setTitle($fs->prefs['page_title'] . L('registernewuser'));
if (!$user->isAnon()) {
Flyspray::Redirect($baseurl);
}
if ($user->can_register()) {
// 32 is the length of the magic_url
if (Req::has('magic_url') && strlen(Req::val('magic_url')) == 32) {
// If the user came here from their notification link
$sql = $db->Query('SELECT * FROM {registrations} WHERE magic_url = ?', array(Get::val('magic_url')));
if (!$db->CountRows($sql)) {
Flyspray::show_error(18);
}
$page->pushTpl('register.magic.tpl');
} else {
$page->pushTpl('register.no-magic.tpl');
}
} elseif ($user->can_self_register()) {
$page->pushTpl('common.newuser.tpl');
} else {
Flyspray::show_error(22);
}
示例9: L
Flyspray::logEvent($task['task_id'], 3, 0, 1, 'mark_private');
$_SESSION['SUCCESS'] = L('taskmadepublicmsg');
break;
// ##################
// Adding a vote for a task
// ##################
// ##################
// Adding a vote for a task
// ##################
case 'details.addvote':
if (Backend::add_vote($user->id, $task['task_id'])) {
$_SESSION['SUCCESS'] = L('voterecorded');
} else {
Flyspray::show_error(L('votefailed'));
break;
}
break;
// ##################
// Removing a vote for a task
// ##################
// ##################
// Removing a vote for a task
// ##################
case 'details.removevote':
if (Backend::remove_vote($user->id, $task['task_id'])) {
$_SESSION['SUCCESS'] = L('voteremoved');
} else {
Flyspray::show_error(L('voteremovefailed'));
break;
}
}
示例10: VALUES
//if 'noone' has been selected then dont do the database update.
if (!$assignee == 0) {
//insert the task and user id's into the assigned table.
$db->Query('INSERT INTO {assigned}
(task_id,user_id)
VALUES (?, ?)', array($id, $assignee));
}
}
}
}
// set success message
$_SESSION['SUCCESS'] = L('tasksupdated');
break;
} else {
if (!Post::val('resolution_reason')) {
Flyspray::show_error(L('noclosereason'));
break;
}
$task_ids = Post::val('ids');
foreach ($task_ids as $task_id) {
$task = Flyspray::GetTaskDetails($task_id);
if (!$user->can_close_task($task)) {
continue;
}
if ($task['is_closed']) {
continue;
}
Backend::close_task($task_id, Post::val('resolution_reason'), Post::val('closure_comment', ''), Post::val('mark100', false));
}
$_SESSION['SUCCESS'] = L('taskclosedmsg');
break;
示例11: L
case 'groups':
$page->assign('globalgroups', Flyspray::ListGroups(0));
# global user groups
$page->assign('groups', Flyspray::ListGroups($proj->id));
# project specific user groups
# project specific user groups
case 'editgroup':
// yeah, utterly stupid, is changed in 1.0 already
if (Req::val('area') == 'editgroup') {
$group_details = Flyspray::getGroupDetails(Req::num('id'));
if (!$group_details || $group_details['project_id'] != $proj->id) {
Flyspray::show_error(L('groupnotexist'));
Flyspray::Redirect(CreateURL('pm', 'groups', $proj->id));
}
$page->uses('group_details');
}
case 'tasktype':
case 'tag':
case 'resolution':
case 'os':
case 'version':
case 'cat':
case 'status':
case 'newgroup':
$page->setTitle($fs->prefs['page_title'] . L('pmtoolbox'));
$page->pushTpl('pm.menu.tpl');
$page->pushTpl('pm.' . $area . '.tpl');
break;
default:
Flyspray::show_error(17);
}
示例12: die
<?php
/*********************************************************\
| Deal with lost passwords |
| ~~~~~~~~~~~~~~~~~~~~~~~~ |
\*********************************************************/
if (!defined('IN_FS')) {
die('Do not access this file directly.');
}
$page->setTitle($fs->prefs['page_title'] . L('lostpw'));
if (!Req::has('magic_url') && $user->isAnon()) {
// Step One: user requests magic url
$page->pushTpl('lostpw.step1.tpl');
} elseif (Req::has('magic_url') && $user->isAnon()) {
// Step Two: user enters new password
$check_magic = $db->Query('SELECT * FROM {users} WHERE magic_url = ?', array(Get::val('magic_url')));
if (!$db->CountRows($check_magic)) {
Flyspray::show_error(12);
}
$page->pushTpl('lostpw.step2.tpl');
} else {
Flyspray::Redirect($baseurl);
}
示例13: die
<?php
/*********************************************************\
| Show the roadmap |
| ~~~~~~~~~~~~~~~~~~~ |
\*********************************************************/
if (!defined('IN_FS')) {
die('Do not access this file directly.');
}
if (!$proj->id) {
Flyspray::show_error(25);
}
$page->setTitle($fs->prefs['page_title'] . L('roadmap'));
// Get milestones
$milestones = $db->Query('SELECT version_id, version_name
FROM {list_version}
WHERE project_id = ? AND version_tense = 3
ORDER BY list_position ASC', array($proj->id));
$data = array();
while ($row = $db->FetchRow($milestones)) {
// Get all tasks related to a milestone
$all_tasks = $db->Query('SELECT percent_complete, is_closed
FROM {tasks}
WHERE closedby_version = ? AND project_id = ?', array($row['version_id'], $proj->id));
$all_tasks = $db->fetchAllArray($all_tasks);
$percent_complete = 0;
foreach ($all_tasks as $task) {
if ($task['is_closed']) {
$percent_complete += 100;
} else {
$percent_complete += $task['percent_complete'];
示例14: die
<?php
/************************************\
| Edit comment |
| ~~~~~~~~~~~~ |
| This script allows users |
| to edit comments attached to tasks |
\************************************/
if (!defined('IN_FS')) {
die('Do not access this file directly.');
}
$sql = $db->Query("SELECT c.*, u.real_name\n FROM {comments} c\n INNER JOIN {users} u ON c.user_id = u.user_id\n WHERE comment_id = ? AND task_id = ?", array(Get::num('id', 0), Get::num('task_id', 0)));
$page->assign('comment', $comment = $db->FetchRow($sql));
if (!$user->can_edit_comment($comment)) {
Flyspray::show_error(11);
}
$page->pushTpl('editcomment.tpl');
示例15: VALUES
VALUES (?, ?)', array($id, $assignee));
}
}
}
}
// set success message
$_SESSION['SUCCESS'] = L('tasksupdated');
break;
} else {
if (!Post::val('resolution_reason')) {
Flyspray::show_error(L('noclosereason'));
break;
}
$task_ids = Post::val('ids');
foreach ($task_ids as $task_id) {
$task = Flyspray::GetTaskDetails($task_id);
if (!$user->can_close_task($task)) {
continue;
}
if ($task['is_closed']) {
continue;
}
Backend::close_task($task_id, Post::val('resolution_reason'), Post::val('closure_comment', ''), Post::val('mark100', false));
}
$_SESSION['SUCCESS'] = L('taskclosedmsg');
break;
}
} else {
Flyspray::show_error(L('massopsdisabled'));
}
}