Version Description
Download this release
Release Info
Developer | borkweb |
Plugin | Event Tickets |
Version | 4.0.1 |
Comparing to | |
See all releases |
Code changes from version 4.0 to 4.0.1
- common/src/Tribe/Admin/Notice/Plugin_Upgrade_Notice.php +239 -0
- common/src/Tribe/Date_Utils.php +62 -0
- common/src/Tribe/Main.php +1 -1
- common/src/resources/css/tribe-common-admin.css +26 -3
- common/src/resources/images/tribe-loading@2x.gif +0 -0
- common/tribe-autoload.php +7 -0
- event-tickets.php +1 -1
- readme.txt +8 -3
- src/Tribe/Main.php +1 -1
- src/Tribe/RSVP.php +1 -1
- src/admin-views/attendees.php +18 -56
common/src/Tribe/Admin/Notice/Plugin_Upgrade_Notice.php
ADDED
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* When appropriate, displays a plugin upgrade message "inline" within the plugin
|
4 |
+
* admin screen.
|
5 |
+
*
|
6 |
+
* This is drawn from the Upgrade Notice section of the plugin readme.txt file (ie,
|
7 |
+
* the one belonging to the current stable accessible via WP SVN - at least by
|
8 |
+
* default).
|
9 |
+
*/
|
10 |
+
class Tribe__Admin__Notice__Plugin_Upgrade_Notice {
|
11 |
+
/**
|
12 |
+
* Currently installed version of the plugin
|
13 |
+
*
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
protected $current_version = '';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* The plugin path as it is within the plugins directory, ie
|
20 |
+
* "some-plugin/main-file.php".
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
protected $plugin_path = '';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Contains the plugin upgrade notice (empty if none are available).
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
protected $upgrade_notice = '';
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Test for and display any plugin upgrade messages (if any are available) inline
|
36 |
+
* beside the plugin listing itself.
|
37 |
+
*
|
38 |
+
* The optional third param is the object which actually checks to see if there
|
39 |
+
* are any upgrade notices worth displaying. If not provided, an object of the
|
40 |
+
* default type will be created (which connects to WP SVN).
|
41 |
+
*
|
42 |
+
* @param string $current_version
|
43 |
+
* @param string $plugin_path (ie "plugin-dir/main-file.php")
|
44 |
+
*/
|
45 |
+
public function __construct( $current_version, $plugin_path ) {
|
46 |
+
$this->current_version = $current_version;
|
47 |
+
$this->plugin_path = $plugin_path;
|
48 |
+
|
49 |
+
add_action( "in_plugin_update_message-$plugin_path", array( $this, 'maybe_run' ) );
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Test if there is a plugin upgrade notice and displays it if so.
|
54 |
+
*
|
55 |
+
* Expects to fire during "in_plugin_update_message-{plugin_path}", therefore
|
56 |
+
* this should only run if WordPress has detected that an upgrade is indeed
|
57 |
+
* available.
|
58 |
+
*/
|
59 |
+
public function maybe_run() {
|
60 |
+
$this->test_for_upgrade_notice();
|
61 |
+
|
62 |
+
if ( $this->upgrade_notice ) {
|
63 |
+
$this->display_message();
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Tests to see if an upgrade notice is available.
|
69 |
+
*/
|
70 |
+
protected function test_for_upgrade_notice() {
|
71 |
+
$cache_key = $this->cache_key();
|
72 |
+
$this->upgrade_notice = get_transient( $cache_key );
|
73 |
+
|
74 |
+
if ( false === $this->upgrade_notice ) {
|
75 |
+
$this->discover_upgrade_notice();
|
76 |
+
}
|
77 |
+
|
78 |
+
set_transient( $cache_key, $this->upgrade_notice, $this->cache_expiration() );
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Returns a cache key unique to the current plugin path and version, that
|
83 |
+
* still fits within the 45-char limit of regular WP transient keys.
|
84 |
+
*
|
85 |
+
* @return string
|
86 |
+
*/
|
87 |
+
protected function cache_key() {
|
88 |
+
return 'tribe_plugin_upgrade_notice-' . hash( 'crc32b', $this->plugin_path . $this->current_version );
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Returns the period of time (in seconds) for which to cache plugin upgrade messages.
|
93 |
+
*
|
94 |
+
* @return int
|
95 |
+
*/
|
96 |
+
protected function cache_expiration() {
|
97 |
+
/**
|
98 |
+
* Number of seconds to cache plugin upgrade messages for.
|
99 |
+
*
|
100 |
+
* Defaults to one day, which provides a decent balance between efficiency savings
|
101 |
+
* and allowing for the possibility that some upgrade messages may be changed or
|
102 |
+
* rescinded.
|
103 |
+
*
|
104 |
+
* @var int $cache_expiration
|
105 |
+
*/
|
106 |
+
return (int) apply_filters( 'tribe_plugin_upgrade_notice_expiration', DAY_IN_SECONDS, $this->plugin_path );
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Looks at the current stable plugin readme.txt and parses to try and find the first
|
111 |
+
* available upgrade notice relating to a plugin version higher than this one.
|
112 |
+
*
|
113 |
+
* By default, WP SVN is the source.
|
114 |
+
*/
|
115 |
+
protected function discover_upgrade_notice() {
|
116 |
+
/**
|
117 |
+
* The URL for the current plugin readme.txt file.
|
118 |
+
*
|
119 |
+
* @var string $url
|
120 |
+
* @var string $plugin_path
|
121 |
+
*/
|
122 |
+
$readme_url = apply_filters( 'tribe_plugin_upgrade_readme_url',
|
123 |
+
$this->form_wp_svn_readme_url(),
|
124 |
+
$this->plugin_path
|
125 |
+
);
|
126 |
+
|
127 |
+
if ( ! empty( $readme_url ) ) {
|
128 |
+
$response = wp_safe_remote_get( $readme_url );
|
129 |
+
}
|
130 |
+
|
131 |
+
if ( ! empty( $response ) && ! is_wp_error( $response ) ) {
|
132 |
+
$readme = $response['body'];
|
133 |
+
}
|
134 |
+
|
135 |
+
if ( ! empty( $readme ) ) {
|
136 |
+
$this->parse_for_upgrade_notice( $readme );
|
137 |
+
$this->format_upgrade_notice();
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* The upgrade notice for the current plugin (may be empty).
|
142 |
+
*
|
143 |
+
* @var string $upgrade_notice
|
144 |
+
* @var string $plugin_path
|
145 |
+
*/
|
146 |
+
return apply_filters( 'tribe_plugin_upgrade_notice',
|
147 |
+
$this->upgrade_notice,
|
148 |
+
$this->plugin_path
|
149 |
+
);
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Forms the expected URL to the trunk readme.txt file as it is on WP SVN
|
154 |
+
* or an empty string if for any reason it cannot be determined.
|
155 |
+
*
|
156 |
+
* @return string
|
157 |
+
*/
|
158 |
+
protected function form_wp_svn_readme_url() {
|
159 |
+
$parts = explode( '/', $this->plugin_path );
|
160 |
+
$slug = empty( $parts[0] ) ? '' : $parts[0];
|
161 |
+
return esc_url( "https://plugins.svn.wordpress.org/$slug/trunk/readme.txt" );
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Given a standard Markdown-format WP readme.txt file, finds the first upgrade
|
166 |
+
* notice (if any) for a version higher than $this->current_version.
|
167 |
+
*
|
168 |
+
* @param string $readme
|
169 |
+
* @return string
|
170 |
+
*/
|
171 |
+
protected function parse_for_upgrade_notice( $readme ) {
|
172 |
+
$in_upgrade_notice = false;
|
173 |
+
$in_version_notice = false;
|
174 |
+
$readme_text = fopen( "data:://text/plain,$readme", 'r' );
|
175 |
+
|
176 |
+
while ( $line = fgets( $readme_text ) ) {
|
177 |
+
// Once we leave the Upgrade Notice section (ie, we encounter a new section header), bail
|
178 |
+
if ( $in_upgrade_notice && 0 === strpos( $line, '==' ) ) {
|
179 |
+
break;
|
180 |
+
}
|
181 |
+
|
182 |
+
// Look out for the start of the Upgrade Notice section
|
183 |
+
if ( ! $in_upgrade_notice && preg_match( '/^==\s*Upgrade\s+Notice\s*==/i', $line ) ) {
|
184 |
+
$in_upgrade_notice = true;
|
185 |
+
}
|
186 |
+
|
187 |
+
// Also test to see if we have left the version specific note (ie, we encounter a new sub heading or header)
|
188 |
+
if ( $in_upgrade_notice && $in_version_notice && 0 === strpos( $line, '=' ) ) {
|
189 |
+
break;
|
190 |
+
}
|
191 |
+
|
192 |
+
// Look out for the first applicable version-specific note within the Upgrade Notice section
|
193 |
+
if ( $in_upgrade_notice && ! $in_version_notice && preg_match( '/^=\s*([0-9\.]{3,})\s*=/', $line, $matches ) ) {
|
194 |
+
// Is this a higher version than currently installed?
|
195 |
+
if ( version_compare( $matches[1], $this->current_version, '>' ) ) {
|
196 |
+
$in_version_notice = true;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
// Copy the details of the upgrade notice for the first higher version we find
|
201 |
+
if ( $in_upgrade_notice && $in_version_notice ) {
|
202 |
+
$this->upgrade_notice .= $line;
|
203 |
+
}
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Convert the plugin version header and any links from Markdown to HTML.
|
209 |
+
*/
|
210 |
+
protected function format_upgrade_notice() {
|
211 |
+
// Convert [links](http://...) to <a href="..."> tags
|
212 |
+
$this->upgrade_notice = preg_replace(
|
213 |
+
'/\[([^\]]*)\]\(([^\)]*)\)/',
|
214 |
+
'<a href="${2}">${1}</a>',
|
215 |
+
$this->upgrade_notice
|
216 |
+
);
|
217 |
+
|
218 |
+
// Convert =4.0= headings to <h4 class="version">4.0</h4> tags
|
219 |
+
$this->upgrade_notice = preg_replace(
|
220 |
+
'/=\s*([a-zA-Z0-9\.]{3,})\s*=/',
|
221 |
+
'<h4 class="version">${1}</h4>',
|
222 |
+
$this->upgrade_notice
|
223 |
+
);
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Render the actual upgrade notice.
|
228 |
+
*
|
229 |
+
* Please note if plugin-specific styling is required for the message, you can
|
230 |
+
* use an ID generated by WordPress for one of the message's parent elements
|
231 |
+
* which takes the form "{plugin_name}-update". Example:
|
232 |
+
*
|
233 |
+
* #the-events-calendar-update .tribe-plugin-update-message { ... }
|
234 |
+
*/
|
235 |
+
public function display_message() {
|
236 |
+
$notice = wp_kses_post( $this->upgrade_notice );
|
237 |
+
echo "<div class='tribe-plugin-update-message'> $notice </div>";
|
238 |
+
}
|
239 |
+
}
|
common/src/Tribe/Date_Utils.php
CHANGED
@@ -721,6 +721,68 @@ if ( ! class_exists( 'Tribe__Date_Utils' ) ) {
|
|
721 |
_deprecated_function( __METHOD__, '3.11', __CLASS__ . '::is_timestamp' );
|
722 |
return self::is_timestamp( $timestamp );
|
723 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
724 |
// @codingStandardsIgnoreEnd
|
725 |
}
|
|
|
726 |
}
|
721 |
_deprecated_function( __METHOD__, '3.11', __CLASS__ . '::is_timestamp' );
|
722 |
return self::is_timestamp( $timestamp );
|
723 |
}
|
724 |
+
|
725 |
+
/**
|
726 |
+
* Gets the timestamp of a day in week, month and year context.
|
727 |
+
*
|
728 |
+
* Kudos to [icedwater StackOverflow user](http://stackoverflow.com/users/1091386/icedwater) in
|
729 |
+
* [his answer](http://stackoverflow.com/questions/924246/get-the-first-or-last-friday-in-a-month).
|
730 |
+
*
|
731 |
+
* Usage examples:
|
732 |
+
* "The second Wednesday of March 2015" - `get_day_timestamp( 3, 2, 3, 2015, 1)`
|
733 |
+
* "The last Friday of December 2015" - `get_day_timestamp( 5, 1, 12, 2015, -1)`
|
734 |
+
* "The first Monday of April 2016 - `get_day_timestamp( 1, 1, 4, 2016, 1)`
|
735 |
+
* "The penultimate Thursday of January 2012" - `get_day_timestamp( 4, 2, 1, 2012, -1)`
|
736 |
+
*
|
737 |
+
* @param int $day_of_week The day representing the number in the week, Monday is `1`, Tuesday is `2`, Sunday is `7`
|
738 |
+
* @param int $week_in_month The week number in the month; first week is `1`, second week is `2`; when direction is reverse
|
739 |
+
* then `1` is last week of the month, `2` is penultimate week of the month and so on.
|
740 |
+
* @param int $month The month number in the year, January is `1`
|
741 |
+
* @param int $year The year number, e.g. "2015"
|
742 |
+
* @param int $week_direction Either `1` or `-1`; the direction for the search referring to the week, defaults to `1`
|
743 |
+
* to specify weeks in natural order so:
|
744 |
+
* $week_direction `1` and $week_in_month `1` means "first week of the month"
|
745 |
+
* $week_direction `1` and $week_in_month `3` means "third week of the month"
|
746 |
+
* $week_direction `-1` and $week_in_month `1` means "last week of the month"
|
747 |
+
* $week_direction `-1` and $week_in_month `2` means "penultimmate week of the month"
|
748 |
+
*
|
749 |
+
* @return int The day timestamp
|
750 |
+
*/
|
751 |
+
public static function get_weekday_timestamp( $day_of_week, $week_in_month, $month, $year, $week_direction = 1 ) {
|
752 |
+
if (
|
753 |
+
! (
|
754 |
+
is_numeric( $day_of_week )
|
755 |
+
&& is_numeric( $week_in_month )
|
756 |
+
&& is_numeric( $month )
|
757 |
+
&& is_numeric( $year )
|
758 |
+
&& is_numeric( $week_direction )
|
759 |
+
&& in_array( $week_direction, array( - 1, 1 ) )
|
760 |
+
)
|
761 |
+
) {
|
762 |
+
return false;
|
763 |
+
}
|
764 |
+
|
765 |
+
if ( $week_direction > 0 ) {
|
766 |
+
$startday = 1;
|
767 |
+
} else {
|
768 |
+
$startday = date( 't', mktime( 0, 0, 0, $month, 1, $year ) );
|
769 |
+
}
|
770 |
+
|
771 |
+
$start = mktime( 0, 0, 0, $month, $startday, $year );
|
772 |
+
$weekday = date( 'N', $start );
|
773 |
+
|
774 |
+
if ( $week_direction * $day_of_week >= $week_direction * $weekday ) {
|
775 |
+
$offset = - $week_direction * 7;
|
776 |
+
} else {
|
777 |
+
$offset = 0;
|
778 |
+
}
|
779 |
+
|
780 |
+
$offset += $week_direction * ( $week_in_month * 7 ) + ( $day_of_week - $weekday );
|
781 |
+
|
782 |
+
return mktime( 0, 0, 0, $month, $startday + $offset, $year );
|
783 |
+
}
|
784 |
+
|
785 |
// @codingStandardsIgnoreEnd
|
786 |
}
|
787 |
+
|
788 |
}
|
common/src/Tribe/Main.php
CHANGED
@@ -17,7 +17,7 @@ class Tribe__Main {
|
|
17 |
const OPTIONNAME = 'tribe_events_calendar_options';
|
18 |
const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options';
|
19 |
|
20 |
-
const VERSION = '
|
21 |
const FEED_URL = 'https://theeventscalendar.com/feed/';
|
22 |
|
23 |
protected $plugin_context;
|
17 |
const OPTIONNAME = 'tribe_events_calendar_options';
|
18 |
const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options';
|
19 |
|
20 |
+
const VERSION = '4.0.1';
|
21 |
const FEED_URL = 'https://theeventscalendar.com/feed/';
|
22 |
|
23 |
protected $plugin_context;
|
common/src/resources/css/tribe-common-admin.css
CHANGED
@@ -20,6 +20,32 @@ td.tribe_message {padding-bottom: 10px !important;}
|
|
20 |
#tribe-upgrade {margin:20px 0 30px; border:1px solid #ccc; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; padding:0 20px 20px; background:#f6f6f6;}
|
21 |
#tribe-upgrade .message {border-style:solid; border-width:1px; padding:6px 12px; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; background-color:#FFFFE0; border-color:#E6DB55;}
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
/* = Settings Screen
|
24 |
=============================================*/
|
25 |
.tribe-settings-form { max-width: 1000px; }
|
@@ -346,9 +372,6 @@ only screen and (min--moz-device-pixel-ratio: 2),
|
|
346 |
only screen and (-o-min-device-pixel-ratio: 2/1),
|
347 |
only screen and (-webkit-min-device-pixel-ratio: 2),
|
348 |
only screen and (min-device-pixel-ratio: 2) {
|
349 |
-
.events-cal #icon-edit {
|
350 |
-
background-image: url(../images/events-screen-icon@2x.png);
|
351 |
-
}
|
352 |
#tribe-loading span {
|
353 |
background-image: url(../images/tribe-loading@2x.gif);
|
354 |
}
|
20 |
#tribe-upgrade {margin:20px 0 30px; border:1px solid #ccc; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; padding:0 20px 20px; background:#f6f6f6;}
|
21 |
#tribe-upgrade .message {border-style:solid; border-width:1px; padding:6px 12px; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; background-color:#FFFFE0; border-color:#E6DB55;}
|
22 |
|
23 |
+
/* = Plugin Screen
|
24 |
+
=============================================*/
|
25 |
+
table.plugins .tribe-plugin-update-message {
|
26 |
+
background: #d54e21; /* taken from colour scheme in list-tables.css */
|
27 |
+
color: white;
|
28 |
+
display: inline-table;
|
29 |
+
padding: 10px 12px;
|
30 |
+
margin: 6px 0px;
|
31 |
+
}
|
32 |
+
|
33 |
+
table.plugins .tribe-plugin-update-message h4 {
|
34 |
+
display: inline;
|
35 |
+
font-weight: bold;
|
36 |
+
margin-right: 8px;
|
37 |
+
}
|
38 |
+
|
39 |
+
table.plugins .tribe-plugin-update-message h4:after {
|
40 |
+
content: ' \00BB ';
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
table.plugins .tribe-plugin-update-message a {
|
45 |
+
color: white;
|
46 |
+
text-decoration: underline;
|
47 |
+
}
|
48 |
+
|
49 |
/* = Settings Screen
|
50 |
=============================================*/
|
51 |
.tribe-settings-form { max-width: 1000px; }
|
372 |
only screen and (-o-min-device-pixel-ratio: 2/1),
|
373 |
only screen and (-webkit-min-device-pixel-ratio: 2),
|
374 |
only screen and (min-device-pixel-ratio: 2) {
|
|
|
|
|
|
|
375 |
#tribe-loading span {
|
376 |
background-image: url(../images/tribe-loading@2x.gif);
|
377 |
}
|
common/src/resources/images/tribe-loading@2x.gif
ADDED
Binary file
|
common/tribe-autoload.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$src = dirname( __FILE__ ) . '/src';
|
3 |
+
require_once $src . '/Tribe/Autoloader.php';
|
4 |
+
|
5 |
+
$autoloader = Tribe__Autoloader::instance();
|
6 |
+
$autoloader->register_prefix('Tribe__',$src);
|
7 |
+
$autoloader->register_autoloader();
|
event-tickets.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Event Tickets
|
4 |
Description: Event Tickets allows you to sell tickets to events
|
5 |
-
Version: 4.0
|
6 |
Author: Modern Tribe, Inc.
|
7 |
Author URI: http://m.tri.be/28
|
8 |
License: GPLv2 or later
|
2 |
/*
|
3 |
Plugin Name: Event Tickets
|
4 |
Description: Event Tickets allows you to sell tickets to events
|
5 |
+
Version: 4.0.1
|
6 |
Author: Modern Tribe, Inc.
|
7 |
Author URI: http://m.tri.be/28
|
8 |
License: GPLv2 or later
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
Contributors: ModernTribe, borkweb, zbtirrell, barry.hughes, bordoni, brianjessee, brook-tribe, faction23, geoffgraham, ggwicz, jazbek, jbrinley, joshlimecuda, leahkoerper, lucatume, mastromktg, neillmcshea, nicosantos, peterchester, reid.peifer, roblagatta, shane.pearlman, thatdudebutch
|
4 |
Tags: events, add-on, ticket sales, tickets, calendar, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, The Events Calendar, Events Calendar PRO, ticket integration, event ticketing, RSVP, Event Tickets, Event Tickets Plus
|
5 |
Requires at least: 3.9
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 4.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -173,12 +173,17 @@ Our Premium Plugins:
|
|
173 |
* <a href="http://m.tri.be/18ul" target="_blank">The Events Calendar PRO</a>
|
174 |
* <a href="http://m.tri.be/18uo" target="_blank">The Events Calendar: Eventbrite Tickets</a>
|
175 |
* <a href="http://m.tri.be/18uu" target="_blank">The Events Calendar: Community Events</a>
|
176 |
-
* <a href="http://m.tri.be/18uy" target="_blank">The Events Calendar: Community Tickets
|
177 |
* <a href="http://m.tri.be/18v0" target="_blank">The Events Calendar: Facebook Events</a>
|
178 |
* <a href="http://m.tri.be/18v2" target="_blank">The Events Calendar: Filter Bar</a>
|
179 |
|
180 |
== Changelog ==
|
181 |
|
|
|
|
|
|
|
|
|
|
|
182 |
= [4.0] 2015-12-02 =
|
183 |
|
184 |
* Initial release
|
3 |
Contributors: ModernTribe, borkweb, zbtirrell, barry.hughes, bordoni, brianjessee, brook-tribe, faction23, geoffgraham, ggwicz, jazbek, jbrinley, joshlimecuda, leahkoerper, lucatume, mastromktg, neillmcshea, nicosantos, peterchester, reid.peifer, roblagatta, shane.pearlman, thatdudebutch
|
4 |
Tags: events, add-on, ticket sales, tickets, calendar, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, The Events Calendar, Events Calendar PRO, ticket integration, event ticketing, RSVP, Event Tickets, Event Tickets Plus
|
5 |
Requires at least: 3.9
|
6 |
+
Tested up to: 4.4
|
7 |
+
Stable tag: 4.0.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
173 |
* <a href="http://m.tri.be/18ul" target="_blank">The Events Calendar PRO</a>
|
174 |
* <a href="http://m.tri.be/18uo" target="_blank">The Events Calendar: Eventbrite Tickets</a>
|
175 |
* <a href="http://m.tri.be/18uu" target="_blank">The Events Calendar: Community Events</a>
|
176 |
+
* <a href="http://m.tri.be/18uy" target="_blank">The Events Calendar: Community Tickets</a>
|
177 |
* <a href="http://m.tri.be/18v0" target="_blank">The Events Calendar: Facebook Events</a>
|
178 |
* <a href="http://m.tri.be/18v2" target="_blank">The Events Calendar: Filter Bar</a>
|
179 |
|
180 |
== Changelog ==
|
181 |
|
182 |
+
= [4.0.1] 2015-12-10 =
|
183 |
+
|
184 |
+
* Tweak - Removed The Events Calendar-specific fields from the Attendees Report as defaults. The Events Calendar will now hook into the report and inject event-specific fields
|
185 |
+
* Fix - Fixed issue where a retina-friendly loading gif was 404ing
|
186 |
+
|
187 |
= [4.0] 2015-12-02 =
|
188 |
|
189 |
* Initial release
|
src/Tribe/Main.php
CHANGED
@@ -9,7 +9,7 @@ class Tribe__Tickets__Main {
|
|
9 |
/**
|
10 |
* Current version of this plugin
|
11 |
*/
|
12 |
-
const VERSION = '4.0';
|
13 |
|
14 |
/**
|
15 |
* Min required The Events Calendar version
|
9 |
/**
|
10 |
* Current version of this plugin
|
11 |
*/
|
12 |
+
const VERSION = '4.0.1';
|
13 |
|
14 |
/**
|
15 |
* Min required The Events Calendar version
|
src/Tribe/RSVP.php
CHANGED
@@ -282,7 +282,7 @@ class Tribe__Tickets__RSVP extends Tribe__Tickets__Tickets {
|
|
282 |
$qty = max( intval( $_POST[ "quantity_{$product_id}" ] ), 0 );
|
283 |
|
284 |
// Throw an error if Qty is bigger then Remaining
|
285 |
-
if ( $qty > $ticket->remaining() ){
|
286 |
$url = add_query_arg( 'rsvp_error', 2, get_permalink( $event_id ) );
|
287 |
wp_redirect( esc_url_raw( $url ) );
|
288 |
die;
|
282 |
$qty = max( intval( $_POST[ "quantity_{$product_id}" ] ), 0 );
|
283 |
|
284 |
// Throw an error if Qty is bigger then Remaining
|
285 |
+
if ( $ticket->managing_stock() && $qty > $ticket->remaining() ) {
|
286 |
$url = add_query_arg( 'rsvp_error', 2, get_permalink( $event_id ) );
|
287 |
wp_redirect( esc_url_raw( $url ) );
|
288 |
die;
|
src/admin-views/attendees.php
CHANGED
@@ -4,6 +4,7 @@ $this->attendees_table->prepare_items();
|
|
4 |
$event_id = $this->attendees_table->event->ID;
|
5 |
$event = $this->attendees_table->event;
|
6 |
$tickets = Tribe__Tickets__Tickets::get_event_tickets( $event_id );
|
|
|
7 |
|
8 |
$checkedin = Tribe__Tickets__Tickets::get_event_checkedin_attendees_count( $event_id );
|
9 |
$total_sold = 0;
|
@@ -16,18 +17,6 @@ foreach ( $tickets as $ticket ) {
|
|
16 |
$total_completed = $total_sold - $total_pending;
|
17 |
}
|
18 |
|
19 |
-
if ( function_exists( 'tribe_has_venue' ) && tribe_has_venue( $event_id ) ) {
|
20 |
-
$venue_id = tribe_get_venue_id( $event_id );
|
21 |
-
|
22 |
-
$url = get_post_meta( $venue_id, '_VenueURL', true );
|
23 |
-
if ( $url ) {
|
24 |
-
$url_path = parse_url( $url, PHP_URL_PATH );
|
25 |
-
$display_url = parse_url( $url, PHP_URL_HOST );
|
26 |
-
$display_url .= empty( $url_path ) && $url_path !== '/' ? '/…' : '';
|
27 |
-
$display_url = apply_filters( 'tribe_venue_display_url', $display_url, $url, $venue_id );
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
?>
|
32 |
|
33 |
<div class="wrap tribe-attendees-page">
|
@@ -42,53 +31,26 @@ if ( function_exists( 'tribe_has_venue' ) && tribe_has_venue( $event_id ) ) {
|
|
42 |
<?php do_action( 'tribe_events_tickets_attendees_event_details_top', $event_id ); ?>
|
43 |
|
44 |
<ul>
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
<strong><?php esc_html_e( 'End Date / Time:', 'event-tickets' ) ?></strong>
|
53 |
-
<?php echo tribe_get_end_date( $event_id, false, tribe_get_datetime_format( true ) ); ?>
|
54 |
-
</li>
|
55 |
-
<?php endif; ?>
|
56 |
-
|
57 |
-
<?php if ( function_exists( 'tribe_has_venue' ) && tribe_has_venue( $event_id ) ) {
|
58 |
?>
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
<a href="<?php echo get_edit_post_link( $venue_id ); ?>" title="<?php esc_html_e( 'Edit Venue', 'event-tickets' ); ?>"><?php echo tribe_get_venue( $event_id ) ?></a>
|
63 |
-
</li>
|
64 |
-
|
65 |
-
<li class="venue-address">
|
66 |
-
<strong><?php _e( 'Address:', 'event-tickets' ); ?> </strong>
|
67 |
-
<?php echo tribe_get_full_address( $venue_id ); ?>
|
68 |
</li>
|
69 |
-
|
70 |
<?php
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
}//end if
|
79 |
-
|
80 |
-
if ( $url ) {
|
81 |
-
?>
|
82 |
-
<li class="venue-url">
|
83 |
-
<strong><?php echo esc_html( __( 'Website:', 'event-tickets' ) ); ?> </strong>
|
84 |
-
<a target="_blank" href="<?php echo esc_url( $url ); ?>">
|
85 |
-
<?php echo esc_html( $display_url ); ?>
|
86 |
-
</a>
|
87 |
-
</li>
|
88 |
-
<?php
|
89 |
-
}//end if
|
90 |
-
}
|
91 |
-
?>
|
92 |
</ul>
|
93 |
<?php do_action( 'tribe_events_tickets_attendees_event_details_bottom', $event_id ); ?>
|
94 |
</div>
|
4 |
$event_id = $this->attendees_table->event->ID;
|
5 |
$event = $this->attendees_table->event;
|
6 |
$tickets = Tribe__Tickets__Tickets::get_event_tickets( $event_id );
|
7 |
+
$post_type_object = get_post_type_object( $event->post_type );
|
8 |
|
9 |
$checkedin = Tribe__Tickets__Tickets::get_event_checkedin_attendees_count( $event_id );
|
10 |
$total_sold = 0;
|
17 |
$total_completed = $total_sold - $total_pending;
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
?>
|
21 |
|
22 |
<div class="wrap tribe-attendees-page">
|
31 |
<?php do_action( 'tribe_events_tickets_attendees_event_details_top', $event_id ); ?>
|
32 |
|
33 |
<ul>
|
34 |
+
<?php
|
35 |
+
/**
|
36 |
+
* Provides an action that allows for the injections of fields at the top of the event details meta ul
|
37 |
+
*
|
38 |
+
* @var $event_id
|
39 |
+
*/
|
40 |
+
do_action( 'tribe_tickets_attendees_event_details_list_top', $event_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
?>
|
42 |
+
<li>
|
43 |
+
<strong><?php esc_html_e( 'Post Type:', 'event-tickets' ); ?></strong>
|
44 |
+
<?php echo esc_html( $post_type_object->labels->singular_name ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
</li>
|
|
|
46 |
<?php
|
47 |
+
/**
|
48 |
+
* Provides an action that allows for the injections of fields at the bottom of the event details meta ul
|
49 |
+
*
|
50 |
+
* @var $event_id
|
51 |
+
*/
|
52 |
+
do_action( 'tribe_tickets_attendees_event_details_list_bottom', $event_id );
|
53 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
</ul>
|
55 |
<?php do_action( 'tribe_events_tickets_attendees_event_details_bottom', $event_id ); ?>
|
56 |
</div>
|