Completed
Branch master (6ed6e7)
by Lars
07:57
created
src/Intraface/modules/product/Controller/Related.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     {
13 13
         $kernel = $this->context->getKernel();
14 14
         $kernel->module('product');
15
-        $smarty = $this->template->create(dirname(__FILE__) . '/tpl/related');
15
+        $smarty = $this->template->create(dirname(__FILE__).'/tpl/related');
16 16
         return $smarty->render($this);
17 17
     }
18 18
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         }
60 60
 
61 61
         $product->getDBQuery()->defineCharacter("character", "detail_translation.name");
62
-        $product->getDBQuery()->setCondition("product.id != " . $this->context->name());
62
+        $product->getDBQuery()->setCondition("product.id != ".$this->context->name());
63 63
         $product->getDBQuery()->setExtraUri("&id=".(int)$this->context->name());
64 64
         $product->getDBQuery()->usePaging("paging");
65 65
         $product->getDBQuery()->storeResult("use_stored", "related_products", "sublevel");
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         }
119 119
 
120 120
         $product->getDBQuery()->defineCharacter("character", "detail_translation.name");
121
-        $product->getDBQuery()->setCondition("product.id != " . $this->context->name());
121
+        $product->getDBQuery()->setCondition("product.id != ".$this->context->name());
122 122
         $product->getDBQuery()->setExtraUri("&id=".(int)$this->context->name());
123 123
         $product->getDBQuery()->usePaging("paging");
124 124
         $product->getDBQuery()->storeResult("use_stored", "related_products", "sublevel");
Please login to merge, or discard this patch.
src/Intraface/modules/product/Controller/Selectproduct.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -155,16 +155,16 @@
 block discarded – undo
155 155
                     foreach ($this->body('selected') AS $selected_id => $selected_value) {
156 156
                         if ($selected_value != '' && $selected_value != '0') {
157 157
                             $product = array(
158
-                            	'product_id' => $selected_id,
159
-                            	'product_variation_id' => 0);
158
+                                'product_id' => $selected_id,
159
+                                'product_variation_id' => 0);
160 160
                             $this->addItem($product, $selected_value);                        }
161 161
                     }
162 162
                 }
163 163
             } else {
164 164
                 if ((int)$this->body('selected') != 0) {
165 165
                     $product = array(
166
-                    	'product_id' => (int)$this->body('selected'),
167
-                    	'product_variation_id' => 0);
166
+                        'product_id' => (int)$this->body('selected'),
167
+                        'product_variation_id' => 0);
168 168
                     $this->addItem($product, (int)$this->body('quantity'));
169 169
                 }
170 170
             }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
         $data = array('products' => $list);
94 94
 
95
-        $smarty = $this->template->create(dirname(__FILE__) . '/tpl/selectproduct');
95
+        $smarty = $this->template->create(dirname(__FILE__).'/tpl/selectproduct');
96 96
         return $smarty->render($this, $data);
97 97
     }
98 98
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                             $product = array(
158 158
                             	'product_id' => $selected_id,
159 159
                             	'product_variation_id' => 0);
160
-                            $this->addItem($product, $selected_value);                        }
160
+                            $this->addItem($product, $selected_value); }
161 161
                     }
162 162
                 }
163 163
             } else {
Please login to merge, or discard this patch.
src/Intraface/modules/product/Controller/Variation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
             'kernel' => $this->getKernel()
54 54
         );
55 55
 
56
-        $tpl = $this->template->create(dirname(__FILE__) . '/tpl/variation');
56
+        $tpl = $this->template->create(dirname(__FILE__).'/tpl/variation');
57 57
         return $tpl->render($this, $data);
58 58
     }
59 59
 
Please login to merge, or discard this patch.
src/Intraface/modules/product/Controller/Productattributegroup.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 
90 90
     function getProduct()
91 91
     {
92
-    	Intraface_Doctrine_Intranet::singleton($this->getKernel()->intranet->getId());
92
+        Intraface_Doctrine_Intranet::singleton($this->getKernel()->intranet->getId());
93 93
 
94 94
         return new Product($this->getKernel(), $this->context->name());
95 95
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
         $data = array('product' => $product, 'groups' => $groups);
38 38
 
39
-        $smarty = $this->template->create(dirname(__FILE__) . '/tpl/productattributegroup');
39
+        $smarty = $this->template->create(dirname(__FILE__).'/tpl/productattributegroup');
40 40
         return $smarty->render($this, $data);
41 41
     }
42 42
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@
 block discarded – undo
48 48
 
49 49
             $existing_groups = array();
50 50
             $new_groups = array();
51
-            foreach ($product->getAttributeGroups() AS $group) $existing_groups[] = $group['id'];
51
+            foreach ($product->getAttributeGroups() AS $group) {
52
+                $existing_groups[] = $group['id'];
53
+            }
52 54
 
