- constructor of LetoDMS_[Group|User]Access requires the user/group not

its id anymore
This commit is contained in:
steinm 2010-11-18 10:28:45 +00:00
parent 81f4c235d5
commit fbc6ce4c9a
2 changed files with 13 additions and 19 deletions

View File

@ -25,23 +25,20 @@
*/ */
class LetoDMS_UserAccess class LetoDMS_UserAccess
{ {
var $_userID; var $_user;
var $_mode; var $_mode;
function LetoDMS_UserAccess($userID, $mode) function LetoDMS_UserAccess($user, $mode)
{ {
$this->_userID = $userID; $this->_user = $user;
$this->_mode = $mode; $this->_mode = $mode;
} }
function getUserID() { return $this->_userID; } function getUserID() { return $this->_user->getID(); }
function getMode() { return $this->_mode; } function getMode() { return $this->_mode; }
function getUser() function getUser() {
{
if (!isset($this->_user))
$this->_user = getUser($this->_userID);
return $this->_user; return $this->_user;
} }
} }
@ -49,23 +46,20 @@ class LetoDMS_UserAccess
class LetoDMS_GroupAccess class LetoDMS_GroupAccess
{ {
var $_groupID; var $_group;
var $_mode; var $_mode;
function LetoDMS_GroupAccess($groupID, $mode) function LetoDMS_GroupAccess($group, $mode)
{ {
$this->_groupID = $groupID; $this->_group = $group;
$this->_mode = $mode; $this->_mode = $mode;
} }
function getGroupID() { return $this->_groupID; } function getGroupID() { return $this->_group->getID(); }
function getMode() { return $this->_mode; } function getMode() { return $this->_mode; }
function getGroup() function getGroup() {
{
if (!isset($this->_group))
$this->_group = getGroup($this->_groupID);
return $this->_group; return $this->_group;
} }
} }

View File

@ -390,7 +390,7 @@ class LetoDMS_Folder {
if (!$db->getResult($queryStr)) if (!$db->getResult($queryStr))
return false; return false;
$document = getDocument($db->getInsertID()); $document = $this->_dms->getDocument($db->getInsertID());
if ($version_comment!="") if ($version_comment!="")
$res = $document->addContent($version_comment, $owner, $tmpFile, $orgFileName, $fileType, $mimeType, $reviewers, $approvers,$reqversion,FALSE); $res = $document->addContent($version_comment, $owner, $tmpFile, $orgFileName, $fileType, $mimeType, $reviewers, $approvers,$reqversion,FALSE);
@ -470,9 +470,9 @@ class LetoDMS_Folder {
$this->_accessList[$mode] = array("groups" => array(), "users" => array()); $this->_accessList[$mode] = array("groups" => array(), "users" => array());
foreach ($resArr as $row) { foreach ($resArr as $row) {
if ($row["userID"] != -1) if ($row["userID"] != -1)
array_push($this->_accessList[$mode]["users"], new LetoDMS_UserAccess($row["userID"], $row["mode"])); array_push($this->_accessList[$mode]["users"], new LetoDMS_UserAccess($this->_dms->getUser($row["userID"]), $row["mode"]));
else //if ($row["groupID"] != -1) else //if ($row["groupID"] != -1)
array_push($this->_accessList[$mode]["groups"], new LetoDMS_GroupAccess($row["groupID"], $row["mode"])); array_push($this->_accessList[$mode]["groups"], new LetoDMS_GroupAccess($this->_dms->getGroup($row["groupID"]), $row["mode"]));
} }
} }