CRM-13970 - Remove redundant option group page/form
authorColeman Watts <coleman@civicrm.org>
Tue, 4 Feb 2014 18:34:23 +0000 (10:34 -0800)
committerColeman Watts <coleman@civicrm.org>
Tue, 4 Feb 2014 18:34:23 +0000 (10:34 -0800)
20 files changed:
CRM/Admin/Form/OptionValue.php [deleted file]
CRM/Admin/Form/Options.php
CRM/Admin/Page/OptionGroup.php [deleted file]
CRM/Admin/Page/OptionValue.php [deleted file]
CRM/Admin/Page/Options.php
CRM/Campaign/BAO/Petition.php
CRM/Campaign/xml/Menu/Campaign.xml
CRM/Case/xml/Menu/Case.xml
CRM/Contribute/xml/Menu/Contribute.xml
CRM/Core/Invoke.php
CRM/Core/xml/Menu/Admin.xml
CRM/Core/xml/Menu/Misc.xml
CRM/Event/xml/Menu/Event.xml
CRM/Mailing/xml/Menu/Mailing.xml
CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl
templates/CRM/Admin/Form/Options.tpl
templates/CRM/Admin/Page/OptionGroup.tpl
templates/CRM/Admin/Page/Options.tpl
templates/CRM/Contribute/Form/ContributionPage/Settings.tpl
tools/CRM/Auction/xml/Menu/Auction.xml

diff --git a/CRM/Admin/Form/OptionValue.php b/CRM/Admin/Form/OptionValue.php
deleted file mode 100644 (file)
index bf4290c..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-<?php
-/*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
-*/
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
- * $Id$
- *
- */
-
-/**
- * This class generates form components for Option Value
- *
- */
-class CRM_Admin_Form_OptionValue extends CRM_Admin_Form {
-  protected $_gid = NULL;
-
-  /**
-   * The option group name
-   *
-   * @var string
-   * @static
-   */
-  protected $_gName = NULL;
-
-  /**
-   * Function to for pre-processing
-   *
-   * @return void
-   * @access public
-   */
-  public function preProcess() {
-    parent::preProcess();
-    $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive',
-      $this, FALSE, 0
-    );
-    //get optionGroup name in case of email/postal greeting or addressee, CRM-4575
-    if (!empty($this->_gid)) {
-      $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'name');
-    }
-    $session = CRM_Core_Session::singleton();
-    $url = CRM_Utils_System::url('civicrm/admin/optionValue', 'reset=1&action=browse&gid=' . $this->_gid);
-    $session->replaceUserContext($url);
-
-    $this->assign('id', $this->_id);
-
-    if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) {
-      $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id');
-      if (CRM_Core_Config::domainID() != $domainID) {
-        CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
-      }
-    }
-  }
-
-  /**
-   * This function sets the default values for the form.
-   * the default values are retrieved from the database
-   *
-   * @access public
-   *
-   * @return void
-   */
-  function setDefaultValues() {
-    $defaults = array();
-    $defaults = parent::setDefaultValues();
-    if (empty($defaults['weight'])) {
-      $query = "SELECT max( `weight` ) as weight FROM `civicrm_option_value` where option_group_id=" . $this->_gid;
-      $dao = new CRM_Core_DAO();
-      $dao->query($query);
-      $dao->fetch();
-      $defaults['weight'] = ($dao->weight + 1);
-    }
-
-    // CRM-11516
-    if ($this->_gName == 'payment_instrument' && $this->_id) {
-      $defaults['financial_account_id'] = CRM_Financial_BAO_FinancialTypeAccount::getFinancialAccount($this->_id, 'civicrm_option_value', 'financial_account_id');
-    }
-    //setDefault of contact types for email greeting, postal greeting, addressee, CRM-4575
-    if (in_array($this->_gName, array(
-      'email_greeting', 'postal_greeting', 'addressee'))) {
-      $defaults['contactOptions'] = CRM_Utils_Array::value('filter', $defaults);
-    }
-    return $defaults;
-  }
-
-  /**
-   * Function to build the form
-   *
-   * @return void
-   * @access public
-   */
-  public function buildQuickForm() {
-    //CRM-4575
-    $isReserved = FALSE;
-    if ($this->_id) {
-      $isReserved = (bool) CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'is_reserved');
-    }
-    parent::buildQuickForm();
-    if ($this->_action & CRM_Core_Action::DELETE) {
-      return;
-    }
-
-    $this->applyFilter('__ALL__', 'trim');
-    $this->add('text', 'label', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'label'), TRUE);
-    $this->add('text', 'value', ts('Value'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'value'), TRUE);
-    $this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'name'));
-    if ($this->_gName == 'custom_search') {
-      $this->add('text',
-        'description',
-        ts('Description'),
-        CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'description')
-      );
-    }
-    else {
-      $this->addWysiwyg('description',
-        ts('Description'),
-        CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'description')
-      );
-    }
-
-    if ($this->_gName == 'case_status') {
-      $grouping = $this->add('select', 'grouping', ts('Option Grouping Name'), array('Opened' => ts('Opened'),
-          'Closed' => ts('Closed'),
-        ));
-      if ($isReserved) {
-        $grouping->freeze();
-      }
-    }
-    else {
-      $this->add('text', 'grouping', ts('Grouping'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'grouping'));
-    }
-
-    $this->add('text', 'weight', ts('Weight'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE);
-    $this->add('checkbox', 'is_active', ts('Enabled?'));
-    $this->add('checkbox', 'is_default', ts('Default Option?'));
-    $this->add('checkbox', 'is_optgroup', ts('Is OptGroup?'));
-
-    // CRM-11516
-    if ($this->_gName == 'payment_instrument') {
-      $accountType = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type', NULL, " AND v.name = 'Asset' ");
-      $financialAccount = CRM_Contribute_PseudoConstant::financialAccount(NULL, key($accountType));
-
-      $this->add('select', 'financial_account_id', ts('Financial Account'),
-        array('' => ts('- select -')) + $financialAccount
-      );
-    }
-    // CRM-9953
-    // we dont display this in the template, but the form sets the default values which are then saved
-    // this allow us to retain the previous values
-    $this->add('text', 'filter', ts('Filter'));
-
-    if ($this->_action & CRM_Core_Action::UPDATE && $isReserved) {
-      $this->freeze(array('name', 'description', 'is_active'));
-    }
-    //get contact type for which user want to create a new greeting/addressee type, CRM-4575
-    if (in_array($this->_gName, array(
-      'email_greeting', 'postal_greeting', 'addressee')) && !$isReserved) {
-      $values = array(1 => ts('Individual'),
-        2 => ts('Household'),
-        3 => ts('Organization'),
-        4 => ts('Multiple Contact Merge'),
-      );
-
-      $this->add('select', 'contactOptions', ts('Contact Type'), array('' => '-select-') + $values, TRUE);
-    }
-
-    $this->add('hidden', 'gid', $this->_gid);
-    $this->addFormRule(array('CRM_Admin_Form_OptionValue', 'formRule'), $this);
-    $this->addButtons(
-      array(
-        array(
-          'type' => 'next',
-          'name' => ts('Save'),
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      )
-    );
-  }
-
-  function cancelAction() {
-    parent::cancelAction();
-
-    $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
-    $cancelURL = CRM_Utils_System::url('civicrm/admin/optionValue', "gid={$gid}&reset=1");
-
-    $session = CRM_Core_Session::singleton();
-    $session->pushUserContext($cancelURL);
-  }
-
-  /**
-   * global form rule
-   *
-   * @param array $fields  the input form values
-   * @param array $files   the uploaded files if any
-   * @param array $self    this object.
-   *
-   * @return true if no errors, else an array of errors
-   * @access public
-   * @static
-   */
-  static function formRule($fields, $files, $self) {
-    $errors = array();
-
-    //don't allow duplicate value within group.
-    $optionValues = array();
-    CRM_Core_OptionValue::getValues(array('id' => $self->_gid), $optionValues);
-    foreach ($optionValues as $values) {
-      if ($values['id'] != $self->_id) {
-        if ($fields['value'] == $values['value']) {
-          $errors['value'] = ts('Value already exist in database.');
-          break;
-        }
-      }
-    }
-
-    return empty($errors) ? TRUE : $errors;
-  }
-
-  /**
-   * Function to process the form
-   *
-   * @access public
-   *
-   * @return void
-   */
-  public function postProcess() {
-    CRM_Utils_System::flushCache();
-
-    $params = $this->exportValues();
-    if ($this->_action & CRM_Core_Action::DELETE) {
-      CRM_Core_BAO_OptionValue::del($this->_id);
-      CRM_Core_Session::setStatus(ts('Selected option value has been deleted.'), ts('Record Deleted'), 'success');
-    }
-    else {
-
-      $params = $ids = array();
-      // store the submitted values in an array
-      $params = $this->exportValues();
-      $params['option_group_id'] = $this->_gid;
-
-      if ($this->_action & CRM_Core_Action::UPDATE) {
-        $ids['optionValue'] = $this->_id;
-      }
-
-      //set defaultGreeting option in params to save default value as per contactOption-defaultValue mapping
-      if (!empty($params['contactOptions'])) {
-        $params['filter'] = CRM_Utils_Array::value('contactOptions', $params);
-        $params['defaultGreeting'] = 1;
-      }
-
-      $optionValue = CRM_Core_BAO_OptionValue::add($params, $ids);
-      // CRM-11516
-      if (!empty($params['financial_account_id'])) {
-        $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Asset Account is' "));
-        $params = array(
-          'entity_table' => 'civicrm_option_value',
-          'entity_id' => $optionValue->id,
-          'account_relationship' => $relationTypeId,
-          'financial_account_id' => $params['financial_account_id']
-        );
-        CRM_Financial_BAO_FinancialTypeAccount::add($params);
-      }
-      CRM_Core_Session::setStatus(ts('The Option Value \'%1\' has been saved.', array(1 => $optionValue->label)), ts('Saved'), 'success');
-    }
-  }
-}
index d6ced2669a17a990406d4226a5404b1c20b43c12..ef2b883a9d1c3c541814787f38c415aa6a7794aa 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
    * @var array
    * @static
    */
-  protected $_GName;
+  protected $_gLabel;
 
   /**
    * Function to pre-process
@@ -78,7 +78,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
     else {
       $this->_gName = $this->get('gName');
     }
-    $this->_GName = ucwords(str_replace('_', ' ', $this->_gName));
+    $this->_gLabel = ucwords(str_replace('_', ' ', $this->_gName));
     $url          = "civicrm/admin/options/{$this->_gName}";
     $params       = "group={$this->_gName}&reset=1";
 
@@ -93,7 +93,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
       $isInUse    = CRM_Core_DAO::singleValueQuery($sql, $queryParam);
       if ($isInUse) {
         $scriptURL = "<a href='" . CRM_Utils_System::docURL2('Update Greetings and Address Data for Contacts', TRUE, NULL, NULL, NULL, "wiki") . "'>" . ts('Learn more about a script that can automatically update contact addressee and greeting options.') . "</a>";
-        CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(1 => $this->_GName, 2 => $scriptURL)), ts('Sorry'), 'error');
+        CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(1 => $this->_gLabel, 2 => $scriptURL)), ts('Sorry'), 'error');
         $redirect = CRM_Utils_System::url($url, $params);
         CRM_Utils_System::redirect($redirect);
       }
@@ -376,10 +376,10 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
           CRM_Core_BAO_Phone::setOptionToNull(CRM_Utils_Array::value('value', $this->_defaultValues));
         }
 
-        CRM_Core_Session::setStatus(ts('Selected %1 type has been deleted.', array(1 => $this->_GName)), ts('Record Deleted'), 'success');
+        CRM_Core_Session::setStatus(ts('Selected %1 type has been deleted.', array(1 => $this->_gLabel)), ts('Record Deleted'), 'success');
       }
       else {
-        CRM_Core_Session::setStatus(ts('Selected %1 type has not been deleted.', array(1 => $this->_GName)), ts('Sorry'), 'error');
+        CRM_Core_Session::setStatus(ts('Selected %1 type has not been deleted.', array(1 => $this->_gLabel)), ts('Sorry'), 'error');
         CRM_Utils_Weight::correctDuplicateWeights('CRM_Core_DAO_OptionValue', $fieldValues);
       }
     }
@@ -428,7 +428,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
         CRM_Financial_BAO_FinancialTypeAccount::add($params);
       }
 
-      CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(1 => $this->_GName, 2 => $optionValue->label)), ts('Saved'), 'success');
+      CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(1 => $this->_gLabel, 2 => $optionValue->label)), ts('Saved'), 'success');
     }
   }
 }
diff --git a/CRM/Admin/Page/OptionGroup.php b/CRM/Admin/Page/OptionGroup.php
deleted file mode 100644 (file)
index 0d39c08..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-<?php
-/*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
-*/
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
- * $Id$
- *
- */
-
-/**
- * Page for displaying list of Option Groups
- */
-class CRM_Admin_Page_OptionGroup extends CRM_Core_Page_Basic {
-
-  /**
-   * The action links that we need to display for the browse screen
-   *
-   * @var array
-   * @static
-   */
-  static $_links = NULL;
-
-  /**
-   * Get BAO Name
-   *
-   * @return string Classname of BAO.
-   */
-  function getBAOName() {
-    return 'CRM_Core_BAO_OptionGroup';
-  }
-
-  /**
-   * Get action Links
-   *
-   * @return array (reference) of action links
-   */
-  function &links() {
-    if (!(self::$_links)) {
-      self::$_links = array(
-        CRM_Core_Action::BROWSE => array(
-          'name' => ts('Options'),
-          'url' => 'civicrm/admin/optionValue',
-          'qs' => 'reset=1&action=browse&gid=%%id%%',
-          'title' => ts('View and Edit Options'),
-        ),
-        CRM_Core_Action::UPDATE => array(
-          'name' => ts('Edit Group'),
-          'url' => 'civicrm/admin/optionGroup',
-          'qs' => 'action=update&id=%%id%%&reset=1',
-          'title' => ts('Edit Option'),
-        ),
-        CRM_Core_Action::DISABLE => array(
-          'name' => ts('Disable'),
-          'ref' => 'crm-enable-disable',
-          'title' => ts('Disable Option'),
-        ),
-        CRM_Core_Action::ENABLE => array(
-          'name' => ts('Enable'),
-          'ref' => 'crm-enable-disable',
-          'title' => ts('Enable Option'),
-        ),
-        CRM_Core_Action::DELETE => array(
-          'name' => ts('Delete'),
-          'url' => 'civicrm/admin/optionGroup',
-          'qs' => 'action=delete&id=%%id%%',
-          'title' => ts('Delete Option'),
-        ),
-      );
-    }
-    return self::$_links;
-  }
-
-  /**
-   * Get name of edit form
-   *
-   * @return string Classname of edit form.
-   */
-  function editForm() {
-    return 'CRM_Admin_Form_OptionGroup';
-  }
-
-  /**
-   * Get edit form name
-   *
-   * @return string name of this page.
-   */
-  function editName() {
-    return 'Options';
-  }
-
-  /**
-   * Get user context.
-   *
-   * @return string user context.
-   */
-  function userContext($mode = NULL) {
-    return 'civicrm/admin/optionGroup';
-  }
-}
-
diff --git a/CRM/Admin/Page/OptionValue.php b/CRM/Admin/Page/OptionValue.php
deleted file mode 100644 (file)
index 7f28c87..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-<?php
-/*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
-*/
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
- * $Id$
- *
- */
-
-/**
- * Page for displaying list of Option Value
- */
-class CRM_Admin_Page_OptionValue extends CRM_Core_Page_Basic {
-
-  /**
-   * The action links that we need to display for the browse screen
-   .     *
-   * @var array
-   * @static
-   */
-  static $_links = NULL;
-
-  protected $_gid = NULL;
-
-  /**
-   * The option group name
-   *
-   * @var string
-   * @static
-   */
-  protected $_gName = NULL;
-
-  /**
-   * Get BAO Name
-   *
-   * @return string Classname of BAO.
-   */
-  function getBAOName() {
-    return 'CRM_Core_BAO_OptionValue';
-  }
-
-  /**
-   * Get action Links
-   *
-   * @return array (reference) of action links
-   */
-  function &links() {
-    if (!(self::$_links)) {
-      self::$_links = array(
-        CRM_Core_Action::UPDATE => array(
-          'name' => ts('Edit'),
-          'url' => 'civicrm/admin/optionValue',
-          'qs' => 'action=update&id=%%id%%&gid=%%gid%%&reset=1',
-          'title' => ts('Edit Option Value'),
-        ),
-        CRM_Core_Action::DISABLE => array(
-          'name' => ts('Disable'),
-          'ref' => 'crm-enable-disable',
-          'title' => ts('Disable Option Value'),
-        ),
-        CRM_Core_Action::ENABLE => array(
-          'name' => ts('Enable'),
-          'ref' => 'crm-enable-disable',
-          'title' => ts('Enable Option Value'),
-        ),
-        CRM_Core_Action::DELETE => array(
-          'name' => ts('Delete'),
-          'url' => 'civicrm/admin/optionValue',
-          'qs' => 'action=delete&id=%%id%%&gid=%%gid%%',
-          'title' => ts('Delete Option Value'),
-        ),
-      );
-    }
-    return self::$_links;
-  }
-
-  /**
-   * Run the page.
-   *
-   * This method is called after the page is created. It checks for the
-   * type of action and executes that action.
-   * Finally it calls the parent's run method.
-   *
-   * @return void
-   * @access public
-   *
-   */
-  function run() {
-    $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive',
-      $this, FALSE, 0
-    );
-    $this->assign('gid', $this->_gid);
-
-    if ($this->_gid) {
-      //get optionGroup name in case of email/postal greeting or addressee, CRM-4575
-      $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'name');
-
-      $groupTitle = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'title', 'id');
-      // Some option groups do not have a title set
-      if (!$groupTitle) {
-        $groupTitle = $this->_gName;
-      }
-      CRM_Utils_System::setTitle(ts('%1 - Option Values', array(1 => $groupTitle)));
-    }
-    $breadCrumb = array(array('title' => ts('Option Groups'),
-        'url' => CRM_Utils_System::url('civicrm/admin/options',
-          'reset=1'
-        ),
-      ));
-    CRM_Utils_System::appendBreadCrumb($breadCrumb);
-
-    return parent::run();
-  }
-
-  /**
-   * Browse all options value.
-   *
-   *
-   * @return void
-   * @access public
-   * @static
-   */
-  function browse() {
-    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    $dao = new CRM_Core_DAO_OptionValue();
-
-    $dao->option_group_id = $this->_gid;
-
-    if (in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) {
-      $dao->domain_id = CRM_Core_Config::domainID();
-    }
-
-    if ($this->_gName == 'encounter_medium') {
-      $mediumIds = CRM_Case_BAO_Case::getUsedEncounterMediums();
-    }
-    elseif ($this->_gName == 'case_status') {
-      $caseStatusIds = CRM_Case_BAO_Case::getUsedCaseStatuses();
-    }
-    elseif ($this->_gName == 'case_type') {
-      $caseTypeIds = CRM_Case_BAO_Case::getUsedCaseType();
-    }
-
-    $dao->orderBy('name');
-    $dao->find();
-
-    $optionValue = array();
-    while ($dao->fetch()) {
-      $optionValue[$dao->id] = array();
-      CRM_Core_DAO::storeValues($dao, $optionValue[$dao->id]);
-      // form all action links
-      $action = array_sum(array_keys($this->links()));
-      if ($dao->is_default) {
-        $optionValue[$dao->id]['default_value'] = '[x]';
-      }
-      //do not show default option for email/postal greeting and addressee, CRM-4575
-      if (!in_array($this->_gName, array(
-        'email_greeting', 'postal_greeting', 'addressee'))) {
-        $this->assign('showIsDefault', TRUE);
-      }
-      // update enable/disable links depending on if it is is_reserved or is_active
-      if ($dao->is_reserved) {
-        $action = CRM_Core_Action::UPDATE;
-      }
-      else {
-        if ($dao->is_active) {
-          $action -= CRM_Core_Action::ENABLE;
-        }
-        else {
-          $action -= CRM_Core_Action::DISABLE;
-        }
-
-        if ((($this->_gName == 'encounter_medium') && in_array($dao->value, $mediumIds)) ||
-          (($this->_gName == 'case_status') && in_array($dao->value, $caseStatusIds)) ||
-          (($this->_gName == 'case_type') && in_array($dao->value, $caseTypeIds))
-        ) {
-          $action -= CRM_Core_Action::DELETE;
-        }
-      }
-
-      $optionValue[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(), $action,
-        array('id' => $dao->id, 'gid' => $this->_gid),
-        ts('more'),
-        FALSE,
-        'optionValue.admin.actions',
-        'optionValue',
-        $dao->id
-      );
-    }
-
-    $this->assign('rows', $optionValue);
-  }
-
-  /**
-   * Get name of edit form
-   *
-   * @return string Classname of edit form.
-   */
-  function editForm() {
-    return 'CRM_Admin_Form_OptionValue';
-  }
-
-  /**
-   * Get edit form name
-   *
-   * @return string name of this page.
-   */
-  function editName() {
-    return 'Options Values';
-  }
-
-  /**
-   * Get user context.
-   *
-   * @return string user context.
-   */
-  function userContext($mode = NULL) {
-    return 'civicrm/admin/optionValue';
-  }
-}
-
index de748d0e6cb84ba8747343647d67455a7cf91004..c2f4f79d354c98864874b5edee18b57bae00cc3b 100644 (file)
@@ -60,7 +60,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    * @var array
    * @static
    */
-  static $_GName = NULL;
+  static $_gLabel = NULL;
 
   /**
    * The option group id
@@ -71,33 +71,46 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
   static $_gId = NULL;
 
   /**
-   * Obtains the group name from url and sets the title.
+   * Obtains the group name from url string or id from $_GET['gid'].
+   * 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 && !empty($this->urlPath[3])) {
+      self::$_gName = $this->urlPath[3];
     }
-    if (self::$_gName) {
-      $this->set('gName', self::$_gName);
+    // If an id arg is passed instead of a group name in the path
+    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));
     }
-    else {
+    if (!self::$_gName) {
       self::$_gName = $this->get('gName');
     }
-    if (self::$_gName) {
-      self::$_gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gName, 'id', 'name');
+    // If we don't have a group we will browse all groups
+    if (!self::$_gName) {
+      return;
     }
-    else {
-      CRM_Core_Error::fatal();
+    $this->set('gName', self::$_gName);
+    if (!self::$_gId) {
+      self::$_gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', self::$_gName, 'id', 'name');
     }
 
-    self::$_GName = ucwords(str_replace('_', ' ', self::$_gName));
+    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('GName', self::$_GName);
+    $this->assign('gLabel', self::$_gLabel);
 
     if (self::$_gName == 'acl_role') {
       CRM_Utils_System::setTitle(ts('Manage ACL Roles'));
@@ -110,7 +123,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
       CRM_Utils_System::appendBreadCrumb($breadCrumb);
     }
     else {
-      CRM_Utils_System::setTitle(ts("%1 Options", array(1 => self::$_GName)));
+      CRM_Utils_System::setTitle(ts("%1 Options", array(1 => self::$_gLabel)));
     }
     if (in_array(self::$_gName,
         array(
@@ -143,7 +156,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    * @return string Classname of BAO.
    */
   function getBAOName() {
-    return 'CRM_Core_BAO_OptionValue';
+    return self::$_gName ? 'CRM_Core_BAO_OptionValue' : 'CRM_Core_BAO_OptionGroup';
   }
 
   /**
@@ -156,7 +169,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
       self::$_links = array(
         CRM_Core_Action::UPDATE => array(
           'name' => ts('Edit'),
-          'url' => 'civicrm/admin/options/' . self::$_gName,
+          'url' => 'civicrm/admin/options',
           'qs' => 'group=' . self::$_gName . '&action=update&id=%%id%%&reset=1',
           'title' => ts('Edit %1', array(1 => self::$_gName)),
         ),
@@ -172,7 +185,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DELETE => array(
           'name' => ts('Delete'),
-          'url' => 'civicrm/admin/options/' . self::$_gName,
+          'url' => 'civicrm/admin/options',
           'qs' => 'group=' . self::$_gName . '&action=delete&id=%%id%%',
           'title' => ts('Delete %1 Type', array(1 => self::$_gName)),
         ),
@@ -211,7 +224,10 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-
+    if (!self::$_gName) {
+      return parent::browse();
+    }
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $groupParams = array('name' => self::$_gName);
     $optionValue = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'component_id,weight');
     $gName       = self::$_gName;
@@ -239,7 +255,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    * @return string Classname of edit form.
    */
   function editForm() {
-    return 'CRM_Admin_Form_Options';
+    return self::$_gName ? 'CRM_Admin_Form_Options' : 'CRM_Admin_Form_OptionGroup';
   }
 
   /**
@@ -248,7 +264,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    * @return string name of this page.
    */
   function editName() {
-    return self::$_GName;
+    return self::$_gLabel;
   }
 
   /**
@@ -257,19 +273,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    * @return string user context.
    */
   function userContext($mode = NULL) {
-    return 'civicrm/admin/options/' . self::$_gName;
-  }
-
-  /**
-   * function to get userContext params
-   *
-   * @param int $mode mode that we are in
-   *
-   * @return string
-   * @access public
-   */
-  function userContextParams($mode = NULL) {
-    return 'group=' . self::$_gName . '&reset=1&action=browse';
+    return 'civicrm/admin/options' . (self::$_gName ? '/' . self::$_gName : '');
   }
 }
 
