[freeside-commits] freeside/httemplate/search/elements search.html, 1.30, 1.31

Ivan,,, ivan at wavetail.420.am
Sun Nov 25 18:19:51 PST 2007


Update of /home/cvs/cvsroot/freeside/httemplate/search/elements
In directory wavetail:/tmp/cvs-serv27597

Modified Files:
	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.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- search.html	23 Sep 2007 19:18:31 -0000	1.30
+++ search.html	26 Nov 2007 02:19:49 -0000	1.31
@@ -1,704 +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)
[...1322 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