当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Case_BAO_Case::deleteCase方法代码示例

本文整理汇总了PHP中CRM_Case_BAO_Case::deleteCase方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Case_BAO_Case::deleteCase方法的具体用法?PHP CRM_Case_BAO_Case::deleteCase怎么用?PHP CRM_Case_BAO_Case::deleteCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Case_BAO_Case的用法示例。


在下文中一共展示了CRM_Case_BAO_Case::deleteCase方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hrcaseutils_civicrm_uninstall

/**
 * Implementation of hook_civicrm_uninstall
 */
function hrcaseutils_civicrm_uninstall()
{
    //delete all activity type
    CRM_Core_DAO::executeQuery("DELETE FROM civicrm_option_value WHERE name IN ('Interview Prospect', 'Background_Check', 'ID badge')");
    $caseTypes = CRM_Case_PseudoConstant::caseType('name', FALSE);
    $value = array_search('Hrdata', $caseTypes);
    //Delete cases and related contact of type Hrdata on uninstall
    if ($value) {
        $caseDAO = new CRM_Case_DAO_Case();
        $caseDAO->case_type_id = $value;
        $caseDAO->find();
        while ($caseDAO->fetch()) {
            CRM_Case_BAO_Case::deleteCase($caseDAO->id);
        }
    }
    return _hrcaseutils_civix_civicrm_uninstall();
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:20,代码来源:hrcaseutils.php

示例2: postProcess

 /**
  * Process the form after the input has been submitted and validated.
  */
 public function postProcess()
 {
     $deleted = $failed = 0;
     foreach ($this->_caseIds as $caseId) {
         if (CRM_Case_BAO_Case::deleteCase($caseId, $this->_moveToTrash)) {
             $deleted++;
         } else {
             $failed++;
         }
     }
     if ($deleted) {
         if ($this->_moveToTrash) {
             $msg = ts('%count case moved to trash.', array('plural' => '%count cases moved to trash.', 'count' => $deleted));
         } else {
             $msg = ts('%count case permanently deleted.', array('plural' => '%count cases permanently deleted.', 'count' => $deleted));
         }
         CRM_Core_Session::setStatus($msg, ts('Removed'), 'success');
     }
     if ($failed) {
         CRM_Core_Session::setStatus(ts('1 could not be deleted.', array('plural' => '%count could not be deleted.', 'count' => $failed)), ts('Error'), 'error');
     }
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:25,代码来源:Delete.php

示例3: civicrm_api3_case_delete

/**
* Delete a specified case.
*
* @param  array(
   //REQUIRED:
* 'id' => int
*
* //OPTIONAL
* 'move_to_trash' => bool (defaults to false)
*
* @return boolean: true if success, else false
* {@getfields case_delete}
* @access public
*/
function civicrm_api3_case_delete($params)
{
    //check parameters
    civicrm_api3_verify_mandatory($params, NULL, array('id'));
    if (CRM_Case_BAO_Case::deleteCase($params['id'], CRM_Utils_Array::value('move_to_trash', $params, FALSE))) {
        return civicrm_api3_create_success($params, $params, 'case', 'delete');
    } else {
        return civicrm_api3_create_error('Could not delete case.');
    }
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:24,代码来源:Case.php

示例4: postProcess

 /**
  * process the form after the input has been submitted and validated
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     $deletedCases = 0;
     foreach ($this->_caseIds as $caseId) {
         if (CRM_Case_BAO_Case::deleteCase($caseId, $this->_moveToTrash)) {
             $deletedCases++;
         }
     }
     CRM_Core_Session::setStatus($deletedCases, ts('Deleted Cases'), 'success');
     CRM_Core_Session::setStatus('', ts('Total Selected Case(s): %1', array(1 => count($this->_caseIds))), 'info');
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:18,代码来源:Delete.php

示例5: postProcess

 /**
  * Function to process the form
  *
  * @access public
  *
  * @return None
  */
 public function postProcess()
 {
     $tx = new CRM_Core_Transaction();
     // check if dedupe button, if so return.
     $buttonName = $this->controller->getButtonName();
     if (isset($this->_dedupeButtonName) && $buttonName == $this->_dedupeButtonName) {
         return;
     }
     if ($this->_action & CRM_Core_Action::DELETE) {
         $statusMsg = NULL;
         $caseDelete = CRM_Case_BAO_Case::deleteCase($this->_caseId, TRUE);
         if ($caseDelete) {
             $statusMsg = ts('The selected case has been moved to the Trash. You can view and / or restore deleted cases by checking the "Deleted Cases" option under Find Cases.<br />');
         }
         CRM_Core_Session::setStatus($statusMsg);
         return;
     }
     if ($this->_action & CRM_Core_Action::RENEW) {
         $statusMsg = NULL;
         $caseRestore = CRM_Case_BAO_Case::restoreCase($this->_caseId);
         if ($caseRestore) {
             $statusMsg = ts('The selected case has been restored.<br />');
         }
         CRM_Core_Session::setStatus($statusMsg);
         return;
     }
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     $params['now'] = date("Ymd");
     // 1. call begin post process
     if ($this->_activityTypeFile) {
         eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}" . "::beginPostProcess( \$this, \$params );");
     }
     if (CRM_Utils_Array::value('hidden_custom', $params) && !isset($params['custom'])) {
         $customFields = array();
         $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $customFields, NULL, 'Case');
     }
     // 2. create/edit case
     if (CRM_Utils_Array::value('case_type_id', $params)) {
         $caseType = CRM_Case_PseudoConstant::caseType('name');
         $params['case_type'] = $caseType[$params['case_type_id']];
         $params['subject'] = $params['activity_subject'];
         $params['case_type_id'] = CRM_Core_DAO::VALUE_SEPARATOR . $params['case_type_id'] . CRM_Core_DAO::VALUE_SEPARATOR;
     }
     $caseObj = CRM_Case_BAO_Case::create($params);
     $params['case_id'] = $caseObj->id;
     // unset any ids, custom data
     unset($params['id'], $params['custom']);
     // add tags if exists
     $tagParams = array();
     if (!empty($params['tag'])) {
         $tagParams = array();
         foreach ($params['tag'] as $tag) {
             $tagParams[$tag] = 1;
         }
     }
     CRM_Core_BAO_EntityTag::create($tagParams, 'civicrm_case', $caseObj->id);
     //save free tags
     if (isset($params['case_taglist']) && !empty($params['case_taglist'])) {
         CRM_Core_Form_Tag::postProcess($params['case_taglist'], $caseObj->id, 'civicrm_case', $this);
     }
     // user context
     $url = CRM_Utils_System::url('civicrm/contact/view/case', "reset=1&action=view&cid={$this->_currentlyViewedContactId}&id={$caseObj->id}");
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext($url);
     // 3. format activity custom data
     if (CRM_Utils_Array::value('hidden_custom', $params)) {
         $customFields = CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE, $this->_activityTypeId);
         $customFields = CRM_Utils_Array::crmArrayMerge($customFields, CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE, NULL, NULL, TRUE));
         $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $customFields, $this->_activityId, 'Activity');
     }
     // 4. call end post process
     if ($this->_activityTypeFile) {
         eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}" . "::endPostProcess( \$this, \$params );");
     }
     // 5. auto populate activites
     // 6. set status
     CRM_Core_Session::setStatus("{$params['statusMsg']}");
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:86,代码来源:Case.php

