[freeside-commits] branch FREESIDE_3_BRANCH updated. 4cd40172ccbfce9cfa49bff5a6338f3c6c978f4b

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


The branch, FREESIDE_3_BRANCH has been updated
       via  4cd40172ccbfce9cfa49bff5a6338f3c6c978f4b (commit)
      from  206197352809cdbb78134c1e59905f05a2bfca69 (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 4cd40172ccbfce9cfa49bff5a6338f3c6c978f4b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jun 4 03:23:27 2013 -0700

    move services between packages, RT#22619

diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 4753d31..d7e5a17 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -160,6 +160,7 @@ tie my %rights, 'Tie::IxHash',
     'View customer services', #NEW
     'Provision customer service',
     'Bulk provision customer service',
+    'Bulk move customer services', #NEWNEW
     'Recharge customer service', #NEW
     'Unprovision customer service',
     'Change customer service', #NEWNEW
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 42b4b8f..4e16459 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5085,13 +5085,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'maestro-status_test',
-    'section'     => 'UI',
-    'description' => 'Display a link to the maestro status test page on the customer view page',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'cust_main-custom_link',
     'section'     => 'UI',
     'description' => 'URL to use as source for the "Custom" tab in the View Customer page.  The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere.  "$agentnum" will be replaced with the agent number, and "$usernum" will be replaced with the employee number.',
diff --git a/FS/FS/XMLRPC.pm b/FS/FS/XMLRPC.pm
index 73ce13f..62ae43d 100644
--- a/FS/FS/XMLRPC.pm
+++ b/FS/FS/XMLRPC.pm
@@ -11,8 +11,6 @@ use FS::Conf;
 use FS::Record;
 use FS::cust_main;
 
-use FS::Maestro;
-
 use Data::Dumper;
 
 $DEBUG = 0;
diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index a42d7f2..f8e30d0 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -234,6 +234,7 @@ sub _upgrade_data { # class method
                            ],
     'Change customer package' => 'Detach customer package',
     'Services: Accounts' => 'Services: Cable Subscribers',
+    'Bulk change customer packages' => 'Bulk move customer services',
 ;
 
   foreach my $old_acl ( keys %onetime ) {
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index c49007c..425fe68 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -3191,6 +3191,46 @@ sub transfer {
   return $remaining;
 }
 
+=item grab_svcnums SVCNUM, SVCNUM ...
+
+Change the pkgnum for the provided services to this packages.  If there is an
+error, returns the error, otherwise returns false.
+
+=cut
+
+sub grab_svcnums {
+  my $self = shift;
+  my @svcnum = @_;
+
+  local $SIG{HUP} = 'IGNORE';
+  local $SIG{INT} = 'IGNORE';
+  local $SIG{QUIT} = 'IGNORE';
+  local $SIG{TERM} = 'IGNORE';
+  local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
+
+  my $oldAutoCommit = $FS::UID::AutoCommit;
+  local $FS::UID::AutoCommit = 0;
+  my $dbh = dbh;
+
+  foreach my $svcnum (@svcnum) {
+    my $cust_svc = qsearchs('cust_svc', { svcnum=>$svcnum } ) or do {
+      $dbh->rollback if $oldAutoCommit;
+      return "unknown svcnum $svcnum";
+    };
+    $cust_svc->pkgnum( $self->pkgnum );
+    my $error = $cust_svc->replace;
+    if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
+      return $error;
+    }
+  }
+
+  $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+  '';
+
+}
+
 =item reexport
 
 This method is deprecated.  See the I<depend_jobnum> option to the insert and
diff --git a/httemplate/edit/bulk-cust_svc-pkgnum.html b/httemplate/edit/bulk-cust_svc-pkgnum.html
new file mode 100644
index 0000000..a343729
--- /dev/null
+++ b/httemplate/edit/bulk-cust_svc-pkgnum.html
@@ -0,0 +1,47 @@
+<& /elements/header-popup.html, 'Move services' &>
+
+Select the target package and the services to be moved.<BR><BR>
+
+<FORM ACTION="<%$p%>edit/process/bulk-cust_svc-pkgnum.html" METHOD=POST>
+
+<& /view/cust_main/packages.html, $cust_main,
+     no_links            => 1,
+     before_pkg_callback => sub {
+       my $cust_pkg = shift;
+       '<INPUT TYPE="radio" NAME="pkgnum" VALUE="'. $cust_pkg->pkgnum. '">';
+     },
+     before_svc_callback => sub {
+       my $cust_svc = shift;
+       my $nameid = 'svcnum'. $cust_svc->svcnum;
+       '<TABLE CELLSPACING=0 CELLPADDING=0><TR><TD>'.
+       qq( <INPUT TYPE="checkbox" NAME="$nameid" ID="$nameid" VALUE="1"> ).
+       '</TD><TD> </TD><TD>';
+     },
+     after_svc_callback => sub {
+       #my $cust_svc = shift;
+       '</TD></TR></TABLE>';
+     },
+&>
+
+<BR>
+<INPUT TYPE="submit" VALUE="Move services">
+
+</FORM>
+
+  </BODY>
+</HTML>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+die "access denied" unless $curuser->access_right('Bulk move customer services');
+
+$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
+my $custnum = $1;
+
+my $cust_main = qsearchs({
+  'table'     => 'cust_main',
+  'hashref'   => { 'custnum' => $custnum },
+  'extra_sql' => ' AND '. $curuser->agentnums_sql,
+}) or die 'unknown customer';
+
+</%init>
diff --git a/httemplate/elements/tr-cust_svc.html b/httemplate/elements/tr-cust_svc.html
index b66654f..3710b27 100644
--- a/httemplate/elements/tr-cust_svc.html
+++ b/httemplate/elements/tr-cust_svc.html
@@ -15,20 +15,35 @@ Usage:
                 'manage_link'               => '', #for svc_broadband
                 'manage_link_text'          => '', #default 'Manage Device'
                 'manage_link_loc'           => '', #default 'bottom', or 'right'
-                'maestro-status_test'       => '',
             )
   %>
 
 </%doc>
 <TR>
