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 139-150 Link Here
139
[% END %]
139
[% END %]
140
140
141
<script type="text/javascript">
141
<script type="text/javascript">
142
    $(document).ready( function(){
143
        $(".mana_search_button").on("click",function(){
144
            mana_search($("#mana_search_field").val());
145
        });
146
    });
147
148
    function mana_use( mana_id ){
142
    function mana_use( mana_id ){
149
        $.ajax( {
143
        $.ajax( {
150
            type:"POST",
144
            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 352-361 canned reports and writing custom SQL reports.</p> Link Here
352
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
352
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
353
                    </div>
353
                    </div>
354
                [% END %]
354
                [% END %]
355
                <div id="note-error" class="alert alert-danger" role="alert">
356
                    Please enter a report name and descriptive note before sharing (minimum 20 characters)
357
                </div>
355
                [% IF ( languages_loop ) %]
358
                [% IF ( languages_loop ) %]
356
                    [% UNLESS ( one_language_enabled ) %]
359
                    [% UNLESS ( one_language_enabled ) %]
357
                        <label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label>
360
                        <div class="shared_infos rows">
358
                        <div id="shared_infos" class="rows">
359
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
361
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
360
                                </li>
362
                                </li>
361
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
363
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
Lines 374-380 canned reports and writing custom SQL reports.</p> Link Here
374
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
376
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
375
                                <input type="hidden" name="phase" value="Share">
377
                                <input type="hidden" name="phase" value="Share">
376
378
377
                                <fieldset>
379
                                <fieldset class="shared_infos">
378
                                    <label for="mana_language">Language:</label>
380
                                    <label for="mana_language">Language:</label>
379
                                    <select id="mana_language" name="mana_language">
381
                                    <select id="mana_language" name="mana_language">
380
                                        [% FOREACH languages_loo IN languages_loop %]
382
                                        [% FOREACH languages_loo IN languages_loop %]
Lines 434-444 canned reports and writing custom SQL reports.</p> Link Here
434
                [% END %]
436
                [% END %]
435
            </div>
437
            </div>
436
            <div class="modal-footer">
438
            <div class="modal-footer">
437
                <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
439
                <button class="btn" id="ManaCloseButton" data-dismiss="modal" aria-hidden="true">Close</button>
438
                [% IF one_language_enabled==0 %]
440
                [% IF one_language_enabled==0 %]
439
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button>
441
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary shared_infos">Share</button>
440
                [% ELSE %]
442
                [% ELSE %]
441
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary">Share</a></div>
443
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary shared_infos">Share</a></div>
442
                [% END %]
444
                [% END %]
443
            </div>
445
            </div>
444
        </div>
446
        </div>
Lines 1067-1072 canned reports and writing custom SQL reports.</p> Link Here
1067
    [% Asset.js("lib/d3c3/d3.min.js") | $raw %]
1069
    [% Asset.js("lib/d3c3/d3.min.js") | $raw %]
1068
    [% Asset.js("lib/d3c3/c3.min.js") | $raw %]
1070
    [% Asset.js("lib/d3c3/c3.min.js") | $raw %]
1069
    [% INCLUDE 'calendar.inc' %]
1071
    [% INCLUDE 'calendar.inc' %]
1072
    [% INCLUDE 'mana.inc' %]
1070
    [% IF ( saved1 ) %]
1073
    [% IF ( saved1 ) %]
1071
        [% INCLUDE 'datatables.inc' %]
1074
        [% INCLUDE 'datatables.inc' %]
1072
        [% INCLUDE 'columns_settings.inc' %]
1075
        [% INCLUDE 'columns_settings.inc' %]
Lines 1274-1284 canned reports and writing custom SQL reports.</p> Link Here
1274
                window.history.back();
1277
                window.history.back();
1275
            });
1278
            });
1276
1279
1280
            $(".mana_search_button").on("click",function(){
1281
                mana_search($("#mana_search_field").val());
1282
            });
1283
1277
            $(".ShareButton").on("click", function(){
1284
            $(".ShareButton").on("click", function(){
1285
                $("#note-error").hide();
1278
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1286
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1279
                    $("#shared_infos").hide();
1287
                    $(".shared_infos").hide();
1280
                    $("#ManaShareButton").hide();
1288
                    $("#note-error").show();
1281
                    $("#noterror").show();
1282
                }
1289
                }
1283
                else{
1290
                else{
1284
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
1291
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
Lines 1290-1295 canned reports and writing custom SQL reports.</p> Link Here
1290
                }
1297
                }
1291
            });
1298
            });
