@@ -160,14 +160,12 @@ |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | return; |
163 | - } |
|
164 | - catch( \Aimeos\MShop\Exception $e ) |
|
163 | + } catch( \Aimeos\MShop\Exception $e ) |
|
165 | 164 | { |
166 | 165 | $error = array( 'supplier-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
167 | 166 | $view->errors = $view->get( 'errors', [] ) + $error; |
168 | 167 | $this->logException( $e ); |
169 | - } |
|
170 | - catch( \Exception $e ) |
|
168 | + } catch( \Exception $e ) |
|
171 | 169 | { |
172 | 170 | $error = array( 'supplier-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
173 | 171 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Supplier\Text; |
12 | 12 | |
13 | -sprintf( 'text' ); // for translation |
|
13 | +sprintf('text'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->textData = $this->toArray( $view->item, true ); |
|
47 | + $view->textData = $this->toArray($view->item, true); |
|
48 | 48 | $view->textBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->textBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'text', [] ); |
|
67 | + $data = $view->param('text', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) |
|
69 | + foreach ($data as $idx => $entry) |
|
70 | 70 | { |
71 | 71 | $data[$idx]['supplier.lists.siteid'] = $siteid; |
72 | 72 | $data[$idx]['text.siteid'] = $siteid; |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->textData = $data; |
76 | 76 | $view->textBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->textBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | parent::delete(); |
92 | 92 | |
93 | 93 | $item = $this->getView()->item; |
94 | - $item->deleteListItems( $item->getListItems( 'text', null, null, false ), true ); |
|
94 | + $item->deleteListItems($item->getListItems('text', null, null, false), true); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -102,16 +102,16 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function get() |
104 | 104 | { |
105 | - $view = $this->addViewData( $this->getView() ); |
|
105 | + $view = $this->addViewData($this->getView()); |
|
106 | 106 | |
107 | - $view->textData = $this->toArray( $view->item ); |
|
107 | + $view->textData = $this->toArray($view->item); |
|
108 | 108 | $view->textBody = ''; |
109 | 109 | |
110 | - foreach( $this->getSubClients() as $client ) { |
|
110 | + foreach ($this->getSubClients() as $client) { |
|
111 | 111 | $view->textBody .= $client->get(); |
112 | 112 | } |
113 | 113 | |
114 | - return $this->render( $view ); |
|
114 | + return $this->render($view); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -124,26 +124,26 @@ discard block |
||
124 | 124 | |
125 | 125 | try |
126 | 126 | { |
127 | - $view->item = $this->fromArray( $view->item, $view->param( 'text', [] ) ); |
|
127 | + $view->item = $this->fromArray($view->item, $view->param('text', [])); |
|
128 | 128 | $view->textBody = ''; |
129 | 129 | |
130 | - foreach( $this->getSubClients() as $client ) { |
|
130 | + foreach ($this->getSubClients() as $client) { |
|
131 | 131 | $view->textBody .= $client->save(); |
132 | 132 | } |
133 | 133 | |
134 | 134 | return; |
135 | 135 | } |
136 | - catch( \Aimeos\MShop\Exception $e ) |
|
136 | + catch (\Aimeos\MShop\Exception $e) |
|
137 | 137 | { |
138 | - $error = array( 'supplier-item-text' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
139 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
140 | - $this->logException( $e ); |
|
138 | + $error = array('supplier-item-text' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
139 | + $view->errors = $view->get('errors', []) + $error; |
|
140 | + $this->logException($e); |
|
141 | 141 | } |
142 | - catch( \Exception $e ) |
|
142 | + catch (\Exception $e) |
|
143 | 143 | { |
144 | - $error = array( 'supplier-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
145 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
146 | - $this->logException( $e ); |
|
144 | + $error = array('supplier-item-text' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
145 | + $view->errors = $view->get('errors', []) + $error; |
|
146 | + $this->logException($e); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
158 | 158 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
159 | 159 | */ |
160 | - public function getSubClient( $type, $name = null ) |
|
160 | + public function getSubClient($type, $name = null) |
|
161 | 161 | { |
162 | 162 | /** admin/jqadm/supplier/text/decorators/excludes |
163 | 163 | * Excludes decorators added by the "common" option from the supplier JQAdm client |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @see admin/jqadm/supplier/text/decorators/excludes |
233 | 233 | * @see admin/jqadm/supplier/text/decorators/global |
234 | 234 | */ |
235 | - return $this->createSubClient( 'supplier/text/' . $type, $name ); |
|
235 | + return $this->createSubClient('supplier/text/' . $type, $name); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @since 2018.07 |
277 | 277 | * @category Developer |
278 | 278 | */ |
279 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/text/standard/subparts', [] ); |
|
279 | + return $this->getContext()->getConfig()->get('admin/jqadm/supplier/text/standard/subparts', []); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | |
@@ -286,23 +286,23 @@ discard block |
||
286 | 286 | * @param \Aimeos\MW\View\Iface $view View object |
287 | 287 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
288 | 288 | */ |
289 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
289 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
290 | 290 | { |
291 | 291 | $context = $this->getContext(); |
292 | 292 | |
293 | - $textTypeManager = \Aimeos\MShop::create( $context, 'text/type' ); |
|
294 | - $listTypeManager = \Aimeos\MShop::create( $context, 'supplier/lists/type' ); |
|
293 | + $textTypeManager = \Aimeos\MShop::create($context, 'text/type'); |
|
294 | + $listTypeManager = \Aimeos\MShop::create($context, 'supplier/lists/type'); |
|
295 | 295 | |
296 | - $search = $textTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
297 | - $search->setConditions( $search->compare( '==', 'text.type.domain', 'supplier' ) ); |
|
298 | - $search->setSortations( array( $search->sort( '+', 'text.type.label' ) ) ); |
|
296 | + $search = $textTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
297 | + $search->setConditions($search->compare('==', 'text.type.domain', 'supplier')); |
|
298 | + $search->setSortations(array($search->sort('+', 'text.type.label'))); |
|
299 | 299 | |
300 | - $listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
301 | - $listSearch->setConditions( $listSearch->compare( '==', 'supplier.lists.type.domain', 'text' ) ); |
|
302 | - $listSearch->setSortations( array( $listSearch->sort( '+', 'supplier.lists.type.label' ) ) ); |
|
300 | + $listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
301 | + $listSearch->setConditions($listSearch->compare('==', 'supplier.lists.type.domain', 'text')); |
|
302 | + $listSearch->setSortations(array($listSearch->sort('+', 'supplier.lists.type.label'))); |
|
303 | 303 | |
304 | - $view->textTypes = $textTypeManager->searchItems( $search ); |
|
305 | - $view->textListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) ); |
|
304 | + $view->textTypes = $textTypeManager->searchItems($search); |
|
305 | + $view->textListTypes = $this->sortType($listTypeManager->searchItems($listSearch)); |
|
306 | 306 | |
307 | 307 | return $view; |
308 | 308 | } |
@@ -314,50 +314,50 @@ discard block |
||
314 | 314 | * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object without referenced domain items |
315 | 315 | * @param string[] $data Data array |
316 | 316 | */ |
317 | - protected function fromArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data ) |
|
317 | + protected function fromArray(\Aimeos\MShop\Supplier\Item\Iface $item, array $data) |
|
318 | 318 | { |
319 | 319 | $context = $this->getContext(); |
320 | 320 | |
321 | - $textManager = \Aimeos\MShop::create( $context, 'text' ); |
|
322 | - $listManager = \Aimeos\MShop::create( $context, 'supplier/lists' ); |
|
321 | + $textManager = \Aimeos\MShop::create($context, 'text'); |
|
322 | + $listManager = \Aimeos\MShop::create($context, 'supplier/lists'); |
|
323 | 323 | |
324 | - $listItems = $item->getListItems( 'text', null, null, false ); |
|
324 | + $listItems = $item->getListItems('text', null, null, false); |
|
325 | 325 | |
326 | 326 | |
327 | - foreach( $data as $idx => $entry ) |
|
327 | + foreach ($data as $idx => $entry) |
|
328 | 328 | { |
329 | - if( trim( $this->getValue( $entry, 'text.content', '' ) ) === '' ) { |
|
329 | + if (trim($this->getValue($entry, 'text.content', '')) === '') { |
|
330 | 330 | continue; |
331 | 331 | } |
332 | 332 | |
333 | - if( ( $listItem = $item->getListItem( 'text', $entry['supplier.lists.type'], $entry['text.id'], false ) ) === null ) { |
|
333 | + if (($listItem = $item->getListItem('text', $entry['supplier.lists.type'], $entry['text.id'], false)) === null) { |
|
334 | 334 | $listItem = $listManager->createItem(); |
335 | 335 | } |
336 | 336 | |
337 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
337 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
338 | 338 | $refItem = $textManager->createItem(); |
339 | 339 | } |
340 | 340 | |
341 | - $refItem->fromArray( $entry ); |
|
341 | + $refItem->fromArray($entry); |
|
342 | 342 | $conf = []; |
343 | 343 | |
344 | - foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key ) |
|
344 | + foreach ((array) $this->getValue($entry, 'config/key') as $num => $key) |
|
345 | 345 | { |
346 | - if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) { |
|
347 | - $conf[$key] = trim( $val ); |
|
346 | + if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) { |
|
347 | + $conf[$key] = trim($val); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
351 | - $listItem->fromArray( $entry ); |
|
352 | - $listItem->setPosition( $idx ); |
|
353 | - $listItem->setConfig( $conf ); |
|
351 | + $listItem->fromArray($entry); |
|
352 | + $listItem->setPosition($idx); |
|
353 | + $listItem->setConfig($conf); |
|
354 | 354 | |
355 | - $item->addListItem( 'text', $listItem, $refItem ); |
|
355 | + $item->addListItem('text', $listItem, $refItem); |
|
356 | 356 | |
357 | - unset( $listItems[$listItem->getId()] ); |
|
357 | + unset($listItems[$listItem->getId()]); |
|
358 | 358 | } |
359 | 359 | |
360 | - return $item->deleteListItems( $listItems, true ); |
|
360 | + return $item->deleteListItems($listItems, true); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
@@ -368,20 +368,20 @@ discard block |
||
368 | 368 | * @param boolean $copy True if items should be copied, false if not |
369 | 369 | * @return string[] Multi-dimensional associative list of item data |
370 | 370 | */ |
371 | - protected function toArray( \Aimeos\MShop\Supplier\Item\Iface $item, $copy = false ) |
|
371 | + protected function toArray(\Aimeos\MShop\Supplier\Item\Iface $item, $copy = false) |
|
372 | 372 | { |
373 | 373 | $data = []; |
374 | 374 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
375 | 375 | |
376 | - foreach( $item->getListItems( 'text', null, null, false ) as $listItem ) |
|
376 | + foreach ($item->getListItems('text', null, null, false) as $listItem) |
|
377 | 377 | { |
378 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
378 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
379 | 379 | continue; |
380 | 380 | } |
381 | 381 | |
382 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
382 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
383 | 383 | |
384 | - if( $copy === true ) |
|
384 | + if ($copy === true) |
|
385 | 385 | { |
386 | 386 | $list['supplier.lists.siteid'] = $siteId; |
387 | 387 | $list['supplier.lists.id'] = ''; |
@@ -389,10 +389,10 @@ discard block |
||
389 | 389 | $list['text.id'] = null; |
390 | 390 | } |
391 | 391 | |
392 | - $list['supplier.lists.datestart'] = str_replace( ' ', 'T', $list['supplier.lists.datestart'] ); |
|
393 | - $list['supplier.lists.dateend'] = str_replace( ' ', 'T', $list['supplier.lists.dateend'] ); |
|
392 | + $list['supplier.lists.datestart'] = str_replace(' ', 'T', $list['supplier.lists.datestart']); |
|
393 | + $list['supplier.lists.dateend'] = str_replace(' ', 'T', $list['supplier.lists.dateend']); |
|
394 | 394 | |
395 | - foreach( $list['supplier.lists.config'] as $key => $val ) |
|
395 | + foreach ($list['supplier.lists.config'] as $key => $val) |
|
396 | 396 | { |
397 | 397 | $list['config']['key'][] = $key; |
398 | 398 | $list['config']['val'][] = $val; |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
412 | 412 | * @return string HTML output |
413 | 413 | */ |
414 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
414 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
415 | 415 | { |
416 | 416 | /** admin/jqadm/supplier/text/template-item |
417 | 417 | * Relative path to the HTML body template of the text subpart for suppliers. |
@@ -435,6 +435,6 @@ discard block |
||
435 | 435 | $tplconf = 'admin/jqadm/supplier/text/template-item'; |
436 | 436 | $default = 'supplier/item-text-standard'; |
437 | 437 | |
438 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
438 | + return $view->render($view->config($tplconf, $default)); |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | \ No newline at end of file |
@@ -160,14 +160,12 @@ |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | return; |
163 | - } |
|
164 | - catch( \Aimeos\MShop\Exception $e ) |
|
163 | + } catch( \Aimeos\MShop\Exception $e ) |
|
165 | 164 | { |
166 | 165 | $error = array( 'attribute-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
167 | 166 | $view->errors = $view->get( 'errors', [] ) + $error; |
168 | 167 | $this->logException( $e ); |
169 | - } |
|
170 | - catch( \Exception $e ) |
|
168 | + } catch( \Exception $e ) |
|
171 | 169 | { |
172 | 170 | $error = array( 'attribute-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
173 | 171 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Attribute\Price; |
12 | 12 | |
13 | -sprintf( 'price' ); // for translation |
|
13 | +sprintf('price'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->priceData = $this->toArray( $view->item, true ); |
|
47 | + $view->priceData = $this->toArray($view->item, true); |
|
48 | 48 | $view->priceBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->priceBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'price', [] ); |
|
67 | + $data = $view->param('price', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) |
|
69 | + foreach ($data as $idx => $entry) |
|
70 | 70 | { |
71 | 71 | $data[$idx]['attribute.lists.siteid'] = $siteid; |
72 | 72 | $data[$idx]['price.siteid'] = $siteid; |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->priceData = $data; |
76 | 76 | $view->priceBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->priceBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | parent::delete(); |
92 | 92 | |
93 | 93 | $item = $this->getView()->item; |
94 | - $item->deleteListItems( $item->getListItems( 'price', null, null, false ), true ); |
|
94 | + $item->deleteListItems($item->getListItems('price', null, null, false), true); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -102,16 +102,16 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function get() |
104 | 104 | { |
105 | - $view = $this->addViewData( $this->getView() ); |
|
105 | + $view = $this->addViewData($this->getView()); |
|
106 | 106 | |
107 | - $view->priceData = $this->toArray( $view->item ); |
|
107 | + $view->priceData = $this->toArray($view->item); |
|
108 | 108 | $view->priceBody = ''; |
109 | 109 | |
110 | - foreach( $this->getSubClients() as $client ) { |
|
110 | + foreach ($this->getSubClients() as $client) { |
|
111 | 111 | $view->priceBody .= $client->get(); |
112 | 112 | } |
113 | 113 | |
114 | - return $this->render( $view ); |
|
114 | + return $this->render($view); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -124,26 +124,26 @@ discard block |
||
124 | 124 | |
125 | 125 | try |
126 | 126 | { |
127 | - $view->item = $this->fromArray( $view->item, $view->param( 'price', [] ) ); |
|
127 | + $view->item = $this->fromArray($view->item, $view->param('price', [])); |
|
128 | 128 | $view->priceBody = ''; |
129 | 129 | |
130 | - foreach( $this->getSubClients() as $client ) { |
|
130 | + foreach ($this->getSubClients() as $client) { |
|
131 | 131 | $view->priceBody .= $client->save(); |
132 | 132 | } |
133 | 133 | |
134 | 134 | return; |
135 | 135 | } |
136 | - catch( \Aimeos\MShop\Exception $e ) |
|
136 | + catch (\Aimeos\MShop\Exception $e) |
|
137 | 137 | { |
138 | - $error = array( 'attribute-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
139 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
140 | - $this->logException( $e ); |
|
138 | + $error = array('attribute-item-price' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
139 | + $view->errors = $view->get('errors', []) + $error; |
|
140 | + $this->logException($e); |
|
141 | 141 | } |
142 | - catch( \Exception $e ) |
|
142 | + catch (\Exception $e) |
|
143 | 143 | { |
144 | - $error = array( 'attribute-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
145 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
146 | - $this->logException( $e ); |
|
144 | + $error = array('attribute-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
145 | + $view->errors = $view->get('errors', []) + $error; |
|
146 | + $this->logException($e); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
158 | 158 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
159 | 159 | */ |
160 | - public function getSubClient( $type, $name = null ) |
|
160 | + public function getSubClient($type, $name = null) |
|
161 | 161 | { |
162 | 162 | /** admin/jqadm/attribute/price/decorators/excludes |
163 | 163 | * Excludes decorators added by the "common" option from the attribute JQAdm client |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @see admin/jqadm/attribute/price/decorators/excludes |
233 | 233 | * @see admin/jqadm/attribute/price/decorators/global |
234 | 234 | */ |
235 | - return $this->createSubClient( 'attribute/price/' . $type, $name ); |
|
235 | + return $this->createSubClient('attribute/price/' . $type, $name); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @since 2016.01 |
277 | 277 | * @category Developer |
278 | 278 | */ |
279 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/price/standard/subparts', [] ); |
|
279 | + return $this->getContext()->getConfig()->get('admin/jqadm/attribute/price/standard/subparts', []); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | |
@@ -286,28 +286,28 @@ discard block |
||
286 | 286 | * @param \Aimeos\MW\View\Iface $view View object |
287 | 287 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
288 | 288 | */ |
289 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
289 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
290 | 290 | { |
291 | 291 | $context = $this->getContext(); |
292 | 292 | |
293 | - $priceTypeManager = \Aimeos\MShop::create( $context, 'price/type' ); |
|
294 | - $listTypeManager = \Aimeos\MShop::create( $context, 'attribute/lists/type' ); |
|
295 | - $currencyManager = \Aimeos\MShop::create( $context, 'locale/currency' ); |
|
293 | + $priceTypeManager = \Aimeos\MShop::create($context, 'price/type'); |
|
294 | + $listTypeManager = \Aimeos\MShop::create($context, 'attribute/lists/type'); |
|
295 | + $currencyManager = \Aimeos\MShop::create($context, 'locale/currency'); |
|
296 | 296 | |
297 | - $search = $priceTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
298 | - $search->setConditions( $search->compare( '==', 'price.type.domain', 'attribute' ) ); |
|
299 | - $search->setSortations( array( $search->sort( '+', 'price.type.label' ) ) ); |
|
297 | + $search = $priceTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
298 | + $search->setConditions($search->compare('==', 'price.type.domain', 'attribute')); |
|
299 | + $search->setSortations(array($search->sort('+', 'price.type.label'))); |
|
300 | 300 | |
301 | - $listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
302 | - $listSearch->setConditions( $listSearch->compare( '==', 'attribute.lists.type.domain', 'price' ) ); |
|
303 | - $listSearch->setSortations( array( $listSearch->sort( '+', 'attribute.lists.type.label' ) ) ); |
|
301 | + $listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
302 | + $listSearch->setConditions($listSearch->compare('==', 'attribute.lists.type.domain', 'price')); |
|
303 | + $listSearch->setSortations(array($listSearch->sort('+', 'attribute.lists.type.label'))); |
|
304 | 304 | |
305 | - $view->priceTypes = $priceTypeManager->searchItems( $search ); |
|
306 | - $view->priceListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) ); |
|
307 | - $view->priceCurrencies = $currencyManager->searchItems( $currencyManager->createSearch( true )->setSlice( 0, 0x7fffffff ) ); |
|
305 | + $view->priceTypes = $priceTypeManager->searchItems($search); |
|
306 | + $view->priceListTypes = $this->sortType($listTypeManager->searchItems($listSearch)); |
|
307 | + $view->priceCurrencies = $currencyManager->searchItems($currencyManager->createSearch(true)->setSlice(0, 0x7fffffff)); |
|
308 | 308 | |
309 | - if( $view->priceCurrencies === [] ) { |
|
310 | - throw new \Aimeos\Admin\JQAdm\Exception( 'No currencies available. Please enable at least one currency' ); |
|
309 | + if ($view->priceCurrencies === []) { |
|
310 | + throw new \Aimeos\Admin\JQAdm\Exception('No currencies available. Please enable at least one currency'); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | return $view; |
@@ -320,46 +320,46 @@ discard block |
||
320 | 320 | * @param \Aimeos\MShop\Attribute\Item\Iface $item Attribute item object without referenced domain items |
321 | 321 | * @param string[] $data Data array |
322 | 322 | */ |
323 | - protected function fromArray( \Aimeos\MShop\Attribute\Item\Iface $item, array $data ) |
|
323 | + protected function fromArray(\Aimeos\MShop\Attribute\Item\Iface $item, array $data) |
|
324 | 324 | { |
325 | 325 | $context = $this->getContext(); |
326 | 326 | |
327 | - $priceManager = \Aimeos\MShop::create( $context, 'price' ); |
|
328 | - $listManager = \Aimeos\MShop::create( $context, 'attribute/lists' ); |
|
327 | + $priceManager = \Aimeos\MShop::create($context, 'price'); |
|
328 | + $listManager = \Aimeos\MShop::create($context, 'attribute/lists'); |
|
329 | 329 | |
330 | - $listItems = $item->getListItems( 'price', null, null, false ); |
|
330 | + $listItems = $item->getListItems('price', null, null, false); |
|
331 | 331 | |
332 | 332 | |
333 | - foreach( $data as $idx => $entry ) |
|
333 | + foreach ($data as $idx => $entry) |
|
334 | 334 | { |
335 | - if( ( $listItem = $item->getListItem( 'price', $entry['attribute.lists.type'], $entry['price.id'], false ) ) === null ) { |
|
335 | + if (($listItem = $item->getListItem('price', $entry['attribute.lists.type'], $entry['price.id'], false)) === null) { |
|
336 | 336 | $listItem = $listManager->createItem(); |
337 | 337 | } |
338 | 338 | |
339 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
339 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
340 | 340 | $refItem = $priceManager->createItem(); |
341 | 341 | } |
342 | 342 | |
343 | - $refItem->fromArray( $entry ); |
|
343 | + $refItem->fromArray($entry); |
|
344 | 344 | $conf = []; |
345 | 345 | |
346 | - foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key ) |
|
346 | + foreach ((array) $this->getValue($entry, 'config/key') as $num => $key) |
|
347 | 347 | { |
348 | - if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) { |
|
349 | - $conf[$key] = trim( $val ); |
|
348 | + if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) { |
|
349 | + $conf[$key] = trim($val); |
|
350 | 350 | } |
351 | 351 | } |
352 | 352 | |
353 | - $listItem->fromArray( $entry ); |
|
354 | - $listItem->setPosition( $idx ); |
|
355 | - $listItem->setConfig( $conf ); |
|
353 | + $listItem->fromArray($entry); |
|
354 | + $listItem->setPosition($idx); |
|
355 | + $listItem->setConfig($conf); |
|
356 | 356 | |
357 | - $item->addListItem( 'price', $listItem, $refItem ); |
|
357 | + $item->addListItem('price', $listItem, $refItem); |
|
358 | 358 | |
359 | - unset( $listItems[$listItem->getId()] ); |
|
359 | + unset($listItems[$listItem->getId()]); |
|
360 | 360 | } |
361 | 361 | |
362 | - return $item->deleteListItems( $listItems, true ); |
|
362 | + return $item->deleteListItems($listItems, true); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | |
@@ -370,20 +370,20 @@ discard block |
||
370 | 370 | * @param boolean $copy True if items should be copied, false if not |
371 | 371 | * @return string[] Multi-dimensional associative list of item data |
372 | 372 | */ |
373 | - protected function toArray( \Aimeos\MShop\Attribute\Item\Iface $item, $copy = false ) |
|
373 | + protected function toArray(\Aimeos\MShop\Attribute\Item\Iface $item, $copy = false) |
|
374 | 374 | { |
375 | 375 | $data = []; |
376 | 376 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
377 | 377 | |
378 | - foreach( $item->getListItems( 'price', null, null, false ) as $listItem ) |
|
378 | + foreach ($item->getListItems('price', null, null, false) as $listItem) |
|
379 | 379 | { |
380 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
380 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
381 | 381 | continue; |
382 | 382 | } |
383 | 383 | |
384 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
384 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
385 | 385 | |
386 | - if( $copy === true ) |
|
386 | + if ($copy === true) |
|
387 | 387 | { |
388 | 388 | $list['attribute.lists.siteid'] = $siteId; |
389 | 389 | $list['attribute.lists.id'] = ''; |
@@ -391,10 +391,10 @@ discard block |
||
391 | 391 | $list['price.id'] = null; |
392 | 392 | } |
393 | 393 | |
394 | - $list['attribute.lists.datestart'] = str_replace( ' ', 'T', $list['attribute.lists.datestart'] ); |
|
395 | - $list['attribute.lists.dateend'] = str_replace( ' ', 'T', $list['attribute.lists.dateend'] ); |
|
394 | + $list['attribute.lists.datestart'] = str_replace(' ', 'T', $list['attribute.lists.datestart']); |
|
395 | + $list['attribute.lists.dateend'] = str_replace(' ', 'T', $list['attribute.lists.dateend']); |
|
396 | 396 | |
397 | - foreach( $list['attribute.lists.config'] as $key => $val ) |
|
397 | + foreach ($list['attribute.lists.config'] as $key => $val) |
|
398 | 398 | { |
399 | 399 | $list['config']['key'][] = $key; |
400 | 400 | $list['config']['val'][] = $val; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
414 | 414 | * @return string HTML output |
415 | 415 | */ |
416 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
416 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
417 | 417 | { |
418 | 418 | /** admin/jqadm/attribute/price/template-item |
419 | 419 | * Relative path to the HTML body template of the price subpart for attributes. |
@@ -437,6 +437,6 @@ discard block |
||
437 | 437 | $tplconf = 'admin/jqadm/attribute/price/template-item'; |
438 | 438 | $default = 'attribute/item-price-standard'; |
439 | 439 | |
440 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
440 | + return $view->render($view->config($tplconf, $default)); |
|
441 | 441 | } |
442 | 442 | } |
443 | 443 | \ No newline at end of file |
@@ -160,14 +160,12 @@ |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | return; |
163 | - } |
|
164 | - catch( \Aimeos\MShop\Exception $e ) |
|
163 | + } catch( \Aimeos\MShop\Exception $e ) |
|
165 | 164 | { |
166 | 165 | $error = array( 'service-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
167 | 166 | $view->errors = $view->get( 'errors', [] ) + $error; |
168 | 167 | $this->logException( $e ); |
169 | - } |
|
170 | - catch( \Exception $e ) |
|
168 | + } catch( \Exception $e ) |
|
171 | 169 | { |
172 | 170 | $error = array( 'service-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
173 | 171 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Service\Price; |
12 | 12 | |
13 | -sprintf( 'price' ); // for translation |
|
13 | +sprintf('price'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->priceData = $this->toArray( $view->item, true ); |
|
47 | + $view->priceData = $this->toArray($view->item, true); |
|
48 | 48 | $view->priceBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->priceBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'price', [] ); |
|
67 | + $data = $view->param('price', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) |
|
69 | + foreach ($data as $idx => $entry) |
|
70 | 70 | { |
71 | 71 | $data[$idx]['service.lists.siteid'] = $siteid; |
72 | 72 | $data[$idx]['price.siteid'] = $siteid; |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->priceData = $data; |
76 | 76 | $view->priceBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->priceBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | parent::delete(); |
92 | 92 | |
93 | 93 | $item = $this->getView()->item; |
94 | - $item->deleteListItems( $item->getListItems( 'price', null, null, false ), true ); |
|
94 | + $item->deleteListItems($item->getListItems('price', null, null, false), true); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -102,16 +102,16 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function get() |
104 | 104 | { |
105 | - $view = $this->addViewData( $this->getView() ); |
|
105 | + $view = $this->addViewData($this->getView()); |
|
106 | 106 | |
107 | - $view->priceData = $this->toArray( $view->item ); |
|
107 | + $view->priceData = $this->toArray($view->item); |
|
108 | 108 | $view->priceBody = ''; |
109 | 109 | |
110 | - foreach( $this->getSubClients() as $client ) { |
|
110 | + foreach ($this->getSubClients() as $client) { |
|
111 | 111 | $view->priceBody .= $client->get(); |
112 | 112 | } |
113 | 113 | |
114 | - return $this->render( $view ); |
|
114 | + return $this->render($view); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -124,26 +124,26 @@ discard block |
||
124 | 124 | |
125 | 125 | try |
126 | 126 | { |
127 | - $view->item = $this->fromArray( $view->item, $view->param( 'price', [] ) ); |
|
127 | + $view->item = $this->fromArray($view->item, $view->param('price', [])); |
|
128 | 128 | $view->priceBody = ''; |
129 | 129 | |
130 | - foreach( $this->getSubClients() as $client ) { |
|
130 | + foreach ($this->getSubClients() as $client) { |
|
131 | 131 | $view->priceBody .= $client->save(); |
132 | 132 | } |
133 | 133 | |
134 | 134 | return; |
135 | 135 | } |
136 | - catch( \Aimeos\MShop\Exception $e ) |
|
136 | + catch (\Aimeos\MShop\Exception $e) |
|
137 | 137 | { |
138 | - $error = array( 'service-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
139 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
140 | - $this->logException( $e ); |
|
138 | + $error = array('service-item-price' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
139 | + $view->errors = $view->get('errors', []) + $error; |
|
140 | + $this->logException($e); |
|
141 | 141 | } |
142 | - catch( \Exception $e ) |
|
142 | + catch (\Exception $e) |
|
143 | 143 | { |
144 | - $error = array( 'service-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
145 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
146 | - $this->logException( $e ); |
|
144 | + $error = array('service-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
145 | + $view->errors = $view->get('errors', []) + $error; |
|
146 | + $this->logException($e); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
158 | 158 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
159 | 159 | */ |
160 | - public function getSubClient( $type, $name = null ) |
|
160 | + public function getSubClient($type, $name = null) |
|
161 | 161 | { |
162 | 162 | /** admin/jqadm/service/price/decorators/excludes |
163 | 163 | * Excludes decorators added by the "common" option from the service JQAdm client |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @see admin/jqadm/service/price/decorators/excludes |
233 | 233 | * @see admin/jqadm/service/price/decorators/global |
234 | 234 | */ |
235 | - return $this->createSubClient( 'service/price/' . $type, $name ); |
|
235 | + return $this->createSubClient('service/price/' . $type, $name); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @since 2016.01 |
277 | 277 | * @category Developer |
278 | 278 | */ |
279 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/service/price/standard/subparts', [] ); |
|
279 | + return $this->getContext()->getConfig()->get('admin/jqadm/service/price/standard/subparts', []); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | |
@@ -286,28 +286,28 @@ discard block |
||
286 | 286 | * @param \Aimeos\MW\View\Iface $view View object |
287 | 287 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
288 | 288 | */ |
289 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
289 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
290 | 290 | { |
291 | 291 | $context = $this->getContext(); |
292 | 292 | |
293 | - $priceTypeManager = \Aimeos\MShop::create( $context, 'price/type' ); |
|
294 | - $listTypeManager = \Aimeos\MShop::create( $context, 'service/lists/type' ); |
|
295 | - $currencyManager = \Aimeos\MShop::create( $context, 'locale/currency' ); |
|
293 | + $priceTypeManager = \Aimeos\MShop::create($context, 'price/type'); |
|
294 | + $listTypeManager = \Aimeos\MShop::create($context, 'service/lists/type'); |
|
295 | + $currencyManager = \Aimeos\MShop::create($context, 'locale/currency'); |
|
296 | 296 | |
297 | - $search = $priceTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
298 | - $search->setConditions( $search->compare( '==', 'price.type.domain', 'service' ) ); |
|
299 | - $search->setSortations( array( $search->sort( '+', 'price.type.label' ) ) ); |
|
297 | + $search = $priceTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
298 | + $search->setConditions($search->compare('==', 'price.type.domain', 'service')); |
|
299 | + $search->setSortations(array($search->sort('+', 'price.type.label'))); |
|
300 | 300 | |
301 | - $listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
302 | - $listSearch->setConditions( $listSearch->compare( '==', 'service.lists.type.domain', 'price' ) ); |
|
303 | - $listSearch->setSortations( array( $listSearch->sort( '+', 'service.lists.type.label' ) ) ); |
|
301 | + $listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
302 | + $listSearch->setConditions($listSearch->compare('==', 'service.lists.type.domain', 'price')); |
|
303 | + $listSearch->setSortations(array($listSearch->sort('+', 'service.lists.type.label'))); |
|
304 | 304 | |
305 | - $view->priceTypes = $priceTypeManager->searchItems( $search ); |
|
306 | - $view->priceListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) ); |
|
307 | - $view->priceCurrencies = $currencyManager->searchItems( $currencyManager->createSearch( true )->setSlice( 0, 0x7fffffff ) ); |
|
305 | + $view->priceTypes = $priceTypeManager->searchItems($search); |
|
306 | + $view->priceListTypes = $this->sortType($listTypeManager->searchItems($listSearch)); |
|
307 | + $view->priceCurrencies = $currencyManager->searchItems($currencyManager->createSearch(true)->setSlice(0, 0x7fffffff)); |
|
308 | 308 | |
309 | - if( $view->priceCurrencies === [] ) { |
|
310 | - throw new \Aimeos\Admin\JQAdm\Exception( 'No currencies available. Please enable at least one currency' ); |
|
309 | + if ($view->priceCurrencies === []) { |
|
310 | + throw new \Aimeos\Admin\JQAdm\Exception('No currencies available. Please enable at least one currency'); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | return $view; |
@@ -320,46 +320,46 @@ discard block |
||
320 | 320 | * @param \Aimeos\MShop\Service\Item\Iface $item Service item object without referenced domain items |
321 | 321 | * @param string[] $data Data array |
322 | 322 | */ |
323 | - protected function fromArray( \Aimeos\MShop\Service\Item\Iface $item, array $data ) |
|
323 | + protected function fromArray(\Aimeos\MShop\Service\Item\Iface $item, array $data) |
|
324 | 324 | { |
325 | 325 | $context = $this->getContext(); |
326 | 326 | |
327 | - $priceManager = \Aimeos\MShop::create( $context, 'price' ); |
|
328 | - $listManager = \Aimeos\MShop::create( $context, 'service/lists' ); |
|
327 | + $priceManager = \Aimeos\MShop::create($context, 'price'); |
|
328 | + $listManager = \Aimeos\MShop::create($context, 'service/lists'); |
|
329 | 329 | |
330 | - $listItems = $item->getListItems( 'price', null, null, false ); |
|
330 | + $listItems = $item->getListItems('price', null, null, false); |
|
331 | 331 | |
332 | 332 | |
333 | - foreach( $data as $idx => $entry ) |
|
333 | + foreach ($data as $idx => $entry) |
|
334 | 334 | { |
335 | - if( ( $listItem = $item->getListItem( 'price', $entry['service.lists.type'], $entry['price.id'], false ) ) === null ) { |
|
335 | + if (($listItem = $item->getListItem('price', $entry['service.lists.type'], $entry['price.id'], false)) === null) { |
|
336 | 336 | $listItem = $listManager->createItem(); |
337 | 337 | } |
338 | 338 | |
339 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
339 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
340 | 340 | $refItem = $priceManager->createItem(); |
341 | 341 | } |
342 | 342 | |
343 | - $refItem->fromArray( $entry ); |
|
343 | + $refItem->fromArray($entry); |
|
344 | 344 | $conf = []; |
345 | 345 | |
346 | - foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key ) |
|
346 | + foreach ((array) $this->getValue($entry, 'config/key') as $num => $key) |
|
347 | 347 | { |
348 | - if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) { |
|
349 | - $conf[$key] = trim( $val ); |
|
348 | + if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) { |
|
349 | + $conf[$key] = trim($val); |
|
350 | 350 | } |
351 | 351 | } |
352 | 352 | |
353 | - $listItem->fromArray( $entry ); |
|
354 | - $listItem->setPosition( $idx ); |
|
355 | - $listItem->setConfig( $conf ); |
|
353 | + $listItem->fromArray($entry); |
|
354 | + $listItem->setPosition($idx); |
|
355 | + $listItem->setConfig($conf); |
|
356 | 356 | |
357 | - $item->addListItem( 'price', $listItem, $refItem ); |
|
357 | + $item->addListItem('price', $listItem, $refItem); |
|
358 | 358 | |
359 | - unset( $listItems[$listItem->getId()] ); |
|
359 | + unset($listItems[$listItem->getId()]); |
|
360 | 360 | } |
361 | 361 | |
362 | - return $item->deleteListItems( $listItems, true ); |
|
362 | + return $item->deleteListItems($listItems, true); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | |
@@ -370,20 +370,20 @@ discard block |
||
370 | 370 | * @param boolean $copy True if items should be copied, false if not |
371 | 371 | * @return string[] Multi-dimensional associative list of item data |
372 | 372 | */ |
373 | - protected function toArray( \Aimeos\MShop\Service\Item\Iface $item, $copy = false ) |
|
373 | + protected function toArray(\Aimeos\MShop\Service\Item\Iface $item, $copy = false) |
|
374 | 374 | { |
375 | 375 | $data = []; |
376 | 376 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
377 | 377 | |
378 | - foreach( $item->getListItems( 'price', null, null, false ) as $listItem ) |
|
378 | + foreach ($item->getListItems('price', null, null, false) as $listItem) |
|
379 | 379 | { |
380 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
380 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
381 | 381 | continue; |
382 | 382 | } |
383 | 383 | |
384 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
384 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
385 | 385 | |
386 | - if( $copy === true ) |
|
386 | + if ($copy === true) |
|
387 | 387 | { |
388 | 388 | $list['service.lists.siteid'] = $siteId; |
389 | 389 | $list['service.lists.id'] = ''; |
@@ -391,10 +391,10 @@ discard block |
||
391 | 391 | $list['price.id'] = null; |
392 | 392 | } |
393 | 393 | |
394 | - $list['service.lists.datestart'] = str_replace( ' ', 'T', $list['service.lists.datestart'] ); |
|
395 | - $list['service.lists.dateend'] = str_replace( ' ', 'T', $list['service.lists.dateend'] ); |
|
394 | + $list['service.lists.datestart'] = str_replace(' ', 'T', $list['service.lists.datestart']); |
|
395 | + $list['service.lists.dateend'] = str_replace(' ', 'T', $list['service.lists.dateend']); |
|
396 | 396 | |
397 | - foreach( $list['service.lists.config'] as $key => $val ) |
|
397 | + foreach ($list['service.lists.config'] as $key => $val) |
|
398 | 398 | { |
399 | 399 | $list['config']['key'][] = $key; |
400 | 400 | $list['config']['val'][] = $val; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
414 | 414 | * @return string HTML output |
415 | 415 | */ |
416 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
416 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
417 | 417 | { |
418 | 418 | /** admin/jqadm/service/price/template-item |
419 | 419 | * Relative path to the HTML body template of the price subpart for services. |
@@ -437,6 +437,6 @@ discard block |
||
437 | 437 | $tplconf = 'admin/jqadm/service/price/template-item'; |
438 | 438 | $default = 'service/item-price-standard'; |
439 | 439 | |
440 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
440 | + return $view->render($view->config($tplconf, $default)); |
|
441 | 441 | } |
442 | 442 | } |
443 | 443 | \ No newline at end of file |
@@ -160,14 +160,12 @@ |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | return; |
163 | - } |
|
164 | - catch( \Aimeos\MShop\Exception $e ) |
|
163 | + } catch( \Aimeos\MShop\Exception $e ) |
|
165 | 164 | { |
166 | 165 | $error = array( 'product-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
167 | 166 | $view->errors = $view->get( 'errors', [] ) + $error; |
168 | 167 | $this->logException( $e ); |
169 | - } |
|
170 | - catch( \Exception $e ) |
|
168 | + } catch( \Exception $e ) |
|
171 | 169 | { |
172 | 170 | $error = array( 'product-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
173 | 171 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Product\Price; |
12 | 12 | |
13 | -sprintf( 'price' ); // for translation |
|
13 | +sprintf('price'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function copy() |
44 | 44 | { |
45 | - $view = $this->addViewData( $this->getView() ); |
|
45 | + $view = $this->addViewData($this->getView()); |
|
46 | 46 | |
47 | - $view->priceData = $this->toArray( $view->item, true ); |
|
47 | + $view->priceData = $this->toArray($view->item, true); |
|
48 | 48 | $view->priceBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->priceBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function create() |
64 | 64 | { |
65 | - $view = $this->addViewData( $this->getView() ); |
|
65 | + $view = $this->addViewData($this->getView()); |
|
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'price', [] ); |
|
67 | + $data = $view->param('price', []); |
|
68 | 68 | |
69 | - foreach( $data as $idx => $entry ) |
|
69 | + foreach ($data as $idx => $entry) |
|
70 | 70 | { |
71 | 71 | $data[$idx]['product.lists.siteid'] = $siteid; |
72 | 72 | $data[$idx]['price.siteid'] = $siteid; |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->priceData = $data; |
76 | 76 | $view->priceBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->priceBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | parent::delete(); |
92 | 92 | |
93 | 93 | $item = $this->getView()->item; |
94 | - $item->deleteListItems( $item->getListItems( 'price', null, null, false ), true ); |
|
94 | + $item->deleteListItems($item->getListItems('price', null, null, false), true); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -102,16 +102,16 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function get() |
104 | 104 | { |
105 | - $view = $this->addViewData( $this->getView() ); |
|
105 | + $view = $this->addViewData($this->getView()); |
|
106 | 106 | |
107 | - $view->priceData = $this->toArray( $view->item ); |
|
107 | + $view->priceData = $this->toArray($view->item); |
|
108 | 108 | $view->priceBody = ''; |
109 | 109 | |
110 | - foreach( $this->getSubClients() as $client ) { |
|
110 | + foreach ($this->getSubClients() as $client) { |
|
111 | 111 | $view->priceBody .= $client->get(); |
112 | 112 | } |
113 | 113 | |
114 | - return $this->render( $view ); |
|
114 | + return $this->render($view); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -124,26 +124,26 @@ discard block |
||
124 | 124 | |
125 | 125 | try |
126 | 126 | { |
127 | - $view->item = $this->fromArray( $view->item, $view->param( 'price', [] ) ); |
|
127 | + $view->item = $this->fromArray($view->item, $view->param('price', [])); |
|
128 | 128 | $view->priceBody = ''; |
129 | 129 | |
130 | - foreach( $this->getSubClients() as $client ) { |
|
130 | + foreach ($this->getSubClients() as $client) { |
|
131 | 131 | $view->priceBody .= $client->save(); |
132 | 132 | } |
133 | 133 | |
134 | 134 | return; |
135 | 135 | } |
136 | - catch( \Aimeos\MShop\Exception $e ) |
|
136 | + catch (\Aimeos\MShop\Exception $e) |
|
137 | 137 | { |
138 | - $error = array( 'product-item-price' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
139 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
140 | - $this->logException( $e ); |
|
138 | + $error = array('product-item-price' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
139 | + $view->errors = $view->get('errors', []) + $error; |
|
140 | + $this->logException($e); |
|
141 | 141 | } |
142 | - catch( \Exception $e ) |
|
142 | + catch (\Exception $e) |
|
143 | 143 | { |
144 | - $error = array( 'product-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
145 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
146 | - $this->logException( $e ); |
|
144 | + $error = array('product-item-price' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
145 | + $view->errors = $view->get('errors', []) + $error; |
|
146 | + $this->logException($e); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
158 | 158 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
159 | 159 | */ |
160 | - public function getSubClient( $type, $name = null ) |
|
160 | + public function getSubClient($type, $name = null) |
|
161 | 161 | { |
162 | 162 | /** admin/jqadm/product/price/decorators/excludes |
163 | 163 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @see admin/jqadm/product/price/decorators/excludes |
233 | 233 | * @see admin/jqadm/product/price/decorators/global |
234 | 234 | */ |
235 | - return $this->createSubClient( 'product/price/' . $type, $name ); |
|
235 | + return $this->createSubClient('product/price/' . $type, $name); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @since 2016.01 |
277 | 277 | * @category Developer |
278 | 278 | */ |
279 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/price/standard/subparts', [] ); |
|
279 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/price/standard/subparts', []); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | |
@@ -286,28 +286,28 @@ discard block |
||
286 | 286 | * @param \Aimeos\MW\View\Iface $view View object |
287 | 287 | * @return \Aimeos\MW\View\Iface View object with assigned parameters |
288 | 288 | */ |
289 | - protected function addViewData( \Aimeos\MW\View\Iface $view ) |
|
289 | + protected function addViewData(\Aimeos\MW\View\Iface $view) |
|
290 | 290 | { |
291 | 291 | $context = $this->getContext(); |
292 | 292 | |
293 | - $priceTypeManager = \Aimeos\MShop::create( $context, 'price/type' ); |
|
294 | - $listTypeManager = \Aimeos\MShop::create( $context, 'product/lists/type' ); |
|
295 | - $currencyManager = \Aimeos\MShop::create( $context, 'locale/currency' ); |
|
293 | + $priceTypeManager = \Aimeos\MShop::create($context, 'price/type'); |
|
294 | + $listTypeManager = \Aimeos\MShop::create($context, 'product/lists/type'); |
|
295 | + $currencyManager = \Aimeos\MShop::create($context, 'locale/currency'); |
|
296 | 296 | |
297 | - $search = $priceTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
298 | - $search->setConditions( $search->compare( '==', 'price.type.domain', 'product' ) ); |
|
299 | - $search->setSortations( array( $search->sort( '+', 'price.type.label' ) ) ); |
|
297 | + $search = $priceTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
298 | + $search->setConditions($search->compare('==', 'price.type.domain', 'product')); |
|
299 | + $search->setSortations(array($search->sort('+', 'price.type.label'))); |
|
300 | 300 | |
301 | - $listSearch = $listTypeManager->createSearch( true )->setSlice( 0, 0x7fffffff ); |
|
302 | - $listSearch->setConditions( $listSearch->compare( '==', 'product.lists.type.domain', 'price' ) ); |
|
303 | - $listSearch->setSortations( array( $listSearch->sort( '+', 'product.lists.type.label' ) ) ); |
|
301 | + $listSearch = $listTypeManager->createSearch(true)->setSlice(0, 0x7fffffff); |
|
302 | + $listSearch->setConditions($listSearch->compare('==', 'product.lists.type.domain', 'price')); |
|
303 | + $listSearch->setSortations(array($listSearch->sort('+', 'product.lists.type.label'))); |
|
304 | 304 | |
305 | - $view->priceTypes = $priceTypeManager->searchItems( $search ); |
|
306 | - $view->priceListTypes = $this->sortType( $listTypeManager->searchItems( $listSearch ) ); |
|
307 | - $view->priceCurrencies = $currencyManager->searchItems( $currencyManager->createSearch( true )->setSlice( 0, 0x7fffffff ) ); |
|
305 | + $view->priceTypes = $priceTypeManager->searchItems($search); |
|
306 | + $view->priceListTypes = $this->sortType($listTypeManager->searchItems($listSearch)); |
|
307 | + $view->priceCurrencies = $currencyManager->searchItems($currencyManager->createSearch(true)->setSlice(0, 0x7fffffff)); |
|
308 | 308 | |
309 | - if( $view->priceCurrencies === [] ) { |
|
310 | - throw new \Aimeos\Admin\JQAdm\Exception( 'No currencies available. Please enable at least one currency' ); |
|
309 | + if ($view->priceCurrencies === []) { |
|
310 | + throw new \Aimeos\Admin\JQAdm\Exception('No currencies available. Please enable at least one currency'); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | return $view; |
@@ -320,48 +320,48 @@ discard block |
||
320 | 320 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
321 | 321 | * @param string[] $data Data array |
322 | 322 | */ |
323 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
323 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
324 | 324 | { |
325 | 325 | $context = $this->getContext(); |
326 | 326 | |
327 | - $priceManager = \Aimeos\MShop::create( $context, 'price' ); |
|
328 | - $listManager = \Aimeos\MShop::create( $context, 'product/lists' ); |
|
327 | + $priceManager = \Aimeos\MShop::create($context, 'price'); |
|
328 | + $listManager = \Aimeos\MShop::create($context, 'product/lists'); |
|
329 | 329 | |
330 | - $listItems = $item->getListItems( 'price', null, null, false ); |
|
330 | + $listItems = $item->getListItems('price', null, null, false); |
|
331 | 331 | |
332 | 332 | |
333 | - foreach( $data as $idx => $entry ) |
|
333 | + foreach ($data as $idx => $entry) |
|
334 | 334 | { |
335 | 335 | $listType = $entry['product.lists.type']; |
336 | 336 | |
337 | - if( ( $listItem = $item->getListItem( 'price', $listType, $entry['price.id'], false ) ) === null ) { |
|
337 | + if (($listItem = $item->getListItem('price', $listType, $entry['price.id'], false)) === null) { |
|
338 | 338 | $listItem = $listManager->createItem(); |
339 | 339 | } |
340 | 340 | |
341 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
341 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
342 | 342 | $refItem = $priceManager->createItem(); |
343 | 343 | } |
344 | 344 | |
345 | - $refItem->fromArray( $entry ); |
|
345 | + $refItem->fromArray($entry); |
|
346 | 346 | $conf = []; |
347 | 347 | |
348 | - foreach( (array) $this->getValue( $entry, 'config/key' ) as $num => $key ) |
|
348 | + foreach ((array) $this->getValue($entry, 'config/key') as $num => $key) |
|
349 | 349 | { |
350 | - if( trim( $key ) !== '' && ( $val = $this->getValue( $entry, 'config/val/' . $num ) ) !== null ) { |
|
351 | - $conf[$key] = trim( $val ); |
|
350 | + if (trim($key) !== '' && ($val = $this->getValue($entry, 'config/val/' . $num)) !== null) { |
|
351 | + $conf[$key] = trim($val); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
355 | - $listItem->fromArray( $entry ); |
|
356 | - $listItem->setPosition( $idx ); |
|
357 | - $listItem->setConfig( $conf ); |
|
355 | + $listItem->fromArray($entry); |
|
356 | + $listItem->setPosition($idx); |
|
357 | + $listItem->setConfig($conf); |
|
358 | 358 | |
359 | - $item->addListItem( 'price', $listItem, $refItem ); |
|
359 | + $item->addListItem('price', $listItem, $refItem); |
|
360 | 360 | |
361 | - unset( $listItems[$listItem->getId()] ); |
|
361 | + unset($listItems[$listItem->getId()]); |
|
362 | 362 | } |
363 | 363 | |
364 | - return $item->deleteListItems( $listItems, true ); |
|
364 | + return $item->deleteListItems($listItems, true); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | |
@@ -372,20 +372,20 @@ discard block |
||
372 | 372 | * @param boolean $copy True if items should be copied, false if not |
373 | 373 | * @return string[] Multi-dimensional associative list of item data |
374 | 374 | */ |
375 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
375 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
376 | 376 | { |
377 | 377 | $data = []; |
378 | 378 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
379 | 379 | |
380 | - foreach( $item->getListItems( 'price', null, null, false ) as $listItem ) |
|
380 | + foreach ($item->getListItems('price', null, null, false) as $listItem) |
|
381 | 381 | { |
382 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
382 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
383 | 383 | continue; |
384 | 384 | } |
385 | 385 | |
386 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
386 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
387 | 387 | |
388 | - if( $copy === true ) |
|
388 | + if ($copy === true) |
|
389 | 389 | { |
390 | 390 | $list['product.lists.siteid'] = $siteId; |
391 | 391 | $list['product.lists.id'] = ''; |
@@ -393,10 +393,10 @@ discard block |
||
393 | 393 | $list['price.id'] = null; |
394 | 394 | } |
395 | 395 | |
396 | - $list['product.lists.datestart'] = str_replace( ' ', 'T', $list['product.lists.datestart'] ); |
|
397 | - $list['product.lists.dateend'] = str_replace( ' ', 'T', $list['product.lists.dateend'] ); |
|
396 | + $list['product.lists.datestart'] = str_replace(' ', 'T', $list['product.lists.datestart']); |
|
397 | + $list['product.lists.dateend'] = str_replace(' ', 'T', $list['product.lists.dateend']); |
|
398 | 398 | |
399 | - foreach( $list['product.lists.config'] as $key => $val ) |
|
399 | + foreach ($list['product.lists.config'] as $key => $val) |
|
400 | 400 | { |
401 | 401 | $list['config']['key'][] = $key; |
402 | 402 | $list['config']['val'][] = $val; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
416 | 416 | * @return string HTML output |
417 | 417 | */ |
418 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
418 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
419 | 419 | { |
420 | 420 | /** admin/jqadm/product/price/template-item |
421 | 421 | * Relative path to the HTML body template of the price subpart for products. |
@@ -439,6 +439,6 @@ discard block |
||
439 | 439 | $tplconf = 'admin/jqadm/product/price/template-item'; |
440 | 440 | $default = 'product/item-price-standard'; |
441 | 441 | |
442 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
442 | + return $view->render($view->config($tplconf, $default)); |
|
443 | 443 | } |
444 | 444 | } |
445 | 445 | \ No newline at end of file |
@@ -51,14 +51,12 @@ discard block |
||
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | - } |
|
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
54 | + } catch( \Aimeos\MShop\Exception $e ) |
|
56 | 55 | { |
57 | 56 | $error = array( 'type-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
58 | 57 | $view->errors = $view->get( 'errors', [] ) + $error; |
59 | 58 | $this->logException( $e ); |
60 | - } |
|
61 | - catch( \Exception $e ) |
|
59 | + } catch( \Exception $e ) |
|
62 | 60 | { |
63 | 61 | $error = array( 'type-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
64 | 62 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -100,14 +98,12 @@ discard block |
||
100 | 98 | $view->tabindex = ++$idx + 1; |
101 | 99 | $view->itemBody .= $client->create(); |
102 | 100 | } |
103 | - } |
|
104 | - catch( \Aimeos\MShop\Exception $e ) |
|
101 | + } catch( \Aimeos\MShop\Exception $e ) |
|
105 | 102 | { |
106 | 103 | $error = array( 'type-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
107 | 104 | $view->errors = $view->get( 'errors', [] ) + $error; |
108 | 105 | $this->logException( $e ); |
109 | - } |
|
110 | - catch( \Exception $e ) |
|
106 | + } catch( \Exception $e ) |
|
111 | 107 | { |
112 | 108 | $error = array( 'type-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
113 | 109 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -148,14 +144,12 @@ discard block |
||
148 | 144 | |
149 | 145 | $this->nextAction( $view, 'search', 'type/customer/property', null, 'delete' ); |
150 | 146 | return; |
151 | - } |
|
152 | - catch( \Aimeos\MShop\Exception $e ) |
|
147 | + } catch( \Aimeos\MShop\Exception $e ) |
|
153 | 148 | { |
154 | 149 | $error = array( 'type-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
155 | 150 | $view->errors = $view->get( 'errors', [] ) + $error; |
156 | 151 | $this->logException( $e ); |
157 | - } |
|
158 | - catch( \Exception $e ) |
|
152 | + } catch( \Exception $e ) |
|
159 | 153 | { |
160 | 154 | $error = array( 'type-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
161 | 155 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -196,14 +190,12 @@ discard block |
||
196 | 190 | $view->tabindex = ++$idx + 1; |
197 | 191 | $view->itemBody .= $client->get(); |
198 | 192 | } |
199 | - } |
|
200 | - catch( \Aimeos\MShop\Exception $e ) |
|
193 | + } catch( \Aimeos\MShop\Exception $e ) |
|
201 | 194 | { |
202 | 195 | $error = array( 'type-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
203 | 196 | $view->errors = $view->get( 'errors', [] ) + $error; |
204 | 197 | $this->logException( $e ); |
205 | - } |
|
206 | - catch( \Exception $e ) |
|
198 | + } catch( \Exception $e ) |
|
207 | 199 | { |
208 | 200 | $error = array( 'type-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
209 | 201 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -241,18 +233,15 @@ discard block |
||
241 | 233 | |
242 | 234 | $this->nextAction( $view, $view->param( 'next' ), 'type/customer/property', $view->item->getId(), 'save' ); |
243 | 235 | return; |
244 | - } |
|
245 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
236 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
246 | 237 | { |
247 | 238 | // fall through to create |
248 | - } |
|
249 | - catch( \Aimeos\MShop\Exception $e ) |
|
239 | + } catch( \Aimeos\MShop\Exception $e ) |
|
250 | 240 | { |
251 | 241 | $error = array( 'type-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
252 | 242 | $view->errors = $view->get( 'errors', [] ) + $error; |
253 | 243 | $this->logException( $e ); |
254 | - } |
|
255 | - catch( \Exception $e ) |
|
244 | + } catch( \Exception $e ) |
|
256 | 245 | { |
257 | 246 | $error = array( 'type-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
258 | 247 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -291,14 +280,12 @@ discard block |
||
291 | 280 | foreach( $this->getSubClients() as $client ) { |
292 | 281 | $view->itemBody .= $client->search(); |
293 | 282 | } |
294 | - } |
|
295 | - catch( \Aimeos\MShop\Exception $e ) |
|
283 | + } catch( \Aimeos\MShop\Exception $e ) |
|
296 | 284 | { |
297 | 285 | $error = array( 'type-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
298 | 286 | $view->errors = $view->get( 'errors', [] ) + $error; |
299 | 287 | $this->logException( $e ); |
300 | - } |
|
301 | - catch( \Exception $e ) |
|
288 | + } catch( \Exception $e ) |
|
302 | 289 | { |
303 | 290 | $error = array( 'type-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
304 | 291 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Type\Customer\Property; |
12 | 12 | |
13 | -sprintf( 'type/customer/property' ); // for translation |
|
13 | +sprintf('type/customer/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, 'customer/property/type' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'customer/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-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('type-customer-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-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('type-customer-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, 'customer/property/type' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'customer/property/type')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['customer.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-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('type-customer-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-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('type-customer-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, 'customer/property/type' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'customer/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/customer/property', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'type/customer/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-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('type-customer-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-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('type-customer-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, 'customer/property/type' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'customer/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-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('type-customer-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-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('type-customer-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, 'customer/property/type' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'customer/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/customer/property', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'type/customer/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-customer-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('type-customer-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-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('type-customer-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/customer/property' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'customer/property/type' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'type/customer/property'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'customer/property/type'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterCustomers = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterCustomers = $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-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('type-customer-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-customer-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('type-customer-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/customer/property/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/type/customer/property/template-list'; |
327 | 327 | $default = 'type/customer/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/customer/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/customer/property/decorators/excludes |
413 | 413 | * @see admin/jqadm/type/customer/property/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'type/customer/property' . $propertytype, $name ); |
|
415 | + return $this->createSubClient('type/customer/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/customer/property/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/type/customer/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(), 'customer/property/type' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/property/type'); |
|
473 | 473 | |
474 | - if( isset( $data['customer.property.type.id'] ) && $data['customer.property.type.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['customer.property.type.id'] ); |
|
474 | + if (isset($data['customer.property.type.id']) && $data['customer.property.type.id'] != '') { |
|
475 | + $item = $manager->getItem($data['customer.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['customer.property.type.code'] = $data['customer.property.type.code'] . '_copy'; |
499 | 499 | $data['customer.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/customer/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/customer/property/template-item'; |
534 | 534 | $default = 'type/customer/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 | } |
@@ -121,14 +121,12 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | - } |
|
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
124 | + } catch( \Aimeos\MShop\Exception $e ) |
|
126 | 125 | { |
127 | 126 | $error = array( 'attribute-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
128 | 127 | $view->errors = $view->get( 'errors', [] ) + $error; |
129 | 128 | $this->logException( $e ); |
130 | - } |
|
131 | - catch( \Exception $e ) |
|
129 | + } catch( \Exception $e ) |
|
132 | 130 | { |
133 | 131 | $error = array( 'attribute-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
134 | 132 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -320,8 +318,7 @@ discard block |
||
320 | 318 | { |
321 | 319 | $propItem = $propItems[$entry['attribute.property.id']]; |
322 | 320 | unset( $propItems[$entry['attribute.property.id']] ); |
323 | - } |
|
324 | - else |
|
321 | + } else |
|
325 | 322 | { |
326 | 323 | $propItem = $manager->createItem(); |
327 | 324 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Attribute\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->propertyData = $this->toArray( $view->item, true ); |
|
47 | + $view->propertyData = $this->toArray($view->item, true); |
|
48 | 48 | $view->propertyTypes = $this->getPropertyTypes(); |
49 | 49 | $view->propertyBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $client ) { |
|
51 | + foreach ($this->getSubClients() as $client) { |
|
52 | 52 | $view->propertyBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | |
55 | - return $this->render( $view ); |
|
55 | + return $this->render($view); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | { |
66 | 66 | $view = $this->getView(); |
67 | 67 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
68 | - $data = $view->param( 'property', [] ); |
|
68 | + $data = $view->param('property', []); |
|
69 | 69 | |
70 | - foreach( $data as $idx => $entry ) { |
|
70 | + foreach ($data as $idx => $entry) { |
|
71 | 71 | $data[$idx]['attribute.lists.siteid'] = $siteid; |
72 | 72 | } |
73 | 73 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->propertyData = $data; |
76 | 76 | $view->propertyBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->propertyBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -92,15 +92,15 @@ discard block |
||
92 | 92 | { |
93 | 93 | $view = $this->getView(); |
94 | 94 | |
95 | - $view->propertyData = $this->toArray( $view->item ); |
|
95 | + $view->propertyData = $this->toArray($view->item); |
|
96 | 96 | $view->propertyTypes = $this->getPropertyTypes(); |
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -113,26 +113,26 @@ discard block |
||
113 | 113 | |
114 | 114 | try |
115 | 115 | { |
116 | - $this->fromArray( $view->item, $view->param( 'property', [] ) ); |
|
116 | + $this->fromArray($view->item, $view->param('property', [])); |
|
117 | 117 | $view->propertyBody = ''; |
118 | 118 | |
119 | - foreach( $this->getSubClients() as $client ) { |
|
119 | + foreach ($this->getSubClients() as $client) { |
|
120 | 120 | $view->propertyBody .= $client->save(); |
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | 124 | } |
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
125 | + catch (\Aimeos\MShop\Exception $e) |
|
126 | 126 | { |
127 | - $error = array( 'attribute-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
128 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
129 | - $this->logException( $e ); |
|
127 | + $error = array('attribute-item-property' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
128 | + $view->errors = $view->get('errors', []) + $error; |
|
129 | + $this->logException($e); |
|
130 | 130 | } |
131 | - catch( \Exception $e ) |
|
131 | + catch (\Exception $e) |
|
132 | 132 | { |
133 | - $error = array( 'attribute-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
134 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
135 | - $this->logException( $e ); |
|
133 | + $error = array('attribute-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
134 | + $view->errors = $view->get('errors', []) + $error; |
|
135 | + $this->logException($e); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param string|null $name Name of the sub-client (Default if null) |
147 | 147 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
148 | 148 | */ |
149 | - public function getSubClient( $type, $name = null ) |
|
149 | + public function getSubClient($type, $name = null) |
|
150 | 150 | { |
151 | 151 | /** admin/jqadm/attribute/property/decorators/excludes |
152 | 152 | * Excludes decorators added by the "common" option from the attribute JQAdm client |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @see admin/jqadm/attribute/property/decorators/excludes |
222 | 222 | * @see admin/jqadm/attribute/property/decorators/global |
223 | 223 | */ |
224 | - return $this->createSubClient( 'attribute/property/' . $type, $name ); |
|
224 | + return $this->createSubClient('attribute/property/' . $type, $name); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @since 2018.01 |
266 | 266 | * @category Developer |
267 | 267 | */ |
268 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/attribute/property/standard/subparts', [] ); |
|
268 | + return $this->getContext()->getConfig()->get('admin/jqadm/attribute/property/standard/subparts', []); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | */ |
277 | 277 | protected function getPropertyTypes() |
278 | 278 | { |
279 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'attribute/property/type' ); |
|
280 | - return $manager->searchItems( $manager->createSearch()->setSlice( 0, 0x7fffffff ) ); |
|
279 | + $manager = \Aimeos\MShop::create($this->getContext(), 'attribute/property/type'); |
|
280 | + return $manager->searchItems($manager->createSearch()->setSlice(0, 0x7fffffff)); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | |
@@ -287,29 +287,29 @@ discard block |
||
287 | 287 | * @param \Aimeos\MShop\Attribute\Item\Iface $item Attribute item object without referenced domain items |
288 | 288 | * @param string[] $data Data array |
289 | 289 | */ |
290 | - protected function fromArray( \Aimeos\MShop\Attribute\Item\Iface $item, array $data ) |
|
290 | + protected function fromArray(\Aimeos\MShop\Attribute\Item\Iface $item, array $data) |
|
291 | 291 | { |
292 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'attribute/property' ); |
|
292 | + $manager = \Aimeos\MShop::create($this->getContext(), 'attribute/property'); |
|
293 | 293 | |
294 | - $propItems = $item->getPropertyItems( null, false ); |
|
294 | + $propItems = $item->getPropertyItems(null, false); |
|
295 | 295 | |
296 | - foreach( $data as $entry ) |
|
296 | + foreach ($data as $entry) |
|
297 | 297 | { |
298 | - if( isset( $propItems[$entry['attribute.property.id']] ) ) |
|
298 | + if (isset($propItems[$entry['attribute.property.id']])) |
|
299 | 299 | { |
300 | 300 | $propItem = $propItems[$entry['attribute.property.id']]; |
301 | - unset( $propItems[$entry['attribute.property.id']] ); |
|
301 | + unset($propItems[$entry['attribute.property.id']]); |
|
302 | 302 | } |
303 | 303 | else |
304 | 304 | { |
305 | 305 | $propItem = $manager->createItem(); |
306 | 306 | } |
307 | 307 | |
308 | - $propItem->fromArray( $entry ); |
|
309 | - $item->addPropertyItem( $propItem ); |
|
308 | + $propItem->fromArray($entry); |
|
309 | + $item->addPropertyItem($propItem); |
|
310 | 310 | } |
311 | 311 | |
312 | - $item->deletePropertyItems( $propItems ); |
|
312 | + $item->deletePropertyItems($propItems); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | |
@@ -320,16 +320,16 @@ discard block |
||
320 | 320 | * @param boolean $copy True if items should be copied, false if not |
321 | 321 | * @return string[] Multi-dimensional associative list of item data |
322 | 322 | */ |
323 | - protected function toArray( \Aimeos\MShop\Attribute\Item\Iface $item, $copy = false ) |
|
323 | + protected function toArray(\Aimeos\MShop\Attribute\Item\Iface $item, $copy = false) |
|
324 | 324 | { |
325 | 325 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
326 | 326 | $data = []; |
327 | 327 | |
328 | - foreach( $item->getPropertyItems( null, false ) as $item ) |
|
328 | + foreach ($item->getPropertyItems(null, false) as $item) |
|
329 | 329 | { |
330 | - $list = $item->toArray( true ); |
|
330 | + $list = $item->toArray(true); |
|
331 | 331 | |
332 | - if( $copy === true ) |
|
332 | + if ($copy === true) |
|
333 | 333 | { |
334 | 334 | $list['attribute.property.siteid'] = $siteId; |
335 | 335 | $list['attribute.property.id'] = ''; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
349 | 349 | * @return string HTML output |
350 | 350 | */ |
351 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
351 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
352 | 352 | { |
353 | 353 | /** admin/jqadm/attribute/property/template-item |
354 | 354 | * Relative path to the HTML body template of the property subpart for attributes. |
@@ -372,6 +372,6 @@ discard block |
||
372 | 372 | $tplconf = 'admin/jqadm/attribute/property/template-item'; |
373 | 373 | $default = 'attribute/item-property-standard'; |
374 | 374 | |
375 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
375 | + return $view->render($view->config($tplconf, $default)); |
|
376 | 376 | } |
377 | 377 | } |
@@ -305,8 +305,7 @@ |
||
305 | 305 | { |
306 | 306 | $propItem = $propItems[$entry['product.property.id']]; |
307 | 307 | unset( $propItems[$entry['product.property.id']] ); |
308 | - } |
|
309 | - else |
|
308 | + } else |
|
310 | 309 | { |
311 | 310 | $propItem = $manager->createItem(); |
312 | 311 | } |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->propertyData = $this->toArray( $view->item, true ); |
|
45 | + $view->propertyData = $this->toArray($view->item, true); |
|
46 | 46 | $view->propertyTypes = $this->getPropertyTypes(); |
47 | 47 | $view->propertyBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $client ) { |
|
49 | + foreach ($this->getSubClients() as $client) { |
|
50 | 50 | $view->propertyBody .= $client->copy(); |
51 | 51 | } |
52 | 52 | |
53 | - return $this->render( $view ); |
|
53 | + return $this->render($view); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | { |
64 | 64 | $view = $this->getView(); |
65 | 65 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
66 | - $data = $view->param( 'characteristic/property', [] ); |
|
66 | + $data = $view->param('characteristic/property', []); |
|
67 | 67 | |
68 | - foreach( $data as $idx => $entry ) { |
|
68 | + foreach ($data as $idx => $entry) { |
|
69 | 69 | $data[$idx]['product.lists.siteid'] = $siteid; |
70 | 70 | } |
71 | 71 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | $view->propertyData = $data; |
74 | 74 | $view->propertyBody = ''; |
75 | 75 | |
76 | - foreach( $this->getSubClients() as $client ) { |
|
76 | + foreach ($this->getSubClients() as $client) { |
|
77 | 77 | $view->propertyBody .= $client->create(); |
78 | 78 | } |
79 | 79 | |
80 | - return $this->render( $view ); |
|
80 | + return $this->render($view); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -90,15 +90,15 @@ discard block |
||
90 | 90 | { |
91 | 91 | $view = $this->getView(); |
92 | 92 | |
93 | - $view->propertyData = $this->toArray( $view->item ); |
|
93 | + $view->propertyData = $this->toArray($view->item); |
|
94 | 94 | $view->propertyTypes = $this->getPropertyTypes(); |
95 | 95 | $view->propertyBody = ''; |
96 | 96 | |
97 | - foreach( $this->getSubClients() as $client ) { |
|
97 | + foreach ($this->getSubClients() as $client) { |
|
98 | 98 | $view->propertyBody .= $client->get(); |
99 | 99 | } |
100 | 100 | |
101 | - return $this->render( $view ); |
|
101 | + return $this->render($view); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | { |
110 | 110 | $view = $this->getView(); |
111 | 111 | |
112 | - $this->fromArray( $view->item, $view->param( 'characteristic/property', [] ) ); |
|
112 | + $this->fromArray($view->item, $view->param('characteristic/property', [])); |
|
113 | 113 | $view->propertyBody = ''; |
114 | 114 | |
115 | - foreach( $this->getSubClients() as $client ) { |
|
115 | + foreach ($this->getSubClients() as $client) { |
|
116 | 116 | $view->propertyBody .= $client->save(); |
117 | 117 | } |
118 | 118 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @param string|null $name Name of the sub-client (Default if null) |
126 | 126 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
127 | 127 | */ |
128 | - public function getSubClient( $type, $name = null ) |
|
128 | + public function getSubClient($type, $name = null) |
|
129 | 129 | { |
130 | 130 | /** admin/jqadm/product/characteristic/property/decorators/excludes |
131 | 131 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * @see admin/jqadm/product/characteristic/property/decorators/excludes |
201 | 201 | * @see admin/jqadm/product/characteristic/property/decorators/global |
202 | 202 | */ |
203 | - return $this->createSubClient( 'product/characteristic/property/' . $type, $name ); |
|
203 | + return $this->createSubClient('product/characteristic/property/' . $type, $name); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -210,14 +210,14 @@ discard block |
||
210 | 210 | * @param \Aimeos\MShop\Common\Item\Property\Iface[] $propItems List of property items |
211 | 211 | * @return \Aimeos\MShop\Common\Item\Property\Iface[] Filtered list of property items |
212 | 212 | */ |
213 | - protected function excludeItems( array $propItems ) |
|
213 | + protected function excludeItems(array $propItems) |
|
214 | 214 | { |
215 | - $excludes = array( 'package-length', 'package-height', 'package-width', 'package-weight' ); |
|
215 | + $excludes = array('package-length', 'package-height', 'package-width', 'package-weight'); |
|
216 | 216 | |
217 | - foreach( $propItems as $key => $propItem ) |
|
217 | + foreach ($propItems as $key => $propItem) |
|
218 | 218 | { |
219 | - if( in_array( $propItem->getType(), $excludes ) ) { |
|
220 | - unset( $propItems[$key] ); |
|
219 | + if (in_array($propItem->getType(), $excludes)) { |
|
220 | + unset($propItems[$key]); |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @since 2016.01 |
266 | 266 | * @category Developer |
267 | 267 | */ |
268 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/characteristic/property/standard/subparts', [] ); |
|
268 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/characteristic/property/standard/subparts', []); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
@@ -276,14 +276,14 @@ discard block |
||
276 | 276 | */ |
277 | 277 | protected function getPropertyTypes() |
278 | 278 | { |
279 | - $excludes = array( 'package-length', 'package-height', 'package-width', 'package-weight' ); |
|
280 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'product/property/type' ); |
|
279 | + $excludes = array('package-length', 'package-height', 'package-width', 'package-weight'); |
|
280 | + $manager = \Aimeos\MShop::create($this->getContext(), 'product/property/type'); |
|
281 | 281 | |
282 | 282 | $search = $manager->createSearch(); |
283 | - $search->setConditions( $search->compare( '!=', 'product.property.type.code', $excludes ) ); |
|
284 | - $search->setSlice( 0, 0x7fffffff ); |
|
283 | + $search->setConditions($search->compare('!=', 'product.property.type.code', $excludes)); |
|
284 | + $search->setSlice(0, 0x7fffffff); |
|
285 | 285 | |
286 | - return $manager->searchItems( $search ); |
|
286 | + return $manager->searchItems($search); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -293,28 +293,28 @@ discard block |
||
293 | 293 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
294 | 294 | * @param string[] $data Data array |
295 | 295 | */ |
296 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
296 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
297 | 297 | { |
298 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'product/property' ); |
|
299 | - $propItems = $this->excludeItems( $item->getPropertyItems( null, false ) ); |
|
298 | + $manager = \Aimeos\MShop::create($this->getContext(), 'product/property'); |
|
299 | + $propItems = $this->excludeItems($item->getPropertyItems(null, false)); |
|
300 | 300 | |
301 | - foreach( $data as $entry ) |
|
301 | + foreach ($data as $entry) |
|
302 | 302 | { |
303 | - if( isset( $propItems[$entry['product.property.id']] ) ) |
|
303 | + if (isset($propItems[$entry['product.property.id']])) |
|
304 | 304 | { |
305 | 305 | $propItem = $propItems[$entry['product.property.id']]; |
306 | - unset( $propItems[$entry['product.property.id']] ); |
|
306 | + unset($propItems[$entry['product.property.id']]); |
|
307 | 307 | } |
308 | 308 | else |
309 | 309 | { |
310 | 310 | $propItem = $manager->createItem(); |
311 | 311 | } |
312 | 312 | |
313 | - $propItem->fromArray( $entry ); |
|
314 | - $item->addPropertyItem( $propItem ); |
|
313 | + $propItem->fromArray($entry); |
|
314 | + $item->addPropertyItem($propItem); |
|
315 | 315 | } |
316 | 316 | |
317 | - $item->deletePropertyItems( $propItems ); |
|
317 | + $item->deletePropertyItems($propItems); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | |
@@ -325,16 +325,16 @@ discard block |
||
325 | 325 | * @param boolean $copy True if items should be copied, false if not |
326 | 326 | * @return string[] Multi-dimensional associative list of item data |
327 | 327 | */ |
328 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
328 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
329 | 329 | { |
330 | 330 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
331 | 331 | $data = []; |
332 | 332 | |
333 | - foreach( $this->excludeItems( $item->getPropertyItems( null, false ) ) as $item ) |
|
333 | + foreach ($this->excludeItems($item->getPropertyItems(null, false)) as $item) |
|
334 | 334 | { |
335 | - $list = $item->toArray( true ); |
|
335 | + $list = $item->toArray(true); |
|
336 | 336 | |
337 | - if( $copy === true ) |
|
337 | + if ($copy === true) |
|
338 | 338 | { |
339 | 339 | $list['product.property.siteid'] = $siteId; |
340 | 340 | $list['product.property.id'] = ''; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
354 | 354 | * @return string HTML output |
355 | 355 | */ |
356 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
356 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
357 | 357 | { |
358 | 358 | /** admin/jqadm/product/characteristic/property/template-item |
359 | 359 | * Relative path to the HTML body template of the property characteristic subpart for products. |
@@ -377,6 +377,6 @@ discard block |
||
377 | 377 | $tplconf = 'admin/jqadm/product/characteristic/property/template-item'; |
378 | 378 | $default = 'product/item-characteristic-property-standard'; |
379 | 379 | |
380 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
380 | + return $view->render($view->config($tplconf, $default)); |
|
381 | 381 | } |
382 | 382 | } |
@@ -121,14 +121,12 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | - } |
|
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
124 | + } catch( \Aimeos\MShop\Exception $e ) |
|
126 | 125 | { |
127 | 126 | $error = array( 'customer-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
128 | 127 | $view->errors = $view->get( 'errors', [] ) + $error; |
129 | 128 | $this->logException( $e ); |
130 | - } |
|
131 | - catch( \Exception $e ) |
|
129 | + } catch( \Exception $e ) |
|
132 | 130 | { |
133 | 131 | $error = array( 'customer-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
134 | 132 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -299,8 +297,7 @@ discard block |
||
299 | 297 | { |
300 | 298 | $propItem = $propItems[$entry['customer.property.id']]; |
301 | 299 | unset( $propItems[$entry['customer.property.id']] ); |
302 | - } |
|
303 | - else |
|
300 | + } else |
|
304 | 301 | { |
305 | 302 | $propItem = $manager->createItem(); |
306 | 303 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Customer\Property; |
12 | 12 | |
13 | -sprintf( 'property' ); // for translation |
|
13 | +sprintf('property'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->propertyData = $this->toArray( $view->item, true ); |
|
47 | + $view->propertyData = $this->toArray($view->item, true); |
|
48 | 48 | $view->propertyTypes = $this->getPropertyTypes(); |
49 | 49 | $view->propertyBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $client ) { |
|
51 | + foreach ($this->getSubClients() as $client) { |
|
52 | 52 | $view->propertyBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | |
55 | - return $this->render( $view ); |
|
55 | + return $this->render($view); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | { |
66 | 66 | $view = $this->getView(); |
67 | 67 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
68 | - $data = $view->param( 'property', [] ); |
|
68 | + $data = $view->param('property', []); |
|
69 | 69 | |
70 | - foreach( $data as $idx => $entry ) { |
|
70 | + foreach ($data as $idx => $entry) { |
|
71 | 71 | $data[$idx]['customer.lists.siteid'] = $siteid; |
72 | 72 | } |
73 | 73 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->propertyData = $data; |
76 | 76 | $view->propertyBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->propertyBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -92,15 +92,15 @@ discard block |
||
92 | 92 | { |
93 | 93 | $view = $this->getView(); |
94 | 94 | |
95 | - $view->propertyData = $this->toArray( $view->item ); |
|
95 | + $view->propertyData = $this->toArray($view->item); |
|
96 | 96 | $view->propertyTypes = $this->getPropertyTypes(); |
97 | 97 | $view->propertyBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $client ) { |
|
99 | + foreach ($this->getSubClients() as $client) { |
|
100 | 100 | $view->propertyBody .= $client->get(); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->render( $view ); |
|
103 | + return $this->render($view); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -113,26 +113,26 @@ discard block |
||
113 | 113 | |
114 | 114 | try |
115 | 115 | { |
116 | - $this->fromArray( $view->item, $view->param( 'property', [] ) ); |
|
116 | + $this->fromArray($view->item, $view->param('property', [])); |
|
117 | 117 | $view->propertyBody = ''; |
118 | 118 | |
119 | - foreach( $this->getSubClients() as $client ) { |
|
119 | + foreach ($this->getSubClients() as $client) { |
|
120 | 120 | $view->propertyBody .= $client->save(); |
121 | 121 | } |
122 | 122 | |
123 | 123 | return; |
124 | 124 | } |
125 | - catch( \Aimeos\MShop\Exception $e ) |
|
125 | + catch (\Aimeos\MShop\Exception $e) |
|
126 | 126 | { |
127 | - $error = array( 'customer-item-property' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
128 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
129 | - $this->logException( $e ); |
|
127 | + $error = array('customer-item-property' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
128 | + $view->errors = $view->get('errors', []) + $error; |
|
129 | + $this->logException($e); |
|
130 | 130 | } |
131 | - catch( \Exception $e ) |
|
131 | + catch (\Exception $e) |
|
132 | 132 | { |
133 | - $error = array( 'customer-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
134 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
135 | - $this->logException( $e ); |
|
133 | + $error = array('customer-item-property' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
134 | + $view->errors = $view->get('errors', []) + $error; |
|
135 | + $this->logException($e); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param string|null $name Name of the sub-client (Default if null) |
147 | 147 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
148 | 148 | */ |
149 | - public function getSubClient( $type, $name = null ) |
|
149 | + public function getSubClient($type, $name = null) |
|
150 | 150 | { |
151 | 151 | /** admin/jqadm/customer/property/decorators/excludes |
152 | 152 | * Excludes decorators added by the "common" option from the customer JQAdm client |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @see admin/jqadm/customer/property/decorators/excludes |
222 | 222 | * @see admin/jqadm/customer/property/decorators/global |
223 | 223 | */ |
224 | - return $this->createSubClient( 'customer/property/' . $type, $name ); |
|
224 | + return $this->createSubClient('customer/property/' . $type, $name); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @since 2018.07 |
266 | 266 | * @category Developer |
267 | 267 | */ |
268 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/property/standard/subparts', [] ); |
|
268 | + return $this->getContext()->getConfig()->get('admin/jqadm/customer/property/standard/subparts', []); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | */ |
277 | 277 | protected function getPropertyTypes() |
278 | 278 | { |
279 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer/property/type' ); |
|
280 | - return $manager->searchItems( $manager->createSearch()->setSlice( 0, 0x7fffffff ) ); |
|
279 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/property/type'); |
|
280 | + return $manager->searchItems($manager->createSearch()->setSlice(0, 0x7fffffff)); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | |
@@ -287,29 +287,29 @@ discard block |
||
287 | 287 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object without referenced domain items |
288 | 288 | * @param string[] $data Data array |
289 | 289 | */ |
290 | - protected function fromArray( \Aimeos\MShop\Customer\Item\Iface $item, array $data ) |
|
290 | + protected function fromArray(\Aimeos\MShop\Customer\Item\Iface $item, array $data) |
|
291 | 291 | { |
292 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer/property' ); |
|
292 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/property'); |
|
293 | 293 | |
294 | - $propItems = $item->getPropertyItems( null, false ); |
|
294 | + $propItems = $item->getPropertyItems(null, false); |
|
295 | 295 | |
296 | - foreach( $data as $entry ) |
|
296 | + foreach ($data as $entry) |
|
297 | 297 | { |
298 | - if( isset( $propItems[$entry['customer.property.id']] ) ) |
|
298 | + if (isset($propItems[$entry['customer.property.id']])) |
|
299 | 299 | { |
300 | 300 | $propItem = $propItems[$entry['customer.property.id']]; |
301 | - unset( $propItems[$entry['customer.property.id']] ); |
|
301 | + unset($propItems[$entry['customer.property.id']]); |
|
302 | 302 | } |
303 | 303 | else |
304 | 304 | { |
305 | 305 | $propItem = $manager->createItem(); |
306 | 306 | } |
307 | 307 | |
308 | - $propItem->fromArray( $entry ); |
|
309 | - $item->addPropertyItem( $propItem ); |
|
308 | + $propItem->fromArray($entry); |
|
309 | + $item->addPropertyItem($propItem); |
|
310 | 310 | } |
311 | 311 | |
312 | - $item->deletePropertyItems( $propItems ); |
|
312 | + $item->deletePropertyItems($propItems); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | |
@@ -320,16 +320,16 @@ discard block |
||
320 | 320 | * @param boolean $copy True if items should be copied, false if not |
321 | 321 | * @return string[] Multi-dimensional associative list of item data |
322 | 322 | */ |
323 | - protected function toArray( \Aimeos\MShop\Customer\Item\Iface $item, $copy = false ) |
|
323 | + protected function toArray(\Aimeos\MShop\Customer\Item\Iface $item, $copy = false) |
|
324 | 324 | { |
325 | 325 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
326 | 326 | $data = []; |
327 | 327 | |
328 | - foreach( $item->getPropertyItems( null, false ) as $item ) |
|
328 | + foreach ($item->getPropertyItems(null, false) as $item) |
|
329 | 329 | { |
330 | - $list = $item->toArray( true ); |
|
330 | + $list = $item->toArray(true); |
|
331 | 331 | |
332 | - if( $copy === true ) |
|
332 | + if ($copy === true) |
|
333 | 333 | { |
334 | 334 | $list['customer.property.siteid'] = $siteId; |
335 | 335 | $list['customer.property.id'] = ''; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
349 | 349 | * @return string HTML output |
350 | 350 | */ |
351 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
351 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
352 | 352 | { |
353 | 353 | /** admin/jqadm/customer/property/template-item |
354 | 354 | * Relative path to the HTML body template of the property subpart for customers. |
@@ -372,6 +372,6 @@ discard block |
||
372 | 372 | $tplconf = 'admin/jqadm/customer/property/template-item'; |
373 | 373 | $default = 'customer/item-property-standard'; |
374 | 374 | |
375 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
375 | + return $view->render($view->config($tplconf, $default)); |
|
376 | 376 | } |
377 | 377 | } |
@@ -81,9 +81,12 @@ |
||
81 | 81 | </select> |
82 | 82 | </div> |
83 | 83 | </div> |
84 | - <?php else : ?> |
|
84 | + <?php else { |
|
85 | + : ?> |
|
85 | 86 | <input class="item-languageid" type="hidden" |
86 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
87 | + v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); |
|
88 | +} |
|
89 | +?>'.replace('idx', idx)" |
|
87 | 90 | value="<?= $enc->attr( key( $languages ) ); ?>" /> |
88 | 91 | <?php endif; ?> |
89 | 92 | <div class="form-group row optional"> |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | ?> |
21 | 21 | <div id="address" class="item-address content-block tab-pane fade" role="tabpanel" aria-labelledby="address"> |
22 | 22 | <div id="item-address-group" role="tablist" aria-multiselectable="true" |
23 | - data-items="<?= $enc->attr( json_encode( $this->get( 'addressData', [] ) ) ); ?>" |
|
24 | - data-keys="<?= $enc->attr( json_encode( $keys ) ) ?>" |
|
23 | + data-items="<?= $enc->attr(json_encode($this->get('addressData', []))); ?>" |
|
24 | + data-keys="<?= $enc->attr(json_encode($keys)) ?>" |
|
25 | 25 | data-siteid="<?= $this->site()->siteid() ?>" > |
26 | 26 | |
27 | 27 | <div v-for="(entry, idx) in items" v-bind:key="idx" class="group-item card"> |
@@ -30,20 +30,20 @@ discard block |
||
30 | 30 | v-bind:data-target="'#item-address-group-data-' + idx" data-toggle="collapse" role="tab" class="card-header header" |
31 | 31 | v-bind:aria-controls="'item-address-group-data-' + idx" aria-expanded="false"> |
32 | 32 | <div class="card-tools-left"> |
33 | - <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
34 | - title="<?= $enc->attr( $this->translate( 'admin', 'Show/hide this entry') ); ?>"> |
|
33 | + <div class="btn btn-card-header act-show fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
34 | + title="<?= $enc->attr($this->translate('admin', 'Show/hide this entry')); ?>"> |
|
35 | 35 | </div> |
36 | 36 | </div> |
37 | 37 | <span class="item-label header-label">{{ getLabel(idx, 'customer.address.') }}</span> |
38 | 38 | |
39 | 39 | <div class="card-tools-right"> |
40 | - <div class="btn btn-card-header act-copy fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
41 | - title="<?= $enc->attr( $this->translate( 'admin', 'Duplicate entry (Ctrl+D)') ); ?>" |
|
40 | + <div class="btn btn-card-header act-copy fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
41 | + title="<?= $enc->attr($this->translate('admin', 'Duplicate entry (Ctrl+D)')); ?>" |
|
42 | 42 | v-on:click.stop="duplicateItem(idx)"> |
43 | 43 | </div> |
44 | 44 | <div v-if="!checkSite('customer.address.siteid', idx)" |
45 | - class="btn btn-card-header act-delete fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
46 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
45 | + class="btn btn-card-header act-delete fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
46 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
47 | 47 | v-on:click="removeItem(idx)"> |
48 | 48 | </div> |
49 | 49 | </div> |
@@ -53,29 +53,29 @@ discard block |
||
53 | 53 | v-bind:aria-labelledby="'item-address-group-item-' + idx" role="tabpanel" class="card-block collapse row"> |
54 | 54 | |
55 | 55 | <div class="col-xl-6 content-block"> |
56 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Personal data' ) ); ?></h2> |
|
56 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Personal data')); ?></h2> |
|
57 | 57 | |
58 | 58 | <input class="item-id" type="hidden" |
59 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.id' ) ) ); ?>'.replace('idx', idx)" |
|
59 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.id'))); ?>'.replace('idx', idx)" |
|
60 | 60 | v-bind:value="items[idx]['customer.address.id']" /> |
61 | 61 | |
62 | - <?php $languages = $this->get( 'pageLangItems', [] ) ?> |
|
63 | - <?php if( count( $languages ) > 1 ) : ?> |
|
62 | + <?php $languages = $this->get('pageLangItems', []) ?> |
|
63 | + <?php if (count($languages) > 1) : ?> |
|
64 | 64 | <div class="form-group row mandatory"> |
65 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label> |
|
65 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Language')); ?></label> |
|
66 | 66 | <div class="col-sm-8"> |
67 | - <select class="form-control custom-select item-languageid" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
68 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
67 | + <select class="form-control custom-select item-languageid" tabindex="<?= $this->get('tabindex'); ?>" |
|
68 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.languageid'))); ?>'.replace('idx', idx)" |
|
69 | 69 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
70 | 70 | v-model="items[idx]['customer.address.languageid']" > |
71 | 71 | |
72 | 72 | <option value="" disable > |
73 | - <?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?> |
|
73 | + <?= $enc->attr($this->translate('admin', 'Please select')); ?> |
|
74 | 74 | </option> |
75 | 75 | |
76 | - <?php foreach( $languages as $langId => $langItem ) : ?> |
|
77 | - <option value="<?= $enc->attr( $langId ); ?>" v-bind:selected="entry['customer.address.languageid'] == '<?= $enc->attr( $langId ) ?>'" > |
|
78 | - <?= $enc->html( $langItem->getLabel() ); ?> |
|
76 | + <?php foreach ($languages as $langId => $langItem) : ?> |
|
77 | + <option value="<?= $enc->attr($langId); ?>" v-bind:selected="entry['customer.address.languageid'] == '<?= $enc->attr($langId) ?>'" > |
|
78 | + <?= $enc->html($langItem->getLabel()); ?> |
|
79 | 79 | </option> |
80 | 80 | <?php endforeach; ?> |
81 | 81 | </select> |
@@ -83,261 +83,261 @@ discard block |
||
83 | 83 | </div> |
84 | 84 | <?php else : ?> |
85 | 85 | <input class="item-languageid" type="hidden" |
86 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.languageid' ) ) ); ?>'.replace('idx', idx)" |
|
87 | - value="<?= $enc->attr( key( $languages ) ); ?>" /> |
|
86 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.languageid'))); ?>'.replace('idx', idx)" |
|
87 | + value="<?= $enc->attr(key($languages)); ?>" /> |
|
88 | 88 | <?php endif; ?> |
89 | 89 | <div class="form-group row optional"> |
90 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Salutation' ) ); ?></label> |
|
90 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Salutation')); ?></label> |
|
91 | 91 | <div class="col-sm-8"> |
92 | - <select class="form-control custom-select item-salutation" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
93 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.salutation' ) ) ); ?>'.replace('idx', idx)" |
|
92 | + <select class="form-control custom-select item-salutation" tabindex="<?= $this->get('tabindex'); ?>" |
|
93 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.salutation'))); ?>'.replace('idx', idx)" |
|
94 | 94 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
95 | 95 | v-model="items[idx]['customer.address.salutation']" > |
96 | 96 | <option value="company" v-bind:selected="items[idx]['customer.address.salutation'] == 'company'" > |
97 | - <?= $enc->html( $this->translate( 'mshop/code', 'company' ) ); ?> |
|
97 | + <?= $enc->html($this->translate('mshop/code', 'company')); ?> |
|
98 | 98 | </option> |
99 | 99 | <option value="mr" v-bind:selected="items[idx]['customer.address.salutation'] == 'mr'" > |
100 | - <?= $enc->html( $this->translate( 'mshop/code', 'mr' ) ); ?> |
|
100 | + <?= $enc->html($this->translate('mshop/code', 'mr')); ?> |
|
101 | 101 | </option> |
102 | 102 | <option value="mrs" v-bind:selected="items[idx]['customer.address.salutation'] == 'mrs'" > |
103 | - <?= $enc->html( $this->translate( 'mshop/code', 'mrs' ) ); ?> |
|
103 | + <?= $enc->html($this->translate('mshop/code', 'mrs')); ?> |
|
104 | 104 | </option> |
105 | 105 | <option value="miss" v-bind:selected="items[idx]['customer.address.salutation'] == 'miss'" > |
106 | - <?= $enc->html( $this->translate( 'mshop/code', 'miss' ) ); ?> |
|
106 | + <?= $enc->html($this->translate('mshop/code', 'miss')); ?> |
|
107 | 107 | </option> |
108 | 108 | </select> |
109 | 109 | </div> |
110 | 110 | <div class="col-sm-12 form-text text-muted help-text"> |
111 | - <?= $enc->html( $this->translate( 'admin', 'How the customer is addressed in e-mails' ) ); ?> |
|
111 | + <?= $enc->html($this->translate('admin', 'How the customer is addressed in e-mails')); ?> |
|
112 | 112 | </div> |
113 | 113 | </div> |
114 | 114 | <div class="form-group row optional"> |
115 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Title' ) ); ?></label> |
|
115 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Title')); ?></label> |
|
116 | 116 | <div class="col-sm-8"> |
117 | - <input class="form-control item-title" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
118 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.title' ) ) ); ?>'.replace('idx', idx)" |
|
119 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Honorary title (optional)' ) ); ?>" |
|
117 | + <input class="form-control item-title" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
118 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.title'))); ?>'.replace('idx', idx)" |
|
119 | + placeholder="<?= $enc->attr($this->translate('admin', 'Honorary title (optional)')); ?>" |
|
120 | 120 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
121 | 121 | v-model="items[idx]['customer.address.title']" /> |
122 | 122 | </div> |
123 | 123 | <div class="col-sm-12 form-text text-muted help-text"> |
124 | - <?= $enc->html( $this->translate( 'admin', 'Honorary titles like Dr., Ph.D, etc.' ) ); ?> |
|
124 | + <?= $enc->html($this->translate('admin', 'Honorary titles like Dr., Ph.D, etc.')); ?> |
|
125 | 125 | </div> |
126 | 126 | </div> |
127 | 127 | <div class="form-group row mandatory"> |
128 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Last name' ) ); ?></label> |
|
128 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Last name')); ?></label> |
|
129 | 129 | <div class="col-sm-8"> |
130 | - <input class="form-control item-lastname" type="text" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
131 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.lastname' ) ) ); ?>'.replace('idx', idx)" |
|
132 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Last name (required)' ) ); ?>" |
|
130 | + <input class="form-control item-lastname" type="text" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
131 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.lastname'))); ?>'.replace('idx', idx)" |
|
132 | + placeholder="<?= $enc->attr($this->translate('admin', 'Last name (required)')); ?>" |
|
133 | 133 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
134 | 134 | v-model="items[idx]['customer.address.lastname']" /> |
135 | 135 | </div> |
136 | 136 | <div class="col-sm-12 form-text text-muted help-text"> |
137 | - <?= $enc->html( $this->translate( 'admin', 'Last name of the person or full name in cultures where no first names are used' ) ); ?> |
|
137 | + <?= $enc->html($this->translate('admin', 'Last name of the person or full name in cultures where no first names are used')); ?> |
|
138 | 138 | </div> |
139 | 139 | </div> |
140 | 140 | <div class="form-group row optional"> |
141 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'First name' ) ); ?></label> |
|
141 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'First name')); ?></label> |
|
142 | 142 | <div class="col-sm-8"> |
143 | - <input class="form-control item-firstname" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
144 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.firstname' ) ) ); ?>'.replace('idx', idx)" |
|
145 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'First name (optional)' ) ); ?>" |
|
143 | + <input class="form-control item-firstname" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
144 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.firstname'))); ?>'.replace('idx', idx)" |
|
145 | + placeholder="<?= $enc->attr($this->translate('admin', 'First name (optional)')); ?>" |
|
146 | 146 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
147 | 147 | v-model="items[idx]['customer.address.firstname']" /> |
148 | 148 | </div> |
149 | 149 | <div class="col-sm-12 form-text text-muted help-text"> |
150 | - <?= $enc->html( $this->translate( 'admin', 'First name of the person if used in cultures where they are used' ) ); ?> |
|
150 | + <?= $enc->html($this->translate('admin', 'First name of the person if used in cultures where they are used')); ?> |
|
151 | 151 | </div> |
152 | 152 | </div> |
153 | 153 | </div><!-- |
154 | 154 | |
155 | 155 | --><div class="col-xl-6 content-block"> |
156 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Delivery address' ) ); ?></h2> |
|
156 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Delivery address')); ?></h2> |
|
157 | 157 | <div class="form-group row optional"> |
158 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Street' ) ); ?></label> |
|
158 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Street')); ?></label> |
|
159 | 159 | <div class="col-sm-8"> |
160 | - <input class="form-control item-address1" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
161 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.address1' ) ) ); ?>'.replace('idx', idx)" |
|
162 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Street name (optional)' ) ); ?>" |
|
160 | + <input class="form-control item-address1" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
161 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.address1'))); ?>'.replace('idx', idx)" |
|
162 | + placeholder="<?= $enc->attr($this->translate('admin', 'Street name (optional)')); ?>" |
|
163 | 163 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
164 | 164 | v-model="items[idx]['customer.address.address1']" /> |
165 | 165 | </div> |
166 | 166 | <div class="col-sm-12 form-text text-muted help-text"> |
167 | - <?= $enc->html( $this->translate( 'admin', 'First name of the person if used in cultures where they are used' ) ); ?> |
|
167 | + <?= $enc->html($this->translate('admin', 'First name of the person if used in cultures where they are used')); ?> |
|
168 | 168 | </div> |
169 | 169 | </div> |
170 | 170 | <div class="form-group row optional"> |
171 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'House number' ) ); ?></label> |
|
171 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'House number')); ?></label> |
|
172 | 172 | <div class="col-sm-8"> |
173 | - <input class="form-control item-address2" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
174 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.address2' ) ) ); ?>'.replace('idx', idx)" |
|
175 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'House number (optional)' ) ); ?>" |
|
173 | + <input class="form-control item-address2" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
174 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.address2'))); ?>'.replace('idx', idx)" |
|
175 | + placeholder="<?= $enc->attr($this->translate('admin', 'House number (optional)')); ?>" |
|
176 | 176 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
177 | 177 | v-model="items[idx]['customer.address.address2']" /> |
178 | 178 | </div> |
179 | 179 | <div class="col-sm-12 form-text text-muted help-text"> |
180 | - <?= $enc->html( $this->translate( 'admin', 'Address identifier of the customer\'s house for delivery' ) ); ?> |
|
180 | + <?= $enc->html($this->translate('admin', 'Address identifier of the customer\'s house for delivery')); ?> |
|
181 | 181 | </div> |
182 | 182 | </div> |
183 | 183 | <div class="form-group row optional"> |
184 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Floor / Appartment' ) ); ?></label> |
|
184 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Floor / Appartment')); ?></label> |
|
185 | 185 | <div class="col-sm-8"> |
186 | - <input class="form-control item-address3" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
187 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.address3' ) ) ); ?>'.replace('idx', idx)" |
|
188 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Floor and/or apartment (optional)' ) ); ?>" |
|
186 | + <input class="form-control item-address3" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
187 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.address3'))); ?>'.replace('idx', idx)" |
|
188 | + placeholder="<?= $enc->attr($this->translate('admin', 'Floor and/or apartment (optional)')); ?>" |
|
189 | 189 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
190 | 190 | v-model="items[idx]['customer.address.address3']" /> |
191 | 191 | </div> |
192 | 192 | <div class="col-sm-12 form-text text-muted help-text"> |
193 | - <?= $enc->html( $this->translate( 'admin', 'Additional information where the customer\'s apartment can be found' ) ); ?> |
|
193 | + <?= $enc->html($this->translate('admin', 'Additional information where the customer\'s apartment can be found')); ?> |
|
194 | 194 | </div> |
195 | 195 | </div> |
196 | 196 | <div class="form-group row optional"> |
197 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Zip code' ) ); ?></label> |
|
197 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Zip code')); ?></label> |
|
198 | 198 | <div class="col-sm-8"> |
199 | - <input class="form-control item-postal" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
200 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.postal' ) ) ); ?>'.replace('idx', idx)" |
|
201 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Zip code (optional)' ) ); ?>" |
|
199 | + <input class="form-control item-postal" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
200 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.postal'))); ?>'.replace('idx', idx)" |
|
201 | + placeholder="<?= $enc->attr($this->translate('admin', 'Zip code (optional)')); ?>" |
|
202 | 202 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
203 | 203 | v-model="items[idx]['customer.address.postal']" /> |
204 | 204 | </div> |
205 | 205 | <div class="col-sm-12 form-text text-muted help-text"> |
206 | - <?= $enc->html( $this->translate( 'admin', 'Postal code for delivery if used in the area the customer is living' ) ); ?> |
|
206 | + <?= $enc->html($this->translate('admin', 'Postal code for delivery if used in the area the customer is living')); ?> |
|
207 | 207 | </div> |
208 | 208 | </div> |
209 | 209 | <div class="form-group row mandatory"> |
210 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'City' ) ); ?></label> |
|
210 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'City')); ?></label> |
|
211 | 211 | <div class="col-sm-8"> |
212 | - <input class="form-control item-city" type="text" required="required" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
213 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.city' ) ) ); ?>'.replace('idx', idx)" |
|
214 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'City or town name (required)' ) ); ?>" |
|
212 | + <input class="form-control item-city" type="text" required="required" tabindex="<?= $this->get('tabindex'); ?>" |
|
213 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.city'))); ?>'.replace('idx', idx)" |
|
214 | + placeholder="<?= $enc->attr($this->translate('admin', 'City or town name (required)')); ?>" |
|
215 | 215 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
216 | 216 | v-model="items[idx]['customer.address.city']" /> |
217 | 217 | </div> |
218 | 218 | </div> |
219 | 219 | <div class="form-group row mandatory"> |
220 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Country' ) ); ?></label> |
|
220 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Country')); ?></label> |
|
221 | 221 | <div class="col-sm-8"> |
222 | 222 | <select is="combo-box" class="form-control c-select item-countryid" required="required" |
223 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.countryid' ) ) ); ?>'.replace('idx', idx)" |
|
223 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.countryid'))); ?>'.replace('idx', idx)" |
|
224 | 224 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
225 | - v-bind:tabindex="'<?= $this->get( 'tabindex' ); ?>'" |
|
225 | + v-bind:tabindex="'<?= $this->get('tabindex'); ?>'" |
|
226 | 226 | v-bind:getfcn="getCountries" |
227 | 227 | v-model="items[idx]['customer.address.countryid']" > |
228 | 228 | <option value=""></option> |
229 | 229 | </select> |
230 | 230 | </div> |
231 | 231 | <div class="col-sm-12 form-text text-muted help-text"> |
232 | - <?= $enc->html( $this->translate( 'admin', 'Two letter ISO country code' ) ); ?> |
|
232 | + <?= $enc->html($this->translate('admin', 'Two letter ISO country code')); ?> |
|
233 | 233 | </div> |
234 | 234 | </div> |
235 | 235 | <div class="form-group row optional"> |
236 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'State' ) ); ?></label> |
|
236 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'State')); ?></label> |
|
237 | 237 | <div class="col-sm-8"> |
238 | - <input class="form-control item-state" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
239 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.state' ) ) ); ?>'.replace('idx', idx)" |
|
240 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Country state code (optional)' ) ); ?>" |
|
238 | + <input class="form-control item-state" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
239 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.state'))); ?>'.replace('idx', idx)" |
|
240 | + placeholder="<?= $enc->attr($this->translate('admin', 'Country state code (optional)')); ?>" |
|
241 | 241 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
242 | 242 | v-model="items[idx]['customer.address.state']" /> |
243 | 243 | </div> |
244 | 244 | <div class="col-sm-12 form-text text-muted help-text"> |
245 | - <?= $enc->html( $this->translate( 'admin', 'Short state code (e.g. NY) if used in the country the customer is living' ) ); ?> |
|
245 | + <?= $enc->html($this->translate('admin', 'Short state code (e.g. NY) if used in the country the customer is living')); ?> |
|
246 | 246 | </div> |
247 | 247 | </div> |
248 | 248 | </div><!-- |
249 | 249 | |
250 | 250 | --><div class="col-xl-6 content-block"> |
251 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Communication' ) ); ?></h2> |
|
251 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Communication')); ?></h2> |
|
252 | 252 | <div class="form-group row optional"> |
253 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Telephone' ) ); ?></label> |
|
253 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Telephone')); ?></label> |
|
254 | 254 | <div class="col-sm-8"> |
255 | - <input class="form-control item-telephone" type="tel" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
256 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.telephone' ) ) ); ?>'.replace('idx', idx)" |
|
257 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Telephone number (optional)' ) ); ?>" |
|
255 | + <input class="form-control item-telephone" type="tel" tabindex="<?= $this->get('tabindex'); ?>" |
|
256 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.telephone'))); ?>'.replace('idx', idx)" |
|
257 | + placeholder="<?= $enc->attr($this->translate('admin', 'Telephone number (optional)')); ?>" |
|
258 | 258 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
259 | 259 | v-model="items[idx]['customer.address.telephone']" /> |
260 | 260 | </div> |
261 | 261 | <div class="col-sm-12 form-text text-muted help-text"> |
262 | - <?= $enc->html( $this->translate( 'admin', '(International) telephone number without separation characters, can start with a "+"' ) ); ?> |
|
262 | + <?= $enc->html($this->translate('admin', '(International) telephone number without separation characters, can start with a "+"')); ?> |
|
263 | 263 | </div> |
264 | 264 | </div> |
265 | 265 | <div class="form-group row optional"> |
266 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Facsimile' ) ); ?></label> |
|
266 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Facsimile')); ?></label> |
|
267 | 267 | <div class="col-sm-8"> |
268 | - <input class="form-control item-telefax" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
269 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.telefax' ) ) ); ?>'.replace('idx', idx)" |
|
270 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Facsimile number (optional)' ) ); ?>" |
|
268 | + <input class="form-control item-telefax" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
269 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.telefax'))); ?>'.replace('idx', idx)" |
|
270 | + placeholder="<?= $enc->attr($this->translate('admin', 'Facsimile number (optional)')); ?>" |
|
271 | 271 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
272 | 272 | v-model="items[idx]['customer.address.telefax']" /> |
273 | 273 | </div> |
274 | 274 | <div class="col-sm-12 form-text text-muted help-text"> |
275 | - <?= $enc->html( $this->translate( 'admin', '(International) facsimilie number without separation characters, can start with a "+"' ) ); ?> |
|
275 | + <?= $enc->html($this->translate('admin', '(International) facsimilie number without separation characters, can start with a "+"')); ?> |
|
276 | 276 | </div> |
277 | 277 | </div> |
278 | 278 | <div class="form-group row optional"> |
279 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'E-mail' ) ); ?></label> |
|
279 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'E-mail')); ?></label> |
|
280 | 280 | <div class="col-sm-8"> |
281 | - <input class="form-control item-email" type="email" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
282 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.email' ) ) ); ?>'.replace('idx', idx)" |
|
283 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'E-mail address (optional)' ) ); ?>" |
|
281 | + <input class="form-control item-email" type="email" tabindex="<?= $this->get('tabindex'); ?>" |
|
282 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.email'))); ?>'.replace('idx', idx)" |
|
283 | + placeholder="<?= $enc->attr($this->translate('admin', 'E-mail address (optional)')); ?>" |
|
284 | 284 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
285 | 285 | v-model="items[idx]['customer.address.email']" /> |
286 | 286 | </div> |
287 | 287 | <div class="col-sm-12 form-text text-muted help-text"> |
288 | - <?= $enc->html( $this->translate( 'admin', 'E-mail address that belongs to the address' ) ); ?> |
|
288 | + <?= $enc->html($this->translate('admin', 'E-mail address that belongs to the address')); ?> |
|
289 | 289 | </div> |
290 | 290 | </div> |
291 | 291 | <div class="form-group row optional"> |
292 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Web site' ) ); ?></label> |
|
292 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Web site')); ?></label> |
|
293 | 293 | <div class="col-sm-8"> |
294 | - <input class="form-control item-website" type="url" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
295 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.website' ) ) ); ?>'.replace('idx', idx)" |
|
296 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Web site URL (optional)' ) ); ?>" |
|
294 | + <input class="form-control item-website" type="url" tabindex="<?= $this->get('tabindex'); ?>" |
|
295 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.website'))); ?>'.replace('idx', idx)" |
|
296 | + placeholder="<?= $enc->attr($this->translate('admin', 'Web site URL (optional)')); ?>" |
|
297 | 297 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
298 | 298 | v-model="items[idx]['customer.address.website']" /> |
299 | 299 | </div> |
300 | 300 | <div class="col-sm-12 form-text text-muted help-text"> |
301 | - <?= $enc->html( $this->translate( 'admin', 'URL of the customer web site' ) ); ?> |
|
301 | + <?= $enc->html($this->translate('admin', 'URL of the customer web site')); ?> |
|
302 | 302 | </div> |
303 | 303 | </div> |
304 | 304 | </div><!-- |
305 | 305 | |
306 | 306 | --><div class="col-xl-6 content-block"> |
307 | - <h2 class="col-sm-12 item-header"><?= $enc->html( $this->translate( 'admin', 'Company details' ) ); ?></h2> |
|
307 | + <h2 class="col-sm-12 item-header"><?= $enc->html($this->translate('admin', 'Company details')); ?></h2> |
|
308 | 308 | <div class="form-group row optional"> |
309 | - <label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Company' ) ); ?></label> |
|
309 | + <label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Company')); ?></label> |
|
310 | 310 | <div class="col-sm-8"> |
311 | - <input class="form-control item-company" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
312 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.company' ) ) ); ?>'.replace('idx', idx)" |
|
313 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Company name (optional)' ) ); ?>" |
|
311 | + <input class="form-control item-company" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
312 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.company'))); ?>'.replace('idx', idx)" |
|
313 | + placeholder="<?= $enc->attr($this->translate('admin', 'Company name (optional)')); ?>" |
|
314 | 314 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
315 | 315 | v-model="items[idx]['customer.address.company']" /> |
316 | 316 | </div> |
317 | 317 | </div> |
318 | 318 | <div class="form-group row optional"> |
319 | - <label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'VAT ID' ) ); ?></label> |
|
319 | + <label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'VAT ID')); ?></label> |
|
320 | 320 | <div class="col-sm-8"> |
321 | - <input class="form-control item-vatid" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
322 | - v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'customer.address.vatid' ) ) ); ?>'.replace('idx', idx)" |
|
323 | - placeholder="<?= $enc->attr( $this->translate( 'admin', 'Value added tax identifier (optional)' ) ); ?>" |
|
321 | + <input class="form-control item-vatid" type="text" tabindex="<?= $this->get('tabindex'); ?>" |
|
322 | + v-bind:name="'<?= $enc->attr($this->formparam(array('address', 'idx', 'customer.address.vatid'))); ?>'.replace('idx', idx)" |
|
323 | + placeholder="<?= $enc->attr($this->translate('admin', 'Value added tax identifier (optional)')); ?>" |
|
324 | 324 | v-bind:readonly="checkSite('customer.address.siteid', idx)" |
325 | 325 | v-model="items[idx]['customer.address.vatid']" /> |
326 | 326 | </div> |
327 | 327 | <div class="col-sm-12 form-text text-muted help-text"> |
328 | - <?= $enc->html( $this->translate( 'admin', 'Official VAT ID to determine if the tax needs to be billed in invoices' ) ); ?> |
|
328 | + <?= $enc->html($this->translate('admin', 'Official VAT ID to determine if the tax needs to be billed in invoices')); ?> |
|
329 | 329 | </div> |
330 | 330 | </div> |
331 | 331 | </div> |
332 | 332 | |
333 | - <?= $this->get( 'addressBody' ); ?> |
|
333 | + <?= $this->get('addressBody'); ?> |
|
334 | 334 | |
335 | 335 | </div> |
336 | 336 | </div> |
337 | 337 | |
338 | 338 | <div class="card-tools-more"> |
339 | - <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get( 'tabindex' ); ?>" |
|
340 | - title="<?= $enc->attr( $this->translate( 'admin', 'Insert new entry (Ctrl+I)') ); ?>" |
|
339 | + <div class="btn btn-primary btn-card-more act-add fa" tabindex="<?= $this->get('tabindex'); ?>" |
|
340 | + title="<?= $enc->attr($this->translate('admin', 'Insert new entry (Ctrl+I)')); ?>" |
|
341 | 341 | v-on:click="addItem('customer.address.')" > |
342 | 342 | </div> |
343 | 343 | </div> |