Author: david
Date: Tue Sep 29 22:05:54 2009
New Revision: 3607
Log:
Fix repostitory auto-complete ACL for 'create' action.
Modified:
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
Modified:
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Tue Sep 29 22:04:51 2009 (r3606)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Tue Sep 29 22:05:54 2009 (r3607)
@@ -119,6 +119,15 @@
$this->form->setValidator('repository', new sfValidatorString);
$this->form->setWidget('repository', new
sfWidgetFormSelect(array('choices' =>
array($this->context->routing->generate(null, array('module' => 'repository',
'action' => 'show', 'id' => $this->informationObject->repository->id)) =>
$this->informationObject->repository))));
+ if (isset($this->request->id))
+ {
+ $this->repoAcParams = array('module' => 'repository', 'action' =>
'autocomplete', 'aclAction' => QubitAclAction::UPDATE_ID, 'informationObject'
=> $this->request->id);
+ }
+ else
+ {
+ $this->repoAcParams = array('module' => 'repository', 'action' =>
'autocomplete', 'aclAction' => QubitAclAction::CREATE_ID);
+ }
+
break;
case 'script':
@@ -218,7 +227,6 @@
$this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
$this->informationObject = new QubitInformationObject;
- $this->aclActionId = QubitAclAction::CREATE_ID;
if (isset($request->id))
{
@@ -230,8 +238,6 @@
$this->forward404();
}
- $this->aclActionId = QubitAclAction::UPDATE_ID;
-
// Add optimistic lock
$this->form->setDefault('serialNumber',
$this->informationObject->serialNumber);
$this->form->setValidator('serialNumber', new sfValidatorInteger);
Modified:
trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
Tue Sep 29 22:04:51 2009 (r3606)
+++ trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
Tue Sep 29 22:05:54 2009 (r3607)
@@ -106,7 +106,7 @@
<?php echo $form->repository->renderLabel() ?>
<?php echo $form->repository->render(array('class' =>
'form-autocomplete')) ?>
<input class="add" type="hidden" value="<?php echo
url_for(array('module' => 'repository', 'action' => 'create')) ?>
#authorized_form_of_name"/>
- <input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'repository', 'action' => 'autocomplete',
'informationObject' => $informationObject->id, 'aclAction' => $aclActionId))
?>"/>
+ <input class="list" type="hidden" value="<?php echo
url_for($repoAcParams) ?>"/>
</div>
<?php echo render_field($form->archivalHistory->help(__('Record the
successive transfers of ownership, responsibility and/or custody of the unit of
description and indicate those actions, such as history of the arrangement,
production of contemporary finding aids, re-use of the records for other
purposes or software migrations, that have contributed to its present structure
and arrangement. Give the dates of these actions, insofar as they can be
ascertained. If the archival history is unknown, record that information.')),
$informationObject, array('class' => 'resizable')) ?>
--~--~---------~--~----~------------~-------~--~----~
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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---