Plugin Directory

Changeset 1149448


Ignore:
Timestamp:
04/29/2015 08:00:22 PM (11 years ago)
Author:
a2rocklobster
Message:

intervals on calendar and various label changes

Location:
vacancy-personal-edition
Files:
61 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • vacancy-personal-edition/trunk/readme.txt

    r1148497 r1149448  
    5252== Changelog ==
    5353
     54= 1.2.3 =
     55* Feature ADD! The reservation intervals can now be reflected on your calendar
     56
    5457= 1.2.2 =
    5558* Feature ADD! You now have the ability to pick which type of reservation length to use; Standard (any length), Fixed Length, or Min/Max Length with custom Intervals
     
    9497== Upgrade Notice ==
    9598
     99= 1.2.3 =
     100* Feature ADD! The reservation intervals can now be reflected on your calendar
     101
    96102= 1.2.2 =
    97103* Feature ADD! You now have the ability to pick which type of reservation length to use; Standard (any length), Fixed Length, or Min/Max Length with custom Intervals
  • vacancy-personal-edition/trunk/va-settings.php

    r1148497 r1149448  
    9797                        <div class="reservation-end-time-type">
    9898                            <p>
    99                                 <label style="width:auto;"><input id="va-standard-end-time" type="radio" name="va_end_time_type" value="standard" <?php if($this->va_settings['end_time_type'] == 'standard'){echo 'checked';};?> /> Standard End Time Selection</label><br/>
     99                                <label style="width:auto;"><input id="va-standard-end-time" type="radio" name="va_end_time_type" value="standard" <?php if($this->va_settings['end_time_type'] == 'standard'){echo 'checked';};?> /> Standard End Time Selection (any length)</label><br/>
    100100                                <label style="width:auto;"><input id="va-fixed-end-time" type="radio" name="va_end_time_type" value="fixed" <?php if($this->va_settings['end_time_type'] == 'fixed'){echo 'checked';};?> /> Fixed <?php echo $this->va_settings['reservation_single']; ?> Length</label><br/>
    101101                                <label style="width:auto;"><input id="va-minmax-end-time" type="radio" name="va_end_time_type" value="minmax" <?php if($this->va_settings['end_time_type'] == 'minmax'){echo 'checked';};?> /> Min/Max <?php echo $this->va_settings['reservation_single']; ?> Length Selection</label>
     
    174174                                </select>
    175175                            </p>
     176                            <p>
     177                                Match Interval to Calendar Intervals<br/>
     178                                <select name="va_match_minmax_interval">
     179                                    <option value="no" <?php if($this->va_settings['match_minmax_interval'] == 'no'){echo 'selected';};?>>No</option>
     180                                    <option value="yes" <?php if($this->va_settings['match_minmax_interval'] == 'yes'){echo 'selected';};?>>Yes</option>
     181                                </select>
     182                            </p>
    176183                        </div>
    177184                    </div>
     
    179186                    <h2 class="va-tab-title">Form Field Visibility</h2><hr/>
    180187                    <div id="va-show-form-fields">
    181                         <p>Display these fields on the <?php echo $this->va_settings['reservation_single']; ?> form:</p>
     188                        <p>
     189                            Display these fields on the <?php echo $this->va_settings['reservation_single']; ?> form:<br/>
     190                            <span class="description">(Name, Email, Date, Start Time & End Time are always required and cannot be hidden)</span>
     191                        </p>
     192                       
    182193                        <ul>
    183194                        <?php
     195                            if(!empty($this->va_settings['title_label'])){
     196                                $title = $this->va_settings['title_label'];
     197                            }else{
     198                                $title = $this->va_settings['reservation_single'] . ' Title';
     199                            }
     200                            if(!empty($this->va_settings['phone_label'])){
     201                                $phone = $this->va_settings['phone_label'];
     202                            }else{
     203                                $phone = 'Phone';
     204                            }                           
     205                            if(!empty($this->va_settings['reservation_type_label'])){
     206                                $type = $this->va_settings['reservation_type_label'];
     207                            }else{
     208                                $type = $this->va_settings['reservation_single'] . ' Type';
     209                            }                           
     210                            if(!empty($this->va_settings['description_label'])){
     211                                $description = $this->va_settings['description_label'];
     212                            }else{
     213                                $description = $this->va_settings['reservation_single'] . ' Description';
     214                            }                           
     215                            if(!empty($this->va_settings['setup_needs_label'])){
     216                                $setup = $this->va_settings['setup_needs_label'];
     217                            }else{
     218                                $setup = 'Setup Needs';
     219                            }                   
     220                            if(!empty($this->va_settings['av_needs_label'])){
     221                                $av = $this->va_settings['av_needs_label'];
     222                            }else{
     223                                $av = 'A/V Tech Needs: (ie. Screen, Projector, Speakers, Microphone, etc.)';
     224                            }
    184225                            $fields = array(
    185226                                //'end_time' => 'End Time',
    186227                                'setup_time' => 'Setup Time',
    187228                                'cleanup_time' => 'Cleanup Time',
    188                                 'title' => 'Title',
     229                                'title' => $title,
    189230                                'venue' => $this->va_settings['venue_single'],
    190231                                'location' => $this->va_settings['location_single'],
    191                                 'phone' => 'Phone',
    192                                 'type' => $this->va_settings['reservation_single'] . ' type',
    193                                 'description' => 'Description',
    194                                 'setup_needs' => 'Setup Needs',
    195                                 'av_needs' => 'A/V Needs'
     232                                'phone' => $phone,
     233                                'type' => $type,
     234                                'description' => $description,
     235                                'setup_needs' => $setup,
     236                                'av_needs' => $av
    196237                            );
    197238                        ?>
  • vacancy-personal-edition/trunk/vacancy.php

    r1148497 r1149448  
    44    Plugin URI: http://kraftpress.it
    55    Description: A full featured appointment and reservation booking solution
    6     Version: 1.2.2
     6    Version: 1.2.3
    77    Author: kraftpress
    88    Author URI: http://kraftpress.it
     
    2121             // vars
    2222            $this->va_settings = array(
    23                 'version' => '1.2.2',
     23                'version' => '1.2.3',
    2424                'path' => apply_filters('va_get_path', __FILE__),
    2525                'dir' => apply_filters('va_get_dir', __FILE__),
     
    3535                'day_end_time' => '22:00',
    3636                'end_time_length_hr' => '0',
    37                 'end_time_length_min' => '0',
     37                'end_time_length_min' => '00',
    3838                'end_time_min_length_hr' => '0',
    39                 'end_time_min_length_min' => '0',
     39                'end_time_min_length_min' => '00',
    4040                'end_time_max_length_hr' => '0',
    41                 'end_time_max_length_min' => '0',
     41                'end_time_max_length_min' => '00',
    4242                'end_time_minmax_interval' => 0.25,
    4343                'end_time_type' => 'standard',
     44                'match_minmax_interval' => 'no',
    4445                'require_login' => 'yes',
    4546                'admin_new_notification' => 'yes',
     
    131132               
    132133                if(!empty($_POST['va_end_time_type'])){update_option('va_end_time_type', sanitize_text_field($_POST['va_end_time_type']));}
    133                 if(!empty($_POST['va_end_time_length_hr'])){update_option('va_end_time_length_hr', sanitize_text_field($_POST['va_end_time_length_hr']));}
    134                 if(!empty($_POST['va_end_time_length_min'])){update_option('va_end_time_length_min', sanitize_text_field($_POST['va_end_time_length_min']));}
    135                 if(!empty($_POST['va_end_time_min_length_hr'])){update_option('va_end_time_min_length_hr', sanitize_text_field($_POST['va_end_time_min_length_hr']));}
    136                 if(!empty($_POST['va_end_time_min_length_min'])){update_option('va_end_time_min_length_min', sanitize_text_field($_POST['va_end_time_min_length_min']));}
    137                 if(!empty($_POST['va_end_time_max_length_hr'])){update_option('va_end_time_max_length_hr', sanitize_text_field($_POST['va_end_time_max_length_hr']));}
    138                 if(!empty($_POST['va_end_time_max_length_min'])){update_option('va_end_time_max_length_min', sanitize_text_field($_POST['va_end_time_max_length_min']));}
    139                 if(!empty($_POST['va_end_time_minmax_interval'])){update_option('va_end_time_minmax_interval', sanitize_text_field($_POST['va_end_time_minmax_interval']));}
     134                if(isset($_POST['va_end_time_length_hr'])){update_option('va_end_time_length_hr', sanitize_text_field($_POST['va_end_time_length_hr']));}
     135                if(isset($_POST['va_end_time_length_min'])){update_option('va_end_time_length_min', sanitize_text_field($_POST['va_end_time_length_min']));}
     136                if(isset($_POST['va_end_time_min_length_hr'])){update_option('va_end_time_min_length_hr', sanitize_text_field($_POST['va_end_time_min_length_hr']));}
     137                if(isset($_POST['va_end_time_min_length_min'])){update_option('va_end_time_min_length_min', sanitize_text_field($_POST['va_end_time_min_length_min']));}
     138                if(isset($_POST['va_end_time_max_length_hr'])){update_option('va_end_time_max_length_hr', sanitize_text_field($_POST['va_end_time_max_length_hr']));}
     139                if(isset($_POST['va_end_time_max_length_min'])){update_option('va_end_time_max_length_min', sanitize_text_field($_POST['va_end_time_max_length_min']));}
     140                if(isset($_POST['va_end_time_minmax_interval'])){update_option('va_end_time_minmax_interval', sanitize_text_field($_POST['va_end_time_minmax_interval']));}
     141                if(!empty($_POST['va_match_minmax_interval'])){update_option('va_match_minmax_interval', sanitize_text_field($_POST['va_match_minmax_interval']));}
    140142
    141143                if(!empty($_POST['va_require_login'])){update_option('va_require_login', sanitize_text_field($_POST['va_require_login']));}
     
    236238            $end_time_minmax_interval = get_option('va_end_time_minmax_interval');
    237239            if(!empty($end_time_minmax_interval)){$this->va_settings['end_time_minmax_interval'] = $end_time_minmax_interval;}
     240            $match_minmax_interval = get_option('va_match_minmax_interval');
     241            if(!empty($match_minmax_interval)){$this->va_settings['match_minmax_interval'] = $match_minmax_interval;}
    238242
    239243            $require_login = get_option('va_require_login');
     
    15041508                            ?>
    15051509                            <?php $reservations = new WP_Query($args); ?>
    1506                             <?php $times = $this->va_get_times($this->va_settings['day_start_time'],$this->va_settings['day_end_time'],0.25); ?>
     1510                            <?php if($this->va_settings['match_minmax_interval'] == 'yes') : ?>
     1511                                <?php $interval = $this->va_settings['end_time_minmax_interval']; ?>
     1512                            <?php else : ?>
     1513                                <?php $interval = 0.25; ?>
     1514                            <?php endif; ?>
     1515                            <?php $times = $this->va_get_times($this->va_settings['day_start_time'],$this->va_settings['day_end_time'],$interval); ?>
    15071516                            <?php if($times) : ?>
     1517                                <?php $reservation_displayed = ''; ?>
    15081518                                <?php foreach($times as $time) : ?>
    15091519                                    <tr>
     
    15471557                                                        <?php $end = get_post_meta($reservation->ID, 'va_end_cleanup_time', true); ?>
    15481558                                                        <?php $diff = (strtotime($end) - strtotime($start))/60; ?>
    1549                                                         <?php $height = ($diff/15) * 30; ?>
     1559                                                        <?php $int_minutes = $this->va_decimal_to_minutes($interval); ?>
     1560                                                        <?php $height = ($diff/$int_minutes) * 30;  ?>
    15501561                                                        <?php $status = get_post_meta($reservation->ID, 'va_reservation_status', true); ?>
    15511562                                                        <?php if($status != 'denied' && $status != 'private') : ?>
    1552                                                             <?php if($start == $time) : ?>
     1563                                                            <?php if($start <= $time && $end >= $time && ($reservation_displayed != $reservation->ID)) : ?>
     1564                                                                <?php $reservation_displayed = $reservation->ID; ?>
    15531565                                                                <div class="reservation <?php echo $status; ?>" style="height:<?php echo $height; ?>px;<?php echo apply_filters('va_reservation_background', '', $status); ?>">
    15541566                                                                    <?php if($this->va_settings['show_reservation_details'] == 'yes') : ?>
     
    23312343            return $decimal;
    23322344        }
     2345
     2346        function va_decimal_to_minutes($decimal){
     2347            return $decimal * 60;
     2348        }
    23332349       
    23342350        function va_get_time_select($name, $value = null, $id = null, $required = false, $start = false, $end = false, $interval = 0.25, $reverse = false){
Note: See TracChangeset for help on using the changeset viewer.