Bug 18466: article requests box outline in opac
authorphette23 <phette23@gmail.com>
Fri, 21 Apr 2017 00:15:57 +0000 (17:15 -0700)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 24 Apr 2017 17:24:58 +0000 (13:24 -0400)
To test:
1) apply patch
2) ensure ArticleRequests is set to Enable
3) sign in as a user with no article requests on the OPAC side
4) click the 'article requests' tab & see the box & message

Sponsored-By: California College of the Arts

Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt

index a715178..e724b18 100644 (file)
@@ -727,100 +727,106 @@ Using this account is not recommended because some parts of Koha will not functi
                         </div> <!-- / #opac-user-holds -->
                         [% END # / #RESERVES.count %]
 
-                        [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current.count %]
+                        [% IF Koha.Preference('ArticleRequests') %]
                             <div id="opac-user-article-requests">
-                                <table id="article-requests-table" class="table table-bordered table-striped">
-                                    <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption>
-                                    <thead>
-                                        <tr>
-                                            <th class="anti-the article-request-record-title">Record title</th>
-                                            <th class="psort article-request-created-on">Placed on</th>
-                                            <th class="anti-the article-request-title">Title</th>
-                                            <th class="article-request-author">Author</th>
-                                            <th class="article-request-volume">Volume</th>
-                                            <th class="article-request-issue">Issue</th>
-                                            <th class="article-request-date">Date</th>
-                                            <th class="article-request-pages">Pages</th>
-                                            <th class="article-request-chapters">Chapters</th>
-                                            <th class="article-request-patron-notes">Notes</th>
-                                            <th class="article-request-status">Status</th>
-                                            <th class="article-request-branchcode">Pickup library</th>
-                                            <th class="nosort article-request-cancel">&nbsp;</th>
-                                        </tr>
-                                    </thead>
+                                [% IF borrower.article_requests_current.count %]
+                                    <table id="article-requests-table" class="table table-bordered table-striped">
+                                        <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption>
+                                        <thead>
+                                            <tr>
+                                                <th class="anti-the article-request-record-title">Record title</th>
+                                                <th class="psort article-request-created-on">Placed on</th>
+                                                <th class="anti-the article-request-title">Title</th>
+                                                <th class="article-request-author">Author</th>
+                                                <th class="article-request-volume">Volume</th>
+                                                <th class="article-request-issue">Issue</th>
+                                                <th class="article-request-date">Date</th>
+                                                <th class="article-request-pages">Pages</th>
+                                                <th class="article-request-chapters">Chapters</th>
+                                                <th class="article-request-patron-notes">Notes</th>
+                                                <th class="article-request-status">Status</th>
+                                                <th class="article-request-branchcode">Pickup library</th>
+                                                <th class="nosort article-request-cancel">&nbsp;</th>
+                                            </tr>
+                                        </thead>
 
-                                    <tbody>
-                                    [% FOREACH ar IN borrower.article_requests_current %]
-                                            <td class="article-request-record-title">
-                                                <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber %]">
-                                                    [% ar.biblio.title %]
-                                                    [% ar.item.enumchron %]
-                                                </a>
-                                                [% ar.biblio.author %]
-                                                [% IF ar.itemnumber %] <i>(only [% ar.item.barcode %])</i>[% END %]
-                                            </td>
+                                        <tbody>
+                                        [% FOREACH ar IN borrower.article_requests_current %]
+                                                <td class="article-request-record-title">
+                                                    <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber %]">
+                                                        [% ar.biblio.title %]
+                                                        [% ar.item.enumchron %]
+                                                    </a>
+                                                    [% ar.biblio.author %]
+                                                    [% IF ar.itemnumber %] <i>(only [% ar.item.barcode %])</i>[% END %]
+                                                </td>
 
-                                            <td class="article-request-created_on">
-                                                [% ar.created_on | $KohaDates %]
-                                            </td>
+                                                <td class="article-request-created_on">
+                                                    [% ar.created_on | $KohaDates %]
+                                                </td>
 
