PHP 클래스 Nag, horde

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
저자: Jon Parise ([email protected])
저자: Chuck Hagenbuch ([email protected])
저자: Jan Schneider ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 메소드들

메소드 설명
_rsortByAssignee ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by assignee.
_rsortByCompletion ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by completion status.
_rsortByDue ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by due date.
_rsortByEstimate ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by name.
_rsortByName ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by name.
_rsortByOwner ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by owner.
_rsortByPriority ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by priority.
_rsortByStart ( array $a, array $b ) : integer Comparison function for reverse sorting tasks by start date.
_sortByAssignee ( array $a, array $b ) : integer Comparison function for sorting tasks by assignee.
_sortByCompletion ( array $a, array $b ) : integer Comparison function for sorting tasks by completion status.
_sortByDue ( array $a, array $b ) : integer Comparison function for sorting tasks by due date.
_sortByEstimate ( array $a, array $b ) : integer Comparison function for sorting tasks by assignee.
_sortByName ( array $a, array $b ) : integer Comparison function for sorting tasks by name.
_sortByOwner ( array $a, array $b ) : integer Comparison function for sorting tasks by owner.
_sortByPriority ( array $a, array $b ) : integer Comparison function for sorting tasks by priority.
_sortByStart ( array $a, array $b ) : integer Comparison function for sorting tasks by start date.
addTasklist ( array $info, boolean $display = true ) : Horde_Share Creates a new share.
buildCheckboxWidget ( string $name, integer $checked ) : string Builds the HTML for a checkbox widget.
buildMimeMessage ( Horde_View $view, string $template, Horde_Mime_Part $image ) : Horde_Mime_Part Builds the body MIME part of a multipart message.
buildPriorityWidget ( string $name, integer $selected ) : string Builds the HTML for a priority selection widget.
countTasks ( ) : integer Returns the number of taks in task lists that the current user owns.
createTasksFromText ( string $text, string $tasklist = null ) : array Imports one or more tasks parsed from a string.
deleteTasklist ( Horde_Share_Object $tasklist ) Deletes a task list.
formatAlarm ( integer $value ) : string Returns the string matching the given alarm value.
formatAssignee ( string $assignee, boolean $link = false ) : string Returns the full name and a compose to message an assignee.
formatCompletion ( integer $completed ) : string Returns the string representation of the given completion status.
formatDate ( string $unixdate = '', boolean $hours = true ) : string Formats the given Unix-style date string.
formatOrganizer ( string $organizer, boolean $link = false ) : string Returns formatted string representing a task organizer.
formatPriority ( integer $priority ) : string Returns a colored representation of a priority.
getDefaultTasklist ( integer $permission = Horde_Perms::SHOW ) : string Returns the default tasklist for the current user at the specified permissions level.
getImagePart ( string $file ) : Horde_Mime_Part Returns a MIME part for an image to be embedded into a HTML document.
getLabel ( $tasklist ) : string Returns the label to be used for a task list.
getSyncLists ( ) : array Returns the tasklists that should be used for syncing.
getTask ( string $tasklist, string $task ) : Nag_Task Returns a single task.
getUrl ( integer $type, $tasklist ) : string Returns a DAV URL to be used for a task list.
getUserEmail ( $user )
getUserName ( string $uid ) : string Returns the real name, if available, of a user.
hasPermission ( string $tasklist, integer $perm ) : boolean Returns whether the current user has certain permissions on a tasklist.
initialize ( ) Initial app setup code.
listAlarms ( integer $date, array $tasklists = null ) : array Returns all the alarms active right on $date.
listTasklists ( boolean $owneronly = false, integer $permission = Horde_Perms::SHOW, boolean $smart = true ) : array Lists all task lists a user has access to.
listTasks ( array $options = [] ) : Nag_Task Retrieves the current user's task list from storage.
parseDate ( string $date, boolean $withtime = true ) : Horde_Date Parses a complete date-time string into a Horde_Date object.
randomColor ( ) : string Returns a random CSS color.
responseFromICal ( string $response ) : string Maps an iCalendar attendee response string to the corresponding Nag value.
secondsToString ( integer $seconds ) : string
sendITipNotifications ( Nag_Task $task, Horde_Notification_Handler $notification, integer $action, Horde_Date $instance = null, string $range = null ) Sends out iTip task notification to the assignee.
sendNotification ( string $action, Nag_Task $task, Nag_Task $old_task = null ) Sends email notifications that a task has been added, edited, or deleted to users that want such notifications.
status ( ) Trigger notifications.
updateTasklist ( Horde_Share_Object $tasklist, array $info ) Updates an existing share.

