@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | $this->getKernel()->module('controlpanel'); |
22 | 22 | |
23 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
23 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
24 | 24 | return $smarty->render($this); |
25 | 25 | } |
26 | 26 |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $this->webshop = $webshop; |
59 | - $this->sql_extra = " session_id = '" . safeToDb($session_id) . "'"; |
|
59 | + $this->sql_extra = " session_id = '".safeToDb($session_id)."'"; |
|
60 | 60 | |
61 | 61 | // rydder op i databasen efter fx to timer |
62 | 62 | $clean_up_after = 2; // timer |
63 | 63 | |
64 | 64 | $db = new DB_Sql; |
65 | - $db->query("DELETE FROM basket WHERE DATE_ADD(date_changed, INTERVAL " . $clean_up_after . " HOUR) < NOW()"); |
|
65 | + $db->query("DELETE FROM basket WHERE DATE_ADD(date_changed, INTERVAL ".$clean_up_after." HOUR) < NOW()"); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -128,27 +128,27 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | $db->query("SELECT id, quantity FROM basket WHERE product_id = $product_id |
131 | - AND product_detail_id = " . $product_detail_id . " |
|
132 | - AND basketevaluation_product = " . $basketevaluation . " |
|
133 | - AND " . $this->sql_extra. " |
|
131 | + AND product_detail_id = ".$product_detail_id." |
|
132 | + AND basketevaluation_product = " . $basketevaluation." |
|
133 | + AND " . $this->sql_extra." |
|
134 | 134 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
135 | 135 | |
136 | 136 | if ($db->nextRecord()) { |
137 | 137 | if ($quantity == 0) { |
138 | 138 | $db->query("DELETE FROM basket |
139 | - WHERE id = ".$db->f('id') . " |
|
140 | - AND basketevaluation_product = " . $basketevaluation . " |
|
141 | - AND " . $this->sql_extra . " |
|
139 | + WHERE id = ".$db->f('id')." |
|
140 | + AND basketevaluation_product = " . $basketevaluation." |
|
141 | + AND " . $this->sql_extra." |
|
142 | 142 | AND intranet_id = " . $this->webshop->kernel->intranet->get("id")); |
143 | 143 | } else { |
144 | 144 | $db->query("UPDATE basket SET |
145 | 145 | quantity = $quantity, |
146 | 146 | date_changed = NOW(), |
147 | 147 | text = '".$text."' |
148 | - WHERE id = ".$db->f('id') . " |
|
149 | - AND basketevaluation_product = " . $basketevaluation . " |
|
148 | + WHERE id = ".$db->f('id')." |
|
149 | + AND basketevaluation_product = " . $basketevaluation." |
|
150 | 150 | |
151 | - AND " . $this->sql_extra . " |
|
151 | + AND " . $this->sql_extra." |
|
152 | 152 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
153 | 153 | } |
154 | 154 | return true; |
@@ -158,10 +158,10 @@ discard block |
||
158 | 158 | quantity = $quantity, |
159 | 159 | date_changed = NOW(), |
160 | 160 | text = '".$text."', |
161 | - basketevaluation_product = " . $basketevaluation . ", |
|
161 | + basketevaluation_product = " . $basketevaluation.", |
|
162 | 162 | product_id = $product_id, |
163 | 163 | product_detail_id = ".$product_detail_id.", |
164 | - intranet_id = " . $this->webshop->kernel->intranet->get('id') . ", |
|
164 | + intranet_id = " . $this->webshop->kernel->intranet->get('id').", |
|
165 | 165 | " . $this->sql_extra); |
166 | 166 | return true; |
167 | 167 | } |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | settype($input['email'], 'string'); |
187 | 187 | settype($input['phone'], 'string'); |
188 | 188 | |
189 | - $sql = "name = \"".safeToDb($input['name'])."\"," . |
|
190 | - "contactperson = \"".safeToDb($input['contactperson'])."\", " . |
|
191 | - "address = \"".safeToDb($input['address'])."\", " . |
|
192 | - "postcode = \"".safeToDb($input['postcode'])."\", " . |
|
189 | + $sql = "name = \"".safeToDb($input['name'])."\",". |
|
190 | + "contactperson = \"".safeToDb($input['contactperson'])."\", ". |
|
191 | + "address = \"".safeToDb($input['address'])."\", ". |
|
192 | + "postcode = \"".safeToDb($input['postcode'])."\", ". |
|
193 | 193 | "city = \"".safeToDb($input['city'])."\", ". |
194 | 194 | "country = \"".safeToDb($input['country'])."\", ". |
195 | 195 | "cvr = \"".safeToDb($input['cvr'])."\", ". |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | { |
253 | 253 | |
254 | 254 | $db = new DB_Sql; |
255 | - $db->query("SELECT id FROM basket_details WHERE " . $this->sql_extra. " |
|
255 | + $db->query("SELECT id FROM basket_details WHERE ".$this->sql_extra." |
|
256 | 256 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
257 | 257 | if ($db->nextRecord()) { |
258 | 258 | $db->query("UPDATE basket_details SET ".$sql.", |
259 | 259 | date_changed = NOW() |
260 | - WHERE id = ".$db->f('id') . " |
|
261 | - AND " . $this->sql_extra . " |
|
260 | + WHERE id = ".$db->f('id')." |
|
261 | + AND " . $this->sql_extra." |
|
262 | 262 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
263 | 263 | return true; |
264 | 264 | } else { |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | SET ".$sql.", |
267 | 267 | date_changed = NOW(), |
268 | 268 | date_created = NOW(), |
269 | - intranet_id = " . $this->webshop->kernel->intranet->get('id') . ", |
|
269 | + intranet_id = " . $this->webshop->kernel->intranet->get('id').", |
|
270 | 270 | " . $this->sql_extra); |
271 | 271 | |
272 | 272 | return true; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $db = new DB_Sql; |
286 | 286 | $db->query("SELECT * |
287 | 287 | FROM basket_details |
288 | - WHERE " . $this->sql_extra . " |
|
288 | + WHERE " . $this->sql_extra." |
|
289 | 289 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
290 | 290 | if (!$db->nextRecord()) { |
291 | 291 | return array(); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $db = new DB_Sql; |
315 | 315 | $db->query("SELECT customer_coupon |
316 | 316 | FROM basket_details |
317 | - WHERE " . $this->sql_extra . " |
|
317 | + WHERE " . $this->sql_extra." |
|
318 | 318 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
319 | 319 | if (!$db->nextRecord()) { |
320 | 320 | return array(); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $db = new DB_Sql; |
336 | 336 | $db->query("SELECT customer_ean |
337 | 337 | FROM basket_details |
338 | - WHERE " . $this->sql_extra . " |
|
338 | + WHERE " . $this->sql_extra." |
|
339 | 339 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
340 | 340 | if (!$db->nextRecord()) { |
341 | 341 | return array(); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $db = new DB_Sql; |
357 | 357 | $db->query("SELECT customer_comment |
358 | 358 | FROM basket_details |
359 | - WHERE " . $this->sql_extra . " |
|
359 | + WHERE " . $this->sql_extra." |
|
360 | 360 | AND intranet_id = " . $this->webshop->kernel->intranet->get('id')); |
361 | 361 | if (!$db->nextRecord()) { |
362 | 362 | return array(); |
@@ -379,9 +379,9 @@ discard block |
||
379 | 379 | $db = new DB_Sql; |
380 | 380 | $db->query("SELECT * |
381 | 381 | FROM basket |
382 | - WHERE " . $this->sql_extra . " |
|
383 | - AND product_id = " . $product_id . " |
|
384 | - AND intranet_id = " . $this->webshop->kernel->intranet->get('id') . " |
|
382 | + WHERE " . $this->sql_extra." |
|
383 | + AND product_id = " . $product_id." |
|
384 | + AND intranet_id = " . $this->webshop->kernel->intranet->get('id')." |
|
385 | 385 | AND quantity > 0 LIMIT 1"); |
386 | 386 | |
387 | 387 | if (!$db->nextRecord()) { |
@@ -401,14 +401,14 @@ discard block |
||
401 | 401 | $price = 0; |
402 | 402 | |
403 | 403 | $db = new DB_Sql; |
404 | - $db->query("SELECT product_id, quantity FROM basket WHERE " . $this->sql_extra); |
|
404 | + $db->query("SELECT product_id, quantity FROM basket WHERE ".$this->sql_extra); |
|
405 | 405 | |
406 | 406 | while ($db->nextRecord()) { |
407 | 407 | $product = new Product($this->webshop->kernel, $db->f("product_id")); |
408 | 408 | if ($type == 'exclusive_vat') { |
409 | - $price += $product->get('price') * $db->f("quantity"); |
|
409 | + $price += $product->get('price')*$db->f("quantity"); |
|
410 | 410 | } else { |
411 | - $price += $product->get('price_incl_vat') * $db->f("quantity"); |
|
411 | + $price += $product->get('price_incl_vat')*$db->f("quantity"); |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
@@ -432,9 +432,9 @@ discard block |
||
432 | 432 | ON product.id = basket.product_id |
433 | 433 | INNER JOIN product_detail |
434 | 434 | ON product.id = product_detail.product_id |
435 | - WHERE " . $this->sql_extra . " |
|
435 | + WHERE " . $this->sql_extra." |
|
436 | 436 | AND product_detail.active = 1 |
437 | - AND basket.intranet_id = " . $this->webshop->kernel->intranet->get("id") . " |
|
437 | + AND basket.intranet_id = " . $this->webshop->kernel->intranet->get("id")." |
|
438 | 438 | AND basket.quantity > 0 |
439 | 439 | "); |
440 | 440 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $weight = 0; |
443 | 443 | |
444 | 444 | while ($db->nextRecord()) { |
445 | - $weight += $db->f('weight') * $db->f('quantity'); |
|
445 | + $weight += $db->f('weight')*$db->f('quantity'); |
|
446 | 446 | } |
447 | 447 | |
448 | 448 | return $weight; |
@@ -471,9 +471,9 @@ discard block |
||
471 | 471 | ON product.id = basket.product_id |
472 | 472 | INNER JOIN product_detail |
473 | 473 | ON product.id = product_detail.product_id |
474 | - WHERE " . $this->sql_extra . " |
|
474 | + WHERE " . $this->sql_extra." |
|
475 | 475 | AND product_detail.active = 1 |
476 | - AND basket.intranet_id = " . $this->webshop->kernel->intranet->get("id") . " |
|
476 | + AND basket.intranet_id = " . $this->webshop->kernel->intranet->get("id")." |
|
477 | 477 | ORDER BY product_detail.vat DESC, basket.basketevaluation_product"); |
478 | 478 | |
479 | 479 | $i = 0; |
@@ -493,8 +493,8 @@ discard block |
||
493 | 493 | |
494 | 494 | // basket specific |
495 | 495 | $items[$i]['quantity'] = $db->f('quantity'); |
496 | - $items[$i]['totalprice'] = $db->f('quantity') * $items[$i]['price']; |
|
497 | - $items[$i]['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['price_incl_vat']; |
|
496 | + $items[$i]['totalprice'] = $db->f('quantity')*$items[$i]['price']; |
|
497 | + $items[$i]['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['price_incl_vat']; |
|
498 | 498 | |
499 | 499 | $i++; |
500 | 500 | } |
@@ -511,10 +511,10 @@ discard block |
||
511 | 511 | public function removeEvaluationProducts() |
512 | 512 | { |
513 | 513 | $db = new DB_Sql; |
514 | - $db->query("DELETE FROM basket " . |
|
515 | - "WHERE basketevaluation_product = 1 " . |
|
516 | - "AND " . $this->sql_extra . " " . |
|
517 | - "AND intranet_id = " . $this->webshop->kernel->intranet->get("id")); |
|
514 | + $db->query("DELETE FROM basket ". |
|
515 | + "WHERE basketevaluation_product = 1 ". |
|
516 | + "AND ".$this->sql_extra." ". |
|
517 | + "AND intranet_id = ".$this->webshop->kernel->intranet->get("id")); |
|
518 | 518 | return true; |
519 | 519 | |
520 | 520 | } |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | public function reset() |
528 | 528 | { |
529 | 529 | $db = new DB_Sql; |
530 | - $db->query("UPDATE basket SET session_id = '' WHERE " . $this->sql_extra . " AND intranet_id = " . $this->webshop->kernel->intranet->get("id")); |
|
531 | - $db->query("UPDATE basket_details SET session_id = '' WHERE " . $this->sql_extra . " AND intranet_id = " . $this->webshop->kernel->intranet->get("id")); |
|
530 | + $db->query("UPDATE basket SET session_id = '' WHERE ".$this->sql_extra." AND intranet_id = ".$this->webshop->kernel->intranet->get("id")); |
|
531 | + $db->query("UPDATE basket_details SET session_id = '' WHERE ".$this->sql_extra." AND intranet_id = ".$this->webshop->kernel->intranet->get("id")); |
|
532 | 532 | |
533 | 533 | return true; |
534 | 534 | } |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | |
66 | 66 | $identifier = md5($action->getOrderIdentifier().$this->intranet_id.time()); |
67 | 67 | |
68 | - $result = $this->db->exec('INSERT INTO module_package_action SET ' . |
|
69 | - 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').', ' . |
|
70 | - 'identifier = '.$this->db->quote($identifier, 'text').', ' . |
|
71 | - 'order_debtor_identifier = '.$this->db->quote($action->getOrderIdentifier(), 'text').', ' . |
|
72 | - 'date_created = NOW(), ' . |
|
73 | - 'action = '.$this->db->quote($action_serialized, 'text').', ' . |
|
68 | + $result = $this->db->exec('INSERT INTO module_package_action SET '. |
|
69 | + 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').', '. |
|
70 | + 'identifier = '.$this->db->quote($identifier, 'text').', '. |
|
71 | + 'order_debtor_identifier = '.$this->db->quote($action->getOrderIdentifier(), 'text').', '. |
|
72 | + 'date_created = NOW(), '. |
|
73 | + 'action = '.$this->db->quote($action_serialized, 'text').', '. |
|
74 | 74 | 'active = 1'); |
75 | 75 | |
76 | 76 | if (PEAR::isError($result)) { |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | public function restore($identifier) |
98 | 98 | { |
99 | 99 | |
100 | - $result = $this->db->query('SELECT id, action, identifier FROM module_package_action WHERE ' . |
|
101 | - 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND ' . |
|
102 | - 'identifier = '.$this->db->quote($identifier, 'text').' AND ' . |
|
100 | + $result = $this->db->query('SELECT id, action, identifier FROM module_package_action WHERE '. |
|
101 | + 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND '. |
|
102 | + 'identifier = '.$this->db->quote($identifier, 'text').' AND '. |
|
103 | 103 | 'active = 1 '); |
104 | 104 | |
105 | 105 | if (PEAR::isError($result)) { |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | public static function restoreFromIdentifier($db, $identifier) |
134 | 134 | { |
135 | 135 | |
136 | - $result = $db->query('SELECT id, action, identifier FROM module_package_action WHERE ' . |
|
137 | - 'identifier = '.$db->quote($identifier, 'text').' AND ' . |
|
136 | + $result = $db->query('SELECT id, action, identifier FROM module_package_action WHERE '. |
|
137 | + 'identifier = '.$db->quote($identifier, 'text').' AND '. |
|
138 | 138 | 'active = 1 '); |
139 | 139 | |
140 | 140 | if (PEAR::isError($result)) { |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | |
172 | - $result = $this->db->exec('UPDATE module_package_action SET active = 0 WHERE ' . |
|
173 | - 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND ' . |
|
172 | + $result = $this->db->exec('UPDATE module_package_action SET active = 0 WHERE '. |
|
173 | + 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND '. |
|
174 | 174 | 'id = '.$this->db->quote($this->id, 'integer')); |
175 | 175 | |
176 | 176 | if (PEAR::isError($result)) { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | // Should we rather just take intranet_id as parameter? |
49 | 49 | $this->intranet = &$intranet; |
50 | 50 | $this->db = MDB2::singleton(DB_DSN); |
51 | - $this->error = new Intraface_Error; |
|
51 | + $this->error = new Intraface_Error; |
|
52 | 52 | $this->id = (int)$id; |
53 | 53 | |
54 | 54 | if ($this->id > 0) { |
@@ -69,20 +69,20 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | // TODO: This could actually easily use dbquery |
72 | - $result = $this->db->query('SELECT intranet_module_package.id, ' . |
|
73 | - 'intranet_module_package.module_package_id, ' . |
|
74 | - 'intranet_module_package.start_date, ' . |
|
75 | - 'intranet_module_package.end_date, ' . |
|
76 | - 'intranet_module_package.order_debtor_id, ' . |
|
77 | - 'intranet_module_package.status_key, ' . |
|
78 | - 'module_package_plan.plan, ' . |
|
79 | - 'module_package_group.group_name, ' . |
|
80 | - 'DATE_FORMAT(intranet_module_package.start_date, "%d-%m-%Y") AS dk_start_date, ' . |
|
81 | - 'DATE_FORMAT(intranet_module_package.end_date, "%d-%m-%Y") AS dk_end_date ' . |
|
82 | - 'FROM intranet_module_package ' . |
|
83 | - 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id ' . |
|
84 | - 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ' . |
|
85 | - 'INNER JOIN module_package_group ON module_package.module_package_group_id = module_package_group.id ' . |
|
72 | + $result = $this->db->query('SELECT intranet_module_package.id, '. |
|
73 | + 'intranet_module_package.module_package_id, '. |
|
74 | + 'intranet_module_package.start_date, '. |
|
75 | + 'intranet_module_package.end_date, '. |
|
76 | + 'intranet_module_package.order_debtor_id, '. |
|
77 | + 'intranet_module_package.status_key, '. |
|
78 | + 'module_package_plan.plan, '. |
|
79 | + 'module_package_group.group_name, '. |
|
80 | + 'DATE_FORMAT(intranet_module_package.start_date, "%d-%m-%Y") AS dk_start_date, '. |
|
81 | + 'DATE_FORMAT(intranet_module_package.end_date, "%d-%m-%Y") AS dk_end_date '. |
|
82 | + 'FROM intranet_module_package '. |
|
83 | + 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id '. |
|
84 | + 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id '. |
|
85 | + 'INNER JOIN module_package_group ON module_package.module_package_group_id = module_package_group.id '. |
|
86 | 86 | 'WHERE intranet_id = '.$this->db->quote($this->intranet->get('id'), 'integer').' AND intranet_module_package.id = '.$this->db->quote($this->id, 'integer')); |
87 | 87 | |
88 | 88 | if (PEAR::isError($result)) { |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | return false; |
162 | 162 | } |
163 | 163 | |
164 | - $sql = "module_package_id = ".$this->db->quote($modulepackage->get('id'), 'integer').", " . |
|
165 | - "start_date = ".$this->db->quote($start_date, 'date').", " . |
|
164 | + $sql = "module_package_id = ".$this->db->quote($modulepackage->get('id'), 'integer').", ". |
|
165 | + "start_date = ".$this->db->quote($start_date, 'date').", ". |
|
166 | 166 | "end_date = ".$this->db->quote($end_date, 'date'); |
167 | 167 | |
168 | 168 | $result = $this->db->exec("INSERT INTO intranet_module_package SET ".$sql.", status_key = 1, active = 1, intranet_id = ".$this->intranet->get('id')); |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | return false; |
198 | 198 | } |
199 | 199 | |
200 | - $result = $this->db->exec('UPDATE intranet_module_package ' . |
|
201 | - 'SET order_debtor_identifier = '.$this->db->quote($order_identifier, 'text').' ' . |
|
200 | + $result = $this->db->exec('UPDATE intranet_module_package '. |
|
201 | + 'SET order_debtor_identifier = '.$this->db->quote($order_identifier, 'text').' '. |
|
202 | 202 | 'WHERE intranet_id = '.$this->db->quote($this->intranet->get('id'), 'integer').' AND id = '.$this->db->quote($this->id, 'integer')); |
203 | 203 | |
204 | 204 | if (PEAR::isError($result)) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | $result = $this->db->exec("UPDATE intranet_module_package SET status_key = 3 WHERE intranet_id = ".$this->intranet->get('id')." AND id = ".intval($this->id)); |
223 | 223 | if (PEAR::isError($result)) { |
224 | - throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->terminate :". $result->getUserInfo()); |
|
224 | + throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->terminate :".$result->getUserInfo()); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | return $result; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | } |
240 | 240 | $result = $this->db->exec("UPDATE intranet_module_package SET active = 0 WHERE intranet_id = ".$this->intranet->get('id')." AND id = ".intval($this->id)); |
241 | 241 | if (PEAR::isError($result)) { |
242 | - throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->delete :". $result->getUserInfo()); |
|
242 | + throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->delete :".$result->getUserInfo()); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | return $result; |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | // TODO: If DBQuery had not needed kernel we could have used it here! |
266 | - $result = $this->db->query('SELECT module_package_plan.plan_index FROM intranet_module_package ' . |
|
267 | - 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id ' . |
|
268 | - 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ' . |
|
269 | - 'WHERE intranet_module_package.intranet_id = '.$this->intranet->get('id').' AND intranet_module_package.active = 1 AND (intranet_module_package.status_key = 1 OR intranet_module_package.status_key = 2) AND module_package.module_package_group_id = '.$modulepackage->get('group_id').' ' . |
|
266 | + $result = $this->db->query('SELECT module_package_plan.plan_index FROM intranet_module_package '. |
|
267 | + 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id '. |
|
268 | + 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id '. |
|
269 | + 'WHERE intranet_module_package.intranet_id = '.$this->intranet->get('id').' AND intranet_module_package.active = 1 AND (intranet_module_package.status_key = 1 OR intranet_module_package.status_key = 2) AND module_package.module_package_group_id = '.$modulepackage->get('group_id').' '. |
|
270 | 270 | 'ORDER BY end_date DESC'); |
271 | 271 | |
272 | 272 | if (PEAR::isError($result)) { |
@@ -301,10 +301,10 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | // TODO: If DBQuery had not needed kernel we could have used it here! |
304 | - $result = $this->db->query('SELECT intranet_module_package.end_date FROM intranet_module_package ' . |
|
305 | - 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id ' . |
|
306 | - 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ' . |
|
307 | - 'WHERE intranet_module_package.intranet_id = '.$this->intranet->get('id').' AND intranet_module_package.active = 1 AND (intranet_module_package.status_key = 1 OR intranet_module_package.status_key = 2) AND module_package.module_package_group_id = '.$modulepackage->get('group_id').' ' . |
|
304 | + $result = $this->db->query('SELECT intranet_module_package.end_date FROM intranet_module_package '. |
|
305 | + 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id '. |
|
306 | + 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id '. |
|
307 | + 'WHERE intranet_module_package.intranet_id = '.$this->intranet->get('id').' AND intranet_module_package.active = 1 AND (intranet_module_package.status_key = 1 OR intranet_module_package.status_key = 2) AND module_package.module_package_group_id = '.$modulepackage->get('group_id').' '. |
|
308 | 308 | 'ORDER BY end_date DESC'); |
309 | 309 | |
310 | 310 | if (PEAR::isError($result)) { |
@@ -480,11 +480,11 @@ discard block |
||
480 | 480 | $shop = new Intraface_modules_modulepackage_ShopExtension; |
481 | 481 | |
482 | 482 | // TODO: If DBQuery had not needed kernel we could have used it here! |
483 | - $result = $this->db->query('SELECT intranet_module_package.id, intranet_module_package.status_key, intranet_module_package.start_date, intranet_module_package.end_date, intranet_module_package.order_debtor_id, intranet_module_package.module_package_id, module_package.product_id ' . |
|
484 | - 'FROM intranet_module_package ' . |
|
485 | - 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id ' . |
|
486 | - 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ' . |
|
487 | - 'WHERE intranet_module_package.intranet_id = '.$this->intranet->get('id').' AND intranet_module_package.active = 1 AND (intranet_module_package.status_key = 1 OR intranet_module_package.status_key = 2) AND module_package.module_package_group_id = '.$modulepackage->get('group_id').' ' . |
|
483 | + $result = $this->db->query('SELECT intranet_module_package.id, intranet_module_package.status_key, intranet_module_package.start_date, intranet_module_package.end_date, intranet_module_package.order_debtor_id, intranet_module_package.module_package_id, module_package.product_id '. |
|
484 | + 'FROM intranet_module_package '. |
|
485 | + 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id '. |
|
486 | + 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id '. |
|
487 | + 'WHERE intranet_module_package.intranet_id = '.$this->intranet->get('id').' AND intranet_module_package.active = 1 AND (intranet_module_package.status_key = 1 OR intranet_module_package.status_key = 2) AND module_package.module_package_group_id = '.$modulepackage->get('group_id').' '. |
|
488 | 488 | 'ORDER BY end_date DESC'); |
489 | 489 | |
490 | 490 | if (PEAR::isError($result)) { |
@@ -567,15 +567,15 @@ discard block |
||
567 | 567 | $this->dbquery->setSorting('module_package_group.sorting_index, module_package_plan.plan_index, intranet_module_package.start_date'); |
568 | 568 | } |
569 | 569 | |
570 | - $db = $this->dbquery->getRecordset('intranet_module_package.id, ' . |
|
571 | - 'intranet_module_package.module_package_id, ' . |
|
572 | - 'intranet_module_package.start_date, ' . |
|
573 | - 'intranet_module_package.end_date, ' . |
|
574 | - 'intranet_module_package.order_debtor_id, ' . |
|
575 | - 'intranet_module_package.status_key, ' . |
|
576 | - 'module_package_plan.plan, ' . |
|
577 | - 'module_package_group.group_name, ' . |
|
578 | - 'DATE_FORMAT(intranet_module_package.start_date, "%d-%m-%Y") AS dk_start_date, ' . |
|
570 | + $db = $this->dbquery->getRecordset('intranet_module_package.id, '. |
|
571 | + 'intranet_module_package.module_package_id, '. |
|
572 | + 'intranet_module_package.start_date, '. |
|
573 | + 'intranet_module_package.end_date, '. |
|
574 | + 'intranet_module_package.order_debtor_id, '. |
|
575 | + 'intranet_module_package.status_key, '. |
|
576 | + 'module_package_plan.plan, '. |
|
577 | + 'module_package_group.group_name, '. |
|
578 | + 'DATE_FORMAT(intranet_module_package.start_date, "%d-%m-%Y") AS dk_start_date, '. |
|
579 | 579 | 'DATE_FORMAT(intranet_module_package.end_date, "%d-%m-%Y") AS dk_end_date', '', false); |
580 | 580 | |
581 | 581 | $modulepackages = array(); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | 'keywords' => $keywords, |
30 | 30 | 'checked' => $checked); |
31 | 31 | |
32 | - $smarty = $this->template->create(dirname(__FILE__) . '/../templates/connect'); |
|
32 | + $smarty = $this->template->create(dirname(__FILE__).'/../templates/connect'); |
|
33 | 33 | return $smarty->render($this, $data); |
34 | 34 | } |
35 | 35 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | 'kernel' => $kernel, |
31 | 31 | 'gateway' => $gateway); |
32 | 32 | |
33 | - $tpl = $this->template->create(dirname(__FILE__) . '/../templates/batchedit'); |
|
33 | + $tpl = $this->template->create(dirname(__FILE__).'/../templates/batchedit'); |
|
34 | 34 | return $tpl->render($this, $data); |
35 | 35 | } |
36 | 36 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'instance_manager' => $instance_manager, |
30 | 30 | 'instances' => $instances); |
31 | 31 | |
32 | - $tpl = $this->template->create(dirname(__FILE__) . '/../templates/sizes'); |
|
32 | + $tpl = $this->template->create(dirname(__FILE__).'/../templates/sizes'); |
|
33 | 33 | return $tpl->render($this, $data); |
34 | 34 | } |
35 | 35 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | 'instance_manager' => $instance_manager, |
48 | 48 | 'value' => $value); |
49 | 49 | |
50 | - $tpl = $this->template->create(dirname(__FILE__) . '/../templates/sizes-edit'); |
|
50 | + $tpl = $this->template->create(dirname(__FILE__).'/../templates/sizes-edit'); |
|
51 | 51 | return $tpl->render($this, $data); |
52 | 52 | } |
53 | 53 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | 'instance_manager' => $instance_manager, |
22 | 22 | 'value' => $value); |
23 | 23 | |
24 | - $tpl = $this->template->create(dirname(__FILE__) . '/../templates/sizes-edit'); |
|
24 | + $tpl = $this->template->create(dirname(__FILE__).'/../templates/sizes-edit'); |
|
25 | 25 | return $tpl->render($this, $data); |
26 | 26 | } |
27 | 27 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | $db = new DB_Sql; |
83 | 83 | $db->query('SET NAMES utf8'); /* To be removed when everything is in utf-8 */ |
84 | - $sql = "SELECT id, email.date_sent, DATE_FORMAT(date_sent, '%d-%m-%Y') as date_sent_dk, subject, from_name, from_email, user_id, body, status, contact_id, contact_person_id, type_id, belong_to_id, status, bcc_to_user FROM email WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = " . $this->id; |
|
84 | + $sql = "SELECT id, email.date_sent, DATE_FORMAT(date_sent, '%d-%m-%Y') as date_sent_dk, subject, from_name, from_email, user_id, body, status, contact_id, contact_person_id, type_id, belong_to_id, status, bcc_to_user FROM email WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = ".$this->id; |
|
85 | 85 | $db->query($sql); |
86 | 86 | if (!$db->nextRecord()) { |
87 | 87 | return false; |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | if ($this->id == 0) { |
175 | 175 | $sql_type = "INSERT INTO "; |
176 | 176 | $sql_end = ", date_created = NOW(), |
177 | - belong_to_id = ".(int)$var['belong_to'] . ", |
|
178 | - type_id = ".(int)$var['type_id'] . ", |
|
177 | + belong_to_id = ".(int)$var['belong_to'].", |
|
178 | + type_id = ".(int)$var['type_id'].", |
|
179 | 179 | contact_id=".$var['contact_id']; |
180 | 180 | } else { |
181 | 181 | $sql_type = "UPDATE "; |
182 | - $sql_end = " WHERE id = " . $this->id; |
|
182 | + $sql_end = " WHERE id = ".$this->id; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | if (!empty($var['date_deadline'])) { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | // gemme userid hvis vi er inde i systemet |
192 | 192 | if (is_object($this->kernel->user) and $this->kernel->user->get('id') > 0) { |
193 | 193 | //$db->query("UPDATE email SET user_id = ".$this->kernel->user->get('id')." WHERE id = " . $this->id); |
194 | - $sql_extra = ', user_id = ' . $db->quote($this->kernel->user->get('id'), 'integer'); |
|
194 | + $sql_extra = ', user_id = '.$db->quote($this->kernel->user->get('id'), 'integer'); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | if (!isset($var['contact_person_id'])) { |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | // status 1 = draft |
206 | - $sql = $sql_type . " email SET |
|
206 | + $sql = $sql_type." email SET |
|
207 | 207 | contact_person_id = ".(int)$var['contact_person_id'].", |
208 | 208 | bcc_to_user = ".(int)$var['bcc_to_user'].", |
209 | 209 | date_updated = NOW(), |
210 | - intranet_id = " . $this->kernel->intranet->get('id') . ", |
|
210 | + intranet_id = " . $this->kernel->intranet->get('id').", |
|
211 | 211 | subject = '".$var['subject']."', |
212 | 212 | body = '".$var['body']."', |
213 | 213 | date_deadline = ".$date_deadline.", |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | function saveErrorMsg($error) |
246 | 246 | { |
247 | 247 | $db = new DB_Sql; |
248 | - $db->query("UPDATE email SET error_msg = '".$error."' WHERE id = " . $this->id); |
|
248 | + $db->query("UPDATE email SET error_msg = '".$error."' WHERE id = ".$this->id); |
|
249 | 249 | return true; |
250 | 250 | } |
251 | 251 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | return false; |
261 | 261 | } |
262 | 262 | $db = new DB_Sql; |
263 | - $db->query("UPDATE email SET status = 3, date_sent = NOW() WHERE id = " . $this->id); |
|
263 | + $db->query("UPDATE email SET status = 3, date_sent = NOW() WHERE id = ".$this->id); |
|
264 | 264 | return true; |
265 | 265 | } |
266 | 266 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | $db = new DB_Sql; |
293 | 293 | // Putter e-mailen i outboxen (status = 2) |
294 | - $db->query("UPDATE email SET status = 2 WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = " . $this->id); |
|
294 | + $db->query("UPDATE email SET status = 2 WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = ".$this->id); |
|
295 | 295 | return true; |
296 | 296 | } |
297 | 297 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | { |
300 | 300 | $contact = $this->getContact(); |
301 | 301 | if ($this->get('contact_id') == 0 or !is_object($contact)) { |
302 | - $this->error->set('Der kunne ikke sendes e-mail til email #' . $this->get('id') . ' fordi der ikke var nogen kunde sat'); |
|
302 | + $this->error->set('Der kunne ikke sendes e-mail til email #'.$this->get('id').' fordi der ikke var nogen kunde sat'); |
|
303 | 303 | return false; |
304 | 304 | } |
305 | 305 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | { |
384 | 384 | $db = new DB_Sql; |
385 | 385 | $db->query("SELECT file_id, filename FROM email_attachment |
386 | - WHERE intranet_id = " .$this->kernel->intranet->get('id') . " AND email_id = " . $this->id); |
|
386 | + WHERE intranet_id = " .$this->kernel->intranet->get('id')." AND email_id = ".$this->id); |
|
387 | 387 | $file = array(); |
388 | 388 | $i = 0; |
389 | 389 | while ($db->nextRecord()) { |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | return false; |
415 | 415 | } |
416 | 416 | $db = new DB_Sql; |
417 | - $db->query("DELETE FROM email WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
417 | + $db->query("DELETE FROM email WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
418 | 418 | return true; |
419 | 419 | } |
420 | 420 |