[freeside-commits] branch FREESIDE_3_BRANCH updated. 150a188ede4c1c325aac6420184e5bf746d27ff4

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


The branch, FREESIDE_3_BRANCH has been updated
       via  150a188ede4c1c325aac6420184e5bf746d27ff4 (commit)
      from  4cd40172ccbfce9cfa49bff5a6338f3c6c978f4b (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 150a188ede4c1c325aac6420184e5bf746d27ff4
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jun 4 03:30:24 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