Class CMS_resourceStatus

Description

Class CMS_resourceStatus

represent a resource status : its life cycle, and edition and validation states Tested OK.

Located in /automne/classes/workflow/resourcestatus.php (line 30)

CMS_grandFather
   |
   --CMS_resourceStatus
Class Constant Summary
Method Summary
 void __construct ([integer $id = 0])
 boolean addEdition (integer $edition)
 boolean addValidationRefused (integer $edition)
 void delAllEditions ()
 boolean delEdition (integer $edition)
 boolean delValidationRefused (integer $edition)
 void destroy ()
 array(integer=>integer) getAllEditions ()
 array(integer=>integer) getAllLocations ()
 array(integer=>integer) getAllPublications ()
 boolean getDraft ()
 integer getEditions ()
 string getHTML ([boolean $tiny = false], [CMS_profile_user $user = false], [string $modCodeName = false], [integer $resourceID = false], [boolean $checkLock = true], [ $withQTip = true])
 integer getID ()
 integer getLocation ()
 integer getLock ()
 integer getProposedFor ()
 integer getPublication ()
 CMS_date getPublicationDateEnd ([ $public = true])
 CMS_date getPublicationDateStart ([ $public = true])
 string getPublicationRange (string $userLanguage, [ $public = true])
 void getStatusId ( $module,  $resourceId, string $modCodeName, integer $resourceID)
 string getStatusLabel (CMS_language $language)
 array(integer) getValidationRefused ()
 boolean hasEdition (integer $edition)
 boolean hasValidationRefused (integer $edition)
 boolean lock ( &$user, CMS_profile_user $user)
 void setAllEditions (integer $allEditions)
 void setAllValidationsRefused (integer $allEditions)
 boolean setDraft (boolean $draft)
 boolean setLocation (integer $location)
 boolean setProposedFor (integer $location)
 void setPublication (integer $status)
 boolean setPublicationDateEnd (CMS_date $date)
 void setValidated ()
 void unlock ()
 boolean writeToPersistence ()
 string _getStatusLabel (string, $iconFileName)
Methods
Constructor __construct (line 143)

Constructor.

initializes the resourceStatus if the id is given

  • access: public
void __construct ([integer $id = 0])
  • integer $id: DB id
addEdition (line 332)

Add an edition.

  • return: true on success, false on failure.
  • access: public
boolean addEdition (integer $edition)
  • integer $edition: the edition to add
addValidationRefused (line 424)

Add a Validation refused.

  • return: true on success, false on failure.
  • access: public
boolean addValidationRefused (integer $edition)
  • integer $edition: the edition to add
delAllEditions (line 371)

Deletes all editions.

  • access: public
void delAllEditions ()
delEdition (line 352)

Deletes an edition.

  • return: true on success, false on failure.
  • access: public
boolean delEdition (integer $edition)
  • integer $edition: the edition to del
delValidationRefused (line 444)

Deletes an edition off the validations refused.

  • return: true on success, false on failure.
  • access: public
boolean delValidationRefused (integer $edition)
  • integer $edition: the edition to del from the validations refused
destroy (line 966)

Totally destroys the resource status from persistence.

  • access: public
void destroy ()
getAllEditions (line 1054)

Gets the array of all the editions possibly made on a resource.

Static function.

  • return: All the editions indexed by their message DB ID
  • access: public
array(integer=>integer) getAllEditions ()
getAllLocations (line 1038)

Gets the array of all the locations.

Static function.

  • return: All the locations indexed by their message DB ID
  • access: public
array(integer=>integer) getAllLocations ()
getAllPublications (line 1071)

Gets the array of all the publications.

Static function.

  • return: All the publications indexed by their message DB ID
  • access: public
array(integer=>integer) getAllPublications ()
getDraft (line 236)

Get the draft of the instance.

  • return: : the draft status
  • access: public
boolean getDraft ()
getEditions (line 304)

Gets the editions done on the resource.

  • return: The editions, all added in one integer.
  • access: public
integer getEditions ()
getHTML (line 752)

Returns the HTML representation of the status, available in tiny form.

  • return: HTML data
  • access: public
string getHTML ([boolean $tiny = false], [CMS_profile_user $user = false], [string $modCodeName = false], [integer $resourceID = false], [boolean $checkLock = true], [ $withQTip = true])
  • boolean $tiny: If set to true, returns the tiny version of the images.
  • CMS_profile_user $user: : current user (used to check validation rights)
  • string $modCodeName: : resource module codename (used to provide simple access to validation on status click)
  • integer $resourceID: : resource Id (used to provide simple access to validation on status click)
  • boolean $checkLock: : does it need to check lock status on resource (used for standard module only for now)
  • $withQTip
getID (line 213)

Gets the DB ID of the instance.

  • return: the DB id
  • access: public
integer getID ()
getLocation (line 246)

Gets the location

  • return: The resource location
  • access: public
integer getLocation ()
getLock (line 650)

Gets the locksmith data of a lock placed on the resource.

  • return: the locksmithData : DB ID of the user who placed the lock
  • access: public
integer getLock ()
getLockDate (line 673)

Gets the locksmith date of a lock placed on the resource.

  • return: the locksmithData : date where the lock was placed
  • access: public
CMS_date getLockDate ()
getProposedFor (line 275)

Gets the proposedFor location.

  • return: The proposedFor location.
  • access: public
integer getProposedFor ()
getPublication (line 477)

Gets the publication status of the resource.

  • return: The publication status.
  • access: public
integer getPublication ()
getPublicationDateEnd (line 577)

