@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/type/text/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/type/text/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/type/text/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Text\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Text\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Type\\Text\\' . $name; |
79 | 79 | |
80 | - $client = self::createAdmin( $context, $classname, $iface ); |
|
80 | + $client = self::createAdmin($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'type/text' ); |
|
82 | + return self::addClientDecorators($context, $client, 'type/text'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/type/price/lists/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/type/price/lists/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/type/price/lists/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Price\\Lists\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Price\\Lists\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Type\\Price\\Lists\\' . $name; |
79 | 79 | |
80 | - $client = self::createAdmin( $context, $classname, $iface ); |
|
80 | + $client = self::createAdmin($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'type/price/lists' ); |
|
82 | + return self::addClientDecorators($context, $client, 'type/price/lists'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/type/price/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/type/price/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/type/price/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Price\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Type\\Price\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Type\\Price\\' . $name; |
79 | 79 | |
80 | - $client = self::createAdmin( $context, $classname, $iface ); |
|
80 | + $client = self::createAdmin($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'type/price' ); |
|
82 | + return self::addClientDecorators($context, $client, 'type/price'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Order; |
12 | 12 | |
13 | -sprintf( 'order' ); // for translation |
|
13 | +sprintf('order'); // 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, 'order/base' ); |
|
43 | - $view->item = $manager->load( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'order/base'); |
|
43 | + $view->item = $manager->load($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( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('order-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( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('order-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, 'order/base' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'order/base')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['order.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( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('order-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( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('order-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 | |
@@ -128,34 +128,34 @@ discard block |
||
128 | 128 | |
129 | 129 | try |
130 | 130 | { |
131 | - $params = $this->storeSearchParams( $view->param(), 'order' ); |
|
131 | + $params = $this->storeSearchParams($view->param(), 'order'); |
|
132 | 132 | $msg = ['sitecode' => $context->getLocale()->getSite()->getCode()]; |
133 | 133 | |
134 | - if( isset( $params['filter'] ) ) { |
|
135 | - $msg['filter'] = $this->getCriteriaConditions( $params['filter'] ); |
|
134 | + if (isset($params['filter'])) { |
|
135 | + $msg['filter'] = $this->getCriteriaConditions($params['filter']); |
|
136 | 136 | } |
137 | 137 | |
138 | - if( isset( $params['sort'] ) ) { |
|
139 | - $msg['sort'] = $this->getCriteriaSortations( $params['sort'] ); |
|
138 | + if (isset($params['sort'])) { |
|
139 | + $msg['sort'] = $this->getCriteriaSortations($params['sort']); |
|
140 | 140 | } |
141 | 141 | |
142 | - $mq = $context->getMessageQueueManager()->get( 'mq-admin' )->getQueue( 'order-export' ); |
|
143 | - $mq->add( json_encode( $msg ) ); |
|
142 | + $mq = $context->getMessageQueueManager()->get('mq-admin')->getQueue('order-export'); |
|
143 | + $mq->add(json_encode($msg)); |
|
144 | 144 | |
145 | - $msg = $context->getI18n()->dt( 'admin', 'Your export will be available in a few minutes for download' ); |
|
146 | - $view->info = $view->get( 'info', [] ) + ['order-item' => $msg]; |
|
145 | + $msg = $context->getI18n()->dt('admin', 'Your export will be available in a few minutes for download'); |
|
146 | + $view->info = $view->get('info', []) + ['order-item' => $msg]; |
|
147 | 147 | } |
148 | - catch( \Aimeos\MShop\Exception $e ) |
|
148 | + catch (\Aimeos\MShop\Exception $e) |
|
149 | 149 | { |
150 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
151 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
152 | - $this->logException( $e ); |
|
150 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
151 | + $view->errors = $view->get('errors', []) + $error; |
|
152 | + $this->logException($e); |
|
153 | 153 | } |
154 | - catch( \Exception $e ) |
|
154 | + catch (\Exception $e) |
|
155 | 155 | { |
156 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
157 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
158 | - $this->logException( $e ); |
|
156 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
157 | + $view->errors = $view->get('errors', []) + $error; |
|
158 | + $this->logException($e); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return $this->search(); |
@@ -174,38 +174,38 @@ discard block |
||
174 | 174 | |
175 | 175 | try |
176 | 176 | { |
177 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
178 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
177 | + if (($id = $view->param('id')) === null) { |
|
178 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
179 | 179 | } |
180 | 180 | |
181 | - $manager = \Aimeos\MShop::create( $context, 'order/base' ); |
|
181 | + $manager = \Aimeos\MShop::create($context, 'order/base'); |
|
182 | 182 | $refs = ['order/base/address', 'order/base/coupon', 'order/base/product', 'order/base/service']; |
183 | 183 | |
184 | - $view->item = $manager->getItem( $id, $refs ); |
|
184 | + $view->item = $manager->getItem($id, $refs); |
|
185 | 185 | $view->itemSubparts = $this->getSubClientNames(); |
186 | - $view->itemData = $this->toArray( $view->item ); |
|
186 | + $view->itemData = $this->toArray($view->item); |
|
187 | 187 | $view->itemBody = ''; |
188 | 188 | |
189 | - foreach( $this->getSubClients() as $idx => $client ) |
|
189 | + foreach ($this->getSubClients() as $idx => $client) |
|
190 | 190 | { |
191 | 191 | $view->tabindex = ++$idx + 1; |
192 | 192 | $view->itemBody .= $client->get(); |
193 | 193 | } |
194 | 194 | } |
195 | - catch( \Aimeos\MShop\Exception $e ) |
|
195 | + catch (\Aimeos\MShop\Exception $e) |
|
196 | 196 | { |
197 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
198 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
199 | - $this->logException( $e ); |
|
197 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
198 | + $view->errors = $view->get('errors', []) + $error; |
|
199 | + $this->logException($e); |
|
200 | 200 | } |
201 | - catch( \Exception $e ) |
|
201 | + catch (\Exception $e) |
|
202 | 202 | { |
203 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
204 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
205 | - $this->logException( $e ); |
|
203 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
204 | + $view->errors = $view->get('errors', []) + $error; |
|
205 | + $this->logException($e); |
|
206 | 206 | } |
207 | 207 | |
208 | - return $this->render( $view ); |
|
208 | + return $this->render($view); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | |
@@ -219,40 +219,40 @@ discard block |
||
219 | 219 | $view = $this->getView(); |
220 | 220 | $context = $this->getContext(); |
221 | 221 | |
222 | - $manager = \Aimeos\MShop::create( $context, 'order/base' ); |
|
222 | + $manager = \Aimeos\MShop::create($context, 'order/base'); |
|
223 | 223 | $manager->begin(); |
224 | 224 | |
225 | 225 | try |
226 | 226 | { |
227 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
228 | - $view->item = $item->getId() ? $item : $manager->store( clone $item ); |
|
227 | + $item = $this->fromArray($view->param('item', [])); |
|
228 | + $view->item = $item->getId() ? $item : $manager->store(clone $item); |
|
229 | 229 | $view->itemBody = ''; |
230 | 230 | |
231 | - foreach( $this->getSubClients() as $client ) { |
|
231 | + foreach ($this->getSubClients() as $client) { |
|
232 | 232 | $view->itemBody .= $client->save(); |
233 | 233 | } |
234 | 234 | |
235 | - $manager->store( clone $view->item ); |
|
235 | + $manager->store(clone $view->item); |
|
236 | 236 | $manager->commit(); |
237 | 237 | |
238 | - $this->nextAction( $view, $view->param( 'next' ), 'order', $view->item->getId(), 'save' ); |
|
238 | + $this->nextAction($view, $view->param('next'), 'order', $view->item->getId(), 'save'); |
|
239 | 239 | return; |
240 | 240 | } |
241 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
241 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
242 | 242 | { |
243 | 243 | // fall through to create |
244 | 244 | } |
245 | - catch( \Aimeos\MShop\Exception $e ) |
|
245 | + catch (\Aimeos\MShop\Exception $e) |
|
246 | 246 | { |
247 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
248 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
249 | - $this->logException( $e ); |
|
247 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
248 | + $view->errors = $view->get('errors', []) + $error; |
|
249 | + $this->logException($e); |
|
250 | 250 | } |
251 | - catch( \Exception $e ) |
|
251 | + catch (\Exception $e) |
|
252 | 252 | { |
253 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
254 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
255 | - $this->logException( $e ); |
|
253 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
254 | + $view->errors = $view->get('errors', []) + $error; |
|
255 | + $this->logException($e); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | $manager->rollback(); |
@@ -274,35 +274,35 @@ discard block |
||
274 | 274 | try |
275 | 275 | { |
276 | 276 | $total = 0; |
277 | - $params = $this->storeSearchParams( $view->param(), 'order' ); |
|
278 | - $manager = \Aimeos\MShop::create( $context, 'order' ); |
|
277 | + $params = $this->storeSearchParams($view->param(), 'order'); |
|
278 | + $manager = \Aimeos\MShop::create($context, 'order'); |
|
279 | 279 | |
280 | 280 | $search = $manager->createSearch(); |
281 | - $search->setSortations( [$search->sort( '-', 'order.id' )] ); |
|
282 | - $search = $this->initCriteria( $search, $params ); |
|
281 | + $search->setSortations([$search->sort('-', 'order.id')]); |
|
282 | + $search = $this->initCriteria($search, $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->baseItems = $this->getOrderBaseItems( $view->items ); |
|
286 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->baseItems = $this->getOrderBaseItems($view->items); |
|
286 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
287 | 287 | $view->filterOperators = $search->getOperators(); |
288 | 288 | $view->total = $total; |
289 | 289 | $view->itemBody = ''; |
290 | 290 | |
291 | - foreach( $this->getSubClients() as $client ) { |
|
291 | + foreach ($this->getSubClients() as $client) { |
|
292 | 292 | $view->itemBody .= $client->search(); |
293 | 293 | } |
294 | 294 | } |
295 | - catch( \Aimeos\MShop\Exception $e ) |
|
295 | + catch (\Aimeos\MShop\Exception $e) |
|
296 | 296 | { |
297 | - $error = array( 'order-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
298 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
299 | - $this->logException( $e ); |
|
297 | + $error = array('order-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
298 | + $view->errors = $view->get('errors', []) + $error; |
|
299 | + $this->logException($e); |
|
300 | 300 | } |
301 | - catch( \Exception $e ) |
|
301 | + catch (\Exception $e) |
|
302 | 302 | { |
303 | - $error = array( 'order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
304 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
305 | - $this->logException( $e ); |
|
303 | + $error = array('order-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
304 | + $view->errors = $view->get('errors', []) + $error; |
|
305 | + $this->logException($e); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** admin/jqadm/order/template-list |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $tplconf = 'admin/jqadm/order/template-list'; |
328 | 328 | $default = 'order/list-standard'; |
329 | 329 | |
330 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
330 | + return $view->render($view->config($tplconf, $default)); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @param string|null $name Name of the sub-client (Default if null) |
339 | 339 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
340 | 340 | */ |
341 | - public function getSubClient( $type, $name = null ) |
|
341 | + public function getSubClient($type, $name = null) |
|
342 | 342 | { |
343 | 343 | /** admin/jqadm/order/decorators/excludes |
344 | 344 | * Excludes decorators added by the "common" option from the order JQAdm client |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * @see admin/jqadm/order/decorators/excludes |
414 | 414 | * @see admin/jqadm/order/decorators/global |
415 | 415 | */ |
416 | - return $this->createSubClient( 'order/' . $type, $name ); |
|
416 | + return $this->createSubClient('order/' . $type, $name); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | |
@@ -423,19 +423,19 @@ discard block |
||
423 | 423 | * @param \Aimeos\MShop\Order\Item\Iface[] $orderItems List of order items |
424 | 424 | * @param \Aimeos\MShop\Order\Item\Base\Iface[] List of order base items |
425 | 425 | */ |
426 | - protected function getOrderBaseItems( array $orderItems ) |
|
426 | + protected function getOrderBaseItems(array $orderItems) |
|
427 | 427 | { |
428 | 428 | $baseIds = []; |
429 | - foreach( $orderItems as $item ) { |
|
429 | + foreach ($orderItems as $item) { |
|
430 | 430 | $baseIds[] = $item->getBaseId(); |
431 | 431 | } |
432 | 432 | |
433 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order/base' ); |
|
433 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order/base'); |
|
434 | 434 | |
435 | - $search = $manager->createSearch()->setSlice( 0, count( $baseIds ) ); |
|
436 | - $search->setConditions( $search->compare( '==', 'order.base.id', $baseIds ) ); |
|
435 | + $search = $manager->createSearch()->setSlice(0, count($baseIds)); |
|
436 | + $search->setConditions($search->compare('==', 'order.base.id', $baseIds)); |
|
437 | 437 | |
438 | - return $manager->searchItems( $search, ['order/base/address', 'order/base/service'] ); |
|
438 | + return $manager->searchItems($search, ['order/base/address', 'order/base/service']); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | * @since 2016.01 |
480 | 480 | * @category Developer |
481 | 481 | */ |
482 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/order/standard/subparts', [] ); |
|
482 | + return $this->getContext()->getConfig()->get('admin/jqadm/order/standard/subparts', []); |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | |
@@ -489,72 +489,72 @@ discard block |
||
489 | 489 | * @param string[] Data array |
490 | 490 | * @return \Aimeos\MShop\Order\Item\Iface New order item object |
491 | 491 | */ |
492 | - protected function fromArray( array $data ) |
|
492 | + protected function fromArray(array $data) |
|
493 | 493 | { |
494 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order/base' ); |
|
495 | - $attrManager = \Aimeos\MShop::create( $this->getContext(), 'order/base/service/attribute' ); |
|
494 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order/base'); |
|
495 | + $attrManager = \Aimeos\MShop::create($this->getContext(), 'order/base/service/attribute'); |
|
496 | 496 | |
497 | - if( isset( $data['order.base.id'] ) ) { |
|
498 | - $basket = $manager->load( $data['order.base.id'] ); |
|
497 | + if (isset($data['order.base.id'])) { |
|
498 | + $basket = $manager->load($data['order.base.id']); |
|
499 | 499 | } else { |
500 | 500 | $basket = $manager->createItem(); |
501 | 501 | } |
502 | 502 | |
503 | - $basket->fromArray( $data ); |
|
503 | + $basket->fromArray($data); |
|
504 | 504 | |
505 | - foreach( $basket->getProducts() as $pos => $product ) |
|
505 | + foreach ($basket->getProducts() as $pos => $product) |
|
506 | 506 | { |
507 | - if( isset( $data['product'][$pos]['order.base.product.status'] ) ) { |
|
508 | - $product->setStatus( $data['product'][$pos]['order.base.product.status'] ); |
|
507 | + if (isset($data['product'][$pos]['order.base.product.status'])) { |
|
508 | + $product->setStatus($data['product'][$pos]['order.base.product.status']); |
|
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
512 | - foreach( $basket->getAddresses() as $type => $address ) |
|
512 | + foreach ($basket->getAddresses() as $type => $address) |
|
513 | 513 | { |
514 | - if( isset( $data['address'][$type] ) ) { |
|
514 | + if (isset($data['address'][$type])) { |
|
515 | 515 | $list = (array) $data['address'][$type]; |
516 | - $basket->setAddress( $address->fromArray( $list ), $type ); |
|
516 | + $basket->setAddress($address->fromArray($list), $type); |
|
517 | 517 | } else { |
518 | - $basket->deleteAddress( $type ); |
|
518 | + $basket->deleteAddress($type); |
|
519 | 519 | } |
520 | 520 | } |
521 | 521 | |
522 | - foreach( $basket->getServices() as $type => $services ) |
|
522 | + foreach ($basket->getServices() as $type => $services) |
|
523 | 523 | { |
524 | - foreach( $services as $serviceId => $service ) |
|
524 | + foreach ($services as $serviceId => $service) |
|
525 | 525 | { |
526 | 526 | $list = []; |
527 | 527 | $attrItems = $service->getAttributeItems(); |
528 | 528 | |
529 | - if( isset( $data['service'][$type][$serviceId] ) ) |
|
529 | + if (isset($data['service'][$type][$serviceId])) |
|
530 | 530 | { |
531 | - foreach( (array) $data['service'][$type][$serviceId] as $key => $pair ) |
|
531 | + foreach ((array) $data['service'][$type][$serviceId] as $key => $pair) |
|
532 | 532 | { |
533 | - foreach( $pair as $pos => $value ) { |
|
533 | + foreach ($pair as $pos => $value) { |
|
534 | 534 | $list[$pos][$key] = $value; |
535 | 535 | } |
536 | 536 | } |
537 | 537 | |
538 | - foreach( $list as $array ) |
|
538 | + foreach ($list as $array) |
|
539 | 539 | { |
540 | - if( isset( $attrItems[$array['order.base.service.attribute.id']] ) ) |
|
540 | + if (isset($attrItems[$array['order.base.service.attribute.id']])) |
|
541 | 541 | { |
542 | 542 | $attrItem = $attrItems[$array['order.base.service.attribute.id']]; |
543 | - unset( $attrItems[$array['order.base.service.attribute.id']] ); |
|
543 | + unset($attrItems[$array['order.base.service.attribute.id']]); |
|
544 | 544 | } |
545 | 545 | else |
546 | 546 | { |
547 | 547 | $attrItem = $attrManager->createItem(); |
548 | 548 | } |
549 | 549 | |
550 | - $attrItem->fromArray( $array ); |
|
551 | - $attrItem->setParentId( $service->getId() ); |
|
550 | + $attrItem->fromArray($array); |
|
551 | + $attrItem->setParentId($service->getId()); |
|
552 | 552 | |
553 | - $item = $attrManager->saveItem( $attrItem ); |
|
553 | + $item = $attrManager->saveItem($attrItem); |
|
554 | 554 | } |
555 | 555 | } |
556 | 556 | |
557 | - $attrManager->deleteItems( array_keys( $attrItems ) ); |
|
557 | + $attrManager->deleteItems(array_keys($attrItems)); |
|
558 | 558 | } |
559 | 559 | } |
560 | 560 | |
@@ -568,53 +568,53 @@ discard block |
||
568 | 568 | * @param \Aimeos\MShop\Order\Item\Base\Iface $item Order base item object |
569 | 569 | * @return string[] Multi-dimensional associative list of item data |
570 | 570 | */ |
571 | - protected function toArray( \Aimeos\MShop\Order\Item\Base\Iface $item, $copy = false ) |
|
571 | + protected function toArray(\Aimeos\MShop\Order\Item\Base\Iface $item, $copy = false) |
|
572 | 572 | { |
573 | 573 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
574 | - $data = $item->toArray( true ); |
|
574 | + $data = $item->toArray(true); |
|
575 | 575 | |
576 | - if( $item->getCustomerId() != '' ) |
|
576 | + if ($item->getCustomerId() != '') |
|
577 | 577 | { |
578 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer' ); |
|
578 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer'); |
|
579 | 579 | |
580 | 580 | try { |
581 | - $data += $manager->getItem( $item->getCustomerId() )->toArray(); |
|
582 | - } catch( \Exception $e ) {}; |
|
581 | + $data += $manager->getItem($item->getCustomerId())->toArray(); |
|
582 | + } catch (\Exception $e) {}; |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | |
586 | - if( $copy === true ) |
|
586 | + if ($copy === true) |
|
587 | 587 | { |
588 | 588 | $data['order.base.siteid'] = $siteId; |
589 | 589 | $data['order.base.id'] = ''; |
590 | 590 | } |
591 | 591 | |
592 | - foreach( $item->getAddresses() as $type => $addrItem ) |
|
592 | + foreach ($item->getAddresses() as $type => $addrItem) |
|
593 | 593 | { |
594 | - $list = $addrItem->toArray( true ); |
|
594 | + $list = $addrItem->toArray(true); |
|
595 | 595 | |
596 | - foreach( $list as $key => $value ) { |
|
596 | + foreach ($list as $key => $value) { |
|
597 | 597 | $data['address'][$type][$key] = $value; |
598 | 598 | } |
599 | 599 | |
600 | - if( $copy === true ) |
|
600 | + if ($copy === true) |
|
601 | 601 | { |
602 | 602 | $data['address'][$type]['order.base.address.siteid'] = $siteId; |
603 | 603 | $data['address'][$type]['order.base.address.id'] = ''; |
604 | 604 | } |
605 | 605 | } |
606 | 606 | |
607 | - if( $copy !== true ) |
|
607 | + if ($copy !== true) |
|
608 | 608 | { |
609 | - foreach( $item->getServices() as $type => $services ) |
|
609 | + foreach ($item->getServices() as $type => $services) |
|
610 | 610 | { |
611 | - foreach( $services as $serviceItem ) |
|
611 | + foreach ($services as $serviceItem) |
|
612 | 612 | { |
613 | 613 | $serviceId = $serviceItem->getServiceId(); |
614 | 614 | |
615 | - foreach( $serviceItem->getAttributeItems() as $attrItem ) |
|
615 | + foreach ($serviceItem->getAttributeItems() as $attrItem) |
|
616 | 616 | { |
617 | - foreach( $attrItem->toArray( true ) as $key => $value ) { |
|
617 | + foreach ($attrItem->toArray(true) as $key => $value) { |
|
618 | 618 | $data['service'][$type][$serviceId][$key][] = $value; |
619 | 619 | } |
620 | 620 | } |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | } |
623 | 623 | } |
624 | 624 | |
625 | - foreach( $item->getProducts() as $pos => $productItem ) { |
|
625 | + foreach ($item->getProducts() as $pos => $productItem) { |
|
626 | 626 | $data['product'][$pos]['order.base.product.status'] = $productItem->getStatus(); |
627 | 627 | } |
628 | 628 | |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
637 | 637 | * @return string HTML output |
638 | 638 | */ |
639 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
639 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
640 | 640 | { |
641 | 641 | /** admin/jqadm/order/template-item |
642 | 642 | * Relative path to the HTML body template for the order item. |
@@ -660,6 +660,6 @@ discard block |
||
660 | 660 | $tplconf = 'admin/jqadm/order/template-item'; |
661 | 661 | $default = 'order/item-standard'; |
662 | 662 | |
663 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
663 | + return $view->render($view->config($tplconf, $default)); |
|
664 | 664 | } |
665 | 665 | } |
@@ -13,63 +13,63 @@ discard block |
||
13 | 13 | public static function bootstrap() |
14 | 14 | { |
15 | 15 | self::getAimeos(); |
16 | - \Aimeos\MShop::cache( false ); |
|
16 | + \Aimeos\MShop::cache(false); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | |
20 | - public static function getContext( $site = 'unittest' ) |
|
20 | + public static function getContext($site = 'unittest') |
|
21 | 21 | { |
22 | - if( !isset( self::$context[$site] ) ) { |
|
23 | - self::$context[$site] = self::createContext( $site ); |
|
22 | + if (!isset(self::$context[$site])) { |
|
23 | + self::$context[$site] = self::createContext($site); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | return clone self::$context[$site]; |
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | - public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null ) |
|
30 | + public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null) |
|
31 | 31 | { |
32 | - if( $config === null ) { |
|
33 | - $config = self::getContext( $site )->getConfig(); |
|
32 | + if ($config === null) { |
|
33 | + $config = self::getContext($site)->getConfig(); |
|
34 | 34 | } |
35 | 35 | |
36 | - $view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() ); |
|
36 | + $view = new \Aimeos\MW\View\Standard(self::getTemplatePaths()); |
|
37 | 37 | |
38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, ['site' => 'unittest'] ); |
|
39 | - $view->addHelper( 'param', $helper ); |
|
38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, ['site' => 'unittest']); |
|
39 | + $view->addHelper('param', $helper); |
|
40 | 40 | |
41 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
42 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
43 | - $view->addHelper( 'translate', $helper ); |
|
41 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
42 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
43 | + $view->addHelper('translate', $helper); |
|
44 | 44 | |
45 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
46 | - $view->addHelper( 'url', $helper ); |
|
45 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
46 | + $view->addHelper('url', $helper); |
|
47 | 47 | |
48 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
49 | - $view->addHelper( 'number', $helper ); |
|
48 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
49 | + $view->addHelper('number', $helper); |
|
50 | 50 | |
51 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
52 | - $view->addHelper( 'date', $helper ); |
|
51 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
52 | + $view->addHelper('date', $helper); |
|
53 | 53 | |
54 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, ['admin', 'resource/fs/baseurl'] ); |
|
55 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
56 | - $view->addHelper( 'config', $helper ); |
|
54 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, ['admin', 'resource/fs/baseurl']); |
|
55 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
56 | + $view->addHelper('config', $helper); |
|
57 | 57 | |
58 | - $helper = new \Aimeos\MW\View\Helper\Session\Standard( $view, new \Aimeos\MW\Session\None() ); |
|
59 | - $view->addHelper( 'session', $helper ); |
|
58 | + $helper = new \Aimeos\MW\View\Helper\Session\Standard($view, new \Aimeos\MW\Session\None()); |
|
59 | + $view->addHelper('session', $helper); |
|
60 | 60 | |
61 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, new \Zend\Diactoros\ServerRequest() ); |
|
62 | - $view->addHelper( 'request', $helper ); |
|
61 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, new \Zend\Diactoros\ServerRequest()); |
|
62 | + $view->addHelper('request', $helper); |
|
63 | 63 | |
64 | - $helper = new \Aimeos\MW\View\Helper\Response\Standard( $view, new \Zend\Diactoros\Response() ); |
|
65 | - $view->addHelper( 'response', $helper ); |
|
64 | + $helper = new \Aimeos\MW\View\Helper\Response\Standard($view, new \Zend\Diactoros\Response()); |
|
65 | + $view->addHelper('response', $helper); |
|
66 | 66 | |
67 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' ); |
|
68 | - $view->addHelper( 'csrf', $helper ); |
|
67 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value'); |
|
68 | + $view->addHelper('csrf', $helper); |
|
69 | 69 | |
70 | - $fcn = function() { return array( 'admin' ); }; |
|
71 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn ); |
|
72 | - $view->addHelper( 'access', $helper ); |
|
70 | + $fcn = function() { return array('admin'); }; |
|
71 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn); |
|
72 | + $view->addHelper('access', $helper); |
|
73 | 73 | |
74 | 74 | $view->pageSitePath = []; |
75 | 75 | |
@@ -79,19 +79,19 @@ discard block |
||
79 | 79 | |
80 | 80 | public static function getTemplatePaths() |
81 | 81 | { |
82 | - return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' ); |
|
82 | + return self::getAimeos()->getCustomPaths('admin/jqadm/templates'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
86 | 86 | public static function getAimeos() |
87 | 87 | { |
88 | - if( !isset( self::$aimeos ) ) |
|
88 | + if (!isset(self::$aimeos)) |
|
89 | 89 | { |
90 | 90 | require_once 'Bootstrap.php'; |
91 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
91 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
92 | 92 | |
93 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
94 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
93 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
94 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | return self::$aimeos; |
@@ -101,57 +101,57 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * @param string $site |
103 | 103 | */ |
104 | - private static function createContext( $site ) |
|
104 | + private static function createContext($site) |
|
105 | 105 | { |
106 | 106 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
107 | 107 | $aimeos = self::getAimeos(); |
108 | 108 | |
109 | 109 | |
110 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
110 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
111 | 111 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
112 | 112 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
113 | - $local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) ); |
|
113 | + $local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp'))); |
|
114 | 114 | |
115 | - $conf = new \Aimeos\MW\Config\PHPArray( $local, $paths ); |
|
116 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
117 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
118 | - $ctx->setConfig( $conf ); |
|
115 | + $conf = new \Aimeos\MW\Config\PHPArray($local, $paths); |
|
116 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
117 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
118 | + $ctx->setConfig($conf); |
|
119 | 119 | |
120 | 120 | |
121 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
122 | - $ctx->setDatabaseManager( $dbm ); |
|
121 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
122 | + $ctx->setDatabaseManager($dbm); |
|
123 | 123 | |
124 | 124 | |
125 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
126 | - $ctx->setFilesystemManager( $fs ); |
|
125 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf); |
|
126 | + $ctx->setFilesystemManager($fs); |
|
127 | 127 | |
128 | 128 | |
129 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf ); |
|
130 | - $ctx->setMessageQueueManager( $mq ); |
|
129 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($conf); |
|
130 | + $ctx->setMessageQueueManager($mq); |
|
131 | 131 | |
132 | 132 | |
133 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
134 | - $ctx->setLogger( $logger ); |
|
133 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
134 | + $ctx->setLogger($logger); |
|
135 | 135 | |
136 | 136 | |
137 | 137 | $cache = new \Aimeos\MW\Cache\None(); |
138 | - $ctx->setCache( $cache ); |
|
138 | + $ctx->setCache($cache); |
|
139 | 139 | |
140 | 140 | |
141 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
142 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
141 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
142 | + $ctx->setI18n(array('de' => $i18n)); |
|
143 | 143 | |
144 | 144 | |
145 | 145 | $session = new \Aimeos\MW\Session\None(); |
146 | - $ctx->setSession( $session ); |
|
146 | + $ctx->setSession($session); |
|
147 | 147 | |
148 | 148 | |
149 | - $localeManager = \Aimeos\MShop::create( $ctx, 'locale' ); |
|
150 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
151 | - $ctx->setLocale( $locale ); |
|
149 | + $localeManager = \Aimeos\MShop::create($ctx, 'locale'); |
|
150 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
151 | + $ctx->setLocale($locale); |
|
152 | 152 | |
153 | 153 | |
154 | - $ctx->setEditor( 'ai-admin-jqadm:admin/jqadm' ); |
|
154 | + $ctx->setEditor('ai-admin-jqadm:admin/jqadm'); |
|
155 | 155 | |
156 | 156 | return $ctx; |
157 | 157 | } |
@@ -13,55 +13,55 @@ discard block |
||
13 | 13 | public static function bootstrap() |
14 | 14 | { |
15 | 15 | self::getAimeos(); |
16 | - \Aimeos\MShop::cache( false ); |
|
16 | + \Aimeos\MShop::cache(false); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | |
20 | - public static function getContext( $site = 'unittest' ) |
|
20 | + public static function getContext($site = 'unittest') |
|
21 | 21 | { |
22 | - if( !isset( self::$context[$site] ) ) { |
|
23 | - self::$context[$site] = self::createContext( $site ); |
|
22 | + if (!isset(self::$context[$site])) { |
|
23 | + self::$context[$site] = self::createContext($site); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | return clone self::$context[$site]; |
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | - public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null ) |
|
30 | + public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null) |
|
31 | 31 | { |
32 | - if( $config === null ) { |
|
33 | - $config = self::getContext( $site )->getConfig(); |
|
32 | + if ($config === null) { |
|
33 | + $config = self::getContext($site)->getConfig(); |
|
34 | 34 | } |
35 | 35 | |
36 | - $view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() ); |
|
36 | + $view = new \Aimeos\MW\View\Standard(self::getTemplatePaths()); |
|
37 | 37 | |
38 | 38 | $param = ['site' => 'unittest']; |
39 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
40 | - $view->addHelper( 'param', $helper ); |
|
39 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
40 | + $view->addHelper('param', $helper); |
|
41 | 41 | |
42 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
43 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
44 | - $view->addHelper( 'translate', $helper ); |
|
42 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
43 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
44 | + $view->addHelper('translate', $helper); |
|
45 | 45 | |
46 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
47 | - $view->addHelper( 'url', $helper ); |
|
46 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
47 | + $view->addHelper('url', $helper); |
|
48 | 48 | |
49 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
50 | - $view->addHelper( 'number', $helper ); |
|
49 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
50 | + $view->addHelper('number', $helper); |
|
51 | 51 | |
52 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
53 | - $view->addHelper( 'date', $helper ); |
|
52 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
53 | + $view->addHelper('date', $helper); |
|
54 | 54 | |
55 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin', 'client/html', 'controller/jsonadm' ) ); |
|
56 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
57 | - $view->addHelper( 'config', $helper ); |
|
55 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin', 'client/html', 'controller/jsonadm')); |
|
56 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
57 | + $view->addHelper('config', $helper); |
|
58 | 58 | |
59 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' ); |
|
60 | - $view->addHelper( 'csrf', $helper ); |
|
59 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value'); |
|
60 | + $view->addHelper('csrf', $helper); |
|
61 | 61 | |
62 | - $fcn = function() { return array( 'admin' ); }; |
|
63 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn ); |
|
64 | - $view->addHelper( 'access', $helper ); |
|
62 | + $fcn = function() { return array('admin'); }; |
|
63 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn); |
|
64 | + $view->addHelper('access', $helper); |
|
65 | 65 | |
66 | 66 | return $view; |
67 | 67 | } |
@@ -69,19 +69,19 @@ discard block |
||
69 | 69 | |
70 | 70 | public static function getTemplatePaths() |
71 | 71 | { |
72 | - return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' ); |
|
72 | + return self::getAimeos()->getCustomPaths('admin/jqadm/templates'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | 76 | private static function getAimeos() |
77 | 77 | { |
78 | - if( !isset( self::$aimeos ) ) |
|
78 | + if (!isset(self::$aimeos)) |
|
79 | 79 | { |
80 | 80 | require_once 'Bootstrap.php'; |
81 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
81 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
82 | 82 | |
83 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
84 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
83 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
84 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | return self::$aimeos; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * @param string $site |
93 | 93 | */ |
94 | - private static function createContext( $site ) |
|
94 | + private static function createContext($site) |
|
95 | 95 | { |
96 | 96 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
97 | 97 | $aimeos = self::getAimeos(); |
@@ -100,44 +100,44 @@ discard block |
||
100 | 100 | $paths = $aimeos->getConfigPaths(); |
101 | 101 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
102 | 102 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
103 | - $local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) ); |
|
103 | + $local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp'))); |
|
104 | 104 | |
105 | - $conf = new \Aimeos\MW\Config\PHPArray( $local, $paths ); |
|
106 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
107 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
108 | - $ctx->setConfig( $conf ); |
|
105 | + $conf = new \Aimeos\MW\Config\PHPArray($local, $paths); |
|
106 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
107 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
108 | + $ctx->setConfig($conf); |
|
109 | 109 | |
110 | 110 | |
111 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
112 | - $ctx->setDatabaseManager( $dbm ); |
|
111 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
112 | + $ctx->setDatabaseManager($dbm); |
|
113 | 113 | |
114 | 114 | |
115 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
116 | - $ctx->setFilesystemManager( $fs ); |
|
115 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf); |
|
116 | + $ctx->setFilesystemManager($fs); |
|
117 | 117 | |
118 | 118 | |
119 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
120 | - $ctx->setLogger( $logger ); |
|
119 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
120 | + $ctx->setLogger($logger); |
|
121 | 121 | |
122 | 122 | |
123 | 123 | $cache = new \Aimeos\MW\Cache\None(); |
124 | - $ctx->setCache( $cache ); |
|
124 | + $ctx->setCache($cache); |
|
125 | 125 | |
126 | 126 | |
127 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
128 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
127 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
128 | + $ctx->setI18n(array('de' => $i18n)); |
|
129 | 129 | |
130 | 130 | |
131 | 131 | $session = new \Aimeos\MW\Session\None(); |
132 | - $ctx->setSession( $session ); |
|
132 | + $ctx->setSession($session); |
|
133 | 133 | |
134 | 134 | |
135 | - $localeManager = \Aimeos\MShop::create( $ctx, 'locale' ); |
|
136 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
137 | - $ctx->setLocale( $locale ); |
|
135 | + $localeManager = \Aimeos\MShop::create($ctx, 'locale'); |
|
136 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
137 | + $ctx->setLocale($locale); |
|
138 | 138 | |
139 | 139 | |
140 | - $ctx->setEditor( 'ai-admin-jqadm:lib/custom' ); |
|
140 | + $ctx->setEditor('ai-admin-jqadm:lib/custom'); |
|
141 | 141 | |
142 | 142 | return $ctx; |
143 | 143 | } |
@@ -29,40 +29,40 @@ |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface admin client implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path, $name = null ) |
|
32 | + public static function create(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path, $name = null) |
|
33 | 33 | { |
34 | - if( empty( $path ) ) { |
|
35 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Admin JQAdm type is empty' ) ); |
|
34 | + if (empty($path)) { |
|
35 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Admin JQAdm type is empty')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $view = $context->getView(); |
39 | 39 | $config = $context->getConfig(); |
40 | - $parts = explode( '/', $path ); |
|
40 | + $parts = explode('/', $path); |
|
41 | 41 | |
42 | - foreach( $parts as $idx => $part ) |
|
42 | + foreach ($parts as $idx => $part) |
|
43 | 43 | { |
44 | - if( ctype_alnum( $part ) === false ) { |
|
45 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in client name "%1$s"', $path ) ); |
|
44 | + if (ctype_alnum($part) === false) { |
|
45 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in client name "%1$s"', $path)); |
|
46 | 46 | } |
47 | 47 | |
48 | - $parts[$idx] = ucwords( $part ); |
|
48 | + $parts[$idx] = ucwords($part); |
|
49 | 49 | } |
50 | 50 | |
51 | - if( $view->access( $config->get( 'admin/jqadm/resource/' . $path . '/groups', [] ) ) !== true ) { |
|
52 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Not allowed to access JQAdm "%1$s" client', $path ) ); |
|
51 | + if ($view->access($config->get('admin/jqadm/resource/' . $path . '/groups', [])) !== true) { |
|
52 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Not allowed to access JQAdm "%1$s" client', $path)); |
|
53 | 53 | } |
54 | 54 | |
55 | - $factory = '\\Aimeos\\Admin\\JQAdm\\' . implode( '\\', $parts ) . '\\Factory'; |
|
55 | + $factory = '\\Aimeos\\Admin\\JQAdm\\' . implode('\\', $parts) . '\\Factory'; |
|
56 | 56 | |
57 | - if( class_exists( $factory ) === false ) { |
|
58 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Class "%1$s" not available', $factory ) ); |
|
57 | + if (class_exists($factory) === false) { |
|
58 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Class "%1$s" not available', $factory)); |
|
59 | 59 | } |
60 | 60 | |
61 | - if( ( $client = @call_user_func_array( [$factory, 'create'], [$context, $name] ) ) === false ) { |
|
62 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) ); |
|
61 | + if (($client = @call_user_func_array([$factory, 'create'], [$context, $name])) === false) { |
|
62 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid factory "%1$s"', $factory)); |
|
63 | 63 | } |
64 | 64 | |
65 | - return $client->setAimeos( $aimeos )->setView( $view );; |
|
65 | + return $client->setAimeos($aimeos)->setView($view); ; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | } |
69 | 69 | \ No newline at end of file |
@@ -8,35 +8,35 @@ discard block |
||
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | 10 | |
11 | -$target = $this->config( 'admin/jqadm/url/search/target' ); |
|
12 | -$controller = $this->config( 'admin/jqadm/url/search/controller', 'Jqadm' ); |
|
13 | -$action = $this->config( 'admin/jqadm/url/search/action', 'search' ); |
|
14 | -$config = $this->config( 'admin/jqadm/url/search/config', [] ); |
|
11 | +$target = $this->config('admin/jqadm/url/search/target'); |
|
12 | +$controller = $this->config('admin/jqadm/url/search/controller', 'Jqadm'); |
|
13 | +$action = $this->config('admin/jqadm/url/search/action', 'search'); |
|
14 | +$config = $this->config('admin/jqadm/url/search/config', []); |
|
15 | 15 | |
16 | -$newTarget = $this->config( 'admin/jqadm/url/create/target' ); |
|
17 | -$newCntl = $this->config( 'admin/jqadm/url/create/controller', 'Jqadm' ); |
|
18 | -$newAction = $this->config( 'admin/jqadm/url/create/action', 'create' ); |
|
19 | -$newConfig = $this->config( 'admin/jqadm/url/create/config', [] ); |
|
16 | +$newTarget = $this->config('admin/jqadm/url/create/target'); |
|
17 | +$newCntl = $this->config('admin/jqadm/url/create/controller', 'Jqadm'); |
|
18 | +$newAction = $this->config('admin/jqadm/url/create/action', 'create'); |
|
19 | +$newConfig = $this->config('admin/jqadm/url/create/config', []); |
|
20 | 20 | |
21 | -$getTarget = $this->config( 'admin/jqadm/url/get/target' ); |
|
22 | -$getCntl = $this->config( 'admin/jqadm/url/get/controller', 'Jqadm' ); |
|
23 | -$getAction = $this->config( 'admin/jqadm/url/get/action', 'get' ); |
|
24 | -$getConfig = $this->config( 'admin/jqadm/url/get/config', [] ); |
|
21 | +$getTarget = $this->config('admin/jqadm/url/get/target'); |
|
22 | +$getCntl = $this->config('admin/jqadm/url/get/controller', 'Jqadm'); |
|
23 | +$getAction = $this->config('admin/jqadm/url/get/action', 'get'); |
|
24 | +$getConfig = $this->config('admin/jqadm/url/get/config', []); |
|
25 | 25 | |
26 | -$copyTarget = $this->config( 'admin/jqadm/url/copy/target' ); |
|
27 | -$copyCntl = $this->config( 'admin/jqadm/url/copy/controller', 'Jqadm' ); |
|
28 | -$copyAction = $this->config( 'admin/jqadm/url/copy/action', 'copy' ); |
|
29 | -$copyConfig = $this->config( 'admin/jqadm/url/copy/config', [] ); |
|
26 | +$copyTarget = $this->config('admin/jqadm/url/copy/target'); |
|
27 | +$copyCntl = $this->config('admin/jqadm/url/copy/controller', 'Jqadm'); |
|
28 | +$copyAction = $this->config('admin/jqadm/url/copy/action', 'copy'); |
|
29 | +$copyConfig = $this->config('admin/jqadm/url/copy/config', []); |
|
30 | 30 | |
31 | -$delTarget = $this->config( 'admin/jqadm/url/delete/target' ); |
|
32 | -$delCntl = $this->config( 'admin/jqadm/url/delete/controller', 'Jqadm' ); |
|
33 | -$delAction = $this->config( 'admin/jqadm/url/delete/action', 'delete' ); |
|
34 | -$delConfig = $this->config( 'admin/jqadm/url/delete/config', [] ); |
|
31 | +$delTarget = $this->config('admin/jqadm/url/delete/target'); |
|
32 | +$delCntl = $this->config('admin/jqadm/url/delete/controller', 'Jqadm'); |
|
33 | +$delAction = $this->config('admin/jqadm/url/delete/action', 'delete'); |
|
34 | +$delConfig = $this->config('admin/jqadm/url/delete/config', []); |
|
35 | 35 | |
36 | -$expTarget = $this->config( 'admin/jqadm/url/export/target' ); |
|
37 | -$expCntl = $this->config( 'admin/jqadm/url/export/controller', 'Jqadm' ); |
|
38 | -$expAction = $this->config( 'admin/jqadm/url/export/action', 'export' ); |
|
39 | -$expConfig = $this->config( 'admin/jqadm/url/export/config', [] ); |
|
36 | +$expTarget = $this->config('admin/jqadm/url/export/target'); |
|
37 | +$expCntl = $this->config('admin/jqadm/url/export/controller', 'Jqadm'); |
|
38 | +$expAction = $this->config('admin/jqadm/url/export/action', 'export'); |
|
39 | +$expConfig = $this->config('admin/jqadm/url/export/config', []); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | /** admin/jqadm/subscription/fields |
@@ -54,90 +54,90 @@ discard block |
||
54 | 54 | * @category Developer |
55 | 55 | */ |
56 | 56 | $default = ['subscription.status', 'subscription.datenext', 'subscription.dateend', 'subscription.interval']; |
57 | -$default = $this->config( 'admin/jqadm/subscription/fields', $default ); |
|
58 | -$fields = $this->session( 'aimeos/admin/jqadm/subscription/fields', $default ); |
|
57 | +$default = $this->config('admin/jqadm/subscription/fields', $default); |
|
58 | +$fields = $this->session('aimeos/admin/jqadm/subscription/fields', $default); |
|
59 | 59 | |
60 | -$searchParams = $params = $this->get( 'pageParams', [] ); |
|
60 | +$searchParams = $params = $this->get('pageParams', []); |
|
61 | 61 | $searchParams['page']['start'] = 0; |
62 | 62 | |
63 | -$baseItems = $this->get( 'baseItems', [] ); |
|
63 | +$baseItems = $this->get('baseItems', []); |
|
64 | 64 | |
65 | 65 | $columnList = [ |
66 | - 'subscription.id' => $this->translate( 'admin', 'ID' ), |
|
67 | - 'subscription.status' => $this->translate( 'admin', 'Status' ), |
|
68 | - 'subscription.interval' => $this->translate( 'admin', 'Interval' ), |
|
69 | - 'subscription.datenext' => $this->translate( 'admin', 'Next date' ), |
|
70 | - 'subscription.dateend' => $this->translate( 'admin', 'End date' ), |
|
71 | - 'subscription.reason' => $this->translate( 'admin', 'Reason' ), |
|
72 | - 'subscription.ctime' => $this->translate( 'admin', 'Created' ), |
|
73 | - 'subscription.mtime' => $this->translate( 'admin', 'Modified' ), |
|
74 | - 'subscription.editor' => $this->translate( 'admin', 'Editor' ), |
|
75 | - 'order.base.customerid' => $this->translate( 'admin', 'Customer ID' ), |
|
76 | - 'order.base.sitecode' => $this->translate( 'admin', 'Site' ), |
|
77 | - 'order.base.languageid' => $this->translate( 'admin', 'Language' ), |
|
78 | - 'order.base.currencyid' => $this->translate( 'admin', 'Currency' ), |
|
79 | - 'order.base.taxflag' => $this->translate( 'admin', 'Incl. tax' ), |
|
80 | - 'order.base.comment' => $this->translate( 'admin', 'Comment' ), |
|
81 | - 'order.base.address.salutation' => $this->translate( 'admin', 'Salutation' ), |
|
82 | - 'order.base.address.company' => $this->translate( 'admin', 'Company' ), |
|
83 | - 'order.base.address.vatid' => $this->translate( 'admin', 'VAT ID' ), |
|
84 | - 'order.base.address.title' => $this->translate( 'admin', 'Title' ), |
|
85 | - 'order.base.address.firstname' => $this->translate( 'admin', 'First name' ), |
|
86 | - 'order.base.address.lastname' => $this->translate( 'admin', 'Last name' ), |
|
87 | - 'order.base.address.address1' => $this->translate( 'admin', 'Street' ), |
|
88 | - 'order.base.address.address2' => $this->translate( 'admin', 'House number' ), |
|
89 | - 'order.base.address.address3' => $this->translate( 'admin', 'Floor' ), |
|
90 | - 'order.base.address.postal' => $this->translate( 'admin', 'Zip code' ), |
|
91 | - 'order.base.address.city' => $this->translate( 'admin', 'City' ), |
|
92 | - 'order.base.address.state' => $this->translate( 'admin', 'State' ), |
|
93 | - 'order.base.address.countryid' => $this->translate( 'admin', 'Country' ), |
|
94 | - 'order.base.address.languageid' => $this->translate( 'admin', 'Language' ), |
|
95 | - 'order.base.address.telephone' => $this->translate( 'admin', 'Telephone' ), |
|
96 | - 'order.base.address.telefax' => $this->translate( 'admin', 'Facsimile' ), |
|
97 | - 'order.base.address.email' => $this->translate( 'admin', 'E-Mail' ), |
|
98 | - 'order.base.address.website' => $this->translate( 'admin', 'Web site' ), |
|
66 | + 'subscription.id' => $this->translate('admin', 'ID'), |
|
67 | + 'subscription.status' => $this->translate('admin', 'Status'), |
|
68 | + 'subscription.interval' => $this->translate('admin', 'Interval'), |
|
69 | + 'subscription.datenext' => $this->translate('admin', 'Next date'), |
|
70 | + 'subscription.dateend' => $this->translate('admin', 'End date'), |
|
71 | + 'subscription.reason' => $this->translate('admin', 'Reason'), |
|
72 | + 'subscription.ctime' => $this->translate('admin', 'Created'), |
|
73 | + 'subscription.mtime' => $this->translate('admin', 'Modified'), |
|
74 | + 'subscription.editor' => $this->translate('admin', 'Editor'), |
|
75 | + 'order.base.customerid' => $this->translate('admin', 'Customer ID'), |
|
76 | + 'order.base.sitecode' => $this->translate('admin', 'Site'), |
|
77 | + 'order.base.languageid' => $this->translate('admin', 'Language'), |
|
78 | + 'order.base.currencyid' => $this->translate('admin', 'Currency'), |
|
79 | + 'order.base.taxflag' => $this->translate('admin', 'Incl. tax'), |
|
80 | + 'order.base.comment' => $this->translate('admin', 'Comment'), |
|
81 | + 'order.base.address.salutation' => $this->translate('admin', 'Salutation'), |
|
82 | + 'order.base.address.company' => $this->translate('admin', 'Company'), |
|
83 | + 'order.base.address.vatid' => $this->translate('admin', 'VAT ID'), |
|
84 | + 'order.base.address.title' => $this->translate('admin', 'Title'), |
|
85 | + 'order.base.address.firstname' => $this->translate('admin', 'First name'), |
|
86 | + 'order.base.address.lastname' => $this->translate('admin', 'Last name'), |
|
87 | + 'order.base.address.address1' => $this->translate('admin', 'Street'), |
|
88 | + 'order.base.address.address2' => $this->translate('admin', 'House number'), |
|
89 | + 'order.base.address.address3' => $this->translate('admin', 'Floor'), |
|
90 | + 'order.base.address.postal' => $this->translate('admin', 'Zip code'), |
|
91 | + 'order.base.address.city' => $this->translate('admin', 'City'), |
|
92 | + 'order.base.address.state' => $this->translate('admin', 'State'), |
|
93 | + 'order.base.address.countryid' => $this->translate('admin', 'Country'), |
|
94 | + 'order.base.address.languageid' => $this->translate('admin', 'Language'), |
|
95 | + 'order.base.address.telephone' => $this->translate('admin', 'Telephone'), |
|
96 | + 'order.base.address.telefax' => $this->translate('admin', 'Facsimile'), |
|
97 | + 'order.base.address.email' => $this->translate('admin', 'E-Mail'), |
|
98 | + 'order.base.address.website' => $this->translate('admin', 'Web site'), |
|
99 | 99 | ]; |
100 | 100 | |
101 | 101 | $deliveryStatusList = [ |
102 | - '-1' => $this->translate( 'mshop/code', 'stat:-1' ), |
|
103 | - '0' => $this->translate( 'mshop/code', 'stat:0' ), |
|
104 | - '1' => $this->translate( 'mshop/code', 'stat:1' ), |
|
105 | - '2' => $this->translate( 'mshop/code', 'stat:2' ), |
|
106 | - '3' => $this->translate( 'mshop/code', 'stat:3' ), |
|
107 | - '4' => $this->translate( 'mshop/code', 'stat:4' ), |
|
108 | - '5' => $this->translate( 'mshop/code', 'stat:5' ), |
|
109 | - '6' => $this->translate( 'mshop/code', 'stat:6' ), |
|
110 | - '7' => $this->translate( 'mshop/code', 'stat:7' ), |
|
102 | + '-1' => $this->translate('mshop/code', 'stat:-1'), |
|
103 | + '0' => $this->translate('mshop/code', 'stat:0'), |
|
104 | + '1' => $this->translate('mshop/code', 'stat:1'), |
|
105 | + '2' => $this->translate('mshop/code', 'stat:2'), |
|
106 | + '3' => $this->translate('mshop/code', 'stat:3'), |
|
107 | + '4' => $this->translate('mshop/code', 'stat:4'), |
|
108 | + '5' => $this->translate('mshop/code', 'stat:5'), |
|
109 | + '6' => $this->translate('mshop/code', 'stat:6'), |
|
110 | + '7' => $this->translate('mshop/code', 'stat:7'), |
|
111 | 111 | ]; |
112 | 112 | |
113 | 113 | $statusList = [ |
114 | - 0 => $this->translate( 'admin', 'no' ), |
|
115 | - 1 => $this->translate( 'admin', 'yes' ), |
|
114 | + 0 => $this->translate('admin', 'no'), |
|
115 | + 1 => $this->translate('admin', 'yes'), |
|
116 | 116 | ]; |
117 | 117 | |
118 | 118 | $reasonList = [ |
119 | 119 | null => '', |
120 | - -1 => $this->translate( 'mshop/code', 'reason:-1' ), |
|
121 | - 0 => $this->translate( 'mshop/code', 'reason:0' ), |
|
122 | - 1 => $this->translate( 'mshop/code', 'reason:1' ), |
|
120 | + -1 => $this->translate('mshop/code', 'reason:-1'), |
|
121 | + 0 => $this->translate('mshop/code', 'reason:0'), |
|
122 | + 1 => $this->translate('mshop/code', 'reason:1'), |
|
123 | 123 | ]; |
124 | 124 | |
125 | 125 | |
126 | 126 | ?> |
127 | -<?php $this->block()->start( 'jqadm_content' ); ?> |
|
127 | +<?php $this->block()->start('jqadm_content'); ?> |
|
128 | 128 | |
129 | 129 | <nav class="main-navbar"> |
130 | 130 | |
131 | 131 | <span class="navbar-brand"> |
132 | - <?= $enc->html( $this->translate( 'admin', 'Subscription' ) ); ?> |
|
133 | - <span class="navbar-secondary">(<?= $enc->html( $this->site()->label() ); ?>)</span> |
|
132 | + <?= $enc->html($this->translate('admin', 'Subscription')); ?> |
|
133 | + <span class="navbar-secondary">(<?= $enc->html($this->site()->label()); ?>)</span> |
|
134 | 134 | </span> |
135 | 135 | |
136 | 136 | <?= $this->partial( |
137 | - $this->config( 'admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard' ), [ |
|
138 | - 'filter' => $this->session( 'aimeos/admin/jqadm/subscription/filter', [] ), |
|
139 | - 'filterAttributes' => $this->get( 'filterAttributes', [] ), |
|
140 | - 'filterOperators' => $this->get( 'filterOperators', [] ), |
|
137 | + $this->config('admin/jqadm/partial/navsearch', 'common/partials/navsearch-standard'), [ |
|
138 | + 'filter' => $this->session('aimeos/admin/jqadm/subscription/filter', []), |
|
139 | + 'filterAttributes' => $this->get('filterAttributes', []), |
|
140 | + 'filterOperators' => $this->get('filterOperators', []), |
|
141 | 141 | 'params' => $params, |
142 | 142 | ] |
143 | 143 | ); ?> |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | |
146 | 146 | |
147 | 147 | <?= $this->partial( |
148 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard' ), |
|
149 | - ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get( 'total' ), |
|
150 | - 'page' => $this->session( 'aimeos/admin/jqadm/subscription/page', [] )] |
|
148 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard'), |
|
149 | + ['pageParams' => $params, 'pos' => 'top', 'total' => $this->get('total'), |
|
150 | + 'page' => $this->session('aimeos/admin/jqadm/subscription/page', [])] |
|
151 | 151 | ); |
152 | 152 | ?> |
153 | 153 | |
154 | -<form class="list list-subscription" method="POST" action="<?= $enc->attr( $this->url( $target, $controller, $action, $searchParams, [], $config ) ); ?>"> |
|
154 | +<form class="list list-subscription" method="POST" action="<?= $enc->attr($this->url($target, $controller, $action, $searchParams, [], $config)); ?>"> |
|
155 | 155 | <?= $this->csrf()->formfield(); ?> |
156 | 156 | |
157 | 157 | <table class="list-items table table-hover table-striped"> |
@@ -159,20 +159,20 @@ discard block |
||
159 | 159 | <tr> |
160 | 160 | |
161 | 161 | <?= $this->partial( |
162 | - $this->config( 'admin/jqadm/partial/listhead', 'common/partials/listhead-standard' ), |
|
163 | - ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session( 'aimeos/admin/jqadm/subscription/sort' )] |
|
162 | + $this->config('admin/jqadm/partial/listhead', 'common/partials/listhead-standard'), |
|
163 | + ['fields' => $fields, 'params' => $params, 'data' => $columnList, 'sort' => $this->session('aimeos/admin/jqadm/subscription/sort')] |
|
164 | 164 | ); |
165 | 165 | ?> |
166 | 166 | |
167 | 167 | <th class="actions"> |
168 | 168 | <a class="btn fa act-download" tabindex="1" |
169 | - href="<?= $enc->attr( $this->url( $expTarget, $expCntl, $expAction, $params, [], $expConfig ) ); ?>" |
|
170 | - title="<?= $enc->attr( $this->translate( 'admin', 'Download') ); ?>" |
|
171 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Download' ) ); ?>"> |
|
169 | + href="<?= $enc->attr($this->url($expTarget, $expCntl, $expAction, $params, [], $expConfig)); ?>" |
|
170 | + title="<?= $enc->attr($this->translate('admin', 'Download')); ?>" |
|
171 | + aria-label="<?= $enc->attr($this->translate('admin', 'Download')); ?>"> |
|
172 | 172 | </a> |
173 | 173 | |
174 | 174 | <?= $this->partial( |
175 | - $this->config( 'admin/jqadm/partial/columns', 'common/partials/columns-standard' ), |
|
175 | + $this->config('admin/jqadm/partial/columns', 'common/partials/columns-standard'), |
|
176 | 176 | ['fields' => $fields, 'data' => $columnList] |
177 | 177 | ); |
178 | 178 | ?> |
@@ -182,15 +182,15 @@ discard block |
||
182 | 182 | <tbody> |
183 | 183 | |
184 | 184 | <?= $this->partial( |
185 | - $this->config( 'admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard' ), [ |
|
186 | - 'fields' => $fields, 'filter' => $this->session( 'aimeos/admin/jqadm/subscription/filter', [] ), |
|
185 | + $this->config('admin/jqadm/partial/listsearch', 'common/partials/listsearch-standard'), [ |
|
186 | + 'fields' => $fields, 'filter' => $this->session('aimeos/admin/jqadm/subscription/filter', []), |
|
187 | 187 | 'data' => [ |
188 | 188 | 'subscription.id' => ['op' => '=='], |
189 | 189 | 'subscription.status' => ['op' => '==', 'type' => 'select', 'val' => [ |
190 | - '1' => $this->translate( 'mshop/code', 'status:1' ), |
|
191 | - '0' => $this->translate( 'mshop/code', 'status:0' ), |
|
192 | - '-1' => $this->translate( 'mshop/code', 'status:-1' ), |
|
193 | - '-2' => $this->translate( 'mshop/code', 'status:-2' ), |
|
190 | + '1' => $this->translate('mshop/code', 'status:1'), |
|
191 | + '0' => $this->translate('mshop/code', 'status:0'), |
|
192 | + '-1' => $this->translate('mshop/code', 'status:-1'), |
|
193 | + '-2' => $this->translate('mshop/code', 'status:-2'), |
|
194 | 194 | ]], |
195 | 195 | 'subscription.interval' => ['op' => '=~', 'type' => 'string'], |
196 | 196 | 'subscription.datenext' => ['op' => '>=', 'type' => 'date'], |
@@ -229,129 +229,129 @@ discard block |
||
229 | 229 | ] ); |
230 | 230 | ?> |
231 | 231 | |
232 | - <?php foreach( $this->get( 'items', [] ) as $id => $item ) : ?> |
|
233 | - <?php $url = $enc->attr( $this->url( $getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig ) ); ?> |
|
234 | - <tr class="<?= $this->site()->readonly( $item->getSiteId() ); ?>"> |
|
235 | - <?php if( in_array( 'subscription.id', $fields ) ) : ?> |
|
236 | - <td class="subscription-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getId() ); ?></a></td> |
|
232 | + <?php foreach ($this->get('items', []) as $id => $item) : ?> |
|
233 | + <?php $url = $enc->attr($this->url($getTarget, $getCntl, $getAction, ['id' => $id] + $params, [], $getConfig)); ?> |
|
234 | + <tr class="<?= $this->site()->readonly($item->getSiteId()); ?>"> |
|
235 | + <?php if (in_array('subscription.id', $fields)) : ?> |
|
236 | + <td class="subscription-id"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getId()); ?></a></td> |
|
237 | 237 | <?php endif; ?> |
238 | - <?php if( in_array( 'subscription.status', $fields ) ) : ?> |
|
239 | - <td class="subscription-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr( $item->getStatus() ); ?>"></div></a></td> |
|
238 | + <?php if (in_array('subscription.status', $fields)) : ?> |
|
239 | + <td class="subscription-status"><a class="items-field" href="<?= $url; ?>"><div class="fa status-<?= $enc->attr($item->getStatus()); ?>"></div></a></td> |
|
240 | 240 | <?php endif; ?> |
241 | - <?php if( in_array( 'subscription.interval', $fields ) ) : ?> |
|
242 | - <td class="subscription-interval"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getInterval() ); ?></a></td> |
|
241 | + <?php if (in_array('subscription.interval', $fields)) : ?> |
|
242 | + <td class="subscription-interval"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getInterval()); ?></a></td> |
|
243 | 243 | <?php endif; ?> |
244 | - <?php if( in_array( 'subscription.datenext', $fields ) ) : ?> |
|
245 | - <td class="subscription-datenext"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateNext() ); ?></a></td> |
|
244 | + <?php if (in_array('subscription.datenext', $fields)) : ?> |
|
245 | + <td class="subscription-datenext"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateNext()); ?></a></td> |
|
246 | 246 | <?php endif; ?> |
247 | - <?php if( in_array( 'subscription.dateend', $fields ) ) : ?> |
|
248 | - <td class="subscription-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getDateEnd() ); ?></a></td> |
|
247 | + <?php if (in_array('subscription.dateend', $fields)) : ?> |
|
248 | + <td class="subscription-dateend"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getDateEnd()); ?></a></td> |
|
249 | 249 | <?php endif; ?> |
250 | - <?php if( in_array( 'subscription.reason', $fields ) ) : ?> |
|
251 | - <td class="subscription-reason"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $reasonList[$item->getReason()] ); ?></td> |
|
250 | + <?php if (in_array('subscription.reason', $fields)) : ?> |
|
251 | + <td class="subscription-reason"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($reasonList[$item->getReason()]); ?></td> |
|
252 | 252 | <?php endif; ?> |
253 | - <?php if( in_array( 'subscription.ctime', $fields ) ) : ?> |
|
254 | - <td class="subscription-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeCreated() ); ?></a></td> |
|
253 | + <?php if (in_array('subscription.ctime', $fields)) : ?> |
|
254 | + <td class="subscription-ctime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeCreated()); ?></a></td> |
|
255 | 255 | <?php endif; ?> |
256 | - <?php if( in_array( 'subscription.mtime', $fields ) ) : ?> |
|
257 | - <td class="subscription-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getTimeModified() ); ?></a></td> |
|
256 | + <?php if (in_array('subscription.mtime', $fields)) : ?> |
|
257 | + <td class="subscription-mtime"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getTimeModified()); ?></a></td> |
|
258 | 258 | <?php endif; ?> |
259 | - <?php if( in_array( 'subscription.editor', $fields ) ) : ?> |
|
260 | - <td class="subscription-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html( $item->getEditor() ); ?></a></td> |
|
259 | + <?php if (in_array('subscription.editor', $fields)) : ?> |
|
260 | + <td class="subscription-editor"><a class="items-field" href="<?= $url; ?>"><?= $enc->html($item->getEditor()); ?></a></td> |
|
261 | 261 | <?php endif; ?> |
262 | 262 | |
263 | - <?php $baseItem = ( isset( $baseItems[$item->getOrderBaseId()] ) ? $baseItems[$item->getOrderBaseId()] : null ); ?> |
|
263 | + <?php $baseItem = (isset($baseItems[$item->getOrderBaseId()]) ? $baseItems[$item->getOrderBaseId()] : null); ?> |
|
264 | 264 | |
265 | - <?php if( in_array( 'order.base.customerid', $fields ) ) : ?> |
|
266 | - <td class="order-base-customerid"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html( $baseItem->getCustomerId() ) : ''; ?></a></td> |
|
265 | + <?php if (in_array('order.base.customerid', $fields)) : ?> |
|
266 | + <td class="order-base-customerid"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html($baseItem->getCustomerId()) : ''; ?></a></td> |
|
267 | 267 | <?php endif; ?> |
268 | - <?php if( in_array( 'order.base.sitecode', $fields ) ) : ?> |
|
269 | - <td class="order-base-sitecode"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html( $baseItem->getSiteCode() ) : ''; ?></a></td> |
|
268 | + <?php if (in_array('order.base.sitecode', $fields)) : ?> |
|
269 | + <td class="order-base-sitecode"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html($baseItem->getSiteCode()) : ''; ?></a></td> |
|
270 | 270 | <?php endif; ?> |
271 | - <?php if( in_array( 'order.base.languageid', $fields ) ) : ?> |
|
272 | - <td class="order-base-languageid"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html( $baseItem->getLocale()->getLanguageId() ) : ''; ?></a></td> |
|
271 | + <?php if (in_array('order.base.languageid', $fields)) : ?> |
|
272 | + <td class="order-base-languageid"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html($baseItem->getLocale()->getLanguageId()) : ''; ?></a></td> |
|
273 | 273 | <?php endif; ?> |
274 | - <?php if( in_array( 'order.base.currencyid', $fields ) ) : ?> |
|
275 | - <td class="order-base-currencyid"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html( $baseItem->getLocale()->getCurrencyId() ) : ''; ?></a></td> |
|
274 | + <?php if (in_array('order.base.currencyid', $fields)) : ?> |
|
275 | + <td class="order-base-currencyid"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html($baseItem->getLocale()->getCurrencyId()) : ''; ?></a></td> |
|
276 | 276 | <?php endif; ?> |
277 | - <?php if( in_array( 'order.base.taxflag', $fields ) ) : ?> |
|
278 | - <td class="order-base-taxflag"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html( $statusList[$baseItem->getPrice()->getTaxFlag()] ) : ''; ?></a></td> |
|
277 | + <?php if (in_array('order.base.taxflag', $fields)) : ?> |
|
278 | + <td class="order-base-taxflag"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html($statusList[$baseItem->getPrice()->getTaxFlag()]) : ''; ?></a></td> |
|
279 | 279 | <?php endif; ?> |
280 | - <?php if( in_array( 'order.base.comment', $fields ) ) : ?> |
|
281 | - <td class="order-base-comment"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html( $baseItem->getComment() ) : ''; ?></a></td> |
|
280 | + <?php if (in_array('order.base.comment', $fields)) : ?> |
|
281 | + <td class="order-base-comment"><a class="items-field" href="<?= $url; ?>"><?= $baseItem ? $enc->html($baseItem->getComment()) : ''; ?></a></td> |
|
282 | 282 | <?php endif; ?> |
283 | 283 | |
284 | 284 | <?php $addrItem = null; |
285 | - if( $baseItem && ( $addresses = $baseItem->getAddresses() ) && isset( $addresses[\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT] ) ) { |
|
285 | + if ($baseItem && ($addresses = $baseItem->getAddresses()) && isset($addresses[\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT])) { |
|
286 | 286 | $addrItem = $addresses[\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT]; |
287 | 287 | } |
288 | 288 | ?> |
289 | 289 | |
290 | - <?php if( in_array( 'order.base.address.salutation', $fields ) ) : ?> |
|
291 | - <td class="order-base-address-salutation"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getSalutation() ) : ''; ?></a></td> |
|
290 | + <?php if (in_array('order.base.address.salutation', $fields)) : ?> |
|
291 | + <td class="order-base-address-salutation"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getSalutation()) : ''; ?></a></td> |
|
292 | 292 | <?php endif; ?> |
293 | - <?php if( in_array( 'order.base.address.company', $fields ) ) : ?> |
|
294 | - <td class="order-base-address-company"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getCompany() ) : ''; ?></a></td> |
|
293 | + <?php if (in_array('order.base.address.company', $fields)) : ?> |
|
294 | + <td class="order-base-address-company"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getCompany()) : ''; ?></a></td> |
|
295 | 295 | <?php endif; ?> |
296 | - <?php if( in_array( 'order.base.address.vatid', $fields ) ) : ?> |
|
297 | - <td class="order-base-address-vatid"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getVatID() ) : ''; ?></a></td> |
|
296 | + <?php if (in_array('order.base.address.vatid', $fields)) : ?> |
|
297 | + <td class="order-base-address-vatid"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getVatID()) : ''; ?></a></td> |
|
298 | 298 | <?php endif; ?> |
299 | - <?php if( in_array( 'order.base.address.title', $fields ) ) : ?> |
|
300 | - <td class="order-base-address-title"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getTitle() ) : ''; ?></a></td> |
|
299 | + <?php if (in_array('order.base.address.title', $fields)) : ?> |
|
300 | + <td class="order-base-address-title"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getTitle()) : ''; ?></a></td> |
|
301 | 301 | <?php endif; ?> |
302 | - <?php if( in_array( 'order.base.address.firstname', $fields ) ) : ?> |
|
303 | - <td class="order-base-address-firstname"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getFirstname() ) : ''; ?></a></td> |
|
302 | + <?php if (in_array('order.base.address.firstname', $fields)) : ?> |
|
303 | + <td class="order-base-address-firstname"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getFirstname()) : ''; ?></a></td> |
|
304 | 304 | <?php endif; ?> |
305 | - <?php if( in_array( 'order.base.address.lastname', $fields ) ) : ?> |
|
306 | - <td class="order-base-address-lastname"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getLastname() ) : ''; ?></a></td> |
|
305 | + <?php if (in_array('order.base.address.lastname', $fields)) : ?> |
|
306 | + <td class="order-base-address-lastname"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getLastname()) : ''; ?></a></td> |
|
307 | 307 | <?php endif; ?> |
308 | - <?php if( in_array( 'order.base.address.address1', $fields ) ) : ?> |
|
309 | - <td class="order-base-address-address1"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getAddress1() ) : ''; ?></a></td> |
|
308 | + <?php if (in_array('order.base.address.address1', $fields)) : ?> |
|
309 | + <td class="order-base-address-address1"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getAddress1()) : ''; ?></a></td> |
|
310 | 310 | <?php endif; ?> |
311 | - <?php if( in_array( 'order.base.address.address2', $fields ) ) : ?> |
|
312 | - <td class="order-base-address-address2"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getAddress2() ) : ''; ?></a></td> |
|
311 | + <?php if (in_array('order.base.address.address2', $fields)) : ?> |
|
312 | + <td class="order-base-address-address2"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getAddress2()) : ''; ?></a></td> |
|
313 | 313 | <?php endif; ?> |
314 | - <?php if( in_array( 'order.base.address.address3', $fields ) ) : ?> |
|
315 | - <td class="order-base-address-address3"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getAddress3() ) : ''; ?></a></td> |
|
314 | + <?php if (in_array('order.base.address.address3', $fields)) : ?> |
|
315 | + <td class="order-base-address-address3"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getAddress3()) : ''; ?></a></td> |
|
316 | 316 | <?php endif; ?> |
317 | - <?php if( in_array( 'order.base.address.postal', $fields ) ) : ?> |
|
318 | - <td class="order-base-address-postal"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getPostal() ) : ''; ?></a></td> |
|
317 | + <?php if (in_array('order.base.address.postal', $fields)) : ?> |
|
318 | + <td class="order-base-address-postal"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getPostal()) : ''; ?></a></td> |
|
319 | 319 | <?php endif; ?> |
320 | - <?php if( in_array( 'order.base.address.city', $fields ) ) : ?> |
|
321 | - <td class="order-base-address-city"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getCity() ) : ''; ?></a></td> |
|
320 | + <?php if (in_array('order.base.address.city', $fields)) : ?> |
|
321 | + <td class="order-base-address-city"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getCity()) : ''; ?></a></td> |
|
322 | 322 | <?php endif; ?> |
323 | - <?php if( in_array( 'order.base.address.state', $fields ) ) : ?> |
|
324 | - <td class="order-base-address-state"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getState() ) : ''; ?></a></td> |
|
323 | + <?php if (in_array('order.base.address.state', $fields)) : ?> |
|
324 | + <td class="order-base-address-state"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getState()) : ''; ?></a></td> |
|
325 | 325 | <?php endif; ?> |
326 | - <?php if( in_array( 'order.base.address.countryid', $fields ) ) : ?> |
|
327 | - <td class="order-base-address-countryid"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getCountryId() ) : ''; ?></a></td> |
|
326 | + <?php if (in_array('order.base.address.countryid', $fields)) : ?> |
|
327 | + <td class="order-base-address-countryid"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getCountryId()) : ''; ?></a></td> |
|
328 | 328 | <?php endif; ?> |
329 | - <?php if( in_array( 'order.base.address.languageid', $fields ) ) : ?> |
|
330 | - <td class="order-base-address-languageid"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getLanguageId() ) : ''; ?></a></td> |
|
329 | + <?php if (in_array('order.base.address.languageid', $fields)) : ?> |
|
330 | + <td class="order-base-address-languageid"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getLanguageId()) : ''; ?></a></td> |
|
331 | 331 | <?php endif; ?> |
332 | - <?php if( in_array( 'order.base.address.telephone', $fields ) ) : ?> |
|
333 | - <td class="order-base-address-telephone"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getTelephone() ) : ''; ?></a></td> |
|
332 | + <?php if (in_array('order.base.address.telephone', $fields)) : ?> |
|
333 | + <td class="order-base-address-telephone"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getTelephone()) : ''; ?></a></td> |
|
334 | 334 | <?php endif; ?> |
335 | - <?php if( in_array( 'order.base.address.telefax', $fields ) ) : ?> |
|
336 | - <td class="order-base-address-telefax"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getTelefax() ) : ''; ?></a></td> |
|
335 | + <?php if (in_array('order.base.address.telefax', $fields)) : ?> |
|
336 | + <td class="order-base-address-telefax"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getTelefax()) : ''; ?></a></td> |
|
337 | 337 | <?php endif; ?> |
338 | - <?php if( in_array( 'order.base.address.email', $fields ) ) : ?> |
|
339 | - <td class="order-base-address-email"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getEmail() ) : ''; ?></a></td> |
|
338 | + <?php if (in_array('order.base.address.email', $fields)) : ?> |
|
339 | + <td class="order-base-address-email"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getEmail()) : ''; ?></a></td> |
|
340 | 340 | <?php endif; ?> |
341 | - <?php if( in_array( 'order.base.address.website', $fields ) ) : ?> |
|
342 | - <td class="order-base-address-website"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html( $addrItem->getWebsite() ) : ''; ?></a></td> |
|
341 | + <?php if (in_array('order.base.address.website', $fields)) : ?> |
|
342 | + <td class="order-base-address-website"><a class="items-field" href="<?= $url; ?>"><?= $addrItem ? $enc->html($addrItem->getWebsite()) : ''; ?></a></td> |
|
343 | 343 | <?php endif; ?> |
344 | 344 | |
345 | 345 | <td class="actions"> |
346 | 346 | <a class="btn act-copy fa" tabindex="1" |
347 | - href="<?= $enc->attr( $this->url( $copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig ) ); ?>" |
|
348 | - title="<?= $enc->attr( $this->translate( 'admin', 'Copy this entry') ); ?>" |
|
349 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Copy' ) ); ?>"></a> |
|
350 | - <?php if( !$this->site()->readonly( $item->getSiteId() ) ) : ?> |
|
347 | + href="<?= $enc->attr($this->url($copyTarget, $copyCntl, $copyAction, ['id' => $id] + $params, [], $copyConfig)); ?>" |
|
348 | + title="<?= $enc->attr($this->translate('admin', 'Copy this entry')); ?>" |
|
349 | + aria-label="<?= $enc->attr($this->translate('admin', 'Copy')); ?>"></a> |
|
350 | + <?php if (!$this->site()->readonly($item->getSiteId())) : ?> |
|
351 | 351 | <a class="btn act-delete fa" tabindex="1" |
352 | - href="<?= $enc->attr( $this->url( $delTarget, $delCntl, $delAction, ['resource' => 'subscription', 'id' => $id] + $params, [], $delConfig ) ); ?>" |
|
353 | - title="<?= $enc->attr( $this->translate( 'admin', 'Delete this entry') ); ?>" |
|
354 | - aria-label="<?= $enc->attr( $this->translate( 'admin', 'Delete' ) ); ?>"></a> |
|
352 | + href="<?= $enc->attr($this->url($delTarget, $delCntl, $delAction, ['resource' => 'subscription', 'id' => $id] + $params, [], $delConfig)); ?>" |
|
353 | + title="<?= $enc->attr($this->translate('admin', 'Delete this entry')); ?>" |
|
354 | + aria-label="<?= $enc->attr($this->translate('admin', 'Delete')); ?>"></a> |
|
355 | 355 | <?php endif; ?> |
356 | 356 | </td> |
357 | 357 | </tr> |
@@ -359,18 +359,18 @@ discard block |
||
359 | 359 | </tbody> |
360 | 360 | </table> |
361 | 361 | |
362 | - <?php if( $this->get( 'items', [] ) === [] ) : ?> |
|
363 | - <div class="noitems"><?= $enc->html( sprintf( $this->translate( 'admin', 'No items found' ) ) ); ?></div> |
|
362 | + <?php if ($this->get('items', []) === []) : ?> |
|
363 | + <div class="noitems"><?= $enc->html(sprintf($this->translate('admin', 'No items found'))); ?></div> |
|
364 | 364 | <?php endif; ?> |
365 | 365 | </form> |
366 | 366 | |
367 | 367 | <?= $this->partial( |
368 | - $this->config( 'admin/jqadm/partial/pagination', 'common/partials/pagination-standard' ), |
|
369 | - ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get( 'total' ), |
|
370 | - 'page' => $this->session( 'aimeos/admin/jqadm/subscription/page', [] )] |
|
368 | + $this->config('admin/jqadm/partial/pagination', 'common/partials/pagination-standard'), |
|
369 | + ['pageParams' => $params, 'pos' => 'bottom', 'total' => $this->get('total'), |
|
370 | + 'page' => $this->session('aimeos/admin/jqadm/subscription/page', [])] |
|
371 | 371 | ); |
372 | 372 | ?> |
373 | 373 | |
374 | 374 | <?php $this->block()->stop(); ?> |
375 | 375 | |
376 | -<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard' ) ); ?> |
|
376 | +<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard')); ?> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Product\Category; |
12 | 12 | |
13 | -sprintf( 'category' ); // for translation |
|
13 | +sprintf('category'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->categoryData = $this->toArray( $view->item, true ); |
|
47 | + $view->categoryData = $this->toArray($view->item, true); |
|
48 | 48 | $view->categoryListTypes = $this->getListTypes(); |
49 | 49 | $view->categoryBody = ''; |
50 | 50 | |
51 | - foreach( $this->getSubClients() as $client ) { |
|
51 | + foreach ($this->getSubClients() as $client) { |
|
52 | 52 | $view->categoryBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | |
55 | - return $this->render( $view ); |
|
55 | + return $this->render($view); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | public function create() |
65 | 65 | { |
66 | 66 | $view = $this->getView(); |
67 | - $data = $view->param( 'category', [] ); |
|
67 | + $data = $view->param('category', []); |
|
68 | 68 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
69 | 69 | |
70 | - foreach( $view->value( $data, 'catalog.lists.id', [] ) as $idx => $value ) { |
|
70 | + foreach ($view->value($data, 'catalog.lists.id', []) as $idx => $value) { |
|
71 | 71 | $data['catalog.lists.siteid'][$idx] = $siteid; |
72 | 72 | } |
73 | 73 | |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | $view->categoryListTypes = $this->getListTypes(); |
76 | 76 | $view->categoryBody = ''; |
77 | 77 | |
78 | - foreach( $this->getSubClients() as $client ) { |
|
78 | + foreach ($this->getSubClients() as $client) { |
|
79 | 79 | $view->categoryBody .= $client->create(); |
80 | 80 | } |
81 | 81 | |
82 | - return $this->render( $view ); |
|
82 | + return $this->render($view); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -93,29 +93,29 @@ discard block |
||
93 | 93 | $view = $this->getView(); |
94 | 94 | $context = $this->getContext(); |
95 | 95 | |
96 | - $manager = \Aimeos\MShop::create( $context, 'catalog/lists' ); |
|
96 | + $manager = \Aimeos\MShop::create($context, 'catalog/lists'); |
|
97 | 97 | |
98 | 98 | $search = $manager->createSearch(); |
99 | 99 | $expr = array( |
100 | - $search->compare( '==', 'catalog.lists.refid', $view->param( 'id' ) ), |
|
101 | - $search->compare( '==', 'catalog.lists.domain', 'product' ) |
|
100 | + $search->compare('==', 'catalog.lists.refid', $view->param('id')), |
|
101 | + $search->compare('==', 'catalog.lists.domain', 'product') |
|
102 | 102 | ); |
103 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
104 | - $search->setSlice( 0, 0x7fffffff ); |
|
103 | + $search->setConditions($search->combine('&&', $expr)); |
|
104 | + $search->setSlice(0, 0x7fffffff); |
|
105 | 105 | |
106 | 106 | $start = 0; |
107 | 107 | |
108 | 108 | do |
109 | 109 | { |
110 | - $search->setSlice( $start ); |
|
110 | + $search->setSlice($start); |
|
111 | 111 | |
112 | - $result = $manager->searchItems( $search ); |
|
113 | - $manager->deleteItems( array_keys( $result ) ); |
|
112 | + $result = $manager->searchItems($search); |
|
113 | + $manager->deleteItems(array_keys($result)); |
|
114 | 114 | |
115 | - $count = count( $result ); |
|
115 | + $count = count($result); |
|
116 | 116 | $start += $count; |
117 | 117 | } |
118 | - while( $count >= $search->getSliceSize() ); |
|
118 | + while ($count >= $search->getSliceSize()); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | { |
129 | 129 | $view = $this->getView(); |
130 | 130 | |
131 | - $view->categoryData = $this->toArray( $view->item ); |
|
131 | + $view->categoryData = $this->toArray($view->item); |
|
132 | 132 | $view->categoryListTypes = $this->getListTypes(); |
133 | 133 | $view->categoryBody = ''; |
134 | 134 | |
135 | - foreach( $this->getSubClients() as $client ) { |
|
135 | + foreach ($this->getSubClients() as $client) { |
|
136 | 136 | $view->categoryBody .= $client->get(); |
137 | 137 | } |
138 | 138 | |
139 | - return $this->render( $view ); |
|
139 | + return $this->render($view); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | |
@@ -148,32 +148,32 @@ discard block |
||
148 | 148 | $view = $this->getView(); |
149 | 149 | $context = $this->getContext(); |
150 | 150 | |
151 | - $manager = \Aimeos\MShop::create( $context, 'product/lists' ); |
|
151 | + $manager = \Aimeos\MShop::create($context, 'product/lists'); |
|
152 | 152 | $manager->begin(); |
153 | 153 | |
154 | 154 | try |
155 | 155 | { |
156 | - $this->fromArray( $view->item, $view->param( 'category', [] ) ); |
|
156 | + $this->fromArray($view->item, $view->param('category', [])); |
|
157 | 157 | $view->categoryBody = ''; |
158 | 158 | |
159 | - foreach( $this->getSubClients() as $client ) { |
|
159 | + foreach ($this->getSubClients() as $client) { |
|
160 | 160 | $view->categoryBody .= $client->save(); |
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->commit(); |
164 | 164 | return; |
165 | 165 | } |
166 | - catch( \Aimeos\MShop\Exception $e ) |
|
166 | + catch (\Aimeos\MShop\Exception $e) |
|
167 | 167 | { |
168 | - $error = array( 'product-item-category' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
169 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
170 | - $this->logException( $e ); |
|
168 | + $error = array('product-item-category' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
169 | + $view->errors = $view->get('errors', []) + $error; |
|
170 | + $this->logException($e); |
|
171 | 171 | } |
172 | - catch( \Exception $e ) |
|
172 | + catch (\Exception $e) |
|
173 | 173 | { |
174 | - $error = array( 'product-item-category' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
175 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
176 | - $this->logException( $e ); |
|
174 | + $error = array('product-item-category' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
175 | + $view->errors = $view->get('errors', []) + $error; |
|
176 | + $this->logException($e); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | $manager->rollback(); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @param string|null $name Name of the sub-client (Default if null) |
190 | 190 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
191 | 191 | */ |
192 | - public function getSubClient( $type, $name = null ) |
|
192 | + public function getSubClient($type, $name = null) |
|
193 | 193 | { |
194 | 194 | /** admin/jqadm/product/category/decorators/excludes |
195 | 195 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | * @see admin/jqadm/product/category/decorators/excludes |
265 | 265 | * @see admin/jqadm/product/category/decorators/global |
266 | 266 | */ |
267 | - return $this->createSubClient( 'product/category/' . $type, $name ); |
|
267 | + return $this->createSubClient('product/category/' . $type, $name); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | * @since 2016.01 |
309 | 309 | * @category Developer |
310 | 310 | */ |
311 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/category/standard/subparts', [] ); |
|
311 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/category/standard/subparts', []); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | * @param array $listItems List of items implementing \Aimeos\Common\Item\Lists\Iface |
319 | 319 | * @return array Associative list of catalog IDs as keys and items implementing \Aimeos\Catalog\Item\Iface as values |
320 | 320 | */ |
321 | - protected function getCatalogItems( array $listItems ) |
|
321 | + protected function getCatalogItems(array $listItems) |
|
322 | 322 | { |
323 | 323 | $ids = []; |
324 | 324 | |
325 | - foreach( $listItems as $listItem ) { |
|
325 | + foreach ($listItems as $listItem) { |
|
326 | 326 | $ids[] = $listItem->getParentId(); |
327 | 327 | } |
328 | 328 | |
329 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog' ); |
|
329 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog'); |
|
330 | 330 | |
331 | 331 | $search = $manager->createSearch(); |
332 | - $search->setConditions( $search->compare( '==', 'catalog.id', $ids ) ); |
|
332 | + $search->setConditions($search->compare('==', 'catalog.id', $ids)); |
|
333 | 333 | |
334 | - return $manager->searchItems( $search ); |
|
334 | + return $manager->searchItems($search); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | |
@@ -341,18 +341,18 @@ discard block |
||
341 | 341 | * @param string $prodid Unique product ID |
342 | 342 | * @return array Associative list of category list IDs as keys and list items as values |
343 | 343 | */ |
344 | - protected function getListItems( $prodid ) |
|
344 | + protected function getListItems($prodid) |
|
345 | 345 | { |
346 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists' ); |
|
346 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists'); |
|
347 | 347 | |
348 | - $search = $manager->createSearch()->setSlice( 0, 0x7fffffff ); |
|
348 | + $search = $manager->createSearch()->setSlice(0, 0x7fffffff); |
|
349 | 349 | $expr = array( |
350 | - $search->compare( '==', 'catalog.lists.refid', $prodid ), |
|
351 | - $search->compare( '==', 'catalog.lists.domain', 'product' ), |
|
350 | + $search->compare('==', 'catalog.lists.refid', $prodid), |
|
351 | + $search->compare('==', 'catalog.lists.domain', 'product'), |
|
352 | 352 | ); |
353 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
353 | + $search->setConditions($search->combine('&&', $expr)); |
|
354 | 354 | |
355 | - return $manager->searchItems( $search ); |
|
355 | + return $manager->searchItems($search); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | */ |
364 | 364 | protected function getListTypes() |
365 | 365 | { |
366 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists/type' ); |
|
366 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists/type'); |
|
367 | 367 | |
368 | - $search = $manager->createSearch( true )->setSlice( 0, 10000 ); |
|
369 | - $search->setConditions( $search->compare( '==', 'catalog.lists.type.domain', 'product' ) ); |
|
370 | - $search->setSortations( [$search->sort( '+', 'catalog.lists.type.position' )] ); |
|
368 | + $search = $manager->createSearch(true)->setSlice(0, 10000); |
|
369 | + $search->setConditions($search->compare('==', 'catalog.lists.type.domain', 'product')); |
|
370 | + $search->setSortations([$search->sort('+', 'catalog.lists.type.position')]); |
|
371 | 371 | |
372 | - return $this->map( $manager->searchItems( $search ) ); |
|
372 | + return $this->map($manager->searchItems($search)); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | |
@@ -379,37 +379,37 @@ discard block |
||
379 | 379 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
380 | 380 | * @param string[] $data Data array |
381 | 381 | */ |
382 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
382 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
383 | 383 | { |
384 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists' ); |
|
385 | - $listIds = (array) $this->getValue( $data, 'catalog.lists.id', [] ); |
|
386 | - $listItems = $map = $this->getListItems( $item->getId() ); |
|
384 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog/lists'); |
|
385 | + $listIds = (array) $this->getValue($data, 'catalog.lists.id', []); |
|
386 | + $listItems = $map = $this->getListItems($item->getId()); |
|
387 | 387 | |
388 | 388 | |
389 | - foreach( $listIds as $idx => $listid ) |
|
389 | + foreach ($listIds as $idx => $listid) |
|
390 | 390 | { |
391 | - if( isset( $map[$listid] ) ) { |
|
392 | - unset( $map[$listid] ); |
|
391 | + if (isset($map[$listid])) { |
|
392 | + unset($map[$listid]); |
|
393 | 393 | } |
394 | 394 | } |
395 | 395 | |
396 | - $manager->deleteItems( array_keys( $map ) ); |
|
396 | + $manager->deleteItems(array_keys($map)); |
|
397 | 397 | |
398 | 398 | |
399 | - foreach( $listIds as $idx => $listid ) |
|
399 | + foreach ($listIds as $idx => $listid) |
|
400 | 400 | { |
401 | - if( isset( $listItems[$listid] ) ) { |
|
401 | + if (isset($listItems[$listid])) { |
|
402 | 402 | $litem = $listItems[$listid]; |
403 | 403 | } else { |
404 | 404 | $litem = $manager->createItem(); |
405 | 405 | } |
406 | 406 | |
407 | - $litem->setDomain( 'product' ); |
|
408 | - $litem->setRefId( $item->getId() ); |
|
409 | - $litem->setParentId( $this->getValue( $data, 'catalog.id/' . $idx ) ); |
|
410 | - $litem->setType( $this->getValue( $data, 'catalog.lists.type/' . $idx ) ); |
|
407 | + $litem->setDomain('product'); |
|
408 | + $litem->setRefId($item->getId()); |
|
409 | + $litem->setParentId($this->getValue($data, 'catalog.id/' . $idx)); |
|
410 | + $litem->setType($this->getValue($data, 'catalog.lists.type/' . $idx)); |
|
411 | 411 | |
412 | - $manager->saveItem( $litem, false ); |
|
412 | + $manager->saveItem($litem, false); |
|
413 | 413 | } |
414 | 414 | } |
415 | 415 | |
@@ -421,34 +421,34 @@ discard block |
||
421 | 421 | * @param boolean $copy True if items should be copied, false if not |
422 | 422 | * @return string[] Multi-dimensional associative list of item data |
423 | 423 | */ |
424 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
424 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
425 | 425 | { |
426 | 426 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
427 | - $listItems = $this->getListItems( $item->getId() ); |
|
428 | - $catItems = $this->getCatalogItems( $listItems ); |
|
427 | + $listItems = $this->getListItems($item->getId()); |
|
428 | + $catItems = $this->getCatalogItems($listItems); |
|
429 | 429 | $data = []; |
430 | 430 | |
431 | - foreach( $listItems as $listItem ) |
|
431 | + foreach ($listItems as $listItem) |
|
432 | 432 | { |
433 | 433 | $catId = $listItem->getParentId(); |
434 | 434 | |
435 | - if( !isset( $catItems[$catId] ) ) { |
|
435 | + if (!isset($catItems[$catId])) { |
|
436 | 436 | continue; |
437 | 437 | } |
438 | 438 | |
439 | - $list = $listItem->toArray( true ); |
|
439 | + $list = $listItem->toArray(true); |
|
440 | 440 | |
441 | - if( $copy === true ) |
|
441 | + if ($copy === true) |
|
442 | 442 | { |
443 | 443 | $list['catalog.lists.siteid'] = $siteId; |
444 | 444 | $list['catalog.lists.id'] = ''; |
445 | 445 | } |
446 | 446 | |
447 | - foreach( $list as $key => $value ) { |
|
447 | + foreach ($list as $key => $value) { |
|
448 | 448 | $data[$key][] = $value; |
449 | 449 | } |
450 | 450 | |
451 | - foreach( $catItems[$catId]->toArray( true ) as $key => $value ) { |
|
451 | + foreach ($catItems[$catId]->toArray(true) as $key => $value) { |
|
452 | 452 | $data[$key][] = $value; |
453 | 453 | } |
454 | 454 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
464 | 464 | * @return string HTML output |
465 | 465 | */ |
466 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
466 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
467 | 467 | { |
468 | 468 | /** admin/jqadm/product/category/template-item |
469 | 469 | * Relative path to the HTML body template of the category subpart for products. |
@@ -487,6 +487,6 @@ discard block |
||
487 | 487 | $tplconf = 'admin/jqadm/product/category/template-item'; |
488 | 488 | $default = 'product/item-category-standard'; |
489 | 489 | |
490 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
490 | + return $view->render($view->config($tplconf, $default)); |
|
491 | 491 | } |
492 | 492 | } |
493 | 493 | \ No newline at end of file |