[Koha-patches] [PATCH] bug 5841 Catalyst WR77407 showing pub and recd dates on routing slips

Chris Cormack chrisc at catalyst.net.nz
Tue Apr 5 04:29:53 CEST 2011


From: Reed Wade <reed at catalyst.net.nz>

Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
---
 C4/Serials.pm                                      |    3 ++-
 .../en/modules/serials/routing-preview-slip.tmpl   |    3 ++-
 .../prog/en/modules/serials/routing.tmpl           |    5 ++++-
 .../en/modules/serials/serials-collection.tmpl     |    2 +-
 serials/routing.pl                                 |    1 +
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/C4/Serials.pm b/C4/Serials.pm
index 32c9bcb..8135663 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -754,7 +754,7 @@ sub GetLatestSerials {
     my $dbh = C4::Context->dbh;
 
     # status = 2 is "arrived"
-    my $strsth = "SELECT   serialid,serialseq, status, planneddate, notes
+    my $strsth = "SELECT   serialid,serialseq, status, planneddate, notes, publisheddate
                         FROM     serial
                         WHERE    subscriptionid = ?
                         AND      (status =2 or status=4)
@@ -766,6 +766,7 @@ sub GetLatestSerials {
     while ( my $line = $sth->fetchrow_hashref ) {
         $line->{ "status" . $line->{status} } = 1;                        # fills a "statusX" value, used for template status select list
         $line->{"planneddate"} = format_date( $line->{"planneddate"} );
+        $line->{"publisheddate"} = format_date( $line->{"publisheddate"} );
         push @serials, $line;
     }
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tmpl
index 3180337..345c4dd 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tmpl
@@ -26,7 +26,8 @@
             <td>&nbsp;</td></tr>
 <!-- /TMPL_LOOP -->
 </table>
-<p><b>Notes:</b> Please return this item promptly as others are waiting for it.
+<p><b>Notes:</b> Please return this item promptly
+<br />as others are waiting for it.
 <br /><!-- TMPL_VAR NAME="routingnotes" --></p>
    <div id="slip-block-links" class="noprint">
    <a class="button" href="javascript:window.print();self.close()">Print</a> &nbsp; <a class="button" href="javascript:self.close()">Close</a>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tmpl
index 4e9dd11..238d575 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tmpl
@@ -43,7 +43,10 @@ function search_member(subscriptionid){
 		<li><label for="date_selected">Issue: </label>
 <select name="date_selected" id="date_selected">
 <!-- TMPL_LOOP NAME="dates" -->
-<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR NAME="planneddate" -->)" selected="selected"><!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR NAME="planneddate" -->)</option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR NAME="planneddate" -->)"><!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR NAME="planneddate" -->)</option><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="selected" -->
+<option value="<!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR Name="publisheddate" ESCAPE="HTML" -->) (Rec'd: <!-- TMPL_VAR NAME="planneddate" -->)" selected="selected"><!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR Name="publisheddate" ESCAPE="HTML" -->) (Rec'd: <!-- TMPL_VAR Name="planneddate" ESCAPE="HTML" -->)</option>
+<!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR NAME="planneddate" -->)"><!-- TMPL_VAR NAME="serialseq" --> (<!-- TMPL_VAR Name="publisheddate" ESCAPE="HTML" -->) (Rec'd: <!-- TMPL_VAR Name="planneddate" ESCAPE="HTML" -->)</option>
+<!-- /TMPL_IF -->
 <!-- /TMPL_LOOP -->
 </select> <!-- TMPL_VAR NAME="issue" --></li>
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl
index b5c9d84..a5e00d0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl
@@ -226,7 +226,7 @@ $(document).ready(function() {
                     <!-- TMPL_VAR Name="branchcode" -->
                 </td>
 		<td>
-		   <a href="" onclick="print_slip(<!-- TMPL_VAR NAME="subscriptionid" ESCAPE="HTML" -->, '<!-- TMPL_VAR NAME="serialseq" ESCAPE="HTML" -->'); return false" >Print list</a>
+		   <a href="" onclick="print_slip(<!-- TMPL_VAR NAME="subscriptionid" ESCAPE="HTML" -->, '<!-- TMPL_VAR NAME="serialseq" ESCAPE="HTML" --> (<!-- TMPL_VAR Name="publisheddate" ESCAPE="HTML" -->) (Rec\'d: <!-- TMPL_VAR Name="planneddate" ESCAPE="HTML" -->)'); return false" >Print list</a>
 		</td>
                 <td>
                   <!--TMPL_IF Name="cannotedit"-->
diff --git a/serials/routing.pl b/serials/routing.pl
index 2bd7d69..9792a96 100755
--- a/serials/routing.pl
+++ b/serials/routing.pl
@@ -74,6 +74,7 @@ my $serialdates = GetLatestSerials($subscriptionid,$count);
 my $dates = [];
 foreach my $dateseq (@{$serialdates}) {
     my $d = {};
+    $d->{publisheddate} = $dateseq->{publisheddate};
     $d->{planneddate} = $dateseq->{planneddate};
     $d->{serialseq} = $dateseq->{serialseq};
     $d->{serialid} = $dateseq->{serialid};
-- 
1.7.1



More information about the Koha-patches mailing list