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 (-6 lines)
Lines 132-143 Link Here
132
[% END %]
132
[% END %]
133
133
134
<script type="text/javascript">
134
<script type="text/javascript">
135
    $(document).ready( function(){
136
        $(".mana_search_button").on("click",function(){
137
            mana_search($("#mana_search_field").val());
138
        });
139
    });
140
141
    function mana_use( mana_id ){
135
    function mana_use( mana_id ){
142
        $.ajax( {
136
        $.ajax( {
143
            type:"POST",
137
            type:"POST",
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc (-1 / +1 lines)
Lines 38-44 Link Here
38
        });
38
        });
39
     });
39
     });
40
    //]]>
40
    //]]>
41
    </script>
41
</script>
42
[% IF subscriptionid and ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription || CAN_user_serials_receive_serials ) %]
42
[% IF subscriptionid and ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription || CAN_user_serials_receive_serials ) %]
43
    <div id="toolbar" class="btn-toolbar">
43
    <div id="toolbar" class="btn-toolbar">
44
        [% IF CAN_user_serials_create_subscription %]
44
        [% IF CAN_user_serials_create_subscription %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-9 / +20 lines)
Lines 342-351 canned reports and writing custom SQL reports.</p> Link Here
342
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
342
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
343
                    </div>
343
                    </div>
344
                [% END %]
344
                [% END %]
345
                <div id="note-error" class="alert alert-danger" role="alert">
346
                    Please enter a report name and descriptive note before sharing (minimum 20 characters)
347
                </div>
345
                [% IF ( languages_loop ) %]
348
                [% IF ( languages_loop ) %]
346
                    [% UNLESS ( one_language_enabled ) %]
349
                    [% UNLESS ( one_language_enabled ) %]
347
                        <label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label>
350
                        <div class="shared_infos rows">
348
                        <div id="shared_infos" class="rows">
349
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
351
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
350
                                </li>
352
                                </li>
351
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
353
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
Lines 364-370 canned reports and writing custom SQL reports.</p> Link Here
364
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
366
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
365
                                <input type="hidden" name="phase" value="Share">
367
                                <input type="hidden" name="phase" value="Share">
366
368
367
                                <fieldset>
369
                                <fieldset class="shared_infos">
368
                                    <label for="mana_language">Language:</label>
370
                                    <label for="mana_language">Language:</label>
369
                                    <select id="mana_language" name="mana_language">
371
                                    <select id="mana_language" name="mana_language">
370
                                        [% FOREACH languages_loo IN languages_loop %]
372
                                        [% FOREACH languages_loo IN languages_loop %]
Lines 424-434 canned reports and writing custom SQL reports.</p> Link Here
424
                [% END %]
426
                [% END %]
425
            </div>
427
            </div>
426
            <div class="modal-footer">
428
            <div class="modal-footer">
427
                <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
429
                <button class="btn" id="ManaCloseButton" data-dismiss="modal" aria-hidden="true">Close</button>
428
                [% IF one_language_enabled==0 %]
430
                [% IF one_language_enabled==0 %]
429
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button>
431
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary shared_infos">Share</button>
430
                [% ELSE %]
432
                [% ELSE %]
431
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary">Share</a></div>
433
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary shared_infos">Share</a></div>
432
                [% END %]
434
                [% END %]
433
            </div>
435
            </div>
434
        </div>
436
        </div>
Lines 1061-1066 $(document).ready(function() { Link Here
1061
1063
1062
[% MACRO jsinclude BLOCK %]
1064
[% MACRO jsinclude BLOCK %]
1063
    [% INCLUDE 'calendar.inc' %]
1065
    [% INCLUDE 'calendar.inc' %]
1066
    [% INCLUDE 'mana.inc' %]
1064
    [% IF ( saved1 ) %]
1067
    [% IF ( saved1 ) %]
1065
        [% INCLUDE 'datatables.inc' %]
1068
        [% INCLUDE 'datatables.inc' %]
1066
        [% INCLUDE 'columns_settings.inc' %]
1069
        [% INCLUDE 'columns_settings.inc' %]
Lines 1112-1122 $(document).ready(function() { Link Here
1112
                window.history.back();
1115
                window.history.back();
1113
            });
1116
            });
