Author: david
Date: Thu Oct 14 15:12:49 2010
New Revision: 8129
Log:
Use default publication status setting for new descriptions.
Modified:
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Modified:
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Thu Oct 14 14:43:59 2010 (r8128)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Thu Oct 14 15:12:49 2010 (r8129)
@@ -169,6 +169,10 @@
{
$this->form->setDefault('publicationStatus',
$publicationStatus->statusId);
}
+ else
+ {
+ $this->form->setDefault('publicationStatus',
sfConfig::get('app_defaultPubStatus'));
+ }
$this->form->setValidator('publicationStatus', new sfValidatorString);
@@ -189,6 +193,11 @@
{
$choices = array($publicationStatus->id =>
$publicationStatus->status->__toString());
}
+ else
+ {
+ $status =
QubitTerm::getById(sfConfig::get('app_defaultPubStatus'));
+ $choices = array($status->id => $status->__toString());
+ }
// Disable widget if user doesn't have "publish" permission
$this->form->setWidget('publicationStatus', new
sfWidgetFormSelect(array('choices' => $choices), array('disabled' => true)));
@@ -559,8 +568,9 @@
{
if (!QubitAcl::check($this->resource, 'publish'))
{
- // if the user does not have 'publish' permission, automatically set
publication status to 'draft'
- $pubStatusId = QubitTerm::PUBLICATION_STATUS_DRAFT_ID;
+ // if the user does not have 'publish' permission, use default
publication
+ // status setting
+ $pubStatusId = sfConfig::get('app_defaultPubStatus',
QubitTerm::PUBLICATION_STATUS_DRAFT_ID);
}
else
{
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.