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

(-)a/Koha/SharedContent.pm (-1 lines)
Lines 178-184 sub buildRequest { Link Here
178
        my $url = "$MANA_IP/$resource.json";
178
        my $url = "$MANA_IP/$resource.json";
179
        my $request = HTTP::Request->new( POST => $url );
179
        my $request = HTTP::Request->new( POST => $url );
180
180
181
        $content->{bulk_import} = 0;
182
        my $json = to_json( $content, { utf8 => 1 } );
181
        my $json = to_json( $content, { utf8 => 1 } );
183
        $request->content($json);
182
        $request->content($json);
184
183
(-)a/installer/data/mysql/atomicupdate/mana_01-add_mana_id.perl (+13 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    if( !column_exists( 'subscription', 'mana_id' ) ) {
4
        $dbh->do( "ALTER TABLE subscription ADD mana_id int(11) NULL DEFAULT NULL" );
5
    }
6
7
    if( !column_exists( 'saved_sql', 'mana_id' ) ) {
8
        $dbh->do( "ALTER TABLE saved_sql ADD mana_id int(11) NULL DEFAULT NULL" );
9
    }
10
11
    SetVersion( $DBversion );
12
    print "Upgrade to $DBversion done (Bug 17047 - Add column mana_id in subscription and saved_sql tables)\n";
13
}
(-)a/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql (-2 lines)
Lines 1-2 Link Here
1
ALTER TABLE subscription ADD mana_id int(11) NULL DEFAULT NULL;
2
ALTER TABLE saved_sql ADD mana_id int(11) NULL DEFAULT NULL;
(-)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 IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('AutoShareWithMana','','','defines datas automatically shared with mana','multiple');
2
('AutoShareWithMana','','','defines datas automatically shared with mana','multiple');
(-)a/installer/data/mysql/atomicupdate/mana_04-add_mana_token.sql (-1 / +1 lines)
Lines 1-2 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('ManaToken','',NULL,'Security token used for authentication on Mana KB service (anti spam)','Textarea');
2
('ManaToken','',NULL,'Security token used for authentication on Mana KB service (anti spam)','Textarea');
(-)a/installer/data/mysql/atomicupdate/skeleton.perl (-1 / +1 lines)
Lines 1-4 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
3
    # you can use $dbh here like:
4
    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
4
    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc (-7 lines)
Lines 1-4 Link Here
1
[% INCLUDE 'mana.inc' %]
2
<div id="toolbar" class="btn-toolbar">
1
<div id="toolbar" class="btn-toolbar">
3
    [% IF ( CAN_user_reports_create_reports ) %]
2
    [% IF ( CAN_user_reports_create_reports ) %]
4
        <div class="btn-group">
3
        <div class="btn-group">
Lines 125-136 Link Here
125
[% END %]
124
[% END %]
126
125
127
<script type="text/javascript">
126
<script type="text/javascript">
128
    $(document).ready( function(){
129
        $(".mana_search_button").on("click",function(){
130
            mana_search($("#mana_search_field").val());
131
        });
132
    });
133
134
    function mana_use( mana_id ){
127
    function mana_use( mana_id ){
135
        $.ajax( {
128
        $.ajax( {
136
            type:"POST",
129
            type:"POST",
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc (-40 lines)
Lines 1-43 Link Here
1
[% INCLUDE 'mana.inc' %]
2
<script type="text/javascript">
3
    //<![CDATA[
4
5
    function confirm_close() {
6
        var is_confirmed = confirm(_("Are you sure you want to close this subscription?"));
7
        if (is_confirmed) {
8
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=close";
9
        }
10
    }
11
    function confirm_reopen() {
12
        var is_confirmed = confirm(_("Are you sure you want to reopen this subscription?"));
13
        if (is_confirmed) {
14
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen";
15
        }
16
    }
17
18
     $(document).ready(function() {
19
        $("#deletesub").click(function(){
20
            confirm_deletion();
21
            return false;
22
        });
23
        $("#reopen").click(function(){
24
            confirm_reopen();
25
            return false;
26
        });
27
        $("#close").click(function(){
28
            confirm_close();
29
            return false;
30
        });
31
        $("#renew").click(function(){
32
            popup([% subscriptionid %]);
33
            return false;
34
        })
35
        $("#mana-subscription-share").click(function() {
36
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=share";
37
        });
38
     });
39
    //]]>
40
    </script>
41
[% IF subscriptionid and ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription || CAN_user_serials_receive_serials ) %]
1
[% IF subscriptionid and ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription || CAN_user_serials_receive_serials ) %]
42
    <div id="toolbar" class="btn-toolbar">
2
    <div id="toolbar" class="btn-toolbar">
43
        [% IF CAN_user_serials_create_subscription %]
3
        [% IF CAN_user_serials_create_subscription %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-9 / +20 lines)
Lines 324-333 canned reports and writing custom SQL reports.</p> Link Here
324
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
324
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
325
                    </div>
325
                    </div>
326
                [% END %]
326
                [% END %]
327
                <div id="note-error" class="alert alert-danger" role="alert">
328
                    Please enter a report name and descriptive note before sharing (minimum 20 characters)
329
                </div>
327
                [% IF ( languages_loop ) %]
330
                [% IF ( languages_loop ) %]
328
                    [% UNLESS ( one_language_enabled ) %]
331
                    [% UNLESS ( one_language_enabled ) %]
329
                        <label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label>
332
                        <div class="shared_infos rows">
330
                        <div id="shared_infos" class="rows">
331
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
333
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
332
                                </li>
334
                                </li>
333
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
335
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
Lines 346-352 canned reports and writing custom SQL reports.</p> Link Here
346
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
348
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
347
                                <input type="hidden" name="phase" value="Share">
349
                                <input type="hidden" name="phase" value="Share">
348
350
349
                                <fieldset>
351
                                <fieldset class="shared_infos">
350
                                    <label for="mana_language">Language:</label>
352
                                    <label for="mana_language">Language:</label>
351
                                    <select id="mana_language" name="mana_language">
353
                                    <select id="mana_language" name="mana_language">
352
                                        [% FOREACH languages_loo IN languages_loop %]
354
                                        [% FOREACH languages_loo IN languages_loop %]
Lines 406-416 canned reports and writing custom SQL reports.</p> Link Here
406
                [% END %]
408
                [% END %]
407
            </div>
409
            </div>
408
            <div class="modal-footer">
410
            <div class="modal-footer">
409
                <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
411
                <button class="btn" id="ManaCloseButton" data-dismiss="modal" aria-hidden="true">Close</button>
410
                [% IF one_language_enabled==0 %]
412
                [% IF one_language_enabled==0 %]
411
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button>
413
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary shared_infos">Share</button>
412
                [% ELSE %]
414
                [% ELSE %]
413
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary">Share</a></div>
415
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary shared_infos">Share</a></div>
414
                [% END %]
416
                [% END %]
415
            </div>
417
            </div>
416
        </div>
418
        </div>
Lines 1052-1057 Sub report:<select name="subreport"> Link Here
1052
1054
1053
[% MACRO jsinclude BLOCK %]
1055
[% MACRO jsinclude BLOCK %]
1054
    [% INCLUDE 'calendar.inc' %]
1056
    [% INCLUDE 'calendar.inc' %]
1057
    [% INCLUDE 'mana.inc' %]
1055
    [% IF ( saved1 ) %]
1058
    [% IF ( saved1 ) %]
1056
        [% INCLUDE 'datatables.inc' %]
1059
        [% INCLUDE 'datatables.inc' %]
1057
    [% END %]
1060
    [% END %]
Lines 1094-1104 Sub report:<select name="subreport"> Link Here
1094
                window.history.back();
1097
                window.history.back();
1095
            });
1098
            });
1096
1099
1100
            $(".mana_search_button").on("click",function(){
1101
                mana_search($("#mana_search_field").val());
1102
            });
1103
1097
            $(".ShareButton").on("click", function(){
1104
            $(".ShareButton").on("click", function(){
1105
                $("#note-error").hide();
1098
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1106
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1099
                    $("#shared_infos").hide();
1107
                    $(".shared_infos").hide();
1100
                    $("#ManaShareButton").hide();
1108
                    $("#note-error").show();
1101
                    $("#noterror").show();
1102
                }
1109
                }
1103
                else{
1110
                else{
1104
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
1111
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
Lines 1110-1115 Sub report:<select name="subreport"> Link Here
1110
                }
1117
                }
1111
            });
1118
            });
