Example #1
0
 /**
  * This method returns the links that are given for each search row.
  * currently the links added for each row are 
  * 
  * - View
  * - Edit
  *
  * @return array
  * @access public
  *
  */
 static function &links()
 {
     if (!self::$_links) {
         self::$_links = array(CRM_Core_Action::VIEW => array('name' => ts('View'), 'url' => 'civicrm/contact/view', 'qs' => 'reset=1&cid=%%id%%', 'title' => ts('View Contact Details')), CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/contact/add', 'qs' => 'reset=1&action=update&cid=%%id%%', 'title' => ts('Edit Contact Details')));
         $config = CRM_Core_Config::singleton();
         if ($config->mapAPIKey && $config->mapProvider) {
             self::$_links[CRM_Core_Action::MAP] = array('name' => ts('Map'), 'url' => 'civicrm/contact/map', 'qs' => 'reset=1&cid=%%id%%&searchType=custom', 'title' => ts('Map Contact'));
         }
     }
     return self::$_links;
 }
Example #2
0
 /**
  * This method returns the links that are given for each search row.
  *
  * Currently the links added for each row are
  * - View
  * - Edit
  *
  * @return array
  */
 public static function &links()
 {
     list($key) = func_get_args();
     $searchContext = "&context=custom";
     $extraParams = $key ? "&key={$key}" : NULL;
     if (!self::$_links) {
         self::$_links = array(CRM_Core_Action::VIEW => array('name' => ts('View'), 'url' => 'civicrm/contact/view', 'qs' => "reset=1&cid=%%id%%{$extraParams}{$searchContext}", 'class' => 'no-popup', 'title' => ts('View Contact Details')), CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/contact/add', 'qs' => 'reset=1&action=update&cid=%%id%%', 'class' => 'no-popup', 'title' => ts('Edit Contact Details')));
         $config = CRM_Core_Config::singleton();
         //CRM-16552: mapAPIKey is not mandatory as google no longer requires an API Key
         if ($config->mapProvider && ($config->mapAPIKey || $config->mapProvider == 'Google')) {
             self::$_links[CRM_Core_Action::MAP] = array('name' => ts('Map'), 'url' => 'civicrm/contact/map', 'qs' => 'reset=1&cid=%%id%%&searchType=custom', 'class' => 'no-popup', 'title' => ts('Map Contact'));
         }
     }
     return self::$_links;
 }