% if ( exists($opt{'redirect'}) && $opt{'redirect'}
% && scalar(@$rows) == 1 && $total == 1
% && $type ne 'html-print'
% ) {
% my $redirect = $opt{'redirect'};
% $redirect = &{$redirect}($rows->[0], $cgi) if ref($redirect) eq 'CODE';
% my( $url, $method ) = @$redirect;
% redirect( $url. $rows->[0]->$method() );
% } elsif ( exists($opt{'redirect_empty'}) && ! scalar(@$rows) && $total == 0
% && $type ne 'html-print'
% && $opt{'redirect_empty'}
% && ( ref($opt{'redirect_empty'}) ne 'CODE'
% || &{$opt{'redirect_empty'}}($cgi) )
% ) {
% my $redirect = $opt{'redirect_empty'};
% $redirect = &{$redirect}($cgi) if ref($redirect) eq 'CODE';
% redirect( $redirect );
% } else {
% if ( $opt{'name_singular'} ) {
% $opt{'name'} = PL($opt{'name_singular'});
% }
% ( my $xlsname = $opt{'name'} ) =~ s/\W//g;
% if ( $total == 1 ) {
% if ( $opt{'name_singular'} ) {
% $opt{'name'} = $opt{'name_singular'}
% } else {
% #$opt{'name'} =~ s/s$// if $total == 1;
% $opt{'name'} =~ s/((s)e)?s$/$2/ if $total == 1;
% }
% }
%
% unless ( $opt{nohtmlheader} ) {
%
% if ( $type eq 'html-print' ) {
<& /elements/header-popup.html, $opt{'title'} &>
% } else {
% if ( $type eq 'select' ) {
<&/elements/header-popup.html, $opt{'title'} &>
% } else {
%
% my @menubar = ();
% if ( $opt{'menubar'} ) {
% @menubar = @{ $opt{'menubar'} };
% #} else {
% # @menubar = ( 'Main menu' => $p );
% }
<& /elements/header.html, $opt{'title'},
include( '/elements/menubar.html', @menubar )
&>
% }
% }
%
% }
%
% unless ( $type eq 'html-print' ) {
% if ( $opt{'add_link'} ) { #or after html_init?
Add a <% $opt{'name_singular'} %>
% }
<% defined($opt{'html_init'})
? ( ref($opt{'html_init'})
? &{$opt{'html_init'}}()
: $opt{'html_init'}
)
: ''
%>
% }
% unless ( $total ) {
% unless ( $opt{'disable_nonefound'} ) {
No matching <% $opt{'name'} %> found.
% }
% }
%
% if ( $total || $opt{'disableable'} ) { #hmm... and there *are* ones to show??
% if ( $curuser->access_right('Download report data') % and !$opt{'disable_download'} % and $type ne 'html-print' ) { % $cgi->param('_type', "html" ); % } | |
% my $pager = ''; % unless ( $type eq 'html_print' ) { <% $pager = include( '/elements/pager.html', 'offset' => $offset, 'num_rows' => scalar(@$rows), 'total' => $total, 'maxrecords' => $maxrecords, ) %> <% defined($opt{'html_form'}) ? ( ref($opt{'html_form'}) ? &{$opt{'html_form'}}() : $opt{'html_form'} ) : '' %> % } <& SELF:data_table, rows => $rows, null_link => $null_link, link_agentnums => \@link_agentnums, self_url => $self_url, %opt &> <% $pager %> |