@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | if (!$this->subscriber->unsubscribe($email, $comment)) { |
| 91 | 91 | require_once 'XML/RPC2/Exception.php'; |
| 92 | - throw new XML_RPC2_FaultException('you could not unsubscribe ('. implode(', ', $this->subscriber->error->getMessage()).')', -4); |
|
| 92 | + throw new XML_RPC2_FaultException('you could not unsubscribe ('.implode(', ', $this->subscriber->error->getMessage()).')', -4); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | return $this->prepareResponseData(true); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $code = $this->processRequestData($code); |
| 209 | 209 | |
| 210 | 210 | $db = MDB2::singleton(DB_DSN); |
| 211 | - $result = $db->query('SELECT list_id FROM newsletter_subscriber WHERE code = ' . $db->quote($code, 'text')); |
|
| 211 | + $result = $db->query('SELECT list_id FROM newsletter_subscriber WHERE code = '.$db->quote($code, 'text')); |
|
| 212 | 212 | if ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { |
| 213 | 213 | return $this->prepareResponseData($row['list_id']); |
| 214 | 214 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public function auth() |
| 50 | 50 | { |
| 51 | - $result = $this->db->query("SELECT id FROM intranet WHERE private_key = " . $this->db->quote($this->key, 'text')); |
|
| 51 | + $result = $this->db->query("SELECT id FROM intranet WHERE private_key = ".$this->db->quote($this->key, 'text')); |
|
| 52 | 52 | if (PEAR::isError($result)) { |
| 53 | 53 | throw new Exception($result->getUserInfo()); |
| 54 | 54 | } |
@@ -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 | } |
@@ -88,7 +88,7 @@ |
||
| 88 | 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 | } |
@@ -99,11 +99,11 @@ |
||
| 99 | 99 | public static function getBelongToTypes() |
| 100 | 100 | { |
| 101 | 101 | return array(1 => 'intranet', |
| 102 | - 2 => 'user', |
|
| 103 | - 3 => 'contact', |
|
| 104 | - 4 => 'contact_delivery', |
|
| 105 | - 5 => 'contact_invoice', |
|
| 106 | - 6 => 'contactperson'); |
|
| 102 | + 2 => 'user', |
|
| 103 | + 3 => 'contact', |
|
| 104 | + 4 => 'contact_delivery', |
|
| 105 | + 5 => 'contact_invoice', |
|
| 106 | + 6 => 'contactperson'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @param string $belong_to What the address belongs to, corresponding to the ones in Address::getBelongToTypes() |
| 84 | 84 | * @param integer $belong_to_id From belong_to. NB not id on the address |
| 85 | 85 | * |
| 86 | - * @return object Address |
|
| 86 | + * @return Intraface_Address Address |
|
| 87 | 87 | */ |
| 88 | 88 | function factory($belong_to, $belong_to_id) |
| 89 | 89 | { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | /** |
| 95 | 95 | * Returns possible belong to types |
| 96 | 96 | * |
| 97 | - * @return array |
|
| 97 | + * @return string[] |
|
| 98 | 98 | */ |
| 99 | 99 | public static function getBelongToTypes() |
| 100 | 100 | { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | * @param array $array_var et array med felter med adressen. Se felterne i init funktionen: $this->fields |
| 222 | 222 | * |
| 223 | - * @return bolean true or false |
|
| 223 | + * @return boolean true or false |
|
| 224 | 224 | */ |
| 225 | 225 | function save($array_var) |
| 226 | 226 | { |
@@ -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 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * Used for instance in Page to give the correct submenu. |
| 82 | 82 | * |
| 83 | - * @return module object or false |
|
| 83 | + * @return boolean object or false |
|
| 84 | 84 | */ |
| 85 | 85 | function getPrimaryModule() |
| 86 | 86 | { |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * |
| 168 | 168 | * @param $count (integer) how many characters to return? |
| 169 | 169 | * |
| 170 | - * @return random key (string) only letters |
|
| 170 | + * @return string key (string) only letters |
|
| 171 | 171 | */ |
| 172 | 172 | function randomKey($length = 1) |
| 173 | 173 | { |
@@ -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() |
@@ -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 | |