Skip to content

Commit

Permalink
Merge pull request #76 from pipedrive/GRAL-3222
Browse files Browse the repository at this point in the history
GRAL-3222 - busyFlag is not supported for adding/updating activity
  • Loading branch information
estevanjantsk committed Oct 7, 2022
2 parents 54a216b + 8346485 commit 1c7719d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function addAnActivity($options)
|-----------|------|-------------|
| subject | ``` Required ``` | Subject of the activity |
| type | ``` Required ``` | Type of the activity. This is in correlation with the key_string parameter of ActivityTypes. |
| done | ``` Optional ``` | TODO: Add a parameter description |
| done | ``` Optional ``` | Whether the activity is done or not. 0 = Not done, 1 = Done |
| dueDate | ``` Optional ``` | Due date of the activity. Format: YYYY-MM-DD |
| dueTime | ``` Optional ``` | Due time of the activity in UTC. Format: HH:MM |
| duration | ``` Optional ``` | Duration of the activity. Format: HH:MM |
Expand All @@ -432,6 +432,7 @@ function addAnActivity($options)
| participants | ``` Optional ``` | List of multiple persons (participants) this activity will be associated with. If omitted, single participant from person_id field is used. It requires a structure as follows: [{"person_id":1,"primary_flag":true}] |
| orgId | ``` Optional ``` | ID of the organization this activity will be associated with |
| note | ``` Optional ``` | Note of the activity (HTML format) |
| busyFlag | ``` Optional ``` | Set the activity as 'Busy' or 'Free'. If the flag is set to true, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with null. When the value of the flag is unset (null), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. Format: true/false |



Expand Down Expand Up @@ -474,6 +475,8 @@ $collect['orgId'] = $orgId;
$note = 'note';
$collect['note'] = $note;

$busyFlag = true;
$collect['busyFlag'] = $busyFlag;

$activities->addAnActivity($collect);

Expand Down Expand Up @@ -560,6 +563,7 @@ function updateEditAnActivity($options)
| participants | ``` Optional ``` | List of multiple persons (participants) this activity will be associated with. If omitted, single participant from person_id field is used. It requires a structure as follows: [{"person_id":1,"primary_flag":true}] |
| orgId | ``` Optional ``` | ID of the organization this activity will be associated with |
| note | ``` Optional ``` | Note of the activity (HTML format) |
| busyFlag | ``` Optional ``` | Set the activity as 'Busy' or 'Free'. If the flag is set to true, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with null. When the value of the flag is unset (null), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. Format: true/false |



Expand Down
10 changes: 6 additions & 4 deletions src/Controllers/ActivitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,17 @@ public function addAnActivity(
$_parameters = array (
'subject' => $this->val($options, 'subject'),
'type' => $this->val($options, 'type'),
'done' => APIHelper::prepareFormFields($this->val($options, 'done')),
'due_date' => DateTimeHelper::toSimpleDate($this->val($options, 'dueDate')),
'done' => APIHelper::prepareFormFields($this->val($options, 'done')),
'due_date' => DateTimeHelper::toSimpleDate($this->val($options, 'dueDate')),
'due_time' => $this->val($options, 'dueTime'),
'duration' => $this->val($options, 'duration'),
'user_id' => $this->val($options, 'userId'),
'deal_id' => $this->val($options, 'dealId'),
'person_id' => $this->val($options, 'personId'),
'participants' => $this->val($options, 'participants'),
'org_id' => $this->val($options, 'orgId'),
'note' => $this->val($options, 'note')
'note' => $this->val($options, 'note'),
'busy_flag' => $this->val($options, 'busyFlag')
);

//call on-before Http callback
Expand Down Expand Up @@ -431,7 +432,8 @@ public function updateEditAnActivity(
'person_id' => $this->val($options, 'personId'),
'participants' => $this->val($options, 'participants'),
'org_id' => $this->val($options, 'orgId'),
'note' => $this->val($options, 'note')
'note' => $this->val($options, 'note'),
'busy_flag' => $this->val($options, 'busyFlag')
);

//call on-before Http callback
Expand Down

0 comments on commit 1c7719d

Please sign in to comment.