\Hermes_Ajax_Application_Handler

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.

Summary

Methods
Properties
Constants
addTimer()
createJobType()
updateDeliverable()
deleteDeliverable()
deleteJobType()
deleteSlice()
enterTime()
listDeliverablesSelect()
listDeliverables()
getDeliverableDetail()
listJobTypes()
listTimers()
loadSlices()
pauseTimer()
poll()
search()
startTimer()
stopTimer()
submitSlices()
updateJobType()
updateSlice()
No public properties found
No constants found
_readSearchForm()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

addTimer()

addTimer() : array

Add a new timer. Expects the following in $this->vars: - desc: The timer description.

  • client_id:
    • deliverable_id:
    • jobtype_id:

Returns

array —

An array with an 'id' key.

createJobType()

createJobType() : integer

Create a new jobtype. Takes the following from $this->vars: - 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.

Returns

integer —

The type id of the newly created type.

updateDeliverable()

updateDeliverable() 

Create a new deliverable. Takes the following in $this->vars: - deliverable_id: The id of the deliverable if editing.

  • 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.

deleteDeliverable()

deleteDeliverable() 

deleteJobType()

deleteJobType() 

Delete a jobtype. Takes the following in $this->vars: - id: The jobtype id to delete.

deleteSlice()

deleteSlice() : boolean

Remove a slice. Expects the following in $this->vars: - id: The slice ids

Returns

boolean

enterTime()

enterTime() : array

Enter a new time slice.

@see Hermes_Slice::readForm for the data expected to be sent in the posted form.

Returns

array —

The new timeslice

listDeliverablesSelect()

listDeliverablesSelect() : array

Get a list of client deliverables suitable for building a select list.

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.

Returns

array —

@see Hermes::getCostObjectType

listDeliverables()

listDeliverables() 

Get the list of Hermes-only deliverables for the requested client.

  • c: The client id
    • id: The optional deliverable id, if requesting a specific deliverable.

getDeliverableDetail()

getDeliverableDetail() 

listJobTypes()

listJobTypes() : array

Return descriptions of job types. If $this->vars->id is present it is used to filter by the requested id.

Returns

array —

An array describing the type.

listTimers()

listTimers(boolean  $running_only = false) : array

Return the current list of timers.

Parameters

boolean $running_only

Only return running timers if true.

Returns

array —

An array of timer arrays. @see Hermes::listTimers()

loadSlices()

loadSlices() : array

Fetch a collection of time slices. For now, just allows a search for all of a single employees time. Either submitted or not submitted.

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

Returns

array —

An array of time slice data.

pauseTimer()

pauseTimer() : boolean

Pause a timer. Expects the following data in $this->vars: - t: The timer id

Returns

boolean

poll()

poll() : array

Poll the server. Currently also returns the list of current timer data so the UI can be updated periodically.

Returns

array —

An array of timer arrays. @see self::listTimers()

search()

search() : array

Perform a slice search.

Returns

array —

The search results.

startTimer()

startTimer() : boolean|array

Restart a paused timer. Expects the following data in $this->vars: - t: The timer id.

Returns

boolean|array —

If the timer is exclusive, returns a new list of timer data, otherwise true on success/false on failure.

stopTimer()

stopTimer() : array

Stop a timer. Expects the following in $this->vars: - t: The timer id.

  • restart:

Returns

array —

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()

submitSlices() : boolean

Mark slices as submitted. Expects the following in $this->vars: - items: The slice ids to submit.

Returns

boolean

updateJobType()

updateJobType() : boolean

Update an existing jobtype. Takes the following from $this->vars: - id: (integer) The type id of the exsting type.

  • 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.

Returns

boolean —

True on success/false on failure.

updateSlice()

updateSlice() : array

Update a slice.

@see Hermes_Slice::readForm() for the data expeted in the posted form.

Returns

array —

The new slice data.

_readSearchForm()

_readSearchForm() 

Reads the search form submitted and return the search criteria