Commit 6bdcaa662297ab8dcd0e395bc12dfbedbd4cd59b

Authored by Tohir Solomons
1 parent 384ef967

Added Document and Folder Browsing History

Committed by: Tohir Solomons
Reviewed by: Megan Watson
ktapi/KTAPIDocument.inc.php
... ... @@ -2588,6 +2588,21 @@ class KTAPI_Document extends KTAPI_FolderItem
2588 2588  
2589 2589 }
2590 2590  
  2591 + /**
  2592 + * Method to add a Document to the User's History
  2593 + *
  2594 + * This integrates with the User History commercial plugin
  2595 + * @author KnowledgeTree Team
  2596 + * @access public
  2597 + */
  2598 + public function addDocumentToUserHistory()
  2599 + {
  2600 + require_once(KT_DIR . '/plugins/commercial/network/userhistory/UserHistoryActions.php');
  2601 +
  2602 + $docAction = new UserHistoryDocumentAction($this->document, $this->ktapi->get_user());
  2603 + $docAction->_show();
  2604 + }
  2605 +
2591 2606 /**
2592 2607 * Get a list of Documents
2593 2608 *
... ...
ktapi/KTAPIFolder.inc.php
... ... @@ -1602,6 +1602,21 @@ class KTAPI_Folder extends KTAPI_FolderItem
1602 1602  
1603 1603 return $_SESSION['errorMessage'];
1604 1604 }
  1605 +
  1606 + /**
  1607 + * Method to add a Document to the User's History
  1608 + *
  1609 + * This integrates with the User History commercial plugin
  1610 + * @author KnowledgeTree Team
  1611 + * @access public
  1612 + */
  1613 + public function addFolderToUserHistory()
  1614 + {
  1615 + require_once(KT_DIR . '/plugins/commercial/network/userhistory/UserHistoryActions.php');
  1616 +
  1617 + $docAction = new UserHistoryFolderAction($this->folder, $this->ktapi->get_user());
  1618 + $docAction->_show();
  1619 + }
1605 1620 }
1606 1621  
1607 1622 ?>
... ...
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'] )) {
... ...