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

(-)a/Koha/SharedContent.pm (-1 / +1 lines)
Lines 42-48 sub manaRequest { Link Here
42
42
43
    my $response  = $userAgent->request($mana_request);
43
    my $response  = $userAgent->request($mana_request);
44
44
45
    eval { $result = from_json( $response->decoded_content ); };
45
    eval { $result = from_json( $response->decoded_content, { utf8 => 1} ); };
46
    $result->{code} = $response->code;
46
    $result->{code} = $response->code;
47
    if ( $@ ){
47
    if ( $@ ){
48
        $result->{msg} = $response->{_msg};
48
        $result->{msg} = $response->{_msg};
(-)a/Koha/Subscription.pm (+1 lines)
Lines 61-66 sub get_search_info { Link Here
61
    my $self=shift;
61
    my $self=shift;
62
    my $searched_sub_id = shift;
62
    my $searched_sub_id = shift;
63
    my $biblio = Koha::Biblios->find( { 'biblionumber' => $searched_sub_id } );
63
    my $biblio = Koha::Biblios->find( { 'biblionumber' => $searched_sub_id } );
64
    return unless $biblio;
64
    my $biblioitem =
65
    my $biblioitem =
65
      Koha::Biblioitems->find( { 'biblionumber' => $searched_sub_id } );
66
      Koha::Biblioitems->find( { 'biblionumber' => $searched_sub_id } );
66
67
(-)a/installer/data/mysql/atomicupdate/mana_03-add_mana_autoshare.sql (-1 / +1 lines)
Lines 1-2 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple');
2
('AutoShareWithMana','','','defines datas automatically shared with mana','multiple');
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (-1 / +1 lines)
Lines 118-124 jQuery(function($){ Link Here
118
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
118
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
119
        weekHeader: _("Wk"),
119
        weekHeader: _("Wk"),
120
        dateFormat: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSIF ( dateformat == "dmydot" ) %]dd.mm.yy[% ELSE %]yy-mm-dd[% END %]",
120
        dateFormat: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSIF ( dateformat == "dmydot" ) %]dd.mm.yy[% ELSE %]yy-mm-dd[% END %]",
121
        firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %],
121
        firstDay: '[% Koha.Preference('CalendarFirstDayOfWeek') %]',
122
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
122
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
123
        showMonthAfterYear: false,
123
        showMonthAfterYear: false,
124
        yearSuffix: ''};
124
        yearSuffix: ''};
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc (-1 / +1 lines)
Lines 30-36 Link Here
30
                    [% END %]
30
                    [% END %]
31
                    <input hidden class="rowid" value="[% report.id %]">
31
                    <input hidden class="rowid" value="[% report.id %]">
32
                    <td>[% IF ( report.report_name ) %][% report.report_name %][% END %]</td>
32
                    <td>[% IF ( report.report_name ) %][% report.report_name %][% END %]</td>
33
                    <td title="[% report.savedsql %]"><div>
33
                    <td title="[% report.savedsql |html %]"><div>
34
                        [% IF report.notes.length > 200 %]
34
                        [% IF report.notes.length > 200 %]
35
                            [% report.notes.substr(0,200) %]<a class="showbutton">Show More</a></div><div hidden>
35
                            [% report.notes.substr(0,200) %]<a class="showbutton">Show More</a></div><div hidden>
36
                        [% END %]
36
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-subscription-search-result.inc (-2 / +1 lines)
Lines 4-10 Link Here
4
[% USE Branches %]
4
[% USE Branches %]
5
5
6
6
7
8
[% IF statuscode == "200" %]
7
[% IF statuscode == "200" %]
9
    <table id="mana_results_datatable" width=100%>
8
    <table id="mana_results_datatable" width=100%>
10
        <thead>
9
        <thead>
Lines 62-68 Link Here
62
        </tbody>
61
        </tbody>
63
    </table>
62
    </table>
64
[% ELSE %]
63
[% ELSE %]
65
    <h4> [% msg %] statuscode: [% statuscode %] </h4>
64
    <h4>Mana search fails with the code: [% statuscode %] </h4>
66
[% END %]
65
[% END %]
67
66
68
<div id="comment_box" class="modal" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="display: none;">
67
<div id="comment_box" class="modal" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="display: none;">
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc (+141 lines)
Lines 6-11 Link Here
6
            <ul class="dropdown-menu">
6
            <ul class="dropdown-menu">
7
                <li id="newmenuc"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">New guided report</a> </li>
7
                <li id="newmenuc"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">New guided report</a> </li>
8
                <li id="newsql"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">New SQL report</a> </li>
8
                <li id="newsql"><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL">New SQL report</a> </li>
9
                [% IF Koha.Preference('Mana')==1 %]
10
                <li id="newsql"><a href="" data-toggle="modal" data-target="#mana_search_result">New SQL from Mana</a> </li>
11
                [% END %]
9
            </ul>
12
            </ul>
10
        </div>
13
        </div>
11
    [% END %]
14
    [% END %]
Lines 69-71 Link Here
69
72
70
    [% END %]
73
    [% END %]
71
</div>
74
</div>
75
76
[% IF Koha.Preference('Mana')==1 %]
77
    <div id="mana_search_result" class="modal fade container-fluid" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="width: 100%; left:0%; margin-left: auto; display: none;">
78
        <div class="modal-dialog modal-lg">
79
            <div class="modal-content">
80
                <div class="modal-header">
81
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
82
                    <h3 id="mana_search_result_label"> Mana Search</h3>
83
                </div>
84
                <div>
85
                    <form id="search_form" style="margin-left: 5%">
86
                        Please enter a few key words:
87
                        <input type=text id=mana_search_field>
88
                        <input type=button class="mana_search_button" value="Search">
89
                    </form>
90
                    <div class="modal-body">
91
                    </div>
92
                </div>
93
            </div>
94
        </div>
95
    </div>
96
[% END %]
97
98
<script type="text/javascript">
99
    $(document).ready( function(){
100
        $(".mana_search_button").on("click",function(){
101
            mana_search($("#mana_search_field").val());
102
        });
103
    });
104
105
    $('#search_form').on( "submit", function(event) {
106
        event.preventDefault();
107
        mana_search($(this).children("#mana_search_field").val());
108
    });
109
110
    function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){
111
        $.ajax( {
112
            type: "POST",
113
            url: "/cgi-bin/koha/svc/mana/addvaluetofield",
114
            data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue},
115
            datatype: "json",
116
        }).done( function() {
117
        }).fail( function(){ alert("") });
