當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Mailing_BAO_MailingJob::cancel方法代碼示例

本文整理匯總了PHP中CRM_Mailing_BAO_MailingJob::cancel方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Mailing_BAO_MailingJob::cancel方法的具體用法?PHP CRM_Mailing_BAO_MailingJob::cancel怎麽用?PHP CRM_Mailing_BAO_MailingJob::cancel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Mailing_BAO_MailingJob的用法示例。


在下文中一共展示了CRM_Mailing_BAO_MailingJob::cancel方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postProcess

 /**
  *
  * @return void
  */
 public function postProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         CRM_Mailing_BAO_Mailing::del($this->_mailingId);
     } elseif ($this->_action & CRM_Core_Action::DISABLE) {
         CRM_Mailing_BAO_MailingJob::cancel($this->_mailingId);
     } elseif ($this->_action & CRM_Core_Action::RENEW) {
         //set is_archived to 1
         CRM_Core_DAO::setFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingId, 'is_archived', TRUE);
     }
 }
開發者ID:nganivet,項目名稱:civicrm-core,代碼行數:15,代碼來源:Browse.php

示例2: run

 /**
  * Run this page (figure out the action needed and perform it).
  */
 public function run()
 {
     $this->preProcess();
     $newArgs = func_get_args();
     // since we want only first function argument
     $newArgs = $newArgs[0];
     if (isset($_GET['runJobs']) || CRM_Utils_Array::value('2', $newArgs) == 'queue') {
         $mailerJobSize = Civi::settings()->get('mailerJobSize');
         CRM_Mailing_BAO_MailingJob::runJobs_pre($mailerJobSize);
         CRM_Mailing_BAO_MailingJob::runJobs();
         CRM_Mailing_BAO_MailingJob::runJobs_post();
     }
     $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
     // CRM-11920 all should set sortByCharacter to null, not empty string
     if (strtolower($this->_sortByCharacter) == 'all' || !empty($_POST)) {
         $this->_sortByCharacter = NULL;
         $this->set('sortByCharacter', NULL);
     }
     if (CRM_Utils_Array::value(3, $newArgs) == 'unscheduled') {
         $this->_unscheduled = TRUE;
     }
     $this->set('unscheduled', $this->_unscheduled);
     if (CRM_Utils_Array::value(3, $newArgs) == 'archived') {
         $this->_archived = TRUE;
     }
     $this->set('archived', $this->_archived);
     if (CRM_Utils_Array::value(3, $newArgs) == 'scheduled') {
         $this->_scheduled = TRUE;
     }
     $this->set('scheduled', $this->_scheduled);
     $this->_createdId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0);
     if ($this->_createdId) {
         $this->set('createdId', $this->_createdId);
     }
     if ($this->_sms) {
         $this->set('sms', $this->_sms);
     }
     $session = CRM_Core_Session::singleton();
     $context = $session->readUserContext();
     if ($this->_action & CRM_Core_Action::DISABLE) {
         if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', $this)) {
             CRM_Mailing_BAO_MailingJob::cancel($this->_mailingId);
             CRM_Utils_System::redirect($context);
         } else {
             $controller = new CRM_Core_Controller_Simple('CRM_Mailing_Form_Browse', ts('Cancel Mailing'), $this->_action);
             $controller->setEmbedded(TRUE);
             $controller->run();
         }
     } elseif ($this->_action & CRM_Core_Action::DELETE) {
         if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', $this)) {
             // check for action permissions.
             if (!CRM_Core_Permission::checkActionPermission('CiviMail', $this->_action)) {
                 CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
             }
             CRM_Mailing_BAO_Mailing::del($this->_mailingId);
             CRM_Utils_System::redirect($context);
         } else {
             $controller = new CRM_Core_Controller_Simple('CRM_Mailing_Form_Browse', ts('Delete Mailing'), $this->_action);
             $controller->setEmbedded(TRUE);
             $controller->run();
         }
     } elseif ($this->_action & CRM_Core_Action::RENEW) {
         // archive this mailing, CRM-3752.
         if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', $this)) {
             // set is_archived to 1
             CRM_Core_DAO::setFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingId, 'is_archived', TRUE);
             CRM_Utils_System::redirect($context);
         } else {
             $controller = new CRM_Core_Controller_Simple('CRM_Mailing_Form_Browse', ts('Archive Mailing'), $this->_action);
             $controller->setEmbedded(TRUE);
             $controller->run();
         }
     }
     $selector = new CRM_Mailing_Selector_Browse();
     $selector->setParent($this);
     $controller = new CRM_Core_Selector_Controller($selector, $this->get(CRM_Utils_Pager::PAGE_ID), $this->get(CRM_Utils_Sort::SORT_ID) . $this->get(CRM_Utils_Sort::SORT_DIRECTION), CRM_Core_Action::VIEW, $this, CRM_Core_Selector_Controller::TEMPLATE);
     $controller->setEmbedded(TRUE);
     $controller->run();
     // hack to display results as per search
     $rows = $controller->getRows($controller);
     $this->assign('rows', $rows);
     $urlParams = 'reset=1';
     $urlString = 'civicrm/mailing/browse';
     if ($this->get('sms')) {
         $urlParams .= '&sms=1';
     }
     if (CRM_Utils_Array::value(3, $newArgs) == 'unscheduled') {
         $urlString .= '/unscheduled';
         $urlParams .= '&scheduled=false';
         $this->assign('unscheduled', TRUE);
     } elseif (CRM_Utils_Array::value(3, $newArgs) == 'archived') {
         $urlString .= '/archived';
         $this->assign('archived', TRUE);
     } elseif (CRM_Utils_Array::value(3, $newArgs) == 'scheduled') {
         $urlString .= '/scheduled';
         $urlParams .= '&scheduled=true';
     }
//.........這裏部分代碼省略.........
開發者ID:rameshrr99,項目名稱:civicrm-core,代碼行數:101,代碼來源:Browse.php

示例3: cancelMailingJobs

 /**
  * Cancel mailing jobs for a CiviCRM mailing with the provided ID
  *
  * @param int $crmMailingId CiviCRM mailing ID
  */
 protected static function cancelMailingJobs($crmMailingId)
 {
     CRM_Mailing_BAO_MailingJob::cancel($crmMailingId);
 }
開發者ID:jaapjansma,項目名稱:uk.co.compucorp.civicrm.simplemail,代碼行數:9,代碼來源:SimpleMail.php


注:本文中的CRM_Mailing_BAO_MailingJob::cancel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。