collaborationUI.inc
3.78 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
<?php
/**
* $Id$
*
* Presentation data for collaborationBL.php.
*
* Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @version $Revision$
* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
* @package documentmanagement
*/
function getGroupRow($iGroupID) {
$oGroup = Group::get($iGroupID);
return "<input type=\"hidden\" name=\"fGroupID\" value=\"" . $iGroupID . "\" />" . $oGroup->getName();
}
function getUserDropDown($iGroupID, $iUserID) {
global $default;
$oPatternListBox = & new PatternListBox("$default->users_table", "name", "id", "fUserID");
$sFromClause = "INNER JOIN $default->users_groups_table AS UGL ON ST.id = UGL.user_id ";
$oPatternListBox->setFromClause($sFromClause);
$sWhereClause = "UGL.group_id = $iGroupID";
$oPatternListBox->setWhereClause($sWhereClause);
$oPatternListBox->setIncludeDefaultValue(false);
if (isset($iUserID)) {
$oPatternListBox->setSelectedValue($iUserID);
}
$oPatternListBox->setEmptyErrorMessage("There are no users in this group");
return $oPatternListBox->render();
}
function getRole($iRoleID) {
$oRole = Role::get($iRoleID);
return "<input type=\"hidden\" name=\"fRoleID\" value=\"$iRoleID\" />" . $oRole->getName();
/*global $default;
$oPatternListBox = & new PatternListBox("$default->roles_table", "name", "id", "fRoleID");
if (isset($iRoleID)) {
$oPatternListBox->setSelectedValue($iRoleID);
}
$oPatternListBox->setEmptyErrorMessage("There are no users in this group");
return $oPatternListBox->render();*/
}
function getDocumentRoutingPage($iGroupID, $iUserID, $iRoleID, $iSequenceNumber, $fDocumentID) {
global $default;
$sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
$sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td");
$sTHBGColour = $default->siteMap->getSectionColour($sSectionName, "th");
return renderHeading(_("Edit Document Approval Routing")) .
displayDocumentPath($fDocumentID) .
"<table cellspacing=2, cellpadding=2, border=0>\n" .
"<caption><b>" . _("Document Routing") . "</b></caption>\n" .
"<tr>\n" .
"<td bgcolor=\"$sTDBGColour\"><b>" . _("Group") . "</b></td><td>".getGroupRow($iGroupID)."</td>\n" .
"</tr>\n" .
"<tr>\n" .
"<td bgcolor=\"$sTDBGColour\"><b>" . _("Role") . "</b></td><td bgcolor=\"F5F6EE\">".getRole($iRoleID)."</td>\n" .
"</tr>\n" .
"<tr>\n" .
"<td bgcolor=\"$sTDBGColour\"><b>" . _("Player") . "</b></td><td>".getUserDropDown($iGroupID, $iUserID)."</td>\n" .
"</tr>\n" .
"<tr>\n" .
"<tr>\n" .
"<td bgcolor=\"$sTDBGColour\"><b>" . _("Sequence No.") . "</b></td><td bgcolor=\"F5F6EE\">$iSequenceNumber</td>\n" .
"</tr>\n" .
"<tr>\n" .
"<td colspan=\"2\"> </td>\n" .
"</tr>\n" .
"<tr>\n" .
"<td><b><input type=\"image\" src=\"" . KTHtml::getUpdateButton() . "\" border=\"0\"/></b></td><td>" . generateControllerLink("viewDocument", "fDocumentID=$fDocumentID&fShowSection=documentRouting", "<img src=\"" . KTHtml::getCancelButton() . "\" border=\"0\"/>") . "</td>\n" .
"</tr>\n" .
"</table>\n";
}
?>