Esempio n. 1
0
 /**
  * Obtains the group name from url and sets the title.
  *
  * @return void
  * @access public
  *
  */
 function preProcess()
 {
     if (!self::$_gName) {
         self::$_gName = CRM_Utils_Request::retrieve('group', 'String', CRM_Core_DAO::$_nullObject, false, null, 'GET');
     }
     if (self::$_gName) {
         $this->set('gName', self::$_gName);
     } else {
         self::$_gName = $this->get('gName');
     }
     if (self::$_gName) {
         self::$_gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gName, 'id', 'name');
     } else {
         CRM_Core_Error::fatal();
     }
     self::$_GName = ucwords(str_replace('_', ' ', self::$_gName));
     $this->assign('gName', self::$_gName);
     $this->assign('GName', self::$_GName);
     if (self::$_gName == 'acl_role') {
         CRM_Utils_System::setTitle(ts('Manage ACL Roles'));
         // set breadcrumb to append to admin/access
         $breadCrumb = array(array('title' => ts('Access Control'), 'url' => CRM_Utils_System::url('civicrm/admin/access', 'reset=1')));
         CRM_Utils_System::appendBreadCrumb($breadCrumb);
     } else {
         CRM_Utils_System::setTitle(ts('%1 Options', array(1 => self::$_GName)));
     }
     if (in_array(self::$_gName, array('from_email_address', 'email_greeting', 'postal_greeting', 'addressee'))) {
         $this->assign('showIsDefault', true);
     }
     if (self::$_gName == 'participant_status') {
         $this->assign('showCounted', true);
         $this->assign('showVisibility', true);
     }
     if (self::$_gName == 'participant_role') {
         $this->assign('showCounted', true);
     }
     require_once 'CRM/Core/Config.php';
     $config =& CRM_Core_Config::singleton();
     if (in_array("CiviCase", $config->enableComponents) && self::$_gName == 'activity_type') {
         $this->assign('showComponent', true);
     }
 }
Esempio n. 2
0
 /**
  * Obtains the group name from url string or id from $_GET['gid'].
  * Sets the title.
  *
  * @return void
  * @access public
  *
  */
 function preProcess()
 {
     if (!self::$_gName && !empty($this->urlPath[3])) {
         self::$_gName = $this->urlPath[3];
     } elseif (!self::$_gName && !empty($_GET['gid'])) {
         self::$_gId = $_GET['gid'];
         self::$_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gId, 'name');
         $breadCrumb = array('title' => ts('Option Groups'), 'url' => CRM_Utils_System::url('civicrm/admin/options', 'reset=1'));
         CRM_Utils_System::appendBreadCrumb(array($breadCrumb));
     }
     if (!self::$_gName) {
         self::$_gName = $this->get('gName');
     }
     // If we don't have a group we will browse all groups
     if (!self::$_gName) {
         return;
     }
     $this->set('gName', self::$_gName);
     if (!self::$_gId) {
         self::$_gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gName, 'id', 'name');
     }
     self::$_gLabel = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gId, 'title');
     if (!self::$_gLabel) {
         self::$_gLabel = ts('Option');
     }
     $this->assign('gName', self::$_gName);
     $this->assign('gLabel', self::$_gLabel);
     if (self::$_gName == 'acl_role') {
         CRM_Utils_System::setTitle(ts('Manage ACL Roles'));
         // set breadcrumb to append to admin/access
         $breadCrumb = array(array('title' => ts('Access Control'), 'url' => CRM_Utils_System::url('civicrm/admin/access', 'reset=1')));
         CRM_Utils_System::appendBreadCrumb($breadCrumb);
     } else {
         CRM_Utils_System::setTitle(ts("%1 Options", array(1 => self::$_gLabel)));
     }
     if (in_array(self::$_gName, array('from_email_address', 'email_greeting', 'postal_greeting', 'addressee', 'communication_style', 'case_status', 'encounter_medium', 'case_type', 'payment_instrument', 'soft_credit_type'))) {
         $this->assign('showIsDefault', TRUE);
     }
     if (self::$_gName == 'participant_status') {
         $this->assign('showCounted', TRUE);
         $this->assign('showVisibility', TRUE);
     }
     if (self::$_gName == 'participant_role') {
         $this->assign('showCounted', TRUE);
     }
     $config = CRM_Core_Config::singleton();
     if (self::$_gName == 'activity_type') {
         $this->assign('showComponent', TRUE);
     }
 }