@@ -253,6 +253,7 @@ discard block |
||
| 253 | 253 | * Returns on the basis of the module package which type of add this is. Can be either add, extend, or upgrade |
| 254 | 254 | * |
| 255 | 255 | * @param object modulepackage An modulepackage object |
| 256 | + * @param Intraface_modules_modulepackage_ModulePackage $modulepackage |
|
| 256 | 257 | * |
| 257 | 258 | * @return string either 'add', 'extend' or 'upgrade' |
| 258 | 259 | */ |
@@ -295,6 +296,7 @@ discard block |
||
| 295 | 296 | * Returns the end date of the last modulepacke in a given group |
| 296 | 297 | * |
| 297 | 298 | * @param object modulepackage |
| 299 | + * @return string |
|
| 298 | 300 | */ |
| 299 | 301 | public function getLastEndDateInGroup($modulepackage) |
| 300 | 302 | { |
@@ -400,6 +402,8 @@ discard block |
||
| 400 | 402 | * |
| 401 | 403 | * @param object modulepackage module package |
| 402 | 404 | * @param string duration Duration as either date 'dd-mm-yyyy' or 'yyyy-mm-dd' or 'X month' where X is any whole number |
| 405 | + * @param Intraface_modules_modulepackage_ModulePackage $modulepackage |
|
| 406 | + * @param string $duration |
|
| 403 | 407 | * |
| 404 | 408 | * @return object Action object with the actions needed to be processed |
| 405 | 409 | */ |
@@ -470,6 +474,8 @@ discard block |
||
| 470 | 474 | * |
| 471 | 475 | * @param object modulepackage |
| 472 | 476 | * @param string duration Duration as either date 'dd-mm-yyyy' or 'yyyy-mm-dd' or 'X month' where X is any whole number |
| 477 | + * @param Intraface_modules_modulepackage_ModulePackage $modulepackage |
|
| 478 | + * @param string $duration |
|
| 473 | 479 | * |
| 474 | 480 | * @return object Action object with the actions needed to be performed |
| 475 | 481 | */ |
@@ -628,7 +634,7 @@ discard block |
||
| 628 | 634 | /** |
| 629 | 635 | * Returns the possible types of status' |
| 630 | 636 | * |
| 631 | - * @return array status types |
|
| 637 | + * @return string[] status types |
|
| 632 | 638 | */ |
| 633 | 639 | static public function getStatusTypes() |
| 634 | 640 | { |
@@ -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)) { |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | return false; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - $sql = "module_package_id = ".$this->db->quote($modulepackage->get('id'), 'integer').", " . |
|
| 166 | - "start_date = ".$this->db->quote($start_date, 'date').", " . |
|
| 165 | + $sql = "module_package_id = ".$this->db->quote($modulepackage->get('id'), 'integer').", ". |
|
| 166 | + "start_date = ".$this->db->quote($start_date, 'date').", ". |
|
| 167 | 167 | "end_date = ".$this->db->quote($end_date, 'date'); |
| 168 | 168 | |
| 169 | 169 | $result = $this->db->exec("INSERT INTO intranet_module_package SET ".$sql.", status_key = 1, active = 1, intranet_id = ".$this->intranet->get('id')); |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | return false; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - $result = $this->db->exec('UPDATE intranet_module_package ' . |
|
| 204 | - 'SET order_debtor_identifier = '.$this->db->quote($order_identifier, 'text').' ' . |
|
| 203 | + $result = $this->db->exec('UPDATE intranet_module_package '. |
|
| 204 | + 'SET order_debtor_identifier = '.$this->db->quote($order_identifier, 'text').' '. |
|
| 205 | 205 | 'WHERE intranet_id = '.$this->db->quote($this->intranet->get('id'), 'integer').' AND id = '.$this->db->quote($this->id, 'integer')); |
| 206 | 206 | |
| 207 | 207 | if (PEAR::isError($result)) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | $result = $this->db->exec("UPDATE intranet_module_package SET status_key = 3 WHERE intranet_id = ".$this->intranet->get('id')." AND id = ".intval($this->id)); |
| 227 | 227 | if (PEAR::isError($result)) { |
| 228 | - throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->terminate :". $result->getUserInfo()); |
|
| 228 | + throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->terminate :".$result->getUserInfo()); |
|
| 229 | 229 | exit; |
| 230 | 230 | } |
| 231 | 231 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | $result = $this->db->exec("UPDATE intranet_module_package SET active = 0 WHERE intranet_id = ".$this->intranet->get('id')." AND id = ".intval($this->id)); |
| 246 | 246 | if (PEAR::isError($result)) { |
| 247 | - throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->delete :". $result->getUserInfo()); |
|
| 247 | + throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->delete :".$result->getUserInfo()); |
|
| 248 | 248 | exit; |
| 249 | 249 | } |
| 250 | 250 | |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | // TODO: If DBQuery had not needed kernel we could have used it here! |
| 274 | - $result = $this->db->query('SELECT module_package_plan.plan_index FROM intranet_module_package ' . |
|
| 275 | - 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id ' . |
|
| 276 | - 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ' . |
|
| 277 | - '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').' ' . |
|
| 274 | + $result = $this->db->query('SELECT module_package_plan.plan_index FROM intranet_module_package '. |
|
| 275 | + 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id '. |
|
| 276 | + 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id '. |
|
| 277 | + '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').' '. |
|
| 278 | 278 | 'ORDER BY end_date DESC'); |
| 279 | 279 | |
| 280 | 280 | if (PEAR::isError($result)) { |
@@ -312,10 +312,10 @@ discard block |
||
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | // TODO: If DBQuery had not needed kernel we could have used it here! |
| 315 | - $result = $this->db->query('SELECT intranet_module_package.end_date FROM intranet_module_package ' . |
|
| 316 | - 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id ' . |
|
| 317 | - 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ' . |
|
| 318 | - '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').' ' . |
|
| 315 | + $result = $this->db->query('SELECT intranet_module_package.end_date FROM intranet_module_package '. |
|
| 316 | + 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id '. |
|
| 317 | + 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id '. |
|
| 318 | + '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').' '. |
|
| 319 | 319 | 'ORDER BY end_date DESC'); |
| 320 | 320 | |
| 321 | 321 | if (PEAR::isError($result)) { |
@@ -498,11 +498,11 @@ discard block |
||
| 498 | 498 | $shop = new Intraface_modules_modulepackage_ShopExtension; |
| 499 | 499 | |
| 500 | 500 | // TODO: If DBQuery had not needed kernel we could have used it here! |
| 501 | - $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 ' . |
|
| 502 | - 'FROM intranet_module_package ' . |
|
| 503 | - 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id ' . |
|
| 504 | - 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ' . |
|
| 505 | - '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').' ' . |
|
| 501 | + $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 '. |
|
| 502 | + 'FROM intranet_module_package '. |
|
| 503 | + 'INNER JOIN module_package ON intranet_module_package.module_package_id = module_package.id '. |
|
| 504 | + 'INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id '. |
|
| 505 | + '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').' '. |
|
| 506 | 506 | 'ORDER BY end_date DESC'); |
| 507 | 507 | |
| 508 | 508 | if (PEAR::isError($result)) { |
@@ -587,15 +587,15 @@ discard block |
||
| 587 | 587 | $this->dbquery->setSorting('module_package_group.sorting_index, module_package_plan.plan_index, intranet_module_package.start_date'); |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - $db = $this->dbquery->getRecordset('intranet_module_package.id, ' . |
|
| 591 | - 'intranet_module_package.module_package_id, ' . |
|
| 592 | - 'intranet_module_package.start_date, ' . |
|
| 593 | - 'intranet_module_package.end_date, ' . |
|
| 594 | - 'intranet_module_package.order_debtor_id, ' . |
|
| 595 | - 'intranet_module_package.status_key, ' . |
|
| 596 | - 'module_package_plan.plan, ' . |
|
| 597 | - 'module_package_group.group_name, ' . |
|
| 598 | - 'DATE_FORMAT(intranet_module_package.start_date, "%d-%m-%Y") AS dk_start_date, ' . |
|
| 590 | + $db = $this->dbquery->getRecordset('intranet_module_package.id, '. |
|
| 591 | + 'intranet_module_package.module_package_id, '. |
|
| 592 | + 'intranet_module_package.start_date, '. |
|
| 593 | + 'intranet_module_package.end_date, '. |
|
| 594 | + 'intranet_module_package.order_debtor_id, '. |
|
| 595 | + 'intranet_module_package.status_key, '. |
|
| 596 | + 'module_package_plan.plan, '. |
|
| 597 | + 'module_package_group.group_name, '. |
|
| 598 | + 'DATE_FORMAT(intranet_module_package.start_date, "%d-%m-%Y") AS dk_start_date, '. |
|
| 599 | 599 | 'DATE_FORMAT(intranet_module_package.end_date, "%d-%m-%Y") AS dk_end_date', '', false); |
| 600 | 600 | |
| 601 | 601 | $modulepackages = array(); |
@@ -234,7 +234,7 @@ |
||
| 234 | 234 | /** |
| 235 | 235 | * Returns order details from order identifier |
| 236 | 236 | * |
| 237 | - * @param string $order_identifier |
|
| 237 | + * @param string $order_identification |
|
| 238 | 238 | * @return array |
| 239 | 239 | */ |
| 240 | 240 | public function getOrderDetails($order_identification) |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | /** |
| 201 | 201 | * Puts subscribers in a queue to the newsletter |
| 202 | 202 | * |
| 203 | - * @return boolean |
|
| 203 | + * @return null|boolean |
|
| 204 | 204 | */ |
| 205 | 205 | function queue() |
| 206 | 206 | { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * |
| 307 | 307 | * @param integer $id Contact id |
| 308 | 308 | * |
| 309 | - * @return object |
|
| 309 | + * @return Contact |
|
| 310 | 310 | */ |
| 311 | 311 | function getContact($id) |
| 312 | 312 | { |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | private function load() |
| 78 | 78 | { |
| 79 | 79 | $db = new DB_Sql; |
| 80 | - $db->query("SELECT id, list_id, subject, text, deadline, sent_to_receivers, status FROM newsletter_archieve WHERE id = " . $this->id . " AND active = 1 LIMIT 1"); |
|
| 80 | + $db->query("SELECT id, list_id, subject, text, deadline, sent_to_receivers, status FROM newsletter_archieve WHERE id = " . $this->id . " AND active = 1 LIMIT 1"); |
|
| 81 | 81 | |
| 82 | 82 | $db2 = new DB_Sql; |
| 83 | 83 | if ($db->nextRecord()) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | private function load() |
| 78 | 78 | { |
| 79 | 79 | $db = new DB_Sql; |
| 80 | - $db->query("SELECT id, list_id, subject, text, deadline, sent_to_receivers, status FROM newsletter_archieve WHERE id = " . $this->id . " AND active = 1 LIMIT 1"); |
|
| 80 | + $db->query("SELECT id, list_id, subject, text, deadline, sent_to_receivers, status FROM newsletter_archieve WHERE id = ".$this->id." AND active = 1 LIMIT 1"); |
|
| 81 | 81 | |
| 82 | 82 | $db2 = new DB_Sql; |
| 83 | 83 | if ($db->nextRecord()) { |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | return false; |
| 119 | 119 | } |
| 120 | 120 | $db = new DB_Sql; |
| 121 | - $db->query("UPDATE newsletter_archieve SET active = 0 WHERE id = " . $this->get("id") . " AND intranet_id = " . $this->list->getIntranet()->getId() . " AND locked = 0"); |
|
| 121 | + $db->query("UPDATE newsletter_archieve SET active = 0 WHERE id = ".$this->get("id")." AND intranet_id = ".$this->list->getIntranet()->getId()." AND locked = 0"); |
|
| 122 | 122 | |
| 123 | 123 | return true; |
| 124 | 124 | } |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | $sql_end = ', date_created = NOW()'; |
| 149 | 149 | } else { |
| 150 | 150 | $sql_type = "UPDATE"; |
| 151 | - $sql_end = " WHERE id = " . $this->id; |
|
| 151 | + $sql_end = " WHERE id = ".$this->id; |
|
| 152 | 152 | } |
| 153 | 153 | $db = new DB_Sql; |
| 154 | - $sql = $sql_type . " newsletter_archieve |
|
| 154 | + $sql = $sql_type." newsletter_archieve |
|
| 155 | 155 | SET subject = '".$var['subject']."', |
| 156 | 156 | text = '".$var['text']."', |
| 157 | 157 | intranet_id = ".$this->list->getIntranet()->getId().", |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | private function updateSent($receivers) |
| 182 | 182 | { |
| 183 | 183 | $db = new DB_Sql; |
| 184 | - $db->query("UPDATE newsletter_archieve SET status = 1, sent_to_receivers = '".(int)$receivers."' WHERE id = " . $this->id . " AND intranet_id = " . $this->list->getIntranet()->getId()); |
|
| 184 | + $db->query("UPDATE newsletter_archieve SET status = 1, sent_to_receivers = '".(int)$receivers."' WHERE id = ".$this->id." AND intranet_id = ".$this->list->getIntranet()->getId()); |
|
| 185 | 185 | return true; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $db = MDB2::singleton(DB_DSN); |
| 223 | 223 | |
| 224 | 224 | if (PEAR::isError($db)) { |
| 225 | - throw new Exception($result->getMessage() . $result->getUserInfo()); |
|
| 225 | + throw new Exception($result->getMessage().$result->getUserInfo()); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | $i = 0; |
@@ -259,19 +259,19 @@ discard block |
||
| 259 | 259 | '".$name."', |
| 260 | 260 | 8, |
| 261 | 261 | 2, |
| 262 | - ".$this->get('id') . ", |
|
| 263 | - '".$this->get('deadline'). "', |
|
| 264 | - " .$this->list->getIntranet()->getId(). " , |
|
| 265 | - " .$subscriber['contact_id']. " , |
|
| 262 | + ".$this->get('id').", |
|
| 263 | + '".$this->get('deadline')."', |
|
| 264 | + " .$this->list->getIntranet()->getId()." , |
|
| 265 | + " .$subscriber['contact_id']." , |
|
| 266 | 266 | " .$this->list->kernel->user->get('id').", |
| 267 | 267 | ".$subject.", |
| 268 | 268 | ".$body.")"; |
| 269 | 269 | |
| 270 | 270 | if ($i == 40) { |
| 271 | - $result = $db->exec($sql . implode($params, ',')); |
|
| 271 | + $result = $db->exec($sql.implode($params, ',')); |
|
| 272 | 272 | |
| 273 | 273 | if (PEAR::isError($result)) { |
| 274 | - $error[] = $result->getMessage() . $result->getUserInfo(); |
|
| 274 | + $error[] = $result->getMessage().$result->getUserInfo(); |
|
| 275 | 275 | return false; |
| 276 | 276 | } |
| 277 | 277 | |
@@ -285,11 +285,11 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | // If the number of contacts can be divided evenly into 40 there will be no more params here. |
| 287 | 287 | if (count($params) > 0) { |
| 288 | - $result = $db->exec($sql . implode($params, ',')); |
|
| 288 | + $result = $db->exec($sql.implode($params, ',')); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | if (PEAR::isError($result)) { |
| 292 | - $error[] = $result->getMessage() . $result->getUserInfo(); |
|
| 292 | + $error[] = $result->getMessage().$result->getUserInfo(); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | if (!empty($error)) { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | { |
| 322 | 322 | $list = array(); |
| 323 | 323 | $db = new DB_Sql; |
| 324 | - $db->query("SELECT * FROM newsletter_archieve WHERE active = 1 AND list_id = " . $this->list->get('id') . " ORDER BY deadline DESC"); |
|
| 324 | + $db->query("SELECT * FROM newsletter_archieve WHERE active = 1 AND list_id = ".$this->list->get('id')." ORDER BY deadline DESC"); |
|
| 325 | 325 | $i = 0; |
| 326 | 326 | while ($db->nextRecord()) { |
| 327 | 327 | $list[$i]['subject'] = $db->f('subject'); |
@@ -57,6 +57,9 @@ discard block |
||
| 57 | 57 | return $db->numRows(); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | + /** |
|
| 61 | + * @param string $code |
|
| 62 | + */ |
|
| 60 | 63 | function findByCode($code) |
| 61 | 64 | { |
| 62 | 65 | // kernel og kode |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | return new NewsletterSubscriber(new NewsletterList($this->kernel, $db->f('list_id')), $db->f('id')); |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @param string $email |
|
| 81 | + */ |
|
| 76 | 82 | function findByListAndEmail($list, $email) |
| 77 | 83 | { |
| 78 | 84 | $email = safeToDb($email); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | function getAllUnsubscribersForList($list) |
| 18 | 18 | { |
| 19 | - $this->dbquery = new Intraface_DBQuery($list->kernel, "newsletter_subscriber", "newsletter_subscriber.list_id=". $list->get('id') . " AND newsletter_subscriber.intranet_id = " . $list->kernel->intranet->get('id')); |
|
| 19 | + $this->dbquery = new Intraface_DBQuery($list->kernel, "newsletter_subscriber", "newsletter_subscriber.list_id=".$list->get('id')." AND newsletter_subscriber.intranet_id = ".$list->kernel->intranet->get('id')); |
|
| 20 | 20 | $this->dbquery->setJoin("LEFT", "contact", "newsletter_subscriber.contact_id = contact.id AND contact.intranet_id = ".$list->kernel->intranet->get("id"), ''); |
| 21 | 21 | $this->dbquery->setJoin("LEFT", "address", "address.belong_to_id = contact.id AND address.active = 1 AND address.type = 3", ''); |
| 22 | 22 | $this->dbquery->setFilter('optin', 1); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | function getByContactId($list, $id) |
| 32 | 32 | { |
| 33 | - $this->dbquery = new Intraface_DBQuery($list->kernel, "newsletter_subscriber", "newsletter_subscriber.list_id=". $list->get('id') . " AND newsletter_subscriber.intranet_id = " . $list->kernel->intranet->get('id')); |
|
| 33 | + $this->dbquery = new Intraface_DBQuery($list->kernel, "newsletter_subscriber", "newsletter_subscriber.list_id=".$list->get('id')." AND newsletter_subscriber.intranet_id = ".$list->kernel->intranet->get('id')); |
|
| 34 | 34 | $this->dbquery->setFilter('contact_id', $id); |
| 35 | 35 | $this->getDBQuery()->setCondition('newsletter_subscriber.contact_id = '.$this->getDBQuery()->getFilter('contact_id')); |
| 36 | 36 | |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | // @todo - make sure to delete old ones |
| 43 | 43 | $db = MDB2::singleton(); |
| 44 | - $db->query('UPDATE newsletter_subscriber SET contact_id = ' . $new_id . ' WHERE contact_id = ' . $old_id); |
|
| 44 | + $db->query('UPDATE newsletter_subscriber SET contact_id = '.$new_id.' WHERE contact_id = '.$old_id); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function findCountByContactId($contact_id) |
| 48 | 48 | { |
| 49 | 49 | $sql = "SELECT id |
| 50 | 50 | FROM newsletter_subscriber |
| 51 | - WHERE intranet_id = " . $this->kernel->intranet->get("id") . " |
|
| 51 | + WHERE intranet_id = " . $this->kernel->intranet->get("id")." |
|
| 52 | 52 | AND contact_id = ".(int)$contact_id." |
| 53 | 53 | AND active = 1"; |
| 54 | 54 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $code = strip_tags($code); |
| 66 | 66 | |
| 67 | 67 | $db = new DB_Sql; |
| 68 | - $db->query("SELECT id, list_id FROM newsletter_subscriber WHERE code = '".$code."' AND intranet_id = " . $this->kernel->intranet->get('id')." and active = 1"); |
|
| 68 | + $db->query("SELECT id, list_id FROM newsletter_subscriber WHERE code = '".$code."' AND intranet_id = ".$this->kernel->intranet->get('id')." and active = 1"); |
|
| 69 | 69 | if (!$db->nextRecord()) { |
| 70 | 70 | return false; |
| 71 | 71 | } |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | LEFT JOIN address |
| 85 | 85 | ON address.belong_to_id = contact.id |
| 86 | 86 | WHERE address.email = '".$email."' |
| 87 | - AND newsletter_subscriber.list_id = " . $list->get('id') . " |
|
| 88 | - AND newsletter_subscriber.intranet_id = " . $this->kernel->intranet->get('id') . " |
|
| 87 | + AND newsletter_subscriber.list_id = " . $list->get('id')." |
|
| 88 | + AND newsletter_subscriber.intranet_id = " . $this->kernel->intranet->get('id')." |
|
| 89 | 89 | AND newsletter_subscriber.active = 1 |
| 90 | 90 | AND contact.active = 1"); |
| 91 | 91 | if (!$db->nextRecord()) { |
@@ -33,6 +33,9 @@ discard block |
||
| 33 | 33 | return $this->getProvider($provider, $value); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | + /** |
|
| 37 | + * @param integer $provider |
|
| 38 | + */ |
|
| 36 | 39 | public function findByProvider($provider) |
| 37 | 40 | { |
| 38 | 41 | if (!in_array($provider, $this->implemented_providers)) { |
@@ -42,6 +45,9 @@ discard block |
||
| 42 | 45 | return $this->getProvider($provider); |
| 43 | 46 | } |
| 44 | 47 | |
| 48 | + /** |
|
| 49 | + * @param integer $value |
|
| 50 | + */ |
|
| 45 | 51 | public function findByTransactionNumber($value) |
| 46 | 52 | { |
| 47 | 53 | $db = new DB_Sql; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $type = 'id'; |
| 27 | 27 | $db = new DB_Sql; |
| 28 | - $db->query("SELECT provider_key FROM onlinepayment WHERE id = ".(int)$value. " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 28 | + $db->query("SELECT provider_key FROM onlinepayment WHERE id = ".(int)$value." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 29 | 29 | if (!$db->nextRecord()) { |
| 30 | 30 | throw new Exception('OnlinePayment::factory: Ikke et gyldigt id'); |
| 31 | 31 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function findByTransactionNumber($value) |
| 46 | 46 | { |
| 47 | 47 | $db = new DB_Sql; |
| 48 | - $db->query("SELECT provider_key FROM onlinepayment WHERE transaction_number = '".$value."' AND intranet_id = " . $kernel->intranet->get('id')); |
|
| 48 | + $db->query("SELECT provider_key FROM onlinepayment WHERE transaction_number = '".$value."' AND intranet_id = ".$kernel->intranet->get('id')); |
|
| 49 | 49 | if (!$db->nextRecord()) { |
| 50 | 50 | throw new Exception('OnlinePayment::factory: Ikke et gyldigt transactionnumber'); |
| 51 | 51 | } |
@@ -8,6 +8,9 @@ |
||
| 8 | 8 | |
| 9 | 9 | class OnlinePaymentDefault extends OnlinePayment |
| 10 | 10 | {
|
| 11 | + /** |
|
| 12 | + * @param integer $id |
|
| 13 | + */ |
|
| 11 | 14 | function __construct($kernel, $id) {
|
| 12 | 15 | |
| 13 | 16 | parent::__construct($kernel, $id); |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | * |
| 96 | 96 | * @param string $action Which action to perform? |
| 97 | 97 | * |
| 98 | - * @return void |
|
| 98 | + * @return boolean |
|
| 99 | 99 | */ |
| 100 | 100 | function transactionAction($action) |
| 101 | 101 | { |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | |
| 87 | 87 | return $this->eval; |
| 88 | 88 | } |
| 89 | - **/ |
|
| 89 | + **/ |
|
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * @todo does what? |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->quickpay = new quickpay; |
| 59 | 59 | $this->quickpay->set_md5checkword($this->settings['md5_secret']); |
| 60 | 60 | $this->quickpay->set_merchant($this->settings['merchant_id']); |
| 61 | - $this->quickpay->set_curl_certificate(dirname(__FILE__) . '/../../../certificates/cacert.pem'); |
|
| 61 | + $this->quickpay->set_curl_certificate(dirname(__FILE__).'/../../../certificates/cacert.pem'); |
|
| 62 | 62 | |
| 63 | 63 | // hvordan bliver disse sat - og hvad er det n�jagtigt? |
| 64 | 64 | $this->quickpay->set_posc($this->posc); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | // henter bel�bene fra denne onlinebetaling |
| 106 | 106 | $this->quickpay->set_transaction($this->get('transaction_number')); |
| 107 | - $this->quickpay->set_amount(round($this->get('amount') * 100)); |
|
| 107 | + $this->quickpay->set_amount(round($this->get('amount')*100)); |
|
| 108 | 108 | |
| 109 | 109 | $this->eval = $this->quickpay->capture(); |
| 110 | 110 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $this->setStatus("reversed"); |
| 131 | 131 | return true; |
| 132 | 132 | } else { |
| 133 | - $this->error->set('Betalingen kunne ikke tilbagebetales: ' . $this->eval['qpstatmsg']); |
|
| 133 | + $this->error->set('Betalingen kunne ikke tilbagebetales: '.$this->eval['qpstatmsg']); |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | } else { |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | function getSettings() |
| 186 | 186 | { |
| 187 | - $this->value['md5_secret'] = $this->kernel->setting->get('intranet', 'onlinepayment.quickpay.md5_secret'); |
|
| 188 | - $this->value['merchant_id'] = $this->kernel->setting->get('intranet', 'onlinepayment.quickpay.merchant_id'); |
|
| 187 | + $this->value['md5_secret'] = $this->kernel->setting->get('intranet', 'onlinepayment.quickpay.md5_secret'); |
|
| 188 | + $this->value['merchant_id'] = $this->kernel->setting->get('intranet', 'onlinepayment.quickpay.merchant_id'); |
|
| 189 | 189 | return $this->value; |
| 190 | 190 | } |
| 191 | 191 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * returns possible status types |
| 183 | 183 | * @todo: duplicate in Procurement class |
| 184 | 184 | * |
| 185 | - * @return array status types |
|
| 185 | + * @return string[] status types |
|
| 186 | 186 | */ |
| 187 | 187 | public function getStatusTypes() |
| 188 | 188 | { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * returns the possible regions where procurement is bought |
| 198 | 198 | * @todo: duplicate in Procurement class |
| 199 | 199 | * |
| 200 | - * @return array possible regions |
|
| 200 | + * @return string[] possible regions |
|
| 201 | 201 | */ |
| 202 | 202 | public function getRegionTypes() |
| 203 | 203 | { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | function setNewContactId($old_id, $new_id) |
| 42 | 42 | { |
| 43 | 43 | $db = MDB2::singleton(); |
| 44 | - $db->query('UPDATE procurement SET contact_id = ' . $new_id . ' WHERE contact_id = ' . $old_id); |
|
| 44 | + $db->query('UPDATE procurement SET contact_id = '.$new_id.' WHERE contact_id = '.$old_id); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | function find() |
@@ -158,14 +158,14 @@ discard block |
||
| 158 | 158 | function any() |
| 159 | 159 | { |
| 160 | 160 | $db = new DB_Sql; |
| 161 | - $db->query("SELECT id FROM procurement WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 161 | + $db->query("SELECT id FROM procurement WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 162 | 162 | return $db->numRows(); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | function anyByContact($contact_id) |
| 166 | 166 | { |
| 167 | 167 | $db = new DB_Sql; |
| 168 | - $db->query("SELECT id FROM procurement WHERE intranet_id = " . $this->kernel->intranet->get('id')." AND contact_id = ".$contact_id." AND active = 1"); |
|
| 168 | + $db->query("SELECT id FROM procurement WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND contact_id = ".$contact_id." AND active = 1"); |
|
| 169 | 169 | return $db->numRows(); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | { |
| 215 | 215 | $sql = "SELECT id |
| 216 | 216 | FROM procurement |
| 217 | - WHERE intranet_id = " . $this->kernel->intranet->get("id") . " |
|
| 217 | + WHERE intranet_id = " . $this->kernel->intranet->get("id")." |
|
| 218 | 218 | AND contact_id = ".(int)$contact_id." |
| 219 | 219 | AND active = 1"; |
| 220 | 220 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @todo $doctrine should not be optional |
| 22 | 22 | * |
| 23 | 23 | * @param object $doctrine Doctrine_Connection |
| 24 | - * @return void |
|
| 24 | + * @return integer |
|
| 25 | 25 | */ |
| 26 | 26 | public function __construct($doctrine = NULL) |
| 27 | 27 | { |