Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
HIPO_Job_Edit_Bundled_Assets_Status Class Reference
Inheritance diagram for HIPO_Job_Edit_Bundled_Assets_Status:
HIPO_Job MySource_Object

Public Member Functions

 getThresholdPercentageRequired ()
 
 getHipoName ()
 
 getCodeName ()
 
 getInitialStepData ()
 
 prepare ()
 
 paint (&$o, $nested=FALSE)
 
 freestyle ()
 
 paintStatusChangeWarning (Array &$step_data, Hipo_Backend_Outputter $o, $prefix)
 
 processStatusChangeWarning (Array &$step_data, $prefix)
 
 processBundledAsset (&$step_data, $prefix, $freestyle=FALSE)
 
 sendBundleWorkflowMessage (&$step_data, $prefix, $freestyle=FALSE)
 
- Public Member Functions inherited from HIPO_Job
 HIPO_Job ($code_name='')
 
 getCodeName ()
 
 getHipoName ()
 
 getInitialStepData ()
 
 complete ()
 
 percentDone ()
 
getRunningVars ()
 
 setRunningVars (&$vars)
 
 setOption ($name, $value)
 
 getOption ($name)
 
 setHipoVar ($name, $value)
 
 getHipoVar ($name)
 
 _addError ($error, $warning=FALSE)
 
 getErrors ()
 
 prepare ()
 
 initialise ($source_code_name=NULL)
 
 getThreshold ()
 
 getThresholdPercentageRequired ()
 
 freestyle ()
 
 load ($code_name)
 
 save ($ignore_running_mode=FALSE)
 
 _updateProgress ()
 
 _renewLastUpdated ($new_time=NULL)
 
_getSubJob ()
 
 getInitialiseMode ()
 
 setRunningMode ($mode, $server_taskid='')
 
 getRunningMode ()
 
 autoStep ()
 
 getNextStep ()
 
 skipStep ($stepid=0)
 
 paint (&$o, $nested=FALSE)
 
 process ()
 
 processWeb (&$step_data, $prefix)
 
 processServer (&$step_data, $prefix)
 
 abort ($abort_source=TRUE, $abort_dependant=TRUE)
 
 jobAborted ()
 
 _paintErrorReport ()
 
 paintStepDefault (&$step_data, &$o, $prefix)
 
 _errorHandler ($err_no, $err_msg, $err_file, $err_line)
 
 getDependantHipoJob ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Static Public Member Functions

static getConfigVars ()
 
- Static Public Member Functions inherited from HIPO_Job
static paintConfig (&$o, $class, $write_access)
 
static getConfigVars ()
 
static paintProgressBar ($percent_done, $message='', $label_class='sq-hipo-progress-bar-label', $percent_class='sq-hipo-progress-bar-percent', $bar_main_class='sq-hipo-progress-bar-main', $bar_done_class='sq-hipo-progress-bar-done')
 

Protected Member Functions

 _prepareStatusChangeHIPO ($assetid, $new_status)
 
 _getBundledAssets ($bundle_assetid)
 
 _getNewAssetStatus ($assetid, $bundle_status, $new_status, $workflow_stream='')
 
 _filterMessages ($assetid, Array &$job_messages, $filters)
 
 _getRequiredBundleMessages ($old_status, $new_status)
 
 _getBackendScreenKeywordReplacement ($assetid, $screen_name)
 
 _sendUserLogMessage ($assetid, $message_body)
 

Protected Attributes

 $_usual_statuses
 

Additional Inherited Members

- Data Fields inherited from HIPO_Job
 $code_name = ''
 
 $source_code_name = ''
 
 $userid = 0
 
 $last_updated = 0
 
 $hipo_name = ''
 
 $is_prepared = FALSE
 
 $uses_trans = TRUE
 
 $_hipo_vars
 
 $_options
 
 $_running_vars = Array()
 
 $_current_mode = 'web'
 
 $_steps = Array()
 

Detailed Description

Definition at line 7 of file hipo_job_edit_bundled_assets_status.inc.

