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


PHP CRM_Campaign_BAO_Survey类代码示例

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


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

示例1: preProcess

 public function preProcess()
 {
     if (!CRM_Campaign_BAO_Campaign::accessCampaign()) {
         CRM_Utils_System::permissionDenied();
     }
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
     $this->_surveyId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
     if ($this->_surveyId) {
         $this->_single = TRUE;
         $params = array('id' => $this->_surveyId);
         CRM_Campaign_BAO_Survey::retrieve($params, $surveyInfo);
         $this->_surveyTitle = $surveyInfo['title'];
         $this->assign('surveyTitle', $this->_surveyTitle);
         CRM_Utils_System::setTitle(ts('Configure Survey - %1', array(1 => $this->_surveyTitle)));
     }
     $this->assign('action', $this->_action);
     $this->assign('surveyId', $this->_surveyId);
     // when custom data is included in this page
     if (!empty($_POST['hidden_custom'])) {
         $this->set('type', 'Event');
         $this->set('entityId', $this->_surveyId);
         CRM_Custom_Form_CustomData::preProcess($this, NULL, NULL, 1, 'Survey', $this->_surveyId);
         CRM_Custom_Form_CustomData::buildQuickForm($this);
         CRM_Custom_Form_CustomData::setDefaultValues($this);
     }
     // CRM-11480, CRM-11682
     // Preload libraries required by the "Questions" tab
     CRM_UF_Page_ProfileEditor::registerProfileScripts();
     CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ActivityModel'));
     CRM_Campaign_Form_Survey_TabHeader::build($this);
 }
开发者ID:scardinius,项目名称:civicrm-core,代码行数:31,代码来源:Survey.php

示例2: buildQuickForm

 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     if ($this->_search) {
         return;
     }
     $attributes = CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey');
     $this->add('text', 'survey_title', ts('Title'), $attributes['title']);
     //activity Type id
     $surveyTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType();
     $this->add('select', 'activity_type_id', ts('Activity Type'), array('' => ts('- select -')) + $surveyTypes);
     $this->set('surveyTypes', $surveyTypes);
     $this->assign('surveyTypes', json_encode($surveyTypes));
     //campaigns
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
     $this->add('select', 'survey_campaign_id', ts('Campaign'), array('' => ts('- select -')) + $campaigns);
     $this->set('surveyCampaigns', $campaigns);
     $this->assign('surveyCampaigns', json_encode($campaigns));
     //build the array of all search params.
     $this->_searchParams = array();
     foreach ($this->_elements as $element) {
         $name = $element->_attributes['name'];
         $label = $element->_label;
         if ($name == 'qfKey') {
             continue;
         }
         $this->_searchParams[$name] = $label ? $label : $name;
     }
     $this->set('searchParams', $this->_searchParams);
     $this->assign('searchParams', json_encode($this->_searchParams));
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:33,代码来源:Survey.php

