summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
authorBlueTeck <tili2@gmx.de>2015-03-02 22:40:09 +0100
committerBlueTeck <tili2@gmx.de>2015-03-02 22:40:09 +0100
commit88ba0c0953395e18dbdd871e96831d885f59740c (patch)
tree4597134cb25382c6671990fb8923701298724203 /app/Model
parentda425e4187e5e8e7feb9783c9d75bcaa9fa0c7ec (diff)
preview images in taskview
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/File.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/app/Model/File.php b/app/Model/File.php
index f069c8cf..46710658 100644
--- a/app/Model/File.php
+++ b/app/Model/File.php
@@ -111,6 +111,38 @@ class File extends Base
->asc('name')
->findAll();
}
+
+ /**
+ * Get all images for a given task
+ *
+ * @access public
+ * @param integer $task_id Task id
+ * @return array
+ */
+ public function getAllImages($task_id)
+ {
+ return $this->db->table(self::TABLE)
+ ->eq('task_id', $task_id)
+ ->eq('is_image', 1)
+ ->asc('name')
+ ->findAll();
+ }
+
+ /**
+ * Get all files without images for a given task
+ *
+ * @access public
+ * @param integer $task_id Task id
+ * @return array
+ */
+ public function getAllDocuments($task_id)
+ {
+ return $this->db->table(self::TABLE)
+ ->eq('task_id', $task_id)
+ ->eq('is_image', 0)
+ ->asc('name')
+ ->findAll();
+ }
/**
* Check if a filename is an image