53 55
             if (count($existing_groups) > 0) {
54 56
                 try {
Please login to merge, or discard this patch.
src/Intraface/modules/modulepackage/ModulePackage.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @param int id on a ModulePackage
38 38
      *
39 39
      * @return void
40
-      */
40
+     */
41 41
     public function __construct($id = 0)
42 42
     {
43 43
         $this->db = MDB2::singleton(DB_DSN);
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
                         break;
156 156
                 }
157 157
                 $i++;
158
-             } else {
158
+                } else {
159 159
                 throw new Exception('limiter '.$limiter.' in tabel module_package_module for module '.$module.' is not valid!');
160
-             }
160
+                }
161 161
         }
162 162
 
163 163
         return $return_limiters;
@@ -204,18 +204,18 @@  discard block
 block discarded – undo
204 204
         $i = 0;
205 205
         $db = $this->dbquery->getRecordset('module_package.id, module_package_plan.plan, module_package_plan.id AS plan_id, module_package.product_id, module_package_group.group_name, module_package_group.id AS group_id');
206 206
         while ($db->nextRecord()) {
207
-             $list[$i]['id'] = $db->f('id');
208
-             $list[$i]['plan'] = $db->f('plan');
209
-             $list[$i]['plan_id'] = $db->f('plan_id');
210
-             $list[$i]['group'] = $db->f('group_name');
211
-             $list[$i]['group_id'] = $db->f('group_id');
212
-             $list[$i]['product_id'] = $db->f('product_id');
213
-             if ($db->f('product_id') != 0) {
214
-                 $product_ids[] = $db->f('product_id');
215
-             }
216
-             $list[$i]['modules'] = $this->getModules($db->f('id'));
217
-             $list[$i]['product'] = array();
218
-             $i++;
207
+                $list[$i]['id'] = $db->f('id');
208
+                $list[$i]['plan'] = $db->f('plan');
209
+                $list[$i]['plan_id'] = $db->f('plan_id');
210
+                $list[$i]['group'] = $db->f('group_name');
211
+                $list[$i]['group_id'] = $db->f('group_id');
212
+                $list[$i]['product_id'] = $db->f('product_id');
213
+                if ($db->f('product_id') != 0) {
214
+                    $product_ids[] = $db->f('product_id');
215
+                }
216
+                $list[$i]['modules'] = $this->getModules($db->f('id'));
217
+                $list[$i]['product'] = array();
218
+                $i++;
219 219
         }
220 220
 
221 221
         // get all products in one request and add them to the array
@@ -226,13 +226,13 @@  discard block
 block discarded – undo
226 226
         // we apply the products to the aray
227 227
         if (is_array($products) && count($products) > 0) {
228 228
             for ($i = 0, $max = count($list); $i < $max; $i++) {
229
-                 if ($list[$i]['product_id'] != 0) {
230
-                     foreach ($products['products'] AS $product) {
231
-                         if ($product['id'] == $list[$i]['product_id']) {
232
-                             $list[$i]['product'] = $product;
233
-                         }
234
-                     }
235
-                 }
229
+                    if ($list[$i]['product_id'] != 0) {
230
+                        foreach ($products['products'] AS $product) {
231
+                            if ($product['id'] == $list[$i]['product_id']) {
232
+                                $list[$i]['product'] = $product;
233
+                            }
234
+                        }
235
+                    }
236 236
             }
237 237
         }
