Skip to content
Permalink
Browse files

Merge pull request #5150 from ChurchCRM/bugfix/5149-event-types-bugfixes

Bugfix/5149 event types bugfixes
  • Loading branch information
crossan007 committed Feb 13, 2020
2 parents 12ed96d + 2a7f760 commit 78fbc12b112c7880c19405c6d6bfc66c1e904674
Showing with 12 additions and 9 deletions.
  1. +7 −0 propel/schema.xml
  2. +0 −1 react/interfaces/CRMEvent.ts
  3. +3 −5 src/EventEditor.php
  4. +1 −1 src/ListEvents.php
  5. +1 −2 src/api/routes/calendar/events.php
@@ -504,6 +504,13 @@
<column name="event_start" phpName="Start" type="TIMESTAMP" required="true"/>
<column name="event_end" phpName="End" type="TIMESTAMP" required="true"/>
<column name="inactive" phpName="InActive" type="INTEGER" size="1" required="true" defaultValue="0"/>
<!--
event_typename is deprecated, and should be removed with 4.1.0.
https://github.com/ChurchCRM/CRM/issues/5149
This field denormalizes the event type data by storing a string representation of the event type name
represented by the field in the event_types table having a foreign key relationship with this table's
event_type property. This denormalized event type name storage is unnecessary.
-->
<column name="event_typename" phpName="TypeName" type="VARCHAR" size="40" required="true" defaultValue=""/>
<column name="location_id" phpName="LocationId" type="INTEGER" required="true" defaultValue="0"/>
<column name="primary_contact_person_id" phpName="PrimaryContactPersonId" type="INTEGER" required="true" defaultValue="0"/>
@@ -7,7 +7,6 @@ interface CRMEvent {
Text?: string,
Type?: number,
Title?: string,
TypeName?: string,
LocationId?: number,
PrimaryContactPersonId?: number,
SecondaryContactPersonId?: number,
@@ -352,8 +352,7 @@
`event_text` = '".InputUtils::FilterHTML($sEventText)."',
`event_start` = '".InputUtils::LegacyFilterInput($sEventStart)."',
`event_end` = '".InputUtils::LegacyFilterInput($sEventEnd)."',
`inactive` = '".InputUtils::LegacyFilterInput($iEventStatus)."',
`event_typename` = '".InputUtils::LegacyFilterInput($sTypeName)."';";
`inactive` = '".InputUtils::LegacyFilterInput($iEventStatus)."';";
RunQuery($sSQL);
$iEventID = mysqli_insert_id($cnInfoCentral);
for ($c = 0; $c < $iNumCounts; $c++) {
@@ -376,9 +375,8 @@
`event_text` = '".InputUtils::FilterHTML($sEventText)."',
`event_start` = '".InputUtils::LegacyFilterInput($sEventStart)."',
`event_end` = '".InputUtils::LegacyFilterInput($sEventEnd)."',
`inactive` = '".InputUtils::LegacyFilterInput($iEventStatus)."',
`event_typename` = '".InputUtils::LegacyFilterInput($sTypeName)."'".
" WHERE `event_id` = '".InputUtils::LegacyFilterInput($iEventID)."';";
`inactive` = '".InputUtils::LegacyFilterInput($iEventStatus)."'
WHERE `event_id` = '".InputUtils::LegacyFilterInput($iEventID)."';";
echo $sSQL;
RunQuery($sSQL);
for ($c = 0; $c < $iNumCounts; $c++) {
@@ -176,7 +176,7 @@
extract($aRow);

$aEventID[$row] = $event_id;
$aEventType[$row] = $event_typename;
$aEventType[$row] = $type_name;
$aEventTitle[$row] = htmlentities(stripslashes($event_title), ENT_NOQUOTES, 'UTF-8');
$aEventDesc[$row] = htmlentities(stripslashes($event_desc), ENT_NOQUOTES, 'UTF-8');
$aEventText[$row] = htmlentities(stripslashes($event_text), ENT_NOQUOTES, 'UTF-8');
@@ -109,7 +109,6 @@ function getEventAudience($request, Response $response, $args)
function newEvent($request, $response, $args)
{
$input = (object)$request->getParsedBody();
$eventTypeName = "";

//fetch all related event objects before committing this event.
$type = EventTypeQuery::Create()
@@ -128,7 +127,7 @@ function newEvent($request, $response, $args)
// we have event type and pined calendars. now create the event.
$event = new Event;
$event->setTitle($input->Title);
$event->setType($type);
$event->setEventType($type);
$event->setDesc($input->Desc);
$event->setStart(str_replace("T", " ", $input->Start));
$event->setEnd(str_replace("T", " ", $input->End));

0 comments on commit 78fbc12

Please sign in to comment.
You can’t perform that action at this time.