Plugin Directory

Changeset 3068888


Ignore:
Timestamp:
04/11/2024 09:43:46 AM (2 years ago)
Author:
tharkun69
Message:

1.4.1

  • Bugfix: Frontend add and delete booking
  • Bugfix: Drag & Drop move of the booking
Location:
occupancy-plan/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • occupancy-plan/trunk/admin/class-occupancy-plan-admin.php

    r3068435 r3068888  
    532532     * 1.3.8 - Don't send mail for block update
    533533     * 1.3.16 - Replace of [email] tag
     534     * 1.4.1 - Bugfix: User correct blocks controller
    534535     */
    535536    public function add_block()
     
    549550        }
    550551
    551         $blockid = $this->internal_save_block();
     552        $blockid = $this->blocks->internal_save_block();
    552553
    553554        if ((isset($_POST['id'])) && ((int) $_POST['id'] > 0))
     
    617618     * 1.2.4 - Add 'mailaddress' element
    618619     * 1.2.4 - Add 'provisional' flag
     620     * 1.4.1 - Fix logic for full court move
    619621     */
    620622    public function move_block()
     
    635637                (isset($target['interval'])))
    636638            {
    637                 // error_log(print_r($source, true));
    638                 // error_log(print_r($target, true));
    639 
    640639                $id = intval($source['blockid']);
    641640                $interval = intval($source['interval']);
    642641
    643642                // Calculate the new start and end time ...
    644                 $oldstarttime  = date_create_from_format('H:i', sanitize_text_field($source['starttime']));
    645                 $oldendtime = date_create_from_format('H:i', sanitize_text_field($source['endtime']));
     643                $oldstarttime  = date_create_from_format('H:i:s', sanitize_text_field($source['starttime']));
     644                $oldendtime = date_create_from_format('H:i:s', sanitize_text_field($source['endtime']));
    646645                $timediff = $oldstarttime->diff($oldendtime);
    647646                $newstarttime = date_create_from_format('!H:i:s', sanitize_text_field($target['starttime']));
     
    668667                    // Unique booking can be updated directly
    669668                    $blockdata = array(
    670                             'court' => (isset($target['court']))? intval($target['court']) : 0,
     669                            'court' => ((isset($source['court'])) && (intval($source['court'] == 0)))? 0 : ((isset($target['court']))? intval($target['court']) : 0),
    671670                            'childcourt' => (isset($target['childcourt']))? intval($target['childcourt']) : 1,
    672671                            'weekday' => $newstartdate->format('N'),
     
    708707                            'description' => (isset($source['description']))? sanitize_text_field($source['description']) : '',
    709708                            'weekday' => $newstartdate->format('N'),
    710                             'court' => (isset($target['court']))? intval($target['court']) : 0,
     709                            'court' => ((isset($source['court'])) && (intval($source['court'] == 0)))? 0 : ((isset($target['court']))? intval($target['court']) : 0),
    711710                            'childcourt' => (isset($target['childcourt']))? intval($target['childcourt']) : 1,
    712711                            'startdate' => $newstartdate->format('Y-m-d'),
     
    733732            }
    734733        }
     734    }
     735
     736    /**
     737     * Delete action from frontend
     738     *
     739     * @since    1.4.1
     740     */
     741    public function delete_block()
     742    {
     743        $this->blocks->delete_block();
    735744    }
    736745
  • occupancy-plan/trunk/admin/controller/class-occupancy-plan-blocks.php

    r3068435 r3068888  
    9999    public function action_block()
    100100    {
     101        error_log(print_r($_POST, true));
    101102        if (isset($_POST['occupancy-plan-save']))
    102103        {
     
    290291     * 1.3.11 - Save of intervalinfo for monthly interval
    291292     * 1.3.17 - Save of court and child court id
    292      */
    293     private function internal_save_block()
    294     {
    295         // error_log(print_r('internal_save_block()', true));
    296         // error_log(print_r($_POST, true));
    297 
     293     * 1.4.1 - Changed vom private to public
     294     */
     295    public function internal_save_block()
     296    {
    298297        $interval = isset($_POST['interval'])? intval($_POST['interval']) : 1;
    299298        if ($interval == 1)
  • occupancy-plan/trunk/includes/class-occupancy-plan-main.php

    r3068435 r3068888  
    178178        add_action('admin_post_nopriv_add_block', array($plugin_admin, 'add_block'));
    179179        add_action('admin_post_move_block', array($plugin_admin, 'move_block'));
     180        add_action('admin_post_delete_block', array($plugin_admin, 'delete_block'));
    180181
    181182        add_action('admin_menu', array($plugin_admin, 'add_admin_page'));
  • occupancy-plan/trunk/occupancy-plan.php

    r3068435 r3068888  
    1616 * Plugin URI:        https://www.software-kunze.de/plugins/occupancy-plan/
    1717 * Description:       Management of Occupancy Plans
    18  * Version:           1.4
     18 * Version:           1.4.1
    1919 * Author:            Alexander Kunze Software Consulting
    2020 * Author URI:        https://www.software-kunze.de
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define('Occupancy_Plan', '1.4');
     38define('Occupancy_Plan', '1.4.1');
    3939
    4040/**
  • occupancy-plan/trunk/readme.txt

    r3068435 r3068888  
    55Requires at least: 4.9
    66Tested up to: 6.5.2
    7 Stable tag: 1.4
     7Stable tag: 1.4.1
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
     
    5050== Changelog ==
    5151
     52= 1.4.1 =
     53* Bugfix: Frontend add and delete booking
     54* Bugfix: Drag&Drop move of the booking
     55
    5256= 1.4 =
    5357* If frontend is not anoymized then show detailed tooltip
Note: See TracChangeset for help on using the changeset viewer.