From dfb6ad5c96f3a18553ef4b0e81d51c6bc5d44c92 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 3 Aug 2010 23:12:06 +0000 Subject: don't allow addition of a domain rule template to itself, RT#7514 --- httemplate/browse/cgp_rule.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/browse') diff --git a/httemplate/browse/cgp_rule.html b/httemplate/browse/cgp_rule.html index 8a427b828..8ea7571d0 100644 --- a/httemplate/browse/cgp_rule.html +++ b/httemplate/browse/cgp_rule.html @@ -44,11 +44,12 @@ my $html_init = if ( $part_svc->svcdb eq 'svc_domain' ) { - #areyousure for adding these? + #XXX add areyousure javscript confirmation for adding these foreach my $line ( FS::Conf->new->config('cgp_rule-domain_templates') ) { $line =~ /^\s*(\d+)\s+(.+)\s*$/ or next; my($t_svcnum, $t_name) = ( $1, $2 ); + next if $t_svcnum == $svcnum; $html_init .= qq!! ."Add $t_name rule
"; -- cgit v1.2.1 From b3205ddf480401284a5fc4ccbcb45d9c42b0bcf9 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 7 Aug 2010 07:39:06 +0000 Subject: communigate phase 3: RPOP/acct_snarf, RT#7515 --- httemplate/browse/acct_snarf.html | 78 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 httemplate/browse/acct_snarf.html (limited to 'httemplate/browse') diff --git a/httemplate/browse/acct_snarf.html b/httemplate/browse/acct_snarf.html new file mode 100644 index 000000000..f6109944f --- /dev/null +++ b/httemplate/browse/acct_snarf.html @@ -0,0 +1,78 @@ +<% include('elements/browse.html', + 'title' => "Remote POP accounts for $svc_label: $svc_value", + 'name_singular' => 'Remote POP account', + 'html_init' => $html_init, + 'query' => { 'table' => 'acct_snarf', + 'hashref' => { 'svcnum' => $svcnum }, + #'order_by' => 'ORDER BY priority DESC', + }, + 'count_query' => $count_query, + 'header' => [ 'Name', + 'Mail server', + 'Username', + #'Password', + 'Poll every', + #'Options', + 'Leave', + 'APOP', + 'TLS', + 'Mailbox', + '', #delete + ], + 'fields' => [ 'snarfname', + 'machine', + 'username', + sub { FS::acct_snarf->check_freq_labels->{shift->check_freq} }, + 'leave', + 'apop', + 'tls', + 'mailbox', + ], + #'align' + 'links' => [ $edit_sub, $edit_sub, $edit_sub, '', + '', '', '', '', $del_sub ], + ) +%> +<%init> + +$cgi->param('svcnum') =~ /^(\d+)$/ or die 'no svcnum'; +my $svcnum = $1; + +#agent virt so you can't do cross-agent snarfing +my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svcnum }) + or die 'unknown svcnum'; +my $part_svc = $cust_svc->part_svc; + +my $count_query = "SELECT COUNT(*) FROM acct_snarf WHERE svcnum = $svcnum"; + +my($svc_label, $svc_value, $svcdb) = $cust_svc->label; + +my $view = FS::UI::Web::svc_url( 'm' => $m, + 'action' => 'view', + 'part_svc' => $part_svc, + 'svc' => $cust_svc, + ); + +my $html_init = + qq(View this $svc_label

). + qq!Add new remote POP account
!. + '
'. + qq! + +!; + +my $edit_sub = [ $p.'edit/acct_snarf.html?', 'snarfnum' ]; +my $del_sub = sub { + my $snarfnum = shift->snarfnum; + [ "javascript:areyousure_delete('${p}misc/delete-acct_snarf.html?$snarfnum')", '' ]; +}; + + -- cgit v1.2.1 From 76fc32468d0353e606c99ca9a26bcb0137fc9de1 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 17 Aug 2010 07:00:48 +0000 Subject: allow Configuration right to see global message templates, avoid weird surprises on upgrade --- httemplate/browse/msg_template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/browse') diff --git a/httemplate/browse/msg_template.html b/httemplate/browse/msg_template.html index 0cd33c797..252ee1ff8 100644 --- a/httemplate/browse/msg_template.html +++ b/httemplate/browse/msg_template.html @@ -9,7 +9,7 @@ 'disableable' => 1, 'disabled_statuspos' => 2, 'agent_virt' => 1, - 'agent_null_right' => 'Edit global templates', + 'agent_null_right' => ['Edit global templates','Configuration'], 'agent_pos' => 3, 'header' => [ 'Name' ], 'fields' => [ 'msgname' ], -- cgit v1.2.1 From 5250c44bd7f282c7d782bf0e8349af12376929df Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 22 Sep 2010 19:16:20 +0000 Subject: prepayment discounts rt#5318 --- httemplate/browse/part_pkg.cgi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'httemplate/browse') diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 42eb5dfcb..3c3016ba2 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -195,6 +195,9 @@ push @fields, sub { my $part_pkg = shift; (my $plan = $plan_labels{$part_pkg->plan} ) =~ s/ / /g; my $is_recur = ( $part_pkg->freq ne '0' ); + my @discounts = sort { $a->months <=> $b->months } + map { $_->discount } + $part_pkg->part_pkg_discount; [ [ @@ -238,6 +241,28 @@ push @fields, sub { } $part_pkg->bill_part_pkg_link ), + ( scalar(@discounts) + ? [ + { data => 'Discounts', + align=>'center', #? + colspan=>2, + } + ] + : () + ), + ( scalar(@discounts) + ? map { + [ + { data => $_->months. ':', + align => 'right', + }, + { data => $_->amount ? '$'. $_->amount : $_->percent. '%' + } + ] + } + @discounts + : () + ), ]; # $plan_labels{$part_pkg->plan}.'
'. -- cgit v1.2.1 From 9a98d39e3ce40c1f2c324991e8ad469271093fb5 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 17 Oct 2010 00:09:27 +0000 Subject: show eventpart in clone dropdown --- httemplate/browse/part_event.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/browse') diff --git a/httemplate/browse/part_event.html b/httemplate/browse/part_event.html index 3d7c245ac..f68f06b9f 100644 --- a/httemplate/browse/part_event.html +++ b/httemplate/browse/part_event.html @@ -150,7 +150,7 @@ my $html_init = foreach my $part_event ( qsearch('part_event', {'diabled'=>''}) ) { $html_init .= ''; + $part_event->eventpart. ': '. $part_event->event. ''; } $html_init .= ''. -- cgit v1.2.1 From 79f809fedf5fc96da31039122c8326d31b6662b6 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 22 Oct 2010 08:54:32 +0000 Subject: fix package def report totals to break down not yet billed vs. active package counts, RT#10317 --- httemplate/browse/part_pkg.cgi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'httemplate/browse') diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 3c3016ba2..3881606d9 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -96,6 +96,13 @@ $select = " *, ( $count_cust_pkg + AND ( setup IS NULL OR setup = 0 ) + AND ( cancel IS NULL OR cancel = 0 ) + AND ( susp IS NULL OR susp = 0 ) + ) AS num_not_yet_billed, + + ( $count_cust_pkg + AND setup IS NOT NULL AND setup != 0 AND ( cancel IS NULL OR cancel = 0 ) AND ( susp IS NULL OR susp = 0 ) ) AS num_active, @@ -309,6 +316,7 @@ if ( $acl_edit_global ) { #if ( $cgi->param('active') ) { push @header, 'Customer
packages'; my %col = ( + 'not yet billed' => '009999', #teal? cyan? 'active' => '00CC00', 'suspended' => 'FF9900', 'cancelled' => 'FF0000', @@ -326,6 +334,7 @@ if ( $acl_edit_global ) { #$label = 'one-time charge', $label = 'charge', } + $label= 'not yet billed' if $magic eq 'not_yet_billed'; [ { @@ -350,7 +359,7 @@ if ( $acl_edit_global ) { ), }, ], - } (qw( active suspended cancelled )) + } (qw( not_yet_billed active suspended cancelled )) ]; }; $align .= 'r'; #} -- cgit v1.2.1 From 942f129f37980d8a2a87be8c3297663ad38298ba Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 3 Nov 2010 00:33:24 +0000 Subject: bulk change package type, RT#9947 --- httemplate/browse/part_pkg.cgi | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'httemplate/browse') diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 3881606d9..26e01700a 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -32,6 +32,7 @@ my $acl_edit = $curuser->access_right($edit); my $acl_edit_global = $curuser->access_right($edit_global); my $acl_config = $curuser->access_right('Configuration'); #to edit services #and agent types + #and bulk change die "access denied" unless $acl_edit || $acl_edit_global; @@ -325,8 +326,8 @@ if ( $acl_edit_global ) { ); my $cust_pkg_link = $p. 'search/cust_pkg.cgi?pkgpart='; push @fields, sub { my $part_pkg = shift; - [ - map { + [ + map( { my $magic = $_; my $label = $_; if ( $magic eq 'active' && $part_pkg->freq == 0 ) { @@ -360,7 +361,23 @@ if ( $acl_edit_global ) { }, ], } (qw( not_yet_billed active suspended cancelled )) - ]; }; + ), + ($acl_config ? + [ {}, + { 'data' => '[ '. + include('/elements/popup_link.html', + 'label' => 'change', + 'action' => "${p}edit/bulk-cust_pkg.html?". + 'pkgpart='.$part_pkg->pkgpart, + 'actionlabel' => 'Change Packages', + 'width' => 569, + 'height' => 210, + ).' ]', + 'align' => 'left', + } + ] : () ), + ]; + }; $align .= 'r'; #} -- cgit v1.2.1