diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
index 08c03ce..2d71665 100644
--- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
+++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
@@ -144,32 +144,40 @@ function renderDocumentArchiveSettingsDetails($oDocument, $bEditable) {
// retrieve the appropriate settings given the document id
$oDocumentArchiving = DocumentArchiving::getFromDocumentID($oDocument->getID());
- // retrieve the settings
- $oArchiveSettings = ArchivingSettings::get($oDocumentArchiving->getArchivingSettingsID());
- // switch on archiving type
- $sArchivingType = lookupName($default->archiving_type_lookup_table, $oArchiveSettings->getArchivingTypeID());
- $oTimePeriod = TimePeriod::get($oArchiveSettings->getTimePeriodID());
-
- switch ($sArchivingType) {
- case "Date" :
- $sDisplayText = "Expiration Date: " . $oArchiveSettings->getExpirationDate();
- if ($oTimePeriod) {
- $sDisplayText .= "
Expires after " . $oTimePeriod->getUnits() . " ";
- $sDisplayText .= lookupName($default->time_unit_lookup_table, $oTimePeriod->getTimeUnitID()) . " from document creation date";
- }
- break;
- case "Utilisation" :
- $sDisplayText .= "Archive document " . $oTimePeriod->getUnits() . " ";
- $sDisplayText .= lookupName($default->time_unit_lookup_table, $oTimePeriod->getTimeUnitID());
- $sDisplayText .= " after the last " . lookupName($default->transaction_types_table, $oArchiveSettings->getDocumentTransactionID()) . " transaction";
- break;
- }
+ if ($oDocumentArchiving) {
+ // retrieve the settings
+ $oArchiveSettings = ArchivingSettings::get($oDocumentArchiving->getArchivingSettingsID());
+ // switch on archiving type
+ $sArchivingType = lookupName($default->archiving_type_lookup_table, $oArchiveSettings->getArchivingTypeID());
+ $oTimePeriod = TimePeriod::get($oArchiveSettings->getTimePeriodID());
+
+ $sDisplayText = "
| Archiving Type: $sArchivingType | "; + $sToRender .= "" . $sArchivingType . " | "; $sToRender .= "|
|---|---|---|
| $sDisplayText | " . ($bEditable ? "" . generateControllerLink("modifyDocumentArchiveSettings", "fDocumentID=" . $oDocument->getID(), "Edit") . " | " : ""); + $sToRender .= "$sDisplayText | "; $sToRender .= "