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 425-430 Link Here
425
        var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
425
        var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
426
        var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
426
        var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
427
    </script>
427
    </script>
428
    [% INCLUDE 'mana.inc' %]
428
    [% Asset.js("js/serials-toolbar.js") | $raw %]
429
    [% Asset.js("js/serials-toolbar.js") | $raw %]
429
    [% INCLUDE 'datatables.inc' %]
430
    [% INCLUDE 'datatables.inc' %]
430
    <script type="text/javascript">
431
    <script type="text/javascript">
(-)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
$subs->{enddate} ||= GetExpirationDate($subscriptionid);
66
$subs->{enddate} ||= GetExpirationDate($subscriptionid);
68
67
Lines 96-102 if ($op eq 'del') { Link Here
96
    }
95
    }
97
}
96
}
98
elsif ( $op and $op eq "share" ) {
97
elsif ( $op and $op eq "share" ) {
99
    my $result = Koha::SharedContent::manaPostRequest($query->param('mana_language'), $loggedinuser, $subscriptionid, 'subscription');
98
    my $mana_language = $query->param('mana_language');
99
    my $result = Koha::SharedContent::manaPostRequest($mana_language, $loggedinuser, $subscriptionid, 'subscription');
100
    $template->param( mana_code => $result->{msg} );
100
    $template->param( mana_code => $result->{msg} );
101
    $subs->{mana_id} = $result->{id};
101
    $subs->{mana_id} = $result->{id};
102
}
102
}
103
- 

Return to bug 17047