@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if ($this->dbquery) { |
41 | 41 | return $this->dbquery; |
42 | 42 | } |
43 | - return ($this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id'))); |
|
43 | + return ($this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = '.$this->cmssite->get('id'))); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | function setDBQuery($dbquery) |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | function findById($id) |
52 | 52 | { |
53 | - $this->db->query("SELECT id, site_id FROM cms_page WHERE id = " . (int)$id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
53 | + $this->db->query("SELECT id, site_id FROM cms_page WHERE id = ".(int)$id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
54 | 54 | if (!$this->db->nextRecord()) { |
55 | 55 | return false; |
56 | 56 | } |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | $identifier = strip_tags($identifier); |
65 | 65 | |
66 | 66 | if (!empty($identifier)) { |
67 | - $this->db->query("SELECT site_id, id FROM cms_page WHERE identifier = '" . $identifier . "' AND intranet_id = " . $this->kernel->intranet->get('id') . " AND active = 1 AND site_id = " . $site_id); |
|
67 | + $this->db->query("SELECT site_id, id FROM cms_page WHERE identifier = '".$identifier."' AND intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1 AND site_id = ".$site_id); |
|
68 | 68 | } else { |
69 | 69 | // @todo choose the default page - vi skal lige have noget med publish og expire date her ogs� |
70 | - $this->db->query("SELECT site_id, id FROM cms_page WHERE intranet_id = " . $this->kernel->intranet->get('id') . " AND active = 1 AND status_key = 1 AND site_id = " . $site_id . " ORDER BY position ASC LIMIT 1"); |
|
70 | + $this->db->query("SELECT site_id, id FROM cms_page WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1 AND status_key = 1 AND site_id = ".$site_id." ORDER BY position ASC LIMIT 1"); |
|
71 | 71 | } |
72 | 72 | if (!$this->db->nextRecord()) { |
73 | - $this->db->query("SELECT site_id, id FROM cms_page WHERE id = " . (int)$identifier . " AND intranet_id = " . $this->kernel->intranet->get('id') . " AND active = 1 AND site_id = " . $site_id); |
|
73 | + $this->db->query("SELECT site_id, id FROM cms_page WHERE id = ".(int)$identifier." AND intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1 AND site_id = ".$site_id); |
|
74 | 74 | if (!$this->db->nextRecord()) { |
75 | 75 | return false; |
76 | 76 | } |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | // til google sitemaps |
212 | 212 | // sp�rgsm�let er om vi ikke skal starte et objekt op for hver pages |
213 | 213 | |
214 | - $pages[$i]['url'] = $this->cmssite->get('url') . $pages[$i]['identifier'] . '/'; |
|
215 | - $pages[$i]['url_self'] = $pages[$i]['identifier'] . '/'; |
|
214 | + $pages[$i]['url'] = $this->cmssite->get('url').$pages[$i]['identifier'].'/'; |
|
215 | + $pages[$i]['url_self'] = $pages[$i]['identifier'].'/'; |
|
216 | 216 | $pages[$i]['changefreq'] = 'weekly'; |
217 | 217 | $pages[$i]['priority'] = 0.5; |
218 | 218 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $api = $this->get('api_key'); |
36 | 36 | } |
37 | 37 | |
38 | - $this->value['map'] = '<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?'.htmlentities('v=2.0&appid=' . $api) .'"></script>'; |
|
38 | + $this->value['map'] = '<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?'.htmlentities('v=2.0&appid='.$api).'"></script>'; |
|
39 | 39 | /* flash version |
40 | 40 | $this->value['map'] .= '<script type="text/javascript">'; |
41 | 41 | $this->value['map'] .= ' var latlon = new LatLon(' .$a['ResultSet']['Result']['Latitude'] . ', '. $a['ResultSet']['Result']['Longitude'].');'; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->value['map'] .= ' var words = "title";'; |
52 | 52 | $this->value['map'] .= ' marker.openSmartWindow(words);'; |
53 | 53 | $this->value['map'] .= ' } '; |
54 | - $this->value['map'] .= ' var latlon = new YGeoPoint(' .$this->get('latitude') . ', '. $this->get('longitude').');'; |
|
54 | + $this->value['map'] .= ' var latlon = new YGeoPoint('.$this->get('latitude').', '.$this->get('longitude').');'; |
|
55 | 55 | $this->value['map'] .= ' var mymap = new YMap(document.getElementById("mapContainer"));'; |
56 | 56 | $this->value['map'] .= ' var marker = new YMarker(latlon);'; |
57 | 57 | $this->value['map'] .= ' marker.addLabel("<b>A</b>"); '; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->value['map'] .= ' }'; |
85 | 85 | $this->value['map'] .= '}'; |
86 | 86 | $this->value['map'] .= 'load();'; |
87 | - $this->value['map'] .= ' var latlon = new YGeoPoint(' .$this->get('latitude') . ', '. $this->get('longitude').');'; |
|
87 | + $this->value['map'] .= ' var latlon = new YGeoPoint('.$this->get('latitude').', '.$this->get('longitude').');'; |
|
88 | 88 | $this->value['map'] .= ' var mymap = new YMap(document.getElementById("mapContainer"));'; |
89 | 89 | $this->value['map'] .= ' var marker = new YMarker(latlon);'; |
90 | 90 | $this->value['map'] .= ' marker.addLabel("<b>A</b>"); '; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $url = parse_url($var['url']); |
61 | 61 | |
62 | 62 | // cleans up url |
63 | - $var['url'] = $url['scheme'] . '://' . $url['host'] . $url['path']; |
|
63 | + $var['url'] = $url['scheme'].'://'.$url['host'].$url['path']; |
|
64 | 64 | |
65 | 65 | $this->parameter->save('url', $var['url']); |
66 | 66 |
@@ -52,8 +52,8 @@ |
||
52 | 52 | $db = new DB_Sql; |
53 | 53 | $db->query("SELECT id FROM cms_element |
54 | 54 | WHERE intranet_id = ".$this->kernel->intranet->get('id')." |
55 | - AND section_id = " . $this->id . " |
|
56 | - AND active = 1 " . $sql_expire . $sql_publish . " |
|
55 | + AND section_id = " . $this->id." |
|
56 | + AND active = 1 " . $sql_expire.$sql_publish." |
|
57 | 57 | ORDER BY position ASC"); |
58 | 58 | $i = 0; |
59 | 59 |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | |
49 | 49 | public function load() |
50 | 50 | { |
51 | - $result = $this->db->query('SELECT id, amount, type, description, payment_date, payment_for_id, DATE_FORMAT(payment_date, "%d-%m-%Y") AS dk_payment_date, date_stated, voucher_id FROM invoice_payment ' . |
|
52 | - 'WHERE intranet_id = '.$this->kernel->intranet->get('id').' ' . |
|
53 | - 'AND payment_for = '.$this->payment_for_type_id.' ' . |
|
54 | - 'AND payment_for_id = '.$this->payment_for_id.' ' . |
|
55 | - 'AND type IN ('.implode(',', array_keys($this->getTypes())).')' . |
|
51 | + $result = $this->db->query('SELECT id, amount, type, description, payment_date, payment_for_id, DATE_FORMAT(payment_date, "%d-%m-%Y") AS dk_payment_date, date_stated, voucher_id FROM invoice_payment '. |
|
52 | + 'WHERE intranet_id = '.$this->kernel->intranet->get('id').' '. |
|
53 | + 'AND payment_for = '.$this->payment_for_type_id.' '. |
|
54 | + 'AND payment_for_id = '.$this->payment_for_id.' '. |
|
55 | + 'AND type IN ('.implode(',', array_keys($this->getTypes())).')'. |
|
56 | 56 | 'AND id = '.$this->id); |
57 | 57 | |
58 | 58 | if (PEAR::isError($result)) { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | $types = $this->getPaymentForTypes(); |
430 | 430 | // translation is needed! |
431 | - $text = $translation->get('Payment') . ' ' . $this->get('description') . ' ('.$translation->get($types[$this->payment_for_type_id]).' #'.$this->payment_for->get('number') . ')'; |
|
431 | + $text = $translation->get('Payment').' '.$this->get('description').' ('.$translation->get($types[$this->payment_for_type_id]).' #'.$this->payment_for->get('number').')'; |
|
432 | 432 | |
433 | 433 | $input_values = array( |
434 | 434 | 'voucher_number' => $voucher_number, |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | |
447 | 447 | $db = new DB_sql; |
448 | - $db->query("UPDATE invoice_payment SET date_stated = NOW(), voucher_id = ".$voucher->get('id') . " WHERE intranet_id = " . $this->kernel->intranet->getId() . ' AND id = ' . $this->id); |
|
448 | + $db->query("UPDATE invoice_payment SET date_stated = NOW(), voucher_id = ".$voucher->get('id')." WHERE intranet_id = ".$this->kernel->intranet->getId().' AND id = '.$this->id); |
|
449 | 449 | |
450 | 450 | $this->load(); |
451 | 451 | return true; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $db = new DB_Sql; |
34 | 34 | $sql = "SELECT id FROM debtor |
35 | - WHERE type=3 AND status=1 AND active = 1 AND due_date < NOW() AND intranet_id = ".$this->kernel->intranet->get("id")." AND contact_id = " . $contact_id; |
|
35 | + WHERE type=3 AND status=1 AND active = 1 AND due_date < NOW() AND intranet_id = ".$this->kernel->intranet->get("id")." AND contact_id = ".$contact_id; |
|
36 | 36 | $db->query($sql); |
37 | 37 | |
38 | 38 | return $db->numRows(); |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | for ($i = 0, $max = count($items); $i < $max; $i++) { |
130 | 130 | $product = new Product($this->kernel, $items[$i]['product_id']); |
131 | 131 | if ($product->get('state_account_id') == 0) { |
132 | - $this->error->set('Produktet ' . $product->get('name') . ' ved ikke hvor den skal bogf�res'); |
|
132 | + $this->error->set('Produktet '.$product->get('name').' ved ikke hvor den skal bogf�res'); |
|
133 | 133 | } else { |
134 | 134 | require_once 'Intraface/modules/accounting/Account.php'; |
135 | 135 | $account = Account::factory($year, $product->get('state_account_id')); |
136 | 136 | if ($account->get('id') == 0 || $account->get('type') != 'operating') { |
137 | - $this->error->set('Ugyldig konto for bogføring af produktet ' . $product->get('name')); |
|
137 | + $this->error->set('Ugyldig konto for bogføring af produktet '.$product->get('name')); |
|
138 | 138 | $return = false; |
139 | 139 | } |
140 | 140 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $debet_account_number = $debet_account->get('number'); |
208 | 208 | $voucher = Voucher::factory($year, $voucher_number); |
209 | 209 | |
210 | - $amount = $item['quantity'] * $item['price']->getAsIso(2); |
|
210 | + $amount = $item['quantity']*$item['price']->getAsIso(2); |
|
211 | 211 | |
212 | 212 | // hvis bel�bet er mindre end nul, skal konti byttes om og bel�bet skal g�res positivt |
213 | 213 | if ($amount < 0) { |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | 'debet_account_number' => $debet_account_number, |
225 | 225 | 'credit_account_number' => $credit_account_number, |
226 | 226 | 'vat_off' => 1, |
227 | - 'text' => $text . ' - ' . $item['name'] |
|
227 | + 'text' => $text.' - '.$item['name'] |
|
228 | 228 | ); |
229 | 229 | |
230 | 230 | if ($credit_account->get('vat') == 'out') { |
231 | - $total_with_vat += $item["quantity"] * $item["price"]->getAsIso(2); |
|
231 | + $total_with_vat += $item["quantity"]*$item["price"]->getAsIso(2); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | if (!$voucher->saveInDaybook($input_values, true)) { |
@@ -241,16 +241,16 @@ discard block |
||
241 | 241 | if ($total_with_vat > 0) { |
242 | 242 | $voucher = Voucher::factory($year, $voucher_number); |
243 | 243 | $credit_account = new Account($year, $year->getSetting('vat_out_account_id')); |
244 | - $debet_account = new Account($year, $year->getSetting('debtor_account_id')); |
|
244 | + $debet_account = new Account($year, $year->getSetting('debtor_account_id')); |
|
245 | 245 | $input_values = array( |
246 | 246 | 'voucher_number' => $voucher_number, |
247 | 247 | 'reference' => $this->get('number'), |
248 | 248 | 'date' => $voucher_date, |
249 | - 'amount' => number_format($total_with_vat * $this->kernel->setting->get('intranet', 'vatpercent') / 100, 2, ",", "."), // opm�rksom p� at vat bliver rigtig defineret |
|
249 | + 'amount' => number_format($total_with_vat*$this->kernel->setting->get('intranet', 'vatpercent')/100, 2, ",", "."), // opm�rksom p� at vat bliver rigtig defineret |
|
250 | 250 | 'debet_account_number' => $debet_account->get('number'), |
251 | 251 | 'credit_account_number' => $credit_account->get('number'), |
252 | 252 | 'vat_off' => 1, |
253 | - 'text' => $text . ' - ' . $credit_account->get('name') |
|
253 | + 'text' => $text.' - '.$credit_account->get('name') |
|
254 | 254 | ); |
255 | 255 | if (!$voucher->saveInDaybook($input_values, true)) { |
256 | 256 | $this->error->merge($voucher->error->getMessage()); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | require_once 'Intraface/modules/accounting/VoucherFile.php'; |
261 | 261 | $voucher_file = new VoucherFile($voucher); |
262 | - if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'invoice','belong_to_id'=>$this->get('id')))) { |
|
262 | + if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'invoice', 'belong_to_id'=>$this->get('id')))) { |
|
263 | 263 | $this->error->merge($voucher_file->error->getMessage()); |
264 | 264 | $this->error->set('Filen blev ikke overflyttet'); |
265 | 265 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | function isNumberFree($number) |
128 | 128 | { |
129 | - $sql = "SELECT id FROM invoice_reminder WHERE number = ".intval($number)." AND id != ".$this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'); |
|
129 | + $sql = "SELECT id FROM invoice_reminder WHERE number = ".intval($number)." AND id != ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'); |
|
130 | 130 | $this->db->query($sql); |
131 | 131 | if ($this->db->nextRecord()) { |
132 | 132 | return false; |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | $db = new Db_Sql; |
342 | - $db->query("UPDATE invoice_reminder SET status = ".$status_id.", ".$sql." WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
342 | + $db->query("UPDATE invoice_reminder SET status = ".$status_id.", ".$sql." WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
343 | 343 | $this->load(); |
344 | 344 | return true; |
345 | 345 | } |
@@ -477,14 +477,14 @@ discard block |
||
477 | 477 | } |
478 | 478 | $db = new DB_Sql; |
479 | 479 | $db->query("SELECT id |
480 | - FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=" . $contact_id); |
|
480 | + FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=".$contact_id); |
|
481 | 481 | return $db->numRows(); |
482 | 482 | } |
483 | 483 | |
484 | 484 | function isFilledIn() |
485 | 485 | { |
486 | 486 | $db = new DB_Sql; |
487 | - $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
487 | + $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
488 | 488 | return $db->numRows(); |
489 | 489 | } |
490 | 490 | |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | { |
501 | 501 | // FIXME - check on date |
502 | 502 | $db = new DB_Sql; |
503 | - $db->query("UPDATE invoice_reminder SET date_stated = '" . $voucher_date . "', voucher_id = '".$voucher_id."' WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
503 | + $db->query("UPDATE invoice_reminder SET date_stated = '".$voucher_date."', voucher_id = '".$voucher_id."' WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
504 | 504 | return true; |
505 | 505 | } |
506 | 506 | |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | |
648 | 648 | require_once 'Intraface/modules/accounting/VoucherFile.php'; |
649 | 649 | $voucher_file = new VoucherFile($voucher); |
650 | - if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'reminder','belong_to_id'=>$this->get('id')))) { |
|
650 | + if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'reminder', 'belong_to_id'=>$this->get('id')))) { |
|
651 | 651 | $this->error->merge($voucher_file->error->getMessage()); |
652 | 652 | $this->error->set('Filen blev ikke overflyttet'); |
653 | 653 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | function findById($id) |
26 | 26 | { |
27 | - require_once dirname(__FILE__) . '/Reminder.php'; |
|
27 | + require_once dirname(__FILE__).'/Reminder.php'; |
|
28 | 28 | return new Reminder($this->kernel, $id); |
29 | 29 | } |
30 | 30 | |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | } |
40 | 40 | $db = new DB_Sql; |
41 | 41 | $db->query("SELECT id |
42 | - FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=" . $contact_id); |
|
42 | + FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=".$contact_id); |
|
43 | 43 | return $db->numRows(); |
44 | 44 | } |
45 | 45 | |
46 | 46 | function setNewContactId($old_contact_id, $new_contact_id) |
47 | 47 | { |
48 | 48 | $db = new DB_Sql; |
49 | - $db->query('UPDATE invoice_reminder SET contact_id = ' . $new_contact_id . ' WHERE contact_id = ' . $old_contact_id); |
|
49 | + $db->query('UPDATE invoice_reminder SET contact_id = '.$new_contact_id.' WHERE contact_id = '.$old_contact_id); |
|
50 | 50 | return true; |
51 | 51 | } |
52 | 52 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | function isFilledIn() |
158 | 158 | { |
159 | 159 | $db = new DB_Sql; |
160 | - $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
160 | + $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
161 | 161 | return $db->numRows(); |
162 | 162 | } |
163 | 163 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | function findById($id) |
23 | 23 | { |
24 | 24 | $db = new DB_Sql; |
25 | - $db->query('SELECT * FROM invoice_payment WHERE id = ' . $id); |
|
25 | + $db->query('SELECT * FROM invoice_payment WHERE id = '.$id); |
|
26 | 26 | |
27 | 27 | if (!$db->nextRecord()) { |
28 | 28 | return false; |