보호된 메소드들

메소드 설명
_getOwner ( Nag_Task $task ) : string Returns the owner of a task.
_notificationPref ( string $user, string $mode, string $tasklist = null ) : boolean Returns whether a user wants email notifications for a tasklist.

메소드 상세

_getOwner() 보호된 정적인 메소드

Returns the owner of a task.
protected static _getOwner ( Nag_Task $task ) : string
$task Nag_Task A task.
리턴 string The task's owner.

_notificationPref() 보호된 정적인 메소드

Returns whether a user wants email notifications for a tasklist.
protected static _notificationPref ( string $user, string $mode, string $tasklist = null ) : boolean
$user string A user name.
$mode string The check "mode". If "owner", the method checks if the user wants notifications only for tasklists he owns. If "read", the method checks if the user wants notifications for all tasklists he has read access to, or only for shown tasklists and the specified tasklist is currently shown.
$tasklist string The name of the tasklist if mode is "read".
리턴 boolean True if the user wants notifications for the tasklist.

_rsortByAssignee() 공개 정적인 메소드

Comparison function for reverse sorting tasks by assignee.
public static _rsortByAssignee ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByCompletion() 공개 정적인 메소드

Comparison function for reverse sorting tasks by completion status.
public static _rsortByCompletion ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByDue() 공개 정적인 메소드

Comparison function for reverse sorting tasks by due date.
public static _rsortByDue ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater, 0 if they are equal.

_rsortByEstimate() 공개 정적인 메소드

Comparison function for reverse sorting tasks by name.
public static _rsortByEstimate ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByName() 공개 정적인 메소드

Comparison function for reverse sorting tasks by name.
public static _rsortByName ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByOwner() 공개 정적인 메소드

Comparison function for reverse sorting tasks by owner.
public static _rsortByOwner ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByPriority() 공개 정적인 메소드

Comparison function for reverse sorting tasks by priority.
public static _rsortByPriority ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByStart() 공개 정적인 메소드

Comparison function for reverse sorting tasks by start date.
public static _rsortByStart ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer -1 if task one is greater, 1 if task two is greater, 0 if they are equal.

_sortByAssignee() 공개 정적인 메소드

Comparison function for sorting tasks by assignee.
public static _sortByAssignee ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByCompletion() 공개 정적인 메소드

Comparison function for sorting tasks by completion status.
public static _sortByCompletion ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByDue() 공개 정적인 메소드

Comparison function for sorting tasks by due date.
public static _sortByDue ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByEstimate() 공개 정적인 메소드

Comparison function for sorting tasks by assignee.
public static _sortByEstimate ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByName() 공개 정적인 메소드

Comparison function for sorting tasks by name.
public static _sortByName ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByOwner() 공개 정적인 메소드

Comparison function for sorting tasks by owner.
public static _sortByOwner ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByPriority() 공개 정적인 메소드

Comparison function for sorting tasks by priority.
public static _sortByPriority ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByStart() 공개 정적인 메소드

Comparison function for sorting tasks by start date.
public static _sortByStart ( array $a, array $b ) : integer
$a array Task one.
$b array Task two.
리턴 integer 1 if task one is greater, -1 if task two is greater; 0 if they are equal.

addTasklist() 공개 정적인 메소드

Creates a new share.
public static addTasklist ( array $info, boolean $display = true ) : Horde_Share
$info array Hash with tasklist information.
$display boolean Add the new tasklist to display_tasklists
리턴 Horde_Share The new share.

buildCheckboxWidget() 공개 정적인 메소드

Builds the HTML for a checkbox widget.
public static buildCheckboxWidget ( string $name, integer $checked ) : string
$name string The name of the widget.
$checked integer The default checkbox state.
리턴 string HTML for a checkbox representing the completion state.

buildMimeMessage() 공개 정적인 메소드

