Commit 3beb758d41f6722d134e61e93c21835f32e89ea2

Authored by unknown
1 parent 2ccb1399

Added new webservice function to return checked out docuements in folder

Committed by Serge Meunier
webservice/clienttools/services/0.9/kt.php
@@ -94,6 +94,31 @@ class kt extends client_service { @@ -94,6 +94,31 @@ class kt extends client_service {
94 $this->setResponse ( $result ); 94 $this->setResponse ( $result );
95 return true; 95 return true;
96 } 96 }
  97 +
  98 + function get_checkedout_documents_list($params) {
  99 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
  100 + $kt = &$this->KT;
  101 +
  102 +
  103 + $params ['control'] = 'F_';
  104 + $params ['node'] = substr ( $params ['node'], strlen ( $params ['control'] ) );
  105 +
  106 + $folder = &$kt->get_folder_by_id ( $params ['node'] );
  107 + if (! $this->checkPearError ( $folder, "[error 1] Folder Not Found: {$params['control']}{$params['node']}", '', array () ))
  108 + return false;
  109 +
  110 + $types = (isset ( $params ['types'] ) ? $params ['types'] : 'D');
  111 + $listing = $folder->get_listing ( 1, $types );
  112 + foreach ( $listing as $item ) {
  113 + if ($item['checked_out_by'] == $params['user'])
  114 + {
  115 + $result[] = array ('text' => htmlspecialchars ( $item ['title'] ), 'id' => $item ['id'], 'filename' => $item ['filename']);
  116 + }
  117 + }
  118 +
  119 + $this->setResponse ( $result );
  120 + return true;
  121 + }
97 122
98 function get_folder_contents($params) { 123 function get_folder_contents($params) {
99 $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); 124 $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );