));
}
- if (CRM_Core_Permission::check('administer CiviCRM')) {
+ if (CRM_Core_Permission::check('manage tags')) {
$shortCuts = array_merge($shortCuts, array(
array(
- 'path' => 'civicrm/admin/tag',
+ 'path' => 'civicrm/tag',
'query' => 'reset=1&action=add',
'ref' => 'new-tag',
'title' => ts('Tag'),
$prefix . ts('translate CiviCRM'),
ts('Allow User to enable multilingual'),
),
+ 'manage tags' => array(
+ $prefix . ts('manage tags'),
+ ts('Create and rename tags'),
+ ),
'administer reserved groups' => array(
$prefix . ts('administer reserved groups'),
ts('Edit and disable Reserved Groups (Needs Edit Groups)'),
<page_callback>CRM_UF_Form_AdvanceSetting</page_callback>
<weight>0</weight>
</item>
- <item>
- <path>civicrm/admin/tag</path>
- <title>Tags (Categories)</title>
- <desc>Tags are useful for segmenting the contacts in your database into categories (e.g. Staff Member, Donor, Volunteer, etc.). Create and edit available tags here.</desc>
- <page_callback>CRM_Admin_Page_Tag</page_callback>
- <adminGroup>Customize Data and Screens</adminGroup>
- <icon>admin/small/11.png</icon>
- <weight>25</weight>
- </item>
- <item>
- <path>civicrm/admin/tag/add</path>
- <title>New Tag</title>
- <page_callback>CRM_Admin_Page_Tag</page_callback>
- <path_arguments>action=add</path_arguments>
- </item>
<item>
<path>civicrm/admin/options/activity_type</path>
<title>Activity Types</title>
--- /dev/null
+<?xml version="1.0" encoding="iso-8859-1" ?>
+
+<menu>
+ <item>
+ <path>civicrm/tag</path>
+ <title>Tags (Categories)</title>
+ <desc>Tags are useful for segmenting the contacts in your database into categories (e.g. Staff Member, Donor, Volunteer, etc.). Create and edit available tags here.</desc>
+ <page_callback>CRM_Tag_Page_Tag</page_callback>
+ <access_arguments>administer CiviCRM;manage tags</access_arguments>
+ <adminGroup>Customize Data and Screens</adminGroup>
+ <icon>admin/small/11.png</icon>
+ <weight>25</weight>
+ </item>
+ <item>
+ <path>civicrm/tag/add</path>
+ <title>New Tag</title>
+ <page_callback>CRM_Tag_Page_Tag</page_callback>
+ <path_arguments>action=add</path_arguments>
+ <access_arguments>administer CiviCRM;manage tags</access_arguments>
+ </item>
+</menu>
/**
* This class generates form components for Tag.
*/
-class CRM_Admin_Form_Tag extends CRM_Admin_Form {
+class CRM_Tag_Form_Edit extends CRM_Admin_Form {
protected $_isTagSet;
/**
if ($this->_action == CRM_Core_Action::DELETE) {
if ($this->_id && $tag = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Tag', $this->_id, 'name', 'parent_id')) {
- $url = CRM_Utils_System::url('civicrm/admin/tag', "reset=1");
+ $url = CRM_Utils_System::url('civicrm/tag', "reset=1");
CRM_Core_Error::statusBounce(ts("This tag cannot be deleted. You must delete all its child tags ('%1', etc) prior to deleting this tag.", array(1 => $tag)), $url);
}
if ($this->_values['is_reserved'] == 1 && !CRM_Core_Permission::check('administer reserved tags')) {
/**
* Page for displaying list of categories.
*/
-class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic {
+class CRM_Tag_Page_Tag extends CRM_Core_Page_Basic {
public $useLivePageJS = TRUE;
self::$_links = array(
CRM_Core_Action::UPDATE => array(
'name' => ts('Edit'),
- 'url' => 'civicrm/admin/tag',
+ 'url' => 'civicrm/tag',
'qs' => 'action=update&id=%%id%%&reset=1',
'title' => ts('Edit Tag'),
),
CRM_Core_Action::DELETE => array(
'name' => ts('Delete'),
- 'url' => 'civicrm/admin/tag',
+ 'url' => 'civicrm/tag',
'qs' => 'action=delete&id=%%id%%',
'title' => ts('Delete Tag'),
),
* Classname of edit form.
*/
public function editForm() {
- return 'CRM_Admin_Form_Tag';
+ return 'CRM_Tag_Form_Edit';
}
/**
* user context.
*/
public function userContext($mode = NULL) {
- return 'civicrm/admin/tag';
+ return 'civicrm/tag';
}
/**
* Classname of delete form.
*/
public function deleteForm() {
- return 'CRM_Admin_Form_Tag';
+ return 'CRM_Tag_Form_Edit';
}
/**
ALTER TABLE `civicrm_price_field_value` CHANGE `deductible_amount` `non_deductible_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'Portion of total amount which is NOT tax deductible.';
ALTER TABLE `civicrm_line_item` CHANGE `deductible_amount` `non_deductible_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'Portion of total amount which is NOT tax deductible.';
+
+-- CRM-15371 Manage tags with new *manage tags* permission (used to need *administer CiviCRM* permission)
+UPDATE civicrm_navigation SET
+ `url` = 'civicrm/tag?reset=1&action=add',
+ `permission` = 'manage tags'
+WHERE `name` = 'Manage Tags (Categories)';
+
+UPDATE civicrm_navigation SET
+ `url` = 'civicrm/admin/tag?reset=1',
+ `permission` = 'manage tags'
+WHERE `name` = 'New Tag';
+
+UPDATE civicrm_navigation SET
+ `url` = 'civicrm/admin/tag?reset=1'
+WHERE `name` = 'Tags (Categories)';
<td colspan="2">{ts}Organize your contacts{/ts}</td>
</tr>
<tr class="even">
- <td class="tasklist nowrap"><a href="{crmURL p="civicrm/admin/tag" q="reset=1&civicrmDestination=`$destination`"}" title="{$linkTitle}">{ts}Tags (Categories){/ts}</a></td>
+ <td class="tasklist nowrap"><a href="{crmURL p="civicrm/tag" q="reset=1&civicrmDestination=`$destination`"}" title="{$linkTitle}">{ts}Tags (Categories){/ts}</a></td>
<td>{ts}Tags can be assigned to any contact record, and are a convenient way to find contacts. You can create as many tags as needed to organize and segment your records.{/ts}</td>
</tr>
<tr class="even">
{capture assign=docLink}{docURL page="user/organising-your-data/groups-and-tags"}{/capture}
{if $action eq 1 or $action eq 2 or $action eq 8}
- {include file="CRM/Admin/Form/Tag.tpl"}
+ {include file="CRM/Tag/Form/Edit.tpl"}
{else}
<div class="crm-content-block">
<div class="help">
{else}
<div class="messages status no-popup">
<div class="icon inform-icon"></div>
- {capture assign=crmURL}{crmURL p='civicrm/admin/tag' q="action=add&reset=1"}{/capture}
+ {capture assign=crmURL}{crmURL p='civicrm/tag' q="action=add&reset=1"}{/capture}
{ts 1=$crmURL}There are no Tags present. You can <a href='%1'>add one</a>.{/ts}
</div>
{/if}
( @domainID, 'civicrm/import/activity?reset=1', '{ts escape="sql" skip="true"}Import Activities{/ts}', 'Import Activities', 'import contacts', '', @contactlastID, '1', '1', 8 ),
( @domainID, 'civicrm/group/add?reset=1', '{ts escape="sql" skip="true"}New Group{/ts}', 'New Group', 'edit groups', '', @contactlastID, '1', NULL, 9 ),
( @domainID, 'civicrm/group?reset=1', '{ts escape="sql" skip="true"}Manage Groups{/ts}', 'Manage Groups', 'access CiviCRM', '', @contactlastID, '1', '1', 10 ),
- ( @domainID, 'civicrm/admin/tag?reset=1&action=add', '{ts escape="sql" skip="true"}New Tag{/ts}', 'New Tag', 'administer CiviCRM', '', @contactlastID, '1', NULL, 11 ),
- ( @domainID, 'civicrm/admin/tag?reset=1', '{ts escape="sql" skip="true"}Manage Tags (Categories){/ts}', 'Manage Tags (Categories)', 'administer CiviCRM', '', @contactlastID, '1','1', 12 ),
+ ( @domainID, 'civicrm/tag?reset=1&action=add', '{ts escape="sql" skip="true"}New Tag{/ts}', 'New Tag', 'manage tags', '', @contactlastID, '1', NULL, 11 ),
+ ( @domainID, 'civicrm/tag?reset=1', '{ts escape="sql" skip="true"}Manage Tags (Categories){/ts}', 'Manage Tags (Categories)', 'manage tags', '', @contactlastID, '1','1', 12 ),
( @domainID, 'civicrm/contact/deduperules?reset=1', '{ts escape="sql" skip="true"}Find and Merge Duplicate Contacts{/ts}', 'Find and Merge Duplicate Contacts', 'administer dedupe rules,merge duplicate contacts', 'OR', @contactlastID, '1', NULL, 13 );
INSERT INTO civicrm_navigation
VALUES
( @domainID, 'civicrm/admin/custom/group?reset=1', '{ts escape="sql" skip="true"}Custom Fields{/ts}', 'Custom Fields', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 1 ),
( @domainID, 'civicrm/admin/uf/group?reset=1', '{ts escape="sql" skip="true"}Profiles{/ts}', 'Profiles', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 2 ),
- ( @domainID, 'civicrm/admin/tag?reset=1', '{ts escape="sql" skip="true"}Tags (Categories){/ts}', 'Tags (Categories)', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 3 ),
+ ( @domainID, 'civicrm/tag?reset=1', '{ts escape="sql" skip="true"}Tags (Categories){/ts}', 'Tags (Categories)', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 3 ),
( @domainID, 'civicrm/admin/options/activity_type?reset=1', '{ts escape="sql" skip="true"}Activity Types{/ts}', 'Activity Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 4 ),
( @domainID, 'civicrm/admin/reltype?reset=1', '{ts escape="sql" skip="true"}Relationship Types{/ts}', 'Relationship Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 5 ),
( @domainID, 'civicrm/admin/options/subtype?reset=1', '{ts escape="sql" skip="true"}Contact Types{/ts}','Contact Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 6 ),