Commit 2e5cfc9f13133e1296f70fe5974cb6454dd9a63b
1 parent
06982810
Fixed typo - changed KTAPI_role to KTAPI_group
Jira: WSA-197 Committed by: Megan Watson
Showing
1 changed file
with
24 additions
and
15 deletions
ktapi/ktapi.inc.php
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | * KnowledgeTree Community Edition |
| 6 | 6 | * Document Management Made Simple |
| 7 | 7 | * Copyright (C) 2008,2009 KnowledgeTree Inc. |
| 8 | -* | |
| 8 | +* | |
| 9 | 9 | * |
| 10 | 10 | * This program is free software; you can redistribute it and/or modify it under |
| 11 | 11 | * the terms of the GNU General Public License version 3 as published by the |
| ... | ... | @@ -403,7 +403,6 @@ class KTAPI |
| 403 | 403 | ); |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - | |
| 407 | 406 | $user = KTAPI_User::getByUsername($username); |
| 408 | 407 | if(PEAR::isError($user)) { |
| 409 | 408 | $user_ktapi->session_logout(); |
| ... | ... | @@ -417,6 +416,10 @@ class KTAPI |
| 417 | 416 | |
| 418 | 417 | $permissions->add($user, $permission); |
| 419 | 418 | $permissions->save(); |
| 419 | + | |
| 420 | + return array( | |
| 421 | + "status_code" => 0 | |
| 422 | + ); | |
| 420 | 423 | } |
| 421 | 424 | |
| 422 | 425 | /** |
| ... | ... | @@ -470,7 +473,6 @@ class KTAPI |
| 470 | 473 | ); |
| 471 | 474 | } |
| 472 | 475 | |
| 473 | - | |
| 474 | 476 | $role = KTAPI_Role::getByName($role); |
| 475 | 477 | if(PEAR::isError($role)) { |
| 476 | 478 | return array( |
| ... | ... | @@ -483,6 +485,10 @@ class KTAPI |
| 483 | 485 | |
| 484 | 486 | $permissions->add($role, $permission); |
| 485 | 487 | $permissions->save(); |
| 488 | + | |
| 489 | + return array( | |
| 490 | + "status_code" => 0 | |
| 491 | + ); | |
| 486 | 492 | } |
| 487 | 493 | |
| 488 | 494 | /** |
| ... | ... | @@ -536,8 +542,7 @@ class KTAPI |
| 536 | 542 | ); |
| 537 | 543 | } |
| 538 | 544 | |
| 539 | - | |
| 540 | - $group = KTAPI_Role::getByName($group); | |
| 545 | + $group = KTAPI_Group::getByName($group); | |
| 541 | 546 | if(PEAR::isError($group)) { |
| 542 | 547 | return array( |
| 543 | 548 | "status_code" => 1, |
| ... | ... | @@ -549,6 +554,10 @@ class KTAPI |
| 549 | 554 | |
| 550 | 555 | $permissions->add($group, $permission); |
| 551 | 556 | $permissions->save(); |
| 557 | + | |
| 558 | + return array( | |
| 559 | + "status_code" => 0 | |
| 560 | + ); | |
| 552 | 561 | } |
| 553 | 562 | |
| 554 | 563 | /** |
| ... | ... | @@ -1025,7 +1034,7 @@ class KTAPI |
| 1025 | 1034 | |
| 1026 | 1035 | |
| 1027 | 1036 | //$controltype = 'string'; |
| 1028 | - | |
| 1037 | + | |
| 1029 | 1038 | // Replace with true |
| 1030 | 1039 | $controltype = strtolower($field->getDataType()); |
| 1031 | 1040 | if ($field->getHasLookup()) |
| ... | ... | @@ -1037,12 +1046,12 @@ class KTAPI |
| 1037 | 1046 | } |
| 1038 | 1047 | } |
| 1039 | 1048 | $options = array(); |
| 1040 | - | |
| 1049 | + | |
| 1041 | 1050 | if ($field->getInetLookupType() == 'multiwithcheckboxes' || $field->getInetLookupType() == 'multiwithlist') { |
| 1042 | 1051 | $controltype = 'multiselect'; |
| 1043 | 1052 | } |
| 1044 | - | |
| 1045 | - | |
| 1053 | + | |
| 1054 | + | |
| 1046 | 1055 | switch ($controltype) |
| 1047 | 1056 | { |
| 1048 | 1057 | case 'lookup': |
| ... | ... | @@ -2702,7 +2711,7 @@ class KTAPI |
| 2702 | 2711 | } |
| 2703 | 2712 | |
| 2704 | 2713 | $result = $document->email($recipients, $content, $attach); |
| 2705 | - | |
| 2714 | + | |
| 2706 | 2715 | if (PEAR::isError($result)) { |
| 2707 | 2716 | $response['message'] = $result->getMessage(); |
| 2708 | 2717 | return $response; |
| ... | ... | @@ -3137,7 +3146,7 @@ class KTAPI |
| 3137 | 3146 | } |
| 3138 | 3147 | |
| 3139 | 3148 | $result = $document->checkout($reason); |
| 3140 | - | |
| 3149 | + | |
| 3141 | 3150 | if (PEAR::isError($result)) |
| 3142 | 3151 | { |
| 3143 | 3152 | $response['status_code'] = 1; |
| ... | ... | @@ -3275,19 +3284,19 @@ class KTAPI |
| 3275 | 3284 | $response['status_code'] = 0; |
| 3276 | 3285 | return $response; |
| 3277 | 3286 | } |
| 3278 | - | |
| 3287 | + | |
| 3279 | 3288 | /** |
| 3280 | 3289 | * Fetches a list of checked out documents (optionally limited to the logged in user) |
| 3281 | - * | |
| 3290 | + * | |
| 3282 | 3291 | * @param boolean $userSpecific limit to current user |
| 3283 | - * @return $checkedout An array of checked out documents | |
| 3292 | + * @return $checkedout An array of checked out documents | |
| 3284 | 3293 | */ |
| 3285 | 3294 | // TODO determine whether the listing is showing docs the user should not be able to see |
| 3286 | 3295 | // (when not restricting to docs checked out by that user) |
| 3287 | 3296 | public function get_checkedout_docs($userSpecific = true) |
| 3288 | 3297 | { |
| 3289 | 3298 | $checkedout = array(); |
| 3290 | - | |
| 3299 | + | |
| 3291 | 3300 | $where = null; |
| 3292 | 3301 | // limit to current user? |
| 3293 | 3302 | if ($userSpecific) { | ... | ... |