freeside/httemplate/search/elements search.html,1.3,1.4
ivan
ivan at pouncequick.420.am
Fri Apr 23 05:19:45 PDT 2004
Update of /home/cvs/cvsroot/freeside/httemplate/search/elements
In directory pouncequick:/tmp/cvs-serv28951/httemplate/search/elements
Modified Files:
search.html
Log Message:
credit report, add some links to sales/credits/receipts summary, move payment search to template
Index: search.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/elements/search.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- search.html 23 Apr 2004 02:32:38 -0000 1.3
+++ search.html 23 Apr 2004 12:19:40 -0000 1.4
@@ -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' ) { %>
More information about the freeside-commits
mailing list