Fix for CRM-15564
authorRohan Katkar <rohan.katkar@webaccessglobal.com>
Mon, 17 Nov 2014 05:31:21 +0000 (11:01 +0530)
committerRohan Katkar <rohan.katkar@webaccessglobal.com>
Mon, 17 Nov 2014 05:31:21 +0000 (11:01 +0530)
CRM/Event/Form/Registration.php

index fdac42ca8a623156e9bb6b6bdd04fad411a023ed..19237c3cfbf31dcb07165c0ab04b6a4fb8591e2f 100644 (file)
@@ -1407,12 +1407,16 @@ WHERE  v.option_group_id = g.id
     $endDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('registration_end_date',
         $this->_values['event']
       ));
+    $eventEndDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('event_end_date', $this->_values['event']));
     if (
       $endDate &&
       $endDate < $now
     ) {
       CRM_Core_Error::statusBounce(ts('Registration for this event ended on %1', array(1 => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('registration_end_date', $this->_values['event'])))), $redirect);
     }
+    if (!empty($eventEndDate) && $eventEndDate < $now) {
+      CRM_Core_Error::statusBounce(ts('Event ended on %1', array(1 => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('event_end_date', $this->_values['event'])))), $redirect);
+    }
   }
 }