WordPress.org

Plugin Directory

Changeset 684967


Ignore:
Timestamp:
03/20/13 22:49:13 (13 months ago)
Author:
liedekef
Message:

in the backend, you can now choose wether or not mails are being sent when approving or changing registrations

Location:
events-made-easy/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • events-made-easy/trunk/eme_rsvp.php

    r684945 r684967  
    275275 
    276276// the eme_book_seats can also be called from the admin backend, that's why for certain things, we check using is_admin where we are 
    277 function eme_book_seats($event) { 
     277function eme_book_seats($event, $send_mail=1) { 
    278278   global $current_user; 
    279279   $booking_id = 0; 
     
    384384               $action=""; 
    385385            } 
    386             eme_email_rsvp_booking($booking_id,$action); 
     386            if ($send_mail) eme_email_rsvp_booking($booking_id,$action); 
    387387 
    388388            // everything ok, so we unset the variables entered, so when the form is shown again, all is defaulted again 
     
    10221022      } else { 
    10231023         $action = isset($_POST ['action']) ? $_POST ['action'] : ''; 
     1024         $send_mail = isset($_POST ['send_mail']) ? intval($_POST ['send_mail']) : 1; 
    10241025 
    10251026         if ($action == 'addRegistration') { 
     
    10271028            $booking_payed = isset($_POST ['booking_payed']) ? intval($_POST ['booking_payed']) : 0; 
    10281029            $event = eme_get_event($event_id); 
    1029             $booking_res = eme_book_seats($event); 
     1030            $booking_res = eme_book_seats($event, $send_mail); 
    10301031            $result=$booking_res[0]; 
    10311032            $booking_id_done=$booking_res[1]; 
     
    10351036            else 
    10361037               print "<div id='message'>$result</p></div>"; 
    1037          } 
    1038  
    1039          $bookings = isset($_POST ['bookings']) ? $_POST ['bookings'] : array(); 
    1040          $selected_bookings = isset($_POST ['selected_bookings']) ? $_POST ['selected_bookings'] : array(); 
    1041          $bookings_seats = isset($_POST ['bookings_seats']) ? $_POST ['bookings_seats'] : array(); 
    1042          $bookings_payed = isset($_POST ['bookings_payed']) ? $_POST ['bookings_payed'] : array(); 
    1043          foreach ( $bookings as $key=>$booking_id ) { 
    1044             if (!in_array($booking_id,$selected_bookings)) { 
    1045                continue; 
    1046             } 
    1047             // make sure the seats are integers 
    1048             $bookings_seats[$key]=intval($bookings_seats[$key]); 
    1049             $booking = eme_get_booking ($booking_id); 
    1050             if ($action == 'approveRegistration') { 
    1051                if ($booking['booking_payed']!= intval($bookings_payed[$key])) 
    1052                   eme_update_booking_payed($booking_id,intval($bookings_payed[$key])); 
    1053                if ($booking['booking_seats']!= $bookings_seats[$key]) { 
    1054                   eme_update_booking_seats($booking_id,$bookings_seats[$key]); 
    1055                   eme_email_rsvp_booking($booking_id,$action); 
     1038         } elseif ($action == 'approveRegistration' || $action == 'denyRegistration') { 
     1039            $bookings = isset($_POST ['bookings']) ? $_POST ['bookings'] : array(); 
     1040            $selected_bookings = isset($_POST ['selected_bookings']) ? $_POST ['selected_bookings'] : array(); 
     1041            $bookings_seats = isset($_POST ['bookings_seats']) ? $_POST ['bookings_seats'] : array(); 
     1042            $bookings_payed = isset($_POST ['bookings_payed']) ? $_POST ['bookings_payed'] : array(); 
     1043            foreach ( $bookings as $key=>$booking_id ) { 
     1044               if (!in_array($booking_id,$selected_bookings)) { 
     1045                  continue; 
    10561046               } 
    1057             } elseif ($action == 'denyRegistration') { 
    1058                eme_email_rsvp_booking($booking_id,$action); 
    1059                eme_delete_booking($booking_id); 
     1047               // make sure the seats are integers 
     1048               $bookings_seats[$key]=intval($bookings_seats[$key]); 
     1049               $booking = eme_get_booking ($booking_id); 
     1050               if ($action == 'approveRegistration') { 
     1051                  if ($booking['booking_payed']!= intval($bookings_payed[$key])) 
     1052                     eme_update_booking_payed($booking_id,intval($bookings_payed[$key])); 
     1053                  if ($booking['booking_seats']!= $bookings_seats[$key]) { 
     1054                     eme_update_booking_seats($booking_id,$bookings_seats[$key]); 
     1055                     if ($send_mail) eme_email_rsvp_booking($booking_id,$action); 
     1056                  } 
     1057               } elseif ($action == 'denyRegistration') { 
     1058                  if ($send_mail) eme_email_rsvp_booking($booking_id,$action); 
     1059                  eme_delete_booking($booking_id); 
     1060               } 
    10601061            } 
    10611062         } 
     
    11021103   </tbody> 
    11031104   </table> 
     1105   <p> 
     1106   <?php _e('Send mails for new registration?','eme'); echo eme_ui_select_binary(1,"send_mail"); ?> 
     1107   </p> 
    11041108   <input id="post-query-submit" class="button-secondary" type="submit" value="<?php _e ( 'Register booking' )?>" /> 
    11051109   </form> 
     
    11101114   <input type='hidden' name='page' value='eme-registration-seats' /> 
    11111115   <div class="tablenav"> 
    1112  
    11131116   <div class="alignleft actions"> 
    11141117   <select name="action"> 
     
    11361139   <input id="post-query-submit" class="button-secondary" type="submit" value="<?php _e ( 'Filter' )?>" /> 
    11371140   </div> 
    1138    <div class="clear"></div> 
     1141   <div class="clear"><p> 
     1142   <?php _e('Send mails to attendees upon changes being made?','eme'); echo eme_ui_select_binary(1,"send_mail"); ?> 
     1143   </p></div> 
    11391144   <table class="widefat"> 
    11401145   <thead> 
     
    12361241      $bookings_seats = isset($_POST ['bookings_seats']) ? $_POST ['bookings_seats'] : array(); 
    12371242      $bookings_payed = isset($_POST ['bookings_payed']) ? $_POST ['bookings_payed'] : array(); 
     1243      $send_mail = isset($_POST ['send_mail']) ? intval($_POST ['send_mail']) : 1; 
    12381244      foreach ( $pending_bookings as $key=>$booking_id ) { 
    12391245         if (!in_array($booking_id,$selected_bookings)) { 
     
    12531259               eme_update_booking_seats($booking_id,intval($bookings_seats[$key])); 
    12541260            } 
    1255             eme_email_rsvp_booking($booking_id,$action); 
     1261            if ($send_mail) eme_email_rsvp_booking($booking_id,$action); 
    12561262         } elseif ($action == 'denyRegistration') { 
    1257             eme_email_rsvp_booking($booking_id,$action); 
     1263            if ($send_mail) eme_email_rsvp_booking($booking_id,$action); 
    12581264            eme_delete_booking($booking_id); 
    12591265         } 
     
    12751281   <input type='hidden' name='page' value='eme-registration-approval' /> 
    12761282   <div class="tablenav"> 
    1277  
    12781283   <div class="alignleft actions"> 
    12791284   <select name="action"> 
     
    13011306   <input id="post-query-submit" class="button-secondary" type="submit" value="<?php _e ( 'Filter' )?>" /> 
    13021307   </div> 
    1303    <div class="clear"></div> 
     1308   <div class="clear"><p> 
     1309   <?php _e('Send mails to attendees upon changes being made?','eme'); echo eme_ui_select_binary(1,"send_mail"); ?> 
     1310   </p></div> 
    13041311   <table class="widefat"> 
    13051312   <thead> 
  • events-made-easy/trunk/readme.txt

    r683421 r684967  
    119119* Improvement: when editing a single event, delete buttons to edit the event and/or recurrence are now there (and asked for confirmation) 
    120120* Improvement: when trying to view a non-existing location, now also a 404 is returned (as for events) 
     121* Improvement: in the backend, you can now choose wether or not mails are being sent when approving or changing registrations 
    121122* Bugfix: for recurrent events, the wanted date/time format was not being taken into account when being shown in the admin interface or when using #_RECURRENTDESC 
    122123* Bugfix: #_EVENTDETAILS has never been working (#_NOTES and #_DETAILS did work ok) 
Note: See TracChangeset for help on using the changeset viewer.