activities_controller.php
11 months ago
auth_controller.php
9 months ago
booking_form_settings_controller.php
1 year ago
bookings_controller.php
1 year ago
calendars_controller.php
9 months ago
carts_controller.php
1 year ago
controller.php
9 months ago
customer_cabinet_controller.php
9 months ago
customers_controller.php
9 months ago
dashboard_controller.php
9 months ago
default_agent_controller.php
1 year ago
events_controller.php
1 year ago
form_fields_controller.php
9 months ago
integrations_controller.php
9 months ago
invoices_controller.php
1 year ago
manage_booking_by_key_controller.php
1 year ago
manage_order_by_key_controller.php
1 year ago
notifications_controller.php
1 year ago
orders_controller.php
1 year ago
pro_controller.php
1 year ago
process_jobs_controller.php
9 months ago
processes_controller.php
1 year ago
search_controller.php
1 year ago
services_controller.php
9 months ago
settings_controller.php
1 year ago
steps_controller.php
9 months ago
stripe_connect_controller.php
9 months ago
support_topics_controller.php
1 year ago
todos_controller.php
1 year ago
transactions_controller.php
1 year ago
wizard_controller.php
1 year ago
notifications_controller.php
53 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) { |
| 3 | exit; // Exit if accessed directly. |
| 4 | } |
| 5 | |
| 6 | |
| 7 | if (!class_exists('OsNotificationsController')) : |
| 8 | |
| 9 | |
| 10 | class OsNotificationsController extends OsController { |
| 11 | |
| 12 | function __construct() { |
| 13 | parent::__construct(); |
| 14 | |
| 15 | $this->views_folder = LATEPOINT_VIEWS_ABSPATH . 'notifications/'; |
| 16 | $this->vars['page_header'] = OsMenuHelper::get_menu_items_by_id('notifications'); |
| 17 | $this->vars['breadcrumbs'][] = array('label' => __('Notifications', 'latepoint'), 'link' => OsRouterHelper::build_link(OsRouterHelper::build_route_name('notifications', 'settings'))); |
| 18 | } |
| 19 | |
| 20 | public function templates_index() { |
| 21 | $action_id = $this->params['action_id']; |
| 22 | $action_type = $this->params['action_type']; |
| 23 | $process_id = $this->params['process_id']; |
| 24 | |
| 25 | $templates = OsNotificationsHelper::load_templates_for_action_type($action_type); |
| 26 | $grouped_templates = []; |
| 27 | foreach($templates as $template){ |
| 28 | $grouped_templates[$template['to_user_type']][] = $template; |
| 29 | } |
| 30 | |
| 31 | switch ($action_type) { |
| 32 | case 'send_email': |
| 33 | $this->vars['heading'] = __('Select a template', 'latepoint'); |
| 34 | break; |
| 35 | case 'send_sms': |
| 36 | $this->vars['heading'] = __('Select a template', 'latepoint'); |
| 37 | break; |
| 38 | } |
| 39 | |
| 40 | $this->vars['action_type'] = $action_type; |
| 41 | $this->vars['action_id'] = $action_id; |
| 42 | $this->vars['process_id'] = $process_id; |
| 43 | |
| 44 | $this->vars['selected_template_id'] = false; |
| 45 | $this->vars['templates'] = $templates; |
| 46 | $this->vars['grouped_templates'] = $grouped_templates; |
| 47 | $this->format_render(__FUNCTION__); |
| 48 | |
| 49 | } |
| 50 | |
| 51 | |
| 52 | } |
| 53 | endif; |