function addEventWatchers() { $('repeatJob').observe('click', clickRepeatJob); for (var i = 0; i < 3; i++) $('dateType_' + i).observe('click', clickRepeatJob); } function getSelectedDateType() { for (var i = 0; i < 3; i++) if ($F('dateType_' + i) != null) return i; } function clickRepeatJob(event) { for (var i = 0; i < 3; i++) { $('repeatDate_' + i).hide(); var obj = $('date_' + i); if (obj) obj.hide(); } var selectedDateType = getSelectedDateType(); var obj = $('date_' + selectedDateType); if (obj) obj.show(); if ($F('repeatJob') == 'on') $('repeatDate_' + selectedDateType).show(); } function loadJobList() { $('jobList').innerHTML = ' Carregando lista de jobs ...'; cExecute("$this.bo_adminjobs.loadJobs", resultLoadJobList, "processID=" + $F('processID')); } function resultLoadJobList(data) { if (checkError(data)) return; var content = ''; if (data.length > 0) { content += ''; for (var i = 0; i < data.length; i++) { var dataHash = new Hash(); for (j in data[i]) if (typeof data[i][j] != 'function') dataHash[j] = data[i][j]; content += ''; content += ''; content += ''; /* ações */ content += ''; content += ''; } content += '
'; content += '

' + data[i]['name'] + '

'; content += '

' + getRepetitionSummary(data[i]) + '

'; content += '
'; content += 'Executar Job'; content += 'Editar Job'; content += 'Ver Logs'; content += '   '; content += 'Excluir Job'; content += '

'; } else { content += '


'; content += '
Não existem Jobs cadastrados neste Processo
'; content += '


'; } content += ''; $('jobList').innerHTML = content; }