[freeside-commits] freeside/httemplate/elements tr-select-cust_tag.html, NONE, 1.1 select-cust_tag.html, NONE, 1.1

Ivan,,, ivan at wavetail.420.am
Fri Jul 16 16:45:26 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv17937/httemplate/elements

Added Files:
	tr-select-cust_tag.html select-cust_tag.html 
Log Message:
customer tags, RT#9192

--- NEW FILE: tr-select-cust_tag.html ---
% if ( $curuser->access_right('Edit customer tags') && @part_tag ) {

  <TR>
    <TD ALIGN="right"><% $opt{'label'} || 'Tags' %></TD>
    <TD>
      <% include( '/elements/select-cust_tag.html',
                     'curr_value' => \@curr_tagnum,
                     'part_tag'   => \@part_tag,
                     %opt,
                 )
      %>
    </TD>
  </TR>

% } else {

%   foreach my $tagnum (@curr_tagnum) {
      <INPUT TYPE="hidden" NAME="tagnum" VALUE="<% $tagnum %>">
%   }

% }
<%init>

my $curuser = $FS::CurrentUser::CurrentUser;

my %opt = @_;
my $cgi = $opt{'cgi'};

my @curr_tagnum = ();
if ( $cgi->param('error') ) {
  @curr_tagnum = $cgi->param('tagnum');
} elsif ( $opt{'custnum'} ) {
  @curr_tagnum = map $_->tagnum,
                     qsearch('cust_tag', { 'custnum' => $opt{'custnum'} } );
}

my $extra_sql = "WHERE disabled IS NULL OR disabled = '' ";
$extra_sql .= ' OR tagnum IN ('. join(',', @curr_tagnum). ')' if @curr_tagnum;

my @part_tag = qsearch({
  'table'     => 'part_tag',
  'hashref'   => {},
  'extra_sql' => $extra_sql,
});

</%init>

--- NEW FILE: select-cust_tag.html ---
<% include( '/elements/select-table.html',
                 'table'         => 'part_tag',
                 'name_col'      => 'tagname', #tagname - tagdesc??
                 'multiple'      => 1,
                 #'value'         => $agentnum || '',
                 #'agent_virt'    => 1,
                 'hashref'       => { 'disabled' => '' },
                 'order_by'      => ' ORDER BY tagname',
                 %opt,
             )
%>
<%init>

my %opt = @_;
#my $agentnum = $opt{'curr_value'} || $opt{'value'};

$opt{'records'} = delete $opt{'part_tag'}
  if $opt{'part_tag'};

</%init>



More information about the freeside-commits mailing list