Browse Source

Doc block changes

Timothy J. Warren 3 years ago
parent
commit
9446816131

+ 37
- 5
application/core/MY_Controller.php View File

@@ -6,12 +6,44 @@
6 6
 class MY_Controller extends CI_Controller {
7 7
 
8 8
 	/**
9
-	 * Constructor
9
+	 * @var MY_Session
10 10
 	 */
11
-	public function __construct()
12
-	{
13
-		parent::__construct();
14
-	}
11
+	public $session;
12
+
13
+	/**
14
+	 * @var CI_DB_query_builder
15
+	 */
16
+	public $db;
17
+
18
+	/**
19
+	 * @var CI_Input
20
+	 */
21
+	public $input;
22
+
23
+	/**
24
+	 * @var CI_Uri
25
+	 */
26
+	public $uri;
27
+
28
+	/**
29
+	 * @var MY_Form_validation
30
+	 */
31
+	public $form_validation;
32
+
33
+	/**
34
+	 * @var Validation_Callbacks
35
+	 */
36
+	public $validation_callbacks;
37
+
38
+	/**
39
+	 * @var CI_Output
40
+	 */
41
+	public $output;
42
+
43
+	/**
44
+	 * @var Page
45
+	 */
46
+	public $page;
15 47
 
16 48
 	// --------------------------------------------------------------------------
17 49
 

+ 6
- 1
application/libraries/Todo.php View File

@@ -7,7 +7,12 @@
7 7
  */
8 8
 class Todo {
9 9
 
10
-	private $user, $pass, $CI, $uid; //For user registration
10
+	private $user, $pass, $uid; //For user registration
11
+
12
+	/**
13
+	 * @var MY_Controller
14
+	 */
15
+	protected $CI;
11 16
 
12 17
 	/**
13 18
 	 * Constructor

+ 16
- 15
application/models/task_model.php View File

@@ -6,7 +6,7 @@
6 6
  */
7 7
 class Task_model extends CI_Model {
8 8
 
9
-	private $title, $description, $category, $priority, $due, $created,
9
+	private $title, $description, $category, $priority, $due,
10 10
 			$status, $user_id, $task_id, $reminder, $reminder_time,
11 11
 			$groups, $group_perms, $friends, $friend_perms, $share_type;
12 12
 
@@ -110,7 +110,7 @@ class Task_model extends CI_Model {
110 110
 	 * Get Checklist
111 111
 	 *
112 112
 	 * Returns Checklist for current task
113
-	 * @param int task_id
113
+	 * @param int $task_id
114 114
 	 * @return array
115 115
 	 */
116 116
 	public function get_checklist($task_id)
@@ -212,7 +212,7 @@ class Task_model extends CI_Model {
212 212
 
213 213
 		$res = $this->db->get();
214 214
 
215
-		if($res->num_rows()==0) return;
215
+		if($res->num_rows()==0) return NULL;
216 216
 
217 217
 		$result_array = array();
218 218
 		$i=1;
@@ -259,8 +259,7 @@ class Task_model extends CI_Model {
259 259
 
260 260
 		$res = $this->db->get();
261 261
 
262
-		if($res->num_rows()==0)
263
-			return;
262
+		if($res->num_rows()==0) return NULL;
264 263
 
265 264
 		$result_array = array();
266 265
 		$i=1;
@@ -294,7 +293,7 @@ class Task_model extends CI_Model {
294 293
 			->join('category', 'category.id=item.category_id', 'inner')
295 294
 			->join('priority', 'priority.id=item.priority', 'inner')
296 295
 			->join('status', 'status.id=item.status', 'inner')
297
-			->where('user_id', (int)$this->session->userdata('uid'))
296
+			->where('user_id', (int) $this->session->userdata('uid'))
298 297
 
299 298
 			->group_start()
300 299
 			->where('due <', time())
@@ -309,7 +308,7 @@ class Task_model extends CI_Model {
309 308
 		$res = $this->db->get();
310 309
 
311 310
 		if($res->num_rows()==0)
312
-			return;
311
+			return NULL;
313 312
 
314 313
 		$result_array = array();
315 314
 		$i=1;
@@ -728,7 +727,7 @@ class Task_model extends CI_Model {
728 727
 	/**
729 728
 	 * Get Task By Id
730 729
 	 *
731
-	 * Retreives task from database by task id
730
+	 * Retrieves task from database by task id
732 731
 	 * @param int $task_id
733 732
 	 * @return array
734 733
 	 */
@@ -923,7 +922,7 @@ class Task_model extends CI_Model {
923 922
 	 * Get Category Select
924 923
 	 *
925 924
 	 * Returns category options for task status
926
-	 * @param int $id
925
+	 * @param int $task_id
927 926
 	 * @return string
928 927
 	 */
929 928
 	public function get_category_select($task_id=0)
@@ -1192,9 +1191,10 @@ class Task_model extends CI_Model {
1192 1191
 	 * Updates a checklist
1193 1192
 	 *
1194 1193
 	 * @param int $check_id
1195
-	 * @param bit $checked
1194
+	 * @param int $checked
1195
+	 * @return int
1196 1196
 	 */
1197
-	public function update_checklist($check_id,  $checked)
1197
+	public function update_checklist($check_id, $checked)
1198 1198
 	{
1199 1199
 		$task_id = $this->input->post('task_id');
1200 1200
 
@@ -1393,7 +1393,7 @@ class Task_model extends CI_Model {
1393 1393
 	 * Get Task Perms
1394 1394
 	 *
1395 1395
 	 * Get the permissions of the current task
1396
-	 * @param int $id
1396
+	 * @param int $task_id
1397 1397
 	 * @return array
1398 1398
 	 */
1399 1399
 	private function _get_task_perms($task_id)
@@ -1513,12 +1513,12 @@ class Task_model extends CI_Model {
1513 1513
 			if($result_array['user_perms'] == PERM_NO_ACCESS)
1514 1514
 			{
1515 1515
 				show_error('You do not have permission to view this task.');
1516
-				return;
1516
+				return NULL;
1517 1517
 			}
1518 1518
 			else if($result_array['user_perms'] < PERM_WRITE_ACCESS && $this->uri->segment('2') == "edit")
1519 1519
 			{
1520 1520
 				show_error('You do not have permission to edit this task.');
1521
-				return;
1521
+				return NULL;
1522 1522
 			}
1523 1523
 
1524 1524
 			return $result_array;
@@ -1562,4 +1562,5 @@ class Task_model extends CI_Model {
1562 1562
 		//Redirect to the task list
1563 1563
 		$this->todo->redirect_303(site_url('task/list'));
1564 1564
 	}
1565
-}
1565
+}
1566
+// End of task_model.php