fileSystemRoot/presentation/Html.inc"); /** * $Id$ * * Dashboard page html UI building functions. * * Licensed under the GNU GPL. For full terms see the file COPYING. * * @version $Revision$ * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa * @package presentation */ /** * just a tmp document forging class */ class tmpDocument { var $title; var $id; var $status; var $days; var $statuses = array("good", "bad", "indifferent"); /** * generate random attribute data on instantiation */ function tmpDocument() { // initialise the random number generator srand ((float) microtime() * 10000000); // generate a random document title $number = rand(0,500); $this->title = "document title $number"; $this->id = $number; // generate a random status $this->status = $this->statuses[array_rand($this->statuses, 1)]; // random days $this->days = rand(0,25); } function getTitleLink() { /* return "id . "\">" . $this->title . ""; */ return "$this->title"; } function getStatus() { return $this->status; } function getDays() { return $this->days; } } function getPendingDocuments() { // generate random document objects and return return array(new tmpDocument(), new tmpDocument(), new tmpDocument()); } function getCheckedoutDocuments() { // generate random document objects and return return array(new tmpDocument(), new tmpDocument(), new tmpDocument()); } function getSubscriptionDocuments() { /* global $default; $sQuery = "SELECT D.name, D.modified, DTT.datetime AS created, U.name AS initiator, CONCAT(CONCAT(D.major_version, '.'), D.minor_version) AS version, WDSL.name AS status " . "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_web_documents_table AS WD ON WD.document_id = D.ID " . "INNER JOIN $default->owl_web_documents_status_table AS WDSL ON WD.status_id = WDSL.id " . "INNER JOIN $default->owl_users_table AS U ON U.id = D.creator_id " . "INNER JOIN $default->owl_document_transactions_table AS DTT ON DTT.document_id = D.id " . "INNER JOIN $default->owl_transaction_types_table AS TT ON DTT.transaction_id = TT.id " . "WHERE D.id = " . $oDocument->getID() . " " . "AND TT.name LIKE 'Create'"; $aColumns = array("name", "last_modified", "created", "initiator", "version", "status"); $aColumnNames = array("Document title", "Last updated", "Created", "Document initiator", "Version", "Status"); $aColumnTypes = array(1,1,1,1,1); $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); $oPatternListFromQuery->setTableHeading("Document Data"); $oPatternListFromQuery->setTableWidth("90%"); return $oPatternListFromQuery->render(); */ // you know the drill return array(new tmpDocument(), new tmpDocument(), new tmpDocument()); } function pendingDocumentsHeaders() { return " Title Status Days "; } function checkedOutDocumentsHeaders() { return " Title Days "; } function subscriptionDocumentsHeaders() { return " Title Status Days "; } function getPage() { $sToRender = renderDocumentPath($oDocument) . "\n
\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "
\n"; $sToRender .= "\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t\t\n"; //$sToRender .= "\t\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t\t\n"; //$sToRender .= "\t\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t
" . wrapInTable(renderDocumentData($oDocument)) . "" . renderGenericDocumentMetaData($oDocument) . "
" . wrapInTable(renderGenericMetaData($oDocument)) . "
" . wrapInTable(renderTypeSpecificMetaData($oDocument)) . "" . renderTypeSpecificMetaData($oDocument) . "
\n"; $sToRender .= "
\n"; $sToRender .= "\t\n"; $sToRender .= "\t\n"; $sToRender .= "\t\t\n"; //$sToRender .= "\t\t\n"; $sToRender .= "\t"; $sToRender .= "\t
" . wrapInTable(renderNonEditableDocumentRouting($oDocument)) . "" . renderDocumentRouting($oDocument) . "
"; $sToRender .= "
"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "
graphicsUrl/widgets/download.gif\" border=\"0\" />graphicsUrl/widgets/email.gif\" border=\"0\" />
\n"; } ?>