[freeside-commits] freeside/httemplate/view/cust_main/packages package.html, 1.1, 1.2 location.html, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Sat Jan 10 15:57:01 PST 2009


Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main/packages
In directory wavetail.420.am:/tmp/cvs-serv3185/httemplate/view/cust_main/packages

Modified Files:
	package.html location.html 
Log Message:
implement package changes w/location change, RT#4499

Index: package.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/packages/package.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- package.html	8 Jan 2009 01:45:22 -0000	1.1
+++ package.html	10 Jan 2009 23:56:59 -0000	1.2
@@ -184,12 +184,14 @@
 }
 
 sub pkg_change_link {
+  my $cust_pkg = shift;
+  my $locationnum = $cust_pkg->locationnum;
   include( '/elements/popup_link-cust_pkg.html',
-             'action'      => $p. 'misc/change_pkg.cgi?dummy=value',
-             'label'       => 'Change package',
-             'actionlabel' => 'Change',
-             'cust_pkg'    => shift,
-         )
+    'action'      => $p. "misc/change_pkg.cgi?locationnum=$locationnum",
+    'label'       => 'Change package',
+    'actionlabel' => 'Change',
+    'cust_pkg'    => $cust_pkg,
+  );
 }
 
 sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); }

Index: location.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/packages/location.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- location.html	9 Jan 2009 04:06:26 -0000	1.2
+++ location.html	10 Jan 2009 23:56:59 -0000	1.3
@@ -19,17 +19,40 @@
 
   </I>
 
+% if ($FS::CurrentUser::CurrentUser->access_right('Change customer package')) {
+  <FONT SIZE=-1>
+    (&nbsp;<%pkg_change_location_link($cust_pkg)%>&nbsp;)
+  </FONT>
+% } 
+
 </TD>
 <%init>
 
 my %opt = @_;
 
+my $conf = new FS::Conf;
+
 my $bgcolor        = $opt{'bgcolor'};
 my $cust_pkg       = $opt{'cust_pkg'};
 my $part_pkg       = $opt{'part_pkg'};
 my $conf           = new FS::Conf;
 my $countrydefault = $conf->config('countrydefault') || 'US';
+my $statedefault   = $conf->config('statedefault')
+                     || ($countrydefault eq 'US' ? 'CA' : '');
 
 my $loc = $cust_pkg->cust_location_or_main;
 
+sub pkg_change_location_link {
+  my $cust_pkg = shift;
+  my $pkgpart = $cust_pkg->pkgpart;
+  include( '/elements/popup_link-cust_pkg.html',
+    'action'      => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
+                     "address1=;address2=;city=;county=;state=$statedefault;".
+                     "zip=;country=$countrydefault",
+    'label'       => 'Change&nbsp;location',
+    'actionlabel' => 'Change',
+    'cust_pkg'    => $cust_pkg,
+  );
+}
+
 </%init>



More information about the freeside-commits mailing list