Member Function Documentation

_filterMessages (   $assetid,
Array &  $job_messages,
  $filters 
)
protected

Utility function to filter "invitation" and other undesirable messages

By "undesirable", in this case this means asset-level messages that we'd rather have the bundle send. We save details about those messages in running vars so we can send asset info in the bundle message.

Modifies a running var storing the users and assets that they would have been sent messages about, and removes them from the job messages argument, which is passed back to the caller.

Parameters
string$assetidThe ID of the bundled asset generating these messages
array&$job_messagesThe messages generated by that asset's Edit Status job
array$filtersFilter of 'name' => 'message type code'
Returns
void

Definition at line 1045 of file hipo_job_edit_bundled_assets_status.inc.

_getBackendScreenKeywordReplacement (   $assetid,
  $screen_name 
)
protected

Returns a URL for the specified asset's passed screen

Parameters
string$assetidThe specified asset ID
string$screen_nameThe screen we want the URL of
Returns
string

Definition at line 1152 of file hipo_job_edit_bundled_assets_status.inc.

_getBundledAssets (   $bundle_assetid)
protected

Get the bundled assets that we will be working upon

Returned array will be just of asset ID, no specific key

Parameters
string$bundle_assetidThe bundle that we are checking links of
Returns
array

Definition at line 677 of file hipo_job_edit_bundled_assets_status.inc.

_getNewAssetStatus (   $assetid,
  $bundle_status,
  $new_status,
  $workflow_stream = '' 
)
protected

Determines an asset's intended status, given the bundle's current status and what it's changing to.

Returns NULL if no status change should apply. The new status can be the same as the old status if the old status supports it (eg. Pending Approval => Pending Approval, for progressing a workflow).

Parameters
string$assetidThe asset ID of the child asset
int$bundle_statusThe current status of the bundle
int$new_statusThe new status of the bundle
Returns
int

Definition at line 705 of file hipo_job_edit_bundled_assets_status.inc.

_getRequiredBundleMessages (   $old_status,
  $new_status 
)
protected

Return an array of the messages we should be filtering and bundling (either 'start', 'progress', 'approve' or 'invite').

Parameters
int$old_statusThe old bundle status
int$new_statusThe new bundle status
Returns
array

Definition at line 1093 of file hipo_job_edit_bundled_assets_status.inc.

_prepareStatusChangeHIPO (   $assetid,
  $new_status 
)
protected

Prepare a dependant status change HIPO for a single bundled asset

Effects of dependant HIPOs spawned by this should be to dependant assets ONLY.

Return FALSE if the sub-job couldn't be initialised, otherwise return the code-name of it

Parameters
string$assetid
int$new_status
Returns
mixed string|boolean

Definition at line 633 of file hipo_job_edit_bundled_assets_status.inc.

_sendUserLogMessage (   $assetid,
  $message_body 
)
protected

Encapsulate the sending of user log messages for each asset

Parameters
string$assetidThe asset ID being logged
string$message_bodyThe user log message to send

Definition at line 1187 of file hipo_job_edit_bundled_assets_status.inc.

freestyle ( )

Run this HIPO quietly, and in one go

Returns
boolean

Definition at line 261 of file hipo_job_edit_bundled_assets_status.inc.

getCodeName ( )

Returns a unique codename the HIPO can use to ensure it is not being run twice

The Edit Status HIPO appends the ID of the asset that the status is being edited for (the top most parent) so that any other status jobs on this asset do not start while it is running. Due to locking of the interface, nobody should be allowed to run this HIPO at the same time on the same parent asset.

Returns
string public

Definition at line 99 of file hipo_job_edit_bundled_assets_status.inc.

static getConfigVars ( )
static

Sets some info about thresholds that this hipo requires.

Returns
array public

Definition at line 34 of file hipo_job_edit_bundled_assets_status.inc.

getHipoName ( )

Returns the (localised) HIPO name

Returns
string public

Definition at line 81 of file hipo_job_edit_bundled_assets_status.inc.

