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 119-124 sub get_search_info { Link Here
119
    my $self=shift;
119
    my $self=shift;
120
    my $searched_sub_id = shift;
120
    my $searched_sub_id = shift;
121
    my $biblio = Koha::Biblios->find( { 'biblionumber' => $searched_sub_id } );
121
    my $biblio = Koha::Biblios->find( { 'biblionumber' => $searched_sub_id } );
122
    return unless $biblio;
122
    my $biblioitem =
123
    my $biblioitem =
123
      Koha::Biblioitems->find( { 'biblionumber' => $searched_sub_id } );
124
      Koha::Biblioitems->find( { 'biblionumber' => $searched_sub_id } );
124
125
(-)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') | html %],
121
        firstDay: '[% Koha.Preference('CalendarFirstDayOfWeek') | html %]',
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 77-79 Link Here
77
80
78
    [% END %]
81
    [% END %]
79
</div>
82
</div>
83
84
[% IF Koha.Preference('Mana')==1 %]
85
    <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;">
86
        <div class="modal-dialog modal-lg">
87
            <div class="modal-content">
88
                <div class="modal-header">
89
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
90
                    <h3 id="mana_search_result_label"> Mana Search</h3>
91
                </div>
92
                <div>
93
                    <form id="search_form" style="margin-left: 5%">
94
                        Please enter a few key words:
95
                        <input type=text id=mana_search_field>
96
                        <input type=button class="mana_search_button" value="Search">
97
                    </form>
98
                    <div class="modal-body">
99
                    </div>
100
                </div>
101
            </div>
102
        </div>
103
    </div>
104
[% END %]
105
106
<script type="text/javascript">
107
    $(document).ready( function(){
108
        $(".mana_search_button").on("click",function(){
109
            mana_search($("#mana_search_field").val());
110
        });
111
    });
112
113
    $('#search_form').on( "submit", function(event) {
114
        event.preventDefault();
115
        mana_search($(this).children("#mana_search_field").val());
116
    });
117
118
    function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){
119
        $.ajax( {
120
            type: "POST",
121
            url: "/cgi-bin/koha/svc/mana/addvaluetofield",
122
            data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue},
123
            datatype: "json",
124
        }).done( function() {
125
        }).fail( function(){ alert("") });
126
    }
127
128
    function mana_use( mana_id ){
129
        $.ajax( {
130
            type:"POST",
131
            url: "/cgi-bin/koha/svc/mana/use",
132
            data: {id:mana_id, resource: 'report', saveinbase: 1},
133
            dataType: "json",
134
        })
135
        .done( function (result){
136
            if ( result.errmsg ){
137
                alert( result.errmsg );
138
            }
139
            else{
140
                window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&amp;phase=Show%20SQL&mana_success=1&phase=Edit%20SQL");
141
            }
142
        })
143
        .fail( function ( foo, msg, longmsg, bla ){
144
        });
145
    }
146
147
    function mana_search( textquery ){
148
        $.ajax({
149
            type: "POST",
150
            url: "/cgi-bin/koha/svc/mana/search",
151
            data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1},
152
            dataType: "html",
153
        })
154
        .done( function( result ) {
155
            $("#mana_search_result .modal-body").html(result);
156
            $("#mana_search_result_label").text("Results from Mana Knowledge Base");
157
            $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{
158
                "sPaginationType":"four_button",
159
                "autoWidth": false,
160
                "columnDefs": [
161
                    { "width": "35%", "targets": 1 }
162
                ],
163
                "aoColumnDefs": [
164
                    { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
165
                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
166
                    { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
167
                ]
168
            }));
169
            if($("td.dataTables_empty").length == 0){
170
                 $("#mana_search").show();
171
            }
172
173
            $( "select[class='actionreport1']" ).show();
174
            $( "button[class='actionreport2']" ).hide();
175
            $("#CommentButton").on("click", function(){
176
                var resource_type = "report";
177
                var target_id = $("#selected_id").val();
178
                var manamsg = $("#manamsg").val();
179
                mana_comment(target_id, manamsg, resource_type);
180
                $("#comment_box").modal("hide");
181
            });
182
183
            $(".showbutton").on("click", function(){
184
                $(this).parent().hide();
185
                $(this).parent().next().show();
186
            });
187
188
            $("a[class='hidebutton']").on("click", function(){
189
                $(this).parent().hide();
190
                $(this).parent().prev().show();
191
            });
192
193
            $("#commentCloseButton").on("click", function(){
194
                $("#comment_box").modal("hide");
195
            });
196
197
            $(".actionreport1").on("click", function(){
198
                $("#selectedcomment").val($(this).val());
199
                $(this).parent("select").hide();
200
                $(this).parent("select").next().show();
201
            });
202
203
            $(".actionreport2").on("click", function(){
204
                $(this).hide();
205
                $(this).prev().show();
206
                mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1);
207
            });
208
        }).fail( function( result ){
209
        });
