mirror of
https://github.com/VTECRM/vtenext.git
synced 2026-02-26 16:18:47 +00:00
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
/*************************************
|
|
* SPDX-FileCopyrightText: 2009-2020 Vtenext S.r.l. <info@vtenext.com>
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
************************************/
|
|
function edittaskscript($){
|
|
|
|
function NumberBox(element){
|
|
var elementId = element.attr("id");
|
|
var boxId = '#'+elementId+'-number-box';
|
|
var str = "";
|
|
for(var i = 1; i <= 30; i++){
|
|
str += '<a href="#'+i+'" class="box_cel">'+(i < 10? ("0"+i) : i)+'</a> ';
|
|
if(!(i % 5)){
|
|
str+="<br>";
|
|
}
|
|
}
|
|
element.after('<div id="'+elementId+'-number-box" style="display:none;" class="box">'+str+'</div>');
|
|
element.focus(function(){
|
|
var pos = element.position();
|
|
$(boxId).css('display', 'block');
|
|
$(boxId).css({
|
|
position: 'absolute',
|
|
top: (pos.top+25)+'px'
|
|
});
|
|
});
|
|
|
|
element.blur(function(){
|
|
setTimeout(function(){$(boxId).css('display', 'none');},500);
|
|
});
|
|
|
|
$('.box_cel').click(function(){
|
|
element.val(parseInt($(this).text(), 10));
|
|
});
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
validator = new VTFieldValidator($('#new_task_form'));
|
|
validator.mandatoryFields = ['summary'];
|
|
$('.time_field').timepicker();
|
|
NumberBox($('#select_date_days'));
|
|
//UI to set the date for executing the task.
|
|
$('#check_select_date').click(function(){
|
|
if($(this).prop('checked')){
|
|
$('#select_date').css('display', 'block');
|
|
}else{
|
|
$('#select_date').css('display', 'none');
|
|
}
|
|
});
|
|
$('#edittask_cancel_button').click(function(){
|
|
window.location=returnUrl;
|
|
});
|
|
});
|
|
} |