Changeset 4362 for contrib/Dms/inc/inc.ClassDocument.php
- Timestamp:
- 05/12/11 11:52:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/Dms/inc/inc.ClassDocument.php
r3526 r4362 3 3 function getDocument($id) 4 4 { 5 6 // echo "aggggi".$id; 5 7 if (!is_numeric($id)) 6 8 die ("invalid documentid"); 7 9 8 10 $queryStr = "SELECT * FROM phpgw_mydms_Documents WHERE id = " . $id; 11 12 //echo "<br>documentos".$queryStr."<br>"; 9 13 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 10 14 if (is_bool($resArr) && $resArr == false) … … 15 19 16 20 $resArr = $resArr[0]; 17 $newDocument = new Document($resArr["id"], $resArr["name"], $resArr["comment"], $resArr["date"], $resArr["expires"], $resArr["owner"], $resArr["folder"], $resArr["inheritAccess"], $resArr["defaultAccess"], $resArr["locked"], $resArr["keywords"], $resArr["sequence"]); 18 21 $newDocument = new Document($resArr["id"], $resArr["name"], $resArr["comment"], $resArr["date"], $resArr["expires"], $resArr["owner"], $resArr["folder"], $resArr[7], $resArr[8], $resArr[9], $resArr["keywords"], $resArr["sequence"]); 22 23 19 24 if($newDocument->getAccessMode(getUser($GLOBALS['phpgw_info']['user']['account_id'])) > M_NONE) 20 25 return $newDocument; … … 419 424 return M_NONE; 420 425 } 421 426 return $this->getAccessList2(); 422 427 //Berechtigung erben?? 423 428 // wird ï¿œber GetAccessList() bereits realisiert. … … 431 436 } 432 437 */ 433 $highestPrivileged = M_NONE;438 /* $highestPrivileged = M_NONE; 434 439 435 440 //ACLs durchforsten … … 465 470 466 471 //Standard-Berechtigung verwenden 467 return $this->getDefaultAccess(); 468 } 469 472 return $this->getDefaultAccess();*/ 473 } 474 function getAccessList2() 475 { 476 477 $grupos=read_repository2($GLOBALS['phpgw_info']['user']['account_id']); 478 // echo "".$GLOBALS['phpgw_info']['user']['account_id']; 479 480 if($grupos!=''){ 481 $queryStr = "SELECT * FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target in ( select folder from phpgw_mydms_Documents WHERE id=" . $this->_id . ") and (userid=".$GLOBALS['phpgw_info']['user']['account_id']." or groupid in (".$grupos.")) ORDER BY targettype"; 482 }else{ 483 $queryStr = "SELECT * FROM phpgw_mydms_acls WHERE targettype = ".T_FOLDER." AND target in ( select folder from phpgw_mydms_Documents WHERE id=" . $this->_id . ") and (userid=".$GLOBALS['phpgw_info']['user']['account_id']." ) ORDER BY targettype"; 484 485 } 486 //echo "aqui".$queryStr ; 487 $resArr = $GLOBALS['mydms']->db->getResultArray($queryStr); 488 489 490 if (is_bool($resArr) && !$resArr) 491 return false; 492 493 //$this->_accessList = array("groups" => array(), "users" => array()); 494 foreach ($resArr as $row) 495 { 496 497 //echo "el grupo de acceso es".$row[4]." ".$row["groupid"]."<br>"; 498 return $row["mode"]; 499 /*if ($row["userid"] != -1) 500 array_push($this->_accessList["users"], new UserAccess($row["userid"], $row["mode"])); 501 else //if ($row["groupID"] != -1) 502 array_push($this->_accessList["groups"], new GroupAccess($row["groupid"], $row["mode"]));*/ 503 } 504 505 506 return $this->_accessList; 507 } 470 508 function getNotifyList() 471 509 { … … 683 721 ); 684 722 685 if(!$this->db->select('phpgw_mydms_DocumentContent', $cols, $where, __LINE__, __FILE__ )) {723 if(!$this->db->select('phpgw_mydms_DocumentContent', $cols, $where, __LINE__, __FILE__, false, 'ORDER BY version,id desc')) { 686 724 return false; 687 725 }
Note: See TracChangeset
for help on using the changeset viewer.