Completed
Branch BUG-10434-reg-cancel-shortcode... (f76056)
by
unknown
14:04
created
core/libraries/shortcodes/EE_Recipient_List_Shortcodes.lib.php 2 patches
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 
44 44
 
45 45
 
46
-	protected function _parser( $shortcode ) {
47
-		switch ( $shortcode ) {
46
+	protected function _parser($shortcode) {
47
+		switch ($shortcode) {
48 48
 			case '[RECIPIENT_TICKET_LIST]' :
49 49
 				return $this->_get_recipient_ticket_list();
50 50
 				break;
@@ -67,34 +67,34 @@  discard block
 block discarded – undo
67 67
 		$this->_validate_list_requirements();
68 68
 		$this->_set_shortcode_helper();
69 69
 
70
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
71
-			return $this->_get_recipient_ticket_list_parsed( $this->_data['data'] );
72
-		} else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
73
-			return $this->_get_recipient_ticket_list_parsed( $this->_extra_data['data'] );
70
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
71
+			return $this->_get_recipient_ticket_list_parsed($this->_data['data']);
72
+		} else if ($this->_extra_data['data'] instanceof EE_Messages_Addressee) {
73
+			return $this->_get_recipient_ticket_list_parsed($this->_extra_data['data']);
74 74
 		} else {
75 75
 			return '';
76 76
 		}
77 77
 	}
78 78
 
79 79
 
80
-	private function _get_recipient_ticket_list_parsed( EE_Messages_Addressee $data ) {
80
+	private function _get_recipient_ticket_list_parsed(EE_Messages_Addressee $data) {
81 81
 		//first get registrations just for this attendee.
82 82
 		$att = $data->att_obj;
83 83
 		$registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[$att->ID()]['reg_objs'] : array();
84
-		$registrations_on_attendee = empty( $registrations_on_attendee ) && $data->reg_obj instanceof EE_Registration ? array( $data->reg_obj ) : $registrations_on_attendee;
84
+		$registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration ? array($data->reg_obj) : $registrations_on_attendee;
85 85
 		$tkts = array();
86 86
 
87 87
 		//if we're coming in from the main content then $this->_data['data'] is instanceof EE_Messages_Addressee.
88 88
 		//which means we want to get tickets for all events this addressee is a part of.
89
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
90
-			$valid_shortcodes = array('ticket', 'event_list', 'attendee_list','datetime_list', 'registration_details', 'attendee', 'recipient_details');
89
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
90
+			$valid_shortcodes = array('ticket', 'event_list', 'attendee_list', 'datetime_list', 'registration_details', 'attendee', 'recipient_details');
91 91
 			$template = $this->_data['template'];
92 92
 
93 93
 			//tickets will be tickets for all registrations on this attendee.
94
-			foreach ( $registrations_on_attendee as $reg ) {
95
-				if ( $reg instanceof EE_Registration ) {
96
-					$ticket = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['tkt_obj'] ) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
97
-					if ( $ticket instanceof EE_Ticket ) {
94
+			foreach ($registrations_on_attendee as $reg) {
95
+				if ($reg instanceof EE_Registration) {
96
+					$ticket = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
97
+					if ($ticket instanceof EE_Ticket) {
98 98
 						$tkts[$ticket->ID()] = $ticket;
99 99
 					}
100 100
 				}
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
 
104 104
 		//if coming from the context of the event list parser, then let's return just the tickets for that event.
105 105
 		$event = $this->_data['data'];
106
-		if ( $event instanceof EE_Event ) {
106
+		if ($event instanceof EE_Event) {
107 107
 			$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'recipient_details');
108
-			$template = is_array($this->_data['template'] ) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
108
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
109 109
 			//let's remove any existing [EVENT_LIST] shortcode from the ticket list template so that we don't get recursion.
110 110
 			$template = str_replace('[EVENT_LIST]', '', $template);
111 111
 			//data will be tickets for this event for this recipient.
112
-			foreach ( $registrations_on_attendee as $reg ) {
113
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $event->ID() ) {
114
-					$ticket = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['tkt_obj'] ) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
115
-					if ( $ticket instanceof EE_Ticket ) {
112
+			foreach ($registrations_on_attendee as $reg) {
113
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
114
+					$ticket = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
115
+					if ($ticket instanceof EE_Ticket) {
116 116
 						$tkts[$ticket->ID()] = $ticket;
117 117
 					}
118 118
 				}
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
 		}
121 121
 
122 122
 		$tkt_parsed = '';
123
-		foreach ( $tkts as $ticket ) {
124
-			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template( $template, $ticket, $valid_shortcodes, $this->_extra_data );
123
+		foreach ($tkts as $ticket) {
124
+			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
125 125
 		}
126 126
 		return $tkt_parsed;
127 127
 	}
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 		$this->_validate_list_requirements();
138 138
 		$this->_set_shortcode_helper();
139 139
 
140
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
141
-			return $this->_get_recipient_datetime_list_parsed( $this->_data['data']  );
140
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
141
+			return $this->_get_recipient_datetime_list_parsed($this->_data['data']);
142 142
 
143
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
144
-			return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'] );
143
+		else if ($this->_extra_data['data'] instanceof EE_Messages_Addressee)
144
+			return $this->_get_recipient_datetime_list_parsed($this->_extra_data['data']);
145 145
 
146 146
 		else
147 147
 			return '';
@@ -149,26 +149,26 @@  discard block
 block discarded – undo
149 149
 	}
150 150
 
151 151
 
152
-	private function _get_recipient_datetime_list_parsed( EE_Messages_Addressee $data ) {
152
+	private function _get_recipient_datetime_list_parsed(EE_Messages_Addressee $data) {
153 153
 		//first get registrations just for this attendee.
154 154
 		$att = $data->att_obj;
155 155
 		$registrations_on_attendee = $att instanceof EE_Attendee ? $data->attendees[$att->ID()]['reg_objs'] : null;
156
-		$registrations_on_attendee = empty( $registrations_on_attendee ) && $data->reg_obj instanceof EE_Registration ? array( $data->reg_obj ) : array();
157
-		$valid_shortcodes = array( 'datetime', 'attendee', 'recipient_details' );
156
+		$registrations_on_attendee = empty($registrations_on_attendee) && $data->reg_obj instanceof EE_Registration ? array($data->reg_obj) : array();
157
+		$valid_shortcodes = array('datetime', 'attendee', 'recipient_details');
158 158
 		$template = '';
159 159
 		$dtts = array();
160 160
 
161 161
 		//setup valid shortcodes depending on what the status of the $this->_data property is
162
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
162
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
163 163
 			$template = $this->_data['template'];
164 164
 
165 165
 			//dtts will be datetimes for all registrations on this attendee
166
-			foreach ( $registrations_on_attendee as $reg ) {
167
-				if ( $reg instanceof EE_Registration ) {
168
-					$dtt_objs = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['dtt_objs'] ) ? $data->registrations[$reg->ID()]['dtt_objs'] : array();
166
+			foreach ($registrations_on_attendee as $reg) {
167
+				if ($reg instanceof EE_Registration) {
168
+					$dtt_objs = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['dtt_objs']) ? $data->registrations[$reg->ID()]['dtt_objs'] : array();
169 169
 					$dtt_objs = (array) $dtt_objs;
170
-					foreach ( $dtt_objs as $dtt_obj ) {
171
-						if ( $dtt_obj instanceof EE_Datetime ) {
170
+					foreach ($dtt_objs as $dtt_obj) {
171
+						if ($dtt_obj instanceof EE_Datetime) {
172 172
 							$dtts[$dtt_obj->ID()] = $dtt_obj;
173 173
 						}
174 174
 					}
@@ -178,18 +178,18 @@  discard block
 block discarded – undo
178 178
 
179 179
 		//if coming from the context of the event list parser, then let's just return the datetimes for the specific event.
180 180
 		$event = $this->_data['data'];
181
-		if ( $event instanceof EE_Event ) {
182
-			$template = is_array( $this->_data['template'] ) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
181
+		if ($event instanceof EE_Event) {
182
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
183 183
 
184 184
 			//data will be datetimes for this event for this recipient
185
-			foreach ( $registrations_on_attendee as $reg ) {
186
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $event->ID() ) {
187
-					$ticket = isset( $data->registrations[$reg->ID()] ) && is_array( $data->registrations[$reg->ID()] ) && isset( $data->registrations[$reg->ID()]['tkt_obj'] ) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
188
-					if ( $ticket instanceof EE_Ticket ) {
189
-						$dtt_objs = isset( $data->tickets[$ticket->ID()] ) && is_array( $data->tickets[$ticket->ID()] ) && isset( $data->tickets[$ticket->ID()]['dtt_objs'] ) ? $data->tickets[$ticket->ID()]['dtt_objs'] : array();
185
+			foreach ($registrations_on_attendee as $reg) {
186
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $event->ID()) {
187
+					$ticket = isset($data->registrations[$reg->ID()]) && is_array($data->registrations[$reg->ID()]) && isset($data->registrations[$reg->ID()]['tkt_obj']) ? $data->registrations[$reg->ID()]['tkt_obj'] : null;
188
+					if ($ticket instanceof EE_Ticket) {
189
+						$dtt_objs = isset($data->tickets[$ticket->ID()]) && is_array($data->tickets[$ticket->ID()]) && isset($data->tickets[$ticket->ID()]['dtt_objs']) ? $data->tickets[$ticket->ID()]['dtt_objs'] : array();
190 190
 						$dtt_objs = (array) $dtt_objs;
191
-						foreach ( $dtt_objs as $dtt_obj ) {
192
-							if ( $dtt_obj instanceof EE_Datetime ) {
191
+						foreach ($dtt_objs as $dtt_obj) {
192
+							if ($dtt_obj instanceof EE_Datetime) {
193 193
 								$dtts[$dtt_obj->ID()] = $dtt_obj;
194 194
 							}
195 195
 						}
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 		}
200 200
 
201 201
 		$dtt_parsed = '';
202
-		foreach ( $dtts as $datetime ) {
203
-			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template( $template, $datetime, $valid_shortcodes, $this->_extra_data );
202
+		foreach ($dtts as $datetime) {
203
+			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template($template, $datetime, $valid_shortcodes, $this->_extra_data);
204 204
 		}
205 205
 		return $dtt_parsed;
206 206
 	}
Please login to merge, or discard this patch.
Braces   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -137,14 +137,13 @@
 block discarded – undo
137 137
 		$this->_validate_list_requirements();
138 138
 		$this->_set_shortcode_helper();
139 139
 
140
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
141
-			return $this->_get_recipient_datetime_list_parsed( $this->_data['data']  );
142
-
143
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
144
-			return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'] );
145
-
146
-		else
147
-			return '';
140
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
141
+					return $this->_get_recipient_datetime_list_parsed( $this->_data['data']  );
142
+		} else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
143
+					return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'] );
144
+		} else {
145
+					return '';
146
+		}
148 147
 
149 148
 	}
150 149
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Ticket_List_Shortcodes.lib.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 
51
-	protected function _parser( $shortcode ) {
52
-		switch ( $shortcode ) {
51
+	protected function _parser($shortcode) {
52
+		switch ($shortcode) {
53 53
 			case '[TICKET_LIST]' :
54 54
 				return $this->_get_ticket_list();
55 55
 				break;
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 		$this->_set_shortcode_helper();
69 69
 
70 70
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
71
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
72 72
 			return $this->_get_ticket_list_for_main();
73 73
 
74
-		else if ( $this->_data['data'] instanceof EE_Registration )
74
+		else if ($this->_data['data'] instanceof EE_Registration)
75 75
 			return $this->_get_ticket_list_for_attendee();
76 76
 
77
-		else if ( $this->_data['data'] instanceof EE_Event )
77
+		else if ($this->_data['data'] instanceof EE_Event)
78 78
 			return $this->_get_ticket_list_for_event();
79 79
 
80 80
 		//prevent recursive loop
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 	 * This returns the parsed ticket list for main template;
92 92
 	 */
93 93
 	private function _get_ticket_list_for_main() {
94
-		$valid_shortcodes = array('ticket', 'event_list', 'attendee_list','datetime_list', 'attendee', 'line_item_list', 'primary_registration_details', 'recipient_details' );
94
+		$valid_shortcodes = array('ticket', 'event_list', 'attendee_list', 'datetime_list', 'attendee', 'line_item_list', 'primary_registration_details', 'recipient_details');
95 95
 		$template = $this->_data['template'];
96 96
 		$data = $this->_data['data'];
97 97
 		$tktparsed = '';
98 98
 
99 99
 
100 100
 		//now we need to loop through the ticket list and send data to the EE_Parser helper.
101
-		foreach ( $data->tickets as $ticket ) {
101
+		foreach ($data->tickets as $ticket) {
102 102
 			$tktparsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket['ticket'], $valid_shortcodes, $this->_extra_data);
103 103
 		}
104 104
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * @return string
113 113
 	 */
114 114
 	private function _get_ticket_list_for_event() {
115
-		$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'venue', 'line_item_list', 'primary_registration_details', 'recipient_details' );
116
-		$template = is_array($this->_data['template'] ) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
115
+		$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee', 'venue', 'line_item_list', 'primary_registration_details', 'recipient_details');
116
+		$template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
117 117
 		$event = $this->_data['data'];
118 118
 
119 119
 		//let's remove any existing [EVENT_LIST] shortcodes from the ticket list template so that we don't get recursion.
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		$tickets = $this->_get_tickets_from_event($event);
125 125
 
126 126
 		//each ticket in this case should be an ticket object.
127
-		foreach ( $tickets as $ticket ) {
127
+		foreach ($tickets as $ticket) {
128 128
 			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
129 129
 		}
130 130
 
@@ -151,18 +151,18 @@  discard block
 block discarded – undo
151 151
 		$tickets = $this->_get_ticket_list_from_registration($registration);
152 152
 
153 153
 		//each ticket in this case should be an ticket object.
154
-		foreach ( $tickets as $ticket ) {
154
+		foreach ($tickets as $ticket) {
155 155
 			$tkt_parsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $this->_extra_data);
156 156
 		}
157 157
 
158 158
 		return $tkt_parsed;
159 159
 	}
160 160
 
161
-	private function _get_tickets_from_event( EE_Event $event ) {
161
+	private function _get_tickets_from_event(EE_Event $event) {
162 162
 		return isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['tkt_objs'] : array();
163 163
 	}
164 164
 
165
-	private function _get_ticket_list_from_registration( EE_Registration $registration, $att = NULL ) {
165
+	private function _get_ticket_list_from_registration(EE_Registration $registration, $att = NULL) {
166 166
 		return isset($this->_extra_data['data']->registrations) ? array($this->_extra_data['data']->registrations[$registration->ID()]['tkt_obj']) : array();
167 167
 	}
168 168
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -68,18 +69,18 @@  discard block
 block discarded – undo
68 69
 		$this->_set_shortcode_helper();
69 70
 
70 71
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
72
-			return $this->_get_ticket_list_for_main();
73
-
74
-		else if ( $this->_data['data'] instanceof EE_Registration )
75
-			return $this->_get_ticket_list_for_attendee();
76
-
77
-		else if ( $this->_data['data'] instanceof EE_Event )
78
-			return $this->_get_ticket_list_for_event();
72
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
73
+					return $this->_get_ticket_list_for_main();
74
+		} else if ( $this->_data['data'] instanceof EE_Registration ) {
75
+					return $this->_get_ticket_list_for_attendee();
76
+		} else if ( $this->_data['data'] instanceof EE_Event ) {
77
+					return $this->_get_ticket_list_for_event();
78
+		}
79 79
 
80 80
 		//prevent recursive loop
81
-		else
82
-			return '';
81
+		else {
82
+					return '';
83
+		}
83 84
 	}
84 85
 
85 86
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Ticket_Shortcodes.lib.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -80,8 +81,9 @@  discard block
 block discarded – undo
80 81
 
81 82
 
82 83
 		//If there is no event object by now then get out.
83
-		if ( ! $this->_ticket instanceof EE_Ticket )
84
-			return '';
84
+		if ( ! $this->_ticket instanceof EE_Ticket ) {
85
+					return '';
86
+		}
85 87
 
86 88
 		switch ( $shortcode ) {
87 89
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -50,38 +50,38 @@  discard block
 block discarded – undo
50 50
 			'[TICKET_PRICE]' => __('The price of the ticket', 'event_espresso'),
51 51
 			'[TICKET_PRICE_WITH_TAXES]' => __('The price of the ticket including any taxes that might be on the ticket', 'event_espresso'),
52 52
 			'[TKT_QTY_PURCHASED]' => __('The total quantity of the current ticket in the list that has been purchased in this transaction', 'event_espresso'),
53
-			'[TKT_USES_*]' => __( 'This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso' ) .
54
-				'<p><ul>' .
55
-				'<li><strong>symbol</strong>:' . __('This returns the &infin; symbol.', 'event_espresso') . '</li>' .
56
-				'<li><strong>text</strong>:' . __('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso' ) . '</li>' .
57
-				'<li><strong>{custom}</strong>:' . __('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso' ) . '</li>' .
53
+			'[TKT_USES_*]' => __('This attribute based shortcode parses to show the number of uses the ticket has.  The optional "schema" attribute can be used to indicate what schema is used when the uses is infinite.  Options are:', 'event_espresso').
54
+				'<p><ul>'.
55
+				'<li><strong>symbol</strong>:'.__('This returns the &infin; symbol.', 'event_espresso').'</li>'.
56
+				'<li><strong>text</strong>:'.__('This returns the word, "Unlimited". This is also the default if the "schema" attribute is not used.', 'event_espresso').'</li>'.
57
+				'<li><strong>{custom}</strong>:'.__('You can put anything you want as a string instead and that will be used.  So you could have the world "any" and whenever uses for a ticket is infinity, this shortcode will parse to "any".', 'event_espresso').'</li>'.
58 58
 				'</ul></p>'
59 59
 			);
60 60
 	}
61 61
 
62 62
 
63
-	protected function _parser( $shortcode ) {
63
+	protected function _parser($shortcode) {
64 64
 
65 65
 		$this->_ticket = $this->_data instanceof EE_Ticket ? $this->_data : null;
66 66
 
67 67
 		$aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null;
68
-		$aee = ! $aee instanceof EE_Messages_Addressee && is_array( $this->_extra_data ) && isset( $this->_extra_data['data'] ) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
68
+		$aee = ! $aee instanceof EE_Messages_Addressee && is_array($this->_extra_data) && isset($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
69 69
 
70 70
 
71 71
 		//possible EE_Line_Item may be incoming data
72
-		$this->_ticket = empty( $this->_ticket ) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty( $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] ) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
72
+		$this->_ticket = empty($this->_ticket) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && ! empty($aee->line_items_with_children[$this->_data->ID()]['EE_Ticket']) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
73 73
 
74 74
 		//if still no ticket, then let's see if there is a reg_obj.  If there IS, then we'll try and grab the ticket from the reg_obj instead.
75
-		if ( empty( $this->_ticket ) ) {
75
+		if (empty($this->_ticket)) {
76 76
 			$this->_ticket = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->ticket() : NULL;
77 77
 		}
78 78
 
79 79
 
80 80
 		//If there is no event object by now then get out.
81
-		if ( ! $this->_ticket instanceof EE_Ticket )
81
+		if ( ! $this->_ticket instanceof EE_Ticket)
82 82
 			return '';
83 83
 
84
-		switch ( $shortcode ) {
84
+		switch ($shortcode) {
85 85
 
86 86
 			case '[TICKET_ID]' :
87 87
 				return $this->_ticket->ID();
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 				break;
97 97
 
98 98
 			case '[TICKET_PRICE]' :
99
-				return EEH_Template::format_currency( $this->_ticket->get('TKT_price') );
99
+				return EEH_Template::format_currency($this->_ticket->get('TKT_price'));
100 100
 				break;
101 101
 
102 102
 			case '[TICKET_PRICE_WITH_TAXES]' :
103
-				return EEH_Template::format_currency( $this->_ticket->get_ticket_total_with_taxes() );
103
+				return EEH_Template::format_currency($this->_ticket->get_ticket_total_with_taxes());
104 104
 				break;
105 105
 
106 106
 			case '[TKT_QTY_PURCHASED]' :
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
 				break;
109 109
 		}
110 110
 
111
-		if ( strpos( $shortcode, '[TKT_USES_*') !== FALSE  ) {
112
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
113
-			$schema = empty( $attrs['schema'] ) ? null : $attrs['schema'];
114
-			return $this->_ticket->get_pretty( 'TKT_uses', $schema );
111
+		if (strpos($shortcode, '[TKT_USES_*') !== FALSE) {
112
+			$attrs = $this->_get_shortcode_attrs($shortcode);
113
+			$schema = empty($attrs['schema']) ? null : $attrs['schema'];
114
+			return $this->_ticket->get_pretty('TKT_uses', $schema);
115 115
 		}
116 116
 		return '';
117 117
 
Please login to merge, or discard this patch.
modules/certificate/EED_Certificate.module.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Module
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *  @access 	public
61 61
 	 *  @return 	void
62 62
 	 */
63
-	public function run( $WP ) {
63
+	public function run($WP) {
64 64
 //		add_filter( 'FHEE_load_ee_config', '__return_true' );
65 65
 //		add_filter( 'FHEE_run_EE_wp', '__return_true' );
66 66
 //		add_filter( 'FHEE_load_EE_Session', '__return_true' );
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 *  @return 	void
80 80
 	 */
81 81
 	public function certificate_launch() {
82
-		if ( EE_Registry::instance()->REQ->is_set( 'id' ) && EE_Registry::instance()->REQ->is_set( 'r_id' )) {
83
-			echo espresso_certificate_launch( EE_Registry::instance()->REQ->get( 'id' ), EE_Registry::instance()->REQ->get( 'r_id' ));
82
+		if (EE_Registry::instance()->REQ->is_set('id') && EE_Registry::instance()->REQ->is_set('r_id')) {
83
+			echo espresso_certificate_launch(EE_Registry::instance()->REQ->get('id'), EE_Registry::instance()->REQ->get('r_id'));
84 84
 		}
85 85
 	}
86 86
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 *  @access 	public
115 115
 	 *  @return 	void
116 116
 	 */
117
-	public function the_content( $content ) {
117
+	public function the_content($content) {
118 118
 		$content .= $this->ouput;
119 119
 		return $content;
120 120
 	}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 	 * 
57 57
 	 *  @access 	public
58 58
 	 *  @param		array 	$attributes
59
-	 *  @return 	void
59
+	 *  @return 	string
60 60
 	 */
61 61
 	public function process_shortcode( $attributes = array() ) {
62 62
 		extract( $attributes );
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
modules/csv/EED_Csv.module.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Csv
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 *  @access 	public
61 61
 	 *  @return 	void
62 62
 	 */
63
-	public function run( $WP ) {
63
+	public function run($WP) {
64 64
 //		add_filter( 'FHEE_load_ee_config', '__return_true' );
65 65
 //		add_filter( 'FHEE_run_EE_wp', '__return_true' );
66 66
 //		add_filter( 'FHEE_load_EE_Session', '__return_true' );
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 *  @return 	void
80 80
 	 */
81 81
 	public function export() {
82
-		$Export = EE_Registry::instance()->load_class( 'Export' );
82
+		$Export = EE_Registry::instance()->load_class('Export');
83 83
 		$Export->export();
84 84
 	}
85 85
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 *  @return 	void
94 94
 	 */
95 95
 	public function import() {
96
-		$Import = EE_Registry::instance()->load_class( 'Import' );
96
+		$Import = EE_Registry::instance()->load_class('Import');
97 97
 		$Import->import();
98 98
 	}
99 99
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
modules/feeds/templates/espresso_events_feed.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  * @ version		4+
11 11
  */
12 12
  ?>
13
-<p><?php  _e( 'Event Organizer: ', 'event_espresso' ) . espresso_organization_name( $EVT_ID ); ?><br/>
14
-<?php  _e( 'Organizer Email: ', 'event_espresso' ) . espresso_organization_email( $EVT_ID ); ?><br/>
15
-<?php  _e( 'Event Phone: ', 'event_espresso' ) . espresso_event_phone( $EVT_ID ); ?></p>
16
-<p><?php  _e( 'Event Status: ', 'event_espresso' ) . espresso_event_status( $EVT_ID );?></p>
17
-<p><?php  _e( 'Categories: ', 'event_espresso' ) . espresso_event_categories( $EVT_ID );?></p>
18
-<?php  _e( 'Dates and Times: ', 'event_espresso' ) . espresso_list_of_event_dates( $EVT_ID );?>
19
-<?php  _e( 'Available Tickets: ', 'event_espresso' ) . espresso_event_tickets_available( $EVT_ID );?>
20
-<p><?php  _e( 'Event Venue: ', 'event_espresso' ) . espresso_venue_name( NULL, FALSE ); ?></p>
21
-<p><?php  echo __( 'Description: ', 'event_espresso' ) . $event_description; ?></p><br/>
13
+<p><?php  _e('Event Organizer: ', 'event_espresso').espresso_organization_name($EVT_ID); ?><br/>
14
+<?php  _e('Organizer Email: ', 'event_espresso').espresso_organization_email($EVT_ID); ?><br/>
15
+<?php  _e('Event Phone: ', 'event_espresso').espresso_event_phone($EVT_ID); ?></p>
16
+<p><?php  _e('Event Status: ', 'event_espresso').espresso_event_status($EVT_ID); ?></p>
17
+<p><?php  _e('Categories: ', 'event_espresso').espresso_event_categories($EVT_ID); ?></p>
18
+<?php  _e('Dates and Times: ', 'event_espresso').espresso_list_of_event_dates($EVT_ID); ?>
19
+<?php  _e('Available Tickets: ', 'event_espresso').espresso_event_tickets_available($EVT_ID); ?>
20
+<p><?php  _e('Event Venue: ', 'event_espresso').espresso_venue_name(NULL, FALSE); ?></p>
21
+<p><?php  echo __('Description: ', 'event_espresso').$event_description; ?></p><br/>
22 22
  
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
modules/feeds/templates/espresso_venues_feed.template.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@
 block discarded – undo
10 10
  * @ version		4+
11 11
  */
12 12
  ?>
13
-<p><?php  _e( 'Organizer Name: ', 'event_espresso' ) . espresso_organization_name( $VNU_ID ); ?><br/>
14
-<?php  _e( 'Organizer Email: ', 'event_espresso' ) . espresso_organization_email( $VNU_ID ); ?><br/>
15
-<?php  _e( 'Venue Phone: ', 'event_espresso' ) . espresso_venue_phone( $VNU_ID ); ?></p>
16
-<p><?php  _e( 'Categories: ', 'event_espresso' ) . espresso_venue_categories( $VNU_ID );?></p>
17
-<p><?php  _e( 'Address: ', 'event_espresso' ) . espresso_venue_address( $VNU_ID );?></p>
18
-<p><?php  _e( 'Website: ', 'event_espresso' ) . espresso_venue_website( $VNU_ID );?></p>
19
-<p><?php  echo __( 'Description: ', 'event_espresso' )  . $venue_description; ?></p><br/>
13
+<p><?php  _e('Organizer Name: ', 'event_espresso').espresso_organization_name($VNU_ID); ?><br/>
14
+<?php  _e('Organizer Email: ', 'event_espresso').espresso_organization_email($VNU_ID); ?><br/>
15
+<?php  _e('Venue Phone: ', 'event_espresso').espresso_venue_phone($VNU_ID); ?></p>
16
+<p><?php  _e('Categories: ', 'event_espresso').espresso_venue_categories($VNU_ID); ?></p>
17
+<p><?php  _e('Address: ', 'event_espresso').espresso_venue_address($VNU_ID); ?></p>
18
+<p><?php  _e('Website: ', 'event_espresso').espresso_venue_website($VNU_ID); ?></p>
19
+<p><?php  echo __('Description: ', 'event_espresso').$venue_description; ?></p><br/>
20 20
  
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/Invoice.class.php 2 patches
Braces   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		//Get the CSS file
51 51
 		if( isset( $themes[ $theme_requested ] ) ) {
52 52
 			$template_args['invoice_css'] = $themes[ $theme_requested ];
53
-		}else{
53
+		} else{
54 54
 			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' );
55 55
 		}
56 56
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		$attendee_state = $primary_attendee->state_obj();
79 79
 		if($attendee_state){
80 80
 			$attendee_state_name = $attendee_state->name();
81
-		}else{
81
+		} else{
82 82
 			$attendee_state_name = '';
83 83
 		}
84 84
 		$template_args['attendee_state'] = $attendee_state_name;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$EE->load_helper( 'Venue_View' );
150 150
 //			d($template_args);
151 151
 			$template_args['download_link'] = $this->registration->receipt_url('download');
152
-		}else{
152
+		} else{
153 153
 			//it's just an invoice we're accessing
154 154
 			$template_args['download_link'] = $this->registration->invoice_url('download');
155 155
 		}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE );
166 166
 		if(isset($_GET['receipt'])){
167 167
 			$template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE );
168
-		}else{
168
+		} else{
169 169
 			$template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE );
170 170
 		}
171 171
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		//Create the PDF
191 191
 		if(array_key_exists('html',$_GET)){
192 192
 			echo $content;
193
-		}else{
193
+		} else{
194 194
 			//only load dompdf if nobody else has yet...
195 195
 			if( ! defined('DOMPDF_DIR')){
196 196
 				define('DOMPDF_ENABLE_REMOTE', TRUE);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){
215 215
 		if($line_item->desc()){
216 216
 			return true;
217
-		}else{
217
+		} else{
218 218
 			foreach($line_item->children() as $child_line_item){
219 219
 				if($this->check_if_any_line_items_have_a_description($child_line_item)){
220 220
 					return true;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
259 259
 		if($org_state){
260 260
 			$org_state_name = $org_state->name();
261
-		}else{
261
+		} else{
262 262
 			$org_state_name = '';
263 263
 		}
264 264
 		$ReplaceValues = array(
@@ -285,8 +285,9 @@  discard block
 block discarded – undo
285 285
 	public function espressoLoadData($items) {
286 286
 		$lines = $items;
287 287
 		$data = array();
288
-		foreach ($lines as $line)
289
-			$data[] = explode(';', chop($line));
288
+		foreach ($lines as $line) {
289
+					$data[] = explode(';', chop($line));
290
+		}
290 291
 
291 292
 		return $data;
292 293
 	}
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -21,23 +21,23 @@  discard block
 block discarded – undo
21 21
 	private $EE;
22 22
 	public function __construct($url_link = 0) {
23 23
 
24
-		if ( $this->registration = EE_Registry::instance()->load_model( 'Registration' )->get_registration_for_reg_url_link( $url_link)) {
24
+		if ($this->registration = EE_Registry::instance()->load_model('Registration')->get_registration_for_reg_url_link($url_link)) {
25 25
 			$this->transaction = $this->registration->transaction();
26 26
 
27
-			$payment_settings = EE_Config::instance()->gateway->payment_settings;//get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
-			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Invoice' );
27
+			$payment_settings = EE_Config::instance()->gateway->payment_settings; //get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
+			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type('Invoice');
29 29
 		} else {
30
-			EE_Error::add_error( __( 'Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
30
+			EE_Error::add_error(__('Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
31 31
 		}
32 32
 
33 33
 	}
34 34
 
35
-	public function send_invoice( $download = FALSE ) {
35
+	public function send_invoice($download = FALSE) {
36 36
 		$template_args = array();
37 37
 		$EE = EE_Registry::instance();
38 38
 
39 39
 		//allow the request to override the default theme defined in the invoice settings
40
-		$theme_requested = ( isset( $_REQUEST['theme'] ) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8 ) ? absint( $_REQUEST['theme'] ) : null;
40
+		$theme_requested = (isset($_REQUEST['theme']) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8) ? absint($_REQUEST['theme']) : null;
41 41
 		$themes = array(
42 42
 										1 => "simple.css",
43 43
 										2 => "bauhaus.css",
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
 										7 => "union.css"
49 49
 									);
50 50
 		//Get the CSS file
51
-		if( isset( $themes[ $theme_requested ] ) ) {
52
-			$template_args['invoice_css'] = $themes[ $theme_requested ];
53
-		}else{
54
-			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' );
51
+		if (isset($themes[$theme_requested])) {
52
+			$template_args['invoice_css'] = $themes[$theme_requested];
53
+		} else {
54
+			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta('legacy_invoice_css', TRUE, 'simple.css');
55 55
 		}
56 56
 
57
-		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) {
58
-			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/';
57
+		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) {
58
+			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/';
59 59
 		} else {
60
-			$template_args['base_url'] = EE_GATEWAYS . '/Invoice/lib/templates/';
60
+			$template_args['base_url'] = EE_GATEWAYS.'/Invoice/lib/templates/';
61 61
 		}
62 62
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
63 63
 
64
-		$template_args['organization'] = $EE->CFG->organization->get_pretty( 'name' );
65
-		$template_args['street'] = empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' );
66
-		$template_args['city'] = $EE->CFG->organization->get_pretty( 'city' );
67
-		$template_args['state'] = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
68
-		$template_args['country'] = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $EE->CFG->organization->CNT_ISO );
69
-		$template_args['zip'] = $EE->CFG->organization->get_pretty( 'zip' );
70
-		$template_args['email'] = $EE->CFG->organization->get_pretty( 'email' );
64
+		$template_args['organization'] = $EE->CFG->organization->get_pretty('name');
65
+		$template_args['street'] = empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2');
66
+		$template_args['city'] = $EE->CFG->organization->get_pretty('city');
67
+		$template_args['state'] = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
68
+		$template_args['country'] = EE_Registry::instance()->load_model('Country')->get_one_by_ID($EE->CFG->organization->CNT_ISO);
69
+		$template_args['zip'] = $EE->CFG->organization->get_pretty('zip');
70
+		$template_args['email'] = $EE->CFG->organization->get_pretty('email');
71 71
 
72 72
 		$template_args['registration_code'] = $this->registration->reg_code();
73 73
 		$template_args['registration_date'] = $this->registration->date();
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 		$template_args['attendee_address2'] = $primary_attendee->address2();
77 77
 		$template_args['attendee_city'] = $primary_attendee->city();
78 78
 		$attendee_state = $primary_attendee->state_obj();
79
-		if($attendee_state){
79
+		if ($attendee_state) {
80 80
 			$attendee_state_name = $attendee_state->name();
81
-		}else{
81
+		} else {
82 82
 			$attendee_state_name = '';
83 83
 		}
84 84
 		$template_args['attendee_state'] = $attendee_state_name;
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 		if ($template_args['amount_pd'] != $template_args['total_cost']) {
103 103
 			//$template_args['net_total'] = $this->espressoInvoiceTotals( __('SubTotal', 'event_espresso'), $this->transaction->total());//$this->session_data['cart']['REG']['sub_total']);
104 104
 			$tax_items = $this->transaction->tax_items();
105
-			if(!empty($tax_items) ){
105
+			if ( ! empty($tax_items)) {
106 106
 				foreach ($tax_items as $tax) {
107
-					$template_args['net_total'] .= $this->espressoInvoiceTotals( $tax->name(), $tax->total());
107
+					$template_args['net_total'] .= $this->espressoInvoiceTotals($tax->name(), $tax->total());
108 108
 				}
109 109
 			}
110 110
 
@@ -114,30 +114,30 @@  discard block
 block discarded – undo
114 114
 			} else {
115 115
 				$text = __('Extra', 'event_espresso');
116 116
 			}
117
-			$template_args['discount'] = $this->espressoInvoiceTotals( $text, $difference );
117
+			$template_args['discount'] = $this->espressoInvoiceTotals($text, $difference);
118 118
 		}
119 119
 
120 120
 		$template_args['currency_symbol'] = $EE->CFG->currency->sign;
121
-		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ), ENT_QUOTES)));
122
-		$template_args['shameless_plug'] = apply_filters( 'FHEE_Invoice__send_invoice__shameless_plug',true );
123
-		if(isset($_GET['receipt'])){
121
+		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE), ENT_QUOTES)));
122
+		$template_args['shameless_plug'] = apply_filters('FHEE_Invoice__send_invoice__shameless_plug', true);
123
+		if (isset($_GET['receipt'])) {
124 124
 			//receipt-specific stuff
125 125
 			$events_for_txn = EEM_Event::instance()->get_all(array(array('Registration.TXN_ID'=>$this->transaction->ID())));
126 126
 			$ticket_line_items_per_event = array();
127 127
 			$registrations_per_line_item = array();
128 128
 			$venues_for_events = array();
129
-			foreach($events_for_txn as $event_id => $event){
130
-				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id,'TXN_ID'=>$this->transaction->ID())));
129
+			foreach ($events_for_txn as $event_id => $event) {
130
+				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id, 'TXN_ID'=>$this->transaction->ID())));
131 131
 				$ticket_line_items_per_event[$event_id] = $line_items_for_this_event;
132
-				foreach($line_items_for_this_event as $line_item_id => $line_item){
132
+				foreach ($line_items_for_this_event as $line_item_id => $line_item) {
133 133
 					$ticket = $line_item->ticket();
134
-					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(),'TXN_ID'=>$this->transaction->ID())));
134
+					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(), 'TXN_ID'=>$this->transaction->ID())));
135 135
 					$registrations_per_line_item[$line_item_id] = $registrations_for_this_ticket;
136 136
 				}
137 137
 				$venues_for_events = array_merge($venues_for_events, $event->venues());
138 138
 			}
139
-			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(),'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
-			$questions_to_skip = array(EEM_Attendee::system_question_fname,EEM_Attendee::system_question_lname,  EEM_Attendee::system_question_email);
139
+			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(), 'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
+			$questions_to_skip = array(EEM_Attendee::system_question_fname, EEM_Attendee::system_question_lname, EEM_Attendee::system_question_email);
141 141
 
142 142
 
143 143
 			$template_args['events_for_txn'] = $events_for_txn;
@@ -148,53 +148,53 @@  discard block
 block discarded – undo
148 148
 			$template_args['questions_to_skip'] = $questions_to_skip;
149 149
 //			d($template_args);
150 150
 			$template_args['download_link'] = $this->registration->receipt_url('download');
151
-		}else{
151
+		} else {
152 152
 			//it's just an invoice we're accessing
153 153
 			$template_args['download_link'] = $this->registration->invoice_url('download');
154 154
 		}
155 155
 
156 156
 		//Get the HTML as an object
157 157
 		$templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
158
-		$template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE );
159
-		if(isset($_GET['receipt'])){
160
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE );
161
-		}else{
162
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE );
158
+		$template_header = EEH_Template::locate_template($templates_relative_path.'invoice_header.template.php', $template_args, TRUE, TRUE);
159
+		if (isset($_GET['receipt'])) {
160
+			$template_body = EEH_Template::locate_template($templates_relative_path.'receipt_body.template.php', $template_args, TRUE, TRUE);
161
+		} else {
162
+			$template_body = EEH_Template::locate_template($templates_relative_path.'invoice_body.template.php', $template_args, TRUE, TRUE);
163 163
 		}
164 164
 
165 165
 
166
-		$template_footer = EEH_Template::locate_template( $templates_relative_path . 'invoice_footer.template.php', $template_args, TRUE, TRUE );
166
+		$template_footer = EEH_Template::locate_template($templates_relative_path.'invoice_footer.template.php', $template_args, TRUE, TRUE);
167 167
 
168
-		$copies =  ! empty( $_REQUEST['copies'] ) ? $_REQUEST['copies'] : 1;
168
+		$copies = ! empty($_REQUEST['copies']) ? $_REQUEST['copies'] : 1;
169 169
 
170 170
 		$content = $this->espresso_replace_invoice_shortcodes($template_header);
171
-		for( $x = 1; $x <= $copies; $x++ ) {
171
+		for ($x = 1; $x <= $copies; $x++) {
172 172
 			$content .= $this->espresso_replace_invoice_shortcodes($template_body);
173 173
 		}
174 174
 		$content .= $this->espresso_replace_invoice_shortcodes($template_footer);
175 175
 
176 176
 		//Check if debugging or mobile is set
177
-		if (!empty($_REQUEST['html'])) {
177
+		if ( ! empty($_REQUEST['html'])) {
178 178
 			echo $content;
179 179
 			exit(0);
180 180
 		}
181
-		$invoice_name = $template_args['organization'] . ' ' . __('Invoice #', 'event_espresso') . $template_args['registration_code'] . __(' for ', 'event_espresso') . $template_args['name'];
182
-		$invoice_name = str_replace( ' ', '_', $invoice_name );
181
+		$invoice_name = $template_args['organization'].' '.__('Invoice #', 'event_espresso').$template_args['registration_code'].__(' for ', 'event_espresso').$template_args['name'];
182
+		$invoice_name = str_replace(' ', '_', $invoice_name);
183 183
 		//Create the PDF
184
-		if(array_key_exists('html',$_GET)){
184
+		if (array_key_exists('html', $_GET)) {
185 185
 			echo $content;
186
-		}else{
186
+		} else {
187 187
 			//only load dompdf if nobody else has yet...
188
-			if( ! defined('DOMPDF_DIR')){
188
+			if ( ! defined('DOMPDF_DIR')) {
189 189
 				define('DOMPDF_ENABLE_REMOTE', TRUE);
190 190
 				define('DOMPDF_ENABLE_JAVASCRIPT', FALSE);
191 191
 				define('DOMPDF_ENABLE_CSS_FLOAT', TRUE);
192
-				require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php');
192
+				require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php');
193 193
 			}
194 194
 			$dompdf = new DOMPDF();
195 195
 			$dompdf->load_html($content);
196 196
 			$dompdf->render();
197
-			$dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => $download ));
197
+			$dompdf->stream($invoice_name.".pdf", array('Attachment' => $download));
198 198
 		}
199 199
 		exit(0);
200 200
 	}
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 	 * @param EE_Line_Item $line_item
205 205
 	 * @return boolean
206 206
 	 */
207
-	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){
208
-		if($line_item->desc()){
207
+	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item) {
208
+		if ($line_item->desc()) {
209 209
 			return true;
210
-		}else{
211
-			foreach($line_item->children() as $child_line_item){
212
-				if($this->check_if_any_line_items_have_a_description($child_line_item)){
210
+		} else {
211
+			foreach ($line_item->children() as $child_line_item) {
212
+				if ($this->check_if_any_line_items_have_a_description($child_line_item)) {
213 213
 					return true;
214 214
 				}
215 215
 			}
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
 	}
220 220
 
221 221
 //Perform the shortcode replacement
222
-	function espresso_replace_invoice_shortcodes( $content ) {
222
+	function espresso_replace_invoice_shortcodes($content) {
223 223
 
224 224
 		$EE = EE_Registry::instance();
225 225
 		//Create the logo
226
-		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE,  $EE->CFG->organization->logo_url );
227
-		if (!empty($invoice_logo_url)) {
226
+		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE, $EE->CFG->organization->logo_url);
227
+		if ( ! empty($invoice_logo_url)) {
228 228
 			$image_size = getimagesize($invoice_logo_url);
229
-			$invoice_logo_image = '<img class="logo screen" src="' . $invoice_logo_url . '" ' . $image_size[3] . ' alt="logo" /> ';
229
+			$invoice_logo_image = '<img class="logo screen" src="'.$invoice_logo_url.'" '.$image_size[3].' alt="logo" /> ';
230 230
 		} else {
231 231
 			$invoice_logo_image = '';
232 232
 		}
@@ -248,28 +248,28 @@  discard block
 block discarded – undo
248 248
 				"[instructions]",
249 249
 		);
250 250
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
251
-		$org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
252
-		if($org_state){
251
+		$org_state = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
252
+		if ($org_state) {
253 253
 			$org_state_name = $org_state->name();
254
-		}else{
254
+		} else {
255 255
 			$org_state_name = '';
256 256
 		}
257 257
 		$ReplaceValues = array(
258
-				$EE->CFG->organization->get_pretty( 'name' ),
258
+				$EE->CFG->organization->get_pretty('name'),
259 259
 				$this->registration->reg_code(),
260 260
 				$this->transaction->ID(),
261 261
 				$primary_attendee->full_name(),
262
-				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/' : EE_GATEWAYS_URL . 'Invoice/lib/templates/',
263
-				$this->registration->invoice_url(),//home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
262
+				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/' : EE_GATEWAYS_URL.'Invoice/lib/templates/',
263
+				$this->registration->invoice_url(), //home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
264 264
 				$invoice_logo_image,
265
-				empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' ),
266
-				$EE->CFG->organization->get_pretty( 'city' ),
265
+				empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2'),
266
+				$EE->CFG->organization->get_pretty('city'),
267 267
 				$org_state_name,
268
-				$EE->CFG->organization->get_pretty( 'zip' ),
269
-				$EE->CFG->organization->get_pretty( 'email' ),
268
+				$EE->CFG->organization->get_pretty('zip'),
269
+				$EE->CFG->organization->get_pretty('email'),
270 270
 				$EE->CFG->organization->vat,
271
-				$this->registration->get_i18n_datetime( 'REG_date', get_option( 'date_format' ) ),
272
-				$this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ),
271
+				$this->registration->get_i18n_datetime('REG_date', get_option('date_format')),
272
+				$this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE),
273 273
 		);
274 274
 
275 275
 		return str_replace($SearchValues, $ReplaceValues, $content);
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 		if ($total_cost < 0) {
293 293
 			$total_cost = (-1) * $total_cost;
294 294
 		}
295
-		$find = array( ' ' );
296
-		$replace = array( '-' );
297
-		$row_id = strtolower( str_replace( $find, $replace, $text ));
295
+		$find = array(' ');
296
+		$replace = array('-');
297
+		$row_id = strtolower(str_replace($find, $replace, $text));
298 298
 		$html .= '<tr id="'.$row_id.'-tr"><td colspan="4">&nbsp;</td>';
299
-		$html .= '<td class="item_r">' . $text . '</td>';
300
-		$html .= '<td class="item_r">' . $total_cost . '</td>';
299
+		$html .= '<td class="item_r">'.$text.'</td>';
300
+		$html .= '<td class="item_r">'.$total_cost.'</td>';
301 301
 		$html .= '</tr>';
302 302
 		return $html;
303 303
 	}
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/templates/invoice_body.template.php 3 patches
Switch Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -154,12 +154,12 @@
 block discarded – undo
154 154
 							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
155 155
 						</tr>
156 156
 						<?php break;
157
-					case EEM_Line_Item::type_tax:
158
-							?>
157
+						case EEM_Line_Item::type_tax:
158
+								?>
159 159
 						<tr class="item sub-item tax-total">
160 160
 							<td class="item_l"><?php echo $line_item->name(); ?></td>
161 161
 							<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
162
-							<td colspan="2" class="item_c"><?php echo $line_item->percent(); ?>%</td>
162
+								<td colspan="2" class="item_c"><?php echo $line_item->percent(); ?>%</td>
163 163
 
164 164
 							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
165 165
 						</tr><?php break;
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 					</div>
46 46
 					 <!--#client-details vcard-->
47 47
 
48
-		<h2><?php _e("Purchases",'event_espresso')?></h2>
48
+		<h2><?php _e("Purchases", 'event_espresso')?></h2>
49 49
 		<table class="invoice-amount">
50 50
 
51 51
 			<thead>
52 52
 				<tr class="header_row">
53 53
 					<th class="left ticket_th"><?php _e('Item', 'event_espresso'); ?></th>
54
-					<?php if ($show_line_item_description){?><th class="left event_th"><?php _e('Description', 'event_espresso'); ?></th><?php }?>
54
+					<?php if ($show_line_item_description) {?><th class="left event_th"><?php _e('Description', 'event_espresso'); ?></th><?php }?>
55 55
 					<th class="quantity_th"><?php _e('Qty', 'event_espresso'); ?></th>
56 56
 					<th class="left event_th"><?php _e('Price', 'event_espresso'); ?></th>
57 57
 					<th class="subtotal_th item_r"><?php _e('Total', 'event_espresso'); ?></th>
@@ -65,56 +65,56 @@  discard block
 block discarded – undo
65 65
 				 * @param EE_Line_Item $line_item
66 66
 				 * @param boolean $odd for indicating whether to style this line item as an 'odd' or 'even'
67 67
 				 */
68
-				function ee_invoice_display_line_item(EE_Line_Item $line_item, $show_line_item_description, $odd = false){
69
-					switch($line_item->type()){
68
+				function ee_invoice_display_line_item(EE_Line_Item $line_item, $show_line_item_description, $odd = false) {
69
+					switch ($line_item->type()) {
70 70
 						case EEM_Line_Item::type_total:
71
-							foreach($line_item->children() as $child_line_item){
72
-								ee_invoice_display_line_item($child_line_item,$show_line_item_description);
71
+							foreach ($line_item->children() as $child_line_item) {
72
+								ee_invoice_display_line_item($child_line_item, $show_line_item_description);
73 73
 								}?>
74 74
 							<tr><td colspan="<?php echo $show_line_item_description ? 5 : 4 ?>"><hr></td></tr>
75 75
 							<tr class="total_tr odd">
76 76
 								<td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>">&nbsp;</td>
77 77
 								<td colspan="2" class="total" id="total_currency"><?php _e('Total', 'event_espresso'); ?></td>
78
-								<td class="total"><?php echo $line_item->total_no_code();?></td>
78
+								<td class="total"><?php echo $line_item->total_no_code(); ?></td>
79 79
 							</tr>
80 80
 						<?php break;
81 81
 
82 82
 
83 83
 						case EEM_Line_Item::type_sub_total:
84
-							foreach($line_item->children() as $child_line_item){
84
+							foreach ($line_item->children() as $child_line_item) {
85 85
 							//$odd = !$odd;
86
-								ee_invoice_display_line_item($child_line_item,$show_line_item_description,$odd);
86
+								ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd);
87 87
 							}?>
88 88
 							<tr class="total_tr odd">
89 89
 								<td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>">&nbsp;</td>
90 90
 								<td colspan="2" class="total" id="total_currency"><?php _e('Sub-Total', 'event_espresso'); ?></td>
91
-								<td class="total"><?php echo $line_item->total_no_code();?></td>
91
+								<td class="total"><?php echo $line_item->total_no_code(); ?></td>
92 92
 							</tr>
93 93
 						<?php break;
94 94
 
95 95
 
96 96
 						case EEM_Line_Item::type_tax_sub_total:
97
-							foreach($line_item->children() as $child_line_item){
98
-								$odd = !$odd;
97
+							foreach ($line_item->children() as $child_line_item) {
98
+								$odd = ! $odd;
99 99
 								ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd);
100 100
 							}?>
101 101
 							<tr class="total_tr odd">
102 102
 								<td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>">&nbsp;</td>
103 103
 								<td colspan="2" class="total" id="total_currency"><?php _e('Tax Total', 'event_espresso'); ?></td>
104
-								<td class="total"><?php echo $line_item->total_no_code();?></td>
104
+								<td class="total"><?php echo $line_item->total_no_code(); ?></td>
105 105
 							</tr>
106 106
 						<?php break;
107 107
 
108 108
 
109 109
 						case EEM_Line_Item::type_line_item:
110 110
 							$subitems = $line_item->children();
111
-							$has_subitems  = count($subitems) > 1 ;
112
-							if($has_subitems){
111
+							$has_subitems = count($subitems) > 1;
112
+							if ($has_subitems) {
113 113
 							?>
114
-							<tr class="item <?php echo $odd ?   'odd' : ''; ?>">
114
+							<tr class="item <?php echo $odd ? 'odd' : ''; ?>">
115 115
 								<td class="item_l"><?php echo $line_item->name() ?></td>
116
-								<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
117
-								<td class="item_l"><?php echo $line_item->quantity();?></td>
116
+								<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
117
+								<td class="item_l"><?php echo $line_item->quantity(); ?></td>
118 118
 
119 119
 								<td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
120 120
 
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
 								<?php //<td class="item_l"><?php  $datetimes_strings = array(); foreach($datetimes as $datetime){ $datetimes_strings[]= $datetime->start_date_and_time();} echo implode(", ",$datetimes_strings); ?>
123 123
 							</tr>
124 124
 							<?php
125
-								if( $has_subitems ){
126
-									foreach($line_item->children() as $child_line_item){
127
-										ee_invoice_display_line_item($child_line_item,$show_line_item_description, $odd);
125
+								if ($has_subitems) {
126
+									foreach ($line_item->children() as $child_line_item) {
127
+										ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd);
128 128
 									}
129 129
 								}
130
-							}else{//no subitems - just show this line item ?>
131
-								<tr class="item <?php echo $odd ?   'odd' : ''; ?>">
130
+							} else {//no subitems - just show this line item ?>
131
+								<tr class="item <?php echo $odd ? 'odd' : ''; ?>">
132 132
 									<td class="item_l"><?php echo $line_item->name()?></td>
133
-									<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
133
+									<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
134 134
 									<td class="item_l"><?php echo $line_item->quantity()?></td>
135 135
 									<td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
136 136
 									<td class="item_r"> <?php echo $line_item->total_no_code(); echo $line_item->is_taxable() ? '*' : ''?> </td>
@@ -143,32 +143,32 @@  discard block
 block discarded – undo
143 143
 							?>
144 144
 						<tr class="item subitem-row">
145 145
 							<td class="item_l subitem"><?php echo $line_item->name(); ?></td>
146
-							<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
146
+							<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
147 147
 							<?php if ($line_item->is_percent()) { ?>
148 148
 									<td></td>
149
-									<td class="item_c"><?php echo $line_item->percent();?>%</td>
150
-							<?php }else{//flat discount/surcharge ?>
149
+									<td class="item_c"><?php echo $line_item->percent(); ?>%</td>
150
+							<?php } else {//flat discount/surcharge ?>
151 151
 									<td></td>
152
-									<td class="item_c"><?php echo $line_item->unit_price_no_code();?></td>
152
+									<td class="item_c"><?php echo $line_item->unit_price_no_code(); ?></td>
153 153
 							<?php } ?>
154
-							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
154
+							<td class="item_r"><?php echo $line_item->total_no_code(); ?></td>
155 155
 						</tr>
156 156
 						<?php break;
157 157
 					case EEM_Line_Item::type_tax:
158 158
 							?>
159 159
 						<tr class="item sub-item tax-total">
160 160
 							<td class="item_l"><?php echo $line_item->name(); ?></td>
161
-							<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
161
+							<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
162 162
 							<td colspan="2" class="item_c"><?php echo $line_item->percent(); ?>%</td>
163 163
 
164
-							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
164
+							<td class="item_r"><?php echo $line_item->total_no_code(); ?></td>
165 165
 						</tr><?php break;
166 166
 					}
167 167
 				}
168
-				$c=false;
168
+				$c = false;
169 169
 				/* @var $transaction EE_Transaction */
170 170
 				$total_line_item = $transaction->total_line_item();
171
-				ee_invoice_display_line_item($total_line_item,$show_line_item_description);
171
+				ee_invoice_display_line_item($total_line_item, $show_line_item_description);
172 172
 				/* foreach($transaction->registrations() as $registration){
173 173
 					 ?>
174 174
 					<tr class="item <?php echo ($c = !$c) ? ' odd' : ''; ?>">
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
 			</tbody>
184 184
 
185 185
 		</table>
186
-		<p><?php _e("* taxable items", "event_espresso");?></p>
187
-		<h2><?php _e("Payments",'event_espresso')?></h2>
186
+		<p><?php _e("* taxable items", "event_espresso"); ?></p>
187
+		<h2><?php _e("Payments", 'event_espresso')?></h2>
188 188
 		<table class="invoice-amount">
189 189
 			<thead>
190 190
 				<tr class="header_row">
191 191
 					<th ><span class=""><?php _e('Payment Method', 'event_espresso'); ?></span></th>
192
-					<th class='left datetime_th'><?php _e("Date",'event_espresso')?></th>
192
+					<th class='left datetime_th'><?php _e("Date", 'event_espresso')?></th>
193 193
 					<th ><span class=""><?php _e('Transaction Id / Cheque #', 'event_espresso'); ?></span></th>
194 194
 					<th ><span class=""><?php _e('P.O. / S.O.#', 'event_espresso'); ?></span></th>
195 195
 					<th ><span class=""><?php _e('Status', 'event_espresso'); ?></span></th>
@@ -199,29 +199,29 @@  discard block
 block discarded – undo
199 199
 			<tbody>
200 200
 				<?php
201 201
 				$c = false;
202
-				if(!empty($payments)){
202
+				if ( ! empty($payments)) {
203 203
 
204
-					foreach($payments as $payment){
204
+					foreach ($payments as $payment) {
205 205
 						/* @var $payment EE_Payment */?>
206
-					<tr class='item <?php echo (($c = !$c) ? ' odd' : '')?>'>
206
+					<tr class='item <?php echo (($c = ! $c) ? ' odd' : '')?>'>
207 207
 						<td><?php $payment->e('PAY_gateway')?></td>
208 208
 						<td><?php echo $payment->timestamp('D M j, Y')?></td>
209 209
 						<td><?php $payment->e('PAY_txn_id_chq_nmbr')?></td>
210 210
 						<td><?php $payment->e('PAY_po_number')?></td>
211 211
 						<td><?php $payment->e_pretty_status()?></td>
212
-						<td class='item_r'><?php echo EEH_Template::format_currency($payment->amount());?></td>
212
+						<td class='item_r'><?php echo EEH_Template::format_currency($payment->amount()); ?></td>
213 213
 					</tr>
214 214
 					<?php }
215
-				}else{?>
215
+				} else {?>
216 216
 					<tr class='item'>
217
-						<td class='aln-cntr' colspan=6><?php _e("No approved payments have been received",'event_espresso')?></td>
217
+						<td class='aln-cntr' colspan=6><?php _e("No approved payments have been received", 'event_espresso')?></td>
218 218
 					</tr>
219 219
 				<?php }
220 220
 ?>
221 221
 			</tbody>
222 222
 			<tfoot>
223 223
 				<tr class='total_tr'><td colspan="4"></td>
224
-					<td class="item_r"><?php _e('Total Paid','event_espresso')?></td>
224
+					<td class="item_r"><?php _e('Total Paid', 'event_espresso')?></td>
225 225
 					<td class="item_r"><?php echo EEH_Template::format_currency($amount_pd)?> </td>
226 226
 				</tr>
227 227
 				<?php //echo $discount; ?>
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 										ee_invoice_display_line_item($child_line_item,$show_line_item_description, $odd);
128 128
 									}
129 129
 								}
130
-							}else{//no subitems - just show this line item ?>
130
+							} else{//no subitems - just show this line item ?>
131 131
 								<tr class="item <?php echo $odd ?   'odd' : ''; ?>">
132 132
 									<td class="item_l"><?php echo $line_item->name()?></td>
133 133
 									<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 							<?php if ($line_item->is_percent()) { ?>
148 148
 									<td></td>
149 149
 									<td class="item_c"><?php echo $line_item->percent();?>%</td>
150
-							<?php }else{//flat discount/surcharge ?>
150
+							<?php } else{//flat discount/surcharge ?>
151 151
 									<td></td>
152 152
 									<td class="item_c"><?php echo $line_item->unit_price_no_code();?></td>
153 153
 							<?php } ?>
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 						<td class='item_r'><?php echo EEH_Template::format_currency($payment->amount());?></td>
213 213
 					</tr>
214 214
 					<?php }
215
-				}else{?>
215
+				} else{?>
216 216
 					<tr class='item'>
217 217
 						<td class='aln-cntr' colspan=6><?php _e("No approved payments have been received",'event_espresso')?></td>
218 218
 					</tr>
Please login to merge, or discard this patch.