Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Bulkmail_Manager Class Reference
Inheritance diagram for Bulkmail_Manager:
Bulkmail_Post_Office Asset MySource_Object

Public Member Functions

 __construct ($assetid=0)
 
 _getName ($short_name=FALSE)
 
 create (&$link)
 
 _getAllowedLinks ()
 
 canMoveLink (&$minor, &$old_major, $link_type)
 
 deleteLink ($linkid)
 
 canDelete ()
 
 canClone ()
 
 createAdHocJob ($from, $recipients, $subject, $content_id, $content_gen_as, $headers=Array(), $post_office_id=0, $server_details=Array(), $design_id=0, $layout_id=0, $subscriptions=Array())
 
 addJob ($job, $post_office=NULL)
 
 deleteJob ($job_id)
 
 updateJob ($job_id, $state)
 
 getQueuedJobs ($job_id=NULL, $post_office_id=NULL)
 
 getJobDataPath ($job_id)
 
getPostOffice ($job_id)
 
 initProgressFile ($data_dir)
 
 getJobProgress ($job_id)
 
 generateJobDetails ($job, $post_office)
 
 initDetailsFile ($details_info, $data_dir)
 
 getJobDetails ($job_id)
 
 isValidJob ($details_info, $report_error=FALSE)
 
- Public Member Functions inherited from Bulkmail_Post_Office
 __construct ($assetid=0)
 
 _getName ($short_name=FALSE)
 
 _getAllowedLinks ()
 
 canCreateLink (&$minor, $link_type, $exclusive)
 
 canMoveLink (&$minor, &$old_major, $link_type)
 
 attr ($name)
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Additional Inherited Members

- Data Fields inherited from Asset
 $id = 0
 
 $version = ''
 
 $name = ''
 
 $short_name = ''
 
 $status
 
 $languages = ''
 
 $charset = ''
 
 $force_secure = '0'
 
 $created
 
 $created_userid
 
 $updated
 
 $updated_userid
 
 $published
 
 $published_userid
 
 $status_changed
 
 $status_changed_userid
 
 $_is_cacheable = FALSE
 
 $vars = Array()
 
 $_available_keywords = Array()
 
 $data_path_suffix = ''
 
 $data_path = ''
 
 $data_path_public = ''
 
 $_ser_attrs = FALSE
 
- Protected Member Functions inherited from Asset
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _abortCreate ($trigger_level_changed=FALSE, $linkid=0)
 
 _loadVars ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getKeywordReplacement ($keyword)
 
 _checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE)
 
 makeAndSaveInitialWebPath ($path, $parent_link=NULL)
 

Detailed Description

Definition at line 35 of file bulkmail_manager.inc.

Constructor & Destructor Documentation