示例6: deleteContact

 /**
  * Delete a contact and all its associated records.
  *
  * @param int $id
  *   Id of the contact to delete.
  * @param bool $restore
  *   Whether to actually restore, not delete.
  * @param bool $skipUndelete
  *   Whether to force contact delete or not.
  *
  * @return bool
  *   Was contact deleted?
  */
 public static function deleteContact($id, $restore = FALSE, $skipUndelete = FALSE)
 {
     if (!$id) {
         return FALSE;
     }
     // If trash is disabled in system settings then we always skip
     if (!CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_undelete', NULL, 1)) {
         $skipUndelete = TRUE;
     }
     // make sure we have edit permission for this contact
     // before we delete
     if ($skipUndelete && !CRM_Core_Permission::check('delete contacts') || $restore && !CRM_Core_Permission::check('access deleted contacts')) {
         return FALSE;
     }
     // CRM-12929
     // Restrict contact to be delete if contact has financial trxns
     $error = NULL;
     if ($skipUndelete && CRM_Financial_BAO_FinancialItem::checkContactPresent(array($id), $error)) {
         return FALSE;
     }
     // make sure this contact_id does not have any membership types
     $membershipTypeID = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $id, 'id', 'member_of_contact_id');
     if ($membershipTypeID) {
         return FALSE;
     }
     $contact = new CRM_Contact_DAO_Contact();
     $contact->id = $id;
     if (!$contact->find(TRUE)) {
         return FALSE;
     }
     $contactType = $contact->contact_type;
     // currently we only clear employer cache.
     // we are now deleting inherited membership if any.
     if ($contact->contact_type == 'Organization') {
         $action = $restore ? CRM_Core_Action::ENABLE : CRM_Core_Action::DISABLE;
         $relationshipDtls = CRM_Contact_BAO_Relationship::getRelationship($id);
         if (!empty($relationshipDtls)) {
             foreach ($relationshipDtls as $rId => $details) {
                 CRM_Contact_BAO_Relationship::disableEnableRelationship($rId, $action);
             }
         }
         CRM_Contact_BAO_Contact_Utils::clearAllEmployee($id);
     }
     if ($restore) {
         return self::contactTrashRestore($contact, TRUE);
     }
     // start a new transaction
     $transaction = new CRM_Core_Transaction();
     if ($skipUndelete) {
         CRM_Utils_Hook::pre('delete', $contactType, $id, CRM_Core_DAO::$_nullArray);
         //delete billing address if exists.
         CRM_Contribute_BAO_Contribution::deleteAddress(NULL, $id);
         // delete the log entries since we dont have triggers enabled as yet
         $logDAO = new CRM_Core_DAO_Log();
         $logDAO->entity_table = 'civicrm_contact';
         $logDAO->entity_id = $id;
         $logDAO->delete();
         // delete contact participants CRM-12155
         CRM_Event_BAO_Participant::deleteContactParticipant($id);
         // delete contact contributions CRM-12155
         CRM_Contribute_BAO_Contribution::deleteContactContribution($id);
         // do activity cleanup, CRM-5604
         CRM_Activity_BAO_Activity::cleanupActivity($id);
         // delete all notes related to contact
         CRM_Core_BAO_Note::cleanContactNotes($id);
         // delete cases related to contact
         $contactCases = CRM_Case_BAO_Case::retrieveCaseIdsByContactId($id);
         if (!empty($contactCases)) {
             foreach ($contactCases as $caseId) {
                 //check if case is associate with other contact or not.
                 $caseContactId = CRM_Case_BAO_Case::getCaseClients($caseId);
                 if (count($caseContactId) <= 1) {
                     CRM_Case_BAO_Case::deleteCase($caseId);
                 }
             }
         }
         $contact->delete();
     } else {
         self::contactTrashRestore($contact);
     }
     //delete the contact id from recently view
     CRM_Utils_Recent::delContact($id);
     // Update the group contact cache
     if ($restore) {
         CRM_Contact_BAO_GroupContactCache::remove();
     } else {
         CRM_Contact_BAO_GroupContactCache::removeContact($id);
//.........这里部分代码省略.........
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:101,代码来源:Contact.php

示例7: postProcess

 /**
  * process the form after the input has been submitted and validated
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     $deletedCases = 0;
     require_once 'CRM/Case/BAO/Case.php';
     foreach ($this->_caseIds as $caseId) {
         if (CRM_Case_BAO_Case::deleteCase($caseId, $this->_moveToTrash)) {
             $deletedCases++;
         }
     }
     $status = array(ts('Deleted Case(s): %1', array(1 => $deletedCases)), ts('Total Selected Case(s): %1', array(1 => count($this->_caseIds))));
     CRM_Core_Session::setStatus($status);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:18,代码来源:Delete.php

示例8: del

 public static function del($vacancyID)
 {
     $vacancy = new self();
     $vacancy->id = $vacancyID;
     $vacancy->find(TRUE);
     //Delete all Application cases linked to this vacancy
     $customTableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', 'application_case', 'table_name', 'name');
     $query = "SELECT entity_id FROM {$customTableName} WHERE vacancy_id = {$vacancyID}";
     $ctDAO = CRM_Core_DAO::executeQuery($query);
     while ($ctDAO->fetch()) {
         CRM_Case_BAO_Case::deleteCase($ctDAO->entity_id);
     }
     $vacancy->delete();
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:14,代码来源:HRVacancy.php

示例9: postProcess

 /** 
  * Function to process the form 
  * 
  * @access public 
  * @return None 
  */
 public function postProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         require_once 'CRM/Case/BAO/Case.php';
         CRM_Case_BAO_Case::deleteCase($this->_id);
         CRM_Core_Session::setStatus(ts("Selected Case has been deleted."));
         return;
     }
     // get the submitted form values.
     $params = $this->controller->exportValues($this->_name);
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $params['id'] = $this->_id;
     }
     $params['contact_id'] = $this->_contactID;
     $params['start_date'] = CRM_Utils_Date::format($params['start_date']);
     $params['end_date'] = CRM_Utils_Date::format($params['end_date']);
     $params['case_type_id'] = CRM_Case_BAO_Case::VALUE_SEPERATOR . implode(CRM_Case_BAO_Case::VALUE_SEPERATOR, $params['case_type_id']) . CRM_Case_BAO_Case::VALUE_SEPERATOR;
     $config =& CRM_Core_Config::singleton();
     if ($config->civiHRD) {
         $params['casetag2_id'] = CRM_Case_BAO_Case::VALUE_SEPERATOR . implode(CRM_Case_BAO_Case::VALUE_SEPERATOR, $params['casetag2_id']) . CRM_Case_BAO_Case::VALUE_SEPERATOR;
         $params['casetag3_id'] = CRM_Case_BAO_Case::VALUE_SEPERATOR . implode(CRM_Case_BAO_Case::VALUE_SEPERATOR, $params['casetag3_id']) . CRM_Case_BAO_Case::VALUE_SEPERATOR;
     }
     require_once 'CRM/Case/BAO/Case.php';
     $case = CRM_Case_BAO_Case::create($params);
     CRM_Case_BAO_Case::deleteCaseContact($case->id);
     if (!empty($this->_contactIds) && is_array($this->_contactIds)) {
         foreach ($this->_contactIds as $key => $id) {
             if ($id) {
                 $contactParams = array('case_id' => $case->id, 'contact_id' => $id);
                 CRM_Case_BAO_Case::addCaseToContact($contactParams);
             }
         }
     } else {
         $contactParams = array('case_id' => $case->id, 'contact_id' => $this->_contactID);
         CRM_Case_BAO_Case::addCaseToContact($contactParams);
         foreach ($params['case_contact'] as $key => $id) {
             if ($id) {
                 $contactParams = array('case_id' => $case->id, 'contact_id' => $id);
                 CRM_Case_BAO_Case::addCaseToContact($contactParams);
             }
         }
     }
     // set status message
     CRM_Core_Session::setStatus(ts('Case \'%1\' has been saved.', array(1 => $params['subject'])));
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:51,代码来源:Case.php

