Plugin Directory

Changeset 3190680


Ignore:
Timestamp:
11/17/2024 02:57:00 PM (17 months ago)
Author:
tharkun69
Message:

1.4.6

  • Fallback for not support inpute type=week (Firefox & Safari)
  • Fix: Check if PHP session is active before destroy
  • Test with WordPress version 6.7
Location:
occupancy-plan/trunk
Files:
5 edited

Legend:

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

    r3103960 r3190680  
    14461446     * @since     1.4
    14471447     *
     1448     * 1.4.6 - Fix: Check if PHP session is active
    14481449     */
    14491450    public function end_session()
    1450      {
    1451         session_destroy();
     1451    {
     1452        if (session_status() === PHP_SESSION_ACTIVE)
     1453        {
     1454            session_destroy();
     1455        }
    14521456    }
    14531457}
  • occupancy-plan/trunk/occupancy-plan.php

    r3143722 r3190680  
    1616 * Plugin URI:        https://www.software-kunze.de/plugins/occupancy-plan/
    1717 * Description:       Management of Occupancy Plans
    18  * Version:           1.4.5
     18 * Version:           1.4.6
    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.5');
     38define('Occupancy_Plan', '1.4.6');
    3939
    4040/**
  • occupancy-plan/trunk/public/js/occupancy-plan-public.js

    r3103274 r3190680  
    496496            }
    497497        });
     498
     499        if ($(".weekselect").prop("type") == "text")
     500        {
     501           $(".weekselectnative").hide();
     502           $(".weekselectfallback").show();
     503        }
    498504    });
    499505
  • occupancy-plan/trunk/public/partials/occupancy-plan-public-display.php

    r3143722 r3190680  
    718718                                break;
    719719                            case 'weekly':
    720                                 echo '<input class="weekselect" id="week" type="week" name="week" value="' . esc_attr($context->week) . '" />';
     720                                echo '<input class="weekselect weekselectnative" id="week" type="week" name="week" value="' . esc_attr($context->week) . '" />';
     721                                echo '<select class="weekselect weekselectfallback" id="fallbackWeek" name="week" style="display:none">';
     722                                $weekdate = new DateTime();
     723                                $weekdate->setISODate(substr($context->week,0,4), substr($context->week,6,2));
     724                                $weekdate->sub(new DateInterval('P7W'));
     725                                for ($w = 0; ($w < 21); $w++)
     726                                {
     727                                    echo '<option value="' . $weekdate->format("Y") . "-W". $weekdate->format("W") . '"' . (($w == 7)? " selected":"") . '>';
     728                                    if ($weekdate->format("W") == "01")
     729                                    {
     730                                        $weekdate->add(new DateInterval('P7D'));
     731                                        echo __("Week",'occupancy-plan') . ' 01. ' . $weekdate->format("Y") . '</option>';
     732                                    }
     733                                    else
     734                                    {
     735                                        echo __("Week",'occupancy-plan') . ' ' .  $weekdate->format("W") . '. ' . $weekdate->format("Y") . '</option>';
     736                                        $weekdate->add(new DateInterval('P7D'));
     737                                    }
     738                                }
     739                                echo '</select>';
    721740                                break;
    722741                            case 'daily':
     
    784803            <tr>
    785804                <td>
    786                         <?php switch ($context->mode) {
    787                             case 'yearly':
    788                                 echo esc_attr($context->year);
    789                                 break;
    790                             case 'monthly':
    791                                 echo esc_attr($context->month);
    792                                 break;
    793                             case 'weekly':
    794                                 echo esc_attr($context->week);
    795                                 break;
    796                             case 'daily':
    797                                 echo mysql2date('Y-m-d', $context->singledate );
    798                                 break;
    799                         }?>
     805                    <?php switch ($context->mode) {
     806                        case 'yearly':
     807                            echo esc_attr($context->year);
     808                            break;
     809                        case 'monthly':
     810                            echo esc_attr($context->month);
     811                            break;
     812                        case 'weekly':
     813                            echo esc_attr($context->week);
     814                            break;
     815                        case 'daily':
     816                            echo mysql2date('Y-m-d', $context->singledate );
     817                            break;
     818                    }?>
    800819                </td>
    801820                <td></td>
  • occupancy-plan/trunk/readme.txt

    r3143722 r3190680  
    44Tags: Occupancy Plan, Belegungsplan, Booking, Buchungen, Hallenbelegung, Reservierung
    55Requires at least: 4.9
    6 Tested up to: 6.6.1
     6Tested up to: 6.7
    77Stable tag: 1.4.5
    88Requires PHP: 5.2.4
     
    5050== Changelog ==
    5151
     52= 1.4.6 =
     53* Fallback for not support inpute type=week (Firefox & Safari)
     54* Fix: Check if PHP session is active before destroy
     55* Test with WordPress version 6.7
     56
    5257= 1.4.5 =
    53 - Add shortcut attribute to show short weekdays
     58* Add shortcut attribute to show short weekdays
    5459
    5560= 1.4.4 =
Note: See TracChangeset for help on using the changeset viewer.