Changeset 1148497
- Timestamp:
- 04/28/2015 10:40:10 PM (11 years ago)
- Location:
- vacancy-personal-edition
- Files:
-
- 62 added
- 3 edited
-
tags/1.2.1 (added)
-
tags/1.2.1/css (added)
-
tags/1.2.1/css/Font Awesome Cheatsheet.pdf (added)
-
tags/1.2.1/css/FontAwesome.otf (added)
-
tags/1.2.1/css/fontawesome-webfont.eot (added)
-
tags/1.2.1/css/fontawesome-webfont.svg (added)
-
tags/1.2.1/css/fontawesome-webfont.ttf (added)
-
tags/1.2.1/css/fontawesome-webfont.woff (added)
-
tags/1.2.1/css/fonts.css (added)
-
tags/1.2.1/css/va-admin.css (added)
-
tags/1.2.1/css/va-datepicker.css (added)
-
tags/1.2.1/css/va.css (added)
-
tags/1.2.1/images (added)
-
tags/1.2.1/images/arrow.png (added)
-
tags/1.2.1/images/dark_leather.png (added)
-
tags/1.2.1/images/darkdenim3.png (added)
-
tags/1.2.1/images/loading.gif (added)
-
tags/1.2.1/js (added)
-
tags/1.2.1/js/chosen_v1.2.0 (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen-sprite.png (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen-sprite@2x.png (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen.css (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen.jquery.js (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen.jquery.min.js (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen.min.css (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen.proto.js (added)
-
tags/1.2.1/js/chosen_v1.2.0/chosen.proto.min.js (added)
-
tags/1.2.1/js/chosen_v1.2.0/docsupport (added)
-
tags/1.2.1/js/chosen_v1.2.0/docsupport/chosen.png (added)
-
tags/1.2.1/js/chosen_v1.2.0/docsupport/oss-credit.png (added)
-
tags/1.2.1/js/chosen_v1.2.0/docsupport/prism.css (added)
-
tags/1.2.1/js/chosen_v1.2.0/docsupport/prism.js (added)
-
tags/1.2.1/js/chosen_v1.2.0/docsupport/style.css (added)
-
tags/1.2.1/js/chosen_v1.2.0/index.html (added)
-
tags/1.2.1/js/chosen_v1.2.0/index.proto.html (added)
-
tags/1.2.1/js/chosen_v1.2.0/options.html (added)
-
tags/1.2.1/js/floatThead (added)
-
tags/1.2.1/js/floatThead/.gitignore (added)
-
tags/1.2.1/js/floatThead/CONTRIBUTING.md (added)
-
tags/1.2.1/js/floatThead/Gruntfile.coffee (added)
-
tags/1.2.1/js/floatThead/README.md (added)
-
tags/1.2.1/js/floatThead/bower.json (added)
-
tags/1.2.1/js/floatThead/demo (added)
-
tags/1.2.1/js/floatThead/demo/README.md (added)
-
tags/1.2.1/js/floatThead/dist (added)
-
tags/1.2.1/js/floatThead/dist/jquery.floatThead-slim.js (added)
-
tags/1.2.1/js/floatThead/dist/jquery.floatThead-slim.min.js (added)
-
tags/1.2.1/js/floatThead/dist/jquery.floatThead.js (added)
-
tags/1.2.1/js/floatThead/dist/jquery.floatThead.min.js (added)
-
tags/1.2.1/js/floatThead/jquery.floatThead._.js (added)
-
tags/1.2.1/js/floatThead/jquery.floatThead.js (added)
-
tags/1.2.1/js/floatThead/license.txt (added)
-
tags/1.2.1/js/floatThead/package.json (added)
-
tags/1.2.1/js/jquery.ui.touch-punch.min.js (added)
-
tags/1.2.1/readme.txt (added)
-
tags/1.2.1/va-admin-calendar.php (added)
-
tags/1.2.1/va-location-meta.php (added)
-
tags/1.2.1/va-reservation-meta.php (added)
-
tags/1.2.1/va-settings.php (added)
-
tags/1.2.1/va-venue-meta.php (added)
-
tags/1.2.1/vacancy.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sftp-config.json (added)
-
trunk/va-settings.php (modified) (5 diffs)
-
trunk/vacancy.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vacancy-personal-edition/trunk/readme.txt
r1137504 r1148497 52 52 == Changelog == 53 53 54 = 1.2.2 = 55 * 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 56 54 57 = 1.2.1 = 55 58 * Fixed a bug where reservations for locations with custom availability weren't getting errors … … 91 94 == Upgrade Notice == 92 95 96 = 1.2.2 = 97 * 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 98 93 99 = 1.2.1 = 94 100 * Fixed a bug where reservations for locations with custom availability weren't getting errors -
vacancy-personal-edition/trunk/va-settings.php
r1119174 r1148497 43 43 </select> 44 44 <div id="va-show-admin-bar" style="display:none;"> 45 <p> Show WP admin bar for</p>45 <p>BUT, Still Show WP admin bar for</p> 46 46 <?php global $wp_roles; ?> 47 47 <ul> … … 93 93 <div id="va-forms"> 94 94 <form method="post" action=""> 95 <h2 class="va-tab-title">Form Field Labels</h2><hr/> 96 <p>This allows you to update the labels on the reservation form. Leave blank for default values shown.</p> 97 <div class="form-field-labels"> 98 <p> 99 <label><?php echo $this->va_settings['reservation_single']; ?> Title:</label> 100 <input type="text" name="va_title_label" value="<?php echo $this->va_settings['title_label'];?>"/> 101 </p> 102 <p> 103 <label>Your Name:</label> 104 <input type="text" name="va_name_label" value="<?php echo $this->va_settings['name_label'];?>"/> 105 </p> 106 <p> 107 <label>Phone:</label> 108 <input type="text" name="va_phone_label" value="<?php echo $this->va_settings['phone_label']; ?>"/> 109 </p> 110 <p> 111 <label>Email:</label> 112 <input type="text" name="va_email_label" value="<?php echo $this->va_settings['email_label'];?>"/> 113 </p> 114 <p> 115 <label><?php echo $this->va_settings['reservation_single']; ?> Type:</label> 116 <input type="text" name="va_reservation_type_label" value="<?php echo $this->va_settings['reservation_type_label'];?>"/> 117 </p> 118 <p> 119 <label><?php echo $this->va_settings['reservation_single']; ?> Description:</label> 120 <input type="text" name="va_description_label" value="<?php echo $this->va_settings['description_label'];?>"/> 121 122 </p> 123 <p> 124 <label>Setup Needs:</label> 125 <input type="text" name="va_setup_needs_label" value="<?php echo $this->va_settings['setup_needs_label'];?>"/> 126 </p> 127 <p> 128 <label>A/V Tech Needs: (ie. Screen, Projector, Speakers, Microphone, etc.)</label> 129 <input type="text" name="va_av_needs_label" value="<?php echo $this->va_settings['av_needs_label'];?>"/> 130 </p> 95 <h2 class="va-tab-title"><?php echo $this->va_settings['reservation_single']; ?> End Time Options</h2><hr/> 96 <div id="va-end-time-options"> 97 <div class="reservation-end-time-type"> 98 <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/> 100 <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/> 101 <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> 102 </p> 103 </div> 104 <span class="va-clearer"></span> 105 <div class="reservation-fixed-end-times" style="display:none;"> 106 <p> 107 <?php echo $this->va_settings['reservation_plural']; ?> last for:<br/> 108 <select name="va_end_time_length_hr"> 109 <?php for($i=0;$i<24;$i++) : ?> 110 <option value="<?php echo $i; ?>" <?php if($this->va_settings['end_time_length_hr'] == $i){echo 'selected';};?>><?php echo $i; ?></option> 111 <?php endfor; ?> 112 </select> hours 113 <select name="va_end_time_length_min"> 114 <option value="00" <?php if($this->va_settings['end_time_length_min'] == '00'){echo 'selected';};?>>00</option> 115 <option value="15" <?php if($this->va_settings['end_time_length_min'] == '15'){echo 'selected';};?>>15</option> 116 <option value="30" <?php if($this->va_settings['end_time_length_min'] == '30'){echo 'selected';};?>>30</option> 117 <option value="45" <?php if($this->va_settings['end_time_length_min'] == '45'){echo 'selected';};?>>45</option> 118 </select> minutes 119 </p> 120 </div> 121 <span class="va-clearer"></span> 122 <div class="reservation-minmax-end-times" style="display:none;"> 123 <p> 124 Minimum <?php echo $this->va_settings['reservation_single']; ?> Length:<br/><span class="description">(if a user chooses a 1:00pm start time and this setting is 30 minutes, the first available end time will be 1:30pm)</span><br/> 125 <select name="va_end_time_min_length_hr"> 126 <?php for($i=0;$i<24;$i++) : ?> 127 <option value="<?php echo $i; ?>" <?php if($this->va_settings['end_time_min_length_hr'] == $i){echo 'selected';};?>><?php echo $i; ?></option> 128 <?php endfor; ?> 129 </select> hours 130 <select name="va_end_time_min_length_min"> 131 <option value="00" <?php if($this->va_settings['end_time_min_length_min'] == '00'){echo 'selected';};?>>00</option> 132 <option value="15" <?php if($this->va_settings['end_time_min_length_min'] == '15'){echo 'selected';};?>>15</option> 133 <option value="30" <?php if($this->va_settings['end_time_min_length_min'] == '30'){echo 'selected';};?>>30</option> 134 <option value="45" <?php if($this->va_settings['end_time_min_length_min'] == '45'){echo 'selected';};?>>45</option> 135 </select> minutes 136 </p> 137 <p> 138 Maximum <?php echo $this->va_settings['reservation_single']; ?> Length:<br/><span class="description">(if a user chooses a 1:00pm start time and this setting is 2 hours, the last available end time will be 3:00pm)</span><br/> 139 <select name="va_end_time_max_length_hr"> 140 <?php for($i=0;$i<24;$i++) : ?> 141 <option value="<?php echo $i; ?>" <?php if($this->va_settings['end_time_max_length_hr'] == $i){echo 'selected';};?>><?php echo $i; ?></option> 142 <?php endfor; ?> 143 </select> hours 144 <select name="va_end_time_max_length_min"> 145 <option value="00" <?php if($this->va_settings['end_time_max_length_min'] == '00'){echo 'selected';};?>>00</option> 146 <option value="15" <?php if($this->va_settings['end_time_max_length_min'] == '15'){echo 'selected';};?>>15</option> 147 <option value="30" <?php if($this->va_settings['end_time_max_length_min'] == '30'){echo 'selected';};?>>30</option> 148 <option value="45" <?php if($this->va_settings['end_time_max_length_min'] == '45'){echo 'selected';};?>>45</option> 149 </select> minutes 150 </p> 151 <p> 152 <?php echo $this->va_settings['reservation_single']; ?> Time Interval:<br/><span class="description">(end times available to the user will be in intervals of this setting. make sure it fits evenly between your Min/Max settings above)</span><br/> 153 <select name="va_end_time_minmax_interval"> 154 <option value="0.25" <?php if($this->va_settings['end_time_minmax_interval'] == '0.25'){echo 'selected';};?>>15 minutes</option> 155 <option value="0.5" <?php if($this->va_settings['end_time_minmax_interval'] == '0.5'){echo 'selected';};?>>30 minutes</option> 156 <option value="0.75" <?php if($this->va_settings['end_time_minmax_interval'] == '0.75'){echo 'selected';};?>>45 minutes</option> 157 <option value="1" <?php if($this->va_settings['end_time_minmax_interval'] == '1'){echo 'selected';};?>>1 hour</option> 158 <option value="1.25" <?php if($this->va_settings['end_time_minmax_interval'] == '1.25'){echo 'selected';};?>>1 hour 15 minutes</option> 159 <option value="1.5" <?php if($this->va_settings['end_time_minmax_interval'] == '1.5'){echo 'selected';};?>>1 hour 30 minutes</option> 160 <option value="1.75" <?php if($this->va_settings['end_time_minmax_interval'] == '1.75'){echo 'selected';};?>>1 hour 45 minutes</option> 161 <option value="2" <?php if($this->va_settings['end_time_minmax_interval'] == '2'){echo 'selected';};?>>2 hours</option> 162 <option value="2.25" <?php if($this->va_settings['end_time_minmax_interval'] == '2.25'){echo 'selected';};?>>2 hours 15 minutes</option> 163 <option value="2.5" <?php if($this->va_settings['end_time_minmax_interval'] == '2.5'){echo 'selected';};?>>2 hours 30 minutes</option> 164 <option value="2.75" <?php if($this->va_settings['end_time_minmax_interval'] == '2.75'){echo 'selected';};?>>2 hours 45 minutes</option> 165 <option value="3" <?php if($this->va_settings['end_time_minmax_interval'] == '3'){echo 'selected';};?>>3 hours</option> 166 <option value="3.25" <?php if($this->va_settings['end_time_minmax_interval'] == '3.25'){echo 'selected';};?>>3 hours 15 minutes</option> 167 <option value="3.5" <?php if($this->va_settings['end_time_minmax_interval'] == '3.5'){echo 'selected';};?>>3 hours 30 minutes</option> 168 <option value="3.75" <?php if($this->va_settings['end_time_minmax_interval'] == '3.75'){echo 'selected';};?>>3 hours 45 minutes</option> 169 <option value="4" <?php if($this->va_settings['end_time_minmax_interval'] == '4'){echo 'selected';};?>>4 hours</option> 170 <option value="4.25" <?php if($this->va_settings['end_time_minmax_interval'] == '4.25'){echo 'selected';};?>>4 hours 15 minutes</option> 171 <option value="4.5" <?php if($this->va_settings['end_time_minmax_interval'] == '4.5'){echo 'selected';};?>>4 hours 30 minutes</option> 172 <option value="4.75" <?php if($this->va_settings['end_time_minmax_interval'] == '4.75'){echo 'selected';};?>>4 hours 45 minutes</option> 173 <option value="5" <?php if($this->va_settings['end_time_minmax_interval'] == '5'){echo 'selected';};?>>5 hours</option> 174 </select> 175 </p> 176 </div> 131 177 </div> 132 178 <br/> … … 137 183 <?php 138 184 $fields = array( 139 'end_time' => 'End Time',185 //'end_time' => 'End Time', 140 186 'setup_time' => 'Setup Time', 141 187 'cleanup_time' => 'Cleanup Time', … … 158 204 </ul> 159 205 </div> 160 <div class="reservation-end-times" style="display:none;"> 161 <p> 162 <?php echo $this->va_settings['reservation_plural']; ?> last for:<br/> 163 <select name="va_end_time_length_hr"> 164 <?php for($i=0;$i<24;$i++) : ?> 165 <option value="<?php echo $i; ?>" <?php if($this->va_settings['end_time_length_hr'] == $i){echo 'selected';};?>><?php echo $i; ?></option> 166 <?php endfor; ?> 167 </select> hours<br/> 168 <select name="va_end_time_length_min"> 169 <option value="00" <?php if($this->va_settings['end_time_length_hr'] == '00'){echo 'selected';};?>>00</option> 170 <option value="15" <?php if($this->va_settings['end_time_length_hr'] == '15'){echo 'selected';};?>>15</option> 171 <option value="30" <?php if($this->va_settings['end_time_length_hr'] == '30'){echo 'selected';};?>>30</option> 172 <option value="45" <?php if($this->va_settings['end_time_length_hr'] == '45'){echo 'selected';};?>>45</option> 173 </select> minutes 206 <br/> 207 <h2 class="va-tab-title">Form Field Labels</h2><hr/> 208 <p>This allows you to update the labels on the reservation form. Leave blank for default values shown.</p> 209 <div class="form-field-labels"> 210 <p> 211 <label><?php echo $this->va_settings['reservation_single']; ?> Title:</label> 212 <input type="text" name="va_title_label" value="<?php echo $this->va_settings['title_label'];?>"/> 213 </p> 214 <p> 215 <label>Your Name:</label> 216 <input type="text" name="va_name_label" value="<?php echo $this->va_settings['name_label'];?>"/> 217 </p> 218 <p> 219 <label>Phone:</label> 220 <input type="text" name="va_phone_label" value="<?php echo $this->va_settings['phone_label']; ?>"/> 221 </p> 222 <p> 223 <label>Email:</label> 224 <input type="text" name="va_email_label" value="<?php echo $this->va_settings['email_label'];?>"/> 225 </p> 226 <p> 227 <label><?php echo $this->va_settings['reservation_single']; ?> Type:</label> 228 <input type="text" name="va_reservation_type_label" value="<?php echo $this->va_settings['reservation_type_label'];?>"/> 229 </p> 230 <p> 231 <label><?php echo $this->va_settings['reservation_single']; ?> Description:</label> 232 <input type="text" name="va_description_label" value="<?php echo $this->va_settings['description_label'];?>"/> 233 234 </p> 235 <p> 236 <label>Setup Needs:</label> 237 <input type="text" name="va_setup_needs_label" value="<?php echo $this->va_settings['setup_needs_label'];?>"/> 238 </p> 239 <p> 240 <label>A/V Tech Needs: (ie. Screen, Projector, Speakers, Microphone, etc.)</label> 241 <input type="text" name="va_av_needs_label" value="<?php echo $this->va_settings['av_needs_label'];?>"/> 174 242 </p> 175 243 </div> 244 <br/> 176 245 <input type="hidden" name="va_save_form_settings" /> 177 246 <input class="button button-primary" type="submit" name="va_update_settings" value="Update Settings" /> … … 360 429 }); 361 430 362 if(!($('#va-forms #end_time:checked').length > 0)){ 363 $('.reservation-end-times').slideToggle('fast'); 431 // show/hide end time types 432 var selectedVal = ""; 433 var selected = $("input[type='radio'][name='va_end_time_type']:checked"); 434 if(selected.length > 0){ 435 selectedVal = selected.val(); 364 436 } 365 $('#end_time').on('click', function(){ 366 $('.reservation-end-times').slideToggle('fast'); 367 }); 437 438 if(selectedVal == 'fixed'){ 439 $('.reservation-fixed-end-times').fadeIn('fast'); 440 }else if(selectedVal == 'minmax'){ 441 $('.reservation-minmax-end-times').fadeIn('fast'); 442 } 443 444 // toggle fixed and min/max 445 $('.reservation-end-time-type label').on('click', function(){ 446 var selectedVal = $('input', this).val(); 447 if(selectedVal == 'fixed'){ 448 $('.reservation-fixed-end-times').fadeIn('fast'); 449 $('.reservation-minmax-end-times').hide(); 450 }else if(selectedVal == 'minmax'){ 451 $('.reservation-minmax-end-times').fadeIn('fast'); 452 $('.reservation-fixed-end-times').hide(); 453 }else { 454 $('.reservation-fixed-end-times').hide(); 455 $('.reservation-minmax-end-times').hide(); 456 } 457 }); 368 458 }); 369 459 </script> -
vacancy-personal-edition/trunk/vacancy.php
r1137504 r1148497 4 4 Plugin URI: http://kraftpress.it 5 5 Description: A full featured appointment and reservation booking solution 6 Version: 1.2. 16 Version: 1.2.2 7 7 Author: kraftpress 8 8 Author URI: http://kraftpress.it … … 21 21 // vars 22 22 $this->va_settings = array( 23 'version' => '1.2. 1',23 'version' => '1.2.2', 24 24 'path' => apply_filters('va_get_path', __FILE__), 25 25 'dir' => apply_filters('va_get_dir', __FILE__), … … 36 36 'end_time_length_hr' => '0', 37 37 'end_time_length_min' => '0', 38 'end_time_min_length_hr' => '0', 39 'end_time_min_length_min' => '0', 40 'end_time_max_length_hr' => '0', 41 'end_time_max_length_min' => '0', 42 'end_time_minmax_interval' => 0.25, 43 'end_time_type' => 'standard', 38 44 'require_login' => 'yes', 39 45 'admin_new_notification' => 'yes', … … 54 60 'saving_reservation_meta' => false, 55 61 'show_reservation_details' => 'yes', 56 'show_form_fields' => array(' end_time','setup_time','cleanup_time','title','venue','location','phone','type','description','setup_needs','av_needs'),62 'show_form_fields' => array('setup_time','cleanup_time','title','venue','location','phone','type','description','setup_needs','av_needs'), 57 63 'title_label' => '', 58 64 'name_label' => '', … … 124 130 if(isset($_POST['va_av_needs_label'])){update_option('va_av_needs_label', sanitize_text_field($_POST['va_av_needs_label']));} 125 131 132 if(!empty($_POST['va_end_time_type'])){update_option('va_end_time_type', sanitize_text_field($_POST['va_end_time_type']));} 126 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']));} 127 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']));} 128 140 129 141 if(!empty($_POST['va_require_login'])){update_option('va_require_login', sanitize_text_field($_POST['va_require_login']));} … … 208 220 if(!empty($av_needs_label)){$this->va_settings['av_needs_label'] = $av_needs_label;} 209 221 222 $end_time_type = get_option('va_end_time_type'); 223 if(!empty($end_time_type)){$this->va_settings['end_time_type'] = $end_time_type;} 210 224 $end_time_length_hr = get_option('va_end_time_length_hr'); 211 225 if(!empty($end_time_length_hr)){$this->va_settings['end_time_length_hr'] = $end_time_length_hr;} 212 226 $end_time_length_min = get_option('va_end_time_length_min'); 213 227 if(!empty($end_time_length_min)){$this->va_settings['end_time_length_min'] = $end_time_length_min;} 228 $end_time_min_length_hr = get_option('va_end_time_min_length_hr'); 229 if(!empty($end_time_min_length_hr)){$this->va_settings['end_time_min_length_hr'] = $end_time_min_length_hr;} 230 $end_time_min_length_min = get_option('va_end_time_min_length_min'); 231 if(!empty($end_time_min_length_min)){$this->va_settings['end_time_min_length_min'] = $end_time_min_length_min;} 232 $end_time_max_length_hr = get_option('va_end_time_max_length_hr'); 233 if(!empty($end_time_max_length_hr)){$this->va_settings['end_time_max_length_hr'] = $end_time_max_length_hr;} 234 $end_time_max_length_min = get_option('va_end_time_max_length_min'); 235 if(!empty($end_time_max_length_min)){$this->va_settings['end_time_max_length_min'] = $end_time_max_length_min;} 236 $end_time_minmax_interval = get_option('va_end_time_minmax_interval'); 237 if(!empty($end_time_minmax_interval)){$this->va_settings['end_time_minmax_interval'] = $end_time_minmax_interval;} 214 238 215 239 $require_login = get_option('va_require_login'); … … 909 933 } 910 934 $start_time = sanitize_text_field($_POST['va_start_time']); 911 if(in_array('end_time',$this->va_settings['show_form_fields'])){ 912 $end_time = sanitize_text_field($_POST['va_end_time']); 913 }else{ 914 $start_time_temp = strtotime($start_time); 915 $end_time_temp = strtotime("+".$this->va_settings['end_time_length_hr']." hours", $start_time_temp); 916 $end_time = date('H:i',strtotime("+".$this->va_settings['end_time_length_min']." minutes", $end_time_temp)); 917 } 935 $end_time = sanitize_text_field($_POST['va_end_time']); 936 918 937 $name = sanitize_text_field($_POST['va_reservation_name']); 919 938 if(in_array('phone',$this->va_settings['show_form_fields'])){ … … 1704 1723 <?php $setup_cleanup = $this->va_settings['setup_cleanup']; ?> 1705 1724 <div class="va-start"> 1706 <label><strong>Start <?php echo $this->va_settings['reservation_single']; ?> at:</strong> <?php echo $this->va_get_time_select('va_start_time', $start_time, null, true); ?></label> 1725 <label> 1726 <strong>Start <?php echo $this->va_settings['reservation_single']; ?> at:</strong><br/> 1727 <?php echo $this->va_get_time_select('va_start_time', $start_time, null, true, $start_time, $start_time); ?> 1728 </label> 1707 1729 <?php if(in_array('setup_time', $this->va_settings['show_form_fields'])) : ?> 1708 1730 <div class="va-setup-time" <?php if($setup_cleanup == 'no'){echo 'style="display:none;"';}?>> … … 1715 1737 <div id="va-setup-time" style="display:none;"> 1716 1738 <label>Start Setup before <?php echo $this->va_settings['reservation_single']; ?> at: 1717 <?php echo $this->va_get_time_select('va_start_setup_time',null,null,false,false,$start_time ); ?>1739 <?php echo $this->va_get_time_select('va_start_setup_time',null,null,false,false,$start_time,0.25,true); ?> 1718 1740 </label> 1719 1741 </div> … … 1722 1744 </div> 1723 1745 <div class="va-end"> 1724 <?php if(in_array('end_time', $this->va_settings['show_form_fields'])) : ?> 1725 <label><strong>End <?php echo $this->va_settings['reservation_single']; ?> at:</strong> <?php echo $this->va_get_time_select('va_end_time', null, null, true, $start_time); ?></label> 1726 <?php else : ?> 1727 <br/> 1728 <label><?php echo $this->va_settings['reservation_plural']; ?> last for: <?php echo $this->va_settings['end_time_length_hr']; ?> hr <?php echo $this->va_settings['end_time_length_min']; ?> min</label> 1746 <?php if($this->va_settings['end_time_type'] == "standard") : ?> 1747 <label> 1748 <strong>End <?php echo $this->va_settings['reservation_single']; ?> at:</strong> 1749 <?php $start_time = date('H:i',strtotime("+ 15 minutes", strtotime($start_time))); ?> 1750 <?php echo $this->va_get_time_select('va_end_time', $start_time, null, true, $start_time); ?> 1751 </label> 1752 <?php elseif($this->va_settings['end_time_type'] == "fixed") : ?> 1753 <label> 1754 <strong>End <?php echo $this->va_settings['reservation_single']; ?> at:</strong> 1755 <?php 1756 $end_time_temp = strtotime("+".$this->va_settings['end_time_length_hr']." hours", strtotime($start_time)); 1757 $end_time = date('H:i',strtotime("+".$this->va_settings['end_time_length_min']." minutes", $end_time_temp)); 1758 ?> 1759 <?php echo $this->va_get_time_select('va_end_time', $end_time, null, true, $end_time, $end_time); ?> 1760 </label> 1761 <?php else : // min/max ?> 1762 <label> 1763 <strong>End <?php echo $this->va_settings['reservation_single']; ?> at:</strong> 1764 <?php 1765 1766 $start_time_temp = strtotime("+".$this->va_settings['end_time_min_length_hr']." hours", strtotime($start_time)); 1767 $start_time_min = date('H:i',strtotime("+".$this->va_settings['end_time_min_length_min']." minutes", $start_time_temp)); 1768 1769 $end_time_temp = strtotime("+".$this->va_settings['end_time_max_length_hr']." hours", strtotime($start_time)); 1770 $end_time_max = date('H:i',strtotime("+".$this->va_settings['end_time_max_length_min']." minutes", $end_time_temp)); 1771 1772 $interval = $this->va_settings['end_time_minmax_interval']; 1773 ?> 1774 <?php echo $this->va_get_time_select('va_end_time', $start_time_min, null, true, $start_time_min, $end_time_max, $interval); ?> 1775 </label> 1729 1776 <?php endif; ?> 1730 1777 <?php if(in_array('cleanup_time', $this->va_settings['show_form_fields'])) : ?> … … 2285 2332 } 2286 2333 2287 function va_get_time_select($name, $value = null, $id = null, $required = false, $start = false, $end = false ){2334 function va_get_time_select($name, $value = null, $id = null, $required = false, $start = false, $end = false, $interval = 0.25, $reverse = false){ 2288 2335 ob_start(); 2289 2336 ?> 2290 2337 <select id="<?php echo $id; ?>" name="<?php echo $name; ?>" <?php if($required){echo 'required';} ?>> 2291 <?php if($start) : ?> 2292 <?php $time_arr = explode(':',$start); ?> 2293 <?php $start_at = $time_arr[0] + ($time_arr[1]/60); ?> 2294 <?php $times = $this->va_get_times($start_at,23.75,0.25); ?> 2295 <?php elseif($end) : ?> 2296 <?php $time_arr = explode(':',$end); ?> 2297 <?php $end_at = $time_arr[0] + ($time_arr[1]/60); ?> 2298 <?php $times = $this->va_get_times(0,$end_at,0.25); ?> 2299 <?php arsort($times); ?> 2300 <?php else : ?> 2301 <?php $times = $this->va_get_times(0,23.75,0.25); ?> 2302 <?php endif; ?> 2338 2339 <?php 2340 $start_at = 0; 2341 $end_at = 23.75; 2342 2343 if($start){ 2344 $time_arr = explode(':',$start); 2345 $start_at = $time_arr[0] + ($time_arr[1]/60); 2346 } 2347 if($end){ 2348 $time_arr = explode(':',$end); 2349 $end_at = $time_arr[0] + ($time_arr[1]/60); 2350 } 2351 2352 $times = $this->va_get_times($start_at,$end_at,$interval); 2353 if($reverse){ 2354 arsort($times); 2355 } 2356 ?> 2303 2357 <option></option> 2304 2358 <?php foreach ($times as $time) : ?>
Note: See TracChangeset
for help on using the changeset viewer.