118
    }
119
120
    function mana_use( mana_id ){
121
        $.ajax( {
122
            type:"POST",
123
            url: "/cgi-bin/koha/svc/mana/use",
124
            data: {id:mana_id, resource: 'report', saveinbase: 1},
125
            dataType: "json",
126
        })
127
        .done( function (result){
128
            if ( result.errmsg ){
129
                alert( result.errmsg );
130
            }
131
            else{
132
                window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&amp;phase=Show%20SQL&mana_success=1&phase=Edit%20SQL");
133
            }
134
        })
135
        .fail( function ( foo, msg, longmsg, bla ){
136
        });
137
    }
138
139
    function mana_search( textquery ){
140
        $.ajax({
141
            type: "POST",
142
            url: "/cgi-bin/koha/svc/mana/search",
143
            data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1},
144
            dataType: "html",
145
        })
146
        .done( function( result ) {
147
            $("#mana_search_result .modal-body").html(result);
148
            $("#mana_search_result_label").text("Results from Mana Knowledge Base");
149
            $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{
150
                "sPaginationType":"four_button",
151
                "autoWidth": false,
152
                "columnDefs": [
153
                    { "width": "35%", "targets": 1 }
154
                ],
155
                "aoColumnDefs": [
156
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
157
                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
158
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
159
                ]
160
            }));
161
            if($("td.dataTables_empty").length == 0){
162
                 $("#mana_search").show();
163
            }
164
165
            $( "select[class='actionreport1']" ).show();
166
            $( "button[class='actionreport2']" ).hide();
