diff --git a/ktapi/KTAPIDocument.inc.php b/ktapi/KTAPIDocument.inc.php index 1a5af7e..fafff37 100644 --- a/ktapi/KTAPIDocument.inc.php +++ b/ktapi/KTAPIDocument.inc.php @@ -2548,6 +2548,21 @@ class KTAPI_Document extends KTAPI_FolderItem } + /** + * Method to add a Document to the User's History + * + * This integrates with the User History commercial plugin + * @author KnowledgeTree Team + * @access public + */ + public function addDocumentToUserHistory() + { + require_once(KT_DIR . '/plugins/commercial/network/userhistory/UserHistoryActions.php'); + + $docAction = new UserHistoryDocumentAction($this->document, $this->ktapi->get_user()); + $docAction->_show(); + } + /** * Get a list of Documents * diff --git a/ktapi/KTAPIFolder.inc.php b/ktapi/KTAPIFolder.inc.php index 105b598..c8daac0 100755 --- a/ktapi/KTAPIFolder.inc.php +++ b/ktapi/KTAPIFolder.inc.php @@ -1594,6 +1594,21 @@ class KTAPI_Folder extends KTAPI_FolderItem return $_SESSION['errorMessage']; } + + /** + * Method to add a Document to the User's History + * + * This integrates with the User History commercial plugin + * @author KnowledgeTree Team + * @access public + */ + public function addFolderToUserHistory() + { + require_once(KT_DIR . '/plugins/commercial/network/userhistory/UserHistoryActions.php'); + + $docAction = new UserHistoryFolderAction($this->folder, $this->ktapi->get_user()); + $docAction->_show(); + } } ?> diff --git a/webservice/clienttools/services/0.9/kt.php b/webservice/clienttools/services/0.9/kt.php index c574345..a5d01d1 100644 --- a/webservice/clienttools/services/0.9/kt.php +++ b/webservice/clienttools/services/0.9/kt.php @@ -134,6 +134,8 @@ class kt extends client_service { return false; } + $folder->addFolderToUserHistory(); + $types = (isset ( $arr ['types'] ) ? $arr ['types'] : 'DF'); $listing = $folder->get_listing ( 1, $types ); @@ -291,6 +293,8 @@ class kt extends client_service { $document_detail = $document->get_detail (); $title = $document_detail ['title']; $document_type = $document_detail ['document_type']; + + $document->addDocumentToUserHistory(); /* Added by Tohir */ } else { if (isset ( $params ['document_type'] )) {