@@ -26,6 +26,9 @@ discard block |
||
| 26 | 26 | $this->db->setOption('portability', MDB2_PORTABILITY_NONE); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $SQL |
|
| 31 | + */ |
|
| 29 | 32 | function query($SQL) |
| 30 | 33 | { |
| 31 | 34 | $this->result = $this->db->query($SQL); |
@@ -101,6 +104,9 @@ discard block |
||
| 101 | 104 | return mysql_escape_string($value); |
| 102 | 105 | } |
| 103 | 106 | |
| 107 | + /** |
|
| 108 | + * @param string $type |
|
| 109 | + */ |
|
| 104 | 110 | function quote($value, $type) |
| 105 | 111 | { |
| 106 | 112 | return $this->db->quote($value, $type); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * @param string $belong_to What the address belongs to, corresponding to the ones in Address::getBelongToTypes() |
| 15 | 15 | * @param integer $belong_to_id From belong_to. NB not id on the address |
| 16 | 16 | * |
| 17 | - * @return object Address |
|
| 17 | + * @return Intraface_Address Address |
|
| 18 | 18 | */ |
| 19 | 19 | public function findByBelongToAndId($belong_to, $belong_to_id) |
| 20 | 20 | { |
@@ -58,6 +58,7 @@ |
||
| 58 | 58 | /** |
| 59 | 59 | * This function is dynamically redefinable. |
| 60 | 60 | * @see $GLOBALS['_global_function_callback_email'] |
| 61 | + * @param string $args |
|
| 61 | 62 | */ |
| 62 | 63 | function autoop($args) {
|
| 63 | 64 | $args = func_get_args(); |
@@ -196,7 +196,7 @@ |
||
| 196 | 196 | function intrafaceBackendErrorhandler($errno, $errstr, $errfile, $errline, $errcontext) |
| 197 | 197 | { |
| 198 | 198 | if (!defined('ERROR_LOG')) { |
| 199 | - define('ERROR_LOG', dirname(__FILE__) . '/../log/error.log'); |
|
| 199 | + define('ERROR_LOG', dirname(__FILE__).'/../log/error.log'); |
|
| 200 | 200 | } |
| 201 | 201 | $errorhandler = new ErrorHandler; |
| 202 | 202 | if (!defined('ERROR_LEVEL_CONTINUE_SCRIPT')) { |
@@ -8,6 +8,9 @@ |
||
| 8 | 8 | $this->translation = $translation; |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | + /** |
|
| 12 | + * @param Intraface_User $user |
|
| 13 | + */ |
|
| 11 | 14 | function findByUserobject($user) |
| 12 | 15 | { |
| 13 | 16 | $kernel = new Intraface_Kernel(session_id()); |
@@ -6,6 +6,9 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | interface Observer |
| 8 | 8 | {
|
| 9 | + /** |
|
| 10 | + * @return boolean |
|
| 11 | + */ |
|
| 9 | 12 | function update($code, $msg); |
| 10 | 13 | } |
| 11 | 14 | |
@@ -47,6 +50,9 @@ discard block |
||
| 47 | 50 | } |
| 48 | 51 | } |
| 49 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string $table |
|
| 55 | + */ |
|
| 50 | 56 | function tableExists($table) |
| 51 | 57 | {
|
| 52 | 58 | $this->db->loadModule('Manager', null, true);
|
@@ -64,12 +64,12 @@ |
||
| 64 | 64 | $result = $this->db->createTable($this->table_name, $this->table_definition); |
| 65 | 65 | |
| 66 | 66 | if (PEAR::isError($result)) { |
| 67 | - throw new Exception('create ' . $result->getMessage()); |
|
| 67 | + throw new Exception('create '.$result->getMessage()); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $result = $this->db->createConstraint($this->table_name, 'PRIMARY', $this->definition); |
| 71 | 71 | if (PEAR::isError($result)) { |
| 72 | - throw new Exception('primary ' . $result->getMessage()); |
|
| 72 | + throw new Exception('primary '.$result->getMessage()); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | /** |
| 66 | 66 | * @deprecated |
| 67 | 67 | * @param $id |
| 68 | - * @return unknown_type |
|
| 68 | + * @return Account |
|
| 69 | 69 | */ |
| 70 | 70 | function findFromId($id) |
| 71 | 71 | { |
@@ -78,6 +78,9 @@ discard block |
||
| 78 | 78 | return new Account($this->year, $id); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | + /** |
|
| 82 | + * @param string $type |
|
| 83 | + */ |
|
| 81 | 84 | function findByType($type, $saldo = false) |
| 82 | 85 | { |
| 83 | 86 | return $this->getList($type, $saldo); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $this->year = $year; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - /** |
|
| 32 | + /** |
|
| 33 | 33 | * Denne funktion bruges bl.a. under bogf�ringen, s� man bare taster kontonummer |
| 34 | 34 | * og s� s�ttes den rigtige konto. |
| 35 | 35 | * |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | function findById($id) |
| 76 | 76 | { |
| 77 | - require_once dirname(__FILE__) . '/Account.php'; |
|
| 77 | + require_once dirname(__FILE__).'/Account.php'; |
|
| 78 | 78 | return new Account($this->year, $id); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $db = new DB_Sql; |
| 188 | 188 | $sql = "SELECT id |
| 189 | 189 | FROM accounting_account |
| 190 | - WHERE intranet_id = " . $this->year->kernel->intranet->get("id") . " AND year_id = ".$this->year->get('id')." AND active = 1"; |
|
| 190 | + WHERE intranet_id = " . $this->year->kernel->intranet->get("id")." AND year_id = ".$this->year->get('id')." AND active = 1"; |
|
| 191 | 191 | $db->query($sql); |
| 192 | 192 | |
| 193 | 193 | return $db->numRows(); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @param object $voucher |
| 25 | 25 | * |
| 26 | - * @return void |
|
| 26 | + * @return string |
|
| 27 | 27 | */ |
| 28 | 28 | function __construct($voucher) |
| 29 | 29 | { |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $post_id = (int)$post_id; |
| 41 | 41 | $db = new DB_Sql; |
| 42 | - $db->query("SELECT voucher_id FROM accounting_post WHERE id = " . $post_id . " AND year_id = " . $year->get('id') . " AND intranet_id=" . $year->kernel->intranet->get('id')); |
|
| 42 | + $db->query("SELECT voucher_id FROM accounting_post WHERE id = ".$post_id." AND year_id = ".$year->get('id')." AND intranet_id=".$year->kernel->intranet->get('id')); |
|
| 43 | 43 | if (!$db->nextRecord()) { |
| 44 | 44 | return new Post(new Voucher($year)); |
| 45 | 45 | } |
| 46 | - $post = new Post(new Voucher($year, $db->f('voucher_id')), (int)$post_id); |
|
| 46 | + $post = new Post(new Voucher($year, $db->f('voucher_id')), (int)$post_id); |
|
| 47 | 47 | return $post; |
| 48 | 48 | |
| 49 | 49 | } |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | public function getList($type = 'stated') |
| 52 | 52 | { |
| 53 | 53 | $db = new DB_Sql; |
| 54 | - $sql = "SELECT voucher.reference, post.id, post.text, post.voucher_id, post.date, post.account_id, post.debet, post.credit, post.stated, DATE_FORMAT(post.date, '%d-%m-%Y') AS date_dk FROM accounting_post post INNER JOIN accounting_voucher voucher ON post.voucher_id = voucher.id WHERE post.year_id = " . $this->voucher->year->get('id') . " AND post.intranet_id = " . $this->voucher->year->kernel->intranet->get('id'); |
|
| 54 | + $sql = "SELECT voucher.reference, post.id, post.text, post.voucher_id, post.date, post.account_id, post.debet, post.credit, post.stated, DATE_FORMAT(post.date, '%d-%m-%Y') AS date_dk FROM accounting_post post INNER JOIN accounting_voucher voucher ON post.voucher_id = voucher.id WHERE post.year_id = ".$this->voucher->year->get('id')." AND post.intranet_id = ".$this->voucher->year->kernel->intranet->get('id'); |
|
| 55 | 55 | if ($type == 'stated') { |
| 56 | 56 | $sql .= " AND post.stated = 1"; |
| 57 | 57 | } elseif ($type == 'draft') { |
| 58 | 58 | $sql .= " AND post.stated = 0"; |
| 59 | 59 | } |
| 60 | - $db->query($sql . " ORDER BY post.voucher_id DESC, post.id DESC"); |
|
| 60 | + $db->query($sql." ORDER BY post.voucher_id DESC, post.id DESC"); |
|
| 61 | 61 | |
| 62 | 62 | $i = 0; |
| 63 | 63 | $this->value['list_saldo'] = 0; |
@@ -90,6 +90,9 @@ |
||
| 90 | 90 | return $files; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | + /** |
|
| 94 | + * @param string $url |
|
| 95 | + */ |
|
| 93 | 96 | function url($url) |
| 94 | 97 | { |
| 95 | 98 | return PATH_WWW . 'restricted' . $url; |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | function findFromId($id) |
| 24 | 24 | { |
| 25 | - require_once dirname(__FILE__) . '/VoucherFile.php'; |
|
| 25 | + require_once dirname(__FILE__).'/VoucherFile.php'; |
|
| 26 | 26 | return new VoucherFile($this->voucher, $id); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | function getList() |
| 30 | 30 | { |
| 31 | 31 | $db = new DB_Sql; |
| 32 | - $db->query("SELECT * FROM accounting_voucher_file WHERE active = 1 AND voucher_id = " . $this->voucher->get('id') . " AND intranet_id=" . $this->voucher->year->kernel->intranet->get('id')); |
|
| 32 | + $db->query("SELECT * FROM accounting_voucher_file WHERE active = 1 AND voucher_id = ".$this->voucher->get('id')." AND intranet_id=".$this->voucher->year->kernel->intranet->get('id')); |
|
| 33 | 33 | $i = 0; |
| 34 | 34 | $files = array(); |
| 35 | 35 | while ($db->nextRecord()) { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $files[$i]['description'] = 'Momsperiode'; |
| 50 | 50 | } |
| 51 | 51 | $files[$i]['name'] = 'Momsperiode'; |
| 52 | - $files[$i]['file_uri'] = $this->url('/module/accounting/year/'.$this->voucher->year->getId().'/vat/' . $db->f('belong_to_id')); |
|
| 52 | + $files[$i]['file_uri'] = $this->url('/module/accounting/year/'.$this->voucher->year->getId().'/vat/'.$db->f('belong_to_id')); |
|
| 53 | 53 | break; |
| 54 | 54 | case 'file': |
| 55 | 55 | $this->voucher->year->kernel->useModule('filemanager'); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $files[$i]['description'] = 'Kreditnota'; |
| 64 | 64 | } |
| 65 | 65 | $files[$i]['name'] = 'Kreditnota'; |
| 66 | - $files[$i]['file_uri'] = $this->url('/module/debtor/credit_note/' . $db->f('belong_to_id') . '.pdf'); |
|
| 66 | + $files[$i]['file_uri'] = $this->url('/module/debtor/credit_note/'.$db->f('belong_to_id').'.pdf'); |
|
| 67 | 67 | break; |
| 68 | 68 | case 'reminder': |
| 69 | 69 | if (empty($files[$i]['description'])) { |
@@ -91,6 +91,6 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | function url($url) |
| 93 | 93 | { |
| 94 | - return PATH_WWW . 'restricted' . $url; |
|
| 94 | + return PATH_WWW.'restricted'.$url; |
|
| 95 | 95 | } |
| 96 | 96 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @param object $year_object |
| 18 | 18 | * |
| 19 | - * @return void |
|
| 19 | + * @return string |
|
| 20 | 20 | */ |
| 21 | 21 | public function __construct($year_object) |
| 22 | 22 | { |
@@ -32,10 +32,9 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Creates a voucher |
| 34 | 34 | * |
| 35 | - * @param object $year |
|
| 36 | 35 | * @param string $voucher_number |
| 37 | 36 | * |
| 38 | - * @return void |
|
| 37 | + * @return Voucher |
|
| 39 | 38 | */ |
| 40 | 39 | public function findFromVoucherNumber($voucher_number) |
| 41 | 40 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function findFromId($id) |
| 27 | 27 | { |
| 28 | - require_once dirname(__FILE__) . '/Voucher.php'; |
|
| 28 | + require_once dirname(__FILE__).'/Voucher.php'; |
|
| 29 | 29 | return new Voucher($this->year, $id); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public function findFromVoucherNumber($voucher_number) |
| 41 | 41 | { |
| 42 | 42 | $db = new DB_Sql; |
| 43 | - $db->query("SELECT id FROM accounting_voucher WHERE number = '".safeToDb($voucher_number)."' AND year_id = '".$this->year->get('id')."' AND intranet_id = " . $this->year->kernel->intranet->get('id')); |
|
| 43 | + $db->query("SELECT id FROM accounting_voucher WHERE number = '".safeToDb($voucher_number)."' AND year_id = '".$this->year->get('id')."' AND intranet_id = ".$this->year->kernel->intranet->get('id')); |
|
| 44 | 44 | if (!$db->nextRecord()) { |
| 45 | 45 | return new Voucher($this->year); |
| 46 | 46 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $db->query("SELECT MAX(number) AS max_voucher_number |
| 95 | 95 | FROM accounting_voucher |
| 96 | - WHERE intranet_id = " . $this->year->kernel->intranet->get('id') . " |
|
| 96 | + WHERE intranet_id = " . $this->year->kernel->intranet->get('id')." |
|
| 97 | 97 | AND year_id = " . $this->year->get('id')); |
| 98 | 98 | if (!$db->nextRecord()) { |
| 99 | 99 | return 0; |