protected function parseData($data)
 {
     $this->id = intval($data['id']);
     $this->title = $data['title'];
     $this->type = $data['grouptype'];
     $this->is_master = ky_assure_bool($data['ismaster']);
 }
 protected function parseData($data)
 {
     $this->id = ky_assure_positive_int($data['id']);
     $this->template_group_id = ky_assure_positive_int($data['tgroupid']);
     $this->user_id = ky_assure_positive_int($data['userid']);
     $this->email = ky_assure_string($data['email']);
     $this->is_validated = ky_assure_bool($data['isvalidated']);
     $this->user_group_id = ky_assure_positive_int($data['usergroupid']);
 }
 /**
  * Sets whether to ignore (disable) autoresponder e-mail.
  *
  * @param bool $ignore_auto_responder Whether to ignore (disable) autoresponder e-mail.
  * @return kyTicket
  */
 public function setIgnoreAutoResponder($ignore_auto_responder)
 {
     $this->ignore_auto_responder = ky_assure_bool($ignore_auto_responder);
     return $this;
 }
Example #4
0
 /**
  * Sets whether Daylight Saving Time is enabled for the staff user.
  * True is the default value when creating new staff user.
  *
  * @param bool $enable_dst True to enable Daylight Saving Time for the staff user. False to disable.
  * @return kyStaff
  */
 public function setEnableDST($enable_dst)
 {
     $this->enable_dst = ky_assure_bool($enable_dst);
     return $this;
 }
Example #5
0
 protected function parseData($data)
 {
     $this->id = intval($data['_attributes']['id']);
     $this->flag_type = intval($data['_attributes']['flagtype']);
     $this->display_id = $data['displayid'];
     $this->department_id = ky_assure_positive_int($data['departmentid']);
     $this->status_id = ky_assure_positive_int($data['statusid']);
     $this->priority_id = ky_assure_positive_int($data['priorityid']);
     $this->type_id = ky_assure_positive_int($data['typeid']);
     $this->user_id = ky_assure_positive_int($data['userid']);
     $this->user_organization_name = $data['userorganization'];
     $this->user_organization_id = ky_assure_positive_int($data['userorganizationid']);
     $this->owner_staff_id = ky_assure_positive_int($data['ownerstaffid']);
     $this->owner_staff_name = $data['ownerstaffname'];
     $this->full_name = $data['fullname'];
     $this->email = $data['email'];
     $this->last_replier = $data['lastreplier'];
     $this->subject = $data['subject'];
     $this->creation_time = ky_assure_positive_int($data['creationtime']);
     $this->last_activity = ky_assure_positive_int($data['lastactivity']);
     $this->last_staff_reply = ky_assure_positive_int($data['laststaffreply']);
     $this->last_user_reply = ky_assure_positive_int($data['lastuserreply']);
     $this->sla_plan_id = ky_assure_positive_int($data['slaplanid']);
     $this->next_reply_due = ky_assure_positive_int($data['nextreplydue']);
     $this->resolution_due = ky_assure_positive_int($data['resolutiondue']);
     $this->replies = intval($data['replies']);
     $this->ip_address = $data['ipaddress'];
     $this->creator = intval($data['creator']);
     $this->creation_mode = intval($data['creationmode']);
     $this->creation_type = intval($data['creationtype']);
     $this->is_escalated = ky_assure_bool($data['isescalated']);
     $this->escalation_rule_id = ky_assure_positive_int($data['escalationruleid']);
     $this->template_group_id = ky_assure_positive_int($data['templategroupid']);
     $this->tags = $data['tags'];
     $this->watchers = array();
     if (array_key_exists('watcher', $data)) {
         foreach ($data['watcher'] as $watcher) {
             $this->watchers[] = array('staff_id' => intval($watcher['_attributes']['staffid']), 'name' => $watcher['_attributes']['name']);
         }
     }
     $this->workflows = array();
     if (array_key_exists('workflow', $data)) {
         foreach ($data['workflow'] as $workflow) {
             $this->workflows[] = array('id' => intval($workflow['_attributes']['id']), 'title' => $workflow['_attributes']['title']);
         }
     }
     /**
      * Notes and time tracks.
      */
     if (array_key_exists('note', $data)) {
         foreach ($data['note'] as $note_data) {
             /*
              * Includes workaround for old format of TimeTrack object - if "timeworked" key is present than it's a time track.
              */
             if ($note_data['_attributes']['type'] === 'timetrack' || array_key_exists('timeworked', $note_data['_attributes'])) {
                 if ($this->time_tracks === null) {
                     $this->time_tracks = array();
                 }
                 $this->time_tracks[] = new kyTicketTimeTrack($note_data);
             } else {
                 if ($this->notes === null) {
                     $this->notes = array();
                 }
                 $this->notes[] = new kyTicketNote($note_data);
             }
         }
     }
     /**
      * Posts.
      */
     if (array_key_exists('posts', $data)) {
         $this->posts = array();
         foreach ($data['posts'][0]['post'] as $post_data) {
             $this->posts[] = new kyTicketPost($post_data);
         }
     }
 }