210
    }
211
212
    function mana_comment( target_id, manamsg, resource_type ){
213
        $.ajax( {
214
            type: "POST",
215
            url: "/cgi-bin/koha/svc/mana/share",
216
            data: {message: manamsg, resource: resource_type , resource_id: target_id},
217
            datatype: "json",
218
        })
219
    }
220
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-113 / +9 lines)
Lines 149-154 canned reports and writing custom SQL reports.</p> Link Here
149
    </div>
149
    </div>
150
</div>
150
</div>
151
151
152
[% IF report_converted %]
153
    <div class="dialog message">
154
        The report "[% report_converted %]" has been converted.
155
    </div>
156
[% END %]
157
158
152
[% IF ( saved1 ) %]
159
[% IF ( saved1 ) %]
153
[% IF ( savedreports ) %]<h1>Saved reports</h1>
160
[% IF ( savedreports ) %]<h1>Saved reports</h1>
154
161
Lines 190-203 canned reports and writing custom SQL reports.</p> Link Here
190
    </div>
197
    </div>
191
    [% END %]
198
    [% END %]
192
199
193
   [% IF (Koha.Preference('Mana') == 1) %]
194
    <div id="mana_search" class="dialog message">
195
        <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>
196
    </div>
197
    [% END %]
198
199
</script>
200
</script>
200
<h1> [% savedreport.sql %]</h1>
201
201
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">
202
<form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">
202
<input type="hidden" name="phase" value="Delete Multiple" />
203
<input type="hidden" name="phase" value="Delete Multiple" />
203
        <table id="table_reports">
204
        <table id="table_reports">
Lines 237-243 canned reports and writing custom SQL reports.</p> Link Here
237
                            [% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS -->
238
                            [% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS -->
238
                                <input type="checkbox" name="ids" value="[% savedreport.id | html %]" />
239
                                <input type="checkbox" name="ids" value="[% savedreport.id | html %]" />
239
                            [% END %]
240
                            [% END %]
240
                        <input hidden class="report_sql" value="[% savedreport.savedsql %]">
241
                        <input hidden class="report_sql" value="[% savedreport.savedsql |html %]">
241
                        </td>
242
                        </td>
242
                        <td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td>
243
                        <td class="report_id"><label for="ids">[% savedreport.id | html %]</label></td>
243
                        <td class="report_name">
244
                        <td class="report_name">
Lines 1273-1282 $(document).ready(function() { Link Here
1273
                window.history.back();
1274
                window.history.back();
1274
            });
1275
            });
1275
1276
1276
            $(".mana_search_button").on("click",function(){
1277
                mana_search($(this).prev().val());
1278
            });
1279
1280
            $(".ShareButton").on("click", function(){
1277
            $(".ShareButton").on("click", function(){
1281
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1278
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1282
                    $("#shared_infos").hide();
1279
                    $("#shared_infos").hide();
Lines 1293-1302 $(document).ready(function() { Link Here
1293
                }
1290
                }
1294
            });
1291
            });
1295
1292
1296
            $('#search_form').submit(function () {
1297
                return false;
1298
            });
1299
1300
            $("#addColumn").on("click",function(){
1293
            $("#addColumn").on("click",function(){
1301
                addColumn();
1294
                addColumn();
1302
            });
1295
            });
Lines 1488-1590 $(document).ready(function() { Link Here
1488
                return confirmDelete(MSG_CONFIRM_DELETE);
1481
                return confirmDelete(MSG_CONFIRM_DELETE);
1489
            });
1482
            });
1490
        });
1483
        });
1491
        function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){
1492
            $.ajax( {
1493
                type: "POST",
1494
                url: "/cgi-bin/koha/svc/mana/addvaluetofield",
1495
                data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue},
1496
                datatype: "json",
1497
            }).done( function() {
1498
            }).fail( function(){ });
1499
        }
1500
1501
        function mana_use( mana_id ){
1502
            $.ajax( {
1503
                type:"POST",
1504
                url: "/cgi-bin/koha/svc/mana/use",
1505
                data: {id:mana_id, resource: 'report', saveinbase: 1},
1506
                dataType: "json",
1507
            })
1508
            .done( function (result){
1509
                window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&amp;phase=Show%20SQL");
1510
            })
1511
            .fail( function ( foo, msg, longmsg){
1512
            });
1513
        }
1514
1515
        function mana_search( textquery ){
1516
            $.ajax({
1517
                type: "POST",
1518
                url: "/cgi-bin/koha/svc/mana/search",
1519
                data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1},
1520
                dataType: "html",
1521
            })
1522
            .done( function( result ) {
1523
                $("#mana_search_result .modal-body").html(result);
1524
                $("#mana_search_result_label").text("Results from Mana Knowledge Base");
1525
                $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{
1526
                    "sPaginationType":"four_button",
1527
                    "autoWidth": false,
1528
                    "columnDefs": [
1529
                        { "width": "35%", "targets": 1 }
1530
                    ],
1531
                    "aoColumnDefs": [
1532
                        { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
1533
                        { "sType": "title-string", "aTargets" : [ "title-string" ] },
1534
                        { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
1535
                    ]
1536
                }));
1537
                if($("td.dataTables_empty").length == 0){
1538
                     $("#mana_search").show();
1539
                }
1540
1541
                $( "select[class='actionreport1']" ).show();
1542
                $( "button[class='actionreport2']" ).hide();
1543
                $("#CommentButton").on("click", function(){
1544
                    var resource_type = "report";
1545
                    var target_id = $("#selected_id").val();
1546
                    var manamsg = $("#manamsg").val();
1547
                    mana_comment(target_id, manamsg, resource_type);
1548
                    $("#comment_box").modal("hide");
1549
                });
1550
1551
                $(".showbutton").on("click", function(){
1552
                    $(this).parent().hide();
1553
                    $(this).parent().next().show();
1554
                });
1555
1556
                $("a[class='hidebutton']").on("click", function(){
1557
                    $(this).parent().hide();
1558
                    $(this).parent().prev().show();
1559
                });
1560
1561
                $("#commentCloseButton").on("click", function(){
1562
                    $("#comment_box").modal("hide");
1563
                });
1564
1565
                $(".actionreport1").on("click", function(){
1566
                    $("#selectedcomment").val($(this).val());
1567
                    $(this).parent("select").hide();
1568
                    $(this).parent("select").next().show();
1569
                });
1570
1571
                $(".actionreport2").on("click", function(){
1572
                    $(this).hide();
1573
                    $(this).prev().show();
1574
                    mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1);
1575
                });
1576
            }).fail( function( result ){
1577
            });
1578
        }
1579
1580
        function mana_comment( target_id, manamsg, resource_type ){
1581
            $.ajax( {
1582
                type: "POST",
1583
                url: "/cgi-bin/koha/svc/mana/share",
1584
                data: {message: manamsg, resource: resource_type , resource_id: target_id},
1585
                datatype: "json",
1586
            })
1587
        }
1588
1484
1589
        function addColumn() {
1485
        function addColumn() {
1590
            $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected");
1486
            $("#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 296-302 Link Here
296
            </ul>
296
            </ul>
297
            [% IF mana %]
297
            [% IF mana %]
298
                <div id="mana">
298
                <div id="mana">
299
                    [% INCLUDE 'mana-subscription-search-result.inc' %]
299
                    [% INCLUDE 'mana/mana-subscription-search-result.inc' %]
300
                </div>
300
                </div>
301
            [% ELSE %]
301
            [% ELSE %]
302
            <div id="opened">
302
            <div id="opened">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-1 lines)
Lines 216-222 width: 300px; /* not enough for IE7 apparently */ Link Here
216
                [% END %]
216
                [% END %]
217
217
218
                        <div hidden id="mana_search" class="dialog message">
218
                        <div hidden id="mana_search" class="dialog message">
219
                            <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>
220
                        </div>
219
                        </div>
221
                        <div id="subscription_form_planning">
220
                        <div id="subscription_form_planning">
222
                            <fieldset class="rows">
221
                            <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 182-187 elsif ( $phase eq 'Show SQL'){ Link Here
182
        'notes'      => $report->notes,
182
        'notes'      => $report->notes,
183
        'sql'     => $report->savedsql,
183
        'sql'     => $report->savedsql,
184
        'showsql' => 1,
184
        'showsql' => 1,
185
        'mana_success' => $input->param('mana_success'),
185
    );
186
    );
186
}
187
}
187
188
(-)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