@@ -799,7 +799,6 @@ |
||
799 | 799 | |
800 | 800 | |
801 | 801 | /** |
802 | - |
|
803 | 802 | * |
804 | 803 | * If the the first date starts at midnight on one day, and the next date ends at midnight on the |
805 | 804 | * very next day then this method will return true. |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\collections; |
3 | 3 | |
4 | -use EventEspresso\core\exceptions\InvalidEntityException; |
|
5 | -use EventEspresso\core\exceptions\InvalidInterfaceException; |
|
4 | +use EventEspresso\core\exceptions\InvalidEntityException; |
|
5 | +use EventEspresso\core\exceptions\InvalidInterfaceException; |
|
6 | 6 | use LimitIterator; |
7 | 7 | |
8 | 8 | if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | use EventEspresso\core\exceptions\InvalidInterfaceException; |
6 | 6 | use LimitIterator; |
7 | 7 | |
8 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
9 | - exit( 'No direct script access allowed' ); |
|
8 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
9 | + exit('No direct script access allowed'); |
|
10 | 10 | } |
11 | 11 | /** |
12 | 12 | * Class Collection |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @param string $collection_interface |
37 | 37 | * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
38 | 38 | */ |
39 | - public function __construct( $collection_interface ) { |
|
40 | - $this->setCollectionInterface( $collection_interface ); |
|
39 | + public function __construct($collection_interface) { |
|
40 | + $this->setCollectionInterface($collection_interface); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | * @param string $collection_interface |
50 | 50 | * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
51 | 51 | */ |
52 | - protected function setCollectionInterface( $collection_interface ) { |
|
53 | - if ( ! ( interface_exists( $collection_interface ) || class_exists( $collection_interface ) ) ) { |
|
54 | - throw new InvalidInterfaceException( $collection_interface ); |
|
52 | + protected function setCollectionInterface($collection_interface) { |
|
53 | + if ( ! (interface_exists($collection_interface) || class_exists($collection_interface))) { |
|
54 | + throw new InvalidInterfaceException($collection_interface); |
|
55 | 55 | } |
56 | 56 | $this->collection_interface = $collection_interface; |
57 | 57 | } |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | * @return bool |
71 | 71 | * @throws \EventEspresso\core\exceptions\InvalidEntityException |
72 | 72 | */ |
73 | - public function add( $object, $identifier = null ) { |
|
74 | - if ( ! $object instanceof $this->collection_interface ) { |
|
75 | - throw new InvalidEntityException( $object, $this->collection_interface ); |
|
73 | + public function add($object, $identifier = null) { |
|
74 | + if ( ! $object instanceof $this->collection_interface) { |
|
75 | + throw new InvalidEntityException($object, $this->collection_interface); |
|
76 | 76 | } |
77 | - $this->attach( $object ); |
|
78 | - $this->setIdentifier( $object, $identifier ); |
|
79 | - return $this->contains( $object ); |
|
77 | + $this->attach($object); |
|
78 | + $this->setIdentifier($object, $identifier); |
|
79 | + return $this->contains($object); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | * @param mixed $identifier |
93 | 93 | * @return bool |
94 | 94 | */ |
95 | - public function setIdentifier( $object, $identifier = null ) { |
|
96 | - $identifier = ! empty( $identifier ) ? $identifier : spl_object_hash( $object ); |
|
95 | + public function setIdentifier($object, $identifier = null) { |
|
96 | + $identifier = ! empty($identifier) ? $identifier : spl_object_hash($object); |
|
97 | 97 | $this->rewind(); |
98 | - while ( $this->valid() ) { |
|
99 | - if ( $object === $this->current() ) { |
|
100 | - $this->setInfo( $identifier ); |
|
98 | + while ($this->valid()) { |
|
99 | + if ($object === $this->current()) { |
|
100 | + $this->setInfo($identifier); |
|
101 | 101 | $this->rewind(); |
102 | 102 | return true; |
103 | 103 | } |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | * @param mixed $identifier |
118 | 118 | * @return mixed |
119 | 119 | */ |
120 | - public function get( $identifier ) { |
|
120 | + public function get($identifier) { |
|
121 | 121 | $this->rewind(); |
122 | - while ( $this->valid() ) { |
|
123 | - if ( $identifier === $this->getInfo() ) { |
|
122 | + while ($this->valid()) { |
|
123 | + if ($identifier === $this->getInfo()) { |
|
124 | 124 | $object = $this->current(); |
125 | 125 | $this->rewind(); |
126 | 126 | return $object; |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | * @param mixed $identifier |
143 | 143 | * @return bool |
144 | 144 | */ |
145 | - public function has( $identifier ) { |
|
145 | + public function has($identifier) { |
|
146 | 146 | $this->rewind(); |
147 | - while ( $this->valid() ) { |
|
148 | - if ( $identifier === $this->getInfo() ) { |
|
147 | + while ($this->valid()) { |
|
148 | + if ($identifier === $this->getInfo()) { |
|
149 | 149 | $this->rewind(); |
150 | 150 | return true; |
151 | 151 | } |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | * @param $object |
165 | 165 | * @return bool |
166 | 166 | */ |
167 | - public function hasObject( $object ) { |
|
168 | - return $this->contains( $object ); |
|
167 | + public function hasObject($object) { |
|
168 | + return $this->contains($object); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | * @param $object |
179 | 179 | * @return bool |
180 | 180 | */ |
181 | - public function remove( $object ) { |
|
182 | - $this->detach( $object ); |
|
181 | + public function remove($object) { |
|
182 | + $this->detach($object); |
|
183 | 183 | return true; |
184 | 184 | } |
185 | 185 | |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | * @param mixed $identifier |
194 | 194 | * @return boolean |
195 | 195 | */ |
196 | - public function setCurrent( $identifier ) { |
|
196 | + public function setCurrent($identifier) { |
|
197 | 197 | $this->rewind(); |
198 | - while ( $this->valid() ) { |
|
199 | - if ( $identifier === $this->getInfo() ) { |
|
198 | + while ($this->valid()) { |
|
199 | + if ($identifier === $this->getInfo()) { |
|
200 | 200 | return true; |
201 | 201 | } |
202 | 202 | $this->next(); |
@@ -214,10 +214,10 @@ discard block |
||
214 | 214 | * @param $object |
215 | 215 | * @return boolean |
216 | 216 | */ |
217 | - public function setCurrentUsingObject( $object ) { |
|
217 | + public function setCurrentUsingObject($object) { |
|
218 | 218 | $this->rewind(); |
219 | - while ( $this->valid() ) { |
|
220 | - if ( $this->current() === $object ) { |
|
219 | + while ($this->valid()) { |
|
220 | + if ($this->current() === $object) { |
|
221 | 221 | return true; |
222 | 222 | } |
223 | 223 | $this->next(); |
@@ -234,12 +234,12 @@ discard block |
||
234 | 234 | * @return mixed |
235 | 235 | */ |
236 | 236 | public function previous() { |
237 | - $index = $this->indexOf( $this->current() ); |
|
238 | - if ( $index === 0 ) { |
|
237 | + $index = $this->indexOf($this->current()); |
|
238 | + if ($index === 0) { |
|
239 | 239 | return $this->current(); |
240 | 240 | } |
241 | 241 | $index--; |
242 | - return $this->objectAtIndex( $index ); |
|
242 | + return $this->objectAtIndex($index); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | * @param $object |
252 | 252 | * @return boolean|int|string |
253 | 253 | */ |
254 | - public function indexOf( $object ) { |
|
255 | - if ( ! $this->contains( $object ) ) { |
|
254 | + public function indexOf($object) { |
|
255 | + if ( ! $this->contains($object)) { |
|
256 | 256 | return false; |
257 | 257 | } |
258 | - foreach ( $this as $index => $obj ) { |
|
259 | - if ( $obj === $object ) { |
|
258 | + foreach ($this as $index => $obj) { |
|
259 | + if ($obj === $object) { |
|
260 | 260 | return $index; |
261 | 261 | } |
262 | 262 | } |
@@ -272,8 +272,8 @@ discard block |
||
272 | 272 | * @param int $index |
273 | 273 | * @return mixed |
274 | 274 | */ |
275 | - public function objectAtIndex( $index ) { |
|
276 | - $iterator = new LimitIterator( $this, $index, 1 ); |
|
275 | + public function objectAtIndex($index) { |
|
276 | + $iterator = new LimitIterator($this, $index, 1); |
|
277 | 277 | $iterator->rewind(); |
278 | 278 | return $iterator->current(); |
279 | 279 | } |
@@ -288,10 +288,10 @@ discard block |
||
288 | 288 | * @param int $length |
289 | 289 | * @return array |
290 | 290 | */ |
291 | - public function slice( $offset, $length ) { |
|
291 | + public function slice($offset, $length) { |
|
292 | 292 | $slice = array(); |
293 | - $iterator = new LimitIterator( $this, $offset, $length ); |
|
294 | - foreach ( $iterator as $object ) { |
|
293 | + $iterator = new LimitIterator($this, $offset, $length); |
|
294 | + foreach ($iterator as $object) { |
|
295 | 295 | $slice[] = $object; |
296 | 296 | } |
297 | 297 | return $slice; |
@@ -306,35 +306,35 @@ discard block |
||
306 | 306 | * @param mixed $objects A single object or an array of objects |
307 | 307 | * @param int $index |
308 | 308 | */ |
309 | - public function insertAt( $objects, $index ) { |
|
310 | - if ( ! is_array( $objects ) ) { |
|
311 | - $objects = array( $objects ); |
|
309 | + public function insertAt($objects, $index) { |
|
310 | + if ( ! is_array($objects)) { |
|
311 | + $objects = array($objects); |
|
312 | 312 | } |
313 | 313 | // check to ensure that objects don't already exist in the collection |
314 | - foreach ( $objects as $key => $object ) { |
|
315 | - if ( $this->contains( $object ) ) { |
|
316 | - unset( $objects[ $key ] ); |
|
314 | + foreach ($objects as $key => $object) { |
|
315 | + if ($this->contains($object)) { |
|
316 | + unset($objects[$key]); |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | // do we have any objects left? |
320 | - if ( ! $objects ) { |
|
320 | + if ( ! $objects) { |
|
321 | 321 | return; |
322 | 322 | } |
323 | 323 | // detach any objects at or past this index |
324 | 324 | $remaining = array(); |
325 | - if ( $index < $this->count() ) { |
|
326 | - $remaining = $this->slice( $index, $this->count() - $index ); |
|
327 | - foreach ( $remaining as $object ) { |
|
328 | - $this->detach( $object ); |
|
325 | + if ($index < $this->count()) { |
|
326 | + $remaining = $this->slice($index, $this->count() - $index); |
|
327 | + foreach ($remaining as $object) { |
|
328 | + $this->detach($object); |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | // add the new objects we're splicing in |
332 | - foreach ( $objects as $object ) { |
|
333 | - $this->attach( $object ); |
|
332 | + foreach ($objects as $object) { |
|
333 | + $this->attach($object); |
|
334 | 334 | } |
335 | 335 | // attach the objects we previously detached |
336 | - foreach ( $remaining as $object ) { |
|
337 | - $this->attach( $object ); |
|
336 | + foreach ($remaining as $object) { |
|
337 | + $this->attach($object); |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | |
@@ -346,8 +346,8 @@ discard block |
||
346 | 346 | * @see http://stackoverflow.com/a/8736013 |
347 | 347 | * @param int $index |
348 | 348 | */ |
349 | - public function removeAt( $index ) { |
|
350 | - $this->detach( $this->objectAtIndex( $index ) ); |
|
349 | + public function removeAt($index) { |
|
350 | + $this->detach($this->objectAtIndex($index)); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * by calling EE_Object_Collection::set_identifier() |
66 | 66 | * |
67 | 67 | * @access public |
68 | - * @param $object |
|
68 | + * @param \EventEspresso\core\services\progress_steps\ProgressStep $object |
|
69 | 69 | * @param mixed $identifier |
70 | 70 | * @return bool |
71 | 71 | * @throws \EventEspresso\core\exceptions\InvalidEntityException |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * advances pointer to the provided object |
212 | 212 | * |
213 | 213 | * @access public |
214 | - * @param $object |
|
214 | + * @param \EventEspresso\core\libraries\form_sections\form_handlers\SequentialStepFormInterface $object |
|
215 | 215 | * @return boolean |
216 | 216 | */ |
217 | 217 | public function setCurrentUsingObject( $object ) { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * |
250 | 250 | * @see http://stackoverflow.com/a/8736013 |
251 | 251 | * @param $object |
252 | - * @return boolean|int|string |
|
252 | + * @return integer |
|
253 | 253 | */ |
254 | 254 | public function indexOf( $object ) { |
255 | 255 | if ( ! $this->contains( $object ) ) { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | /** |
6 | 6 | * Class EE_Line_Item_Filter_Collection |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | use EventEspresso\core\services\collections\Collection; |
5 | 5 | |
6 | 6 | |
7 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
8 | - exit( 'No direct script access allowed' ); |
|
7 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
8 | + exit('No direct script access allowed'); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @throws \EventEspresso\Core\Exceptions\InvalidInterfaceException |
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | - parent::__construct( '\EventEspresso\core\services\progress_steps\ProgressStepInterface' ); |
|
30 | + parent::__construct('\EventEspresso\core\services\progress_steps\ProgressStepInterface'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\progress_steps; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * @param boolean $is_current |
24 | 24 | */ |
25 | - public function setIsCurrent( $is_current = true ); |
|
25 | + public function setIsCurrent($is_current = true); |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @return int|string |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | use EventEspresso\core\services\locators\FqcnLocator; |
9 | 9 | use EventEspresso\core\services\locators\LocatorInterface; |
10 | 10 | |
11 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
12 | - exit( 'No direct script access allowed' ); |
|
11 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
12 | + exit('No direct script access allowed'); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | $identifier_callback = '', |
171 | 171 | LocatorInterface $file_locator = null |
172 | 172 | ) { |
173 | - $this->setCollectionName( $collection_name ); |
|
174 | - $this->setCollectionInterface( $collection_interface ); |
|
175 | - $this->setCollectionFQCNs( $collection_FQCNs ); |
|
176 | - $this->setCollectionPaths( $collection_paths ); |
|
177 | - $this->setFileMasks( $file_mask ); |
|
178 | - $this->setIdentifierType( $identifier_type ); |
|
179 | - $this->setIdentifierCallback( $identifier_callback ); |
|
173 | + $this->setCollectionName($collection_name); |
|
174 | + $this->setCollectionInterface($collection_interface); |
|
175 | + $this->setCollectionFQCNs($collection_FQCNs); |
|
176 | + $this->setCollectionPaths($collection_paths); |
|
177 | + $this->setFileMasks($file_mask); |
|
178 | + $this->setIdentifierType($identifier_type); |
|
179 | + $this->setIdentifierCallback($identifier_callback); |
|
180 | 180 | $this->file_locator = $file_locator; |
181 | 181 | } |
182 | 182 | |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | * @param string $collection_interface |
198 | 198 | * @throws \EventEspresso\Core\Exceptions\InvalidInterfaceException |
199 | 199 | */ |
200 | - protected function setCollectionInterface( $collection_interface ) { |
|
201 | - if ( ! ( interface_exists( $collection_interface ) || class_exists( $collection_interface ) ) ) { |
|
202 | - throw new InvalidInterfaceException( $collection_interface ); |
|
200 | + protected function setCollectionInterface($collection_interface) { |
|
201 | + if ( ! (interface_exists($collection_interface) || class_exists($collection_interface))) { |
|
202 | + throw new InvalidInterfaceException($collection_interface); |
|
203 | 203 | } |
204 | 204 | $this->collection_interface = $collection_interface; |
205 | 205 | } |
@@ -225,14 +225,14 @@ discard block |
||
225 | 225 | * @param string $collection_name |
226 | 226 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
227 | 227 | */ |
228 | - protected function setCollectionName( $collection_name ) { |
|
229 | - if ( ! is_string( $collection_name ) ) { |
|
230 | - throw new InvalidDataTypeException( '$collection_name', $collection_name, 'string' ); |
|
228 | + protected function setCollectionName($collection_name) { |
|
229 | + if ( ! is_string($collection_name)) { |
|
230 | + throw new InvalidDataTypeException('$collection_name', $collection_name, 'string'); |
|
231 | 231 | } |
232 | 232 | $this->collection_name = str_replace( |
233 | 233 | '-', |
234 | 234 | '_', |
235 | - sanitize_title_with_dashes( $collection_name, '', 'save' ) |
|
235 | + sanitize_title_with_dashes($collection_name, '', 'save') |
|
236 | 236 | ); |
237 | 237 | } |
238 | 238 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @param string $identifier_type |
254 | 254 | * @throws \EventEspresso\Core\Exceptions\InvalidIdentifierException |
255 | 255 | */ |
256 | - protected function setIdentifierType( $identifier_type ) { |
|
256 | + protected function setIdentifierType($identifier_type) { |
|
257 | 257 | if ( |
258 | 258 | ! ( |
259 | 259 | $identifier_type === CollectionDetails::ID_CLASS_NAME |
@@ -286,9 +286,9 @@ discard block |
||
286 | 286 | * @param string $identifier_callback |
287 | 287 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
288 | 288 | */ |
289 | - protected function setIdentifierCallback( $identifier_callback = 'identifier' ) { |
|
290 | - if ( ! is_string( $identifier_callback ) ) { |
|
291 | - throw new InvalidDataTypeException( '$identifier_callback', $identifier_callback, 'string' ); |
|
289 | + protected function setIdentifierCallback($identifier_callback = 'identifier') { |
|
290 | + if ( ! is_string($identifier_callback)) { |
|
291 | + throw new InvalidDataTypeException('$identifier_callback', $identifier_callback, 'string'); |
|
292 | 292 | } |
293 | 293 | $this->identifier_callback = $identifier_callback; |
294 | 294 | } |
@@ -313,12 +313,12 @@ discard block |
||
313 | 313 | * @param string $file_mask |
314 | 314 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
315 | 315 | */ |
316 | - protected function setFileMasks( $file_mask ) { |
|
317 | - $this->file_mask = ! empty( $file_mask ) ? $file_mask : '*.php'; |
|
316 | + protected function setFileMasks($file_mask) { |
|
317 | + $this->file_mask = ! empty($file_mask) ? $file_mask : '*.php'; |
|
318 | 318 | // we know our default is a string, so if it's not a string now, |
319 | 319 | // then that means the incoming parameter was something else |
320 | - if ( ! is_string( $this->file_mask ) ) { |
|
321 | - throw new InvalidDataTypeException( '$file_mask', $this->file_mask, 'string' ); |
|
320 | + if ( ! is_string($this->file_mask)) { |
|
321 | + throw new InvalidDataTypeException('$file_mask', $this->file_mask, 'string'); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
@@ -340,13 +340,13 @@ discard block |
||
340 | 340 | * @throws \EventEspresso\Core\Exceptions\InvalidClassException |
341 | 341 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
342 | 342 | */ |
343 | - public function setCollectionFQCNs( $collection_FQCNs ) { |
|
344 | - foreach ( (array) $collection_FQCNs as $collection_FQCN ) { |
|
345 | - if ( ! empty( $collection_FQCN ) ) { |
|
346 | - if ( class_exists( $collection_FQCN ) ) { |
|
343 | + public function setCollectionFQCNs($collection_FQCNs) { |
|
344 | + foreach ((array) $collection_FQCNs as $collection_FQCN) { |
|
345 | + if ( ! empty($collection_FQCN)) { |
|
346 | + if (class_exists($collection_FQCN)) { |
|
347 | 347 | $this->collection_FQCNs[] = $collection_FQCN; |
348 | 348 | } else { |
349 | - foreach ( $this->getFQCNsFromPartialNamespace( $collection_FQCN ) as $FQCN ) { |
|
349 | + foreach ($this->getFQCNsFromPartialNamespace($collection_FQCN) as $FQCN) { |
|
350 | 350 | $this->collection_FQCNs[] = $FQCN; |
351 | 351 | } |
352 | 352 | } |
@@ -363,11 +363,11 @@ discard block |
||
363 | 363 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
364 | 364 | * @throws \EventEspresso\Core\Exceptions\InvalidClassException |
365 | 365 | */ |
366 | - protected function getFQCNsFromPartialNamespace( $partial_FQCN ) { |
|
367 | - if ( ! $this->file_locator instanceof FqcnLocator ) { |
|
366 | + protected function getFQCNsFromPartialNamespace($partial_FQCN) { |
|
367 | + if ( ! $this->file_locator instanceof FqcnLocator) { |
|
368 | 368 | $this->file_locator = new FqcnLocator(); |
369 | 369 | } |
370 | - $this->file_locator->locate( $partial_FQCN ); |
|
370 | + $this->file_locator->locate($partial_FQCN); |
|
371 | 371 | return $this->file_locator->getFQCNs(); |
372 | 372 | } |
373 | 373 | |
@@ -388,11 +388,11 @@ discard block |
||
388 | 388 | * @param string|array $collection_paths |
389 | 389 | * @throws \EventEspresso\Core\Exceptions\InvalidFilePathException |
390 | 390 | */ |
391 | - public function setCollectionPaths( $collection_paths ) { |
|
392 | - foreach ( (array) $collection_paths as $collection_path ) { |
|
393 | - if ( ! empty( $collection_path ) ) { |
|
394 | - if ( ! is_readable( $collection_path ) ) { |
|
395 | - throw new InvalidFilePathException( $collection_path ); |
|
391 | + public function setCollectionPaths($collection_paths) { |
|
392 | + foreach ((array) $collection_paths as $collection_path) { |
|
393 | + if ( ! empty($collection_path)) { |
|
394 | + if ( ! is_readable($collection_path)) { |
|
395 | + throw new InvalidFilePathException($collection_path); |
|
396 | 396 | } |
397 | 397 | $this->collection_paths[] = $collection_path; |
398 | 398 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | /** |
6 | 6 | * This is the template for the "Number Bubbles" Progress Steps |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | <!-- progress step display --> |
15 | 15 | <div class="ee-progress-step-main-container"> |
16 | 16 | <div class="progress-step-container number-bubbles-container"> |
17 | - <?php foreach ( $progress_steps as $progress_step ) : ?> |
|
18 | - <div data-step-nmbr="<?php echo $progress_step->order();?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>"> |
|
17 | + <?php foreach ($progress_steps as $progress_step) : ?> |
|
18 | + <div data-step-nmbr="<?php echo $progress_step->order(); ?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>"> |
|
19 | 19 | <div class="progress-step-line"></div> |
20 | 20 | <div class="progress-step-bubble"><p><?php echo $progress_step->order(); ?></p></div> |
21 | 21 | <span class="progress-step-text"><?php echo $progress_step->text(); ?></span> |
22 | 22 | </div> |
23 | - <?php endforeach;?> |
|
23 | + <?php endforeach; ?> |
|
24 | 24 | </div> |
25 | 25 | </div> |
26 | 26 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use OutOfBoundsException; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | * @param int $code |
29 | 29 | * @param \Exception $previous |
30 | 30 | */ |
31 | - public function __construct( $form_name, $message = '', $code = 0, \Exception $previous = null ) { |
|
32 | - if ( empty( $message ) ) { |
|
31 | + public function __construct($form_name, $message = '', $code = 0, \Exception $previous = null) { |
|
32 | + if (empty($message)) { |
|
33 | 33 | $message = sprintf( |
34 | 34 | __( |
35 | 35 | 'The data for the "%1$s" form, is either missing or was not submitted properly.', |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $form_name |
39 | 39 | ); |
40 | 40 | } |
41 | - parent::__construct( $message, $code, $previous ); |
|
41 | + parent::__construct($message, $code, $previous); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | } |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | /** |
55 | 55 | * @param \Registrations_Admin_Page $admin_page |
56 | 56 | */ |
57 | - public function __construct( Registrations_Admin_Page $admin_page ){ |
|
58 | - if ( ! empty( $_GET['event_id'] ) ) { |
|
57 | + public function __construct(Registrations_Admin_Page $admin_page) { |
|
58 | + if ( ! empty($_GET['event_id'])) { |
|
59 | 59 | $extra_query_args = array(); |
60 | - foreach ( $admin_page->get_views() as $key => $view_details ) { |
|
61 | - $extra_query_args[$view_details['slug']] = array( 'event_id' => $_GET['event_id'] ); |
|
60 | + foreach ($admin_page->get_views() as $key => $view_details) { |
|
61 | + $extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']); |
|
62 | 62 | } |
63 | - $this->_views = $admin_page->get_list_table_view_RLs( $extra_query_args ); |
|
63 | + $this->_views = $admin_page->get_list_table_view_RLs($extra_query_args); |
|
64 | 64 | } |
65 | 65 | parent::__construct($admin_page); |
66 | 66 | $this->_status = $this->_admin_page->get_registration_status_array(); |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @return void |
76 | 76 | */ |
77 | 77 | protected function _setup_data() { |
78 | - $this->_data = $this->_admin_page->get_registrations( $this->_per_page ); |
|
79 | - $this->_all_data_count = $this->_admin_page->get_registrations( $this->_per_page, TRUE, FALSE, FALSE ); |
|
78 | + $this->_data = $this->_admin_page->get_registrations($this->_per_page); |
|
79 | + $this->_all_data_count = $this->_admin_page->get_registrations($this->_per_page, TRUE, FALSE, FALSE); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -93,30 +93,30 @@ discard block |
||
93 | 93 | 'ajax' => TRUE, |
94 | 94 | 'screen' => $this->_admin_page->get_current_screen()->id |
95 | 95 | ); |
96 | - $ID_column_name = __( 'ID', 'event_espresso' ); |
|
96 | + $ID_column_name = __('ID', 'event_espresso'); |
|
97 | 97 | $ID_column_name .= ' : <span class="show-on-mobile-view-only" style="float:none">'; |
98 | - $ID_column_name .= __( 'Registrant Name', 'event_espresso' ); |
|
98 | + $ID_column_name .= __('Registrant Name', 'event_espresso'); |
|
99 | 99 | $ID_column_name .= '</span> '; |
100 | - if ( isset( $_GET['event_id'] )) { |
|
100 | + if (isset($_GET['event_id'])) { |
|
101 | 101 | $this->_columns = array( |
102 | 102 | 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
103 | 103 | '_REG_ID' => $ID_column_name, |
104 | - 'ATT_fname' => __( 'Name', 'event_espresso' ), |
|
104 | + 'ATT_fname' => __('Name', 'event_espresso'), |
|
105 | 105 | 'ATT_email' => __('Email', 'event_espresso'), |
106 | - '_REG_date' => __( 'Reg Date', 'event_espresso' ), |
|
107 | - 'PRC_amount' => __( 'TKT Price', 'event_espresso' ), |
|
108 | - '_REG_final_price' => __( 'Final Price', 'event_espresso' ), |
|
109 | - 'TXN_total' => __( 'Total Txn', 'event_espresso' ), |
|
106 | + '_REG_date' => __('Reg Date', 'event_espresso'), |
|
107 | + 'PRC_amount' => __('TKT Price', 'event_espresso'), |
|
108 | + '_REG_final_price' => __('Final Price', 'event_espresso'), |
|
109 | + 'TXN_total' => __('Total Txn', 'event_espresso'), |
|
110 | 110 | 'TXN_paid' => __('Paid', 'event_espresso'), |
111 | - 'actions' => __( 'Actions', 'event_espresso' ) |
|
111 | + 'actions' => __('Actions', 'event_espresso') |
|
112 | 112 | ); |
113 | 113 | $this->_bottom_buttons = array( |
114 | 114 | 'report'=> array( |
115 | 115 | 'route' => 'registrations_report', |
116 | 116 | 'extra_request' => |
117 | 117 | array( |
118 | - 'EVT_ID'=> isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null, |
|
119 | - 'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) |
|
118 | + 'EVT_ID'=> isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null, |
|
119 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}") |
|
120 | 120 | ) |
121 | 121 | ), |
122 | 122 | ); |
@@ -124,19 +124,19 @@ discard block |
||
124 | 124 | $this->_columns = array( |
125 | 125 | 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
126 | 126 | '_REG_ID' => $ID_column_name, |
127 | - 'ATT_fname' => __( 'Name', 'event_espresso' ), |
|
128 | - '_REG_date' => __( 'TXN Date', 'event_espresso' ), |
|
129 | - 'event_name' => __( 'Event', 'event_espresso' ), |
|
130 | - 'DTT_EVT_start' => __( 'Event Date', 'event_espresso' ), |
|
131 | - '_REG_final_price' => __( 'Price', 'event_espresso' ), |
|
132 | - '_REG_paid' => __( 'Paid', 'event_espresso' ), |
|
133 | - 'actions' => __( 'Actions', 'event_espresso' ) |
|
127 | + 'ATT_fname' => __('Name', 'event_espresso'), |
|
128 | + '_REG_date' => __('TXN Date', 'event_espresso'), |
|
129 | + 'event_name' => __('Event', 'event_espresso'), |
|
130 | + 'DTT_EVT_start' => __('Event Date', 'event_espresso'), |
|
131 | + '_REG_final_price' => __('Price', 'event_espresso'), |
|
132 | + '_REG_paid' => __('Paid', 'event_espresso'), |
|
133 | + 'actions' => __('Actions', 'event_espresso') |
|
134 | 134 | ); |
135 | 135 | $this->_bottom_buttons = array( |
136 | 136 | 'report_all'=> array( |
137 | 137 | 'route' => 'registrations_report', |
138 | 138 | 'extra_request' => array( |
139 | - 'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) ) |
|
139 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}") ) |
|
140 | 140 | ), |
141 | 141 | ); |
142 | 142 | } |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | $this->_primary_column = '_REG_ID'; |
145 | 145 | |
146 | 146 | $this->_sortable_columns = array( |
147 | - '_REG_date' => array( '_REG_date' => TRUE ), //true means its already sorted |
|
148 | - 'ATT_fname' => array( 'ATT_fname' => FALSE ), |
|
149 | - 'event_name' => array( 'event_name' => FALSE ), |
|
150 | - 'DTT_EVT_start' => array( 'DTT_EVT_start' => FALSE ), |
|
151 | - '_REG_ID' => array( '_REG_ID' => FALSE ), |
|
147 | + '_REG_date' => array('_REG_date' => TRUE), //true means its already sorted |
|
148 | + 'ATT_fname' => array('ATT_fname' => FALSE), |
|
149 | + 'event_name' => array('event_name' => FALSE), |
|
150 | + 'DTT_EVT_start' => array('DTT_EVT_start' => FALSE), |
|
151 | + '_REG_ID' => array('_REG_ID' => FALSE), |
|
152 | 152 | ); |
153 | 153 | |
154 | 154 | $this->_hidden_columns = array(); |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | * @param EE_Registration $item the current item |
163 | 163 | * @return string |
164 | 164 | */ |
165 | - protected function _get_row_class( $item ) { |
|
166 | - $class = parent::_get_row_class( $item ); |
|
165 | + protected function _get_row_class($item) { |
|
166 | + $class = parent::_get_row_class($item); |
|
167 | 167 | //add status class |
168 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
169 | - if ( $this->_has_checkbox_column ) { |
|
168 | + $class .= ' ee-status-strip reg-status-'.$item->status_ID(); |
|
169 | + if ($this->_has_checkbox_column) { |
|
170 | 170 | $class .= ' has-checkbox-column'; |
171 | 171 | } |
172 | 172 | return $class; |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | * @param EE_Registration $registration |
181 | 181 | * @throws \EE_Error |
182 | 182 | */ |
183 | - protected function _set_related_details( EE_Registration $registration ) { |
|
183 | + protected function _set_related_details(EE_Registration $registration) { |
|
184 | 184 | |
185 | - $transaction = $registration->get_first_related( 'Transaction' ); |
|
185 | + $transaction = $registration->get_first_related('Transaction'); |
|
186 | 186 | $status = $transaction instanceof EE_Transaction |
187 | 187 | ? $transaction->status_ID() |
188 | 188 | : EEM_Transaction::failed_status_code; |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | 'status' => $status, |
192 | 192 | 'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0, |
193 | 193 | 'title_attr' => sprintf( |
194 | - __( 'View Transaction Details (%s)', 'event_espresso' ), |
|
195 | - EEH_Template::pretty_status( $status, false, 'sentence' ) |
|
194 | + __('View Transaction Details (%s)', 'event_espresso'), |
|
195 | + EEH_Template::pretty_status($status, false, 'sentence') |
|
196 | 196 | ) |
197 | 197 | ); |
198 | 198 | |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | 'status' => $status, |
204 | 204 | 'id' => $event instanceof EE_Event ? $event->ID() : 0, |
205 | 205 | 'title_attr' => sprintf( |
206 | - __( 'Edit Event (%s)', 'event_espresso' ), |
|
207 | - EEH_Template::pretty_status( $status, false, 'sentence' ) |
|
206 | + __('Edit Event (%s)', 'event_espresso'), |
|
207 | + EEH_Template::pretty_status($status, false, 'sentence') |
|
208 | 208 | ) |
209 | 209 | ); |
210 | 210 | } |
@@ -221,30 +221,30 @@ discard block |
||
221 | 221 | |
222 | 222 | //todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods. |
223 | 223 | |
224 | - $cur_date = isset( $this->_req_data['month_range'] ) ? $this->_req_data['month_range'] : ''; |
|
225 | - $cur_category = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1; |
|
226 | - $reg_status = isset( $this->_req_data['_reg_status'] ) ? $this->_req_data['_reg_status'] : ''; |
|
224 | + $cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : ''; |
|
225 | + $cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1; |
|
226 | + $reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : ''; |
|
227 | 227 | |
228 | - $filters[] = EEH_Form_Fields::generate_registration_months_dropdown( $cur_date, $reg_status, $cur_category ); |
|
229 | - $filters[] = EEH_Form_Fields::generate_event_category_dropdown( $cur_category ); |
|
228 | + $filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category); |
|
229 | + $filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category); |
|
230 | 230 | |
231 | 231 | $status = array(); |
232 | - $status[] = array( 'id' => 0, 'text' => __('Select Status', 'event_espresso') ); |
|
233 | - foreach ( $this->_status as $key => $value ) { |
|
234 | - $status[] = array( 'id' => $key, 'text' => $value ); |
|
232 | + $status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso')); |
|
233 | + foreach ($this->_status as $key => $value) { |
|
234 | + $status[] = array('id' => $key, 'text' => $value); |
|
235 | 235 | } |
236 | - if ( $this->_view !== 'incomplete' ) { |
|
236 | + if ($this->_view !== 'incomplete') { |
|
237 | 237 | $filters[] = EEH_Form_Fields::select_input( |
238 | 238 | '_reg_status', |
239 | 239 | $status, |
240 | - isset( $this->_req_data['_reg_status'] ) |
|
241 | - ? strtoupper( sanitize_key( $this->_req_data['_reg_status'] )) |
|
240 | + isset($this->_req_data['_reg_status']) |
|
241 | + ? strtoupper(sanitize_key($this->_req_data['_reg_status'])) |
|
242 | 242 | : '' |
243 | 243 | ); |
244 | 244 | } |
245 | 245 | |
246 | - if ( isset( $this->_req_data['event_id'] ) ) { |
|
247 | - $filters[] = EEH_Form_Fields::hidden_input( 'event_id', $this->_req_data['event_id'], 'reg_event_id' ); |
|
246 | + if (isset($this->_req_data['event_id'])) { |
|
247 | + $filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | return $filters; |
@@ -263,9 +263,9 @@ discard block |
||
263 | 263 | $this->_views['all']['count'] = $this->_total_registrations(); |
264 | 264 | $this->_views['month']['count'] = $this->_total_registrations_this_month(); |
265 | 265 | $this->_views['today']['count'] = $this->_total_registrations_today(); |
266 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_trash_registrations' ) ) { |
|
267 | - $this->_views['incomplete']['count'] = $this->_total_registrations( 'incomplete' ); |
|
268 | - $this->_views['trash']['count'] = $this->_total_registrations( 'trash' ); |
|
266 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_trash_registrations')) { |
|
267 | + $this->_views['incomplete']['count'] = $this->_total_registrations('incomplete'); |
|
268 | + $this->_views['trash']['count'] = $this->_total_registrations('trash'); |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 | |
@@ -279,23 +279,23 @@ discard block |
||
279 | 279 | * @return int |
280 | 280 | * @throws \EE_Error |
281 | 281 | */ |
282 | - protected function _total_registrations( $view = '' ){ |
|
282 | + protected function _total_registrations($view = '') { |
|
283 | 283 | $_where = array(); |
284 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
285 | - if( $EVT_ID ) { |
|
284 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
285 | + if ($EVT_ID) { |
|
286 | 286 | $_where['EVT_ID'] = $EVT_ID; |
287 | 287 | } |
288 | - switch ( $view ) { |
|
288 | + switch ($view) { |
|
289 | 289 | case 'trash' : |
290 | - return EEM_Registration::instance()->count_deleted( array( $_where )); |
|
290 | + return EEM_Registration::instance()->count_deleted(array($_where)); |
|
291 | 291 | break; |
292 | 292 | case 'incomplete' : |
293 | 293 | $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
294 | 294 | break; |
295 | 295 | default : |
296 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
296 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
297 | 297 | } |
298 | - return EEM_Registration::instance()->count( array( $_where )); |
|
298 | + return EEM_Registration::instance()->count(array($_where)); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | |
@@ -307,32 +307,32 @@ discard block |
||
307 | 307 | * @return int |
308 | 308 | * @throws \EE_Error |
309 | 309 | */ |
310 | - protected function _total_registrations_this_month(){ |
|
311 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
312 | - $_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array(); |
|
310 | + protected function _total_registrations_this_month() { |
|
311 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
312 | + $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
313 | 313 | $this_year_r = date('Y', current_time('timestamp')); |
314 | 314 | $time_start = ' 00:00:00'; |
315 | 315 | $time_end = ' 23:59:59'; |
316 | 316 | $this_month_r = date('m', current_time('timestamp')); |
317 | - $days_this_month = date( 't', current_time('timestamp') ); |
|
317 | + $days_this_month = date('t', current_time('timestamp')); |
|
318 | 318 | //setup date query. |
319 | 319 | $beginning_string = EEM_Registration::instance()->convert_datetime_for_query( |
320 | 320 | 'REG_date', |
321 | - $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, |
|
321 | + $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, |
|
322 | 322 | 'Y-m-d H:i:s' |
323 | 323 | ); |
324 | 324 | $end_string = EEM_Registration::instance()->convert_datetime_for_query( |
325 | 325 | 'REG_date', |
326 | - $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, |
|
326 | + $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, |
|
327 | 327 | 'Y-m-d H:i:s' |
328 | 328 | ); |
329 | - $_where['REG_date']= array('BETWEEN', |
|
329 | + $_where['REG_date'] = array('BETWEEN', |
|
330 | 330 | array( |
331 | 331 | $beginning_string, |
332 | 332 | $end_string |
333 | 333 | )); |
334 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
335 | - return EEM_Registration::instance()->count(array( $_where ) ); |
|
334 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
335 | + return EEM_Registration::instance()->count(array($_where)); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | |
@@ -344,20 +344,20 @@ discard block |
||
344 | 344 | * @return int |
345 | 345 | * @throws \EE_Error |
346 | 346 | */ |
347 | - protected function _total_registrations_today(){ |
|
347 | + protected function _total_registrations_today() { |
|
348 | 348 | |
349 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
350 | - $_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array(); |
|
349 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
350 | + $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
351 | 351 | $current_date = date('Y-m-d', current_time('timestamp')); |
352 | 352 | $time_start = ' 00:00:00'; |
353 | 353 | $time_end = ' 23:59:59'; |
354 | - $_where['REG_date']= array('BETWEEN', |
|
354 | + $_where['REG_date'] = array('BETWEEN', |
|
355 | 355 | array( |
356 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_start, 'Y-m-d H:i:s' ), |
|
357 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_end, 'Y-m-d H:i:s' ) |
|
356 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_start, 'Y-m-d H:i:s'), |
|
357 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_end, 'Y-m-d H:i:s') |
|
358 | 358 | )); |
359 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
360 | - return EEM_Registration::instance()->count(array( $_where ) ); |
|
359 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
360 | + return EEM_Registration::instance()->count(array($_where)); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
@@ -370,12 +370,12 @@ discard block |
||
370 | 370 | * @return string |
371 | 371 | * @throws \EE_Error |
372 | 372 | */ |
373 | - public function column_cb($item){ |
|
373 | + public function column_cb($item) { |
|
374 | 374 | /** checkbox/lock **/ |
375 | - $transaction = $item->get_first_related( 'Transaction' ); |
|
376 | - $payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0; |
|
375 | + $transaction = $item->get_first_related('Transaction'); |
|
376 | + $payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related('Payment') : 0; |
|
377 | 377 | return $payment_count > 0 |
378 | - ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() ) |
|
378 | + ? sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID()) |
|
379 | 379 | . '<span class="ee-lock-icon"></span>' |
380 | 380 | : sprintf( |
381 | 381 | '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', |
@@ -393,14 +393,14 @@ discard block |
||
393 | 393 | * @return string |
394 | 394 | * @throws \EE_Error |
395 | 395 | */ |
396 | - public function column__REG_ID(EE_Registration $item){ |
|
396 | + public function column__REG_ID(EE_Registration $item) { |
|
397 | 397 | $attendee = $item->attendee(); |
398 | 398 | $content = $item->ID(); |
399 | 399 | $content .= '<div class="show-on-mobile-view-only">'; |
400 | 400 | $content .= '<br>'; |
401 | 401 | $content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
402 | - $content .= ' ' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size()); |
|
403 | - $content .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') ); |
|
402 | + $content .= ' '.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
403 | + $content .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
404 | 404 | $content .= '</div>'; |
405 | 405 | return $content; |
406 | 406 | } |
@@ -415,12 +415,12 @@ discard block |
||
415 | 415 | * @return string |
416 | 416 | * @throws \EE_Error |
417 | 417 | */ |
418 | - public function column__REG_date(EE_Registration $item){ |
|
418 | + public function column__REG_date(EE_Registration $item) { |
|
419 | 419 | $this->_set_related_details($item); |
420 | 420 | //Build row actions |
421 | - $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL ); |
|
422 | - $view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_lnk_url.'" title="' . esc_attr( $this->_transaction_details['title_attr'] ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' ); |
|
423 | - $view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>'; |
|
421 | + $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id']), TXN_ADMIN_URL); |
|
422 | + $view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-'.$this->_transaction_details['status'].'" href="'.$view_lnk_url.'" title="'.esc_attr($this->_transaction_details['title_attr']).'">'.$item->get_i18n_datetime('REG_date').'</a>' : $item->get_i18n_datetime('REG_date'); |
|
423 | + $view_link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($this->_transaction_details['status'], false, 'sentence').'</span>'; |
|
424 | 424 | return $view_link; |
425 | 425 | } |
426 | 426 | |
@@ -434,18 +434,18 @@ discard block |
||
434 | 434 | * @return string |
435 | 435 | * @throws \EE_Error |
436 | 436 | */ |
437 | - public function column_event_name(EE_Registration $item){ |
|
438 | - $this->_set_related_details( $item ); |
|
437 | + public function column_event_name(EE_Registration $item) { |
|
438 | + $this->_set_related_details($item); |
|
439 | 439 | // page=espresso_events&action=edit_event&EVT_ID=2&edit_event_nonce=cf3a7e5b62 |
440 | - $edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$item->event_ID() ), EVENTS_ADMIN_URL ); |
|
440 | + $edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$item->event_ID()), EVENTS_ADMIN_URL); |
|
441 | 441 | $event_name = $item->event_name(); |
442 | 442 | $event_name = $event_name ? $event_name : __("No Associated Event", 'event_espresso'); |
443 | - $edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID() ) ? '<a class="ee-status-color-' . $this->_event_details['status'] . '" href="' . $edit_event_url . '" title="' . esc_attr( $this->_event_details['title_attr'] ) .'">' . wp_trim_words( $event_name, 30, '...' ) . '</a>' : wp_trim_words( $event_name, 30, '...' ) ; |
|
443 | + $edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID()) ? '<a class="ee-status-color-'.$this->_event_details['status'].'" href="'.$edit_event_url.'" title="'.esc_attr($this->_event_details['title_attr']).'">'.wp_trim_words($event_name, 30, '...').'</a>' : wp_trim_words($event_name, 30, '...'); |
|
444 | 444 | |
445 | - $edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'event_id'=>$item->event_ID() ), REG_ADMIN_URL ); |
|
446 | - $actions['event_filter'] = '<a href="' . $edit_event_url . '" title="' . sprintf( esc_attr__( 'Filter this list to only show registrations for %s', 'event_espresso' ), $event_name ) .'">' . __( 'View Registrations', 'event_espresso' ) . '</a>'; |
|
445 | + $edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id'=>$item->event_ID()), REG_ADMIN_URL); |
|
446 | + $actions['event_filter'] = '<a href="'.$edit_event_url.'" title="'.sprintf(esc_attr__('Filter this list to only show registrations for %s', 'event_espresso'), $event_name).'">'.__('View Registrations', 'event_espresso').'</a>'; |
|
447 | 447 | |
448 | - return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions) ); |
|
448 | + return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions)); |
|
449 | 449 | } |
450 | 450 | |
451 | 451 | |
@@ -458,18 +458,18 @@ discard block |
||
458 | 458 | * @return string |
459 | 459 | * @throws \EE_Error |
460 | 460 | */ |
461 | - public function column_DTT_EVT_start(EE_Registration $item){ |
|
461 | + public function column_DTT_EVT_start(EE_Registration $item) { |
|
462 | 462 | $datetime_strings = array(); |
463 | - $ticket = $item->ticket( TRUE ); |
|
464 | - if ( $ticket instanceof EE_Ticket ) { |
|
463 | + $ticket = $item->ticket(TRUE); |
|
464 | + if ($ticket instanceof EE_Ticket) { |
|
465 | 465 | $remove_defaults = array('default_where_conditions' => 'none'); |
466 | 466 | $datetimes = $ticket->datetimes($remove_defaults); |
467 | - foreach($datetimes as $datetime){ |
|
468 | - $datetime_strings[] = $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
467 | + foreach ($datetimes as $datetime) { |
|
468 | + $datetime_strings[] = $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
469 | 469 | } |
470 | - return implode("<br />",$datetime_strings); |
|
470 | + return implode("<br />", $datetime_strings); |
|
471 | 471 | } else { |
472 | - return __( 'There is no ticket on this registration', 'event_espresso' ); |
|
472 | + return __('There is no ticket on this registration', 'event_espresso'); |
|
473 | 473 | } |
474 | 474 | } |
475 | 475 | |
@@ -483,45 +483,45 @@ discard block |
||
483 | 483 | * @return string |
484 | 484 | * @throws \EE_Error |
485 | 485 | */ |
486 | - public function column_ATT_fname(EE_Registration $item){ |
|
486 | + public function column_ATT_fname(EE_Registration $item) { |
|
487 | 487 | $attendee = $item->attendee(); |
488 | 488 | |
489 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
489 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
490 | 490 | $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
491 | - $link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . $attendee_name . '</a>' : $attendee_name; |
|
491 | + $link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'.$attendee_name.'</a>' : $attendee_name; |
|
492 | 492 | $link .= $item->count() === 1 ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : ''; |
493 | 493 | |
494 | 494 | $t = $item->get_first_related('Transaction'); |
495 | 495 | $payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0; |
496 | 496 | |
497 | 497 | //append group count to name |
498 | - $link .= ' ' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size()); |
|
498 | + $link .= ' '.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
499 | 499 | |
500 | 500 | //append reg_code |
501 | - $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') ); |
|
501 | + $link .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
502 | 502 | |
503 | 503 | //reg status text for accessibility |
504 | - $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>'; |
|
504 | + $link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->status_ID(), false, 'sentence').'</span>'; |
|
505 | 505 | |
506 | 506 | //trash/restore/delete actions |
507 | 507 | $actions = array(); |
508 | - if ( $this->_view !== 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID() ) ) { |
|
509 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
510 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Trash Registration', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>'; |
|
511 | - } elseif ( $this->_view === 'trash' ) { |
|
508 | + if ($this->_view !== 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID())) { |
|
509 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
510 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Trash Registration', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
511 | + } elseif ($this->_view === 'trash') { |
|
512 | 512 | // restore registration link |
513 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID() ) ) { |
|
514 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
515 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Registration', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
513 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID())) { |
|
514 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
515 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Registration', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
516 | 516 | } |
517 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID() ) ) { |
|
518 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
517 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID())) { |
|
518 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
519 | 519 | |
520 | - $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Registration Permanently', 'event_espresso' ). '">' . __( 'Delete', 'event_espresso' ) . '</a>'; |
|
520 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Registration Permanently', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>'; |
|
521 | 521 | } |
522 | 522 | } |
523 | 523 | |
524 | - return sprintf('%1$s %2$s', $link, $this->row_actions($actions) ); |
|
524 | + return sprintf('%1$s %2$s', $link, $this->row_actions($actions)); |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | * @return string |
535 | 535 | * @throws \EE_Error |
536 | 536 | */ |
537 | - public function column_ATT_email( EE_Registration $item ) { |
|
537 | + public function column_ATT_email(EE_Registration $item) { |
|
538 | 538 | $attendee = $item->get_first_related('Attendee'); |
539 | 539 | return ! $attendee instanceof EE_Attendee ? __('No attached contact record.', 'event_espresso') : $attendee->email(); |
540 | 540 | } |
@@ -548,8 +548,8 @@ discard block |
||
548 | 548 | * @param \EE_Registration $item |
549 | 549 | * @return string |
550 | 550 | */ |
551 | - public function column__REG_count(EE_Registration $item){ |
|
552 | - return sprintf(__( '%1$s / %2$s', 'event_espresso' ), $item->count(), $item->group_size()); |
|
551 | + public function column__REG_count(EE_Registration $item) { |
|
552 | + return sprintf(__('%1$s / %2$s', 'event_espresso'), $item->count(), $item->group_size()); |
|
553 | 553 | } |
554 | 554 | |
555 | 555 | |
@@ -561,16 +561,16 @@ discard block |
||
561 | 561 | * @param \EE_Registration $item |
562 | 562 | * @return string |
563 | 563 | */ |
564 | - public function column_PRC_amount(EE_Registration $item){ |
|
564 | + public function column_PRC_amount(EE_Registration $item) { |
|
565 | 565 | $ticket = $item->ticket(); |
566 | 566 | |
567 | - $content = isset( $_GET['event_id'] ) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">' . $ticket->name() . '</span><br />' : ''; |
|
567 | + $content = isset($_GET['event_id']) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">'.$ticket->name().'</span><br />' : ''; |
|
568 | 568 | |
569 | - if ( $item->final_price() > 0 ) { |
|
570 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
569 | + if ($item->final_price() > 0) { |
|
570 | + $content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>'; |
|
571 | 571 | } else { |
572 | 572 | // free event |
573 | - $content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' . __( 'free', 'event_espresso' ) . '</span>'; |
|
573 | + $content .= '<span class="reg-overview-free-event-spn reg-pad-rght">'.__('free', 'event_espresso').'</span>'; |
|
574 | 574 | } |
575 | 575 | |
576 | 576 | return $content; |
@@ -586,11 +586,11 @@ discard block |
||
586 | 586 | * @param \EE_Registration $item |
587 | 587 | * @return string |
588 | 588 | */ |
589 | - public function column__REG_final_price(EE_Registration $item){ |
|
589 | + public function column__REG_final_price(EE_Registration $item) { |
|
590 | 590 | $ticket = $item->ticket(); |
591 | - $content = isset( $_GET['event_id'] ) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">' . $ticket->name() . '</span><br />'; |
|
591 | + $content = isset($_GET['event_id']) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">'.$ticket->name().'</span><br />'; |
|
592 | 592 | |
593 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
593 | + $content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>'; |
|
594 | 594 | return $content; |
595 | 595 | |
596 | 596 | } |
@@ -604,13 +604,13 @@ discard block |
||
604 | 604 | * @param \EE_Registration $item |
605 | 605 | * @return string |
606 | 606 | */ |
607 | - public function column__REG_paid(EE_Registration $item){ |
|
607 | + public function column__REG_paid(EE_Registration $item) { |
|
608 | 608 | $payment_method = $item->payment_method(); |
609 | - $payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __( 'Unknown', 'event_espresso' ); |
|
609 | + $payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso'); |
|
610 | 610 | |
611 | - $content = '<span class="reg-pad-rght">' . $item->pretty_paid() . '</span>'; |
|
612 | - if ( $item->paid() > 0 ) { |
|
613 | - $content .= '<br><span class="ee-status-text-small">' . sprintf( __( '...via %s', 'event_espresso' ), $payment_method_name ) . '</span>'; |
|
611 | + $content = '<span class="reg-pad-rght">'.$item->pretty_paid().'</span>'; |
|
612 | + if ($item->paid() > 0) { |
|
613 | + $content .= '<br><span class="ee-status-text-small">'.sprintf(__('...via %s', 'event_espresso'), $payment_method_name).'</span>'; |
|
614 | 614 | } |
615 | 615 | return $content; |
616 | 616 | } |
@@ -625,11 +625,11 @@ discard block |
||
625 | 625 | * @return string |
626 | 626 | * @throws \EE_Error |
627 | 627 | */ |
628 | - public function column_TXN_total(EE_Registration $item){ |
|
629 | - if($item->transaction()){ |
|
630 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL ); |
|
631 | - return EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $item->transaction()->status_ID() .'" href="'.$view_txn_lnk_url.'" title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">' . $item->transaction()->pretty_total() . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>'; |
|
632 | - }else{ |
|
628 | + public function column_TXN_total(EE_Registration $item) { |
|
629 | + if ($item->transaction()) { |
|
630 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL); |
|
631 | + return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$item->transaction()->status_ID().'" href="'.$view_txn_lnk_url.'" title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_total().'</a></span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_total().'</span>'; |
|
632 | + } else { |
|
633 | 633 | return __("None", "event_espresso"); |
634 | 634 | } |
635 | 635 | } |
@@ -644,15 +644,15 @@ discard block |
||
644 | 644 | * @return string |
645 | 645 | * @throws \EE_Error |
646 | 646 | */ |
647 | - public function column_TXN_paid(EE_Registration $item){ |
|
647 | + public function column_TXN_paid(EE_Registration $item) { |
|
648 | 648 | |
649 | - if ( $item->count() === 1 ) { |
|
649 | + if ($item->count() === 1) { |
|
650 | 650 | $transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance(); |
651 | - if ( $transaction->paid() >= $transaction->total() ) { |
|
651 | + if ($transaction->paid() >= $transaction->total()) { |
|
652 | 652 | return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
653 | 653 | } else { |
654 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL ); |
|
655 | - return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $transaction->status_ID() .'" href="'.$view_txn_lnk_url.'" title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">' . $item->transaction()->pretty_paid() . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
654 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL); |
|
655 | + return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$transaction->status_ID().'" href="'.$view_txn_lnk_url.'" title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_paid().'</a><span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>'; |
|
656 | 656 | } |
657 | 657 | } |
658 | 658 | |
@@ -673,42 +673,42 @@ discard block |
||
673 | 673 | public function column_actions(EE_Registration $item) { |
674 | 674 | $actions = array(); |
675 | 675 | $attendee = $item->attendee(); |
676 | - $this->_set_related_details( $item ); |
|
676 | + $this->_set_related_details($item); |
|
677 | 677 | |
678 | 678 | //Build row actions |
679 | - $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
680 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->attendee_ID() ), REG_ADMIN_URL ); |
|
679 | + $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
680 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->attendee_ID()), REG_ADMIN_URL); |
|
681 | 681 | |
682 | 682 | // page=attendees&event_admin_reports=resend_email®istration_id=43653465634&event_id=2&form_action=resend_email |
683 | 683 | //$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID ); |
684 | - $resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL, true ); |
|
684 | + $resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL, true); |
|
685 | 685 | |
686 | 686 | |
687 | 687 | //Build row actions |
688 | - $actions['view_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? ' |
|
688 | + $actions['view_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? ' |
|
689 | 689 | <li> |
690 | - <a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '" class="tiny-text"> |
|
690 | + <a href="'.$view_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'" class="tiny-text"> |
|
691 | 691 | <div class="dashicons dashicons-clipboard"></div> |
692 | 692 | </a> |
693 | 693 | </li>' : ''; |
694 | - $actions['edit_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee' ) && $attendee instanceof EE_Attendee ?' |
|
694 | + $actions['edit_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') && $attendee instanceof EE_Attendee ? ' |
|
695 | 695 | <li> |
696 | - <a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact Details', 'event_espresso' ) . '" class="tiny-text"> |
|
696 | + <a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact Details', 'event_espresso').'" class="tiny-text"> |
|
697 | 697 | <div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div> |
698 | 698 | </a> |
699 | 699 | </li>' : ''; |
700 | - $actions['resend_reg_lnk'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration', $item->ID() ) ? ' |
|
700 | + $actions['resend_reg_lnk'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration', $item->ID()) ? ' |
|
701 | 701 | <li> |
702 | - <a href="'.$resend_reg_lnk_url.'" title="' . esc_attr__( 'Resend Registration Details', 'event_espresso' ) . '" class="tiny-text"> |
|
702 | + <a href="'.$resend_reg_lnk_url.'" title="'.esc_attr__('Resend Registration Details', 'event_espresso').'" class="tiny-text"> |
|
703 | 703 | <div class="dashicons dashicons-email-alt"></div> |
704 | 704 | </a> |
705 | 705 | </li>' : ''; |
706 | 706 | |
707 | 707 | // page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb |
708 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id'] ), TXN_ADMIN_URL ); |
|
709 | - $actions['view_txn_lnk'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id'] ) ? ' |
|
708 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id']), TXN_ADMIN_URL); |
|
709 | + $actions['view_txn_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id']) ? ' |
|
710 | 710 | <li> |
711 | - <a class="ee-status-color-' . $this->_transaction_details['status'] . ' tiny-text" href="'.$view_txn_lnk_url.'" title="' . $this->_transaction_details['title_attr'] . '"> |
|
711 | + <a class="ee-status-color-' . $this->_transaction_details['status'].' tiny-text" href="'.$view_txn_lnk_url.'" title="'.$this->_transaction_details['title_attr'].'"> |
|
712 | 712 | <div class="dashicons dashicons-cart"></div> |
713 | 713 | </a> |
714 | 714 | </li>' : ''; |
@@ -717,17 +717,17 @@ discard block |
||
717 | 717 | $actions['dl_invoice_lnk'] = ''; |
718 | 718 | $dl_invoice_lnk_url = $item->invoice_url(); |
719 | 719 | //only show invoice link if message type is active. |
720 | - if ( $attendee instanceof EE_Attendee && $item->is_primary_registrant() && EEH_MSG_Template::is_mt_active( 'invoice' ) ) { |
|
720 | + if ($attendee instanceof EE_Attendee && $item->is_primary_registrant() && EEH_MSG_Template::is_mt_active('invoice')) { |
|
721 | 721 | $actions['dl_invoice_lnk'] = ' |
722 | 722 | <li> |
723 | - <a title="' . esc_attr__( 'View Transaction Invoice', 'event_espresso' ) . '" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text"> |
|
723 | + <a title="' . esc_attr__('View Transaction Invoice', 'event_espresso').'" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text"> |
|
724 | 724 | <span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span> |
725 | 725 | </a> |
726 | 726 | </li>'; |
727 | 727 | } |
728 | 728 | $actions['filtered_messages_link'] = ''; |
729 | 729 | //message list table link (filtered by REG_ID |
730 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) { |
|
730 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { |
|
731 | 731 | $actions['filtered_messages_link'] = '<li>' |
732 | 732 | . EEH_MSG_Template::get_message_action_link( |
733 | 733 | 'see_notifications_for', |
@@ -738,9 +738,9 @@ discard block |
||
738 | 738 | ) |
739 | 739 | . '</li>'; |
740 | 740 | } |
741 | - $actions = apply_filters( 'FHEE__EE_Registrations_List_Table__column_actions__actions', $actions, $item, $this ); |
|
741 | + $actions = apply_filters('FHEE__EE_Registrations_List_Table__column_actions__actions', $actions, $item, $this); |
|
742 | 742 | return $this->_action_string( |
743 | - implode( '', $actions ), |
|
743 | + implode('', $actions), |
|
744 | 744 | $item, |
745 | 745 | 'ul', |
746 | 746 | 'reg-overview-actions-ul' |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')){ |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | } |
5 | 5 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * ------------------------------------------------------------------------ |
36 | 36 | */ |
37 | -abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base{ |
|
37 | +abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base { |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Array of validation errors in this section. Does not contain validation errors in subsections, however. |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * called get_validation_errors_accumulated |
50 | 50 | * @return EE_Validation_Error[] |
51 | 51 | */ |
52 | - public function get_validation_errors(){ |
|
52 | + public function get_validation_errors() { |
|
53 | 53 | return $this->_validation_errors; |
54 | 54 | } |
55 | 55 | /** |
@@ -57,16 +57,16 @@ discard block |
||
57 | 57 | * If we want this to be customizable, we may decide to create a strategy for displaying it. |
58 | 58 | * @return string |
59 | 59 | */ |
60 | - public function get_validation_error_string(){ |
|
60 | + public function get_validation_error_string() { |
|
61 | 61 | $validation_error_messages = array(); |
62 | - if($this->get_validation_errors()){ |
|
63 | - foreach($this->get_validation_errors() as $validation_error){ |
|
64 | - if ( $validation_error instanceof EE_Validation_Error ) { |
|
65 | - $validation_error_messages[] =$validation_error->getMessage(); |
|
62 | + if ($this->get_validation_errors()) { |
|
63 | + foreach ($this->get_validation_errors() as $validation_error) { |
|
64 | + if ($validation_error instanceof EE_Validation_Error) { |
|
65 | + $validation_error_messages[] = $validation_error->getMessage(); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
69 | - return implode(", ",$validation_error_messages); |
|
69 | + return implode(", ", $validation_error_messages); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | * @return boolean |
83 | 83 | */ |
84 | 84 | public function is_valid() { |
85 | - if(count($this->_validation_errors)){ |
|
85 | + if (count($this->_validation_errors)) { |
|
86 | 86 | return false; |
87 | - }else{ |
|
87 | + } else { |
|
88 | 88 | return true; |
89 | 89 | } |
90 | 90 | } |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * @param Exception $previous_exception if there was an exception that caused the error, that exception |
110 | 110 | * @return void |
111 | 111 | */ |
112 | - public function add_validation_error( $message_or_object, $error_code = NULL, $previous_exception = NULL ){ |
|
113 | - if($message_or_object instanceof EE_Validation_Error){ |
|
114 | - $validation_error= $message_or_object; |
|
112 | + public function add_validation_error($message_or_object, $error_code = NULL, $previous_exception = NULL) { |
|
113 | + if ($message_or_object instanceof EE_Validation_Error) { |
|
114 | + $validation_error = $message_or_object; |
|
115 | 115 | $validation_error->set_form_section($this); |
116 | - }else{ |
|
116 | + } else { |
|
117 | 117 | $validation_error = new EE_Validation_Error($message_or_object, $error_code, $this, $previous_exception); |
118 | 118 | } |
119 | 119 | $this->_validation_errors[] = $validation_error; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $validation_error_message = $default_validation_strategy->get_validation_error_message(); |
43 | 43 | } |
44 | 44 | throw new EE_Validation_Error( $validation_error_message, 'float_only' ); |
45 | - }else{ |
|
45 | + } else{ |
|
46 | 46 | return floatval($normalized_value); |
47 | 47 | } |
48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function unnormalize($normalized_value) { |
56 | 56 | if( empty( $normalized_value ) ){ |
57 | 57 | return '0.00'; |
58 | - }else{ |
|
58 | + } else{ |
|
59 | 59 | return "$normalized_value"; |
60 | 60 | } |
61 | 61 | } |