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

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/sms_providers.js (+15 lines)
Lines 5-10 $(document).ready(function() { Link Here
5
    $("#new_provider").on("click",function(){
5
    $("#new_provider").on("click",function(){
6
        add_provider();
6
        add_provider();
7
    });
7
    });
8
    $(".edit").on("click",function(e){
9
        e.preventDefault();
10
        var providerid = $(this).data("providerid");
11
        edit_provider( providerid );
12
    });
13
    $(".delete").on("click",function(e){
14
        e.preventDefault();
15
        var providerid = $(this).data("providerid");
16
        var patrons_using = $(this).data("patrons_using");
17
        if( patrons_using !== "" ){
18
            delete_provider( providerid, patrons_using );
19
        } else {
20
            delete_provider( providerid );
21
        }
22
    });
8
});
23
});
9
24
10
function clear_form(){
25
function clear_form(){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt (-15 / +5 lines)
Lines 38-44 Link Here
38
                                <th>Domain</th>
38
                                <th>Domain</th>
39
                                <th title="Patrons using this provider">Patrons</th>
39
                                <th title="Patrons using this provider">Patrons</th>
40
                                <th>&nbsp;</th>
40
                                <th>&nbsp;</th>
41
                                <th>&nbsp;</th>
42
                            </tr>
41
                            </tr>
43
                        </thead>
42
                        </thead>
44
43
Lines 48-68 Link Here
48
                                    <td id="name_[% p.id %]">[% p.name %]</td>
47
                                    <td id="name_[% p.id %]">[% p.name %]</td>
49
                                    <td id="domain_[% p.id %]">[% p.domain %]</td>
48
                                    <td id="domain_[% p.id %]">[% p.domain %]</td>
50
                                    <td id="patrons_using_[% p.id %]">[% p.patrons_using %]</td>
49
                                    <td id="patrons_using_[% p.id %]">[% p.patrons_using %]</td>
51
                                    <td>
50
                                    <td class="actions">
52
                                        <a class="btn edit" href="#" id="edit_[% p.id %]" onclick="edit_provider( [% p.id %] );">
51
                                        <a class="btn btn-mini edit" href="#" id="edit_[% p.id %]" data-providerid="[% p.id %]">
53
                                            <i class="fa fa-pencil"></i> Edit
52
                                            <i class="fa fa-pencil"></i> Edit
54
                                        </a>
53
                                        </a>
55
                                    </td>
54
                                        <a class="btn btn-mini delete" href="#" data-providerid="[% p.id %]" data-patrons_using="[% p.patrons_using %]" id="delete_[% p.id %]">
56
                                    <td>
55
                                            <i class="fa fa-trash"></i> Delete
57
                                        [% IF p.patrons_using %]
56
                                        </a>
58
                                            <a class="btn btn-danger" href="#" id="delete_[% p.id %]" class="delete" onclick="delete_provider( [% p.id %], [% p.patrons_using %] );">
59
                                                <span style="color:white"><i class="fa fa-trash"></i> Delete</span>
60
                                            </a>
61
                                        [% ELSE %]
62
                                            <a class="btn delete" href="#" id="delete_[% p.id %]" onclick="delete_provider( [% p.id %] );">
63
                                                <i class="fa fa-trash"></i> Delete
64
                                            </a>
65
                                        [% END %]
66
                                    </td>
57
                                    </td>
67
                                </tr>
58
                                </tr>
68
                            [% END %]
59
                            [% END %]
69
- 

Return to bug 16301