本文整理汇总了PHP中Note::convertNote方法的典型用法代码示例。如果您正苦于以下问题:PHP Note::convertNote方法的具体用法?PHP Note::convertNote怎么用?PHP Note::convertNote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::convertNote方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertNote
/**
* @param int $issue_id
* @param int $note_id
* @param string $target
* @param bool $authorize_sender
* @return string
* @access protected
*/
public function convertNote($issue_id, $note_id, $target, $authorize_sender)
{
AuthCookie::setProjectCookie(Issue::getProjectID($issue_id));
$res = Note::convertNote($note_id, $target, $authorize_sender);
if (empty($res)) {
throw new RemoteApiException('Error converting note');
}
return 'OK';
}
示例2: Template_API
// +----------------------------------------------------------------------+
//
// @(#) $Id$
//
include_once "config.inc.php";
include_once APP_INC_PATH . "db_access.php";
include_once APP_INC_PATH . "class.template.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.note.php";
include_once APP_INC_PATH . "class.draft.php";
include_once APP_INC_PATH . "class.support.php";
include_once APP_INC_PATH . "class.mime_helper.php";
include_once APP_INC_PATH . "class.mail.php";
include_once APP_INC_PATH . "class.date.php";
include_once APP_INC_PATH . "class.issue.php";
include_once APP_INC_PATH . "class.notification.php";
$tpl = new Template_API();
$tpl->setTemplate("convert_note.tpl.html");
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
if (@$HTTP_POST_VARS['cat'] == 'convert') {
if (@$HTTP_POST_VARS["add_authorized_replier"] == 1) {
$authorize_sender = true;
} else {
$authorize_sender = false;
}
$tpl->assign("convert_result", Note::convertNote($HTTP_POST_VARS['note_id'], $HTTP_POST_VARS['target'], $authorize_sender));
} else {
$tpl->assign("note_id", $HTTP_GET_VARS['id']);
}
$tpl->assign("current_user_prefs", Prefs::get(Auth::getUserID()));
$tpl->displayTemplate();
示例3: convertNote
function convertNote($p)
{
$email = XML_RPC_decode($p->getParam(0));
$password = XML_RPC_decode($p->getParam(1));
$auth = authenticate($email, $password);
if (is_object($auth)) {
return $auth;
}
$issue_id = XML_RPC_decode($p->getParam(2));
$note_id = XML_RPC_decode($p->getParam(3));
$target = XML_RPC_decode($p->getParam(4));
$authorize_sender = XML_RPC_decode($p->getParam(5));
createFakeCookie($email, Issue::getProjectID($issue_id));
$res = Note::convertNote($note_id, $target, $authorize_sender);
if ($res) {
return new XML_RPC_Response(XML_RPC_Encode("OK"));
} else {
return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "Error converting note");
}
}
示例4: dirname
// | 51 Franklin Street, Suite 330 |
// | Boston, MA 02110-1301, USA. |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com> |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('convert_note.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$usr_id = Auth::getUserID();
$note_id = !empty($_GET['id']) ? $_GET['id'] : $_POST['note_id'];
$note = Note::getDetails($note_id);
$issue_id = $note['not_iss_id'];
if (User::getRoleByUser($usr_id, Issue::getProjectID($issue_id)) < User::getRoleID('Standard User') || !Access::canConvertNote($issue_id, Auth::getUserID())) {
$tpl->setTemplate('permission_denied.tpl.html');
$tpl->displayTemplate();
exit;
}
if (@$_POST['cat'] == 'convert') {
if (@$_POST['add_authorized_replier'] == 1) {
$authorize_sender = true;
} else {
$authorize_sender = false;
}
$tpl->assign('convert_result', Note::convertNote($_POST['note_id'], $_POST['target'], $authorize_sender));
} else {
$tpl->assign('note_id', $_GET['id']);
}
$tpl->assign('current_user_prefs', Prefs::get(Auth::getUserID()));
$tpl->assign('issue_id', $issue_id);
$tpl->displayTemplate();