[freeside-commits] branch master updated. 5c6ae08373b08615c7ab9ffbb98eada0cfd2878f

Ivan ivan at 420.am
Tue Jun 4 03:30:23 PDT 2013


The branch, master has been updated
       via  5c6ae08373b08615c7ab9ffbb98eada0cfd2878f (commit)
      from  05eb6fd62056682d8760b85ced91dabd33357a3b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5c6ae08373b08615c7ab9ffbb98eada0cfd2878f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jun 4 03:30:20 2013 -0700

    move services between packages, RT#22619

diff --git a/httemplate/edit/process/bulk-cust_svc-pkgnum.html b/httemplate/edit/process/bulk-cust_svc-pkgnum.html
new file mode 100644
index 0000000..5936cc6
--- /dev/null
+++ b/httemplate/edit/process/bulk-cust_svc-pkgnum.html
@@ -0,0 +1,39 @@
+% if ($error) {
+%   #$cgi->param('error', $error);
+%   #$cgi->redirect(popurl(3). 'misc/detach_pkg.html?'. $cgi->query_string );
+%   #XXX actually redirect back and display the error instead
+%   errorpage($error);
+% } else {
+
+    <% header(emt("Services moved")) %>
+      <SCRIPT TYPE="text/javascript">
+        window.top.location.reload();
+      </SCRIPT>
+    </BODY>
+    </HTML>
+
+% }
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+die "access denied" unless $curuser->access_right('Bulk move customer services');
+
+$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'illegal pkgnum';
+my $pkgnum = $1;
+
+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';
+
+my @svcnum = ();
+foreach my $param (grep /^svcnum\d+$/, $cgi->param) {
+  $param =~ /^svcnum(\d+)$/ or die "guru meditation #309";
+  push @svcnum, $1 if $cgi->param($param);
+}
+
+my $error = $cust_pkg->grab_svcnums(@svcnum);
+
+</%init>
diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html
index c0a56d0..7dfc004 100644
--- a/httemplate/view/cust_main/packages/services.html
+++ b/httemplate/view/cust_main/packages/services.html
@@ -24,7 +24,7 @@ function clearhint_search_cust_svc(obj, str) {
         <TD ALIGN="right" VALIGN="top">
 %       my $href="${p}search/cust_pkg_svc.html?svcpart=".$part_svc->svcpart.
 %          ";pkgnum=".$cust_pkg->pkgnum;
-        <A HREF="<% $href %>"><% $part_svc->svc %></A>
+        <A HREF="<% $href %>"><% $part_svc->svc |h %></A>
         </TD>
         <TD ALIGN="left" VALIGN="top">
         <A HREF="<% $href %>"><B>(<% mt("view all [_1]", $num_cust_svc) |h %>)</B></A>
@@ -74,9 +74,21 @@ function clearhint_search_cust_svc(obj, str) {
 
       <TR>
         <TD COLSPAN=3 ALIGN="center" STYLE="padding-bottom:4px;padding-top:0px">
-          <B><% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %></B>
+
+          <B>
+%         if ( $opt{no_links} ) {
+            <% $part_svc->svc |h %>: <% $part_svc->num_avail %>
+            <% mt('Available') |h %>
+%         } else {
+            <% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %>
+%         }
+          </B>
+
 %        if ( $curuser->access_right('Bulk provision customer service') 
-%               && $part_svc->svcdb eq 'svc_phone' ) {
+%               && $part_svc->svcdb eq 'svc_phone'
+%               && ! $opt{no_links}
+%           )
+%        {
 %          if ( $part_svc->num_avail > 5 ) {
 %             local $opt{'bulk'} = 1;
               <BR><% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/edit/process/bulk-cust_svc-pkgnum.html |   39 +++++++++++++++++++++
 httemplate/view/cust_main/packages/services.html  |   18 ++++++++--
 2 files changed, 54 insertions(+), 3 deletions(-)
 create mode 100644 httemplate/edit/process/bulk-cust_svc-pkgnum.html




More information about the freeside-commits mailing list