Plugin Directory

Changeset 3352327


Ignore:
Timestamp:
08/28/2025 10:12:34 PM (6 months ago)
Author:
reventor
Message:

Added Reminder Setting to Appointments

Location:
reventor-calendar-appointment-booking
Files:
31 added
6 edited

Legend:

Unmodified
Added
Removed
  • reventor-calendar-appointment-booking/trunk/includes/class-admin.php

    r3352003 r3352327  
    5858        register_setting('reventorcab_settings', 'reventorcab_date_format', ['sanitize_callback' => 'sanitize_text_field']);
    5959        register_setting('reventorcab_settings', 'reventorcab_show_credits', ['sanitize_callback' => [$this, 'sanitize_checkbox']]);
     60        register_setting('reventorcab_settings', 'reventorcab_appointment_reminder', ['sanitize_callback' => [$this, 'sanitize_reminder_time']]);
    6061    }
    6162   
     
    118119    public function sanitize_checkbox($value) {
    119120        return !empty($value) ? 1 : 0;
     121    }
     122   
     123    public function sanitize_reminder_time($value) {
     124        $valid_times = array('5', '10', '15', 'none');
     125        $value = sanitize_text_field($value);
     126        return in_array($value, $valid_times, true) ? $value : 'none';
    120127    }
    121128   
     
    177184        $timeslot_granularity = get_option('reventorcab_timeslot_granularity', 15);
    178185        $show_credits = get_option('reventorcab_show_credits', 0);
     186        $appointment_reminder = get_option('reventorcab_appointment_reminder', 'none');
    179187       
    180188        include REVENTORCAB_PLUGIN_PATH . 'templates/admin-page.php';
     
    213221        $timeslot_granularity = isset($_POST['timeslot_granularity']) ? intval($_POST['timeslot_granularity']) : 15;
    214222        $show_credits = isset($_POST['show_credits']) ? 1 : 0;
     223        $appointment_reminder = isset($_POST['appointment_reminder']) ? sanitize_text_field(wp_unslash($_POST['appointment_reminder'])) : '10';
    215224        // phpcs:enable WordPress.Security.NonceVerification.Missing
    216225       
     
    223232        update_option('reventorcab_date_format', $date_format);
    224233        update_option('reventorcab_timeslot_granularity', $timeslot_granularity);
     234        update_option('reventorcab_appointment_reminder', $appointment_reminder);
    225235       
    226236        return true;
     
    508518            'reventorcab_timezone' => $this->get_timezone_string(),
    509519            'reventorcab_time_format' => get_option('reventorcab_time_format', 'H:i'),
    510             'reventorcab_date_format' => get_option('reventorcab_date_format', 'Y-m-d')
     520            'reventorcab_date_format' => get_option('reventorcab_date_format', 'Y-m-d'),
     521            'reventorcab_appointment_reminder' => get_option('reventorcab_appointment_reminder', '10')
    511522        );
    512523       
  • reventor-calendar-appointment-booking/trunk/includes/class-caldav.php

    r3351939 r3352327  
    454454        }
    455455        $ical_content .= "STATUS:CONFIRMED\r\n";
     456       
     457        // Add reminder if configured
     458        $reminder_minutes = get_option('reventorcab_appointment_reminder', '10');
     459        if ($reminder_minutes !== 'none' && is_numeric($reminder_minutes)) {
     460            $ical_content .= "BEGIN:VALARM\r\n";
     461            $ical_content .= "ACTION:DISPLAY\r\n";
     462            $ical_content .= "DESCRIPTION:Reminder for appointment\r\n";
     463            $ical_content .= "TRIGGER:-PT" . $reminder_minutes . "M\r\n";
     464            $ical_content .= "END:VALARM\r\n";
     465        }
     466       
    456467        $ical_content .= "END:VEVENT\r\n";
    457468        $ical_content .= "END:VCALENDAR\r\n";
  • reventor-calendar-appointment-booking/trunk/includes/email-functions.php

    r3352003 r3352327  
    162162    $site_url = get_bloginfo('url');
    163163   
     164    // Get reminder setting
     165    $reminder_minutes = get_option('reventorcab_appointment_reminder', '10');
     166   
    164167    // Get local timezone for conversion
    165168    $user_timezone = isset($appointment_data['user_timezone']) ? $appointment_data['user_timezone'] : null;
     
    252255    }
    253256    $ics_content .= "STATUS:CONFIRMED\r\n";
     257   
     258    // Add reminder if configured
     259    if ($reminder_minutes !== 'none' && is_numeric($reminder_minutes)) {
     260        $ics_content .= "BEGIN:VALARM\r\n";
     261        $ics_content .= "ACTION:DISPLAY\r\n";
     262        $ics_content .= "DESCRIPTION:Reminder for appointment\r\n";
     263        $ics_content .= "TRIGGER:-PT" . $reminder_minutes . "M\r\n";
     264        $ics_content .= "END:VALARM\r\n";
     265    }
     266   
    254267    $ics_content .= "END:VEVENT\r\n";
    255268    $ics_content .= "END:VCALENDAR\r\n";
  • reventor-calendar-appointment-booking/trunk/readme.txt

    r3352003 r3352327  
    44Requires at least: 6.3
    55Tested up to: 6.8
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77Requires PHP: 8.1
    8 License: GPLv2 or later
     8License: GPL v2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
     
    4040Yes, you can configure the available time slots and working days in the plugin settings.
    4141
    42 == Screenshots ==
    43 
    44 1. Step 1 - Choose appointment type
    45 2. Step 2 - Select available time slot
    46 3. Step 3 - Book appointment
    47 
    4842== Changelog ==
    4943
     44= 1.0.2 =
     45* Added appointment reminder feature
     46* Added configurable reminder time (5, 10, or 15 minutes) in admin settings
     47* Added VALARM component to ICS files for email notifications
     48* Added VALARM component to CalDAV events for admin calendar reminders
     49
    5050= 1.0.1 =
    51 * Fixed CSS class names
     51* Minor CSS fixes
    5252
    5353= 1.0.0 =
  • reventor-calendar-appointment-booking/trunk/reventor-calendar-appointment-booking.php

    r3352003 r3352327  
    44 * Description: A REVENTOR calendar appointment booking system with CalDAV integration for seamless scheduling and calendar synchronization.
    55 * Plugin URI: https://wordpress.org/plugins/reventor-calendar-appointment-booking/
    6  * Version: 1.0.1
     6 * Version: 1.0.2
    77 * Author: REVENTOR
    88 * Author URI: https://reventor.eu
  • reventor-calendar-appointment-booking/trunk/templates/admin-page.php

    r3352003 r3352327  
    158158                    </div>
    159159
     160                    <div class="reventorcab-field-group">
     161                        <label for="appointment_reminder"><?php esc_html_e('Appointment Reminder', 'reventor-calendar-appointment-booking'); ?></label>
     162                        <select id="appointment_reminder" name="appointment_reminder">
     163                            <option value="none" <?php selected($appointment_reminder, 'none'); ?>><?php esc_html_e('No reminder', 'reventor-calendar-appointment-booking'); ?></option>
     164                            <option value="5" <?php selected($appointment_reminder, '5'); ?>>5 <?php esc_html_e('minutes', 'reventor-calendar-appointment-booking'); ?></option>
     165                            <option value="10" <?php selected($appointment_reminder, '10'); ?> selected>10 <?php esc_html_e('minutes', 'reventor-calendar-appointment-booking'); ?></option>
     166                            <option value="15" <?php selected($appointment_reminder, '15'); ?>>15 <?php esc_html_e('minutes', 'reventor-calendar-appointment-booking'); ?></option>
     167                        </select>
     168                        <p class="description"><?php esc_html_e('Set a reminder time for appointments in calendar invitations. This will be included in the ICS file sent to customers and set for admin appointments.', 'reventor-calendar-appointment-booking'); ?></p>
     169                    </div>
     170
    160171                </div>
    161172               
Note: See TracChangeset for help on using the changeset viewer.