[freeside-commits] freeside/httemplate/search/elements search.html, 1.28, 1.28.2.1
Ivan,,,
ivan at wavetail.420.am
Sun Nov 25 18:19:56 PST 2007
Update of /home/cvs/cvsroot/freeside/httemplate/search/elements
In directory wavetail:/tmp/cvs-serv27608
Modified Files:
Tag: FREESIDE_1_7_BRANCH
search.html
Log Message:
add a "printable copy" link to searches to get full results as printable HTML without other cruft, closes: #1885
Index: search.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/elements/search.html,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -d -r1.28 -r1.28.2.1
--- search.html 22 Dec 2006 06:18:21 -0000 1.28
+++ search.html 26 Nov 2007 02:19:54 -0000 1.28.2.1
@@ -1,658 +1,749 @@
-% # options example...
-% # (everything not commented required is optional)
-% #
-% # # basic options, required
-% # 'title' => 'Page title',
-% #
-% # 'name_singular' => 'item', #singular name for the records returned
-% # #OR# # (preferred, will be pluralized automatically)
-% # 'name' => 'items', #plural name for the records returned
-% # # (deprecated, will be singularlized
-% # # simplisticly)
[...1275 lines suppressed...]
+ 'select' => $opt{'query'}->{'select'},
+ 'table' => $opt{'query'}->{'table'},
+ 'addl_from' => (exists($opt{'query'}->{'addl_from'}) ? $opt{'query'}->{'addl_from'} : ''),
+ 'hashref' => $opt{'query'}->{'hashref'} || {},
+ 'extra_sql' => $opt{'query'}->{'extra_sql'},
+ 'order_by' => $opt{'query'}->{'order_by'}. " $limit",
+ }) ];
+} else {
+ my $sth = dbh->prepare("$opt{'query'} $limit")
+ or die "Error preparing $opt{'query'}: ". dbh->errstr;
+ $sth->execute
+ or die "Error executing $opt{'query'}: ". $sth->errstr;
+
+ #can get # of rows without fetching them all?
+ $rows = $sth->fetchall_arrayref;
+
+ $header ||= $sth->{NAME};
+}
+
+</%init>
More information about the freeside-commits
mailing list