@@ -13,35 +13,35 @@ |
||
| 13 | 13 | class CoreAdmin |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @var string |
|
| 18 | - */ |
|
| 19 | - const URL_PREFIX = 'admin.php?page='; |
|
| 16 | + /** |
|
| 17 | + * @var string |
|
| 18 | + */ |
|
| 19 | + const URL_PREFIX = 'admin.php?page='; |
|
| 20 | 20 | |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * This is the selector for the next page button on list tables. |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 26 | - const ADMIN_LIST_TABLE_NEXT_PAGE_CLASS = '.next-page'; |
|
| 22 | + /** |
|
| 23 | + * This is the selector for the next page button on list tables. |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | + const ADMIN_LIST_TABLE_NEXT_PAGE_CLASS = '.next-page'; |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Get the EE admin url for the given properties. |
|
| 31 | - * Note, this is JUST the endpoint for the admin route. It is expected that the actor/test would be calling this |
|
| 32 | - * with `amOnAdminPage` action. |
|
| 33 | - * |
|
| 34 | - * @param string $page |
|
| 35 | - * @param string $action |
|
| 36 | - * @param string $additional_params |
|
| 37 | - * @return string |
|
| 38 | - */ |
|
| 39 | - public static function adminUrl($page = 'espresso_events', $action = 'default', $additional_params = '') |
|
| 40 | - { |
|
| 41 | - $url = self::URL_PREFIX . $page; |
|
| 42 | - $url .= $action ? '&action=' . $action : ''; |
|
| 43 | - $url .= $additional_params ? '&' . ltrim('&', ltrim('?', $additional_params)) : ''; |
|
| 44 | - return $url; |
|
| 45 | - } |
|
| 29 | + /** |
|
| 30 | + * Get the EE admin url for the given properties. |
|
| 31 | + * Note, this is JUST the endpoint for the admin route. It is expected that the actor/test would be calling this |
|
| 32 | + * with `amOnAdminPage` action. |
|
| 33 | + * |
|
| 34 | + * @param string $page |
|
| 35 | + * @param string $action |
|
| 36 | + * @param string $additional_params |
|
| 37 | + * @return string |
|
| 38 | + */ |
|
| 39 | + public static function adminUrl($page = 'espresso_events', $action = 'default', $additional_params = '') |
|
| 40 | + { |
|
| 41 | + $url = self::URL_PREFIX . $page; |
|
| 42 | + $url .= $action ? '&action=' . $action : ''; |
|
| 43 | + $url .= $additional_params ? '&' . ltrim('&', ltrim('?', $additional_params)) : ''; |
|
| 44 | + return $url; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | } |
| 48 | 48 | \ No newline at end of file |
@@ -14,103 +14,103 @@ |
||
| 14 | 14 | class EventsAdmin extends CoreAdmin |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Selector for the Add new Event button in the admin. |
|
| 19 | - * @var string |
|
| 20 | - */ |
|
| 21 | - const ADD_NEW_EVENT_BUTTON_SELECTOR = '#add-new-event'; |
|
| 22 | - |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * Selector for the Event Title field in the event editor |
|
| 26 | - * @var string |
|
| 27 | - */ |
|
| 28 | - const EVENT_EDITOR_TITLE_FIELD_SELECTOR = "//input[@id='title']"; |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * Selector for the publish submit button in the event editor. |
|
| 32 | - * @var string |
|
| 33 | - */ |
|
| 34 | - const EVENT_EDITOR_PUBLISH_BUTTON_SELECTOR = "#publish"; |
|
| 35 | - |
|
| 36 | - /** |
|
| 37 | - * Selector for the view link after publishing an event. |
|
| 38 | - * @var string |
|
| 39 | - */ |
|
| 40 | - const EVENT_EDITOR_VIEW_LINK_AFTER_PUBLISH_SELECTOR = "//div[@id='message']/p/a"; |
|
| 41 | - |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * Selector for the ID of the event in the event editor |
|
| 45 | - * @var string |
|
| 46 | - */ |
|
| 47 | - const EVENT_EDITOR_EVT_ID_SELECTOR = "//input[@id='post_ID']"; |
|
| 48 | - |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @param string $additional_params |
|
| 52 | - * @return string |
|
| 53 | - */ |
|
| 54 | - public static function defaultEventsListTableUrl($additional_params = '') |
|
| 55 | - { |
|
| 56 | - return self::adminUrl('espresso_events', 'default', $additional_params); |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * The selector for the DTTname field for the given row in the event editor. |
|
| 62 | - * @param int $row_number |
|
| 63 | - * @return string |
|
| 64 | - */ |
|
| 65 | - public static function eventEditorDatetimeNameFieldSelector($row_number = 1) |
|
| 66 | - { |
|
| 67 | - return self::eventEditorDatetimeFieldSelectorForField('DTT_name', $row_number); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - |
|
| 71 | - /** |
|
| 72 | - * The selector for the DTT_EVT_start field for the given row in the event editor.d |
|
| 73 | - * @param int $row_number |
|
| 74 | - * @return string |
|
| 75 | - */ |
|
| 76 | - public static function eventEditorDatetimeStartDateFieldSelector($row_number = 1) |
|
| 77 | - { |
|
| 78 | - return self::eventEditorDatetimeFieldSelectorForField('DTT_EVT_start', $row_number); |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - |
|
| 82 | - /** |
|
| 83 | - * Wrapper for getting the selector for a given field and given row of a datetime in the event editor. |
|
| 84 | - * |
|
| 85 | - * @param string $field_name |
|
| 86 | - * @param int $row_number |
|
| 87 | - * @return string |
|
| 88 | - */ |
|
| 89 | - public static function eventEditorDatetimeFieldSelectorForField($field_name, $row_number = 1) |
|
| 90 | - { |
|
| 91 | - return "//input[@id='event-datetime-$field_name-$row_number']"; |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * The selector for the TKT_name field for the given display row in the event editor. |
|
| 97 | - * @param int $row_number |
|
| 98 | - * @return string |
|
| 99 | - */ |
|
| 100 | - public static function eventEditorTicketNameFieldSelector($row_number = 1) |
|
| 101 | - { |
|
| 102 | - return self::eventEditorTicketFieldSelectorForFieldInDisplayRow('TKT_name', $row_number); |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * Wrapper for getting the selector for a given field and given display row of a ticket in the event editor. |
|
| 108 | - * @param $field_name |
|
| 109 | - * @param int $row_number |
|
| 110 | - * @return string |
|
| 111 | - */ |
|
| 112 | - public static function eventEditorTicketFieldSelectorForFieldInDisplayRow($field_name, $row_number = 1) |
|
| 113 | - { |
|
| 114 | - return "//tr[@id='display-ticketrow-$row_number']/td[2]/input[@class='edit-ticket-$field_name ee-large-text-inp']"; |
|
| 115 | - } |
|
| 17 | + /** |
|
| 18 | + * Selector for the Add new Event button in the admin. |
|
| 19 | + * @var string |
|
| 20 | + */ |
|
| 21 | + const ADD_NEW_EVENT_BUTTON_SELECTOR = '#add-new-event'; |
|
| 22 | + |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * Selector for the Event Title field in the event editor |
|
| 26 | + * @var string |
|
| 27 | + */ |
|
| 28 | + const EVENT_EDITOR_TITLE_FIELD_SELECTOR = "//input[@id='title']"; |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * Selector for the publish submit button in the event editor. |
|
| 32 | + * @var string |
|
| 33 | + */ |
|
| 34 | + const EVENT_EDITOR_PUBLISH_BUTTON_SELECTOR = "#publish"; |
|
| 35 | + |
|
| 36 | + /** |
|
| 37 | + * Selector for the view link after publishing an event. |
|
| 38 | + * @var string |
|
| 39 | + */ |
|
| 40 | + const EVENT_EDITOR_VIEW_LINK_AFTER_PUBLISH_SELECTOR = "//div[@id='message']/p/a"; |
|
| 41 | + |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * Selector for the ID of the event in the event editor |
|
| 45 | + * @var string |
|
| 46 | + */ |
|
| 47 | + const EVENT_EDITOR_EVT_ID_SELECTOR = "//input[@id='post_ID']"; |
|
| 48 | + |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @param string $additional_params |
|
| 52 | + * @return string |
|
| 53 | + */ |
|
| 54 | + public static function defaultEventsListTableUrl($additional_params = '') |
|
| 55 | + { |
|
| 56 | + return self::adminUrl('espresso_events', 'default', $additional_params); |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * The selector for the DTTname field for the given row in the event editor. |
|
| 62 | + * @param int $row_number |
|
| 63 | + * @return string |
|
| 64 | + */ |
|
| 65 | + public static function eventEditorDatetimeNameFieldSelector($row_number = 1) |
|
| 66 | + { |
|
| 67 | + return self::eventEditorDatetimeFieldSelectorForField('DTT_name', $row_number); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + |
|
| 71 | + /** |
|
| 72 | + * The selector for the DTT_EVT_start field for the given row in the event editor.d |
|
| 73 | + * @param int $row_number |
|
| 74 | + * @return string |
|
| 75 | + */ |
|
| 76 | + public static function eventEditorDatetimeStartDateFieldSelector($row_number = 1) |
|
| 77 | + { |
|
| 78 | + return self::eventEditorDatetimeFieldSelectorForField('DTT_EVT_start', $row_number); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * Wrapper for getting the selector for a given field and given row of a datetime in the event editor. |
|
| 84 | + * |
|
| 85 | + * @param string $field_name |
|
| 86 | + * @param int $row_number |
|
| 87 | + * @return string |
|
| 88 | + */ |
|
| 89 | + public static function eventEditorDatetimeFieldSelectorForField($field_name, $row_number = 1) |
|
| 90 | + { |
|
| 91 | + return "//input[@id='event-datetime-$field_name-$row_number']"; |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * The selector for the TKT_name field for the given display row in the event editor. |
|
| 97 | + * @param int $row_number |
|
| 98 | + * @return string |
|
| 99 | + */ |
|
| 100 | + public static function eventEditorTicketNameFieldSelector($row_number = 1) |
|
| 101 | + { |
|
| 102 | + return self::eventEditorTicketFieldSelectorForFieldInDisplayRow('TKT_name', $row_number); |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * Wrapper for getting the selector for a given field and given display row of a ticket in the event editor. |
|
| 108 | + * @param $field_name |
|
| 109 | + * @param int $row_number |
|
| 110 | + * @return string |
|
| 111 | + */ |
|
| 112 | + public static function eventEditorTicketFieldSelectorForFieldInDisplayRow($field_name, $row_number = 1) |
|
| 113 | + { |
|
| 114 | + return "//tr[@id='display-ticketrow-$row_number']/td[2]/input[@class='edit-ticket-$field_name ee-large-text-inp']"; |
|
| 115 | + } |
|
| 116 | 116 | } |
| 117 | 117 | \ No newline at end of file |
@@ -13,48 +13,48 @@ |
||
| 13 | 13 | class Checkout |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * The class selector for the next step button in the checkout. |
|
| 18 | - * @var string |
|
| 19 | - */ |
|
| 20 | - const NEXT_STEP_BUTTON_SELECTOR = '.spco-next-step-btn'; |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * @param int $attendee_number |
|
| 24 | - * @return string |
|
| 25 | - */ |
|
| 26 | - public static function firstNameFieldSelectorForAttendeeNumber($attendee_number = 1) |
|
| 27 | - { |
|
| 28 | - return self::fieldSelectorForAttendeeNumber('fname', $attendee_number); |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * @param int $attendee_number |
|
| 34 | - * @return string |
|
| 35 | - */ |
|
| 36 | - public static function lastNameFieldSelectorForAttendeeNumber($attendee_number = 1) |
|
| 37 | - { |
|
| 38 | - return self::fieldSelectorForAttendeeNumber('lname', $attendee_number); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * @param int $attendee_number |
|
| 44 | - * @return string |
|
| 45 | - */ |
|
| 46 | - public static function emailFieldSelectorForAttendeeNumber($attendee_number = 1) |
|
| 47 | - { |
|
| 48 | - return self::fieldSelectorForAttendeeNumber('email', $attendee_number); |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * @param $field_name |
|
| 53 | - * @param int $attendee_number |
|
| 54 | - * @return string |
|
| 55 | - */ |
|
| 56 | - public static function fieldSelectorForAttendeeNumber($field_name, $attendee_number = 1) |
|
| 57 | - { |
|
| 58 | - return "//div[starts-with(@id, 'spco-attendee-panel-dv-$attendee_number')]//input[contains(@class, 'ee-reg-qstn-$field_name')]"; |
|
| 59 | - } |
|
| 16 | + /** |
|
| 17 | + * The class selector for the next step button in the checkout. |
|
| 18 | + * @var string |
|
| 19 | + */ |
|
| 20 | + const NEXT_STEP_BUTTON_SELECTOR = '.spco-next-step-btn'; |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @param int $attendee_number |
|
| 24 | + * @return string |
|
| 25 | + */ |
|
| 26 | + public static function firstNameFieldSelectorForAttendeeNumber($attendee_number = 1) |
|
| 27 | + { |
|
| 28 | + return self::fieldSelectorForAttendeeNumber('fname', $attendee_number); |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * @param int $attendee_number |
|
| 34 | + * @return string |
|
| 35 | + */ |
|
| 36 | + public static function lastNameFieldSelectorForAttendeeNumber($attendee_number = 1) |
|
| 37 | + { |
|
| 38 | + return self::fieldSelectorForAttendeeNumber('lname', $attendee_number); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * @param int $attendee_number |
|
| 44 | + * @return string |
|
| 45 | + */ |
|
| 46 | + public static function emailFieldSelectorForAttendeeNumber($attendee_number = 1) |
|
| 47 | + { |
|
| 48 | + return self::fieldSelectorForAttendeeNumber('email', $attendee_number); |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * @param $field_name |
|
| 53 | + * @param int $attendee_number |
|
| 54 | + * @return string |
|
| 55 | + */ |
|
| 56 | + public static function fieldSelectorForAttendeeNumber($field_name, $attendee_number = 1) |
|
| 57 | + { |
|
| 58 | + return "//div[starts-with(@id, 'spco-attendee-panel-dv-$attendee_number')]//input[contains(@class, 'ee-reg-qstn-$field_name')]"; |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -12,130 +12,130 @@ |
||
| 12 | 12 | class MessagesAdmin extends CoreAdmin |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Context slug for the admin messages context. |
|
| 17 | - * @var string |
|
| 18 | - */ |
|
| 19 | - const ADMIN_CONTEXT_SLUG = 'admin'; |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Context slug for the primary attendee messages context |
|
| 23 | - * @var string |
|
| 24 | - */ |
|
| 25 | - const PRIMARY_ATTENDEE_CONTEXT_SLUG = 'primary_attendee'; |
|
| 26 | - |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Status reference for the EEM_Message::status_sent status. |
|
| 30 | - * @var string |
|
| 31 | - */ |
|
| 32 | - const MESSAGE_STATUS_SENT = 'MSN'; |
|
| 33 | - |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Message type slug for the Payment Failed message type |
|
| 37 | - */ |
|
| 38 | - const PAYMENT_FAILED_MESSAGE_TYPE_SLUG = 'payment_failed'; |
|
| 39 | - |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Selector for the Global Messages "Send on same request" field in the Messages Settings tab. |
|
| 43 | - * @var string |
|
| 44 | - */ |
|
| 45 | - const GLOBAL_MESSAGES_SETTINGS_ON_REQUEST_SELECTION_SELECTOR = '#global_messages_settings-do-messages-on-same-request'; |
|
| 46 | - |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * Selector for the Global Messages Settings submit button in the Messages Settings tab. |
|
| 50 | - * @var string |
|
| 51 | - */ |
|
| 52 | - const GLOBAL_MESSAGES_SETTINGS_SUBMIT_SELECTOR = '#global_messages_settings-update-settings-submit'; |
|
| 53 | - |
|
| 54 | - |
|
| 55 | - |
|
| 56 | - /** |
|
| 57 | - * @param string $additional_params Any additional request parameters for the generated url should be included as |
|
| 58 | - * a string. |
|
| 59 | - * @return string |
|
| 60 | - */ |
|
| 61 | - public static function messageActivityListTableUrl($additional_params = '') |
|
| 62 | - { |
|
| 63 | - return self::adminUrl('espresso_messages', 'default', $additional_params); |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * @param string $additional_params Any additional request parameters for the generated url should be included as |
|
| 69 | - * a string. |
|
| 70 | - * @return string |
|
| 71 | - */ |
|
| 72 | - public static function defaultMessageTemplateListTableUrl($additional_params = '') |
|
| 73 | - { |
|
| 74 | - return self::adminUrl('espresso_messages', 'global_mtps', $additional_params); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * @param string $additional_params Any additional request parameters for the generated url should be included as |
|
| 80 | - * a string. |
|
| 81 | - * @return string |
|
| 82 | - */ |
|
| 83 | - public static function customMessageTemplateListTableUrl($additional_params = '') |
|
| 84 | - { |
|
| 85 | - return self::adminUrl('espresso_messages', 'custom_mtps', $additional_params); |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * @return string |
|
| 91 | - */ |
|
| 92 | - public static function messageSettingsUrl() |
|
| 93 | - { |
|
| 94 | - return self::adminUrl('espresso_messages', 'settings'); |
|
| 95 | - } |
|
| 96 | - |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @param string $message_type_slug |
|
| 100 | - * @param string $context |
|
| 101 | - * @return string |
|
| 102 | - */ |
|
| 103 | - public static function editMessageTemplateClassByMessageType($message_type_slug, $context = '') |
|
| 104 | - { |
|
| 105 | - return $context |
|
| 106 | - ? '.' . $message_type_slug . '-' . $context . '-edit-link' |
|
| 107 | - : '.' . $message_type_slug . '-edit-link'; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * Selector for (a) specific table cell(s) in the Messages Activity list table for the given parameters. |
|
| 113 | - * @param $field |
|
| 114 | - * @param $message_type_label |
|
| 115 | - * @param string $message_status |
|
| 116 | - * @param string $messenger |
|
| 117 | - * @param string $context |
|
| 118 | - * @param string $table_cell_content_for_field |
|
| 119 | - * @return string |
|
| 120 | - */ |
|
| 121 | - public static function messagesActivityListTableCellSelectorFor( |
|
| 122 | - $field, |
|
| 123 | - $message_type_label, |
|
| 124 | - $message_status = self::MESSAGE_STATUS_SENT, |
|
| 125 | - $messenger = 'Email', |
|
| 126 | - $context = 'Event Admin', |
|
| 127 | - $table_cell_content_for_field = '' |
|
| 128 | - ) { |
|
| 129 | - $selector = "//tr[contains(@class, 'msg-status-$message_status')]" |
|
| 130 | - . "//td[contains(@class, 'message_type') and text()='$message_type_label']"; |
|
| 131 | - if ($messenger) { |
|
| 132 | - $selector .= "/ancestor::tr/td[contains(@class, 'messenger') and text()='$messenger']"; |
|
| 133 | - } |
|
| 134 | - $selector .= "/ancestor::tr/td[contains(@class, 'column-context') and text()='$context']"; |
|
| 135 | - $selector .= $table_cell_content_for_field |
|
| 136 | - ? "/ancestor::tr/td[contains(@class, 'column-$field') and text()='$table_cell_content_for_field']" |
|
| 137 | - : "/ancestor::tr/td[contains(@class, 'column-$field')]"; |
|
| 138 | - return $selector; |
|
| 139 | - } |
|
| 15 | + /** |
|
| 16 | + * Context slug for the admin messages context. |
|
| 17 | + * @var string |
|
| 18 | + */ |
|
| 19 | + const ADMIN_CONTEXT_SLUG = 'admin'; |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Context slug for the primary attendee messages context |
|
| 23 | + * @var string |
|
| 24 | + */ |
|
| 25 | + const PRIMARY_ATTENDEE_CONTEXT_SLUG = 'primary_attendee'; |
|
| 26 | + |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Status reference for the EEM_Message::status_sent status. |
|
| 30 | + * @var string |
|
| 31 | + */ |
|
| 32 | + const MESSAGE_STATUS_SENT = 'MSN'; |
|
| 33 | + |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Message type slug for the Payment Failed message type |
|
| 37 | + */ |
|
| 38 | + const PAYMENT_FAILED_MESSAGE_TYPE_SLUG = 'payment_failed'; |
|
| 39 | + |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Selector for the Global Messages "Send on same request" field in the Messages Settings tab. |
|
| 43 | + * @var string |
|
| 44 | + */ |
|
| 45 | + const GLOBAL_MESSAGES_SETTINGS_ON_REQUEST_SELECTION_SELECTOR = '#global_messages_settings-do-messages-on-same-request'; |
|
| 46 | + |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * Selector for the Global Messages Settings submit button in the Messages Settings tab. |
|
| 50 | + * @var string |
|
| 51 | + */ |
|
| 52 | + const GLOBAL_MESSAGES_SETTINGS_SUBMIT_SELECTOR = '#global_messages_settings-update-settings-submit'; |
|
| 53 | + |
|
| 54 | + |
|
| 55 | + |
|
| 56 | + /** |
|
| 57 | + * @param string $additional_params Any additional request parameters for the generated url should be included as |
|
| 58 | + * a string. |
|
| 59 | + * @return string |
|
| 60 | + */ |
|
| 61 | + public static function messageActivityListTableUrl($additional_params = '') |
|
| 62 | + { |
|
| 63 | + return self::adminUrl('espresso_messages', 'default', $additional_params); |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @param string $additional_params Any additional request parameters for the generated url should be included as |
|
| 69 | + * a string. |
|
| 70 | + * @return string |
|
| 71 | + */ |
|
| 72 | + public static function defaultMessageTemplateListTableUrl($additional_params = '') |
|
| 73 | + { |
|
| 74 | + return self::adminUrl('espresso_messages', 'global_mtps', $additional_params); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @param string $additional_params Any additional request parameters for the generated url should be included as |
|
| 80 | + * a string. |
|
| 81 | + * @return string |
|
| 82 | + */ |
|
| 83 | + public static function customMessageTemplateListTableUrl($additional_params = '') |
|
| 84 | + { |
|
| 85 | + return self::adminUrl('espresso_messages', 'custom_mtps', $additional_params); |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * @return string |
|
| 91 | + */ |
|
| 92 | + public static function messageSettingsUrl() |
|
| 93 | + { |
|
| 94 | + return self::adminUrl('espresso_messages', 'settings'); |
|
| 95 | + } |
|
| 96 | + |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * @param string $message_type_slug |
|
| 100 | + * @param string $context |
|
| 101 | + * @return string |
|
| 102 | + */ |
|
| 103 | + public static function editMessageTemplateClassByMessageType($message_type_slug, $context = '') |
|
| 104 | + { |
|
| 105 | + return $context |
|
| 106 | + ? '.' . $message_type_slug . '-' . $context . '-edit-link' |
|
| 107 | + : '.' . $message_type_slug . '-edit-link'; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * Selector for (a) specific table cell(s) in the Messages Activity list table for the given parameters. |
|
| 113 | + * @param $field |
|
| 114 | + * @param $message_type_label |
|
| 115 | + * @param string $message_status |
|
| 116 | + * @param string $messenger |
|
| 117 | + * @param string $context |
|
| 118 | + * @param string $table_cell_content_for_field |
|
| 119 | + * @return string |
|
| 120 | + */ |
|
| 121 | + public static function messagesActivityListTableCellSelectorFor( |
|
| 122 | + $field, |
|
| 123 | + $message_type_label, |
|
| 124 | + $message_status = self::MESSAGE_STATUS_SENT, |
|
| 125 | + $messenger = 'Email', |
|
| 126 | + $context = 'Event Admin', |
|
| 127 | + $table_cell_content_for_field = '' |
|
| 128 | + ) { |
|
| 129 | + $selector = "//tr[contains(@class, 'msg-status-$message_status')]" |
|
| 130 | + . "//td[contains(@class, 'message_type') and text()='$message_type_label']"; |
|
| 131 | + if ($messenger) { |
|
| 132 | + $selector .= "/ancestor::tr/td[contains(@class, 'messenger') and text()='$messenger']"; |
|
| 133 | + } |
|
| 134 | + $selector .= "/ancestor::tr/td[contains(@class, 'column-context') and text()='$context']"; |
|
| 135 | + $selector .= $table_cell_content_for_field |
|
| 136 | + ? "/ancestor::tr/td[contains(@class, 'column-$field') and text()='$table_cell_content_for_field']" |
|
| 137 | + : "/ancestor::tr/td[contains(@class, 'column-$field')]"; |
|
| 138 | + return $selector; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | 141 | } |
| 142 | 142 | \ No newline at end of file |
@@ -103,8 +103,8 @@ |
||
| 103 | 103 | public static function editMessageTemplateClassByMessageType($message_type_slug, $context = '') |
| 104 | 104 | { |
| 105 | 105 | return $context |
| 106 | - ? '.' . $message_type_slug . '-' . $context . '-edit-link' |
|
| 107 | - : '.' . $message_type_slug . '-edit-link'; |
|
| 106 | + ? '.'.$message_type_slug.'-'.$context.'-edit-link' |
|
| 107 | + : '.'.$message_type_slug.'-edit-link'; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
@@ -12,24 +12,24 @@ |
||
| 12 | 12 | class TicketSelector |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Return the selector for the ticket option select input for the given event id. |
|
| 17 | - * @param int|string $event_id |
|
| 18 | - * @return string |
|
| 19 | - */ |
|
| 20 | - public static function ticketOptionByEventIdSelector($event_id) |
|
| 21 | - { |
|
| 22 | - return "//select[@id='ticket-selector-tbl-qty-slct-$event_id-1']"; |
|
| 23 | - } |
|
| 15 | + /** |
|
| 16 | + * Return the selector for the ticket option select input for the given event id. |
|
| 17 | + * @param int|string $event_id |
|
| 18 | + * @return string |
|
| 19 | + */ |
|
| 20 | + public static function ticketOptionByEventIdSelector($event_id) |
|
| 21 | + { |
|
| 22 | + return "//select[@id='ticket-selector-tbl-qty-slct-$event_id-1']"; |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Return the selector for the submit button for the ticket selector for the given event id. |
|
| 28 | - * @param int|string $event_id |
|
| 29 | - * @return string |
|
| 30 | - */ |
|
| 31 | - public static function ticketSelectionSubmitSelectorByEventId($event_id) |
|
| 32 | - { |
|
| 33 | - return "#ticket-selector-submit-$event_id-btn"; |
|
| 34 | - } |
|
| 26 | + /** |
|
| 27 | + * Return the selector for the submit button for the ticket selector for the given event id. |
|
| 28 | + * @param int|string $event_id |
|
| 29 | + * @return string |
|
| 30 | + */ |
|
| 31 | + public static function ticketSelectionSubmitSelectorByEventId($event_id) |
|
| 32 | + { |
|
| 33 | + return "#ticket-selector-submit-$event_id-btn"; |
|
| 34 | + } |
|
| 35 | 35 | } |
| 36 | 36 | \ No newline at end of file |