Ejemplo n.º 1
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     // Load l10n for fixtures creating.
     load_plugin_textdomain('ab', false, dirname(plugin_basename(__FILE__)) . '/languages/');
     /*
      * Notifications.
      */
     $this->notifications = array('client_info' => array('subject' => __('Your appointment information', 'ab'), 'message' => wpautop(__("Dear [[CLIENT_NAME]].\n\nThis is confirmation that you have booked [[SERVICE_NAME]].\n\nWe are waiting you at [[COMPANY_ADDRESS]] on [[APPOINTMENT_DATE]] at [[APPOINTMENT_TIME]].\n\nThank you for choosing our company.\n\n[[COMPANY_NAME]]\n[[COMPANY_PHONE]]\n[[COMPANY_WEBSITE]]", 'ab')), 'active' => 1), 'provider_info' => array('subject' => __('New booking information', 'ab'), 'message' => wpautop(__("Hello.\n\nYou have new booking.\n\nService: [[SERVICE_NAME]]\nDate: [[APPOINTMENT_DATE]]\nTime: [[APPOINTMENT_TIME]]\nClient name: [[CLIENT_NAME]]\nClient phone: [[CLIENT_PHONE]]\nClient email: [[CLIENT_EMAIL]]\nClient notes: [[CLIENT_NOTES]]", 'ab')), 'active' => 0), 'evening_next_day' => array('subject' => __('Your appointment at [[COMPANY_NAME]]', 'ab'), 'message' => wpautop(__("Dear [[CLIENT_NAME]].\n\nWe would like to remind you that you have booked [[SERVICE_NAME]] tomorrow on [[APPOINTMENT_TIME]]. We are waiting you at [[COMPANY_ADDRESS]].\n\nThank you for choosing our company.\n\n[[COMPANY_NAME]]\n[[COMPANY_PHONE]]\n[[COMPANY_WEBSITE]]", 'ab')), 'active' => 0), 'evening_after' => array('subject' => __('Your visit to [[COMPANY_NAME]]', 'ab'), 'message' => wpautop(__("Dear [[CLIENT_NAME]].\n\nThank you for choosing [[COMPANY_NAME]]. We hope you were satisfied with your [[SERVICE_NAME]].\n\nThank you and we look forward to seeing you again soon.\n\n[[COMPANY_NAME]]\n[[COMPANY_PHONE]]\n[[COMPANY_WEBSITE]]", 'ab')), 'active' => 0), 'event_next_day' => array('subject' => __('Your agenda for [[TOMORROW_DATE]]', 'ab'), 'message' => wpautop(__("Hello.\n\nYour agenda for tomorrow is:\n\n[[NEXT_DAY_AGENDA]]", 'ab')), 'active' => 0));
     /**
      * Options.
      */
     $this->options = array('ab_data_loaded' => '0', 'ab_db_version' => ab_plugin_get_version(), 'ab_installation_time' => time(), 'ab_settings_company_name' => '', 'ab_settings_company_logo' => '', 'ab_settings_company_logo_path' => '', 'ab_settings_company_logo_url' => '', 'ab_settings_company_address' => '', 'ab_settings_company_phone' => '', 'ab_settings_company_website' => '', 'ab_settings_pay_locally' => '1', 'ab_settings_sender_name' => get_option('blogname'), 'ab_settings_sender_email' => get_option('admin_email'), 'ab_settings_time_slot_length' => '15', 'ab_settings_no_current_day_appointments' => '0', 'ab_settings_use_client_time_zone' => '0', 'ab_settings_coupons' => '0', 'ab_settings_google_client_id' => '', 'ab_settings_google_client_secret' => '', 'ab_settings_monday_start' => '08:00', 'ab_settings_monday_end' => '18:00', 'ab_settings_tuesday_start' => '08:00', 'ab_settings_tuesday_end' => '18:00', 'ab_settings_wednesday_start' => '08:00', 'ab_settings_wednesday_end' => '18:00', 'ab_settings_thursday_start' => '08:00', 'ab_settings_thursday_end' => '18:00', 'ab_settings_friday_start' => '08:00', 'ab_settings_friday_end' => '18:00', 'ab_settings_saturday_start' => '', 'ab_settings_saturday_end' => '', 'ab_settings_sunday_start' => '', 'ab_settings_sunday_end' => '', 'ab_settings_cancel_page_url' => home_url(), 'ab_appearance_text_info_first_step' => __('Please select service: ', 'ab'), 'ab_appearance_text_info_second_step' => __("Below you can find a list of available time slots for [[SERVICE_NAME]] by [[STAFF_NAME]].\nClick on a time slot to proceed with booking.", 'ab'), 'ab_appearance_text_info_third_step' => __("You selected a booking for [[SERVICE_NAME]] by [[STAFF_NAME]] at [[SERVICE_TIME]] on [[SERVICE_DATE]]. The price for the service is [[SERVICE_PRICE]].\nPlease provide your details in the form below to proceed with booking.", 'ab'), 'ab_appearance_text_info_fourth_step' => __('Please tell us how you would like to pay: ', 'ab'), 'ab_appearance_text_info_fifth_step' => __('Thank you! Your booking is complete. An email with details of your booking has been sent to you.', 'ab'), 'ab_appearance_text_info_coupon' => __('The price for the service is [[SERVICE_PRICE]].', 'ab'), 'ab_appearance_color' => '#f4662f', 'ab_appearance_text_step_service' => __("Service", "ab"), 'ab_appearance_text_step_time' => __("Time", "ab"), 'ab_appearance_text_step_details' => __("Details", "ab"), 'ab_appearance_text_step_payment' => __("Payment", "ab"), 'ab_appearance_text_step_done' => __("Done", "ab"), 'ab_appearance_text_label_category' => __("Category", "ab"), 'ab_appearance_text_label_service' => __("Service", "ab"), 'ab_appearance_text_label_employee' => __("Employee", "ab"), 'ab_appearance_text_label_select_date' => __('I\'m available on or after', 'ab'), 'ab_appearance_text_label_start_from' => __('Start from', 'ab'), 'ab_appearance_text_label_finish_by' => __('Finish by', 'ab'), 'ab_appearance_text_label_name' => __('Name', 'ab'), 'ab_appearance_text_label_phone' => __('Phone', 'ab'), 'ab_appearance_text_label_email' => __('Email', 'ab'), 'ab_appearance_text_label_notes' => __('Notes (optional)', 'ab'), 'ab_appearance_text_label_coupon' => __('Coupon', 'ab'), 'ab_appearance_text_option_service' => __('Select service', 'ab'), 'ab_appearance_text_option_category' => __('Select category', 'ab'), 'ab_appearance_text_option_employee' => __('Any', 'ab'), 'ab_appearance_show_progress_tracker' => '1', 'ab_envato_purchase_code' => '', 'ab_paypal_api_username' => '', 'ab_paypal_api_password' => '', 'ab_paypal_api_signature' => '', 'ab_paypal_ec_mode' => '', 'ab_paypal_type' => 'disabled', 'ab_paypal_id' => '', 'ab_paypal_currency' => 'USD', 'ab_authorizenet_api_login_id' => '', 'ab_authorizenet_transaction_key' => '', 'ab_authorizenet_sandbox' => 0, 'ab_authorizenet_type' => 'disabled', 'ab_stripe' => '0', 'ab_stripe_secret_key' => '');
 }
Ejemplo n.º 2
0
function ab_plugin_update_db()
{
    $db_version = get_option('ab_db_version');
    $plugin_version = ab_plugin_get_version();
    $update_class = new AB_Updates();
    if ($plugin_version > $db_version) {
        $db_version_underscored = 'update_' . str_replace('.', '_', $db_version);
        $plugin_version_underscored = 'update_' . str_replace('.', '_', $plugin_version);
        // sort the update methods ascending
        $updates = array_filter(get_class_methods($update_class), function ($method) {
            return strstr($method, 'update_');
        });
        usort($updates, 'strnatcmp');
        foreach ($updates as $method) {
            if ($method > $db_version_underscored && $method <= $plugin_version_underscored) {
                call_user_func(array($update_class, $method));
            }
        }
        update_option('ab_db_version', $plugin_version);
    }
}