1112
1119
1120
            $("#ManaCloseButton").on("click", function() {
1121
                $(".shared_infos").show();
1122
            });
1123
1113
            $("#addColumn").on("click",function(){
1124
            $("#addColumn").on("click",function(){
1114
                addColumn();
1125
                addColumn();
1115
            });
1126
            });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (+1 lines)
Lines 433-438 Link Here
433
[% MACRO jsinclude BLOCK %]
433
[% MACRO jsinclude BLOCK %]
434
    [% INCLUDE 'calendar.inc' %]
434
    [% INCLUDE 'calendar.inc' %]
435
    [% INCLUDE 'datatables.inc' %]
435
    [% INCLUDE 'datatables.inc' %]
436
    [% INCLUDE 'mana.inc' %]
436
    <script type="text/javascript">
437
    <script type="text/javascript">
437
        var subscriptionid = "[% subscriptionid %]";
438
        var subscriptionid = "[% subscriptionid %]";
438
        var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
439
        var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (+2 lines)
Lines 516-521 width: 300px; /* not enough for IE7 apparently */ Link Here
516
516
517
[% MACRO jsinclude BLOCK %]
517
[% MACRO jsinclude BLOCK %]
518
    [% INCLUDE 'calendar.inc' %]
518
    [% INCLUDE 'calendar.inc' %]
