Author: sevein
Date: Thu Jul 28 19:03:05 2011
New Revision: 9414

Log:
Add extra queries to relation/indexAction and update route

Added:
   
trunk/plugins/qtAccessionPlugin/modules/accession/actions/relatedDonorAction.class.php
Modified:
   trunk/plugins/qtAccessionPlugin/modules/accession/templates/_relatedDonor.php

Added: 
trunk/plugins/qtAccessionPlugin/modules/accession/actions/relatedDonorAction.class.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
trunk/plugins/qtAccessionPlugin/modules/accession/actions/relatedDonorAction.class.php
      Thu Jul 28 19:03:05 2011        (r9414)
@@ -0,0 +1,64 @@
+<?php
+
+/*
+ * This file is part of Qubit Toolkit.
+ *
+ * Qubit Toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Qubit Toolkit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Qubit Toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class AccessionRelatedDonorAction extends RelationIndexAction
+{
+  public function extraQueries($value)
+  {
+    if (null !== $contact = $this->resource->object->getPrimaryContact())
+    {
+      if (isset($contact->streetAddress))
+      {
+        $value['streetAddress'] = $contact->streetAddress;
+      }
+
+      if (isset($contact->region))
+      {
+        $value['region'] = $contact->region;
+      }
+
+      if (isset($contact->countryCode))
+      {
+        $value['countryCode'] = $contact->countryCode;
+      }
+
+      if (isset($contact->postalCode))
+      {
+        $value['postalCode'] = $contact->postalCode;
+      }
+
+      if (isset($contact->telephone))
+      {
+        $value['telephone'] = $contact->telephone;
+      }
+
+      if (isset($contact->email))
+      {
+        $value['email'] = $contact->email;
+      }
+
+      if (isset($contact->contactPerson))
+      {
+        $value['contactPerson'] = $contact->contactPerson;
+      }
+    }
+
+    return $value;
+  }
+}

Modified: 
trunk/plugins/qtAccessionPlugin/modules/accession/templates/_relatedDonor.php
==============================================================================
--- 
trunk/plugins/qtAccessionPlugin/modules/accession/templates/_relatedDonor.php   
    Thu Jul 28 19:01:57 2011        (r9413)
+++ 
trunk/plugins/qtAccessionPlugin/modules/accession/templates/_relatedDonor.php   
    Thu Jul 28 19:03:05 2011        (r9414)
@@ -20,7 +20,7 @@
       </tr>
     </thead><tbody>
       <?php foreach ($relatedDonorRecord as $item): ?>
-        <tr class="<?php echo 0 == @++$row % 2 ? 'even' : 'odd' ?> 
related_obj_<?php echo $item->id ?>" id="<?php echo url_for(array($item, 
'module' => 'relation')) ?>">
+        <tr class="<?php echo 0 == @++$row % 2 ? 'even' : 'odd' ?> 
related_obj_<?php echo $item->id ?>" id="<?php echo url_for(array($item, 
'module' => 'accession', 'action' => 'relatedDonor')) ?>">
           <td>
             <?php echo render_title($item->object) ?>
           </td><td style="text-align: center">

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