@@ -38,6 +38,10 @@ discard block |
||
38 | 38 | } |
39 | 39 | } |
40 | 40 | var $do_not_send_notifications_to; |
41 | + |
|
42 | + /** |
|
43 | + * @param string $type |
|
44 | + */ |
|
41 | 45 | function _buildMessagesForUsers(&$users, $type, $params) { |
42 | 46 | if ($users) { |
43 | 47 | $um = $this->_getUserManager(); |
@@ -55,6 +59,10 @@ discard block |
||
55 | 59 | } |
56 | 60 | } |
57 | 61 | } |
62 | + |
|
63 | + /** |
|
64 | + * @param PFUser $user |
|
65 | + */ |
|
58 | 66 | function _buildMessage($params, $user, $type) { |
59 | 67 | $params['old_parent'] = $this->_item_factory->getItemFromDb($params['item']->getParentId()); |
60 | 68 | $this->_addMessage( |
@@ -257,6 +257,7 @@ discard block |
||
257 | 257 | * - he is super user, |
258 | 258 | * - he is admin of the current docman, |
259 | 259 | * - or one of his ugroups has MANAGE permission on the item |
260 | + * @param PFUser|null $user |
|
260 | 261 | * @return boolean |
261 | 262 | */ |
262 | 263 | function userCanManage($user, $item_id) { |
@@ -339,7 +340,7 @@ discard block |
||
339 | 340 | /** |
340 | 341 | * Check if given user has write access on a item tree. |
341 | 342 | * |
342 | - * @param $user User User object. |
|
343 | + * @param PFUser $user User User object. |
|
343 | 344 | * @param $itemId Integer The parent item id. |
344 | 345 | * @return boolean |
345 | 346 | */ |
@@ -461,6 +462,7 @@ discard block |
||
461 | 462 | |
462 | 463 | /** |
463 | 464 | * Revoke all access to the user if not already set. |
465 | + * @param integer $userId |
|
464 | 466 | */ |
465 | 467 | function _setNoAccess($userId, $objectId) { |
466 | 468 | $this->_revokeIfNotGranted($this->cache_read, $userId, $objectId); |
@@ -473,6 +475,7 @@ discard block |
||
473 | 475 | * |
474 | 476 | * If userCanRead, cache it. Otherwise, if read is not already granted, |
475 | 477 | * block it. |
478 | + * @param boolean $canRead |
|
476 | 479 | */ |
477 | 480 | function _setCanRead($userId, $objectId, $canRead) { |
478 | 481 | if($canRead) { |
@@ -487,6 +490,7 @@ discard block |
||
487 | 490 | * |
488 | 491 | * If userCanWrite, cache it. Otherwise, if write is not already granted, |
489 | 492 | * block it. |
493 | + * @param boolean $canWrite |
|
490 | 494 | */ |
491 | 495 | function _setCanWrite($userId, $objectId, $canWrite) { |
492 | 496 | if($canWrite) { |
@@ -501,6 +505,7 @@ discard block |
||
501 | 505 | * Set MANAGE, WRITE and READ accesses to the user. |
502 | 506 | * |
503 | 507 | * If user cannot manage and manage is not already granted, block it. |
508 | + * @param boolean $canManage |
|
504 | 509 | */ |
505 | 510 | function _setCanManage($userId, $objectId, $canManage) { |
506 | 511 | if($canManage) { |
@@ -25,11 +25,18 @@ discard block |
||
25 | 25 | class Docman_PermissionsManagerDao extends DataAccessObject { |
26 | 26 | |
27 | 27 | var $groupId; |
28 | + |
|
29 | + /** |
|
30 | + * @param integer $groupId |
|
31 | + */ |
|
28 | 32 | function __construct($da, $groupId) { |
29 | 33 | parent::__construct($da); |
30 | 34 | $this->groupId = $groupId; |
31 | 35 | } |
32 | 36 | |
37 | + /** |
|
38 | + * @param string[] $perms |
|
39 | + */ |
|
33 | 40 | function retreivePermissionsForItems($itemsIds, $perms, $ugroupIds) { |
34 | 41 | $sql = 'SELECT *'. |
35 | 42 | ' FROM permissions'. |
@@ -39,6 +46,9 @@ discard block |
||
39 | 46 | return $this->retrieve($sql); |
40 | 47 | } |
41 | 48 | |
49 | + /** |
|
50 | + * @param string $perm |
|
51 | + */ |
|
42 | 52 | function setDefaultPermissions($objectId, $perm, $force=false) { |
43 | 53 | require_once('www/project/admin/permissions.php'); |
44 | 54 | $res = permission_db_get_defaults($perm); |
@@ -47,6 +57,9 @@ discard block |
||
47 | 57 | } |
48 | 58 | } |
49 | 59 | |
60 | + /** |
|
61 | + * @param integer $group_id |
|
62 | + */ |
|
50 | 63 | function oneFolderIsWritable($group_id, $ugroupIds) { |
51 | 64 | $sql = sprintf('SELECT i.item_id'. |
52 | 65 | ' FROM plugin_docman_item as i, permissions as p'. |
@@ -107,6 +120,9 @@ discard block |
||
107 | 120 | } |
108 | 121 | } |
109 | 122 | |
123 | + /** |
|
124 | + * @param integer $project_id |
|
125 | + */ |
|
110 | 126 | public function isThereAnExplicitPermission($ugroup_id, $project_id) { |
111 | 127 | $ugroup_id = $this->da->escapeInt($ugroup_id); |
112 | 128 | $project_id = $this->da->escapeInt($project_id); |
@@ -123,6 +139,9 @@ discard block |
||
123 | 139 | return $this->retrieveFirstRow($sql); |
124 | 140 | } |
125 | 141 | |
142 | + /** |
|
143 | + * @param integer $project_id |
|
144 | + */ |
|
126 | 145 | public function doAllItemsHaveExplicitPermissions($project_id) { |
127 | 146 | $project_id = $this->da->escapeInt($project_id); |
128 | 147 |
@@ -76,6 +76,9 @@ |
||
76 | 76 | return $this->title; |
77 | 77 | } |
78 | 78 | |
79 | + /** |
|
80 | + * @param integer $g |
|
81 | + */ |
|
79 | 82 | function setGroupId($g) { |
80 | 83 | $this->groupId = $g; |
81 | 84 | } |
@@ -29,6 +29,9 @@ |
||
29 | 29 | $this->sort = null; |
30 | 30 | } |
31 | 31 | |
32 | + /** |
|
33 | + * @param integer $s |
|
34 | + */ |
|
32 | 35 | function setSort($s) { |
33 | 36 | $this->sort = $s; |
34 | 37 | } |
@@ -31,6 +31,9 @@ |
||
31 | 31 | $this->groupId = $groupId; |
32 | 32 | } |
33 | 33 | |
34 | + /** |
|
35 | + * @param string $colLabel |
|
36 | + */ |
|
34 | 37 | function getColumnFromLabel($colLabel) { |
35 | 38 | $col = null; |
36 | 39 | $mdFactory = $this->_getMetadataFactory(); |
@@ -36,6 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Create a report for table view based on URL |
39 | + * @param integer|null $reportId |
|
40 | + * @param boolean $feedback |
|
39 | 41 | */ |
40 | 42 | function &get($reportId, $request, $item, &$feedback) { |
41 | 43 | $report = null; |
@@ -263,6 +265,9 @@ discard block |
||
263 | 265 | return $rai; |
264 | 266 | } |
265 | 267 | |
268 | + /** |
|
269 | + * @param PFUser $user |
|
270 | + */ |
|
266 | 271 | function getPersonalReportsForUser($user) { |
267 | 272 | $ra = array(); |
268 | 273 | $dao =& $this->getDao(); |
@@ -336,6 +341,9 @@ discard block |
||
336 | 341 | return false; |
337 | 342 | } |
338 | 343 | |
344 | + /** |
|
345 | + * @param Docman_Report $report |
|
346 | + */ |
|
339 | 347 | function deleteReport($report) { |
340 | 348 | $dao =& $this->getDao(); |
341 | 349 | $filterFactory = new Docman_FilterFactory($this->groupId); |
@@ -49,6 +49,9 @@ |
||
49 | 49 | return $html; |
50 | 50 | } |
51 | 51 | |
52 | + /** |
|
53 | + * @param ArrayIterator $reportIter |
|
54 | + */ |
|
52 | 55 | function getSelectOptionFromReportIterator($reportIter, $current=null) { |
53 | 56 | $html = ''; |
54 | 57 | $reportIter->rewind(); |
@@ -108,6 +108,9 @@ discard block |
||
108 | 108 | return $dao->updateMetadataUsageForGroupId($this->groupId, $label, $useIt); |
109 | 109 | } |
110 | 110 | |
111 | + /** |
|
112 | + * @param integer $targetGroupId |
|
113 | + */ |
|
111 | 114 | function cloneMetadataSettings($targetGroupId) { |
112 | 115 | if($this->settingsExist()) { |
113 | 116 | $dao =& $this->getDao(); |
@@ -136,6 +139,8 @@ discard block |
||
136 | 139 | |
137 | 140 | /** |
138 | 141 | * @access: private |
142 | + * @param Docman_SettingsBo $srcBo |
|
143 | + * @param string $label |
|
139 | 144 | */ |
140 | 145 | function _importMetadataUsage($srcBo, $label) { |
141 | 146 | if($srcBo->getMetadataUsage($label) == true && |