Author: sevein
Date: Tue Jun 28 13:06:46 2011
New Revision: 9213
Log:
Accession view page
Modified:
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/actions/indexAction.class.php
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/templates/indexSuccess.php
Modified:
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/actions/indexAction.class.php
==============================================================================
---
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/actions/indexAction.class.php
Tue Jun 28 12:56:26 2011 (r9212)
+++
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/actions/indexAction.class.php
Tue Jun 28 13:06:46 2011 (r9213)
@@ -23,7 +23,11 @@
{
$this->resource = $this->getRoute()->resource;
- // TODO: user check
+ // Check user authorization
+ if (!QubitAcl::check($this->resource, 'read'))
+ {
+ QubitAcl::forwardToSecureAction();
+ }
if (1 > strlen($title = $this->resource->__toString()))
{
@@ -32,6 +36,19 @@
$this->response->setTitle("$title - {$this->response->getTitle()}");
- // TODO: validation code
+ if (QubitAcl::check($this->resource, 'update'))
+ {
+ $validatorSchema = new sfValidatorSchema;
+ $values = array();
+
+ try
+ {
+ $validatorSchema->clean($values);
+ }
+ catch (sfValidatorErrorSchema $e)
+ {
+ $this->errorSchema = $e;
+ }
+ }
}
}
Modified:
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/templates/indexSuccess.php
==============================================================================
---
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/templates/indexSuccess.php
Tue Jun 28 12:56:26 2011 (r9212)
+++
trunk/plugins/qtAccessionPlugin/modules/qtAccessionPlugin/templates/indexSuccess.php
Tue Jun 28 13:06:46 2011 (r9213)
@@ -1,6 +1,6 @@
<h1><?php echo __('View accession record') ?></h1>
-<h1 class="label"><?php echo render_title($resource) ?></h1>
+<?php echo link_to_if(QubitAcl::check($resource, 'update'), '<h1
class="label">'.render_title($resource).'</h1>', array($resource, 'module' =>
'accession', 'action' => 'edit'), array('title' => __('Edit accession
record'))) ?>
<?php if (isset($errorSchema)): ?>
<div class="messages error">
@@ -14,7 +14,49 @@
<?php echo render_show(__('Identifier'), render_value($resource->identifier))
?>
-<?php echo render_show(__('Title'), render_value($resource->title)) ?>
+<?php echo render_show(__('Source of acquisition'),
render_value($resource->getSourceOfAcquisition(array('cultureFallback' =>
true)))) ?>
+
+<?php echo render_show(__('Location information'),
render_value($resource->getLocationInformation(array('cultureFallback' =>
true)))) ?>
+
+<div class="section" id="donorArea">
+
+ <?php echo link_to_if(QubitAcl::check($resource, 'update'),
'<h2>'.__('Donor/Transferring body area').'</h2>', array($resource, 'module' =>
'accession', 'action' => 'edit'), array('anchor' => 'donorArea', 'title' =>
__('Edit donor/transferring body area'))) ?>
+
+</div> <!-- /.section#donorArea -->
+
+<div class="section" id="administrativeArea">
+
+ <?php echo link_to_if(QubitAcl::check($resource, 'update'),
'<h2>'.__('Administrative area').'</h2>', array($resource, 'module' =>
'accession', 'action' => 'edit'), array('anchor' => 'administrativeArea',
'title' => __('Edit administrative area'))) ?>
+
+ <?php echo render_show(__('Acquisition type'),
render_value($resource->acquisitionType)) ?>
+
+ <?php echo render_show(__('Resource type'),
render_value($resource->resourceType)) ?>
+
+ <?php echo render_show(__('Title'),
render_value($resource->getTitle(array('cultureFallback' => true)))) ?>
+
+ <?php echo render_show(__('Creator'),
render_value($resource->getCreator(array('cultureFallback' => true)))) ?>
+
+ <?php echo render_show(__('Archival history'),
render_value($resource->getArchivalHistory(array('cultureFallback' => true))))
?>
+
+ <?php echo render_show(__('Content'),
render_value($resource->getContent(array('cultureFallback' => true)))) ?>
+
+ <?php echo render_show(__('Condition'),
render_value($resource->getCondition(array('cultureFallback' => true)))) ?>
+
+ <?php echo render_show(__('Received extent units'),
render_value($resource->getReceivedExtentUnits(array('cultureFallback' =>
true)))) ?>
+
+ <?php echo render_show(__('Progressing status'),
render_value($resource->processingStatus)) ?>
+
+ <?php echo render_show(__('Progressing priority'),
render_value($resource->processingPriority)) ?>
+
+ <?php echo render_show(__('Processing notes'),
render_value($resource->getProcessingNotes(array('cultureFallback' => true))))
?>
+
+</div> <!-- /.section#administrativeArea -->
+
+<div class="section" id="rightsArea">
+
+ <?php echo link_to_if(QubitAcl::check($resource, 'update'),
'<h2>'.__('Rights area').'</h2>', array($resource, 'module' => 'accession',
'action' => 'edit'), array('anchor' => 'rightsArea', 'title' => __('Edit rights
area'))) ?>
+
+</div> <!-- /.section#rightsArea -->
<div class="actions section">
--
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.