519
    [% INCLUDE 'datatables.inc' %]
519
    <script type="text/javascript">
520
    <script type="text/javascript">
520
        var subscriptionid = "[% subscriptionid %]";
521
        var subscriptionid = "[% subscriptionid %]";
521
        var irregularity = "[% irregularity %]";
522
        var irregularity = "[% irregularity %]";
Lines 524-529 width: 300px; /* not enough for IE7 apparently */ Link Here
524
        [% FOREACH field IN dont_export_field_loop %]
525
        [% FOREACH field IN dont_export_field_loop %]
525
            tags.push("[% field.fieldid %]");
526
            tags.push("[% field.fieldid %]");
526
        [% END %]
527
        [% END %]
528
        var mana_enabled = [% Koha.Preference('Mana') %]
527
        var MSG_LINK_TO_VENDOR = _("If you wish to claim late or missing issues you must link this subscription to a vendor. Click OK to ignore or Cancel to return and enter a vendor");
529
        var MSG_LINK_TO_VENDOR = _("If you wish to claim late or missing issues you must link this subscription to a vendor. Click OK to ignore or Cancel to return and enter a vendor");
528
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
530
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
529
        var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date.");
531
        var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date.");
(-)a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js (+3 lines)
Lines 40-43 function popup(subscriptionid) { Link Here
40
        popup( subscriptionid );
40
        popup( subscriptionid );
41
        return false;
41
        return false;
42
    });
42
    });
43
    $("#mana-subscription-share").click(function() {
44
        window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=share";
45
    });
43
 });
46
 });
(-)a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js (-2 / +2 lines)
Lines 617-625 $(document).ready(function() { Link Here
617
    });
617
    });
618
    $("#subscription_add_next").on("click",function(){
618
    $("#subscription_add_next").on("click",function(){
619
        if ( Check_page1() ){
619
        if ( Check_page1() ){
620
            [% IF Koha.Preference('Mana') == 1 %]
620
            if ( mana_enabled ) {
621
                mana_search();
621
                mana_search();
622
            [% END %]
622
            }
623
            show_page_2();
623
            show_page_2();
624
        }
624
        }
625
    });
625
    });
(-)a/serials/subscription-add.pl (-3 / +2 lines)
Lines 303-309 sub redirect_add_subscription { Link Here
303
        )->store();
303
        )->store();
304
        $periodicity = $subscription_freq->id;
304
        $periodicity = $subscription_freq->id;
305
    }
305
    }
306
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing($query->Vars);
306
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing({ $query->Vars });
307
307
308
    my $auser          = $query->param('user');
308
    my $auser          = $query->param('user');
309
    my $branchcode     = $query->param('branchcode');
309
    my $branchcode     = $query->param('branchcode');
Lines 410-416 sub redirect_mod_subscription { Link Here
410
        )->store();
410
        )->store();
411
        $periodicity = $subscription_freq->id;
411
        $periodicity = $subscription_freq->id;
412
    }
412
    }
413
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing($query->Vars);
413
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing({ $query->Vars });
414
414
415
    my $subtype = $query->param('subtype');
415
    my $subtype = $query->param('subtype');
416
    my $sublength = $query->param('sublength');
416
    my $sublength = $query->param('sublength');
417
- 

Return to bug 17047