1
|
|
|
<?php |
2
|
|
|
namespace Page; |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* RegistrationsAdmin |
6
|
|
|
* Selectors/References to elements in the Registrations admin pages. |
7
|
|
|
* |
8
|
|
|
* @package Page |
9
|
|
|
* @author Darren Ethier |
10
|
|
|
* @since 1.0.0 |
11
|
|
|
*/ |
12
|
|
|
class RegistrationsAdmin extends CoreAdmin |
13
|
|
|
{ |
14
|
|
|
|
15
|
|
|
const REGISTRATION_STATUS_NOT_APPROVED = 'RNA'; |
16
|
|
|
const REGISTRATION_STATUS_APPROVED = 'RAP'; |
17
|
|
|
const REGISTRATION_STATUS_PENDING_PAYMENT = 'RPP'; |
18
|
|
|
const SEARCH_INPUT_SELECTOR_LIST_TABLE_REGISTRATION = '#event-espresso_page_espresso_registrations-search-input'; |
19
|
|
|
const BUTTON_ADD_NEW_REGISTRATION = '#add-new-registration'; |
20
|
|
|
const DROPDOWN_REGISTRATION_STATUS = '#reg-status-change-form-reg-status'; |
21
|
|
|
const BUTTON_UPDATE_REGISTRATION_STATUS = '#reg-status-change-form-submit-submit'; |
22
|
|
|
const DROPDOWN_SEND_RELATED_MESSAGES = '#reg-status-change-form-send-notifications'; |
23
|
|
|
|
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param string $additional_params |
27
|
|
|
* @return string |
28
|
|
|
*/ |
29
|
|
|
public static function registrationsDefaultAdminListTableUrl($additional_params = '') |
30
|
|
|
{ |
31
|
|
|
return self::adminUrl('espresso_registrations', 'default', $additional_params); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Given a registration id, this will return the selector for all the checkbox for that id. |
37
|
|
|
* Assumes the view is the default registrations list table. |
38
|
|
|
* @param int $registration_id |
39
|
|
|
* @return string |
40
|
|
|
*/ |
41
|
|
|
public static function listTableCheckBoxSelectorForRegistrationId($registration_id) |
42
|
|
|
{ |
43
|
|
|
return "//input[@name='_REG_ID[]' and @value='{$registration_id}']"; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Given a registration id, this will return the selector for the link to the registration details. |
49
|
|
|
* Assumes the view is the default registrations list table. |
50
|
|
|
* @param int $registration_id |
51
|
|
|
* @return string |
52
|
|
|
*/ |
53
|
|
|
public static function viewDetailsLinkSelectorForRegistrationId($registration_id) |
54
|
|
|
{ |
55
|
|
|
return "//tbody[@id='the-list']/tr/td[contains(@class, 'column-_REG_ID') and contains(., $registration_id)]" |
56
|
|
|
. "//ancestor::tr/td[contains(@class, 'column-ATT_fname')]/a[1]"; |
57
|
|
|
} |
58
|
|
|
} |