167
            $("#CommentButton").on("click", function(){
168
                var resource_type = "report";
169
                var target_id = $("#selected_id").val();
170
                var manamsg = $("#manamsg").val();
171
                mana_comment(target_id, manamsg, resource_type);
172
                $("#comment_box").modal("hide");
173
            });
174
175
            $(".showbutton").on("click", function(){
176
                $(this).parent().hide();
177
                $(this).parent().next().show();
178
            });
179
180
            $("a[class='hidebutton']").on("click", function(){
181
                $(this).parent().hide();
182
                $(this).parent().prev().show();
183
            });
184
185
            $("#commentCloseButton").on("click", function(){
186
                $("#comment_box").modal("hide");
187
            });
188
189
            $(".actionreport1").on("click", function(){
190
                $("#selectedcomment").val($(this).val());
191
                $(this).parent("select").hide();
192
                $(this).parent("select").next().show();
193
            });
194
195
            $(".actionreport2").on("click", function(){
196
                $(this).hide();
197
                $(this).prev().show();
198
                mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1);
199
            });
200
        }).fail( function( result ){
201
        });
202
    }
203
204
    function mana_comment( target_id, manamsg, resource_type ){
205
        $.ajax( {
206
            type: "POST",
207
            url: "/cgi-bin/koha/svc/mana/share",
208
            data: {message: manamsg, resource: resource_type , resource_id: target_id},
209
            datatype: "json",
210
        })
211
    }
212
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-113 / +9 lines)
Lines 161-166 canned reports and writing custom SQL reports.</p> Link Here
161
    </div>
161
    </div>
162
</div>
162
</div>
163
163
164
[% IF report_converted %]
165
    <div class="dialog message">
166
        The report "[% report_converted %]" has been converted.
167
    </div>
168
[% END %]
169
170
164
[% IF ( saved1 ) %]
171
[% IF ( saved1 ) %]
165
[% IF ( savedreports ) %]<h1>Saved reports</h1>
172
[% IF ( savedreports ) %]<h1>Saved reports</h1>
166
173
Lines 185-198 canned reports and writing custom SQL reports.</p> Link Here
185
    </div>
192
    </div>
186
    [% END %]
193
    [% END %]
187
194
188
   [% IF (Koha.Preference('Mana') == 1) %]
189
    <div id="mana_search" class="dialog message">
190
        <p> You want more reports? Check the Mana Knowledge Base <p> <a style="cursor:pointer" data-toggle="modal" data-target="#mana_search_result">Quick Search</a></p>
191
    </div>
192
    [% END %]
193
194
</script>
195
</script>
195
<h1> [% savedreport.sql %]</h1>
196
196
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">
197
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">
197
<input type="hidden" name="phase" value="Delete Multiple" />
198
<input type="hidden" name="phase" value="Delete Multiple" />
198
        <table id="table_reports">
199
        <table id="table_reports">
Lines 224-230 canned reports and writing custom SQL reports.</p> Link Here
224
                            [% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS -->
225
                            [% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS -->
225
                                <input type="checkbox" name="ids" value="[% savedreport.id %]" />
226
                                <input type="checkbox" name="ids" value="[% savedreport.id %]" />
226
                            [% END %]
227
                            [% END %]
227
                        <input hidden class="report_sql" value="[% savedreport.savedsql %]">
228
                        <input hidden class="report_sql" value="[% savedreport.savedsql |html %]">
228
                        </td>
229
                        </td>
229
                        <td class="report_id"><label for="ids">[% savedreport.id %]</label></td>
230
                        <td class="report_id"><label for="ids">[% savedreport.id %]</label></td>
230
                        <td class="report_name">
231
                        <td class="report_name">
Lines 1152-1161 Sub report:<select name="subreport"> Link Here
1152
                window.history.back();
1153
                window.history.back();
1153
            });
1154
            });
1154
1155
1155
            $(".mana_search_button").on("click",function(){
1156
                mana_search($(this).prev().val());
1157
            });
