include/SugarFolders/SugarFolders.php

Show: inherited
Table of Contents

\SugarFolder

Package: SugarCRM

Polymorphic buckets - place any item in a folder

Properties

Propertypublic  $_depth= ''
Details
Type
n/a
Propertypublic  $assign_to_id= ''
Details
Type
n/a
Propertypublic  $core= '"SELECT f.id, f.name, f.has_child, f.is_group, f.is_dynamic, f.dynamic_query, f.folder_type, f.created_by, i.deleted FROM folders f left join inbound_email i on f.id = i.groupfolder_id "'
Default value"SELECT f.id, f.name, f.has_child, f.is_group, f.is_dynamic, f.dynamic_query, f.folder_type, f.created_by, i.deleted FROM folders f left join inbound_email i on f.id = i.groupfolder_id "Details
Type
n/a
Propertypublic  $coreOrderBy= '" ORDER BY f.is_dynamic, f.is_group, f.name ASC "'
Default value" ORDER BY f.is_dynamic, f.is_group, f.name ASC "Details
Type
n/a
Propertypublic  $coreSubscribed= '"SELECT f.id, f.name, f.has_child, f.is_group, f.is_dynamic, f.dynamic_query, f.folder_type, f.created_by, i.deleted FROM folders f LEFT JOIN folders_subscriptions fs ON f.id = fs.folder_id LEFT JOIN inbound_email i on i.groupfolder_id = f.id "'
Default value"SELECT f.id, f.name, f.has_child, f.is_group, f.is_dynamic, f.dynamic_query, f.folder_type, f.created_by, i.deleted FROM folders f LEFT JOIN folders_subscriptions fs ON f.id = fs.folder_id LEFT JOIN inbound_email i on i.groupfolder_id = f.id "Details
Type
n/a
Propertypublic  $coreWhere= '"WHERE f.deleted = 0 "'
Default value"WHERE f.deleted = 0 "Details
Type
n/a
Propertypublic  $coreWhereSubscribed= '"WHERE f.deleted = 0 AND fs.assigned_user_id = "'
Default value"WHERE f.deleted = 0 AND fs.assigned_user_id = "Details
Type
n/a
Propertypublic  $created_by= ''
Details
Type
n/a
Propertypublic  $date_created= ''
Details
Type
n/a
Propertypublic  $date_modified= ''
Details
Type
n/a
Propertypublic  $db= ''
Details
Type
n/a
Propertypublic  $defaultDirection= '"DESC"'
Default value"DESC"Details
Type
n/a
Propertypublic  $defaultSort= ''date''
Default value'date'Details
Type
n/a
Propertypublic  $deleted= ''
Details
Type
n/a
Propertypublic  $dynamic_query= ''''
Default value''Details
Type
n/a
Propertypublic  $folder_type= ''
Details
Type
n/a
Propertypublic  $has_child= '0'
Default value0Details
Type
n/a
Propertypublic  $hrSortLocal= 'array( 'flagged' => 'type', 'status' => 'reply_to_status', 'from' => 'emails_text.from_addr', 'subject' => 'name', 'date' => 'date_sent', 'AssignedTo' => 'assigned_user_id', 'flagged' => 'flagged' )'
Default valuearray( 'flagged' => 'type', 'status' => 'reply_to_status', 'from' => 'emails_text.from_addr', 'subject' => 'name', 'date' => 'date_sent', 'AssignedTo' => 'assigned_user_id', 'flagged' => 'flagged' )Details
Type
n/a
Propertypublic  $id= ''
Details
Type
n/a
Propertypublic  $is_dynamic= '0'
Default value0Details
Type
n/a
Propertypublic  $is_group= '0'
Default value0Details
Type
n/a
Propertypublic  $modified_by= ''
Details
Type
n/a
Propertypublic  $name= ''
Details
Type
n/a
Propertypublic  $new_with_id= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $parent_folder= ''
Details
Type
n/a

Methods

methodpublicSugarFolder( ) : void

Sole constructor

methodpublicaddBean(  $bean,  $user = null ) : void

Convenience method, pass a SugarBean and User to this to add anything to a given folder

Parameters
Name Type Description
$bean
$user
methodpublicaddSubscriptionsToGroupFolder( ) : void

Add subscriptions to this group folder.

methodpublicbuildTreeNodeFolders(  $a,  $nodePath,  $folderStates,  $subscriptions ) : \$folderNode

Builds children nodes for folders for TreeView

Parameters
Name Type Description
$a
$nodePath
$folderStates
$subscriptions
Returns
Type Description
\$folderNode TreeView node
methodpublicbuildTreeNodeRefresh(  $folderNode,  $subscriptions ) : void

Builds up a metanode for folder refresh (Sugar folders only)

Parameters
Name Type Description
$folderNode
$subscriptions
methodpubliccheckEmailExistForFolder(  $id ) : void

Parameters
Name Type Description
$id
methodpublicclearSubscriptions( ) : void

Deletes subscriptions to folders in preparation for reset

methodpublicclearSubscriptionsForFolder(  $folderID ) : \unknown

Deletes all subscriptions for a particular folder id

Parameters
Name Type Description
$folderID
Returns
Type Description
\unknown
methodpubliccopyBean(  $fromFolder,  $toFolder,  $beanId,  $module ) : void

Copies one bean from one folder to another

Parameters
Name Type Description
$fromFolder
$toFolder
$beanId
$module
methodpubliccreateSubscriptionForUser(  $user_id ) : void

Add subscriptions to this group folder.

Parameters
Name Type Description
$user_id
methodpublicdelete( ) : bool

Flags a folder as deleted

Returns
Type Description
bool True on success
methodpublicdeleteChildrenCascade( string $id ) : bool

Deletes all children in a cascade

Parameters
Name Type Description
$id string

ID of parent

Returns
Type Description
bool True on success
methodpublicdeleteEmailFromAllFolder(  $id ) : void

Parameters
Name Type Description
$id
methodpublicdeleteEmailFromFolder(  $id ) : void

Parameters
Name Type Description
$id
methodpublicfindAllChildren(  $folderId,  $childrenArray ) : void

Parameters
Name Type Description
$folderId
$childrenArray
methodprotectedgenerateArchiveFolderQuery( ) : void

methodpublicgenerateSugarsDynamicFolderQuery( ) : void

methodpublicgetCountItems(  $folderId ) : void

Parameters
Name Type Description
$folderId
methodpublicgetCountNewItems( string $id, array $criteria,  $folder ) : int

Returns the number of "new" items (based on passed criteria)

Parameters
Name Type Description
$id string

id ID of folder

$criteria array

criteria expected: array('field' => 'status', 'value' => 'unread');

$folder

array

Returns
Type Description
int
methodpublicgetCountUnread(  $folderId ) : void

Parameters
Name Type Description
$folderId
methodpublicgetFoldersChildForSettings(  $a,  $collection,  $subscriptions ) : void

Parameters
Name Type Description
$a
$collection
$subscriptions
methodpublicgetFoldersForSettings(  $focusUser = null ) : void

Preps object array for async call from user's Settings->Folders

Parameters
Name Type Description
$focusUser
methodpublicgetGroupFoldersForSettings(  $focusUser = null ) : void

Preps object array for async call from user's Settings->Folders

Parameters
Name Type Description
$focusUser
methodpublicgetListItemsForEmailXML(  $folderId,  $page = 1,  $pageSize = 10,  $sort = '',  $direction = '' ) : void

returns array of items for listView display in yui-ext Grid

Parameters
Name Type Description
$folderId
$page
$pageSize
$sort
$direction
methodpublicgetParentIDRecursive( string $id, array $ret = array() ) : array

Recursively finds parent node until it hits root

Parameters
Name Type Description
$id string

id Starting id to follow up

$ret array

ret collected ids

Returns
Type Description
array of IDs
methodpublicgetSubscriptions( object $user ) : array

Returns GUIDs of folders that the user in focus is subscribed to

Parameters
Name Type Description
$user object

user User object in focus

Returns
Type Description
array
methodpublicgetUserFolders( \objec $rootNode, array $folderStates, object $user = null,  $forRefresh = false ) : array

Collects, sorts, and builds tree of user's folders

Parameters
Name Type Description
$rootNode \objec

Reference to tree root node

$folderStates array

User pref folder open/closed states

$user object

Optional User in focus, default current_user

$forRefresh
Returns
Type Description
array
methodpublicinsertFolderSubscription( String $folderId, String $userID ) : String

Given a folder id and user id, create a folder subscription entry.

Parameters
Name Type Description
$folderId String
$userID String
Returns
Type Description
String The id of the newly created folder subscription.
methodpublicmove( string $fromFolder, string $toFolder, string $beanId ) : void

Moves beans from one folder to another folder

Parameters
Name Type Description
$fromFolder string

fromFolder GUID of source folder

$toFolder string

toFolder GUID of destination folder

$beanId string

beanId GUID of SugarBean being moved

methodpublicretrieve( string $id ) : bool

Retrieves and populates object

Parameters
Name Type Description
$id string

ID of folder

Returns
Type Description
bool True on success
methodpublicretrieveFoldersForProcessing( object $user,  $subscribed = true ) : array

Builds up a metacollection of user/group folders to be passed to processor methods

Parameters
Name Type Description
$user object

User object, defaults to $current_user

$subscribed
Returns
Type Description
array Array of abstract folder objects
methodpublicsave(  $addSubscriptions = TRUE ) : bool

Saves folder

Parameters
Name Type Description
$addSubscriptions
Returns
Type Description
bool
methodpublicsetFolder( array $fields ) : void

Creates a new group Folder from the passed fields

Parameters
Name Type Description
$fields array

fields

methodpublicsetSubscriptions( array $subs ) : void

Sets a user's preferences for subscribe folders (Sugar only)

Parameters
Name Type Description
$subs array

subs Array of IDs for subscribed folders

methodpublicupdateFolder(  $fields ) : void

Parameters
Name Type Description
$fields
Documentation was generated by DocBlox 0.18.1.