Events Manager - Version 3.0.95

Version Description

  • removed some php warnings
  • fixed blank widget defaults (resave current widgets to replace blanks with defaults)
  • fixed calendar bug, where old events aren't being shown
  • fixed calendar css for events on the current day
  • unapproval is now reject if pre-approvals are turned off
  • delete bookings working again
  • booking emails working as expected without pre-approvals
  • added js hook for maps
  • fixed qtranslate conflict, delayed mo file loading for better compatability with wpml
Download this release

Release Info

Developer netweblogic
Plugin Icon 128x128 Events Manager
Version 3.0.95
Comparing to
See all releases

Code changes from version 3.0.94 to 3.0.95

admin/bookings/em-cancelled.php CHANGED
@@ -62,7 +62,7 @@ function em_bookings_cancelled_table(){
62
  <?php
63
  if ( $bookings_count >= $limit ) {
64
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
65
- $bookings_nav .= em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
66
  echo $bookings_nav;
67
  }
68
  ?>
@@ -104,7 +104,7 @@ function em_bookings_cancelled_table(){
104
  $approve_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_approve', 'booking_id'=>$EM_Booking->id));
105
  $delete_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_delete', 'booking_id'=>$EM_Booking->id));
106
  ?>
107
- <a class="em-bookings-approve" href="<?php echo $approve_url ?>"><?php _e('Approve','dbem'); ?></a> |
108
  <a class="em-bookings-edit" href="<?php bloginfo ( 'wpurl' )?>/wp-admin/admin.php?page=events-manager-bookings&amp;booking_id=<?php echo $EM_Booking->id; ?>"><?php _e('Edit'); ?></a> |
109
  <a class="em-bookings-delete" href="<?php echo $delete_url ?>"><?php _e('Delete','dbem'); ?></a>
110
  </td>
@@ -121,7 +121,7 @@ function em_bookings_cancelled_table(){
121
  <?php _e('No cancelled bookings.', 'dbem'); ?>
122
  <?php endif; ?>
123
  </form>
124
- <?php if( $bookings >= $limit ) : ?>
125
  <div class='tablenav'>
126
  <?php echo $bookings_nav; ?>
127
  <div class="clear"></div>
62
  <?php
63
  if ( $bookings_count >= $limit ) {
64
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
65
+ $bookings_nav = em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
66
  echo $bookings_nav;
67
  }
68
  ?>
104
  $approve_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_approve', 'booking_id'=>$EM_Booking->id));
105
  $delete_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_delete', 'booking_id'=>$EM_Booking->id));
106
  ?>
107
+ <a class="em-bookings-approve" href="<?php echo $approve_url ?>"><?php _e('Restore','dbem'); ?></a> |
108
  <a class="em-bookings-edit" href="<?php bloginfo ( 'wpurl' )?>/wp-admin/admin.php?page=events-manager-bookings&amp;booking_id=<?php echo $EM_Booking->id; ?>"><?php _e('Edit'); ?></a> |
109
  <a class="em-bookings-delete" href="<?php echo $delete_url ?>"><?php _e('Delete','dbem'); ?></a>
110
  </td>
121
  <?php _e('No cancelled bookings.', 'dbem'); ?>
122
  <?php endif; ?>
123
  </form>
124
+ <?php if( !empty($bookings_nav) ) : ?>
125
  <div class='tablenav'>
126
  <?php echo $bookings_nav; ?>
127
  <div class="clear"></div>
admin/bookings/em-confirmed.php CHANGED
@@ -63,7 +63,7 @@ function em_bookings_confirmed_table(){
63
  <?php
64
  if ( $bookings_count >= $limit ) {
65
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
66
- $bookings_nav .= em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
67
  echo $bookings_nav;
68
  }
69
  ?>
@@ -103,8 +103,15 @@ function em_bookings_confirmed_table(){
103
  <td>
104
  <?php
105
  $unapprove_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_unapprove', 'booking_id'=>$EM_Booking->id));
 
 
106
  ?>
 
107
  <a class="em-bookings-unapprove" href="<?php echo $unapprove_url ?>"><?php _e('Unapprove','dbem'); ?></a> |
 
 
 
 
108
  <a class="em-bookings-edit" href="<?php bloginfo ( 'wpurl' )?>/wp-admin/admin.php?page=events-manager-bookings&amp;booking_id=<?php echo $EM_Booking->id; ?>"><?php _e('Edit'); ?></a>
109
  </td>
110
  </tr>
@@ -120,7 +127,7 @@ function em_bookings_confirmed_table(){
120
  <?php _e('No confirmed bookings.', 'dbem'); ?>
121
  <?php endif; ?>
122
  </form>
123
- <?php if( $bookings >= $limit ) : ?>
124
  <div class='tablenav'>
125
  <?php echo $bookings_nav; ?>
126
  <div class="clear"></div>
63
  <?php
64
  if ( $bookings_count >= $limit ) {
65
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
66
+ $bookings_nav = em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
67
  echo $bookings_nav;
68
  }
69
  ?>
103
  <td>
104
  <?php
105
  $unapprove_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_unapprove', 'booking_id'=>$EM_Booking->id));
106
+ $reject_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_reject', 'booking_id'=>$EM_Booking->id));
107
+ $delete_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'bookings_delete', 'booking_id'=>$EM_Booking->id));
108
  ?>
109
+ <?php if( get_option('dbem_bookings_approval') ): ?>
110
  <a class="em-bookings-unapprove" href="<?php echo $unapprove_url ?>"><?php _e('Unapprove','dbem'); ?></a> |
111
+ <?php else: ?>
112
+ <a class="em-bookings-reject" href="<?php echo $reject_url ?>"><?php _e('Reject','dbem'); ?></a> |
113
+ <?php endif; ?>
114
+ <a class="em-bookings-delete" href="<?php echo $delete_url ?>"><?php _e('Delete','dbem'); ?></a> |
115
  <a class="em-bookings-edit" href="<?php bloginfo ( 'wpurl' )?>/wp-admin/admin.php?page=events-manager-bookings&amp;booking_id=<?php echo $EM_Booking->id; ?>"><?php _e('Edit'); ?></a>
116
  </td>
117
  </tr>
127
  <?php _e('No confirmed bookings.', 'dbem'); ?>
128
  <?php endif; ?>
129
  </form>
130
+ <?php if( !empty($bookings_nav) ) : ?>
131
  <div class='tablenav'>
132
  <?php echo $bookings_nav; ?>
133
  <div class="clear"></div>
admin/bookings/em-events.php CHANGED
@@ -78,7 +78,7 @@ function em_bookings_events_table() {
78
  <?php
79
  if ( $events_count >= $limit ) {
80
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_events_table'));
81
- $events_nav .= em_admin_paginate( $page_link_template, $events_count, $limit, $page, 5);
82
  echo $events_nav;
83
  }
84
  ?>
@@ -162,7 +162,7 @@ function em_bookings_events_table() {
162
  <div class="alignleft actions">
163
  <br class='clear' />
164
  </div>
165
- <?php if ( $events_count >= $limit ) : ?>
166
  <div class="tablenav-pages">
167
  <?php
168
  echo $events_nav;
78
  <?php
79
  if ( $events_count >= $limit ) {
80
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_events_table'));
81
+ $events_nav = em_admin_paginate( $page_link_template, $events_count, $limit, $page, 5);
82
  echo $events_nav;
83
  }
84
  ?>
162
  <div class="alignleft actions">
163
  <br class='clear' />
164
  </div>
165
+ <?php if( !empty($events_nav) ) : ?>
166
  <div class="tablenav-pages">
167
  <?php
168
  echo $events_nav;
admin/bookings/em-pending.php CHANGED
@@ -77,7 +77,7 @@ function em_bookings_pending_table($event_id = false){
77
  <?php
78
  if ( $bookings_count >= $limit ) {
79
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_pending_table'));
80
- $bookings_nav .= em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
81
  echo $bookings_nav;
82
  }
83
  ?>
@@ -142,7 +142,7 @@ function em_bookings_pending_table($event_id = false){
142
  <?php _e('No pending bookings.', 'dbem'); ?>
143
  <?php endif; ?>
144
  </form>
145
- <?php if( $bookings >= $limit ) : ?>
146
  <div class='tablenav'>
147
  <?php echo $bookings_nav; ?>
148
  <div class="clear"></div>
77
  <?php
78
  if ( $bookings_count >= $limit ) {
79
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_pending_table'));
80
+ $bookings_nav = em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
81
  echo $bookings_nav;
82
  }
83
  ?>
142
  <?php _e('No pending bookings.', 'dbem'); ?>
143
  <?php endif; ?>
144
  </form>
145
+ <?php if( !empty($bookings_nav) ) : ?>
146
  <div class='tablenav'>
147
  <?php echo $bookings_nav; ?>
148
  <div class="clear"></div>
admin/bookings/em-person.php CHANGED
@@ -68,7 +68,7 @@ function em_bookings_person_table(){
68
  <?php
69
  if ( $bookings_count >= $limit ) {
70
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
71
- $bookings_nav .= em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
72
  echo $bookings_nav;
73
  }
74
  ?>
@@ -137,7 +137,7 @@ function em_bookings_person_table(){
137
  <?php _e('No confirmed bookings.', 'dbem'); ?>
138
  <?php endif; ?>
139
  </form>
140
- <?php if( $bookings >= $limit ) : ?>
141
  <div class='tablenav'>
142
  <?php echo $bookings_nav; ?>
143
  <div class="clear"></div>
68
  <?php
69
  if ( $bookings_count >= $limit ) {
70
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
71
+ $bookings_nav = em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
72
  echo $bookings_nav;
73
  }
74
  ?>
137
  <?php _e('No confirmed bookings.', 'dbem'); ?>
138
  <?php endif; ?>
139
  </form>
140
+ <?php if( !empty($bookings_nav) ) : ?>
141
  <div class='tablenav'>
142
  <?php echo $bookings_nav; ?>
143
  <div class="clear"></div>
admin/bookings/em-rejected.php CHANGED
@@ -62,7 +62,7 @@ function em_bookings_rejected_table(){
62
  <?php
63
  if ( $bookings_count >= $limit ) {
64
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
65
- $bookings_nav .= em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
66
  echo $bookings_nav;
67
  }
68
  ?>
@@ -121,7 +121,7 @@ function em_bookings_rejected_table(){
121
  <?php _e('No rejected bookings.', 'dbem'); ?>
122
  <?php endif; ?>
123
  </form>
124
- <?php if( $bookings >= $limit ) : ?>
125
  <div class='tablenav'>
126
  <?php echo $bookings_nav; ?>
127
  <div class="clear"></div>
62
  <?php
63
  if ( $bookings_count >= $limit ) {
64
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%', 'em_ajax'=>0, 'em_obj'=>'em_bookings_confirmed_table'));
65
+ $bookings_nav = em_admin_paginate( $page_link_template, $bookings_count, $limit, $page, 5);
66
  echo $bookings_nav;
67
  }
68
  ?>
121
  <?php _e('No rejected bookings.', 'dbem'); ?>
122
  <?php endif; ?>
123
  </form>
124
+ <?php if( !empty($bookings_nav) ) : ?>
125
  <div class='tablenav'>
126
  <?php echo $bookings_nav; ?>
127
  <div class="clear"></div>
admin/em-admin.php CHANGED
@@ -14,7 +14,7 @@ function em_admin_warnings() {
14
  if (isset ( $_GET ['disable_hello_to_user'] ) && $_GET ['disable_hello_to_user'] == 'true'){
15
  // Disable Hello to new user if requested
16
  update_option ( 'dbem_hello_to_user', 0 );
17
- }elseif ( get_option ( 'dbem_hello_to_user' ) == 1 && $_GET['page'] == 'events-manager-events' ) {
18
  $current_user = wp_get_current_user ();
19
  //FIXME update welcome msg with good links
20
  $advice = sprintf ( __ ( "<p>Hey, <strong>%s</strong>, welcome to <strong>Events Manager</strong>! We hope you like it around here.</p>
@@ -110,6 +110,7 @@ function em_admin_load_scripts(){
110
  wp_enqueue_script('em-script', WP_PLUGIN_URL.'/events-manager/includes/js/em_admin.js', array('em-ui-js'));
111
 
112
  //TinyMCE Editor
 
113
  add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
114
  wp_enqueue_script('post');
115
  if ( user_can_richedit() )
14
  if (isset ( $_GET ['disable_hello_to_user'] ) && $_GET ['disable_hello_to_user'] == 'true'){
15
  // Disable Hello to new user if requested
16
  update_option ( 'dbem_hello_to_user', 0 );
17
+ }elseif ( get_option ( 'dbem_hello_to_user' ) == 1 && !empty($_GET['page']) && $_GET['page'] == 'events-manager-events' ) {
18
  $current_user = wp_get_current_user ();
19
  //FIXME update welcome msg with good links
20
  $advice = sprintf ( __ ( "<p>Hey, <strong>%s</strong>, welcome to <strong>Events Manager</strong>! We hope you like it around here.</p>
110
  wp_enqueue_script('em-script', WP_PLUGIN_URL.'/events-manager/includes/js/em_admin.js', array('em-ui-js'));
111
 
112
  //TinyMCE Editor
113
+ remove_filter('the_editor', 'qtrans_modifyRichEditor'); //qtranslate filter
114
  add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
115
  wp_enqueue_script('post');
116
  if ( user_can_richedit() )
admin/em-bookings.php CHANGED
@@ -81,8 +81,10 @@ function em_bookings_dashboard(){
81
  <h2>
82
  <?php _e('Event Bookings Dashboard', 'dbem'); ?>
83
  </h2>
 
84
  <h2><?php _e('Pending Bookings','dbem'); ?></h2>
85
  <?php em_bookings_pending_table(); ?>
 
86
  <h2><?php _e('Events With Bookings Enabled','dbem'); ?></h2>
87
  <?php em_bookings_events_table(); ?>
88
  </div>
@@ -127,8 +129,10 @@ function em_bookings_event(){
127
  <a class="row-title" href="<?php bloginfo ( 'wpurl' )?>/wp-admin/admin.php?page=events-manager-locations&amp;location_id=<?php echo $EM_Event->location->id ?>"><?php echo ($EM_Event->location->name); ?></a>
128
  </p>
129
  </div>
 
130
  <h2><?php _e('Pending Bookings','dbem'); ?></h2>
131
  <?php em_bookings_pending_table(); ?>
 
132
  <h2><?php _e('Confirmed Bookings','dbem'); ?></h2>
133
  <?php em_bookings_confirmed_table(); ?>
134
  <h2><?php _e('Rejected Bookings','dbem'); ?></h2>
81
  <h2>
82
  <?php _e('Event Bookings Dashboard', 'dbem'); ?>
83
  </h2>
84
+ <?php if( get_option('dbem_bookings_approval') ): ?>
85
  <h2><?php _e('Pending Bookings','dbem'); ?></h2>
86
  <?php em_bookings_pending_table(); ?>
87
+ <?php endif; ?>
88
  <h2><?php _e('Events With Bookings Enabled','dbem'); ?></h2>
89
  <?php em_bookings_events_table(); ?>
90
  </div>
129
  <a class="row-title" href="<?php bloginfo ( 'wpurl' )?>/wp-admin/admin.php?page=events-manager-locations&amp;location_id=<?php echo $EM_Event->location->id ?>"><?php echo ($EM_Event->location->name); ?></a>
130
  </p>
131
  </div>
132
+ <?php if( get_option('dbem_bookings_approval') ): ?>
133
  <h2><?php _e('Pending Bookings','dbem'); ?></h2>
134
  <?php em_bookings_pending_table(); ?>
135
+ <?php endif; ?>
136
  <h2><?php _e('Confirmed Bookings','dbem'); ?></h2>
137
  <?php em_bookings_confirmed_table(); ?>
138
  <h2><?php _e('Rejected Bookings','dbem'); ?></h2>
admin/em-events.php CHANGED
@@ -109,7 +109,7 @@ function em_admin_events_page() {
109
  <?php
110
  if ( $events_count >= $limit ) {
111
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%'));
112
- $events_nav .= em_admin_paginate( $page_link_template, $events_count, $limit, $page, 5);
113
  echo $events_nav;
114
  }
115
  ?>
109
  <?php
110
  if ( $events_count >= $limit ) {
111
  $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], array('pno'=>'%PAGE%'));
112
+ $events_nav = em_admin_paginate( $page_link_template, $events_count, $limit, $page, 5);
113
  echo $events_nav;
114
  }
115
  ?>
admin/em-locations.php CHANGED
@@ -137,7 +137,7 @@ function em_admin_locations($message='', $fill_fields = false) {
137
  }
138
 
139
  function em_admin_location($message = "") {
140
- global $EM_Location;
141
  //check that user can access this page
142
  if( is_object($EM_Location) && !$EM_Location->can_manage() ){
143
  ?>
@@ -186,9 +186,9 @@ function em_admin_location($message = "") {
186
  <?php _e ( 'Coordinates', 'dbem' ); ?>
187
  </h3>
188
  <div class="inside">
189
- <input id='location-latitude' name='location_latitude' type='text' value='<?php echo $EM_Event->latitude; ?>' size='15' />
190
  -
191
- <input id='location-longitude' name='location_longitude' type='text' value='<?php echo $EM_Event->longitude; ?>' size='15' />
192
  </div>
193
  </div>
194
  <div id="location_info" class="stuffbox">
137
  }
138
 
139
  function em_admin_location($message = "") {
140
+ global $EM_Location, $EM_Event;
141
  //check that user can access this page
142
  if( is_object($EM_Location) && !$EM_Location->can_manage() ){
143
  ?>
186
  <?php _e ( 'Coordinates', 'dbem' ); ?>
187
  </h3>
188
  <div class="inside">
189
+ <input id='location-latitude' name='location_latitude' type='text' value='<?php echo $EM_Location->latitude; ?>' size='15' />
190
  -
191
+ <input id='location-longitude' name='location_longitude' type='text' value='<?php echo $EM_Location->longitude; ?>' size='15' />
192
  </div>
193
  </div>
194
  <div id="location_info" class="stuffbox">
classes/em-booking.php CHANGED
@@ -26,7 +26,7 @@ class EM_Booking extends EM_Object{
26
  * If saved in this instance, you can see what previous approval status was.
27
  * @var int
28
  */
29
- var $previous_status;
30
  /**
31
  * The booking approval status number corresponds to a state in this array.
32
  * @var unknown_type
@@ -39,6 +39,9 @@ class EM_Booking extends EM_Object{
39
  * @return null
40
  */
41
  function EM_Booking( $booking_data = false ){
 
 
 
42
  if( $booking_data !== false ){
43
  //Load booking data
44
  $booking = array();
@@ -46,7 +49,7 @@ class EM_Booking extends EM_Object{
46
  $booking = $booking_data;
47
  //Also create a person out of this...
48
  $this->person = new EM_Person($booking_data);
49
- if($booking['person_id'] != $this->person->id){
50
  $this->person = new EM_Person($booking['booking_id']);
51
  }
52
  }elseif( is_numeric($booking_data) ){
@@ -64,7 +67,9 @@ class EM_Booking extends EM_Object{
64
  }
65
  //Save into the object
66
  $this->to_object($booking);
67
- $this->timestamp = strtotime($booking['booking_date']);
 
 
68
  }
69
  //Do it here so things appear in the po file.
70
  $this->status_array = array(
@@ -166,7 +171,7 @@ class EM_Booking extends EM_Object{
166
  */
167
  function get_event(){
168
  global $EM_Event;
169
- if( is_object($this->event) && get_class($this->event)=='EM_Event' && $this->event->id == $this->event_id ){
170
  return $this->event;
171
  }elseif( is_object($EM_Event) && $EM_Event->id == $this->event_id ){
172
  $this->event = $EM_Event;
@@ -191,11 +196,6 @@ class EM_Booking extends EM_Object{
191
  global $wpdb;
192
  $sql = $wpdb->prepare("DELETE FROM ". $wpdb->prefix.EM_BOOKINGS_TABLE . " WHERE booking_id=%d", $this->id);
193
  $result = $wpdb->query( $sql );
194
- if( $result !== false ){
195
- $this->previous_status = $this->status;
196
- $this->status == false;
197
- $this->email();
198
- }
199
  return ( $result !== false );
200
  }
201
 
@@ -283,7 +283,7 @@ class EM_Booking extends EM_Object{
283
  $contact_subject = get_option('dbem_bookings_contact_email_subject');
284
  $contact_body = get_option('dbem_bookings_contact_email_body');
285
 
286
- if( get_option('dbem_bookings_approval') == 0 || $this->status == 1 ){
287
  $booker_subject = get_option('dbem_bookings_email_confirmed_subject');
288
  $booker_body = get_option('dbem_bookings_email_confirmed_body');
289
  }elseif( $this->status == 0 ){
26
  * If saved in this instance, you can see what previous approval status was.
27
  * @var int
28
  */
29
+ var $previous_status = false;
30
  /**
31
  * The booking approval status number corresponds to a state in this array.
32
  * @var unknown_type
39
  * @return null
40
  */
41
  function EM_Booking( $booking_data = false ){
42
+ if( !get_option('dbem_bookings_approval') ){
43
+ $this->status = 1;
44
+ }
45
  if( $booking_data !== false ){
46
  //Load booking data
47
  $booking = array();
49
  $booking = $booking_data;
50
  //Also create a person out of this...
51
  $this->person = new EM_Person($booking_data);
52
+ if( !empty($booking['person_id']) && $booking['person_id'] != $this->person->id){
53
  $this->person = new EM_Person($booking['booking_id']);
54
  }
55
  }elseif( is_numeric($booking_data) ){
67
  }
68
  //Save into the object
69
  $this->to_object($booking);
70
+ if( !empty($booking['booking_date']) ){
71
+ $this->timestamp = strtotime($booking['booking_date']);
72
+ }
73
  }
74
  //Do it here so things appear in the po file.
75
  $this->status_array = array(
171
  */
172
  function get_event(){
173
  global $EM_Event;
174
+ if( !empty($this->event) && is_object($this->event) && get_class($this->event)=='EM_Event' && $this->event->id == $this->event_id ){
175
  return $this->event;
176
  }elseif( is_object($EM_Event) && $EM_Event->id == $this->event_id ){
177
  $this->event = $EM_Event;
196
  global $wpdb;
197
  $sql = $wpdb->prepare("DELETE FROM ". $wpdb->prefix.EM_BOOKINGS_TABLE . " WHERE booking_id=%d", $this->id);
198
  $result = $wpdb->query( $sql );
 
 
 
 
 
199
  return ( $result !== false );
200
  }
201
 
283
  $contact_subject = get_option('dbem_bookings_contact_email_subject');
284
  $contact_body = get_option('dbem_bookings_contact_email_body');
285
 
286
+ if( (get_option('dbem_bookings_approval') == 0 && $this->previous_status === false) || $this->status == 1 ){
287
  $booker_subject = get_option('dbem_bookings_email_confirmed_subject');
288
  $booker_body = get_option('dbem_bookings_email_confirmed_body');
289
  }elseif( $this->status == 0 ){
classes/em-bookings.php CHANGED
@@ -227,7 +227,7 @@ class EM_Bookings extends EM_Object{
227
  function get_bookings(){
228
  $confirmed = array();
229
  foreach ( $this->bookings as $booking ){
230
- if( $booking->status == 1 || (get_option('dbem_bookings_approval') == 0 && $booking->status != 3) ){
231
  $confirmed[] = $booking;
232
  }
233
  }
@@ -252,13 +252,10 @@ class EM_Bookings extends EM_Object{
252
  }
253
 
254
  /**
255
- * Get rejected bookings. If booking approval is disabled, will return no bookings.
256
  * @return array EM_Booking
257
  */
258
  function get_rejected_bookings(){
259
- if( get_option('dbem_bookings_approval') == 0 ){
260
- return array();
261
- }
262
  $pending = array();
263
  foreach ( $this->bookings as $booking ){
264
  if($booking->status == 2){
@@ -416,7 +413,7 @@ class EM_Bookings extends EM_Object{
416
  'Comment'
417
  );
418
  $file = sprintf(__('Booking details for "%s" as of %s','dbem'),$event_name, date_i18n('D d M Y h:i', current_time('timestamp'))) . "\n";
419
- $file = '"'. implode('","', $labels). '"' . "\n";
420
 
421
  //Rows
422
  foreach( $this->bookings as $EM_Booking ) {
227
  function get_bookings(){
228
  $confirmed = array();
229
  foreach ( $this->bookings as $booking ){
230
+ if( $booking->status == 1 || (get_option('dbem_bookings_approval') == 0 && $booking->status < 2) ){
231
  $confirmed[] = $booking;
232
  }
233
  }
252
  }
253
 
254
  /**
255
+ * Get rejected bookings.
256
  * @return array EM_Booking
257
  */
258
  function get_rejected_bookings(){
 
 
 
259
  $pending = array();
260
  foreach ( $this->bookings as $booking ){
261
  if($booking->status == 2){
413
  'Comment'
414
  );
415
  $file = sprintf(__('Booking details for "%s" as of %s','dbem'),$event_name, date_i18n('D d M Y h:i', current_time('timestamp'))) . "\n";
416
+ $file = '"'. strtolower(implode('","', $labels)). '"' . "\n";
417
 
418
  //Rows
419
  foreach( $this->bookings as $EM_Booking ) {
classes/em-calendar.php CHANGED
@@ -353,7 +353,7 @@ class EM_Calendar extends EM_Object {
353
  $defaults = array(
354
  'full' => 0, //Will display a full calendar with event names
355
  'long_events' => 0, //Events that last longer than a day
356
- 'scope' => 'future',
357
  'owner' => false
358
  );
359
  $atts = parent::get_default_search($defaults, $array);
353
  $defaults = array(
354
  'full' => 0, //Will display a full calendar with event names
355
  'long_events' => 0, //Events that last longer than a day
356
+ 'scope' => 'all',
357
  'owner' => false
358
  );
359
  $atts = parent::get_default_search($defaults, $array);
classes/em-category.php CHANGED
@@ -23,6 +23,7 @@ class EM_Category extends EM_Object {
23
  function EM_Category( $category_data = false ) {
24
  //Initialize
25
  $this->required_fields = array("category_name" => __('The category name', 'dbem'));
 
26
  if( $category_data != false ){
27
  //Load location data
28
  if( is_array($category_data) && isset($category_data['category_name']) ){
23
  function EM_Category( $category_data = false ) {
24
  //Initialize
25
  $this->required_fields = array("category_name" => __('The category name', 'dbem'));
26
+ $category = array();
27
  if( $category_data != false ){
28
  //Load location data
29
  if( is_array($category_data) && isset($category_data['category_name']) ){
classes/em-event.php CHANGED
@@ -666,19 +666,18 @@ class EM_Event extends EM_Object{
666
  $event_string = str_replace($result,$replace,$event_string );
667
  }
668
  //This is for the custom attributes
669
- preg_match_all('/#_ATT\{.+?\}(\{.+?\})?/', $format, $results);
670
  foreach($results[0] as $resultKey => $result) {
671
  //Strip string of placeholder and just leave the reference
672
  $attRef = substr( substr($result, 0, strpos($result, '}')), 6 );
673
  $attString = '';
674
- if( array_key_exists($attRef, $this->attributes) ){
675
  $attString = $this->attributes[$attRef];
676
- if( trim($attString) == '' && $results[1][$resultKey] != '' ){
677
- //Check to see if we have a second set of braces;
678
- $attString = substr( $results[1][$resultKey], 1, strlen(trim($results[1][$resultKey]))-2 );
679
- }
680
- $attString = apply_filters('em_event_output_placeholder', $attString, $this, $result, $target);
681
  }
 
682
  $event_string = str_replace($result, $attString ,$event_string );
683
  }
684
 
666
  $event_string = str_replace($result,$replace,$event_string );
667
  }
668
  //This is for the custom attributes
669
+ preg_match_all('/#_ATT\{.+?\}(\{(.+)\})?/', $format, $results);
670
  foreach($results[0] as $resultKey => $result) {
671
  //Strip string of placeholder and just leave the reference
672
  $attRef = substr( substr($result, 0, strpos($result, '}')), 6 );
673
  $attString = '';
674
+ if( is_array($this->attributes) && array_key_exists($attRef, $this->attributes) ){
675
  $attString = $this->attributes[$attRef];
676
+ }elseif( !empty($results[2][$resultKey]) ){
677
+ //Check to see if we have a second set of braces;
678
+ $attString = $results[2][$resultKey];
 
 
679
  }
680
+ $attString = apply_filters('em_event_output_placeholder', $attString, $this, $result, $target);
681
  $event_string = str_replace($result, $attString ,$event_string );
682
  }
683
 
classes/em-object.php CHANGED
@@ -176,7 +176,7 @@ class EM_Object {
176
  $conditions['scope'] = " event_start_date < '$today'";
177
  }elseif ($scope == "today"){
178
  $conditions['scope'] = " ( (event_start_date = CAST('$today' AS DATE)) OR (event_start_date <= CAST('$today' AS DATE) AND event_end_date >= CAST('$today' AS DATE)) )";
179
- }elseif ($scope == "future" || $scope != 'all'){
180
  $conditions['scope'] = " (event_start_date >= CAST('$today' AS DATE) OR (event_end_date >= CAST('$today' AS DATE) AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL))";
181
  }
182
  }
176
  $conditions['scope'] = " event_start_date < '$today'";
177
  }elseif ($scope == "today"){
178
  $conditions['scope'] = " ( (event_start_date = CAST('$today' AS DATE)) OR (event_start_date <= CAST('$today' AS DATE) AND event_end_date >= CAST('$today' AS DATE)) )";
179
+ }elseif ($scope == "future"){
180
  $conditions['scope'] = " (event_start_date >= CAST('$today' AS DATE) OR (event_end_date >= CAST('$today' AS DATE) AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL))";
181
  }
182
  }
classes/em-people.php CHANGED
@@ -88,15 +88,6 @@ class EM_People extends EM_Object {
88
  //FIXME EM_People doesn't build sql conditions in EM_Object
89
  $conditions = array();
90
 
91
- //owner lookup
92
- //FIXME permissions need tweaking for people, not owned by event owner, but site.
93
- /*
94
- if( is_numeric($args['owner']) ){
95
- $conditions['owner'] = "person_owner=".get_current_user_id();
96
- }elseif( preg_match('/^([0-9],?)+$/', $args['owner']) ){
97
- $conditions['owner'] = "person_owner IN (".explode(',', $args['owner']).")";
98
- }
99
- */
100
  return apply_filters( 'em_people_build_sql_conditions', $conditions, $args );
101
  }
102
 
88
  //FIXME EM_People doesn't build sql conditions in EM_Object
89
  $conditions = array();
90
 
 
 
 
 
 
 
 
 
 
91
  return apply_filters( 'em_people_build_sql_conditions', $conditions, $args );
92
  }
93
 
classes/em-person.php CHANGED
@@ -10,7 +10,6 @@ class EM_Person extends EM_Object{
10
  //Other Vars
11
  var $fields = array(
12
  'person_id' => array('name'=>'id','type'=>'%d'),
13
- 'person_owner' => array('name'=>'owner','type'=>'%d'),
14
  'person_name' => array('name'=>'name','type'=>'%s'),
15
  'person_email' => array('name'=>'email','type'=>'%s'),
16
  'person_phone' => array('name'=>'phone','type'=>'%s')
10
  //Other Vars
11
  var $fields = array(
12
  'person_id' => array('name'=>'id','type'=>'%d'),
 
13
  'person_name' => array('name'=>'name','type'=>'%s'),
14
  'person_email' => array('name'=>'email','type'=>'%s'),
15
  'person_phone' => array('name'=>'phone','type'=>'%s')
em-ajax.php CHANGED
@@ -60,15 +60,18 @@ function em_ajax_actions() {
60
  die();
61
  }elseif($_REQUEST['action'] == 'bookings_delete'){
62
  //Just do it here, since we may be deleting bookings of different events.
 
63
  if(EM_Object::array_is_numeric($_REQUEST['bookings'])){
64
  $results = array();
65
- foreach($booking_ids as $booking_id){
66
- $EM_Booking = new EM_Booking($booking_ids);
67
  $results[] = $EM_Booking->delete();
68
  }
69
  $result = !in_array(false,$results);
70
- }elseif(is_numeric($booking_ids)){
71
- $EM_Booking = new EM_Booking($booking_ids);
 
 
72
  $result = $EM_Booking->delete();
73
  }
74
  if( $result ){
60
  die();
61
  }elseif($_REQUEST['action'] == 'bookings_delete'){
62
  //Just do it here, since we may be deleting bookings of different events.
63
+ $result = false;
64
  if(EM_Object::array_is_numeric($_REQUEST['bookings'])){
65
  $results = array();
66
+ foreach($_REQUEST['bookings'] as $booking_id){
67
+ $EM_Booking = new EM_Booking($booking_id);
68
  $results[] = $EM_Booking->delete();
69
  }
70
  $result = !in_array(false,$results);
71
+ }elseif( is_numeric($_REQUEST['bookings']) ){
72
+ $EM_Booking = new EM_Booking($_REQUEST['bookings']);
73
+ $result = $EM_Booking->delete();
74
+ }elseif( is_object($EM_Booking) ){
75
  $result = $EM_Booking->delete();
76
  }
77
  if( $result ){
em-bookings.php CHANGED
@@ -102,7 +102,7 @@ function em_add_booking_form() {
102
  <script type="text/javascript">
103
  jQuery(document).ready( function($){
104
  if( $('#dbem-booking-delete').size() > 0 ){
105
- var triggerText = '<?php ($_POST['eventAction'] == 'delete_booking') ? _e('Hide cancellation form', 'dbem') : _e('Cancel a booking', 'dbem'); ?>';
106
  $('#dbem-rsvp input[type=submit]').after(' <a href="#" id="dbem-booking-cancel">'+triggerText+'</a>');
107
  if( $('#dbem-booking-cancel').html() == '<?php _e('Cancel a booking', 'dbem'); ?>' ) { $('#dbem-booking-delete').hide(); }
108
  $('#dbem-booking-cancel').click( function(event){
102
  <script type="text/javascript">
103
  jQuery(document).ready( function($){
104
  if( $('#dbem-booking-delete').size() > 0 ){
105
+ var triggerText = '<?php ( !empty($_POST['eventAction']) && $_POST['eventAction'] == 'delete_booking') ? _e('Hide cancellation form', 'dbem') : _e('Cancel a booking', 'dbem'); ?>';
106
  $('#dbem-rsvp input[type=submit]').after(' <a href="#" id="dbem-booking-cancel">'+triggerText+'</a>');
107
  if( $('#dbem-booking-cancel').html() == '<?php _e('Cancel a booking', 'dbem'); ?>' ) { $('#dbem-booking-delete').hide(); }
108
  $('#dbem-booking-cancel').click( function(event){
em-events.php CHANGED
@@ -44,7 +44,9 @@ function em_content($content) {
44
  // single event page
45
  $event = new EM_Event( $_REQUEST['event_id'] );
46
  $content = $event->output_single();
47
- } else {
 
 
48
  // Multiple events page
49
  $scope = ( !empty($_REQUEST['scope']) ) ? EM_Object::sanitize($_REQUEST['scope']) : "future";
50
  //If we have a $_GET['page'] var, use it to calculate the offset/limit ratios (safer than offset/limit get vars)
44
  // single event page
45
  $event = new EM_Event( $_REQUEST['event_id'] );
46
  $content = $event->output_single();
47
+ } elseif ( !empty($_REQUEST['bookings_id']) ) {
48
+ //bookings page
49
+ }else {
50
  // Multiple events page
51
  $scope = ( !empty($_REQUEST['scope']) ) ? EM_Object::sanitize($_REQUEST['scope']) : "future";
52
  //If we have a $_GET['page'] var, use it to calculate the offset/limit ratios (safer than offset/limit get vars)
em-functions.php CHANGED
@@ -1,5 +1,11 @@
1
  <?php
2
-
 
 
 
 
 
 
3
 
4
  /**
5
  * Currently, just is_super_admin() but allows scalability of permissions now.
1
  <?php
2
+ //simple backwards compatability for WP 2.x ... since it's only this function to get it down to 2.9.1
3
+ if( !function_exists('get_current_user_id') ){
4
+ function get_current_user_id() {
5
+ $user = wp_get_current_user();
6
+ return ( isset( $user->ID ) ? (int) $user->ID : 0 );
7
+ }
8
+ }
9
 
10
  /**
11
  * Currently, just is_super_admin() but allows scalability of permissions now.
em-install.php CHANGED
@@ -29,8 +29,8 @@ function em_install() {
29
  update_option('dbem_version', EM_VERSION);
30
 
31
  // wp-content must be chmodded 777. Maybe just wp-content.
32
- if(!file_exists("../".EM_IMAGE_UPLOAD_DIR))
33
- mkdir("../".EM_IMAGE_UPLOAD_DIR, 0777); //do we need to 777 it? it'll be owner apache anyway, like normal uploads
34
 
35
  em_create_events_page();
36
  }
@@ -170,7 +170,6 @@ function em_create_people_table() {
170
 
171
  $sql = "CREATE TABLE ".$table_name." (
172
  person_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
173
- person_owner bigint(20) unsigned DEFAULT 0 NOT NULL,
174
  person_name tinytext NOT NULL,
175
  person_email tinytext NOT NULL,
176
  person_phone tinytext NOT NULL,
@@ -207,12 +206,12 @@ function em_create_categories_table() {
207
 
208
 
209
  function em_add_options() {
210
- $contact_person_email_body_localizable = __("#_BOOKINGNAME (#_BOOKINGEMAIL) will attend #_NAME on #F #j, #Y. He wants to reserve #_BOOKINGSPACES spaces.<br/> Now there are #_BOOKEDSPACES spaces reserved, #_AVAILABLESPACES are still available.<br/>Yours faithfully,<br/>Events Manager - http://wp-events-plugin.com",'dbem').__('<br/><br/>-------------------------------<br/>Powered by Events Manager - http://wp-events-plugin.com','dbem');
211
- $contact_person_email_cancelled_body_localizable = __("#_BOOKINGNAME (#_BOOKINGEMAIL) cancelled his booking at #_NAME on #F #j, #Y. He wanted to reserve #_BOOKINGSPACES spaces.<br/> Now there are #_BOOKEDSPACES spaces reserved, #_AVAILABLESPACES are still available.<br/>Yours faithfully,<br/>Events Manager - http://wp-events-plugin.com",'dbem').__('<br/><br/>-------------------------------<br/>Powered by Events Manager - http://wp-events-plugin.com','dbem');
212
- $respondent_email_body_localizable = __("Dear #_BOOKINGNAME, <br/>you have successfully reserved #_BOOKINGSPACES space/spaces for #_NAME.<br/>Yours faithfully,<br/>#_CONTACTNAME",'dbem').__('<br/><br/>-------------------------------<br/>Powered by Events Manager - http://wp-events-plugin.com','dbem');
213
- $respondent_email_pending_body_localizable = __("Dear #_BOOKINGNAME, <br/>You have requested #_BOOKEDSPACES space/spaces for #_NAME.<br/>Your booking is currently pending approval by our administrators. Once approved you will receive an automatic confirmation.<br/>Yours faithfully,<br/>#_CONTACTNAME",'dbem').__('<br/><br/>-------------------------------<br/>Powered by Events Manager - http://wp-events-plugin.com','dbem');
214
- $respondent_email_rejected_body_localizable = __("Dear #_BOOKINGNAME, <br/>Your requested booking for #_BOOKINGSPACES spaces at #_NAME on #F #j, #Y has been rejected.<br/>Yours faithfully,<br/>#_CONTACTNAME",'dbem').__('<br/><br/>-------------------------------<br/>Powered by Events Manager - http://wp-events-plugin.com','dbem');
215
- $respondent_email_cancelled_body_localizable = __("Dear #_BOOKINGNAME, <br/>Your requested booking for #_BOOKINGSPACES spaces at #_NAME on #F #j, #Y has been cancelled.<br/>Yours faithfully,<br/>#_CONTACTNAME",'dbem').__('<br/><br/>-------------------------------<br/>Powered by Events Manager - http://wp-events-plugin.com','dbem');
216
 
217
  $dbem_options = array(
218
  //defaults
29
  update_option('dbem_version', EM_VERSION);
30
 
31
  // wp-content must be chmodded 777. Maybe just wp-content.
32
+ if( !file_exists(ABSPATH."/".EM_IMAGE_UPLOAD_DIR))
33
+ @mkdir(ABSPATH."/".EM_IMAGE_UPLOAD_DIR, 0777); //do we need to 777 it? it'll be owner apache anyway, like normal uploads
34
 
35
  em_create_events_page();
36
  }
170
 
171
  $sql = "CREATE TABLE ".$table_name." (
172
  person_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 
173
  person_name tinytext NOT NULL,
174
  person_email tinytext NOT NULL,
175
  person_phone tinytext NOT NULL,
206
 
207
 
208
  function em_add_options() {
209
+ $contact_person_email_body_localizable = __("#_BOOKINGNAME (#_BOOKINGEMAIL) will attend #_NAME on #F #j, #Y. He wants to reserve #_BOOKINGSPACES spaces.<br/> Now there are #_BOOKEDSPACES spaces reserved, #_AVAILABLESPACES are still available.").'<br/><br/>-------------------------------<br/>'.__('Powered by Events Manager','dbem').' - http://wp-events-plugin.com';
210
+ $contact_person_email_cancelled_body_localizable = __("#_BOOKINGNAME (#_BOOKINGEMAIL) cancelled his booking at #_NAME on #F #j, #Y. He wanted to reserve #_BOOKINGSPACES spaces.<br/> Now there are #_BOOKEDSPACES spaces reserved, #_AVAILABLESPACES are still available.").'<br/><br/>-------------------------------<br/>'.__('Powered by Events Manager','dbem').' - http://wp-events-plugin.com';
211
+ $respondent_email_body_localizable = __("Dear #_BOOKINGNAME, <br/>You have successfully reserved #_BOOKINGSPACES space/spaces for #_NAME.").'<br/><br/>-------------------------------<br/>'.__('Powered by Events Manager','dbem').' - http://wp-events-plugin.com';
212
+ $respondent_email_pending_body_localizable = __("Dear #_BOOKINGNAME, <br/>You have requested #_BOOKEDSPACES space/spaces for #_NAME.<br/>Your booking is currently pending approval by our administrators. Once approved you will receive an automatic confirmation.").'<br/><br/>-------------------------------<br/>'.__('Powered by Events Manager','dbem').' - http://wp-events-plugin.com';
213
+ $respondent_email_rejected_body_localizable = __("Dear #_BOOKINGNAME, <br/>Your requested booking for #_BOOKINGSPACES spaces at #_NAME on #F #j, #Y has been rejected.").'<br/><br/>-------------------------------<br/>'.__('Powered by Events Manager','dbem').' - http://wp-events-plugin.com';
214
+ $respondent_email_cancelled_body_localizable = __("Dear #_BOOKINGNAME, <br/>Your requested booking for #_BOOKINGSPACES spaces at #_NAME on #F #j, #Y has been cancelled.").'<br/><br/>-------------------------------<br/>'.__('Powered by Events Manager','dbem').' - http://wp-events-plugin.com';
215
 
216
  $dbem_options = array(
217
  //defaults
events-manager.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
- Version: 3.0.94
5
  Plugin URI: http://wp-events-plugin.com
6
  Description: Manage events specifying precise spatial data (Location, Town, Province, etc).
7
  Author: Davide Benini, Marcus Sykes
@@ -94,7 +94,7 @@ if( is_admin() ){
94
 
95
 
96
  // Setting constants
97
- define('EM_VERSION', 3.094); //self expanatory
98
  define('EM_CATEGORIES_TABLE', 'em_categories'); //TABLE NAME
99
  define('EM_EVENTS_TABLE','em_events'); //TABLE NAME
100
  define('EM_META_TABLE','em_meta'); //TABLE NAME
@@ -125,7 +125,7 @@ add_filter('dbem_notes', 'prepend_attachment');
125
  // RSS general filters
126
  add_filter('dbem_general_rss', 'strip_tags');
127
  add_filter('dbem_general_rss', 'ent2ncr', 8);
128
- add_filter('dbem_general_rss', 'wp_specialchars');
129
  // RSS content filter
130
  add_filter('dbem_notes_rss', 'convert_chars', 8);
131
  add_filter('dbem_notes_rss', 'ent2ncr', 8);
@@ -135,8 +135,11 @@ add_filter('dbem_notes_map', 'js_escape');
135
 
136
  // LOCALIZATION
137
  // Localised date formats as in the jquery UI datepicker plugin
138
- //TODO Sort out dates, (ref: output idea)
139
- load_plugin_textdomain('dbem', false, dirname( plugin_basename( __FILE__ ) ).'/includes/langs');
 
 
 
140
 
141
  /**
142
  * This function will load an event into the global $EM_Event variable during page initialization, provided an event_id is given in the url via GET or POST.
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
+ Version: 3.0.95
5
  Plugin URI: http://wp-events-plugin.com
6
  Description: Manage events specifying precise spatial data (Location, Town, Province, etc).
7
  Author: Davide Benini, Marcus Sykes
94
 
95
 
96
  // Setting constants
97
+ define('EM_VERSION', 3.095); //self expanatory
98
  define('EM_CATEGORIES_TABLE', 'em_categories'); //TABLE NAME
99
  define('EM_EVENTS_TABLE','em_events'); //TABLE NAME
100
  define('EM_META_TABLE','em_meta'); //TABLE NAME
125
  // RSS general filters
126
  add_filter('dbem_general_rss', 'strip_tags');
127
  add_filter('dbem_general_rss', 'ent2ncr', 8);
128
+ add_filter('dbem_general_rss', 'esc_html');
129
  // RSS content filter
130
  add_filter('dbem_notes_rss', 'convert_chars', 8);
131
  add_filter('dbem_notes_rss', 'ent2ncr', 8);
135
 
136
  // LOCALIZATION
137
  // Localised date formats as in the jquery UI datepicker plugin
138
+ // TODO Sort out dates, (ref: output idea)
139
+ function em_load_plugin_textdomain(){
140
+ load_plugin_textdomain('dbem', false, dirname( plugin_basename( __FILE__ ) ).'/includes/langs');
141
+ }
142
+ add_filter('plugins_loaded','em_load_plugin_textdomain');
143
 
144
  /**
145
  * This function will load an event into the global $EM_Event variable during page initialization, provided an event_id is given in the url via GET or POST.
includes/css/events_manager.css CHANGED
@@ -108,7 +108,7 @@ table.dbem-calendar-table td.eventful a, table.dbem-calendar-table td.eventful-t
108
  font-weight: bold;
109
  color: #FD7E29;
110
  }
111
- table.dbem-calendar-table td.eventless-today {
112
  background-color: #CFCFCF;
113
  }
114
  table.dbem-calendar-table thead {
108
  font-weight: bold;
109
  color: #FD7E29;
110
  }
111
+ table.dbem-calendar-table td.eventless-today, table.dbem-calendar-table td.eventful-today {
112
  background-color: #CFCFCF;
113
  }
114
  table.dbem-calendar-table thead {
includes/js/em_admin.js CHANGED
@@ -42,8 +42,7 @@ jQuery(document).ready( function($) {
42
  });
43
  //Approve/Reject Links
44
  $('.em-bookings-approve,.em-bookings-reject,.em-bookings-unapprove,.em-bookings-delete').live('click', function(){
45
- var el = $(this);
46
- console.log(el);
47
  if( el.hasClass('em-bookings-delete') ){
48
  if( !confirm("Are you sure you want to delete?") ){ return false; }
49
  }
42
  });
43
  //Approve/Reject Links
44
  $('.em-bookings-approve,.em-bookings-reject,.em-bookings-unapprove,.em-bookings-delete').live('click', function(){
45
+ var el = $(this);
 
46
  if( el.hasClass('em-bookings-delete') ){
47
  if( !confirm("Are you sure you want to delete?") ){ return false; }
48
  }
includes/js/em_maps.js CHANGED
@@ -28,6 +28,8 @@ function em_maps() {
28
  });
29
  var infowindow = new google.maps.InfoWindow({ content: document.getElementById('em-location-map-info-'+map_id).firstElementChild });
30
  infowindow.open(maps[map_id],marker);
 
 
31
  });
32
  jQuery('.em-locations-map').each( function(index){
33
  var el = jQuery(this);
@@ -69,6 +71,8 @@ function em_maps() {
69
  var maxLatLng = new google.maps.LatLng(maxLatLngArr[0],maxLatLngArr[1]);
70
  var bounds = new google.maps.LatLngBounds(minLatLng,maxLatLng);
71
  maps[map_id].fitBounds(bounds);
 
 
72
  }else{
73
  el.children().first().html('No locations found');
74
  }
28
  });
29
  var infowindow = new google.maps.InfoWindow({ content: document.getElementById('em-location-map-info-'+map_id).firstElementChild });
30
  infowindow.open(maps[map_id],marker);
31
+ //JS Hook for handling map after instantiation
32
+ if( jQuery.isFunction(em_maps_location_hook) ){ em_maps_location_hook( maps[map_id], infowindow ); }
33
  });
34
  jQuery('.em-locations-map').each( function(index){
35
  var el = jQuery(this);
71
  var maxLatLng = new google.maps.LatLng(maxLatLngArr[0],maxLatLngArr[1]);
72
  var bounds = new google.maps.LatLngBounds(minLatLng,maxLatLng);
73
  maps[map_id].fitBounds(bounds);
74
+ //Call a hook if exists
75
+ if( jQuery.isFunction(em_maps_locations_hook) ){ em_maps_locations_hook( maps[map_id] ); }
76
  }else{
77
  el.children().first().html('No locations found');
78
  }
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: nutsmuggler, netweblogic
3
  Donate link: http://wp-events-plugin.com
4
  Tags: events, booking, calendar, locations, maps, geotagging, admin, dashboard, plugin, template, theme, widget
5
- Requires at least: 2.9
6
- Tested up to: 3.0.4
7
- Stable tag: 3.0.94
8
 
9
  Fully featured events management including recurring events, location management, calendar, Google map integration, booking management and more.
10
 
@@ -108,6 +108,17 @@ At this stage, Events Manager is available in German, Spanish, Czech, Italian, D
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
 
 
 
 
 
111
  = 3.0.94 =
112
  * Fixed missing events, locations etc. due to permissions
113
  * Fixed location widget bug
2
  Contributors: nutsmuggler, netweblogic
3
  Donate link: http://wp-events-plugin.com
4
  Tags: events, booking, calendar, locations, maps, geotagging, admin, dashboard, plugin, template, theme, widget
5
+ Requires at least: 2.9
6
+ Tested up to: 3.1
7
+ Stable tag: 3.0.95
8
 
9
  Fully featured events management including recurring events, location management, calendar, Google map integration, booking management and more.
10
 
108
 
109
  == Changelog ==
110
 
111
+ = 3.0.95 =
112
+ * removed some php warnings
113
+ * fixed blank widget defaults (resave current widgets to replace blanks with defaults)
114
+ * fixed calendar bug, where old events aren't being shown
115
+ * fixed calendar css for events on the current day
116
+ * unapproval is now reject if pre-approvals are turned off
117
+ * delete bookings working again
118
+ * booking emails working as expected without pre-approvals
119
+ * added js hook for maps
120
+ * fixed qtranslate conflict, delayed mo file loading for better compatability with wpml
121
+
122
  = 3.0.94 =
123
  * Fixed missing events, locations etc. due to permissions
124
  * Fixed location widget bug
widgets/em-calendar.php CHANGED
@@ -4,14 +4,22 @@
4
  * Standard events calendar widget
5
  */
6
  class EM_Widget_Calendar extends WP_Widget {
 
 
 
7
  /** constructor */
8
  function EM_Widget_Calendar() {
 
 
 
 
9
  $widget_ops = array('description' => __( "Display your events in a calendar widget.", 'dbem') );
10
  parent::WP_Widget(false, $name = __('Events Calendar','dbem'), $widget_ops);
11
  }
12
 
13
  /** @see WP_Widget::widget */
14
  function widget($args, $instance) {
 
15
  echo $args['before_widget'];
16
  echo $args['before_title'];
17
  echo $instance['title'];
@@ -37,13 +45,14 @@ class EM_Widget_Calendar extends WP_Widget {
37
  /** @see WP_Widget::update */
38
  function update($new_instance, $old_instance) {
39
  //filter the new instance and replace blanks with defaults
40
- $new_instance['title'] = ($new_instance['title'] == '') ? __('Calendar','dbem'):$new_instance['title'];
41
- $new_instance['long_events'] = ($new_instance['long_events'] == '') ? 0:$new_instance['long_events'];
42
  return $new_instance;
43
  }
44
 
45
  /** @see WP_Widget::form */
46
  function form($instance) {
 
47
  ?>
48
  <p>
49
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>
4
  * Standard events calendar widget
5
  */
6
  class EM_Widget_Calendar extends WP_Widget {
7
+
8
+ var $defaults = array();
9
+
10
  /** constructor */
11
  function EM_Widget_Calendar() {
12
+ $this->defaults = array(
13
+ 'title' => __('Calendar','dbem'),
14
+ 'long_events' => 0
15
+ );
16
  $widget_ops = array('description' => __( "Display your events in a calendar widget.", 'dbem') );
17
  parent::WP_Widget(false, $name = __('Events Calendar','dbem'), $widget_ops);
18
  }
19
 
20
  /** @see WP_Widget::widget */
21
  function widget($args, $instance) {
22
+ $instance = array_merge($this->defaults, $instance);
23
  echo $args['before_widget'];
24
  echo $args['before_title'];
25
  echo $instance['title'];
45
  /** @see WP_Widget::update */
46
  function update($new_instance, $old_instance) {
47
  //filter the new instance and replace blanks with defaults
48
+ $new_instance['title'] = ($new_instance['title'] == '') ? $this->defaults['title']:$new_instance['title'];
49
+ $new_instance['long_events'] = ($new_instance['long_events'] == '') ? $this->defaults['long_events']:$new_instance['long_events'];
50
  return $new_instance;
51
  }
52
 
53
  /** @see WP_Widget::form */
54
  function form($instance) {
55
+ $instance = array_merge($this->defaults, $instance);
56
  ?>
57
  <p>
58
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>
widgets/em-events.php CHANGED
@@ -4,14 +4,29 @@
4
  * Standard events list widget
5
  */
6
  class EM_Widget extends WP_Widget {
 
 
7
  /** constructor */
8
  function EM_Widget() {
 
 
 
 
 
 
 
 
 
 
 
 
9
  $widget_ops = array('description' => __( "Display a list of events on Events Manager.", 'dbem') );
10
  parent::WP_Widget(false, $name = 'Events', $widget_ops);
11
  }
12
 
13
  /** @see WP_Widget::widget */
14
  function widget($args, $instance) {
 
15
  echo $args['before_widget'];
16
  echo $args['before_title'];
17
  echo $instance['title'];
@@ -46,23 +61,17 @@ class EM_Widget extends WP_Widget {
46
 
47
  /** @see WP_Widget::update */
48
  function update($new_instance, $old_instance) {
49
- //filter the new instance and replace blanks with defaults
50
- $defaults = array(
51
- 'title' => __('Events','dbem'),
52
- 'scope' => 'future',
53
- 'order' => 'ASC',
54
- 'limit' => 5,
55
- 'format' => '#_LINKEDNAME<ul><li>#j #M #y</li><li>#_TOWN</li></ul>',
56
- 'nolistwrap' => false,
57
- 'orderby' => 'start_date,start_time,name',
58
- 'all_events' => 0,
59
- 'all_events_text' => __('all events', 'dbem')
60
- );
61
- return array_merge($defaults, $new_instance);
62
  }
63
 
64
  /** @see WP_Widget::form */
65
  function form($instance) {
 
66
  ?>
67
  <p>
68
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>
4
  * Standard events list widget
5
  */
6
  class EM_Widget extends WP_Widget {
7
+ var $defaults;
8
+
9
  /** constructor */
10
  function EM_Widget() {
11
+ //filter the new instance and replace blanks with defaults
12
+ $this->defaults = array(
13
+ 'title' => __('Events','dbem'),
14
+ 'scope' => 'future',
15
+ 'order' => 'ASC',
16
+ 'limit' => 5,
17
+ 'format' => '#_LINKEDNAME<ul><li>#j #M #y</li><li>#_TOWN</li></ul>',
18
+ 'nolistwrap' => false,
19
+ 'orderby' => 'start_date,start_time,name',
20
+ 'all_events' => 0,
21
+ 'all_events_text' => __('all events', 'dbem')
22
+ );
23
  $widget_ops = array('description' => __( "Display a list of events on Events Manager.", 'dbem') );
24
  parent::WP_Widget(false, $name = 'Events', $widget_ops);
25
  }
26
 
27
  /** @see WP_Widget::widget */
28
  function widget($args, $instance) {
29
+ $instance = array_merge($this->defaults, $instance);
30
  echo $args['before_widget'];
31
  echo $args['before_title'];
32
  echo $instance['title'];
61
 
62
  /** @see WP_Widget::update */
63
  function update($new_instance, $old_instance) {
64
+ foreach($this->defaults as $key => $value){
65
+ if( empty($new_instance[$key]) ){
66
+ $new_instance[$key] = $value;
67
+ }
68
+ }
69
+ return $new_instance;
 
 
 
 
 
 
 
70
  }
71
 
72
  /** @see WP_Widget::form */
73
  function form($instance) {
74
+ $instance = array_merge($this->defaults, $instance);
75
  ?>
76
  <p>
77
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>
widgets/em-locations.php CHANGED
@@ -4,14 +4,25 @@
4
  * Standard events list widget
5
  */
6
  class EM_Locations_Widget extends WP_Widget {
 
 
 
7
  /** constructor */
8
  function EM_Locations_Widget() {
 
 
 
 
 
 
 
9
  $widget_ops = array('description' => __( "Display a list of event locations on Events Manager.", 'dbem') );
10
  parent::WP_Widget(false, $name = 'Event Locations', $widget_ops);
11
  }
12
 
13
  /** @see WP_Widget::widget */
14
- function widget($args, $instance) {
 
15
  echo $args['before_widget'];
16
  echo $args['before_title'];
17
  echo $instance['title'];
@@ -40,14 +51,7 @@ class EM_Locations_Widget extends WP_Widget {
40
  /** @see WP_Widget::update */
41
  function update($new_instance, $old_instance) {
42
  //filter the new instance and replace blanks with defaults
43
- $defaults = array(
44
- 'title' => __('Event Locations','dbem'),
45
- 'scope' => 'future',
46
- 'order' => 'ASC',
47
- 'limit' => 5,
48
- 'format' => '#_LOCATIONLINK<ul><li>#_ADDRESS</li><li>#_TOWN</li></ul>'
49
- );
50
- foreach($defaults as $key => $value){
51
  if( empty($new_instance[$key]) ){
52
  $new_instance[$key] = $value;
53
  }
@@ -57,6 +61,7 @@ class EM_Locations_Widget extends WP_Widget {
57
 
58
  /** @see WP_Widget::form */
59
  function form($instance) {
 
60
  ?>
61
  <p>
62
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>
4
  * Standard events list widget
5
  */
6
  class EM_Locations_Widget extends WP_Widget {
7
+
8
+ var $defaults = array();
9
+
10
  /** constructor */
11
  function EM_Locations_Widget() {
12
+ $this->defaults = array(
13
+ 'title' => __('Event Locations','dbem'),
14
+ 'scope' => 'future',
15
+ 'order' => 'ASC',
16
+ 'limit' => 5,
17
+ 'format' => '#_LOCATIONLINK<ul><li>#_ADDRESS</li><li>#_TOWN</li></ul>'
18
+ );
19
  $widget_ops = array('description' => __( "Display a list of event locations on Events Manager.", 'dbem') );
20
  parent::WP_Widget(false, $name = 'Event Locations', $widget_ops);
21
  }
22
 
23
  /** @see WP_Widget::widget */
24
+ function widget($args, $instance) {
25
+ $instance = array_merge($this->defaults, $instance);
26
  echo $args['before_widget'];
27
  echo $args['before_title'];
28
  echo $instance['title'];
51
  /** @see WP_Widget::update */
52
  function update($new_instance, $old_instance) {
53
  //filter the new instance and replace blanks with defaults
54
+ foreach($this->defaults as $key => $value){
 
 
 
 
 
 
 
55
  if( empty($new_instance[$key]) ){
56
  $new_instance[$key] = $value;
57
  }
61
 
62
  /** @see WP_Widget::form */
63
  function form($instance) {
64
+ $instance = array_merge($this->defaults, $instance);
65
  ?>
66
  <p>
67
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>