dashboardUI.inc
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
require_once("$default->owl_fs_root/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 <michael@jamwarehouse.com>, 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 "<a href=\"control.php?action=viewDocument&fDocumentID=" . $this->id . "\">" .
$this->title . "</a>";
}
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() {
// you know the drill
return array(new tmpDocument(), new tmpDocument(), new tmpDocument());
}
function pendingDocumentsHeaders() {
return "<th align=\"left\" width=\"33%\">
<span class=\"sectionColumns\">Title</span>
</th>
<th align=\"left\" width=\"33%\">
<span class=\"sectionColumns\">Status</span>
</th>
<th align=\"left\" width=\"33%\">
<span class=\"sectionColumns\">Days</span>
</th>";
}
function checkedOutDocumentsHeaders() {
return "<th align=\"left\" width=\"33%\">
<span class=\"sectionColumns\">Title</span>
</th>
<th align=\"left\" width=\"66%\">
<span class=\"sectionColumns\">Days</span>
</th>";
}
function subscriptionDocumentsHeaders() {
return "<th align=\"left\" width=\"33%\">
<span class=\"sectionColumns\">Title</span>
</th>
<th align=\"left\" width=\"33%\">
<span class=\"sectionColumns\">Status</span>
</th>
<th align=\"left\" width=\"33%\">
<span class=\"sectionColumns\">Days</span>
</th>";
}