@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | function renderHtml() |
12 | 12 | { |
13 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
13 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
14 | 14 | return $smarty->render($this); |
15 | 15 | } |
16 | 16 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | # If there is subcategories to the category |
33 | 33 | if (is_array($category['categories']) && count($category['categories']) > 0) { |
34 | 34 | # We make the items for the next level the sub categories of this category |
35 | - $level_categories[$level+1] = $category['categories']; |
|
35 | + $level_categories[$level + 1] = $category['categories']; |
|
36 | 36 | |
37 | 37 | # We move to next level |
38 | 38 | $level++; |
@@ -196,14 +196,14 @@ discard block |
||
196 | 196 | if ($value['message'] != '') { |
197 | 197 | $value['message'] .= "\n\n"; |
198 | 198 | } |
199 | - $value['message'] .= "Kundekupon:". $input['customer_coupon']; |
|
199 | + $value['message'] .= "Kundekupon:".$input['customer_coupon']; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | if (isset($input['customer_comment']) && $input['customer_comment'] != '') { |
203 | 203 | if ($value['message'] != '') { |
204 | 204 | $value['message'] .= "\n\n"; |
205 | 205 | } |
206 | - $value['message'] .= "Kommentar:\n". $input['customer_comment']; |
|
206 | + $value['message'] .= "Kommentar:\n".$input['customer_comment']; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | if (isset($input['payment_method']) && is_array($input['payment_method']) && !empty($input['payment_method'])) { |
@@ -328,15 +328,15 @@ discard block |
||
328 | 328 | $email = new Email($this->kernel); |
329 | 329 | |
330 | 330 | if ($this->shop->getConfirmationSubject()) { |
331 | - $subject = $this->shop->getConfirmationSubject() . ' (#' . $this->order->get('number') . ')'; |
|
331 | + $subject = $this->shop->getConfirmationSubject().' (#'.$this->order->get('number').')'; |
|
332 | 332 | } else { |
333 | - $subject = 'Bekræftelse på bestilling (#' . $this->order->get('number') . ')'; |
|
333 | + $subject = 'Bekræftelse på bestilling (#'.$this->order->get('number').')'; |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | $body = $this->shop->getConfirmationText(); |
337 | 337 | |
338 | 338 | if ($this->shop->showPaymentUrl()) { |
339 | - $body .= "\n\n" . $this->shop->getPaymentUrl() . $this->order->getIdentifier(); |
|
339 | + $body .= "\n\n".$this->shop->getPaymentUrl().$this->order->getIdentifier(); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | // @todo improve this table |
@@ -352,19 +352,19 @@ discard block |
||
352 | 352 | $currency_iso_code = 'DKK'; |
353 | 353 | } |
354 | 354 | |
355 | - $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' ' . $amount)); |
|
355 | + $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' '.$amount)); |
|
356 | 356 | } |
357 | 357 | |
358 | - $body .= "\n\n" . $table->getTable(); |
|
358 | + $body .= "\n\n".$table->getTable(); |
|
359 | 359 | |
360 | 360 | if ($this->shop->getConfirmationGreeting()) { |
361 | - $body .= "\n\n" . $this->shop->getConfirmationGreeting(); |
|
361 | + $body .= "\n\n".$this->shop->getConfirmationGreeting(); |
|
362 | 362 | } else { |
363 | - $body .= "Venlig hilsen\n". $this->kernel->intranet->address->get('name'); |
|
363 | + $body .= "Venlig hilsen\n".$this->kernel->intranet->address->get('name'); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | if ($this->shop->showLoginUrl()) { |
367 | - $body .= "\n\n" . $this->contact->getLoginUrl(); |
|
367 | + $body .= "\n\n".$this->contact->getLoginUrl(); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | if (!$email->save(array('contact_id' => $this->contact->get('id'), |
@@ -439,9 +439,9 @@ discard block |
||
439 | 439 | $this->kernel->useShared('email'); |
440 | 440 | $email = new Email($this->kernel); |
441 | 441 | |
442 | - $subject = 'Bekræftelse på betaling (#' . $payment_id . ')'; |
|
442 | + $subject = 'Bekræftelse på betaling (#'.$payment_id.')'; |
|
443 | 443 | $body = 'Vi har modtaget din betaling. Hvis din ordre var afsendt inden kl. 12.00, sender vi den allerede i dag.'; |
444 | - $body .= "\n\nVenlig hilsen\n". $this->kernel->intranet->address->get('name'); |
|
444 | + $body .= "\n\nVenlig hilsen\n".$this->kernel->intranet->address->get('name'); |
|
445 | 445 | |
446 | 446 | if (!$email->save(array('contact_id' => $this->contact->get('id'), |
447 | 447 | 'subject' => $subject, |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | function findById($id) |
14 | 14 | { |
15 | - $this->db->query("SELECT site_id, id FROM cms_template WHERE id = " . $id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
15 | + $this->db->query("SELECT site_id, id FROM cms_template WHERE id = ".$id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
16 | 16 | if (!$this->db->nextRecord()) { |
17 | 17 | return false; |
18 | 18 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | // validering p� value // kun v�re gyldige elementtyper |
17 | 17 | // object skal vre cmspage |
18 | - $class = $this->class_prefix . ucfirst($type); |
|
18 | + $class = $this->class_prefix.ucfirst($type); |
|
19 | 19 | return new $class($page); |
20 | 20 | } |
21 | 21 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | $cms_module = $this->kernel->getModule('cms'); |
26 | 26 | $section_types = $cms_module->getSetting('section_types'); |
27 | 27 | |
28 | - $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = " . $id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
28 | + $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = ".$id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
29 | 29 | |
30 | 30 | if (!$this->db->nextRecord()) { |
31 | 31 | return false; |
32 | 32 | } |
33 | - $class = $this->class_prefix . ucfirst($section_types[$this->db->f('type_key')]); |
|
33 | + $class = $this->class_prefix.ucfirst($section_types[$this->db->f('type_key')]); |
|
34 | 34 | return new $class(CMS_Page::factory($this->kernel, 'id', $this->db->f('page_id')), $this->db->f('id')); |
35 | 35 | |
36 | 36 | } |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | $cms_module = $this->kernel->getModule('cms'); |
42 | 42 | $section_types = $cms_module->getSetting('section_types'); |
43 | 43 | |
44 | - $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = " . $id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
44 | + $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = ".$id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
45 | 45 | if (!$this->db->nextRecord()) { |
46 | 46 | return false; |
47 | 47 | } |
48 | - $class = $this->class_prefix . ucfirst($section_types[$this->db->f('type_key')]); |
|
48 | + $class = $this->class_prefix.ucfirst($section_types[$this->db->f('type_key')]); |
|
49 | 49 | return new $class($page, $this->db->f('id')); |
50 | 50 | } |
51 | 51 | } |
@@ -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(); |