Lines Matching refs:this

2 /** @var action_plugin_bez $this */
6 if ($this->model->get_level() < BEZ_AUTH_USER) {
10 if ($this->get_param('id') == '') {
11 header('Location: ' . $this->url('threads'));
15 $thread = $this->model->threadFactory->get_one($this->get_param('id'));
21 $this->tpl->set('thread', $thread);
23 $this->tpl->set('lang_suffix', '_project');
26 $thread_comments = iterator_to_array($this->model->thread_commentFactory->get_from_thread($thread));
27 $tasks = $this->model->taskFactory->get_from_thread($thread);
37 $this->tpl->set('timeline', $timeline);
38 $this->tpl->set('tasks', $tasks);
39 $this->tpl->set('task_programs', $this->model->task_programFactory->get_all([], 'name'));
42 $thread_comment = $this->model->thread_commentFactory->create_object(array('thread' => $thread));
43 $this->tpl->set('thread_comment', $thread_comment);
45 if ($this->get_param('action') == 'commcause_add') {
47 $this->model->thread_commentFactory->initial_save($thread_comment, $_POST);
52 } elseif ($this->get_param('action') == 'subscribe') {
54 $thread->set_participant_flags($this->model->user_nick, array('subscribent'));
57 } elseif ($this->get_param('action') == 'unsubscribe') {
59 $thread->remove_participant_flags($this->model->user_nick, array('subscribent'));
60 $this->add_notification($this->getLang('unsubscribed_com'));
63 } elseif ($this->get_param('action') == 'invite') {
68 $this->add_notification($this->model->userFactory->get_user_email($client), $this->getLang('invitation_has_been_send'));
71 } elseif ($this->get_param('action') == 'participant_remove') {
72 $user_id = $this->get_param('user_id');
75 $name = $this->model->userFactory->get_user_full_name($user_id);
76 $notif = sprintf($this->getLang('participant_removed'), $name);
77 $this->add_notification($notif);
81 } elseif ($this->get_param('action') == 'commcause_delete') {
83 $thread_comment = $this->model->thread_commentFactory->get_one($this->get_param('kid'), array('thread' => $thread));
84 $this->model->thread_commentFactory->delete($thread_comment);
87 } elseif ($this->get_param('action') == 'commcause_edit') {
89 $thread_comment = $this->model->thread_commentFactory->get_one($this->get_param('kid'), array('thread' => $thread));
92 $this->tpl->set_values($thread_comment->get_assoc());
94 $this->model->thread_commentFactory->update_save($thread_comment, $_POST);
99 } elseif ($this->get_param('action') == 'task_add') {
103 if ($this->get_param('kid') != '') {
104 $thread_comment = $this->model->thread_commentFactory->get_one($this->get_param('kid'), array('thread' => $thread));
108 $task = $this->model->taskFactory->create_object($defaults);
109 $this->tpl->set('task_new', $task);
113 $this->model->taskFactory->initial_save($task, $_POST);
118 } elseif ($this->get_param('action') == 'task_edit') {
120 $task = $this->model->taskFactory->get_one($this->get_param('tid'), array('thread' => $thread));
121 $this->tpl->set('task', $task);
125 $this->tpl->set_values($task->get_assoc());
127 $this->model->taskFactory->update_save($task, $_POST);
132 } elseif ($this->get_param('action') == 'task_delete') {
134 $task = $this->model->taskFactory->get_one($this->get_param('tid'), array('thread' => $thread));
135 $this->model->taskFactory->delete($task);
137 } elseif ($this->get_param('action') == 'delete') {
143 $this->model->threadFactory->delete($thread);
144 header('Location: ' . $this->url($redirect_to));
153 header('Location: ' . $this->url('thread', 'id', $thread->id) . $anchor);