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 131-142 Link Here
131
[% END %]
131
[% END %]
132
132
133
<script type="text/javascript">
133
<script type="text/javascript">
134
    $(document).ready( function(){
135
        $(".mana_search_button").on("click",function(){
136
            mana_search($("#mana_search_field").val());
137
        });
138
    });
139
140
    function mana_use( mana_id ){
134
    function mana_use( mana_id ){
141
        $.ajax( {
135
        $.ajax( {
142
            type:"POST",
136
            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 335-344 canned reports and writing custom SQL reports.</p> Link Here
335
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
335
                        <p>Your subscription is already linked with a Mana subscription model. Share it if you have made modifications, otherwise it will do nothing.</p>
336
                    </div>
336
                    </div>
337
                [% END %]
337
                [% END %]
338
                <div id="note-error" class="alert alert-danger" role="alert">
339
                    Please enter a report name and descriptive note before sharing (minimum 20 characters)
340
                </div>
338
                [% IF ( languages_loop ) %]
341
                [% IF ( languages_loop ) %]
339
                    [% UNLESS ( one_language_enabled ) %]
342
                    [% UNLESS ( one_language_enabled ) %]
340
                        <label id="noteerror" type="hidden">Please enter a report name and descriptive note before sharing (minimum 20 characters)</label>
343
                        <div class="shared_infos rows">
341
                        <div id="shared_infos" class="rows">
342
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
344
                                <li> <span class="label">Id: </span><div id="shared_id"></div>
343
                                </li>
345
                                </li>
344
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
346
                                <li> <span class="label">Name: </span><div id="shared_name"></div>
Lines 357-363 canned reports and writing custom SQL reports.</p> Link Here
357
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
359
                            <form method="post" id="mana_share_form" action="/cgi-bin/koha/reports/guided_reports.pl?phase=Share" class="validated" >
358
                                <input type="hidden" name="phase" value="Share">
360
                                <input type="hidden" name="phase" value="Share">
359
361
360
                                <fieldset>
362
                                <fieldset class="shared_infos">
361
                                    <label for="mana_language">Language:</label>
363
                                    <label for="mana_language">Language:</label>
362
                                    <select id="mana_language" name="mana_language">
364
                                    <select id="mana_language" name="mana_language">
363
                                        [% FOREACH languages_loo IN languages_loop %]
365
                                        [% FOREACH languages_loo IN languages_loop %]
Lines 417-427 canned reports and writing custom SQL reports.</p> Link Here
417
                [% END %]
419
                [% END %]
418
            </div>
420
            </div>
419
            <div class="modal-footer">
421
            <div class="modal-footer">
420
                <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
422
                <button class="btn" id="ManaCloseButton" data-dismiss="modal" aria-hidden="true">Close</button>
421
                [% IF one_language_enabled==0 %]
423
                [% IF one_language_enabled==0 %]
422
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary">Share</button>
424
                    <button id="ManaShareButton" type="submit" form="mana_share_form" class="btn btn-primary shared_infos">Share</button>
423
                [% ELSE %]
425
                [% ELSE %]
424
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary">Share</a></div>
426
                    <div id="ManaShareButton" class="btn-group"><a class="btn btn-primary shared_infos">Share</a></div>
425
                [% END %]
427
                [% END %]
426
            </div>
428
            </div>
427
        </div>
429
        </div>
Lines 1078-1083 Sub report:<select name="subreport"> Link Here
1078
1080
1079
[% MACRO jsinclude BLOCK %]
1081
[% MACRO jsinclude BLOCK %]
1080
    [% INCLUDE 'calendar.inc' %]
1082
    [% INCLUDE 'calendar.inc' %]
1083
    [% INCLUDE 'mana.inc' %]
1081
    [% IF ( saved1 ) %]
1084
    [% IF ( saved1 ) %]
1082
        [% INCLUDE 'datatables.inc' %]
1085
        [% INCLUDE 'datatables.inc' %]
1083
        [% INCLUDE 'columns_settings.inc' %]
1086
        [% INCLUDE 'columns_settings.inc' %]
Lines 1129-1139 Sub report:<select name="subreport"> Link Here
1129
                window.history.back();
1132
                window.history.back();
1130
            });
1133
            });
1131
1134
1135
            $(".mana_search_button").on("click",function(){
1136
                mana_search($("#mana_search_field").val());
1137
            });
1138
1132
            $(".ShareButton").on("click", function(){
1139
            $(".ShareButton").on("click", function(){
1140
                $("#note-error").hide();
1133
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1141
                if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){
1134
                    $("#shared_infos").hide();
1142
                    $(".shared_infos").hide();
1135
                    $("#ManaShareButton").hide();
1143
                    $("#note-error").show();
1136
                    $("#noterror").show();
1137
                }
1144
                }
1138
                else{
1145
                else{
1139
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
1146
                    $("#shared_id").html($(this).closest("tr").find(".report_id").text());
Lines 1145-1150 Sub report:<select name="subreport"> Link Here
1145
                }
1152
                }
1146
            });
1153
            });
1147
1154
1155
            $("#ManaCloseButton").on("click", function() {
1156
                $(".shared_infos").show();
1157
            });
1158
1148
            $("#addColumn").on("click",function(){
1159
            $("#addColumn").on("click",function(){
1149
                addColumn();
1160
                addColumn();
1150
            });
1161
            });
(-)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 511-516 width: 300px; /* not enough for IE7 apparently */ Link Here
511
511
512
[% MACRO jsinclude BLOCK %]
512
[% MACRO jsinclude BLOCK %]
513
    [% INCLUDE 'calendar.inc' %]
513
    [% INCLUDE 'calendar.inc' %]
514
    [% INCLUDE 'datatables.inc' %]
514
    <script type="text/javascript">
515
    <script type="text/javascript">
515
        var subscriptionid = "[% subscriptionid %]";
516
        var subscriptionid = "[% subscriptionid %]";
516
        var irregularity = "[% irregularity %]";
517
        var irregularity = "[% irregularity %]";
Lines 519-524 width: 300px; /* not enough for IE7 apparently */ Link Here
519
        [% FOREACH field IN dont_export_field_loop %]
520
        [% FOREACH field IN dont_export_field_loop %]
520
            tags.push("[% field.fieldid %]");
521
            tags.push("[% field.fieldid %]");
521
        [% END %]
522
        [% END %]
523
        var mana_enabled = [% Koha.Preference('Mana') %]
522
        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");
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");
523
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
525
        var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record");
524
        var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date.");
526
        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