Commit 379c1a11286187c068f7451e594a524f2eeea884

Authored by Tohir Solomons
Committed by Megan Watson
1 parent f990d744

Added Document and Folder Browsing History

Committed by: Tohir Solomons
Reviewed by: Megan Watson
ktapi/KTAPIDocument.inc.php
... ... @@ -2548,6 +2548,21 @@ class KTAPI_Document extends KTAPI_FolderItem
2548 2548  
2549 2549 }
2550 2550  
  2551 + /**
  2552 + * Method to add a Document to the User's History
  2553 + *
  2554 + * This integrates with the User History commercial plugin
  2555 + * @author KnowledgeTree Team
  2556 + * @access public
  2557 + */
  2558 + public function addDocumentToUserHistory()
  2559 + {
  2560 + require_once(KT_DIR . '/plugins/commercial/network/userhistory/UserHistoryActions.php');
  2561 +
  2562 + $docAction = new UserHistoryDocumentAction($this->document, $this->ktapi->get_user());
  2563 + $docAction->_show();
  2564 + }
  2565 +
2551 2566 /**
2552 2567 * Get a list of Documents
2553 2568 *
... ...
ktapi/KTAPIFolder.inc.php
... ... @@ -1594,6 +1594,21 @@ class KTAPI_Folder extends KTAPI_FolderItem
1594 1594  
1595 1595 return $_SESSION['errorMessage'];
1596 1596 }
  1597 +
  1598 + /**
  1599 + * Method to add a Document to the User's History
  1600 + *
  1601 + * This integrates with the User History commercial plugin
  1602 + * @author KnowledgeTree Team
  1603 + * @access public
  1604 + */
  1605 + public function addFolderToUserHistory()
  1606 + {
  1607 + require_once(KT_DIR . '/plugins/commercial/network/userhistory/UserHistoryActions.php');
  1608 +
  1609 + $docAction = new UserHistoryFolderAction($this->folder, $this->ktapi->get_user());
  1610 + $docAction->_show();
  1611 + }
1597 1612 }
1598 1613  
1599 1614 ?>
... ...
webservice/clienttools/services/0.9/kt.php
... ... @@ -134,6 +134,8 @@ class kt extends client_service {
134 134 return false;
135 135 }
136 136  
  137 + $folder->addFolderToUserHistory();
  138 +
137 139 $types = (isset ( $arr ['types'] ) ? $arr ['types'] : 'DF');
138 140  
139 141 $listing = $folder->get_listing ( 1, $types );
... ... @@ -291,6 +293,8 @@ class kt extends client_service {
291 293 $document_detail = $document->get_detail ();
292 294 $title = $document_detail ['title'];
293 295 $document_type = $document_detail ['document_type'];
  296 +
  297 + $document->addDocumentToUserHistory(); /* Added by Tohir */
294 298  
295 299 } else {
296 300 if (isset ( $params ['document_type'] )) {
... ...