[freeside-commits] freeside/httemplate/edit REAL_cust_pkg.cgi, 1.18, 1.19 agent_type.cgi, 1.18, 1.19 cust_pkg.cgi, 1.15, 1.16 part_bill_event.cgi, 1.49, 1.50 part_pkg.cgi, 1.108, 1.109 reg_code.cgi, 1.6, 1.7

Jeff Finucane,420,, jeff at wavetail.420.am
Sun Jun 21 08:21:33 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv32471/httemplate/edit

Modified Files:
	REAL_cust_pkg.cgi agent_type.cgi cust_pkg.cgi 
	part_bill_event.cgi part_pkg.cgi reg_code.cgi 
Log Message:
CUSTOM packages/actual flag for custom packages #3988

Index: agent_type.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/agent_type.cgi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- agent_type.cgi	13 Jan 2008 21:35:52 -0000	1.18
+++ agent_type.cgi	21 Jun 2009 15:21:30 -0000	1.19
@@ -20,7 +20,7 @@
               '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,
 

Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_pkg.cgi,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- part_pkg.cgi	18 Jun 2009 11:03:34 -0000	1.108
+++ part_pkg.cgi	21 Jun 2009 15:21:31 -0000	1.109
@@ -58,6 +58,8 @@
                                 sub { shift->param('pkgnum') },
                             },
 
+                            { field=>'custom',  type=>'hidden' },
+
                             { type => 'columnstart' },
                             
                               { field     => 'pkg',
@@ -217,10 +219,7 @@
 
 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 @@
     $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');
 

Index: REAL_cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/REAL_cust_pkg.cgi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- REAL_cust_pkg.cgi	1 Jul 2008 05:03:41 -0000	1.18
+++ REAL_cust_pkg.cgi	21 Jun 2009 15:21:30 -0000	1.19
@@ -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>

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_pkg.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cust_pkg.cgi	4 Mar 2008 19:15:05 -0000	1.15
+++ cust_pkg.cgi	21 Jun 2009 15:21:30 -0000	1.16
@@ -128,10 +128,10 @@
 #}
 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);

Index: part_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_bill_event.cgi,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- part_bill_event.cgi	26 Sep 2008 03:54:25 -0000	1.49
+++ part_bill_event.cgi	21 Jun 2009 15:21:30 -0000	1.50
@@ -78,7 +78,7 @@
 %  join("\n", map {
 %    '<OPTION VALUE="'. $_->pkgpart. '"'.
 %    ( $selected{$_->pkgpart} ? ' SELECTED' : '' ).
-%    '>'. $_->pkg. ' - '. $_->comment
+%    '>'. $_->pkg_comment
 %  } qsearch('part_pkg', { 'disabled' => '' } ) ).
 %  '</SELECT>';
 %}

Index: reg_code.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/reg_code.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- reg_code.cgi	13 Jan 2008 21:35:52 -0000	1.6
+++ reg_code.cgi	21 Jun 2009 15:21:31 -0000	1.7
@@ -18,7 +18,7 @@
 %   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>
 
 % } 



More information about the freeside-commits mailing list