Bug 19458: (follow-up) Self-check module highlighting
authorAgustin Moyano <agustinmoyano@theke.io>
Thu, 13 Dec 2018 23:01:24 +0000 (20:01 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 11 Jan 2019 12:32:11 +0000 (12:32 +0000)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
opac/sco/sco-main.pl

index bfa3aec..e004afd 100644 (file)
@@ -84,6 +84,7 @@
                                     <input type="hidden" name="op" value="returnbook" />
                                     <input type="hidden" name="patronid" value="[% patronid | html %]" />
                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
+                                    <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                     <button type="submit" name="returnbook" class="btn"><i class="return"></i> Return this item</button>
                                 </form>
                             [% END %]
@@ -92,6 +93,7 @@
                                 <input type="hidden" name="op" value="" />
                                 <input type="hidden" name="patronid" value="[% patronid | html %]" />
                                 <input type="hidden" name="barcode" value="[% barcode | html %]" />
+                                <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                 <input type="submit" name= "confirm" value="Return to account summary" class="btn back focus" />
                             </form>
                         </div> <!-- / .alert -->
                                     <input type="hidden" name="patronid" value="[% patronid | html %]" />
                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
                                     <input type="hidden" name="confirmed" value="" />
+                                    <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                     <button type="submit" name="returnbook" class="btn"><i class="icon return"></i> Return this item</button>
                                 </form>
                             [% END %]
                                     <input type="hidden" name="patronid" value="[% patronid | html %]" />
                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
                                     <input type="hidden" name="confirmed" value="1" />
+                                    <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                     <button type="submit" name="confirm" class="btn"><i class="icon renew"></i> Renew item</button>
                                   </form>
                             [% ELSE %]
                                     <input type="hidden" name="patronid" value="[% patronid | html %]" />
                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
                                     <input type="hidden" name="confirmed" value="1" />
+                                    <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                     <button type="submit" class="btn"><i class="icon renew"></i> Renew item</button>
                                 </form>
                             [% END %]
                             <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
                                 <input type="hidden" name="op" value="" />
                                 <input type="hidden" name="patronid" value="[% patronid | html %]" />
+                                <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                 <button type="submit" class="btn"><i class="icon cancel"></i> Cancel</button>
                             </form>
                         </div>
                                             <tr>
                                                 <td>[% ISSUE.issuedate | html %]</td>
                                                 <td>
-                                                    [% IF ( newissues.match(ISSUE.barcode)) %]
-                                                        <span class="label label-info">NEW</span>
-                                                    [% END %]
                                                     [% UNLESS ( noitemlinks ) %]
                                                         <a href="/cgi-bin/koha/opac-detail.pl?bib=[% ISSUE.  biblionumber | uri %]">[% ISSUE.title | html %]</a>
                                                     [% ELSE %]
                                                         <strong>[% ISSUE.title | html %]</strong>
                                                     [% END %]
+                                                    [% IF ( newissues.match(ISSUE.barcode)) %]
+                                                        <span class="label label-info">NEW</span>
+                                                    [% END %]
                                                     <span class="item-details">[% ISSUE.author | html %]</span>
                                                     ([% ISSUE.barcode | html %])
                                                 </td>
                                                     <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
                                                         <input type="hidden" name="patronid" value="[% patronid | html %]" />
                                                         <input type="hidden" name="barcode" value="[% ISSUE.barcode | html %]" />
+                                                        <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                                         [% IF ISSUE.can_be_renewed %]
                                                             <input type="hidden" name="op" value="checkout" />
                                                             <input type="hidden" name="confirmed" value="1" />
index 49018da..841b59b 100755 (executable)
@@ -176,6 +176,7 @@ elsif ( $patron and $op eq "checkout" ) {
         if ($confirmed) {
             #warn "renewing";
             AddRenewal( $borrower->{borrowernumber}, $item->{itemnumber} );
+            push @newissueslist, $barcode;
         } else {
             #warn "renew confirmation";
             $template->param(
@@ -215,10 +216,10 @@ elsif ( $patron and $op eq "checkout" ) {
                     }
                 )->count;
             }
+
             AddIssue( $borrower, $barcode );
             push @newissueslist, $barcode;
-            print 'Issues \n';
-            print join(',', @newissueslist);
+
             if ( $hold_existed ) {
                 my $dtf = Koha::Database->new->schema->storage->datetime_parser;
                 $template->param(
@@ -248,7 +249,6 @@ elsif ( $patron and $op eq "checkout" ) {
 } # $op
 
 if ($borrower) {
-    print 'borrower \n';
 #   warn "issuer's  branchcode: " .   $issuer->{branchcode};
 #   warn   "user's  branchcode: " . $borrower->{branchcode};
     my $borrowername = sprintf "%s %s", ($borrower->{firstname} || ''), ($borrower->{surname} || '');