@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | $this->kernel = $kernel; |
37 | - $this->id = (int) $id; |
|
37 | + $this->id = (int)$id; |
|
38 | 38 | |
39 | 39 | if ($this->id > 0) { |
40 | 40 | $this->load(); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | $db = new DB_Sql; |
62 | - $db->query("SELECT * FROM todo_item WHERE " . $sql_status . " todo_list_id =" . (int)$this->getId() . " AND active = 1 ORDER BY status ASC, position ASC"); |
|
62 | + $db->query("SELECT * FROM todo_item WHERE ".$sql_status." todo_list_id =".(int)$this->getId()." AND active = 1 ORDER BY status ASC, position ASC"); |
|
63 | 63 | $ids = array(); |
64 | 64 | $i = 0; |
65 | 65 | while ($db->nextRecord()) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | public function setAllItemsUndone() |
101 | 101 | { |
102 | 102 | $db = new DB_Sql; |
103 | - $db->query("UPDATE todo_item SET status = 0 WHERE todo_list_id = " . $this->getId()); |
|
103 | + $db->query("UPDATE todo_item SET status = 0 WHERE todo_list_id = ".$this->getId()); |
|
104 | 104 | return true; |
105 | 105 | } |
106 | 106 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | public function deleteAllItems() |
141 | 141 | { |
142 | 142 | $db = new DB_Sql; |
143 | - $db->query("DELETE FROM todo_item WHERE todo_list_id = " . $this->id. " AND active = 1 AND status = 0"); |
|
143 | + $db->query("DELETE FROM todo_item WHERE todo_list_id = ".$this->id." AND active = 1 AND status = 0"); |
|
144 | 144 | return true; |
145 | 145 | } |
146 | 146 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | private function load() |
153 | 153 | { |
154 | 154 | $db = new Db_Sql; |
155 | - $db->query("SELECT * FROM todo_list WHERE id = " . $this->id . " LIMIT 1"); |
|
155 | + $db->query("SELECT * FROM todo_list WHERE id = ".$this->id." LIMIT 1"); |
|
156 | 156 | if ($db->nextRecord()) { |
157 | 157 | $this->value['id'] = $db->f('id'); |
158 | 158 | $this->value['list_name'] = $db->f('name'); |
@@ -218,13 +218,13 @@ discard block |
||
218 | 218 | |
219 | 219 | if ($this->id == 0) { |
220 | 220 | $sql_type = "INSERT INTO "; |
221 | - $sql_end = ", date_created = NOW(), public_key = '" .$this->kernel->randomKey(10) . "'"; |
|
221 | + $sql_end = ", date_created = NOW(), public_key = '".$this->kernel->randomKey(10)."'"; |
|
222 | 222 | } else { |
223 | 223 | $sql_type = "UPDATE "; |
224 | - $sql_end = " WHERE id = " . $this->id; |
|
224 | + $sql_end = " WHERE id = ".$this->id; |
|
225 | 225 | } |
226 | 226 | $db = new DB_Sql; |
227 | - $db->query($sql_type. " todo_list SET description = '".$var['list_description']."', name = '".$var['list_name']."', date_changed=NOW(),intranet_id = " . $this->kernel->intranet->get('id') . $sql_end); |
|
227 | + $db->query($sql_type." todo_list SET description = '".$var['list_description']."', name = '".$var['list_name']."', date_changed=NOW(),intranet_id = ".$this->kernel->intranet->get('id').$sql_end); |
|
228 | 228 | |
229 | 229 | if ($this->id == 0) { |
230 | 230 | $this->id = $db->insertedId(); |
@@ -246,12 +246,12 @@ discard block |
||
246 | 246 | $db->query("SELECT * FROM todo_list |
247 | 247 | WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
248 | 248 | $ids = array(); |
249 | - $i=0; |
|
249 | + $i = 0; |
|
250 | 250 | while ($db->nextRecord()) { |
251 | 251 | $todo = new TodoList($this->kernel, $db->f('id')); |
252 | 252 | if ($type == 'done' and $todo->howManyLeft() > 0) { |
253 | 253 | continue; |
254 | - } elseif ($type != 'done' and $todo->howManyLeft() == 0) { |
|
254 | + } elseif ($type != 'done' and $todo->howManyLeft() == 0) { |
|
255 | 255 | continue; |
256 | 256 | } |
257 | 257 | $ids[$i]['id'] = $db->f('id'); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | public function howManyLeft() |
271 | 271 | { |
272 | 272 | $db = new DB_Sql; |
273 | - $db->query("SELECT * FROM todo_item WHERE status = 0 AND active = 1 AND todo_list_id = " . $this->id); |
|
273 | + $db->query("SELECT * FROM todo_item WHERE status = 0 AND active = 1 AND todo_list_id = ".$this->id); |
|
274 | 274 | return $db->numRows(); |
275 | 275 | } |
276 | 276 | |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | { |
284 | 284 | $id = (int)$id; |
285 | 285 | $db = new DB_Sql; |
286 | - $db->query("SELECT * FROM todo_contact WHERE contact_id = " . $id); |
|
286 | + $db->query("SELECT * FROM todo_contact WHERE contact_id = ".$id); |
|
287 | 287 | if ($db->nextRecord()) { |
288 | 288 | return true; |
289 | 289 | } |
290 | - $db->query("INSERT INTO todo_contact SET contact_id = " . $id . ", list_id = ".$this->get('id').", intranet_id = " . $this->kernel->intranet->get('id')); |
|
290 | + $db->query("INSERT INTO todo_contact SET contact_id = ".$id.", list_id = ".$this->get('id').", intranet_id = ".$this->kernel->intranet->get('id')); |
|
291 | 291 | return true; |
292 | 292 | } |
293 | 293 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $db = new DB_Sql; |
302 | 302 | $i = 0; |
303 | 303 | $contacts = array(); |
304 | - $db->query("SELECT * FROM todo_contact WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
304 | + $db->query("SELECT * FROM todo_contact WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
305 | 305 | while ($db->nextRecord()) { |
306 | 306 | $contacts[$i] = $db->f('contact_id'); |
307 | 307 | $i++; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | throw new Exception('Todo kr�ver Kernel'); |
30 | 30 | } |
31 | 31 | $this->todo = $todo; |
32 | - $this->id = (int) $id; |
|
32 | + $this->id = (int)$id; |
|
33 | 33 | |
34 | 34 | if ($this->id > 0) { |
35 | 35 | $this->load(); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | private function load() |
45 | 45 | { |
46 | 46 | $db = new Db_Sql; |
47 | - $db->query("SELECT * FROM todo_item WHERE id = " . $this->id); |
|
47 | + $db->query("SELECT * FROM todo_item WHERE id = ".$this->id); |
|
48 | 48 | if ($db->nextRecord()) { |
49 | 49 | $this->value['id'] = $db->f('id'); |
50 | 50 | $this->value['item'] = $db->f('item'); |
@@ -103,20 +103,20 @@ discard block |
||
103 | 103 | $db = new DB_Sql; |
104 | 104 | |
105 | 105 | if ($this->id == 0) { |
106 | - $db->query("SELECT position FROM todo_item WHERE todo_list_id = " . $this->todo->get('id') . " ORDER BY position DESC LIMIT 1"); |
|
106 | + $db->query("SELECT position FROM todo_item WHERE todo_list_id = ".$this->todo->get('id')." ORDER BY position DESC LIMIT 1"); |
|
107 | 107 | $db->nextRecord(); |
108 | 108 | $new_position = $db->f('position') + 1; |
109 | 109 | } |
110 | 110 | |
111 | 111 | if ($this->id == 0) { |
112 | 112 | $sql_type = "INSERT INTO "; |
113 | - $sql_end = ", date_created = NOW(), position = " . $new_position; |
|
113 | + $sql_end = ", date_created = NOW(), position = ".$new_position; |
|
114 | 114 | } else { |
115 | 115 | $sql_type = "UPDATE "; |
116 | - $sql_end = " WHERE id = " . $this->id; |
|
116 | + $sql_end = " WHERE id = ".$this->id; |
|
117 | 117 | } |
118 | 118 | |
119 | - $db->query($sql_type. " todo_item SET intranet_id = ".$this->todo->kernel->intranet->get('id').", item = '".$var."', todo_list_id = ".(int)$this->todo->get('id').", responsible_user_id = " .$user_id. " " . $sql_end); |
|
119 | + $db->query($sql_type." todo_item SET intranet_id = ".$this->todo->kernel->intranet->get('id').", item = '".$var."', todo_list_id = ".(int)$this->todo->get('id').", responsible_user_id = ".$user_id." ".$sql_end); |
|
120 | 120 | |
121 | 121 | if ($this->id == 0) { |
122 | 122 | $this->id = $db->insertedId(); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | return false; |
136 | 136 | } |
137 | 137 | $db = new DB_Sql; |
138 | - $db->query("UPDATE todo_item SET status = 1 WHERE id = " . $this->id); |
|
138 | + $db->query("UPDATE todo_item SET status = 1 WHERE id = ".$this->id); |
|
139 | 139 | return true; |
140 | 140 | } |
141 | 141 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | $db = new DB_Sql; |
153 | - $db->query("UPDATE todo_item SET active = 0 WHERE id = " . $this->id); |
|
153 | + $db->query("UPDATE todo_item SET active = 0 WHERE id = ".$this->id); |
|
154 | 154 | return true; |
155 | 155 | } |
156 | 156 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <h1><?php e(t('Todo')); ?></h1> |
2 | 2 | |
3 | 3 | <ul class="options"> |
4 | - <li><a href="<?php e(url('create'));?>"><?php e(t('Create list')); ?></a></li> |
|
4 | + <li><a href="<?php e(url('create')); ?>"><?php e(t('Create list')); ?></a></li> |
|
5 | 5 | </ul> |
6 | 6 | |
7 | 7 | <?php if (count($todo_list) == 0) : ?> |
8 | 8 | |
9 | - <p><?php e(t('No lists available'))?>. <a href="<?php e(url('create'));?>"><?php e(t('Create list')); ?></a>.</p> |
|
9 | + <p><?php e(t('No lists available'))?>. <a href="<?php e(url('create')); ?>"><?php e(t('Create list')); ?></a>.</p> |
|
10 | 10 | |
11 | 11 | <?php else : ?> |
12 | 12 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $todo = new TodoList($this->getKernel(), $this->context->name()); |
19 | 19 | $value['id'] = $todo->get('id'); |
20 | 20 | $value['subject'] = 'Todoliste'; |
21 | - $value['body'] = $this->getKernel()->setting->get('user', 'todo.email.standardtext') . "\n\nMed venlig hilsen\n".$this->getKernel()->user->getAddress()->get('name') . "\n" . $this->getKernel()->intranet->get('name'); |
|
21 | + $value['body'] = $this->getKernel()->setting->get('user', 'todo.email.standardtext')."\n\nMed venlig hilsen\n".$this->getKernel()->user->getAddress()->get('name')."\n".$this->getKernel()->intranet->get('name'); |
|
22 | 22 | |
23 | 23 | $contacts = $todo->getContacts(); |
24 | 24 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | 'value' => $value |
32 | 32 | ); |
33 | 33 | |
34 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/email'); |
|
34 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/email'); |
|
35 | 35 | return $tpl->render($this, $data); |
36 | 36 | } |
37 | 37 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | $email = new Email($this->getKernel()); |
56 | 56 | $var = array( |
57 | - 'body' => $_POST['body'] . "\n\n" . $contact->getLoginUrl(), |
|
57 | + 'body' => $_POST['body']."\n\n".$contact->getLoginUrl(), |
|
58 | 58 | 'subject' => $_POST['subject'], |
59 | 59 | 'contact_id' => $contact->get('id'), |
60 | 60 | 'type_id' => 6, // type_id 6 er todo |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | 'kernel' => $this->getKernel() |
28 | 28 | ); |
29 | 29 | |
30 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/edit'); |
|
30 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/edit'); |
|
31 | 31 | return $tpl->render($this, $data); |
32 | 32 | } |
33 | 33 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $item_id = 0; |
52 | 52 | } |
53 | 53 | } |
54 | - return new k_SeeOther($this->url('../' . $todo->get('id'))); |
|
54 | + return new k_SeeOther($this->url('../'.$todo->get('id'))); |
|
55 | 55 | } |
56 | 56 | return $this->render(); |
57 | 57 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | $this->document()->addScript('todo/todo.js'); |
50 | 50 | |
51 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/todo'); |
|
51 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/todo'); |
|
52 | 52 | return $tpl->render($this, $data); |
53 | 53 | } |
54 | 54 |
@@ -13,14 +13,14 @@ |
||
13 | 13 | $module = $this->getKernel()->module('todo'); |
14 | 14 | $translation = $this->getKernel()->getTranslation('todo'); |
15 | 15 | |
16 | - $value['publiclist'] = $kernel->setting->get('intranet', 'todo.publiclist'); |
|
17 | - $value['emailstandardtext'] = $kernel->setting->get('user', 'todo.email.standardtext'); |
|
16 | + $value['publiclist'] = $kernel->setting->get('intranet', 'todo.publiclist'); |
|
17 | + $value['emailstandardtext'] = $kernel->setting->get('user', 'todo.email.standardtext'); |
|
18 | 18 | |
19 | 19 | $data = array( |
20 | 20 | 'value' => $value |
21 | 21 | ); |
22 | 22 | |
23 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/setting'); |
|
23 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/setting'); |
|
24 | 24 | return $tpl->render($this, $data); |
25 | 25 | } |
26 | 26 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | } else { |
20 | 20 | foreach ($list as $key => $module) { |
21 | 21 | // check whether there is any expering within a month and if there is no other packages comming up in the same group. |
22 | - if (strtotime($module['end_date']) < strtotime('+1 month') && (!isset($list[$key+1]) || $module['group'] != $list[$key+1]['group'])) { |
|
22 | + if (strtotime($module['end_date']) < strtotime('+1 month') && (!isset($list[$key + 1]) || $module['group'] != $list[$key + 1]['group'])) { |
|
23 | 23 | $_advice[] = array( |
24 | 24 | 'msg' => 'You have modules that expire within a month! Click here to extend the modules now to keep the functionality of your intranet', |
25 | 25 | 'link' => $this->url('module/modulepackage'), |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | <tbody> |
33 | 33 | <?php foreach ($packages as $package) : ?> |
34 | 34 | <tr> |
35 | - <td><?php e($package['plan'] . ' '. $package['group']); ?></td> |
|
35 | + <td><?php e($package['plan'].' '.$package['group']); ?></td> |
|
36 | 36 | <td><?php e($package['dk_start_date']); ?></td> |
37 | 37 | <td><?php e($package['dk_end_date']); ?></td> |
38 | 38 | <td><?php e(t($package['status'])); ?></td> |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | <p> DKK <?php e($packages[$group['id']][$plan['id']]['product']['price_incl_vat'].' '.t('per').' '.t($packages[$group['id']][$plan['id']]['product']['unit']['singular'])); ?></p> |
138 | 138 | <?php } ?> |
139 | 139 | |
140 | - <a href="<?php e(url('package/' . $packages[$group['id']][$plan['id']]['id'])); ?>"><?php e(t('choose')); ?></a> |
|
140 | + <a href="<?php e(url('package/'.$packages[$group['id']][$plan['id']]['id'])); ?>"><?php e(t('choose')); ?></a> |
|
141 | 141 | |
142 | 142 | <?php } ?> |
143 | 143 | </td> |