@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | require_once 'Intraface/modules/accounting/Year.php'; |
16 | 16 | $year = new Year($this->kernel); |
17 | - $year->save(array('from_date' => date('Y') . '-01-01', 'to_date' => date('Y') . '-12-31', 'label' => 'test', 'locked' => 0, 'vat' => 1)); |
|
17 | + $year->save(array('from_date' => date('Y').'-01-01', 'to_date' => date('Y').'-12-31', 'label' => 'test', 'locked' => 0, 'vat' => 1)); |
|
18 | 18 | $year->createAccounts('standard'); |
19 | 19 | $year->setYear(); |
20 | 20 | } |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | |
13 | 13 | public function createInvoice() |
14 | 14 | { |
15 | - require_once dirname (__FILE__) . '/Contact.php'; |
|
15 | + require_once dirname(__FILE__).'/Contact.php'; |
|
16 | 16 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
17 | 17 | $contact_id = $contact->create(); |
18 | 18 | |
19 | - require_once dirname(__FILE__) . '/Product.php'; |
|
19 | + require_once dirname(__FILE__).'/Product.php'; |
|
20 | 20 | $product = new Install_Helper_Product($this->kernel, $this->db); |
21 | 21 | $product_id = $product->create(); |
22 | 22 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'contact_id' => $contact_id, |
27 | 27 | 'description' => 'Test invoice', |
28 | 28 | 'this_date' => date('d-m-Y'), |
29 | - 'due_date' => date('d-m-Y', time()+14*60*60*24))); |
|
29 | + 'due_date' => date('d-m-Y', time() + 14*60*60*24))); |
|
30 | 30 | |
31 | 31 | $debtor->loadItem(); |
32 | 32 | $debtor->item->save(array('product_id' => $product_id, 'quantity' => 3, 'description' => 'Test description on product')); |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | |
35 | 35 | public function createOrder() |
36 | 36 | { |
37 | - require_once dirname(__FILE__) . '/Contact.php'; |
|
37 | + require_once dirname(__FILE__).'/Contact.php'; |
|
38 | 38 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
39 | 39 | $contact_id = $contact->create(); |
40 | 40 | |
41 | - require_once dirname(__FILE__) . '/Product.php'; |
|
41 | + require_once dirname(__FILE__).'/Product.php'; |
|
42 | 42 | $product = new Install_Helper_Product($this->kernel, $this->db); |
43 | 43 | $product_id = $product->create(); |
44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | 'contact_id' => $contact_id, |
49 | 49 | 'description' => 'Test invoice', |
50 | 50 | 'this_date' => date('d-m-Y'), |
51 | - 'due_date' => date('d-m-Y', time()+14*60*60*24))); |
|
51 | + 'due_date' => date('d-m-Y', time() + 14*60*60*24))); |
|
52 | 52 | |
53 | 53 | $debtor->loadItem(); |
54 | 54 | $debtor->item->save(array('product_id' => $product_id, 'quantity' => 3, 'description' => 'Test description on product')); |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | |
57 | 57 | public function createOrderFromShop() |
58 | 58 | { |
59 | - require_once dirname(__FILE__) . '/Contact.php'; |
|
59 | + require_once dirname(__FILE__).'/Contact.php'; |
|
60 | 60 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
61 | 61 | $contact_id = $contact->create(); |
62 | 62 | |
63 | - require_once dirname(__FILE__) . '/Product.php'; |
|
63 | + require_once dirname(__FILE__).'/Product.php'; |
|
64 | 64 | $product = new Install_Helper_Product($this->kernel, $this->db); |
65 | 65 | $product_id = $product->create(); |
66 | 66 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'contact_id' => $contact_id, |
71 | 71 | 'description' => 'From shop', |
72 | 72 | 'this_date' => date('d-m-Y'), |
73 | - 'due_date' => date('d-m-Y', time()+14*60*60*24)), 'webshop', 1); |
|
73 | + 'due_date' => date('d-m-Y', time() + 14*60*60*24)), 'webshop', 1); |
|
74 | 74 | |
75 | 75 | $debtor->loadItem(); |
76 | 76 | $debtor->item->save(array('product_id' => $product_id, 'quantity' => 3, 'description' => 'Test description on product')); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | public function loadPackages() |
20 | 20 | { |
21 | 21 | |
22 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/../database-module_package-values.sql'); |
|
22 | + $sql_structure = file_get_contents(dirname(__FILE__).'/../database-module_package-values.sql'); |
|
23 | 23 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
24 | 24 | |
25 | 25 | foreach ($sql_arr as $sql) { |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $variation->load(); |
97 | 97 | $detail = $variation->getDetail(); |
98 | 98 | $detail->price_difference = 0; /* Can be reimplemented: ($a1 * $a2); */ |
99 | - $detail->weight_difference = -1*($a1 * $a2); |
|
99 | + $detail->weight_difference = -1*($a1*$a2); |
|
100 | 100 | $detail->save(); |
101 | 101 | |
102 | 102 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public function create() |
14 | 14 | { |
15 | - require_once dirname(__FILE__) . '/Contact.php'; |
|
15 | + require_once dirname(__FILE__).'/Contact.php'; |
|
16 | 16 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
17 | 17 | $contact_id = $contact->create(); |
18 | 18 |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | |
27 | 27 | function dropDatabase() |
28 | 28 | { |
29 | - $result = $this->db->query("SHOW TABLES FROM " . DB_NAME); |
|
29 | + $result = $this->db->query("SHOW TABLES FROM ".DB_NAME); |
|
30 | 30 | if (PEAR::isError($result)) { |
31 | 31 | throw new Exception($result->getUserInfo()); |
32 | 32 | } |
33 | 33 | |
34 | 34 | while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { |
35 | - $drop = $this->db->exec('DROP TABLE ' . $line['tables_in_' . DB_NAME]); |
|
35 | + $drop = $this->db->exec('DROP TABLE '.$line['tables_in_'.DB_NAME]); |
|
36 | 36 | if (PEAR::IsError($drop)) { |
37 | 37 | throw new Exception($drop->getUserInfo()); |
38 | 38 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | function createDatabaseSchema() |
44 | 44 | { |
45 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/database-structure.sql'); |
|
45 | + $sql_structure = file_get_contents(dirname(__FILE__).'/database-structure.sql'); |
|
46 | 46 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
47 | 47 | |
48 | 48 | foreach ($sql_arr as $sql) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/database-update.sql'); |
|
56 | + $sql_structure = file_get_contents(dirname(__FILE__).'/database-update.sql'); |
|
57 | 57 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
58 | 58 | |
59 | 59 | foreach ($sql_arr as $sql) { |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | |
69 | 69 | function emptyDatabase() |
70 | 70 | { |
71 | - $result = $this->db->query("SHOW TABLES FROM " . DB_NAME); |
|
71 | + $result = $this->db->query("SHOW TABLES FROM ".DB_NAME); |
|
72 | 72 | if (PEAR::isError($result)) { |
73 | 73 | throw new Exception($result->getUserInfo()); |
74 | 74 | } |
75 | 75 | while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { |
76 | - $truncate = $this->db->exec('TRUNCATE TABLE ' . $line['Tables_in_'.DB_NAME]); |
|
76 | + $truncate = $this->db->exec('TRUNCATE TABLE '.$line['Tables_in_'.DB_NAME]); |
|
77 | 77 | if (PEAR::IsError($truncate)) { |
78 | 78 | throw new Exception($truncate->getUserInfo()); |
79 | 79 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | function createStartingValues() |
86 | 86 | { |
87 | - $sql_values = file_get_contents(dirname(__FILE__) . '/database-values.sql'); |
|
87 | + $sql_values = file_get_contents(dirname(__FILE__).'/database-values.sql'); |
|
88 | 88 | $sql_arr = Intraface_Install::splitSql($sql_values); |
89 | 89 | |
90 | 90 | foreach ($sql_arr as $sql) { |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | |
129 | 129 | function deleteUploadDirectory($f) |
130 | 130 | { |
131 | - if ( is_dir( $f ) ){ |
|
132 | - foreach ( scandir( $f ) as $item ){ |
|
133 | - if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) |
|
131 | + if (is_dir($f)) { |
|
132 | + foreach (scandir($f) as $item) { |
|
133 | + if (!strcmp($item, '.') || !strcmp($item, '..')) |
|
134 | 134 | continue; |
135 | - $this->deleteUploadDirectory( $f . "/" . $item ); |
|
135 | + $this->deleteUploadDirectory($f."/".$item); |
|
136 | 136 | } |
137 | - rmdir( $f ); |
|
138 | - } else{ |
|
139 | - @unlink( $f ); |
|
137 | + rmdir($f); |
|
138 | + } else { |
|
139 | + @unlink($f); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $object_method[0] = str_replace('/', '', $object_method[0]); |
216 | 216 | $object_method[0] = str_replace('\\', '', $object_method[0]); |
217 | 217 | |
218 | - require_once dirname(__FILE__) . '/Helper/'.$object_method[0].'.php'; |
|
218 | + require_once dirname(__FILE__).'/Helper/'.$object_method[0].'.php'; |
|
219 | 219 | $object_name = 'Install_Helper_'.$object_method[0]; |
220 | 220 | $object = new $object_name($kernel, $this->db); |
221 | 221 | $object->$object_method[1](); |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | 'packagefile' => 'package.xml', |
58 | 58 | 'ignore' => $ignore, |
59 | 59 | 'dir_roles' => array( |
60 | - 'intraface.dk' => 'www' |
|
60 | + 'intraface.dk' => 'www' |
|
61 | 61 | ), |
62 | 62 | 'exceptions' => array( |
63 | - 'intraface.dk/*.*' => 'www' |
|
63 | + 'intraface.dk/*.*' => 'www' |
|
64 | 64 | ), |
65 | 65 | 'simpleoutput' => true, |
66 | 66 | 'addhiddenfiles' => true |
@@ -221,29 +221,29 @@ discard block |
||
221 | 221 | $post_install_script = $pfm->initPostinstallScript('intraface.php'); |
222 | 222 | $post_install_script->addParamGroup('setup', |
223 | 223 | array($post_install_script->getParam('db_user', 'User', 'string', 'root'), |
224 | - $post_install_script->getParam('db_pass', 'Password', 'string', ''), |
|
225 | - $post_install_script->getParam('db_host', 'Host', 'string', 'localhost'), |
|
226 | - $post_install_script->getParam('db_name', 'Database', 'string', 'intraface'), |
|
227 | - $post_install_script->getParam('net_scheme', 'Net scheme', 'string', 'http://'), |
|
228 | - $post_install_script->getParam('net_host', 'Net host', 'string', 'localhost'), |
|
229 | - $post_install_script->getParam('net_directory', 'Net directory', 'string', '/'), |
|
230 | - $post_install_script->getParam('path_root', 'Root path', 'string', '/home/intraface/'), |
|
231 | - $post_install_script->getParam('path_include_path', 'Include path', 'string', ''), |
|
232 | - $post_install_script->getParam('path_upload', 'Upload path', 'string', '/home/intraface/upload/'), |
|
233 | - $post_install_script->getParam('path_cache', 'Cache path', 'string', '/home/intraface/cache'), |
|
234 | - $post_install_script->getParam('connection_internet', 'Connection to intranet', 'boolean', true), |
|
235 | - $post_install_script->getParam('server_status', 'Server status', 'string', 'PRODUCTION'), |
|
236 | - $post_install_script->getParam('error_handle_level', 'Error handle error ', 'integer', E_ALL), |
|
237 | - $post_install_script->getParam('error_level_continue_script', 'Error level continue script', 'integer' ^ E_NOTICE), |
|
238 | - $post_install_script->getParam('error_report_email', 'Error report email', 'string', '[email protected]'), |
|
239 | - $post_install_script->getParam('error_log', 'Error log', 'string', 'log/error.log'), |
|
240 | - $post_install_script->getParam('timezone', 'Timezone', 'string', 'Europe/Copenhagen'), |
|
241 | - $post_install_script->getParam('country_local', 'Country local', 'string', 'da_DK'), |
|
242 | - $post_install_script->getParam('intraface_intranetmaintenance_intranet_private_key', 'Private key', 'string', ''), |
|
243 | - $post_install_script->getParam('intraface_onlinepayment_provider', 'Online payment provider', 'string', 'Quickpay'), |
|
244 | - $post_install_script->getParam('intraface_onlinepayment_merchant', 'Online payment merchant number', 'string', ''), |
|
245 | - $post_install_script->getParam('intraface_onlinepayment_md5secret', 'Online payment md5secret', 'string', '') |
|
246 | - ), |
|
224 | + $post_install_script->getParam('db_pass', 'Password', 'string', ''), |
|
225 | + $post_install_script->getParam('db_host', 'Host', 'string', 'localhost'), |
|
226 | + $post_install_script->getParam('db_name', 'Database', 'string', 'intraface'), |
|
227 | + $post_install_script->getParam('net_scheme', 'Net scheme', 'string', 'http://'), |
|
228 | + $post_install_script->getParam('net_host', 'Net host', 'string', 'localhost'), |
|
229 | + $post_install_script->getParam('net_directory', 'Net directory', 'string', '/'), |
|
230 | + $post_install_script->getParam('path_root', 'Root path', 'string', '/home/intraface/'), |
|
231 | + $post_install_script->getParam('path_include_path', 'Include path', 'string', ''), |
|
232 | + $post_install_script->getParam('path_upload', 'Upload path', 'string', '/home/intraface/upload/'), |
|
233 | + $post_install_script->getParam('path_cache', 'Cache path', 'string', '/home/intraface/cache'), |
|
234 | + $post_install_script->getParam('connection_internet', 'Connection to intranet', 'boolean', true), |
|
235 | + $post_install_script->getParam('server_status', 'Server status', 'string', 'PRODUCTION'), |
|
236 | + $post_install_script->getParam('error_handle_level', 'Error handle error ', 'integer', E_ALL), |
|
237 | + $post_install_script->getParam('error_level_continue_script', 'Error level continue script', 'integer' ^ E_NOTICE), |
|
238 | + $post_install_script->getParam('error_report_email', 'Error report email', 'string', '[email protected]'), |
|
239 | + $post_install_script->getParam('error_log', 'Error log', 'string', 'log/error.log'), |
|
240 | + $post_install_script->getParam('timezone', 'Timezone', 'string', 'Europe/Copenhagen'), |
|
241 | + $post_install_script->getParam('country_local', 'Country local', 'string', 'da_DK'), |
|
242 | + $post_install_script->getParam('intraface_intranetmaintenance_intranet_private_key', 'Private key', 'string', ''), |
|
243 | + $post_install_script->getParam('intraface_onlinepayment_provider', 'Online payment provider', 'string', 'Quickpay'), |
|
244 | + $post_install_script->getParam('intraface_onlinepayment_merchant', 'Online payment merchant number', 'string', ''), |
|
245 | + $post_install_script->getParam('intraface_onlinepayment_md5secret', 'Online payment md5secret', 'string', '') |
|
246 | + ), |
|
247 | 247 | ''); |
248 | 248 | |
249 | 249 | $pfm->addPostInstallTask($post_install_script, 'intraface.php'); |
@@ -250,7 +250,7 @@ |
||
250 | 250 | |
251 | 251 | foreach ($web_files AS $file) { |
252 | 252 | $src_file = substr($file, 4); |
253 | - $formatted_file = substr($file, strlen($web_dir . '/')); |
|
253 | + $formatted_file = substr($file, strlen($web_dir.'/')); |
|
254 | 254 | if (in_array($src_file, $ignore)) continue; |
255 | 255 | $pfm->addInstallAs($src_file, $formatted_file); |
256 | 256 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | function hasModuleAccess($modulename) |
55 | 55 | { |
56 | - return $this->intranet->hasModuleAccess($modulename); |
|
56 | + return $this->intranet->hasModuleAccess($modulename); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | function hasIntranetAccess($intranet_id) |
@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | public function getAddress() |
96 | 96 | { |
97 | - return ($this->address = Intraface_Address::factory('intranet', $this->id)); |
|
97 | + return ($this->address = Intraface_Address::factory('intranet', $this->id)); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -109,7 +109,7 @@ |
||
109 | 109 | */ |
110 | 110 | function hasModuleAccess($module) |
111 | 111 | { |
112 | - $filename = PATH_INCLUDE_MODULE . $module . '/Main' . ucfirst($module) . '.php'; |
|
112 | + $filename = PATH_INCLUDE_MODULE.$module.'/Main'.ucfirst($module).'.php'; |
|
113 | 113 | if (file_exists($filename)) { |
114 | 114 | require_once $filename; |
115 | 115 | $module_class = 'Main'.ucfirst($module); |