Kyle M Hall
b7f6303e3c
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
133 lines
5.2 KiB
Text
133 lines
5.2 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Administration › SMS cellular providers</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$('#submit_update').hide();
|
|
$("#name").focus();
|
|
});
|
|
|
|
function edit_provider( id ) {
|
|
cancel_edit();
|
|
|
|
$("#id").val( id );
|
|
$("#name").val( $("#name_" + id).text() );
|
|
$("#domain").val( $("#domain_" + id).text() );
|
|
|
|
$("#name_" + id).parent().children().addClass("highlighted-row");
|
|
|
|
$("#submit_save").hide();
|
|
$("#submit_update").show();
|
|
|
|
$("#name").focus();
|
|
}
|
|
|
|
function cancel_edit() {
|
|
$("#id").val("");
|
|
$("#name").val("");
|
|
$("#domain").val("");
|
|
|
|
$("tr").children().removeClass("highlighted-row");
|
|
|
|
$("#submit_update").hide();
|
|
$("#submit_save").show();
|
|
|
|
}
|
|
|
|
function delete_provider( id, users ) {
|
|
var c;
|
|
if ( users ) {
|
|
c = confirm( _("Are you sure you want to delete %s? %s patron(s) are using it!").format( $("#name_" + id).html(), users ) );
|
|
} else {
|
|
c = confirm( _("Are you sure you want to delete %s?").format( $("#name_" + id).html() ) );
|
|
}
|
|
|
|
if ( c ) {
|
|
$("#op").val('delete');
|
|
$("#id").val( id );
|
|
$("#sms_form").submit();
|
|
}
|
|
}
|
|
</script>
|
|
<body id="admin_sms_providers" class="admin">
|
|
[% INCLUDE 'header.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › SMS cellular providers</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
<h2>SMS cellular providers</h2>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Domain</th>
|
|
<th title="Patrons using this provider">Patrons</th>
|
|
<th> </th>
|
|
<th> </th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
[% FOREACH p IN providers %]
|
|
<tr>
|
|
<td id="name_[% p.id %]">[% p.name %]</td>
|
|
<td id="domain_[% p.id %]">[% p.domain %]</td>
|
|
<td id="patrons_using_[% p.id %]">[% p.patrons_using %]</td>
|
|
<td>
|
|
<a class="btn" href="#" id="edit_[% p.id %]" class="edit" onclick="edit_provider( [% p.id %] );">
|
|
<i class="fa fa-pencil"></i> Edit
|
|
</a>
|
|
</td>
|
|
<td>
|
|
[% IF p.patrons_using %]
|
|
<a class="btn btn-danger" href="#" id="delete_[% p.id %]" class="delete" onclick="delete_provider( [% p.id %], [% p.patrons_using %] );">
|
|
<span style="color:white"><i class="fa fa-trash"></i> Delete</span>
|
|
</a>
|
|
[% ELSE %]
|
|
<a class="btn" href="#" id="delete_[% p.id %]" class="delete" onclick="delete_provider( [% p.id %] );">
|
|
<i class="fa fa-trash"></i> Delete
|
|
</a>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
|
|
<tfoot>
|
|
<form id="sms_form" action="sms_providers.pl" method="post">
|
|
<input type="hidden" id="id" name="id" value="" />
|
|
<input type="hidden" id="op" name="op" value="add_update" />
|
|
<tr>
|
|
<td><input type="text" id="name" name="name" /></td>
|
|
<td><input type="text" id="domain" name="domain" size="40"/></td>
|
|
<td colspan="2">
|
|
<button class="btn" id="submit_save" type="submit">
|
|
<i class="fa fa-plus"></i> Add new
|
|
</button>
|
|
<button class="btn" id="submit_update" type="submit">
|
|
<i class="fa fa-plus-circle"></i> Update
|
|
</button>
|
|
</td>
|
|
<td>
|
|
<a class="btn" id="cancel" href="#" onclick="cancel_edit()">
|
|
<i class="fa fa-ban"></i> Cancel
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
</form>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'admin-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|