Builds the body MIME part of a multipart message.
public static buildMimeMessage ( Horde_View $view, string $template, Horde_Mime_Part $image ) : Horde_Mime_Part
$view Horde_View A view to render the HTML and plain text templates for the messate.
$template string The template base name for the view.
$image Horde_Mime_Part The MIME part of a related image.
리턴 Horde_Mime_Part A multipart/alternative MIME part.

buildPriorityWidget() 공개 정적인 메소드

Builds the HTML for a priority selection widget.
public static buildPriorityWidget ( string $name, integer $selected ) : string
$name string The name of the widget.
$selected integer The default selected priority.
리턴 string The HTML

countTasks() 공개 정적인 메소드

Returns the number of taks in task lists that the current user owns.
public static countTasks ( ) : integer
리턴 integer The number of tasks that the user owns.

createTasksFromText() 공개 정적인 메소드

Imports one or more tasks parsed from a string.
public static createTasksFromText ( string $text, string $tasklist = null ) : array
$text string The text to parse into
$tasklist string The tasklist into which the task will be imported. If 'null', the user's default tasklist will be used.
리턴 array The UIDs of all tasks that were added.

deleteTasklist() 공개 정적인 메소드

Deletes a task list.
public static deleteTasklist ( Horde_Share_Object $tasklist )
$tasklist Horde_Share_Object The task list to delete.

formatAlarm() 공개 정적인 메소드

Returns the string matching the given alarm value.
public static formatAlarm ( integer $value ) : string
$value integer The alarm value in minutes.
리턴 string The formatted alarm string.

formatAssignee() 공개 정적인 메소드

Returns the full name and a compose to message an assignee.
public static formatAssignee ( string $assignee, boolean $link = false ) : string
$assignee string The assignee's user name.
$link boolean Whether to link to an email compose screen.
리턴 string The formatted assignee name.

formatCompletion() 공개 정적인 메소드

Returns the string representation of the given completion status.
public static formatCompletion ( integer $completed ) : string
$completed integer The completion value.
리턴 string The HTML representation of $completed.

formatDate() 공개 정적인 메소드

Formats the given Unix-style date string.
public static formatDate ( string $unixdate = '', boolean $hours = true ) : string
$unixdate string The Unix-style date value to format.
$hours boolean Whether to add hours.
리턴 string The formatted due date string.

formatOrganizer() 공개 정적인 메소드

Returns formatted string representing a task organizer.
public static formatOrganizer ( string $organizer, boolean $link = false ) : string
$organizer string The organinzer, as an email or mailto: format.
$link boolean Whether to link to an email compose screen.
리턴 string The formatted organizer name.

formatPriority() 공개 정적인 메소드

Returns a colored representation of a priority.
public static formatPriority ( integer $priority ) : string
$priority integer The priority level.
리턴 string The HTML representation of $priority.

getDefaultTasklist() 공개 정적인 메소드

Returns the default tasklist for the current user at the specified permissions level.
public static getDefaultTasklist ( integer $permission = Horde_Perms::SHOW ) : string
$permission integer Horde_Perms constant for permission level required.
리턴 string The default tasklist or null if none.

getImagePart() 공개 정적인 메소드

Returns a MIME part for an image to be embedded into a HTML document.
public static getImagePart ( string $file ) : Horde_Mime_Part
$file string An image file name.
리턴 Horde_Mime_Part A MIME part representing the image.

getLabel() 공개 정적인 메소드

Attaches the owner name of shared task lists if necessary.
public static getLabel ( $tasklist ) : string
리턴 string The task list's label.

getSyncLists() 공개 정적인 메소드

Returns the tasklists that should be used for syncing.
public static getSyncLists ( ) : array
리턴 array An array of task list ids

getTask() 공개 정적인 메소드

Returns a single task.
public static getTask ( string $tasklist, string $task ) : Nag_Task
$tasklist string A tasklist.
$task string A task id.
리턴 Nag_Task The task hash.

getUrl() 공개 정적인 메소드

Returns a DAV URL to be used for a task list.
public static getUrl ( integer $type, $tasklist ) : string
$type integer A Nag::DAV_* constant.
리턴 string The task list's URL.

getUserEmail() 공개 정적인 메소드

public static getUserEmail ( $user )

getUserName() 공개 정적인 메소드

Returns the real name, if available, of a user.
public static getUserName ( string $uid ) : string
$uid string The userid of the user to retrieve
리턴 string The fullname of the user.

