, Jam Warehouse (Pty) Ltd, South Africa * @package presentation.lookAndFeel.knowledgeTree.administration.news */ /** * Display the heading * FIXME: need to refactor this */ function renderHeading($sHeading) { global $default; $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); $sColor = $default->siteMap->getSectionColour($sSectionName, "th"); $sToRender = "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "
$sHeading
\n"; return $sToRender; } /** * Displays an error message */ function renderErrorMessage($sErrorMessage) { $sToRender = ""; $sToRender .= ""; $sToRender .= "

$sErrorMessage

"; return $sToRender; } function renderDocumentTransactionListBox($iDocumentTransactionID) { global $default; $oPatternListBox = & new PatternListBox($default->owl_transaction_types_table, "name", "id", "fDocumentTransactionID"); if (isset($iDocumentTransactionID)) { $oPatternListBox->setSelectedValue($iDocumentTransactionID); } return $oPatternListBox->render(); } function renderArchivingTypeListBox() { global $default, $fArchivingTypeID; $oPatternListBox = & new PatternListBox($default->owl_archiving_type_lookup_table, "name", "id", "fArchivingTypeID"); $oPatternListBox->setPostBackOnChange(true); $oPatternListBox->setSelectedValue($fArchivingTypeID); return $oPatternListBox->render(); } function renderTimeUnitsListBox($iTimeUnitID) { global $default; $oPatternListBox = & new PatternListBox($default->owl_time_unit_lookup_table, "name", "id", "fTimeUnitID"); if (isset($iTimeUnitID)) { $oPatternListBox->setSelectedValue($iTimeUnitID); } return $oPatternListBox->render(); } function renderChooseArchivingTypeForm() { global $default, $fDocumentID; $sToRender = ""; $sToRender .= ""; $sToRender .= ""; // hidden archive settings references $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "
Choose the archiving type for this document
Archiving Type:" . renderArchivingTypeListBox() . "
rootUrl/control.php?action=viewDocument&fDocumentID=$fDocumentID\">graphicsUrl/widgets/cancel.gif\" border=\"0\" />
"; return $sToRender; } function getDateArchivingJavascript() { $sToRender .= "\n\n\n\n"; return $sToRender; } function getUtilisationArchivingJavascript() { $sToRender .= "\n\n\n\n"; return $sToRender; } function renderTimePeriod($sHeading, $oTimePeriod = null) { global $default; if (strlen($sHeading) > 0) { $sToRender .= "$sHeading:"; } $sToRender .= "getUnits() : "") . "\">"; $sToRender .= "  " . renderTimeUnitsListBox( ($oTimePeriod ? $oTimePeriod->getTimeUnitID() : null) ); $sToRender .= "  graphicsUrl/widgets/clear.gif\" border=\"0\">"; return $sToRender; } /** * Displays the edit archive settings form * * @param integer the archive settings to modify, null display an add form */ function renderArchiveSettingsForm($oDocumentArchiving = null) { global $default, $fDocumentID; if (is_a($oDocumentArchiving, "DocumentArchiving")) { $sToRender .= "(in order to change the archiving type for this document, click the 'Remove' button and add new archiving settings)"; $iArchivingTypeID = $oDocumentArchiving->getArchivingTypeID(); } else { $iArchivingTypeID = (integer)$oDocumentArchiving; unset($oDocumentArchiving); } $sArchivingType = lookupName($default->owl_archiving_type_lookup_table, $iArchivingTypeID); $sToRender .= ""; // TODO: calendar control integration switch ($sArchivingType) { case "Date" : if ($oDocumentArchiving) { // get date settings from document archiving $oDateArchivingSettings = ArchivingDateSettings::get($oDocumentArchiving->getArchivingSettingsID()); } $sToRender .= ""; $sToRender .= ""; $sToRender .= ""; if ($oDateArchivingSettings) { $oTimePeriod = TimePeriod::get($oDateArchivingSettings->getTimePeriodID()); $sToRender .= renderTimePeriod("Expires after", $oTimePeriod); } else { $sToRender .= renderTimePeriod("Expires after"); } $sToRender .= getDateArchivingJavascript(); break; case "Utilisation" : if ($oDocumentArchiving) { // get date settings from document archiving $oUtilisationArchivingSettings = ArchivingUtilisationSettings::get($oDocumentArchiving->getArchivingSettingsID()); $iDocumentTransactionID = $oUtilisationArchivingSettings->getDocumentTransactionID(); } $sToRender .= ""; $sToRender .= ""; if ($oUtilisationArchivingSettings) { $oTimePeriod = TimePeriod::get($oUtilisationArchivingSettings->getTimePeriodID()); $sToRender .= renderTimePeriod("Time since last transaction", $oTimePeriod); } else { $sToRender .= renderTimePeriod("Time since last transaction"); } $sToRender .= getUtilisationArchivingJavascript(); break; } // hidden archive settings references $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; if ($oDocumentArchiving) { $sToRender .= "\n"; $sToRender .= "
Archive By Date
Expiration Date:
getExpirationDate() == "0000-00-00" ? "" : $oDateArchivingSettings->getExpirationDate()) : "") . "\">"; $sToRender .= "  graphicsUrl/calendar/calendar.gif\" name=\"imgCalendar\" width=\"34\" height=\"21\" border=\"0\" alt=\"\">"; $sToRender .= "  graphicsUrl/widgets/clear.gif\" border=\"0\">
Archive By Utilisation
Document Transaction:" . renderDocumentTransactionListBox($iDocumentTransactionID) . "
graphicsUrl/widgets/update.gif\" border=\"0\">\n"; $sToRender .= "rootUrl/control.php?action=modifyDocumentArchiveSettings&fDocumentID=$fDocumentID&fDelete=1\">graphicsUrl/widgets/remove.gif\" border=\"0\" />\n"; } else { $sToRender .= "
graphicsUrl/widgets/submit.gif\" border=\"0\">\n"; } $sToRender .= "rootUrl/control.php?action=viewDocument&fDocumentID=$fDocumentID\">graphicsUrl/widgets/cancel.gif\" border=\"0\" />
"; return $sToRender; } /** * Displays the edit document archive settings page */ function renderEditArchiveSettingsPage($oDocumentArchiving, $sErrorMessage = "") { global $default; $sToRender .= renderHeading("Edit Document Archive Settings"); if (strlen($sErrorMessage) > 0) { $sToRender .= renderErrorMessage($sErrorMessage); } $sToRender .= "\n"; $sToRender .= renderArchiveSettingsForm($oDocumentArchiving); $sToRender .= "
\n"; return $sToRender; } /** * Displays the add document archive settings page */ function renderAddArchiveSettingsPage($iArchivingTypeID, $sErrorMessage = "") { global $default; $sToRender .= renderHeading("Add Document Archive Settings"); if (strlen($sErrorMessage) > 0) { $sToRender .= renderErrorMessage($sErrorMessage); } $sToRender .= "\n"; if ($iArchivingTypeID) { $sToRender .= renderArchiveSettingsForm($iArchivingTypeID); } else { $sToRender .= renderChooseArchivingTypeForm(); } $sToRender .= "
\n"; return $sToRender; } function wrap($html) { global $default; return " Javascript Calendar Example by Lea Smart uiUrl/calendar.css\"> " . $html . " "; } /** * Display the confirmation page for manual archiving of a document */ function renderArchiveConfirmationPage() { } ?>