summaryrefslogtreecommitdiff
path: root/httemplate/edit
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/edit
parent5826159b3b1272f763b67f05a0cc3a53913f7912 (diff)
CUSTOM packages/actual flag for custom packages #3988
Diffstat (limited to 'httemplate/edit')
-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
7 files changed, 16 insertions, 15 deletions
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>
% }