Commit 5e8f3642 authored by mattwire's avatar mattwire
Browse files

Release 1.1

parent e113912e
......@@ -9,6 +9,8 @@
+--------------------------------------------------------------------+
*/
use CRM_AdvancedEvents_ExtensionUtil as E;
/**
* This class provides the functionality to delete a group of events.
* This class provides functionality for the actual deletion.
......@@ -24,7 +26,7 @@ class CRM_AdvancedEvents_Form_Task_CopyParticipants extends CRM_AdvancedEvents_F
public function preProcess() {
//check for edit participants
if (!CRM_Core_Permission::checkActionPermission('CiviEvent', CRM_Core_Action::UPDATE)) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
CRM_Core_Error::statusBounce(E::ts('You do not have permission to access this page.'));
}
parent::preProcess();
}
......@@ -57,11 +59,11 @@ class CRM_AdvancedEvents_Form_Task_CopyParticipants extends CRM_AdvancedEvents_F
else {
$this->_defaultSourceEvent = $eventHasParticipants;
}
$this->add('select', 'event_source_id', ts('Source Event to copy participants from: '),
$this->add('select', 'event_source_id', E::ts('Source Event to copy participants from: '),
$eventList,
TRUE
);
$this->addDefaultButtons(ts('Copy Participants'), 'done');
$this->addDefaultButtons(E::ts('Copy Participants'), 'done');
}
/**
......@@ -83,7 +85,7 @@ class CRM_AdvancedEvents_Form_Task_CopyParticipants extends CRM_AdvancedEvents_F
public function postProcess() {
$params = $this->exportValues();
if (empty($params['event_source_id'])) {
CRM_Core_Error::statusBounce('No source event found to copy participants from');
CRM_Core_Error::statusBounce(E::ts('No source event found to copy participants from'));
}
$sourceParticipants = civicrm_api3('Participant', 'get', [
......@@ -91,9 +93,10 @@ class CRM_AdvancedEvents_Form_Task_CopyParticipants extends CRM_AdvancedEvents_F
'options' => ['limit' => 0],
]);
if (empty($sourceParticipants['count'])) {
CRM_Core_Error::statusBounce('The source event has no participants');
CRM_Core_Error::statusBounce(E::ts('The source event has no participants'));
}
$participantAddedCount = 0;
foreach ($this->_eventIds as $eventId) {
if ($eventId == $params['event_source_id']) {
continue;
......@@ -119,14 +122,18 @@ class CRM_AdvancedEvents_Form_Task_CopyParticipants extends CRM_AdvancedEvents_F
$participant['event_id'] = $eventId;
$participant['register_date'] = date('YmdHis');
civicrm_api3('Participant', 'create', $participant);
$participantAddedCount++;
}
}
$eventCount = count($this->_eventIds) -1;
$participantCount = $sourceParticipants['count'];
$status = ts('%1 participants added to %2 events.', [1 => $participantCount, 2 => $eventCount]);
$status = E::ts('%1 participants added (or already added) to %2 events.', [
1 => $participantCount,
2 => $eventCount,
]);
CRM_Core_Session::setStatus($status, ts('Added'), 'info');
CRM_Core_Session::setStatus($status, E::ts('Added'), 'info');
}
}
Package: advanced-events
Copyright (C) 2020, Matthew Wire <mjw@mjw.pt>
Copyright (C) 2021, Matthew Wire <mjw@mjw.pt>
Licensed under the GNU Affero Public License 3.0 (below).
-------------------------------------------------------------------------------
......
......@@ -19,7 +19,7 @@ The extension is licensed under [AGPL-3.0](LICENSE.txt).
## Requirements
* PHP v7.2+
* CiviCRM 5.24+
* CiviCRM 5.35+
## Installation
......
......@@ -51,9 +51,19 @@ To find events by template: Events->Find (Events by template).
To manage event templates: Events->Event Templates.
## Tutorial
1. To create a series of events first set up a template for your event.
2. While creating it if you want to create your series at the same time as creating the template,
then you can create a bunch of events via the Repeat tab.
*But note that the 'repeat settings' (eg ever Monday for 6 weeks) do not get saved in the template*
3. If later you want to create a single event based on the template then you click on the `Create` on
the ui showing all the `Event Templates` but this does not give you the ability to make multiple events.
4. If you want to do that, eg to add a series for Tuesdays then you need to click `Edit` for the relevant
template and go back to the Repeat tab of the Event Template, and fire them off from that screen.
### Repeating Events
In order to manage repeating events, a template should be created for the event. Within these templates the Repeat functionality can be accessed and "extra" events can be added to the series, giving much better management of related events. It should be notes that this extension overrides the standard CiviCRM behaviour with repetition on the actual event itself to improve functionality.
In order to manage repeating events, a template should be created for the event. Within these templates the Repeat functionality can be accessed and "extra" events can be added to the series, giving much better management of related events. It should be notes that this extension overrides the standard CiviCRM behaviour with repetition on the actual event itself to improve functionality.
## Permissions
......
## Information
Releases use the following numbering system:
**{major}.{minor}.{incremental}**
* major: Major refactoring or rewrite - make sure you read and test very carefully!
* minor: Breaking change in some circumstances, or a new feature. Read carefully and make sure you understand the impact of the change.
* incremental: A "safe" change / improvement. Should *always* be safe to upgrade.
* **[BC]**: Items marked with [BC] indicate a breaking change that will require updates to your code if you are using that code in your extension.
## Release 1.1
* Fix [#3](https://lab.civicrm.org/extensions/civicrm-advanced-events/-/issues/3) Copy Participants breaks on update
* Fix [#4](https://lab.civicrm.org/extensions/civicrm-advanced-events/-/issues/4) The paginator doesn't work for Event Templates
* Improve documentation.
* Use font-awesome icons and helper available from CiviCRM 5.27
## Release 1.0.2
* Fix for repeating events by end date.
......
......@@ -15,11 +15,11 @@
<url desc="Release Notes">https://docs.civicrm.org/advancedevents/en/latest/releasenotes/</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-08-14</releaseDate>
<version>1.0.3-dev</version>
<develStage>beta</develStage>
<releaseDate>2021-03-31</releaseDate>
<version>1.1</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.28</ver>
<ver>5.35</ver>
</compatibility>
<comments>Advanced functionality for Events</comments>
<civix>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment