@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | use EventEspressoBatchRequest\Helpers\JobParameters; |
| 24 | 24 | use EventEspressoBatchRequest\Helpers\JobStepResponse; |
| 25 | 25 | |
| 26 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 27 | - exit( 'No direct script access allowed' ); |
|
| 26 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 27 | + exit('No direct script access allowed'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
@@ -50,32 +50,32 @@ discard block |
||
| 50 | 50 | * @param array $request_data to be used by the batch job handler |
| 51 | 51 | * @return JobStepResponse |
| 52 | 52 | */ |
| 53 | - public function create_job( $batch_job_handler_class, $request_data ) { |
|
| 53 | + public function create_job($batch_job_handler_class, $request_data) { |
|
| 54 | 54 | try { |
| 55 | - $this->_job_id = wp_generate_password( 15, false ); |
|
| 56 | - $obj = $this->instantiate_batch_job_handler_from_classname( $batch_job_handler_class ); |
|
| 57 | - $this->_job_parameters = new JobParameters( $this->_job_id, $batch_job_handler_class, $request_data ); |
|
| 58 | - $response = $obj->create_job( $this->_job_parameters ); |
|
| 59 | - if( ! $response instanceof JobStepResponse ) { |
|
| 55 | + $this->_job_id = wp_generate_password(15, false); |
|
| 56 | + $obj = $this->instantiate_batch_job_handler_from_classname($batch_job_handler_class); |
|
| 57 | + $this->_job_parameters = new JobParameters($this->_job_id, $batch_job_handler_class, $request_data); |
|
| 58 | + $response = $obj->create_job($this->_job_parameters); |
|
| 59 | + if ( ! $response instanceof JobStepResponse) { |
|
| 60 | 60 | throw new BatchRequestException( |
| 61 | 61 | sprintf( |
| 62 | - __( 'The class implementing JobHandlerInterface did not return a JobStepResponse when create_job was called with %1$s. It needs to return one or throw an Exception', 'event_espresso' ), |
|
| 63 | - wp_json_encode( $request_data ) |
|
| 62 | + __('The class implementing JobHandlerInterface did not return a JobStepResponse when create_job was called with %1$s. It needs to return one or throw an Exception', 'event_espresso'), |
|
| 63 | + wp_json_encode($request_data) |
|
| 64 | 64 | ) |
| 65 | 65 | ); |
| 66 | 66 | } |
| 67 | - $success = $this->_job_parameters->save( true ); |
|
| 68 | - if( ! $success ) { |
|
| 67 | + $success = $this->_job_parameters->save(true); |
|
| 68 | + if ( ! $success) { |
|
| 69 | 69 | throw new BatchRequestException( |
| 70 | 70 | sprintf( |
| 71 | 71 | __('Could not save job %1$s to the Wordpress Options table. These were the arguments used: %2$s', 'event_espresso'), |
| 72 | 72 | $this->_job_id, |
| 73 | - wp_json_encode( $request_data ) |
|
| 73 | + wp_json_encode($request_data) |
|
| 74 | 74 | ) |
| 75 | 75 | ); |
| 76 | 76 | } |
| 77 | - } catch( \Exception $e ) { |
|
| 78 | - $response = $this->_get_error_response( $e, 'create_job' ); |
|
| 77 | + } catch (\Exception $e) { |
|
| 78 | + $response = $this->_get_error_response($e, 'create_job'); |
|
| 79 | 79 | } |
| 80 | 80 | return $response; |
| 81 | 81 | } |
@@ -88,26 +88,26 @@ discard block |
||
| 88 | 88 | * @param int $batch_size |
| 89 | 89 | * @return JobStepResponse |
| 90 | 90 | */ |
| 91 | - public function continue_job( $job_id, $batch_size = 50 ) { |
|
| 91 | + public function continue_job($job_id, $batch_size = 50) { |
|
| 92 | 92 | try { |
| 93 | 93 | $this->_job_id = $job_id; |
| 94 | - $batch_size = defined( 'EE_BATCHRUNNER_BATCH_SIZE' ) ? EE_BATCHRUNNER_BATCH_SIZE : $batch_size; |
|
| 94 | + $batch_size = defined('EE_BATCHRUNNER_BATCH_SIZE') ? EE_BATCHRUNNER_BATCH_SIZE : $batch_size; |
|
| 95 | 95 | //get the corresponding WordPress option for the job |
| 96 | - $this->_job_parameters = JobParameters::load( $this->_job_id ); |
|
| 97 | - $handler_obj = $this->instantiate_batch_job_handler_from_classname( $this->_job_parameters->classname() ); |
|
| 96 | + $this->_job_parameters = JobParameters::load($this->_job_id); |
|
| 97 | + $handler_obj = $this->instantiate_batch_job_handler_from_classname($this->_job_parameters->classname()); |
|
| 98 | 98 | //continue it |
| 99 | - $response = $handler_obj->continue_job( $this->_job_parameters, $batch_size ); |
|
| 100 | - if( ! $response instanceof JobStepResponse ) { |
|
| 99 | + $response = $handler_obj->continue_job($this->_job_parameters, $batch_size); |
|
| 100 | + if ( ! $response instanceof JobStepResponse) { |
|
| 101 | 101 | throw new BatchRequestException( |
| 102 | 102 | sprintf( |
| 103 | - __( 'The class implementing JobHandlerInterface did not return a JobStepResponse when continue_job was called with job %1$s. It needs to return one or throw an Exception', 'event_espresso' ), |
|
| 103 | + __('The class implementing JobHandlerInterface did not return a JobStepResponse when continue_job was called with job %1$s. It needs to return one or throw an Exception', 'event_espresso'), |
|
| 104 | 104 | $this->_job_id |
| 105 | 105 | ) |
| 106 | 106 | ); |
| 107 | 107 | } |
| 108 | 108 | $this->_job_parameters->save(); |
| 109 | - } catch( \Exception $e ) { |
|
| 110 | - $response = $this->_get_error_response( $e, 'continue_job' ); |
|
| 109 | + } catch (\Exception $e) { |
|
| 110 | + $response = $this->_get_error_response($e, 'continue_job'); |
|
| 111 | 111 | } |
| 112 | 112 | return $response; |
| 113 | 113 | } |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | * @return JobHandlerInterface |
| 123 | 123 | * @throws BatchRequestException |
| 124 | 124 | */ |
| 125 | - public function instantiate_batch_job_handler_from_classname( $classname ) { |
|
| 126 | - if( ! class_exists( $classname ) ) { |
|
| 125 | + public function instantiate_batch_job_handler_from_classname($classname) { |
|
| 126 | + if ( ! class_exists($classname)) { |
|
| 127 | 127 | throw new BatchRequestException( |
| 128 | 128 | sprintf( |
| 129 | 129 | __('The class %1$s does not exist, and so could not be used for running a job. It should implement JobHandlerInterface.', 'event_espresso'), |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | ); |
| 133 | 133 | } |
| 134 | 134 | $obj = new $classname; |
| 135 | - if( ! $obj instanceof JobHandlerInterface ) { |
|
| 135 | + if ( ! $obj instanceof JobHandlerInterface) { |
|
| 136 | 136 | throw new BatchRequestException( |
| 137 | 137 | sprintf( |
| 138 | 138 | __('The class %1$s does not implement JobHandlerInterface and so could not be used for running a job', 'event_espresso'), |
@@ -152,26 +152,26 @@ discard block |
||
| 152 | 152 | * @return JobStepResponse |
| 153 | 153 | * @throws BatchRequestException |
| 154 | 154 | */ |
| 155 | - public function cleanup_job( $job_id ) { |
|
| 156 | - try{ |
|
| 155 | + public function cleanup_job($job_id) { |
|
| 156 | + try { |
|
| 157 | 157 | $this->_job_id = $job_id; |
| 158 | - $job_parameters = JobParameters::load( $this->_job_id ); |
|
| 159 | - $handler_obj = $this->instantiate_batch_job_handler_from_classname( $job_parameters->classname() ); |
|
| 158 | + $job_parameters = JobParameters::load($this->_job_id); |
|
| 159 | + $handler_obj = $this->instantiate_batch_job_handler_from_classname($job_parameters->classname()); |
|
| 160 | 160 | //continue it |
| 161 | - $response = $handler_obj->cleanup_job( $job_parameters ); |
|
| 162 | - if( ! $response instanceof JobStepResponse ) { |
|
| 161 | + $response = $handler_obj->cleanup_job($job_parameters); |
|
| 162 | + if ( ! $response instanceof JobStepResponse) { |
|
| 163 | 163 | throw new BatchRequestException( |
| 164 | 164 | sprintf( |
| 165 | - __( 'The class implementing JobHandlerInterface did not return a JobStepResponse when cleanup_job was called with job %1$s. It needs to return one or throw an Exception', 'event_espresso' ), |
|
| 165 | + __('The class implementing JobHandlerInterface did not return a JobStepResponse when cleanup_job was called with job %1$s. It needs to return one or throw an Exception', 'event_espresso'), |
|
| 166 | 166 | $this->_job_id |
| 167 | 167 | ) |
| 168 | 168 | ); |
| 169 | 169 | } |
| 170 | - $job_parameters->set_status( JobParameters::status_cleaned_up ); |
|
| 170 | + $job_parameters->set_status(JobParameters::status_cleaned_up); |
|
| 171 | 171 | $job_parameters->delete(); |
| 172 | 172 | return $response; |
| 173 | - } catch( \Exception $e ) { |
|
| 174 | - $response = $this->_get_error_response( $e, 'cleanup_job' ); |
|
| 173 | + } catch (\Exception $e) { |
|
| 174 | + $response = $this->_get_error_response($e, 'cleanup_job'); |
|
| 175 | 175 | } |
| 176 | 176 | return $response; |
| 177 | 177 | } |
@@ -184,17 +184,17 @@ discard block |
||
| 184 | 184 | * @param string $method_name |
| 185 | 185 | * @return JobStepResponse |
| 186 | 186 | */ |
| 187 | - protected function _get_error_response( \Exception $exception, $method_name ) { |
|
| 188 | - if( ! $this->_job_parameters instanceof JobParameters ) { |
|
| 189 | - $this->_job_parameters = new JobParameters( $this->_job_id, __( '__Unknown__', 'event_espresso' ), array() ); |
|
| 187 | + protected function _get_error_response(\Exception $exception, $method_name) { |
|
| 188 | + if ( ! $this->_job_parameters instanceof JobParameters) { |
|
| 189 | + $this->_job_parameters = new JobParameters($this->_job_id, __('__Unknown__', 'event_espresso'), array()); |
|
| 190 | 190 | } |
| 191 | - $this->_job_parameters->set_status( JobParameters::status_error ); |
|
| 191 | + $this->_job_parameters->set_status(JobParameters::status_error); |
|
| 192 | 192 | return new JobStepResponse( |
| 193 | 193 | $this->_job_parameters, |
| 194 | 194 | sprintf( |
| 195 | 195 | __('An exception of type %1$s occurred while running %2$s. Its message was %3$s and had trace %4$s', 'event_espresso'), |
| 196 | - get_class( $exception ), |
|
| 197 | - 'BatchRunner::' . $method_name . '()', |
|
| 196 | + get_class($exception), |
|
| 197 | + 'BatchRunner::'.$method_name.'()', |
|
| 198 | 198 | $exception->getMessage(), |
| 199 | 199 | $exception->getTraceAsString() |
| 200 | 200 | ) |
@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * |
|
| 4 | - * Class BatchRequetProcessor |
|
| 3 | + * |
|
| 4 | + * Class BatchRequetProcessor |
|
| 5 | 5 | * |
| 6 | - * Responsible for receiving a request to start a job and assign it a job Id. |
|
| 7 | - * Then when subsequent requests come in to continue that job, dispatches |
|
| 8 | - * the request to the appropriate JobHandler, which processes a step of the batch, |
|
| 9 | - * and then returns the job's new status. |
|
| 10 | - * This class is used by controller code, and the controller code is sent HTTP |
|
| 11 | - * requests from the batch_runner.js library |
|
| 12 | - * |
|
| 13 | - * @package Event Espresso |
|
| 14 | - * @subpackage batch |
|
| 15 | - * @author Mike Nelson |
|
| 16 | - * @since 4.8.26 |
|
| 17 | - * |
|
| 18 | - */ |
|
| 6 | + * Responsible for receiving a request to start a job and assign it a job Id. |
|
| 7 | + * Then when subsequent requests come in to continue that job, dispatches |
|
| 8 | + * the request to the appropriate JobHandler, which processes a step of the batch, |
|
| 9 | + * and then returns the job's new status. |
|
| 10 | + * This class is used by controller code, and the controller code is sent HTTP |
|
| 11 | + * requests from the batch_runner.js library |
|
| 12 | + * |
|
| 13 | + * @package Event Espresso |
|
| 14 | + * @subpackage batch |
|
| 15 | + * @author Mike Nelson |
|
| 16 | + * @since 4.8.26 |
|
| 17 | + * |
|
| 18 | + */ |
|
| 19 | 19 | namespace EventEspressoBatchRequest; |
| 20 | 20 | |
| 21 | 21 | use EventEspressoBatchRequest\JobHandlerBaseClasses\JobHandlerInterface; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | namespace EventEspressoBatchRequest\Helpers; |
| 16 | 16 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
| 17 | 17 | |
| 18 | -class BatchRequestException extends \Exception{ |
|
| 18 | +class BatchRequestException extends \Exception { |
|
| 19 | 19 | //so far the same as exception |
| 20 | 20 | } |
| 21 | 21 | |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * |
|
| 4 | - * Class BatchRequestException |
|
| 5 | - * |
|
| 6 | - * Exception class for whenever we have trouble running start, continuing, or finishing |
|
| 7 | - * a batch job. |
|
| 8 | - * |
|
| 9 | - * @package Event Espresso |
|
| 10 | - * @subpackage batch |
|
| 11 | - * @author Mike Nelson |
|
| 12 | - * @since 4.8.26 |
|
| 13 | - * |
|
| 14 | - */ |
|
| 3 | + * |
|
| 4 | + * Class BatchRequestException |
|
| 5 | + * |
|
| 6 | + * Exception class for whenever we have trouble running start, continuing, or finishing |
|
| 7 | + * a batch job. |
|
| 8 | + * |
|
| 9 | + * @package Event Espresso |
|
| 10 | + * @subpackage batch |
|
| 11 | + * @author Mike Nelson |
|
| 12 | + * @since 4.8.26 |
|
| 13 | + * |
|
| 14 | + */ |
|
| 15 | 15 | namespace EventEspressoBatchRequest\Helpers; |
| 16 | 16 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
| 17 | 17 | |
@@ -43,10 +43,10 @@ |
||
| 43 | 43 | * @param string $update_text |
| 44 | 44 | * @param array $extra_data |
| 45 | 45 | */ |
| 46 | - public function __construct(JobParameters $job_parameters, $update_text, $extra_data = array() ) { |
|
| 47 | - $this->_job_parameters = $job_parameters; |
|
| 46 | + public function __construct(JobParameters $job_parameters, $update_text, $extra_data = array()) { |
|
| 47 | + $this->_job_parameters = $job_parameters; |
|
| 48 | 48 | $this->_update_text = $update_text; |
| 49 | - $this->_extra_data = (array)$extra_data; |
|
| 49 | + $this->_extra_data = (array) $extra_data; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | use EventEspressoBatchRequest\Helpers\JobParameters; |
| 21 | 21 | use EventEspressoBatchRequest\Helpers\JobStepResponse; |
| 22 | 22 | |
| 23 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 24 | - exit( 'No direct script access allowed' ); |
|
| 23 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 24 | + exit('No direct script access allowed'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @throws BatchRequestException |
| 36 | 36 | * @return JobStepResponse |
| 37 | 37 | */ |
| 38 | - public function create_job( JobParameters $job_parameters ); |
|
| 38 | + public function create_job(JobParameters $job_parameters); |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Performs another step of the job |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @return JobStepResponse |
| 45 | 45 | * @throws BatchRequestException |
| 46 | 46 | */ |
| 47 | - public function continue_job( JobParameters $job_parameters, $batch_size = 50 ); |
|
| 47 | + public function continue_job(JobParameters $job_parameters, $batch_size = 50); |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Performs any clean-up logic when we know the job is completed |
@@ -52,5 +52,5 @@ discard block |
||
| 52 | 52 | * @return JobStepResponse |
| 53 | 53 | * @throws BatchRequestException |
| 54 | 54 | */ |
| 55 | - public function cleanup_job( JobParameters $job_parameters ); |
|
| 55 | + public function cleanup_job(JobParameters $job_parameters); |
|
| 56 | 56 | } |
@@ -5,25 +5,25 @@ |
||
| 5 | 5 | <table class="admin-primary-mbox-tbl"> |
| 6 | 6 | <thead> |
| 7 | 7 | <tr> |
| 8 | - <th class="jst-left"><?php _e( '#', 'event_espresso' );?></th> |
|
| 9 | - <th class="jst-left"><?php _e( 'Event Name and Ticket', 'event_espresso' );?></th> |
|
| 10 | - <th class="jst-left"><?php _e( 'Registrant', 'event_espresso' );?></th> |
|
| 11 | - <th class="jst-left"><?php _e( 'Ticket Price', 'event_espresso' );?></th> |
|
| 12 | - <th class="jst-left"><?php _e( 'Email', 'event_espresso' );?></th> |
|
| 13 | - <th class="jst-left"><?php _e( 'Address', 'event_espresso' );?></th> |
|
| 8 | + <th class="jst-left"><?php _e('#', 'event_espresso'); ?></th> |
|
| 9 | + <th class="jst-left"><?php _e('Event Name and Ticket', 'event_espresso'); ?></th> |
|
| 10 | + <th class="jst-left"><?php _e('Registrant', 'event_espresso'); ?></th> |
|
| 11 | + <th class="jst-left"><?php _e('Ticket Price', 'event_espresso'); ?></th> |
|
| 12 | + <th class="jst-left"><?php _e('Email', 'event_espresso'); ?></th> |
|
| 13 | + <th class="jst-left"><?php _e('Address', 'event_espresso'); ?></th> |
|
| 14 | 14 | </tr> |
| 15 | 15 | </thead> |
| 16 | 16 | <tbody> |
| 17 | - <?php if ( isset( $event_attendees ) && is_array( $event_attendees )) : ?> |
|
| 18 | - <?php foreach ( $event_attendees as $registration => $attendee ) : ?> |
|
| 17 | + <?php if (isset($event_attendees) && is_array($event_attendees)) : ?> |
|
| 18 | + <?php foreach ($event_attendees as $registration => $attendee) : ?> |
|
| 19 | 19 | <tr> |
| 20 | - <td class="jst-left"><?php echo $attendee['att_num'];?></td> |
|
| 21 | - <td class="jst-left"><?php echo $attendee['event_ticket_name'];?></td> |
|
| 20 | + <td class="jst-left"><?php echo $attendee['att_num']; ?></td> |
|
| 21 | + <td class="jst-left"><?php echo $attendee['event_ticket_name']; ?></td> |
|
| 22 | 22 | <td class="jst-left"> |
| 23 | 23 | <?php |
| 24 | - $att_link = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration), REG_ADMIN_URL ); |
|
| 24 | + $att_link = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration), REG_ADMIN_URL); |
|
| 25 | 25 | ?> |
| 26 | - <a href="<?php echo $att_link; ?>" title="<?php _e( 'View details for this registrant', 'event_espresso' );?>"> |
|
| 26 | + <a href="<?php echo $att_link; ?>" title="<?php _e('View details for this registrant', 'event_espresso'); ?>"> |
|
| 27 | 27 | <?php echo $attendee['attendee']?> |
| 28 | 28 | </a> |
| 29 | 29 | </td> |
@@ -649,8 +649,9 @@ |
||
| 649 | 649 | * @return EE_Registration |
| 650 | 650 | */ |
| 651 | 651 | public function get_primary_registration() { |
| 652 | - if ( $this->is_primary_registrant() ) |
|
| 653 | - return $this; |
|
| 652 | + if ( $this->is_primary_registrant() ) { |
|
| 653 | + return $this; |
|
| 654 | + } |
|
| 654 | 655 | |
| 655 | 656 | //k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1 |
| 656 | 657 | $primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) ); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * |
| 105 | 105 | * @param string $new_STS_ID |
| 106 | 106 | * @param boolean $use_default |
| 107 | - * @return bool |
|
| 107 | + * @return null|boolean |
|
| 108 | 108 | * @throws \EE_Error |
| 109 | 109 | */ |
| 110 | 110 | public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) { |
@@ -924,7 +924,7 @@ discard block |
||
| 924 | 924 | /** |
| 925 | 925 | * Sets deleted |
| 926 | 926 | * @param boolean $deleted |
| 927 | - * @return boolean |
|
| 927 | + * @return boolean|null |
|
| 928 | 928 | */ |
| 929 | 929 | public function set_deleted($deleted) { |
| 930 | 930 | $this->set( 'REG_deleted', $deleted ); |
@@ -968,6 +968,7 @@ discard block |
||
| 968 | 968 | * |
| 969 | 969 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
| 970 | 970 | * @param bool $check_approved This is used to indicate whether the caller wants can_checkin to also consider registration status as well as datetime access. |
| 971 | + * @param integer $DTT_OR_ID |
|
| 971 | 972 | * |
| 972 | 973 | * @return bool |
| 973 | 974 | */ |
@@ -1106,7 +1107,7 @@ discard block |
||
| 1106 | 1107 | * Returns the latest datetime related to this registration (via the ticket attached to the registration). |
| 1107 | 1108 | * "Latest" is defined by the `DTT_EVT_start` column. |
| 1108 | 1109 | * |
| 1109 | - * @return EE_Datetime|null |
|
| 1110 | + * @return null|EE_Base_Class |
|
| 1110 | 1111 | * @throws \EE_Error |
| 1111 | 1112 | */ |
| 1112 | 1113 | public function get_latest_related_datetime() { |
@@ -1377,7 +1378,7 @@ discard block |
||
| 1377 | 1378 | * This grabs the payment method corresponding to the last payment made for the amount owing on the registration. |
| 1378 | 1379 | * Note: if there are no payments on the registration there will be no payment method returned. |
| 1379 | 1380 | * |
| 1380 | - * @return EE_Payment_Method|null |
|
| 1381 | + * @return null|EE_Base_Class |
|
| 1381 | 1382 | */ |
| 1382 | 1383 | public function payment_method() { |
| 1383 | 1384 | return EEM_Payment_Method::instance()->get_last_used_for_registration( $this ); |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | ) { |
| 120 | 120 | // TO approved |
| 121 | 121 | if ( $new_STS_ID === EEM_Registration::status_id_approved ) { |
| 122 | - \EEH_Debug_Tools::printr(__FUNCTION__, 'BEFORE HOOK ' . __CLASS__, __FILE__, __LINE__, 2); |
|
| 123 | - // reserve a space by incrementing ticket and datetime sold values |
|
| 122 | + \EEH_Debug_Tools::printr(__FUNCTION__, 'BEFORE HOOK ' . __CLASS__, __FILE__, __LINE__, 2); |
|
| 123 | + // reserve a space by incrementing ticket and datetime sold values |
|
| 124 | 124 | $this->_reserve_registration_space(); |
| 125 | 125 | do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID ); |
| 126 | - \EEH_Debug_Tools::printr(__FUNCTION__, 'AFTER HOOK ' . __CLASS__, __FILE__, __LINE__, 2); |
|
| 126 | + \EEH_Debug_Tools::printr(__FUNCTION__, 'AFTER HOOK ' . __CLASS__, __FILE__, __LINE__, 2); |
|
| 127 | 127 | exit(); |
| 128 | 128 | // OR FROM approved |
| 129 | 129 | } else if ( $old_STS_ID === EEM_Registration::status_id_approved ) { |
@@ -648,9 +648,9 @@ discard block |
||
| 648 | 648 | |
| 649 | 649 | |
| 650 | 650 | /** |
| 651 | - * get Attendee Number |
|
| 652 | - * @access public |
|
| 653 | - */ |
|
| 651 | + * get Attendee Number |
|
| 652 | + * @access public |
|
| 653 | + */ |
|
| 654 | 654 | public function count() { |
| 655 | 655 | return $this->get( 'REG_count' ); |
| 656 | 656 | } |
@@ -1032,20 +1032,20 @@ discard block |
||
| 1032 | 1032 | |
| 1033 | 1033 | |
| 1034 | 1034 | |
| 1035 | - /** |
|
| 1036 | - * toggle Check-in status for this registration |
|
| 1037 | - * Check-ins are toggled in the following order: |
|
| 1038 | - * never checked in -> checked in |
|
| 1039 | - * checked in -> checked out |
|
| 1040 | - * checked out -> checked in |
|
| 1041 | - * |
|
| 1042 | - * @param int $DTT_ID include specific datetime to toggle Check-in for. |
|
| 1043 | - * If not included or null, then it is assumed latest datetime is being toggled. |
|
| 1044 | - * @param bool $verify If true then can_checkin() is used to verify whether the person |
|
| 1045 | - * can be checked in or not. Otherwise this forces change in checkin status. |
|
| 1046 | - * @return bool|int the chk_in status toggled to OR false if nothing got changed. |
|
| 1047 | - * @throws EE_Error |
|
| 1048 | - */ |
|
| 1035 | + /** |
|
| 1036 | + * toggle Check-in status for this registration |
|
| 1037 | + * Check-ins are toggled in the following order: |
|
| 1038 | + * never checked in -> checked in |
|
| 1039 | + * checked in -> checked out |
|
| 1040 | + * checked out -> checked in |
|
| 1041 | + * |
|
| 1042 | + * @param int $DTT_ID include specific datetime to toggle Check-in for. |
|
| 1043 | + * If not included or null, then it is assumed latest datetime is being toggled. |
|
| 1044 | + * @param bool $verify If true then can_checkin() is used to verify whether the person |
|
| 1045 | + * can be checked in or not. Otherwise this forces change in checkin status. |
|
| 1046 | + * @return bool|int the chk_in status toggled to OR false if nothing got changed. |
|
| 1047 | + * @throws EE_Error |
|
| 1048 | + */ |
|
| 1049 | 1049 | public function toggle_checkin_status( $DTT_ID = null, $verify = false ) { |
| 1050 | 1050 | if ( empty( $DTT_ID ) ) { |
| 1051 | 1051 | $datetime = $this->get_latest_related_datetime(); |
@@ -1102,13 +1102,13 @@ discard block |
||
| 1102 | 1102 | |
| 1103 | 1103 | |
| 1104 | 1104 | |
| 1105 | - /** |
|
| 1106 | - * Returns the latest datetime related to this registration (via the ticket attached to the registration). |
|
| 1107 | - * "Latest" is defined by the `DTT_EVT_start` column. |
|
| 1108 | - * |
|
| 1109 | - * @return EE_Datetime|null |
|
| 1110 | - * @throws \EE_Error |
|
| 1111 | - */ |
|
| 1105 | + /** |
|
| 1106 | + * Returns the latest datetime related to this registration (via the ticket attached to the registration). |
|
| 1107 | + * "Latest" is defined by the `DTT_EVT_start` column. |
|
| 1108 | + * |
|
| 1109 | + * @return EE_Datetime|null |
|
| 1110 | + * @throws \EE_Error |
|
| 1111 | + */ |
|
| 1112 | 1112 | public function get_latest_related_datetime() { |
| 1113 | 1113 | return EEM_Datetime::instance()->get_one( |
| 1114 | 1114 | array( |
@@ -1122,12 +1122,12 @@ discard block |
||
| 1122 | 1122 | |
| 1123 | 1123 | |
| 1124 | 1124 | |
| 1125 | - /** |
|
| 1126 | - * Returns the earliest datetime related to this registration (via the ticket attached to the registration). |
|
| 1127 | - * "Earliest" is defined by the `DTT_EVT_start` column. |
|
| 1128 | - * |
|
| 1129 | - * @throws \EE_Error |
|
| 1130 | - */ |
|
| 1125 | + /** |
|
| 1126 | + * Returns the earliest datetime related to this registration (via the ticket attached to the registration). |
|
| 1127 | + * "Earliest" is defined by the `DTT_EVT_start` column. |
|
| 1128 | + * |
|
| 1129 | + * @throws \EE_Error |
|
| 1130 | + */ |
|
| 1131 | 1131 | public function get_earliest_related_datetime() { |
| 1132 | 1132 | return EEM_Datetime::instance()->get_one( |
| 1133 | 1133 | array( |
@@ -1141,18 +1141,18 @@ discard block |
||
| 1141 | 1141 | |
| 1142 | 1142 | |
| 1143 | 1143 | |
| 1144 | - /** |
|
| 1145 | - * This method simply returns the check-in status for this registration and the given datetime. |
|
| 1146 | - * If neither the datetime nor the checkin values are provided as arguments, |
|
| 1147 | - * then this will return the LATEST check-in status for the registration across all datetimes it belongs to. |
|
| 1148 | - * |
|
| 1149 | - * @param int $DTT_ID The ID of the datetime we're checking against |
|
| 1150 | - * (if empty we'll get the primary datetime for |
|
| 1151 | - * this registration (via event) and use it's ID); |
|
| 1152 | - * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id. |
|
| 1153 | - * @return int Integer representing Check-in status. |
|
| 1154 | - * @throws \EE_Error |
|
| 1155 | - */ |
|
| 1144 | + /** |
|
| 1145 | + * This method simply returns the check-in status for this registration and the given datetime. |
|
| 1146 | + * If neither the datetime nor the checkin values are provided as arguments, |
|
| 1147 | + * then this will return the LATEST check-in status for the registration across all datetimes it belongs to. |
|
| 1148 | + * |
|
| 1149 | + * @param int $DTT_ID The ID of the datetime we're checking against |
|
| 1150 | + * (if empty we'll get the primary datetime for |
|
| 1151 | + * this registration (via event) and use it's ID); |
|
| 1152 | + * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id. |
|
| 1153 | + * @return int Integer representing Check-in status. |
|
| 1154 | + * @throws \EE_Error |
|
| 1155 | + */ |
|
| 1156 | 1156 | public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = null ) { |
| 1157 | 1157 | $checkin_query_params = array( |
| 1158 | 1158 | 'order_by' => array( 'CHK_timestamp' => 'DESC' ) |
@@ -1164,8 +1164,8 @@ discard block |
||
| 1164 | 1164 | |
| 1165 | 1165 | //get checkin object (if exists) |
| 1166 | 1166 | $checkin = $checkin instanceof EE_Checkin |
| 1167 | - ? $checkin |
|
| 1168 | - : $this->get_first_related( 'Checkin', $checkin_query_params ); |
|
| 1167 | + ? $checkin |
|
| 1168 | + : $this->get_first_related( 'Checkin', $checkin_query_params ); |
|
| 1169 | 1169 | if ( $checkin instanceof EE_Checkin ) { |
| 1170 | 1170 | if ( $checkin->get( 'CHK_in' ) ) { |
| 1171 | 1171 | return EE_Registration::checkin_status_in; //checked in |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | |
| 1419 | 1419 | |
| 1420 | 1420 | |
| 1421 | - /*************************** DEPRECATED ***************************/ |
|
| 1421 | + /*************************** DEPRECATED ***************************/ |
|
| 1422 | 1422 | |
| 1423 | 1423 | |
| 1424 | 1424 | |
@@ -1468,24 +1468,24 @@ discard block |
||
| 1468 | 1468 | |
| 1469 | 1469 | |
| 1470 | 1470 | |
| 1471 | - /** |
|
| 1472 | - * Gets the primary datetime related to this registration via the related Event to this registration |
|
| 1473 | - * |
|
| 1474 | - * @deprecated 4.9.17 |
|
| 1475 | - * @return EE_Datetime |
|
| 1476 | - */ |
|
| 1477 | - public function get_related_primary_datetime() { |
|
| 1478 | - EE_Error::doing_it_wrong( |
|
| 1479 | - __METHOD__, |
|
| 1480 | - esc_html__( |
|
| 1481 | - 'Use EE_Registration::get_latest_related_datetime() or EE_Registration::get_earliest_related_datetime()', |
|
| 1482 | - 'event_espresso' |
|
| 1483 | - ), |
|
| 1484 | - '4.9.17', |
|
| 1485 | - '5.0.0' |
|
| 1486 | - ); |
|
| 1487 | - return $this->event()->primary_datetime(); |
|
| 1488 | - } |
|
| 1471 | + /** |
|
| 1472 | + * Gets the primary datetime related to this registration via the related Event to this registration |
|
| 1473 | + * |
|
| 1474 | + * @deprecated 4.9.17 |
|
| 1475 | + * @return EE_Datetime |
|
| 1476 | + */ |
|
| 1477 | + public function get_related_primary_datetime() { |
|
| 1478 | + EE_Error::doing_it_wrong( |
|
| 1479 | + __METHOD__, |
|
| 1480 | + esc_html__( |
|
| 1481 | + 'Use EE_Registration::get_latest_related_datetime() or EE_Registration::get_earliest_related_datetime()', |
|
| 1482 | + 'event_espresso' |
|
| 1483 | + ), |
|
| 1484 | + '4.9.17', |
|
| 1485 | + '5.0.0' |
|
| 1486 | + ); |
|
| 1487 | + return $this->event()->primary_datetime(); |
|
| 1488 | + } |
|
| 1489 | 1489 | |
| 1490 | 1490 | |
| 1491 | 1491 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php use EventEspresso\core\exceptions\EntityNotFoundException; |
| 2 | 2 | |
| 3 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 4 | - exit( 'No direct script access allowed' ); |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 4 | + exit('No direct script access allowed'); |
|
| 5 | 5 | } |
| 6 | 6 | /** |
| 7 | 7 | * EE_Registration class |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * date_format and the second value is the time format |
| 44 | 44 | * @return EE_Registration |
| 45 | 45 | */ |
| 46 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
| 47 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
| 48 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
| 46 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
| 47 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
| 48 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | * the website will be used. |
| 57 | 57 | * @return EE_Registration |
| 58 | 58 | */ |
| 59 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
| 60 | - return new self( $props_n_values, TRUE, $timezone ); |
|
| 59 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
| 60 | + return new self($props_n_values, TRUE, $timezone); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @param int $EVT_ID Event ID |
| 69 | 69 | */ |
| 70 | - public function set_event( $EVT_ID = 0 ) { |
|
| 71 | - $this->set( 'EVT_ID', $EVT_ID ); |
|
| 70 | + public function set_event($EVT_ID = 0) { |
|
| 71 | + $this->set('EVT_ID', $EVT_ID); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -79,18 +79,18 @@ discard block |
||
| 79 | 79 | * @param mixed $field_value |
| 80 | 80 | * @param bool $use_default |
| 81 | 81 | */ |
| 82 | - public function set( $field_name, $field_value, $use_default = FALSE ) { |
|
| 83 | - switch( $field_name ) { |
|
| 82 | + public function set($field_name, $field_value, $use_default = FALSE) { |
|
| 83 | + switch ($field_name) { |
|
| 84 | 84 | case 'REG_code' : |
| 85 | - if ( ! empty( $field_value ) && $this->reg_code() == '' ) { |
|
| 86 | - $this->set_reg_code( $field_value, $use_default ); |
|
| 85 | + if ( ! empty($field_value) && $this->reg_code() == '') { |
|
| 86 | + $this->set_reg_code($field_value, $use_default); |
|
| 87 | 87 | } |
| 88 | 88 | break; |
| 89 | 89 | case 'STS_ID' : |
| 90 | - $this->set_status( $field_value, $use_default ); |
|
| 90 | + $this->set_status($field_value, $use_default); |
|
| 91 | 91 | break; |
| 92 | 92 | default : |
| 93 | - parent::set( $field_name, $field_value, $use_default ); |
|
| 93 | + parent::set($field_name, $field_value, $use_default); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
@@ -107,45 +107,45 @@ discard block |
||
| 107 | 107 | * @return bool |
| 108 | 108 | * @throws \EE_Error |
| 109 | 109 | */ |
| 110 | - public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) { |
|
| 110 | + public function set_status($new_STS_ID = NULL, $use_default = FALSE) { |
|
| 111 | 111 | // get current REG_Status |
| 112 | 112 | $old_STS_ID = $this->status_ID(); |
| 113 | 113 | // if status has changed |
| 114 | 114 | if ( |
| 115 | 115 | $this->ID() // ensure registration is in the db |
| 116 | 116 | && $old_STS_ID != $new_STS_ID // and that status has actually changed |
| 117 | - && ! empty( $old_STS_ID ) // and that old status is actually set |
|
| 118 | - && ! empty( $new_STS_ID ) // as well as the new status |
|
| 117 | + && ! empty($old_STS_ID) // and that old status is actually set |
|
| 118 | + && ! empty($new_STS_ID) // as well as the new status |
|
| 119 | 119 | ) { |
| 120 | 120 | // TO approved |
| 121 | - if ( $new_STS_ID === EEM_Registration::status_id_approved ) { |
|
| 122 | - \EEH_Debug_Tools::printr(__FUNCTION__, 'BEFORE HOOK ' . __CLASS__, __FILE__, __LINE__, 2); |
|
| 121 | + if ($new_STS_ID === EEM_Registration::status_id_approved) { |
|
| 122 | + \EEH_Debug_Tools::printr(__FUNCTION__, 'BEFORE HOOK '.__CLASS__, __FILE__, __LINE__, 2); |
|
| 123 | 123 | // reserve a space by incrementing ticket and datetime sold values |
| 124 | 124 | $this->_reserve_registration_space(); |
| 125 | - do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
| 126 | - \EEH_Debug_Tools::printr(__FUNCTION__, 'AFTER HOOK ' . __CLASS__, __FILE__, __LINE__, 2); |
|
| 125 | + do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID); |
|
| 126 | + \EEH_Debug_Tools::printr(__FUNCTION__, 'AFTER HOOK '.__CLASS__, __FILE__, __LINE__, 2); |
|
| 127 | 127 | exit(); |
| 128 | 128 | // OR FROM approved |
| 129 | - } else if ( $old_STS_ID === EEM_Registration::status_id_approved ) { |
|
| 129 | + } else if ($old_STS_ID === EEM_Registration::status_id_approved) { |
|
| 130 | 130 | // release a space by decrementing ticket and datetime sold values |
| 131 | 131 | $this->_release_registration_space(); |
| 132 | - do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID ); |
|
| 132 | + do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID); |
|
| 133 | 133 | } |
| 134 | 134 | // update status |
| 135 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
| 135 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
| 136 | 136 | /** @type EE_Registration_Processor $registration_processor */ |
| 137 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
| 137 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
| 138 | 138 | /** @type EE_Transaction_Processor $transaction_processor */ |
| 139 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
| 139 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
| 140 | 140 | /** @type EE_Transaction_Payments $transaction_payments */ |
| 141 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
| 141 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
| 142 | 142 | // these reg statuses should not be considered in any calculations involving monies owing |
| 143 | - $closed_reg_statuses = ! empty( $closed_reg_statuses ) |
|
| 143 | + $closed_reg_statuses = ! empty($closed_reg_statuses) |
|
| 144 | 144 | ? $closed_reg_statuses |
| 145 | 145 | : EEM_Registration::closed_reg_statuses(); |
| 146 | 146 | if ( |
| 147 | - in_array( $new_STS_ID, $closed_reg_statuses ) |
|
| 148 | - && ! in_array( $old_STS_ID, $closed_reg_statuses ) |
|
| 147 | + in_array($new_STS_ID, $closed_reg_statuses) |
|
| 148 | + && ! in_array($old_STS_ID, $closed_reg_statuses) |
|
| 149 | 149 | ) { |
| 150 | 150 | // cancelled or declined registration |
| 151 | 151 | $registration_processor->update_registration_after_being_canceled_or_declined( |
@@ -158,24 +158,24 @@ discard block |
||
| 158 | 158 | false |
| 159 | 159 | ); |
| 160 | 160 | } else if ( |
| 161 | - in_array( $old_STS_ID, $closed_reg_statuses ) |
|
| 162 | - && ! in_array( $new_STS_ID, $closed_reg_statuses ) |
|
| 161 | + in_array($old_STS_ID, $closed_reg_statuses) |
|
| 162 | + && ! in_array($new_STS_ID, $closed_reg_statuses) |
|
| 163 | 163 | ) { |
| 164 | 164 | // reinstating cancelled or declined registration |
| 165 | 165 | $registration_processor->update_canceled_or_declined_registration_after_being_reinstated( |
| 166 | 166 | $this, |
| 167 | 167 | $closed_reg_statuses |
| 168 | 168 | ); |
| 169 | - $transaction_processor->update_transaction_after_reinstating_canceled_registration( $this ); |
|
| 169 | + $transaction_processor->update_transaction_after_reinstating_canceled_registration($this); |
|
| 170 | 170 | } |
| 171 | - $transaction_payments->recalculate_transaction_total( $this->transaction(), false ); |
|
| 172 | - $this->transaction()->update_status_based_on_total_paid( true ); |
|
| 173 | - do_action( 'AHEE__EE_Registration__set_status__after_update', $this ); |
|
| 171 | + $transaction_payments->recalculate_transaction_total($this->transaction(), false); |
|
| 172 | + $this->transaction()->update_status_based_on_total_paid(true); |
|
| 173 | + do_action('AHEE__EE_Registration__set_status__after_update', $this); |
|
| 174 | 174 | return TRUE; |
| 175 | 175 | } else { |
| 176 | 176 | //even though the old value matches the new value, it's still good to |
| 177 | 177 | //allow the parent set method to have a say |
| 178 | - parent::set( 'STS_ID', $new_STS_ID, $use_default ); |
|
| 178 | + parent::set('STS_ID', $new_STS_ID, $use_default); |
|
| 179 | 179 | return TRUE; |
| 180 | 180 | } |
| 181 | 181 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * get Status ID |
| 187 | 187 | */ |
| 188 | 188 | public function status_ID() { |
| 189 | - return $this->get( 'STS_ID' ); |
|
| 189 | + return $this->get('STS_ID'); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
@@ -211,12 +211,12 @@ discard block |
||
| 211 | 211 | * @param boolean $include_archived whether to include archived tickets or not. |
| 212 | 212 | * @return EE_Ticket |
| 213 | 213 | */ |
| 214 | - public function ticket( $include_archived = TRUE ) { |
|
| 214 | + public function ticket($include_archived = TRUE) { |
|
| 215 | 215 | $query_params = array(); |
| 216 | - if ( $include_archived ) { |
|
| 217 | - $query_params[ 'default_where_conditions' ] = 'none'; |
|
| 216 | + if ($include_archived) { |
|
| 217 | + $query_params['default_where_conditions'] = 'none'; |
|
| 218 | 218 | } |
| 219 | - return $this->get_first_related( 'Ticket', $query_params ); |
|
| 219 | + return $this->get_first_related('Ticket', $query_params); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | public function wp_user() { |
| 246 | 246 | $event = $this->event(); |
| 247 | - if ( $event instanceof EE_Event ) { |
|
| 247 | + if ($event instanceof EE_Event) { |
|
| 248 | 248 | return $event->wp_user(); |
| 249 | 249 | } |
| 250 | 250 | return 0; |
@@ -269,8 +269,8 @@ discard block |
||
| 269 | 269 | * |
| 270 | 270 | * @param int $ATT_ID Attendee ID |
| 271 | 271 | */ |
| 272 | - public function set_attendee_id( $ATT_ID = 0 ) { |
|
| 273 | - $this->set( 'ATT_ID', $ATT_ID ); |
|
| 272 | + public function set_attendee_id($ATT_ID = 0) { |
|
| 273 | + $this->set('ATT_ID', $ATT_ID); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
@@ -280,8 +280,8 @@ discard block |
||
| 280 | 280 | * |
| 281 | 281 | * @param int $TXN_ID Transaction ID |
| 282 | 282 | */ |
| 283 | - public function set_transaction_id( $TXN_ID = 0 ) { |
|
| 284 | - $this->set( 'TXN_ID', $TXN_ID ); |
|
| 283 | + public function set_transaction_id($TXN_ID = 0) { |
|
| 284 | + $this->set('TXN_ID', $TXN_ID); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | * |
| 292 | 292 | * @param string $REG_session PHP Session ID |
| 293 | 293 | */ |
| 294 | - public function set_session( $REG_session = '' ) { |
|
| 295 | - $this->set( 'REG_session', $REG_session ); |
|
| 294 | + public function set_session($REG_session = '') { |
|
| 295 | + $this->set('REG_session', $REG_session); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | |
@@ -302,8 +302,8 @@ discard block |
||
| 302 | 302 | * |
| 303 | 303 | * @param string $REG_url_link Registration URL Link |
| 304 | 304 | */ |
| 305 | - public function set_reg_url_link( $REG_url_link = '' ) { |
|
| 306 | - $this->set( 'REG_url_link', $REG_url_link ); |
|
| 305 | + public function set_reg_url_link($REG_url_link = '') { |
|
| 306 | + $this->set('REG_url_link', $REG_url_link); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | |
@@ -313,8 +313,8 @@ discard block |
||
| 313 | 313 | * |
| 314 | 314 | * @param int $REG_count Primary Attendee |
| 315 | 315 | */ |
| 316 | - public function set_count( $REG_count = 1 ) { |
|
| 317 | - $this->set( 'REG_count', $REG_count ); |
|
| 316 | + public function set_count($REG_count = 1) { |
|
| 317 | + $this->set('REG_count', $REG_count); |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | |
@@ -324,8 +324,8 @@ discard block |
||
| 324 | 324 | * |
| 325 | 325 | * @param boolean $REG_group_size Group Registration |
| 326 | 326 | */ |
| 327 | - public function set_group_size( $REG_group_size = FALSE ) { |
|
| 328 | - $this->set( 'REG_group_size', $REG_group_size ); |
|
| 327 | + public function set_group_size($REG_group_size = FALSE) { |
|
| 328 | + $this->set('REG_group_size', $REG_group_size); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | * |
| 402 | 402 | * @param mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date |
| 403 | 403 | */ |
| 404 | - public function set_reg_date( $REG_date = FALSE ) { |
|
| 405 | - $this->set( 'REG_date', $REG_date ); |
|
| 404 | + public function set_reg_date($REG_date = FALSE) { |
|
| 405 | + $this->set('REG_date', $REG_date); |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | |
@@ -413,8 +413,8 @@ discard block |
||
| 413 | 413 | * @access public |
| 414 | 414 | * @param float $REG_final_price |
| 415 | 415 | */ |
| 416 | - public function set_final_price( $REG_final_price = 0.00 ) { |
|
| 417 | - $this->set( 'REG_final_price', $REG_final_price ); |
|
| 416 | + public function set_final_price($REG_final_price = 0.00) { |
|
| 417 | + $this->set('REG_final_price', $REG_final_price); |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | |
@@ -425,8 +425,8 @@ discard block |
||
| 425 | 425 | * @access public |
| 426 | 426 | * @param float $REG_paid |
| 427 | 427 | */ |
| 428 | - public function set_paid( $REG_paid = 0.00 ) { |
|
| 429 | - $this->set( 'REG_paid', $REG_paid ); |
|
| 428 | + public function set_paid($REG_paid = 0.00) { |
|
| 429 | + $this->set('REG_paid', $REG_paid); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | * |
| 437 | 437 | * @param boolean $REG_att_is_going Attendee Is Going |
| 438 | 438 | */ |
| 439 | - public function set_att_is_going( $REG_att_is_going = FALSE ) { |
|
| 440 | - $this->set( 'REG_att_is_going', $REG_att_is_going ); |
|
| 439 | + public function set_att_is_going($REG_att_is_going = FALSE) { |
|
| 440 | + $this->set('REG_att_is_going', $REG_att_is_going); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | * @return EE_Attendee |
| 448 | 448 | */ |
| 449 | 449 | public function attendee() { |
| 450 | - return $this->get_first_related( 'Attendee' ); |
|
| 450 | + return $this->get_first_related('Attendee'); |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | * get Event ID |
| 457 | 457 | */ |
| 458 | 458 | public function event_ID() { |
| 459 | - return $this->get( 'EVT_ID' ); |
|
| 459 | + return $this->get('EVT_ID'); |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | */ |
| 467 | 467 | public function event_name() { |
| 468 | 468 | $event = $this->event_obj(); |
| 469 | - if ( $event ) { |
|
| 469 | + if ($event) { |
|
| 470 | 470 | return $event->name(); |
| 471 | 471 | } else { |
| 472 | 472 | return NULL; |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | * @return EE_Event |
| 481 | 481 | */ |
| 482 | 482 | public function event_obj() { |
| 483 | - return $this->get_first_related( 'Event' ); |
|
| 483 | + return $this->get_first_related('Event'); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | * get Attendee ID |
| 490 | 490 | */ |
| 491 | 491 | public function attendee_ID() { |
| 492 | - return $this->get( 'ATT_ID' ); |
|
| 492 | + return $this->get('ATT_ID'); |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | * get PHP Session ID |
| 499 | 499 | */ |
| 500 | 500 | public function session_ID() { |
| 501 | - return $this->get( 'REG_session' ); |
|
| 501 | + return $this->get('REG_session'); |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
| 509 | 509 | * @return string |
| 510 | 510 | */ |
| 511 | - public function receipt_url( $messenger = 'html' ) { |
|
| 511 | + public function receipt_url($messenger = 'html') { |
|
| 512 | 512 | |
| 513 | 513 | /** |
| 514 | 514 | * The below will be deprecated one version after this. We check first if there is a custom receipt template already in use on old system. If there is then we just return the standard url for it. |
@@ -516,12 +516,12 @@ discard block |
||
| 516 | 516 | * @since 4.5.0 |
| 517 | 517 | */ |
| 518 | 518 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php'; |
| 519 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
| 519 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
| 520 | 520 | |
| 521 | - if ( $has_custom ) { |
|
| 522 | - return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) ); |
|
| 521 | + if ($has_custom) { |
|
| 522 | + return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch')); |
|
| 523 | 523 | } |
| 524 | - return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' ); |
|
| 524 | + return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt'); |
|
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | |
@@ -532,28 +532,28 @@ discard block |
||
| 532 | 532 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
| 533 | 533 | * @return string |
| 534 | 534 | */ |
| 535 | - public function invoice_url( $messenger = 'html' ) { |
|
| 535 | + public function invoice_url($messenger = 'html') { |
|
| 536 | 536 | /** |
| 537 | 537 | * The below will be deprecated one version after this. We check first if there is a custom invoice template already in use on old system. If there is then we just return the standard url for it. |
| 538 | 538 | * |
| 539 | 539 | * @since 4.5.0 |
| 540 | 540 | */ |
| 541 | 541 | $template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php'; |
| 542 | - $has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE ); |
|
| 542 | + $has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE); |
|
| 543 | 543 | |
| 544 | - if ( $has_custom ) { |
|
| 545 | - if ( $messenger == 'html' ) { |
|
| 546 | - return $this->invoice_url( 'launch' ); |
|
| 544 | + if ($has_custom) { |
|
| 545 | + if ($messenger == 'html') { |
|
| 546 | + return $this->invoice_url('launch'); |
|
| 547 | 547 | } |
| 548 | 548 | $route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice'; |
| 549 | 549 | |
| 550 | - $query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() ); |
|
| 551 | - if ( $messenger == 'html' ) { |
|
| 550 | + $query_args = array('ee' => $route, 'id' => $this->reg_url_link()); |
|
| 551 | + if ($messenger == 'html') { |
|
| 552 | 552 | $query_args['html'] = TRUE; |
| 553 | 553 | } |
| 554 | - return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) ); |
|
| 554 | + return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id)); |
|
| 555 | 555 | } |
| 556 | - return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' ); |
|
| 556 | + return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice'); |
|
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | * @throws \EE_Error |
| 567 | 567 | */ |
| 568 | 568 | public function reg_url_link() { |
| 569 | - return (string)$this->get( 'REG_url_link' ); |
|
| 569 | + return (string) $this->get('REG_url_link'); |
|
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | |
@@ -576,8 +576,8 @@ discard block |
||
| 576 | 576 | * @param string $type 'download','launch', or 'html' (default is 'launch') |
| 577 | 577 | * @return void |
| 578 | 578 | */ |
| 579 | - public function e_invoice_url( $type = 'launch' ) { |
|
| 580 | - echo $this->invoice_url( $type ); |
|
| 579 | + public function e_invoice_url($type = 'launch') { |
|
| 580 | + echo $this->invoice_url($type); |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | * @return string |
| 598 | 598 | */ |
| 599 | 599 | public function payment_overview_url() { |
| 600 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() ); |
|
| 600 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url()); |
|
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | * @return string |
| 609 | 609 | */ |
| 610 | 610 | public function edit_attendee_information_url() { |
| 611 | - return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() ); |
|
| 611 | + return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url()); |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | * @return string |
| 619 | 619 | */ |
| 620 | 620 | public function get_admin_edit_url() { |
| 621 | - return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) ); |
|
| 621 | + return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php')); |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | * is_primary_registrant? |
| 628 | 628 | */ |
| 629 | 629 | public function is_primary_registrant() { |
| 630 | - return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE; |
|
| 630 | + return $this->get('REG_count') == 1 ? TRUE : FALSE; |
|
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | |
@@ -636,12 +636,12 @@ discard block |
||
| 636 | 636 | * This returns the primary registration object for this registration group (which may be this object). |
| 637 | 637 | * @return EE_Registration |
| 638 | 638 | */ |
| 639 | - public function get_primary_registration() { |
|
| 640 | - if ( $this->is_primary_registrant() ) |
|
| 639 | + public function get_primary_registration() { |
|
| 640 | + if ($this->is_primary_registrant()) |
|
| 641 | 641 | return $this; |
| 642 | 642 | |
| 643 | 643 | //k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1 |
| 644 | - $primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) ); |
|
| 644 | + $primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1))); |
|
| 645 | 645 | return $primary_registrant; |
| 646 | 646 | } |
| 647 | 647 | |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | * @access public |
| 653 | 653 | */ |
| 654 | 654 | public function count() { |
| 655 | - return $this->get( 'REG_count' ); |
|
| 655 | + return $this->get('REG_count'); |
|
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | * get Group Size |
| 662 | 662 | */ |
| 663 | 663 | public function group_size() { |
| 664 | - return $this->get( 'REG_group_size' ); |
|
| 664 | + return $this->get('REG_group_size'); |
|
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | * get Registration Date |
| 671 | 671 | */ |
| 672 | 672 | public function date() { |
| 673 | - return $this->get( 'REG_date' ); |
|
| 673 | + return $this->get('REG_date'); |
|
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | |
@@ -681,8 +681,8 @@ discard block |
||
| 681 | 681 | * @param string $time_format |
| 682 | 682 | * @return string |
| 683 | 683 | */ |
| 684 | - public function pretty_date( $date_format = NULL, $time_format = NULL ) { |
|
| 685 | - return $this->get_datetime( 'REG_date', $date_format, $time_format ); |
|
| 684 | + public function pretty_date($date_format = NULL, $time_format = NULL) { |
|
| 685 | + return $this->get_datetime('REG_date', $date_format, $time_format); |
|
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | * @return float |
| 695 | 695 | */ |
| 696 | 696 | public function final_price() { |
| 697 | - return $this->get( 'REG_final_price' ); |
|
| 697 | + return $this->get('REG_final_price'); |
|
| 698 | 698 | } |
| 699 | 699 | |
| 700 | 700 | |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | * @return string |
| 706 | 706 | */ |
| 707 | 707 | public function pretty_final_price() { |
| 708 | - return $this->get_pretty( 'REG_final_price' ); |
|
| 708 | + return $this->get_pretty('REG_final_price'); |
|
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | * @return float |
| 716 | 716 | */ |
| 717 | 717 | public function paid() { |
| 718 | - return $this->get( 'REG_paid' ); |
|
| 718 | + return $this->get('REG_paid'); |
|
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | * @return float |
| 726 | 726 | */ |
| 727 | 727 | public function pretty_paid() { |
| 728 | - return $this->get_pretty( 'REG_paid' ); |
|
| 728 | + return $this->get_pretty('REG_paid'); |
|
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | |
@@ -736,11 +736,11 @@ discard block |
||
| 736 | 736 | * @param array $requires_payment |
| 737 | 737 | * @return bool |
| 738 | 738 | */ |
| 739 | - public function owes_monies_and_can_pay( $requires_payment = array()) { |
|
| 739 | + public function owes_monies_and_can_pay($requires_payment = array()) { |
|
| 740 | 740 | // these reg statuses require payment (if event is not free) |
| 741 | - $requires_payment = ! empty( $requires_payment ) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment(); |
|
| 741 | + $requires_payment = ! empty($requires_payment) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment(); |
|
| 742 | 742 | if ( |
| 743 | - in_array( $this->status_ID(), $requires_payment ) && |
|
| 743 | + in_array($this->status_ID(), $requires_payment) && |
|
| 744 | 744 | $this->final_price() != 0 && |
| 745 | 745 | $this->final_price() != $this->paid() |
| 746 | 746 | ) { |
@@ -757,8 +757,8 @@ discard block |
||
| 757 | 757 | * @param bool $show_icons |
| 758 | 758 | * @return void |
| 759 | 759 | */ |
| 760 | - public function e_pretty_status( $show_icons = FALSE ) { |
|
| 761 | - echo $this->pretty_status( $show_icons ); |
|
| 760 | + public function e_pretty_status($show_icons = FALSE) { |
|
| 761 | + echo $this->pretty_status($show_icons); |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | |
@@ -769,10 +769,10 @@ discard block |
||
| 769 | 769 | * @param bool $show_icons |
| 770 | 770 | * @return string |
| 771 | 771 | */ |
| 772 | - public function pretty_status( $show_icons = FALSE ) { |
|
| 773 | - $status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' ); |
|
| 772 | + public function pretty_status($show_icons = FALSE) { |
|
| 773 | + $status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence'); |
|
| 774 | 774 | $icon = ''; |
| 775 | - switch ( $this->status_ID() ) { |
|
| 775 | + switch ($this->status_ID()) { |
|
| 776 | 776 | case EEM_Registration::status_id_approved: |
| 777 | 777 | $icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : ''; |
| 778 | 778 | break; |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | $icon = $show_icons ? '<span class="dashicons dashicons-clipboard ee-icon-size-16 purple-text"></span>' : ''; |
| 796 | 796 | break; |
| 797 | 797 | } |
| 798 | - return $icon . $status[ $this->status_ID() ]; |
|
| 798 | + return $icon.$status[$this->status_ID()]; |
|
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | * get Attendee Is Going |
| 805 | 805 | */ |
| 806 | 806 | public function att_is_going() { |
| 807 | - return $this->get( 'REG_att_is_going' ); |
|
| 807 | + return $this->get('REG_att_is_going'); |
|
| 808 | 808 | } |
| 809 | 809 | |
| 810 | 810 | |
@@ -814,8 +814,8 @@ discard block |
||
| 814 | 814 | * @param array $query_params like EEM_Base::get_all |
| 815 | 815 | * @return EE_Answer[] |
| 816 | 816 | */ |
| 817 | - public function answers( $query_params = NULL ) { |
|
| 818 | - return $this->get_many_related( 'Answer', $query_params ); |
|
| 817 | + public function answers($query_params = NULL) { |
|
| 818 | + return $this->get_many_related('Answer', $query_params); |
|
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | |
@@ -829,9 +829,9 @@ discard block |
||
| 829 | 829 | * (because the answer might be an array of answer values, so passing pretty_value=true |
| 830 | 830 | * will convert it into some kind of string) |
| 831 | 831 | */ |
| 832 | - public function answer_value_to_question( $question, $pretty_value=true ) { |
|
| 832 | + public function answer_value_to_question($question, $pretty_value = true) { |
|
| 833 | 833 | $question_id = EEM_Question::instance()->ensure_is_ID($question); |
| 834 | - return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value); |
|
| 834 | + return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value); |
|
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | |
@@ -844,13 +844,13 @@ discard block |
||
| 844 | 844 | */ |
| 845 | 845 | public function question_groups() { |
| 846 | 846 | $question_groups = array(); |
| 847 | - if ( $this->event() instanceof EE_Event ) { |
|
| 847 | + if ($this->event() instanceof EE_Event) { |
|
| 848 | 848 | $question_groups = $this->event()->question_groups( |
| 849 | 849 | array( |
| 850 | 850 | array( |
| 851 | 851 | 'Event_Question_Group.EQG_primary' => $this->count() == 1 ? true : false |
| 852 | 852 | ), |
| 853 | - 'order_by' => array( 'QSG_order' => 'ASC' ) |
|
| 853 | + 'order_by' => array('QSG_order' => 'ASC') |
|
| 854 | 854 | ) |
| 855 | 855 | ); |
| 856 | 856 | } |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | */ |
| 868 | 868 | public function count_question_groups() { |
| 869 | 869 | $qg_count = 0; |
| 870 | - if ( $this->event() instanceof EE_Event ) { |
|
| 870 | + if ($this->event() instanceof EE_Event) { |
|
| 871 | 871 | $qg_count = $this->event()->count_related( |
| 872 | 872 | 'Question_Group', |
| 873 | 873 | array( |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | * @return string |
| 889 | 889 | */ |
| 890 | 890 | public function reg_date() { |
| 891 | - return $this->get_datetime( 'REG_date' ); |
|
| 891 | + return $this->get_datetime('REG_date'); |
|
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | * @return EE_Datetime_Ticket |
| 901 | 901 | */ |
| 902 | 902 | public function datetime_ticket() { |
| 903 | - return $this->get_first_related( 'Datetime_Ticket' ); |
|
| 903 | + return $this->get_first_related('Datetime_Ticket'); |
|
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | |
@@ -910,15 +910,15 @@ discard block |
||
| 910 | 910 | * @param EE_Datetime_Ticket $datetime_ticket |
| 911 | 911 | * @return EE_Datetime_Ticket |
| 912 | 912 | */ |
| 913 | - public function set_datetime_ticket( $datetime_ticket ) { |
|
| 914 | - return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' ); |
|
| 913 | + public function set_datetime_ticket($datetime_ticket) { |
|
| 914 | + return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket'); |
|
| 915 | 915 | } |
| 916 | 916 | /** |
| 917 | 917 | * Gets deleted |
| 918 | 918 | * @return boolean |
| 919 | 919 | */ |
| 920 | 920 | public function deleted() { |
| 921 | - return $this->get( 'REG_deleted' ); |
|
| 921 | + return $this->get('REG_deleted'); |
|
| 922 | 922 | } |
| 923 | 923 | |
| 924 | 924 | /** |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | * @return boolean |
| 928 | 928 | */ |
| 929 | 929 | public function set_deleted($deleted) { |
| 930 | - $this->set( 'REG_deleted', $deleted ); |
|
| 930 | + $this->set('REG_deleted', $deleted); |
|
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | * @return EE_Status |
| 938 | 938 | */ |
| 939 | 939 | public function status_obj() { |
| 940 | - return $this->get_first_related( 'Status' ); |
|
| 940 | + return $this->get_first_related('Status'); |
|
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | * @return int |
| 949 | 949 | */ |
| 950 | 950 | public function count_checkins() { |
| 951 | - return $this->get_model()->count_related( $this, 'Checkin' ); |
|
| 951 | + return $this->get_model()->count_related($this, 'Checkin'); |
|
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | * @return int |
| 959 | 959 | */ |
| 960 | 960 | public function count_checkins_not_checkedout() { |
| 961 | - return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) ); |
|
| 961 | + return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1))); |
|
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | |
@@ -971,20 +971,20 @@ discard block |
||
| 971 | 971 | * |
| 972 | 972 | * @return bool |
| 973 | 973 | */ |
| 974 | - public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) { |
|
| 975 | - $DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID ); |
|
| 974 | + public function can_checkin($DTT_OR_ID, $check_approved = TRUE) { |
|
| 975 | + $DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID); |
|
| 976 | 976 | |
| 977 | 977 | //first check registration status |
| 978 | - if ( ( $check_approved && ! $this->is_approved() ) || ! $DTT_ID ) { |
|
| 978 | + if (($check_approved && ! $this->is_approved()) || ! $DTT_ID) { |
|
| 979 | 979 | return false; |
| 980 | 980 | } |
| 981 | 981 | //is there a datetime ticket that matches this dtt_ID? |
| 982 | - if ( ! ( EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) ) ) ) { |
|
| 982 | + if ( ! (EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID))))) { |
|
| 983 | 983 | return false; |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | //final check is against TKT_uses |
| 987 | - return $this->verify_can_checkin_against_TKT_uses( $DTT_ID ); |
|
| 987 | + return $this->verify_can_checkin_against_TKT_uses($DTT_ID); |
|
| 988 | 988 | } |
| 989 | 989 | |
| 990 | 990 | |
@@ -997,10 +997,10 @@ discard block |
||
| 997 | 997 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
| 998 | 998 | * @return bool true means can checkin. false means cannot checkin. |
| 999 | 999 | */ |
| 1000 | - public function verify_can_checkin_against_TKT_uses( $DTT_OR_ID ) { |
|
| 1001 | - $DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID ); |
|
| 1000 | + public function verify_can_checkin_against_TKT_uses($DTT_OR_ID) { |
|
| 1001 | + $DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID); |
|
| 1002 | 1002 | |
| 1003 | - if ( ! $DTT_ID ) { |
|
| 1003 | + if ( ! $DTT_ID) { |
|
| 1004 | 1004 | return false; |
| 1005 | 1005 | } |
| 1006 | 1006 | |
@@ -1008,23 +1008,23 @@ discard block |
||
| 1008 | 1008 | |
| 1009 | 1009 | // if max uses is not set or equals infinity then return true cause its not a factor for whether user can check-in |
| 1010 | 1010 | // or not. |
| 1011 | - if ( ! $max_uses || $max_uses === EE_INF ) { |
|
| 1011 | + if ( ! $max_uses || $max_uses === EE_INF) { |
|
| 1012 | 1012 | return true; |
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | 1015 | //does this datetime have a checkin record? If so, then the dtt count has already been verified so we can just |
| 1016 | 1016 | //go ahead and toggle. |
| 1017 | - if ( EEM_Checkin::instance()->exists( array( array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID ) ) ) ) { |
|
| 1017 | + if (EEM_Checkin::instance()->exists(array(array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID)))) { |
|
| 1018 | 1018 | return true; |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | //made it here so the last check is whether the number of checkins per unique datetime on this registration |
| 1022 | 1022 | //disallows further check-ins. |
| 1023 | - $count_unique_dtt_checkins = EEM_Checkin::instance()->count( array( array( 'REG_ID' => $this->ID(), 'CHK_in' => true ) ), 'DTT_ID', true ); |
|
| 1023 | + $count_unique_dtt_checkins = EEM_Checkin::instance()->count(array(array('REG_ID' => $this->ID(), 'CHK_in' => true)), 'DTT_ID', true); |
|
| 1024 | 1024 | // checkins have already reached their max number of uses |
| 1025 | 1025 | // so registrant can NOT checkin |
| 1026 | - if ( $count_unique_dtt_checkins >= $max_uses ) { |
|
| 1027 | - EE_Error::add_error( __( 'Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1026 | + if ($count_unique_dtt_checkins >= $max_uses) { |
|
| 1027 | + EE_Error::add_error(__('Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 1028 | 1028 | return false; |
| 1029 | 1029 | } |
| 1030 | 1030 | return true; |
@@ -1046,15 +1046,15 @@ discard block |
||
| 1046 | 1046 | * @return bool|int the chk_in status toggled to OR false if nothing got changed. |
| 1047 | 1047 | * @throws EE_Error |
| 1048 | 1048 | */ |
| 1049 | - public function toggle_checkin_status( $DTT_ID = null, $verify = false ) { |
|
| 1050 | - if ( empty( $DTT_ID ) ) { |
|
| 1049 | + public function toggle_checkin_status($DTT_ID = null, $verify = false) { |
|
| 1050 | + if (empty($DTT_ID)) { |
|
| 1051 | 1051 | $datetime = $this->get_latest_related_datetime(); |
| 1052 | 1052 | $DTT_ID = $datetime instanceof EE_Datetime ? $datetime->ID() : 0; |
| 1053 | 1053 | // verify the registration can checkin for the given DTT_ID |
| 1054 | - } elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) { |
|
| 1054 | + } elseif ( ! $this->can_checkin($DTT_ID, $verify)) { |
|
| 1055 | 1055 | EE_Error::add_error( |
| 1056 | 1056 | sprintf( |
| 1057 | - __( 'The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'), |
|
| 1057 | + __('The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'), |
|
| 1058 | 1058 | $this->ID(), |
| 1059 | 1059 | $DTT_ID |
| 1060 | 1060 | ), |
@@ -1068,8 +1068,8 @@ discard block |
||
| 1068 | 1068 | EE_Registration::checkin_status_out => EE_Registration::checkin_status_in |
| 1069 | 1069 | ); |
| 1070 | 1070 | //start by getting the current status so we know what status we'll be changing to. |
| 1071 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL ); |
|
| 1072 | - $status_to = $status_paths[ $cur_status ]; |
|
| 1071 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL); |
|
| 1072 | + $status_to = $status_paths[$cur_status]; |
|
| 1073 | 1073 | // database only records true for checked IN or false for checked OUT |
| 1074 | 1074 | // no record ( null ) means checked in NEVER, but we obviously don't save that |
| 1075 | 1075 | $new_status = $status_to === EE_Registration::checkin_status_in ? true : false; |
@@ -1077,24 +1077,24 @@ discard block |
||
| 1077 | 1077 | // because we are keeping track of Check-ins over time. |
| 1078 | 1078 | // Eventually we'll probably want to show a list table |
| 1079 | 1079 | // for the individual Check-ins so that they can be managed. |
| 1080 | - $checkin = EE_Checkin::new_instance( array( |
|
| 1080 | + $checkin = EE_Checkin::new_instance(array( |
|
| 1081 | 1081 | 'REG_ID' => $this->ID(), |
| 1082 | 1082 | 'DTT_ID' => $DTT_ID, |
| 1083 | 1083 | 'CHK_in' => $new_status |
| 1084 | - ) ); |
|
| 1084 | + )); |
|
| 1085 | 1085 | // if the record could not be saved then return false |
| 1086 | - if ( $checkin->save() === 0 ) { |
|
| 1087 | - if ( WP_DEBUG ) { |
|
| 1086 | + if ($checkin->save() === 0) { |
|
| 1087 | + if (WP_DEBUG) { |
|
| 1088 | 1088 | global $wpdb; |
| 1089 | 1089 | $error = sprintf( |
| 1090 | - __( 'Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso' ), |
|
| 1090 | + __('Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso'), |
|
| 1091 | 1091 | '<br />', |
| 1092 | 1092 | $wpdb->last_error |
| 1093 | 1093 | ); |
| 1094 | 1094 | } else { |
| 1095 | - $error = __( 'Registration check in update failed because of an unknown database error', 'event_espresso' ); |
|
| 1095 | + $error = __('Registration check in update failed because of an unknown database error', 'event_espresso'); |
|
| 1096 | 1096 | } |
| 1097 | - EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1097 | + EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__); |
|
| 1098 | 1098 | return false; |
| 1099 | 1099 | } |
| 1100 | 1100 | return $status_to; |
@@ -1115,7 +1115,7 @@ discard block |
||
| 1115 | 1115 | array( |
| 1116 | 1116 | 'Ticket.Registration.REG_ID' => $this->ID() |
| 1117 | 1117 | ), |
| 1118 | - 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) |
|
| 1118 | + 'order_by' => array('DTT_EVT_start' => 'DESC') |
|
| 1119 | 1119 | ) |
| 1120 | 1120 | ); |
| 1121 | 1121 | } |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | array( |
| 1135 | 1135 | 'Ticket.Registration.REG_ID' => $this->ID() |
| 1136 | 1136 | ), |
| 1137 | - 'order_by' => array( 'DTT_EVT_start' => 'ASC' ) |
|
| 1137 | + 'order_by' => array('DTT_EVT_start' => 'ASC') |
|
| 1138 | 1138 | ) |
| 1139 | 1139 | ); |
| 1140 | 1140 | } |
@@ -1153,21 +1153,21 @@ discard block |
||
| 1153 | 1153 | * @return int Integer representing Check-in status. |
| 1154 | 1154 | * @throws \EE_Error |
| 1155 | 1155 | */ |
| 1156 | - public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = null ) { |
|
| 1156 | + public function check_in_status_for_datetime($DTT_ID = 0, $checkin = null) { |
|
| 1157 | 1157 | $checkin_query_params = array( |
| 1158 | - 'order_by' => array( 'CHK_timestamp' => 'DESC' ) |
|
| 1158 | + 'order_by' => array('CHK_timestamp' => 'DESC') |
|
| 1159 | 1159 | ); |
| 1160 | 1160 | |
| 1161 | - if ( $DTT_ID > 0 ) { |
|
| 1162 | - $checkin_query_params[0] = array( 'DTT_ID' => $DTT_ID ); |
|
| 1161 | + if ($DTT_ID > 0) { |
|
| 1162 | + $checkin_query_params[0] = array('DTT_ID' => $DTT_ID); |
|
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | 1165 | //get checkin object (if exists) |
| 1166 | 1166 | $checkin = $checkin instanceof EE_Checkin |
| 1167 | 1167 | ? $checkin |
| 1168 | - : $this->get_first_related( 'Checkin', $checkin_query_params ); |
|
| 1169 | - if ( $checkin instanceof EE_Checkin ) { |
|
| 1170 | - if ( $checkin->get( 'CHK_in' ) ) { |
|
| 1168 | + : $this->get_first_related('Checkin', $checkin_query_params); |
|
| 1169 | + if ($checkin instanceof EE_Checkin) { |
|
| 1170 | + if ($checkin->get('CHK_in')) { |
|
| 1171 | 1171 | return EE_Registration::checkin_status_in; //checked in |
| 1172 | 1172 | } |
| 1173 | 1173 | return EE_Registration::checkin_status_out; //had checked in but is now checked out. |
@@ -1183,28 +1183,28 @@ discard block |
||
| 1183 | 1183 | * @param bool $error This just flags that you want an error message returned. This is put in so that the error message can be customized with the attendee name. |
| 1184 | 1184 | * @return string internationalized message |
| 1185 | 1185 | */ |
| 1186 | - public function get_checkin_msg( $DTT_ID, $error = FALSE ) { |
|
| 1186 | + public function get_checkin_msg($DTT_ID, $error = FALSE) { |
|
| 1187 | 1187 | //let's get the attendee first so we can include the name of the attendee |
| 1188 | - $attendee = $this->get_first_related( 'Attendee' ); |
|
| 1189 | - if ( $attendee instanceof EE_Attendee ) { |
|
| 1190 | - if ( $error ) { |
|
| 1191 | - return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() ); |
|
| 1188 | + $attendee = $this->get_first_related('Attendee'); |
|
| 1189 | + if ($attendee instanceof EE_Attendee) { |
|
| 1190 | + if ($error) { |
|
| 1191 | + return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name()); |
|
| 1192 | 1192 | } |
| 1193 | - $cur_status = $this->check_in_status_for_datetime( $DTT_ID ); |
|
| 1193 | + $cur_status = $this->check_in_status_for_datetime($DTT_ID); |
|
| 1194 | 1194 | //what is the status message going to be? |
| 1195 | - switch ( $cur_status ) { |
|
| 1195 | + switch ($cur_status) { |
|
| 1196 | 1196 | case EE_Registration::checkin_status_never : |
| 1197 | - return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() ); |
|
| 1197 | + return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name()); |
|
| 1198 | 1198 | break; |
| 1199 | 1199 | case EE_Registration::checkin_status_in : |
| 1200 | - return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() ); |
|
| 1200 | + return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name()); |
|
| 1201 | 1201 | break; |
| 1202 | 1202 | case EE_Registration::checkin_status_out : |
| 1203 | - return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() ); |
|
| 1203 | + return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name()); |
|
| 1204 | 1204 | break; |
| 1205 | 1205 | } |
| 1206 | 1206 | } |
| 1207 | - return __( "The check-in status could not be determined.", "event_espresso" ); |
|
| 1207 | + return __("The check-in status could not be determined.", "event_espresso"); |
|
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | 1210 | |
@@ -1228,7 +1228,7 @@ discard block |
||
| 1228 | 1228 | * get Registration Code |
| 1229 | 1229 | */ |
| 1230 | 1230 | public function reg_code() { |
| 1231 | - return $this->get( 'REG_code' ); |
|
| 1231 | + return $this->get('REG_code'); |
|
| 1232 | 1232 | } |
| 1233 | 1233 | |
| 1234 | 1234 | |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | * get Transaction ID |
| 1238 | 1238 | */ |
| 1239 | 1239 | public function transaction_ID() { |
| 1240 | - return $this->get( 'TXN_ID' ); |
|
| 1240 | + return $this->get('TXN_ID'); |
|
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | 1243 | |
@@ -1246,7 +1246,7 @@ discard block |
||
| 1246 | 1246 | * @return int |
| 1247 | 1247 | */ |
| 1248 | 1248 | public function ticket_ID() { |
| 1249 | - return $this->get( 'TKT_ID' ); |
|
| 1249 | + return $this->get('TKT_ID'); |
|
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | 1252 | |
@@ -1258,17 +1258,17 @@ discard block |
||
| 1258 | 1258 | * @param string $REG_code Registration Code |
| 1259 | 1259 | * @param boolean $use_default |
| 1260 | 1260 | */ |
| 1261 | - public function set_reg_code( $REG_code, $use_default = FALSE ) { |
|
| 1262 | - if ( empty( $REG_code )) { |
|
| 1263 | - EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
| 1261 | + public function set_reg_code($REG_code, $use_default = FALSE) { |
|
| 1262 | + if (empty($REG_code)) { |
|
| 1263 | + EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
| 1264 | 1264 | return; |
| 1265 | 1265 | } |
| 1266 | - if ( ! $this->reg_code() ) { |
|
| 1267 | - parent::set( 'REG_code', $REG_code, $use_default ); |
|
| 1266 | + if ( ! $this->reg_code()) { |
|
| 1267 | + parent::set('REG_code', $REG_code, $use_default); |
|
| 1268 | 1268 | } else { |
| 1269 | 1269 | EE_Error::doing_it_wrong( |
| 1270 | - __CLASS__ . '::' . __FUNCTION__, |
|
| 1271 | - __( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ), |
|
| 1270 | + __CLASS__.'::'.__FUNCTION__, |
|
| 1271 | + __('Can not change a registration REG_code once it has been set.', 'event_espresso'), |
|
| 1272 | 1272 | '4.6.0' |
| 1273 | 1273 | ); |
| 1274 | 1274 | } |
@@ -1288,17 +1288,17 @@ discard block |
||
| 1288 | 1288 | * @return EE_Registration[] or empty array if this isn't a group registration. |
| 1289 | 1289 | */ |
| 1290 | 1290 | public function get_all_other_registrations_in_group() { |
| 1291 | - if ( $this->group_size() < 2 ) { |
|
| 1291 | + if ($this->group_size() < 2) { |
|
| 1292 | 1292 | return array(); |
| 1293 | 1293 | } |
| 1294 | 1294 | |
| 1295 | 1295 | $query[0] = array( |
| 1296 | 1296 | 'TXN_ID' => $this->transaction_ID(), |
| 1297 | - 'REG_ID' => array( '!=', $this->ID() ), |
|
| 1297 | + 'REG_ID' => array('!=', $this->ID()), |
|
| 1298 | 1298 | 'TKT_ID' => $this->ticket_ID() |
| 1299 | 1299 | ); |
| 1300 | 1300 | |
| 1301 | - $registrations = $this->get_model()->get_all( $query ); |
|
| 1301 | + $registrations = $this->get_model()->get_all($query); |
|
| 1302 | 1302 | return $registrations; |
| 1303 | 1303 | } |
| 1304 | 1304 | |
@@ -1307,14 +1307,14 @@ discard block |
||
| 1307 | 1307 | * @return string |
| 1308 | 1308 | */ |
| 1309 | 1309 | public function get_admin_details_link() { |
| 1310 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
| 1310 | + EE_Registry::instance()->load_helper('URL'); |
|
| 1311 | 1311 | return EEH_URL::add_query_args_and_nonce( |
| 1312 | 1312 | array( |
| 1313 | 1313 | 'page' => 'espresso_registrations', |
| 1314 | 1314 | 'action' => 'view_registration', |
| 1315 | 1315 | '_REG_ID' => $this->ID() |
| 1316 | 1316 | ), |
| 1317 | - admin_url( 'admin.php' ) |
|
| 1317 | + admin_url('admin.php') |
|
| 1318 | 1318 | ); |
| 1319 | 1319 | } |
| 1320 | 1320 | |
@@ -1339,12 +1339,12 @@ discard block |
||
| 1339 | 1339 | * @return string |
| 1340 | 1340 | */ |
| 1341 | 1341 | public function get_admin_overview_link() { |
| 1342 | - EE_Registry::instance()->load_helper( 'URL' ); |
|
| 1342 | + EE_Registry::instance()->load_helper('URL'); |
|
| 1343 | 1343 | return EEH_URL::add_query_args_and_nonce( |
| 1344 | 1344 | array( |
| 1345 | 1345 | 'page' => 'espresso_registrations' |
| 1346 | 1346 | ), |
| 1347 | - admin_url( 'admin.php' ) |
|
| 1347 | + admin_url('admin.php') |
|
| 1348 | 1348 | ); |
| 1349 | 1349 | } |
| 1350 | 1350 | |
@@ -1355,8 +1355,8 @@ discard block |
||
| 1355 | 1355 | * @return \EE_Registration[] |
| 1356 | 1356 | * @throws \EE_Error |
| 1357 | 1357 | */ |
| 1358 | - public function payments( $query_params = array() ) { |
|
| 1359 | - return $this->get_many_related( 'Payment', $query_params ); |
|
| 1358 | + public function payments($query_params = array()) { |
|
| 1359 | + return $this->get_many_related('Payment', $query_params); |
|
| 1360 | 1360 | } |
| 1361 | 1361 | |
| 1362 | 1362 | |
@@ -1366,8 +1366,8 @@ discard block |
||
| 1366 | 1366 | * @return \EE_Registration_Payment[] |
| 1367 | 1367 | * @throws \EE_Error |
| 1368 | 1368 | */ |
| 1369 | - public function registration_payments( $query_params = array() ) { |
|
| 1370 | - return $this->get_many_related( 'Registration_Payment', $query_params ); |
|
| 1369 | + public function registration_payments($query_params = array()) { |
|
| 1370 | + return $this->get_many_related('Registration_Payment', $query_params); |
|
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | 1373 | |
@@ -1380,7 +1380,7 @@ discard block |
||
| 1380 | 1380 | * @return EE_Payment_Method|null |
| 1381 | 1381 | */ |
| 1382 | 1382 | public function payment_method() { |
| 1383 | - return EEM_Payment_Method::instance()->get_last_used_for_registration( $this ); |
|
| 1383 | + return EEM_Payment_Method::instance()->get_last_used_for_registration($this); |
|
| 1384 | 1384 | } |
| 1385 | 1385 | |
| 1386 | 1386 | |
@@ -34,37 +34,37 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | class Post implements RequestMethod |
| 36 | 36 | { |
| 37 | - /** |
|
| 38 | - * URL to which requests are POSTed. |
|
| 39 | - * @const string |
|
| 40 | - */ |
|
| 41 | - const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'; |
|
| 37 | + /** |
|
| 38 | + * URL to which requests are POSTed. |
|
| 39 | + * @const string |
|
| 40 | + */ |
|
| 41 | + const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'; |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Submit the POST request with the specified parameters. |
|
| 45 | - * |
|
| 46 | - * @param RequestParameters $params Request parameters |
|
| 47 | - * @return string Body of the reCAPTCHA response |
|
| 48 | - */ |
|
| 49 | - public function submit(RequestParameters $params) |
|
| 50 | - { |
|
| 51 | - /** |
|
| 52 | - * PHP 5.6.0 changed the way you specify the peer name for SSL context options. |
|
| 53 | - * Using "CN_name" will still work, but it will raise deprecated errors. |
|
| 54 | - */ |
|
| 55 | - $peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name'; |
|
| 56 | - $options = array( |
|
| 57 | - 'http' => array( |
|
| 58 | - 'header' => "Content-type: application/x-www-form-urlencoded\r\n", |
|
| 59 | - 'method' => 'POST', |
|
| 60 | - 'content' => $params->toQueryString(), |
|
| 61 | - // Force the peer to validate (not needed in 5.6.0+, but still works |
|
| 62 | - 'verify_peer' => true, |
|
| 63 | - // Force the peer validation to use www.google.com |
|
| 64 | - $peer_key => 'www.google.com', |
|
| 65 | - ), |
|
| 66 | - ); |
|
| 67 | - $context = stream_context_create($options); |
|
| 68 | - return file_get_contents(self::SITE_VERIFY_URL, false, $context); |
|
| 69 | - } |
|
| 43 | + /** |
|
| 44 | + * Submit the POST request with the specified parameters. |
|
| 45 | + * |
|
| 46 | + * @param RequestParameters $params Request parameters |
|
| 47 | + * @return string Body of the reCAPTCHA response |
|
| 48 | + */ |
|
| 49 | + public function submit(RequestParameters $params) |
|
| 50 | + { |
|
| 51 | + /** |
|
| 52 | + * PHP 5.6.0 changed the way you specify the peer name for SSL context options. |
|
| 53 | + * Using "CN_name" will still work, but it will raise deprecated errors. |
|
| 54 | + */ |
|
| 55 | + $peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name'; |
|
| 56 | + $options = array( |
|
| 57 | + 'http' => array( |
|
| 58 | + 'header' => "Content-type: application/x-www-form-urlencoded\r\n", |
|
| 59 | + 'method' => 'POST', |
|
| 60 | + 'content' => $params->toQueryString(), |
|
| 61 | + // Force the peer to validate (not needed in 5.6.0+, but still works |
|
| 62 | + 'verify_peer' => true, |
|
| 63 | + // Force the peer validation to use www.google.com |
|
| 64 | + $peer_key => 'www.google.com', |
|
| 65 | + ), |
|
| 66 | + ); |
|
| 67 | + $context = stream_context_create($options); |
|
| 68 | + return file_get_contents(self::SITE_VERIFY_URL, false, $context); |
|
| 69 | + } |
|
| 70 | 70 | } |
@@ -5,42 +5,42 @@ |
||
| 5 | 5 | <table class="admin-primary-mbox-tbl"> |
| 6 | 6 | <thead> |
| 7 | 7 | <tr> |
| 8 | - <th class="jst-left"><?php esc_html_e( 'Event Name', 'event_espresso' );?></th> |
|
| 9 | - <th class="jst-left"><?php esc_html_e( 'REG ID', 'event_espresso' );?></th> |
|
| 10 | - <th class="jst-left"><?php esc_html_e( 'TXN ID', 'event_espresso' );?></th> |
|
| 11 | - <th class="jst-left"><?php esc_html_e( 'Reg Code', 'event_espresso' );?></th> |
|
| 12 | - <th class="jst-rght"><?php esc_html_e( 'Ticket Price', 'event_espresso' );?></th> |
|
| 8 | + <th class="jst-left"><?php esc_html_e('Event Name', 'event_espresso'); ?></th> |
|
| 9 | + <th class="jst-left"><?php esc_html_e('REG ID', 'event_espresso'); ?></th> |
|
| 10 | + <th class="jst-left"><?php esc_html_e('TXN ID', 'event_espresso'); ?></th> |
|
| 11 | + <th class="jst-left"><?php esc_html_e('Reg Code', 'event_espresso'); ?></th> |
|
| 12 | + <th class="jst-rght"><?php esc_html_e('Ticket Price', 'event_espresso'); ?></th> |
|
| 13 | 13 | </tr> |
| 14 | 14 | </thead> |
| 15 | 15 | <tbody> |
| 16 | - <?php foreach( $registrations as $registration ) : ?> |
|
| 16 | + <?php foreach ($registrations as $registration) : ?> |
|
| 17 | 17 | <tr> |
| 18 | 18 | <td class="jst-left"> |
| 19 | 19 | <?php |
| 20 | - $event_url = add_query_arg( array( 'action' => 'edit', 'post' => $registration->event_ID() ), admin_url( 'admin.php?page=espresso_events' )); |
|
| 21 | - echo EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $registration->event_ID() ) ? '<a href="'. $event_url .'" title="'. esc_attr__( 'Edit Event', 'event_espresso' ) .'">' . $registration->event_name() . '</a>' : $registration->event_name(); |
|
| 20 | + $event_url = add_query_arg(array('action' => 'edit', 'post' => $registration->event_ID()), admin_url('admin.php?page=espresso_events')); |
|
| 21 | + echo EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $registration->event_ID()) ? '<a href="'.$event_url.'" title="'.esc_attr__('Edit Event', 'event_espresso').'">'.$registration->event_name().'</a>' : $registration->event_name(); |
|
| 22 | 22 | ?> |
| 23 | 23 | </td> |
| 24 | 24 | <td class="jst-left"> |
| 25 | 25 | <?php |
| 26 | - $reg_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration->ID() ), REG_ADMIN_URL ); |
|
| 27 | - echo EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $registration->ID() ) ? ' |
|
| 28 | - <a href="'.$reg_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . |
|
| 29 | - esc_html__( 'View Registration', 'event_espresso' ) . |
|
| 26 | + $reg_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration->ID()), REG_ADMIN_URL); |
|
| 27 | + echo EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $registration->ID()) ? ' |
|
| 28 | + <a href="'.$reg_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'. |
|
| 29 | + esc_html__('View Registration', 'event_espresso'). |
|
| 30 | 30 | '</a>' : $registration->ID(); |
| 31 | 31 | ?> |
| 32 | 32 | </td> |
| 33 | 33 | <td class="jst-left"> |
| 34 | 34 | <?php |
| 35 | - $txn_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$registration->transaction_ID() ), TXN_ADMIN_URL ); |
|
| 36 | - echo EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ? ' |
|
| 37 | - <a href="'.$txn_url.'" title="' . esc_attr__( 'View Transaction Details', 'event_espresso' ) . '">' . |
|
| 38 | - sprintf( esc_html__('View Transaction %d', 'event_espresso'), $registration->transaction_ID() ) . |
|
| 35 | + $txn_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$registration->transaction_ID()), TXN_ADMIN_URL); |
|
| 36 | + echo EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? ' |
|
| 37 | + <a href="'.$txn_url.'" title="'.esc_attr__('View Transaction Details', 'event_espresso').'">'. |
|
| 38 | + sprintf(esc_html__('View Transaction %d', 'event_espresso'), $registration->transaction_ID()). |
|
| 39 | 39 | '</a>' : $registration->transaction_ID(); |
| 40 | 40 | ?> |
| 41 | 41 | </td> |
| 42 | - <td class="jst-left"><?php echo $registration->reg_code();?></td> |
|
| 43 | - <td class="jst-rght"><?php echo EEH_Template::format_currency( $registration->final_price() );?></td> |
|
| 42 | + <td class="jst-left"><?php echo $registration->reg_code(); ?></td> |
|
| 43 | + <td class="jst-rght"><?php echo EEH_Template::format_currency($registration->final_price()); ?></td> |
|
| 44 | 44 | </tr> |
| 45 | 45 | <?php endforeach; ?> |
| 46 | 46 | </tbody> |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | * @param null $timezone |
| 23 | 23 | * @return EE_Event_Message_Template|mixed |
| 24 | 24 | */ |
| 25 | - public static function new_instance( $props_n_values = array(), $timezone = NULL ) { |
|
| 26 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone ); |
|
| 27 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
| 25 | + public static function new_instance($props_n_values = array(), $timezone = NULL) { |
|
| 26 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone); |
|
| 27 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | * @param null $timezone |
| 35 | 35 | * @return EE_Event_Message_Template |
| 36 | 36 | */ |
| 37 | - public static function new_instance_from_db ( $props_n_values = array(), $timezone = NULL ) { |
|
| 38 | - return new self( $props_n_values, TRUE, $timezone ); |
|
| 37 | + public static function new_instance_from_db($props_n_values = array(), $timezone = NULL) { |
|
| 38 | + return new self($props_n_values, TRUE, $timezone); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | } |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * Event Espresso |
| 4 | 6 | * |