__construct (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 45 of file bulkmail_manager.inc.

Member Function Documentation

_getAllowedLinks ( )

Returns an array of all the permitted links type, the type asset and the cardinality

Returns
array private
See Also
Asset::_getAllowLinks()

Definition at line 111 of file bulkmail_manager.inc.

_getName (   $short_name = FALSE)

Return a name to use to describe this instance of the asset

Parameters
boolean$short_namewhether or not we are after the shortname or the full name
Returns
string private

Definition at line 61 of file bulkmail_manager.inc.

addJob (   $job,
  $post_office = NULL 
)

Adds a new job entry to the database, set up the datapath and progress info file

Note: existing entry in the table with the same job id will cause a HIPO lock

Parameters
object$jobjob object
object$post_officepost office object where we get the server/header details from
Returns
boolean private

Definition at line 281 of file bulkmail_manager.inc.

canClone ( )

returns FALSE always because we don't want to be able to clone a bulkmail manager

Returns
boolean public

Definition at line 178 of file bulkmail_manager.inc.

canDelete ( )

Can this asset have its last significant link removed (putting it in the trash)?

Returns
boolean public

Definition at line 165 of file bulkmail_manager.inc.

canMoveLink ( $minor,
$old_major,
  $link_type 
)

Not able to move this system asset around

Parameters
object&$minorthe minor asset that we are linking to
object&$old_majorthe major asset that we are being moved from
string$link_typethe type of link this is
Returns
mixed boolean|string public

Definition at line 136 of file bulkmail_manager.inc.

create ( $link)

Create this asset

Parameters
array&$linkinformation used to create the initial link
Returns
mixed int|boolean public
See Also
Asset::create()

Definition at line 77 of file bulkmail_manager.inc.

createAdHocJob (   $from,
  $recipients,
  $subject,
  $content_id,
  $content_gen_as,
  $headers = Array(),
  $post_office_id = 0,
  $server_details = Array(),
  $design_id = 0,
  $layout_id = 0,
  $subscriptions = Array() 
)

Interface function for adding a non-scheduled (DO IT NOW!) bulkmail to the bulkmail queue.

Parameters
string$fromAddress of the sender, eg "John Doe <johndoe@example.com>"
array$recipientsAssetIDs of the recipients
string$subjectSubject of the email
int$content_idAssetID of the asset you want to send as content
int$content_gen_asAssetID of the user you want the mail generated as
array$headersAddition headers to add to the mail in the form: Array('key' => 'value')
object$post_office_idAssetID of the post office to use. If this is NULL, you MUST supply server details
array$server_detailsMail options to create a post office on the fly:
                            Array(
                                'driver'    => 'sendmail',
                                'path'      => '/usr/sbin/sendmail',
                            )

OR

                            Array(
                                'driver'    => 'smtp',
                                'host'      => 'mail.yourcompany.com',
                                'port'      => 25,
                                'auth'      => FALSE,
                                'username'  => '',
                                'password'  => '',
                            )
Parameters
int$design_idAssetID of the design to use with the content
int$layout_idAssetID of the paint layout to use with the content (requires a design as well)
Returns
boolean public

Definition at line 225 of file bulkmail_manager.inc.

deleteJob (   $job_id)

Deletes a job entry from the DB table when it's cancelled/completed

Also removes the data directory if the job is an ad-hoc job

Parameters
int$job_idthe unique id of the job entry
Returns
boolean public

Definition at line 347 of file bulkmail_manager.inc.

deleteLink (   $linkid)

Removes a link where this asset is the major player

Parameters
int$linkidthe link id of the link to remove
Returns
boolean public

Definition at line 151 of file bulkmail_manager.inc.

generateJobDetails (   $job,
  $post_office 
)

Generates the relevant job details, also work out whether to use post office attribute

Parameters
object$jobthe job object
object$post_officethe post office object
Returns
array public

Definition at line 590 of file bulkmail_manager.inc.

getJobDataPath (   $job_id)

Gets the data path of a job

Parameters
int$job_idthe unique id of the job entry
Returns
string public

Definition at line 469 of file bulkmail_manager.inc.

getJobDetails (   $job_id)

Reads the details info from a file

Parameters
int$job_idthe unique id of the job entry
Returns
array public

Definition at line 674 of file bulkmail_manager.inc.

getJobProgress (   $job_id)

Reads the progress info from a file

Parameters
int$job_idthe unique id of the job entry
Returns
array public

Definition at line 567 of file bulkmail_manager.inc.

& getPostOffice (   $job_id)

Gets the post office of a bulkmail job

Parameters
string$job_idthe unique id of the job entry
Returns
string public

Definition at line 498 of file bulkmail_manager.inc.

getQueuedJobs (   $job_id = NULL,
  $post_office_id = NULL 
)

Returns jobs from the db table, if post office id is supplied, also returns all children

Parameters
int$job_idthe unique id of the job entry
int$post_office_idthe id of the parent post office
Returns
array public

Definition at line 415 of file bulkmail_manager.inc.

initDetailsFile (   $details_info,
  $data_dir 
)

Stores all the job details we need to a file

Parameters
array$details_infojob details generated by generateJobDetails()
string$data_dirpath to job's effective data directory
Returns
boolean public

Definition at line 648 of file bulkmail_manager.inc.

initProgressFile (   $data_dir)

Initialises the progress info file

Parameters
string$data_dirpath to the directory containing the progress info file use job's data-dir path if it is a normal job use system default post office data-dir path for an ad-hoc job
Returns
boolean public

Definition at line 526 of file bulkmail_manager.inc.

isValidJob (   $details_info,
  $report_error = FALSE 
)

Check if job is not valid or TRUE if we can set this job to live

Returns an array of error messages if extra parameter is passed in, otherwise returns a boolean

Parameters
array$details_infojob details generated by generateJobDetails()
boolean$report_errorreturns an array of error messages if TRUE
Returns
mixed boolean|array public

Definition at line 697 of file bulkmail_manager.inc.

updateJob (   $job_id,
  $state 
)

Updates the current state of a job

Parameters
int$job_idthe unique id of the job entry
string$statenew job state
Returns
boolean public

Definition at line 378 of file bulkmail_manager.inc.


The documentation for this class was generated from the following file: