WordPress.org

Plugin Directory

Changeset 1785072


Ignore:
Timestamp:
12/12/17 00:44:17 (2 months ago)
Author:
DBAR Productions
Message:

Version 2.3.0

Location:
pta-volunteer-sign-up-sheets/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pta-volunteer-sign-up-sheets/trunk/classes/widget.php

    r1288166 r1785072  
    4646            $hidden = '<br/><span style="color:red;"><strong>(--'.__('Hidden!', 'pta_volunteer_sus').'--)</strong></span>'; 
    4747        } 
     48         
     49        $sort_by = isset($instance['sort_by']) && in_array($instance['sort_by'], array('first_date', 'last_date', 'title', 'id')) ? $instance['sort_by'] : 'first_date'; 
     50        $order = isset($instance['order']) && in_array($instance['order'], array('ASC', 'DESC')) ? $instance['order'] : 'ASC'; 
    4851 
    4952        // Check if there are sheets first, if not, we won't show anything 
    50         $sheets = $this->data->get_sheets(false, true, $show_hidden); 
    51         $sheets = array_reverse($sheets); 
     53        $sheets = $this->data->get_sheets(false, true, $show_hidden, $sort_by, $order); 
     54         
    5255        if (empty($sheets)) { 
    5356            return; 
     
    134137    public function form( $instance ) { 
    135138        /* Set up default widget settings. */ 
    136         $defaults = array( 'title' => __('Current Volunteer Opportunities', 'pta_volunteer_sus'), 'num_items' => 10, 'permalink' => 'volunteer-sign-ups', 'show_what' => 'both', 'list_class' => ''); 
     139        $defaults = array( 'title' => __('Current Volunteer Opportunities', 'pta_volunteer_sus'), 'num_items' => 10, 'permalink' => 'volunteer-sign-ups', 'show_what' => 'both', 'sort_by' => 'first_date', 'order' => 'ASC', 'list_class' => ''); 
    137140        $instance = wp_parse_args( (array) $instance, $defaults ); 
    138141        ?> 
     
    153156            </select> 
    154157        </p> 
     158        <p> 
     159            <label for="<?php echo $this->get_field_name( 'sort_by' ); ?>"><?php _e( 'Sort By:', 'pta_volunteer_sus' ); ?></label> 
     160            <select class="widefat" id="<?php echo $this->get_field_id( 'sort_by' ); ?>" name="<?php echo $this->get_field_name( 'sort_by' ); ?>"> 
     161                <option value="first_date" <?php selected($instance['sort_by'], 'first_date' ); ?>><?php _e( 'First Date', 'pta_volunteer_sus' ); ?></option> 
     162                <option value="last_date" <?php selected($instance['sort_by'], 'last_date' ); ?>><?php _e( 'Last Date', 'pta_volunteer_sus' ); ?></option> 
     163                <option value="title" <?php selected($instance['sort_by'], 'title' ); ?>><?php _e( 'Title', 'pta_volunteer_sus' ); ?></option> 
     164                <option value="id" <?php selected($instance['sort_by'], 'id' ); ?>><?php _e( 'Sheet ID', 'pta_volunteer_sus' ); ?></option> 
     165            </select> 
     166        </p> 
     167        <p> 
     168            <label for="<?php echo $this->get_field_name( 'order' ); ?>"><?php _e( 'Sort Order:', 'pta_volunteer_sus' ); ?></label> 
     169            <select class="widefat" id="<?php echo $this->get_field_id( 'order' ); ?>" name="<?php echo $this->get_field_name( 'order' ); ?>"> 
     170                <option value="ASC" <?php selected($instance['order'], 'ASC' ); ?>><?php _e( 'Ascending', 'pta_volunteer_sus' ); ?></option> 
     171                <option value="DESC" <?php selected($instance['order'], 'DESC' ); ?>><?php _e( 'Descending', 'pta_volunteer_sus' ); ?></option> 
     172            </select> 
     173        </p> 
    155174        <p> 
    156175        <label for="<?php echo $this->get_field_name( 'list_class' ); ?>"><?php _e( 'CSS Class for ul list of signups', 'pta_volunteer_sus' ); ?></label>  
     
    176195        $instance['list_class'] = ( !empty( $new_instance['list_class'] ) ) ? strip_tags( $new_instance['list_class'] ) : ''; 
    177196        $instance['show_what'] = ( !empty( $new_instance['show_what'] ) ) ? sanitize_key( $new_instance['show_what'] ) : 'both'; 
     197        $instance['sort_by'] = ( !empty( $new_instance['sort_by'] ) && in_array($new_instance['sort_by'], array('first_date', 'last_date', 'title', 'id')) ) ?$new_instance['sort_by'] : 'first_date'; 
     198        $instance['order'] = ( !empty( $new_instance['order'] ) && in_array($new_instance['order'], array('ASC', 'DESC')) ) ? $new_instance['order'] : 'ASC'; 
    178199        return $instance; 
    179200    } 
  • pta-volunteer-sign-up-sheets/trunk/languages/pta_volunteer_sus.pot

    r1749580 r1785072  
    44"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 
    55"Project-Id-Version: PTA Volunteer Sign Up Sheets\n" 
    6 "POT-Creation-Date: 2017-10-12 21:29-0700\n" 
     6"POT-Creation-Date: 2017-12-07 12:37-0800\n" 
    77"PO-Revision-Date: 2016-02-09 19:42-0800\n" 
    88"Last-Translator: Stephen Sherrard <stephen@dbar-productions.com>\n" 
     
    576576msgstr "" 
    577577 
    578 #: classes/class-pta_sus_admin.php:837 classes/widget.php:140 
     578#: classes/class-pta_sus_admin.php:837 classes/widget.php:143 
    579579msgid "Title:" 
    580580msgstr "" 
     
    14991499 
    15001500#: classes/class-pta_sus_public.php:134 classes/list-table.php:184 
     1501#: classes/widget.php:163 
    15011502msgid "Title" 
    15021503msgstr "" 
     
    15101511msgstr "" 
    15111512 
    1512 #: classes/class-pta_sus_public.php:137 classes/widget.php:117 
     1513#: classes/class-pta_sus_public.php:137 classes/widget.php:120 
    15131514msgid "Open Spots" 
    15141515msgstr "" 
     
    17641765msgstr "" 
    17651766 
    1766 #: classes/data.php:751 
     1767#: classes/data.php:784 
    17671768msgctxt "contact name separating character" 
    17681769msgid ", " 
    17691770msgstr "" 
    17701771 
    1771 #: classes/data.php:753 
     1772#: classes/data.php:786 
    17721773msgctxt "separator before last contact name" 
    17731774msgid " and " 
    17741775msgstr "" 
    17751776 
    1776 #: classes/data.php:1065 
     1777#: classes/data.php:1098 
    17771778#, php-format 
    17781779msgid "%s is a required field." 
    17791780msgstr "" 
    17801781 
    1781 #: classes/data.php:1076 
     1782#: classes/data.php:1109 
    17821783#, php-format 
    17831784msgid "Invalid characters in %s field." 
    17841785msgstr "" 
    17851786 
    1786 #: classes/data.php:1096 
     1787#: classes/data.php:1129 
    17871788msgid "Invalid email." 
    17881789msgstr "" 
    17891790 
    1790 #: classes/data.php:1104 classes/data.php:1118 
     1791#: classes/data.php:1137 classes/data.php:1151 
    17911792msgid "Invalid date." 
    17921793msgstr "" 
    17931794 
    1794 #: classes/data.php:1127 
     1795#: classes/data.php:1160 
    17951796#, php-format 
    17961797msgid "Numbers only for %s please!" 
    17971798msgstr "" 
    17981799 
    1799 #: classes/data.php:1134 
     1800#: classes/data.php:1167 
    18001801#, php-format 
    18011802msgid "YES or NO only for %s please!" 
    18021803msgstr "" 
    18031804 
    1804 #: classes/data.php:1141 
     1805#: classes/data.php:1174 
    18051806#, php-format 
    18061807msgid "Invalid Value for %s" 
    18071808msgstr "" 
    18081809 
    1809 #: classes/data.php:1149 
     1810#: classes/data.php:1182 
    18101811#, php-format 
    18111812msgid "Invalid time format for %s" 
     
    18521853msgstr "" 
    18531854 
    1854 #: classes/list-table.php:187 
     1855#: classes/list-table.php:187 classes/widget.php:161 
    18551856msgid "First Date" 
    18561857msgstr "" 
    18571858 
    1858 #: classes/list-table.php:188 
     1859#: classes/list-table.php:188 classes/widget.php:162 
    18591860msgid "Last Date" 
    18601861msgstr "" 
     
    19281929msgstr "" 
    19291930 
    1930 #: classes/widget.php:136 
     1931#: classes/widget.php:139 
    19311932msgid "Current Volunteer Opportunities" 
    19321933msgstr "" 
    19331934 
    1934 #: classes/widget.php:144 
     1935#: classes/widget.php:147 
    19351936msgid "# of items to show (-1 for all):" 
    19361937msgstr "" 
    19371938 
    1938 #: classes/widget.php:148 
     1939#: classes/widget.php:151 
    19391940msgid "What to show?" 
    19401941msgstr "" 
    19411942 
    1942 #: classes/widget.php:150 
     1943#: classes/widget.php:153 
    19431944msgid "Both" 
    19441945msgstr "" 
    19451946 
    1946 #: classes/widget.php:151 
     1947#: classes/widget.php:154 
    19471948msgid "Volunteer Events (with sign-ups)" 
    19481949msgstr "" 
    19491950 
    1950 #: classes/widget.php:152 
     1951#: classes/widget.php:155 
    19511952msgid "No Sign-Up Events (display events only)" 
    19521953msgstr "" 
    19531954 
    1954 #: classes/widget.php:156 
     1955#: classes/widget.php:159 
     1956msgid "Sort By:" 
     1957msgstr "" 
     1958 
     1959#: classes/widget.php:164 
     1960msgid "Sheet ID" 
     1961msgstr "" 
     1962 
     1963#: classes/widget.php:168 
     1964msgid "Sort Order:" 
     1965msgstr "" 
     1966 
     1967#: classes/widget.php:170 
     1968msgid "Ascending" 
     1969msgstr "" 
     1970 
     1971#: classes/widget.php:171 
     1972msgid "Descending" 
     1973msgstr "" 
     1974 
     1975#: classes/widget.php:175 
    19551976msgid "CSS Class for ul list of signups" 
    19561977msgstr "" 
  • pta-volunteer-sign-up-sheets/trunk/pta-volunteer-sign-up-sheets.php

    r1758150 r1785072  
    44Plugin URI: http://wordpress.org/plugins/pta-volunteer-sign-up-sheets 
    55Description: Volunteer sign-up sheet manager 
    6 Version: 2.2.3 
     6Version: 2.3.0 
    77Author: Stephen Sherrard 
    88Author URI: https://stephensherrardplugins.com 
     
    1919 
    2020if (!defined('PTA_VOLUNTEER_SUS_VERSION_NUM')) 
    21     define('PTA_VOLUNTEER_SUS_VERSION_NUM', '2.2.3'); 
     21    define('PTA_VOLUNTEER_SUS_VERSION_NUM', '2.3.0'); 
    2222 
    2323add_option(PTA_VOLUNTEER_SUS_VERSION_KEY, PTA_VOLUNTEER_SUS_VERSION_NUM); 
  • pta-volunteer-sign-up-sheets/trunk/readme.txt

    r1758150 r1785072  
    44Tags: Volunteer,Sign Up, Events 
    55Requires at least: 3.3 
    6 Tested up to: 4.8.3 
     6Tested up to: 4.9.1 
    77Stable tag: trunk 
    88 
     
    114114 
    115115== Changelog == 
     116**Version 2.3.0** 
     117*   Added sort by and order options to the widget. 
     118 
    116119**Version 2.2.3** 
    117120*   Updated database prepare queries to eliminate new WordPress notices in WP 4.8.3 when passing in a date value that may not be used in the SQL query. 
Note: See TracChangeset for help on using the changeset viewer.