Author: jablko
Date: Thu Oct 14 17:27:14 2010
New Revision: 8150

Log:
s/$func/$resource

Modified:
   trunk/apps/qubit/modules/function/actions/editAction.class.php
   trunk/apps/qubit/modules/function/actions/indexAction.class.php
   trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php
   trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php

Modified: trunk/apps/qubit/modules/function/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/function/actions/editAction.class.php      Thu Oct 
14 17:06:15 2010        (r8149)
+++ trunk/apps/qubit/modules/function/actions/editAction.class.php      Thu Oct 
14 17:27:14 2010        (r8150)
@@ -82,9 +82,9 @@
     {
       case 'type':
 
-        if (null !== $this->func->type)
+        if (null !== $this->resource->type)
         {
-          $this->form->setDefault('type', 
$this->context->routing->generate(null, array($this->func->type, 'module' => 
'term')));
+          $this->form->setDefault('type', 
$this->context->routing->generate(null, array($this->resource->type, 'module' 
=> 'term')));
         }
         $this->form->setValidator('type', new sfValidatorString);
 
@@ -103,7 +103,7 @@
       case 'parallelName':
       case 'otherName':
         $criteria = new Criteria;
-        $criteria = $this->func->addotherNamesCriteria($criteria);
+        $criteria = $this->resource->addotherNamesCriteria($criteria);
 
         switch ($name)
         {
@@ -134,9 +134,9 @@
 
       case 'descriptionStatus':
 
-        if (null !== $this->func->descriptionStatus)
+        if (null !== $this->resource->descriptionStatus)
         {
-          $this->form->setDefault('descriptionStatus', 
$this->context->routing->generate(null, array($this->func->descriptionStatus, 
'module' => 'term')));
+          $this->form->setDefault('descriptionStatus', 
$this->context->routing->generate(null, 
array($this->resource->descriptionStatus, 'module' => 'term')));
         }
         $this->form->setValidator('descriptionStatus', new sfValidatorString);
 
@@ -153,9 +153,9 @@
 
       case 'descriptionDetail':
 
-        if (null !== $this->func->descriptionDetail)
+        if (null !== $this->resource->descriptionDetail)
         {
-          $this->form->setDefault('descriptionDetail', 
$this->context->routing->generate(null, array($this->func->descriptionDetail, 
'module' => 'term')));
+          $this->form->setDefault('descriptionDetail', 
$this->context->routing->generate(null, 
array($this->resource->descriptionDetail, 'module' => 'term')));
         }
         $this->form->setValidator('descriptionDetail', new sfValidatorString);
 
@@ -171,14 +171,14 @@
         break;
 
       case 'language':
-        $this->form->setDefault($name, $this->func[$name]);
+        $this->form->setDefault($name, $this->resource[$name]);
         $this->form->setValidator($name, new 
sfValidatorI18nChoiceLanguage(array('multiple' => true)));
         $this->form->setWidget($name, new 
sfWidgetFormI18nChoiceLanguage(array('culture' => 
$this->context->user->getCulture(), 'multiple' => true)));
 
         break;
 
       case 'script':
-        $this->form->setDefault($name, $this->func[$name]);
+        $this->form->setDefault($name, $this->resource[$name]);
         $c = sfCultureInfo::getInstance($this->context->user->getCulture());
         $this->form->setValidator($name, new sfValidatorChoice(array('choices' 
=> array_keys($c->getScripts()), 'multiple' => true)));
         $this->form->setWidget($name, new sfWidgetFormSelect(array('choices' 
=> $c->getScripts(), 'multiple' => true)));
@@ -190,7 +190,7 @@
 
         // Check for existing maintenance note related to this object
         $criteria = new Criteria;
-        $criteria = $this->func->addnotesCriteria($criteria);
+        $criteria = $this->resource->addnotesCriteria($criteria);
         $criteria->add(QubitNote::TYPE_ID, QubitTerm::MAINTENANCE_NOTE_ID);
         $note = QubitNote::getOne($criteria);
 
@@ -234,7 +234,7 @@
       case 'dates':
       case 'descriptionIdentifier':
       case 'institutionIdentifier':
-        $this->form->setDefault($name, $this->func[$name]);
+        $this->form->setDefault($name, $this->resource[$name]);
         $this->form->setValidator($name, new sfValidatorString);
         $this->form->setWidget($name, new sfWidgetFormInput);
 
@@ -246,7 +246,7 @@
       case 'rules':
       case 'revisionHistory':
       case 'sources':
-        $this->form->setDefault($name, $this->func[$name]);
+        $this->form->setDefault($name, $this->resource[$name]);
         $this->form->setValidator($name, new sfValidatorString);
         $this->form->setWidget($name, new sfWidgetFormTextarea);
 
@@ -292,14 +292,14 @@
       case 'descriptionDetail':
         $params = 
$this->context->routing->parse(Qubit::pathInfo($this->form->getValue($name)));
         $fieldId = (isset($params['id'])) ? $params['id'] : null;
-        $this->func[$name.'Id'] = $fieldId;
+        $this->resource[$name.'Id'] = $fieldId;
 
         break;
 
       case 'maintenanceNotes':
         // Check for existing maintenance note related to this object
         $criteria = new Criteria;
-        $criteria = $this->func->addnotesCriteria($criteria);
+        $criteria = $this->resource->addnotesCriteria($criteria);
         $criteria->add(QubitNote::TYPE_ID, QubitTerm::MAINTENANCE_NOTE_ID);
         $note = QubitNote::getOne($criteria);
 
@@ -312,7 +312,7 @@
 
         $note->content = $this->form->getValue($name);
 
-        $this->func->notes[] = $note;
+        $this->resource->notes[] = $note;
 
         break;
 
@@ -350,7 +350,7 @@
             }
 
             $otherName->name = $thisName;
-            $this->func->otherNames[] = $otherName;
+            $this->resource->otherNames[] = $otherName;
           }
         }
 
@@ -366,7 +366,7 @@
         break;
 
       default:
-        $this->func[$field->getName()] = 
$this->form->getValue($field->getName());
+        $this->resource[$field->getName()] = 
$this->form->getValue($field->getName());
     }
   }
 
@@ -388,7 +388,7 @@
     $this->deleteRelations();
 
     // Save function after updating it's attributes
-    $this->func->save();
+    $this->resource->save();
   }
 
   /**
@@ -402,19 +402,19 @@
     $this->form = new sfForm;
     $this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
 
-    $this->func = new QubitFunction;
+    $this->resource = new QubitFunction;
 
     if (isset($request->id))
     {
-      $this->func = QubitFunction::getById($request->id);
+      $this->resource = QubitFunction::getById($request->id);
 
-      if (!$this->func instanceof QubitFunction)
+      if (!$this->resource instanceof QubitFunction)
       {
         $this->forward404();
       }
 
       // Add optimistic lock
-      $this->form->setDefault('serialNumber', $this->func->serialNumber);
+      $this->form->setDefault('serialNumber', $this->resource->serialNumber);
       $this->form->setValidator('serialNumber', new sfValidatorInteger);
       $this->form->setWidget('serialNumber', new sfWidgetFormInputHidden);
     }
@@ -426,8 +426,8 @@
     $criteria->addAlias('rs', QubitObject::TABLE_NAME);
     $criteria->addJoin(QubitRelation::OBJECT_ID, 'ro.id');
     $criteria->addJoin(QubitRelation::SUBJECT_ID, 'rs.id');
-    $criterion1 = $criteria->getNewCriterion(QubitRelation::OBJECT_ID, 
$this->func->id, Criteria::EQUAL);
-    $criterion2 = $criteria->getNewCriterion(QubitRelation::SUBJECT_ID, 
$this->func->id, Criteria::EQUAL);
+    $criterion1 = $criteria->getNewCriterion(QubitRelation::OBJECT_ID, 
$this->resource->id, Criteria::EQUAL);
+    $criterion2 = $criteria->getNewCriterion(QubitRelation::SUBJECT_ID, 
$this->resource->id, Criteria::EQUAL);
     $criterion1->addOr($criterion2);
     $criterion3 = $criteria->getNewCriterion('ro.class_name', 'QubitFunction', 
Criteria::EQUAL);
     $criterion4 = $criteria->getNewCriterion('rs.class_name', 'QubitFunction', 
Criteria::EQUAL);
@@ -441,7 +441,7 @@
     $criteria = new Criteria;
     $criteria->addAlias('ro', QubitObject::TABLE_NAME);
     $criteria->addJoin(QubitRelation::OBJECT_ID, 'ro.id', 
Criteria::INNER_JOIN);
-    $criteria->add(QubitRelation::SUBJECT_ID, $this->func->id);
+    $criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
     $criteria->add('ro.class_name', 'QubitActor');
     $this->actorRelations = QubitRelation::get($criteria);
 
@@ -449,7 +449,7 @@
     $criteria = new Criteria;
     $criteria->addAlias('ro', QubitObject::TABLE_NAME);
     $criteria->addJoin(QubitRelation::OBJECT_ID, 'ro.id', 
Criteria::INNER_JOIN);
-    $criteria->add(QubitRelation::SUBJECT_ID, $this->func->id);
+    $criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
     $criteria->add('ro.class_name', 'QubitInformationObject');
     $this->infoObjectRelations = QubitRelation::get($criteria);
 
@@ -460,7 +460,7 @@
       $this->editTaxonomyCredentials = true;
     }
 
-    // HACK: Use static::$NAMES in PHP 5.3,
+    // HACK Use static::$NAMES in PHP 5.3,
     // http://php.net/oop5.late-static-bindings
     $class = new ReflectionClass($this);
     foreach ($class->getStaticPropertyValue('NAMES') as $name)
@@ -471,11 +471,10 @@
     if ($request->isMethod('post'))
     {
       $this->form->bind($request->getPostParameters());
-
       if ($this->form->isValid())
       {
         $this->processForm();
-        $this->redirect(array($this->func, 'module' => 'function'));
+        $this->redirect(array($this->resource, 'module' => 'function'));
       }
     }
 
@@ -491,12 +490,12 @@
   {
     if (isset($this->request->relations))
     {
-      // Javascript (multiple) relationship update
+      // JavaScript (multiple) relationship update
       $relationsData = $this->request->relations;
     }
     else if (isset($this->request->relation))
     {
-      // Non-javascript (single) relationship update
+      // Non-JavaScript (single) relationship update
       $relationsData = array($this->request->relation);
     }
     else
@@ -545,15 +544,15 @@
       $relation->updateNote($relationData['dateDisplay'], 
QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID);
 
       // Default to current function as subject of relationship
-      if ($relation->subjectId == $this->func->id || null == 
$relation->subjectId)
+      if ($relation->subjectId == $this->resource->id || null == 
$relation->subjectId)
       {
         $relation->object = $relatedFunction;
-        $this->func->relationsRelatedBysubjectId[] = $relation;
+        $this->resource->relationsRelatedBysubjectId[] = $relation;
       }
       else
       {
         $relation->subject = $relatedFunction;
-        $this->func->relationsRelatedByobjectId[] = $relation;
+        $this->resource->relationsRelatedByobjectId[] = $relation;
       }
     }
 
@@ -567,12 +566,12 @@
   {
     if (isset($this->request["{$formName}s"]))
     {
-      // Javascript (multiple) relationship update
+      // JavaScript (multiple) relationship update
       $relationsData = $this->request["{$formName}s"];
     }
     else if (isset($this->request[$formName]))
     {
-      // Non-javascript (single) relationship update
+      // Non-JavaScript (single) relationship update
       $relationsData = array($this->request[$formName]);
     }
     else
@@ -606,9 +605,12 @@
       {
         case 'relatedEntity':
           $object = QubitActor::getById($objectId);
+
           break;
+
         case 'relatedResource':
           $object = QubitInformationObject::getById($objectId);
+
           break;
       }
 
@@ -628,7 +630,7 @@
       $relation->updateNote($relationData['description'], 
QubitTerm::RELATION_NOTE_DESCRIPTION_ID);
       $relation->updateNote($relationData['dateDisplay'], 
QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID);
 
-      $this->func->relationsRelatedBysubjectId[] = $relation;
+      $this->resource->relationsRelatedBysubjectId[] = $relation;
     }
 
     return $this;
@@ -639,7 +641,7 @@
    */
   public function deleteRelations()
   {
-    if (is_array($deleteRelations = $this->request->deleteRelations) && 
count($deleteRelations))
+    if (is_array($deleteRelations = $this->request->deleteRelations))
     {
       foreach ($deleteRelations as $deleteId => $doDelete)
       {

Modified: trunk/apps/qubit/modules/function/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/function/actions/indexAction.class.php     Thu Oct 
14 17:06:15 2010        (r8149)
+++ trunk/apps/qubit/modules/function/actions/indexAction.class.php     Thu Oct 
14 17:27:14 2010        (r8150)
@@ -21,16 +21,16 @@
 {
   public function execute($request)
   {
-    $this->func = QubitFunction::getById($request->id);
+    $this->resource = QubitFunction::getById($request->id);
 
-    if (!isset($this->func))
+    if (!isset($this->resource))
     {
       $this->forward404();
     }
 
-    $this->parallelNames = $this->func->getOtherNames(array('typeId' => 
QubitTerm::PARALLEL_FORM_OF_NAME_ID));
-    $this->otherNames = $this->func->getOtherNames(array('typeId' => 
QubitTerm::OTHER_FORM_OF_NAME_ID));
-    $this->maintenanceNotes = $this->func->getNotesByType(array('noteTypeId' 
=> QubitTerm::MAINTENANCE_NOTE_ID));
+    $this->parallelNames = $this->resource->getOtherNames(array('typeId' => 
QubitTerm::PARALLEL_FORM_OF_NAME_ID));
+    $this->otherNames = $this->resource->getOtherNames(array('typeId' => 
QubitTerm::OTHER_FORM_OF_NAME_ID));
+    $this->maintenanceNotes = 
$this->resource->getNotesByType(array('noteTypeId' => 
QubitTerm::MAINTENANCE_NOTE_ID));
 
     // Find function to function relations with current function as subject or
     // object
@@ -39,8 +39,8 @@
     $criteria->addAlias('rs', QubitObject::TABLE_NAME);
     $criteria->addJoin(QubitRelation::OBJECT_ID, 'ro.id');
     $criteria->addJoin(QubitRelation::SUBJECT_ID, 'rs.id');
-    $criterion1 = $criteria->getNewCriterion(QubitRelation::OBJECT_ID, 
$this->func->id, Criteria::EQUAL);
-    $criterion2 = $criteria->getNewCriterion(QubitRelation::SUBJECT_ID, 
$this->func->id, Criteria::EQUAL);
+    $criterion1 = $criteria->getNewCriterion(QubitRelation::OBJECT_ID, 
$this->resource->id, Criteria::EQUAL);
+    $criterion2 = $criteria->getNewCriterion(QubitRelation::SUBJECT_ID, 
$this->resource->id, Criteria::EQUAL);
     $criterion1->addOr($criterion2);
     $criterion3 = $criteria->getNewCriterion('ro.class_name', 'QubitFunction', 
Criteria::EQUAL);
     $criterion4 = $criteria->getNewCriterion('rs.class_name', 'QubitFunction', 
Criteria::EQUAL);
@@ -48,13 +48,13 @@
     $criterion1->addAnd($criterion3);
     $criteria->add($criterion1);
     $criteria->addAscendingOrderByColumn(QubitRelation::TYPE_ID);
-    $this->functionRelations = QubitRelation::get($criteria);
+    $this->resourcetionRelations = QubitRelation::get($criteria);
 
     // Get information objects (object) related to this function (subject)
     $criteria = new Criteria;
     $criteria->addAlias('ro', QubitObject::TABLE_NAME);
     $criteria->addJoin(QubitRelation::OBJECT_ID, 'ro.id', 
Criteria::INNER_JOIN);
-    $criteria->add(QubitRelation::SUBJECT_ID, $this->func->id);
+    $criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
     $criteria->add('ro.class_name', 'QubitInformationObject');
     $this->infoObjectRelations = QubitRelation::get($criteria);
 
@@ -62,12 +62,12 @@
     $criteria = new Criteria;
     $criteria->addAlias('ro', QubitObject::TABLE_NAME);
     $criteria->addJoin(QubitRelation::OBJECT_ID, 'ro.id', 
Criteria::INNER_JOIN);
-    $criteria->add(QubitRelation::SUBJECT_ID, $this->func->id);
+    $criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
     $criteria->add('ro.class_name', 'QubitActor');
     $this->actorRelations = QubitRelation::get($criteria);
 
     // ISDF validation rules
-    if (QubitAcl::check($this->func, 'update'))
+    if (QubitAcl::check($this->resource, 'update'))
     {
       $validatorSchema = new sfValidatorSchema;
       $validatorSchema->type = new sfValidatorString(array(
@@ -83,9 +83,9 @@
       try
       {
         $validatorSchema->clean(array(
-          'type' => $this->func->type,
-          'authorizedFormOfName' => 
$this->func->getAuthorizedFormOfName(array('cultureFallback' => true)),
-          'descriptionIdentifier' => $this->func->descriptionIdentifier));
+          'type' => $this->resource->type,
+          'authorizedFormOfName' => 
$this->resource->getAuthorizedFormOfName(array('cultureFallback' => true)),
+          'descriptionIdentifier' => $this->resource->descriptionIdentifier));
       }
       catch (sfValidatorErrorSchema $e)
       {

Modified: trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php     Thu Oct 
14 17:06:15 2010        (r8149)
+++ trunk/apps/qubit/modules/function/templates/editIsdfSuccess.php     Thu Oct 
14 17:27:14 2010        (r8150)
@@ -2,12 +2,12 @@
 
 <h1><?php echo __('Edit %1% - ISDF', array('%1%' => 
sfConfig::get('app_ui_label_function'))) ?></h1>
 
-<h1 class="label"><?php echo render_title($func->getLabel()) ?></h1>
+<h1 class="label"><?php echo render_title($resource->getLabel()) ?></h1>
 
 <?php echo $form->renderGlobalErrors() ?>
 
 <?php if (isset($sf_request->id)): ?>
-  <?php echo $form->renderFormTag(url_for(array($func, 'module' => 'function', 
'action' => 'edit')), array('id' => 'editForm')) ?>
+  <?php echo $form->renderFormTag(url_for(array($resource, 'module' => 
'function', 'action' => 'edit')), array('id' => 'editForm')) ?>
 <?php else: ?>
   <?php echo $form->renderFormTag(url_for(array('module' => 'function', 
'action' => 'create')), array('id' => 'editForm')) ?>
 <?php endif; ?>
@@ -25,7 +25,7 @@
 
     <?php echo render_field($form->authorizedFormOfName
       ->help(__('"Record the authorised name of the function being described. 
In cases where the name is not enough, add qualifiers to make it unique such as 
the territorial or administrative scope, or the name of the institution which 
performs it. This element is to be used in conjunction with the Function 
description identifier element (5.4.1)." (ISDF 5.1.2)'))
-      ->label(__('Authorized form of name').'<span class="form-required" 
title="'.__('This is a mandatory element.').'">*</span>'), $func) ?>
+      ->label(__('Authorized form of name').'<span class="form-required" 
title="'.__('This is a mandatory element.').'">*</span>'), $resource) ?>
 
     <?php echo $form->parallelName
       ->help(__('"Purpose: To indicate the various forms in which the 
authorized form(s) of name occurs in other languages or script forms. Rule: 
Record the parallel form(s) of name in accordance with any relevant national or 
international conventions or rules applied by the agency that created the 
description, including any necessary sub elements and/or qualifiers required by 
those conventions or rules. Specify in the Rules and/or conventions element 
(5.4.3.) which rules have been applied." (ISDF 5.1.3)'))
@@ -38,7 +38,7 @@
       ->renderRow() ?>
 
     <?php echo render_field($form->classification
-      ->help(__('"Record any term and/or code from a classification scheme of 
functions. Record the classification scheme used in the element Rules and/or 
conventions used (5.4.3)." (ISDF 5.1.5)')), $func) ?>
+      ->help(__('"Record any term and/or code from a classification scheme of 
functions. Record the classification scheme used in the element Rules and/or 
conventions used (5.4.3)." (ISDF 5.1.5)')), $resource) ?>
 
   </fieldset>
 
@@ -47,16 +47,16 @@
     <legend><?php echo __('Context area') ?></legend>
 
     <?php echo render_field($form->dates
-      ->help(__('"Provide a date or date span which covers the dates when the 
function was started and when it finished. If a function is ongoing, no end 
date is needed." (ISDF 5.2.1)')), $func) ?>
+      ->help(__('"Provide a date or date span which covers the dates when the 
function was started and when it finished. If a function is ongoing, no end 
date is needed." (ISDF 5.2.1)')), $resource) ?>
 
     <?php echo render_field($form->description
-      ->help(__('"Record a narrative description of the purpose of the 
function." (ISDF 5.2.2)')), $func, array('class' => 'resizable')) ?>
+      ->help(__('"Record a narrative description of the purpose of the 
function." (ISDF 5.2.2)')), $resource, array('class' => 'resizable')) ?>
 
     <?php echo render_field($form->history
-      ->help(__('"Record in narrative form or as a chronology the main events 
relating to the function." (ISDF 5.2.3)')), $func, array('class' => 
'resizable')) ?>
+      ->help(__('"Record in narrative form or as a chronology the main events 
relating to the function." (ISDF 5.2.3)')), $resource, array('class' => 
'resizable')) ?>
 
     <?php echo render_field($form->legislation
-      ->help(__('"Record any law, directive or charter which creates, changes 
or ends the function." (ISDF 5.2.4)')), $func, array('class' => 'resizable')) ?>
+      ->help(__('"Record any law, directive or charter which creates, changes 
or ends the function." (ISDF 5.2.4)')), $resource, array('class' => 
'resizable')) ?>
 
   </fieldset>
 
@@ -83,7 +83,7 @@
         <?php foreach ($relatedFunctions as $item): ?>
           <tr id="<?php echo url_for(array($item, 'module' => 'relation')) ?>" 
class="<?php echo 'related_obj_'.$item->id ?>">
             <td>
-              <?php if ($func->id == $item->objectId): ?>
+              <?php if ($resource->id == $item->objectId): ?>
                 <?php echo render_title($item->subject) ?>
               <?php else: ?>
                 <?php echo render_title($item->object) ?>
@@ -123,7 +123,7 @@
     $rowTemplate .= '<td style="text-align: right">'.$editImage.' 
'.$deleteBtn.'</td>';
     $rowTemplate .= '</tr>';
 
-    $linkToShow = url_for(array($func, 'module' => 'function'));
+    $linkToShow = url_for(array($resource, 'module' => 'function'));
 
     echo javascript_tag(<<<EOL
 // Add special rendering rules
@@ -598,15 +598,15 @@
 
     <?php echo render_field($form->descriptionIdentifier
       ->help(__('"Record a unique description identifier in accordance with 
local and/or national conventions. If the description is to be used 
internationally, record the code of the country in which the description was 
created in accordance with the latest version of ISO 3166 Codes for the 
representation of names of countries. Where the creator of the description is 
an international organisation, give the organisational identifier in place of 
the country code." (ISDF 5.4.1)'))
-      ->label(__('Description identifier').'<span class="form-required" 
title="'.__('This is a mandatory element.').'">*</span>'), $func) ?>
+      ->label(__('Description identifier').'<span class="form-required" 
title="'.__('This is a mandatory element.').'">*</span>'), $resource) ?>
 
     <?php echo render_field($form->institutionIdentifier
       ->help(__('"Record the full authorised form of name(s) of agency(ies) 
responsible for creating, modifying or disseminating the description or, 
alternatively, record a recognized code for the agency." (ISDF 5.4.2)'))
-      ->label(__('Institution identifier')), $func) ?>
+      ->label(__('Institution identifier')), $resource) ?>
 
     <?php echo render_field($form->rules
       ->help(__('"Purpose: To identify the national or international 
conventions or rules applied in creating the archival description. Rule: Record 
the names and where useful the editions or publication dates of the conventions 
or rules applied." (ISDF 5.4.3)'))
-      ->label(__('Rules and/or conventions used')), $func, array('class' => 
'resizable')) ?>
+      ->label(__('Rules and/or conventions used')), $resource, array('class' 
=> 'resizable')) ?>
 
     <?php echo $form->descriptionStatus
       ->help(__('The purpose of this field is "[t]o indicate the drafting 
status of the description so that users can understand the current status of 
the description." (ISDF 5.4.4). Select Final, Revised or Draft from the 
drop-down menu.'))
@@ -620,7 +620,7 @@
 
     <?php echo render_field($form->revisionHistory
       ->help(__('"Record the date the description was created and the dates of 
any revisions to the description." (ISDF 5.4.6)'))
-      ->label(__('Dates of creation, revision or deletion')), $func, 
array('class' => 'resizable')) ?>
+      ->label(__('Dates of creation, revision or deletion')), $resource, 
array('class' => 'resizable')) ?>
 
     <?php echo $form->language
       ->help(__('Select the language(s) of this record from the drop-down 
menu; enter the first few letters to narrow the choices. (ISDF 5.4.7)'))
@@ -633,7 +633,7 @@
       ->renderRow(array('class' => 'form-autocomplete')) ?>
 
     <?php echo render_field($form->sources
-      ->help(__('"Record the sources consulted in establishing the function 
description." (ISDF 5.4.8)')), $func, array('class' => 'resizable')) ?>
+      ->help(__('"Record the sources consulted in establishing the function 
description." (ISDF 5.4.8)')), $resource, array('class' => 'resizable')) ?>
 
     <?php echo render_field($form->maintenanceNotes
       ->help(__('"Record notes pertinent to the creation and maintenance of 
the description." (ISDF 5.4.9)')), $maintenanceNote, array('name' => 'content', 
'class' => 'resizable')) ?>
@@ -647,7 +647,7 @@
     <div class="content">
       <ul class="clearfix links">
         <?php if (isset($sf_request->id)): ?>
-          <li><?php echo link_to(__('Cancel'), array($func, 'module' => 
'function')) ?></li>
+          <li><?php echo link_to(__('Cancel'), array($resource, 'module' => 
'function')) ?></li>
           <li><input class="form-submit" type="submit" value="<?php echo 
__('Save') ?>"/></li>
         <?php else: ?>
           <li><?php echo link_to(__('Cancel'), array('module' => 'function', 
'action' => 'list')) ?></li>

Modified: trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php    Thu Oct 
14 17:06:15 2010        (r8149)
+++ trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php    Thu Oct 
14 17:27:14 2010        (r8150)
@@ -1,6 +1,6 @@
 <h1><?php echo __('View ISDF function') ?></h1>
 
-<?php echo link_to_if(QubitAcl::check($func, 'update'), '<h1 
class="label">'.render_title($func).'</h1>', array($func, 'module' => 
'function', 'action' => 'edit'), array('title' => __('Edit function'))) ?>
+<?php echo link_to_if(QubitAcl::check($resource, 'update'), '<h1 
class="label">'.render_title($resource).'</h1>', array($resource, 'module' => 
'function', 'action' => 'edit'), array('title' => __('Edit function'))) ?>
 
 <?php if (isset($errorSchema)): ?>
   <div class="messages error">
@@ -14,11 +14,11 @@
 
 <div class="section" id="identityArea">
 
-  <?php echo link_to_if(QubitAcl::check($func, 'update'), '<h2>'.__('Identity 
area').'</h2>', array($func, 'module' => 'function', 'action' => 'edit'), 
array('anchor' => 'identityArea', 'title' => __('Edit identity area'))) ?>
+  <?php echo link_to_if(QubitAcl::check($resource, 'update'), 
'<h2>'.__('Identity area').'</h2>', array($resource, 'module' => 'function', 
'action' => 'edit'), array('anchor' => 'identityArea', 'title' => __('Edit 
identity area'))) ?>
 
-  <?php echo render_show(__('Type'), render_value($func->type)) ?>
+  <?php echo render_show(__('Type'), render_value($resource->type)) ?>
 
-  <?php echo render_show(__('Authorized form of name'), 
render_value($func->getAuthorizedFormOfName(array('cultureFallback' => true)))) 
?>
+  <?php echo render_show(__('Authorized form of name'), 
render_value($resource->getAuthorizedFormOfName(array('cultureFallback' => 
true)))) ?>
 
   <div class="field">
     <h3><?php echo __('Parallel form(s) of name') ?></h3>
@@ -42,31 +42,31 @@
     </div>
   </div>
 
-  <?php echo render_show(__('Classification'), 
render_value($func->getClassification(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('Classification'), 
render_value($resource->getClassification(array('cultureFallback' => true)))) ?>
 
 </div> <!-- /.section#identityArea -->
 
 <!-- Context area -->
 <div class="section" id="contextArea">
 
-  <?php echo link_to_if(QubitAcl::check($func, 'update'), '<h2>'.__('Context 
area').'</h2>', array($func, 'module' => 'function', 'action' => 'edit'), 
array('anchor' => 'contextArea', 'title' => __('Edit context area'))) ?>
+  <?php echo link_to_if(QubitAcl::check($resource, 'update'), 
'<h2>'.__('Context area').'</h2>', array($resource, 'module' => 'function', 
'action' => 'edit'), array('anchor' => 'contextArea', 'title' => __('Edit 
context area'))) ?>
 
-  <?php echo render_show(__('Dates'), 
render_value($func->getDates(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('Dates'), 
render_value($resource->getDates(array('cultureFallback' => true)))) ?>
 
-  <?php echo render_show(__('Description'), 
render_value($func->getDescription(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('Description'), 
render_value($resource->getDescription(array('cultureFallback' => true)))) ?>
 
-  <?php echo render_show(__('History'), 
render_value($func->getHistory(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('History'), 
render_value($resource->getHistory(array('cultureFallback' => true)))) ?>
 
-  <?php echo render_show(__('Legislation'), 
render_value($func->getLegislation(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('Legislation'), 
render_value($resource->getLegislation(array('cultureFallback' => true)))) ?>
 
 </div> <!-- /.section#contextArea -->
 
 <!-- Relationships area -->
 <div class="section" id="relationshipsArea">
 
-  <?php echo link_to_if(QubitAcl::check($func, 'update'), 
'<h2>'.__('Relationships area').'</h2>', array($func, 'module' => 'function', 
'action' => 'edit'), array('anchor' => 'relationshipsArea', 'title' => __('Edit 
relationships area'))) ?>
+  <?php echo link_to_if(QubitAcl::check($resource, 'update'), 
'<h2>'.__('Relationships area').'</h2>', array($resource, 'module' => 
'function', 'action' => 'edit'), array('anchor' => 'relationshipsArea', 'title' 
=> __('Edit relationships area'))) ?>
 
-  <?php foreach ($functionRelations as $relation): ?>
+  <?php foreach ($resourcetionRelations as $relation): ?>
     <div class="field">
       <h3><?php echo __('Related function') ?></h3>
       <div>
@@ -79,12 +79,12 @@
             </th>
           </tr><tr>
             <td>
-              <?php echo link_to($relation->getOpposedObject($func->id), 
array($relation->getOpposedObject($func->id), 'module' => 'function')) ?>
+              <?php echo link_to($relation->getOpposedObject($resource->id), 
array($relation->getOpposedObject($resource->id), 'module' => 'function')) ?>
             </td>
           </tr>
 
           <!-- Identifier -->
-          <?php if (0 < strlen($identifier = 
$relation->getOpposedObject($func->id)->getDescriptionIdentifier(array('cultureFallback'
 => true)))): ?>
+          <?php if (0 < strlen($identifier = 
$relation->getOpposedObject($resource->id)->getDescriptionIdentifier(array('cultureFallback'
 => true)))): ?>
             <tr>
               <th style="text-align: left; padding: 1px">
                 <?php echo __('Identifier') ?>
@@ -97,14 +97,14 @@
           <?php endif; ?>
 
           <!-- Type of function -->
-          <?php if (isset($relation->getOpposedObject($func->id)->type)): ?>
+          <?php if (isset($relation->getOpposedObject($resource->id)->type)): 
?>
             <tr>
               <th style="text-align: left; padding: 1px">
                 <?php echo __('Type') ?>
               </th>
             </tr><tr>
               <td>
-                <?php echo 
render_value($relation->getOpposedObject($func->id)->type) ?>
+                <?php echo 
render_value($relation->getOpposedObject($resource->id)->type) ?>
               </td>
             </tr>
           <?php endif; ?>
@@ -301,25 +301,25 @@
 <!-- Control area -->
 <div class="section" id="controlArea">
 
-  <?php echo link_to_if(QubitAcl::check($func, 'update'), '<h2>'.__('Control 
area').'</h2>', array($func, 'module' => 'function', 'action' => 'edit'), 
array('anchor' => 'controlArea', 'title' => __('Edit control area'))) ?>
+  <?php echo link_to_if(QubitAcl::check($resource, 'update'), 
'<h2>'.__('Control area').'</h2>', array($resource, 'module' => 'function', 
'action' => 'edit'), array('anchor' => 'controlArea', 'title' => __('Edit 
control area'))) ?>
 
-  <?php echo render_show(__('Description identifier'), 
render_value($func->descriptionIdentifier)) ?>
+  <?php echo render_show(__('Description identifier'), 
render_value($resource->descriptionIdentifier)) ?>
 
-  <?php echo render_show(__('Institution identifier'), 
render_value($func->getInstitutionIdentifier(array('cultureFallback' => 
true)))) ?>
+  <?php echo render_show(__('Institution identifier'), 
render_value($resource->getInstitutionIdentifier(array('cultureFallback' => 
true)))) ?>
 
-  <?php echo render_show(__('Rules and/or conventions used'), 
render_value($func->getRules(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('Rules and/or conventions used'), 
render_value($resource->getRules(array('cultureFallback' => true)))) ?>
 
-  <?php echo render_show(__('Status'), render_value($func->descriptionStatus)) 
?>
+  <?php echo render_show(__('Status'), 
render_value($resource->descriptionStatus)) ?>
 
-  <?php echo render_show(__('Level of detail'), 
render_value($func->descriptionDetail)) ?>
+  <?php echo render_show(__('Level of detail'), 
render_value($resource->descriptionDetail)) ?>
 
-  <?php echo render_show(__('Dates of creation, revision or deletion'), 
render_value($func->getRevisionHistory(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('Dates of creation, revision or deletion'), 
render_value($resource->getRevisionHistory(array('cultureFallback' => true)))) 
?>
 
   <div class="field">
     <h3><?php echo __('Language(s)') ?></h3>
     <div>
       <ul>
-        <?php foreach ($func->language as $code): ?>
+        <?php foreach ($resource->language as $code): ?>
           <li><?php echo format_language($code) ?></li>
         <?php endforeach; ?>
       </ul>
@@ -330,14 +330,14 @@
     <h3><?php echo __('Script(s)') ?></h3>
     <div>
       <ul>
-        <?php foreach ($func->script as $code): ?>
+        <?php foreach ($resource->script as $code): ?>
           <li><?php echo format_script($code) ?></li>
         <?php endforeach; ?>
       </ul>
     </div>
   </div>
 
-  <?php echo render_show(__('Sources'), 
render_value($func->getSources(array('cultureFallback' => true)))) ?>
+  <?php echo render_show(__('Sources'), 
render_value($resource->getSources(array('cultureFallback' => true)))) ?>
 
   <div class="field">
     <h3><?php echo __('Maintenance notes') ?></h3>
@@ -351,18 +351,18 @@
 </div> <!-- /.section#controlArea -->
 
 
-<?php if ((QubitAcl::check($func, 'update')) || (QubitAcl::check($func, 
'delete')) || (QubitAcl::check($func, 'create'))): ?>
+<?php if ((QubitAcl::check($resource, 'update')) || 
(QubitAcl::check($resource, 'delete')) || (QubitAcl::check($resource, 
'create'))): ?>
   <div class="actions section">
     <h2 class="element-invisible"><?php echo __('Actions') ?></h2>
     <div class="content">
       <ul class="clearfix links">
-        <?php if (QubitAcl::check($func, 'update')): ?>
-          <li><?php echo link_to(__('Edit'), array($func, 'module' => 
'function', 'action' => 'edit'), array('title' => __('Edit'))) ?></li>
+        <?php if (QubitAcl::check($resource, 'update')): ?>
+          <li><?php echo link_to(__('Edit'), array($resource, 'module' => 
'function', 'action' => 'edit'), array('title' => __('Edit'))) ?></li>
         <?php endif; ?>
-        <?php if (QubitAcl::check($func, 'delete')): ?>
-          <li><?php echo link_to(__('Delete'), array($func, 'module' => 
'function', 'action' => 'delete'), array('title' => __('Delete'))) ?></li>
+        <?php if (QubitAcl::check($resource, 'delete')): ?>
+          <li><?php echo link_to(__('Delete'), array($resource, 'module' => 
'function', 'action' => 'delete'), array('title' => __('Delete'))) ?></li>
         <?php endif; ?>
-        <?php if (QubitAcl::check($func, 'create')): ?>
+        <?php if (QubitAcl::check($resource, 'create')): ?>
           <li><?php echo link_to(__('Add new'), array('module' => 'function', 
'action' => 'create'), array('title' => __('Add new'))) ?></li>
         <?php endif; ?>
       </ul>

-- 
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.

Reply via email to