Owen Leonard
3ad0f4368f
Adding foreign key constraint on biblio and borrowers: - delete reviews when bibliographic records are deleted - set set reviews.borrowernumber to NULL when patron records are deleted. Before these constraints are set the database update script will clean up existing instances of these problems by deleting reviews of deleted biblios and setting to NULL reviews.borrowernumber for deleted patrons. In comments moderation, the list of comments will indicate "(deleted patron") if the review was submitted by a patron who has since been deleted. In the OPAC display of comments will omit the patron name altogether if the patron has since been deleted. To test: 1. CONFIRM THAT THE DATABASE UPDATE RUNS CORRECTLY Before applying the patch: - delete the record for a title which has a review - delete a patron who has submitted a review (on a different title). Viewing /cgi-bin/koha/opac-showreviews.pl should result in an error. Apply the patch and make sure the database update runs. Viewing the recent comments page in the OPAC should no longer result in an error. The title with the comment from a deleted patron should show no patron name on these pages: - Recent comments (opac-showreviews.pl) - Recent comments RSS (opac-showreviews.pl?format=rss) - Detail page (opac-detail.pl) Comments from other patrons should show correctly. 2. CONFIRM THAT NEW DELETIONS PERFORM CORRECTLY After applying the patch: - delete the record for a title which has a review - delete a patron who has submitted a review (on a different title). Viewing /cgi-bin/koha/opac-showreviews.pl should NOT result in an error. The review of the title which you deleted should no longer appear in the list of recent comments. The title with the comment from a deleted patron should show no patron name on these pages: - Recent comments (opac-showreviews.pl) - Recent comments RSS (opac-showreviews.pl?format=rss) - Detail page (opac-detail.pl) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
75 lines
2.7 KiB
Text
75 lines
2.7 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Tools › Comments › [% IF ( status ) %] Approved comments[% ELSE %] Comments awaiting moderation[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
<body>
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
|
|
› <a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a> ›[% IF ( status ) %] Approved comments[% ELSE %] Comments awaiting moderation[% END %]</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
<h1>Comments</h1>
|
|
|
|
<!-- The manual invoice and credit buttons -->
|
|
<div class="toptabs">
|
|
<ul class="ui-tabs-nav">
|
|
[% IF ( status ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/reviews/reviewswaiting.pl?status=1">Approved comments</a></li>
|
|
[% IF ( status ) %]<li>[% ELSE %]<li class="ui-tabs-selected">[% END %]<a href="/cgi-bin/koha/reviews/reviewswaiting.pl" >Comments awaiting moderation</a></li>
|
|
</ul>
|
|
<div class="tabs-container">
|
|
|
|
[% IF ( reviews ) %]
|
|
<table id="commentst">
|
|
<thead><tr>
|
|
<th>
|
|
Commenter
|
|
</th>
|
|
<th>
|
|
On Title
|
|
</th>
|
|
<th>
|
|
Comment
|
|
</th>
|
|
<th>
|
|
|
|
</th>
|
|
</tr></thead>
|
|
<tbody>[% FOREACH review IN reviews %]
|
|
<tr>
|
|
<td>
|
|
[% IF ( review.borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% review.borrowernumber %]">[% review.surname %], [% review.firstname %]</a>[% ELSE %](deleted patron)[% END %]
|
|
</td>
|
|
<td>
|
|
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% review.biblionumber %]">[% review.bibliotitle %]</a>
|
|
</td>
|
|
<td>
|
|
[% review.review |html %]
|
|
</td>
|
|
<td>
|
|
[% IF ( status ) %]<a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=unapprove&reviewid=[% review.reviewid %]">Unapprove</a>[% ELSE %]<a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=approve&reviewid=[% review.reviewid %]">Approve</a>[% END %] |
|
|
<a href="/cgi-bin/koha/reviews/reviewswaiting.pl?op=delete&reviewid=[% review.reviewid %]">Delete</a>
|
|
</td>
|
|
</tr>
|
|
[% END %]</tbody>
|
|
</table>
|
|
<div class="pages">[% pagination_bar %]</div>
|
|
[% ELSE %]
|
|
[% IF ( status ) %]<p><b>No comments have been approved.</b></p>[% ELSE %]<p><b>No comments to moderate.</b></p>[% END %]
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'tools-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|