1158
1159
            $(".ShareButton").on("click", function(){
1156
            $(".ShareButton").on("click", function(){
1160
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1157
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1161
                    $("#shared_infos").hide();
1158
                    $("#shared_infos").hide();
Lines 1172-1181 Sub report:<select name="subreport"> Link Here
1172
                }
1169
                }
1173
            });
1170
            });
1174
1171
1175
            $('#search_form').submit(function () {
1176
                return false;
1177
            });
1178
1179
            $("#addColumn").on("click",function(){
1172
            $("#addColumn").on("click",function(){
1180
                addColumn();
1173
                addColumn();
1181
            });
1174
            });
Lines 1360-1462 Sub report:<select name="subreport"> Link Here
1360
                return confirmDelete(MSG_CONFIRM_DELETE);
1353
                return confirmDelete(MSG_CONFIRM_DELETE);
1361
            });
1354
            });
1362
        });
1355
        });
1363
        function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){
1364
            $.ajax( {
1365
                type: "POST",
1366
                url: "/cgi-bin/koha/svc/mana/addvaluetofield",
1367
                data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue},
1368
                datatype: "json",
1369
            }).done( function() {
1370
            }).fail( function(){ });
1371
        }
1372
1373
        function mana_use( mana_id ){
1374
            $.ajax( {
1375
                type:"POST",
1376
                url: "/cgi-bin/koha/svc/mana/use",
1377
                data: {id:mana_id, resource: 'report', saveinbase: 1},
1378
                dataType: "json",
1379
            })
1380
            .done( function (result){
1381
                window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&amp;phase=Show%20SQL");
1382
            })
1383
            .fail( function ( foo, msg, longmsg){
1384
            });
1385
        }
1386
1387
        function mana_search( textquery ){
1388
            $.ajax({
1389
                type: "POST",
1390
                url: "/cgi-bin/koha/svc/mana/search",
1391
                data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1},
1392
                dataType: "html",
1393
            })
1394
            .done( function( result ) {
1395
                $("#mana_search_result .modal-body").html(result);
1396
                $("#mana_search_result_label").text("Results from Mana Knowledge Base");
1397
                $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{
1398
                    "sPaginationType":"four_button",
1399
                    "autoWidth": false,
1400
                    "columnDefs": [
1401
                        { "width": "35%", "targets": 1 }
1402
                    ],
1403
                    "aoColumnDefs": [
1404
                        { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
1405
                        { "sType": "title-string", "aTargets" : [ "title-string" ] },
1406
                        { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
1407
                    ]
1408
                }));
1409
                if($("td.dataTables_empty").length == 0){
1410
                     $("#mana_search").show();
1411
                }
1412
1413
                $( "select[class='actionreport1']" ).show();
1414
                $( "button[class='actionreport2']" ).hide();
1415
                $("#CommentButton").on("click", function(){
1416
                    var resource_type = "report";
1417
                    var target_id = $("#selected_id").val();
1418
                    var manamsg = $("#manamsg").val();
1419
                    mana_comment(target_id, manamsg, resource_type);
1420
                    $("#comment_box").modal("hide");
1421
                });
1422
1423
                $(".showbutton").on("click", function(){
1424
                    $(this).parent().hide();
1425
                    $(this).parent().next().show();
1426
                });
1427
1428
                $("a[class='hidebutton']").on("click", function(){
1429
                    $(this).parent().hide();
1430
                    $(this).parent().prev().show();
1431
                });
1432
1433
                $("#commentCloseButton").on("click", function(){
1434
                    $("#comment_box").modal("hide");
1435
                });
1436
1437
                $(".actionreport1").on("click", function(){
1438
                    $("#selectedcomment").val($(this).val());
1439
                    $(this).parent("select").hide();
1440
                    $(this).parent("select").next().show();
1441
                });
1442
1443
                $(".actionreport2").on("click", function(){
1444
                    $(this).hide();
1445
                    $(this).prev().show();
1446
                    mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1);
1447
                });
1448
            }).fail( function( result ){
1449
            });
1450
        }