Gets the publication date end.

  • return: the publication date end.
  • access: public
CMS_date getPublicationDateEnd ([ $public = true])
  • $public
getPublicationDateStart (line 548)

Gets the publication date start.

  • return: the publication date start.
  • access: public
CMS_date getPublicationDateStart ([ $public = true])
  • $public
getPublicationRange (line 618)

Gets the publication range : from xx/xx/xxxx to xx/xx/xxxx (last is replaced by "++" if not defined)

  • return: The publication range
  • access: public
string getPublicationRange (string $userLanguage, [ $public = true])
  • string $userLanguage: The user language
  • $public
getStatusId (line 956)

Get the status id for this resource

  • access: public
void getStatusId ( $module,  $resourceId, string $modCodeName, integer $resourceID)
  • string $modCodeName: : resource module codename (used to provide simple access to validation on status click)
  • integer $resourceID: : resource Id (used to provide simple access to validation on status click)
  • $module
  • $resourceId
getStatusLabel (line 882)

Returns the label for current status.

  • return: label
  • access: public
string getStatusLabel (CMS_language $language)
getValidationRefused (line 412)

Get validations Refused .

  • access: public
array(integer) getValidationRefused ()
hasEdition (line 316)

Has the resource edition parameter been done on it ?

  • return: true if the edition was made on the resource, false otherwise
  • access: public
boolean hasEdition (integer $edition)
  • integer $edition: The edition to test for
hasValidationRefused (line 397)

Has the resource edition parameter been refused by a validator on it ?

  • return: true if the validations refused contains the edition, false otherwise
  • access: public
boolean hasValidationRefused (integer $edition)
  • integer $edition: The edition to test for
lock (line 701)

Locks the page. Takes the user DB ID and place it as locksmith data. Impossible if resource is already locked.

  • return: true on success, false on failure.
  • access: public
boolean lock ( &$user, CMS_profile_user $user)
setAllEditions (line 383)

Sets all editions.

  • access: public
void setAllEditions (integer $allEditions)
  • integer $allEditions
setAllValidationsRefused (line 464)

Sets all validations refused.

  • access: public
void setAllValidationsRefused (integer $allEditions)
  • integer $allEditions
setDraft (line 225)

Set the draft of the instance.

  • return: true on success, false on failure
  • access: public
boolean setDraft (boolean $draft)
  • boolean $draft: : the instance draft status to set
setLocation (line 258)

Sets the location.

  • return: true on success, false on failure.
  • access: public
boolean setLocation (integer $location)
  • integer $location: the location to set
setProposedFor (line 287)

Sets the proposedFor location.

  • return: true on success, false on failure.
  • access: public
boolean setProposedFor (integer $location)
  • integer $location: the proposedFor location to set
setPublication (line 502)

Sets the publication status by hand. Beware ! This function should be used only be the log to create fake resource statuses !

  • access: public
void setPublication (integer $status)
  • integer $status: The status to set
setPublicationDateEnd (line 589)

Sets the publication date end.

  • return: true on success, false on failure.
  • access: public
boolean setPublicationDateEnd (CMS_date $date)
  • CMS_date $date: the publication date to set
setPublicationDateStart (line 560)

Sets the publication date start.

  • return: true on success, false on failure.
  • access: public
boolean setPublicationDateStart (CMS_date $date)
  • CMS_date $date: the publication date to set
setValidated (line 489)

Sets the publication status to RESOURCE_PUBLICATION_VALIDATED.

If the publication dates fits, auto-set it to RESOURCE_PUBLICATION_PUBLIC

  • access: public
void setValidated ()
unlock (line 728)

Unlocks the page. No checks done here.

  • access: public
void unlock ()
validatePublicationDates (line 606)

Validate the publication dates range

  • access: public
void validatePublicationDates ()
writeToPersistence (line 987)

Writes the resourceStatus into persistence (MySQL for now).

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence ()
_adjustPublication (line 513)

Adjust the publication status according to publication dates.

  • access: public
void _adjustPublication ()
_getStatusLabel (line 1086)

Gets the message of the given icon status.

  • return: of label message
  • access: private
string _getStatusLabel (string, $iconFileName)
  • string, $iconFileName: the gif icon name without extension.

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
MESSAGE_RESOURCE_EDITION_BASEDATA = 7 (line 39)
MESSAGE_RESOURCE_EDITION_CONTENT = 8 (line 40)
MESSAGE_RESOURCE_EDITION_LOCATION = 41 (line 42)
MESSAGE_RESOURCE_EDITION_MOVE = 592 (line 43)
MESSAGE_RESOURCE_EDITION_SIBLINGSORDER = 9 (line 41)
MESSAGE_RESOURCE_LOCATION_ARCHIVED = 14 (line 46)
MESSAGE_RESOURCE_LOCATION_DELETED = 15 (line 47)
MESSAGE_RESOURCE_LOCATION_EDITION = 205 (line 48)
MESSAGE_RESOURCE_LOCATION_USERSPACE = 13 (line 45)
MESSAGE_RESOURCE_PUBLICATION_NEVERVALIDATED = 4 (line 35)
MESSAGE_RESOURCE_PUBLICATION_PUBLIC = 6 (line 37)
MESSAGE_RESOURCE_PUBLICATION_VALIDATED = 5 (line 36)
MESSAGE_STATUS_DRAFT = 1421 (line 32)
MESSAGE_STATUS_LOCKED = 1320 (line 31)
MESSAGE_STATUS_LOCKEDBY = 321 (line 33)

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:38:26 +0100 by phpDocumentor 1.4.3