From 130c7801e718d55c500e9f777112f51905cad060 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 15 Jul 2010 21:46:31 +0000 Subject: customer tags, RT#9192 --- httemplate/browse/part_tag.html | 23 +++++++++++++++++++++++ httemplate/edit/part_tag.html | 23 +++++++++++++++++++++++ httemplate/edit/process/part_tag.html | 11 +++++++++++ httemplate/elements/menu.html | 5 ++++- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 httemplate/browse/part_tag.html create mode 100644 httemplate/edit/part_tag.html create mode 100644 httemplate/edit/process/part_tag.html (limited to 'httemplate') diff --git a/httemplate/browse/part_tag.html b/httemplate/browse/part_tag.html new file mode 100644 index 000000000..3bb166199 --- /dev/null +++ b/httemplate/browse/part_tag.html @@ -0,0 +1,23 @@ +<% include( 'elements/browse.html', + 'title' => 'Tags', + 'name_singular' => 'tag', + 'menubar' => [ 'Add a new tag' => + $p.'edit/part_tag.html', + ], + 'query' => { 'table' => 'part_tag', }, + 'count_query' => 'SELECT COUNT(*) FROM part_tag', + 'header' => [ 'Tag', 'Description', 'Color' ], + 'fields' => [ 'tagname', 'tagdesc', 'tagcolor' ], + 'links' => [ $link, '', '' ], + 'disableable' => 1, + 'disabled_statuspos' => 1, + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $link = [ "${p}edit/part_tag.html?", 'tagnum' ]; + + diff --git a/httemplate/edit/part_tag.html b/httemplate/edit/part_tag.html new file mode 100644 index 000000000..938e34256 --- /dev/null +++ b/httemplate/edit/part_tag.html @@ -0,0 +1,23 @@ +<% include( 'elements/edit.html', + 'table' => 'part_tag', + 'name_singular' => 'tag', + 'fields' => [ 'tagname', + { field=>'disabled', type=>'checkbox', value=>'Y' }, + 'tagdesc', + 'tagcolor' + ], + 'labels' => { 'tagnum' => 'Tag #', + 'tagname' => 'Tag', + 'tagdesc' => 'Description', + 'tagcolor' => 'Highlight Color', + 'disabled' => 'Disabled', + }, + 'viewall_dir' => 'browse', + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + + diff --git a/httemplate/edit/process/part_tag.html b/httemplate/edit/process/part_tag.html new file mode 100644 index 000000000..077dc4cd9 --- /dev/null +++ b/httemplate/edit/process/part_tag.html @@ -0,0 +1,11 @@ +<% include( 'elements/process.html', + 'table' => 'part_tag', + 'viewall_dir' => 'browse', + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + + diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 190455772..1eaefe231 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -475,6 +475,8 @@ tie my %config_misc, 'Tie::IxHash'; $config_misc{'Message templates'} = [ $fsurl.'browse/msg_template.html', 'Templates for customer notices' ] if $curuser->access_right('Edit templates') || $curuser->access_right('Edit global templates'); +$config_misc{'Tags'} = [ $fsurl.'browse/part_tag.html', '' ] + if $curuser->access_right('Configuration'); $config_misc{'Advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service.' ] if $curuser->access_right('Edit advertising sources') || $curuser->access_right('Edit global advertising sources'); @@ -518,7 +520,8 @@ $config_menu{'Broadband'} = [ \%config_broadband, '' ] $config_menu{'Phone'} = [ \%config_phone, '' ] if ( $curuser->access_right('Configuration') ); $config_menu{'Miscellaneous'} = [ \%config_misc, '' ] - if $curuser->access_right('Edit advertising sources') + if $curuser->access_right('Configuration' ) + || $curuser->access_right('Edit advertising sources') || $curuser->access_right('Edit global advertising sources'); -- cgit v1.2.1