public function indexAction() { $request = $this->getRequest(); $taskId = $request->getParam('taskid'); $is_personal = $request->getParam('is_personal', 0); $tasks = new Rp_Db_Table_Ach_Tasks(); $task = $tasks->find($taskId)->current(); $notes = new Rp_Db_Table_Ach_Tasks_Notes(); switch ($is_personal) { case 0: $note = $notes->fetchTaskNotes($task->id); break; case 1: $note = $notes->fetchPersonalManagerNotes($task->id); break; default: $note = $notes->fetchTaskNotes($task->id); break; } //$note = $notes->fetchTaskNotes($task->id); $view = $this->initView(); $view->title = Rp::getTitle('Заметки к бизнес-цели #' . $task->id); $view->task = $task; $view->is_personal = $is_personal; $view->notes = $note; }
private function _rowTask(Rp_Db_Table_Row_Ach_Task $task, $readNotes, $counter) { $all_notes = new Rp_Db_Table_Ach_Tasks_Notes(); $kol = count($all_notes->fetchTaskNotes($task->id)); $notes = ''; if ($readNotes) { //$countNotes = count($task->fetchNotes()); $notes = '<div onclick="openNotes(' . $task->id . ', 0)">' . $kol . '</div>'; } $status = $task->status == '0' ? 'Отменена' : ''; $term_date = ''; if ($task->date_term != null) { $term_date = date('d.m.y', strtotime($task->date_term)); } return ' <tr class="tasks-row-status' . $task->status . '"> <td class="tasks-field-num">' . $counter . '.</td> <td class="tasks-field-description">' . nl2br(htmlspecialchars($task->description)) . '</td> <td class="tasks-field-term">' . $term_date . '</td> <td class="tasks-field-notes">' . $notes . '</td> <td class="tasks-field-status">' . $status . '</td> </tr> '; }
private function _rowTask(Zend_Db_Table_Row_Abstract $task, array $ratings, $func, $counter = null) { if (empty($task->id)) { $num = '*'; $term = ''; //(date('n') < 12 ? date('Y') : (date('Y') + 1)) . '-12-31'; $note = ''; $name = 'taskPattern'; $class = 'row-pattern'; $toggle = '<div class="toggle-cancel" onclick="Card.removeRow(this, \'personaltasks\')"> </div>'; $weight = '0'; } else { $all_notes = new Rp_Db_Table_Ach_Tasks_Notes(); $kol = count($all_notes->fetchTaskNotes($task->id)); $num = $counter; $term = ''; $term_date = ''; if ($task->date_term != null) { $term = $task->date_term; $term_date = date('d.m.y', strtotime($term)); } $note = '<div style="display:none" onclick="openNotes(' . $task->id . ', 0)" title="Заметки" style:>' . $kol . '</div>'; $name = 'tasks_in_personal[' . $task->id . ']'; $weight = $task->weight; $class = ''; $toggle = ''; if ($task->status == '0') { $class = 'row-canceled'; } elseif ($task->status > 0) { $class = 'row-approval'; } if ($task->status != 2) { $toggle = '<div class="toggle-cancel" onclick="Card.toggleCancel(this, \'personaltasks\')"> </div>'; } } return ' <tr class="' . $class . '"> <td class="tasks-field-num"> <div>' . $num . '</div>' . $toggle . ' <input name="' . $name . '[status]" type="hidden" value="' . $task->status . '" /> </td> <td class="tasks-field-description"> <textarea name="' . $name . '[description]" readonly="readonly">' . $task->description . '</textarea> </td> <td class="tasks-field-term"> <input name="term_display" type="text" value="' . $term_date . '" readonly="readonly" /> <input name="' . $name . '[date_term]" type="hidden" value="' . $term . '" /> </td> <td class="tasks-field-weight"> <textarea name="' . $name . '[weight]" readonly="readonly">' . $weight . '</textarea> </td> <td class="tasks-field-note"> ' . $note . ' <input name="' . $name . '[is_personal]" type="hidden" value="' . $func . '" /> </td> <td class="tasks-field-result"> <textarea name="' . $name . '[result]" readonly="readonly">' . $task->result . '</textarea> </td> <td class="tasks-field-rating"> ' . $this->view->formSelect($name . '[rating_id]', $task->rating_id, null, $ratings) . ' <div>' . $ratings[$task->rating_id] . '</div> </td> </tr> '; }