Author: sevein
Date: Thu Jul 14 14:19:55 2011
New Revision: 9313
Log:
Add accession_mask Qubit setting
Modified:
trunk/apps/qubit/modules/settings/actions/listAction.class.php
trunk/data/fixtures/settings.yml
trunk/lib/form/SettingsGlobalForm.class.php
trunk/lib/task/migrate/QubitMigrate110.class.php
Modified: trunk/apps/qubit/modules/settings/actions/listAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/settings/actions/listAction.class.php Tue Jul
12 16:00:05 2011 (r9312)
+++ trunk/apps/qubit/modules/settings/actions/listAction.class.php Thu Jul
14 14:19:55 2011 (r9313)
@@ -196,6 +196,7 @@
$uploadDir = QubitSetting::getSettingByName('upload_dir');
$refImageMaxWidth =
QubitSetting::getSettingByName('reference_image_maxwidth');
$hitsPerPage = QubitSetting::getSettingByName('hits_per_page');
+ $accessionMask = QubitSetting::getSettingByName('accession_mask');
$inheritCodeInformationObject =
QubitSetting::getSettingByName('inherit_code_informationobject');
$sortTreeviewInformationObject =
QubitSetting::getSettingByName('sort_treeview_informationobject');
$multiRepository = QubitSetting::getSettingByName('multi_repository');
@@ -210,6 +211,7 @@
'upload_dir' => (isset($uploadDir)) ?
$uploadDir->getValue(array('sourceCulture'=>true)) : null,
'reference_image_maxwidth' => (isset($refImageMaxWidth)) ?
$refImageMaxWidth->getValue(array('sourceCulture'=>true)) : null,
'hits_per_page' => (isset($hitsPerPage)) ?
$hitsPerPage->getValue(array('sourceCulture'=>true)) : null,
+ 'accession_mask' => (isset($accessionMask)) ?
$accessionMask->getValue(array('sourceCulture'=>true)) : null,
'inherit_code_informationobject' =>
(isset($inheritCodeInformationObject)) ?
intval($inheritCodeInformationObject->getValue(array('sourceCulture'=>true))) :
1,
'sort_treeview_informationobject' =>
(isset($sortTreeviewInformationObject)) ?
$sortTreeviewInformationObject->getValue(array('sourceCulture'=>true)) : 0,
'multi_repository' => (isset($multiRepository)) ?
intval($multiRepository->getValue(array('sourceCulture'=>true))) : 1,
@@ -262,6 +264,16 @@
}
}
+ // Accession mask
+ if (null !== $accessionMask = $thisForm->getValue('accession_mask'))
+ {
+ $setting = QubitSetting::getSettingByName('accession_mask');
+
+ // Force sourceCulture update to prevent discrepency in settings between
cultures
+ $setting->setValue($accessionMask, array('sourceCulture' => true));
+ $setting->save();
+ }
+
// Inherit Code (Information Object)
if (null !== $inheritCodeInformationObjectValue =
$thisForm->getValue('inherit_code_informationobject'))
{
Modified: trunk/data/fixtures/settings.yml
==============================================================================
--- trunk/data/fixtures/settings.yml Tue Jul 12 16:00:05 2011 (r9312)
+++ trunk/data/fixtures/settings.yml Thu Jul 14 14:19:55 2011 (r9313)
@@ -335,3 +335,6 @@
QubitSetting_showTooltips:
name: show_tooltips
value: 1
+ QubitSetting_accessionMask:
+ name: accession_mask
+ value: '%Y-%m-%d/#i'
Modified: trunk/lib/form/SettingsGlobalForm.class.php
==============================================================================
--- trunk/lib/form/SettingsGlobalForm.class.php Tue Jul 12 16:00:05 2011
(r9312)
+++ trunk/lib/form/SettingsGlobalForm.class.php Thu Jul 14 14:19:55 2011
(r9313)
@@ -44,12 +44,13 @@
'upload_dir' => new sfWidgetFormInput(array(),
array('class'=>'disabled', 'disabled'=>true)),
'reference_image_maxwidth' => new sfWidgetFormInput,
'hits_per_page' => new sfWidgetFormInput,
+ 'accession_mask' => new sfWidgetFormInput,
'inherit_code_informationobject' => new
sfWidgetFormSelectRadio(array('choices'=>array(1=>'yes', 0=>'no')),
array('class'=>'radio')),
'sort_treeview_informationobject' => new
sfWidgetFormSelectRadio(array('choices'=>array('none'=>'none',
'title'=>'title', 'identifierTitle'=> 'identifier - title')),
array('class'=>'radio')),
'multi_repository' => new
sfWidgetFormSelectRadio(array('choices'=>array(1=>'yes', 0=>'no')),
array('class'=>'radio')),
'explode_multipage_files' => new
sfWidgetFormSelectRadio(array('choices'=>array(1=>'yes', 0=>'no')),
array('class'=>'radio')),
'show_tooltips' => new
sfWidgetFormSelectRadio(array('choices'=>array(1=>'yes', 0=>'no')),
array('class'=>'radio')),
- 'defaultPubStatus' => new
sfWidgetFormSelectRadio(array('choices'=>array(QubitTerm::PUBLICATION_STATUS_DRAFT_ID=>__('Draft'),
QubitTerm::PUBLICATION_STATUS_PUBLISHED_ID=>__('Published'))),
array('class'=>'radio'))
+ 'defaultPubStatus' => new
sfWidgetFormSelectRadio(array('choices'=>array(QubitTerm::PUBLICATION_STATUS_DRAFT_ID=>__('Draft'),
QubitTerm::PUBLICATION_STATUS_PUBLISHED_ID=>__('Published'))),
array('class'=>'radio')),
));
// Add labels
@@ -59,6 +60,7 @@
'upload_dir' => __('Upload directory'),
'reference_image_maxwidth' => __('Maximum image width (pixels)'),
'hits_per_page' => __('Results per page'),
+ 'accession_mask' => __('Accession mask'),
'inherit_code_informationobject' => __('Inherit reference code
(information object)'),
'sort_treeview_informationobject' => __('Sort treeview (information
object)'),
'multi_repository' => __('Multiple repositories'),
@@ -74,6 +76,7 @@
'upload_dir' => __('The destination directory for uploaded digital
object files'),
'reference_image_maxwidth' => __('The maximum width for derived
reference images'),
'hits_per_page' => __('The number of records shown per page on list
pages'),
+ // 'accession_mask' => __('The number of records shown per page on list
pages'),
'inherit_code_informationobject' => __('When set to "yes", the
reference code string will be built using the information object identifier
plus the identifiers of all its ancestors'),
'sort_treeview_informationobject' => __('Determines whether to sort
siblings in the information object treeview control and, if so, what sort
criteria to use'),
'multi_repository' => __('When set to "no", the repository
name is excluded from certain displays because it will be too repetitive'),
@@ -113,6 +116,7 @@
$this->validatorSchema['version'] = new sfValidatorString(array('required'
=> false));
$this->validatorSchema['check_for_updates'] = new
sfValidatorString(array('required' => false));
$this->validatorSchema['upload_dir'] = new
sfValidatorString(array('required' => false));
+ $this->validatorSchema['accession_mask'] = new
sfValidatorString(array('required' => false));
$this->validatorSchema['inherit_code_informationobject'] = new
sfValidatorInteger(array('required' => false));
$this->validatorSchema['sort_treeview_informationobject'] = new
sfValidatorString(array('required' => false));
$this->validatorSchema['multi_repository'] = new
sfValidatorInteger(array('required' => false));
Modified: trunk/lib/task/migrate/QubitMigrate110.class.php
==============================================================================
--- trunk/lib/task/migrate/QubitMigrate110.class.php Tue Jul 12 16:00:05
2011 (r9312)
+++ trunk/lib/task/migrate/QubitMigrate110.class.php Thu Jul 14 14:19:55
2011 (r9313)
@@ -71,6 +71,16 @@
*/
protected function addAccessionFixtures()
{
+ // Add accession mask user setting
+ if (false === $this->getRowKey('QubitSetting', 'name',
'QubitSetting_accessionMask'))
+ {
+ $this->data['QubitSetting']['QubitSetting_accessionMask'] = array(
+ 'name' => 'accession_mask',
+ 'value' => '%Y-%m-%d/#i'
+ );
+ }
+
+
// Update add button, accession is now the default action
if ($key = $this->findRowKeyForColumnValue($this->data['QubitMenu'],
'name', 'add'))
{
--
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.