1114
1117
1118
            $(".mana_search_button").on("click",function(){
1119
                mana_search($("#mana_search_field").val());
1120
            });
1121
1115
            $(".ShareButton").on("click", function(){
1122
            $(".ShareButton").on("click", function(){
1123
                $("#note-error").hide();
1116
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1124
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1117
                    $("#shared_infos").hide();
1125
                    $(".shared_infos").hide();
1118
                    $("#ManaShareButton").hide();
1126
                    $("#note-error").show();
1119
                    $("#noterror").show();
1120
                }
1127
                }
1121
                else{
1128
                else{
1122
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
1129
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
Lines 1128-1133 $(document).ready(function() { Link Here
1128
                }
1135
                }
1129
            });
1136
            });
1130
1137
1138
            $("#ManaCloseButton").on("click", function() {
1139
                $(".shared_infos").show();
1140
            });
1141
1131
            $("#addColumn").on("click",function(){
1142
            $("#addColumn").on("click",function(){
1132
                addColumn();
1143
                addColumn();
1133
            });
1144
            });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (+1 lines)
Lines 416-421 Link Here
416
[% MACRO jsinclude BLOCK %]
416
[% MACRO jsinclude BLOCK %]
417
    [% INCLUDE 'calendar.inc' %]
417
    [% INCLUDE 'calendar.inc' %]
418
    [% INCLUDE 'datatables.inc' %]
418
    [% INCLUDE 'datatables.inc' %]
419
    [% INCLUDE 'mana.inc' %]
419
    <script type="text/javascript">
420
    <script type="text/javascript">
420
        var subscriptionid = "[% subscriptionid | html %]";
421
        var subscriptionid = "[% subscriptionid | html %]";
421
        var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
422
        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 513-518 width: 300px; /* not enough for IE7 apparently */ Link Here
513
513
514
[% MACRO jsinclude BLOCK %]
514
[% MACRO jsinclude BLOCK %]
515
    [% INCLUDE 'calendar.inc' %]
515
    [% INCLUDE 'calendar.inc' %]
516
    [% INCLUDE 'datatables.inc' %]
516
    <script type="text/javascript">
517
    <script type="text/javascript">
517
        var subscriptionid = "[% subscriptionid | html %]";
518
        var subscriptionid = "[% subscriptionid | html %]";
518
        var irregularity = "[% irregularity | html %]";
519
        var irregularity = "[% irregularity | html %]";
Lines 521-526 width: 300px; /* not enough for IE7 apparently */ Link Here
521
        [% FOREACH field IN dont_export_field_loop %]
522
        [% FOREACH field IN dont_export_field_loop %]
522
            tags.push("[% field.fieldid | html %]");
523
            tags.push("[% field.fieldid | html %]");
523
        [% END %]
524
        [% END %]
525
        var mana_enabled = [% Koha.Preference('Mana') %]
524
        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");
526
        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");
525
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
527
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
526
        var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date.");
528
        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 302-308 sub redirect_add_subscription { Link Here
302
        )->store();
302
        )->store();
303
        $periodicity = $subscription_freq->id;
303
        $periodicity = $subscription_freq->id;
304
    }
304
    }
305
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing($query->Vars);
305
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing({ $query->Vars });
306
306
307
    my $auser          = $query->param('user');
307
    my $auser          = $query->param('user');
308
    my $branchcode     = $query->param('branchcode');
308
    my $branchcode     = $query->param('branchcode');
Lines 409-415 sub redirect_mod_subscription { Link Here
409
        )->store();
409
        )->store();
410
        $periodicity = $subscription_freq->id;
410
        $periodicity = $subscription_freq->id;
411
    }
411
    }
412
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing($query->Vars);
412
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing({ $query->Vars });
413
413
414
    my $subtype = $query->param('subtype');
414
    my $subtype = $query->param('subtype');
415
    my $sublength = $query->param('sublength');
415
    my $sublength = $query->param('sublength');
416
- 

Return to bug 17047