Example #6
0
 /**
  * Sets whether to send welcome email to new user.
  *
  * @param bool $send_welcome_email True, to send welcome email to new user. False, otherwise.
  * @return kyUser
  */
 public function setSendWelcomeEmail($send_welcome_email)
 {
     $this->send_welcome_email = ky_assure_bool($send_welcome_email);
     return $this;
 }
 /**
  * Sets wheter to restrict visibility of this news item to particular staff groups.
  * Use setStaffGroupIds to set these groups using identifiers or addStaffGroup to set them using objects.
  * Automatically clears staff groups when set to false.
  *
  * @param bool $staff_visibility_custom True to restrict visibility of this news item to particular staff groups. False otherwise.
  * @return kyNewsItem
  */
 public function setStaffVisibilityCustom($staff_visibility_custom)
 {
     $this->staff_visibility_custom = ky_assure_bool($staff_visibility_custom);
     if ($this->staff_visibility_custom === false) {
         $this->staff_group_ids = array();
         $this->staff_groups = null;
     }
     return $this;
 }
 /**
  * Sets whether staff members assigned to this group are Administrators.
  *
  * @param bool $is_admin True, if you want staff members assigned to this group to be Administrators. False (default), otherwise.
  * @return kyStaffGroup
  */
 public function setIsAdmin($is_admin)
 {
     $this->is_admin = ky_assure_bool($is_admin);
     return $this;
 }
 /**
  * Sets wheter to restrict visibility of this department to particular user groups.
  * Use setUserGroupIds to set these groups using identifiers or addUserGroup to set them using objects.
  * Automatically clears user groups when set to false.
  *
  * @param bool $user_visibility_custom True to restrict visibility of this department to particular user groups. False otherwise.
  * @return kyDepartment
  */
 public function setUserVisibilityCustom($user_visibility_custom)
 {
     $this->user_visibility_custom = ky_assure_bool($user_visibility_custom);
     if ($this->user_visibility_custom === false) {
         $this->user_group_ids = array();
         $this->user_groups = null;
     }
     return $this;
 }
 /**
  * Sets whether clients are permitted to comment on this knowledgebase article.
  *
  * @param bool $allow_comments True to allow clients to comment on this knowledgebase article item.
  * @return kyKnowledgebaseCategory
  */
 public function setAllowComments($allow_comments)
 {
     $this->allow_comments = ky_assure_bool($allow_comments);
     return $this;
 }
 /**
  * Sets the parameter enableTicketRedirection of this Troubleshooterstep item.
  *
  * @param bool $enab_ticket_redirect True to allow ticket creation.
  * @return kyTroubleshooterStep
  */
 public function setEnableTicketRedirection($enab_ticket_redirect)
 {
     $this->enable_ticket_redirection = ky_assure_bool($enab_ticket_redirect);
     return $this;
 }
 /**
  * Sets whether the ticket post should be created as private (hidden from the customer) or not.
  *
  * @param bool $is_private Whether the ticket post should be created as private (hidden from the customer) or not.
  * @return kyTicketPost
  */
 public function setIsPrivate($is_private)
 {
     $this->is_private = ky_assure_bool($is_private);
     return $this;
 }
Example #13
0
 protected function parseData($data)
 {
     $this->id = intval($data['id']);
     $this->ticket_id = ky_assure_positive_int($data['ticketid']);
     $this->dateline = ky_assure_positive_int($data['dateline']);
     $this->user_id = ky_assure_positive_int($data['userid']);
     $this->full_name = $data['fullname'];
     $this->email = $data['email'];
     $this->email_to = $data['emailto'];
     $this->ip_address = $data['ipaddress'];
     $this->has_attachments = ky_assure_bool($data['hasattachments']);
     $this->creator = intval($data['creator']);
     $this->is_third_party = ky_assure_bool($data['isthirdparty']);
     $this->is_html = ky_assure_bool($data['ishtml']);
     $this->is_emailed = ky_assure_bool($data['isemailed']);
     $this->staff_id = ky_assure_positive_int($data['staffid']);
     $this->is_survey_comment = ky_assure_bool($data['issurveycomment']);
     $this->contents = $data['contents'];
 }
 protected function parseData($data)
 {
     $this->id = intval($data['id']);
     $this->title = $data['title'];
     $this->display_order = intval($data['displayorder']);
     $this->department_id = ky_assure_positive_int($data['departmentid']);
     $this->display_icon = $data['displayicon'];
     $this->type = $data['type'];
     $this->mark_as_resolved = ky_assure_bool($data['markasresolved']);
     $this->display_count = ky_assure_bool($data['displaycount']);
     $this->status_color = $data['statuscolor'];
     $this->status_bg_color = $data['statusbgcolor'];
     $this->reset_due_time = ky_assure_bool($data['resetduetime']);
     $this->trigger_survey = ky_assure_bool($data['triggersurvey']);
     $this->staff_visibility_custom = ky_assure_bool($data['staffvisibilitycustom']);
     if ($this->staff_visibility_custom && is_array($data['staffgroupid'])) {
         foreach ($data['staffgroupid'] as $staff_group_id) {
             $this->staff_group_ids[] = intval($staff_group_id);
         }
     }
 }
 protected function parseData($data)
 {
     $this->id = intval($data['id']);
     $this->title = $data['title'];
     $this->display_order = intval($data['displayorder']);
     $this->fr_color_code = $data['frcolorcode'];
     $this->bg_color_code = $data['bgcolorcode'];
     $this->type = $data['type'];
     $this->user_visibility_custom = ky_assure_bool($data['uservisibilitycustom']);
     if ($this->user_visibility_custom && is_array($data['usergroupid'])) {
         foreach ($data['usergroupid'] as $user_group_id) {
             $this->user_group_ids[] = intval($user_group_id);
         }
     }
 }
 protected function parseData($data)
 {
     $this->id = intval($data['id']);
     $this->title = $data['title'];
     $this->display_order = intval($data['displayorder']);
     $this->department_id = ky_assure_positive_int($data['departmentid']);
     $this->display_icon = $data['displayicon'];
     $this->type = $data['type'];
     $this->user_visibility_custom = ky_assure_bool($data['uservisibilitycustom']);
     if ($this->user_visibility_custom && is_array($data['usergroupid'])) {
         foreach ($data['usergroupid'] as $user_group_id) {
             $this->user_group_ids[] = intval($user_group_id);
         }
     }
 }