1292
1299
1300
            $("#ManaCloseButton").on("click", function() {
1301
                $(".shared_infos").show();
1302
            });
1303
1293
            $("#addColumn").on("click",function(){
1304
            $("#addColumn").on("click",function(){
1294
                addColumn();
1305
                addColumn();
1295
            });
1306
            });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (+1 lines)
Lines 421-426 Link Here
421
[% MACRO jsinclude BLOCK %]
421
[% MACRO jsinclude BLOCK %]
422
    [% INCLUDE 'calendar.inc' %]
422
    [% INCLUDE 'calendar.inc' %]
423
    [% INCLUDE 'datatables.inc' %]
423
    [% INCLUDE 'datatables.inc' %]
424
    [% INCLUDE 'mana.inc' %]
424
    <script>
425
    <script>
425
        var subscriptionid = "[% subscriptionid | html %]";
426
        var subscriptionid = "[% subscriptionid | html %]";
426
        var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
427
        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 520-525 width: 300px; /* not enough for IE7 apparently */ Link Here
520
520
521
[% MACRO jsinclude BLOCK %]
521
[% MACRO jsinclude BLOCK %]
522
    [% INCLUDE 'calendar.inc' %]
522
    [% INCLUDE 'calendar.inc' %]
523
    [% INCLUDE 'datatables.inc' %]
523
    <script type="text/javascript">
524
    <script type="text/javascript">
524
        var subscriptionid = "[% subscriptionid | html %]";
525
        var subscriptionid = "[% subscriptionid | html %]";
525
        var irregularity = "[% irregularity | html %]";
526
        var irregularity = "[% irregularity | html %]";
Lines 528-533 width: 300px; /* not enough for IE7 apparently */ Link Here
528
        [% FOREACH field IN dont_export_field_loop %]
529
        [% FOREACH field IN dont_export_field_loop %]
529
            tags.push("[% field.fieldid | html %]");
530
            tags.push("[% field.fieldid | html %]");
530
        [% END %]
531
        [% END %]
532
        var mana_enabled = [% Koha.Preference('Mana') %]
531
        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");
533
        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");
532
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
534
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
533
        var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date.");
535
        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 305-311 sub redirect_add_subscription { Link Here
305
        )->store();
305
        )->store();
306
        $periodicity = $subscription_freq->id;
306
        $periodicity = $subscription_freq->id;
307
    }
307
    }
308
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing($query->Vars);
308
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing({ $query->Vars });
309
309
310
    my $auser          = $query->param('user');
310
    my $auser          = $query->param('user');
311
    my $branchcode     = $query->param('branchcode');
311
    my $branchcode     = $query->param('branchcode');
Lines 412-418 sub redirect_mod_subscription { Link Here
412
        )->store();
412
        )->store();
413
        $periodicity = $subscription_freq->id;
413
        $periodicity = $subscription_freq->id;
414
    }
414
    }
415
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing($query->Vars);
415
    my $numberpattern = Koha::Subscription::Numberpatterns->new_or_existing({ $query->Vars });
416
416
417
    my $subtype = $query->param('subtype');
417
    my $subtype = $query->param('subtype');
418
    my $sublength = $query->param('sublength');
418
    my $sublength = $query->param('sublength');
419
- 

Return to bug 17047