@@ -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-customer-lists-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-customer-lists-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-customer-lists-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-customer-lists-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/customer/lists', 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-customer-lists-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-customer-lists-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-customer-lists-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-customer-lists-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/customer/lists', $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-customer-lists-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-customer-lists-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-customer-lists-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-customer-lists-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\Customer\Lists; |
12 | 12 | |
13 | -sprintf( 'type/customer/lists' ); // for translation |
|
13 | +sprintf('type/customer/lists'); // 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, 'customer/lists/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'customer/lists/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-customer-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-customer-lists-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-customer-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-customer-lists-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, 'customer/lists/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'customer/lists/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['customer.lists.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-customer-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-customer-lists-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-customer-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-customer-lists-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, 'customer/lists/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'customer/lists/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/customer/lists', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/customer/lists', 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-customer-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-customer-lists-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-customer-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-customer-lists-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, 'customer/lists/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'customer/lists/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-customer-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-customer-lists-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-customer-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-customer-lists-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, 'customer/lists/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'customer/lists/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/customer/lists', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/customer/lists', $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-customer-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-customer-lists-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-customer-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-customer-lists-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/customer/lists' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'customer/lists/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/customer/lists'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'customer/lists/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-customer-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-customer-lists-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-customer-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-customer-lists-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/customer/lists/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/customer/lists/template-list'; |
327 | 327 | $default = 'type/customer/lists/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/customer/lists/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/customer/lists/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/customer/lists/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/customer/lists' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/customer/lists' . $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/customer/lists/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/customer/lists/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(), 'customer/lists/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/lists/type'); |
|
473 | 473 | |
474 | - if( isset( $data['customer.lists.type.id'] ) && $data['customer.lists.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['customer.lists.type.id'] ); |
|
474 | + if (isset($data['customer.lists.type.id']) && $data['customer.lists.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['customer.lists.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['customer.lists.type.code'] = $data['customer.lists.type.code'] . '_copy'; |
499 | 499 | $data['customer.lists.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/customer/lists/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/customer/lists/template-item'; |
534 | 534 | $default = 'type/customer/lists/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-price-lists-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-price-lists-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-price-lists-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-price-lists-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/price/lists', 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-price-lists-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-price-lists-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-price-lists-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-price-lists-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/price/lists', $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-price-lists-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-price-lists-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-price-lists-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-price-lists-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\Price\Lists; |
12 | 12 | |
13 | -sprintf( 'type/price/lists' ); // for translation |
|
13 | +sprintf('type/price/lists'); // 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, 'price/lists/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'price/lists/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-price-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-price-lists-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-price-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-price-lists-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, 'price/lists/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'price/lists/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['price.lists.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-price-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-price-lists-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-price-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-price-lists-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, 'price/lists/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'price/lists/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/price/lists', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/price/lists', 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-price-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-price-lists-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-price-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-price-lists-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, 'price/lists/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'price/lists/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-price-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-price-lists-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-price-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-price-lists-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, 'price/lists/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'price/lists/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/price/lists', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/price/lists', $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-price-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-price-lists-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-price-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-price-lists-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/price/lists' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'price/lists/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/price/lists'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'price/lists/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-price-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-price-lists-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-price-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-price-lists-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/price/lists/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/price/lists/template-list'; |
327 | 327 | $default = 'type/price/lists/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/price/lists/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/price/lists/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/price/lists/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/price/lists' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/price/lists' . $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/price/lists/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/price/lists/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(), 'price/lists/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'price/lists/type'); |
|
473 | 473 | |
474 | - if( isset( $data['price.lists.type.id'] ) && $data['price.lists.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['price.lists.type.id'] ); |
|
474 | + if (isset($data['price.lists.type.id']) && $data['price.lists.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['price.lists.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['price.lists.type.code'] = $data['price.lists.type.code'] . '_copy'; |
499 | 499 | $data['price.lists.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/price/lists/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/price/lists/template-item'; |
534 | 534 | $default = 'type/price/lists/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-price-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-price-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-price-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-price-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/price', 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-price-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-price-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-price-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-price-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/price', $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-price-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-price-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-price-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-price-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\Price; |
12 | 12 | |
13 | -sprintf( 'type/price' ); // for translation |
|
13 | +sprintf('type/price'); // 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, 'price/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'price/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-price-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-price-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-price-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-price-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, 'price/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'price/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['price.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-price-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-price-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-price-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-price-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, 'price/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'price/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/price', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/price', 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-price-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-price-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-price-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-price-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, 'price/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'price/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-price-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-price-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-price-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-price-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, 'price/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'price/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/price', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/price', $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-price-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-price-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-price-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-price-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/price' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'price/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/price'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'price/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-price-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-price-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-price-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-price-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/price/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/price/template-list'; |
327 | 327 | $default = 'type/price/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/price/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/price/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/price/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/price' . $type, $name ); |
|
415 | + return $this->createSubClient('type/price' . $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/price/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/price/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(), 'price/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'price/type'); |
|
473 | 473 | |
474 | - if( isset( $data['price.type.id'] ) && $data['price.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['price.type.id'] ); |
|
474 | + if (isset($data['price.type.id']) && $data['price.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['price.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['price.type.code'] = $data['price.type.code'] . '_copy'; |
499 | 499 | $data['price.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/price/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/price/template-item'; |
534 | 534 | $default = 'type/price/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-attribute-lists-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-attribute-lists-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-attribute-lists-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-attribute-lists-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/attribute/lists', 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-attribute-lists-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-attribute-lists-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-attribute-lists-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-attribute-lists-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/attribute/lists', $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-attribute-lists-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-attribute-lists-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-attribute-lists-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-attribute-lists-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\Attribute\Lists; |
12 | 12 | |
13 | -sprintf( 'type/attribute/lists' ); // for translation |
|
13 | +sprintf('type/attribute/lists'); // 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, 'attribute/lists/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'attribute/lists/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-attribute-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-attribute-lists-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-attribute-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-attribute-lists-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, 'attribute/lists/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'attribute/lists/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['attribute.lists.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-attribute-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-attribute-lists-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-attribute-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-attribute-lists-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, 'attribute/lists/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'attribute/lists/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/attribute/lists', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/attribute/lists', 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-attribute-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-attribute-lists-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-attribute-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-attribute-lists-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, 'attribute/lists/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'attribute/lists/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-attribute-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-attribute-lists-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-attribute-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-attribute-lists-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, 'attribute/lists/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'attribute/lists/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/attribute/lists', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/attribute/lists', $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-attribute-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-attribute-lists-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-attribute-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-attribute-lists-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/attribute/lists' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'attribute/lists/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/attribute/lists'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'attribute/lists/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-attribute-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-attribute-lists-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-attribute-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-attribute-lists-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/attribute/lists/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/attribute/lists/template-list'; |
327 | 327 | $default = 'type/attribute/lists/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/attribute/lists/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/attribute/lists/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/attribute/lists/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/attribute/lists' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/attribute/lists' . $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/attribute/lists/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/attribute/lists/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(), 'attribute/lists/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'attribute/lists/type'); |
|
473 | 473 | |
474 | - if( isset( $data['attribute.lists.type.id'] ) && $data['attribute.lists.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['attribute.lists.type.id'] ); |
|
474 | + if (isset($data['attribute.lists.type.id']) && $data['attribute.lists.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['attribute.lists.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['attribute.lists.type.code'] = $data['attribute.lists.type.code'] . '_copy'; |
499 | 499 | $data['attribute.lists.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/attribute/lists/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/attribute/lists/template-item'; |
534 | 534 | $default = 'type/attribute/lists/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-attribute-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-attribute-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-attribute-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-attribute-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/attribute/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-attribute-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-attribute-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-attribute-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-attribute-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/attribute/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-attribute-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-attribute-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-attribute-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-attribute-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\Attribute\Property; |
12 | 12 | |
13 | -sprintf( 'type/attribute/property' ); // for translation |
|
13 | +sprintf('type/attribute/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, 'attribute/property/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'attribute/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-attribute-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-attribute-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-attribute-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-attribute-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, 'attribute/property/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'attribute/property/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['attribute.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-attribute-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-attribute-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-attribute-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-attribute-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, 'attribute/property/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'attribute/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/attribute/property', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/attribute/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-attribute-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-attribute-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-attribute-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-attribute-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, 'attribute/property/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'attribute/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-attribute-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-attribute-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-attribute-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-attribute-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, 'attribute/property/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'attribute/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/attribute/property', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/attribute/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-attribute-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-attribute-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-attribute-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-attribute-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/attribute/property' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'attribute/property/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/attribute/property'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'attribute/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-attribute-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-attribute-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-attribute-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-attribute-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/attribute/property/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/attribute/property/template-list'; |
327 | 327 | $default = 'type/attribute/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( $propertytype, $name = null ) |
|
340 | + public function getSubClient($propertytype, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/type/attribute/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/attribute/property/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/attribute/property/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/attribute/property' . $propertytype, $name ); |
|
415 | + return $this->createSubClient('type/attribute/property' . $propertytype, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2018.01 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/type/attribute/property/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/attribute/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(), 'attribute/property/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'attribute/property/type'); |
|
473 | 473 | |
474 | - if( isset( $data['attribute.property.type.id'] ) && $data['attribute.property.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['attribute.property.type.id'] ); |
|
474 | + if (isset($data['attribute.property.type.id']) && $data['attribute.property.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['attribute.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['attribute.property.type.code'] = $data['attribute.property.type.code'] . '_copy'; |
499 | 499 | $data['attribute.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/attribute/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/attribute/property/template-item'; |
534 | 534 | $default = 'type/attribute/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-attribute-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-attribute-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-attribute-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-attribute-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/attribute', 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-attribute-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-attribute-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-attribute-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-attribute-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/attribute', $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-attribute-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-attribute-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-attribute-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-attribute-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\Attribute; |
12 | 12 | |
13 | -sprintf( 'type/attribute' ); // for translation |
|
13 | +sprintf('type/attribute'); // 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, 'attribute/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'attribute/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-attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-attribute-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-attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-attribute-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, 'attribute/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'attribute/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['attribute.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-attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-attribute-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-attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-attribute-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, 'attribute/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'attribute/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/attribute', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/attribute', 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-attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-attribute-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-attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-attribute-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, 'attribute/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'attribute/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-attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-attribute-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-attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-attribute-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, 'attribute/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'attribute/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/attribute', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/attribute', $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-attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-attribute-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-attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-attribute-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/attribute' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'attribute/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/attribute'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'attribute/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-attribute-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-attribute-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-attribute-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-attribute-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/attribute/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/attribute/template-list'; |
327 | 327 | $default = 'type/attribute/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/attribute/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/attribute/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/attribute/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/attribute' . $type, $name ); |
|
415 | + return $this->createSubClient('type/attribute' . $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/attribute/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/attribute/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(), 'attribute/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'attribute/type'); |
|
473 | 473 | |
474 | - if( isset( $data['attribute.type.id'] ) && $data['attribute.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['attribute.type.id'] ); |
|
474 | + if (isset($data['attribute.type.id']) && $data['attribute.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['attribute.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['attribute.type.code'] = $data['attribute.type.code'] . '_copy'; |
499 | 499 | $data['attribute.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/attribute/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/attribute/template-item'; |
534 | 534 | $default = 'type/attribute/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-catalog-lists-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-catalog-lists-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-catalog-lists-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-catalog-lists-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/catalog/lists', 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-catalog-lists-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-catalog-lists-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-catalog-lists-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-catalog-lists-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/catalog/lists', $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-catalog-lists-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-catalog-lists-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-catalog-lists-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-catalog-lists-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\Catalog\Lists; |
12 | 12 | |
13 | -sprintf( 'type/catalog/lists' ); // for translation |
|
13 | +sprintf('type/catalog/lists'); // 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, 'catalog/lists/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'catalog/lists/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-catalog-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-catalog-lists-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-catalog-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-catalog-lists-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, 'catalog/lists/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'catalog/lists/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['catalog.lists.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-catalog-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-catalog-lists-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-catalog-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-catalog-lists-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, 'catalog/lists/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'catalog/lists/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/catalog/lists', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/catalog/lists', 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-catalog-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-catalog-lists-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-catalog-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-catalog-lists-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, 'catalog/lists/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'catalog/lists/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-catalog-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-catalog-lists-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-catalog-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-catalog-lists-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, 'catalog/lists/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'catalog/lists/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/catalog/lists', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/catalog/lists', $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-catalog-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-catalog-lists-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-catalog-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-catalog-lists-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/catalog/lists' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'catalog/lists/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/catalog/lists'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'catalog/lists/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-catalog-lists-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-catalog-lists-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-catalog-lists-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-catalog-lists-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/catalog/lists/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/catalog/lists/template-list'; |
327 | 327 | $default = 'type/catalog/lists/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/catalog/lists/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/catalog/lists/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/catalog/lists/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/catalog/lists' . $liststype, $name ); |
|
415 | + return $this->createSubClient('type/catalog/lists' . $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/catalog/lists/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/catalog/lists/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(), 'catalog/lists/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists/type'); |
|
473 | 473 | |
474 | - if( isset( $data['catalog.lists.type.id'] ) && $data['catalog.lists.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['catalog.lists.type.id'] ); |
|
474 | + if (isset($data['catalog.lists.type.id']) && $data['catalog.lists.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['catalog.lists.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['catalog.lists.type.code'] = $data['catalog.lists.type.code'] . '_copy'; |
499 | 499 | $data['catalog.lists.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/catalog/lists/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/catalog/lists/template-item'; |
534 | 534 | $default = 'type/catalog/lists/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-tag-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-tag-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-tag-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-tag-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/tag', 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-tag-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-tag-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-tag-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-tag-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/tag', $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-tag-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-tag-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-tag-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-tag-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\Tag; |
12 | 12 | |
13 | -sprintf( 'type/tag' ); // for translation |
|
13 | +sprintf('type/tag'); // 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, 'tag/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'tag/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-tag-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-tag-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-tag-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-tag-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, 'tag/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'tag/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['tag.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-tag-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-tag-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-tag-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-tag-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, 'tag/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'tag/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/tag', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/tag', 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-tag-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-tag-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-tag-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-tag-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, 'tag/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'tag/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-tag-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-tag-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-tag-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-tag-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, 'tag/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'tag/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/tag', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/tag', $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-tag-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-tag-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-tag-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-tag-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/tag' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'tag/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/tag'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'tag/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-tag-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-tag-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-tag-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-tag-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/tag/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/tag/template-list'; |
327 | 327 | $default = 'type/tag/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/tag/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/tag/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/tag/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/tag' . $type, $name ); |
|
415 | + return $this->createSubClient('type/tag' . $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/tag/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/tag/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(), 'tag/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'tag/type'); |
|
473 | 473 | |
474 | - if( isset( $data['tag.type.id'] ) && $data['tag.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['tag.type.id'] ); |
|
474 | + if (isset($data['tag.type.id']) && $data['tag.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['tag.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['tag.type.code'] = $data['tag.type.code'] . '_copy'; |
499 | 499 | $data['tag.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/tag/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/tag/template-item'; |
534 | 534 | $default = 'type/tag/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-stock-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-stock-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-stock-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-stock-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/stock', 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-stock-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-stock-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-stock-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-stock-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/stock', $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-stock-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-stock-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-stock-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-stock-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\Stock; |
12 | 12 | |
13 | -sprintf( 'type/stock' ); // for translation |
|
13 | +sprintf('type/stock'); // 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, 'stock/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'stock/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-stock-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-stock-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-stock-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-stock-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, 'stock/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'stock/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['stock.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-stock-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-stock-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-stock-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-stock-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, 'stock/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'stock/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/stock', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/stock', 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-stock-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-stock-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-stock-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-stock-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, 'stock/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'stock/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-stock-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-stock-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-stock-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-stock-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, 'stock/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'stock/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/stock', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/stock', $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-stock-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-stock-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-stock-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-stock-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/stock' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'stock/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/stock'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'stock/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-stock-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-stock-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-stock-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-stock-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/stock/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/stock/template-list'; |
327 | 327 | $default = 'type/stock/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/stock/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/stock/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/stock/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/stock' . $type, $name ); |
|
415 | + return $this->createSubClient('type/stock' . $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/stock/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/stock/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(), 'stock/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'stock/type'); |
|
473 | 473 | |
474 | - if( isset( $data['stock.type.id'] ) && $data['stock.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['stock.type.id'] ); |
|
474 | + if (isset($data['stock.type.id']) && $data['stock.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['stock.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['stock.type.code'] = $data['stock.type.code'] . '_copy'; |
499 | 499 | $data['stock.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/stock/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/stock/template-item'; |
534 | 534 | $default = 'type/stock/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |