Completed
Branch BUG-9050-duplicate-contacts (ffab8b)
by
unknown
12:24 queued 14s
created
caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -284,12 +284,12 @@  discard block
 block discarded – undo
284 284
 			);
285 285
 			$title = esc_attr__( 'Duplicate Event', 'event_espresso' );
286 286
 			$return .= '<a href="'
287
-			           . $href
288
-			           . '" title="'
289
-			           . $title
290
-			           . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
291
-			           . $title
292
-			           . '</button>';
287
+					   . $href
288
+					   . '" title="'
289
+					   . $title
290
+					   . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
291
+					   . $title
292
+					   . '</button>';
293 293
 		}
294 294
 		return $return;
295 295
 	}
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
 			);
451 451
 			$reports_link = EE_Admin_Page::add_query_args_and_nonce( $reports_query_args, REG_ADMIN_URL );
452 452
 			$action_links[] = '<a href="'
453
-			                  . $reports_link
454
-			                  . '" title="'
455
-			                  . esc_attr__( 'View Report', 'event_espresso' )
456
-			                  . '"><div class="dashicons dashicons-chart-bar"></div></a>'
457
-			                  . "\n\t";
453
+							  . $reports_link
454
+							  . '" title="'
455
+							  . esc_attr__( 'View Report', 'event_espresso' )
456
+							  . '"><div class="dashicons dashicons-chart-bar"></div></a>'
457
+							  . "\n\t";
458 458
 		}
459 459
 		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
460 460
 			EE_Registry::instance()->load_helper( 'MSG_Template' );
Please login to merge, or discard this patch.
registration_form/espresso_events_Registration_Form_Hooks_Extend.class.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -44,30 +44,30 @@  discard block
 block discarded – undo
44 44
 	 * @return void
45 45
 	 */
46 46
 	protected function _extend_properties() {
47
-        $this->_metaboxes = array_merge(
48
-            $this->_metaboxes,
49
-            array(
50
-                1 => array(
51
-                    'page_route' => array('create_new', 'edit'),
52
-                    'func'       => 'additional_questions',
53
-                    'label'      => __('Questions for Additional Registrants', 'event_espresso'),
54
-                    'priority'   => 'default',
55
-                    'context'    => 'side',
56
-                ),
57
-            )
58
-        );
59
-        $this->_scripts_styles = array(
60
-            'registers' => array(
61
-                'extended-event-editor' => array(
62
-                    'url'     => EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/assets/event-editor-question-groups.js',
63
-                    'depends' => array('jquery')
64
-                )
65
-            ),
66
-            'enqueues'  => array(
67
-                'extended-event-editor' => array('edit', 'create_new')
68
-            ),
69
-        );
70
-    }
47
+		$this->_metaboxes = array_merge(
48
+			$this->_metaboxes,
49
+			array(
50
+				1 => array(
51
+					'page_route' => array('create_new', 'edit'),
52
+					'func'       => 'additional_questions',
53
+					'label'      => __('Questions for Additional Registrants', 'event_espresso'),
54
+					'priority'   => 'default',
55
+					'context'    => 'side',
56
+				),
57
+			)
58
+		);
59
+		$this->_scripts_styles = array(
60
+			'registers' => array(
61
+				'extended-event-editor' => array(
62
+					'url'     => EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/assets/event-editor-question-groups.js',
63
+					'depends' => array('jquery')
64
+				)
65
+			),
66
+			'enqueues'  => array(
67
+				'extended-event-editor' => array('edit', 'create_new')
68
+			),
69
+		);
70
+	}
71 71
 
72 72
 
73 73
 
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 						<input value="' . $QSG->ID() . '" type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' />
125 125
 						<a href="' . $edit_link . '" title="' . sprintf( esc_attr__( 'Edit %s Group', 'event_espresso' ),  $QSG->get('QSG_name') ) . '" target="_blank">' . $QSG->get('QSG_name') . '</a>
126 126
 					</p>';
127
-                    if ($QSG->ID() === 2) {
128
-                        $html .= '
127
+					if ($QSG->ID() === 2) {
128
+						$html .= '
129 129
 					<p id="question-group-requirements-notice-pg" class="important-notice small-text" style="display: none;">
130 130
 					    '. esc_html__('The Personal Information question group is required whenever the Address Information question group is activated.', 'event_espresso').'
131 131
 					</p>';
132
-                    }
132
+					}
133 133
 				}
134 134
 				$html .= count( $QSGs ) > 10 ? '</div>' : '';
135 135
 
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 class espresso_events_Registration_Form_Hooks_Extend extends espresso_events_Registration_Form_Hooks {
31 31
 
32 32
 
33
-	public function __construct( EE_Admin_Page $admin_page ) {
33
+	public function __construct(EE_Admin_Page $admin_page) {
34 34
 		parent::__construct($admin_page);
35 35
 	}
36 36
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $this->_scripts_styles = array(
60 60
             'registers' => array(
61 61
                 'extended-event-editor' => array(
62
-                    'url'     => EE_CORE_CAF_ADMIN_EXTEND_URL . 'registration_form/assets/event-editor-question-groups.js',
62
+                    'url'     => EE_CORE_CAF_ADMIN_EXTEND_URL.'registration_form/assets/event-editor-question-groups.js',
63 63
                     'depends' => array('jquery')
64 64
                 )
65 65
             ),
@@ -72,25 +72,25 @@  discard block
 block discarded – undo
72 72
 
73 73
 
74 74
 
75
-	public function modify_callbacks( $callbacks ) {
76
-		$callbacks = parent::modify_callbacks( $callbacks );
77
-		$callbacks[] = array( $this, 'additional_question_group_update' );
75
+	public function modify_callbacks($callbacks) {
76
+		$callbacks = parent::modify_callbacks($callbacks);
77
+		$callbacks[] = array($this, 'additional_question_group_update');
78 78
 		return $callbacks;
79 79
 	}
80 80
 
81 81
 
82 82
 
83
-	public function restore_revision( $post_id, $revision_id ) {
84
-		$post_evt = parent::restore_revision( $post_id, $revision_id );
83
+	public function restore_revision($post_id, $revision_id) {
84
+		$post_evt = parent::restore_revision($post_id, $revision_id);
85 85
 
86 86
 		//restore revision for additional questions
87
-		$post_evt->restore_revision( $revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 0 ) ) );
87
+		$post_evt->restore_revision($revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 0)));
88 88
 	}
89 89
 
90 90
 
91 91
 
92 92
 
93
-	public function additional_questions( $post_id, $post ) {
93
+	public function additional_questions($post_id, $post) {
94 94
 		$this->_event = $this->_adminpage_obj->get_event_object();
95 95
 		$event_id = $this->_event->ID();
96 96
 		?>
@@ -107,22 +107,22 @@  discard block
 block discarded – undo
107 107
 			<?php
108 108
 
109 109
 			$qsg_where['QSG_deleted'] = FALSE;
110
-			$query_params = array( $qsg_where, 'order_by' => array( 'QSG_order' => 'ASC' ) );
111
-			$QSGs = EEM_Question_Group::instance()->get_all( $query_params );
112
-			$EQGs = !empty( $event_id ) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0 )) ) : array();
110
+			$query_params = array($qsg_where, 'order_by' => array('QSG_order' => 'ASC'));
111
+			$QSGs = EEM_Question_Group::instance()->get_all($query_params);
112
+			$EQGs = ! empty($event_id) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0))) : array();
113 113
 			$EQGids = array_keys($EQGs);
114 114
 
