function doResetCriteria() { parent::doResetCriteria(); $this->params = array(); }
function doResetCriteria() { parent::doResetCriteria(); $this->params = array(SearchFields_FeedbackEntry::LOG_DATE => new DevblocksSearchCriteria(SearchFields_FeedbackEntry::LOG_DATE, DevblocksSearchCriteria::OPER_BETWEEN, array('-1 month', 'now'))); }
function renderCriteriaParam($param) { $field = $param->field; $values = !is_array($param->value) ? array($param->value) : $param->value; switch ($field) { case SearchFields_KbArticle::TOP_CATEGORY_ID: $topics = DAO_KbCategory::getWhere(sprintf("%s = %d", DAO_KbCategory::PARENT_ID, 0)); $strings = array(); foreach ($values as $val) { if (0 == $val) { $strings[] = "None"; } else { if (!isset($topics[$val])) { continue; } $strings[] = $topics[$val]->name; } } echo implode(", ", $strings); break; default: parent::renderCriteriaParam($param); break; } }
function doResetCriteria() { parent::doResetCriteria(); $this->params = array(SearchFields_ForumsThread::IS_CLOSED => new DevblocksSearchCriteria(SearchFields_ForumsThread::IS_CLOSED, '=', 0)); }
/** * @param integer[] $ticket_ids */ function run($ticket_ids) { if (!is_array($ticket_ids)) { $ticket_ids = array($ticket_ids); } $fields = array(); $field_values = array(); $groups = DAO_Group::getAll(); $buckets = DAO_Bucket::getAll(); // $workers = DAO_Worker::getAll(); $custom_fields = DAO_CustomField::getAll(); // actions if (is_array($this->actions)) { foreach ($this->actions as $action => $params) { switch ($action) { // case 'status': // if(isset($params['is_waiting'])) // $fields[DAO_Ticket::IS_WAITING] = intval($params['is_waiting']); // if(isset($params['is_closed'])) // $fields[DAO_Ticket::IS_CLOSED] = intval($params['is_closed']); // if(isset($params['is_deleted'])) // $fields[DAO_Ticket::IS_DELETED] = intval($params['is_deleted']); // break; // case 'assign': // if(isset($params['worker_id'])) { // $w_id = intval($params['worker_id']); // if(0 == $w_id || isset($workers[$w_id])) // $fields[DAO_Ticket::NEXT_WORKER_ID] = $w_id; // } // break; case 'move': if (isset($params['group_id']) && isset($params['bucket_id'])) { $g_id = intval($params['group_id']); $b_id = intval($params['bucket_id']); if (isset($groups[$g_id]) && (0 == $b_id || isset($buckets[$b_id]))) { $fields[DAO_Ticket::TEAM_ID] = $g_id; $fields[DAO_Ticket::CATEGORY_ID] = $b_id; } } break; // case 'spam': // if(isset($params['is_spam'])) { // if(intval($params['is_spam'])) { // foreach($ticket_ids as $ticket_id) // CerberusBayes::markTicketAsSpam($ticket_id); // } else { // foreach($ticket_ids as $ticket_id) // CerberusBayes::markTicketAsNotSpam($ticket_id); // } // } // break; // case 'spam': // if(isset($params['is_spam'])) { // if(intval($params['is_spam'])) { // foreach($ticket_ids as $ticket_id) // CerberusBayes::markTicketAsSpam($ticket_id); // } else { // foreach($ticket_ids as $ticket_id) // CerberusBayes::markTicketAsNotSpam($ticket_id); // } // } // break; default: // Custom fields if (substr($action, 0, 3) == "cf_") { $field_id = intval(substr($action, 3)); if (!isset($custom_fields[$field_id]) || !isset($params['value'])) { break; } $field_values[$field_id] = $params; } break; } } } if (!empty($ticket_ids)) { if (!empty($fields)) { DAO_Ticket::updateTicket($ticket_ids, $fields); } // Custom Fields C4_AbstractView::_doBulkSetCustomFields(ChCustomFieldSource_Ticket::ID, $field_values, $ticket_ids); } }
function renderCriteriaParam($param) { $field = $param->field; $values = !is_array($param->value) ? array($param->value) : $param->value; switch($field) { default: parent::renderCriteriaParam($param); break; } }
function doResetCriteria() { parent::doResetCriteria(); $this->params = array(SearchFields_RssExpItem::IS_READ => new DevblocksSearchCriteria(SearchFields_RssExpItem::IS_READ, DevblocksSearchCriteria::OPER_EQ, 0)); }
function doResetCriteria() { parent::doResetCriteria(); $this->params = array(SearchFields_CallEntry::IS_CLOSED => new DevblocksSearchCriteria(SearchFields_CallEntry::IS_CLOSED, DevblocksSearchCriteria::OPER_EQ, 0)); }
function doResetCriteria() { parent::doResetCriteria(); $this->params = array(SearchFields_Task::IS_COMPLETED => new DevblocksSearchCriteria(SearchFields_Task::IS_COMPLETED, '=', 0)); }
function doResetCriteria() { parent::doResetCriteria(); // $this->params = array( // SearchFields_WorkerEvent::NUM_NONSPAM => new DevblocksSearchCriteria(SearchFields_WorkerEvent::NUM_NONSPAM,'>',0), // ); }