Fix for Bug 7083 - [SIGNED-OFF] Show creator name on list of public lists

Show the name of the patron who created each list on the list
of public lists. Also:

- correcting unescaped ampersand in the template
- making conditional a check on a variable that doesn't always
  exist, causing noisy errors in the log

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
After applying the patch a column for "Created by" is added to the display of
public lists, and the errors in the log are silenced. On the "Your lists"
tab, the link on the list name now has an escaped ampersand.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Owen Leonard 2011-10-24 11:18:16 -04:00 committed by Paul Poulain
parent 614cc4ca8d
commit 2951d83e9d
2 changed files with 9 additions and 7 deletions

View file

@ -340,11 +340,12 @@ sub shelfpage ($$$$$) {
my $owner = $shelflist->{$element}->{'owner'};
my $canmanage = ShelfPossibleAction( $loggedinuser, $element, 'manage' );
my $sortfield = $shelflist->{$element}->{'sortfield'};
if ( $sortfield eq 'author' ) {
$shelflist->{$element}->{"authorsort"} = 'author';
}
if ( $sortfield eq 'year' ) {
$shelflist->{$element}->{"yearsort"} = 'year';
if ( $sortfield ){
if ( $sortfield eq 'author' ) {
$shelflist->{$element}->{"authorsort"} = 'author';
} elsif ( $sortfield eq 'year' ) {
$shelflist->{$element}->{"yearsort"} = 'year';
}
}
$shelflist->{$element}->{"viewcategory$category"} = 1;
$shelflist->{$element}->{manageshelf} = $canmanage;

View file

@ -349,7 +349,7 @@ function placeHold () {
<tr><th>List Name</th><th>Contents</th><th>Sort by</th><th>Type</th><th>Options</th></tr>
[% FOREACH shelveslooppri IN shelveslooppriv %]
[% IF ( shelveslooppri.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
<td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
<td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&amp;shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
<td>[% shelveslooppri.count %] item(s)</td>
<td>[% IF ( shelveslooppri.authorsort ) %]Author[% ELSIF ( shelveslooppri.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
<td>[% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
@ -399,10 +399,11 @@ function placeHold () {
[% IF ( shelvesloop ) %]
<div class="pages">[% pagination_bar %]</div>
<table>
<tr><th>List Name</th><th>Contents</th><th>Sort By</th><th>Type</th><th>Options</th></tr>
<tr><th>List Name</th><th>Created by</th><th>Contents</th><th>Sort By</th><th>Type</th><th>Options</th></tr>
[% FOREACH shelvesloo IN shelvesloop %]
[% IF ( shelvesloo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
<td><a href="shelves.pl?viewshelf=[% shelvesloo.shelf %]">[% shelvesloo.shelfname |html %]</a></td>
<td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% shelvesloo.owner %]">[% shelvesloo.ownername %]</td>
<td>[% shelvesloo.count %] item(s)</td>
<td>[% IF ( shelvesloo.authorsort ) %]Author[% ELSIF ( shelvesloo.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
<td>[% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]