PHP Class Hermes_Ajax_Application_Handler, horde

Copyright 2012-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Michael J Rubinsky ([email protected])
Inheritance: extends Horde_Core_Ajax_Application_Handler
Mostra file Open project: horde/horde

Public Methods

Method Description
addTimer ( ) : array Add a new timer. Expects the following in $this->vars: - desc: The timer description.
createJobType ( ) : integer Create a new jobtype. Takes the following from $this->vars: - name: (string) They type name.
deleteDeliverable ( )
deleteJobType ( ) Delete a jobtype. Takes the following in $this->vars: - id: The jobtype id to delete.
deleteSlice ( ) : boolean Remove a slice. Expects the following in $this->vars: - id: The slice ids
enterTime ( ) : array Enter a new time slice.
getDeliverableDetail ( )
listDeliverables ( ) Get the list of Hermes-only deliverables for the requested client.
listDeliverablesSelect ( ) : array Get a list of client deliverables suitable for building a select list.
listJobTypes ( ) : array Return descriptions of job types. If $this->vars->id is present it is used to filter by the requested id.
listTimers ( boolean $running_only = false ) : array Return the current list of timers.
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.
pauseTimer ( ) : boolean Pause a timer. Expects the following data in $this->vars: - t: The timer id
poll ( ) : array Poll the server. Currently also returns the list of current timer data so the UI can be updated periodically.
search ( ) : array Perform a slice search.
startTimer ( ) : boolean | array Restart a paused timer. Expects the following data in $this->vars: - t: The timer id.
stopTimer ( ) : array Stop a timer. Expects the following in $this->vars: - t: The timer id.
submitSlices ( ) : boolean Mark slices as submitted. Expects the following in $this->vars: - items: The slice ids to submit.
updateDeliverable ( ) Create a new deliverable. Takes the following in $this->vars: - deliverable_id: The id of the deliverable if editing.
updateJobType ( ) : boolean Update an existing jobtype. Takes the following from $this->vars: - id: (integer) The type id of the exsting type.
updateSlice ( ) : array Update a slice.

Protected Methods

Method Description
_readSearchForm ( ) Reads the search form submitted and return the search criteria

Method Details

_readSearchForm() protected method

Reads the search form submitted and return the search criteria
protected _readSearchForm ( )

addTimer() public method

- client_id: - deliverable_id: - jobtype_id:
public addTimer ( ) : array
return array An array with an 'id' key.

createJobType() public method

- billable: (boolean) Is this type billable? - enabled: (boolean) Is this type enabled? - rate: (double) The default hourly rate to use for this type.
public createJobType ( ) : integer
return integer The type id of the newly created type.

deleteDeliverable() public method

public deleteDeliverable ( )

deleteJobType() public method

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

deleteSlice() public method

Remove a slice. Expects the following in $this->vars: - id: The slice ids
public deleteSlice ( ) : boolean
return boolean

enterTime() public method

@see Hermes_Slice::readForm for the data expected to be sent in the posted form.
public enterTime ( ) : array
return array The new timeslice

getDeliverableDetail() public method

listDeliverables() public method

- c: The client id - id: The optional deliverable id, if requesting a specific deliverable.
public listDeliverables ( )

listDeliverablesSelect() public method

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.
public listDeliverablesSelect ( ) : array
return array @see Hermes::getCostObjectType

listJobTypes() public method

Return descriptions of job types. If $this->vars->id is present it is used to filter by the requested id.
public listJobTypes ( ) : array
return array An array describing the type.

listTimers() public method

Return the current list of timers.
public listTimers ( boolean $running_only = false ) : array
$running_only boolean Only return running timers if true.
return array An array of timer arrays. @see Hermes::listTimers()

loadSlices() public method

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
public loadSlices ( ) : array
return array An array of time slice data.

pauseTimer() public method

Pause a timer. Expects the following data in $this->vars: - t: The timer id
public pauseTimer ( ) : boolean
return boolean

poll() public method

Poll the server. Currently also returns the list of current timer data so the UI can be updated periodically.
public poll ( ) : array
return array An array of timer arrays. @see self::listTimers()

startTimer() public method

Restart a paused timer. Expects the following data in $this->vars: - t: The timer id.
public startTimer ( ) : boolean | array
return boolean | array If the timer is exclusive, returns a new list of timer data, otherwise true on success/false on failure.

stopTimer() public method

- restart:
public stopTimer ( ) : array
return 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() public method

Mark slices as submitted. Expects the following in $this->vars: - items: The slice ids to submit.
public submitSlices ( ) : boolean
return boolean

updateDeliverable() public method

- 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.
public updateDeliverable ( )

updateJobType() public method

- 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.
public updateJobType ( ) : boolean
return boolean True on success/false on failure.

updateSlice() public method

@see Hermes_Slice::readForm() for the data expeted in the posted form.
public updateSlice ( ) : array
return array The new slice data.