diff options
author | cvs2git <cvs2git> | 2010-11-05 19:05:57 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-11-05 19:05:57 +0000 |
commit | aaf8baf3662e16e9414de236a39f8801a8c41b01 (patch) | |
tree | 2cda603e4311b3e80f79b93d9bcce3a7c7c2d053 /httemplate/browse | |
parent | 995a145c931164347683071c95c6754379d36604 (diff) | |
parent | 9b2de4257b6a2877434008188e52b8ef71ff339d (diff) |
This commit was manufactured by cvs2svn to create branch
'FREESIDE_2_1_BRANCH'.
Diffstat (limited to 'httemplate/browse')
-rw-r--r-- | httemplate/browse/acct_snarf.html | 78 | ||||
-rw-r--r-- | httemplate/browse/cgp_rule.html | 3 | ||||
-rw-r--r-- | httemplate/browse/msg_template.html | 2 | ||||
-rw-r--r-- | httemplate/browse/part_event.html | 2 | ||||
-rwxr-xr-x | httemplate/browse/part_pkg.cgi | 59 |
5 files changed, 137 insertions, 7 deletions
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(<A HREF="$view">View this $svc_label</A><BR><BR>). + qq!<A HREF="${p}edit/acct_snarf.html?svcnum=$svcnum">Add new remote POP account</A><BR>!. + '<BR>'. + qq! + <SCRIPT> + function areyousure_delete(href) { + areyousure(href,"Are you sure you want to delete this remote POP account?"); + } + function areyousure(href,message) { + if (confirm(message) == true) + window.location.href = href; + } + </SCRIPT> +!; + +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')", '' ]; +}; + +</%init> 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!<A HREF="${p}misc/clone-cgp_rule.html?clone=$t_svcnum;svcnum=$svcnum">! ."Add $t_name rule</A><BR>"; 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' ], 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 .= '<OPTION VALUE="'. $part_event->eventpart. '">'. - $part_event->event. '</OPTION>'; + $part_event->eventpart. ': '. $part_event->event. '</OPTION>'; } $html_init .= '</SELECT><INPUT TYPE="submit" VALUE="Clone existing event">'. diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 42eb5dfcb..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; @@ -96,6 +97,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, @@ -195,6 +203,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 +249,28 @@ push @fields, sub { } $part_pkg->bill_part_pkg_link ), + ( scalar(@discounts) + ? [ + { data => '<b>Discounts</b>', + align=>'center', #? + colspan=>2, + } + ] + : () + ), + ( scalar(@discounts) + ? map { + [ + { data => $_->months. ':', + align => 'right', + }, + { data => $_->amount ? '$'. $_->amount : $_->percent. '%' + } + ] + } + @discounts + : () + ), ]; # $plan_labels{$part_pkg->plan}.'<BR>'. @@ -284,6 +317,7 @@ if ( $acl_edit_global ) { #if ( $cgi->param('active') ) { push @header, 'Customer<BR>packages'; my %col = ( + 'not yet billed' => '009999', #teal? cyan? 'active' => '00CC00', 'suspended' => 'FF9900', 'cancelled' => 'FF0000', @@ -292,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 ) { @@ -301,6 +335,7 @@ if ( $acl_edit_global ) { #$label = 'one-time charge', $label = 'charge', } + $label= 'not yet billed' if $magic eq 'not_yet_billed'; [ { @@ -325,8 +360,24 @@ if ( $acl_edit_global ) { ), }, ], - } (qw( active suspended cancelled )) - ]; }; + } (qw( not_yet_billed active suspended cancelled )) + ), + ($acl_config ? + [ {}, + { 'data' => '<FONT SIZE="-1">[ '. + 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, + ).' ]</FONT>', + 'align' => 'left', + } + ] : () ), + ]; + }; $align .= 'r'; #} |