static function delete($ids) { if (!is_array($ids)) { $ids = array($ids); } $db = DevblocksPlatform::getDatabaseService(); $ids_list = implode(',', $ids); // Opps $db->Execute(sprintf("DELETE QUICK FROM crm_opportunity WHERE id IN (%s)", $ids_list)); // Custom fields DAO_CustomFieldValue::deleteBySourceIds(CrmCustomFieldSource_Opportunity::ID, $ids); // Notes DAO_Note::deleteBySourceIds(CrmNotesSource_Opportunity::ID, $ids); return true; }
function deleteOrgNoteAction() { @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0)); @($org_id = DevblocksPlatform::importGPC($_REQUEST['org_id'], 'integer', 0)); $active_worker = CerberusApplication::getActiveWorker(); if (null != ($note = DAO_Note::get($id))) { if ($note->worker_id == $active_worker->id || $active_worker->is_superuser) { DAO_Note::delete($id); } } DevblocksPlatform::redirect(new DevblocksHttpResponse(array('contacts', 'orgs', 'display', $org_id))); }
/** * Enter description here... * * @param array $ids */ static function delete($ids) { if (!is_array($ids)) { $ids = array($ids); } $db = DevblocksPlatform::getDatabaseService(); if (empty($ids)) { return; } $ids_list = implode(',', $ids); // Tasks $db->Execute(sprintf("DELETE QUICK FROM task WHERE id IN (%s)", $ids_list)); // Custom fields DAO_CustomFieldValue::deleteBySourceIds(ChCustomFieldSource_Task::ID, $ids); // Notes DAO_Note::deleteBySourceIds(ChNotesSource_Task::ID, $ids); return true; }
/** * @param array $ids */ static function delete($ids) { if (!is_array($ids)) { $ids = array($ids); } $db = DevblocksPlatform::getDatabaseService(); $id_list = implode(',', $ids); // Orgs $sql = sprintf("DELETE QUICK FROM contact_org WHERE id IN (%s)", $id_list); $db->Execute($sql) or die(__CLASS__ . '(' . __LINE__ . ')' . ':' . $db->ErrorMsg()); /* @var $rs ADORecordSet */ // Clear any associated addresses $sql = sprintf("UPDATE address SET contact_org_id = 0 WHERE contact_org_id IN (%s)", $id_list); $db->Execute($sql) or die(__CLASS__ . '(' . __LINE__ . ')' . ':' . $db->ErrorMsg()); /* @var $rs ADORecordSet */ // Tasks DAO_Task::deleteBySourceIds('cerberusweb.tasks.org', $ids); // Custom fields DAO_CustomFieldValue::deleteBySourceIds(ChCustomFieldSource_Org::ID, $ids); // Notes DAO_Note::deleteBySourceIds(ChNotesSource_Org::ID, $ids); }
function showTab() { $tpl = DevblocksPlatform::getTemplateService(); $response = DevblocksPlatform::getHttpResponse(); // are we displaying the main home page? $path = $response->path; array_shift($path); // iphone // array_shift($path); // activity array_shift($path); // opportunities $action = array_shift($path); // current action $id = array_shift($path); // opp id list($notes, $null) = DAO_Note::search(array(new DevblocksSearchCriteria(SearchFields_Note::SOURCE_EXT_ID, '=', CrmNotesSource_Opportunity::ID), new DevblocksSearchCriteria(SearchFields_Note::SOURCE_ID, '=', $id)), 25, 0, DAO_Note::CREATED, false, false); // var_dump($notes); $tpl->assign('notes', $notes); $tpl->display('file:' . $this->_TPL_PATH . 'display/notes.tpl'); }