[Koha-patches] [PATCH] Bug 10393 - Receive shipment link in acquisitions main page

Srdjan srdjan at catalyst.net.nz
Fri Jul 26 06:13:39 CEST 2013


From: Amit Gupta <amitddng135 at gmail.com>

To add some shortcuts to acquisitions main screen e.g.
RECEIVE SHIPMENT and the FILTER BOX

Test plan:
1) Click on Receive shipment link on the left hand side.
2) It will give all the vendor list click on
recieve shipment link to receive items.
3) For creating new basket click on "New Basket" link.

Sponsored-by: Staffordshire University/Halton Borough Council/PTFS Europe

Signed-off-by: Srdjan <srdjan at catalyst.net.nz>
---
 acqui/receiveshipment.pl                           | 57 +++++++++++++++++
 .../prog/en/includes/acquisitions-menu.inc         |  1 +
 .../prog/en/modules/acqui/receiveshipment.tt       | 71 ++++++++++++++++++++++
 3 files changed, 129 insertions(+)
 create mode 100755 acqui/receiveshipment.pl
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/receiveshipment.tt

diff --git a/acqui/receiveshipment.pl b/acqui/receiveshipment.pl
new file mode 100755
index 0000000..b24adf9
--- /dev/null
+++ b/acqui/receiveshipment.pl
@@ -0,0 +1,57 @@
+#!/usr/bin/perl
+
+# Copyright 2013 Amit Gupta(amitddng135 at gmail.com)
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 NAME
+
+receiveshipment.pl
+
+=head1 DESCRIPTION
+
+this script is the main page for acqui
+
+=cut
+
+use strict;
+use warnings;
+use CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Members;
+use C4::Branch;
+use C4::Debug;
+use C4::Bookseller qw/ GetBookSeller /;
+
+my $input = CGI->new();
+
+my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
+    {   template_name   => 'acqui/receiveshipment.tmpl',
+        query           => $input,
+        type            => 'intranet',
+        authnotrequired => 0,
+        flagsrequired   => { acquisition => '*' },
+        debug           => 1,
+    }
+);
+
+my $user = GetMember( 'borrowernumber' => $loggedinuser );
+my $branchname = GetBranchName($user->{branchcode});
+
+my @suppliers = GetBookSeller();
+$template->param( supplier_loop => \@suppliers);
+
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
index 439118d..9657466 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
@@ -2,6 +2,7 @@
 	<li><a href="/cgi-bin/koha/acqui/lateorders.pl">Late orders</a></li>
 	[% IF ( suggestion ) %]<li><a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a></li>[% ELSE %][% END %]
     <li><a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a></li>
+    <li><a href="/cgi-bin/koha/acqui/receiveshipment.pl">Receive shipment</a></li>
     [% IF ( CAN_user_acquisition_budget_manage ) %]
     <li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></li>
     <li><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/receiveshipment.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/receiveshipment.tt
new file mode 100644
index 0000000..b1004a3
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/receiveshipment.tt
@@ -0,0 +1,71 @@
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha › Acquisitions › Receive shipment</title>
+[% INCLUDE 'doc-head-close.inc' %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+<script type="text/javascript">
+//<![CDATA[
+    $(document).ready(function() {
+        $("#recshipment").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "aoColumnDefs": [
+                { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
+            ],
+            "aaSorting": [[ 1, "asc" ]],
+            "iDisplayLength": 10,
+            "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
+        }));
+    });
+//]]>
+</script>
+</head>
+
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'acquisitions-search.inc' %]
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › </div>
+<div id="doc3" class="yui-t2">
+<div id="bd">
+<div id="yui-main">
+<div class="yui-b">
+<div class="yui-g">
+<div id="acqui_recshipment">
+[% IF (supplier_loop) %]
+<h1>Receive shipment</h1>
+<div id="acqui_recshipment">
+        <table id="recshipment">
+            <thead>
+                <tr>
+		    <th>Vendor</th>
+		    <th>Status</th>
+		    <th> </th>
+                    <th> </th>
+		</tr>
+            </thead>
+<tbody>
+[% FOREACH suppliers IN supplier_loop %]
+    <tr>
+        <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% suppliers.id %]">[% suppliers.name %]</td>
+        [% IF(suppliers.active == 1)%]
+            <td>Active</td>
+        [% ELSE %]
+            <td>Inactive</td>
+        [% END %]
+        <td><a href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% suppliers.id %]">Receive shipment</a></td>
+        <td><a href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% suppliers.id %]&op=add_form">New basket</a></td>
+    </tr>
+[% END %]
+</tbody>
+</table>
+</div>
+[% END %]
+</div>
+</div>
+</div>
+</div>
+<div class="yui-b">
+[% INCLUDE 'acquisitions-menu.inc' %]
+</div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
-- 
1.8.1.2


More information about the Koha-patches mailing list