[Koha-patches] [PATCH] Bug 12147 [Alternate] Column width for action links on invoices too small

Owen Leonard oleonard at myacpl.org
Mon May 5 21:33:11 CEST 2014


This alternative patch groups "action" links into a menu as was done
with Bug 11763.

This patch also converts the date column sorting configuration to use
header class instead of an index.

This patch also corrects a couple of HTML markup errors: An
improperly-closed <input> and an improperly closed <option>.

To test, view the invoices page and confirm that the "Actions" menu
button works corectly. Test the functionality of each menu options:
Details, Close, Reopen, and Delete. Confirm that sorting by billing date
still works correctly.
---
 .../prog/en/modules/acqui/invoices.tt              |   41 +++++++++++---------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
index 7bfef8c..94efdf2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
@@ -11,14 +11,10 @@
 $(document).ready(function() {
     var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
         sDom: "t",
-        bPaginate: false,
-        bInfo: false,
-        "aoColumns": [
-            null,null,null,{ "sType": "title-string" },null,null,null,null
-        ],
         aoColumnDefs: [
             { "bSortable": false, "aTargets": [1, 8] },
-            { "bVisible": false, "aTargets": [0] }
+            { "bVisible": false, "aTargets": [0] },
+            { "sType": "title-string", "aTargets" : [ "title-string" ] }
         ]
     }));
 
@@ -110,7 +106,7 @@ $(document).ready(function() {
                 <th> </th>
                 <th>Invoice no.</th>
                 <th>Vendor</th>
-                <th>Billing date</th>
+                <th class="title-string">Billing date</th>
                 <th>Received biblios</th>
                 <th>Received items</th>
                 <th>Status</th>
@@ -121,7 +117,7 @@ $(document).ready(function() {
               [% FOREACH invoice IN invoices %]
                 <tr data-invoiceid="[% invoice.invoiceid %]" data-booksellerid="[% invoice.booksellerid %]" data-shipmentdate="[% invoice.shipmentdate | $KohaDates %]" data-billingdate="[% invoice.billingdate | $KohaDates %]" data-shipmentcost="[% invoice.shipmentcost %]" data-shipment_budgetid="[% invoice.shipmentcost_budgetid %]" data-closedate="[% invoice.closedate | $KohaDates %]">
                   <td>[% invoice.is_linked_to_subscriptions %]</td>
-                  <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]"></input></td>
+                  <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]" /></td>
                   <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
                   <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
                   <td>
@@ -141,15 +137,23 @@ $(document).ready(function() {
                     [% END %]
                   </td>
                   <td>
-                    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">Details</a> /
-                    [% IF invoice.closedate %]
-                      <a href="invoice.pl?op=reopen&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Reopen</a>
-                    [% ELSE %]
-                      <a href="invoice.pl?op=close&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Close</a>
-                    [% END %]
-                    [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
-                      / <a href="invoice.pl?op=delete&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Delete</a>
-                    [% END %]
+
+                      <div class="dropdown dropup">
+                          <a class="btn btn-mini dropdown-toggle" id="invoiceactions[% invoice.invoiceid %]" role="button" data-toggle="dropdown" href="#">
+                             Actions <b class="caret"></b>
+                          </a>
+                          <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="invoiceactions[% invoice.invoiceid %]">
+                              <li><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]"><i class="icon-search"></i> Details</a></li>
+                            [% IF invoice.closedate %]
+                                <li><a href="invoice.pl?op=reopen&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="icon-refresh"></i> Reopen</a></li>
+                            [% ELSE %]
+                                <li><a href="invoice.pl?op=close&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="icon-remove-sign"></i> Close</a></li>
+                            [% END %]
+                            [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
+                                <li><a href="invoice.pl?op=delete&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="icon-remove"></i> Delete</a></li>
+                            [% END %]
+                          </ul>
+                      </div>
                   </td>
                 </tr>
               [% END %]
@@ -179,8 +183,7 @@ $(document).ready(function() {
                             <select id="merge_shipment_budgetid" name="shipment_budget_id">
                                 <option value="">No fund</option>
                               [% FOREACH budget IN budgets_loop %]
-                                  <option value="[% budget.budget_id %]">
-                                  [% budget.budget_name %]
+                                  <option value="[% invoice.invoiceid %]">[% budget.budget_name %]
                                   </option>
                               [% END %]
                             </select></li>
-- 
1.7.9.5


More information about the Koha-patches mailing list