@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/product/property', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/product/property', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Product\Property; |
12 | 12 | |
13 | -sprintf( 'type/product/property' ); // for translation |
|
13 | +sprintf('type/product/property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'product/property/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'product/property/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'product/property/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'product/property/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['product.property.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'product/property/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'product/property/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/product/property', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/product/property', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'product/property/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'product/property/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'product/property/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'product/property/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/product/property', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/product/property', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/product/property' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'product/property/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/product/property'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'product/property/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/type/product/property/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/product/property/template-list'; |
327 | 327 | $default = 'type/product/property/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $liststype, $name = null ) |
|
340 | + public function getSubClient($liststype, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/product/property/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the list type JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/type/product/property/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/product/property/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/product/property' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/product/property' . $liststype, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2017.10 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/product/property/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/product/property/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Common\Item\Type\Iface New list type item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'product/property/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'product/property/type'); |
|
473 | 473 | |
474 | - if( isset( $data['product.property.type.id'] ) && $data['product.property.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['product.property.type.id'] ); |
|
474 | + if (isset($data['product.property.type.id']) && $data['product.property.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['product.property.type.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['product.property.type.code'] = $data['product.property.type.code'] . '_copy'; |
499 | 499 | $data['product.property.type.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/type/product/property/template-item |
515 | 515 | * Relative path to the HTML body template for the list type item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/type/product/property/template-item'; |
534 | 534 | $default = 'type/product/property/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -88,14 +88,12 @@ discard block |
||
88 | 88 | $view->tabindex = ++$idx + 1; |
89 | 89 | $view->itemBody .= $client->copy(); |
90 | 90 | } |
91 | - } |
|
92 | - catch( \Aimeos\MShop\Exception $e ) |
|
91 | + } catch( \Aimeos\MShop\Exception $e ) |
|
93 | 92 | { |
94 | 93 | $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
95 | 94 | $view->errors = $view->get( 'errors', [] ) + $error; |
96 | 95 | $this->logException( $e ); |
97 | - } |
|
98 | - catch( \Exception $e ) |
|
96 | + } catch( \Exception $e ) |
|
99 | 97 | { |
100 | 98 | $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
101 | 99 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -137,14 +135,12 @@ discard block |
||
137 | 135 | $view->tabindex = ++$idx + 1; |
138 | 136 | $view->itemBody .= $client->create(); |
139 | 137 | } |
140 | - } |
|
141 | - catch( \Aimeos\MShop\Exception $e ) |
|
138 | + } catch( \Aimeos\MShop\Exception $e ) |
|
142 | 139 | { |
143 | 140 | $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
144 | 141 | $view->errors = $view->get( 'errors', [] ) + $error; |
145 | 142 | $this->logException( $e ); |
146 | - } |
|
147 | - catch( \Exception $e ) |
|
143 | + } catch( \Exception $e ) |
|
148 | 144 | { |
149 | 145 | $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
150 | 146 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -185,14 +181,12 @@ discard block |
||
185 | 181 | |
186 | 182 | $this->nextAction( $view, 'search', 'type/product', null, 'delete' ); |
187 | 183 | return; |
188 | - } |
|
189 | - catch( \Aimeos\MShop\Exception $e ) |
|
184 | + } catch( \Aimeos\MShop\Exception $e ) |
|
190 | 185 | { |
191 | 186 | $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
192 | 187 | $view->errors = $view->get( 'errors', [] ) + $error; |
193 | 188 | $this->logException( $e ); |
194 | - } |
|
195 | - catch( \Exception $e ) |
|
189 | + } catch( \Exception $e ) |
|
196 | 190 | { |
197 | 191 | $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
198 | 192 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -233,14 +227,12 @@ discard block |
||
233 | 227 | $view->tabindex = ++$idx + 1; |
234 | 228 | $view->itemBody .= $client->get(); |
235 | 229 | } |
236 | - } |
|
237 | - catch( \Aimeos\MShop\Exception $e ) |
|
230 | + } catch( \Aimeos\MShop\Exception $e ) |
|
238 | 231 | { |
239 | 232 | $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
240 | 233 | $view->errors = $view->get( 'errors', [] ) + $error; |
241 | 234 | $this->logException( $e ); |
242 | - } |
|
243 | - catch( \Exception $e ) |
|
235 | + } catch( \Exception $e ) |
|
244 | 236 | { |
245 | 237 | $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
246 | 238 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -277,18 +269,15 @@ discard block |
||
277 | 269 | |
278 | 270 | $this->nextAction( $view, $view->param( 'next' ), 'type/product', $view->item->getId(), 'save' ); |
279 | 271 | return; |
280 | - } |
|
281 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
272 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
282 | 273 | { |
283 | 274 | // fall through to create |
284 | - } |
|
285 | - catch( \Aimeos\MShop\Exception $e ) |
|
275 | + } catch( \Aimeos\MShop\Exception $e ) |
|
286 | 276 | { |
287 | 277 | $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
288 | 278 | $view->errors = $view->get( 'errors', [] ) + $error; |
289 | 279 | $this->logException( $e ); |
290 | - } |
|
291 | - catch( \Exception $e ) |
|
280 | + } catch( \Exception $e ) |
|
292 | 281 | { |
293 | 282 | $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
294 | 283 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -327,14 +316,12 @@ discard block |
||
327 | 316 | foreach( $this->getSubClients() as $client ) { |
328 | 317 | $view->itemBody .= $client->search(); |
329 | 318 | } |
330 | - } |
|
331 | - catch( \Aimeos\MShop\Exception $e ) |
|
319 | + } catch( \Aimeos\MShop\Exception $e ) |
|
332 | 320 | { |
333 | 321 | $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
334 | 322 | $view->errors = $view->get( 'errors', [] ) + $error; |
335 | 323 | $this->logException( $e ); |
336 | - } |
|
337 | - catch( \Exception $e ) |
|
324 | + } catch( \Exception $e ) |
|
338 | 325 | { |
339 | 326 | $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
340 | 327 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Product; |
12 | 12 | |
13 | -sprintf( 'type/product' ); // for translation |
|
13 | +sprintf('type/product'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'product/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'product/type'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'product/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'product/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['product.type.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'product/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'product/type'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'type/product', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/product', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'product/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'product/type'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'product/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'product/type'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'type/product', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/product', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'type/product' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'product/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/product'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'product/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/type/product/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/product/template-list'; |
327 | 327 | $default = 'type/product/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $type, $name = null ) |
|
340 | + public function getSubClient($type, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/product/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the type JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/type/product/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/product/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/product' . $type, $name ); |
|
415 | + return $this->createSubClient('type/product' . $type, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2017.10 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/product/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/product/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Common\Item\Type\Iface New type item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'product/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'product/type'); |
|
473 | 473 | |
474 | - if( isset( $data['product.type.id'] ) && $data['product.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['product.type.id'] ); |
|
474 | + if (isset($data['product.type.id']) && $data['product.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['product.type.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['product.type.code'] = $data['product.type.code'] . '_copy'; |
499 | 499 | $data['product.type.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/type/product/template-item |
515 | 515 | * Relative path to the HTML body template for the type item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/type/product/template-item'; |
534 | 534 | $default = 'type/product/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -235,14 +235,12 @@ discard block |
||
235 | 235 | $view->tabindex = ++$idx + 1; |
236 | 236 | $view->itemBody .= $client->copy(); |
237 | 237 | } |
238 | - } |
|
239 | - catch( \Aimeos\MShop\Exception $e ) |
|
238 | + } catch( \Aimeos\MShop\Exception $e ) |
|
240 | 239 | { |
241 | 240 | $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
242 | 241 | $view->errors = $view->get( 'errors', [] ) + $error; |
243 | 242 | $this->logException( $e ); |
244 | - } |
|
245 | - catch( \Exception $e ) |
|
243 | + } catch( \Exception $e ) |
|
246 | 244 | { |
247 | 245 | $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
248 | 246 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -285,14 +283,12 @@ discard block |
||
285 | 283 | $view->tabindex = ++$idx + 1; |
286 | 284 | $view->itemBody .= $client->create(); |
287 | 285 | } |
288 | - } |
|
289 | - catch( \Aimeos\MShop\Exception $e ) |
|
286 | + } catch( \Aimeos\MShop\Exception $e ) |
|
290 | 287 | { |
291 | 288 | $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
292 | 289 | $view->errors = $view->get( 'errors', [] ) + $error; |
293 | 290 | $this->logException( $e ); |
294 | - } |
|
295 | - catch( \Exception $e ) |
|
291 | + } catch( \Exception $e ) |
|
296 | 292 | { |
297 | 293 | $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
298 | 294 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -333,14 +329,12 @@ discard block |
||
333 | 329 | |
334 | 330 | $this->nextAction( $view, 'search', 'product', null, 'delete' ); |
335 | 331 | return; |
336 | - } |
|
337 | - catch( \Aimeos\MShop\Exception $e ) |
|
332 | + } catch( \Aimeos\MShop\Exception $e ) |
|
338 | 333 | { |
339 | 334 | $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
340 | 335 | $view->errors = $view->get( 'errors', [] ) + $error; |
341 | 336 | $this->logException( $e ); |
342 | - } |
|
343 | - catch( \Exception $e ) |
|
337 | + } catch( \Exception $e ) |
|
344 | 338 | { |
345 | 339 | $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
346 | 340 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -382,14 +376,12 @@ discard block |
||
382 | 376 | $view->tabindex = ++$idx + 1; |
383 | 377 | $view->itemBody .= $client->get(); |
384 | 378 | } |
385 | - } |
|
386 | - catch( \Aimeos\MShop\Exception $e ) |
|
379 | + } catch( \Aimeos\MShop\Exception $e ) |
|
387 | 380 | { |
388 | 381 | $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
389 | 382 | $view->errors = $view->get( 'errors', [] ) + $error; |
390 | 383 | $this->logException( $e ); |
391 | - } |
|
392 | - catch( \Exception $e ) |
|
384 | + } catch( \Exception $e ) |
|
393 | 385 | { |
394 | 386 | $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
395 | 387 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -426,18 +418,15 @@ discard block |
||
426 | 418 | |
427 | 419 | $this->nextAction( $view, $view->param( 'next' ), 'product', $view->item->getId(), 'save' ); |
428 | 420 | return; |
429 | - } |
|
430 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
421 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
431 | 422 | { |
432 | 423 | // fall through to create |
433 | - } |
|
434 | - catch( \Aimeos\MShop\Exception $e ) |
|
424 | + } catch( \Aimeos\MShop\Exception $e ) |
|
435 | 425 | { |
436 | 426 | $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
437 | 427 | $view->errors = $view->get( 'errors', [] ) + $error; |
438 | 428 | $this->logException( $e ); |
439 | - } |
|
440 | - catch( \Exception $e ) |
|
429 | + } catch( \Exception $e ) |
|
441 | 430 | { |
442 | 431 | $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
443 | 432 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -477,14 +466,12 @@ discard block |
||
477 | 466 | foreach( $this->getSubClients() as $client ) { |
478 | 467 | $view->itemBody .= $client->search(); |
479 | 468 | } |
480 | - } |
|
481 | - catch( \Aimeos\MShop\Exception $e ) |
|
469 | + } catch( \Aimeos\MShop\Exception $e ) |
|
482 | 470 | { |
483 | 471 | $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
484 | 472 | $view->errors = $view->get( 'errors', [] ) + $error; |
485 | 473 | $this->logException( $e ); |
486 | - } |
|
487 | - catch( \Exception $e ) |
|
474 | + } catch( \Exception $e ) |
|
488 | 475 | { |
489 | 476 | $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
490 | 477 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Product; |
12 | 12 | |
13 | -sprintf( 'product' ); // for translation |
|
13 | +sprintf('product'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,38 +35,38 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'product' ); |
|
43 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'product'); |
|
43 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemTypes = $this->getTypeItems(); |
48 | 48 | $view->itemBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $idx => $client ) |
|
50 | + foreach ($this->getSubClients() as $idx => $client) |
|
51 | 51 | { |
52 | 52 | $view->tabindex = ++$idx + 1; |
53 | 53 | $view->itemBody .= $client->copy(); |
54 | 54 | } |
55 | 55 | } |
56 | - catch( \Aimeos\MShop\Exception $e ) |
|
56 | + catch (\Aimeos\MShop\Exception $e) |
|
57 | 57 | { |
58 | - $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
59 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
60 | - $this->logException( $e ); |
|
58 | + $error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
59 | + $view->errors = $view->get('errors', []) + $error; |
|
60 | + $this->logException($e); |
|
61 | 61 | } |
62 | - catch( \Exception $e ) |
|
62 | + catch (\Exception $e) |
|
63 | 63 | { |
64 | - $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
65 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
66 | - $this->logException( $e ); |
|
64 | + $error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
65 | + $view->errors = $view->get('errors', []) + $error; |
|
66 | + $this->logException($e); |
|
67 | 67 | } |
68 | 68 | |
69 | - return $this->render( $view ); |
|
69 | + return $this->render($view); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | |
83 | 83 | try |
84 | 84 | { |
85 | - $data = $view->param( 'item', [] ); |
|
85 | + $data = $view->param('item', []); |
|
86 | 86 | |
87 | - if( !isset( $view->item ) ) { |
|
88 | - $view->item = \Aimeos\MShop::create( $context, 'product' )->createItem(); |
|
87 | + if (!isset($view->item)) { |
|
88 | + $view->item = \Aimeos\MShop::create($context, 'product')->createItem(); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $data['product.siteid'] = $view->item->getSiteId(); |
@@ -95,26 +95,26 @@ discard block |
||
95 | 95 | $view->itemData = $data; |
96 | 96 | $view->itemBody = ''; |
97 | 97 | |
98 | - foreach( $this->getSubClients() as $idx => $client ) |
|
98 | + foreach ($this->getSubClients() as $idx => $client) |
|
99 | 99 | { |
100 | 100 | $view->tabindex = ++$idx + 1; |
101 | 101 | $view->itemBody .= $client->create(); |
102 | 102 | } |
103 | 103 | } |
104 | - catch( \Aimeos\MShop\Exception $e ) |
|
104 | + catch (\Aimeos\MShop\Exception $e) |
|
105 | 105 | { |
106 | - $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
107 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
108 | - $this->logException( $e ); |
|
106 | + $error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
107 | + $view->errors = $view->get('errors', []) + $error; |
|
108 | + $this->logException($e); |
|
109 | 109 | } |
110 | - catch( \Exception $e ) |
|
110 | + catch (\Exception $e) |
|
111 | 111 | { |
112 | - $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
113 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
114 | - $this->logException( $e ); |
|
112 | + $error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
113 | + $view->errors = $view->get('errors', []) + $error; |
|
114 | + $this->logException($e); |
|
115 | 115 | } |
116 | 116 | |
117 | - return $this->render( $view ); |
|
117 | + return $this->render($view); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | |
@@ -128,39 +128,39 @@ discard block |
||
128 | 128 | $view = $this->getView(); |
129 | 129 | $context = $this->getContext(); |
130 | 130 | |
131 | - $manager = \Aimeos\MShop::create( $context, 'product' ); |
|
131 | + $manager = \Aimeos\MShop::create($context, 'product'); |
|
132 | 132 | $manager->begin(); |
133 | 133 | |
134 | 134 | try |
135 | 135 | { |
136 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
137 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
136 | + if (($id = $view->param('id')) === null) { |
|
137 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
138 | 138 | } |
139 | 139 | |
140 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
140 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
141 | 141 | |
142 | - foreach( $this->getSubClients() as $client ) { |
|
142 | + foreach ($this->getSubClients() as $client) { |
|
143 | 143 | $client->delete(); |
144 | 144 | } |
145 | 145 | |
146 | - $manager->saveItem( $view->item ); |
|
147 | - $manager->deleteItem( $id ); |
|
146 | + $manager->saveItem($view->item); |
|
147 | + $manager->deleteItem($id); |
|
148 | 148 | $manager->commit(); |
149 | 149 | |
150 | - $this->nextAction( $view, 'search', 'product', null, 'delete' ); |
|
150 | + $this->nextAction($view, 'search', 'product', null, 'delete'); |
|
151 | 151 | return; |
152 | 152 | } |
153 | - catch( \Aimeos\MShop\Exception $e ) |
|
153 | + catch (\Aimeos\MShop\Exception $e) |
|
154 | 154 | { |
155 | - $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
156 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
157 | - $this->logException( $e ); |
|
155 | + $error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
156 | + $view->errors = $view->get('errors', []) + $error; |
|
157 | + $this->logException($e); |
|
158 | 158 | } |
159 | - catch( \Exception $e ) |
|
159 | + catch (\Exception $e) |
|
160 | 160 | { |
161 | - $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
162 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
163 | - $this->logException( $e ); |
|
161 | + $error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
162 | + $view->errors = $view->get('errors', []) + $error; |
|
163 | + $this->logException($e); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | $manager->rollback(); |
@@ -181,38 +181,38 @@ discard block |
||
181 | 181 | |
182 | 182 | try |
183 | 183 | { |
184 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
185 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
184 | + if (($id = $view->param('id')) === null) { |
|
185 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
186 | 186 | } |
187 | 187 | |
188 | - $manager = \Aimeos\MShop::create( $context, 'product' ); |
|
188 | + $manager = \Aimeos\MShop::create($context, 'product'); |
|
189 | 189 | |
190 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
190 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
191 | 191 | $view->itemSubparts = $this->getSubClientNames(); |
192 | - $view->itemData = $this->toArray( $view->item ); |
|
192 | + $view->itemData = $this->toArray($view->item); |
|
193 | 193 | $view->itemTypes = $this->getTypeItems(); |
194 | 194 | $view->itemBody = ''; |
195 | 195 | |
196 | - foreach( $this->getSubClients() as $idx => $client ) |
|
196 | + foreach ($this->getSubClients() as $idx => $client) |
|
197 | 197 | { |
198 | 198 | $view->tabindex = ++$idx + 1; |
199 | 199 | $view->itemBody .= $client->get(); |
200 | 200 | } |
201 | 201 | } |
202 | - catch( \Aimeos\MShop\Exception $e ) |
|
202 | + catch (\Aimeos\MShop\Exception $e) |
|
203 | 203 | { |
204 | - $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
205 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
206 | - $this->logException( $e ); |
|
204 | + $error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
205 | + $view->errors = $view->get('errors', []) + $error; |
|
206 | + $this->logException($e); |
|
207 | 207 | } |
208 | - catch( \Exception $e ) |
|
208 | + catch (\Exception $e) |
|
209 | 209 | { |
210 | - $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
211 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
212 | - $this->logException( $e ); |
|
210 | + $error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
211 | + $view->errors = $view->get('errors', []) + $error; |
|
212 | + $this->logException($e); |
|
213 | 213 | } |
214 | 214 | |
215 | - return $this->render( $view ); |
|
215 | + return $this->render($view); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | |
@@ -226,40 +226,40 @@ discard block |
||
226 | 226 | $view = $this->getView(); |
227 | 227 | $context = $this->getContext(); |
228 | 228 | |
229 | - $manager = \Aimeos\MShop::create( $context, 'product' ); |
|
229 | + $manager = \Aimeos\MShop::create($context, 'product'); |
|
230 | 230 | $manager->begin(); |
231 | 231 | |
232 | 232 | try |
233 | 233 | { |
234 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
235 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
234 | + $item = $this->fromArray($view->param('item', [])); |
|
235 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
236 | 236 | $view->itemBody = ''; |
237 | 237 | |
238 | - foreach( $this->getSubClients() as $client ) { |
|
238 | + foreach ($this->getSubClients() as $client) { |
|
239 | 239 | $view->itemBody .= $client->save(); |
240 | 240 | } |
241 | 241 | |
242 | - $manager->saveItem( clone $view->item ); |
|
242 | + $manager->saveItem(clone $view->item); |
|
243 | 243 | $manager->commit(); |
244 | 244 | |
245 | - $this->nextAction( $view, $view->param( 'next' ), 'product', $view->item->getId(), 'save' ); |
|
245 | + $this->nextAction($view, $view->param('next'), 'product', $view->item->getId(), 'save'); |
|
246 | 246 | return; |
247 | 247 | } |
248 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
248 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
249 | 249 | { |
250 | 250 | // fall through to create |
251 | 251 | } |
252 | - catch( \Aimeos\MShop\Exception $e ) |
|
252 | + catch (\Aimeos\MShop\Exception $e) |
|
253 | 253 | { |
254 | - $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
255 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
256 | - $this->logException( $e ); |
|
254 | + $error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
255 | + $view->errors = $view->get('errors', []) + $error; |
|
256 | + $this->logException($e); |
|
257 | 257 | } |
258 | - catch( \Exception $e ) |
|
258 | + catch (\Exception $e) |
|
259 | 259 | { |
260 | - $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
261 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
262 | - $this->logException( $e ); |
|
260 | + $error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
261 | + $view->errors = $view->get('errors', []) + $error; |
|
262 | + $this->logException($e); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | $manager->rollback(); |
@@ -281,35 +281,35 @@ discard block |
||
281 | 281 | try |
282 | 282 | { |
283 | 283 | $total = 0; |
284 | - $params = $this->storeSearchParams( $view->param(), 'product' ); |
|
285 | - $manager = \Aimeos\MShop::create( $context, 'product' ); |
|
284 | + $params = $this->storeSearchParams($view->param(), 'product'); |
|
285 | + $manager = \Aimeos\MShop::create($context, 'product'); |
|
286 | 286 | |
287 | 287 | $search = $manager->createSearch(); |
288 | - $search->setSortations( [$search->sort( '+', 'product.id')] ); |
|
289 | - $search = $this->initCriteria( $search, $params ); |
|
288 | + $search->setSortations([$search->sort('+', 'product.id')]); |
|
289 | + $search = $this->initCriteria($search, $params); |
|
290 | 290 | |
291 | - $view->items = $manager->searchItems( $search, array_diff( $this->getDomains(), ['product'] ), $total ); |
|
292 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
291 | + $view->items = $manager->searchItems($search, array_diff($this->getDomains(), ['product']), $total); |
|
292 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
293 | 293 | $view->filterOperators = $search->getOperators(); |
294 | 294 | $view->itemTypes = $this->getTypeItems(); |
295 | 295 | $view->total = $total; |
296 | 296 | $view->itemBody = ''; |
297 | 297 | |
298 | - foreach( $this->getSubClients() as $client ) { |
|
298 | + foreach ($this->getSubClients() as $client) { |
|
299 | 299 | $view->itemBody .= $client->search(); |
300 | 300 | } |
301 | 301 | } |
302 | - catch( \Aimeos\MShop\Exception $e ) |
|
302 | + catch (\Aimeos\MShop\Exception $e) |
|
303 | 303 | { |
304 | - $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
305 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
306 | - $this->logException( $e ); |
|
304 | + $error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
305 | + $view->errors = $view->get('errors', []) + $error; |
|
306 | + $this->logException($e); |
|
307 | 307 | } |
308 | - catch( \Exception $e ) |
|
308 | + catch (\Exception $e) |
|
309 | 309 | { |
310 | - $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
311 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
312 | - $this->logException( $e ); |
|
310 | + $error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
311 | + $view->errors = $view->get('errors', []) + $error; |
|
312 | + $this->logException($e); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** admin/jqadm/product/template-list |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $tplconf = 'admin/jqadm/product/template-list'; |
335 | 335 | $default = 'product/list-standard'; |
336 | 336 | |
337 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
337 | + return $view->render($view->config($tplconf, $default)); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | * @param string|null $name Name of the sub-client (Default if null) |
346 | 346 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
347 | 347 | */ |
348 | - public function getSubClient( $type, $name = null ) |
|
348 | + public function getSubClient($type, $name = null) |
|
349 | 349 | { |
350 | 350 | /** admin/jqadm/product/decorators/excludes |
351 | 351 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | * @see admin/jqadm/product/decorators/excludes |
421 | 421 | * @see admin/jqadm/product/decorators/global |
422 | 422 | */ |
423 | - return $this->createSubClient( 'product/' . $type, $name ); |
|
423 | + return $this->createSubClient('product/' . $type, $name); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | |
@@ -442,9 +442,9 @@ discard block |
||
442 | 442 | * @since 2016.01 |
443 | 443 | * @category Developer |
444 | 444 | */ |
445 | - $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ); |
|
445 | + $domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text'); |
|
446 | 446 | |
447 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/domains', $domains ); |
|
447 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/domains', $domains); |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | * @since 2016.01 |
489 | 489 | * @category Developer |
490 | 490 | */ |
491 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/standard/subparts', [] ); |
|
491 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/standard/subparts', []); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | |
@@ -499,12 +499,12 @@ discard block |
||
499 | 499 | */ |
500 | 500 | protected function getTypeItems() |
501 | 501 | { |
502 | - $typeManager = \Aimeos\MShop::create( $this->getContext(), 'product/type' ); |
|
502 | + $typeManager = \Aimeos\MShop::create($this->getContext(), 'product/type'); |
|
503 | 503 | |
504 | 504 | $search = $typeManager->createSearch(); |
505 | - $search->setSortations( array( $search->sort( '+', 'product.type.label' ) ) ); |
|
505 | + $search->setSortations(array($search->sort('+', 'product.type.label'))); |
|
506 | 506 | |
507 | - return $typeManager->searchItems( $search ); |
|
507 | + return $typeManager->searchItems($search); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | |
@@ -514,30 +514,30 @@ discard block |
||
514 | 514 | * @param string[] Data array |
515 | 515 | * @return \Aimeos\MShop\Product\Item\Iface New product item object |
516 | 516 | */ |
517 | - protected function fromArray( array $data ) |
|
517 | + protected function fromArray(array $data) |
|
518 | 518 | { |
519 | 519 | $conf = []; |
520 | 520 | |
521 | - if( isset( $data['config']['key'] ) ) |
|
521 | + if (isset($data['config']['key'])) |
|
522 | 522 | { |
523 | - foreach( (array) $data['config']['key'] as $idx => $key ) |
|
523 | + foreach ((array) $data['config']['key'] as $idx => $key) |
|
524 | 524 | { |
525 | - if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) { |
|
525 | + if (trim($key) !== '' && isset($data['config']['val'][$idx])) { |
|
526 | 526 | $conf[$key] = $data['config']['val'][$idx]; |
527 | 527 | } |
528 | 528 | } |
529 | 529 | } |
530 | 530 | |
531 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'product' ); |
|
531 | + $manager = \Aimeos\MShop::create($this->getContext(), 'product'); |
|
532 | 532 | |
533 | - if( isset( $data['product.id'] ) && $data['product.id'] != '' ) { |
|
534 | - $item = $manager->getItem( $data['product.id'], $this->getDomains() ); |
|
533 | + if (isset($data['product.id']) && $data['product.id'] != '') { |
|
534 | + $item = $manager->getItem($data['product.id'], $this->getDomains()); |
|
535 | 535 | } else { |
536 | 536 | $item = $manager->createItem(); |
537 | 537 | } |
538 | 538 | |
539 | - $item->fromArray( $data ); |
|
540 | - $item->setConfig( $conf ); |
|
539 | + $item->fromArray($data); |
|
540 | + $item->setConfig($conf); |
|
541 | 541 | |
542 | 542 | return $item; |
543 | 543 | } |
@@ -549,19 +549,19 @@ discard block |
||
549 | 549 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object |
550 | 550 | * @return string[] Multi-dimensional associative list of item data |
551 | 551 | */ |
552 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
552 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
553 | 553 | { |
554 | - $data = $item->toArray( true ); |
|
554 | + $data = $item->toArray(true); |
|
555 | 555 | $data['config'] = []; |
556 | 556 | |
557 | - if( $copy === true ) |
|
557 | + if ($copy === true) |
|
558 | 558 | { |
559 | 559 | $data['product.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
560 | 560 | $data['product.code'] = $data['product.code'] . '_copy'; |
561 | 561 | $data['product.id'] = ''; |
562 | 562 | } |
563 | 563 | |
564 | - foreach( $item->getConfig() as $key => $value ) |
|
564 | + foreach ($item->getConfig() as $key => $value) |
|
565 | 565 | { |
566 | 566 | $data['config']['key'][] = $key; |
567 | 567 | $data['config']['val'][] = $value; |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
578 | 578 | * @return string HTML output |
579 | 579 | */ |
580 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
580 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
581 | 581 | { |
582 | 582 | /** admin/jqadm/product/template-item |
583 | 583 | * Relative path to the HTML body template for the product item. |
@@ -601,6 +601,6 @@ discard block |
||
601 | 601 | $tplconf = 'admin/jqadm/product/template-item'; |
602 | 602 | $default = 'product/item-standard'; |
603 | 603 | |
604 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
604 | + return $view->render($view->config($tplconf, $default)); |
|
605 | 605 | } |
606 | 606 | } |
@@ -90,14 +90,12 @@ discard block |
||
90 | 90 | $view->tabindex = ++$idx + 1; |
91 | 91 | $view->itemBody .= $client->copy(); |
92 | 92 | } |
93 | - } |
|
94 | - catch( \Aimeos\MShop\Exception $e ) |
|
93 | + } catch( \Aimeos\MShop\Exception $e ) |
|
95 | 94 | { |
96 | 95 | $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
97 | 96 | $view->errors = $view->get( 'errors', [] ) + $error; |
98 | 97 | $this->logException( $e ); |
99 | - } |
|
100 | - catch( \Exception $e ) |
|
98 | + } catch( \Exception $e ) |
|
101 | 99 | { |
102 | 100 | $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
103 | 101 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -141,14 +139,12 @@ discard block |
||
141 | 139 | $view->tabindex = ++$idx + 1; |
142 | 140 | $view->itemBody .= $client->create(); |
143 | 141 | } |
144 | - } |
|
145 | - catch( \Aimeos\MShop\Exception $e ) |
|
142 | + } catch( \Aimeos\MShop\Exception $e ) |
|
146 | 143 | { |
147 | 144 | $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
148 | 145 | $view->errors = $view->get( 'errors', [] ) + $error; |
149 | 146 | $this->logException( $e ); |
150 | - } |
|
151 | - catch( \Exception $e ) |
|
147 | + } catch( \Exception $e ) |
|
152 | 148 | { |
153 | 149 | $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
154 | 150 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -189,14 +185,12 @@ discard block |
||
189 | 185 | |
190 | 186 | $this->nextAction( $view, 'search', 'locale', null, 'delete' ); |
191 | 187 | return; |
192 | - } |
|
193 | - catch( \Aimeos\MShop\Exception $e ) |
|
188 | + } catch( \Aimeos\MShop\Exception $e ) |
|
194 | 189 | { |
195 | 190 | $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
196 | 191 | $view->errors = $view->get( 'errors', [] ) + $error; |
197 | 192 | $this->logException( $e ); |
198 | - } |
|
199 | - catch( \Exception $e ) |
|
193 | + } catch( \Exception $e ) |
|
200 | 194 | { |
201 | 195 | $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
202 | 196 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -239,14 +233,12 @@ discard block |
||
239 | 233 | $view->tabindex = ++$idx + 1; |
240 | 234 | $view->itemBody .= $client->get(); |
241 | 235 | } |
242 | - } |
|
243 | - catch( \Aimeos\MShop\Exception $e ) |
|
236 | + } catch( \Aimeos\MShop\Exception $e ) |
|
244 | 237 | { |
245 | 238 | $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
246 | 239 | $view->errors = $view->get( 'errors', [] ) + $error; |
247 | 240 | $this->logException( $e ); |
248 | - } |
|
249 | - catch( \Exception $e ) |
|
241 | + } catch( \Exception $e ) |
|
250 | 242 | { |
251 | 243 | $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
252 | 244 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -283,18 +275,15 @@ discard block |
||
283 | 275 | |
284 | 276 | $this->nextAction( $view, $view->param( 'next' ), 'locale', $view->item->getId(), 'save' ); |
285 | 277 | return; |
286 | - } |
|
287 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
278 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
288 | 279 | { |
289 | 280 | // fall through to create |
290 | - } |
|
291 | - catch( \Aimeos\MShop\Exception $e ) |
|
281 | + } catch( \Aimeos\MShop\Exception $e ) |
|
292 | 282 | { |
293 | 283 | $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
294 | 284 | $view->errors = $view->get( 'errors', [] ) + $error; |
295 | 285 | $this->logException( $e ); |
296 | - } |
|
297 | - catch( \Exception $e ) |
|
286 | + } catch( \Exception $e ) |
|
298 | 287 | { |
299 | 288 | $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
300 | 289 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -333,14 +322,12 @@ discard block |
||
333 | 322 | foreach( $this->getSubClients() as $client ) { |
334 | 323 | $view->itemBody .= $client->search(); |
335 | 324 | } |
336 | - } |
|
337 | - catch( \Aimeos\MShop\Exception $e ) |
|
325 | + } catch( \Aimeos\MShop\Exception $e ) |
|
338 | 326 | { |
339 | 327 | $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
340 | 328 | $view->errors = $view->get( 'errors', [] ) + $error; |
341 | 329 | $this->logException( $e ); |
342 | - } |
|
343 | - catch( \Exception $e ) |
|
330 | + } catch( \Exception $e ) |
|
344 | 331 | { |
345 | 332 | $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
346 | 333 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Locale; |
12 | 12 | |
13 | -sprintf( 'locale' ); // for translation |
|
13 | +sprintf('locale'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,39 +35,39 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'locale' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'locale'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemCurrencies = $this->getCurrencyItems(); |
48 | 48 | $view->itemLanguages = $this->getLanguageItems(); |
49 | 49 | $view->itemBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $idx => $client ) |
|
51 | + foreach ($this->getSubClients() as $idx => $client) |
|
52 | 52 | { |
53 | 53 | $view->tabindex = ++$idx + 1; |
54 | 54 | $view->itemBody .= $client->copy(); |
55 | 55 | } |
56 | 56 | } |
57 | - catch( \Aimeos\MShop\Exception $e ) |
|
57 | + catch (\Aimeos\MShop\Exception $e) |
|
58 | 58 | { |
59 | - $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
60 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
61 | - $this->logException( $e ); |
|
59 | + $error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
60 | + $view->errors = $view->get('errors', []) + $error; |
|
61 | + $this->logException($e); |
|
62 | 62 | } |
63 | - catch( \Exception $e ) |
|
63 | + catch (\Exception $e) |
|
64 | 64 | { |
65 | - $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
66 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
67 | - $this->logException( $e ); |
|
65 | + $error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
66 | + $view->errors = $view->get('errors', []) + $error; |
|
67 | + $this->logException($e); |
|
68 | 68 | } |
69 | 69 | |
70 | - return $this->render( $view ); |
|
70 | + return $this->render($view); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | |
84 | 84 | try |
85 | 85 | { |
86 | - $data = $view->param( 'item', [] ); |
|
86 | + $data = $view->param('item', []); |
|
87 | 87 | |
88 | - if( !isset( $view->item ) ) { |
|
89 | - $view->item = \Aimeos\MShop::create( $context, 'locale' )->createItem(); |
|
88 | + if (!isset($view->item)) { |
|
89 | + $view->item = \Aimeos\MShop::create($context, 'locale')->createItem(); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $data['locale.siteid'] = $view->item->getSiteId(); |
@@ -97,26 +97,26 @@ discard block |
||
97 | 97 | $view->itemData = $data; |
98 | 98 | $view->itemBody = ''; |
99 | 99 | |
100 | - foreach( $this->getSubClients() as $idx => $client ) |
|
100 | + foreach ($this->getSubClients() as $idx => $client) |
|
101 | 101 | { |
102 | 102 | $view->tabindex = ++$idx + 1; |
103 | 103 | $view->itemBody .= $client->create(); |
104 | 104 | } |
105 | 105 | } |
106 | - catch( \Aimeos\MShop\Exception $e ) |
|
106 | + catch (\Aimeos\MShop\Exception $e) |
|
107 | 107 | { |
108 | - $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
109 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
110 | - $this->logException( $e ); |
|
108 | + $error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
109 | + $view->errors = $view->get('errors', []) + $error; |
|
110 | + $this->logException($e); |
|
111 | 111 | } |
112 | - catch( \Exception $e ) |
|
112 | + catch (\Exception $e) |
|
113 | 113 | { |
114 | - $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
115 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
116 | - $this->logException( $e ); |
|
114 | + $error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
115 | + $view->errors = $view->get('errors', []) + $error; |
|
116 | + $this->logException($e); |
|
117 | 117 | } |
118 | 118 | |
119 | - return $this->render( $view ); |
|
119 | + return $this->render($view); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
@@ -130,38 +130,38 @@ discard block |
||
130 | 130 | $view = $this->getView(); |
131 | 131 | $context = $this->getContext(); |
132 | 132 | |
133 | - $manager = \Aimeos\MShop::create( $context, 'locale' ); |
|
133 | + $manager = \Aimeos\MShop::create($context, 'locale'); |
|
134 | 134 | $manager->begin(); |
135 | 135 | |
136 | 136 | try |
137 | 137 | { |
138 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
139 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
138 | + if (($id = $view->param('id')) === null) { |
|
139 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
140 | 140 | } |
141 | 141 | |
142 | - $view->item = $manager->getItem( $id ); |
|
142 | + $view->item = $manager->getItem($id); |
|
143 | 143 | |
144 | - foreach( $this->getSubClients() as $client ) { |
|
144 | + foreach ($this->getSubClients() as $client) { |
|
145 | 145 | $client->delete(); |
146 | 146 | } |
147 | 147 | |
148 | - $manager->deleteItem( $id ); |
|
148 | + $manager->deleteItem($id); |
|
149 | 149 | $manager->commit(); |
150 | 150 | |
151 | - $this->nextAction( $view, 'search', 'locale', null, 'delete' ); |
|
151 | + $this->nextAction($view, 'search', 'locale', null, 'delete'); |
|
152 | 152 | return; |
153 | 153 | } |
154 | - catch( \Aimeos\MShop\Exception $e ) |
|
154 | + catch (\Aimeos\MShop\Exception $e) |
|
155 | 155 | { |
156 | - $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
157 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
158 | - $this->logException( $e ); |
|
156 | + $error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
157 | + $view->errors = $view->get('errors', []) + $error; |
|
158 | + $this->logException($e); |
|
159 | 159 | } |
160 | - catch( \Exception $e ) |
|
160 | + catch (\Exception $e) |
|
161 | 161 | { |
162 | - $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
163 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
164 | - $this->logException( $e ); |
|
162 | + $error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
163 | + $view->errors = $view->get('errors', []) + $error; |
|
164 | + $this->logException($e); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | $manager->rollback(); |
@@ -182,39 +182,39 @@ discard block |
||
182 | 182 | |
183 | 183 | try |
184 | 184 | { |
185 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
186 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
185 | + if (($id = $view->param('id')) === null) { |
|
186 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
187 | 187 | } |
188 | 188 | |
189 | - $manager = \Aimeos\MShop::create( $context, 'locale' ); |
|
189 | + $manager = \Aimeos\MShop::create($context, 'locale'); |
|
190 | 190 | |
191 | - $view->item = $manager->getItem( $id ); |
|
191 | + $view->item = $manager->getItem($id); |
|
192 | 192 | $view->itemSubparts = $this->getSubClientNames(); |
193 | - $view->itemData = $this->toArray( $view->item ); |
|
193 | + $view->itemData = $this->toArray($view->item); |
|
194 | 194 | $view->itemCurrencies = $this->getCurrencyItems(); |
195 | 195 | $view->itemLanguages = $this->getLanguageItems(); |
196 | 196 | $view->itemBody = ''; |
197 | 197 | |
198 | - foreach( $this->getSubClients() as $idx => $client ) |
|
198 | + foreach ($this->getSubClients() as $idx => $client) |
|
199 | 199 | { |
200 | 200 | $view->tabindex = ++$idx + 1; |
201 | 201 | $view->itemBody .= $client->get(); |
202 | 202 | } |
203 | 203 | } |
204 | - catch( \Aimeos\MShop\Exception $e ) |
|
204 | + catch (\Aimeos\MShop\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | - catch( \Exception $e ) |
|
210 | + catch (\Exception $e) |
|
211 | 211 | { |
212 | - $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
213 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
214 | - $this->logException( $e ); |
|
212 | + $error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
213 | + $view->errors = $view->get('errors', []) + $error; |
|
214 | + $this->logException($e); |
|
215 | 215 | } |
216 | 216 | |
217 | - return $this->render( $view ); |
|
217 | + return $this->render($view); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | |
@@ -228,40 +228,40 @@ discard block |
||
228 | 228 | $view = $this->getView(); |
229 | 229 | $context = $this->getContext(); |
230 | 230 | |
231 | - $manager = \Aimeos\MShop::create( $context, 'locale' ); |
|
231 | + $manager = \Aimeos\MShop::create($context, 'locale'); |
|
232 | 232 | $manager->begin(); |
233 | 233 | |
234 | 234 | try |
235 | 235 | { |
236 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
237 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
236 | + $item = $this->fromArray($view->param('item', [])); |
|
237 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
238 | 238 | $view->itemBody = ''; |
239 | 239 | |
240 | - foreach( $this->getSubClients() as $client ) { |
|
240 | + foreach ($this->getSubClients() as $client) { |
|
241 | 241 | $view->itemBody .= $client->save(); |
242 | 242 | } |
243 | 243 | |
244 | - $manager->saveItem( $view->item ); |
|
244 | + $manager->saveItem($view->item); |
|
245 | 245 | $manager->commit(); |
246 | 246 | |
247 | - $this->nextAction( $view, $view->param( 'next' ), 'locale', $view->item->getId(), 'save' ); |
|
247 | + $this->nextAction($view, $view->param('next'), 'locale', $view->item->getId(), 'save'); |
|
248 | 248 | return; |
249 | 249 | } |
250 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
250 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
251 | 251 | { |
252 | 252 | // fall through to create |
253 | 253 | } |
254 | - catch( \Aimeos\MShop\Exception $e ) |
|
254 | + catch (\Aimeos\MShop\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | - catch( \Exception $e ) |
|
260 | + catch (\Exception $e) |
|
261 | 261 | { |
262 | - $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
263 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
264 | - $this->logException( $e ); |
|
262 | + $error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
263 | + $view->errors = $view->get('errors', []) + $error; |
|
264 | + $this->logException($e); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | $manager->rollback(); |
@@ -283,31 +283,31 @@ discard block |
||
283 | 283 | try |
284 | 284 | { |
285 | 285 | $total = 0; |
286 | - $params = $this->storeSearchParams( $view->param(), 'locale' ); |
|
287 | - $manager = \Aimeos\MShop::create( $context, 'locale' ); |
|
288 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
286 | + $params = $this->storeSearchParams($view->param(), 'locale'); |
|
287 | + $manager = \Aimeos\MShop::create($context, 'locale'); |
|
288 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
289 | 289 | |
290 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
291 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
290 | + $view->items = $manager->searchItems($search, [], $total); |
|
291 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
292 | 292 | $view->filterOperators = $search->getOperators(); |
293 | 293 | $view->total = $total; |
294 | 294 | $view->itemBody = ''; |
295 | 295 | |
296 | - foreach( $this->getSubClients() as $client ) { |
|
296 | + foreach ($this->getSubClients() as $client) { |
|
297 | 297 | $view->itemBody .= $client->search(); |
298 | 298 | } |
299 | 299 | } |
300 | - catch( \Aimeos\MShop\Exception $e ) |
|
300 | + catch (\Aimeos\MShop\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | - catch( \Exception $e ) |
|
306 | + catch (\Exception $e) |
|
307 | 307 | { |
308 | - $error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
309 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
310 | - $this->logException( $e ); |
|
308 | + $error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
309 | + $view->errors = $view->get('errors', []) + $error; |
|
310 | + $this->logException($e); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** admin/jqadm/locale/template-list |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $tplconf = 'admin/jqadm/locale/template-list'; |
333 | 333 | $default = 'locale/list-standard'; |
334 | 334 | |
335 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
335 | + return $view->render($view->config($tplconf, $default)); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | * @param string|null $name Name of the sub-client (Default if null) |
344 | 344 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
345 | 345 | */ |
346 | - public function getSubClient( $type, $name = null ) |
|
346 | + public function getSubClient($type, $name = null) |
|
347 | 347 | { |
348 | 348 | /** admin/jqadm/locale/decorators/excludes |
349 | 349 | * Excludes decorators added by the "common" option from the locale JQAdm client |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * @see admin/jqadm/locale/decorators/excludes |
419 | 419 | * @see admin/jqadm/locale/decorators/global |
420 | 420 | */ |
421 | - return $this->createSubClient( 'locale/' . $type, $name ); |
|
421 | + return $this->createSubClient('locale/' . $type, $name); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | |
@@ -429,13 +429,13 @@ discard block |
||
429 | 429 | */ |
430 | 430 | protected function getCurrencyItems() |
431 | 431 | { |
432 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'locale/currency' ); |
|
432 | + $manager = \Aimeos\MShop::create($this->getContext(), 'locale/currency'); |
|
433 | 433 | |
434 | - $search = $manager->createSearch( true ); |
|
435 | - $search->setSortations( [$search->sort( '+', 'locale.currency.id')] ); |
|
436 | - $search->setSlice( 0, 250 ); |
|
434 | + $search = $manager->createSearch(true); |
|
435 | + $search->setSortations([$search->sort('+', 'locale.currency.id')]); |
|
436 | + $search->setSlice(0, 250); |
|
437 | 437 | |
438 | - return $manager->searchItems( $search ); |
|
438 | + return $manager->searchItems($search); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | |
@@ -446,13 +446,13 @@ discard block |
||
446 | 446 | */ |
447 | 447 | protected function getLanguageItems() |
448 | 448 | { |
449 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'locale/language' ); |
|
449 | + $manager = \Aimeos\MShop::create($this->getContext(), 'locale/language'); |
|
450 | 450 | |
451 | - $search = $manager->createSearch( true ); |
|
452 | - $search->setSortations( [$search->sort( '+', 'locale.language.id')] ); |
|
453 | - $search->setSlice( 0, 250 ); |
|
451 | + $search = $manager->createSearch(true); |
|
452 | + $search->setSortations([$search->sort('+', 'locale.language.id')]); |
|
453 | + $search->setSlice(0, 250); |
|
454 | 454 | |
455 | - return $manager->searchItems( $search ); |
|
455 | + return $manager->searchItems($search); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | * @since 2017.10 |
497 | 497 | * @category Developer |
498 | 498 | */ |
499 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/locale/standard/subparts', [] ); |
|
499 | + return $this->getContext()->getConfig()->get('admin/jqadm/locale/standard/subparts', []); |
|
500 | 500 | } |
501 | 501 | |
502 | 502 | |
@@ -507,17 +507,17 @@ discard block |
||
507 | 507 | * @param string[] Data array |
508 | 508 | * @return \Aimeos\MShop\Locale\Item\Iface New locale item object |
509 | 509 | */ |
510 | - protected function fromArray( array $data ) |
|
510 | + protected function fromArray(array $data) |
|
511 | 511 | { |
512 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'locale' ); |
|
512 | + $manager = \Aimeos\MShop::create($this->getContext(), 'locale'); |
|
513 | 513 | |
514 | - if( isset( $data['locale.id'] ) && $data['locale.id'] != '' ) { |
|
515 | - $item = $manager->getItem( $data['locale.id'] ); |
|
514 | + if (isset($data['locale.id']) && $data['locale.id'] != '') { |
|
515 | + $item = $manager->getItem($data['locale.id']); |
|
516 | 516 | } else { |
517 | 517 | $item = $manager->createItem(); |
518 | 518 | } |
519 | 519 | |
520 | - $item->fromArray( $data ); |
|
520 | + $item->fromArray($data); |
|
521 | 521 | |
522 | 522 | return $item; |
523 | 523 | } |
@@ -529,11 +529,11 @@ discard block |
||
529 | 529 | * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object |
530 | 530 | * @return string[] Multi-dimensional associative list of item data |
531 | 531 | */ |
532 | - protected function toArray( \Aimeos\MShop\Locale\Item\Iface $item, $copy = false ) |
|
532 | + protected function toArray(\Aimeos\MShop\Locale\Item\Iface $item, $copy = false) |
|
533 | 533 | { |
534 | - $data = $item->toArray( true ); |
|
534 | + $data = $item->toArray(true); |
|
535 | 535 | |
536 | - if( $copy === true ) |
|
536 | + if ($copy === true) |
|
537 | 537 | { |
538 | 538 | $data['locale.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
539 | 539 | $data['locale.id'] = ''; |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
550 | 550 | * @return string HTML output |
551 | 551 | */ |
552 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
552 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
553 | 553 | { |
554 | 554 | /** admin/jqadm/locale/template-item |
555 | 555 | * Relative path to the HTML body template for the locale item. |
@@ -573,6 +573,6 @@ discard block |
||
573 | 573 | $tplconf = 'admin/jqadm/locale/template-item'; |
574 | 574 | $default = 'locale/item-standard'; |
575 | 575 | |
576 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
576 | + return $view->render($view->config($tplconf, $default)); |
|
577 | 577 | } |
578 | 578 | } |
@@ -106,14 +106,12 @@ |
||
106 | 106 | foreach( $this->getSubClients() as $client ) { |
107 | 107 | $view->orderBody .= $client->search(); |
108 | 108 | } |
109 | - } |
|
110 | - catch( \Aimeos\MShop\Exception $e ) |
|
109 | + } catch( \Aimeos\MShop\Exception $e ) |
|
111 | 110 | { |
112 | 111 | $error = array( 'customer-order' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
113 | 112 | $view->errors = $view->get( 'errors', [] ) + $error; |
114 | 113 | $this->logException( $e ); |
115 | - } |
|
116 | - catch( \Exception $e ) |
|
114 | + } catch( \Exception $e ) |
|
117 | 115 | { |
118 | 116 | $error = array( 'customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
119 | 117 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer\Order; |
12 | 12 | |
13 | -sprintf( 'order' ); // for translation |
|
13 | +sprintf('order'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -69,33 +69,33 @@ discard block |
||
69 | 69 | try |
70 | 70 | { |
71 | 71 | $total = 0; |
72 | - $params = $this->storeSearchParams( $view->param( 'uo', [] ), 'customerorder' ); |
|
73 | - $orderItems = $this->getOrderItems( $view->item, $params, $total ); |
|
74 | - $baseItems = $this->getOrderBaseItems( $orderItems ); |
|
72 | + $params = $this->storeSearchParams($view->param('uo', []), 'customerorder'); |
|
73 | + $orderItems = $this->getOrderItems($view->item, $params, $total); |
|
74 | + $baseItems = $this->getOrderBaseItems($orderItems); |
|
75 | 75 | |
76 | 76 | $view->orderItems = $orderItems; |
77 | 77 | $view->orderBaseItems = $baseItems; |
78 | 78 | $view->orderTotal = $total; |
79 | 79 | $view->orderBody = ''; |
80 | 80 | |
81 | - foreach( $this->getSubClients() as $client ) { |
|
81 | + foreach ($this->getSubClients() as $client) { |
|
82 | 82 | $view->orderBody .= $client->search(); |
83 | 83 | } |
84 | 84 | } |
85 | - catch( \Aimeos\MShop\Exception $e ) |
|
85 | + catch (\Aimeos\MShop\Exception $e) |
|
86 | 86 | { |
87 | - $error = array( 'customer-order' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
88 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
89 | - $this->logException( $e ); |
|
87 | + $error = array('customer-order' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
88 | + $view->errors = $view->get('errors', []) + $error; |
|
89 | + $this->logException($e); |
|
90 | 90 | } |
91 | - catch( \Exception $e ) |
|
91 | + catch (\Exception $e) |
|
92 | 92 | { |
93 | - $error = array( 'customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
94 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
95 | - $this->logException( $e ); |
|
93 | + $error = array('customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
94 | + $view->errors = $view->get('errors', []) + $error; |
|
95 | + $this->logException($e); |
|
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param string|null $name Name of the sub-client (Default if null) |
116 | 116 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
117 | 117 | */ |
118 | - public function getSubClient( $type, $name = null ) |
|
118 | + public function getSubClient($type, $name = null) |
|
119 | 119 | { |
120 | 120 | /** admin/jqadm/customer/order/decorators/excludes |
121 | 121 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @see admin/jqadm/customer/order/decorators/excludes |
191 | 191 | * @see admin/jqadm/customer/order/decorators/global |
192 | 192 | */ |
193 | - return $this->createSubClient( 'customer/order/' . $type, $name ); |
|
193 | + return $this->createSubClient('customer/order/' . $type, $name); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -200,20 +200,20 @@ discard block |
||
200 | 200 | * @param \Aimeos\MShop\Order\Item\Iface[] $items Order item objects |
201 | 201 | * @return \Aimeos\MShop\Order\Item\Base\Iface[] Basket items |
202 | 202 | */ |
203 | - protected function getOrderBaseItems( array $items ) |
|
203 | + protected function getOrderBaseItems(array $items) |
|
204 | 204 | { |
205 | 205 | $ids = []; |
206 | 206 | |
207 | - foreach( $items as $item ) { |
|
207 | + foreach ($items as $item) { |
|
208 | 208 | $ids[] = $item->getBaseId(); |
209 | 209 | } |
210 | 210 | |
211 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order/base' ); |
|
211 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order/base'); |
|
212 | 212 | |
213 | - $search = $manager->createSearch()->setSlice( 0, count( $ids ) ); |
|
214 | - $search->setConditions( $search->compare( '==', 'order.base.id', $ids ) ); |
|
213 | + $search = $manager->createSearch()->setSlice(0, count($ids)); |
|
214 | + $search->setConditions($search->compare('==', 'order.base.id', $ids)); |
|
215 | 215 | |
216 | - return $manager->searchItems( $search ); |
|
216 | + return $manager->searchItems($search); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -225,21 +225,21 @@ discard block |
||
225 | 225 | * @param integer $total Value/result parameter that will contain the item total afterwards |
226 | 226 | * @return \Aimeos\MShop\Order\Item\Iface[] Order items of the customer |
227 | 227 | */ |
228 | - protected function getOrderItems( \Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total ) |
|
228 | + protected function getOrderItems(\Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total) |
|
229 | 229 | { |
230 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order' ); |
|
230 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order'); |
|
231 | 231 | |
232 | 232 | $search = $manager->createSearch(); |
233 | - $search->setSortations( [$search->sort( '-', 'order.ctime' )] ); |
|
233 | + $search->setSortations([$search->sort('-', 'order.ctime')]); |
|
234 | 234 | |
235 | - $search = $this->initCriteria( $search, $params ); |
|
235 | + $search = $this->initCriteria($search, $params); |
|
236 | 236 | $expr = [ |
237 | - $search->compare( '==', 'order.base.customerid', $item->getId() ), |
|
237 | + $search->compare('==', 'order.base.customerid', $item->getId()), |
|
238 | 238 | $search->getConditions(), |
239 | 239 | ]; |
240 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
240 | + $search->setConditions($search->combine('&&', $expr)); |
|
241 | 241 | |
242 | - return $manager->searchItems( $search, [], $total ); |
|
242 | + return $manager->searchItems($search, [], $total); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @since 2017.07 |
284 | 284 | * @category Developer |
285 | 285 | */ |
286 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/order/standard/subparts', [] ); |
|
286 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/order/standard/subparts', []); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
294 | 294 | * @return string HTML output |
295 | 295 | */ |
296 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
296 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
297 | 297 | { |
298 | 298 | /** admin/jqadm/customer/order/template-item |
299 | 299 | * Relative path to the HTML body template of the order subpart for customers. |
@@ -317,6 +317,6 @@ discard block |
||
317 | 317 | $tplconf = 'admin/jqadm/customer/order/template-item'; |
318 | 318 | $default = 'customer/item-order-standard'; |
319 | 319 | |
320 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
320 | + return $view->render($view->config($tplconf, $default)); |
|
321 | 321 | } |
322 | 322 | } |
@@ -104,14 +104,12 @@ discard block |
||
104 | 104 | foreach( $this->getSubClients() as $client ) { |
105 | 105 | $view->codeBody .= $client->search(); |
106 | 106 | } |
107 | - } |
|
108 | - catch( \Aimeos\MShop\Exception $e ) |
|
107 | + } catch( \Aimeos\MShop\Exception $e ) |
|
109 | 108 | { |
110 | 109 | $error = array( 'coupon-item-code' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
111 | 110 | $view->errors = $view->get( 'errors', [] ) + $error; |
112 | 111 | $this->logException( $e ); |
113 | - } |
|
114 | - catch( \Exception $e ) |
|
112 | + } catch( \Exception $e ) |
|
115 | 113 | { |
116 | 114 | $error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
117 | 115 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -146,14 +144,12 @@ discard block |
||
146 | 144 | |
147 | 145 | $manager->commit(); |
148 | 146 | return; |
149 | - } |
|
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
147 | + } catch( \Aimeos\MShop\Exception $e ) |
|
151 | 148 | { |
152 | 149 | $error = array( 'coupon-item-code' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
153 | 150 | $view->errors = $view->get( 'errors', [] ) + $error; |
154 | 151 | $this->logException( $e ); |
155 | - } |
|
156 | - catch( \Exception $e ) |
|
152 | + } catch( \Exception $e ) |
|
157 | 153 | { |
158 | 154 | $error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
159 | 155 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Coupon\Code; |
12 | 12 | |
13 | -sprintf( 'code' ); // for translation |
|
13 | +sprintf('code'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - return $this->render( $this->getView() ); |
|
45 | + return $this->render($this->getView()); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function create() |
55 | 55 | { |
56 | - return $this->render( $this->getView() ); |
|
56 | + return $this->render($this->getView()); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -69,31 +69,31 @@ discard block |
||
69 | 69 | try |
70 | 70 | { |
71 | 71 | $total = 0; |
72 | - $params = $this->storeSearchParams( $view->param( 'vc', [] ), 'couponcode' ); |
|
73 | - $codeItems = $this->getCodeItems( $view->item, $params, $total ); |
|
72 | + $params = $this->storeSearchParams($view->param('vc', []), 'couponcode'); |
|
73 | + $codeItems = $this->getCodeItems($view->item, $params, $total); |
|
74 | 74 | |
75 | - $view->codeData = $this->toArray( $codeItems ); |
|
75 | + $view->codeData = $this->toArray($codeItems); |
|
76 | 76 | $view->codeTotal = $total; |
77 | 77 | $view->codeBody = ''; |
78 | 78 | |
79 | - foreach( $this->getSubClients() as $client ) { |
|
79 | + foreach ($this->getSubClients() as $client) { |
|
80 | 80 | $view->codeBody .= $client->search(); |
81 | 81 | } |
82 | 82 | } |
83 | - catch( \Aimeos\MShop\Exception $e ) |
|
83 | + catch (\Aimeos\MShop\Exception $e) |
|
84 | 84 | { |
85 | - $error = array( 'coupon-item-code' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
86 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
87 | - $this->logException( $e ); |
|
85 | + $error = array('coupon-item-code' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
86 | + $view->errors = $view->get('errors', []) + $error; |
|
87 | + $this->logException($e); |
|
88 | 88 | } |
89 | - catch( \Exception $e ) |
|
89 | + catch (\Exception $e) |
|
90 | 90 | { |
91 | - $error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
92 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
93 | - $this->logException( $e ); |
|
91 | + $error = array('coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
92 | + $view->errors = $view->get('errors', []) + $error; |
|
93 | + $this->logException($e); |
|
94 | 94 | } |
95 | 95 | |
96 | - return $this->render( $view ); |
|
96 | + return $this->render($view); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
@@ -105,34 +105,34 @@ discard block |
||
105 | 105 | $view = $this->getView(); |
106 | 106 | $context = $this->getContext(); |
107 | 107 | |
108 | - $manager = \Aimeos\MShop::create( $context, 'coupon/code' ); |
|
108 | + $manager = \Aimeos\MShop::create($context, 'coupon/code'); |
|
109 | 109 | $manager->begin(); |
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->storeSearchParams( $view->param( 'vc', [] ), 'couponcode' ); |
|
114 | - $this->storeFile( $view->item, (array) $view->request()->getUploadedFiles() ); |
|
115 | - $this->fromArray( $view->item, $view->param( 'code', [] ) ); |
|
113 | + $this->storeSearchParams($view->param('vc', []), 'couponcode'); |
|
114 | + $this->storeFile($view->item, (array) $view->request()->getUploadedFiles()); |
|
115 | + $this->fromArray($view->item, $view->param('code', [])); |
|
116 | 116 | $view->couponBody = ''; |
117 | 117 | |
118 | - foreach( $this->getSubClients() as $client ) { |
|
118 | + foreach ($this->getSubClients() as $client) { |
|
119 | 119 | $view->couponBody .= $client->save(); |
120 | 120 | } |
121 | 121 | |
122 | 122 | $manager->commit(); |
123 | 123 | return; |
124 | 124 | } |
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
125 | + catch (\Aimeos\MShop\Exception $e) |
|
126 | 126 | { |
127 | - $error = array( 'coupon-item-code' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
128 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
129 | - $this->logException( $e ); |
|
127 | + $error = array('coupon-item-code' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
128 | + $view->errors = $view->get('errors', []) + $error; |
|
129 | + $this->logException($e); |
|
130 | 130 | } |
131 | - catch( \Exception $e ) |
|
131 | + catch (\Exception $e) |
|
132 | 132 | { |
133 | - $error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
134 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
135 | - $this->logException( $e ); |
|
133 | + $error = array('coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
134 | + $view->errors = $view->get('errors', []) + $error; |
|
135 | + $this->logException($e); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | $manager->rollback(); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @param string|null $name Name of the sub-client (Default if null) |
149 | 149 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
150 | 150 | */ |
151 | - public function getSubClient( $type, $name = null ) |
|
151 | + public function getSubClient($type, $name = null) |
|
152 | 152 | { |
153 | 153 | /** admin/jqadm/coupon/code/decorators/excludes |
154 | 154 | * Excludes decorators added by the "common" option from the coupon JQAdm client |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | * @see admin/jqadm/coupon/code/decorators/excludes |
224 | 224 | * @see admin/jqadm/coupon/code/decorators/global |
225 | 225 | */ |
226 | - return $this->createSubClient( 'coupon/code/' . $type, $name ); |
|
226 | + return $this->createSubClient('coupon/code/' . $type, $name); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | |
@@ -233,27 +233,27 @@ discard block |
||
233 | 233 | * @param \Psr\Http\Message\UploadedFileInterface $file Uploaded file |
234 | 234 | * @throws \Aimeos\Admin\JQAdm\Exception If an error occured during upload |
235 | 235 | */ |
236 | - protected function checkFileUpload( \Psr\Http\Message\UploadedFileInterface $file ) |
|
236 | + protected function checkFileUpload(\Psr\Http\Message\UploadedFileInterface $file) |
|
237 | 237 | { |
238 | - if( $file->getError() !== UPLOAD_ERR_OK ) |
|
238 | + if ($file->getError() !== UPLOAD_ERR_OK) |
|
239 | 239 | { |
240 | - switch( $file->getError() ) |
|
240 | + switch ($file->getError()) |
|
241 | 241 | { |
242 | 242 | case UPLOAD_ERR_INI_SIZE: |
243 | 243 | case UPLOAD_ERR_FORM_SIZE: |
244 | - throw new \Aimeos\Admin\JQAdm\Exception( 'The uploaded file exceeds the max. allowed filesize' ); |
|
244 | + throw new \Aimeos\Admin\JQAdm\Exception('The uploaded file exceeds the max. allowed filesize'); |
|
245 | 245 | case UPLOAD_ERR_PARTIAL: |
246 | - throw new \Aimeos\Admin\JQAdm\Exception( 'The uploaded file was only partially uploaded' ); |
|
246 | + throw new \Aimeos\Admin\JQAdm\Exception('The uploaded file was only partially uploaded'); |
|
247 | 247 | case UPLOAD_ERR_NO_FILE: |
248 | - throw new \Aimeos\Admin\JQAdm\Exception( 'No file was uploaded' ); |
|
248 | + throw new \Aimeos\Admin\JQAdm\Exception('No file was uploaded'); |
|
249 | 249 | case UPLOAD_ERR_NO_TMP_DIR: |
250 | - throw new \Aimeos\Admin\JQAdm\Exception( 'Temporary folder is missing' ); |
|
250 | + throw new \Aimeos\Admin\JQAdm\Exception('Temporary folder is missing'); |
|
251 | 251 | case UPLOAD_ERR_CANT_WRITE: |
252 | - throw new \Aimeos\Admin\JQAdm\Exception( 'Failed to write file to disk' ); |
|
252 | + throw new \Aimeos\Admin\JQAdm\Exception('Failed to write file to disk'); |
|
253 | 253 | case UPLOAD_ERR_EXTENSION: |
254 | - throw new \Aimeos\Admin\JQAdm\Exception( 'File upload stopped by extension' ); |
|
254 | + throw new \Aimeos\Admin\JQAdm\Exception('File upload stopped by extension'); |
|
255 | 255 | default: |
256 | - throw new \Aimeos\Admin\JQAdm\Exception( 'Unknown upload error' ); |
|
256 | + throw new \Aimeos\Admin\JQAdm\Exception('Unknown upload error'); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | } |
@@ -267,21 +267,21 @@ discard block |
||
267 | 267 | * @param integer $total Value/result parameter that will contain the item total afterwards |
268 | 268 | * @return \Aimeos\MShop\Coupon\Item\Code\Iface[] Coupon code items associated to the coupon item |
269 | 269 | */ |
270 | - protected function getCodeItems( \Aimeos\MShop\Coupon\Item\Iface $item, array $params = [], &$total ) |
|
270 | + protected function getCodeItems(\Aimeos\MShop\Coupon\Item\Iface $item, array $params = [], &$total) |
|
271 | 271 | { |
272 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'coupon/code' ); |
|
272 | + $manager = \Aimeos\MShop::create($this->getContext(), 'coupon/code'); |
|
273 | 273 | |
274 | 274 | $search = $manager->createSearch(); |
275 | - $search->setSortations( [$search->sort( '+', 'coupon.code.code' )] ); |
|
275 | + $search->setSortations([$search->sort('+', 'coupon.code.code')]); |
|
276 | 276 | |
277 | - $search = $this->initCriteria( $search, $params ); |
|
277 | + $search = $this->initCriteria($search, $params); |
|
278 | 278 | $expr = [ |
279 | - $search->compare( '==', 'coupon.code.parentid', $item->getId() ), |
|
279 | + $search->compare('==', 'coupon.code.parentid', $item->getId()), |
|
280 | 280 | $search->getConditions(), |
281 | 281 | ]; |
282 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
282 | + $search->setConditions($search->combine('&&', $expr)); |
|
283 | 283 | |
284 | - return $manager->searchItems( $search, [], $total ); |
|
284 | + return $manager->searchItems($search, [], $total); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | * @since 2017.07 |
326 | 326 | * @category Developer |
327 | 327 | */ |
328 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/coupon/code/standard/subparts', [] ); |
|
328 | + return $this->getContext()->getConfig()->get('admin/jqadm/coupon/code/standard/subparts', []); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | |
@@ -335,22 +335,22 @@ discard block |
||
335 | 335 | * @param \Aimeos\MShop\Coupon\Item\Iface $item Coupon item object |
336 | 336 | * @param string[] $data Data array |
337 | 337 | */ |
338 | - protected function fromArray( \Aimeos\MShop\Coupon\Item\Iface $item, array $data ) |
|
338 | + protected function fromArray(\Aimeos\MShop\Coupon\Item\Iface $item, array $data) |
|
339 | 339 | { |
340 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'coupon/code' ); |
|
340 | + $manager = \Aimeos\MShop::create($this->getContext(), 'coupon/code'); |
|
341 | 341 | |
342 | - foreach( $this->getValue( $data, 'coupon.code.id', [] ) as $idx => $id ) |
|
342 | + foreach ($this->getValue($data, 'coupon.code.id', []) as $idx => $id) |
|
343 | 343 | { |
344 | 344 | $citem = $manager->createItem(); |
345 | 345 | |
346 | - $citem->setId( $id ); |
|
347 | - $citem->setParentId( $item->getId() ); |
|
348 | - $citem->setCode( $this->getValue( $data, 'coupon.code.code/' . $idx ) ); |
|
349 | - $citem->setCount( $this->getValue( $data, 'coupon.code.count/' . $idx ) ); |
|
350 | - $citem->setDateStart( $this->getValue( $data, 'coupon.code.datestart/' . $idx ) ); |
|
351 | - $citem->setDateEnd( $this->getValue( $data, 'coupon.code.dateend/' . $idx ) ); |
|
346 | + $citem->setId($id); |
|
347 | + $citem->setParentId($item->getId()); |
|
348 | + $citem->setCode($this->getValue($data, 'coupon.code.code/' . $idx)); |
|
349 | + $citem->setCount($this->getValue($data, 'coupon.code.count/' . $idx)); |
|
350 | + $citem->setDateStart($this->getValue($data, 'coupon.code.datestart/' . $idx)); |
|
351 | + $citem->setDateEnd($this->getValue($data, 'coupon.code.dateend/' . $idx)); |
|
352 | 352 | |
353 | - $manager->saveItem( $citem, false ); |
|
353 | + $manager->saveItem($citem, false); |
|
354 | 354 | } |
355 | 355 | } |
356 | 356 | |
@@ -361,25 +361,25 @@ discard block |
||
361 | 361 | * @param \Aimeos\MShop\Coupon\Item\Iface $item Coupon item object |
362 | 362 | * @param array $files File upload array including the PSR-7 file upload objects |
363 | 363 | */ |
364 | - protected function storeFile( \Aimeos\MShop\Coupon\Item\Iface $item, array $files ) |
|
364 | + protected function storeFile(\Aimeos\MShop\Coupon\Item\Iface $item, array $files) |
|
365 | 365 | { |
366 | - $file = $this->getValue( $files, 'code/file' ); |
|
366 | + $file = $this->getValue($files, 'code/file'); |
|
367 | 367 | |
368 | - if( $file == null || $file->getError() === UPLOAD_ERR_NO_FILE ) { |
|
368 | + if ($file == null || $file->getError() === UPLOAD_ERR_NO_FILE) { |
|
369 | 369 | return; |
370 | 370 | } |
371 | 371 | |
372 | - $this->checkFileUpload( $file ); |
|
372 | + $this->checkFileUpload($file); |
|
373 | 373 | |
374 | 374 | $context = $this->getContext(); |
375 | - $fs = $context->getFilesystemManager()->get( 'fs-import' ); |
|
375 | + $fs = $context->getFilesystemManager()->get('fs-import'); |
|
376 | 376 | $dir = 'couponcode/' . $context->getLocale()->getSite()->getCode(); |
377 | 377 | |
378 | - if( $fs->isdir( $dir ) === false ) { |
|
379 | - $fs->mkdir( $dir ); |
|
378 | + if ($fs->isdir($dir) === false) { |
|
379 | + $fs->mkdir($dir); |
|
380 | 380 | } |
381 | 381 | |
382 | - $fs->writes( $dir . '/' . $item->getId() . '.csv', $file->getStream()->detach() ); |
|
382 | + $fs->writes($dir . '/' . $item->getId() . '.csv', $file->getStream()->detach()); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | |
@@ -389,13 +389,13 @@ discard block |
||
389 | 389 | * @param \Aimeos\MShop\Coupon\Item\Code\Iface[] $items Coupon code items |
390 | 390 | * @return string[] Multi-dimensional associative list of item data |
391 | 391 | */ |
392 | - protected function toArray( array $items ) |
|
392 | + protected function toArray(array $items) |
|
393 | 393 | { |
394 | 394 | $data = []; |
395 | 395 | |
396 | - foreach( $items as $item ) |
|
396 | + foreach ($items as $item) |
|
397 | 397 | { |
398 | - foreach( $item->toArray( true ) as $key => $value ) { |
|
398 | + foreach ($item->toArray(true) as $key => $value) { |
|
399 | 399 | $data[$key][] = $value; |
400 | 400 | } |
401 | 401 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
411 | 411 | * @return string HTML output |
412 | 412 | */ |
413 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
413 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
414 | 414 | { |
415 | 415 | /** admin/jqadm/coupon/code/template-item |
416 | 416 | * Relative path to the HTML body template of the code subpart for coupons. |
@@ -434,6 +434,6 @@ discard block |
||
434 | 434 | $tplconf = 'admin/jqadm/coupon/code/template-item'; |
435 | 435 | $default = 'coupon/item-code-standard'; |
436 | 436 | |
437 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
437 | + return $view->render($view->config($tplconf, $default)); |
|
438 | 438 | } |
439 | 439 | } |
@@ -187,14 +187,12 @@ |
||
187 | 187 | |
188 | 188 | $manager->commit(); |
189 | 189 | return; |
190 | - } |
|
191 | - catch( \Aimeos\MShop\Exception $e ) |
|
190 | + } catch( \Aimeos\MShop\Exception $e ) |
|
192 | 191 | { |
193 | 192 | $error = array( 'product-item-category' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
194 | 193 | $view->errors = $view->get( 'errors', [] ) + $error; |
195 | 194 | $this->logException( $e ); |
196 | - } |
|
197 | - catch( \Exception $e ) |
|
195 | + } catch( \Exception $e ) |
|
198 | 196 | { |
199 | 197 | $error = array( 'product-item-category' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
200 | 198 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Product\Category; |
12 | 12 | |
13 | -sprintf( 'category' ); // for translation |
|
13 | +sprintf('category'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->categoryData = $this->toArray( $view->item, true ); |
|
47 | + $view->categoryData = $this->toArray($view->item, true); |
|
48 | 48 | $view->categoryListTypes = $this->getListTypes(); |
49 | 49 | $view->categoryBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $client ) { |
|
51 | + foreach ($this->getSubClients() as $client) { |
|
52 | 52 | $view->categoryBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | |
55 | - return $this->render( $view ); |
|
55 | + return $this->render($view); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | public function create() |
65 | 65 | { |
66 | 66 | $view = $this->getView(); |
67 | - $data = $view->param( 'category', [] ); |
|
67 | + $data = $view->param('category', []); |
|
68 | 68 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
69 | 69 | |
70 | - foreach( $view->value( $data, 'catalog.lists.id', [] ) as $idx => $value ) { |
|
70 | + foreach ($view->value($data, 'catalog.lists.id', []) as $idx => $value) { |
|
71 | 71 | $data['catalog.lists.siteid'][$idx] = $siteid; |
72 | 72 | } |
73 | 73 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->categoryListTypes = $this->getListTypes(); |
76 | 76 | $view->categoryBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->categoryBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -93,29 +93,29 @@ discard block |
||
93 | 93 | $view = $this->getView(); |
94 | 94 | $context = $this->getContext(); |
95 | 95 | |
96 | - $manager = \Aimeos\MShop::create( $context, 'catalog/lists' ); |
|
96 | + $manager = \Aimeos\MShop::create($context, 'catalog/lists'); |
|
97 | 97 | |
98 | 98 | $search = $manager->createSearch(); |
99 | 99 | $expr = array( |
100 | - $search->compare( '==', 'catalog.lists.refid', $view->param( 'id' ) ), |
|
101 | - $search->compare( '==', 'catalog.lists.domain', 'product' ) |
|
100 | + $search->compare('==', 'catalog.lists.refid', $view->param('id')), |
|
101 | + $search->compare('==', 'catalog.lists.domain', 'product') |
|
102 | 102 | ); |
103 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
104 | - $search->setSlice( 0, 0x7fffffff ); |
|
103 | + $search->setConditions($search->combine('&&', $expr)); |
|
104 | + $search->setSlice(0, 0x7fffffff); |
|
105 | 105 | |
106 | 106 | $start = 0; |
107 | 107 | |
108 | 108 | do |
109 | 109 | { |
110 | - $search->setSlice( $start ); |
|
110 | + $search->setSlice($start); |
|
111 | 111 | |
112 | - $result = $manager->searchItems( $search ); |
|
113 | - $manager->deleteItems( array_keys( $result ) ); |
|
112 | + $result = $manager->searchItems($search); |
|
113 | + $manager->deleteItems(array_keys($result)); |
|
114 | 114 | |
115 | - $count = count( $result ); |
|
115 | + $count = count($result); |
|
116 | 116 | $start += $count; |
117 | 117 | } |
118 | - while( $count >= $search->getSliceSize() ); |
|
118 | + while ($count >= $search->getSliceSize()); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | { |
129 | 129 | $view = $this->getView(); |
130 | 130 | |
131 | - $view->categoryData = $this->toArray( $view->item ); |
|
131 | + $view->categoryData = $this->toArray($view->item); |
|
132 | 132 | $view->categoryListTypes = $this->getListTypes(); |
133 | 133 | $view->categoryBody = ''; |
134 | 134 | |
135 | - foreach( $this->getSubClients() as $client ) { |
|
135 | + foreach ($this->getSubClients() as $client) { |
|
136 | 136 | $view->categoryBody .= $client->get(); |
137 | 137 | } |
138 | 138 | |
139 | - return $this->render( $view ); |
|
139 | + return $this->render($view); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | |
@@ -148,32 +148,32 @@ discard block |
||
148 | 148 | $view = $this->getView(); |
149 | 149 | $context = $this->getContext(); |
150 | 150 | |
151 | - $manager = \Aimeos\MShop::create( $context, 'product/lists' ); |
|
151 | + $manager = \Aimeos\MShop::create($context, 'product/lists'); |
|
152 | 152 | $manager->begin(); |
153 | 153 | |
154 | 154 | try |
155 | 155 | { |
156 | - $this->fromArray( $view->item, $view->param( 'category', [] ) ); |
|
156 | + $this->fromArray($view->item, $view->param('category', [])); |
|
157 | 157 | $view->categoryBody = ''; |
158 | 158 | |
159 | - foreach( $this->getSubClients() as $client ) { |
|
159 | + foreach ($this->getSubClients() as $client) { |
|
160 | 160 | $view->categoryBody .= $client->save(); |
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->commit(); |
164 | 164 | return; |
165 | 165 | } |
166 | - catch( \Aimeos\MShop\Exception $e ) |
|
166 | + catch (\Aimeos\MShop\Exception $e) |
|
167 | 167 | { |
168 | - $error = array( 'product-item-category' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
169 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
170 | - $this->logException( $e ); |
|
168 | + $error = array('product-item-category' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
169 | + $view->errors = $view->get('errors', []) + $error; |
|
170 | + $this->logException($e); |
|
171 | 171 | } |
172 | - catch( \Exception $e ) |
|
172 | + catch (\Exception $e) |
|
173 | 173 | { |
174 | - $error = array( 'product-item-category' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
175 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
176 | - $this->logException( $e ); |
|
174 | + $error = array('product-item-category' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
175 | + $view->errors = $view->get('errors', []) + $error; |
|
176 | + $this->logException($e); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | $manager->rollback(); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @param string|null $name Name of the sub-client (Default if null) |
190 | 190 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
191 | 191 | */ |
192 | - public function getSubClient( $type, $name = null ) |
|
192 | + public function getSubClient($type, $name = null) |
|
193 | 193 | { |
194 | 194 | /** admin/jqadm/product/category/decorators/excludes |
195 | 195 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | * @see admin/jqadm/product/category/decorators/excludes |
265 | 265 | * @see admin/jqadm/product/category/decorators/global |
266 | 266 | */ |
267 | - return $this->createSubClient( 'product/category/' . $type, $name ); |
|
267 | + return $this->createSubClient('product/category/' . $type, $name); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | * @since 2016.01 |
309 | 309 | * @category Developer |
310 | 310 | */ |
311 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/category/standard/subparts', [] ); |
|
311 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/category/standard/subparts', []); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | * @param array $listItems List of items implementing \Aimeos\Common\Item\Lists\Iface |
319 | 319 | * @return array Associative list of catalog IDs as keys and items implementing \Aimeos\Catalog\Item\Iface as values |
320 | 320 | */ |
321 | - protected function getCatalogItems( array $listItems ) |
|
321 | + protected function getCatalogItems(array $listItems) |
|
322 | 322 | { |
323 | 323 | $ids = []; |
324 | 324 | |
325 | - foreach( $listItems as $listItem ) { |
|
325 | + foreach ($listItems as $listItem) { |
|
326 | 326 | $ids[] = $listItem->getParentId(); |
327 | 327 | } |
328 | 328 | |
329 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog' ); |
|
329 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog'); |
|
330 | 330 | |
331 | 331 | $search = $manager->createSearch(); |
332 | - $search->setConditions( $search->compare( '==', 'catalog.id', $ids ) ); |
|
332 | + $search->setConditions($search->compare('==', 'catalog.id', $ids)); |
|
333 | 333 | |
334 | - return $manager->searchItems( $search ); |
|
334 | + return $manager->searchItems($search); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | |
@@ -341,18 +341,18 @@ discard block |
||
341 | 341 | * @param string $prodid Unique product ID |
342 | 342 | * @return array Associative list of category list IDs as keys and list items as values |
343 | 343 | */ |
344 | - protected function getListItems( $prodid ) |
|
344 | + protected function getListItems($prodid) |
|
345 | 345 | { |
346 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists' ); |
|
346 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists'); |
|
347 | 347 | |
348 | - $search = $manager->createSearch()->setSlice( 0, 0x7fffffff ); |
|
348 | + $search = $manager->createSearch()->setSlice(0, 0x7fffffff); |
|
349 | 349 | $expr = array( |
350 | - $search->compare( '==', 'catalog.lists.refid', $prodid ), |
|
351 | - $search->compare( '==', 'catalog.lists.domain', 'product' ), |
|
350 | + $search->compare('==', 'catalog.lists.refid', $prodid), |
|
351 | + $search->compare('==', 'catalog.lists.domain', 'product'), |
|
352 | 352 | ); |
353 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
353 | + $search->setConditions($search->combine('&&', $expr)); |
|
354 | 354 | |
355 | - return $manager->searchItems( $search ); |
|
355 | + return $manager->searchItems($search); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | |
@@ -364,13 +364,13 @@ discard block |
||
364 | 364 | protected function getListTypes() |
365 | 365 | { |
366 | 366 | $list = []; |
367 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists/type' ); |
|
367 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists/type'); |
|
368 | 368 | |
369 | 369 | $search = $manager->createSearch(); |
370 | - $search->setConditions( $search->compare( '==', 'catalog.lists.type.domain', 'product' ) ); |
|
371 | - $search->setSlice( 0, 0x7fffffff ); |
|
370 | + $search->setConditions($search->compare('==', 'catalog.lists.type.domain', 'product')); |
|
371 | + $search->setSlice(0, 0x7fffffff); |
|
372 | 372 | |
373 | - foreach( $manager->searchItems( $search ) as $item ) { |
|
373 | + foreach ($manager->searchItems($search) as $item) { |
|
374 | 374 | $list[$item->getCode()] = $item->getId(); |
375 | 375 | } |
376 | 376 | |
@@ -384,37 +384,37 @@ discard block |
||
384 | 384 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
385 | 385 | * @param string[] $data Data array |
386 | 386 | */ |
387 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
387 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
388 | 388 | { |
389 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists' ); |
|
390 | - $listIds = (array) $this->getValue( $data, 'catalog.lists.id', [] ); |
|
391 | - $listItems = $map = $this->getListItems( $item->getId() ); |
|
389 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists'); |
|
390 | + $listIds = (array) $this->getValue($data, 'catalog.lists.id', []); |
|
391 | + $listItems = $map = $this->getListItems($item->getId()); |
|
392 | 392 | |
393 | 393 | |
394 | - foreach( $listIds as $idx => $listid ) |
|
394 | + foreach ($listIds as $idx => $listid) |
|
395 | 395 | { |
396 | - if( isset( $map[$listid] ) ) { |
|
397 | - unset( $map[$listid] ); |
|
396 | + if (isset($map[$listid])) { |
|
397 | + unset($map[$listid]); |
|
398 | 398 | } |
399 | 399 | } |
400 | 400 | |
401 | - $manager->deleteItems( array_keys( $map ) ); |
|
401 | + $manager->deleteItems(array_keys($map)); |
|
402 | 402 | |
403 | 403 | |
404 | - foreach( $listIds as $idx => $listid ) |
|
404 | + foreach ($listIds as $idx => $listid) |
|
405 | 405 | { |
406 | - if( isset( $listItems[$listid] ) ) { |
|
406 | + if (isset($listItems[$listid])) { |
|
407 | 407 | $litem = $listItems[$listid]; |
408 | 408 | } else { |
409 | 409 | $litem = $manager->createItem(); |
410 | 410 | } |
411 | 411 | |
412 | - $litem->setDomain( 'product' ); |
|
413 | - $litem->setRefId( $item->getId() ); |
|
414 | - $litem->setParentId( $this->getValue( $data, 'catalog.id/' . $idx ) ); |
|
415 | - $litem->setType( $this->getValue( $data, 'catalog.lists.type/' . $idx ) ); |
|
412 | + $litem->setDomain('product'); |
|
413 | + $litem->setRefId($item->getId()); |
|
414 | + $litem->setParentId($this->getValue($data, 'catalog.id/' . $idx)); |
|
415 | + $litem->setType($this->getValue($data, 'catalog.lists.type/' . $idx)); |
|
416 | 416 | |
417 | - $manager->saveItem( $litem, false ); |
|
417 | + $manager->saveItem($litem, false); |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
@@ -426,34 +426,34 @@ discard block |
||
426 | 426 | * @param boolean $copy True if items should be copied, false if not |
427 | 427 | * @return string[] Multi-dimensional associative list of item data |
428 | 428 | */ |
429 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
429 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
430 | 430 | { |
431 | 431 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
432 | - $listItems = $this->getListItems( $item->getId() ); |
|
433 | - $catItems = $this->getCatalogItems( $listItems ); |
|
432 | + $listItems = $this->getListItems($item->getId()); |
|
433 | + $catItems = $this->getCatalogItems($listItems); |
|
434 | 434 | $data = []; |
435 | 435 | |
436 | - foreach( $listItems as $listItem ) |
|
436 | + foreach ($listItems as $listItem) |
|
437 | 437 | { |
438 | 438 | $catId = $listItem->getParentId(); |
439 | 439 | |
440 | - if( !isset( $catItems[$catId] ) ) { |
|
440 | + if (!isset($catItems[$catId])) { |
|
441 | 441 | continue; |
442 | 442 | } |
443 | 443 | |
444 | - $list = $listItem->toArray( true ); |
|
444 | + $list = $listItem->toArray(true); |
|
445 | 445 | |
446 | - if( $copy === true ) |
|
446 | + if ($copy === true) |
|
447 | 447 | { |
448 | 448 | $list['catalog.lists.siteid'] = $siteId; |
449 | 449 | $list['catalog.lists.id'] = ''; |
450 | 450 | } |
451 | 451 | |
452 | - foreach( $list as $key => $value ) { |
|
452 | + foreach ($list as $key => $value) { |
|
453 | 453 | $data[$key][] = $value; |
454 | 454 | } |
455 | 455 | |
456 | - foreach( $catItems[$catId]->toArray( true ) as $key => $value ) { |
|
456 | + foreach ($catItems[$catId]->toArray(true) as $key => $value) { |
|
457 | 457 | $data[$key][] = $value; |
458 | 458 | } |
459 | 459 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
469 | 469 | * @return string HTML output |
470 | 470 | */ |
471 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
471 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
472 | 472 | { |
473 | 473 | /** admin/jqadm/product/category/template-item |
474 | 474 | * Relative path to the HTML body template of the category subpart for products. |
@@ -492,6 +492,6 @@ discard block |
||
492 | 492 | $tplconf = 'admin/jqadm/product/category/template-item'; |
493 | 493 | $default = 'product/item-category-standard'; |
494 | 494 | |
495 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
495 | + return $view->render($view->config($tplconf, $default)); |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | \ No newline at end of file |
@@ -104,14 +104,12 @@ discard block |
||
104 | 104 | foreach( $this->getSubClients() as $client ) { |
105 | 105 | $view->invoiceBody .= $client->search(); |
106 | 106 | } |
107 | - } |
|
108 | - catch( \Aimeos\MShop\Exception $e ) |
|
107 | + } catch( \Aimeos\MShop\Exception $e ) |
|
109 | 108 | { |
110 | 109 | $error = array( 'order-item-invoice' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
111 | 110 | $view->errors = $view->get( 'errors', [] ) + $error; |
112 | 111 | $this->logException( $e ); |
113 | - } |
|
114 | - catch( \Exception $e ) |
|
112 | + } catch( \Exception $e ) |
|
115 | 113 | { |
116 | 114 | $error = array( 'order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
117 | 115 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -145,14 +143,12 @@ discard block |
||
145 | 143 | |
146 | 144 | $manager->commit(); |
147 | 145 | return; |
148 | - } |
|
149 | - catch( \Aimeos\MShop\Exception $e ) |
|
146 | + } catch( \Aimeos\MShop\Exception $e ) |
|
150 | 147 | { |
151 | 148 | $error = array( 'order-item-invoice' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
152 | 149 | $view->errors = $view->get( 'errors', [] ) + $error; |
153 | 150 | $this->logException( $e ); |
154 | - } |
|
155 | - catch( \Exception $e ) |
|
151 | + } catch( \Exception $e ) |
|
156 | 152 | { |
157 | 153 | $error = array( 'order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
158 | 154 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Order\Invoice; |
12 | 12 | |
13 | -sprintf( 'invoice' ); // for translation |
|
13 | +sprintf('invoice'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -69,31 +69,31 @@ discard block |
||
69 | 69 | try |
70 | 70 | { |
71 | 71 | $total = 0; |
72 | - $params = $this->storeSearchParams( $view->param( 'oi', [] ), 'orderinvoice' ); |
|
73 | - $orderItems = $this->getOrderItems( $view->item, $params, $total ); |
|
72 | + $params = $this->storeSearchParams($view->param('oi', []), 'orderinvoice'); |
|
73 | + $orderItems = $this->getOrderItems($view->item, $params, $total); |
|
74 | 74 | |
75 | - $view->invoiceData = $this->toArray( $orderItems ); |
|
75 | + $view->invoiceData = $this->toArray($orderItems); |
|
76 | 76 | $view->invoiceTotal = $total; |
77 | 77 | $view->invoiceBody = ''; |
78 | 78 | |
79 | - foreach( $this->getSubClients() as $client ) { |
|
79 | + foreach ($this->getSubClients() as $client) { |
|
80 | 80 | $view->invoiceBody .= $client->search(); |
81 | 81 | } |
82 | 82 | } |
83 | - catch( \Aimeos\MShop\Exception $e ) |
|
83 | + catch (\Aimeos\MShop\Exception $e) |
|
84 | 84 | { |
85 | - $error = array( 'order-item-invoice' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
86 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
87 | - $this->logException( $e ); |
|
85 | + $error = array('order-item-invoice' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
86 | + $view->errors = $view->get('errors', []) + $error; |
|
87 | + $this->logException($e); |
|
88 | 88 | } |
89 | - catch( \Exception $e ) |
|
89 | + catch (\Exception $e) |
|
90 | 90 | { |
91 | - $error = array( 'order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
92 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
93 | - $this->logException( $e ); |
|
91 | + $error = array('order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
92 | + $view->errors = $view->get('errors', []) + $error; |
|
93 | + $this->logException($e); |
|
94 | 94 | } |
95 | 95 | |
96 | - return $this->render( $view ); |
|
96 | + return $this->render($view); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
@@ -105,33 +105,33 @@ discard block |
||
105 | 105 | $view = $this->getView(); |
106 | 106 | $context = $this->getContext(); |
107 | 107 | |
108 | - $manager = \Aimeos\MShop::create( $context, 'order' ); |
|
108 | + $manager = \Aimeos\MShop::create($context, 'order'); |
|
109 | 109 | $manager->begin(); |
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->storeSearchParams( $view->param( 'oi', [] ), 'orderinvoice' ); |
|
114 | - $this->fromArray( $view->item, $view->param( 'invoice', [] ) ); |
|
113 | + $this->storeSearchParams($view->param('oi', []), 'orderinvoice'); |
|
114 | + $this->fromArray($view->item, $view->param('invoice', [])); |
|
115 | 115 | $view->invoiceBody = ''; |
116 | 116 | |
117 | - foreach( $this->getSubClients() as $client ) { |
|
117 | + foreach ($this->getSubClients() as $client) { |
|
118 | 118 | $view->invoiceBody .= $client->save(); |
119 | 119 | } |
120 | 120 | |
121 | 121 | $manager->commit(); |
122 | 122 | return; |
123 | 123 | } |
124 | - catch( \Aimeos\MShop\Exception $e ) |
|
124 | + catch (\Aimeos\MShop\Exception $e) |
|
125 | 125 | { |
126 | - $error = array( 'order-item-invoice' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
127 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
128 | - $this->logException( $e ); |
|
126 | + $error = array('order-item-invoice' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
127 | + $view->errors = $view->get('errors', []) + $error; |
|
128 | + $this->logException($e); |
|
129 | 129 | } |
130 | - catch( \Exception $e ) |
|
130 | + catch (\Exception $e) |
|
131 | 131 | { |
132 | - $error = array( 'order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
133 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
134 | - $this->logException( $e ); |
|
132 | + $error = array('order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
133 | + $view->errors = $view->get('errors', []) + $error; |
|
134 | + $this->logException($e); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $manager->rollback(); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @param string|null $name Name of the sub-client (Default if null) |
148 | 148 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
149 | 149 | */ |
150 | - public function getSubClient( $type, $name = null ) |
|
150 | + public function getSubClient($type, $name = null) |
|
151 | 151 | { |
152 | 152 | /** admin/jqadm/order/invoice/decorators/excludes |
153 | 153 | * Excludes decorators added by the "common" option from the order JQAdm client |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @see admin/jqadm/order/invoice/decorators/excludes |
223 | 223 | * @see admin/jqadm/order/invoice/decorators/global |
224 | 224 | */ |
225 | - return $this->createSubClient( 'order/invoice/' . $type, $name ); |
|
225 | + return $this->createSubClient('order/invoice/' . $type, $name); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @since 2017.07 |
267 | 267 | * @category Developer |
268 | 268 | */ |
269 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/order/invoice/standard/subparts', [] ); |
|
269 | + return $this->getContext()->getConfig()->get('admin/jqadm/order/invoice/standard/subparts', []); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | |
@@ -278,21 +278,21 @@ discard block |
||
278 | 278 | * @param integer $total Value/result parameter that will contain the item total afterwards |
279 | 279 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of order IDs as keys and items as values |
280 | 280 | */ |
281 | - protected function getOrderItems( \Aimeos\MShop\Order\Item\Base\Iface $order, array $params, &$total ) |
|
281 | + protected function getOrderItems(\Aimeos\MShop\Order\Item\Base\Iface $order, array $params, &$total) |
|
282 | 282 | { |
283 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order' ); |
|
283 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order'); |
|
284 | 284 | |
285 | 285 | $search = $manager->createSearch(); |
286 | - $search->setSortations( [$search->sort( '-', 'order.ctime' )] ); |
|
286 | + $search->setSortations([$search->sort('-', 'order.ctime')]); |
|
287 | 287 | |
288 | - $search = $this->initCriteria( $search, $params, 'orderinvoice' ); |
|
288 | + $search = $this->initCriteria($search, $params, 'orderinvoice'); |
|
289 | 289 | $expr = [ |
290 | - $search->compare( '==', 'order.baseid', $order->getId() ), |
|
290 | + $search->compare('==', 'order.baseid', $order->getId()), |
|
291 | 291 | $search->getConditions(), |
292 | 292 | ]; |
293 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
293 | + $search->setConditions($search->combine('&&', $expr)); |
|
294 | 294 | |
295 | - return $manager->searchItems( $search, [], $total ); |
|
295 | + return $manager->searchItems($search, [], $total); |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | |
@@ -302,52 +302,52 @@ discard block |
||
302 | 302 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Order base item object |
303 | 303 | * @param string[] $data Data array |
304 | 304 | */ |
305 | - protected function fromArray( \Aimeos\MShop\Order\Item\Base\Iface $order, array $data ) |
|
305 | + protected function fromArray(\Aimeos\MShop\Order\Item\Base\Iface $order, array $data) |
|
306 | 306 | { |
307 | - $invoiceIds = $this->getValue( $data, 'order.id', [] ); |
|
308 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order' ); |
|
307 | + $invoiceIds = $this->getValue($data, 'order.id', []); |
|
308 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order'); |
|
309 | 309 | |
310 | - $search = $manager->createSearch()->setSlice( 0, count( $invoiceIds ) ); |
|
311 | - $search->setConditions( $search->compare( '==', 'order.id', $invoiceIds ) ); |
|
310 | + $search = $manager->createSearch()->setSlice(0, count($invoiceIds)); |
|
311 | + $search->setConditions($search->compare('==', 'order.id', $invoiceIds)); |
|
312 | 312 | |
313 | - $items = $manager->searchItems( $search ); |
|
313 | + $items = $manager->searchItems($search); |
|
314 | 314 | |
315 | 315 | |
316 | - foreach( $invoiceIds as $idx => $id ) |
|
316 | + foreach ($invoiceIds as $idx => $id) |
|
317 | 317 | { |
318 | - if( !isset( $items[$id] ) ) { |
|
318 | + if (!isset($items[$id])) { |
|
319 | 319 | $item = $manager->createItem(); |
320 | 320 | } else { |
321 | 321 | $item = $items[$id]; |
322 | 322 | } |
323 | 323 | |
324 | - if( isset( $data['order.statusdelivery'][$idx] ) ) { |
|
325 | - $item->setDeliveryStatus( $data['order.statusdelivery'][$idx] ); |
|
324 | + if (isset($data['order.statusdelivery'][$idx])) { |
|
325 | + $item->setDeliveryStatus($data['order.statusdelivery'][$idx]); |
|
326 | 326 | } |
327 | 327 | |
328 | - if( isset( $data['order.statuspayment'][$idx] ) ) { |
|
329 | - $item->setPaymentStatus( $data['order.statuspayment'][$idx] ); |
|
328 | + if (isset($data['order.statuspayment'][$idx])) { |
|
329 | + $item->setPaymentStatus($data['order.statuspayment'][$idx]); |
|
330 | 330 | } |
331 | 331 | |
332 | - if( isset( $data['order.datedelivery'][$idx] ) ) { |
|
333 | - $item->setDateDelivery( $data['order.datedelivery'][$idx] ); |
|
332 | + if (isset($data['order.datedelivery'][$idx])) { |
|
333 | + $item->setDateDelivery($data['order.datedelivery'][$idx]); |
|
334 | 334 | } |
335 | 335 | |
336 | - if( isset( $data['order.datepayment'][$idx] ) ) { |
|
337 | - $item->setDatePayment( $data['order.datepayment'][$idx] ); |
|
336 | + if (isset($data['order.datepayment'][$idx])) { |
|
337 | + $item->setDatePayment($data['order.datepayment'][$idx]); |
|
338 | 338 | } |
339 | 339 | |
340 | - if( isset( $data['order.relatedid'][$idx] ) ) { |
|
341 | - $item->setRelatedId( $data['order.relatedid'][$idx] ); |
|
340 | + if (isset($data['order.relatedid'][$idx])) { |
|
341 | + $item->setRelatedId($data['order.relatedid'][$idx]); |
|
342 | 342 | } |
343 | 343 | |
344 | - if( isset( $data['order.type'][$idx] ) ) { |
|
345 | - $item->setType( $data['order.type'][$idx] ); |
|
344 | + if (isset($data['order.type'][$idx])) { |
|
345 | + $item->setType($data['order.type'][$idx]); |
|
346 | 346 | } |
347 | 347 | |
348 | - $item->setBaseId( $order->getId() ); |
|
348 | + $item->setBaseId($order->getId()); |
|
349 | 349 | |
350 | - $manager->saveItem( $item ); |
|
350 | + $manager->saveItem($item); |
|
351 | 351 | } |
352 | 352 | } |
353 | 353 | |
@@ -358,13 +358,13 @@ discard block |
||
358 | 358 | * @param \Aimeos\MShop\Order\Item\Iface[] $invoices List of invoices belonging to the order |
359 | 359 | * @return string[] Multi-dimensional associative list of item data |
360 | 360 | */ |
361 | - protected function toArray( array $invoices ) |
|
361 | + protected function toArray(array $invoices) |
|
362 | 362 | { |
363 | 363 | $data = []; |
364 | 364 | |
365 | - foreach( $invoices as $item ) |
|
365 | + foreach ($invoices as $item) |
|
366 | 366 | { |
367 | - foreach( $item->toArray( true ) as $key => $value ) { |
|
367 | + foreach ($item->toArray(true) as $key => $value) { |
|
368 | 368 | $data[$key][] = $value; |
369 | 369 | } |
370 | 370 | } |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
380 | 380 | * @return string HTML output |
381 | 381 | */ |
382 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
382 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
383 | 383 | { |
384 | 384 | /** admin/jqadm/order/invoice/template-item |
385 | 385 | * Relative path to the HTML body template of the invoice subpart for orders. |
@@ -403,6 +403,6 @@ discard block |
||
403 | 403 | $tplconf = 'admin/jqadm/order/invoice/template-item'; |
404 | 404 | $default = 'order/item-invoice-standard'; |
405 | 405 | |
406 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
406 | + return $view->render($view->config($tplconf, $default)); |
|
407 | 407 | } |
408 | 408 | } |
@@ -84,14 +84,12 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | $manager->deleteItem( $id ); |
87 | - } |
|
88 | - catch( \Aimeos\MAdmin\Exception $e ) |
|
87 | + } catch( \Aimeos\MAdmin\Exception $e ) |
|
89 | 88 | { |
90 | 89 | $error = array( 'job-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
91 | 90 | $view->errors = $view->get( 'errors', [] ) + $error; |
92 | 91 | $this->logException( $e ); |
93 | - } |
|
94 | - catch( \Exception $e ) |
|
92 | + } catch( \Exception $e ) |
|
95 | 93 | { |
96 | 94 | $error = array( 'job-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
97 | 95 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -129,14 +127,12 @@ discard block |
||
129 | 127 | $view->response()->withHeader( 'Content-Type', 'text/csv' ); |
130 | 128 | $view->response()->withBody( $stream ); |
131 | 129 | } |
132 | - } |
|
133 | - catch( \Aimeos\MAdmin\Exception $e ) |
|
130 | + } catch( \Aimeos\MAdmin\Exception $e ) |
|
134 | 131 | { |
135 | 132 | $error = array( 'job-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
136 | 133 | $view->errors = $view->get( 'errors', [] ) + $error; |
137 | 134 | $this->logException( $e ); |
138 | - } |
|
139 | - catch( \Exception $e ) |
|
135 | + } catch( \Exception $e ) |
|
140 | 136 | { |
141 | 137 | $error = array( 'job-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
142 | 138 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -171,14 +167,12 @@ discard block |
||
171 | 167 | foreach( $this->getSubClients() as $client ) { |
172 | 168 | $view->jobBody .= $client->search(); |
173 | 169 | } |
174 | - } |
|
175 | - catch( \Aimeos\MShop\Exception $e ) |
|
170 | + } catch( \Aimeos\MShop\Exception $e ) |
|
176 | 171 | { |
177 | 172 | $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
178 | 173 | $view->errors = $view->get( 'errors', [] ) + $error; |
179 | 174 | $this->logException( $e ); |
180 | - } |
|
181 | - catch( \Exception $e ) |
|
175 | + } catch( \Exception $e ) |
|
182 | 176 | { |
183 | 177 | $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
184 | 178 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -45,32 +45,32 @@ discard block |
||
45 | 45 | |
46 | 46 | try |
47 | 47 | { |
48 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
49 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
48 | + if (($id = $view->param('id')) === null) { |
|
49 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
50 | 50 | } |
51 | 51 | |
52 | - $fs = $context->getFileSystemManager()->get( 'fs-admin' ); |
|
53 | - $manager = \Aimeos\MAdmin::create( $context, 'job' ); |
|
54 | - $item = $manager->getItem( $id ); |
|
52 | + $fs = $context->getFileSystemManager()->get('fs-admin'); |
|
53 | + $manager = \Aimeos\MAdmin::create($context, 'job'); |
|
54 | + $item = $manager->getItem($id); |
|
55 | 55 | $result = $item->getResult(); |
56 | 56 | |
57 | - if( isset( $result['file'] ) && $fs->has( $result['file'] ) ) { |
|
58 | - $fs->rm( $result['file'] ); |
|
57 | + if (isset($result['file']) && $fs->has($result['file'])) { |
|
58 | + $fs->rm($result['file']); |
|
59 | 59 | } |
60 | 60 | |
61 | - $manager->deleteItem( $id ); |
|
61 | + $manager->deleteItem($id); |
|
62 | 62 | } |
63 | - catch( \Aimeos\MAdmin\Exception $e ) |
|
63 | + catch (\Aimeos\MAdmin\Exception $e) |
|
64 | 64 | { |
65 | - $error = array( 'job-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
66 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
67 | - $this->logException( $e ); |
|
65 | + $error = array('job-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
66 | + $view->errors = $view->get('errors', []) + $error; |
|
67 | + $this->logException($e); |
|
68 | 68 | } |
69 | - catch( \Exception $e ) |
|
69 | + catch (\Exception $e) |
|
70 | 70 | { |
71 | - $error = array( 'job-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
72 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
73 | - $this->logException( $e ); |
|
71 | + $error = array('job-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
72 | + $view->errors = $view->get('errors', []) + $error; |
|
73 | + $this->logException($e); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $this->search(); |
@@ -89,33 +89,33 @@ discard block |
||
89 | 89 | |
90 | 90 | try |
91 | 91 | { |
92 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
93 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
92 | + if (($id = $view->param('id')) === null) { |
|
93 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
94 | 94 | } |
95 | 95 | |
96 | - $fs = $context->getFileSystemManager()->get( 'fs-admin' ); |
|
97 | - $item = \Aimeos\MAdmin::create( $context, 'job' )->getItem( $id ); |
|
96 | + $fs = $context->getFileSystemManager()->get('fs-admin'); |
|
97 | + $item = \Aimeos\MAdmin::create($context, 'job')->getItem($id); |
|
98 | 98 | $result = $item->getResult(); |
99 | 99 | |
100 | - if( isset( $result['file'] ) && $fs->has( $result['file'] ) ) |
|
100 | + if (isset($result['file']) && $fs->has($result['file'])) |
|
101 | 101 | { |
102 | - $stream = $view->response()->createStream( $fs->reads( $result['file'] ) ); |
|
103 | - $view->response()->withHeader( 'Content-Disposition', 'attachment; filename="' . $result['file'] . '"' ); |
|
104 | - $view->response()->withHeader( 'Content-Type', 'text/csv' ); |
|
105 | - $view->response()->withBody( $stream ); |
|
102 | + $stream = $view->response()->createStream($fs->reads($result['file'])); |
|
103 | + $view->response()->withHeader('Content-Disposition', 'attachment; filename="' . $result['file'] . '"'); |
|
104 | + $view->response()->withHeader('Content-Type', 'text/csv'); |
|
105 | + $view->response()->withBody($stream); |
|
106 | 106 | } |
107 | 107 | } |
108 | - catch( \Aimeos\MAdmin\Exception $e ) |
|
108 | + catch (\Aimeos\MAdmin\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'job-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('job-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | - catch( \Exception $e ) |
|
114 | + catch (\Exception $e) |
|
115 | 115 | { |
116 | - $error = array( 'job-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
117 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
118 | - $this->logException( $e ); |
|
116 | + $error = array('job-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
117 | + $view->errors = $view->get('errors', []) + $error; |
|
118 | + $this->logException($e); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
@@ -132,32 +132,32 @@ discard block |
||
132 | 132 | |
133 | 133 | try |
134 | 134 | { |
135 | - $manager = \Aimeos\MAdmin::create( $context, 'job' ); |
|
135 | + $manager = \Aimeos\MAdmin::create($context, 'job'); |
|
136 | 136 | |
137 | 137 | $search = $manager->createSearch(); |
138 | - $search->setSortations( [$search->sort( '-', 'job.ctime' ), $search->sort( '-', 'job.id' )] ); |
|
138 | + $search->setSortations([$search->sort('-', 'job.ctime'), $search->sort('-', 'job.id')]); |
|
139 | 139 | $total = 0; |
140 | 140 | |
141 | 141 | $view->jobBody = ''; |
142 | - $view->jobItems = $manager->searchItems( $search, [], $total ); |
|
142 | + $view->jobItems = $manager->searchItems($search, [], $total); |
|
143 | 143 | $view->jobTotal = $total; |
144 | 144 | |
145 | 145 | |
146 | - foreach( $this->getSubClients() as $client ) { |
|
146 | + foreach ($this->getSubClients() as $client) { |
|
147 | 147 | $view->jobBody .= $client->search(); |
148 | 148 | } |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** admin/jqadm/dashboard/job/template-list |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $tplconf = 'admin/jqadm/dashboard/job/template-list'; |
183 | 183 | $default = 'dashboard/list-job-standard'; |
184 | 184 | |
185 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
185 | + return $view->render($view->config($tplconf, $default)); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * @param string|null $name Name of the sub-client (Default if null) |
194 | 194 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
195 | 195 | */ |
196 | - public function getSubClient( $type, $name = null ) |
|
196 | + public function getSubClient($type, $name = null) |
|
197 | 197 | { |
198 | 198 | /** admin/jqadm/dashboard/job/decorators/excludes |
199 | 199 | * Excludes decorators added by the "common" option from the dashboard JQAdm client |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | * @see admin/jqadm/dashboard/job/decorators/excludes |
269 | 269 | * @see admin/jqadm/dashboard/job/decorators/global |
270 | 270 | */ |
271 | - return $this->createSubClient( 'dashboard/job/' . $type, $name ); |
|
271 | + return $this->createSubClient('dashboard/job/' . $type, $name); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | |
@@ -312,6 +312,6 @@ discard block |
||
312 | 312 | * @since 2017.08 |
313 | 313 | * @category Developer |
314 | 314 | */ |
315 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/dashboard/job/standard/subparts', [] ); |
|
315 | + return $this->getContext()->getConfig()->get('admin/jqadm/dashboard/job/standard/subparts', []); |
|
316 | 316 | } |
317 | 317 | } |