[freeside-commits] freeside/httemplate/misc change_pkg.cgi, 1.9, 1.10
Ivan,,,
ivan at wavetail.420.am
Sat Jan 10 15:57:00 PST 2009
- Previous message: [freeside-commits] freeside/FS/FS cust_main.pm, 1.397, 1.398 Schema.pm, 1.119, 1.120 Conf.pm, 1.258, 1.259 cust_pkg.pm, 1.107, 1.108
- Next message: [freeside-commits] freeside/httemplate/edit/process change-cust_pkg.html, NONE, 1.1 cust_pkg.cgi, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv3185/httemplate/misc
Modified Files:
change_pkg.cgi
Log Message:
implement package changes w/location change, RT#4499
Index: change_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/change_pkg.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- change_pkg.cgi 4 Mar 2008 19:15:05 -0000 1.9
+++ change_pkg.cgi 10 Jan 2009 23:56:57 -0000 1.10
@@ -2,35 +2,37 @@
<% include('/elements/error.html') %>
-<FORM ACTION="<% $p %>edit/process/cust_pkg.cgi" METHOD=POST>
-<INPUT TYPE="hidden" NAME="action" VALUE="change">
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
-<INPUT TYPE="hidden" NAME="remove_pkg" VALUE="<% $pkgnum %>">
+<FORM ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
+<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
<% ntable('#cccccc') %>
<TR>
- <TD>Current package: </TD>
- <TD>
- <B><% $part_pkg->pkgpart %>: <% $part_pkg->pkg %> - <% $part_pkg->comment %></B>
+ <TH ALIGN="right">Current package</TH>
+ <TD COLSPAN=7>
+ <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
</TD>
</TR>
<TR>
- <TD>New package: </TD>
- <TD><% include('/elements/select-cust-part_pkg.html',
- 'cust_main' => $cust_main,
- 'element_name' => 'new_pkgpart',
- 'extra_sql' => ' AND pkgpart != '. $cust_pkg->pkgpart,
- 'curr_value' => ( $cgi->param('error')
- ? scalar($cgi->param('new_pkgpart'))
- : ''
- ),
- )
- %>
+ <TH ALIGN="right">New package</TH>
+ <TD COLSPAN=7>
+ <% include('/elements/select-cust-part_pkg.html',
+ 'cust_main' => $cust_main,
+ 'element_name' => 'pkgpart',
+ #'extra_sql' => ' AND pkgpart != '. $cust_pkg->pkgpart,
+ 'curr_value' => scalar($cgi->param('pkgpart')),
+ )
+ %>
</TD>
</TR>
+ <% include('/elements/tr-select-cust_location.html',
+ 'cgi' => $cgi,
+ 'cust_main' => $cust_main,
+ )
+ %>
+
</TABLE>
<BR>
@@ -42,28 +44,28 @@
<%init>
+my $conf = new FS::Conf;
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Change customer package');
+ unless $curuser->access_right('Change customer package');
-my $pkgnum;
-if ( $cgi->param('error') ) {
- $pkgnum = ($cgi->param('remove_pkg'))[0];
-} else {
- $pkgnum = $cgi->param('pkgnum');
-}
+my $pkgnum = scalar($cgi->param('pkgnum'));
$pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum";
$pkgnum = $1;
-my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } )
- or die "unknown pkgnum $pkgnum";
-my $custnum = $cust_pkg->custnum;
-
-my $conf = new FS::Conf;
+my $cust_pkg =
+ qsearchs({
+ 'table' => 'cust_pkg',
+ 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
+ 'hashref' => { 'pkgnum' => $pkgnum },
+ 'extra_sql' => ' AND '. $curuser->agentnums_sql,
+ }) or die "unknown pkgnum $pkgnum";
my $cust_main = $cust_pkg->cust_main
or die "can't get cust_main record for custnum ". $cust_pkg->custnum.
" ( pkgnum ". cust_pkg->pkgnum. ")";
-my $agent = $cust_main->agent;
my $part_pkg = $cust_pkg->part_pkg;
- Previous message: [freeside-commits] freeside/FS/FS cust_main.pm, 1.397, 1.398 Schema.pm, 1.119, 1.120 Conf.pm, 1.258, 1.259 cust_pkg.pm, 1.107, 1.108
- Next message: [freeside-commits] freeside/httemplate/edit/process change-cust_pkg.html, NONE, 1.1 cust_pkg.cgi, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list