Lines Matching refs:model

55         if ($this->coordinator === $this->model->user_nick ||
56 $this->model->get_level() >= BEZ_AUTH_ADMIN) {
62 public function __construct($model, $defaults=array()) {
63 parent::__construct($model);
74 $this->original_poster = $this->model->user_nick;
86 if ($this->model->get_level() >= BEZ_AUTH_LEADER) {
97 if ($this->model->level < BEZ_AUTH_ADMIN && $this->private == '1') {
98 if ($this->get_participant($this->model->user_nick) === false) {
104 if ($this->state == 'proposal' && $this->original_poster == $this->model->user_nick) {
110 if ($this->coordinator == $this->model->user_nick) {
154 $this->closed_by = $this->model->user_nick;
157 $this->model->sqlite->query("UPDATE {$this->get_table_name()} SET state=?, closed_by=?, close_date=? WHERE id=?",
166 $this->model->sqlite->query("UPDATE {$this->get_table_name()} SET state=? WHERE id=?", $state, $this->id);
183 $this->model->sqlite->query("UPDATE {$this->get_table_name()} SET private=? WHERE id=?", $private, $this->id);
186 $this->model->sqlite->query("UPDATE task SET private=? WHERE thread_id=?", $private, $this->id);
191 $this->model->sqlite->query('UPDATE thread SET last_activity_date=? WHERE id=?',
210 $r = $this->model->sqlite->query($sql, $this->id);
211 $pars = $this->model->sqlite->res2arr($r);
229 $r = $this->model->sqlite->query($q, $this->id, $user_id);
230 $par = $this->model->sqlite->res2row($r);
240 $user_id = $this->model->user_nick;
268 $this->model->sqlite->query($sql, $this->id, $user_id);
279 if (!$this->model->userFactory->exists($user_id)) {
294 $participant['added_by'] = $this->model->user_nick;
299 $this->model->sqlite->storeEntry('thread_participant', $values);
308 $this->model->sqlite->query($q, $this->id, $user_id);
333 $this->model->sqlite->query($q, $this->id, $user_id);
349 $r = $this->model->sqlite->query('SELECT * FROM label JOIN thread_label ON label.id = thread_label.label_id
351 $arr = $this->model->sqlite->res2arr($r);
365 $r = $this->model->sqlite->query('SELECT id FROM label WHERE id=?', $label_id);
366 $label_id = $this->model->sqlite->res2single($r);
372 $this->model->sqlite->storeEntry('thread_label',
385 $r = $this->model->sqlite->query('DELETE FROM thread_label WHERE thread_id=? AND label_id=?',$this->id, $label_id);
393 $r = $this->model->sqlite->query("SELECT id FROM thread_comment WHERE (type='cause' OR type='risk' OR type='opportunity') AND thread_id=?",
395 $arr = $this->model->sqlite->res2arr($r);
421 $res = $this->model->sqlite->query("SELECT state FROM task WHERE thread_id = ?
424 return $this->model->sqlite->res2count($res);
428 $res = $this->model->sqlite->query("SELECT thread_comment.id FROM thread_comment
432 $causes_without_tasks = $this->model->sqlite->res2count($res);
449 $r = $this->model->thread_commentFactory->get_from_thread($this, array(), 'id DESC', 1);
456 $tpl = $this->model->action->get_tpl();
470 $tpl = $this->model->action->get_tpl();
485 $thread_box = $this->model->action->bez_tpl_include('thread_box', true);
493 $tpl = $this->model->action->get_tpl();
498 $content = $this->model->action->bez_tpl_include('mail/thread', true);
507 $tpl = $this->model->action->get_tpl();
509 $tpl->set('who', $this->model->user_nick);
517 $tpl = $this->model->action->get_tpl();
519 $tpl->set('who', $this->model->user_nick);
527 $tpl = $this->model->action->get_tpl();
529 $tpl->set('who', $this->model->user_nick);
537 $tpl = $this->model->action->get_tpl();
539 $tpl->set('who', $this->model->user_nick);
543 $this->mail_notify($content, $this->model->userFactory->users_of_group(array('admin', 'bez_admin')), $attachedImages);
547 $tpl = $this->model->action->get_tpl();
549 $tpl->set('who', $this->model->user_nick);
557 $tpl = $this->model->action->get_tpl();
560 $tpl->set('who', $this->model->user_nick);
567 $content = $this->model->action->bez_tpl_include('mail/thread', true);
573 $tpl = $this->model->action->get_tpl();
582 $tpl->set('who', $this->model->user_nick);
589 $content = $this->model->action->bez_tpl_include('mail/thread', true);
595 $r = $this->model->sqlite->query("SELECT COUNT(*) FROM thread_comment WHERE thread_id=?",
597 $comments_count = $this->model->sqlite->res2single($r);