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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt (-19 / +83 lines)
Lines 1-12 Link Here
1
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Download list[% INCLUDE 'doc-head-close.inc' %]
1
[% USE Koha %]
2
[% BLOCK cssinclude %][% END %]
2
[% IF ( fullpage ) %]
3
</head>
3
    [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Download list [% shelfname %][% INCLUDE 'doc-head-close.inc' %]
4
<body id="opac-downloadlist" class="popup">
4
    [% BLOCK cssinclude %][% END %]
5
    <div class="main">
5
    </head>
6
        <div class="container-fluid">
6
    <body id="opac-downloadlist">
7
            <div class="row-fluid">
7
        [% INCLUDE 'masthead.inc' %]
8
                <div class="span12">
8
        <div class="main">
9
                    <div id="userdownloadshelf">
9
            <ul class="breadcrumb">
10
                <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
11
                [% IF ( loggedinusername ) %]
12
                    <li><a href="/cgi-bin/koha/opac-user.pl">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</a> <span class="divider">&rsaquo;</span></li>
13
                [% END %]
14
                <li>
15
                    [% IF ( showprivateshelves ) %]
16
                        <a href="/cgi-bin/koha/opac-shelves.pl">Your lists</a>
17
                    [% ELSE %]
18
                        <a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a>
19
                    [% END %]
20
                    <span class="divider">&rsaquo;</span>
21
                </li>
22
                <li>Download list <i>[% shelfname %]</i></li>
23
            </ul>
24
            <div class="container-fluid">
25
                <div class="row-fluid">
26
                    [% IF ( OpacNav||loggedinusername ) %]
27
                        <div class="span2">
28
                            <div id="navigation">
29
                                [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
30
                            </div>
31
                        </div>
32
                    [% END %]
33
34
                    [% IF ( OpacNav||loggedinusername ) %]
35
                        <div class="span10">
36
                    [% ELSE %]
37
                        <div class="span12">
38
                    [% END %]
39
[% END # / IF fullpage %]
40
41
                    <div id="userdownloadshelf" class="maincontent">
10
                        [% UNLESS ( invalidlist ) %]
42
                        [% UNLESS ( invalidlist ) %]
11
43
12
                            [% IF ( format ) %]
44
                            [% IF ( format ) %]
Lines 14-23 Link Here
14
                                    <p>Your download should begin automatically.</p>
46
                                    <p>Your download should begin automatically.</p>
15
                                </div>
47
                                </div>
16
                            [% ELSE %]
48
                            [% ELSE %]
17
                                <h1>Download list</h1>
49
                                <h1>Download list <i>[% shelfname %]</i></h1>
18
                                <form method="post" action="/cgi-bin/koha/opac-downloadshelf.pl">
50
                                <form method="post" action="/cgi-bin/koha/opac-downloadshelf.pl">
19
                                    <fieldset>
51
                                    <fieldset>
20
                                        <select name="format" id="format">
52
                                        <select name="format" id="dlformat" required="required">
21
                                            <option value="">-- Choose format --</option>
53
                                            <option value="">-- Choose format --</option>
22
                                            <option value="ris">RIS (Zotero, EndNote, others)</option>
54
                                            <option value="ris">RIS (Zotero, EndNote, others)</option>
23
                                            <option value="bibtex">BibTeX</option>
55
                                            <option value="bibtex">BibTeX</option>
Lines 26-40 Link Here
26
                                            <option value="[% csv_profile.export_format_id %]">CSV - [% csv_profile.profile %]</option>
58
                                            <option value="[% csv_profile.export_format_id %]">CSV - [% csv_profile.profile %]</option>
27
                                            [% END %]
59
                                            [% END %]
28
                                        </select>
60
                                        </select>
61
                                        <span class="required">Required</span>
29
                                    </fieldset>
62
                                    </fieldset>
30
63
31
                                    <fieldset class="action">
64
                                    <fieldset class="action">
32
                                        <input type="hidden" name="shelfid" value="[% shelfid | html %]" />
65
                                        <input type="hidden" name="shelfid" value="[% shelfid | html %]" />
33
                                        <input type="submit" name="save" class="btn" value="Go" />
66
                                        <input type="submit" name="save" class="btn" value="Go" />
34
                                        <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfid %]" class="cancel close">Cancel</a>
67
                                        <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfid %]" class="cancel close" data-dismiss="modal">Cancel</a>
35
                                    </fieldset>
68
                                    </fieldset>
36
                                </form>
69
                                </form>
37
70
                                [% IF ( modal ) %]
71
                                    <script type="text/javascript">
72
                                        //<![CDATA[
73
                                            $(document).ready(function(){
74
                                                $("#userdownloadshelf form").on("submit",function(e){
75
                                                    if( $("#dlformat").val() == "" ){
76
                                                        e.preventDefault();
77
                                                        alert(_("Please choose a download format"));
78
                                                    } else {
79
                                                        $("#modalWin").modal("hide");
80
                                                    }
81
                                                });
82
                                            });
83
                                        //]]>
84
                                    </script>
85
                                [% END %]
38
                            [% END # / IF format %]
86
                            [% END # / IF format %]
39
87
40
                        [% ELSE %]
88
                        [% ELSE %]
Lines 46-54 Link Here
46
                        [% END # / invalidlist %]
94
                        [% END # / invalidlist %]
47
95
48
                    </div> <!-- / #userdownloadshelf -->
96
                    </div> <!-- / #userdownloadshelf -->
49
                </div> <!-- / .span10 -->
97
50
            </div> <!-- / .row-fluid -->
98
[% IF ( fullpage ) %]
51
        </div> <!-- / .container-fluid -->
99
                    </div> <!-- / .span10 -->
52
    </div> <!-- / .main -->
100
                </div> <!-- / .row-fluid -->
53
[% INCLUDE 'opac-bottom.inc' is_popup=1 %]
101
            </div> <!-- / .container-fluid -->
54
[% BLOCK jsinclude %][% END %]
102
        </div> <!-- / .main -->
103
    [% INCLUDE 'opac-bottom.inc' %]
104
    [% BLOCK jsinclude %]
105
        <script type="text/javascript">
106
            //<![CDATA[
107
                $(document).ready(function(){
108
                    $("#userdownloadshelf form").on("submit",function(e){
109
                        if( $("#dlformat").val() == "" ){
110
                            e.preventDefault();
111
                            alert(_("Please choose a download format"));
112
                        }
113
                    });
114
                });
115
            //]]>
116
        </script>
117
    [% END %]
118
[% END # / IF fullpage %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-1 / +16 lines)
Lines 156-162 Link Here
156
                            <div id="toolbar" class="toolbar clearfix">
156
                            <div id="toolbar" class="toolbar clearfix">
157
                                <div class="list-actions">
157
                                <div class="list-actions">
158
                                    <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a> <span class="sep">|</span>
158
                                    <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New list</a> <span class="sep">|</span>
159
                                    <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]" class="download" onclick="open('/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false;">Download list</a>
159
                                    <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]&amp;showprivateshelves=[% showprivateshelves %]" class="download" data-toggle="modal" data-target="#modalWin">Download list</a>
160
160
161
                                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
161
                                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
162
                                        <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>
162
                                        <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>
Lines 805-810 Link Here
805
    </div> <!-- / .container-fluid -->
805
    </div> <!-- / .container-fluid -->
806
  </div> <!-- / .main -->
806
  </div> <!-- / .main -->
807
807
808
<div class="modal hide" id="modalWin" role="dialog" aria-hidden="true" tabindex="-1">
809
    <div class="modal-content">
810
        <div class="modal-body">
811
            <div style="margin:1em;padding:1em;font-size:150%;">
812
                <img src="[% interface %]/[% theme %]/images/loading.gif" /> Loading
813
            </div>
814
        </div>
815
    </div>
816
</div>
817
808
<!-- DEBUG -->
818
<!-- DEBUG -->
809
    <div id="debug"></div>
819
    <div id="debug"></div>
810
<!-- /DEBUG -->
820
<!-- /DEBUG -->
Lines 905-910 $(function() { Link Here
905
        });
915
        });
906
    [% END %]
916
    [% END %]
907
917
918
    // If JS is enabled add paramter to download link
919
    var dialoglink = $(".download").attr("href");
920
    dialoglink += "&context=modal";
921
    $(".download").attr("href",dialoglink);
922
908
    $("#CheckAll").click(function(){
923
    $("#CheckAll").click(function(){
909
        $(".checkboxed").checkCheckboxes();
924
        $(".checkboxed").checkCheckboxes();
910
        enableCheckboxActions();
925
        enableCheckboxActions();
(-)a/opac/opac-downloadshelf.pl (-2 / +19 lines)
Lines 46-51 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
46
46
47
my $shelfid = $query->param('shelfid');
47
my $shelfid = $query->param('shelfid');
48
my $format  = $query->param('format');
48
my $format  = $query->param('format');
49
my $context = $query->param('context');
50
my $showprivateshelves = $query->param('showprivateshelves');
49
my $dbh     = C4::Context->dbh;
51
my $dbh     = C4::Context->dbh;
50
52
51
if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $shelfid, 'view' ) ) {
53
if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $shelfid, 'view' ) ) {
Lines 94-101 if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh Link Here
94
        print $output;
96
        print $output;
95
97
96
    } else {
98
    } else {
99
100
        # get details of the list
101
        my ($shelfnumber,$shelfname,$owner,$category,$sorton) = GetShelf($shelfid);
102
103
        # if modal context is passed set a variable so that page markup can be different
104
        if($context eq "modal"){
105
            $template->param(modal => 1);
106
        } else {
107
            $template->param(fullpage => 1);
108
        }
97
        $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
109
        $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
98
        $template->param(shelfid => $shelfid); 
110
        $template->param(
111
            showprivateshelves  => $showprivateshelves,
112
            shelfid             => $shelfid,
113
            shelfname           => $shelfname,
114
            shelfnumber         => $shelfnumber,
115
            viewshelf           => $shelfnumber
116
        );
99
        output_html_with_http_headers $query, $cookie, $template->output;
117
        output_html_with_http_headers $query, $cookie, $template->output;
100
    }
118
    }
101
119
102
- 

Return to bug 12519