-  <TD ALIGN="right" VALIGN="top"><% 
-FS::UI::Web::svc_link($m, $part_svc, $cust_svc)
-%></TD>
-  <TD STYLE="padding-bottom:0px"><B><% $cust_svc->agent_svcid ? $cust_svc->agent_svcid.': ' : '' %><%
-FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
-%></B></TD>
+  <TD ALIGN="right" VALIGN="top">
+%   if ( $opt{no_links} ) {
+      <% $part_svc->svc |h %>:
+%   } else {
+      <% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %>
+%   }
+  </TD>
+  <TD STYLE="padding-bottom:0px" VALIGN="top">
+%   if ( $opt{before_svc_callback} ) {
+      <% &{ $opt{before_svc_callback} }( $cust_svc ) %>
+%   }
+    <B><% $cust_svc->agent_svcid ? $cust_svc->agent_svcid.': ' : '' %>
+%   if ( $opt{no_links} ) {
+      <% ($cust_svc->label)[1] |h %>
+%   } else {
+      <% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %>
+%   }
+    </B>
+%   if ( $opt{after_svc_callback} ) {
+      <% &{ $opt{after_svc_callback} }( $cust_svc ) %>
+%   }
+  </TD>
 <TD ALIGN="right"><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %>
-%   if ( $manage_link and $opt{'manage_link_loc'} eq 'right' ) {
+%   if ( $manage_link and $opt{'manage_link_loc'} eq 'right' && ! $opt{no_links} ) {
       <A HREF="<% $manage_link %>" <% $manage_target %>><% $opt{'manage_link_text'} |h %></A>
 % }
 </TD>
@@ -49,6 +64,7 @@ $cust_svc->overlimit )
   <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
 % if ( $curuser->access_right('Recharge customer service') 
 %     && $part_svc->svcdb eq 'svc_acct'
+%     && ! $opt{no_links}
 %     && ( $svc_x->seconds ne '' 
 %       || $svc_x->upbytes ne ''
 %       || $svc_x->downbytes ne ''
@@ -60,22 +76,18 @@ $cust_svc->overlimit )
   </TD>
 % # second column: all other action links
   <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
-% if ( $part_svc->svcdb eq 'svc_broadband' ) {
+% if ( $part_svc->svcdb eq 'svc_broadband' && ! $opt{no_links} ) {
     <FONT SIZE="-2">( <%
       include('/elements/popup_link-ping.html',
               'ip' => $svc_x->ip_addr
       ) %> )</FONT>
-%   if ( $manage_link and $opt{'manage_link_loc'} eq 'bottom' ) {
+%   if ( $manage_link and $opt{'manage_link_loc'} eq 'bottom' && ! $opt{no_links} ) {
       <FONT SIZE="-2">( <A HREF="<% $manage_link %>" <% $manage_target %>><% $opt{'manage_link_text'} |h %></A> )</FONT>
 %   }
 % } #svc_broadband
-% if ( $curuser->access_right('Unprovision customer service') ) {
+% if ( $curuser->access_right('Unprovision customer service') && ! $opt{no_links} ) {
     <FONT SIZE="-2">( <% $svc_unprovision_link %> )</FONT>
 % }
-% if ( $part_svc->svcdb eq 'svc_pbx' && $opt{'maestro-status_test'} ) {
-    <FONT SIZE="-2">( <A HREF="<%$p%>misc/maestro-customer_status-test.html?<% $cust_pkg->custnum.'+'.$cust_svc->svcnum %>">Test maestro status</A> )
-    </FONT>
-% }
   </TD>
 </TR>
 
diff --git a/httemplate/elements/tr-cust_svc_cancel.html b/httemplate/elements/tr-cust_svc_cancel.html
index e7fa47a..44276ec 100644
--- a/httemplate/elements/tr-cust_svc_cancel.html
+++ b/httemplate/elements/tr-cust_svc_cancel.html
@@ -3,12 +3,20 @@ tr-cust_svc_cancel - Short display of a canceled customer service
 for use in view/cust_main.
 </%doc>
 <TR STYLE="color:#cccccc;">
-  <TD ALIGN="right" VALIGN="top"><% 
-FS::UI::Web::svc_link($m, $part_svc, $cust_svc)
-%></TD>
-  <TD STYLE="padding-bottom:0px;"><B><%
-FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
-%></B></TD>
+  <TD ALIGN="right" VALIGN="top">
+%   if ( $opt{no_links} ) {
+      <% $part_svc->svc |h %>:
+%   } else {
+      <% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %>
+%   }
+  </TD>
+  <TD STYLE="padding-bottom:0px;"><B>
+%   if ( $opt{no_links} ) {
+      <% ($cust_svc->label)[1] |h %>
+%   } else {
+      <% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %>
+%   }
+  </B></TD>
 </TR>
 %# no action links, the service is canceled
 
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index be0100f..1f9e0f9 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -162,11 +162,6 @@ function areyousure(href, message) {
   <BR><BR>
 % } 
 
-%if ( $conf->exists('maestro-status_test') ) {
-  <A HREF="<% $p %>misc/maestro-customer_status-test.html?<% $custnum %>"><% mt('Test maestro status') |h %></A>
-  <BR><BR>
-% } 
-
 <A NAME="cust_main"></A>
 <TABLE BORDER=0>
 <TR>
diff --git a/httemplate/view/cust_main/locations.html b/httemplate/view/cust_main/locations.html
index 689c9a3..7eb52ca 100755
--- a/httemplate/view/cust_main/locations.html
+++ b/httemplate/view/cust_main/locations.html
@@ -28,15 +28,19 @@ STYLE="padding-bottom: 0px;
 %   }
 <% $loc->location_label %></SPAN>
 <SPAN STYLE="float:right;">
-% if ( $locationnum and !$loc->disabled ) {
+% if ( $locationnum && !$loc->disabled && ! $opt{no_links} ) {
 <% edit_location_link($locationnum) %>
 % }
-% if ( $locationnum and !$loc->disabled and !$active{$locationnum} ) {
+% if ( $locationnum && !$loc->disabled && !$active{$locationnum} && ! $opt{no_links} ) {
  <% disable_location_link($locationnum) %>
 % }
 </SPAN></TH></TR>
 %   if (@$packages) {
-<& packages/section.html, 'packages' => $packages, 'cust_main' => $cust_main &>
+      <& packages/section.html,
+           'packages'  => $packages,
+           'cust_main' => $cust_main,
+           'no_links'  => $opt{no_links}
+      &>
 %   }
 </TABLE><BR>
 % } #foreach $locationnum
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 546dd89..e32fe4c 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -24,7 +24,10 @@ table.usage {
 .row1 { background-color: #ffffff; }
 
 </STYLE>
-% my $s = 0;
+
+% unless ( $opt{no_links} ) {
+
+%   my $s = 0;
 
 % if ( $curuser->access_right('Qualify service') ) { 
   <% $s++ ? ' | ' : '' %>
@@ -43,21 +46,33 @@ table.usage {
   <& one_time_charge_link.html, $cust_main &>
 % } 
 
+% if ( $curuser->access_right('Bulk move customer services') ) { 
+  <% $s++ ? ' | ' : '' %>
+
+  <& /elements/popup_link-cust_main.html,
+               'label'       => emt('Move services between packages'),
+               'action'      => "${p}edit/bulk-cust_svc-pkgnum.html",
+               'cust_main'   => $cust_main,
+               'actionlabel' => emt('Move services'),
+               'width'       => 968, #763,
+               'height'      => 575,
+  &>
+
+% } 
+
 % if ( $curuser->access_right('Bulk change customer packages') ) { 
   <% $s++ ? ' | ' : '' %>
-  <A HREF="<% $p %>edit/cust_pkg.cgi?<% $cust_main->custnum %>"><% mt('Bulk order and cancel packages') |h %></A> (<% mt('preserves services') |h %>)
+  <A HREF="<% $p %>edit/cust_pkg.cgi?<% $cust_main->custnum %>"><% mt('Bulk order and cancel packages') |h %></A>
 % } 
 
 <BR><BR>
 
+% } # unless $opt{no_links}
+
 <TABLE>
   <TR>
     <TD ALIGN="left" VALIGN="top">
 
-% if ( @$packages ) {
-
-<% mt('Current packages') |h %> 
-% } 
 % if ( $cust_main->num_cancelled_pkgs ) {
 %     if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me
 %          || ( $conf->exists('hidecancelledpackages')
@@ -86,6 +101,9 @@ table.usage {
 % }
 
     </TD>
+
+%   unless ( $opt{no_links} ) {
+
     <TD ALIGN="right">
       <A HREF="<%$p%>search/report_cust_pkg.html?custnum=<% $cust_main->custnum %>"><% mt('Package reports') |h %></A>
 % if ( $curuser->access_right('Qualify service') ) { 
@@ -97,6 +115,9 @@ table.usage {
       <% mt('Usage reports:') |h %> 
         <A HREF="<%$p%>search/report_cdr.html?custnum=<% $cust_main->custnum %>"><% mt('CDRs') |h %></A>
     </TD>
+
+%   } # unless $opt{no_links}
+
   </TR>
 
   <TR>
@@ -105,6 +126,7 @@ table.usage {
 <& locations.html,
     'cust_main'     => $cust_main,
     'packages'      => $packages,
+    %opt,
  &>
 % }
 % else {
@@ -113,6 +135,7 @@ table.usage {
 <& packages/section.html,
     'cust_main'     => $cust_main,
     'packages'      => $packages,
+    %opt,
  &>
 </TABLE>
 % }
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
index fe8b715..93985e4 100644
--- a/httemplate/view/cust_main/packages/contact.html
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -1,16 +1,16 @@
 % if ( $contact ) {
     <% $contact->line |h %>
-% if ( $show_change_link ) {
+% if ( $show_change_link && ! $opt{no_links} ) {
         <FONT SIZE=-1>
           ( <%pkg_change_contact_link($cust_pkg)%> )
         </FONT>
 % }
-% if ( $show_detach_link ) {
+% if ( $show_detach_link && ! $opt{no_links} ) {
         <FONT SIZE=-1>
           ( <%pkg_detach_link($cust_pkg)%> )
         </FONT>
 %    }
-% } elsif ( $show_contact_link ) {
+% } elsif ( $show_contact_link && ! $opt{no_links} ) {
     <FONT SIZE=-1>
       ( <%pkg_add_contact_link($cust_pkg)%> )
     </FONT>
diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html
index f2d3798..470fad0 100644
--- a/httemplate/view/cust_main/packages/location.html
+++ b/httemplate/view/cust_main/packages/location.html
@@ -32,8 +32,10 @@
 % {
   <BR>
   <FONT SIZE=-1>
-    ( <%pkg_change_location_link($cust_pkg)%> )
-%   if ( $cust_pkg->locationnum ) {
+%   unless ( $opt{no_links} ) {
+      ( <%pkg_change_location_link($cust_pkg)%> )
+%   }
+%   if ( $cust_pkg->locationnum && ! $opt{no_links} ) {
         ( <%edit_location_link($cust_pkg->locationnum)%> )
 %   }
   </FONT>
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 520305a..5b9c530 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -3,6 +3,10 @@
   <TABLE CLASS="inv package"> 
     <TR>
       <TD COLSPAN=2>
+        <% $opt{before_pkg_callback}
+             ? &{ $opt{before_pkg_callback} }( $cust_pkg )
+             : ''
+        %>
         <A NAME="cust_pkg<% $cust_pkg->pkgnum %>"
            ID  ="cust_pkg<% $cust_pkg->pkgnum %>"
         ><% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B></A>
@@ -24,7 +28,7 @@
       <TD COLSPAN=2>
         <FONT SIZE=-1>
 
-%         unless ( $cust_pkg->get('cancel') ) {
+%         unless ( $cust_pkg->get('cancel') || $opt{no_links} ) {
 %
 %           if ( $supplemental or $part_pkg->freq eq '0' ) {
 %             # Supplemental packages can't be changed independently.
@@ -99,7 +103,7 @@
                 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
                   <FONT SIZE="-1">
                     <% mt('Invoice details') |h %> 
-%                   if ( $editi && ! $cust_pkg->get('cancel') ) {
+%                   if ( $editi && ! $cust_pkg->get('cancel') && ! $opt{no_links} ) {
                       (<& /elements/popup_link.html, { 
                                     'action'      => $editlink. 'I',
                                     'label'       => emt('edit'),
@@ -121,7 +125,7 @@
           </TD>
 %       } else {
           <TD>
-%           if ( $editi && ! $cust_pkg->get('cancel') ) {
+%           if ( $editi && ! $cust_pkg->get('cancel') && ! $opt{no_links} ) {
               <FONT SIZE="-1">
                 ( <% include('/elements/popup_link.html', { 
                                'action'      => $editlink. 'I',
@@ -143,7 +147,7 @@
                 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
                   <FONT SIZE="-1">
                     <% mt('Comments') |h %> 
-%                   if ( $editc ) {
+%                   if ( $editc && ! $opt{no_links} ) {
                       (<& /elements/popup_link.html, { 
                                     'action'      => $editlink. 'C',
                                     'label'       => emt('edit'),
@@ -165,7 +169,7 @@
           </TD>
 %       } else {
           <TD>
-%           if ( $editc ) {
+%           if ( $editc && ! $opt{no_links} ) {
               <FONT SIZE="-1">
                 ( <& /elements/popup_link.html, { 
                                'action'      => $editlink. 'C',
@@ -181,10 +185,13 @@
 %       }
 
       </TR>
-%     if ( $curuser->access_right('Change customer package') and 
-%           !$cust_pkg->get('cancel') and
-%           !$supplemental and
-%           $part_pkg->freq ne '0' ) {
+%     if ( $curuser->access_right('Change customer package')
+%            && ! $cust_pkg->get('cancel')
+%            && ! $supplemental
+%            && $part_pkg->freq ne '0'
+%            && ! $opt{no_links}
+%        )
+%     {
       <TR>
 %       if ( FS::Conf->new->exists('invoice-unitprice') ) {
         <TD><FONT SIZE="-1">
diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html
index 391a13b..82d0620 100755
--- a/httemplate/view/cust_main/packages/section.html
+++ b/httemplate/view/cust_main/packages/section.html
@@ -10,8 +10,10 @@
 % #$FS::cust_pkg::DEBUG = 2;
 %   foreach my $cust_pkg (@$packages) {
     <& .packagerow, $cust_pkg,
-        'cust_main' => $opt{'cust_main'},
-        'bgcolor'   => $opt{'bgcolor'},
+        ( map { $_ => $opt{$_} } qw(
+            cust_main bgcolor
+            no_links before_pkg_callback before_svc_callback after_svc_callback
+        )),
         %conf_opt
     &>
 %   }
@@ -92,7 +94,6 @@ my %conf_opt = (
   'manage_link_text'          => scalar($conf->config('svc_broadband-manage_link_text')),
   'manage_link_loc'           => scalar($conf->config('svc_broadband-manage_link_loc')),
   'manage_link-new_window'    => $conf->exists('svc_broadband-manage_link-new_window'),
-  'maestro-status_test'       => $conf->exists('maestro-status_test'),
   'cust_pkg-large_pkg_size'   => scalar($conf->config('cust_pkg-large_pkg_size')),
 
 );
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index c0213e9..ed360cc 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -36,7 +36,7 @@
       <TR>
         <TD COLSPAN=<%$opt{colspan}%>>
           <FONT SIZE=-1>
-%           if ( $curuser->access_right('Un-cancel customer package') ) { 
+%           if ( $curuser->access_right('Un-cancel customer package') && ! $opt{no_links} ) { 
               ( <% pkg_uncancel_link($cust_pkg) %> )
 %           } 
           <FONT>
@@ -79,7 +79,7 @@
     <% pkg_status_row_if( $cust_pkg, emt('Expires'), 'expire', %opt, curuser=>$curuser ) %>
     <% pkg_status_row_if( $cust_pkg, emt('Contract ends'), 'contract_end', %opt ) %>
 
-% if ( !$supplemental ) {
+% if ( !$supplemental && ! $opt{no_links} ) {
       <TR>
         <TD COLSPAN=<%$opt{colspan}%>>
           <FONT SIZE=-1>
@@ -117,7 +117,7 @@
 
           <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
 
-%         if (!$supplemental) {
+%         if ( !$supplemental && ! $opt{no_links} ) {
           <TR>
             <TD COLSPAN=<%$opt{colspan}%>>
               <FONT SIZE=-1>
@@ -210,7 +210,7 @@
       <% pkg_status_row_if( $cust_pkg, emt('Expires'), 'expire', %opt, curuser=>$curuser ) %>
       <% pkg_status_row_if( $cust_pkg, emt('Contract ends'), 'contract_end', %opt ) %>
 
-%     if ( $part_pkg->freq and !$supplemental ) { 
+%     if ( $part_pkg->freq and !$supplemental && ! $opt{no_links} ) { 
 
         <TR>
           <TD COLSPAN=<%$opt{colspan}%>>

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

Summary of changes:
 FS/FS/AccessRight.pm                             |    1 +
 FS/FS/Conf.pm                                    |    7 ---
 FS/FS/XMLRPC.pm                                  |    2 -
 FS/FS/access_right.pm                            |    1 +
 FS/FS/cust_pkg.pm                                |   40 ++++++++++++++++++
 httemplate/edit/bulk-cust_svc-pkgnum.html        |   47 ++++++++++++++++++++++
 httemplate/elements/tr-cust_svc.html             |   42 ++++++++++++-------
 httemplate/elements/tr-cust_svc_cancel.html      |   20 ++++++---
 httemplate/view/cust_main.cgi                    |    5 --
 httemplate/view/cust_main/locations.html         |   10 +++-
 httemplate/view/cust_main/packages.html          |   35 +++++++++++++---
 httemplate/view/cust_main/packages/contact.html  |    6 +-
 httemplate/view/cust_main/packages/location.html |    6 ++-
 httemplate/view/cust_main/packages/package.html  |   25 +++++++----
 httemplate/view/cust_main/packages/section.html  |    7 ++-
 httemplate/view/cust_main/packages/status.html   |    8 ++--
 16 files changed, 197 insertions(+), 65 deletions(-)
 create mode 100644 httemplate/edit/bulk-cust_svc-pkgnum.html




More information about the freeside-commits mailing list