/** * Show an Ajax-y error message * * Goes back to the browser, where it's shown in a popup. * * @param string $msg Message to show * * @return void */ function ajaxErrorMsg($msg, $taskid, $group) { $this->startHTML('text/xml;charset=utf-8', true); $this->elementStart('head'); // TRANS: Page title after an AJAX error occurs on the send notice page. $this->element('title', null, _('Ajax Error')); $this->elementEnd('head'); $this->elementStart('body'); $this->elementStart('div', array('class' => 'input_form')); $notice_form = new NoticeTaskForm($this, $taskid, array('content' => $this->content, 'to_group' => $group), $msg); $notice_form->show(); $this->elementEnd('div'); $this->elementEnd('body'); $this->elementEnd('html'); }
function showTasks() { $taskIds = Task::getPendingTasks($this->user->id); if (count($taskIds) == 0) { $this->element('p', 'no-pending-task-msg', 'Enhorabuena, no tienes ninguna tarea pendiente.'); } else { $tasks = Task_Grader::multiGet('id', $taskIds)->fetchAll(); foreach ($tasks as $task) { $group = User_group::staticGet('id', $task->groupid); $this->elementStart('div', array('class' => 'div-group-task', 'id' => 'div-task-' . $task->id)); $this->element('h2', null, strtoupper('Tarea de ' . $group->nickname)); $this->elementStart('div', array('id' => 'options-task-' . $task->id, 'class' => 'options-task')); $this->element('input', array('type' => 'button', 'class' => 'button-option-reject', 'value' => 'Rechazar', 'onclick' => 'showConfirmDialog(' . $task->id . ');')); $this->element('input', array('type' => 'button', 'class' => 'button-option-complete', 'value' => 'Completar', 'onclick' => 'mostrarBox(' . $task->id . ');')); $this->elementEnd('div'); $this->element('p', null, 'Fecha: ' . $task->cdate); $this->elementStart('div', array('id' => 'confirm-reject-task-' . $task->id, 'class' => 'confirm-reject-task')); $this->element('a', array('class' => 'close-confirm-dialog', 'href' => 'javascript:hideConfirmDialog(' . $task->id . ');'), 'x'); $this->element('p', null, '¿Está seguro que desea eliminar la tarea?'); $this->elementStart('form', array('action' => common_local_url('taskcreate'), 'method' => 'POST', 'class' => 'ajax')); $this->hidden('hidden-' . $task->id, $task->id, 'delete'); $this->element('input', array('type' => 'submit', 'value' => 'Sí', 'class' => 'button-option-dialog', 'onclick' => 'deleteTask(' . $task->id . ');')); $this->element('input', array('type' => 'button', 'value' => 'No', 'onclick' => 'hideConfirmDialog(' . $task->id . ');', 'class' => 'button-option-dialog')); $this->elementEnd('form'); $this->elementEnd('div'); $this->elementStart('div', array('class' => 'input_form')); if ($task->tag == "") { $notice_form = new NoticeTaskForm($this, $task->id, array('content' => '#' . $task->cdate, 'to_group' => $group)); } else { $notice_form = new NoticeTaskForm($this, $task->id, array('content' => '#' . $task->cdate . ' #' . $task->tag, 'to_group' => $group)); } $notice_form->show(); $this->elementEnd('div'); $this->element('p', 'task-underline'); $this->elementEnd('div'); } } }