@@ -94,6 +94,9 @@ |
||
94 | 94 | ); |
95 | 95 | } |
96 | 96 | |
97 | + /** |
|
98 | + * @param integer $folder_id |
|
99 | + */ |
|
97 | 100 | private function importDump(Project $project, $folder_id) { |
98 | 101 | $xml_import = new XMLDocmanImport( |
99 | 102 | 'import:', |
@@ -117,6 +117,7 @@ |
||
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Set recursively the given tag to all nodes of the tree |
120 | + * @param string $tag |
|
120 | 121 | */ |
121 | 122 | private static function tagTree(&$tree, $tag) { |
122 | 123 | $tree['tag'] = $tag; |
@@ -98,10 +98,17 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * XMLDocmanImport constructor |
100 | 100 | * |
101 | - * @param int $groupId Group ID |
|
102 | 101 | * @param string $wsdl WSDL location |
103 | 102 | * @param string $login Login |
104 | 103 | * @param string $password Password |
104 | + * @param string $command |
|
105 | + * @param string $project |
|
106 | + * @param integer $projectId |
|
107 | + * @param boolean $force |
|
108 | + * @param boolean $reorder |
|
109 | + * @param string $importMessageMetadata |
|
110 | + * @param boolean $autoRetry |
|
111 | + * @param boolean $log |
|
105 | 112 | */ |
106 | 113 | public function __construct($command, $project, $projectId, $wsdl, $login, $password, $force, $reorder, $importMessageMetadata, $autoRetry, $log) { |
107 | 114 | |
@@ -150,6 +157,8 @@ discard block |
||
150 | 157 | /** |
151 | 158 | * Search the next file name that can be used |
152 | 159 | * If the file "name" exists in the folder, the next name to use is "name (2)", then "name (3)", etc. |
160 | + * @param string $folder |
|
161 | + * @param string $fileName |
|
153 | 162 | */ |
154 | 163 | private function searchNextFreeFileName($folder, $fileName) { |
155 | 164 | |
@@ -245,6 +254,8 @@ discard block |
||
245 | 254 | |
246 | 255 | /** |
247 | 256 | * Import an item to the specified parent folder |
257 | + * @param string $xmlDoc |
|
258 | + * @param string $path |
|
248 | 259 | */ |
249 | 260 | public function importPath($xmlDoc, $parentId, $path) { |
250 | 261 | |
@@ -679,6 +690,7 @@ discard block |
||
679 | 690 | |
680 | 691 | /** |
681 | 692 | * Converts a string to a type code |
693 | + * @param string $type |
|
682 | 694 | */ |
683 | 695 | private static function typeStringToCode($type) { |
684 | 696 | switch ($type) { |
@@ -692,6 +704,7 @@ discard block |
||
692 | 704 | |
693 | 705 | /** |
694 | 706 | * Displays an error and terminates execution of the script |
707 | + * @param string $error |
|
695 | 708 | */ |
696 | 709 | protected function exitError($error) { |
697 | 710 | exit (PHP_EOL."Fatal error: ".PHP_EOL.$error.PHP_EOL); |
@@ -754,6 +767,7 @@ discard block |
||
754 | 767 | |
755 | 768 | /** |
756 | 769 | * Parse a date given as an ISO8601 date or a timestamp |
770 | + * @param string $s |
|
757 | 771 | * @return The corresponding timestamp |
758 | 772 | */ |
759 | 773 | private function parseDate($s) { |
@@ -956,6 +970,9 @@ discard block |
||
956 | 970 | |
957 | 971 | } |
958 | 972 | |
973 | + /** |
|
974 | + * @param Exception $e |
|
975 | + */ |
|
959 | 976 | protected function askWhatToDo($e) { |
960 | 977 | self::printException($e); |
961 | 978 | |
@@ -994,6 +1011,8 @@ discard block |
||
994 | 1011 | |
995 | 1012 | /** |
996 | 1013 | * Creates a folder |
1014 | + * @param integer $parentId |
|
1015 | + * @param string $ordering |
|
997 | 1016 | */ |
998 | 1017 | private function createFolder($parentId, $title, $description, $ordering, $status, array $permissions, array $metadata, $owner, $createDate, $updateDate) { |
999 | 1018 | $this->initRetryCounter(); |
@@ -1014,6 +1033,8 @@ discard block |
||
1014 | 1033 | |
1015 | 1034 | /** |
1016 | 1035 | * Creates an empty document |
1036 | + * @param integer $parentId |
|
1037 | + * @param string $ordering |
|
1017 | 1038 | */ |
1018 | 1039 | private function createEmpty($parentId, $title, $description, $ordering, $status, $obsolescenceDate, array $permissions, array $metadata, $owner, $createDate, $updateDate) { |
1019 | 1040 | $this->initRetryCounter(); |
@@ -1034,6 +1055,9 @@ discard block |
||
1034 | 1055 | |
1035 | 1056 | /** |
1036 | 1057 | * Creates a wiki page |
1058 | + * @param integer $parentId |
|
1059 | + * @param string $ordering |
|
1060 | + * @param string $pagename |
|
1037 | 1061 | */ |
1038 | 1062 | private function createWiki($parentId, $title, $description, $ordering, $status, $obsolescenceDate, array $permissions, array $metadata, $pagename, $owner, $createDate, $updateDate) { |
1039 | 1063 | $this->initRetryCounter(); |
@@ -1054,6 +1078,9 @@ discard block |
||
1054 | 1078 | |
1055 | 1079 | /** |
1056 | 1080 | * Creates a link |
1081 | + * @param integer $parentId |
|
1082 | + * @param string $ordering |
|
1083 | + * @param string $url |
|
1057 | 1084 | */ |
1058 | 1085 | private function createLink($parentId, $title, $description, $ordering, $status, $obsolescenceDate, array $permissions, array $metadata, $url, $owner, $createDate, $updateDate) { |
1059 | 1086 | $this->initRetryCounter(); |
@@ -1074,6 +1101,10 @@ discard block |
||
1074 | 1101 | |
1075 | 1102 | /** |
1076 | 1103 | * Creates an embedded file |
1104 | + * @param integer $parentId |
|
1105 | + * @param string $ordering |
|
1106 | + * @param string $file |
|
1107 | + * @param string $author |
|
1077 | 1108 | */ |
1078 | 1109 | private function createEmbeddedFile($parentId, $title, $description, $ordering, $status, $obsolescenceDate, array $permissions, array $metadata, $file, $author, $date, $owner, $createDate, $updateDate) { |
1079 | 1110 | $this->initRetryCounter(); |
@@ -1096,6 +1127,12 @@ discard block |
||
1096 | 1127 | |
1097 | 1128 | /** |
1098 | 1129 | * Creates a file |
1130 | + * @param integer $parentId |
|
1131 | + * @param string $ordering |
|
1132 | + * @param string $file |
|
1133 | + * @param string $fileName |
|
1134 | + * @param string $fileType |
|
1135 | + * @param string $author |
|
1099 | 1136 | */ |
1100 | 1137 | private function createFile($parentId, $title, $description, $ordering, $status, $obsolescenceDate, array $permissions, array $metadata, $file, $fileName, $fileType, $author, $date, $owner, $createDate, $updateDate) { |
1101 | 1138 | $infoStr = "Creating file '$title' ($file, $fileName, $fileType)"; |
@@ -1157,7 +1194,8 @@ discard block |
||
1157 | 1194 | /** |
1158 | 1195 | * Compares the local and the distant checksums |
1159 | 1196 | * |
1160 | - * @return true if they are the same |
|
1197 | + * @param string $filename |
|
1198 | + * @return boolean if they are the same |
|
1161 | 1199 | */ |
1162 | 1200 | private function checkChecksum($item_id, $filename) { |
1163 | 1201 | |
@@ -1178,6 +1216,12 @@ discard block |
||
1178 | 1216 | |
1179 | 1217 | /** |
1180 | 1218 | * Create a new file version |
1219 | + * @param string $label |
|
1220 | + * @param string $changeLog |
|
1221 | + * @param string $file |
|
1222 | + * @param string $fileName |
|
1223 | + * @param string $fileType |
|
1224 | + * @param string $author |
|
1181 | 1225 | */ |
1182 | 1226 | protected function createFileVersion($itemId, $label, $changeLog, $file, $fileName, $fileType, $author, $date) { |
1183 | 1227 | $infoStr = " Version '$label' ($file, $fileName, $fileType)"; |
@@ -1232,6 +1276,12 @@ discard block |
||
1232 | 1276 | } |
1233 | 1277 | } |
1234 | 1278 | |
1279 | + /** |
|
1280 | + * @param string $label |
|
1281 | + * @param string $changeLog |
|
1282 | + * @param string $file |
|
1283 | + * @param string $author |
|
1284 | + */ |
|
1235 | 1285 | protected function createEmbeddedFileVersion($itemId, $label, $changeLog, $file, $author, $date) { |
1236 | 1286 | $this->initRetryCounter(); |
1237 | 1287 | do { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | /** |
295 | 295 | * Compares the version checksums in order to decide what to do. |
296 | 296 | * For each version of the item, the checksum of the local file and the remote file are compared |
297 | - * @return true if we just have to send the new versions to the server |
|
297 | + * @return boolean if we just have to send the new versions to the server |
|
298 | 298 | * false if some versions have been created server-side (so we will need to delete and recreate the whole item) |
299 | 299 | */ |
300 | 300 | private function checkVersionChecksums($itemId, $node) { |
@@ -510,6 +510,7 @@ discard block |
||
510 | 510 | |
511 | 511 | /** |
512 | 512 | * Updates a wiki document |
513 | + * @param string $pageName |
|
513 | 514 | */ |
514 | 515 | private function updateWiki($itemId, $itemInfo, $pageName) { |
515 | 516 | // Assign variables |
@@ -542,6 +543,7 @@ discard block |
||
542 | 543 | |
543 | 544 | /** |
544 | 545 | * Updates a link |
546 | + * @param string $url |
|
545 | 547 | */ |
546 | 548 | private function updateLink($itemId, $itemInfo, $url) { |
547 | 549 | // Assign variables |
@@ -172,6 +172,10 @@ |
||
172 | 172 | |
173 | 173 | // Reviewers management |
174 | 174 | // Should be managed with SplObjectStorage in Php 5 |
175 | + |
|
176 | + /** |
|
177 | + * @param Docman_ApprovalReviewer $reviewer |
|
178 | + */ |
|
175 | 179 | function addReviewer($reviewer) { |
176 | 180 | $this->reviewers[$reviewer->getId()] = $reviewer; |
177 | 181 | } |
@@ -33,6 +33,7 @@ |
||
33 | 33 | |
34 | 34 | /** |
35 | 35 | * |
36 | + * @param Docman_File $item |
|
36 | 37 | */ |
37 | 38 | function __construct($item, $versionNumber=null) { |
38 | 39 | parent::__construct($item); |
@@ -22,6 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | class Docman_ApprovalTableItemDao extends DataAccessObject { |
24 | 24 | |
25 | + /** |
|
26 | + * @param integer $item_id |
|
27 | + */ |
|
25 | 28 | public function getTableByItemId($item_id, $fields='*') { |
26 | 29 | $sql = 'SELECT '.$fields. |
27 | 30 | ' FROM plugin_docman_approval'. |
@@ -57,6 +60,11 @@ discard block |
||
57 | 60 | return $groupBy; |
58 | 61 | } |
59 | 62 | |
63 | + /** |
|
64 | + * @param boolean $status |
|
65 | + * @param string $fields |
|
66 | + * @param string $where |
|
67 | + */ |
|
60 | 68 | function getTableWithStatus($status, $fields, $where, $join='', $orderBy='', $limit='') { |
61 | 69 | $groupBy = ''; |
62 | 70 | if($status) { |
@@ -75,6 +83,9 @@ discard block |
||
75 | 83 | return $this->retrieve($sql); |
76 | 84 | } |
77 | 85 | |
86 | + /** |
|
87 | + * @param string $field |
|
88 | + */ |
|
78 | 89 | function createTable($field, $id, $userId, $description, $date, $status, $notification) { |
79 | 90 | $sql = 'INSERT INTO plugin_docman_approval'. |
80 | 91 | '('.$field.', table_owner, date, description, status, notification)'. |
@@ -149,6 +160,9 @@ discard block |
||
149 | 160 | } |
150 | 161 | } |
151 | 162 | |
163 | + /** |
|
164 | + * @param string $sql |
|
165 | + */ |
|
152 | 166 | function _createAndReturnId($sql) { |
153 | 167 | $inserted = $this->update($sql); |
154 | 168 | if ($inserted) { |
@@ -79,6 +79,9 @@ discard block |
||
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Action |
82 | + * @param PFUser $reviewer |
|
83 | + * @param boolean $isLastReviewer |
|
84 | + * @param boolean $withComments |
|
82 | 85 | */ |
83 | 86 | function reviewerApprove($reviewer, $isLastReviewer, $withComments) { |
84 | 87 | if($isLastReviewer) { |
@@ -96,6 +99,7 @@ discard block |
||
96 | 99 | |
97 | 100 | /** |
98 | 101 | * Action |
102 | + * @param PFUser $reviewer |
|
99 | 103 | */ |
100 | 104 | function reviewerReject($reviewer) { |
101 | 105 | $this->sendNotifRejected($reviewer); |
@@ -104,6 +108,8 @@ discard block |
||
104 | 108 | |
105 | 109 | /** |
106 | 110 | * Action |
111 | + * @param PFUser $reviewer |
|
112 | + * @param boolean $isLastReviewer |
|
107 | 113 | */ |
108 | 114 | function reviewerDecline($reviewer, $isLastReviewer) { |
109 | 115 | $this->sendNotifReviewDeclined($reviewer); |
@@ -115,6 +121,7 @@ discard block |
||
115 | 121 | |
116 | 122 | /** |
117 | 123 | * Action |
124 | + * @param PFUser $reviewer |
|
118 | 125 | */ |
119 | 126 | function reviewerComment($reviewer) { |
120 | 127 | $this->sendNotifReviewCommented($reviewer); |
@@ -210,6 +217,7 @@ discard block |
||
210 | 217 | /** |
211 | 218 | * Update item status according to parameters. |
212 | 219 | * Not in use today. |
220 | + * @param integer $status |
|
213 | 221 | */ |
214 | 222 | function changeItemStatus($reviewer, $status) { |
215 | 223 | // TBD |
@@ -521,6 +529,9 @@ discard block |
||
521 | 529 | return $this->table; |
522 | 530 | } |
523 | 531 | |
532 | + /** |
|
533 | + * @param PFUser $owner |
|
534 | + */ |
|
524 | 535 | function setOwner(&$owner) { |
525 | 536 | $this->owner = $owner; |
526 | 537 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @param Docman_ApprovalTable $table Approval table |
100 | 100 | * |
101 | - * @return Boolean |
|
101 | + * @return null|boolean |
|
102 | 102 | */ |
103 | 103 | private function notifyNextReviewer(Docman_ApprovalTable $table) { |
104 | 104 | $dao = new Docman_ApprovalTableReviewerDao(CodendiDataAccess::instance()); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @param Docman_ApprovalTable $table Approval table |
122 | 122 | * @param Integer $reviewerId Id of the reviewer |
123 | 123 | * |
124 | - * @return Boolean |
|
124 | + * @return null|boolean |
|
125 | 125 | */ |
126 | 126 | private function notifyIndividual(Docman_ApprovalTable $table, $reviewerId) { |
127 | 127 | $hp = Codendi_HTMLPurifier::instance(); |
@@ -191,7 +191,6 @@ discard block |
||
191 | 191 | /** |
192 | 192 | * Retrieve url to access a given docman item |
193 | 193 | * |
194 | - * @param Docman_Item $table The approval table that its reminder notification will be sent |
|
195 | 194 | * |
196 | 195 | * @return String |
197 | 196 | */ |