index ec01af5130f74cefee0b029b2fee0e5ae4af1cb2..937b2fb5ec662893b99840857d7c4d243e513135 100644 (file)
@@ -194,7 +194,6 @@ SELECT  petition.id                         as id,
       $surveyInfo = CRM_Campaign_BAO_Petition::getSurveyInfo($params['sid']);
 
       // create activity
-      // activity status id (from /civicrm/admin/optionValue?reset=1&action=browse&gid=25)
       // 1-Schedule, 2-Completed
 
       $activityParams = array(
index b846b1afaa5dc2eadc13b60ee61ea9b6f3aa64dc..a5c673f24eb848ec580e55473ac51400032657b8 100644 (file)
@@ -43,7 +43,6 @@
      <path>civicrm/admin/options/campaign_type</path>
      <title>Campaign Types</title>
      <desc>categorize your campaigns using campaign types.</desc>
-     <path_arguments>group=campaign_type</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>CiviCampaign</adminGroup>
      <icon>admin/small/05.png</icon>
@@ -54,7 +53,6 @@
      <path>civicrm/admin/options/campaign_status</path>
      <title>Campaign Status</title>
      <desc>Define statuses for campaign here.</desc>
-     <path_arguments>group=campaign_status</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>CiviCampaign</adminGroup>
      <icon>admin/small/05.png</icon>
@@ -65,7 +63,6 @@
      <path>civicrm/admin/options/engagement_index</path>
      <title>Engagement Index</title>
      <desc>Engagement levels.</desc>
-     <path_arguments>group=engagement_index</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>CiviCampaign</adminGroup>
      <icon>admin/small/05.png</icon>
index 6c59d6edca01d9fc53776e3263fc930d1992ee70..aefab0c2b8d98b7828edc3b3f92c934b5294f195 100644 (file)
@@ -68,7 +68,6 @@
      <path>civicrm/admin/options/case_type</path>
      <title>Case Types</title>
      <desc>List of types which can be assigned to Cases. (Enable the Cases tab from System Settings - Enable Components if you want to track cases.)</desc>
-     <path_arguments>group=case_type</path_arguments>
      <access_arguments>administer CiviCase</access_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>CiviCase</adminGroup>
@@ -79,7 +78,6 @@
      <path>civicrm/admin/options/redaction_rule</path>
      <title>Redaction Rules</title>
      <desc>List of rules which can be applied to user input strings so that the redacted output can be recognized as repeated instances of the same string or can be identified as a "semantic type of the data element" within case data.</desc>
-     <path_arguments>group=redaction_rule</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <access_arguments>administer CiviCase</access_arguments>
      <adminGroup>CiviCase</adminGroup>
@@ -90,7 +88,6 @@
      <path>civicrm/admin/options/case_status</path>
      <title>Case Statuses</title>
      <desc>List of statuses that can be assigned to a case.</desc>
-     <path_arguments>group=case_status</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <access_arguments>administer CiviCase</access_arguments>
      <adminGroup>CiviCase</adminGroup>
      <path>civicrm/admin/options/encounter_medium</path>
      <title>Encounter Mediums</title>
      <desc>List of encounter mediums.</desc>
-     <path_arguments>group=encounter_medium</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <access_arguments>administer CiviCase</access_arguments>
      <adminGroup>CiviCase</adminGroup>
index 7fd6301f7640cae117f9d4f4e9b52acf0f5f612e..d95d5ad9b43d0daa8646b7225f82ffaa55994594 100644 (file)
     <title>Payment Instruments</title>
     <page_callback>CRM_Admin_Page_Options</page_callback>
     <desc>You may choose to record the payment instrument used for each contribution. Common payment methods are installed by default (e.g. Check, Cash, Credit Card...). If your site requires additional payment methods, add them here.</desc>
-    <path_arguments>group=payment_instrument</path_arguments>
     <adminGroup>CiviContribute</adminGroup>
     <icon>admin/small/payment_instruments.png</icon>
     <weight>380</weight>
     <title>Accepted Credit Cards</title>
     <page_callback>CRM_Admin_Page_Options</page_callback>
     <desc>Credit card options that will be offered to contributors using your Online Contribution pages.</desc>
-    <path_arguments>group=accept_creditcard</path_arguments>
     <adminGroup>CiviContribute</adminGroup>
     <icon>admin/small/accepted_creditcards.png</icon>
     <weight>395</weight>
     <title>Soft Credit Types</title>
     <page_callback>CRM_Admin_Page_Options</page_callback>
     <desc>Soft Credit Types that will be offered to contributors during soft credit contribution</desc>
-    <path_arguments>group=soft_credit_type</path_arguments>
     <adminGroup>CiviContribute</adminGroup>
     <icon>admin/small/soft_credit_type.png</icon>
   </item>
     <page_type>1</page_type>
     <component>CiviContribute</component>
   </item>
-</menu>
\ No newline at end of file
+</menu>
index 837dda2ef2d6b789aa1868e0772176af568f234d..bb0e17b38a35ed64a5d477d5ca2f5a7ef5d11b96 100644 (file)
@@ -307,7 +307,7 @@ class CRM_Core_Invoke {
         $title = CRM_Utils_Array::value('title', $item);
         if (strstr($item['page_callback'], '_Page')) {
           $object = new $item['page_callback'] ($title, $mode );
-          $object->urlPath = $_GET[$config->userFrameworkURLVar];
+          $object->urlPath = explode('/', $_GET[$config->userFrameworkURLVar]);
         }
         elseif (strstr($item['page_callback'], '_Controller')) {
           $addSequence = 'false';
index 9d6d9a2ea1a0f3d91a59ca6a9c3a16c9b1369332..fc11fa2c04f778fcdd97076efd2e8327cba444fd 100644 (file)
      <path>civicrm/admin/options/activity_type</path>
      <title>Activity Types</title>
      <desc>CiviCRM has several built-in activity types (meetings, phone calls, emails sent). Track other types of interactions by creating custom activity types here.</desc>
-     <path_arguments>group=activity_type</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <icon>admin/small/05.png</icon>
      <path>civicrm/admin/options/gender</path>
      <title>Gender Options</title>
      <desc>Options for assigning gender to individual contacts (e.g. Male, Female, Transgender).</desc>
-     <path_arguments>group=gender</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <icon>admin/small/01.png</icon>
      <path>civicrm/admin/options/individual_prefix</path>
      <title>Individual Prefixes (Ms, Mr...)</title>
      <desc>Options for individual contact prefixes (e.g. Ms., Mr., Dr. etc.).</desc>
-     <path_arguments>group=individual_prefix</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <icon>admin/small/title.png</icon>
      <path>civicrm/admin/options/individual_suffix</path>
      <title>Individual Suffixes (Jr, Sr...)</title>
      <desc>Options for individual contact suffixes (e.g. Jr., Sr. etc.).</desc>
-     <path_arguments>group=individual_suffix</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <icon>admin/small/10.png</icon>
      <path>civicrm/admin/options/website_type</path>
      <title>Website Types</title>
      <desc>Options for assigning website types to contacts.</desc>
-     <path_arguments>group=website_type</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <weight>65</weight>
      <path>civicrm/admin/options/instant_messenger_service</path>
      <title>Instant Messenger Services</title>
      <desc>List of IM services which can be used when recording screen-names for contacts.</desc>
-     <path_arguments>group=instant_messenger_service</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <icon>admin/small/07.png</icon>
      <path>civicrm/admin/options/mobile_provider</path>
      <title>Mobile Phone Providers</title>
      <desc>List of mobile phone providers which can be assigned when recording contact phone numbers.</desc>
-     <path_arguments>group=mobile_provider</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <icon>admin/small/08.png</icon>
     <title>Phone Type</title>
     <desc>Options for assigning phone type to contacts (e.g Phone,
     Mobile, Fax, Pager)</desc>
-    <path_arguments>group=phone_type</path_arguments>
     <page_callback>CRM_Admin_Page_Options</page_callback>
     <adminGroup>Customize Data and Screens</adminGroup>
     <icon>tel.gif</icon>
      <path>civicrm/admin/options/custom_search</path>
      <title>Manage Custom Searches</title>
      <desc>Developers and accidental techies with a bit of PHP and SQL knowledge can create new search forms to handle specific search and reporting needs which aren't covered by the built-in Advanced Search and Search Builder features.</desc>
-     <path_arguments>group=custom_search</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Customize Data and Screens</adminGroup>
      <icon>admin/small/template.png</icon>
      <path>civicrm/admin/options/from_email_address</path>
      <title>From Email Addresses</title>
      <desc>List of Email Addresses which can be used when sending emails to contacts.</desc>
-     <path_arguments>group=from_email_address</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Communications</adminGroup>
      <icon>admin/small/title.png</icon>
      <path>civicrm/admin/options/preferred_communication_method</path>
      <title>Preferred Communication Methods</title>
      <desc>One or more preferred methods of communication can be assigned to each contact. Customize the available options here.</desc>
-     <path_arguments>group=preferred_communication_method</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Communications</adminGroup>
      <icon>admin/small/communication.png</icon>
      <path>civicrm/admin/options/communication_style</path>
      <title>Communication Style Options</title>
      <desc>Options for Communication Style selection.</desc>
-     <path_arguments>group=communication_style</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Communications</adminGroup>
      <icon>admin/small/01.png</icon>
      <path>civicrm/admin/options/email_greeting</path>
      <title>Email Greeting Formats</title>
      <desc>Options for assigning email greetings to individual and household contacts.</desc>
-     <path_arguments>group=email_greeting</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Communications</adminGroup>
      <icon>admin/small/01.png</icon>
      <path>civicrm/admin/options/postal_greeting</path>
      <title>Postal Greeting Formats</title>
      <desc>Options for assigning postal greetings to individual and household contacts.</desc>
-     <path_arguments>group=postal_greeting</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Communications</adminGroup>
      <icon>admin/small/01.png</icon>
      <path>civicrm/admin/options/addressee</path>
      <title>Addressee Formats</title>
      <desc>Options for assigning addressee to individual, household and organization contacts.</desc>
-     <path_arguments>group=addressee</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Communications</adminGroup>
      <icon>admin/small/01.png</icon>
      <path>civicrm/admin/options/languages</path>
      <title>Preferred Languages</title>
      <desc>Options for contact languages.</desc>
-     <path_arguments>group=languages</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Localization</adminGroup>
      <icon>admin/small/36.png</icon>
      <path>civicrm/admin/options/safe_file_extension</path>
      <title>Safe File Extension Options</title>
      <desc>File Extensions that can be considered safe.</desc>
-     <path_arguments>group=safe_file_extension</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>System Settings</adminGroup>
      <icon>admin/small/01.png</icon>
      <path>civicrm/admin/options</path>
      <title>Option Groups</title>
      <desc>Access all meta-data option groups.</desc>
-     <page_callback>CRM_Admin_Page_OptionGroup</page_callback>
+     <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>System Settings</adminGroup>
      <icon>admin/small/01.png</icon>
      <weight>105</weight>
      <path>civicrm/admin/options/grant_type</path>
      <title>Grant Types</title>
      <desc>List of types which can be assigned to Grants. (Enable CiviGrant from Administer > Systme Settings > Enable Components if you want to track grants.)</desc>
-     <path_arguments>group=grant_type</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>Option Lists</adminGroup>
      <icon>admin/small/grant_type.png</icon>
      <is_ssl>true</is_ssl>
      <weight>9000</weight>
   </item>
-  <item>
-     <path>civicrm/admin/optionValue</path>
-     <title>Option Values</title>
-     <page_callback>CRM_Admin_Page_OptionValue</page_callback>
-  </item>
   <item>
      <path>civicrm/ajax/menujs</path>
      <page_callback>CRM_Admin_Page_AJAX::getNavigationMenu</page_callback>
index f54ef23beceb75b7368165a889e973b480fd5a57..274c6fc9469c00bddc5cb7c1949946d426fcfc5c 100644 (file)
@@ -20,7 +20,6 @@
   <item>
      <path>civicrm/admin/options/acl_role</path>
      <title>ACL Roles</title>
-     <path_arguments>group=acl_role</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <access_arguments>administer CiviCRM,access CiviCRM</access_arguments>
   </item>
index be95ac376bd72e66090571e23ac8c632cbf69dd0..2906d3c473779bbee074510d747812207eab62bd 100644 (file)
@@ -82,7 +82,6 @@
      <title>Event Types</title>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <desc>Use Event Types to categorize your events. Event feeds can be filtered by Event Type and participant searches can use Event Type as a criteria.</desc>
-     <path_arguments>group=event_type</path_arguments>
      <access_arguments>administer CiviCRM,access CiviEvent</access_arguments>
      <adminGroup>CiviEvent</adminGroup>
      <icon>admin/small/event_type.png</icon>
      <title>Participant Role</title>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <desc>Define participant roles for events here (e.g. Attendee, Host, Speaker...). You can then assign roles and search for participants by role.</desc>
-     <path_arguments>group=participant_role</path_arguments>
      <access_arguments>administer CiviCRM,access CiviEvent</access_arguments>
      <adminGroup>CiviEvent</adminGroup>
      <icon>admin/small/parti_role.png</icon>
      <path>civicrm/admin/options/participant_listing</path>
      <title>Participant Listing Templates</title>
      <desc>Template to control participant listing display.</desc>
-     <path_arguments>group=participant_listing</path_arguments>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <adminGroup>CiviEvent</adminGroup>
      <icon>admin/small/01.png</icon>
index b6808487a6d9a0dd387026abbec960f7d8a50714..0e2fa2272cb980310c4b5a8ccca0de3d1952f51d 100644 (file)
     <weight>410</weight>
   </item>
   <item>
-    <path>civicrm/admin/options/from_email</path>
+    <path>civicrm/admin/options/from_email_address/civimail</path>
     <title>From Email Addresses</title>
     <desc>List of Email Addresses which can be used when sending emails to contacts.</desc>
-    <path_arguments>group=from_email_address</path_arguments>
     <page_callback>CRM_Admin_Page_Options</page_callback>
     <adminGroup>CiviMail</adminGroup>
     <icon>admin/small/title.png</icon>
index 1a89f39ea68857289baac9ccd0950e686f9e673a..85596b024bd94b0598ee59844ba4808d95250fd7 100644 (file)
@@ -192,3 +192,7 @@ VALUES
    (@option_group_id_act, {localize}'{ts escape="sql"}Refund{/ts}'{/localize}, @option_group_id_act_val+2, 'Refund', NULL, 1, NULL, @option_group_id_act_wt+2, {localize}'{ts escape="sql"}Refund recorded for event or membership fee.{/ts}'{/localize}, 0, 1, 1, @contributeCompId, NULL),
    (@option_group_id_act, {localize}'{ts escape="sql"}Change Registration{/ts}'{/localize}, @option_group_id_act_val+3, 'Change Registration', NULL, 1, NULL, @option_group_id_act_wt+3, {localize}'{ts escape="sql"}Changes to an existing event registration.{/ts}'{/localize}, 0, 1, 1, @eventCompId, NULL);
 
+-- CRM-13970
+UPDATE civicrm_navigation set url = 'civicrm/admin/options/from_email_address&reset=1' WHERE url LIKE 'civicrm/admin/options/from_email%';
+UPDATE civicrm_navigation set url = 'civicrm/admin/option_groups&reset=1' WHERE url LIKE 'civicrm/admin/options&%';
+UPDATE civicrm_navigation set url = CONCAT(SUBSTRING_INDEX(url, '&', 1), '&reset=1') WHERE url LIKE 'civicrm/admin/options/%';
index e8a5dbe11a1e4cf51507dc5e6e80e28d97e380d3..62707560a722e2bf271bd9171c491d594a38dda5 100644 (file)
  +--------------------------------------------------------------------+
 *}
 {* this template is used for adding/editing options *}
-<h3>{if $action eq 1}{ts 1=$GName}New %1 Option{/ts}{elseif $action eq 8}{ts 1=$GName}Delete %1 Option{/ts}{else}{ts 1=$GName}Edit %1 Option{/ts}{/if}</h3>
+<h3>{if $action eq 1}{ts 1=$gLabel}New %1 Option{/ts}{elseif $action eq 8}{ts 1=$gLabel}Delete %1 Option{/ts}{else}{ts 1=$gLabel}Edit %1 Option{/ts}{/if}</h3>
 <div class="crm-block crm-form-block crm-admin-options-form-block">
 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
   {if $action eq 8}
       <div class="messages status no-popup">
         <div class="icon inform-icon"></div>
-             {ts 1=$GName}WARNING: Deleting this option will result in the loss of all %1 related records which use the option.{/ts} {ts}This may mean the loss of a substantial amount of data, and the action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
+             {ts 1=$gLabel}WARNING: Deleting this option will result in the loss of all %1 related records which use the option.{/ts} {ts}This may mean the loss of a substantial amount of data, and the action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
       </div>
     {else}
     <table class="form-layout-compressed">
index 3054e66a392708afae138288781684cf25f8b540..609f629acc48cd52329d8f186d30e17a0ebb179c 100644 (file)
@@ -50,7 +50,7 @@
       <tr id="optionGroup-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
             <td class="crm-admin-optionGroup-title">{if $row.title}{$row.title}{else}( {ts}none{/ts} ){/if}</td>
             <td class="crm-admin-optionGroup-name">{$row.name}</td>
-            <td><a href="{crmURL p="civicrm/admin/optionValue" q="gid=`$row.id`&reset=1"}" title="{ts}View and Edit Options{/ts}">{ts}Options{/ts}</a></td>
+            <td><a href="{crmURL p="civicrm/admin/options" q="gid=`$row.id`&reset=1"}" title="{ts}View and Edit Options{/ts}">{ts}Options{/ts}</a></td>
         </tr>
         {/foreach}
     </table>
index 8deb1527350f73bacedd36a726b661167a4feb48..36474d1b203b0299d79b7df43cca872d997952d7 100644 (file)
  +--------------------------------------------------------------------+
 *}
 
-{if $action eq 1 or $action eq 2 or $action eq 8}
+{if empty($gName)}
+  {include file="CRM/Admin/Page/OptionGroup.tpl"}
+
+{elseif $action eq 1 or $action eq 2 or $action eq 8}
    {include file="CRM/Admin/Form/Options.tpl"}
 {else}
 
@@ -61,7 +64,7 @@
   {elseif $gName eq 'from_email_address'}
     {ts}By default, CiviCRM uses the primary email address of the logged in user as the FROM address when sending emails to contacts. However, you can use this page to define one or more general Email Addresses that can be selected as an alternative. EXAMPLE: <em>"Client Services" &lt;clientservices@example.org&gt;</em>{/ts}
   {else}
-    {ts 1=$GName}The existing option choices for %1 group are listed below. You can add, edit or delete them from this screen.{/ts}
+    {ts 1=$gLabel}The existing option choices for %1 group are listed below. You can add, edit or delete them from this screen.{/ts}
   {/if}
 </div>
 
@@ -69,7 +72,7 @@
 {if $rows}
 {if $action ne 1 and $action ne 2}
     <div class="action-link">
-        <a href="{crmURL q="group="|cat:$gName|cat:"&action=add&reset=1"}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$GName}Add %1{/ts}</span></a>
+        <a href="{crmURL q="group="|cat:$gName|cat:"&action=add&reset=1"}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
     </div>
 {/if}
 <div id={$gName}>
 
         {if $action ne 1 and $action ne 2}
             <div class="action-link">
-                <a href="{crmURL q="group="|cat:$gName|cat:"&action=add&reset=1"}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$GName}Add %1{/ts}</span></a>
+                <a href="{crmURL q="group="|cat:$gName|cat:"&action=add&reset=1"}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
             </div>
         {/if}
 </div>
index c6e24d5d9ec7c19a92a1735e807f723207cd5b23..7a9d6daabc0c82a7d713c27fc82c3d8c5e0f7b3d 100644 (file)
      }
      cj('.optionvalue-link').click(function() {
         {/literal}"{crmAPI var='result' entity='OptionGroup' action='get' sequential=1 name='soft_credit_type'}"{literal};
-        var postURL = {/literal}"{crmURL p='civicrm/admin/optionValue' q="gid="}{$result.id}"{literal};
+        var postURL = {/literal}"{crmURL p='civicrm/admin/options' q="gid="}{$result.id}"{literal};
         CRM.loadForm(postURL).on('crmFormSuccess', function(e, data) {
            cj('.ui-dialog a').click(function(){
            //Todo: inline edit facility for soft_credit_type option group in jquery popup dialog
index fc2fe8b5dcda6be8a1a32336eeb2364110c1dfb8..c3cb3e47763a5850f2efe71c6831a565abbcf8f0 100644 (file)
@@ -66,7 +66,6 @@
      <title>Auction Types</title>
      <page_callback>CRM_Admin_Page_Options</page_callback>
      <desc>Use Auction Types to categorize your auction items.</desc>
-     <path_arguments>group=auction_type</path_arguments>
      <access_arguments>administer CiviCRM,access CiviAuction</access_arguments>
      <adminGroup>CiviAuction</adminGroup>
      <icon>admin/small/auction_type.png</icon>