INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnBeforeExpiry',0,'If ON, checkout will be prevented if returndate is after patron card expiry',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer',1,'If ON, name of reviewer will be shown above comments in OPAC','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewer','full','Choose how a commenter''s identity is presented alongside comments in the OPAC','none|full|first|surname|firstandinitial|username','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory','simplified','Define the display preference for serials issue history in OPAC','simplified|full','Choice');
SetVersion($DBversion);
}
+$DBversion = "3.07.00.019";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do(" UPDATE `systempreferences` SET `value` = 'none', `options` = 'none|full|first|surname|firstandinitial|username', `explanation` = 'Choose how a commenter''s identity is presented alongside comments in the OPAC', `type` = 'Choice' WHERE `systempreferences`.`variable` = 'ShowReviewer' AND `systempreferences`.`variable` = 0");
+ $dbh->do(" UPDATE `systempreferences` SET `value` = 'full', `options` = 'none|full|first|surname|firstandinitial|username', `explanation` = 'Choose how a commenter''s identity is presented alongside comments in the OPAC', `type` = 'Choice' WHERE `systempreferences`.`variable` = 'ShowReviewer' AND `systempreferences`.`variable` = 1");
+ print "Adding additional options for the display of commenter's identity in the OPAC: Full name, first name, last name, first name and last name first initial, username, or no information\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)
no: "Don't allow"
- patrons to make comments on items on the OPAC.
-
+ - Show
- pref: ShowReviewer
choices:
- yes: Show
- no: Hide
- - reviewer's name above comments in OPAC.
+ none: no name
+ full: full name
+ first: first name
+ surname: last name
+ firstandinitial: first name and last name initial
+ username: username
+ - of commenter with comments in OPAC.
-
- pref: ShowReviewerPhoto
choices:
</p></div>
[% ELSE %]
<div class="commentline">
- [% IF ( ShowReviewer ) %]
- [% IF ( review.avatarurl ) %]
- <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
- [% END %]
- <h5>
- Comment by
- [% review.title %]
- [% review.firstname %]
- [% review.surname %]
- </h5>
+ [% IF ( ShowReviewer != "none" ) %]
+ [% IF ( review.avatarurl ) %]
+ <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
+ [% END %]
+ [% SWITCH ShowReviewer %]
+ [% CASE 'full' %]
+ <h5>Comment by [% review.title %] [% review.firstname %] [% review.surname %]</h5>
+ [% CASE 'first' %]
+ <h5>Comment by [% review.firstname %]</h5>
+ [% CASE 'surname' %]
+ <h5>Comment by [% review.surname %]</h5>
+ [% CASE 'firstandinitial' %]
+ <h5>Comment by [% review.firstname %] [% review.surname|truncate(2,'.') %]</h5>
+ [% CASE 'username' %]
+ <h5>Comment by [% review.userid %]</h5>
+ [% END %]
+ <small>[% review.datereviewed %]</small>
+ [% ELSIF ( ShowReviewer == "none") %]
+ <h5>Patron comment on [% review.datereviewed %]</h5>
[% END %]
- <small>[% review.datereviewed %]</small>
<p>
[% FILTER html_break %]
[% review.review |html %]
[% review.review |html %]
[% END %]
<span style="font-size:87%;font-color:#CCC;">Added [% review.datereviewed %] [% IF ( review.your_comment ) %] by <strong>you</strong>[% ELSE %]
- [% IF ( ShowReviewer ) %] by
- [% review.firstname %] [% review.surname %][% END %][% END %]</span></p>
+ [% IF ( ShowReviewer != "none" ) %] by
+ [% SWITCH ShowReviewer %]
+ [% CASE 'full' %]
+ [% review.borrtitle %] [% review.firstname %] [% review.surname %]
+ [% CASE 'first' %]
+ [% review.firstname %]
+ [% CASE 'surname' %]
+ [% review.surname %]
+ [% CASE 'firstandinitial' %]
+ [% review.firstname %] [% review.surname|truncate(2,'.') %]
+ [% CASE 'username' %]
+ [% review.userid %]
+ [% END %]
+ [% END %][% END %]</span></p>
</td>
<td>
[% IF ( review.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% review.biblionumber |url %]" title="View details for this title">
$result->{size} = $bib->{'size'};
$result->{notes} = $bib->{'notes'};
$result->{timestamp} = $bib->{'timestamp'};
+ $result->{borrtitle} = $borr->{'title'};
$result->{firstname} = $borr->{'firstname'};
$result->{surname} = $borr->{'surname'};
+ $result->{userid} = $borr->{'userid'};
if ($libravatar_enabled and $borr->{'email'}) {
$result->{avatarurl} = libravatar_url(email => $borr->{'email'}, size => 40, https => $ENV{HTTPS});
}