@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $result = $this->db->query("SELECT id FROM user WHERE email = ".$this->db->quote($this->email, 'text')." AND password = ".$this->db->quote(md5($this->password), 'text')); |
| 41 | 41 | |
| 42 | 42 | if (PEAR::isError($result)) { |
| 43 | - throw new Exception('result is an error' . $result->getMessage() . $result->getUserInfo()); |
|
| 43 | + throw new Exception('result is an error'.$result->getMessage().$result->getUserInfo()); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if ($result->numRows() != 1) { |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | $row = $result->fetchRow(MDB2_FETCHMODE_ASSOC); |
| 50 | 50 | |
| 51 | - $result = $this->db->exec("UPDATE user SET lastlogin = NOW(), session_id = ".$this->db->quote($this->session_id, 'text')." WHERE id = ". $this->db->quote($row['id'], 'integer')); |
|
| 51 | + $result = $this->db->exec("UPDATE user SET lastlogin = NOW(), session_id = ".$this->db->quote($this->session_id, 'text')." WHERE id = ".$this->db->quote($row['id'], 'integer')); |
|
| 52 | 52 | if (PEAR::isError($result)) { |
| 53 | - throw new Exception('could not update user ' . $result->getMessage() . $result->getUserInfo()); |
|
| 53 | + throw new Exception('could not update user '.$result->getMessage().$result->getUserInfo()); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $user = new Intraface_User($row['id']); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | $result = $this->db->query("SELECT id FROM user WHERE session_id = ".$this->db->quote($this->session_id, 'text')); |
| 69 | 69 | if (PEAR::isError($result)) { |
| 70 | - throw new Exception('could not check if user is logged in ' . $result->getUserInfo()); |
|
| 70 | + throw new Exception('could not check if user is logged in '.$result->getUserInfo()); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | if ($result->numRows() == 0) { |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function logout() |
| 87 | 87 | { |
| 88 | - $result = $this->db->exec("UPDATE user SET session_id = " . $this->db->quote('', 'text') . " WHERE session_id = " . $this->db->quote($this->session_id, 'text')); |
|
| 88 | + $result = $this->db->exec("UPDATE user SET session_id = ".$this->db->quote('', 'text')." WHERE session_id = ".$this->db->quote($this->session_id, 'text')); |
|
| 89 | 89 | |
| 90 | 90 | if (PEAR::isError($result)) { |
| 91 | - throw new Exception('could not log user out ' . $result->getUserInfo()); |
|
| 91 | + throw new Exception('could not log user out '.$result->getUserInfo()); |
|
| 92 | 92 | } |
| 93 | 93 | return true; |
| 94 | 94 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | 'fileimport' => $this->fileimport |
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
| 39 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
| 40 | 40 | return $tpl->render($this, $data); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $_SESSION['shared_fileimport_data'] = $data; |
| 101 | 101 | $this->session()->set('fileimport_data', $data); |
| 102 | 102 | |
| 103 | - return new k_SeeOther($this->url('../', array('header' => $this->body('header'),'file_id' => $this->filehandler->get('id'), 'fields' => $this->body('fields')))); |
|
| 103 | + return new k_SeeOther($this->url('../', array('header' => $this->body('header'), 'file_id' => $this->filehandler->get('id'), 'fields' => $this->body('fields')))); |
|
| 104 | 104 | |
| 105 | 105 | /* |
| 106 | 106 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | } |
| 42 | 42 | $this->db = MDB2:: singleton(DB_DSN); |
| 43 | 43 | if (PEAR::isError($this->db)) { |
| 44 | - throw new Exception($this->db->getMessage() . $this->db->getUserInfo()); |
|
| 44 | + throw new Exception($this->db->getMessage().$this->db->getUserInfo()); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
@@ -8,16 +8,16 @@ discard block |
||
| 8 | 8 | $invoker = $event->getInvoker(); |
| 9 | 9 | $class = get_class($invoker); |
| 10 | 10 | |
| 11 | - $field = $params['alias'] . '.intranet_id'; |
|
| 11 | + $field = $params['alias'].'.intranet_id'; |
|
| 12 | 12 | $query = $event->getQuery(); |
| 13 | 13 | |
| 14 | 14 | // if it is not the class from FROM statement, it is left or inner join. |
| 15 | 15 | // then we add the possibility for IS NULL. Actually it is only relevant in |
| 16 | 16 | // left join, but how do we find out which kind of join it is? |
| 17 | 17 | if ($query->contains('FROM '.$class)) { |
| 18 | - $query->addWhere($field . ' = ?', array($this->getIntranetId())); |
|
| 18 | + $query->addWhere($field.' = ?', array($this->getIntranetId())); |
|
| 19 | 19 | } else { |
| 20 | - $query->addWhere('('.$field.' IS NULL OR '.$field . ' = ?)', array($this->getIntranetId())); |
|
| 20 | + $query->addWhere('('.$field.' IS NULL OR '.$field.' = ?)', array($this->getIntranetId())); |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | public function preDqlDelete(Doctrine_Event $event) |
| 37 | 37 | { |
| 38 | 38 | $params = $event->getParams(); |
| 39 | - $field = $params['alias'] . '.intranet_id'; |
|
| 39 | + $field = $params['alias'].'.intranet_id'; |
|
| 40 | 40 | $query = $event->getQuery(); |
| 41 | - $query->addWhere($field . ' = ?', array($this->getIntranetId())); |
|
| 41 | + $query->addWhere($field.' = ?', array($this->getIntranetId())); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | private function getIntranetId() |
@@ -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()) { |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | return false; |
| 416 | 416 | } |
| 417 | 417 | $db = new DB_Sql; |
| 418 | - $db->query("DELETE FROM email WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 418 | + $db->query("DELETE FROM email WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 419 | 419 | return true; |
| 420 | 420 | } |
| 421 | 421 | |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | function findCountByContactId($contact_id) |
| 57 | 57 | { |
| 58 | 58 | $db = new DB_Sql; |
| 59 | - $db->query('SELECT * FROM email WHERE contact_id = ' . $contact_id); |
|
| 59 | + $db->query('SELECT * FROM email WHERE contact_id = '.$contact_id); |
|
| 60 | 60 | return $db->numRows(); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | function setNewContactId($old_contact_id, $new_contact_id) |
| 64 | 64 | { |
| 65 | 65 | $db = new DB_Sql; |
| 66 | - $db->query('UPDATE email SET contact_id = ' . $new_contact_id . ' WHERE contact_id = ' . $old_contact_id); |
|
| 66 | + $db->query('UPDATE email SET contact_id = '.$new_contact_id.' WHERE contact_id = '.$old_contact_id); |
|
| 67 | 67 | return true; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | function countQueue() |
| 79 | 79 | { |
| 80 | 80 | $db = new DB_Sql; |
| 81 | - $db->query("SELECT COUNT(*) AS antal FROM email WHERE status = 2 AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 81 | + $db->query("SELECT COUNT(*) AS antal FROM email WHERE status = 2 AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 82 | 82 | $this->value['outbox'] = 0; |
| 83 | 83 | if ($db->nextRecord()) { |
| 84 | 84 | $this->value['outbox'] = $db->f('antal'); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $list[$i]['status'] = $this->status[$db->f('status')]; |
| 100 | 100 | |
| 101 | 101 | if ($db->f('contact_id') == 0) { |
| 102 | - $this->error->set('Kan ikke finde #' . $db->f('id') . ' fordi den ikke har noget kontakt_id'); |
|
| 102 | + $this->error->set('Kan ikke finde #'.$db->f('id').' fordi den ikke har noget kontakt_id'); |
|
| 103 | 103 | continue; |
| 104 | 104 | } |
| 105 | 105 | $this->kernel->useModule('contact'); |
@@ -133,13 +133,13 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | $sent_this_hour = $this->sentThisHour(); |
| 135 | 135 | |
| 136 | - $limit_query = abs($this->allowed_limit-$sent_this_hour-$this->system_buffer); |
|
| 136 | + $limit_query = abs($this->allowed_limit - $sent_this_hour - $this->system_buffer); |
|
| 137 | 137 | |
| 138 | 138 | $sql = "SELECT id |
| 139 | 139 | FROM email |
| 140 | 140 | WHERE status = 2 |
| 141 | 141 | AND date_deadline <= NOW() |
| 142 | - AND intranet_id = " . $this->kernel->intranet->get('id') . " |
|
| 142 | + AND intranet_id = " . $this->kernel->intranet->get('id')." |
|
| 143 | 143 | AND contact_id > 0 |
| 144 | 144 | LIMIT " . $limit_query; |
| 145 | 145 | $db = new DB_Sql; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function __construct(MDB2_Driver_Common $db) |
| 18 | 18 | { |
| 19 | - $this->db = $db; |
|
| 19 | + $this->db = $db; |
|
| 20 | 20 | $this->error = new Intraface_Error; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | function renderHtml() |
| 15 | 15 | { |
| 16 | - return get_class($this) . ': intentionally left blank'; |
|
| 16 | + return get_class($this).': intentionally left blank'; |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | function getModel() |
@@ -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 | |