示例10: civicrm_api3_case_delete

/**
* Delete a specified case.
*
* @param  array(
   //REQUIRED:
* 'case_id'           => int
*
* //OPTIONAL
* 'move_to_trash'     => bool (defaults to false)
*
* @return boolean: true if success, else false
* {@getfields case_delete}
* @access public
* @todo Eileen McNaughton 13 Oct 2011 No unit test
* @todo Erik Hommel 16 dec 2010 use utils function civicrm_verify_mandatory to check for required params
*/
function civicrm_api3_case_delete($params)
{
    //check parameters
    $errors = _civicrm_api3_case_check_params($params, 'delete');
    if ($errors) {
        return $errors;
    }
    if (CRM_Case_BAO_Case::deleteCase($params['case_id'], $params['move_to_trash'])) {
        return civicrm_api3_create_success('Case Deleted');
    } else {
        return civicrm_api3_create_error('Could not delete case.');
    }
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:29,代码来源:Case.php

示例11: hrcase_civicrm_uninstall

/**
 * Implementation of hook_civicrm_uninstall
 */
function hrcase_civicrm_uninstall()
{
    //update query to replace Assignment with Case
    $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'activity_type', 'id', 'name');
    $sql = "UPDATE civicrm_option_value SET label= replace(label, 'Assignment', 'Case') WHERE label like '%Assignment%' and option_group_id={$optionGroupID} and label <> 'New Assignment Created'";
    CRM_Core_DAO::executeQuery($sql);
    $sql = "UPDATE civicrm_option_value SET label= replace(label, 'Created New Assignment', 'Open Case') WHERE option_group_id={$optionGroupID}";
    CRM_Core_DAO::executeQuery($sql);
    $scheduleActions = hrcase_getActionsSchedule(TRUE);
    $scheduleAction = implode("','", $scheduleActions);
    CRM_Core_DAO::executeQuery("DELETE FROM civicrm_action_schedule WHERE name IN ('{$scheduleAction}')");
    $sql = "DELETE FROM civicrm_option_value WHERE name IN ('Issue appointment letter','Fill Employee Details Form','Submission of ID/Residence proofs and photos','Program and work induction by program supervisor','Enter employee data in CiviHR','Group Orientation to organization values policies','Probation appraisal','Conduct appraisal','Collection of appraisal paperwork','Issue confirmation/warning letter','Get \"No Dues\" certification','Conduct Exit interview','Revoke access to databases','Block work email ID','Follow up on progress','Collection of Appraisal forms','Issue extension letter','Schedule joining date','Group Orientation to organization, values, policies','Probation appraisal (start probation workflow)','Schedule Exit Interview','Prepare formats','Print formats','Collate and print goals','References Check','Prepare and email schedule')";
    CRM_Core_DAO::executeQuery($sql);
    hrcase_example_caseType(TRUE);
    //delete custom group and custom field
    foreach (array('Joining_Data', 'Exiting_Data') as $cgName) {
        $customGroup = civicrm_api3('CustomGroup', 'getsingle', array('return' => "id", 'name' => $cgName));
        civicrm_api3('CustomGroup', 'delete', array('id' => $customGroup['id']));
    }
    $isEnabled = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Extension', 'org.civicrm.hrrecruitment', 'is_active', 'full_name');
    if (!$isEnabled) {
        CRM_Core_DAO::executeQuery("DELETE FROM `civicrm_relationship_type` WHERE name_b_a IN ('Recruiting Manager')");
    }
    //Delete cases and related contact on uninstall
    $caseTypes = CRM_Case_PseudoConstant::caseType('name', FALSE);
    $cases = array('Joining', 'Exiting', 'Probation', 'Appraisal');
    foreach ($caseTypes as $caseTypeKey => $caseType) {
        if (in_array($caseType, $cases)) {
            $caseDAO = new CRM_Case_DAO_Case();
            $caseDAO->case_type_id = $caseTypeKey;
            $caseDAO->find();
            while ($caseDAO->fetch()) {
                CRM_Case_BAO_Case::deleteCase($caseDAO->id);
            }
        }
    }
    return _hrcase_civix_civicrm_uninstall();
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:41,代码来源:hrcase.php

示例12: postProcess

 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     // check if dedupe button, if so return.
     $buttonName = $this->controller->getButtonName();
     if ($buttonName == $this->_dedupeButtonName) {
         return;
     }
     if ($this->_action & CRM_Core_Action::DELETE) {
         $statusMsg = null;
         require_once 'CRM/Case/BAO/Case.php';
         $caseDelete = CRM_Case_BAO_Case::deleteCase($this->_caseId, true);
         if ($caseDelete) {
             $statusMsg = ts('The selected case has been moved to the Trash. You can view and / or restore deleted cases by checking the "Deleted Cases" option under Find Cases.<br />');
         }
         CRM_Core_Session::setStatus($statusMsg);
         return;
     }
     if ($this->_action & CRM_Core_Action::RENEW) {
         $statusMsg = null;
         require_once 'CRM/Case/BAO/Case.php';
         $caseRestore = CRM_Case_BAO_Case::restoreCase($this->_caseId);
         if ($caseRestore) {
             $statusMsg = ts('The selected case has been restored.<br />');
         }
         CRM_Core_Session::setStatus($statusMsg);
         return;
     }
     // store the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
     $params['now'] = date("Ymd");
     require_once 'CRM/Case/XMLProcessor/Process.php';
     // 1. call begin post process
     if ($this->_activityTypeFile) {
         eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}" . "::beginPostProcess( \$this, \$params );");
     }
     // 2. create/edit case
     require_once 'CRM/Case/BAO/Case.php';
     if (CRM_Utils_Array::value('case_type_id', $params)) {
         $caseType = CRM_Core_OptionGroup::values('case_type', false, false, false, null, 'name');
         $params['case_type'] = $caseType[$params['case_type_id']];
         $params['case_type_id'] = CRM_Case_BAO_Case::VALUE_SEPERATOR . $params['case_type_id'] . CRM_Case_BAO_Case::VALUE_SEPERATOR;
     }
     $caseObj = CRM_Case_BAO_Case::create($params);
     $params['case_id'] = $caseObj->id;
     // unset any ids, custom data
     unset($params['id'], $params['custom']);
     // user context
     $url = CRM_Utils_System::url('civicrm/contact/view/case', "reset=1&action=view&cid={$this->_currentlyViewedContactId}&id={$caseObj->id}");
     $session =& CRM_Core_Session::singleton();
     $session->pushUserContext($url);
     // 3. format activity custom data
     if (CRM_Utils_Array::value('hidden_custom', $params)) {
         $customFields = CRM_Core_BAO_CustomField::getFields('Activity', false, false, $this->_activityTypeId);
         $customFields = CRM_Utils_Array::crmArrayMerge($customFields, CRM_Core_BAO_CustomField::getFields('Activity', false, false, null, null, true));
         $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $customFields, $this->_activityId, 'Activity');
     }
     // 4. call end post process
     if ($this->_activityTypeFile) {
         eval("CRM_Case_Form_Activity_{$this->_activityTypeFile}" . "::endPostProcess( \$this, \$params );");
     }
     // 5. auto populate activites
     // 6. set status
     CRM_Core_Session::setStatus("{$params['statusMsg']}");
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:70,代码来源:Case.php