示例3: browse

 function browse()
 {
     require_once 'CRM/Core/Permission.php';
     $surveys = CRM_Campaign_BAO_Survey::getSurvey(true);
     if (!empty($surveys)) {
         require_once 'CRM/Campaign/BAO/Campaign.php';
         $surveyType = CRM_Campaign_BAO_Survey::getSurveyActivityType();
         $campaigns = CRM_Campaign_BAO_Campaign::getAllCampaign();
         $activityTypes = CRM_Core_OptionGroup::values('activity_type', false, false, false, false, 'name');
         foreach ($surveys as $sid => $survey) {
             $surveys[$sid]['campaign_id'] = $campaigns[$survey['campaign_id']];
             $surveys[$sid]['activity_type_id'] = $surveyType[$survey['activity_type_id']];
             $surveys[$sid]['release_frequency'] = $survey['release_frequency_interval'] . ' ' . $survey['release_frequency_unit'];
             $action = array_sum(array_keys($this->actionLinks()));
             if ($survey['is_active']) {
                 $action -= CRM_Core_Action::ENABLE;
             } else {
                 $action -= CRM_Core_Action::DISABLE;
             }
             $surveys[$sid]['action'] = CRM_Core_Action::formLink($this->actionLinks(), $action, array('id' => $sid));
         }
     }
     $this->assign('surveys', $surveys);
     $this->assign('addSurveyUrl', CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add'));
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:25,代码来源:Survey.php

示例4: civicrm_api3_verify_one_mandatory

/**
 * Get the list of voters (respondents, yet to record survey response) for a survey
 *
 * @param  array   $params           (reference ) input parameters
 *
 * @return array (reference )        contact_id
 * @static void
 * @access public
 */
function &civicrm_api3_survey_voter_get($params)
{
    civicrm_api3_verify_one_mandatory($params, 'CRM_Campaign_BAO_Survey', array('survey_id', 'id'));
    if (array_key_exists('status_id', $params)) {
        $status_id = $params['status_id'];
    } else {
        $status_id = null;
    }
    $surveyID = empty($params['survey_id']) ? $params['id'] : $params['survey_id'];
    require_once 'CRM/Campaign/BAO/Survey.php';
    $survey = new CRM_Campaign_BAO_Survey();
    $voters = $survey->getSurveyVoterInfo($surveyID);
    require_once 'CRM/Contact/BAO/Contact.php';
    foreach ($voters as $key => $voterArray) {
        $voters[$key]['voter_name'] = CRM_Contact_BAO_Contact::displayName($voterArray['voter_id']);
    }
    return civicrm_api3_create_success($voters, $params);
}
开发者ID:rajeshrhino,项目名称:CiviMobile,代码行数:27,代码来源:SurveyVoter.php

示例5: postProcess

 /**
  * Process the form when submitted.
  */
 public function postProcess()
 {
     if ($this->_surveyId) {
         CRM_Campaign_BAO_Survey::del($this->_surveyId);
         CRM_Core_Session::setStatus('', ts("'%1' survey has been deleted.", array(1 => $this->_surveyTitle)), 'success');
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey'));
     } else {
         CRM_Core_Error::fatal(ts('Delete action is missing expected survey ID.'));
     }
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:13,代码来源:Delete.php

示例6: buildForm

 function buildForm(&$form)
 {
     $form->add('text', 'sort_name', ts('Contact Name'), true);
     $form->add('text', 'street_number', ts('Street Number'), true);
     $form->add('text', 'street_address', ts('Street Address'), true);
     $form->add('text', 'city', ts('City'), true);
     $surveys = CRM_Campaign_BAO_Survey::getSurveyList();
     $form->add('select', 'survey_id', ts('Survey'), array('' => ts('- select -')) + $surveys);
     $form->add('checkbox', 'status_id', ts('Is Held'), null, false);
     $form->assign('elements', array('sort_name', 'street_number', 'street_address', 'city', 'status_id', 'survey_id'));
     $this->setTitle('Find Voters');
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:12,代码来源:FindVoters.php

示例7: releaseRespondent

    public function releaseRespondent()
    {
        require_once 'CRM/Core/PseudoConstant.php';
        require_once 'CRM/Campaign/BAO/Survey.php';
        $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
        $reserveStatusId = array_search('Scheduled', $activityStatus);
        $surveyActivityTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType();
        $surveyActivityTypesIds = array_keys($surveyActivityTypes);
        //retrieve all survey activities related to reserve action.
        $releasedCount = 0;
        if ($reserveStatusId && !empty($surveyActivityTypesIds)) {
            $query = '
    SELECT  activity.id as id,
            activity.activity_date_time as activity_date_time,
            survey.id as surveyId,
            survey.release_frequency as release_frequency
      FROM  civicrm_activity activity
INNER JOIN  civicrm_survey survey ON ( survey.id = activity.source_record_id )
     WHERE  activity.is_deleted = 0
       AND  activity.status_id = %1
       AND  activity.activity_type_id IN ( ' . implode(', ', $surveyActivityTypesIds) . ' )';
            $activity = CRM_Core_DAO::executeQuery($query, array(1 => array($reserveStatusId, 'Positive')));
            $releasedIds = array();
            while ($activity->fetch()) {
                if (!$activity->release_frequency) {
                    continue;
                }
                $reservedSeconds = CRM_Utils_Date::unixTime($activity->activity_date_time);
                $releasedSeconds = $activity->release_frequency * 24 * 3600;
                $totalReservedSeconds = $reservedSeconds + $releasedSeconds;
                if ($totalReservedSeconds < time()) {
                    $releasedIds[$activity->id] = $activity->id;
                }
            }
            //released respondent.
            if (!empty($releasedIds)) {
                $query = '
UPDATE  civicrm_activity
   SET  is_deleted = 1
 WHERE  id IN ( ' . implode(', ', $releasedIds) . ' )';
                CRM_Core_DAO::executeQuery($query);
                $releasedCount = count($releasedIds);
            }
        }
        echo "<br /><br />Number of respondents released = {$releasedCount}";
    }
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:46,代码来源:RespondentProcessor.php

示例8: buildQuickForm

 /**
  * Function to actually build the form
  *
  * @param null
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     $subTypeId = CRM_Core_DAO::getFieldValue('CRM_Campaign_DAO_Survey', $this->_surveyId, 'activity_type_id');
     if (!CRM_Core_BAO_CustomGroup::autoCreateByActivityType($subTypeId)) {
         $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE);
         // everything
         // FIXME: Displays weird "/\ Array" message; doesn't work with tabs
         CRM_Core_Session::setStatus(ts('There are no custom data sets for activity type "%1". To create one, <a href="%2" target="%3">click here</a>.', array(1 => $activityTypes[$subTypeId], 2 => CRM_Utils_System::url('civicrm/admin/custom/group', 'action=add&reset=1'), 3 => '_blank')));
     }
     $allowCoreTypes = CRM_Campaign_BAO_Survey::surveyProfileTypes();
     $allowSubTypes = array('ActivityType' => array($subTypeId));
     $entities = array(array('entity_name' => 'contact_1', 'entity_type' => 'IndividualModel'), array('entity_name' => 'activity_1', 'entity_type' => 'ActivityModel', 'entity_sub_type' => $subTypeId));
     $this->addProfileSelector('contact_profile_id', ts('Contact Info'), $allowCoreTypes, $allowSubTypes, $entities);
     $this->addProfileSelector('activity_profile_id', ts('Questions'), $allowCoreTypes, $allowSubTypes, $entities);
     // Note: Because this is in a tab, we also preload the schema via CRM_Campaign_Form_Survey::preProcess
     parent::buildQuickForm();
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:25,代码来源:Questions.php

示例9: civicrm_api3_survey_respondant_get

/**
 * Get the list of signatories.
 *
 * @deprecated - api currently not supported
 *
 * @param array $params
 *   input parameters.
 *
 * @return array
 */
function civicrm_api3_survey_respondant_get(&$params)
{
    civicrm_api3_verify_one_mandatory($params, NULL, array('survey_id', 'id'));
    if (array_key_exists('survey_id', $params)) {
        $surveyID = $params['survey_id'];
    } else {
        $surveyID = $params['id'];
    }
    $interviewerID = NULL;
    if (array_key_exists('interviewer_id', $params)) {
        $interviewerID = $params['interviewer_id'];
    }
    $statusIds = array();
    if (array_key_exists('status_id', $params)) {
        $statusIds = explode(',', $params['status_id']);
    }
    $respondants = CRM_Campaign_BAO_Survey::getSurveyActivities($surveyID, $interviewerID, $statusIds);
    return civicrm_api3_create_success($respondants, $params, 'SurveyRespondant', 'get');
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:29,代码来源:SurveyRespondant.php

示例10: run

 /**
  * @return string
  * @throws Exception
  */
 public function run()
 {
     CRM_Utils_System::addHTMLHead('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">');
     $contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
     $subscribe_id = CRM_Utils_Request::retrieve('sid', 'Integer', CRM_Core_DAO::$_nullObject);
     $hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
     $activity_id = CRM_Utils_Request::retrieve('a', 'String', CRM_Core_DAO::$_nullObject);
     $petition_id = CRM_Utils_Request::retrieve('pid', 'String', CRM_Core_DAO::$_nullObject);
     if (!$petition_id) {
         $petition_id = CRM_Utils_Request::retrieve('p', 'String', CRM_Core_DAO::$_nullObject);
     }
     if (!$contact_id || !$subscribe_id || !$hash) {
         CRM_Core_Error::fatal(ts("Missing input parameters"));
     }
     $result = $this->confirm($contact_id, $subscribe_id, $hash, $activity_id, $petition_id);
     if ($result === FALSE) {
         $this->assign('success', $result);
     } else {
         $this->assign('success', TRUE);
         // $this->assign( 'group'  , $result );
     }
     list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contact_id);
     $this->assign('display_name', $displayName);
     $this->assign('email', $email);
     $this->assign('petition_id', $petition_id);
     $this->assign('survey_id', $petition_id);
     $pparams['id'] = $petition_id;
     $this->petition = array();
     CRM_Campaign_BAO_Survey::retrieve($pparams, $this->petition);
     $this->assign('is_share', CRM_Utils_Array::value('is_share', $this->petition));
     $this->assign('thankyou_title', CRM_Utils_Array::value('thankyou_title', $this->petition));
     $this->assign('thankyou_text', CRM_Utils_Array::value('thankyou_text', $this->petition));
     CRM_Utils_System::setTitle(CRM_Utils_Array::value('thankyou_title', $this->petition));
     // send thank you email
     $params['contactId'] = $contact_id;
     $params['email-Primary'] = $email;
     $params['sid'] = $petition_id;
     $params['activityId'] = $activity_id;
     CRM_Campaign_BAO_Petition::sendEmail($params, CRM_Campaign_Form_Petition_Signature::EMAIL_THANK);
     return parent::run();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:45,代码来源:Confirm.php

示例11: preProcess

 public function preProcess()
 {
     if (!CRM_Campaign_BAO_Campaign::accessCampaign()) {
         CRM_Utils_System::permissionDenied();
     }
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
     $this->_surveyId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
     if ($this->_surveyId) {
         $this->_single = TRUE;
         $params = array('id' => $this->_surveyId);
         CRM_Campaign_BAO_Survey::retrieve($params, $surveyInfo);
         $this->_surveyTitle = $surveyInfo['title'];
         $this->assign('surveyTitle', $this->_surveyTitle);
         CRM_Utils_System::setTitle(ts('Configure Survey - %1', array(1 => $this->_surveyTitle)));
     }
     $this->assign('action', $this->_action);
     $this->assign('surveyId', $this->_surveyId);
     // CRM-11480, CRM-11682
     // Preload libraries required by the "Questions" tab
     CRM_UF_Page_ProfileEditor::registerProfileScripts();
     CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ActivityModel'));
     CRM_Campaign_Form_Survey_TabHeader::build($this);
 }
开发者ID:hguru,项目名称:224Civi,代码行数:23,代码来源:Survey.php

示例12: run

 function run()
 {
     $id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $petition_id = CRM_Utils_Request::retrieve('pid', 'Positive', $this);
     $params['id'] = $petition_id;
     $this->petition = array();
     CRM_Campaign_BAO_Survey::retrieve($params, $this->petition);
     $this->assign('petitionTitle', $this->petition['title']);
     $this->assign('thankyou_title', CRM_Utils_Array::value('thankyou_title', $this->petition));
     $this->assign('thankyou_text', CRM_Utils_Array::value('thankyou_text', $this->petition));
     $this->assign('survey_id', $petition_id);
     $this->assign('status_id', $id);
     CRM_Utils_System::setTitle(CRM_Utils_Array::value('thankyou_title', $this->petition));
     // send thank you or email verification emails
     /* 
      * sendEmailMode
      * 1 = connected user via login/pwd - thank you
      * 	 	or dedupe contact matched who doesn't have a tag CIVICRM_TAG_UNCONFIRMED - thank you
      * 	 	login using fb connect - thank you + click to add msg to fb wall
      * 2 = send a confirmation request email     
      */
     return parent::run();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:23,代码来源:ThankYou.php

示例13: browse

 public function browse()
 {
     $surveys = CRM_Campaign_BAO_Survey::getSurveySummary();
     if (!empty($surveys)) {
         $surveyType = CRM_Campaign_BAO_Survey::getSurveyActivityType();
         $campaigns = CRM_Campaign_BAO_Campaign::getAllCampaign();
         $activityTypes = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, FALSE, 'name');
         foreach ($surveys as $sid => $survey) {
             $surveys[$sid]['campaign_id'] = $campaigns[$survey['campaign_id']];
             $surveys[$sid]['activity_type_id'] = $surveyType[$survey['activity_type_id']];
             $surveys[$sid]['release_frequency'] = $survey['release_frequency_interval'] . ' ' . $survey['release_frequency_unit'];
             $action = array_sum(array_keys($this->actionLinks()));
             if ($survey['is_active']) {
                 $action -= CRM_Core_Action::ENABLE;
             } else {
                 $action -= CRM_Core_Action::DISABLE;
             }
             $surveys[$sid]['action'] = CRM_Core_Action::formLink($this->actionLinks(), $action, array('id' => $sid), ts('more'), FALSE, 'survey.selector.row', 'Survey', $sid);
         }
     }
     $this->assign('surveys', $surveys);
     $this->assign('addSurveyUrl', CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add'));
 }
开发者ID:kidaa30,项目名称:yes,代码行数:23,代码来源:Survey.php

示例14: sendEmail

 /**
 * takes an associative array and sends a thank you or email verification email
 *
 * @param array $params (reference ) an assoc array of name/value pairs
 *
 * @param $sendEmailMode
 *
 * @throws Exception
 * @return void
   @access public
 * @static
 */
 public static function sendEmail($params, $sendEmailMode)
 {
     /* sendEmailMode
      * CRM_Campaign_Form_Petition_Signature::EMAIL_THANK
      *   connected user via login/pwd - thank you
      *    or dedupe contact matched who doesn't have a tag CIVICRM_TAG_UNCONFIRMED - thank you
      *   or login using fb connect - thank you + click to add msg to fb wall
      *
      * CRM_Campaign_Form_Petition_Signature::EMAIL_CONFIRM
      *  send a confirmation request email
      */
     // check if the group defined by CIVICRM_PETITION_CONTACTS exists, else create it
     $petitionGroupName = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'petition_contacts', NULL, 'Petition Contacts');
     $dao = new CRM_Contact_DAO_Group();
     $dao->title = $petitionGroupName;
     if (!$dao->find(TRUE)) {
         $dao->is_active = 1;
         $dao->visibility = 'User and User Admin Only';
         $dao->save();
     }
     $group_id = $dao->id;
     // get petition info
     $petitionParams['id'] = $params['sid'];
     $petitionInfo = array();
     CRM_Campaign_BAO_Survey::retrieve($petitionParams, $petitionInfo);
     if (empty($petitionInfo)) {
         CRM_Core_Error::fatal('Petition doesn\'t exist.');
     }
     //get the default domain email address.
     list($domainEmailName, $domainEmailAddress) = CRM_Core_BAO_Domain::getNameAndEmail();
     $emailDomain = CRM_Core_BAO_MailSettings::defaultDomain();
     $toName = CRM_Contact_BAO_Contact::displayName($params['contactId']);
     $replyTo = "do-not-reply@{$emailDomain}";
     // set additional general message template params (custom tokens to use in email msg templates)
     // tokens then available in msg template as {$petition.title}, etc
     $petitionTokens['title'] = $petitionInfo['title'];
     $petitionTokens['petitionId'] = $params['sid'];
     $tplParams['petition'] = $petitionTokens;
     switch ($sendEmailMode) {
         case CRM_Campaign_Form_Petition_Signature::EMAIL_THANK:
             // add this contact to the CIVICRM_PETITION_CONTACTS group
             // Cannot pass parameter 1 by reference
             $p = array($params['contactId']);
             CRM_Contact_BAO_GroupContact::addContactsToGroup($p, $group_id, 'API');
             if ($params['email-Primary']) {
                 CRM_Core_BAO_MessageTemplate::sendTemplate(array('groupName' => 'msg_tpl_workflow_petition', 'valueName' => 'petition_sign', 'contactId' => $params['contactId'], 'tplParams' => $tplParams, 'from' => "\"{$domainEmailName}\" <{$domainEmailAddress}>", 'toName' => $toName, 'toEmail' => $params['email-Primary'], 'replyTo' => $replyTo, 'petitionId' => $params['sid'], 'petitionTitle' => $petitionInfo['title']));
             }
             break;
         case CRM_Campaign_Form_Petition_Signature::EMAIL_CONFIRM:
             // create mailing event subscription record for this contact
             // this will allow using a hash key to confirm email address by sending a url link
             $se = CRM_Mailing_Event_BAO_Subscribe::subscribe($group_id, $params['email-Primary'], $params['contactId'], 'profile');
             //    require_once 'CRM/Core/BAO/Domain.php';
             //    $domain = CRM_Core_BAO_Domain::getDomain();
             $config = CRM_Core_Config::singleton();
             $localpart = CRM_Core_BAO_MailSettings::defaultLocalpart();
             $replyTo = implode($config->verpSeparator, array($localpart . 'c', $se->contact_id, $se->id, $se->hash)) . "@{$emailDomain}";
             $confirmUrl = CRM_Utils_System::url('civicrm/petition/confirm', "reset=1&cid={$se->contact_id}&sid={$se->id}&h={$se->hash}&a={$params['activityId']}&p={$params['sid']}", TRUE);
             $confirmUrlPlainText = CRM_Utils_System::url('civicrm/petition/confirm', "reset=1&cid={$se->contact_id}&sid={$se->id}&h={$se->hash}&a={$params['activityId']}&p={$params['sid']}", TRUE, NULL, FALSE);
             // set email specific message template params and assign to tplParams
             $petitionTokens['confirmUrl'] = $confirmUrl;
             $petitionTokens['confirmUrlPlainText'] = $confirmUrlPlainText;
             $tplParams['petition'] = $petitionTokens;
             if ($params['email-Primary']) {
                 CRM_Core_BAO_MessageTemplate::sendTemplate(array('groupName' => 'msg_tpl_workflow_petition', 'valueName' => 'petition_confirmation_needed', 'contactId' => $params['contactId'], 'tplParams' => $tplParams, 'from' => "\"{$domainEmailName}\" <{$domainEmailAddress}>", 'toName' => $toName, 'toEmail' => $params['email-Primary'], 'replyTo' => $replyTo, 'petitionId' => $params['sid'], 'petitionTitle' => $petitionInfo['title'], 'confirmUrl' => $confirmUrl));
             }
             break;
     }
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:81,代码来源:Petition.php

示例15: preProcess

 /**
  * Build all the data structures needed to build the form.
  */
 public function preProcess()
 {
     $this->_interviewToRelease = $this->get('interviewToRelease');
     if ($this->_interviewToRelease) {
         //user came from interview form.
         foreach (array('surveyId', 'contactIds', 'interviewerId') as $fld) {
             $this->{"_{$fld}"} = $this->get($fld);
         }
         if (!empty($this->_contactIds)) {
             $this->assign('totalSelectedContacts', count($this->_contactIds));
         }
     } else {
         parent::preProcess();
         //get the survey id from user submitted values.
         $this->_surveyId = CRM_Utils_Array::value('campaign_survey_id', $this->get('formValues'));
         $this->_interviewerId = CRM_Utils_Array::value('survey_interviewer_id', $this->get('formValues'));
     }
     if (!$this->_surveyId) {
         CRM_Core_Error::statusBounce(ts("Please search with 'Survey', to apply this action."));
     }
     if (!$this->_interviewerId) {
         CRM_Core_Error::statusBounce(ts('Missing Interviewer contact.'));
     }
     if (!is_array($this->_contactIds) || empty($this->_contactIds)) {
         CRM_Core_Error::statusBounce(ts('Could not find respondents to release.'));
     }
     $surveyDetails = array();
     $params = array('id' => $this->_surveyId);
     $this->_surveyDetails = CRM_Campaign_BAO_Survey::retrieve($params, $surveyDetails);
     $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
     $statusIds = array();
     foreach (array('Scheduled') as $name) {
         if ($statusId = array_search($name, $activityStatus)) {
             $statusIds[] = $statusId;
         }
     }
     //fetch the target survey activities.
     $this->_surveyActivities = CRM_Campaign_BAO_Survey::voterActivityDetails($this->_surveyId, $this->_contactIds, $this->_interviewerId, $statusIds);
     if (count($this->_surveyActivities) < 1) {
         CRM_Core_Error::statusBounce(ts('We could not found respondent for this survey to release.'));
     }
     $this->assign('surveyTitle', $surveyDetails['title']);
     //append breadcrumb to survey dashboard.
     if (CRM_Campaign_BAO_Campaign::accessCampaign()) {
         $url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey');
         CRM_Utils_System::appendBreadCrumb(array(array('title' => ts('Survey(s)'), 'url' => $url)));
     }
     //set the title.
     CRM_Utils_System::setTitle(ts('Release Respondents'));
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:53,代码来源:Release.php


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