Bug 7977: Followup patch addressing items pointed out by Jonathan Druart
authorChris Nighswonger <cnighswonger@foundations.edu>
Fri, 11 May 2012 00:57:33 +0000 (20:57 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 24 May 2012 12:14:53 +0000 (14:14 +0200)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt
koha-tmpl/opac-tmpl/prog/en/css/opac.css
tools/quotes/quotes_ajax.pl

index 1518290..996a1b2 100644 (file)
@@ -1,14 +1,14 @@
     [% INCLUDE 'doc-head-open.inc' %]
     <title>Koha &rsaquo; Tools &rsaquo; Quote uploader</title>
     [% INCLUDE 'doc-head-close.inc' %]
-    <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/uploader.css" />
-    <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
-    <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/quotes.css" />
-    <script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/uploader.css" />
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/quotes.css" />
+    <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
     [% INCLUDE 'datatables-strings.inc' %]
     </script>
-    <script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
-    <script type="text/javascript" src="/intranet-tmpl/prog/en/js/jquery.jeditable.mini.js"></script>
+    <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+    <script type="text/javascript" src="[% themelang %]/js/jquery.jeditable.mini.js"></script>
     <script type="text/javascript">
     //<![CDATA[
     var oTable; //DataTable object
index 51e11b6..269a099 100644 (file)
@@ -12,7 +12,7 @@
     <script type="text/javascript">
     //<![CDATA[
     var oTable; /* oTable needs to be global */
-    var sEmptyTable = _('No quotes available. Please use the \"Add Quote\" button to add a quote.'); /* override the default message in datatables-strings.inc */
+    var sEmptyTable = _('No quotes available. Please use the "Add Quote" button to add a quote.'); /* override the default message in datatables-strings.inc */
     $(document).ready(function() {
         /* NOTE: This is an ajax-source datatable and *not* a server-side sourced datatable. */
         /* See the datatable docs if you don't understand this difference. */
@@ -41,6 +41,7 @@
                         $(nRow).attr("id", quoteID); /* set row ids to quote id */
                         $('td:eq(0)', nRow).click(function() {$(this.parentNode).toggleClass('selected',this.clicked);}); /* add row selectors */
                         $('td:eq(0)', nRow).attr("title", _("Click ID to select/deselect quote"));
+                        $('td', nRow).attr("id",quoteID); /* FIXME: this is a bit of a hack */
                         if (isNaN(quoteID)) {
                             noEditFields = [0,1,2,3]; /* all fields when adding a quote */
                         }
                         <th>Source</th>
                         <th>Text</th>
                         <th>Last Displayed</th>
-<!--                        <th>Actions</th>-->
                     </tr>
                 </thead>
                 <tbody>
                         <td></td>
                         <td>Loading data...</td>
                         <td></td>
-<!--                        <td></td>-->
                     </tr>
                 </tbody>
                 </table>
index f0f9fac..2b350de 100644 (file)
@@ -2414,7 +2414,6 @@ span.sep {
     margin-right: 2px;
     width: 300px;
     text-align: center;
-    font-family: "Georgia","Palatino","Times New Roman",sans-serif;
 }
 
 #daily-quote h1 {
index eb54550..bcc4f2e 100755 (executable)
@@ -69,6 +69,8 @@ elsif ($params->{'action'} eq 'edit') {
         warn sprintf('Database returned the following error: %s', $sth->errstr);
         exit 0;
     }
+    $sth = $dbh->prepare("SELECT $editable_columns->[$params->{'column'}-1] FROM quotes WHERE id = ?;");
+    $sth->execute($params->{'id'});
     print $sth->fetchrow_array();
     exit 1;
 }
@@ -88,8 +90,7 @@ else {
 
     if (my $filter = $params->{'sSearch'}) {
         # This seems a bit brute force and ungraceful, but it provides a very general, simple search on all fields
-        my $like = " id LIKE \"%$filter%\" OR source LIKE \"%$filter%\" OR text LIKE \"%$filter%\" OR timestamp LIKE \"%$filter%\"";
-        $iTotalRecords = $dbh->selectrow_array("SELECT count(*) FROM quotes WHERE $like;");
+        $iTotalRecords = $dbh->selectrow_array("SELECT count(*) FROM quotes WHERE id LIKE %?% OR source LIKE %?% OR text LIKE %?% OR timestamp LIKE %?%;",undef,($filter, $filter, $filter, $filter));
         $sth = $dbh->prepare("SELECT * FROM quotes;");
     }
     else {