Commit 176e36547ada11368c0e60e9525c93dfaee014c0
1 parent
1d4a512b
mocked up dashboard
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@274 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
106 additions
and
20 deletions
dashboard.php
| ... | ... | @@ -17,15 +17,12 @@ |
| 17 | 17 | // main library routines and defaults |
| 18 | 18 | |
| 19 | 19 | require_once("./config/dmsDefaults.php"); |
| 20 | -require_once("$default->owl_fs_root/lib/owl.lib.php"); | |
| 21 | -require_once("$default->owl_fs_root/config/html.php"); | |
| 22 | -require_once("$default->owl_fs_root/lib/control.inc"); | |
| 23 | -require_once("$default->owl_fs_root/lib/Session.inc"); | |
| 24 | 20 | require_once("$default->owl_fs_root/lib/SiteMap.inc"); |
| 25 | 21 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternMainPage.inc"); |
| 26 | 22 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternImage.inc"); |
| 27 | 23 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableLinks.inc"); |
| 28 | 24 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableSqlQuery.inc"); |
| 25 | +require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); | |
| 29 | 26 | |
| 30 | 27 | // ------------------------------- |
| 31 | 28 | // page start |
| ... | ... | @@ -36,23 +33,116 @@ if (checkSession()) { |
| 36 | 33 | // check if this page is authorised, ie. has come from control.php |
| 37 | 34 | if ($_SESSION["authorised"]) { |
| 38 | 35 | // create a page |
| 39 | - | |
| 36 | + | |
| 40 | 37 | // logo |
| 41 | 38 | $img = new PatternImage("$default->owl_root_url/locale/$default->owl_lang/graphics/$default->logo"); |
| 39 | + $img->setImgSize(238, 178); | |
| 42 | 40 | |
| 43 | 41 | // build the top menu of links |
| 44 | - $aTopMenuLinks = array(0=>generateControllerUrl("logout"), 1=>generateControllerUrl("scratchPad")); | |
| 45 | - $aTopMenuText = array(0=>"logout", 1=>"scratchPad"); | |
| 46 | - $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, $aTopMenuText, 3, 1); | |
| 42 | + // TODO: this is a function of the sitemap | |
| 43 | + // get list of sections | |
| 44 | + $aTopMenuLinks = array(generateControllerUrl("dashboard"), generateControllerUrl("browse"), generateControllerUrl("subscriptions"), | |
| 45 | + generateControllerUrl("search"), generateControllerUrl("administration"), generateControllerUrl("preferences"), generateControllerUrl("help")); | |
| 46 | + $aTopMenuText = array("Dashboard", "Browse Documents", "Subscriptions", "Advanced Search", "Administration", "Preferences", "Help", "Logout"); | |
| 47 | + $aTopMenuImages = array("$default->owl_graphics_url/dashboard.jpg", "$default->owl_graphics_url/browse.jpg", | |
| 48 | + "$default->owl_graphics_url/subscriptions.jpg", "$default->owl_graphics_url/search.jpg", | |
| 49 | + "$default->owl_graphics_url/administration.jpg", "$default->owl_graphics_url/preferences.jpg", | |
| 50 | + "$default->owl_graphics_url/help.jpg", "$default->owl_graphics_url/logout.jpg"); | |
| 47 | 51 | |
| 52 | + $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 8, 2, $aTopMenuImages); | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 48 | 56 | // build the central dashboard |
| 49 | - /* | |
| 50 | - $aCentralPageColumns = array(0=>"name",1=>"parent",2=>"security"); | |
| 51 | - $aColumnTypes = array(0=>1,1=>2,2=>1); | |
| 52 | - $oTableSqlQuery = & new PatternTableSqlQuery("Folders", $aCentralPageColumns, $aColumnTypes); | |
| 53 | - ($HTTP_GET_VARS["fStartIndex"]) ? $oTableSqlQuery->setStartIndex($HTTP_GET_VARS["fStartIndex"]) : $oTableSqlQuery->setStartIndex(0); | |
| 54 | - $oTableSqlQuery->setLinkType(1); | |
| 55 | - */ | |
| 57 | + //- pending documents (document approval) | |
| 58 | + //- checked out documents | |
| 59 | + //- subscriptions | |
| 60 | + $sHtml = "<table border=\"1\" width=\"100%\"> | |
| 61 | + <tr><td> | |
| 62 | + <table> | |
| 63 | + <tr> | |
| 64 | + <td colspan=\"3\"> | |
| 65 | + Pending Documents | |
| 66 | + </td> | |
| 67 | + </tr> | |
| 68 | + <tr> | |
| 69 | + <td width=\"33%\"> | |
| 70 | + Title | |
| 71 | + </td> | |
| 72 | + <td width=\"33%\"> | |
| 73 | + Status | |
| 74 | + </td> | |
| 75 | + <td width=\"33%\"> | |
| 76 | + Days | |
| 77 | + </td> | |
| 78 | + </tr>"; | |
| 79 | + /* | |
| 80 | + $aPendingDocumentList = getPendingDocuments($_SESSION["userID"]); | |
| 81 | + for ($i = 0; $i < count($aPendingDocumentList); $i++) { | |
| 82 | + $sHtml = $sHtml . "<tr><td>" . $aPendingDocumentList[$i] . "</td></tr>"; | |
| 83 | + } | |
| 84 | + */ | |
| 85 | + $sHtml = $sHtml . " | |
| 86 | + </table> | |
| 87 | + </td></tr> | |
| 88 | + | |
| 89 | + <tr><td width=80%> | |
| 90 | + <table border=2> | |
| 91 | + <tr align=\"center\"> | |
| 92 | + <td colspan=2> | |
| 93 | + Checked Out Documents | |
| 94 | + </td> | |
| 95 | + </tr> | |
| 96 | + <tr> | |
| 97 | + <td width=\"33%\"> | |
| 98 | + Title | |
| 99 | + </td> | |
| 100 | + <td width=\"66%\"> | |
| 101 | + Days | |
| 102 | + </td> | |
| 103 | + </tr>"; | |
| 104 | + /* | |
| 105 | + $aCheckedOutDocumentList = getCheckedOutDocuments($_SESSION["userID"]); | |
| 106 | + for ($i = 0; $i < count($aCheckedOutDocumentList); $i++) { | |
| 107 | + $sHtml = $sHtml . "<tr><td>" . $aCheckedOutDocumentList[$i] . "</td></tr>"; | |
| 108 | + } | |
| 109 | + */ | |
| 110 | + $sHtml = $sHtml . " | |
| 111 | + </table> | |
| 112 | + </td></tr> | |
| 113 | + | |
| 114 | + <tr><td> | |
| 115 | + <table> | |
| 116 | + <tr> | |
| 117 | + <td> | |
| 118 | + Subscriptions Alerts | |
| 119 | + </td> | |
| 120 | + </tr> | |
| 121 | + <tr> | |
| 122 | + <td width=\"33%\"> | |
| 123 | + Title | |
| 124 | + </td> | |
| 125 | + <td width=\"33%\"> | |
| 126 | + Status | |
| 127 | + </td> | |
| 128 | + <td width=\"33%\"> | |
| 129 | + Days | |
| 130 | + </td> | |
| 131 | + </tr>"; | |
| 132 | + /* | |
| 133 | + $aSubscriptionList = getSubscriptionAlerts($_SESSION["userID"]); | |
| 134 | + for ($i = 0; $i < count($aSubscriptionList); $i++) { | |
| 135 | + $sHtml = $sHtml . "<tr><td>" . $aSubscriptionList[$i] . "</td></tr>"; | |
| 136 | + } | |
| 137 | + */ | |
| 138 | + $sHtml = $sHtml . " | |
| 139 | + </table> | |
| 140 | + </td></tr> | |
| 141 | + </table>"; | |
| 142 | + | |
| 143 | + | |
| 144 | + $oContent = new PatternCustom(); | |
| 145 | + $oContent->setHtml($html); | |
| 56 | 146 | |
| 57 | 147 | /* get a page */ |
| 58 | 148 | $tmp = new PatternMainPage(); |
| ... | ... | @@ -60,7 +150,7 @@ if (checkSession()) { |
| 60 | 150 | /* put the page together */ |
| 61 | 151 | $tmp->setNorthWestPayload($img); |
| 62 | 152 | $tmp->setNorthPayload($oPatternTableLinks); |
| 63 | - //$tmp->setCentralPayload($oTableSqlQuery); | |
| 153 | + $tmp->setCentralPayload($oContent); | |
| 64 | 154 | $tmp->setFormAction("dashboard.php"); |
| 65 | 155 | $tmp->render(); |
| 66 | 156 | |
| ... | ... | @@ -69,10 +159,6 @@ if (checkSession()) { |
| 69 | 159 | print "you do not have access to view this page! please go away, and come back when you do.<br>"; |
| 70 | 160 | echo generateLink("logout") . "logout</a>"; |
| 71 | 161 | } |
| 72 | -} else { | |
| 73 | - // no session, should have been redirected | |
| 74 | - echo "no session<br>"; | |
| 75 | - print_r($_SESSION); | |
| 76 | 162 | } |
| 77 | 163 | ?> |
| 78 | 164 | ... | ... |