process event data (urls, start date, status)
This commit is contained in:
parent
01004ed9b6
commit
19ddbb4ec4
3 changed files with 78 additions and 31 deletions
|
@ -226,19 +226,26 @@ class TwingleEvent extends Campaign {
|
|||
|
||||
if ($direction == self::IN) {
|
||||
|
||||
// Change timestamp into DateTime string
|
||||
// Change timestamps into DateTime strings
|
||||
if ($values['updated_at']) {
|
||||
$values['updated_at'] =
|
||||
self::getDateTime($values['updated_at']);
|
||||
}
|
||||
|
||||
if ($values['confirmed_at']) {
|
||||
$values['confirmed_at'] =
|
||||
self::getDateTime($values['confirmed_at']);
|
||||
$values['status_id'] = 'In Progress';
|
||||
}
|
||||
else {
|
||||
$values['status_id'] = 'Planned';
|
||||
}
|
||||
|
||||
if ($values['created_at']) {
|
||||
$values['created_at'] =
|
||||
self::getDateTime($values['created_at']);
|
||||
}
|
||||
|
||||
if ($values['user_name']) {
|
||||
$values['user_name'] = $this->matchContact(
|
||||
$values['user_name'],
|
||||
|
@ -246,6 +253,19 @@ class TwingleEvent extends Campaign {
|
|||
);
|
||||
}
|
||||
|
||||
// Set campaign status
|
||||
if ($values['deleted']) {
|
||||
$values['status_id'] = 'Cancelled';
|
||||
}
|
||||
|
||||
// Set URLs
|
||||
if (is_array($values['urls'])) {
|
||||
$values['url_internal'] = $values['urls']['show_internal'];
|
||||
$values['url_external'] = $values['urls']['show_external'];
|
||||
$values['url_edit_internal'] = $values['urls']['edit_internal'];
|
||||
$values['url_edit_external'] = $values['urls']['edit_internal'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
elseif ($direction == self::OUT) {
|
||||
|
|
|
@ -117,21 +117,6 @@
|
|||
"help_post": "Choose the project type. Allow users to create own events or to pay a membership fee.",
|
||||
"default_value": "default"
|
||||
},
|
||||
"twingle_project_project_target": {
|
||||
"custom_group_id": "Twingle_Project_Information",
|
||||
"label": "Twingle Project target",
|
||||
"name": "twingle_project_project_target",
|
||||
"is_required": 0,
|
||||
"is_searchable": 1,
|
||||
"data_type": "Money",
|
||||
"html_type": "Text",
|
||||
"text_length": 32,
|
||||
"is_active": 1,
|
||||
"is_view": 0,
|
||||
"weight": 7,
|
||||
"help_post": "Donation target of the Project",
|
||||
"default_value": "0"
|
||||
},
|
||||
"twingle_project_allow_more": {
|
||||
"custom_group_id": "Twingle_Project_Information",
|
||||
"label": "Twingle Project allow more",
|
||||
|
@ -327,19 +312,6 @@
|
|||
"is_view": 1,
|
||||
"weight": 6
|
||||
},
|
||||
"twingle_event_target": {
|
||||
"custom_group_id": "Twingle_Event_Information",
|
||||
"label": "Twingle Event Target",
|
||||
"name": "twingle_event_target",
|
||||
"is_required": 0,
|
||||
"is_searchable": 0,
|
||||
"data_type": "String",
|
||||
"html_type": "Text",
|
||||
"text_length": 10,
|
||||
"is_active": 1,
|
||||
"is_view": 1,
|
||||
"weight": 6
|
||||
},
|
||||
"twingle_event_is_public": {
|
||||
"custom_group_id": "Twingle_Event_Information",
|
||||
"label": "Twingle Event is public",
|
||||
|
@ -402,6 +374,58 @@
|
|||
"is_active": 1,
|
||||
"is_view": 1,
|
||||
"weight": 11
|
||||
},
|
||||
"twingle_event_url_internal": {
|
||||
"custom_group_id": "Twingle_Event_Information",
|
||||
"label": "Twingle Event Internal URL",
|
||||
"name": "twingle_event_url_internal",
|
||||
"is_required": 0,
|
||||
"is_searchable": 0,
|
||||
"data_type": "String",
|
||||
"html_type": "Text",
|
||||
"text_length": 256,
|
||||
"is_active": 1,
|
||||
"is_view": 1,
|
||||
"weight": 12
|
||||
},
|
||||
"twingle_event_url_external": {
|
||||
"custom_group_id": "Twingle_Event_Information",
|
||||
"label": "Twingle Event External URL",
|
||||
"name": "twingle_event_url_external",
|
||||
"is_required": 0,
|
||||
"is_searchable": 0,
|
||||
"data_type": "String",
|
||||
"html_type": "Text",
|
||||
"text_length": 256,
|
||||
"is_active": 1,
|
||||
"is_view": 1,
|
||||
"weight": 13
|
||||
},
|
||||
"twingle_event_url_edit_internal": {
|
||||
"custom_group_id": "Twingle_Event_Information",
|
||||
"label": "Twingle Event Edit Internal URL",
|
||||
"name": "twingle_event_url_edit_internal",
|
||||
"is_required": 0,
|
||||
"is_searchable": 0,
|
||||
"data_type": "String",
|
||||
"html_type": "Text",
|
||||
"text_length": 256,
|
||||
"is_active": 1,
|
||||
"is_view": 1,
|
||||
"weight": 14
|
||||
},
|
||||
"twingle_event_url_edit_external": {
|
||||
"custom_group_id": "Twingle_Event_Information",
|
||||
"label": "Twingle Event Edit External URL",
|
||||
"name": "twingle_event_url_edit_external",
|
||||
"is_required": 0,
|
||||
"is_searchable": 0,
|
||||
"data_type": "String",
|
||||
"html_type": "Text",
|
||||
"text_length": 256,
|
||||
"is_active": 1,
|
||||
"is_view": 1,
|
||||
"weight": 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
{
|
||||
"TwingleProject": {
|
||||
"name": "title",
|
||||
"last_update": "last_modified_date"
|
||||
"last_update": "last_modified_date",
|
||||
"project_target": "goal_revenue"
|
||||
},
|
||||
"TwingleEvent": {
|
||||
"description": "title",
|
||||
"updated_at": "last_modified_date"
|
||||
"updated_at": "last_modified_date",
|
||||
"created_at": "start_date",
|
||||
"target": "goal_revenue"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue