PHP Класс Hermes, horde

See the enclosed file LICENSE for license information (BSD). If you did not receive this file, see http://www.horde.org/licenses/bsdl.php.
Автор: Chuck Hagenbuch ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_clients array List of available clients.

Открытые методы

Метод Описание
canEditTimeslice ( $id ) : Determines if the current user can edit a specific timeslice according to the following rules: 'hermes:review' perms may edit any slice, the current user can edit his/her own slice prior to submitting it. Otherwise no editing allowed.
clearTimer ( integer $id ) Clear a timer
getClientSelect ( string $id, boolean $multi = false, boolean $use_cotext = false ) : string Return the HTML needed to build an enum or multienum for selecting clients.
getCostObjectByID ( string $id, string | boolean $employee = false ) : array Return a cost object hash.
getCostObjectType ( mixed $client_ids = null ) : array Return data for costobjects, optionally filtered by client_ids.
getCostObjects ( $client_ids = null, $external_only = false ) Return a list of cost objects exported by available APIs, optionally filtered by client_ids.
getEmployeesType ( string $enumtype = 'multienum' ) : array Get form control type for users.
getJobTypeData ( $params = [] )
getJobTypeSelect ( string $id, boolean $multi = false, $show_disabled = false ) : string Return HTML needed to build an enum or multienum for jobtype selection.
getTimer ( $id ) : array Return a specific timer.
listClients ( string $name = '' ) : array Returns a list of available clients.
listTimers ( boolean $running_only = false ) : array Return list of current timers.
makeExportHours ( array $hours ) : array Rewrite an hours array into a format useable by Horde_Data::
newTimer ( string $description, stdClass $details = null ) : integer Create a new timer and save it to storage. Timers contain the following values: - name: (string) The descriptive name of the timer.
parseDate ( string $date ) : Horde_Date Parses a complete date-time string into a Horde_Date object.
pauseTimer ( integer $id ) : boolean Pause a timer.
showAjaxView ( ) : boolean Returns true if we are showing the Ajax view.
tabs ( )
updateCostObject ( $slice )
updateTimer ( integer $id, array $timer ) Update an existing timer.
url ( string $view, array $params = [] ) : Horde_Url Return a URL to a specific view, taking self::showAjaxView() into account

Описание методов

canEditTimeslice() публичный статический Метод

Determines if the current user can edit a specific timeslice according to the following rules: 'hermes:review' perms may edit any slice, the current user can edit his/her own slice prior to submitting it. Otherwise no editing allowed.
public static canEditTimeslice ( $id ) :
$id
Результат

clearTimer() публичный статический Метод

Clear a timer
public static clearTimer ( integer $id )
$id integer The timer id to clear/remove.

getClientSelect() публичный статический Метод

Return the HTML needed to build an enum or multienum for selecting clients.
public static getClientSelect ( string $id, boolean $multi = false, boolean $use_cotext = false ) : string
$id string The DOM id to identify the select list.
$multi boolean Allow multi select?
$use_cotext boolean Instead of 'Select A Client', use 'General Cost Objects' for the top choice.
Результат string The HTML to render the select element.

getCostObjectByID() публичный статический Метод

Return a cost object hash.
public static getCostObjectByID ( string $id, string | boolean $employee = false ) : array
$id string The cost object id.
$employee string | boolean Employee hint - if known. False otherwise.
Результат array The cost object hash. Keys differ depending on the API queried, but should always contain: - id: - name:

getCostObjectType() публичный статический Метод

Return data for costobjects, optionally filtered by client_ids.
public static getCostObjectType ( mixed $client_ids = null ) : array
$client_ids mixed A client id or an array of client ids to filter cost obejcts by.
Результат array An array of cost objects data.

getCostObjects() публичный статический Метод

Return a list of cost objects exported by available APIs, optionally filtered by client_ids.
public static getCostObjects ( $client_ids = null, $external_only = false )

getEmployeesType() публичный статический Метод

What type of control we use depends on whether the Auth driver has list capability.
public static getEmployeesType ( string $enumtype = 'multienum' ) : array
$enumtype string The type to return if we have list capability (should be either 'enum' or 'multienum').
Результат array A two-element array of the type and the type's parameters.

getJobTypeData() публичный статический Метод

public static getJobTypeData ( $params = [] )

getJobTypeSelect() публичный статический Метод

Return HTML needed to build an enum or multienum for jobtype selection.
public static getJobTypeSelect ( string $id, boolean $multi = false, $show_disabled = false ) : string
$id string The DOM id to identify the select list.
$multi boolean Allow multi select?
Результат string The HTML needed to render the select element.

getTimer() публичный статический Метод

Return a specific timer.
public static getTimer ( $id ) : array
Результат array The timer hash.

listClients() публичный статический Метод

Returns a list of available clients.
public static listClients ( string $name = '' ) : array
$name string The string to search for in the client name.
Результат array A hash of client_id => client_name.

listTimers() публичный статический Метод

Return list of current timers.
public static listTimers ( boolean $running_only = false ) : array
$running_only boolean Only return running timers if true.
Результат array An array of timer hashes.

makeExportHours() публичный статический Метод

Rewrite an hours array into a format useable by Horde_Data::
public static makeExportHours ( array $hours ) : array
$hours array This is an array of the results from $driver->getHours().
Результат array an array suitable for Horde_Data::

newTimer() публичный статический Метод

- client_id: (string) The client id. - deliverable_id: (string) The delverable id. - deliverable_text: (string) Descriptive text for deliverable. - jobtype_id: (string) The jobtype id. - time: (integer) Contains the timestamp of the last time this timer was started. Contains zero if paused. - paused: (boolean) Flag to indicate the timer is paused. - elapsed: (integer) Total elapsed time since the timer was created or reset. Updated when timer is paused. - exclusive: (boolean) Whether or not this timer should cause other timers to stop when it is started.
public static newTimer ( string $description, stdClass $details = null ) : integer
$description string The timer description.
$details stdClass Additional, optional details for the ti.
Результат integer The timer id.

parseDate() публичный статический Метод

Parses a complete date-time string into a Horde_Date object.
public static parseDate ( string $date ) : Horde_Date
$date string The date-time string to parse.
Результат Horde_Date The parsed date.

pauseTimer() публичный статический Метод

Pause a timer.
public static pauseTimer ( integer $id ) : boolean
$id integer The timer id.
Результат boolean

showAjaxView() публичный статический Метод

Returns true if we are showing the Ajax view.
public static showAjaxView ( ) : boolean
Результат boolean

tabs() публичный статический Метод

public static tabs ( )

updateCostObject() публичный статический Метод

public static updateCostObject ( $slice )

updateTimer() публичный статический Метод

Update an existing timer.
public static updateTimer ( integer $id, array $timer )
$id integer The timer id.
$timer array The timer hash.

url() публичный статический Метод

Return a URL to a specific view, taking self::showAjaxView() into account
public static url ( string $view, array $params = [] ) : Horde_Url
$view string The view to link to.
$params array Optional paramaters. - id: A slice id.
Результат Horde_Url The Url

Описание свойств

$_clients защищенное статическое свойство

List of available clients.
protected static array $_clients
Результат array