Lines Matching refs:model
56 if ($this->coordinator === $this->model->user_nick ||
57 $this->model->get_level() >= BEZ_AUTH_ADMIN) {
63 public function __construct($model, $defaults=array()) {
64 parent::__construct($model);
75 $this->original_poster = $this->model->user_nick;
87 if ($this->model->get_level() >= BEZ_AUTH_LEADER) {
98 if ($this->model->level < BEZ_AUTH_ADMIN && $this->private == '1') {
99 if ($this->get_participant($this->model->user_nick) === false) {
105 if ($this->state == 'proposal' && $this->original_poster == $this->model->user_nick) {
111 if ($this->coordinator == $this->model->user_nick) {
155 $this->closed_by = $this->model->user_nick;
158 $this->model->sqlite->query("UPDATE {$this->get_table_name()} SET state=?, closed_by=?, close_date=? WHERE id=?",
167 $this->model->sqlite->query("UPDATE {$this->get_table_name()} SET state=? WHERE id=?", $state, $this->id);
184 $this->model->sqlite->query("UPDATE {$this->get_table_name()} SET private=? WHERE id=?", $private, $this->id);
187 $this->model->sqlite->query("UPDATE task SET private=? WHERE thread_id=?", $private, $this->id);
192 $this->model->sqlite->query('UPDATE thread SET last_activity_date=? WHERE id=?',
211 $r = $this->model->sqlite->query($sql, $this->id);
212 $pars = $this->model->sqlite->res2arr($r);
230 $r = $this->model->sqlite->query($q, $this->id, $user_id);
231 $par = $this->model->sqlite->res2row($r);
241 $user_id = $this->model->user_nick;
269 $this->model->sqlite->query($sql, $this->id, $user_id);
280 if (!$this->model->userFactory->exists($user_id)) {
295 $participant['added_by'] = $this->model->user_nick;
300 $this->model->sqlite->storeEntry('thread_participant', $values);
309 $this->model->sqlite->query($q, $this->id, $user_id);
334 $this->model->sqlite->query($q, $this->id, $user_id);
350 $r = $this->model->sqlite->query('SELECT * FROM label JOIN thread_label ON label.id = thread_label.label_id
352 $arr = $this->model->sqlite->res2arr($r);
366 $r = $this->model->sqlite->query('SELECT id FROM label WHERE id=?', $label_id);
367 $label_id = $this->model->sqlite->res2single($r);
373 $this->model->sqlite->storeEntry('thread_label',
386 $r = $this->model->sqlite->query('DELETE FROM thread_label WHERE thread_id=? AND label_id=?',$this->id, $label_id);
394 $r = $this->model->sqlite->query("SELECT id FROM thread_comment WHERE (type='cause' OR type='risk' OR type='opportunity') AND thread_id=?",
396 $arr = $this->model->sqlite->res2arr($r);
422 $res = $this->model->sqlite->query("SELECT state FROM task WHERE thread_id = ?
425 return $this->model->sqlite->res2count($res);
429 $res = $this->model->sqlite->query("SELECT thread_comment.id FROM thread_comment
433 $causes_without_tasks = $this->model->sqlite->res2count($res);
450 $r = $this->model->thread_commentFactory->get_from_thread($this, array(), 'id DESC', 1);
457 $tpl = $this->model->action->get_tpl();
471 $tpl = $this->model->action->get_tpl();
486 $thread_box = $this->model->action->bez_tpl_include('thread_box', true);
494 $tpl = $this->model->action->get_tpl();
499 $content = $this->model->action->bez_tpl_include('mail/thread', true);
508 $tpl = $this->model->action->get_tpl();
510 $tpl->set('who', $this->model->user_nick);
518 $tpl = $this->model->action->get_tpl();
520 $tpl->set('who', $this->model->user_nick);
528 $tpl = $this->model->action->get_tpl();
530 $tpl->set('who', $this->model->user_nick);
538 $tpl = $this->model->action->get_tpl();
540 $tpl->set('who', $this->model->user_nick);
544 $this->mail_notify($content, $this->model->userFactory->users_of_group(array('admin', 'bez_admin')), $attachedImages);
548 $tpl = $this->model->action->get_tpl();
550 $tpl->set('who', $this->model->user_nick);
558 $tpl = $this->model->action->get_tpl();
561 $tpl->set('who', $this->model->user_nick);
568 $content = $this->model->action->bez_tpl_include('mail/thread', true);
574 $tpl = $this->model->action->get_tpl();
583 $tpl->set('who', $this->model->user_nick);
590 $content = $this->model->action->bez_tpl_include('mail/thread', true);
596 $r = $this->model->sqlite->query("SELECT COUNT(*) FROM thread_comment WHERE thread_id=?",
598 $comments_count = $this->model->sqlite->res2single($r);