@@ -130,8 +130,9 @@ |
||
| 130 | 130 | {
|
| 131 | 131 | if ( is_dir( $f ) ){
|
| 132 | 132 | foreach ( scandir( $f ) as $item ){
|
| 133 | - if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) |
|
| 134 | - continue; |
|
| 133 | + if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) { |
|
| 134 | + continue; |
|
| 135 | + } |
|
| 135 | 136 | $this->deleteUploadDirectory( $f . "/" . $item ); |
| 136 | 137 | } |
| 137 | 138 | rmdir( $f ); |
@@ -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'); |
@@ -251,7 +251,9 @@ |
||
| 251 | 251 | foreach ($web_files AS $file) {
|
| 252 | 252 | $src_file = substr($file, 4); |
| 253 | 253 | $formatted_file = substr($file, strlen($web_dir . '/')); |
| 254 | - if (in_array($src_file, $ignore)) continue; |
|
| 254 | + if (in_array($src_file, $ignore)) { |
|
| 255 | + continue; |
|
| 256 | + } |
|
| 255 | 257 | $pfm->addInstallAs($src_file, $formatted_file); |
| 256 | 258 | } |
| 257 | 259 | |
@@ -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 | /** |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $product = new Product($this->procurement->kernel, $input["product_id"], $input['product_detail_id']); |
| 235 | 235 | |
| 236 | 236 | if (!is_object($product) || $product->get('id') == 0) {
|
| 237 | - $this->error->set("Ugyldigt produkt");
|
|
| 237 | + $this->error->set("Ugyldigt produkt");
|
|
| 238 | 238 | } else {
|
| 239 | 239 | $product_detail_id = $product->get("detail_id");
|
| 240 | 240 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $product = new Product($this->procurement->kernel, $product_id); |
| 347 | 347 | |
| 348 | 348 | if (!is_object($product) || $product->get('id') == 0) {
|
| 349 | - throw new Excetion('Invalid product id');
|
|
| 349 | + throw new Excetion('Invalid product id');
|
|
| 350 | 350 | } else {
|
| 351 | 351 | $product_detail_id = $product->get("detail_id");
|
| 352 | 352 | } |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | |
| 124 | 124 | function loadItem($id = 0) |
| 125 | 125 | { |
| 126 | - $this->item = new ProcurementItem($this, (int)$id); |
|
| 126 | + $this->item = new ProcurementItem($this, (int)$id); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | function update($input) |
@@ -98,10 +98,10 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | $data = array( |
| 101 | - 'procurement' => $this->getProcurement(), |
|
| 102 | - 'kernel' => $this->getKernel(), |
|
| 103 | - 'append_file' => $append_file, |
|
| 104 | - 'filehandler' => $filehandler); |
|
| 101 | + 'procurement' => $this->getProcurement(), |
|
| 102 | + 'kernel' => $this->getKernel(), |
|
| 103 | + 'append_file' => $append_file, |
|
| 104 | + 'filehandler' => $filehandler); |
|
| 105 | 105 | $tpl = $this->template->create(dirname(__FILE__) . '/templates/show'); |
| 106 | 106 | return $tpl->render($this, $data); |
| 107 | 107 | } |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | $this->document->addScript('procurement/edit.js');
|
| 114 | 114 | |
| 115 | 115 | $data = array( |
| 116 | - 'procurement' => $this->getProcurement(), |
|
| 117 | - 'kernel' => $this->getKernel(), |
|
| 118 | - 'title' => $this->t("Edit procurement"),
|
|
| 116 | + 'procurement' => $this->getProcurement(), |
|
| 117 | + 'kernel' => $this->getKernel(), |
|
| 118 | + 'title' => $this->t("Edit procurement"),
|
|
| 119 | 119 | 'gateway' => new Intraface_modules_procurement_ProcurementGateway($this->getKernel()), |
| 120 | 120 | 'values' => $this->getValues()); |
| 121 | 121 | $tpl = $this->template->create(dirname(__FILE__) . '/templates/procurement-edit'); |
@@ -245,8 +245,8 @@ discard block |
||
| 245 | 245 | {
|
| 246 | 246 | $this->getProcurement()->loadItem(); |
| 247 | 247 | $this->getProcurement()->item->save(array( |
| 248 | - 'product_id' => $product['product_id'], |
|
| 249 | - 'product_variation_id' => $product['product_variation_id'], |
|
| 250 | - 'quantity' => intval($quantity))); |
|
| 248 | + 'product_id' => $product['product_id'], |
|
| 249 | + 'product_variation_id' => $product['product_variation_id'], |
|
| 250 | + 'quantity' => intval($quantity))); |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | \ No newline at end of file |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $procurement = $this->context->getProcurement(); |
| 17 | 17 | |
| 18 | 18 | $data = array( |
| 19 | - 'items' => $procurement->getItems(), |
|
| 19 | + 'items' => $procurement->getItems(), |
|
| 20 | 20 | 'procurement' => $procurement |
| 21 | 21 | ); |
| 22 | 22 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | if ($this->type == "invoice") {
|
| 392 | - // Hvis det er en faktura skal der indtastes en due_date, ellers er det ligegyldigt! |
|
| 392 | + // Hvis det er en faktura skal der indtastes en due_date, ellers er det ligegyldigt! |
|
| 393 | 393 | if ($validator->isDate($input["due_date"], "Ugyldig leveringsdato", "allow_no_year")) {
|
| 394 | 394 | $due_date = new Intraface_Date($input["due_date"]); |
| 395 | 395 | $due_date->convert2db(); |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | $input["round_off"] = 0; |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | - // user_id = ".$this->kernel->user->get('id').", // skal puttes p�, men kun hvis det ikke er fra webshop.
|
|
| 448 | + // user_id = ".$this->kernel->user->get('id').", // skal puttes p�, men kun hvis det ikke er fra webshop.
|
|
| 449 | 449 | $db = new DB_Sql; |
| 450 | 450 | if ($this->id == 0) {
|
| 451 | 451 | |
@@ -717,9 +717,9 @@ discard block |
||
| 717 | 717 | |
| 718 | 718 | function getFromShopId() |
| 719 | 719 | {
|
| 720 | - if ($this->value['where_from'] == 'webshop') {
|
|
| 721 | - return $this->value['where_from_id']; |
|
| 722 | - } |
|
| 720 | + if ($this->value['where_from'] == 'webshop') {
|
|
| 721 | + return $this->value['where_from_id']; |
|
| 722 | + } |
|
| 723 | 723 | throw new Exception('Not from a shop');
|
| 724 | 724 | } |
| 725 | 725 | |
@@ -1130,9 +1130,9 @@ discard block |
||
| 1130 | 1130 | function getPaymentInformation() |
| 1131 | 1131 | {
|
| 1132 | 1132 | $info = array('bank_name' => $this->kernel->setting->get("intranet", "bank_name"),
|
| 1133 | - 'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"),
|
|
| 1134 | - 'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"),
|
|
| 1135 | - 'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number")
|
|
| 1133 | + 'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"),
|
|
| 1134 | + 'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"),
|
|
| 1135 | + 'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number")
|
|
| 1136 | 1136 | ); |
| 1137 | 1137 | |
| 1138 | 1138 | return $info; |
@@ -307,7 +307,9 @@ |
||
| 307 | 307 | |
| 308 | 308 | for ($i = 0, $max = count($item), $total = 0, $total_currency = 0; $i<$max; $i++) {
|
| 309 | 309 | $total += $item[$i]["amount"]->getAsIso(); |
| 310 | - if ($currency) $total_currency += $item[$i]['amount_currency']->getAsIso(); |
|
| 310 | + if ($currency) { |
|
| 311 | + $total_currency += $item[$i]['amount_currency']->getAsIso(); |
|
| 312 | + } |
|
| 311 | 313 | } |
| 312 | 314 | |
| 313 | 315 | // no round off of curreny yet! |