hasPermission() 공개 정적인 메소드

Returns whether the current user has certain permissions on a tasklist.
public static hasPermission ( string $tasklist, integer $perm ) : boolean
$tasklist string A tasklist id.
$perm integer A Horde_Perms permission mask.
리턴 boolean True if the current user has the requested permissions.

initialize() 공개 정적인 메소드

Initial app setup code.
public static initialize ( )

listAlarms() 공개 정적인 메소드

Returns all the alarms active right on $date.
public static listAlarms ( integer $date, array $tasklists = null ) : array
$date integer The unix epoch time to check for alarms.
$tasklists array An array of tasklists
리턴 array An array of Nag_Task objects with alarms active on $date.

listTasklists() 공개 정적인 메소드

Lists all task lists a user has access to.
public static listTasklists ( boolean $owneronly = false, integer $permission = Horde_Perms::SHOW, boolean $smart = true ) : array
$owneronly boolean Only return task lists that this user owns? Defaults to false.
$permission integer The permission to filter task lists by.
$smart boolean Include SmartLists in the results.
리턴 array The task lists.

listTasks() 공개 정적인 메소드

This function will also sort the resulting list, if requested.
public static listTasks ( array $options = [] ) : Nag_Task
$options array Options array: - altsortby: (string) The secondary sort field. Same values as sortdir. DEFAULT: altsortby pref is used. - completed: (integer) Which task to retrieve. A Nag::VIEW_* constant. DEFAULT: show_completed pref is used. - external: (boolean) Whether to include tasks from other applications too. DEFAULT: true. - include_history: (boolean) Autoload created/modified data from Horde_History. DEFAULT: true (Automatically load history data). - include_tags: (boolean) Autoload all tags. DEFAULT: false (Tags are lazy loaded as needed.) - sortby: (string) A Nag::SORT_* constant for the field to sort by. DEFAULT: sortby pref is used. - sortdir: (string) Direction of sort. NAG::SORT_ASCEND or NAG::SORT_DESCEND. DEFAULT: sortdir pref is used. - tasklists: (array) An array of tasklists to include. DEFAULT: Use $GLOBALS['display_tasklists'];
리턴 Nag_Task A list of the requested tasks.

parseDate() 공개 정적인 메소드

Parses a complete date-time string into a Horde_Date object.
public static parseDate ( string $date, boolean $withtime = true ) : Horde_Date
$date string The date-time string to parse.
$withtime boolean Whether time is included in the string.
리턴 Horde_Date The parsed date.

randomColor() 공개 정적인 메소드

Returns a random CSS color.
public static randomColor ( ) : string
리턴 string A random CSS color string.

responseFromICal() 공개 정적인 메소드

Maps an iCalendar attendee response string to the corresponding Nag value.
public static responseFromICal ( string $response ) : string
$response string The attendee response.
리턴 string The Nag response value.

secondsToString() 공개 정적인 메소드

public static secondsToString ( integer $seconds ) : string
$seconds integer
리턴 string

sendITipNotifications() 공개 정적인 메소드

Can be used to send task invitations, updates, and cancellations.
public static sendITipNotifications ( Nag_Task $task, Horde_Notification_Handler $notification, integer $action, Horde_Date $instance = null, string $range = null )
$task Nag_Task The task in question.
$notification Horde_Notification_Handler A notification object used to show result status.
$action integer The type of notification to send. One of the Nag::ITIP_* values.
$instance Horde_Date If cancelling a single instance of a recurring task, the date of this instance.
$range string The range parameter if this is a recurring event. Possible values are self::RANGE_THISANDFUTURE

sendNotification() 공개 정적인 메소드

Sends email notifications that a task has been added, edited, or deleted to users that want such notifications.
public static sendNotification ( string $action, Nag_Task $task, Nag_Task $old_task = null )
$action string The event action. One of "add", "edit", or "delete".
$task Nag_Task The changed task.
$old_task Nag_Task The original task if $action is "edit".

status() 공개 정적인 메소드

Trigger notifications.
public static status ( )

updateTasklist() 공개 정적인 메소드

Updates an existing share.
public static updateTasklist ( Horde_Share_Object $tasklist, array $info )
$tasklist Horde_Share_Object The share to update.
$info array Hash with task list information.