View | Details | Raw Unified | Return to bug 14544
Collapse All | Expand All

(-)a/Koha/Exceptions.pm (-1 / +1 lines)
Lines 15-21 use Exception::Class ( Link Here
15
15
16
    'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
16
    'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
17
        isa => 'Koha::Exceptions::DuplicateObject',
17
        isa => 'Koha::Exceptions::DuplicateObject',
18
        description => "poeut",
18
        description => "Duplicate shelf object",
19
    },
19
    },
20
    'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
20
    'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
21
        isa => 'Koha::Exceptions::Exception',
21
        isa => 'Koha::Exceptions::Exception',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +1 lines)
Lines 357-363 function verify_images() { Link Here
357
    [% IF ( XSLTDetailsDisplay ) %]
357
    [% IF ( XSLTDetailsDisplay ) %]
358
        [% XSLTBloc %]
358
        [% XSLTBloc %]
359
359
360
        [% IF shelves %]
360
        [% IF shelves.count %]
361
            <span class="results_summary"><span class="label">Lists that include this title: </span>
361
            <span class="results_summary"><span class="label">Lists that include this title: </span>
362
            [% FOREACH s IN shelves %]
362
            [% FOREACH s IN shelves %]
363
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a>
363
                <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-18 / +24 lines)
Lines 564-587 function placeHold () { Link Here
564
                [% END %]
564
                [% END %]
565
                           </select></li>
565
                           </select></li>
566
566
567
            [% FOR permission IN ['allow_add', 'allow_delete_own', 'allow_delete_other'] %]
567
            <li>
568
                <li>
568
                <label for="allow_add">Permissions: </label>
569
                    [% IF loop.first %]
569
                <select name="allow_add" id="allow_add">
570
                        <label for="permissions">Permissions: </label>
570
                    [% IF shelf.allow_add %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
571
                    [% ELSE %]
571
                    [% IF shelf.allow_add %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
572
                        <label>&nbsp;</label>
572
                </select>
573
                    [% END %]
573
                &nbsp;<span>anyone else to add entries.</span>
574
                    <select name="[% permission %]" id="[% permission %]">
574
            </li>
575
                        [% IF shelf.$permission %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
575
            <li>
576
                        [% IF shelf.$permission %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
576
                <label>&nbsp;</label>
577
                    </select>
577
                <select name="allow_delete_own" id="allow_delete_own">
578
                    [% SWITCH permission %]
578
                    [% IF shelf and not shelf.allow_delete_own %]<option value="0" selected="selected">Do not allow</option>[% ELSE %]<option value="0">Do not allow</option>[% END %]
579
                        [% CASE 'allow_add' %]&nbsp;<span>anyone else to add entries.</span>
579
                    [% IF not shelf or shelf.allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
580
                        [% CASE 'allow_delete_own' %]&nbsp;<span>anyone to remove his own contributed entries.</span>
580
                </select>
581
                        [% CASE 'allow_delete_other' %]&nbsp;<span>anyone to remove other contributed entries.</span>
581
                &nbsp;<span>anyone to remove his own contributed entries.</span>
582
                    [% END %]
582
            </li>
583
                </li>
583
            <li>
584
            [% END %]
584
                <label>&nbsp;</label>
585
                <select name="allow_delete_other" id="allow_delete_other">
586
                    [% IF shelf.allow_delete_other %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
587
                    [% IF shelf.allow_delete_other %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
588
                </select>
589
                &nbsp;<span>anyone to remove other contributed entries.</span>
590
            </li>
585
        </ol>
591
        </ol>
586
    </fieldset>
592
    </fieldset>
587
593
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 390-396 Link Here
390
                    [% END # / LibraryThingForLibrariesID %]
390
                    [% END # / LibraryThingForLibrariesID %]
391
391
392
                    <!--This grabs all of the lists a bib record appears in -->
392
                    <!--This grabs all of the lists a bib record appears in -->
393
                    [% IF shelves %]
393
                    [% IF shelves.count %]
394
                        <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
394
                        <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
395
                        [% FOREACH s IN shelves %]
395
                        [% FOREACH s IN shelves %]
396
                            <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a>
396
                            <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt (-1 / +1 lines)
Lines 59-65 Link Here
59
        </fieldset>
59
        </fieldset>
60
        <fieldset class="action">
60
        <fieldset class="action">
61
            <input type="submit" value="Send" class="btn" />
61
            <input type="submit" value="Send" class="btn" />
62
            <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;category=1" class="cancel">Cancel</a>
62
            <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" class="cancel">Cancel</a>
63
        </fieldset>
63
        </fieldset>
64
        </form>
64
        </form>
65
        </div>
65
        </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-4 / +4 lines)
Lines 22-29 Link Here
22
    <li>
22
    <li>
23
        <label>&nbsp;</label>
23
        <label>&nbsp;</label>
24
        <select name="allow_delete_own" id="allow_delete_own">
24
        <select name="allow_delete_own" id="allow_delete_own">
25
            [% IF shelf.allow_delete_own %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %]
25
            [% IF shelf and not shelf.allow_delete_own %]<option value="0" selected="selected">Do not allow</option>[% ELSE %]<option value="0">Do not allow</option>[% END %]
26
            [% IF shelf.allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
26
            [% IF not shelf or shelf.allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %]
27
        </select>
27
        </select>
28
        &nbsp;<span>anyone to remove his own contributed entries.</span>
28
        &nbsp;<span>anyone to remove his own contributed entries.</span>
29
    </li>
29
    </li>
Lines 168-174 Link Here
168
                                    <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=[% shelf.shelfnumber | html %]" class="download" data-toggle="modal" data-target="#modalWin">Download list</a>
168
                                    <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=[% shelf.shelfnumber | html %]" class="download" data-toggle="modal" data-target="#modalWin">Download list</a>
169
169
170
                                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
170
                                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
171
                                        <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>
171
                                        <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>
172
                                    [% END %]
172
                                    [% END %]
173
173
174
                                    <a class="print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber %]&sortfield=[% sortfield %]&direction=[% direction |uri %]&print=1">Print list</a>
174
                                    <a class="print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber %]&sortfield=[% sortfield %]&direction=[% direction |uri %]&print=1">Print list</a>
Lines 521-527 Link Here
521
                    [% END %]
521
                    [% END %]
522
522
523
                    [% IF itemsloop && can_remove_biblios %]
523
                    [% IF itemsloop && can_remove_biblios %]
524
                        <input type="hidden" name="op" value="view" />
524
                        <input type="hidden" name="op" value="remove_biblios" />
525
                        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
525
                        <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
526
                        <input type="hidden" name="modifyshelfcontents" value="1" />
526
                        <input type="hidden" name="modifyshelfcontents" value="1" />
527
                        <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger"/>
527
                        <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger"/>
(-)a/opac/opac-sendshelf.pl (-1 / +1 lines)
Lines 52-58 my $email = $query->param('email'); Link Here
52
my $dbh          = C4::Context->dbh;
52
my $dbh          = C4::Context->dbh;
53
53
54
my $shelf = Koha::Virtualshelves->find( $shelfid );
54
my $shelf = Koha::Virtualshelves->find( $shelfid );
55
if ( $shelf->can_be_viewed( $borrowernumber ) ) {
55
if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) {
56
56
57
if ( $email ) {
57
if ( $email ) {
58
    my $message = Koha::Email->new();
58
    my $message = Koha::Email->new();
(-)a/opac/opac-shelves.pl (-1 / +10 lines)
Lines 222-228 if ( $op eq 'view' ) { Link Here
222
                $rows = C4::Context->preference('OPACnumSearchResults') || 20;
222
                $rows = C4::Context->preference('OPACnumSearchResults') || 20;
223
                $page = ( $query->param('page') ? $query->param('page') : 1 );
223
                $page = ( $query->param('page') ? $query->param('page') : 1 );
224
            }
224
            }
225
            my $contents = $shelf->get_contents->search({}, { join => [ 'biblionumber' ], page => $page, rows => $rows, order_by => "$sortfield $direction", });
225
            my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield;
226
            my $contents = $shelf->get_contents->search(
227
                {},
228
                {
229
                    prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ],
230
                    page     => $page,
231
                    rows     => $rows,
232
                    order_by => "$order_by $direction",
233
                }
234
            );
226
235
227
            # get biblionumbers stored in the cart
236
            # get biblionumbers stored in the cart
228
            my @cart_list;
237
            my @cart_list;
(-)a/virtualshelves/shelves.pl (-2 / +10 lines)
Lines 201-207 if ( $op eq 'view' ) { Link Here
201
                $page = ( $query->param('page') ? $query->param('page') : 1 );
201
                $page = ( $query->param('page') ? $query->param('page') : 1 );
202
            }
202
            }
203
203
204
            my $contents = $shelf->get_contents->search({}, { join => [ 'biblionumber' ], page => $page, rows => $rows, order_by => "$sortfield $direction", });
204
            my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield;
205
            my $contents = $shelf->get_contents->search(
206
                {},
207
                {
208
                    prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ],
209
                    page     => $page,
210
                    rows     => $rows,
211
                    order_by => "$order_by $direction",
212
                }
213
            );
205
214
206
            my $borrower = GetMember( borrowernumber => $loggedinuser );
215
            my $borrower = GetMember( borrowernumber => $loggedinuser );
207
216
208
- 

Return to bug 14544