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

(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 845-851 if ( $op eq "addbiblio" ) { Link Here
845
        }
845
        }
846
        else {
846
        else {
847
            if ($previewrecord) {
847
            if ($previewrecord) {
848
                AddBiblioToBatch(1, 0, $record, 'biblio', int(rand(99999)), 0);
848
                AddBiblioToBatch(1, 0, $record, 'biblio', int(rand(99999)), 1);
849
                print $input->redirect('/cgi-bin/koha/cataloguing/addbooks.pl');
849
                print $input->redirect('/cgi-bin/koha/cataloguing/addbooks.pl');
850
            } else {
850
            } else {
851
                if ($breedingid) {
851
                if ($breedingid) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (-2 / +2 lines)
Lines 44-50 Link Here
44
            </ul>
44
            </ul>
45
        </div>
45
        </div>
46
        [% END %]
46
        [% END %]
47
         <a class="btn btn-default btn-sm" href="/cgi-bin/koha/cataloguing/draftrecords.pl">View Draft records</a></button>
47
         <a class="btn btn-default btn-sm" href="/cgi-bin/koha/cataloguing/draftrecords.pl"><i class="fa fa-eye" aria-hidden="true"></i> View draft records</a></button>
48
    [% IF ( total ) %]
48
    [% IF ( total ) %]
49
        <div class="btn-group"><button type="submit" class="btn btn-default btn-sm merge-items"><i class="fa fa-compress"></i> Merge selected</button></div>
49
        <div class="btn-group"><button type="submit" class="btn btn-default btn-sm merge-items"><i class="fa fa-compress"></i> Merge selected</button></div>
50
    [% END %]
50
    [% END %]
Lines 143-149 Link Here
143
    </table>
143
    </table>
144
</div>
144
</div>
145
[% ELSE %]
145
[% ELSE %]
146
    [% IF ( (query) && !(drafts_only) ) %]
146
    [% IF ((query) && !(drafts_only)) %]
147
        [% IF ( error ) %]<div class="dialog alert">[% END %]<b>No results found</b>
147
        [% IF ( error ) %]<div class="dialog alert">[% END %]<b>No results found</b>
148
        [% IF ( error ) %]
148
        [% IF ( error ) %]
149
            Error: <span class="error">[% error %]</span></div>
149
            Error: <span class="error">[% error %]</span></div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/draftrecords.tt (-1 / +147 lines)
Line 0 Link Here
0
- 
1
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Cataloging &rsaquo; Draft records</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'browser-strings.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
7
<style type="text/css">
8
    #jobpanel,#jobstatus,#jobfailed { display : none; }
9
    span.change-status { font-style:italic; color:#666; display:none; }
10
</style>
11
</head>
12
<body class="cat">
13
14
[% INCLUDE 'header.inc' %]
15
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloguing</a> &rsaquo; View draft records</div>
16
17
<div id="doc" class="yui-t2">
18
   <div id="bd">
19
        <div id="yui-main">
20
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
21
              <div id="toolbar" class="btn-toolbar">
22
                 [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
23
                   <a id="useadvanced" href="/cgi-bin/koha/cataloguing/editor.pl" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> Advanced editor</a>
24
                 [% END %]
25
                 <div class="btn-group">
26
                     <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New record <span class="caret"></span></button>
27
                     <ul class="dropdown-menu">
28
                        <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
29
                        [% FOREACH framework IN frameworks %]
30
                           <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode %]">[% framework.frameworktext %]</a></li>
31
                        [% END %]
32
                     </ul>
33
                 </div>
34
                 [% IF servers.count > 0 %]
35
                    <div class="btn-group">
36
                        <button class="btn btn-default btn-sm" id="z3950search"><i class="fa fa-search"></i> New from Z39.50/SRU</button>
37
                        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
38
                        <span class="caret"></span>
39
                        </button>
40
                        <ul class="dropdown-menu">
41
                            <li id="" class="z3950searchFw"><a href="#">Default framework</a></li>
42
                            [% FOREACH framework IN frameworks %]
43
                              <li id="[% framework.frameworkcode %]" class="z3950searchFw"><a href="#">[% framework.frameworktext %]</a></li>
44
                            [% END %]
45
                        </ul>
46
                    </div>
47
                 [% END %]
48
                 <a class="btn btn-default btn-sm" href="/cgi-bin/koha/cataloguing/draftrecords.pl"><i class="fa fa-eye" aria-hidden="true"></i> View draft records</a></button>
49
                 [% IF ( total ) %]
50
                    <div class="btn-group"><button type="submit" class="btn btn-default btn-sm merge-items"><i class="fa fa-compress"></i> Merge selected</button></div>
51
                 [% END %]
52
              </div>
53
            [% END %]
54
55
            <h1>View draft records</h1>
56
                <div id="draftrecords">
57
                    <p> To edit or save these draft records click the 'Edit' link beside the appropriate record. </p>
58
                    <form action="/cgi-bin/koha/cataloguing/draftrecords.pl" method="post">
59
                        <input type="hidden" name="op" id="delete_all_drafts" value='delete_all'/>
60
                        <button type="submit">Delete all drafts from reservoir</button>
61
                    </form>
62
                    <table id="records-table">
63
                        <thead>
64
                            <tr>
65
                                <th>#</th>
66
                                <th>Citation</th>
67
                                <th>Status</th>
68
                                <th>Edit record</th>
69
                                <th>Delete record</th>
70
                            </tr>
71
                        </thead>
72
                    </table>
73
                </div>
74
        </div>
75
   </div>
76
</div>
77
78
</body>
79
80
[% MACRO jsinclude BLOCK %]
81
<script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu_[% KOHA_VERSION %].js"></script>
82
<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar_[% KOHA_VERSION %].js"></script>
83
[% INCLUDE 'datatables.inc' %]
84
<script type="text/javascript">
85
    $(document).ready(function(){
86
       $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, {
87
          "bSort": true,
88
          "order": [0, "desc"],
89
          "bAutoWidth": false,
90
          "bFilter": false,
91
          "bProcessing": true,
92
          "bServerSide": true,
93
          "sAjaxSource": 'batch_records_ajax.pl',
94
          "sPaginationType": "full_numbers",
95
          "sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">',
96
          "aoColumns": [
97
             { "mDataProp": "import_record_id" },
98
             { "mDataProp": "citation" },
99
             { "mDataProp": "status" },
100
             { "mDataProp": "catalog_link" },
101
             { "mDataProp": "delete_link" }
102
          ],
103
          "fnServerData": function ( sSource, aoData, fnCallback ) {
104
              aoData.push( { "name": "import_batch_id", "value": 1 } );
105
              $.ajax({
106
                 'dataType': 'json',
107
                 'type': 'POST',
108
                 'url': sSource,
109
                 'data': aoData,
110
                 'success': function(json){
111
                     fnCallback(json);
112
                 }
113
              });
114
          },
115
          "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
116
            [% IF ( record_type == 'auth' ) %]
117
               var record_details_url = "/cgi-bin/koha/authorities/detail.pl?authid=";
118
            [% ELSE %]
119
               var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber=";
120
            [% END %]
121
122
            $('td:eq(1)', nRow).html(
123
               '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>'
124
            );
125
126
            $('td:eq(2)', nRow).html(
127
                aData['status'] == 'staged'   ? _("Draft")   :
128
                aData['status']
129
            );
130
131
            if (aData['catalog_link']){
132
                $('td:eq(3)', nRow).html(
133
                   '<a href="' + aData['catalog_link'] + '">' + "Edit" + '</a>'
134
                );
135
            }
136
            if (aData['delete_link']){
137
                $('td:eq(4)', nRow).html(
138
                   '<a href="' + aData['delete_link'] + '">' + "Delete" + '</a>'
139
                );
140
            }
141
          },
142
       }));
143
    });
144
</script>
145
[% END %]
146
147
[% INCLUDE 'intranet-bottom.inc' %]

Return to bug 20678