-                                            <td class="article-request-title">
-                                                [% ar.title %]
-                                            </td>
+                                                <td class="article-request-title">
+                                                    [% ar.title %]
+                                                </td>
 
-                                            <td class="article-request-author">
-                                                [% ar.author %]
-                                            </td>
+                                                <td class="article-request-author">
+                                                    [% ar.author %]
+                                                </td>
 
-                                            <td class="article-request-volume">
-                                                [% ar.volume %]
-                                            </td>
+                                                <td class="article-request-volume">
+                                                    [% ar.volume %]
+                                                </td>
 
-                                            <td class="article-request-issue">
-                                                [% ar.issue %]
-                                            </td>
+                                                <td class="article-request-issue">
+                                                    [% ar.issue %]
+                                                </td>
 
-                                            <td class="article-request-date">
-                                                [% ar.date %]
-                                            </td>
+                                                <td class="article-request-date">
+                                                    [% ar.date %]
+                                                </td>
 
-                                            <td class="article-request-pages">
-                                                [% ar.pages %]
-                                            </td>
+                                                <td class="article-request-pages">
+                                                    [% ar.pages %]
+                                                </td>
 
-                                            <td class="article-request-chapters">
-                                                [% ar.chapters %]
-                                            </td>
+                                                <td class="article-request-chapters">
+                                                    [% ar.chapters %]
+                                                </td>
 
-                                            <td class="article-request-patron-notes">
-                                                [% ar.patron_notes %]
-                                            </td>
+                                                <td class="article-request-patron-notes">
+                                                    [% ar.patron_notes %]
+                                                </td>
 
-                                            <td class="article-request-status">
-                                                [% IF ar.status == 'PENDING' %]
-                                                    Pending
-                                                [% ELSIF ar.status == 'PROCESSING' %]
-                                                    Processing
-                                                [% ELSIF ar.status == 'COMPLETED' %]
-                                                    Completed
-                                                [% ELSIF ar.status == 'CANCELED' %]
-                                                    Canceled
-                                                [% END %]
-                                            </td>
+                                                <td class="article-request-status">
+                                                    [% IF ar.status == 'PENDING' %]
+                                                        Pending
+                                                    [% ELSIF ar.status == 'PROCESSING' %]
+                                                        Processing
+                                                    [% ELSIF ar.status == 'COMPLETED' %]
+                                                        Completed
+                                                    [% ELSIF ar.status == 'CANCELED' %]
+                                                        Canceled
+                                                    [% END %]
+                                                </td>
 
-                                            <td class="article-request-branchcode">
-                                                [% ar.branch.branchname %]
-                                            </td>
+                                                <td class="article-request-branchcode">
+                                                    [% ar.branch.branchname %]
+                                                </td>
 
-                                            <td class="article-request-cancel">
-                                                <span class="tdlabel">Cancel:</span>
-                                                <a class="btn btn-mini btn-danger" href="opac-article-request-cancel.pl?id=[% ar.id %]" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="icon-remove icon-white"></i> Cancel</a>
-                                                <!-- TODO: replace MSG_CONFIRM_DELETE_HOLD with correct message -->
-                                            </td>
-                                        </tr>
-                                    [% END %]
-                                </tbody>
-                            </table>
+                                                <td class="article-request-cancel">
+                                                    <span class="tdlabel">Cancel:</span>
+                                                    <a class="btn btn-mini btn-danger" href="opac-article-request-cancel.pl?id=[% ar.id %]" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="icon-remove icon-white"></i> Cancel</a>
+                                                    <!-- TODO: replace MSG_CONFIRM_DELETE_HOLD with correct message -->
+                                                </td>
+                                            </tr>
+                                        [% END %]
+                                    </tbody>
+                                </table>
+                            [% ELSE %]
+                                <table class="table table-bordered table-striped">
+                                    <tr><td>You have no article requests currently.</td></tr>
+                                </table>
+                            [% END # IF article_requests_current.count %]
                         </div> <!-- / #opac-user-article-requests -->
                     [% END %]