Constructor.
initializes the resourceStatus if the id is given
void
__construct
([integer $id = 0])
Add an edition.
boolean
addEdition
(integer $edition)
-
integer
$edition: the edition to add
Add a Validation refused.
boolean
addValidationRefused
(integer $edition)
-
integer
$edition: the edition to add
Deletes all editions.
void
delAllEditions
()
Deletes an edition.
boolean
delEdition
(integer $edition)
-
integer
$edition: the edition to del
Deletes an edition off the validations refused.
boolean
delValidationRefused
(integer $edition)
-
integer
$edition: the edition to del from the validations refused
Totally destroys the resource status from persistence.
void
destroy
()
Gets the array of all the editions possibly made on a resource.
Static function.
array(integer=>integer)
getAllEditions
()
Gets the array of all the locations.
Static function.
array(integer=>integer)
getAllLocations
()
Gets the array of all the publications.
Static function.
array(integer=>integer)
getAllPublications
()
Get the draft of the instance.
boolean
getDraft
()
Gets the editions done on the resource.
integer
getEditions
()
Returns the HTML representation of the status, available in tiny form.
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
Gets the DB ID of the instance.
integer
getID
()
Gets the location
integer
getLocation
()
Gets the locksmith data of a lock placed on the resource.
integer
getLock
()
Gets the locksmith date of a lock placed on the resource.
Gets the proposedFor location.
integer
getProposedFor
()
Gets the publication status of the resource.
integer
getPublication
()
Gets the publication date end.
CMS_date
getPublicationDateEnd
([
$public =
true])
Gets the publication date start.
CMS_date
getPublicationDateStart
([
$public =
true])
Gets the publication range : from xx/xx/xxxx to xx/xx/xxxx (last is replaced by "++" if not defined)
string
getPublicationRange
(string $userLanguage, [ $public = true])
-
string
$userLanguage: The user language
-
$public
Get the status id for this resource
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
Returns the label for current status.
Get validations Refused .
array(integer)
getValidationRefused
()
Has the resource edition parameter been done on it ?
boolean
hasEdition
(integer $edition)
-
integer
$edition: The edition to test for
Has the resource edition parameter been refused by a validator on it ?
boolean
hasValidationRefused
(integer $edition)
-
integer
$edition: The edition to test for
Locks the page. Takes the user DB ID and place it as locksmith data. Impossible if resource is already locked.
Sets all editions.
void
setAllEditions
(integer $allEditions)
Sets all validations refused.
void
setAllValidationsRefused
(integer $allEditions)
Set the draft of the instance.
boolean
setDraft
(boolean $draft)
-
boolean
$draft: : the instance draft status to set
Sets the location.
boolean
setLocation
(integer $location)
-
integer
$location: the location to set
Sets the proposedFor location.
boolean
setProposedFor
(integer $location)
-
integer
$location: the proposedFor location to set
Sets the publication status by hand. Beware ! This function should be used only be the log to create fake resource statuses !
void
setPublication
(integer $status)
-
integer
$status: The status to set
Sets the publication date end.
boolean
setPublicationDateEnd
(
CMS_date $date)
-
CMS_date
$date: the publication date to set
Sets the publication date start.
boolean
setPublicationDateStart
(
CMS_date $date)
-
CMS_date
$date: the publication date to set
Sets the publication status to RESOURCE_PUBLICATION_VALIDATED.
If the publication dates fits, auto-set it to RESOURCE_PUBLICATION_PUBLIC
void
setValidated
()
Unlocks the page. No checks done here.
void
unlock
()
Validate the publication dates range
void
validatePublicationDates
()
Writes the resourceStatus into persistence (MySQL for now).
boolean
writeToPersistence
()
Adjust the publication status according to publication dates.
void
_adjustPublication
()
Gets the message of the given icon status.
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()