Commit efb79113 authored by jaapjansma's avatar jaapjansma

Add configuration option for visibility

parent bd38ef15
......@@ -31,8 +31,10 @@ class Create extends AbstractAction {
* @return SpecificationBag
*/
public function getConfigurationSpecification() {
$visibilityOptions = \CRM_Contact_DAO_Group::buildOptions('visibility');
return new SpecificationBag([
new OptionGroupSpecification('group_type','group_type', E::ts('Group type'), FALSE),
new Specification('visibility','String', E::ts('Visibility'), FALSE, null, null, $visibilityOptions),
]);
}
......@@ -103,6 +105,9 @@ class Create extends AbstractAction {
if ($this->configuration->doesParameterExists('group_type')) {
$groupApiParams['group_type'] = $this->configuration->getParameter('group_type');
}
if ($this->configuration->doesParameterExists('visibility')) {
$groupApiParams['visibility'] = $this->configuration->getParameter('visibility');
}
foreach($this->getParameterSpecification() as $spec) {
if (stripos($spec->getName(), 'custom_')!==0) {
continue;
......
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