Commit 2e5cfc9f13133e1296f70fe5974cb6454dd9a63b

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