Plugin Directory

Changeset 1024486


Ignore:
Timestamp:
11/12/2014 02:17:51 PM (11 years ago)
Author:
syntaxart
Message:

Updated to version 1.1.7

Location:
restaurant-manager
Files:
245 added
15 edited

Legend:

Unmodified
Added
Removed
  • restaurant-manager/trunk/assets/css/admin-style.css

    r1023371 r1024486  
    379379  padding: 0;
    380380}
     381#restaurant_reservation_status_metabox .inside .field-control {
     382  padding: 6px 10px 8px;
     383}
    381384#restaurant_reservation_status_metabox #reservation_publishing {
    382385  padding: 12px;
     
    472475  margin: 0 30px 0 0;
    473476}
    474 #schedule_container .scheduler .schedule-header .icon-calendar,
    475 #schedule_container .scheduler .schedule-header .icon-clock-o {
     477#schedule_container .scheduler .schedule-header .days-icon,
     478#schedule_container .scheduler .schedule-header .time-icon {
    476479  margin: 0 5px 0 0;
    477480}
     
    519522  display: none;
    520523}
     524#reservation_notes_field label,
     525#reservation_notes_field textarea {
     526  width: 100%;
     527}
     528#reservation_notes_field textarea {
     529  width: 100%;
     530  max-width: 100%;
     531  min-height: 300px;
     532}
     533/* =Metabox Columns
     534-------------------------------------------------------------- */
     535.metabox-columns:before,
     536.metabox-columns:after {
     537  clear: both;
     538  content: '\0020';
     539  display: block;
     540  overflow: hidden;
     541  visibility: hidden;
     542  width: 0;
     543  height: 0;
     544}
     545.metabox-columns .column {
     546  float: left;
     547  display: inline-block;
     548  width: 50%;
     549}
     550.metabox-columns .metabox-content label {
     551  display: inline-block;
     552  width: 18%;
     553}
     554#customer_details_metabox {
     555  margin: 0 0 30px 0;
     556}
     557#customer_details_metabox input[type="text"] {
     558  width: 75%;
     559}
     560#customer_details_metabox input[type="text"]:focus {
     561  outline: 0;
     562}
     563#customer_details_metabox input.error {
     564  border: 1px solid red;
     565}
     566#customer_details_metabox label.error {
     567  display: block;
     568  width: 75%;
     569  margin-left: 19%;
     570  color: red;
     571}
     572#customer_notes_field label,
     573#customer_notes_field textarea {
     574  width: 100%;
     575}
     576#customer_notes_field textarea {
     577  width: 100%;
     578  max-width: 100%;
     579  min-height: 260px;
     580}
    521581/* =Restaurant Menus
    522582-------------------------------------------------------------- */
     
    560620  font-weight: bold;
    561621}
     622/* =Restaurant Menus
     623-------------------------------------------------------------- */
     624#syn_restaurant_manager_addons .addons-list {
     625  display: table;
     626  table-layout: fixed;
     627  width: 100%;
     628}
     629#syn_restaurant_manager_addons .addon-item {
     630  display: table-cell;
     631  padding: 0 20px 20px 0;
     632  width: 33.33333333%;
     633}
     634#syn_restaurant_manager_addons .addon-block {
     635  border: 1px solid #e1e1e1;
     636  background-color: #ffffff;
     637  margin: 0 20px 20px 0;
     638  -webkit-box-sizing: border-box;
     639  -moz-box-sizing: border-box;
     640  box-sizing: border-box;
     641}
     642#syn_restaurant_manager_addons .addon-title {
     643  margin: 0;
     644  padding: 20px;
     645  border-bottom: 1px solid #e1e1e1;
     646}
     647#syn_restaurant_manager_addons .addon-content {
     648  padding: 20px;
     649  overflow: hidden;
     650  border-bottom: 1px solid #e1e1e1;
     651}
     652#syn_restaurant_manager_addons .addon-content:before,
     653#syn_restaurant_manager_addons .addon-content:after {
     654  clear: both;
     655  content: '\0020';
     656  display: block;
     657  overflow: hidden;
     658  visibility: hidden;
     659  width: 0;
     660  height: 0;
     661}
     662#syn_restaurant_manager_addons .addon-image {
     663  float: left;
     664  display: block;
     665  margin: 0 20px 20px 0;
     666  width: 150px;
     667  height: 150px;
     668}
     669#syn_restaurant_manager_addons .addon-footer {
     670  line-height: 28px;
     671  padding: 20px;
     672  background-color: #fcfafa;
     673}
     674#syn_restaurant_manager_addons .addon-footer:before,
     675#syn_restaurant_manager_addons .addon-footer:after {
     676  clear: both;
     677  content: '\0020';
     678  display: block;
     679  overflow: hidden;
     680  visibility: hidden;
     681  width: 0;
     682  height: 0;
     683}
     684#syn_restaurant_manager_addons .addon-footer .read-more-link {
     685  text-decoration: none;
     686}
     687#syn_restaurant_manager_addons .addon-footer .buy-now {
     688  float: right;
     689}
     690/* =Customer Email List
     691-------------------------------------------------------------- */
     692.wp-list-table #comment_author,
     693.wp-list-table .comment-author {
     694  width: 20%;
     695}
     696.wp-list-table .comment-email {
     697  display: block;
     698}
     699.wp-list-table .comment_content .comment-submitted {
     700  display: block;
     701  margin: 0 0 5px 0;
     702}
  • restaurant-manager/trunk/assets/css/style.css

    r1023371 r1024486  
    1 @font-face{font-family:restaurant-manager-icons;src:url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.eot?eb23kt);src:url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.eot?#iefixeb23kt) format('embedded-opentype'),url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.woff?eb23kt) format('woff'),url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.ttf?eb23kt) format('truetype'),url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.svg?eb23kt#restaurant-manager-icons) format('svg');font-weight:400;font-style:normal}[class^=rman-],[class*=" rman-"]{font-family:restaurant-manager-icons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.rman-flame:before{content:"\f0df"}.rman-clock-o:before{content:"\f017"}.rman-times-circle:before{content:"\f057"}.rman-calendar:before{content:"\f073"}.rman-chevron-circle-up:before{content:"\f139"}.rman-chevron-circle-down:before{content:"\f13a"}.rman-syntaxstudio:before{content:"\e600"}.rman-knife-and-fork:before{content:"\e601"}#syn_restaurant_manager .synth-form label.error{color:red;width:100%;font-size:90%}#syn_restaurant_manager .synth-form label.error:before{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0;font-family:FontAwesome;font-weight:400;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;content:"\f057";margin-right:4px}#syn_restaurant_manager .synth-form .form-field{overflow:auto;margin-bottom:20px}#syn_restaurant_manager .synth-form .form-label{display:inline-block;width:100%;margin:0}#syn_restaurant_manager .synth-form .form-label label{width:100%}#syn_restaurant_manager .synth-form .form-control{display:inline-block;width:90%;margin:0}#syn_restaurant_manager .synth-form .form-control .inline-error{color:red;display:none}#syn_restaurant_manager .synth-form .form-control textarea{height:100px}#syn_restaurant_manager .synth-form .captcha{position:relative;width:30%}#syn_restaurant_manager .synth-form .captcha .captcha-sum{position:absolute;display:inline-block;padding:8px 6px;font-weight:700}#syn_restaurant_manager .synth-form .captcha .captcha-result{padding-left:60px}#syn_restaurant_manager .synth-form input[type=text],#syn_restaurant_manager .synth-form textarea{width:100%}.syn-restaurant-menu{position:relative;margin:0;padding:0;list-style-type:none}.syn-restaurant-menu li{margin:0;padding:0}.syn-restaurant-menu .syn-menu-title{font-weight:700}.syn-restaurant-menu .syn-menu-content{margin:0 0 30px;padding:0}.syn-restaurant-menu .syn-menu-content:before,.syn-restaurant-menu .syn-menu-content:after{clear:both;content:'\0020';display:block;overflow:hidden;visibility:hidden;width:0;height:0}.syn-restaurant-menu .syn-menu-excerpt{float:left;display:inline-block;width:70%}.syn-restaurant-menu .syn-menu-price{float:right;display:inline-block;width:20%;text-align:right}.syn-restaurant-menu .syn-menu-properties{clear:both;display:block}.syn-restaurant-menu .syn-menu-properties span{padding:0 10px}.syn-restaurant-menu .syn-menu-properties span:first-child{padding:0 10px 0 0}.syn-restaurant-menu .syn-spice-rating .rating-star{padding:0}.syn-restaurant-menu .syn-spice-rating .rating-star:first-child{padding:0}
     1@font-face{font-family:restaurant-manager-icons;src:url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.eot?eb23kt);src:url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.eot?#iefixeb23kt) format('embedded-opentype'),url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.woff?eb23kt) format('woff'),url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.ttf?eb23kt) format('truetype'),url(../fonts/restaurant-manager-icons/fonts/restaurant-manager-icons.svg?eb23kt#restaurant-manager-icons) format('svg');font-weight:400;font-style:normal}[class^=rman-],[class*=" rman-"]{font-family:restaurant-manager-icons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.rman-flame:before{content:"\f0df"}.rman-clock-o:before{content:"\f017"}.rman-times-circle:before{content:"\f057"}.rman-calendar:before{content:"\f073"}.rman-chevron-circle-up:before{content:"\f139"}.rman-chevron-circle-down:before{content:"\f13a"}.rman-syntaxstudio:before{content:"\e600"}.rman-knife-and-fork:before{content:"\e601"}#syn_restaurant_manager .synth-form label.error{color:red;width:100%;font-size:90%}#syn_restaurant_manager .synth-form label.error:before{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0;font-family:FontAwesome;font-weight:400;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;content:"\f057";margin-right:4px}#syn_restaurant_manager .synth-form .form-field{overflow:auto;margin-bottom:20px}#syn_restaurant_manager .synth-form .form-label{display:inline-block;width:100%;margin:0}#syn_restaurant_manager .synth-form .form-label label{width:100%}#syn_restaurant_manager .synth-form .form-control{display:inline-block;width:90%;margin:0}#syn_restaurant_manager .synth-form .form-control .inline-error{color:red;display:none}#syn_restaurant_manager .synth-form .form-control textarea{height:100px}#syn_restaurant_manager .synth-form .captcha{position:relative;width:30%}#syn_restaurant_manager .synth-form .captcha .captcha-sum{position:absolute;display:inline-block;padding:8px 6px;font-weight:700}#syn_restaurant_manager .synth-form .captcha .captcha-result{padding-left:60px}#syn_restaurant_manager .synth-form input[type=text],#syn_restaurant_manager .synth-form textarea{width:100%}#syn_restaurant_manager .synth-form label input[type=checkbox]{position:relative;vertical-align:middle;bottom:1px;margin:0 5px 0 0}.syn-restaurant-menu{position:relative;margin:0;padding:0;list-style-type:none}.syn-restaurant-menu li{margin:0;padding:0}.syn-restaurant-menu .syn-menu-title{font-weight:700}.syn-restaurant-menu .syn-menu-content{margin:0 0 30px;padding:0}.syn-restaurant-menu .syn-menu-content:before,.syn-restaurant-menu .syn-menu-content:after{clear:both;content:'\0020';display:block;overflow:hidden;visibility:hidden;width:0;height:0}.syn-restaurant-menu .syn-menu-excerpt{float:left;display:inline-block;width:70%}.syn-restaurant-menu .syn-menu-price{float:right;display:inline-block;width:20%;text-align:right}.syn-restaurant-menu .syn-menu-properties{clear:both;display:block}.syn-restaurant-menu .syn-menu-properties span{padding:0 10px}.syn-restaurant-menu .syn-menu-properties span:first-child{padding:0 10px 0 0}.syn-restaurant-menu .syn-spice-rating .rating-star{padding:0}.syn-restaurant-menu .syn-spice-rating .rating-star:first-child{padding:0}
  • restaurant-manager/trunk/assets/js/min/synth-restaurant-admin.min.js

    r1020155 r1024486  
    1 "use strict";function syn_restaurant_manager_datepicker(){var e=new Date;jQuery(".syn-datepicker").datepicker({minDate:e})}function syn_restaurant_manager_schedular_timepicker(){jQuery(".syn-timepicker").timepicker(),jQuery(".syn-scheduler-timepicker").timepicker()}function syn_restaurant_manager_scheduler(){function e(){c=jQuery("#schedule_container"),a=c.children().length,jQuery("#schedule_container").on("click",".scheduler .toggle-schedule-button",r),jQuery("#add_schedule_button").click(t),jQuery("#schedule_container").on("click",".scheduler .delete-schedule-button",n)}function r(){var e=jQuery(this).closest(".scheduler");e.hasClass("closed")?e.removeClass("closed"):e.addClass("closed")}function t(){var e=jQuery("#schedule_template").html();a=c.children().length;var r=jQuery(e);r.find("input").each(function(){var e=jQuery(this).attr("name");e=e.replace("%index%",a),jQuery(this).attr("name",e)}),c.append(r),jQuery(".syn-scheduler-timepicker").timepicker()}function n(){var e=jQuery(this).closest(".scheduler");e.remove()}var c="",a=0;e()}jQuery(document).ready(function(){syn_restaurant_manager_datepicker(),syn_restaurant_manager_schedular_timepicker(),syn_restaurant_manager_scheduler()});
     1"use strict";
     2
     3jQuery(document).ready(function ()
     4{
     5    syn_restaurant_manager_datepicker();
     6    syn_restaurant_manager_schedular_timepicker();
     7    syn_restaurant_manager_scheduler();
     8
     9    syn_restaurant_manager_customer_email();
     10});
     11
     12function syn_restaurant_manager_datepicker() {
     13
     14    var todays_date = new Date();
     15
     16    jQuery('.syn-datepicker').datepicker({
     17        minDate: todays_date
     18    });
     19}
     20
     21function syn_restaurant_manager_schedular_timepicker() {
     22
     23    jQuery('.syn-timepicker').timepicker();
     24    jQuery('.syn-scheduler-timepicker').timepicker();
     25}
     26
     27function syn_restaurant_manager_scheduler() {
     28
     29    var $schedule_container = '';
     30    var template;
     31    var _index = 0;
     32    initialize();
     33
     34    function initialize() {
     35
     36        $schedule_container = jQuery('#schedule_container');
     37        _index = $schedule_container.children().length;
     38
     39        jQuery('#schedule_container').on('click', '.scheduler .toggle-schedule-button', toggle_schedule_content);
     40        jQuery('#add_schedule_button').click(add_schedule);
     41        jQuery('#schedule_container').on('click', '.scheduler .delete-schedule-button', delete_schedule);
     42    }
     43
     44    function toggle_schedule_content() {
     45
     46        var $schedule = jQuery(this).closest('.scheduler');
     47
     48        if ($schedule.hasClass('closed')) {
     49            $schedule.removeClass('closed');
     50        }
     51        else {
     52            $schedule.addClass('closed');
     53        }
     54    }
     55
     56    function add_schedule() {
     57
     58        var template = jQuery('#schedule_template').html();
     59        _index = $schedule_container.children().length;
     60
     61        var $template = jQuery(template);
     62
     63        $template.find('input').each(function () {
     64
     65            var name = jQuery(this).attr('name');
     66            name = name.replace('%index%', _index);
     67            jQuery(this).attr('name', name);
     68        });
     69
     70        $schedule_container.append($template);
     71
     72        jQuery('.syn-scheduler-timepicker').timepicker();
     73    }
     74
     75    function delete_schedule() {
     76
     77        var $scheduler = jQuery(this).closest('.scheduler');
     78        $scheduler.remove();
     79    }
     80
     81}
     82
     83function syn_restaurant_manager_customer_email() {
     84
     85    jQuery('#customer_email_send').click(send_the_email);
     86
     87    function send_the_email() {
     88
     89        if (window.tinyMCE) {
     90            var reservation_id = jQuery('#reservation_id').val();
     91            var content = tinyMCE.get('email_content').getContent();
     92
     93            jQuery.ajax({
     94                type: 'POST',
     95                url: ajaxurl,
     96                dataType: 'json',
     97                data: {
     98                    action: 'restaurant_manager_send_customer_email',
     99                    post_id: reservation_id,
     100                    email_content: content
     101                },
     102                success: function (response) {
     103
     104                    if (response) {
     105                        jQuery('#admin-email-message').html('<div class="updated"><p>' + response.message + '</p></div>');
     106                    }
     107                },
     108                error: function (response, jqXHR, textStatus, errorThrown) {
     109
     110                    alert(textStatus, errorThrown);
     111                },
     112                complete: function (response) {
     113                }
     114            });
     115        }
     116
     117    }
     118
     119}
  • restaurant-manager/trunk/assets/js/synth-restaurant-admin.js

    r1020155 r1024486  
    11"use strict";
    22
    3 jQuery(document).ready(function()
     3jQuery(document).ready(function ()
    44{
    55    syn_restaurant_manager_datepicker();
    66    syn_restaurant_manager_schedular_timepicker();
    77    syn_restaurant_manager_scheduler();
     8
     9    syn_restaurant_manager_customer_email();
    810});
    911
     
    5961        var $template = jQuery(template);
    6062
    61         $template.find('input').each(function() {
     63        $template.find('input').each(function () {
    6264
    6365            var name = jQuery(this).attr('name');
     
    7880
    7981}
     82
     83function syn_restaurant_manager_customer_email() {
     84
     85    jQuery('#customer_email_send').click(send_the_email);
     86
     87    function send_the_email() {
     88
     89        if (window.tinyMCE) {
     90            var reservation_id = jQuery('#reservation_id').val();
     91            var content = tinyMCE.get('email_content').getContent();
     92
     93            jQuery.ajax({
     94                type: 'POST',
     95                url: ajaxurl,
     96                dataType: 'json',
     97                data: {
     98                    action: 'restaurant_manager_send_customer_email',
     99                    post_id: reservation_id,
     100                    email_content: content
     101                },
     102                success: function (response) {
     103
     104                    if (response) {
     105                        jQuery('#admin-email-message').html('<div class="updated"><p>' + response.message + '</p></div>');
     106                    }
     107                },
     108                error: function (response, jqXHR, textStatus, errorThrown) {
     109
     110                    alert(textStatus, errorThrown);
     111                },
     112                complete: function (response) {
     113                }
     114            });
     115        }
     116
     117    }
     118
     119}
  • restaurant-manager/trunk/assets/less/admin-style.less

    r1021648 r1024486  
    355355    margin: 0;
    356356    padding: 0;
     357
     358    .field-control{
     359        padding: 6px 10px 8px;
     360    }
    357361}
    358362
     
    431435                margin: 0 30px 0 0;
    432436            }
    433             .icon-calendar,
    434             .icon-clock-o{
     437            .days-icon,
     438            .time-icon{
    435439                margin: 0 5px 0 0;
    436440            }
     
    473477}
    474478
    475 
     479#reservation_notes_field{
     480    label,
     481    textarea{
     482        width: 100%;
     483    }
     484    textarea{
     485        width: 100%;
     486        max-width: 100%;
     487        min-height: 300px;
     488    }
     489}
     490
     491/* =Metabox Columns
     492-------------------------------------------------------------- */
     493.metabox-columns{
     494    .clearfix();
     495
     496    .column{
     497        float: left;
     498        display: inline-block;
     499        width: 50%;
     500    }
     501
     502    .metabox-content{
     503        label{
     504            display: inline-block;
     505            width: 18%;
     506        }
     507        input[type="text"]{
     508            //width: 50%;
     509        }
     510    }
     511}
     512
     513#customer_details_metabox{
     514    margin: 0 0 30px 0;
     515   
     516    input[type="text"]{
     517        width: 75%;
     518       
     519        &:focus{
     520            outline: 0;
     521        }
     522    }
     523    input.error{
     524        border: 1px solid red;
     525    }
     526    label.error{
     527        display: block;
     528        width: 75%;
     529        margin-left: 19%;
     530        color: red;
     531    }
     532}
     533
     534#customer_notes_field{   
     535   
     536    label,
     537    textarea{
     538        width: 100%;
     539    }
     540    textarea{
     541        width: 100%;
     542        max-width: 100%;
     543        min-height: 260px;
     544    }
     545}
    476546
    477547/* =Restaurant Menus
     
    579649    }
    580650}
     651
     652/* =Customer Email List
     653-------------------------------------------------------------- */
     654.wp-list-table{
     655
     656    #comment_author,
     657    .comment-author{
     658        width: 20%;
     659    }
     660    .comment-email{
     661        display: block;
     662    }
     663    .comment_content{
     664        .comment-submitted{
     665            display: block;
     666            margin: 0 0 5px 0;
     667        }
     668    }
     669}
  • restaurant-manager/trunk/class-config.php

    r1022451 r1024486  
    2323    public function __construct() {
    2424
    25         $this->version = '1.1.6';
     25        $this->version = '1.1.7';
    2626        $this->plugin_name = 'Restaurant Manager';
    2727        $this->plugin_slug = 'restaurant-manager';
  • restaurant-manager/trunk/includes/class-reservation-repository.php

    r1011993 r1024486  
    2424
    2525    public function __construct() {
     26       
    2627       
    2728    }
  • restaurant-manager/trunk/includes/functions-admin-menu.php

    r1021648 r1024486  
    240240    $restaurant_telephone = get_option($syn_restaurant_config->plugin_prefix . 'restaurant_telephone', '');
    241241    $currency_symbol = get_option($syn_restaurant_config->plugin_prefix . 'currency_symbol', '£');
     242    //$date_format = get_option($syn_restaurant_config->plugin_prefix . 'date_format', 'F j, Y');
     243    //$time_format = get_option($syn_restaurant_config->plugin_prefix . 'time_format', 'g:i a');
    242244
    243245    if (empty($reservation_success_message)) {
     
    277279                        <p class="description"><?php _e('Set the currency symbol for your menu prices.', 'syn_restaurant_plugin') ?></p>
    278280                    </td>
    279                 </tr>               
     281                </tr>
     282<!--                <tr>
     283                    <th scope="row">
     284                        <label for="date_format"><?php _e('Date Format', 'syn_restaurant_plugin') ?></label>
     285                    </th>
     286                    <td>
     287                        <select id="date_format" name="date_format">
     288                            <option value="F j, Y"<?php selected($date_format, 'F j, Y', true) ?>><?php echo date('F j, Y') ?></option>
     289                            <option value="j F, Y"<?php selected($date_format, 'j F, Y', true) ?>><?php echo date('j F, Y') ?></option>
     290                            <option value="m/d/Y"<?php selected($date_format, 'm/d/Y', true) ?>><?php echo date('m/d/Y') ?></option>
     291                            <option value="d/m/Y"<?php selected($date_format, 'd/m/Y', true) ?>><?php echo date('d/m/Y') ?></option>
     292                        </select>
     293                        <p class="description"><?php _e('Set the date format for dates displayed in your emails, bookings and reservation table.', 'syn_restaurant_plugin') ?></p>
     294                    </td>
     295                </tr>-->
     296<!--                <tr>
     297                    <th scope="row">
     298                        <label for="time_format"><?php _e('Time Format', 'syn_restaurant_plugin') ?></label>
     299                    </th>
     300                    <td>
     301                        <select id="time_format" name="time_format">
     302                            <option value="g:i a"<?php selected($time_format, 'g:i a', true) ?>><?php echo date('g:i a') ?></option>
     303                            <option value="g:i A"<?php selected($time_format, 'g:i A', true) ?>><?php echo date('g:i A') ?></option>
     304                            <option value="G:i a"<?php selected($time_format, 'G:i a', true) ?>><?php echo date('G:i a') ?></option>
     305                            <option value="G:i A"<?php selected($time_format, 'G:i A', true) ?>><?php echo date('G:i A') ?></option>
     306                            <option value="h:i a"<?php selected($time_format, 'h:i a', true) ?>><?php echo date('h:i a') ?></option>
     307                            <option value="h:i A"<?php selected($time_format, 'h:i A', true) ?>><?php echo date('h:i A') ?></option>
     308                            <option value="H:i a"<?php selected($time_format, 'H:i a', true) ?>><?php echo date('H:i a') ?></option>
     309                            <option value="H:i A"<?php selected($time_format, 'H:i A', true) ?>><?php echo date('H:i A') ?></option>                           
     310                            <option value="H:i"<?php selected($time_format, 'H:i', true) ?>><?php echo date('H:i') ?></option>
     311                        </select>
     312                        <p class="description"><?php _e('Set the time format for dates displayed in your emails, bookings and reservation table.', 'syn_restaurant_plugin') ?></p>
     313                    </td>
     314                </tr>-->
    280315            </tbody>
    281316        </table>
     
    333368        'start_time' => '',
    334369        'end_time' => '',
    335         'content_open' => ''
     370        'content_open' => ' add-schedule'
    336371    );
    337372    syn_restaurant_manager_schedule_template($parameters);
  • restaurant-manager/trunk/includes/functions-form-processing.php

    r1021489 r1024486  
    2525        return false;
    2626    }
    27        
     27
    2828    $first_name = $session->post_var('first_name');
    2929    $last_name = $session->post_var('last_name');
     
    5858    $post_id = wp_insert_post($post);
    5959
     60    //insert arrival time in MySql dateformat.
    6061    $arrival_time = date('Y-m-d H:i:s', strtotime("$reservation_date, $reservation_time"));
    6162
     
    7475    $site_name = get_bloginfo('name');
    7576    $site_link = site_url();
    76     $current_time = date('Y-m-d H:i:s');
     77    $date_format = get_option('date_format');
     78    $time_format = get_option('time_format');
     79    $current_time = date("{$date_format} - {$time_format}");
     80    $reservation_date = date("{$date_format}", strtotime($reservation_date));
     81    $reservation_time = date("{$time_format}", strtotime($reservation_time));
    7782
    7883    $replace = array(
     
    132137    $restaurant_telephone = $session->post_var('restaurant_telephone');
    133138    $currency_symbol = $session->post_var('currency_symbol');
     139    //$date_format = $session->post_var('date_format');
     140    //$time_format = $session->post_var('time_format');
    134141
    135142    update_option($syn_restaurant_config->plugin_prefix . 'group_size', $group_size);
     
    137144    update_option($syn_restaurant_config->plugin_prefix . 'restaurant_telephone', $restaurant_telephone);
    138145    update_option($syn_restaurant_config->plugin_prefix . 'currency_symbol', $currency_symbol);
     146    //update_option($syn_restaurant_config->plugin_prefix . 'date_format', $date_format);
     147    //update_option($syn_restaurant_config->plugin_prefix . 'time_format', $time_format);
    139148}
    140149
  • restaurant-manager/trunk/includes/functions-helpers.php

    r1023371 r1024486  
    197197            $days_obj = array($monday_text, $tuesday_text, $wednesday_text, $thursday_text, $friday_text, $saturday_text, $sunday_text);
    198198            $days_text = implode(', ', array_filter($days_obj));
    199             $days_text = (!empty($days_text)) ? '<i class="rman-calendar"></i>' . $days_text : null;
     199            $days_text = (!empty($days_text)) ? '' . $days_text : null;
    200200            $time_text = date('H:i A', strtotime($starttime)) . ' - ' . date('H:i A', strtotime($endtime));
    201201
     
    230230    <div class="scheduler<?php echo $parameters['content_open'] ?>">
    231231        <div class="schedule-header">
    232             <span class="schedule-days"><?php echo $parameters['days_text'] ?></span>
    233             <span class="schedule-time"><i class="rman-clock-o"></i><?php echo $parameters['time_text'] ?></span>
     232            <span class="schedule-days"><i class="days-icon rman-calendar"></i><?php echo $parameters['days_text'] ?></span>
     233            <span class="schedule-time"><i class="time-icon rman-clock-o"></i><?php echo $parameters['time_text'] ?></span>
    234234            <a class="delete-schedule-button" href="javascrip:void(0)"></a>
    235235            <a class="toggle-schedule-button" href="javascrip:void(0)"></a>
     
    300300            break;
    301301    }
    302 
     302   
    303303    return $result;
    304304}
    305 
    306 
    307 
    308 
    309 
    310305
    311306//menu functions
     
    341336
    342337    $shortcodes = array(
    343         //'syntaxthemes\restaurant\menus\syn_restaurant_menu'
     338            //'syntaxthemes\restaurant\menus\syn_restaurant_menu'
    344339    );
    345340
     
    530525    add_action('wp_ajax_restaurant_menus_get_meal_options', 'syn_restaurant_menus_get_meal_options');
    531526}
     527
     528if (!function_exists('syn_restaurant_manager_send_customer_email')) {
     529
     530    function syn_restaurant_manager_send_customer_email() {
     531
     532        $session = new \syntaxthemes\restaurant\session();
     533
     534        $post_id = $session->post_var('post_id');
     535        $email_content = $session->post_var('email_content');
     536        $first_name = get_post_meta($post_id, 'first_name', true);
     537        $last_name = get_post_meta($post_id, 'last_name', true);
     538        $email_address = get_post_meta($post_id, 'email_address', true);
     539        $time = current_time('mysql');
     540        $user = get_user_by('email', get_option('admin_email'));
     541
     542        $data = array(
     543            'comment_post_ID' => $post_id,
     544            'comment_author' => "$first_name $last_name",
     545            'comment_author_email' => $email_address,
     546            'comment_author_url' => 'http://',
     547            'comment_content' => $email_content,
     548            'comment_type' => '',
     549            'comment_parent' => 0,
     550            'user_id' => $user->ID,
     551            'comment_author_IP' => '127.0.0.1',
     552            'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
     553            'comment_date' => $time,
     554            'comment_approved' => 1,
     555        );
     556
     557        $comment_id = wp_new_comment($data);
     558        //$comment = get_comment($comment_id);
     559
     560        if (isset($comment_id) && !empty($comment_id)) {
     561            $response = array(
     562                'comment' => $data,
     563                'message' => _('Your email has successfully been sent to your customer.')
     564            );
     565
     566            wp_send_json($response);
     567        }
     568
     569        die();
     570    }
     571
     572    add_action('wp_ajax_restaurant_manager_send_customer_email', 'syn_restaurant_manager_send_customer_email');
     573}
    532574?>
  • restaurant-manager/trunk/includes/includes.php

    r1021459 r1024486  
    88require_once('post-types/class-reservation-post-type.php');
    99require_once('post-types/class-reservation-post-meta-boxes.php');
     10require_once('post-types/class-reservation-status.php');
    1011require_once('post-types/class-meal-post-type.php');
    1112require_once('post-types/class-meal-post-meta-boxes.php');
     
    1617require_once('shortcodes/class-shortcode-extensions.php');
    1718require_once('class-reservation-repository.php');
     19
     20require_once('class-emails-list-table.php');
    1821?>
  • restaurant-manager/trunk/includes/post-types/class-reservation-post-meta-boxes.php

    r1011993 r1024486  
    1010class reservation_post_meta_boxes {
    1111
     12    private $_config;
     13
    1214    /**
    1315     * The post meta box constructor.
     
    1517    public function __construct() {
    1618
    17         add_action('add_meta_boxes', array($this, 'remove_meta_boxes'), 10);
     19        global $syn_restaurant_config;
     20        $this->_config = $syn_restaurant_config;
     21
     22        add_action('admin_menu', array($this, 'remove_meta_boxes'), 10);
    1823        add_action('add_meta_boxes', array($this, 'rename_meta_boxes'), 20);
    1924        add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 30);
     25        add_action('save_post', array($this, 'save_meta_boxes'), 30);
    2026
    2127        add_action('edit_form_after_title', array($this, 'metabox_positions'));
    22 
    23         add_action('init', array($this, 'init_meta_boxes'), 9999);
    24         add_filter('syn_restaurant_manager_meta_boxes', array($this, 'reservation_customer_details_meta_box'));
    2528    }
    2629
     
    4245     */
    4346    public function remove_meta_boxes() {
    44        
     47
     48        remove_meta_box('submitdiv', 'syn_rest_reservation', 'normal');
    4549    }
    4650
     
    5761    public function add_meta_boxes() {
    5862
    59         add_meta_box('submitdiv', __('Reservation Status', 'syn_restaurant_plugin'), array($this, 'reservation_status_meta_box'), 'syn_rest_reservation', 'side', 'default');
    60     }
    61 
    62     /**
    63      * Initialize the metaboxes.
    64      * @param type $meta_boxes
    65      */
    66     function init_meta_boxes($meta_boxes) {
    67 
    68         $meta_boxes = apply_filters('syn_restaurant_manager_meta_boxes', $meta_boxes);
    69 
    70         foreach ($meta_boxes as $meta_box) {
    71             new custom_meta_box($meta_box);
     63        add_meta_box('restaurant_reservation_status_metabox', __('Reservation Status', 'syn_restaurant_plugin'), array($this, 'reservation_status_meta_box'), 'syn_rest_reservation', 'side', 'default');
     64        add_meta_box('restaurant_customer_notes_metabox', __('Customer Details', 'syn_restaurant_plugin'), array($this, 'reservation_customer_notes_meta_box'), 'syn_rest_reservation', 'advanced', 'high');
     65        //add_meta_box('restaurant_customer_emails_metabox', __('Customer Email', 'syn_restaurant_plugin'), array($this, 'reservation_customer_emails_meta_box'), 'syn_rest_reservation', 'advanced', 'high');
     66    }
     67
     68    public function save_meta_boxes($post_id) {
     69
     70        global $post_type, $wpdb;
     71
     72        $session = new session();
     73
     74        if ('POST' !== strtoupper($session->server_var('REQUEST_METHOD'))) {
     75            return false;
    7276        }
     77
     78        if ($post_type !== 'syn_rest_reservation') {
     79            return false;
     80        }
     81
     82        $first_name = $session->post_var('first_name');
     83        $last_name = $session->post_var('last_name');
     84        $phone_number = $session->post_var('phone_number');
     85        $email_address = $session->post_var('email_address');
     86        $guests_count = $session->post_var('guests_count');
     87        $reservation_date = $session->post_var('reservation_date');
     88        $reservation_time = $session->post_var('reservation_time');
     89
     90        update_post_meta($post_id, 'first_name', $first_name);
     91        update_post_meta($post_id, 'last_name', $last_name);
     92        update_post_meta($post_id, 'phone_number', $phone_number);
     93        update_post_meta($post_id, 'email_address', $email_address);
     94        update_post_meta($post_id, 'guests_count', $guests_count);
     95        update_post_meta($post_id, 'reservation_date', $reservation_date);
     96        update_post_meta($post_id, 'reservation_time', $reservation_time);
     97
     98        $arrival_time = date('Y-m-d H:i:s', strtotime("$reservation_date, $reservation_time"));
     99        update_post_meta($post_id, 'arrival_time', $arrival_time);
     100
     101        $title = 'Reservation: ' . $first_name . ' ' . $last_name;
     102        $where = array('ID' => $post_id);
     103        $wpdb->update($wpdb->posts, array('post_title' => $title), $where);
    73104    }
    74105
     
    78109     * @return boolean
    79110     */
    80     public function reservation_customer_details_meta_box() {
    81 
    82         global $syn_restaurant_config;
    83 
    84         $meta_boxes = array();
    85 
    86         $meta_boxes[] = array(
    87             'id' => 'restaurant_customer_details_metabox',
    88             'title' => 'Customer Details',
    89             'pages' => array('syn_rest_reservation'), // post type
    90             'context' => 'advanced',
    91             'priority' => 'high',
    92             'show_names' => true, // Show field names on the left
    93             'fields' => array(
    94                 array(
    95                     'id' => $syn_restaurant_config->plugin_prefix . 'first_name',
    96                     'name' => 'first_name',
    97                     'label' => 'First Name',
    98                     'desc' => __('Choose the header feature for your restaurant view.', 'syn_restaurant_plugin'),
    99                     'std' => '',
    100                     'data' => array(
    101                         'rule-required' => 'true',
     111    public function reservation_customer_notes_meta_box($post) {
     112
     113        $first_name = get_post_meta($post->ID, 'first_name', true);
     114        $last_name = get_post_meta($post->ID, 'last_name', true);
     115        $phone_number = get_post_meta($post->ID, 'phone_number', true);
     116        $email_address = get_post_meta($post->ID, 'email_address', true);
     117        $guests_count = get_post_meta($post->ID, 'guests_count', true);
     118        $reservation_date = get_post_meta($post->ID, 'reservation_date', true);
     119        $reservation_time = get_post_meta($post->ID, 'reservation_time', true);
     120        ?>
     121        <div id="customer_details_metabox" class="metabox-columns">
     122            <div class="column metabox-content">
     123                <p>
     124                    <label for="first_name"><?php _e('First Name', 'syn_restaurant_plugin') ?></label>
     125                    <input id="first_name" name="first_name" type="text" value="<?php echo $first_name ?>" data-rule-required="true" />
     126                </p>
     127                <p>
     128                    <label for="last_name"><?php _e('Last Name', 'syn_restaurant_plugin') ?></label>
     129                    <input id="last_name" name="last_name" type="text" value="<?php echo $last_name ?>" data-rule-required="true" />
     130                </p>
     131                <p>
     132                    <label for="phone_number"><?php _e('Phone Number', 'syn_restaurant_plugin') ?></label>
     133                    <input id="phone_number" name="phone_number" type="text" value="<?php echo $phone_number ?>" data-rule-required="true" />
     134                </p>
     135                <p>
     136                    <label for="email_address"><?php _e('Email Address', 'syn_restaurant_plugin') ?></label>
     137                    <input id="email_address" name="email_address" type="text" value="<?php echo $email_address ?>" data-rule-required="true" data-rule-email="true" data-msg-email="Your email address which you have entered is in the incorrect format" />
     138                </p>
     139                <p>
     140                    <label for="guests_count"><?php _e('Number of Guests', 'syn_restaurant_plugin') ?></label>
     141                    <input id="guests_count" name="guests_count" type="text" value="<?php echo $guests_count ?>" data-rule-required="true" />
     142                </p>
     143                <p>
     144                    <label for="reservation_date"><?php _e('Reservation Date', 'syn_restaurant_plugin') ?></label>
     145                    <input id="reservation_date" class="syn-datepicker" name="reservation_date" type="text" value="<?php echo $reservation_date ?>" data-rule-required="true" readonly/>
     146                </p>
     147                <p>
     148                    <label for="reservation_time"><?php _e('Reservation Time', 'syn_restaurant_plugin') ?></label>
     149                    <input id="reservation_time" class="syn-timepicker" name="reservation_time" type="text" value="<?php echo $reservation_time ?>" data-rule-required="true" readonly/>
     150                </p>
     151
     152            </div>
     153            <div class="column metabox-content">               
     154            </div>           
     155        </div>
     156        <div id="customer_notes_box" class="metabox-content">
     157            <p id="customer_notes_field">
     158                <label for="notes"><?php _e('Customer Notes', 'syn_restaurant_plugin') ?></label>
     159                <textarea id="notes" name="content" type="text"><?php echo $post->post_content ?></textarea>
     160            </p>
     161        </div>
     162        <?php
     163    }
     164
     165    public function reservation_customer_emails_meta_box($post) {
     166
     167        $email_address = get_post_meta($post->ID, 'customer_email', true);
     168        ?>
     169        <div id="reservation_email_field" class="metabox-content">
     170            <p>
     171                <?php
     172                $email_content_settings = array(
     173                    'textarea_name' => 'admin_email',
     174                    'textarea_rows' => 10,
     175                    'media_buttons' => false,
     176                    'teeny' => true,
     177                    'tinymce' => array(
     178                        'toolbar1' => 'bold, italic, underline, bullist, numlist'
    102179                    ),
    103                     'template' => 'simple_template',
    104                     'type' => 'text'
    105                 ),
    106                 array(
    107                     'id' => $syn_restaurant_config->plugin_prefix . 'last_name',
    108                     'name' => 'last_name',
    109                     'label' => 'Last Name',
    110                     'desc' => __('Choose the header feature for your restaurant view.', 'syn_restaurant_plugin'),
    111                     'std' => '',
    112                     'data' => array(
    113                         'rule-required' => 'true',
    114                     ),
    115                     'template' => 'simple_template',
    116                     'type' => 'text'
    117                 ),
    118                 array(
    119                     'id' => $syn_restaurant_config->plugin_prefix . 'phone_number',
    120                     'name' => 'phone_number',
    121                     'label' => 'Phone Number',
    122                     'desc' => __('Choose the header feature for your restaurant view.', 'syn_restaurant_plugin'),
    123                     'std' => '',
    124                     'data' => array(
    125                         'rule-required' => 'true',
    126                     ),
    127                     'template' => 'simple_template',
    128                     'type' => 'text'
    129                 ),
    130                 array(
    131                     'id' => $syn_restaurant_config->plugin_prefix . 'email_address',
    132                     'name' => 'email_address',
    133                     'label' => 'Email Address',
    134                     'desc' => __('Choose the header feature for your restaurant view.', 'syn_restaurant_plugin'),
    135                     'std' => '',
    136                     'data' => array(
    137                         'rule-required' => 'true',
    138                         'rule-email' => 'true',
    139                         'msg-email' => __('Your email address which you have entered is in the incorrect format', 'syn_restaurant_plugin')
    140                     ),
    141                     'template' => 'simple_template',
    142                     'type' => 'text'
    143                 ),
    144                 array(
    145                     'id' => $syn_restaurant_config->plugin_prefix . 'guests_count',
    146                     'name' => 'guests_count',
    147                     'label' => 'Number of Guests',
    148                     'desc' => __('Choose the header feature for your restaurant view.', 'syn_restaurant_plugin'),
    149                     'std' => '',
    150                     'data' => array(
    151                         'rule-required' => 'true',
    152                     ),
    153                     'template' => 'simple_template',
    154                     'type' => 'text'
    155                 ),
    156                 array(
    157                     'id' => $syn_restaurant_config->plugin_prefix . 'reservation_date',
    158                     'name' => 'reservation_date',
    159                     'label' => 'Reservation Date',
    160                     'desc' => __('Choose the header feature for your restaurant view.', 'syn_restaurant_plugin'),
    161                     'std' => '',
    162                     'data' => array(
    163                         'rule-required' => 'true',
    164                     ),
    165                     'template' => 'simple_template',
    166                     'type' => 'datepicker'
    167                 ),
    168                 array(
    169                     'id' => $syn_restaurant_config->plugin_prefix . 'reservation_time',
    170                     'name' => 'reservation_time',
    171                     'label' => 'Reservation Time',
    172                     'desc' => __('Choose the header feature for your restaurant view.', 'syn_restaurant_plugin'),
    173                     'std' => '',
    174                     'data' => array(
    175                         'rule-required' => 'true',
    176                     ),
    177                     'template' => 'simple_template',
    178                     'type' => 'timepicker'
    179                 )
    180             )
    181         );
    182 
    183         return $meta_boxes;
     180                    'quicktags' => false,
     181                    'wpautop' => true
     182                );
     183
     184                wp_editor('', 'email_content', $email_content_settings);
     185                ?>
     186            </p>
     187            <p class="description">
     188                <?php _e('Write the content for your customer email in the box and send.', 'syn_restaurant_plugin') ?>
     189            </p>
     190            <p>
     191                <input id="reservation_id" type="hidden" value="<?php echo $post->ID ?>"/>
     192                <a id="customer_email_send" class="button secondary" href="javascript:void(0)">Send Email</a>               
     193            </p>
     194            <div id="customer_emails">
     195                <div id="admin-email-message"></div>
     196                <?php
     197                $args = array(
     198                    'post_id' => $post->ID
     199                );
     200                $comments = get_comments($args);
     201
     202                //var_dump($comments);
     203
     204                $emails_list_table = new \emails_list_table();
     205                $emails_list_table->prepare_items();
     206                $emails_list_table->display();
     207                ?>               
     208            </div>
     209        </div>   
     210
     211        <?php
    184212    }
    185213
     
    190218     * @param type $metabox
    191219     */
    192     public function reservation_status_meta_box($post, $metabox) {
    193 
    194         global $action;
    195 
    196         $post_type = $post->post_type;
    197         $post_type_object = get_post_type_object($post_type);
    198         $can_publish = current_user_can($post_type_object->cap->publish_posts);
    199        
    200         if($post->post_status === 'auto-draft' || $post->post_status === 'draft'){
    201            $post->post_status = 'pending';
    202         }
     220    public function reservation_status_meta_box($post) {
     221
     222        $post_status = $post->post_status;
    203223        ?>
    204         <div class="submitbox" id="submitpost">
    205 
    206             <div id="minor-publishing">
    207 
    208                 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key   ?>
    209                 <div style="display:none;">
    210                     <?php submit_button(__('Save'), 'button', 'save'); ?>
    211                 </div>
    212 
    213                 <div id="misc-publishing-actions">
    214 
    215                     <div class="misc-pub-section misc-pub-post-status"><label for="post_status"><?php _e('Status:') ?></label>
    216                         <span id="post-status-display">
     224        <div class="metabox-content submitbox">
     225            <div id="reservation_status_field" class="field-control">
     226                <p>
     227                    <label for="reservation_status"><?php _e('Status', 'syn_restaurant_plugin') ?></label>
     228                    <select id="reservation_status" name="post_status">
     229                        <?php
     230                        $statuses = $this->reservation_statuses();
     231
     232                        foreach ($statuses as $key => $status) {
     233                            ?>
     234                            <option value="<?php echo $key ?>"<?php selected($post_status, $key, true) ?>><?php echo $status ?></option>
    217235                            <?php
    218                             switch ($post->post_status) {
    219                                 case 'pending':
    220                                     _e('Pending Reservation');
    221                                     break;
    222                                 case 'confirmed':
    223                                     _e('Confirmed Reservation');
    224                                     break;
    225                                 case 'rejected':
    226                                     _e('Rejected Reservation');
    227                                     break;
    228                                 default :
    229                                     _e('Pending Reservation');
    230                                     break;
    231                             }
    232                             ?>
    233                         </span>                   
    234                         <a href="#post_status" <?php if ('complete-reservation' == $post->post_status) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js"><span aria-hidden="true"><?php _e('Edit'); ?></span> <span class="screen-reader-text"><?php _e('Edit status'); ?></span></a>
    235                         <div id="post-status-select" class="hide-if-js">
    236                             <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr(('pending' == $post->post_status ) ? 'pending' : $post->post_status); ?>" />
    237                             <select name='post_status' id='post_status'>
    238                                 <option<?php selected($post->post_status, 'pending'); ?> value='pending'><?php _e('Pending Reservation') ?></option>
    239                                 <option<?php selected($post->post_status, 'confirmed'); ?> value='confirmed'><?php _e('Confirm Reservation') ?></option>
    240                                 <option<?php selected($post->post_status, 'rejected'); ?> value='rejected'><?php _e('Reject Reservation') ?></option>
    241                             </select>
    242                             <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
    243                             <a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
    244                         </div>
    245                     </div><!-- .misc-pub-section -->
    246 
    247                     <?php
    248                     /* translators: Publish box date format, see http://php.net/date */
    249                     $datef = __('M j, Y @ G:i');
    250 
    251                     if (0 != $post->ID) {
    252                         if ('future' == $post->post_status) { // scheduled for publishing at a future date
    253                             $stamp = __('Scheduled for: <b>%1$s</b>');
    254                         } else if ('publish' == $post->post_status || 'private' == $post->post_status) { // already published
    255                             $stamp = __('Published on: <b>%1$s</b>');
    256                         } else if ('0000-00-00 00:00:00' == $post->post_date_gmt) { // draft, 1 or more saves, no date specified
    257                             $stamp = __('Publish <b>immediately</b>');
    258                         } else if (time() < strtotime($post->post_date_gmt . ' +0000')) { // draft, 1 or more saves, future date specified
    259                             $stamp = __('Schedule for: <b>%1$s</b>');
    260                         } else { // draft, 1 or more saves, date specified
    261                             $stamp = __('Publish on: <b>%1$s</b>');
    262236                        }
    263                         $date = date_i18n($datef, strtotime($post->post_date));
    264                     } else { // draft (no saves, and thus no date specified)
    265                         $stamp = __('Publish <b>immediately</b>');
    266                         $date = date_i18n($datef, strtotime(current_time('mysql')));
    267                     }
    268 
    269                     if (!empty($args['args']['revisions_count'])) :
    270                         $revisions_to_keep = wp_revisions_to_keep($post);
    271237                        ?>
    272                         <div class="misc-pub-section misc-pub-revisions">
    273                             <?php
    274                             if ($revisions_to_keep > 0 && $revisions_to_keep <= $args['args']['revisions_count']) {
    275                                 echo '<span title="' . esc_attr(sprintf(__('Your site is configured to keep only the last %s revisions.'), number_format_i18n($revisions_to_keep))) . '">';
    276                                 printf(__('Revisions: %s'), '<b>' . number_format_i18n($args['args']['revisions_count']) . '+</b>');
    277                                 echo '</span>';
    278                             } else {
    279                                 printf(__('Revisions: %s'), '<b>' . number_format_i18n($args['args']['revisions_count']) . '</b>');
    280                             }
    281                             ?>
    282                             <a class="hide-if-no-js" href="<?php echo esc_url(get_edit_post_link($args['args']['revision_id'])); ?>"><span aria-hidden="true"><?php _ex('Browse', 'revisions'); ?></span> <span class="screen-reader-text"><?php _e('Browse revisions'); ?></span></a>
    283                         </div>
    284                         <?php
    285                     endif;
    286 
    287                     if ($can_publish) : // Contributors don't get to choose the date of publish
    288                         ?>
    289                         <div class="misc-pub-section curtime misc-pub-curtime">
    290                             <span id="timestamp">
    291                                 <?php printf($stamp, $date); ?>
    292                             </span>                       
    293                             <div id="timestampdiv" class="hide-if-js">
    294                                 <?php touch_time(($action == 'pending'), 1); ?>
    295                             </div>
    296                         </div>
    297                         <?php // /misc-pub-section  ?>
    298 
    299                     <?php endif; ?>
    300 
    301                     <?php
    302                     /**
    303                      * Fires after the post time/date setting in the Publish meta box.
    304                      *
    305                      * @since 2.9.0
    306                      */
    307                     do_action('post_submitbox_misc_actions');
    308                     ?>
    309                 </div>
    310                 <div class="clear"></div>
    311             </div>
    312 
     238                    </select>
     239                </p>               
     240            </div> 
    313241            <div id="major-publishing-actions">
    314242                <?php
     
    335263                    <span class="spinner"></span>     
    336264                    <?php
     265                    $post_type = $post->post_type;
     266                    $post_type_object = get_post_type_object($post_type);
     267                    $can_publish = current_user_can($post_type_object->cap->publish_posts);
     268
    337269                    if (!in_array($post->post_status, array('pending', 'confirmed', 'rejected')) || 0 == $post->ID) {
    338270                        if ($can_publish) {
    339271                            ?>
    340272                            <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
    341                             <?php submit_button(__('Save Reservation'), 'primary button-large', 'pending', false, array('accesskey' => 'p')); ?>
     273                            <?php submit_button(__('Save Reservation'), 'primary button-large', 'submit', false, array('accesskey' => 'p')); ?>
    342274                            <?php
    343275                        }
     
    352284            </div>
    353285        </div>
    354 
    355286        <?php
    356287    }
  • restaurant-manager/trunk/includes/post-types/class-reservation-post-type.php

    r1021459 r1024486  
    5959            'rewrite' => false,
    6060            'query_var' => false,
    61             'supports' => array('title', 'editor'),
     61            'supports' => array('title'),
    6262            'has_archive' => false,
    6363            'menu_position' => 201,
     
    110110     */
    111111    public function save_post($post_id) {
    112 
    113         if ($post_id == null || empty($_POST))
    114             return;
    115 
    116         if (!isset($_POST['post_type']) || $_POST['post_type'] != 'syn_rest_reservation')
    117             return;
    118 
    119         global $syn_restaurant_config, $post, $wpdb;
    120 
    121         $first_name = get_post_meta($post_id, 'first_name', true);
    122         $last_name = get_post_meta($post_id, 'last_name', true);
    123         $telephone = get_post_meta($post_id, 'phone_number', true);
    124         $email_address = get_post_meta($post_id, 'email_address', true);
    125         $guests_count = get_post_meta($post_id, 'guests_count', true);
    126         $reservation_date = get_post_meta($post_id, 'reservation_date', true);
    127         $reservation_time = get_post_meta($post_id, 'reservation_time', true);
    128         $status = $_POST['post_status'];
    129112       
    130         $arrival_time = date('Y-m-d H:i:s', strtotime("$reservation_date, $reservation_time"));
    131         update_post_meta($post_id, 'arrival_time', $arrival_time);
    132 
    133         $title = 'Reservation: ' . $first_name . ' ' . $last_name;
    134         $where = array('ID' => $post_id);
    135         $wpdb->update($wpdb->posts, array('post_title' => $title), $where);
    136 
    137         $site_name = get_bloginfo('name');
    138         $site_link = site_url();
    139         $current_time = date('Y-m-d H:i:s');
    140 
    141         $restaurant_telephone = get_option($syn_restaurant_config->plugin_prefix . 'restaurant_telephone', '');
    142 
    143         $reservation_date = date('l jS F - Y', strtotime($arrival_time));
    144         $reservation_time = date('g:i A', strtotime($arrival_time));
    145 
    146         $replace = array(
    147             $site_name,
    148             $first_name,
    149             $last_name,
    150             $telephone,
    151             $email_address,
    152             $guests_count,
    153             $reservation_date,
    154             $reservation_time,
    155             $current_time,
    156             $site_link,
    157             $restaurant_telephone
    158         );
    159 
    160         $result = syntaxthemes_process_notification_email($status, $email_address, $replace);
    161113    }
    162114
     
    207159    public function column_content($column, $post_id) {
    208160
    209         global $post, $post_type;
     161        global $post, $post_type, $syn_restaurant_config;
    210162
    211163        if ($post_type === 'syn_rest_reservation') {
     
    244196            if ($column == 'arrival') {
    245197
     198                $date_format = get_option('date_format');
     199                $time_format = get_option('time_format');
    246200                $arrival_time = get_post_meta($post_id, 'arrival_time', true);
    247201
    248                 echo date('F j, Y, g:i a', strtotime($arrival_time));
     202                echo date("{$date_format} - {$time_format}", strtotime($arrival_time));
    249203            }
    250204            if ($column == 'status') {
     
    253207
    254208                switch ($status) {
     209                    case 'draft' : $status_text = __('Draft', 'syn_restaurant_plugin');
     210                        break;
    255211                    case 'pending' : $status_text = __('Pending', 'syn_restaurant_plugin');
    256212                        break;
  • restaurant-manager/trunk/readme.txt

    r1022451 r1024486  
    77Requires at least: 3.8
    88Tested up to: 4.0
    9 Stable tag: 1.1.6
     9Stable tag: 1.1.7
    1010Text Domain: syn_restaurant_plugin
    1111License: GPLv2 or later
     
    119119== Changelog ==
    120120
     121**Version 1.1.7**
     122
     123- Improved the add reservation screen in the admin.
     124- Added date and time formatting built in by WordPress to all date components.
     125
    121126**Version 1.1.6**
    122127
  • restaurant-manager/trunk/restaurant-manager.php

    r1022451 r1024486  
    44  Plugin Name: Restaurant Manager
    55  Plugin URI: http://www.syntaxthemes.co.uk
    6   Version: 1.1.6
     6  Version: 1.1.7
    77  Author: Ryan Haworth
    88  Description: Restaurant Manager is a plugin to manage your restaurant.  Create your dinner menus, take reservations and send and receive notifications with your customers.
Note: See TracChangeset for help on using the changeset viewer.