summaryrefslogtreecommitdiff
path: root/httemplate/search/elements
diff options
context:
space:
mode:
authorivan <ivan>2004-04-23 12:19:40 +0000
committerivan <ivan>2004-04-23 12:19:40 +0000
commit87227cd405166484ca7b791b2bd3c8829ce8d969 (patch)
treeb838747ae5773879bb023b6b39ae904a3f29fefb /httemplate/search/elements
parent5cd995865b91204f7ce9233a8ba4d5eee62f9be4 (diff)
credit report, add some links to sales/credits/receipts summary, move payment search to template
Diffstat (limited to 'httemplate/search/elements')
-rw-r--r--httemplate/search/elements/search.html17
1 files changed, 12 insertions, 5 deletions
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 37a3718ce..226c4f784 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -50,11 +50,11 @@
$header ||= $sth->{NAME};
}
- if ( exists($opt{'redirect'}) && scalar(@$rows) == 1 ) {
+ if ( exists($opt{'redirect'}) && scalar(@$rows) == 1 && $total == 1 ) {
my( $url, $method ) = @{$opt{'redirect'}};
redirect( $url. $rows->[0]->$method() );
} else {
-
+ $opt{'name'} =~ s/s$// if $total == 1;
%>
<%= include( '/elements/header.html', $opt{'title'},
include( '/elements/menubar.html', 'Main menu' => $p )
@@ -87,9 +87,16 @@
<% foreach my $field ( @{$opt{'fields'}} ) { %>
<% my $a = ''; %>
<% if ( $links ) {
- my( $url, $method ) = @{shift @$links};
- $a = $url. $row->$method();
- $a = qq(<A HREF="$a">);
+ my $link = shift @$links;
+ if ( $link ) {
+ my( $url, $method ) = @{$link};
+ if ( ref($method) eq 'CODE' ) {
+ $a = $url. &{$method}($row);
+ } else {
+ $a = $url. $row->$method();
+ }
+ $a = qq(<A HREF="$a">);
+ }
}
%>
<% if ( ref($field) eq 'CODE' ) { %>