示例13: hrrecruitment_civicrm_uninstall

/**
 * Implementation of hook_civicrm_uninstall
 */
function hrrecruitment_civicrm_uninstall()
{
    $vacanciesId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Vacancies', 'id', 'name');
    CRM_Core_BAO_Navigation::processDelete($vacanciesId);
    CRM_Core_BAO_Navigation::resetNavigation();
    CRM_Core_DAO::executeQuery("DELETE FROM civicrm_option_group WHERE name IN ('vacancy_status', 'work_experience', 'rate_the_applicant_s_communicati', 'rate_the_applicant_s_technical_s', 'languages_known')");
    $caseTypes = CRM_Case_PseudoConstant::caseType('name', FALSE);
    $value = array_search('Application', $caseTypes);
    //Delete cases and related contact of type Application on uninstall
    if ($value) {
        $caseDAO = new CRM_Case_DAO_Case();
        $caseDAO->case_type_id = $value;
        $caseDAO->find();
        while ($caseDAO->fetch()) {
            CRM_Case_BAO_Case::deleteCase($caseDAO->id);
        }
    }
    $CaseStatuses = CRM_Core_OptionGroup::values('case_status', FALSE, FALSE, FALSE, " AND grouping = 'Vacancy'", 'id', FALSE);
    $CaseStatus = implode(',', $CaseStatuses);
    CRM_Core_DAO::executeQuery("DELETE FROM civicrm_option_value WHERE id IN ({$CaseStatus}) OR name IN ('Evaluation', 'Comment')");
    foreach (array('application_profile', 'evaluation_profile') as $name) {
        $ufID = civicrm_api3('UFGroup', 'getsingle', array('return' => "id", 'name' => $name));
        civicrm_api3('UFGroup', 'delete', array('id' => $ufID['id']));
    }
    foreach (array('Application', 'application_case', 'Evaluation_fields') as $cgName) {
        $customGroup = civicrm_api3('CustomGroup', 'getsingle', array('return' => "id", 'name' => $cgName));
        civicrm_api3('CustomGroup', 'delete', array('id' => $customGroup['id']));
    }
    $isEnabled = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Extension', 'org.civicrm.hrcase', 'is_active', 'full_name');
    if (!$isEnabled) {
        CRM_Core_DAO::executeQuery("DELETE FROM `civicrm_relationship_type` WHERE name_b_a IN ('Recruiting Manager')");
    }
    return _hrrecruitment_civix_civicrm_uninstall();
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:37,代码来源:hrrecruitment.php


注:本文中的CRM_Case_BAO_Case::deleteCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。