getInitialStepData ( )

Returns the steps in this hipo, possibly with localised step names and messages

Returns
string public

Definition at line 113 of file hipo_job_edit_bundled_assets_status.inc.

getThresholdPercentageRequired ( )

Return this job's threshold percentage

This is the percentage of this HIPO Job's threshold that would run if the job is freestyled (eg. if threshold is 10 assets, and a job would process 20 assets, then this should return 200%).

This is used in conjunction with the "Freestyle Threshold" config var (SQ_HIPO_TOTAL_THRESHOLD) to determine whether a job that doesn't care how its run is run through HIPO, or "freestyled" (run in one hit). This setting normally defaults to 80% (ie. if threshold is 10 assets, it would try to freestyle if processing 8 assets or less).

If multiple HIPOs are queued and can fit underneath this figure, then they will be freestyled until the combined total rises above it.

Return zero (0) to force the job to run through HIPO mode.

Returns
float

Definition at line 63 of file hipo_job_edit_bundled_assets_status.inc.

paint ( $o,
  $nested = FALSE 
)

Paint information about the process of the HIPO

This function calls the paint function for the step currently being run and also outputs a progress bar to indicate to the user where they are in the HIPO process

Parameters
Backend_Outputter&$oBackend_Outputter, reference to the backend outputter
boolean$nestedTRUE if the steps are nested
Returns
void public

Definition at line 238 of file hipo_job_edit_bundled_assets_status.inc.

paintStatusChangeWarning ( Array &  $step_data,
Hipo_Backend_Outputter  $o,
  $prefix 
)

Paint the "status change warning" step

Only painted if there are assets that we need to warn about. For instance, if we are going from "Editing" to "Approving", any assets that will go to something other than a "in workflow" status (eg. to Live since there is no workflow, or Approved to Go Live due to being able to complete the workflow) would need attention drawn to.

Parameters
array&$step_dataa reference to the array of information about the current step
Hipo_Backend_Outputter$oThe backend outputter used for painting this HIPO
string$prefixprefix for form vars
Returns
boolean

Definition at line 293 of file hipo_job_edit_bundled_assets_status.inc.

prepare ( )

Prepare and validate the HIPO vars before running

Returns
boolean

Definition at line 164 of file hipo_job_edit_bundled_assets_status.inc.

processBundledAsset ( $step_data,
  $prefix,
  $freestyle = FALSE 
)

Process a single bundled asset

Parameters
array&$step_dataa reference to the array of information about the current step
string$prefixprefix for form vars
boolean$freestyleTRUE = this HIPO is being freestyled
Returns
boolean

Definition at line 358 of file hipo_job_edit_bundled_assets_status.inc.

processStatusChangeWarning ( Array &  $step_data,
  $prefix 
)

Process the "status change warning" step

We need this solely to make sure the status change warning triggers - or not - depending on whether we need it.

Parameters
array&$step_dataa reference to the array of information about the current step
string$prefixprefix for form vars
Returns
boolean

Definition at line 333 of file hipo_job_edit_bundled_assets_status.inc.

sendBundleWorkflowMessage ( $step_data,
  $prefix,
  $freestyle = FALSE 
)

Send the relevant workflow bundle message for this status change

Parameters
Array&$step_dataHIPO data for the current step
string$prefixPrefix for form elements
boolean$freestyleTRUE = this HIPO is being freestyled
Returns
boolean

Definition at line 528 of file hipo_job_edit_bundled_assets_status.inc.

Field Documentation

$_usual_statuses
protected
Initial value:
= Array(
SQ_STATUS_UNDER_CONSTRUCTION => SQ_SC_STATUS_CAN_APPROVE,
SQ_STATUS_PENDING_APPROVAL => SQ_SC_STATUS_PENDING,
SQ_STATUS_APPROVED => SQ_SC_STATUS_ALL_APPROVED,
SQ_STATUS_LIVE => SQ_STATUS_LIVE,
)

Definition at line 19 of file hipo_job_edit_bundled_assets_status.inc.


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