mirror of https://github.com/sipwise/www_admin.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
614 lines
30 KiB
614 lines
30 KiB
<style>
|
|
|
|
.error, .alert, .notice, .success, .info {
|
|
float: left;
|
|
width: 100%;
|
|
}
|
|
.content li.ui-state-default div.drophead, .content li.ui-state-default div.dropfoot {
|
|
height: 12px;
|
|
margin: 0;
|
|
width: 67px;
|
|
}
|
|
div.ui-widget-header.drophead p, div.ui-widget-header.dropfoot p {
|
|
font-size: xx-small;
|
|
text-align: center;
|
|
font-weight: normal;
|
|
height: 12px;
|
|
margin: 0;
|
|
}
|
|
div.ui-widget-header.dropfoot p a,
|
|
div.ui-widget-header.dropfoot p a:visited,
|
|
div.ui-widget-header.dropfoot p a:link {
|
|
color: #459E00;
|
|
text-decoration: none;
|
|
}
|
|
div.ui-widget-header.dropfoot p a:hover {
|
|
color: #54c000;
|
|
text-decoration: none;
|
|
}
|
|
.content li.ui-state-default div.dateform-elem,
|
|
div.dateform-elem {
|
|
width: 67px;
|
|
height: 60px;
|
|
margin: 0;
|
|
text-align: center;
|
|
}
|
|
div.waiting {
|
|
background: url("jquery-ui/css/smooth/images/ui-bg_glass_75_e6e6e6_1x400.png") repeat-x scroll 50% 50% #E6E6E6;
|
|
border: 1px solid #D3D3D3;
|
|
color: #555555;
|
|
}
|
|
div.accepting {
|
|
background: url("jquery-ui/css/smooth/images/ui-bg_glass_55_fbf9ee_1x400.png") repeat-x scroll 50% 50% #FBF9EE;
|
|
border: 1px solid #FCEFA1;
|
|
color: #363636;
|
|
}
|
|
div.hovering {
|
|
background: url("jquery-ui/css/smooth/images/ui-bg_glass_55_f2fbee_1x400.png") repeat-x scroll 50% 50% #F2FBEE;
|
|
border: 1px solid #BFFCA1;
|
|
color: #363636;
|
|
}
|
|
select {
|
|
font-size: small;
|
|
}
|
|
.content li.ui-state-default.mediumhigh {
|
|
height: 94px;
|
|
padding: 2px;
|
|
}
|
|
.content li.ui-state-default.medium {
|
|
height: 82px;
|
|
padding: 2px;
|
|
}
|
|
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
|
|
// create draggables for
|
|
// drag-elem-{year,month,wday,mday,hour,minute}-range
|
|
drags = ["year", "month", "wday", "mday", "hour", "minute"];
|
|
for(var i in drags) {
|
|
$("#drag-elem-" + drags[i] + "-range").draggable({
|
|
cursor: "move",
|
|
helper: "clone",
|
|
revert: false,
|
|
opacity: 0.7,
|
|
});
|
|
$("#drag-elem-" + drags[i]).draggable({
|
|
cursor: "move",
|
|
helper: "clone",
|
|
revert: false,
|
|
opacity: 0.7,
|
|
});
|
|
}
|
|
|
|
var drops = Array('drop-elem-year', 'drop-elem-month', 'drop-elem-mday',
|
|
'drop-elem-wday', 'drop-elem-hour', 'drop-elem-minute');
|
|
[% FOREACH tset IN tsets %]
|
|
for(var i in drops) {
|
|
createDropZone(drops[i], [% tset.id %], 0, true);
|
|
}
|
|
[% FOREACH p IN tset.periods %]
|
|
for(var i in drops) {
|
|
[% IF peditid == p.id %]
|
|
createDropZone(drops[i], [% tset.id %], [% p.id %], true);
|
|
[% ELSE %]
|
|
createDropZone(drops[i], [% tset.id %], [% p.id %], false);
|
|
[% END %]
|
|
}
|
|
|
|
[% IF p.year.defined %]
|
|
$('div#drop-elem-year-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-year').draggable().clone(), true, '[% p.year %]', undefined, undefined]);
|
|
[% ELSIF p.from_year.defined AND p.to_year.defined %]
|
|
$('div#drop-elem-year-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-year-range').draggable().clone(), true, undefined, '[% p.from_year %]', '[% p.to_year %]']);
|
|
[% END %]
|
|
[% IF p.month.defined %]
|
|
$('div#drop-elem-month-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-month').draggable().clone(), true, '[% p.month %]', undefined, undefined]);
|
|
[% ELSIF p.from_month.defined AND p.to_month.defined %]
|
|
$('div#drop-elem-month-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-month-range').draggable().clone(), true, undefined, '[% p.from_month %]', '[% p.to_month %]']);
|
|
[% END %]
|
|
[% IF p.mday.defined %]
|
|
$('div#drop-elem-mday-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-mday').draggable().clone(), true, '[% p.mday %]', undefined, undefined]);
|
|
[% ELSIF p.from_mday.defined AND p.to_mday.defined %]
|
|
$('div#drop-elem-mday-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-mday-range').draggable().clone(), true, undefined, '[% p.from_mday %]', '[% p.to_mday %]']);
|
|
[% END %]
|
|
[% IF p.wday.defined %]
|
|
$('div#drop-elem-wday-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-wday').draggable().clone(), true, '[% p.wday %]', undefined, undefined]);
|
|
[% ELSIF p.from_wday.defined AND p.to_wday.defined %]
|
|
$('div#drop-elem-wday-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-wday-range').draggable().clone(), true, undefined, '[% p.from_wday %]', '[% p.to_wday %]']);
|
|
[% END %]
|
|
[% IF p.hour.defined %]
|
|
$('div#drop-elem-hour-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-hour').draggable().clone(), true, '[% p.hour %]', undefined, undefined]);
|
|
[% ELSIF p.from_hour.defined AND p.to_hour.defined %]
|
|
$('div#drop-elem-hour-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-hour-range').draggable().clone(), true, undefined, '[% p.from_hour %]', '[% p.to_hour %]']);
|
|
[% END %]
|
|
[% IF p.minute.defined %]
|
|
$('div#drop-elem-minute-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-minute').draggable().clone(), true, '[% p.minute %]', undefined, undefined]);
|
|
[% ELSIF p.from_minute.defined AND p.to_minute.defined %]
|
|
$('div#drop-elem-minute-[% tset.id %]-[% p.id %]').trigger('drop', [$('div#drag-elem-minute-range').draggable().clone(), true, undefined, '[% p.from_minute %]', '[% p.to_minute %]']);
|
|
[% END %]
|
|
|
|
[% END %]
|
|
[% END %]
|
|
|
|
function pad2(number) {
|
|
return (number < 10 ? '0' : '') + number;
|
|
}
|
|
|
|
function createDropZone(id, tsetid, periodid, isactive) {
|
|
var anchor;
|
|
if(id == "drop-elem-year") {
|
|
|
|
anchor = $('div#drop-anchor-year-' + tsetid + '-' + periodid);
|
|
anchor.find('div.drophead').after($('<div class="dateform-elem waiting" id="' + id + '-' + tsetid + '-' + periodid + '">any</div>').droppable({
|
|
hoverClass: "hovering",
|
|
activeClass: "accepting",
|
|
accept: function(d){
|
|
if(isactive && (
|
|
d.attr("id") == "drag-elem-year" ||
|
|
d.attr("id") == "drag-elem-year-range"))
|
|
{ return true; }
|
|
},
|
|
}));
|
|
|
|
} else if(id == "drop-elem-month") {
|
|
|
|
anchor = $('div#drop-anchor-month-' + tsetid + '-' + periodid);
|
|
anchor.find('div.drophead').after($('<div class="dateform-elem waiting" id="' + id + '-' + tsetid + '-' + periodid + '">any</div>').droppable({
|
|
hoverClass: "hovering",
|
|
activeClass: "accepting",
|
|
accept: function(d){
|
|
if(isactive && (
|
|
d.attr("id") == "drag-elem-month" ||
|
|
d.attr("id") == "drag-elem-month-range"))
|
|
{ return true; }
|
|
},
|
|
}));
|
|
|
|
} else if(id == "drop-elem-mday") {
|
|
|
|
anchor = $('div#drop-anchor-mday-' + tsetid + '-' + periodid);
|
|
anchor.find('div.drophead').after($('<div class="dateform-elem waiting" id="' + id + '-' + tsetid + '-' + periodid + '">any</div>').droppable({
|
|
hoverClass: "hovering",
|
|
activeClass: "accepting",
|
|
accept: function(d){
|
|
if(isactive && (
|
|
d.attr("id") == "drag-elem-mday" ||
|
|
d.attr("id") == "drag-elem-mday-range"))
|
|
{ return true; }
|
|
},
|
|
}));
|
|
|
|
} else if(id == "drop-elem-wday") {
|
|
|
|
anchor = $('div#drop-anchor-wday-' + tsetid + '-' + periodid);
|
|
anchor.find('div.drophead').after($('<div class="dateform-elem waiting" id="' + id + '-' + tsetid + '-' + periodid + '">any</div>').droppable({
|
|
hoverClass: "hovering",
|
|
activeClass: "accepting",
|
|
accept: function(d){
|
|
if(isactive && (
|
|
d.attr("id") == "drag-elem-wday" ||
|
|
d.attr("id") == "drag-elem-wday-range"))
|
|
{ return true; }
|
|
},
|
|
}));
|
|
|
|
} else if(id == "drop-elem-hour") {
|
|
|
|
anchor = $('div#drop-anchor-hour-' + tsetid + '-' + periodid);
|
|
anchor.find('div.drophead').after($('<div class="dateform-elem waiting" id="' + id + '-' + tsetid + '-' + periodid + '">any</div>').droppable({
|
|
hoverClass: "hovering",
|
|
activeClass: "accepting",
|
|
accept: function(d){
|
|
if(isactive && (
|
|
d.attr("id") == "drag-elem-hour" ||
|
|
d.attr("id") == "drag-elem-hour-range"))
|
|
{ return true; }
|
|
},
|
|
}));
|
|
|
|
} else if(id == "drop-elem-minute") {
|
|
|
|
anchor = $('div#drop-anchor-minute-' + tsetid + '-' + periodid);
|
|
anchor.find('div.drophead').after($('<div class="dateform-elem waiting" id="' + id + '-' + tsetid + '-' + periodid + '">any</div>').droppable({
|
|
hoverClass: "hovering",
|
|
activeClass: "accepting",
|
|
accept: function(d){
|
|
if(isactive && (
|
|
d.attr("id") == "drag-elem-minute" ||
|
|
d.attr("id") == "drag-elem-minute-range"))
|
|
{ return true; }
|
|
},
|
|
}));
|
|
|
|
}
|
|
$('#' + id + '-' + tsetid + '-' + periodid).bind("drop", handleDrop);
|
|
|
|
if(anchor != undefined) {
|
|
var foot = $(anchor).find('div.dropfoot');
|
|
if(isactive)
|
|
$(foot).find('p').replaceWith('<p>Drop to refine</p>');
|
|
else
|
|
$(foot).find('p').replaceWith('<p></p>');
|
|
}
|
|
}
|
|
|
|
function removeDrop(id, tsetid) {
|
|
$('div#' + tsetid).remove();
|
|
var zonearr = tsetid.match(/^.+\-([0-9]+)\-([0-9]+)$/);
|
|
tsetid = zonearr[1];
|
|
var periodid = zonearr[2];
|
|
zonearr = id.match(/^(.+)\-[0-9]+\-[0-9]+$/);
|
|
id = zonearr[1];
|
|
createDropZone(id, tsetid, periodid, true);
|
|
}
|
|
|
|
function handleDrop(event, ui, manual, param, from_param, to_param) {
|
|
var dropped;
|
|
if(manual)
|
|
dropped = $(ui);
|
|
else
|
|
dropped = ui.draggable.clone();
|
|
|
|
var tsetid = $(this).attr('id');
|
|
var zonearr = tsetid.match(/^.+\-([0-9]+)\-([0-9]+)$/);
|
|
var periodid = zonearr[2];
|
|
var isactive = false;
|
|
if(periodid == "0" || periodid == "[% peditid %]")
|
|
isactive = true;
|
|
|
|
var from_select = dropped.find('select.from');
|
|
if(from_select) {
|
|
if(isactive) from_select.removeAttr('disabled');
|
|
from_select.children().remove();
|
|
}
|
|
var to_select = dropped.find('select.to');
|
|
if(to_select) {
|
|
if(isactive) to_select.removeAttr('disabled');
|
|
to_select.children().remove();
|
|
}
|
|
|
|
var d = new Date();
|
|
var years = new Array(10);
|
|
var months = new Array(12);
|
|
var month_names = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
|
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
var wdays = new Array(7);
|
|
var wday_names = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
var mdays = new Array(31);
|
|
var hours = new Array(24);
|
|
var minutes = new Array(60);
|
|
|
|
// from-year
|
|
if(dropped.attr("id") == "drag-elem-year" || dropped.attr("id") == "drag-elem-year-range") {
|
|
var y = d.getFullYear(); var py = parseInt(param);
|
|
if(y > py) {
|
|
$('<option value="' + py + '" selected="selected">' + py + '</option>').appendTo(from_select);
|
|
}
|
|
for(var i = 0; i < years.length; ++i) {
|
|
var y = d.getFullYear() + i;
|
|
$('<option value="' + y + '"' + ((param == y || from_param == y) ? 'selected="selected"' : '') + '>' + y + '</option>').appendTo(from_select);
|
|
}
|
|
}
|
|
// to-year
|
|
if(dropped.attr("id") == "drag-elem-year-range") {
|
|
for(var i = 0; i < years.length; ++i) {
|
|
var y = d.getFullYear() + i + 1;
|
|
$('<option value="' + y + '"' + (to_param == y ? 'selected="selected"' : '') + '>' + y + '</option>').appendTo(to_select);
|
|
}
|
|
}
|
|
// from-month
|
|
if(dropped.attr("id") == "drag-elem-month" || dropped.attr("id") == "drag-elem-month-range") {
|
|
for(var i = 0; i < months.length; ++i) {
|
|
$('<option value="' + (i+1) + '"' + ((param == (i+1) || from_param == (i+1)) ? 'selected="selected"' : '') + '>' + month_names[i] + '</option>').appendTo(from_select);
|
|
}
|
|
}
|
|
// to-month
|
|
if(dropped.attr("id") == "drag-elem-month-range") {
|
|
for(var i = 0; i < months.length; ++i) {
|
|
$('<option value="' + (i+1) + '"' + (to_param == (i+1) ? 'selected="selected"' : '') + '>' + month_names[i] + '</option>').appendTo(to_select);
|
|
}
|
|
}
|
|
// from-wday
|
|
if(dropped.attr("id") == "drag-elem-wday" || dropped.attr("id") == "drag-elem-wday-range") {
|
|
for(var i = 0; i < wdays.length; ++i) {
|
|
$('<option value="' + (i+1) + '"' + ((param == (i+1) || from_param == (i+1)) ? 'selected="selected"' : '') + '>' + wday_names[i] + '</option>').appendTo(from_select);
|
|
}
|
|
}
|
|
// to-wday
|
|
if(dropped.attr("id") == "drag-elem-wday-range") {
|
|
for(var i = 0; i < wdays.length; ++i) {
|
|
$('<option value="' + (i+1) + '"' + (to_param == (i+1) ? 'selected="selected"' : '') + '>' + wday_names[i] + '</option>').appendTo(to_select);
|
|
}
|
|
}
|
|
// from-mday
|
|
if(dropped.attr("id") == "drag-elem-mday" || dropped.attr("id") == "drag-elem-mday-range") {
|
|
for(var i = 0; i < mdays.length; ++i) {
|
|
$('<option value="' + (i+1) + '"' + ((param == (i+1) || from_param == (i+1)) ? 'selected="selected"' : '') + '>' + (i+1) + '</option>').appendTo(from_select);
|
|
}
|
|
}
|
|
// to-mday
|
|
if(dropped.attr("id") == "drag-elem-mday-range") {
|
|
for(var i = 0; i < mdays.length; ++i) {
|
|
$('<option value="' + (i+1) + '"' + (to_param == (i+1) ? 'selected="selected"' : '') + '>' + (i+1) + '</option>').appendTo(to_select);
|
|
}
|
|
}
|
|
// from-hour
|
|
if(dropped.attr("id") == "drag-elem-hour" || dropped.attr("id") == "drag-elem-hour-range") {
|
|
for(var i = 0; i < hours.length; ++i) {
|
|
$('<option value="' + i + '"' + ((param == i || from_param == i) ? 'selected="selected"' : '') + '>' + pad2(i) + '</option>').appendTo(from_select);
|
|
}
|
|
}
|
|
// to-hour
|
|
if(dropped.attr("id") == "drag-elem-hour-range") {
|
|
for(var i = 0; i < hours.length; ++i) {
|
|
$('<option value="' + i + '"' + (to_param == i ? 'selected="selected"' : '') + '>' + pad2(i) + '</option>').appendTo(to_select);
|
|
}
|
|
}
|
|
// from-minute
|
|
if(dropped.attr("id") == "drag-elem-minute" || dropped.attr("id") == "drag-elem-minute-range") {
|
|
for(var i = 0; i < minutes.length; ++i) {
|
|
$('<option value="' + i + '"' + ((param == i || from_param == i) ? 'selected="selected"' : '') + '>' + pad2(i) + '</option>').appendTo(from_select);
|
|
}
|
|
}
|
|
// to-minute
|
|
if(dropped.attr("id") == "drag-elem-minute-range") {
|
|
for(var i = 0; i < minutes.length; ++i) {
|
|
$('<option value="' + i + '"' + (to_param == i ? 'selected="selected"' : '') + '>' + pad2(i) + '</option>').appendTo(to_select);
|
|
}
|
|
}
|
|
|
|
dropped.attr("id", tsetid);
|
|
|
|
// replace old footer text by remove-link and bind click handler
|
|
var foot = $(this).next('div');
|
|
$(foot).find('p').replaceWith('<p></p>');
|
|
if(isactive) {
|
|
$('<a href="javascript:void(0);">Remove</a>').click(function(){
|
|
removeDrop(dropped.attr("id"), tsetid);
|
|
}).appendTo($(foot).find('p'));
|
|
}
|
|
$(this).replaceWith(dropped).attr('class', 'span-4 ui-state-default dateform-elem');
|
|
if(dropped.attr("id") == "drag-elem-wday-range") {
|
|
$(this).addClass("last");
|
|
}
|
|
}
|
|
|
|
//$("ul, li").disableSelection();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
<h3>Edit Call Forward Time Sets for <a href="detail?subscriber_id=[% subscriber_id %]">[% subscriber.username %]@[% subscriber.domain %]</a></h3>
|
|
|
|
<a href="preferences?subscriber_id=[% subscriber_id %]&#callforward"><span class="button-back">Back</span></a>
|
|
|
|
<div class="hspace-20"></div>
|
|
<h3 id="weekdays">Drag Building Blocks to Time Sets below</h3>
|
|
|
|
<div class="span-16 last">
|
|
<div class="span-2">
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-year">
|
|
<select size="1" class="from" name="year" disabled="disabled"><option>Year</option></select>
|
|
</div>
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-year-range">
|
|
<select size="1" class="from" name="from_year" disabled="disabled"><option>Year</option></select>
|
|
<br/>through</br>
|
|
<select size="1" class="to" name="to_year" disabled="disabled"><option>Year</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="span-2">
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-month">
|
|
<select size="1" class="from" name="month" disabled="disabled"><option>Month</option></select>
|
|
</div>
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-month-range">
|
|
<select size="1" class="from" name="from_month" disabled="disabled"><option>Month</option></select>
|
|
<br/>through</br>
|
|
<select size="1" class="to" name="to_month" disabled="disabled"><option>Month</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="span-2">
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-mday">
|
|
<select size="1" class="from" name="mday" disabled="disabled"><option>Day</option></select>
|
|
</div>
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-mday-range">
|
|
<select size="1" class="from" name="from_mday" disabled="disabled"><option>Day</option></select>
|
|
<br/>through</br>
|
|
<select size="1" class="to" name="to_mday" disabled="disabled"><option>Day</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="span-2">
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-wday">
|
|
<select size="1" class="from" name="wday" disabled="disabled"><option>WDay</option></select>
|
|
</div>
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-wday-range">
|
|
<select size="1" class="from" name="from_wday" disabled="disabled"><option>WDay</option></select>
|
|
<br/>through</br>
|
|
<select size="1" class="to" name="to_wday" disabled="disabled"><option>WDay</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="span-2">
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-hour">
|
|
<select size="1" class="from" name="hour" disabled="disabled"><option>Hour</option></select>
|
|
</div>
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-hour-range">
|
|
<select size="1" class="from" name="from_hour" disabled="disabled"><option>Hour</option></select>
|
|
<br/>through</br>
|
|
<select size="1" class="to" name="to_hour" disabled="disabled"><option>Hour</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="span-2 last">
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-minute">
|
|
<select size="1" class="from" name="minute" disabled="disabled"><option>Min</option></select>
|
|
</div>
|
|
<div class="ui-state-default dateform-elem" id="drag-elem-minute-range">
|
|
<select size="1" class="from" name="from_minute" disabled="disabled"><option>Min</option></select>
|
|
<br/>through</br>
|
|
<select size="1" class="to" name="to_minute" disabled="disabled"><option>Min</option></select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="hspace-20"></div>
|
|
<h3 id="timesets" class="span-16 last">Time Sets</h3>
|
|
|
|
[% IF messages.esetmsg %]<div class="success">[% messages.esetmsg %]</div>[% END %]
|
|
[% IF messages.eseterr %]<div class="error">[% messages.eseterr %]</div>[% END %]
|
|
[% IF messages.epermsg %]<div class="success">[% messages.epermsg %]</div>[% END %]
|
|
[% IF messages.epererr %]<div class="error">[% messages.epererr %]</div>[% END %]
|
|
|
|
[% FOREACH tset IN tsets %]
|
|
<ul class="cleanlist">
|
|
<li class="ui-state-default" id="tset[% tset.id %]">
|
|
[% IF seditid == tset.id %]
|
|
<form action="/subscriber/edit_cf_time_saveset" method="post">
|
|
<input type="hidden" name="subscriber_id" value="[% subscriber_id %]"/>
|
|
<input type="hidden" name="seditid" value="[% tset.id %]"/>
|
|
<div class="span-11"><input type="text" size="20" name="tsetname" value="[% tset.name %]" title="enter a name for the time set" /></div>
|
|
<div class="prepend-3 span-1"><button class="button-save">Save</button></div>
|
|
<div class="span-1">
|
|
<a href="/subscriber/edit_cf_times?subscriber_id=[% subscriber_id %]#tset[% tset.id %]"><span class="button-cancel">Cancel</span></a>
|
|
</div>
|
|
</form>
|
|
[% ELSIF Catalyst.session.admin.read_only %]
|
|
<div class="span-11 last">[% tset.name %]</div>
|
|
[% ELSE %]
|
|
<div class="span-11">[% tset.name %]</div>
|
|
<div class="prepend-3 span-1">
|
|
<a href="/subscriber/edit_cf_times?subscriber_id=[% subscriber_id %]&seditid=[% tset.id %]#tset[% tset.id %]"><span class="button-edit">Edit</span></a>
|
|
</div>
|
|
<div class="span-1 last">
|
|
<form action="/subscriber/edit_cf_time_delset" method="post">
|
|
<input type="hidden" name="subscriber_id" value="[% subscriber_id %]"/>
|
|
<input type="hidden" name="seditid" value="[% tset.id %]"/>
|
|
<button class="button-delete">Delete</button>
|
|
</form>
|
|
</div>
|
|
[% END %]
|
|
</li>
|
|
</ul>
|
|
<ul class="cleanlist" id="[% tset.id %]set">
|
|
[% pedit = 0 %]
|
|
[% FOREACH period IN tset.periods %]
|
|
[% IF peditid == period.id AND !Catalyst.session.admin.read_only %]
|
|
[% pedit = 1 %]
|
|
[% ELSE %]
|
|
[% pedit = 0 %]
|
|
[% END %]
|
|
<li class="ui-state-default intend mediumhigh" id="period_[% period.id %]">
|
|
[% UNLESS Catalyst.session.admin.read_only %]
|
|
[% IF pedit %]
|
|
<form action="/subscriber/edit_cf_times_saveperiod" method="post">
|
|
[% ELSE %]
|
|
<form action="/subscriber/edit_cf_time_delperiod" method="post">
|
|
[% END %]
|
|
[% END %]
|
|
<div class="span-2" id="drop-anchor-year-[% tset.id %]-[% period.id %]">
|
|
<div class="ui-widget-header drophead"><p>Year</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-month-[% tset.id %]-[% period.id %]">
|
|
<div class="ui-widget-header drophead"><p>Month</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-mday-[% tset.id %]-[% period.id %]">
|
|
<div class="ui-widget-header drophead"><p>Day</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-wday-[% tset.id %]-[% period.id %]">
|
|
<div class="ui-widget-header drophead"><p>Weekday</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-hour-[% tset.id %]-[% period.id %]">
|
|
<div class="ui-widget-header drophead"><p>Hour</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-minute-[% tset.id %]-[% period.id %]">
|
|
<div class="ui-widget-header drophead"><p>Minute</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
|
|
[% UNLESS Catalyst.session.admin.read_only %]
|
|
[% IF pedit %]
|
|
<div class="prepend-2 span-1">
|
|
<input type="hidden" name="subscriber_id" value="[% subscriber_id %]"/>
|
|
<input type="hidden" name="seditid" value="[% tset.id %]"/>
|
|
<input type="hidden" name="peditid" value="[% period.id %]"/>
|
|
<button class="button-save">Save</button>
|
|
</div>
|
|
<div class="span-1 last">
|
|
<a href="/subscriber/edit_cf_times?subscriber_id=[% subscriber_id %]#period_[% period.id %]"><span class="button-cancel">Cancel</span></a>
|
|
</div>
|
|
[% ELSE %]
|
|
<div class="prepend-2 span-1">
|
|
<a href="/subscriber/edit_cf_times?subscriber_id=[% subscriber_id %]&peditid=[% period.id %]#period_[% period.id %]"><span class="button-edit">Edit</span></a>
|
|
</div>
|
|
<div class="span-1 last">
|
|
<input type="hidden" name="subscriber_id" value="[% subscriber_id %]"/>
|
|
<input type="hidden" name="seditid" value="[% tset.id %]"/>
|
|
<input type="hidden" name="peditid" value="[% period.id %]"/>
|
|
<button class="button-delete">Delete</button>
|
|
</div>
|
|
[% END %]
|
|
[% END %]
|
|
[% UNLESS Catalyst.session.admin.read_only %]
|
|
</form>
|
|
[% END %]
|
|
</li>
|
|
[% END %]
|
|
|
|
|
|
[% IF seditid == tset.id || !tset.periods || tset.periods.size == 0 %]
|
|
<li class="ui-state-default intend mediumhigh">
|
|
<form action="/subscriber/edit_cf_times_saveperiod" method="post">
|
|
<input type="hidden" name="subscriber_id" value="[% subscriber_id %]"/>
|
|
<input type="hidden" name="seditid" value="[% tset.id %]"/>
|
|
<input type="hidden" name="priority" value="[% priority %]"/>
|
|
<div class="span-2" id="drop-anchor-year-[% tset.id %]-0">
|
|
<div class="ui-widget-header drophead"><p>Year</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-month-[% tset.id %]-0">
|
|
<div class="ui-widget-header drophead"><p>Month</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-mday-[% tset.id %]-0">
|
|
<div class="ui-widget-header drophead"><p>Day</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-wday-[% tset.id %]-0">
|
|
<div class="ui-widget-header drophead"><p>Weekday</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-hour-[% tset.id %]-0">
|
|
<div class="ui-widget-header drophead"><p>Hour</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="span-2" id="drop-anchor-minute-[% tset.id %]-0">
|
|
<div class="ui-widget-header drophead"><p>Minute</p></div>
|
|
<div class="ui-widget-header dropfoot"><p>Drop to refine</p></div>
|
|
</div>
|
|
<div class="prepend-2 span-1 last"><button class="button-add">Add</button></div>
|
|
</form>
|
|
</li>
|
|
[% END %]
|
|
|
|
|
|
</ul>
|
|
[% END %]
|
|
<ul class="cleanlist">
|
|
[% UNLESS Catalyst.session.admin.read_only %]
|
|
<li class="ui-state-default">
|
|
<form action="/subscriber/edit_cf_times_createset" method="post">
|
|
<input type="hidden" name="subscriber_id" value="[% subscriber_id %]"/>
|
|
<div class="span-11"><input type="text" size="20" name="tsetname" value=""/></div>
|
|
<div class="prepend-3 span-1 last"><button class="button-add">Add</button></div>
|
|
</form>
|
|
</li>
|
|
[% END %]
|
|
</ul>
|
|
|