Hermes_Ajax_Application_Handler
extends Horde_Core_Ajax_Application_Handler
in package
Defines the AJAX actions used in Hermes.
Copyright 2012-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Tags
Table of Contents
- addTimer() : array<string|int, mixed>
- Add a new timer. Expects the following in $this->vars: - desc: The timer description.
- createJobType() : int
- Create a new jobtype. Takes the following from $this->vars: - name: (string) They type name.
- deleteDeliverable() : mixed
- deleteJobType() : mixed
- Delete a jobtype. Takes the following in $this->vars: - id: The jobtype id to delete.
- deleteSlice() : bool
- Remove a slice. Expects the following in $this->vars: - id: The slice ids
- enterTime() : array<string|int, mixed>
- Enter a new time slice.
- getDeliverableDetail() : mixed
- listDeliverables() : mixed
- Get the list of Hermes-only deliverables for the requested client.
- listDeliverablesSelect() : array<string|int, mixed>
- Get a list of client deliverables suitable for building a select list.
- listJobTypes() : array<string|int, mixed>
- Return descriptions of job types. If $this->vars->id is present it is used to filter by the requested id.
- listTimers() : array<string|int, mixed>
- Return the current list of timers.
- loadSlices() : array<string|int, mixed>
- Fetch a collection of time slices. For now, just allows a search for all of a single employees time. Either submitted or not submitted.
- pauseTimer() : bool
- Pause a timer. Expects the following data in $this->vars: - t: The timer id
- poll() : array<string|int, mixed>
- Poll the server. Currently also returns the list of current timer data so the UI can be updated periodically.
- search() : array<string|int, mixed>
- Perform a slice search.
- startTimer() : bool|array<string|int, mixed>
- Restart a paused timer. Expects the following data in $this->vars: - t: The timer id.
- stopTimer() : array<string|int, mixed>
- Stop a timer. Expects the following in $this->vars: - t: The timer id.
- submitSlices() : bool
- Mark slices as submitted. Expects the following in $this->vars: - items: The slice ids to submit.
- updateDeliverable() : mixed
- Create a new deliverable. Takes the following in $this->vars: - deliverable_id: The id of the deliverable if editing.
- updateJobType() : bool
- Update an existing jobtype. Takes the following from $this->vars: - id: (integer) The type id of the exsting type.
- updateSlice() : array<string|int, mixed>
- Update a slice.
- _readSearchForm() : mixed
- Reads the search form submitted and return the search criteria
Methods
addTimer()
Add a new timer. Expects the following in $this->vars: - desc: The timer description.
public
addTimer() : array<string|int, mixed>
- client_id:
- deliverable_id:
- jobtype_id:
Return values
array<string|int, mixed> —An array with an 'id' key.
createJobType()
Create a new jobtype. Takes the following from $this->vars: - name: (string) They type name.
public
createJobType() : int
- billable: (boolean) Is this type billable?
- enabled: (boolean) Is this type enabled?
- rate: (double) The default hourly rate to use for this type.
Return values
int —The type id of the newly created type.
deleteDeliverable()
public
deleteDeliverable() : mixed
Return values
mixed —deleteJobType()
Delete a jobtype. Takes the following in $this->vars: - id: The jobtype id to delete.
public
deleteJobType() : mixed
Return values
mixed —deleteSlice()
Remove a slice. Expects the following in $this->vars: - id: The slice ids
public
deleteSlice() : bool
Return values
bool —enterTime()
Enter a new time slice.
public
enterTime() : array<string|int, mixed>
@see Hermes_Slice::readForm for the data expected to be sent in the posted form.
Return values
array<string|int, mixed> —The new timeslice
getDeliverableDetail()
public
getDeliverableDetail() : mixed
Return values
mixed —listDeliverables()
Get the list of Hermes-only deliverables for the requested client.
public
listDeliverables() : mixed
- c: The client id
- id: The optional deliverable id, if requesting a specific deliverable.
Return values
mixed —listDeliverablesSelect()
Get a list of client deliverables suitable for building a select list.
public
listDeliverablesSelect() : array<string|int, mixed>
Expects the following in $this->vars:
- c: The client id, or an array of client ids if querying for specific clients. Returns all deliverables otherwise.
Return values
array<string|int, mixed> —@see Hermes::getCostObjectType
listJobTypes()
Return descriptions of job types. If $this->vars->id is present it is used to filter by the requested id.
public
listJobTypes() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array describing the type.
listTimers()
Return the current list of timers.
public
listTimers([bool $running_only = false ]) : array<string|int, mixed>
Parameters
- $running_only : bool = false
-
Only return running timers if true.
Return values
array<string|int, mixed> —An array of timer arrays. @see Hermes::listTimers()
loadSlices()
Fetch a collection of time slices. For now, just allows a search for all of a single employees time. Either submitted or not submitted.
public
loadSlices() : array<string|int, mixed>
Expects the following values in $this->vars:
- e: The employee id
- s: Include submitted slices if true
- sort: The sort-by value
- dir: The sort direction
Return values
array<string|int, mixed> —An array of time slice data.
pauseTimer()
Pause a timer. Expects the following data in $this->vars: - t: The timer id
public
pauseTimer() : bool
Return values
bool —poll()
Poll the server. Currently also returns the list of current timer data so the UI can be updated periodically.
public
poll() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of timer arrays. @see self::listTimers()
search()
Perform a slice search.
public
search() : array<string|int, mixed>
Return values
array<string|int, mixed> —The search results.
startTimer()
Restart a paused timer. Expects the following data in $this->vars: - t: The timer id.
public
startTimer() : bool|array<string|int, mixed>
Return values
bool|array<string|int, mixed> —If the timer is exclusive, returns a new list of timer data, otherwise true on success/false on failure.
stopTimer()
Stop a timer. Expects the following in $this->vars: - t: The timer id.
public
stopTimer() : array<string|int, mixed>
- restart:
Return values
array<string|int, mixed> —An array describing the current timer state. Contains:
- h: The total number of hours elapsed so far.
- n: A note to apply to the description field of a time slice.
- t: The new timer title, if restarting.
submitSlices()
Mark slices as submitted. Expects the following in $this->vars: - items: The slice ids to submit.
public
submitSlices() : bool
Return values
bool —updateDeliverable()
Create a new deliverable. Takes the following in $this->vars: - deliverable_id: The id of the deliverable if editing.
public
updateDeliverable() : mixed
- name: (string) The deliverable name.
- active: (boolean) Is the deliverable active?
- estimate: (integer) The estimate for this deliverable.
- desc: (string) The description.
- client_id: (string) The client id this deliverable is for.
Return values
mixed —updateJobType()
Update an existing jobtype. Takes the following from $this->vars: - id: (integer) The type id of the exsting type.
public
updateJobType() : bool
- name: (string) They type name.
- billable: (boolean) Is this type billable?
- enabled: (boolean) Is this type enabled?
- rate: (double) The default hourly rate to use for this type.
Return values
bool —True on success/false on failure.
updateSlice()
Update a slice.
public
updateSlice() : array<string|int, mixed>
@see Hermes_Slice::readForm() for the data expeted in the posted form.
Return values
array<string|int, mixed> —The new slice data.
_readSearchForm()
Reads the search form submitted and return the search criteria
protected
_readSearchForm() : mixed