Author: fortim
Date: Tue Sep 8 20:27:19 2009
New Revision: 3199
Log:
Updated last harvest date
Modified:
trunk/apps/qubit/modules/oai/actions/harvesterListAction.class.php
trunk/apps/qubit/modules/oai/templates/harvesterListSuccess.php
trunk/lib/model/QubitOaiHarvest.php
Modified: trunk/apps/qubit/modules/oai/actions/harvesterListAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/oai/actions/harvesterListAction.class.php Tue Sep
8 16:47:38 2009 (r3198)
+++ trunk/apps/qubit/modules/oai/actions/harvesterListAction.class.php Tue Sep
8 20:27:19 2009 (r3199)
@@ -38,11 +38,6 @@
$this->form = new OaiAddRepositoryForm();
$this->repositories = QubitOaiRepository::getRepositories();
$this->harvestJob = array();
- foreach ($this->repositories as $rep)
- {
- $rep->getOaiHarvests();
-
- }
if ($request->isMethod('post'))
{
$this->form->bind($request->getParameter('oai_harvester'));
Modified: trunk/apps/qubit/modules/oai/templates/harvesterListSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/oai/templates/harvesterListSuccess.php Tue Sep
8 16:47:38 2009 (r3198)
+++ trunk/apps/qubit/modules/oai/templates/harvesterListSuccess.php Tue Sep
8 20:27:19 2009 (r3199)
@@ -18,7 +18,7 @@
<tr>
<td>
<div>
- <a href="<?php echo $rep->getUri();?>?verb=Identify"><?php echo
$rep->getName(); ?></a><br>Last Harvest: <?php echo $rep->getLastHarvest();?>
+ <a href="<?php echo $rep->getUri();?>?verb=Identify"><?php echo
$rep->getName(); ?></a><br>Last Harvest: <?php $harvest =
QubitOaiHarvest::getLastHarvest($rep->getId()); echo
$harvest->getLastHarvestAttempt();;?>
</div>
</td>
<td>
Modified: trunk/lib/model/QubitOaiHarvest.php
==============================================================================
--- trunk/lib/model/QubitOaiHarvest.php Tue Sep 8 16:47:38 2009 (r3198)
+++ trunk/lib/model/QubitOaiHarvest.php Tue Sep 8 20:27:19 2009 (r3199)
@@ -27,4 +27,19 @@
*/
class QubitOaiHarvest extends BaseOaiHarvest
{
+
+ /**
+ * Get last harvest for a repository
+ * @var int id, the id for the repository
+ * @return date the last harvest date for that repository
+ */
+ public static function getLastHarvest($id)
+ {
+ $criteria = new Criteria;
+ $criteria->add(QubitOaiHarvest::OAI_REPOSITORY_ID, $id);
+ $criteria->addDescendingOrderByColumn(QubitOaiHarvest::LAST_HARVEST);
+ $harvests = self::get($criteria);
+ return $harvests[0];
+ }
+
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---