1 <& elements/search.html,
2 'title' => $part_svc->svc.' services in package #'.$pkgnum,
4 'html_form' => $html_form,
6 'count_query' => $count_query,
12 'fields' => [ 'svcnum',
18 '<INPUT TYPE="checkbox" NAME="svcnum" VALUE='.$_[0]->svcnum.'>'
32 'html_foot' => sub { $areboxes ? $html_foot : '' }
38 unless $FS::CurrentUser::CurrentUser->access_right('List services');
40 my $pkgnum = $cgi->param('pkgnum');
41 $pkgnum =~ /^(\d+)$/ or die "invalid pkgnum: $pkgnum";
42 my @extra_sql = ( "cust_svc.pkgnum = $pkgnum" );
44 my $svcpart = $cgi->param('svcpart');
45 $svcpart =~ /^(\d+)$/ or die "invalid svcpart: $svcpart";
46 push @extra_sql, "cust_svc.svcpart = $svcpart";
47 my $part_svc = qsearchs('part_svc', {svcpart => $svcpart});
48 my $svcdb = $part_svc->svcdb;
50 my $orderby = 'ORDER BY svcnum'; #others?
52 my $addl_from = " LEFT JOIN part_svc USING (svcpart)
53 LEFT JOIN cust_pkg USING (pkgnum)
54 LEFT JOIN cust_main USING (custnum)
55 INNER JOIN $svcdb USING (svcnum)";
58 if ( length( $cgi->param('search_svc') ) ) {
60 $search_string = $cgi->param('search_svc');
61 $search_string =~ s/(^\s+|\s+$)//;
62 push @extra_sql, "FS::$svcdb"->search_sql($search_string);
66 #here is the agent virtualization
67 push @extra_sql, $FS::CurrentUser::CurrentUser->agentnums_sql(
68 'null_right' => 'View/link unlinked services'
71 my $extra_sql = ' WHERE '. join(' AND ', @extra_sql );
74 'select' => join(', ',
78 'table' => 'cust_svc',
79 'addl_from' => $addl_from,
81 'extra_sql' => $extra_sql,
82 'order_by' => $orderby,
85 #warn Dumper($sql_query)."\n";
87 my $count_query = "SELECT COUNT(*) FROM cust_svc $addl_from $extra_sql";
101 <SCRIPT TYPE="text/javascript">
102 function areyousure(obj) {
103 return confirm('Permanently delete the selected services?');
106 <FORM METHOD="POST" ACTION="${p}misc/unprovision.cgi" onsubmit="return areyousure()">!;
112 <INPUT TYPE="submit" NAME="submit" VALUE="Unprovision selected">
113 <INPUT TYPE="hidden" NAME="pkgnum" VALUE=$pkgnum>
114 <INPUT TYPE="hidden" NAME="svcpart" VALUE=$svcpart>