summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorjeff <jeff>2009-06-21 15:21:32 +0000
committerjeff <jeff>2009-06-21 15:21:32 +0000
commit04a69f9d197efee6fa396bd35d04ae553e669978 (patch)
tree6a8ffd8be1f47991bbe8ee0be98e0a76c66fb934 /httemplate
parent5826159b3b1272f763b67f05a0cc3a53913f7912 (diff)
CUSTOM packages/actual flag for custom packages #3988
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/browse/agent_type.cgi4
-rwxr-xr-xhttemplate/browse/part_pkg.cgi14
-rwxr-xr-xhttemplate/edit/REAL_cust_pkg.cgi5
-rwxr-xr-xhttemplate/edit/agent_type.cgi2
-rw-r--r--httemplate/edit/cust_main/first_pkg/select-part_pkg.html4
-rwxr-xr-xhttemplate/edit/cust_pkg.cgi4
-rwxr-xr-xhttemplate/edit/part_bill_event.cgi2
-rwxr-xr-xhttemplate/edit/part_pkg.cgi12
-rw-r--r--httemplate/edit/reg_code.cgi2
-rwxr-xr-xhttemplate/misc/bulk_change_pkg.cgi5
-rwxr-xr-xhttemplate/misc/cancel_pkg.html2
-rw-r--r--httemplate/misc/cust_main-import.cgi2
-rwxr-xr-xhttemplate/misc/delay_susp_pkg.html2
-rw-r--r--httemplate/misc/meta-import.cgi2
-rwxr-xr-xhttemplate/search/cust_main.cgi5
-rwxr-xr-xhttemplate/search/cust_pkg.cgi2
-rw-r--r--httemplate/search/reg_code.html2
-rwxr-xr-xhttemplate/search/report_cust_pkg.html28
-rw-r--r--httemplate/view/cust_main/packages/package.html2
-rw-r--r--httemplate/view/cust_main/packages/status.html2
20 files changed, 66 insertions, 37 deletions
diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi
index d64ff186a..f07a6515b 100755
--- a/httemplate/browse/agent_type.cgi
+++ b/httemplate/browse/agent_type.cgi
@@ -44,7 +44,9 @@ my $agent_type = shift;
[
{
#'data' => $part_pkg->pkg. ' - '. $part_pkg->comment,
- 'data' => $type_pkgs->pkg. ' - '. $type_pkgs->comment,
+ 'data' => $type_pkgs->pkg. ' - '.
+ ( $type_pkgs->custom ? '(CUSTOM) ' : '' ).
+ $type_pkgs->comment,
'align' => 'left',
'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart,
},
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index 8c961b839..c6cbb81a3 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -4,11 +4,11 @@
'html_posttotal' => $html_posttotal,
'name' => 'package definitions',
'disableable' => 1,
- 'disabled_statuspos' => 3,
+ 'disabled_statuspos' => 4,
'agent_virt' => 1,
'agent_null_right' => [ $edit, $edit_global ],
'agent_null_right_link' => $edit_global,
- 'agent_pos' => 5,
+ 'agent_pos' => 6,
'query' => { 'select' => $select,
'table' => 'part_pkg',
'hashref' => \%hash,
@@ -164,10 +164,12 @@ $cgi->param('recurring', $cgi->param('recurring') ^ 1 ); #put it back
my $link = [ $p.'edit/part_pkg.cgi?', 'pkgpart' ];
-my @header = ( '#', 'Package', 'Comment' );
-my @fields = ( 'pkgpart', 'pkg', 'comment' );
-my $align = 'rll';
-my @links = ( $link, $link, '' );
+my @header = ( '#', 'Package', 'Comment', 'Custom' );
+my @fields = ( 'pkgpart', 'pkg', 'comment',
+ sub{ '<B><FONT COLOR="#0000CC">'.$_[0]->custom.'</FONT></B>' }
+ );
+my $align = 'rllc';
+my @links = ( $link, $link, '', '' );
unless ( 0 ) { #already showing only one class or something?
push @header, 'Class';
diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi
index b2c89c32c..a707aca8d 100755
--- a/httemplate/edit/REAL_cust_pkg.cgi
+++ b/httemplate/edit/REAL_cust_pkg.cgi
@@ -32,6 +32,11 @@
</TR>
<TR>
+ <TD ALIGN="right">Custom</TD>
+ <TD BGCOLOR="#ffffff"><% $part_pkg->custom %></TD>
+ </TR>
+
+ <TR>
<TD ALIGN="right">Comment</TD>
<TD BGCOLOR="#ffffff"><% $part_pkg->comment %></TD>
</TR>
diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi
index abf4bf89f..8a6fbc255 100755
--- a/httemplate/edit/agent_type.cgi
+++ b/httemplate/edit/agent_type.cgi
@@ -20,7 +20,7 @@ Select which packages agents of this type may sell to customers<BR>
'source_obj' => $agent_type,
'link_table' => 'type_pkgs',
'target_table' => 'part_pkg',
- 'name_callback' => sub { $_[0]->pkg. ' - '. $_[0]->comment; },
+ 'name_callback' => sub { $_[0]->pkg_comment(nopkgpart => 1); },
'target_link' => $p.'edit/part_pkg.cgi?',
'disable-able' => 1,
diff --git a/httemplate/edit/cust_main/first_pkg/select-part_pkg.html b/httemplate/edit/cust_main/first_pkg/select-part_pkg.html
index 1b62035b2..d2d862bea 100644
--- a/httemplate/edit/cust_main/first_pkg/select-part_pkg.html
+++ b/httemplate/edit/cust_main/first_pkg/select-part_pkg.html
@@ -141,9 +141,7 @@ foreach my $part_pkg ( @part_pkg ) {
my @options = ( '', map $pkgpart_svcpart{ $_->pkgpart }, @part_pkg );
my %labels = ( '' => '(none)',
- map { $pkgpart_svcpart{ $_->pkgpart }
- => $_->pkg. " - ". $_->comment
- }
+ map { $pkgpart_svcpart{ $_->pkgpart } => $_->pkg_comment }
@part_pkg
);
diff --git a/httemplate/edit/cust_pkg.cgi b/httemplate/edit/cust_pkg.cgi
index f927e1042..dd1ed335f 100755
--- a/httemplate/edit/cust_pkg.cgi
+++ b/httemplate/edit/cust_pkg.cgi
@@ -128,10 +128,10 @@ my %all_comment = ();
#}
foreach (qsearch('part_pkg', {} )) {
$all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
- $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+ $all_comment{ $_ -> getfield('pkgpart') } = $_->custom_comment;
next if $_->disabled;
$pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
- $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+ $comment{ $_ -> getfield('pkgpart') } = $_->custom_comment;
}
my($custnum, %remove_pkg);
diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi
index 3b5114122..ffd642bae 100755
--- a/httemplate/edit/part_bill_event.cgi
+++ b/httemplate/edit/part_bill_event.cgi
@@ -78,7 +78,7 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %>
% join("\n", map {
% '<OPTION VALUE="'. $_->pkgpart. '"'.
% ( $selected{$_->pkgpart} ? ' SELECTED' : '' ).
-% '>'. $_->pkg. ' - '. $_->comment
+% '>'. $_->pkg_comment
% } qsearch('part_pkg', { 'disabled' => '' } ) ).
% '</SELECT>';
%}
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 6391db92a..0934f501a 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -58,6 +58,8 @@
sub { shift->param('pkgnum') },
},
+ { field=>'custom', type=>'hidden' },
+
{ type => 'columnstart' },
{ field => 'pkg',
@@ -217,10 +219,7 @@ my $disabled_type = $acl_edit_either ? 'checkbox' : 'hidden';
my $agent_clone_extra_sql =
' ( '. FS::part_pkg->curuser_pkgs_sql.
- #kludge to clone custom customer packages you otherwise couldn't see
- #really need a proper "CUSTOM" flag that's distinct from disabled
- #" OR ( part_pkg.disabled = 'Y' AND part_pkg.comment LIKE '(CUSTOM)%' ) ".
- " OR ( part_pkg.disabled = 'Y' ) ".
+ " OR ( part_pkg.custom = 'Y' ) ".
' ) ';
my $conf = new FS::Conf;
@@ -339,9 +338,8 @@ my $clone_callback = sub {
$opt->{action} = 'Custom';
#my $part_pkg = $clone_part_pkg->clone;
- #this is all clone did anyway
- $object->comment( '(CUSTOM) '. $object->comment )
- unless $object->comment =~ /^\(CUSTOM\) /;
+ #this is all clone does anyway
+ $object->custom('Y');
$object->disabled('Y');
diff --git a/httemplate/edit/reg_code.cgi b/httemplate/edit/reg_code.cgi
index e57ac09bf..76790ab02 100644
--- a/httemplate/edit/reg_code.cgi
+++ b/httemplate/edit/reg_code.cgi
@@ -18,7 +18,7 @@ registration codes for <B><% $agent->agent %></B> allowing the following package
% my $pkgpart = $part_pkg->pkgpart;
<INPUT TYPE="checkbox" NAME="pkgpart<% $pkgpart %>" <% $cgi->param("pkgpart$pkgpart") ? 'CHECKED' : '' %>>
- <% $part_pkg->pkg %> - <% $part_pkg->comment %>
+ <% $part_pkg->pkg_comment %>
<BR>
% }
diff --git a/httemplate/misc/bulk_change_pkg.cgi b/httemplate/misc/bulk_change_pkg.cgi
index 93349859d..3bb677581 100755
--- a/httemplate/misc/bulk_change_pkg.cgi
+++ b/httemplate/misc/bulk_change_pkg.cgi
@@ -28,10 +28,7 @@
'table' => 'part_pkg',
'name_col' => 'pkg',
'empty_label' => 'Select package',
- 'label_callback' => sub { $_[0]->pkgpart. ': '.
- $_[0]->pkg. ' - '.
- $_[0]->comment;
- },
+ 'label_callback' => sub { $_[0]->pkg_comment },
'element_name' => 'new_pkgpart',
'curr_value' => ( $cgi->param('error')
? scalar($cgi->param('new_pkgpart'))
diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html
index e0e5fd1f8..1228eb1af 100755
--- a/httemplate/misc/cancel_pkg.html
+++ b/httemplate/misc/cancel_pkg.html
@@ -17,7 +17,7 @@
<BR><BR>
-<% ucfirst($method) . " $pkgnum: " .$part_pkg->pkg. ' - ' .$part_pkg->comment %>
+<% ucfirst($method) . $part_pkg->pkg_comment %>
<% ntable("#cccccc", 2) %>
% if ($method eq 'expire' || $method eq 'adjourn') {
diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi
index b822c5dab..9c1f98479 100644
--- a/httemplate/misc/cust_main-import.cgi
+++ b/httemplate/misc/cust_main-import.cgi
@@ -56,7 +56,7 @@ Import a file containing customer records.
<SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) {
- <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg. ' - '. $part_pkg->comment %></OPTION>
+ <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg_comment %></OPTION>
% }
</SELECT>
diff --git a/httemplate/misc/delay_susp_pkg.html b/httemplate/misc/delay_susp_pkg.html
index 1158a35c2..d4a6da18f 100755
--- a/httemplate/misc/delay_susp_pkg.html
+++ b/httemplate/misc/delay_susp_pkg.html
@@ -12,7 +12,7 @@
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
<BR><BR>
-<% "Delay automatic suspension of $pkgnum: " .$part_pkg->pkg. ' - ' .$part_pkg->comment %>
+<% "Delay automatic suspension of " .$part_pkg->pkg_comment %>
<% ntable("#cccccc", 2) %>
<TR>
diff --git a/httemplate/misc/meta-import.cgi b/httemplate/misc/meta-import.cgi
index 5b3470c06..8c158bd14 100644
--- a/httemplate/misc/meta-import.cgi
+++ b/httemplate/misc/meta-import.cgi
@@ -46,7 +46,7 @@ Import data from a DBI data source<BR><BR>
First package: <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) {
- <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg. ' - '. $part_pkg->comment %></OPTION>
+ <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg_comment %></OPTION>
% }
</SELECT><BR><BR>
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 658069b08..e65dc7117 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -485,8 +485,7 @@
%# my $part_pkg = qsearchs( 'part_pkg', { pkgpart => $_->pkgpart } );
% my $part_pkg = $_->part_pkg;
%
-% my $pkg = $part_pkg->pkg;
-% my $comment = $part_pkg->comment;
+% my $pkg_comment = $part_pkg->pkg_comment(nopkgpart => 1);
% my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/
% ? ''
% : ';show=packages';
@@ -496,7 +495,7 @@
% #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } );
% my $rowspan = scalar(@cust_svc) || 1;
%
-% print $n1, qq!<TD CLASS="grid" BGCOLOR="$bgcolor" ROWSPAN=$rowspan><A HREF="$pkgview"><FONT SIZE=-1>$pkg - $comment</FONT></A></TD>!;
+% print $n1, qq!<TD CLASS="grid" BGCOLOR="$bgcolor" ROWSPAN=$rowspan><A HREF="$pkgview"><FONT SIZE=-1>$pkg_comment</FONT></A></TD>!;
%
% my($n2)='';
% foreach my $cust_svc ( @cust_svc ) {
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index 2a702801c..13d0c7af8 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -161,7 +161,7 @@ my $money_char = $conf->config('money_char') || '$';
$search_hash{'query'} = $cgi->keywords;
- for my $param (qw(agentnum magic status classnum pkgpart)) {
+ for my $param (qw(agentnum magic status classnum pkgpart custom)) {
$search_hash{$param} = $cgi->param($param)
if $cgi->param($param);
}
diff --git a/httemplate/search/reg_code.html b/httemplate/search/reg_code.html
index f65b00d05..f7d6d2061 100644
--- a/httemplate/search/reg_code.html
+++ b/httemplate/search/reg_code.html
@@ -13,7 +13,7 @@
sub {
map {
qq!<A HREF="${p}edit/part_pkg.cgi?!. $_->pkgpart. '">'.
- $_->pkg. ' - '. $_->comment.
+ $_->pkg_comment(nopkgpart => 1).
'</A><BR>'
} $_[0]->part_pkg
},
diff --git a/httemplate/search/report_cust_pkg.html b/httemplate/search/report_cust_pkg.html
index b5d2d8b79..3840663cf 100755
--- a/httemplate/search/report_cust_pkg.html
+++ b/httemplate/search/report_cust_pkg.html
@@ -89,6 +89,34 @@
% }
+ <SCRIPT TYPE="text/javascript">
+
+ function custom_changed(what) {
+
+ if ( what.checked ) {
+
+ what.form.pkgpart.disabled = true;
+ what.form.pkgpart.style.backgroundColor = '#dddddd';
+
+ } else {
+
+ what.form.pkgpart.disabled = false;
+ what.form.pkgpart.style.backgroundColor = '#ffffff';
+
+ }
+
+ }
+
+ </SCRIPT>
+
+ <% include( '/elements/tr-checkbox.html',
+ 'label' => 'Custom packages',
+ 'field' => 'custom',
+ 'value' => 1,
+ 'onchange' => 'custom_changed(this);',
+ )
+ %>
+
<% include( '/elements/tr-selectmultiple-part_pkg.html' ) %>
<TR>
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 5edbb4d59..280a01682 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -6,7 +6,7 @@
ID ="cust_pkg<% $cust_pkg->pkgnum %>"
><% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B></A>
-
- <% $part_pkg->comment |h %>
+ <% $part_pkg->custom_comment |h %>
</TD>
</TR>
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index af407b0df..141ed156d 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -244,7 +244,7 @@ sub pkg_status_row_changed {
if ( $old ) {
my $part_pkg = $old->part_pkg;
my $label = 'Changed from '. $cust_pkg->change_pkgnum. ': '.
- $part_pkg->pkg. ' - '. $part_pkg->comment;
+ $part_pkg->pkg_comment(nopartpkg => 1);
$html .= pkg_status_row_colspan( $label, '', size=>'-1', align=>'right' );
}
$html;