Esempio n. 1
0
 /**
  * Function to pre processing
  *
  * @return None
  * @access public
  */
 function preProcess()
 {
     $this->_BAOName = CRM_Admin_Page_DupeMatch::getBAOName();
     $this->_advanced = CRM_Utils_Request::retrieve('advance', $this, false);
     $dupematch =& new CRM_Core_DAO_DupeMatch();
     $dupematch->domain_id = CRM_Core_Config::domainID();
     $dupematch->find(true);
     $id = $dupematch->id;
     $rule = $dupematch->rule;
     $tokens = preg_split('/[\\s]+/', $rule, -1, PREG_SPLIT_NO_EMPTY);
     $rule = explode(' ', $rule);
     if (count($tokens) > 9) {
         $this->_advanced = true;
     }
     foreach ($rule as $value) {
         if ($value == 'OR' || $value == '(' || $value == ')') {
             $this->_advanced = true;
         } else {
             if (substr($value, 0, 1) == '(') {
                 $this->_advanced = true;
             }
         }
     }
     $this->_id = $id;
     $this->assign('advance', $this->_advanced);
 }
Esempio n. 2
0
 /**
  * Browse all dupematchs
  *  
  * 
  * @return void
  * @access public
  * @static
  */
 function browse()
 {
     // get all dupematchs sorted by weight
     $dupematch = array();
     $dao =& new CRM_Core_DAO_DupeMatch();
     // set the domain_id parameter
     $config =& CRM_Core_Config::singleton();
     $dao->domain_id = $config->domainID();
     $dao->find();
     while ($dao->fetch()) {
         $dupematch[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $dupematch[$dao->id]);
         // form all action links
         $action = array_sum(array_keys($this->links()));
         $dupematch[$dao->id]['action'] = CRM_Core_Action::formLink(CRM_Admin_Page_DupeMatch::links(), $action, array('id' => $dao->id));
     }
     $this->assign('rows', $dupematch);
 }