238 238
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function load()
58 58
     {
59
-        $result = $this->db->query("SELECT module_package.id, module_package.product_id, module_package_group.group_name AS ".$this->db->quoteIdentifier('group').", module_package_plan.plan, module_package_plan.plan_index, module_package_group.id AS group_id " .
60
-                "FROM module_package " .
61
-                "INNER JOIN module_package_group ON module_package.module_package_group_id = module_package_group.id " .
62
-                "INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id " .
59
+        $result = $this->db->query("SELECT module_package.id, module_package.product_id, module_package_group.group_name AS ".$this->db->quoteIdentifier('group').", module_package_plan.plan, module_package_plan.plan_index, module_package_group.id AS group_id ".
60
+                "FROM module_package ".
61
+                "INNER JOIN module_package_group ON module_package.module_package_group_id = module_package_group.id ".
62
+                "INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ".
63 63
                 "WHERE module_package.id = ".$this->db->quote($this->id, 'integer'));
64 64
 
65 65
         if (PEAR::isError($result)) {
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
             $id = intval($id);
94 94
         }
95 95
 
96
-        $result = $this->db->query("SELECT id, module, limiter " .
97
-                "FROM module_package_module " .
96
+        $result = $this->db->query("SELECT id, module, limiter ".
97
+                "FROM module_package_module ".
98 98
                 "WHERE module_package_module.module_package_id = ".$this->db->quote($id, 'integer'));
99 99
 
100 100
         if (PEAR::isError($result)) {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                 $return_limiters[$i] = $_limiter[$module][$limiter];
150 150
                 $return_limiters[$i]['limiter'] = $limiter;
151 151
                 $return_limiters[$i]['limit'] = $limit;
152
-                switch($return_limiters[$i]['limit_type']) {
152
+                switch ($return_limiters[$i]['limit_type']) {
153 153
                     case 'file_size':
154 154
                         $return_limiters[$i]['limit_readable'] = filesize_readable($limit);
155 155
                         break;
Please login to merge, or discard this patch.
src/Intraface/modules/modulepackage/include_front.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     } else {
22 22
         foreach ($list AS $key => $module) {
23 23
             // check whether there is any expering within a month and if there is no other packages comming up in the same group.
24
-            if (strtotime($module['end_date']) < strtotime('+1 month') && (!isset($list[$key+1]) || $module['group'] != $list[$key+1]['group'])) {
24
+            if (strtotime($module['end_date']) < strtotime('+1 month') && (!isset($list[$key + 1]) || $module['group'] != $list[$key + 1]['group'])) {
25 25
                 $_advice[] = array(
26 26
                     'msg' => 'You have modules that expire within a month! Click here to extend the modules now to keep the functionality of your intranet',
27 27
                     'link' => $this->url('module/modulepackage'),
Please login to merge, or discard this patch.
src/Intraface/modules/modulepackage/Controller/Postform.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
             $this->body('amount'),
28 28
             $this->body('currency'),
29 29
             $language,
30
-            NET_SCHEME . NET_HOST. $this->url('../', array('status' => 'success')),
31
-            NET_SCHEME . NET_HOST. $this->url('../payment', array('action_store_identifier' => $this->body('action_store_identifier'), 'payment_error' => 'true')),
32
-            NET_SCHEME . NET_HOST. $this->url('/process', array('action_store_identifier' => $this->body('action_store_identifier'))),
30
+            NET_SCHEME.NET_HOST.$this->url('../', array('status' => 'success')),
31
+            NET_SCHEME.NET_HOST.$this->url('../payment', array('action_store_identifier' => $this->body('action_store_identifier'), 'payment_error' => 'true')),
32
+            NET_SCHEME.NET_HOST.$this->url('/process', array('action_store_identifier' => $this->body('action_store_identifier'))),
33 33
             $this->query(),
34 34
             $this->body()
35 35
         );
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         if (substr($url, 0, 7) != 'http://' && substr($url, 0, 8) != 'https://') {
40 40
             $form_action = '';
41
-        }  else {
41
+        } else {
42 42
             $form_action = $url;
43 43
         }
44 44
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             'form_action' => $form_action,
48 48
             'language' => $language);
49 49
 
50
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/postform');
50
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/postform');
51 51
         return $tpl->render($this, $data);
52 52
     }
53 53
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
         if (substr($url, 0, 7) != 'http://' && substr($url, 0, 8) != 'https://') {
40 40
             $form_action = '';
41
-        }  else {
41
+        } else {
42 42
             $form_action = $url;
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/Intraface/modules/modulepackage/Controller/Index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         $packages = $modulepackagemanager->getList();
51 51
 
52 52
         $data = array('packages' => $packages, 'modulepackagemanager' => $modulepackagemanager);
53
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/index');
53
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/index');
54 54
         return $tpl->render($this, $data);
55 55
     }
56 56
 
Please login to merge, or discard this patch.
src/Intraface/modules/modulepackage/Controller/AddPackage.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         $modulepackageshop = new Intraface_modules_modulepackage_ShopExtension();
32 32
 
33 33
         $data = array(
34
-        	'modulepackagemanager' => $this->modulepackagemanager,
34
+            'modulepackagemanager' => $this->modulepackagemanager,
35 35
             'add_type' => $add_type,
36 36
             'modulepackageshop' => $modulepackageshop,
37 37
             'modulepackage' => $this->modulepackage,
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             'modulepackageshop' => $modulepackageshop,
37 37
             'modulepackage' => $this->modulepackage,
38 38
             'kernel' => $this->getKernel());
39
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/add-package');
39
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/add-package');
40 40
         return $tpl->render($this, $data);
41 41
     }
42 42
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 $this->modulepackagemanager->error->set('You need to accept the conditions of sale and use');
59 59
             } else {
60 60
                 // we are now ready to create the order.
61
-                switch($add_type) {
61
+                switch ($add_type) {
62 62
                     case 'add':
63 63
                         $action = $this->modulepackagemanager->add($this->modulepackage, (int)$_POST['duration_month'].' month');
64 64
                         break;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                         if ($this->getKernel()->intranet->address->get('name') != $this->getKernel()->user->getAddress()->get('name')) {
88 88
                             $contact['contactperson'] = $this->getKernel()->user->getAddress()->get('name');
89 89
                             $contact['contactemail'] = $this->getKernel()->user->getAddress()->get('email');
90
-                            $contact['contactphone'] =  $this->getKernel()->user->getAddress()->get('phone');
90
+                            $contact['contactphone'] = $this->getKernel()->user->getAddress()->get('phone');
91 91
                         }
92 92
 
93 93
                         // We add the contact_id. But notice, despite of the bad naming the contact_id is the contact_id in the intranet_maintenance intranet!
Please login to merge, or discard this patch.