1451
1452
        function mana_comment( target_id, manamsg, resource_type ){
1453
            $.ajax( {
1454
                type: "POST",
1455
                url: "/cgi-bin/koha/svc/mana/share",
1456
                data: {message: manamsg, resource: resource_type , resource_id: target_id},
1457
                datatype: "json",
1458
            })
1459
        }
1460
1356
1461
        function addColumn() {
1357
        function addColumn() {
1462
            $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected");
1358
            $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-1 / +1 lines)
Lines 114-120 Link Here
114
                        </ul>
114
                        </ul>
115
                        [% IF mana %]
115
                        [% IF mana %]
116
                            <div id="mana">
116
                            <div id="mana">
117
                                [% INCLUDE 'mana-subscription-search-result.inc' %]
117
                                [% INCLUDE 'mana/mana-subscription-search-result.inc' %]
118
                            </div>
118
                            </div>
119
                        [% ELSE %]
119
                        [% ELSE %]
120
            <div id="opened">
120
            <div id="opened">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-1 lines)
Lines 214-220 width: 300px; /* not enough for IE7 apparently */ Link Here
214
                [% END %]
214
                [% END %]
215
215
216
                        <div hidden id="mana_search" class="dialog message">
216
                        <div hidden id="mana_search" class="dialog message">
217
                            <p>Subscription found on Mana Knowledge Base:</p><p> <a style="cursor:pointer" data-toggle="modal" data-target="#mana_search_result">Quick fill</a></p>
218
                        </div>
217
                        </div>
219
                        <div id="subscription_form_planning">
218
                        <div id="subscription_form_planning">
220
                            <fieldset class="rows">
219
                            <fieldset class="rows">
(-)a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js (-4 / +13 lines)
Lines 393-398 function show_page_2() { Link Here
393
}
393
}
394
394
395
function mana_search() {
395
function mana_search() {
396
    $("#mana_search").html("<p>Mana kb is being asked for your subscription..</p>");
397
    $("#mana_search").show();
398
396
    $.ajax({
399
    $.ajax({
397
        type: "POST",
400
        type: "POST",
398
        url: "/cgi-bin/koha/svc/mana/search",
401
        url: "/cgi-bin/koha/svc/mana/search",
Lines 416-423 function mana_search() { Link Here
416
            ]
419
            ]
417
        }));
420
        }));
418
        if( $("#mana_results_datatable").length && $("td.dataTables_empty").length == 0){
421
        if( $("#mana_results_datatable").length && $("td.dataTables_empty").length == 0){
419
            $("#mana_search").show();
422
            $("#mana_search").html("<p>Subscription found on Mana Knowledge Base:</p><p> <a style='cursor:pointer' data-toggle='modal' data-target='#mana_search_result'>Quick fill</a></p>");
423
        }
424
        else if ( $("#mana_results_datatable").length ){
425
            $("#mana_search").html("<p>No subscription found on Mana Knowledge Base :(</p><p> Please feel free to share you pattern with all others librarians once you are done</p>");
420
        }
426
        }
427
        else{
428
            $("#mana_search").html( result );
429
        }
430
        $("#mana_search").show();
421
        $( "select[class='actionreport1']" ).show();
431
        $( "select[class='actionreport1']" ).show();
422
        $( "button[class='actionreport2']" ).hide();
432
        $( "button[class='actionreport2']" ).hide();
423
433
Lines 446-451 function mana_search() { Link Here
446
        });
456
        });
447
457
448
    }).fail(function(result){
458
    }).fail(function(result){
459
        console.log( msg );
460
        console.log( longmsg );
449
    });
461
    });
