Exemple #1
0
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false);
     $lid = CRM_Utils_Request::retrieve('lid', 'Positive', $this, false);
     $eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, false);
     $profileGID = CRM_Utils_Request::retrieve('profileGID', 'Integer', $this, false);
     $this->assign('profileGID', $profileGID);
     $seachType = CRM_Utils_Request::retrieve('searchType', 'String', $this, false);
     $type = 'Contact';
     if ($cid) {
         $ids = array($cid);
         $this->_single = true;
         if ($seachType && !$profileGID) {
             $fragment = '/basic';
             if ($seachType == 'advance') {
                 $fragment = '/advanced';
             } elseif ($seachType == 'custom') {
                 $fragment = '/custom';
             }
             $session =& CRM_Core_Session::singleton();
             $url = CRM_Utils_System::url('civicrm/contact/search' . $fragment, 'force=1');
             $session->replaceUserContext($url);
         }
     } else {
         if ($eid) {
             $ids = $eid;
             $type = 'Event';
         } else {
             if ($profileGID) {
                 require_once "CRM/Profile/Page/Listings.php";
                 $ids = CRM_Profile_Page_Listings::getProfileContact($profileGID);
             } else {
                 parent::preProcess();
                 $ids = $this->_contactIds;
             }
         }
     }
     self::createMapXML($ids, $lid, $this, true, $type);
     $this->assign('single', $this->_single);
 }
Exemple #2
0
 /**
  * Build all the data structures needed to build the form.
  */
 public function preProcess()
 {
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
     $lid = CRM_Utils_Request::retrieve('lid', 'Positive', $this, FALSE);
     $eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, FALSE);
     $profileGID = CRM_Utils_Request::retrieve('profileGID', 'Integer', $this, FALSE);
     $this->assign('profileGID', $profileGID);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $type = 'Contact';
     if ($cid) {
         $ids = array($cid);
         $this->_single = TRUE;
         if ($profileGID) {
             // this does a check and ensures that the user has permission on this profile
             // CRM-11766
             $profileIDs = CRM_Profile_Page_Listings::getProfileContact($profileGID);
             if (!in_array($cid, $profileIDs)) {
                 CRM_Core_Error::fatal();
             }
         } elseif ($context) {
             $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
             $urlParams = 'force=1';
             if (CRM_Utils_Rule::qfKey($qfKey)) {
                 $urlParams .= "&qfKey={$qfKey}";
             }
             $session = CRM_Core_Session::singleton();
             $urlString = "civicrm/contact/search/{$context}";
             if ($context == 'search') {
                 $urlString = 'civicrm/contact/search';
             }
             $url = CRM_Utils_System::url($urlString, $urlParams);
             $session->replaceUserContext($url);
         }
     } elseif ($eid) {
         $ids = $eid;
         $type = 'Event';
     } else {
         if ($profileGID) {
             $ids = CRM_Profile_Page_Listings::getProfileContact($profileGID);
         } else {
             parent::preProcess();
             $ids = $this->_contactIds;
         }
     }
     self::createMapXML($ids, $lid, $this, TRUE, $type);
     $this->assign('single', $this->_single);
 }
Exemple #3
0
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false);
     $lid = CRM_Utils_Request::retrieve('lid', 'Positive', $this, false);
     $eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, false);
     $profileGID = CRM_Utils_Request::retrieve('profileGID', 'Integer', $this, false);
     $this->assign('profileGID', $profileGID);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $type = 'Contact';
     if ($cid) {
         $ids = array($cid);
         $this->_single = true;
         if ($context && !$profileGID) {
             $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
             $urlParams = 'force=1';
             if (CRM_Utils_Rule::qfKey($qfKey)) {
                 $urlParams .= "&qfKey={$qfKey}";
             }
             $session = CRM_Core_Session::singleton();
             $urlString = "civicrm/contact/search/{$context}";
             if ($context == 'search') {
                 $urlString = 'civicrm/contact/search';
             }
             $url = CRM_Utils_System::url($urlString, $urlParams);
             $session->replaceUserContext($url);
         }
     } else {
         if ($eid) {
             $ids = $eid;
             $type = 'Event';
         } else {
             if ($profileGID) {
                 require_once "CRM/Profile/Page/Listings.php";
                 $ids = CRM_Profile_Page_Listings::getProfileContact($profileGID);
             } else {
                 parent::preProcess();
                 $ids = $this->_contactIds;
             }
         }
     }
     self::createMapXML($ids, $lid, $this, true, $type);
     $this->assign('single', $this->_single);
 }