Commit 195edece authored by jaapjansma's avatar jaapjansma

Added update activity status action

parent cb5196ab
Version 1.2
===========
** Renamed actions**
**Renamed actions**
* Renamed the Create/Update Group action from Create to GroupCreate. If you are using the _Create/Update Group_ action you have to reconfigure it.
** Other Major changes **
**Other Major changes**
* Refactor of the action provider, so that list of available actions only contains the title, name and not the instaciated class (with all the loaded configuration, such as groups, option values etc..)
* Create Address actions now also contains parameters for street name, housenumber and housenumber suffix
* Added OptionGroupByNameSpecification for parameter and configuration specification where the name of the option value is used rather than the value.
** New actions**
**New actions**
* Create Contribution
* Send E-mail
......@@ -22,5 +22,5 @@ Version 1.2
* Get e-mail address of an contact
* Find Individual by Name and Email address
* Get Relationship
* Update Activity Status
<?php
/**
* @author Jaap Jansma <jaap.jansma@civicoop.org>
* @license AGPL-3.0
*/
namespace Civi\ActionProvider\Action\Activity;
use Civi\ActionProvider\Action\AbstractAction;
use Civi\ActionProvider\Parameter\OptionGroupByNameSpecification;
use Civi\ActionProvider\Parameter\ParameterBagInterface;
use Civi\ActionProvider\Parameter\Specification;
use Civi\ActionProvider\Parameter\SpecificationBag;
use Civi\ActionProvider\Utils\CustomField;
use CRM_ActionProvider_ExtensionUtil as E;
class UpdateActivityStatus extends AbstractAction {
/**
* Returns the specification of the configuration options for the actual
* action.
*
* @return SpecificationBag
*/
public function getConfigurationSpecification() {
return new SpecificationBag([]);
}
/**
* Returns the specification of the parameters of the actual action.
*
* @return SpecificationBag
*/
public function getParameterSpecification() {
$bag = new SpecificationBag([
new Specification('id', 'Integer', E::ts('Activity ID'), false),
new Specification('status_id', 'Integer', E::ts('Status ID'), false),
]);
return $bag;
}
/**
* Returns the specification of the output parameters of this action.
*
* This function could be overriden by child classes.
*
* @return SpecificationBag
*/
public function getOutputSpecification() {
return new SpecificationBag(array());
}
/**
* Run the action
*
* @param ParameterBagInterface $parameters
* The parameters to this action.
* @param ParameterBagInterface $output
* The parameters this action can send back
* @return void
* @throws \Exception
*/
protected function doAction(ParameterBagInterface $parameters, ParameterBagInterface $output) {
// Get the contact and the event.
$activityParams['id'] = $parameters->getParameter('id');
$activityParams['status_id'] = $parameters->getParameter('status_id');
try {
// Do not use api as the api checks for an existing relationship.
civicrm_api3('Activity', 'Create', $activityParams);
} catch (\Exception $e) {
// Do nothing.
}
}
}
\ No newline at end of file
......@@ -133,6 +133,10 @@ class Provider {
AbstractAction::DATA_MANIPULATION_TAG,
AbstractAction::MULTIPLE_CONTACTS_ACTION_TAG
));
$this->addActionWithoutFiltering('UpdateActivityStatus', '\Civi\ActionProvider\Action\Activity\UpdateActivityStatus',E::ts('Update activity status') , array(
AbstractAction::DATA_MANIPULATION_TAG,
AbstractAction::WITHOUT_CONTACT_ACTION_TAG
));
$this->addActionWithoutFiltering('DeleteActivity', '\Civi\ActionProvider\Action\Activity\DeleteActivity', E::ts('Delete activity'), array(
AbstractAction::DATA_MANIPULATION_TAG,
AbstractAction::MULTIPLE_CONTACTS_ACTION_TAG
......
......@@ -14,7 +14,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2019-01-09</releaseDate>
<version>1.2</version>
<version>1.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>4.7</ver>
......
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