1 % if ( ($curuser->access_right('Edit customer tags') && @part_tag) || $is_report ) {
4 <TH ALIGN="right"><% $opt{'label'} || 'Tags' %></TD>
6 <% include( '/elements/select-cust_tag.html',
15 % foreach my $tagnum (@curr_tagnum) {
16 <INPUT TYPE="hidden" NAME="tagnum" VALUE="<% $tagnum %>">
22 my $curuser = $FS::CurrentUser::CurrentUser;
25 my $cgi = $opt{'cgi'};
26 my $is_report = $opt{'is_report'};
29 if ( $cgi && $cgi->param('tagnum') ) {
30 @curr_tagnum = $cgi->param('tagnum');
31 } elsif ( $opt{'custnum'} ) {
32 @curr_tagnum = map $_->tagnum,
33 qsearch('cust_tag', { 'custnum' => $opt{'custnum'} } );
36 my $extra_sql = "WHERE disabled IS NULL OR disabled = '' ";
37 $extra_sql .= ' OR tagnum IN ('. join(',', @curr_tagnum). ')' if @curr_tagnum;
39 #now kind of inefficient (we only want to know if there are any), but since
40 # its an edit control its not significant
41 my @part_tag = qsearch({
42 'table' => 'part_tag',
44 'extra_sql' => $extra_sql,