+ my $text = '';
+ my $curuser = $FS::CurrentUser::CurrentUser;
+
+ if ( $curuser->access_right('Bulk change customer packages') ) {
+ $text .= include('/elements/init_overlib.html').
+ include( '/elements/popup_link.html',
+ 'label' => emt('Change these packages'),
+ 'action' => "${p}misc/bulk_change_pkg.cgi?$query",
+ 'actionlabel' => emt('Change Packages'),
+ 'width' => 569,
+ 'height' => 210,
+ ). '<BR>';
+
+ $text .= include( '/elements/popup_link.html',
+ 'label' => emt('Suspend these packages'),
+ 'action' => "${p}misc/bulk_suspend_pkg.cgi?$query",
+ 'actionlabel' => emt('Suspend Packages'),
+ 'width' => 569,
+ 'height' => 210,
+ ). '<BR>' if $search_hash{status} eq 'active';
+
+ $text .= include( '/elements/popup_link.html',
+ 'label' => emt('Unsuspend these packages'),
+ 'action' => "${p}misc/bulk_unsuspend_pkg.cgi?$query",
+ 'actionlabel' => emt('Unsuspend Packages'),
+ 'width' => 569,
+ 'height' => 210,
+ ). '<BR>' if $search_hash{status} eq 'suspended';
+
+ if ( $curuser->access_right('Edit customer package dates') ) {
+ $text .= include( '/elements/popup_link.html',
+ 'label' => emt('Increment next bill date'),
+ 'action' => "${p}misc/bulk_pkg_increment_bill.cgi?$query",
+ 'actionlabel' => emt('Increment Bill Date'),
+ 'width' => 569,
+ 'height' => 210,
+ ). '<BR>';
+ }
+ $text .= include( '/elements/email-link.html',
+ 'search_hash' => \%search_hash,
+ 'table' => 'cust_pkg',
+ ). '<BR><BR>';
+ }
+ return $text;
+};