115
-			if ( ! empty( $QSGs )) {
116
- 				$html = count( $QSGs ) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
117
-				foreach ( $QSGs as $QSG ) {
115
+			if ( ! empty($QSGs)) {
116
+ 				$html = count($QSGs) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
117
+				foreach ($QSGs as $QSG) {
118 118
 
119
-					$checked = in_array( $QSG->ID(), $EQGids ) ? ' checked="checked" ' : '';
120
-					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce( array( 'action' => 'edit_question_group', 'QSG_ID' => $QSG->ID() ), EE_FORMS_ADMIN_URL );
119
+					$checked = in_array($QSG->ID(), $EQGids) ? ' checked="checked" ' : '';
120
+					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce(array('action' => 'edit_question_group', 'QSG_ID' => $QSG->ID()), EE_FORMS_ADMIN_URL);
121 121
 
122 122
 					$html .= '
123
-					<p id="event-question-group-' . $QSG->ID() . '">
124
-						<input value="' . $QSG->ID() . '" type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' />
125
-						<a href="' . $edit_link . '" title="' . sprintf( esc_attr__( 'Edit %s Group', 'event_espresso' ),  $QSG->get('QSG_name') ) . '" target="_blank">' . $QSG->get('QSG_name') . '</a>
123
+					<p id="event-question-group-' . $QSG->ID().'">
124
+						<input value="' . $QSG->ID().'" type="checkbox" name="add_attendee_question_groups['.$QSG->ID().']"'.$checked.' />
125
+						<a href="' . $edit_link.'" title="'.sprintf(esc_attr__('Edit %s Group', 'event_espresso'), $QSG->get('QSG_name')).'" target="_blank">'.$QSG->get('QSG_name').'</a>
126 126
 					</p>';
127 127
                     if ($QSG->ID() === 2) {
128 128
                         $html .= '
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 					</p>';
132 132
                     }
133 133
 				}
134
-				$html .= count( $QSGs ) > 10 ? '</div>' : '';
134
+				$html .= count($QSGs) > 10 ? '</div>' : '';
135 135
 
136 136
 				echo $html;
137 137
 
138 138
 			} else {
139 139
 				echo __('There seems to be a problem with your questions. Please contact [email protected]', 'event_espresso');
140 140
 			}
141
-			do_action( 'AHEE__espresso_events_Registration_Form_Hooks__additional_questions__after_content' );
141
+			do_action('AHEE__espresso_events_Registration_Form_Hooks__additional_questions__after_content');
142 142
 			?>
143 143
 		</div>
144 144
 		<?php
@@ -148,31 +148,31 @@  discard block
 block discarded – undo
148 148
 
149 149
 
150 150
 
151
-	public function additional_question_group_update( $evtobj, $data ) {
152
-		$question_groups = !empty( $data['add_attendee_question_groups'] ) ? (array) $data['add_attendee_question_groups'] : array();
151
+	public function additional_question_group_update($evtobj, $data) {
152
+		$question_groups = ! empty($data['add_attendee_question_groups']) ? (array) $data['add_attendee_question_groups'] : array();
153 153
 		$added_qgs = array_keys($question_groups);
154 154
 		$success = array();
155 155
 
156 156
 		//let's get all current question groups associated with this event.
157
-		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0) ) );
157
+		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0)));
158 158
 		$current_qgs = array_keys($current_qgs); //we just want the ids
159 159
 
160 160
 		//now let's get the groups selected in the editor and update (IF we have data)
161
-		if ( !empty( $question_groups ) ) {
162
-			foreach ( $question_groups as $id => $val ) {
161
+		if ( ! empty($question_groups)) {
162
+			foreach ($question_groups as $id => $val) {
163 163
 				//add to event
164
-				if ( $val )
165
-					$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 0) );
166
-				$success[] = !empty($qg) ? 1 : 0;
164
+				if ($val)
165
+					$qg = $evtobj->_add_relation_to($id, 'Question_Group', array('EQG_primary' => 0));
166
+				$success[] = ! empty($qg) ? 1 : 0;
167 167
 			}
168 168
 		}
169 169
 
170 170
 		//wait a minute... are there question groups missing in the saved groups that ARE with the current event?
171
-		$removed_qgs = array_diff( $current_qgs, $added_qgs );
171
+		$removed_qgs = array_diff($current_qgs, $added_qgs);
172 172
 
173
-		foreach ( $removed_qgs as $qgid ) {
174
-			$qg = $evtobj->_remove_relation_to( $qgid, 'Question_Group', array('EQG_primary' => 0 ) );
175
-			$success[] = !empty($qg) ? 1 : 0;
173
+		foreach ($removed_qgs as $qgid) {
174
+			$qg = $evtobj->_remove_relation_to($qgid, 'Question_Group', array('EQG_primary' => 0));
175
+			$success[] = ! empty($qg) ? 1 : 0;
176 176
 		}
177 177
 
178 178
 
Please login to merge, or discard this patch.