450
}
462
}
451
463
Lines 548-556 function removeDisabledAttr() { Link Here
548
560
549
$(document).ready(function() {
561
$(document).ready(function() {
550
    mana_search();
562
    mana_search();
551
    $("#myid").on("click", function(){
552
        debugger;
553
    })
554
    $("#displayexample").hide();
563
    $("#displayexample").hide();
555
    $("#mana_search_result").modal("hide");
564
    $("#mana_search_result").modal("hide");
556
    $("#aqbooksellerid").on('keypress', function(e) {
565
    $("#aqbooksellerid").on('keypress', function(e) {
(-)a/reports/guided_reports.pl (+1 lines)
Lines 181-186 elsif ( $phase eq 'Show SQL'){ Link Here
181
        'notes'      => $report->{notes},
181
        'notes'      => $report->{notes},
182
	'sql'     => $report->{savedsql},
182
	'sql'     => $report->{savedsql},
183
	'showsql' => 1,
183
	'showsql' => 1,
184
        'mana_success' => $input->param('mana_success'),
184
    );
185
    );
185
}
186
}
186
187
(-)a/serials/serials-search.pl (+3 lines)
Lines 96-101 for my $field ( @$additional_fields ) { Link Here
96
96
97
my $expiration_date_dt = $expiration_date ? dt_from_string( $expiration_date ) : undef;
97
my $expiration_date_dt = $expiration_date ? dt_from_string( $expiration_date ) : undef;
98
my @subscriptions;
98
my @subscriptions;
99
my $mana_statuscode;
99
if ($searched){
100
if ($searched){
100
    if ($mana) {
101
    if ($mana) {
101
        my $result = Koha::SharedContent::manaGetRequest("subscription",{
102
        my $result = Koha::SharedContent::manaGetRequest("subscription",{
Lines 104-109 if ($searched){ Link Here
104
            ean          => $EAN,
105
            ean          => $EAN,
105
            publisher    => $publisher
106
            publisher    => $publisher
106
        });
107
        });
108
        $mana_statuscode = $result->{code};
107
        @subscriptions = @{ $result->{data} };
109
        @subscriptions = @{ $result->{data} };
108
    }
110
    }
109
    else {
111
    else {
Lines 127-132 if ($searched){ Link Here
127
if ($mana) {
129
if ($mana) {
128
    $template->param(
130
    $template->param(
129
        subscriptions => \@subscriptions,
131
        subscriptions => \@subscriptions,
132
        statuscode    => $mana_statuscode,
130
        total         => scalar @subscriptions,
133
        total         => scalar @subscriptions,
131
        title_filter  => $title,
134
        title_filter  => $title,
132
        ISSN_filter   => $ISSN,
135
        ISSN_filter   => $ISSN,
(-)a/serials/subscription-add.pl (-1 / +1 lines)
Lines 304-310 sub manage_subscription_numbering_pattern_id { Link Here
304
            return $existing->id;
304
            return $existing->id;
305
        }
305
        }
306
306
307
        $params->{label} = Koha::Subscription::Numberpattern->uniqueLabel($query->param('patternname'));
307
        $params->{label} = Koha::Subscription::Numberpatterns->uniqueLabel($query->param('patternname'));
308
        $params->{description} = $query->param('sndescription');
308
        $params->{description} = $query->param('sndescription');
309
309
310
310
(-)a/svc/mana/share (-1 / +19 lines)
Lines 45-47 $content->{resource_id} = $input->param("resource_id"); Link Here
45
$content->{resource_type} = $input->param("resource");
45
$content->{resource_type} = $input->param("resource");
46
$content->{message} = $input->param("message");
46
$content->{message} = $input->param("message");
47
Koha::SharedContent::manaPostRequest('resource_comment', $content);
47
Koha::SharedContent::manaPostRequest('resource_comment', $content);
48
- 
48
    my $package = "Koha::".ucfirst($input->param('resource'));
49
    my $resource;
50
    my $result;
51
eval{
52
    $result = Koha::SharedContent::manaGetRequestWithId($input->param('resource'), $input->param('id') );
53
};
54
if ( $@ or $result->{code} == 500 ){
55
    $resource->{errmsg} =  "Error: mana access got broken, please try again later\n\n ( error: $@ )";
56
}
57
else{
58
    if ( $input->param( 'saveinbase' )) {
59
        $resource = { id => $package->new_from_mana($result->{data})->id };
60
    }
61
    else{
62
        $resource = $result->{data};
63
    }
64
}
65
66
print(to_json($resource));

Return to bug 17047