本文整理汇总了PHP中CerberusApplication::getActiveWorker方法的典型用法代码示例。如果您正苦于以下问题:PHP CerberusApplication::getActiveWorker方法的具体用法?PHP CerberusApplication::getActiveWorker怎么用?PHP CerberusApplication::getActiveWorker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CerberusApplication
的用法示例。
在下文中一共展示了CerberusApplication::getActiveWorker方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplateHandler
public static function getTemplateHandler()
{
$tpl = DevblocksPlatform::getTemplateService();
$tpl_path = dirname(__FILE__) . '/templates/';
$tpl->assign('path', $tpl_path);
$tpl->cache_lifetime = "0";
$total_new_count = 0;
foreach (DAO_WorkflowView::getGroupTotals() as $data) {
$total_new_count += $data["total"];
}
$tpl->assign('total_new_count', $total_new_count);
$newest = isset($_SESSION["fluid_latest_seen"]) ? $_SESSION["fluid_latest_seen"] : time() - 3600;
$worker = CerberusApplication::getActiveWorker();
$memberships = $worker->getMemberships();
$params = array(SearchFields_Ticket::TICKET_TEAM_ID => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_TEAM_ID, 'in', array_keys($memberships)), SearchFields_Ticket::TICKET_DELETED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_DELETED, 'eq', 0), SearchFields_Ticket::TICKET_WAITING => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_WAITING, 'eq', 0), SearchFields_Ticket::TICKET_CLOSED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_CLOSED, 'eq', 0), SearchFields_Ticket::TICKET_UPDATED_DATE => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_UPDATED_DATE, '>', $newest));
list($results, $total) = DAO_Ticket::search(array(SearchFields_Ticket::TICKET_ID, SearchFields_Ticket::TICKET_MASK, SearchFields_Ticket::TICKET_SUBJECT, SearchFields_Ticket::TICKET_LAST_WROTE), $params, 5, 0, SearchFields_Ticket::TICKET_UPDATED_DATE, false, true);
$tickets = array();
foreach ($results as $ticket) {
if ($ticket[SearchFields_Ticket::TICKET_UPDATED_DATE] > $newest) {
$newest = $ticket[SearchFields_Ticket::TICKET_UPDATED_DATE];
}
$tickets[] = $ticket;
}
$_SESSION["fluid_latest_seen"] = $newest;
$tpl->assign("recent_tickets_json", json_encode($tickets));
$tpl->assign("recent_ticket_count", json_encode($total));
return $tpl;
}
示例2: handleEvent
/**
* @param Model_DevblocksEvent $event
*/
function handleEvent(Model_DevblocksEvent $event)
{
switch ($event->id) {
case 'cron.maint':
DAO_TicketAuditLog::maint();
break;
case 'ticket.merge':
// Listen for ticket merges and update our internal ticket_id records
@($new_ticket_id = $event->params['new_ticket_id']);
@($old_ticket_ids = $event->params['old_ticket_ids']);
if (empty($new_ticket_id) || empty($old_ticket_ids)) {
return;
}
$fields = array(DAO_TicketAuditLog::TICKET_ID => $new_ticket_id);
DAO_TicketAuditLog::updateWhere($fields, sprintf("%s IN (%s)", DAO_TicketAuditLog::TICKET_ID, implode(',', $old_ticket_ids)));
break;
case 'ticket.property.pre_change':
@($ticket_ids = $event->params['ticket_ids']);
@($changed_fields = $event->params['changed_fields']);
// Filter out any mandatory changes we could care less about
unset($changed_fields[DAO_Ticket::UPDATED_DATE]);
unset($changed_fields[DAO_Ticket::MASK]);
unset($changed_fields[DAO_Ticket::FIRST_MESSAGE_ID]);
unset($changed_fields[DAO_Ticket::FIRST_WROTE_ID]);
unset($changed_fields[DAO_Ticket::LAST_WROTE_ID]);
unset($changed_fields[DAO_Ticket::INTERESTING_WORDS]);
@($tickets = DAO_Ticket::getTickets($ticket_ids));
// Is a worker around to invoke this change? 0 = automatic
@($worker_id = null != ($active_worker = CerberusApplication::getActiveWorker()) && !empty($active_worker->id) ? $active_worker->id : 0);
if (is_array($tickets) && !empty($tickets) && is_array($changed_fields) && !empty($changed_fields)) {
foreach ($tickets as $ticket_id => $ticket) {
/* @var $ticket CerberusTicket */
foreach ($changed_fields as $changed_field => $changed_value) {
if (is_array($changed_value)) {
$changed_value = implode("\r\n", $changed_value);
}
// If different
if (isset($ticket->{$changed_field}) && 0 != strcmp($ticket->{$changed_field}, $changed_value)) {
$fields = array(DAO_TicketAuditLog::TICKET_ID => $ticket_id, DAO_TicketAuditLog::WORKER_ID => $worker_id, DAO_TicketAuditLog::CHANGE_DATE => time(), DAO_TicketAuditLog::CHANGE_FIELD => $changed_field, DAO_TicketAuditLog::CHANGE_VALUE => substr($changed_value, 0, 128));
$log_id = DAO_TicketAuditLog::create($fields);
}
}
}
}
break;
}
}
示例3: handleRequest
function handleRequest(DevblocksHttpRequest $request)
{
$translate = DevblocksPlatform::getTranslationService();
$stack = $request->path;
// URLS like: /files/10000/plaintext.txt
array_shift($stack);
// files
$file_id = array_shift($stack);
// 10000
$file_name = array_shift($stack);
// plaintext.txt
// Security
if (null == ($active_worker = CerberusApplication::getActiveWorker())) {
die($translate->_('common.access_denied'));
}
if (empty($file_id) || empty($file_name) || null == ($file = DAO_Attachment::get($file_id))) {
die($translate->_('files.not_found'));
}
// Security
$message = DAO_Ticket::getMessage($file->message_id);
if (null == ($ticket = DAO_Ticket::getTicket($message->ticket_id))) {
die($translate->_('common.access_denied'));
}
// Security
$active_worker_memberships = $active_worker->getMemberships();
if (null == $active_worker_memberships[$ticket->team_id]) {
die($translate->_('common.access_denied'));
}
// Set headers
header("Expires: Mon, 26 Nov 1962 00:00:00 GMT\n");
header("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT\n");
header("Cache-control: private\n");
header("Pragma: no-cache\n");
header("Content-Type: " . $file->mime_type . "\n");
header("Content-transfer-encoding: binary\n");
header("Content-Length: " . $file->getFileSize() . "\n");
echo $file->getFileContents();
exit;
}
示例4: handleRequest
function handleRequest(DevblocksHttpRequest $request) {
$worker = CerberusApplication::getActiveWorker();
if(empty($worker)) return;
$stack = $request->path;
array_shift($stack); // internal
@$action = array_shift($stack) . 'Action';
switch($action) {
case NULL:
// [TODO] Index/page render
break;
default:
// Default action, call arg as a method suffixed with Action
if(method_exists($this,$action)) {
call_user_func(array(&$this, $action));
}
break;
}
}
示例5: saveWatcherPanelAction
function saveWatcherPanelAction()
{
$translate = DevblocksPlatform::getTranslationService();
@($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
@($active_worker = CerberusApplication::getActiveWorker());
// if(!$active_worker->is_superuser)
// return;
/*****************************/
@($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
@($is_disabled = DevblocksPlatform::importGPC($_POST['is_disabled'], 'integer', 0));
@($worker_id = DevblocksPlatform::importGPC($_POST['worker_id'], 'integer', 0));
@($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
@($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
if (empty($name)) {
$name = $translate->_('Watcher Filter');
}
$criterion = array();
$actions = array();
// Custom fields
$custom_fields = DAO_CustomField::getAll();
// Criteria
if (is_array($rules)) {
foreach ($rules as $rule) {
$rule = DevblocksPlatform::strAlphaNumDash($rule);
@($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
// [JAS]: Allow empty $value (null/blank checking)
$criteria = array('value' => $value);
// Any special rule handling
switch ($rule) {
case 'dayofweek':
// days
$days = DevblocksPlatform::importGPC($_REQUEST['value_dayofweek'], 'array', array());
if (in_array(0, $days)) {
$criteria['sun'] = 'Sunday';
}
if (in_array(1, $days)) {
$criteria['mon'] = 'Monday';
}
if (in_array(2, $days)) {
$criteria['tue'] = 'Tuesday';
}
if (in_array(3, $days)) {
$criteria['wed'] = 'Wednesday';
}
if (in_array(4, $days)) {
$criteria['thu'] = 'Thursday';
}
if (in_array(5, $days)) {
$criteria['fri'] = 'Friday';
}
if (in_array(6, $days)) {
$criteria['sat'] = 'Saturday';
}
unset($criteria['value']);
break;
case 'timeofday':
$from = DevblocksPlatform::importGPC($_REQUEST['timeofday_from'], 'string', '');
$to = DevblocksPlatform::importGPC($_REQUEST['timeofday_to'], 'string', '');
$criteria['from'] = $from;
$criteria['to'] = $to;
unset($criteria['value']);
break;
case 'event':
@($events = DevblocksPlatform::importGPC($_REQUEST['value_event'], 'array', array()));
if (is_array($events)) {
foreach ($events as $event) {
$criteria[$event] = true;
}
}
unset($criteria['value']);
break;
case 'groups':
@($groups = DevblocksPlatform::importGPC($_REQUEST['value_groups'], 'array', array()));
if (is_array($groups) && !empty($groups)) {
$criteria['groups'] = array();
foreach ($groups as $group_id) {
@($all = DevblocksPlatform::importGPC($_REQUEST['value_group' . $group_id . '_all'], 'integer', 0));
// Did we only want to watch specific buckets in this group?
$bucket_ids = array();
if (!$all) {
@($bucket_ids = DevblocksPlatform::importGPC($_REQUEST['value_group' . $group_id . '_buckets'], 'array', array()));
}
// Add to criteria (key=group id, val=array of bucket ids)
$criteria['groups'][$group_id] = $bucket_ids;
}
}
unset($criteria['value']);
break;
case 'next_worker_id':
break;
case 'subject':
break;
case 'from':
break;
// case 'tocc':
// break;
// case 'tocc':
// break;
case 'header1':
case 'header2':
//.........这里部分代码省略.........
示例6: signoutAction
function signoutAction()
{
$session = DevblocksPlatform::getSessionService();
$visit = $session->getVisit();
if (null != ($worker = CerberusApplication::getActiveWorker())) {
DAO_Worker::logActivity($worker->id, new Model_Activity(null));
}
$session->clear();
DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login')));
}
示例7: doDeleteWorkspaceAction
function doDeleteWorkspaceAction()
{
@($workspace = DevblocksPlatform::importGPC($_POST['workspace'], 'string', ''));
$db = DevblocksPlatform::getDatabaseService();
$active_worker = CerberusApplication::getActiveWorker();
$lists = DAO_WorkerWorkspaceList::getWhere(sprintf("%s = %s AND %s = %d", DAO_WorkerWorkspaceList::WORKSPACE, $db->qstr($workspace), DAO_WorkerWorkspaceList::WORKER_ID, $active_worker->id));
DAO_WorkerWorkspaceList::delete(array_keys($lists));
DevblocksPlatform::redirect(new DevblocksHttpResponse(array('home')));
}
示例8: saveReplyTemplateAction
function saveReplyTemplateAction()
{
@($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
@($title = DevblocksPlatform::importGPC($_REQUEST['title'], 'string', ''));
@($description = DevblocksPlatform::importGPC($_REQUEST['description'], 'string', ''));
@($folder = DevblocksPlatform::importGPC($_REQUEST['folder'], 'string', ''));
@($folder_new = DevblocksPlatform::importGPC($_REQUEST['folder_new'], 'string', ''));
@($content = DevblocksPlatform::importGPC($_REQUEST['template'], 'string', ''));
@($type = DevblocksPlatform::importGPC($_REQUEST['type'], 'integer', 0));
@($delete = DevblocksPlatform::importGPC($_REQUEST['do_delete'], 'integer', 0));
$worker = CerberusApplication::getActiveWorker();
if (empty($delete)) {
$fields = array(DAO_MailTemplate::TITLE => $title, DAO_MailTemplate::FOLDER => !empty($folder) ? $folder : $folder_new, DAO_MailTemplate::DESCRIPTION => $description, DAO_MailTemplate::CONTENT => $content, DAO_MailTemplate::TEMPLATE_TYPE => $type, DAO_MailTemplate::OWNER_ID => $worker->id);
if (empty($id)) {
// new
$id = DAO_MailTemplate::create($fields);
} else {
// edit
DAO_MailTemplate::update($id, $fields);
}
} else {
// delete
DAO_MailTemplate::delete($id);
}
}
示例9: handleRequest
function handleRequest(DevblocksHttpRequest $request)
{
$worker = CerberusApplication::getActiveWorker();
if (empty($worker)) {
return;
}
$stack = $request->path;
array_shift($stack);
// print
@($object = strtolower(array_shift($stack)));
// ticket|message|etc
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->_TPL_PATH);
$settings = DevblocksPlatform::getPluginSettingsService();
$tpl->assign('settings', $settings);
$translate = DevblocksPlatform::getTranslationService();
$tpl->assign('translate', $translate);
$teams = DAO_Group::getAll();
$tpl->assign('teams', $teams);
$buckets = DAO_Bucket::getAll();
$tpl->assign('buckets', $buckets);
$workers = DAO_Worker::getAll();
$tpl->assign('workers', $workers);
// Security
$active_worker = CerberusApplication::getActiveWorker();
$active_worker_memberships = $active_worker->getMemberships();
// [TODO] Make this pluggable
// Subcontroller
switch ($object) {
case 'ticket':
@($id = array_shift($stack));
@($ticket = is_numeric($id) ? DAO_Ticket::getTicket($id) : DAO_Ticket::getTicketByMask($id));
$convo_timeline = array();
$messages = $ticket->getMessages();
foreach ($messages as $message_id => $message) {
/* @var $message CerberusMessage */
$key = $message->created_date . '_m' . $message_id;
// build a chrono index of messages
$convo_timeline[$key] = array('m', $message_id);
}
@($mail_inline_comments = DAO_WorkerPref::get($active_worker->id, 'mail_inline_comments', 1));
if ($mail_inline_comments) {
// if inline comments are enabled
$comments = DAO_TicketComment::getByTicketId($ticket->id);
arsort($comments);
$tpl->assign('comments', $comments);
// build a chrono index of comments
foreach ($comments as $comment_id => $comment) {
/* @var $comment Model_TicketComment */
$key = $comment->created . '_c' . $comment_id;
$convo_timeline[$key] = array('c', $comment_id);
}
}
ksort($convo_timeline);
$tpl->assign('convo_timeline', $convo_timeline);
// Comment parent addresses
$comment_addresses = array();
foreach ($comments as $comment) {
/* @var $comment Model_TicketComment */
$address_id = intval($comment->address_id);
if (!isset($comment_addresses[$address_id])) {
$address = DAO_Address::get($address_id);
$comment_addresses[$address_id] = $address;
}
}
$tpl->assign('comment_addresses', $comment_addresses);
// Message Notes
$notes = DAO_MessageNote::getByTicketId($ticket->id);
$message_notes = array();
// Index notes by message id
if (is_array($notes)) {
foreach ($notes as $note) {
if (!isset($message_notes[$note->message_id])) {
$message_notes[$note->message_id] = array();
}
$message_notes[$note->message_id][$note->id] = $note;
}
}
$tpl->assign('message_notes', $message_notes);
// Make sure we're allowed to view this ticket or message
if (!isset($active_worker_memberships[$ticket->team_id])) {
echo "<H1>" . $translate->_('common.access_denied') . "</H1>";
return;
}
$tpl->assign('ticket', $ticket);
$tpl->display('file:' . $this->_TPL_PATH . 'print/ticket.tpl');
break;
case 'message':
@($id = array_shift($stack));
@($message = DAO_Ticket::getMessage($id));
@($ticket = DAO_Ticket::getTicket($message->ticket_id));
// Make sure we're allowed to view this ticket or message
if (!isset($active_worker_memberships[$ticket->team_id])) {
echo "<H1>" . $translate->_('common.access_denied') . "</H1>";
return;
}
// Message Notes
$notes = DAO_MessageNote::getByTicketId($ticket->id);
$message_notes = array();
// Index notes by message id
//.........这里部分代码省略.........
示例10: saveTabFieldsAction
function saveTabFieldsAction()
{
@($group_id = DevblocksPlatform::importGPC($_POST['team_id'], 'integer'));
@($active_worker = CerberusApplication::getActiveWorker());
if (!$active_worker->isTeamManager($group_id) && !$active_worker->is_superuser) {
return;
}
@($ids = DevblocksPlatform::importGPC($_POST['ids'], 'array', array()));
@($names = DevblocksPlatform::importGPC($_POST['names'], 'array', array()));
@($orders = DevblocksPlatform::importGPC($_POST['orders'], 'array', array()));
@($options = DevblocksPlatform::importGPC($_POST['options'], 'array', array()));
@($allow_delete = DevblocksPlatform::importGPC($_POST['allow_delete'], 'integer', 0));
@($deletes = DevblocksPlatform::importGPC($_POST['deletes'], 'array', array()));
if (!empty($ids)) {
foreach ($ids as $idx => $id) {
@($name = $names[$idx]);
@($order = intval($orders[$idx]));
@($option = $options[$idx]);
@($delete = false !== array_search($id, $deletes) ? 1 : 0);
if ($allow_delete && $delete) {
DAO_CustomField::delete($id);
} else {
$fields = array(DAO_CustomField::NAME => $name, DAO_CustomField::POS => $order, DAO_CustomField::OPTIONS => !is_null($option) ? $option : '');
DAO_CustomField::update($id, $fields);
}
}
}
// Add custom field
@($add_name = DevblocksPlatform::importGPC($_POST['add_name'], 'string', ''));
@($add_type = DevblocksPlatform::importGPC($_POST['add_type'], 'string', ''));
@($add_options = DevblocksPlatform::importGPC($_POST['add_options'], 'string', ''));
if (!empty($add_name) && !empty($add_type)) {
$fields = array(DAO_CustomField::NAME => $add_name, DAO_CustomField::TYPE => $add_type, DAO_CustomField::GROUP_ID => $group_id, DAO_CustomField::SOURCE_EXTENSION => ChCustomFieldSource_Ticket::ID, DAO_CustomField::OPTIONS => $add_options);
$id = DAO_CustomField::create($fields);
}
DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('groups', $group_id, 'fields')));
}
示例11: getGroupTotals
static function getGroupTotals()
{
$db = DevblocksPlatform::getDatabaseService();
$active_worker = CerberusApplication::getActiveWorker();
$memberships = $active_worker->getMemberships();
if (empty($memberships)) {
return array();
}
// Group Loads
$sql = sprintf("SELECT count(t.id) AS hits, t.team_id, t.category_id " . "FROM ticket t " . "LEFT JOIN category c ON (t.category_id=c.id) " . "WHERE t.is_waiting = 0 AND t.is_closed = 0 AND t.is_deleted = 0 " . "AND t.next_worker_id = 0 " . "AND (c.id IS NULL OR c.is_assignable = 1) " . "GROUP BY t.team_id, c.pos ");
$rs_buckets = $db->Execute($sql);
$group_counts = array();
while (!$rs_buckets->EOF) {
$team_id = intval($rs_buckets->fields['team_id']);
$category_id = intval($rs_buckets->fields['category_id']);
$hits = intval($rs_buckets->fields['hits']);
if (isset($memberships[$team_id])) {
// If the group manager doesn't want this group inbox assignable (default to YES)
if (empty($category_id) && !DAO_GroupSettings::get($team_id, DAO_GroupSettings::SETTING_INBOX_IS_ASSIGNABLE, 1)) {
// ...skip the unassignable inbox
} else {
if (!isset($group_counts[$team_id])) {
$group_counts[$team_id] = array();
}
$group_counts[$team_id][$category_id] = $hits;
@($group_counts[$team_id]['total'] = intval($group_counts[$team_id]['total']) + $hits);
}
}
$rs_buckets->MoveNext();
}
return $group_counts;
}
示例12: getChooserView
function getChooserView() {
$active_worker = CerberusApplication::getActiveWorker();
// View
$view_id = 'chooser_'.str_replace('.','_',$this->id).time().mt_rand(0,9999);
$defaults = new C4_AbstractViewModel();
$defaults->id = $view_id;
$defaults->is_ephemeral = true;
$defaults->class_name = $this->getViewClass();
$view = C4_AbstractViewLoader::getView($view_id, $defaults);
$view->addParams(array(
SearchFields_Issue::STATE => new DevblocksSearchCriteria(SearchFields_Issue::STATE,'!=','closed'),
), true);
$view->renderSortBy = SearchFields_Issue::UPDATED_DATE;
$view->renderSortAsc = false;
$view->renderLimit = 10;
$view->renderTemplate = 'contextlinks_chooser';
C4_AbstractViewLoader::setView($view_id, $view);
return $view;
}
示例13: mergeTicket
private function mergeTicket($event)
{
// Listen for ticket merges and update our internal ticket_id records
@($new_ticket_id = $event->params['new_ticket_id']);
@($old_ticket_ids = $event->params['old_ticket_ids']);
$translate = DevblocksPlatform::getTranslationService();
if (empty($new_ticket_id) || empty($old_ticket_ids)) {
return;
}
$settings = DevblocksPlatform::getPluginSettingsService();
$al_merge_enabled = intval($settings->get('cerb5blog.last_action_and_audit_log', 'al_merge_enabled', 0));
$uf_merge_enabled = intval($settings->get('cerb5blog.last_action_and_audit_log', 'uf_merge_enabled', 0));
if (!($al_merge_enabled || $uf_merge_enabled)) {
return;
}
$active_worker = CerberusApplication::getActiveWorker();
$worker_id = $active_worker->id;
if (class_exists('DAO_TicketAuditLog', true)) {
if ($al_merge_enabled) {
foreach ($old_ticket_ids as $old_id) {
$old_ticket = DAO_Ticket::get($old_id);
$translate_str = $translate->_('cerb5blog.last_action_and_audit_log.post.merge.new_ticket');
$translated = sprintf($translate_str, $old_id, $old_ticket->mask);
$fields = array(DAO_TicketAuditLog::TICKET_ID => $new_ticket_id, DAO_TicketAuditLog::WORKER_ID => $worker_id, DAO_TicketAuditLog::CHANGE_DATE => time(), DAO_TicketAuditLog::CHANGE_FIELD => "cerb5blog.last_action_and_audit_log.type.merge", DAO_TicketAuditLog::CHANGE_VALUE => substr($translated, 0, 128));
$log_id = DAO_TicketAuditLog::create($fields);
}
unset($fields);
}
}
if ($uf_merge_enabled) {
$new_change_fields[DAO_Ticket::UPDATED_DATE] = time();
DAO_Ticket::update($new_ticket_id, $new_change_fields);
unset($new_change_fields);
}
}
示例14: saveTab
function saveTab()
{
@($forward_bucket = DevblocksPlatform::importGPC($_REQUEST['forward_bucket'], 'string', ''));
@($forward_address = DevblocksPlatform::importGPC($_REQUEST['forward_address'], 'string', ''));
@($forward_event = DevblocksPlatform::importGPC($_REQUEST['forward_event'], 'string', ''));
$worker = CerberusApplication::getActiveWorker();
// Delete forwards
@($forward_deletes = DevblocksPlatform::importGPC($_REQUEST['forward_deletes'], 'array', array()));
if (!empty($forward_deletes)) {
DAO_WorkerMailForward::delete($forward_deletes);
}
// Add forward
if (!empty($forward_bucket) && !empty($forward_address) && !empty($forward_event)) {
@(list($group_id, $bucket_id) = split('_', $forward_bucket));
if (is_null($group_id) || is_null($bucket_id)) {
break;
}
$fields = array(DAO_WorkerMailForward::WORKER_ID => $worker->id, DAO_WorkerMailForward::GROUP_ID => $group_id, DAO_WorkerMailForward::BUCKET_ID => $bucket_id, DAO_WorkerMailForward::EMAIL => $forward_address, DAO_WorkerMailForward::EVENT => $forward_event);
DAO_WorkerMailForward::create($fields);
}
// Assignment notifications
@($assign_notify_email = DevblocksPlatform::importGPC($_REQUEST['assign_notify_email'], 'string', ''));
DAO_WorkerPref::set($worker->id, ChWatchersPlugin::WORKER_PREF_ASSIGN_EMAIL, $assign_notify_email);
DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('preferences', 'notifications')));
}
示例15: saveRssAction
function saveRssAction()
{
@($id = DevblocksPlatform::importGPC($_POST['id']));
$active_worker = CerberusApplication::getActiveWorker();
if (null != ($feed = DAO_ViewRss::getId($id)) && $feed->worker_id == $active_worker->id) {
DAO_ViewRss::delete($id);
}
DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('preferences', 'rss')));
}