From b90b530516f264e511f01557482388b30ff0e412 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Thu, 26 Apr 2018 19:36:50 +0200 Subject: [PATCH] More functionality --- class/stempel.class.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/class/stempel.class.php b/class/stempel.class.php index 23a8cff..b4119c0 100644 --- a/class/stempel.class.php +++ b/class/stempel.class.php @@ -7,10 +7,21 @@ class Stempel extends DatabaseTable { parent::__construct('stempel', $id); } - public function ajaxEditTask(Array $data) + public function ajaxTask(Array $data) { - if (!strlen($data['content'])) return false; - return $this->modify('task', $data['content']); + return $this->modify('task', utf8_decode($data['content'])); + } + + public function ajaxSetStatus(Array $data) + { + if (count($data['ids'])) { + $sql = sprintf('UPDATE %s SET status = %d WHERE id IN (%s)', + $this->table, + $data['status'], implode(',',$data['ids'])); + return $this->execute($sql); + } + + return true; } } -- 2.20.1