[freeside-commits] freeside/httemplate/elements tr-select-payby.html, NONE, 1.1 select-payby.html, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Sat Mar 1 14:23:22 PST 2008
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv5122
Added Files:
tr-select-payby.html select-payby.html
Log Message:
add payby selection to adv. customer search
--- NEW FILE: select-payby.html ---
<SELECT NAME="<% $opt{'field'} || 'payby' %>"
<% $opt{'multiple'} ? 'MULTIPLE' : '' %>
<% $onchange %>
>
% unless ( $opt{'multiple'} ) {
<OPTION VALUE="" <% '' eq $value ? 'SELECTED' : '' %> >all
% }
% foreach my $option ( keys %{ $opt{'paybys'} } ) {
% my $sel = ( ref($value) && $value->{$option} ) || $option eq $value;
<OPTION VALUE="<% $option %>"
<% $sel ? 'SELECTED' : '' %>
><% $opt{'paybys'}->{$option} %>
% }
</SELECT>
<%init>
my %opt = @_;
my $method = 'payby';
$method = 'cust_payby' if $opt{'payby_type'} eq 'cust';
#$method = 'event_payby' if $opt{'payby_type'} eq 'event';
#$method = 'pay_payby' if $opt{'payby_type'} eq 'pay';
unless ( $opt{'paybys'} ) {
tie %{ $opt{'paybys'} }, 'Tie::IxHash', FS::payby->$method();
}
my $onchange = $opt{'onchange'}
? 'onChange="'. $opt{'onchange'}. '(this)"'
: '';
my $value = $opt{'curr_value'} || $opt{'value'};
</%init>
--- NEW FILE: tr-select-payby.html ---
<% include ('tr-td-label.html', 'label' => 'Payment type', @_ ) %>
<TD <% $style %>>
<% include( '/elements/select-payby.html',
'curr_value' => $curr_value,
%opt
)
%>
</TD>
</TR>
<%init>
my %opt = @_;
#my $onchange = $opt{'onchange'}
# ? 'onChange="'. $opt{'onchange'}. '(this)"'
# : '';
my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
my $method = 'payby2longname';
$method = 'cust_payby2longname' if $opt{'payby_type'} eq 'cust';
#$method = 'event_payby2longname' if $opt{'payby_type'} eq 'event';
#$method = 'pay_payby2longname' if $opt{'payby_type'} eq 'pay';
unless ( $opt{'paybys'} ) {
tie %{ $opt{'paybys'} }, 'Tie::IxHash', FS::payby->$method();
}
my $curr_value = $opt{'curr_value'} || $opt{'value'};
</%init>
More information about the freeside-commits
mailing list