Plugin Directory

Changeset 2565680


Ignore:
Timestamp:
07/16/2021 07:41:37 AM (5 years ago)
Author:
hotelspider
Message:

Pushing files to trunk

Location:
hotel-spider/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • hotel-spider/trunk

    • Property svn:ignore
      •  

        old new  
        11deployd.sh
        2 deployp.sh
        3 README.md
         2bitbucket-pipelines.yml
        43ToDo.md
        54publish.md
        65localize.md
        76Version-History.txt
        8 languages/out
         7languages
         8src
        99.git
        1010.gitignore
  • hotel-spider/trunk/assets/hsadminscript.js

    r2564134 r2565680  
     1const { __ } = wp.i18n;
    12jQuery(document).ready(function(){
    2 
    33    // Disabling children and infants depending on show field
    44
     
    1111        if(jQuery("#hsbe_enable_children").children("option:selected").val()==0){
    1212            jQuery("#hsbe_children_default").prop( "disabled", true );
    13             jQuery("#hsbe_children_default").val(1);
     13            jQuery("#hsbe_children_default").val(0);
    1414            jQuery("#hsbe_children_min").prop( "disabled", true );
    15             jQuery("#hsbe_children_min").val(1);
     15            jQuery("#hsbe_children_min").val(0);
    1616            jQuery("#hsbe_children_max").prop( "disabled", true );
    1717            jQuery("#hsbe_children_max").val(4);
     
    3232        if(jQuery("#hsbe_enable_infants").children("option:selected").val()==0){
    3333            jQuery("#hsbe_infants_default").prop( "disabled", true );
    34             jQuery("#hsbe_infants_default").val(1);
     34            jQuery("#hsbe_infants_default").val(0);
    3535            jQuery("#hsbe_infants_min").prop( "disabled", true );
    36             jQuery("#hsbe_infants_min").val(1);
     36            jQuery("#hsbe_infants_min").val(0);
    3737            jQuery("#hsbe_infants_max").prop( "disabled", true );
    3838            jQuery("#hsbe_infants_max").val(4);
     
    4747
    4848    // Validation on submit
    49     var hsbeValidatedAdults = 1;
    50     var hsbeValidatedChildren = 1;
    51     var hsbeValidatedInfants = 1;
    52     var hsbeValidatedAdultsDef = 1;
    53     var hsbeValidatedChildrenDef = 1;
    54     var hsbeValidatedInfantsDef = 1;
     49
    5550    jQuery("#hsbe-spider-booking").submit(function(e){
     51        var hsbeErrorMsg = '';
     52
    5653        var adultsDefVal = parseInt(jQuery("#hsbe_adults_default").children("option:selected").val());
    5754        var adultsMinVal = parseInt(jQuery("#hsbe_adults_min").children("option:selected").val());
     
    6663        var infantsMaxVal = parseInt(jQuery("#hsbe_infants_max").children("option:selected").val());
    6764
    68         //alert("Def: "+infantsDefVal+" Min: "+infantsMinVal+" Max: "+infantsMaxVal);
    69         // alert(typeof(adultMinVal));
    70         // alert(typeof(adultMaxVal));
    71 
     65        jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
    7266        if(adultsMinVal>adultsMaxVal){
    73             jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
    74             jQuery("#adult-max").removeClass("hsbe-error-msg-hide");
    75             jQuery(window).scrollTop(0);
    76             hsbeValidatedAdults = 0;
    77         }
    78         else{
    79             jQuery("#adult-max").addClass("hsbe-error-msg-hide");
    80             hsbeValidatedAdults = 1;
    81         }
    82         if(childrenMinVal>childrenMaxVal){
    83             jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
    84             jQuery("#children-max").removeClass("hsbe-error-msg-hide");
    85             jQuery(window).scrollTop(0);
    86             hsbeValidatedChildren = 0;
    87         }
    88         else{
    89             jQuery("#children-max").addClass("hsbe-error-msg-hide");
    90             hsbeValidatedChildren = 1;
    91         }
    92         if(infantsMinVal>infantsMaxVal){
    93             jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
    94             jQuery("#infants-max").removeClass("hsbe-error-msg-hide");
    95             jQuery(window).scrollTop(0);
    96             hsbeValidatedInfants = 0;
    97         }
    98         else{
    99             jQuery("#infants-max").addClass("hsbe-error-msg-hide");
    100             hsbeValidatedInfants = 1;
     67            hsbeErrorMsg+= "<p>"+__('Adults minimum value is greater than maximum value', 'hotel-spider')+"</p>";
    10168        }
    10269
    103         if((adultsDefVal<adultsMinVal)||(adultsDefVal>adultsMaxVal)){
    104             jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
    105             jQuery("#adult-def").removeClass("hsbe-error-msg-hide");
    106             jQuery(window).scrollTop(0);
    107             hsbeValidatedAdultsDef = 0;
    108         }
    109         else{
    110             jQuery("#adult-def").addClass("hsbe-error-msg-hide");
    111             hsbeValidatedAdultsDef = 1;
     70        if(childrenMinVal>childrenMaxVal){
     71            hsbeErrorMsg+= "<p>"+__('Children minimum value is greater than maximum value', 'hotel-spider')+"</p>";
    11272        }
    11373
    114         if((childrenDefVal<childrenMinVal)||(childrenDefVal>childrenMaxVal)){
    115             if(jQuery("#hsbe_enable_children").children("option:selected").val()!=0){
    116                 jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
    117                 jQuery("#children-def").removeClass("hsbe-error-msg-hide");
    118                 jQuery(window).scrollTop(0);
    119                 hsbeValidatedChildrenDef = 0;
    120             }
    121             else{
    122                 jQuery("#children-def").addClass("hsbe-error-msg-hide");
    123                 hsbeValidatedChildrenDef = 1;
    124             }
    125         }
    126         else{
    127             jQuery("#children-def").addClass("hsbe-error-msg-hide");
    128             hsbeValidatedChildrenDef = 1;
     74        if(infantsMinVal>infantsMaxVal){
     75            hsbeErrorMsg+= "<p>"+__('Infants minimum value is greater than maximum value', 'hotel-spider')+"</p>";
    12976        }
    13077
    131         if((infantsDefVal<infantsMinVal)||(infantsDefVal>infantsMaxVal)){
    132             if(jQuery("#hsbe_enable_infants").children("option:selected").val()!=0){
    133                 jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
    134                 jQuery("#infants-def").removeClass("hsbe-error-msg-hide");
    135                 jQuery(window).scrollTop(0);
    136                 hsbeValidatedInfantsDef = 0;
    137             }
    138             else{
    139                 jQuery("#infants-def").addClass("hsbe-error-msg-hide");
    140                 hsbeValidatedInfantsDef = 1;
    141             }
     78        if(adultsDefVal<adultsMinVal){
     79            hsbeErrorMsg+= "<p>"+__('Adults default value is less than minimum value', 'hotel-spider')+"</p>";
    14280        }
    143         else{
    144             jQuery("#infants-def").addClass("hsbe-error-msg-hide");
    145             hsbeValidatedInfantsDef = 1;
     81        else if(adultsDefVal>adultsMaxVal){
     82            hsbeErrorMsg+= "<p>"+__('Adults default value is greater than maximum value', 'hotel-spider')+"</p>";
    14683        }
    14784
     85        if(childrenDefVal<childrenMinVal){
     86            hsbeErrorMsg+= "<p>"+__('Children default value is less than minimum value', 'hotel-spider')+"</p>"; 
     87        }
     88        else if(childrenDefVal>childrenMaxVal){
     89            hsbeErrorMsg+= "<p>"+__('Children default value is greater than maximum value', 'hotel-spider')+"</p>";
     90        }
    14891
    149         if(!(hsbeValidatedAdults&&hsbeValidatedChildren&&hsbeValidatedInfants&&hsbeValidatedAdultsDef&&hsbeValidatedChildrenDef&&hsbeValidatedInfantsDef)){
     92        if(infantsDefVal<infantsMinVal){
     93            hsbeErrorMsg+= "<p>"+__('Infants default value is less than minimum value', 'hotel-spider')+"</p>"; 
     94        }
     95        else if(infantsDefVal>infantsMaxVal){
     96            hsbeErrorMsg+= "<p>"+__('Infants default value is greater than maximum value', 'hotel-spider')+"</p>";
     97        }
     98        if(hsbeErrorMsg.length){
    15099            e.preventDefault();
     100            jQuery("#hsbe-validation-error").html(hsbeErrorMsg);
     101            jQuery("#hsbe-validation-error").removeClass("hsbe-error-msg-hide");
     102            jQuery(window).scrollTop(0);
    151103        }
     104
    152105    });
    153106
  • hotel-spider/trunk/assets/hsadminstyle.css

    r2564134 r2565680  
    88    border: 1px solid red;
    99    padding: 5px 20px;
    10 }
    11 .hsbe-error-msg{
    1210    color: red;
    1311}
  • hotel-spider/trunk/hs-direct-booking.php

    r2564143 r2565680  
    55    Plugin Name: Spider-Booking
    66    Description: Hotel-Spider plugin is for implementing web-booking-engine functionality on your website. Spider-Booking is our mobile first approach to a conversion obsessed web-booking-engine. On your website you have full control over the content and story you want to transmit to your customers. An elegant booking button transforms your website into an e-commerce platform and drives your direct reservations. Your web-booking-engine is the one tool you need have to generate direct reservations on your website. Consequently, we focus on the goal of converting visitors into paying guests. Machine learning and A/B testing allows us to optimize the booking process to increase your revenue.
    7     Version: 1.2.2-beta
     7    Version: 1.2
    88    Version Log: Added Gutenberg block
    99    Requires at least: 5.0
  • hotel-spider/trunk/hsbeinc/Api/Callbacks/AdminCallbacks.php

    r2564134 r2565680  
    5151
    5252    public function inputSanitize($input){
    53         if ($input['hsbe_adults_min'] > $input['hsbe_adults_max']) {
     53        if (($input['hsbe_adults_min'] > $input['hsbe_adults_max']) || ($input['hsbe_adults_min'] > $input['hsbe_adults_default']) || ($input['hsbe_adults_max'] < $input['hsbe_adults_default'])) {
     54            $input['hsbe_adults_default'] = 1;
    5455            $input['hsbe_adults_min'] = 1;
    5556            $input['hsbe_adults_max'] = 8;
    5657        }
    57         if (($input['hsbe_children_min'] > $input['hsbe_children_max']) || (!$input['hsbe_enable_children'])) {
    58             $input['hsbe_children_min'] = 1;
     58        if (($input['hsbe_children_min'] > $input['hsbe_children_max']) || (!$input['hsbe_enable_children']) || ($input['hsbe_children_min'] > $input['hsbe_children_default']) || ($input['hsbe_children_max'] < $input['hsbe_children_default'])) {
     59            $input['hsbe_children_default'] = 0;
     60            $input['hsbe_children_min'] = 0;
    5961            $input['hsbe_children_max'] = 4;
    6062        }
    61         if (($input['hsbe_infants_min'] > $input['hsbe_infants_max']) || (!$input['hsbe_enable_infants'])) {
    62             $input['hsbe_infants_min'] = 1;
     63        if (($input['hsbe_infants_min'] > $input['hsbe_infants_max']) || (!$input['hsbe_enable_infants']) || ($input['hsbe_infants_min'] > $input['hsbe_infants_default']) || ($input['hsbe_infants_max'] < $input['hsbe_infants_default'])) {
     64            $input['hsbe_infants_default'] = 0;
     65            $input['hsbe_infants_min'] = 0;
    6366            $input['hsbe_infants_max'] = 4;
    6467        }
  • hotel-spider/trunk/hsbeinc/Base/Activate.php

    r2559855 r2565680  
    1414            update_option('hs_booking_engine',[]);
    1515        }
    16 
    17         $default = array();
    18 
    19         update_option('hsbe_enable_persons_cbx', $default);
    20 
     16       
    2117    }
    2218}
  • hotel-spider/trunk/hsbeinc/Base/Enqueue.php

    r2559855 r2565680  
    1818        if(isset($_GET["page"])){
    1919            if($_GET["page"] == "hs_booking_engine_settings"){
    20                 wp_enqueue_script('hsadminscript', $this->plugin_url.'assets/hsadminscript.js');
     20                wp_enqueue_script('hsadminscript', $this->plugin_url.'assets/hsadminscript.js', array( 'wp-i18n' ));
    2121            }
    2222        }
  • hotel-spider/trunk/readme.txt

    r2559855 r2565680  
    44Donate link: http://www.hotel-spider.com
    55Requires at least: 5.0
    6 Tested up to: 5.7.1
    7 Stable tag: 1.1
     6Tested up to: 5.8
     7Stable tag: 1.2
    88Requires PHP: 7.1
    99License: GPLv2 or later
     
    35352. The plugin configuration page. Here you can configure all the setting for your plugin. You must enter your Hotel ID in order to work this plugin
    36363. The plugin in action
     37
     38== Changelog ==
     39
     40= 1.2 =
     41Release Date: July 16th, 2021
     42* Support for WordPress internationalization and localization
     43* Added options to configure guest fields
  • hotel-spider/trunk/templates/adminSettings.php

    r2564134 r2565680  
    22    <h1 id="hsbe-heading"><?php _e('Hotel-Spider Booking Engine Settings', 'hotel-spider'); ?></h1>
    33    <div class="hsbe-error-msg-hide" id="hsbe-validation-error">
    4         <p class="hsbe-error-msg hsbe-error-msg-hide" id="adult-max"><?php _e('Adults minimum value is greater than maximum value', 'hotel-spider'); ?></p>
    5         <p class="hsbe-error-msg hsbe-error-msg-hide" id="adult-def"><?php _e('Adults default value should be greater than or equal to minimul value or less than or equal to maximum value of adults', 'hotel-spider'); ?></p>
    6         <p class="hsbe-error-msg hsbe-error-msg-hide" id="children-max"><?php _e('Children minimum value is greater than maximum value', 'hotel-spider'); ?></p>
    7         <p class="hsbe-error-msg hsbe-error-msg-hide" id="children-def"><?php _e('Children default value should be greater than or equal to minimul value or less than or equal to maximum value of children', 'hotel-spider'); ?></p>
    8         <p class="hsbe-error-msg hsbe-error-msg-hide" id="infants-max"><?php _e('Infants minimum value is greater than maximum value', 'hotel-spider'); ?></p>
    9         <p class="hsbe-error-msg hsbe-error-msg-hide" id="infants-def"><?php _e('Infants default value should be greater than or equal to minimul value or less than or equal to maximum value of infants', 'hotel-spider'); ?></p>
    104    </div>
    115    <?php settings_errors(); ?>
Note: See TracChangeset for help on using the changeset viewer.