@@ -49,6 +49,7 @@ discard block |
||
49 | 49 | * Delete the the ListOfValueElement. |
50 | 50 | * Then keep metadata_value consistent: if there is no entry for a given |
51 | 51 | * (item, $this->metadataId), create a default entry (NONE value). |
52 | + * @param Docman_MetadataListOfValuesElement $love |
|
52 | 53 | */ |
53 | 54 | function delete(&$love) { |
54 | 55 | $dao =& $this->getDao(); |
@@ -131,6 +132,9 @@ discard block |
||
131 | 132 | } |
132 | 133 | } |
133 | 134 | |
135 | + /** |
|
136 | + * @param boolean $onlyActive |
|
137 | + */ |
|
134 | 138 | function &getIteratorByFieldId($id, $mdLabel, $onlyActive) { |
135 | 139 | $loveArray = $this->getListByFieldId($id, $mdLabel, $onlyActive); |
136 | 140 | $loveIter = new ArrayIterator($loveArray); |
@@ -296,6 +300,7 @@ discard block |
||
296 | 300 | |
297 | 301 | /** |
298 | 302 | * Return static list of status (hardcoded metadata with hardcoded values) |
303 | + * @param integer $status |
|
299 | 304 | */ |
300 | 305 | function &getStatusList($status=null) { |
301 | 306 | $ea = array(); |
@@ -34,6 +34,9 @@ |
||
34 | 34 | $this->str_no = $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_param_no'); |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param string|false $sthCanChange |
|
39 | + */ |
|
37 | 40 | function getName(&$sthCanChange) { |
38 | 41 | $mdContent = ''; |
39 | 42 | $mdContent .= '<tr>'; |
@@ -51,6 +51,9 @@ discard block |
||
51 | 51 | */ |
52 | 52 | private $mail_builder; |
53 | 53 | |
54 | + /** |
|
55 | + * @param string|null $url |
|
56 | + */ |
|
54 | 57 | function __construct(Project $project, $url, $feedback, MailBuilder $mail_builder) { |
55 | 58 | parent::__construct(); |
56 | 59 | |
@@ -172,6 +175,9 @@ discard block |
||
172 | 175 | return $users; |
173 | 176 | } |
174 | 177 | |
178 | + /** |
|
179 | + * @param PFUser $user |
|
180 | + */ |
|
175 | 181 | function _buildMessage($event, $params, $user) { |
176 | 182 | $type = ''; |
177 | 183 | switch($event) { |
@@ -200,6 +206,9 @@ discard block |
||
200 | 206 | ); |
201 | 207 | } |
202 | 208 | |
209 | + /** |
|
210 | + * @param string $msg |
|
211 | + */ |
|
203 | 212 | protected function _addMessage(PFUser $to, $subject, $msg, $link) { |
204 | 213 | if (!isset($this->notifications[$msg])) { |
205 | 214 | $subject = '['. util_unconvert_htmlspecialchars($this->_group_name) .' - Documents] '. $subject; |
@@ -47,6 +47,10 @@ discard block |
||
47 | 47 | break; |
48 | 48 | } |
49 | 49 | } |
50 | + |
|
51 | + /** |
|
52 | + * @param string $message_type |
|
53 | + */ |
|
50 | 54 | function _getMessageForUser(&$user, $message_type, $params) { |
51 | 55 | $msg = ''; |
52 | 56 | switch($message_type) { |
@@ -66,6 +70,9 @@ discard block |
||
66 | 70 | return $msg; |
67 | 71 | } |
68 | 72 | |
73 | + /** |
|
74 | + * @param string $type |
|
75 | + */ |
|
69 | 76 | protected function getMessageLink($type, $params) { |
70 | 77 | switch($type) { |
71 | 78 | case self::MESSAGE_ADDED: |
@@ -144,6 +144,9 @@ |
||
144 | 144 | return $link; |
145 | 145 | } |
146 | 146 | |
147 | + /** |
|
148 | + * @param string $message_type |
|
149 | + */ |
|
147 | 150 | function _storeEvents($id, $message_type, $params) { |
148 | 151 | $dpm = $this->_getPermissionsManager(); |
149 | 152 | $users = $this->_getListeningUsers($id); |
@@ -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 | } |