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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/mana.inc (-1 / +1 lines)
Lines 41-44 $(document).ready(function() { Link Here
41
    });
41
    });
42
});
42
});
43
//]]>
43
//]]>
44
</script>
44
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc (-40 lines)
Lines 1-44 Link Here
1
[% INCLUDE 'blocking_errors.inc' %]
1
[% INCLUDE 'blocking_errors.inc' %]
2
[% INCLUDE 'mana.inc' %]
3
<script type="text/javascript">
4
    //<![CDATA[
5
6
    function confirm_close() {
7
        var is_confirmed = confirm(_("Are you sure you want to close this subscription?"));
8
        if (is_confirmed) {
9
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=close";
10
        }
11
    }
12
    function confirm_reopen() {
13
        var is_confirmed = confirm(_("Are you sure you want to reopen this subscription?"));
14
        if (is_confirmed) {
15
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen";
16
        }
17
    }
18
19
     $(document).ready(function() {
20
        $("#deletesub").click(function(){
21
            confirm_deletion();
22
            return false;
23
        });
24
        $("#reopen").click(function(){
25
            confirm_reopen();
26
            return false;
27
        });
28
        $("#close").click(function(){
29
            confirm_close();
30
            return false;
31
        });
32
        $("#renew").click(function(){
33
            popup([% subscriptionid %]);
34
            return false;
35
        })
36
        $("#mana-subscription-share").click(function() {
37
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=share";
38
        });
39
     });
40
    //]]>
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 ) %]
2
[% 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">
3
    <div id="toolbar" class="btn-toolbar">
44
        [% IF CAN_user_serials_create_subscription %]
4
        [% IF CAN_user_serials_create_subscription %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt (+1 lines)
Lines 476-481 Link Here
476
        var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
476
        var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
477
        var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
477
        var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
478
    </script>
478
    </script>
479
    [% INCLUDE 'mana.inc' %]
479
    [% Asset.js("js/serials-toolbar.js") | $raw %]
480
    [% Asset.js("js/serials-toolbar.js") | $raw %]
480
    [% INCLUDE 'datatables.inc' %]
481
    [% INCLUDE 'datatables.inc' %]
481
    [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
482
    [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js (-1 / +1 lines)
Lines 41-46 function popup(subscriptionid) { Link Here
41
        return false;
41
        return false;
42
    });
42
    });
43
    $("#mana-subscription-share").click(function() {
43
    $("#mana-subscription-share").click(function() {
44
        window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=share";
44
        window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=share";
45
    });
45
    });
46
 });
46
 });
(-)a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js (-1 / +1 lines)
Lines 650-653 $(document).ready(function() { Link Here
650
    $('#save-subscription').on("click", function(e){
650
    $('#save-subscription').on("click", function(e){
651
        $('select:disabled').removeAttr('disabled');
651
        $('select:disabled').removeAttr('disabled');
652
    });
652
    });
653
});
653
});
(-)a/serials/subscription-detail.pl (-3 / +2 lines)
Lines 62-68 my ($template, $loggedinuser, $cookie) Link Here
62
                debug => 1,
62
                debug => 1,
63
                });
63
                });
64
64
65
66
my $subs = GetSubscription($subscriptionid);
65
my $subs = GetSubscription($subscriptionid);
67
66
68
output_and_exit( $query, $cookie, $template, 'unknown_subscription')
67
output_and_exit( $query, $cookie, $template, 'unknown_subscription')
Lines 100-106 if ($op eq 'del') { Link Here
100
    }
99
    }
101
}
100
}
102
elsif ( $op and $op eq "share" ) {
101
elsif ( $op and $op eq "share" ) {
103
    my $result = Koha::SharedContent::manaPostRequest($query->param('mana_language'), $loggedinuser, $subscriptionid, 'subscription');
102
    my $mana_language = $query->param('mana_language');
103
    my $result = Koha::SharedContent::manaPostRequest($mana_language, $loggedinuser, $subscriptionid, 'subscription');
104
    $template->param( mana_code => $result->{msg} );
104
    $template->param( mana_code => $result->{msg} );
105
    $subs->{mana_id} = $result->{id};
105
    $subs->{mana_id} = $result->{id};
106
}
106
}
107
- 

Return to bug 17047