Commit b04352b192f5150fdc38ded02f15c7cd28a3c951

Authored by rob
1 parent 7cb14feb

Added document collaboration check


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@890 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/foldermanagement/FolderCollaboration.inc
... ... @@ -137,6 +137,24 @@ class FolderCollaboration {
137 137 }
138 138  
139 139 /**
  140 + * Checks whether there is a document which is currently
  141 + * going through this folder collaboration process
  142 + *
  143 + * return boolean true if there is a document currently going through this process, false otherwise
  144 + */
  145 + function hasDocumentInProcess() {
  146 + global $default;
  147 + $sQuery = "SELECT FURL.id " .
  148 + "FROM groups_folders_approval_link AS GFAL INNER JOIN documents AS D ON GFAL.folder_id = D.folder_id " .
  149 + "INNER JOIN folders_users_roles_link AS FURL ON FURL.document_id = D.id " .
  150 + "WHERE GFAL.id = " . $this->iId;
  151 + $sql = $default->db;
  152 + $sql->query($sQuery);
  153 + return $sql->next_record();
  154 +
  155 + }
  156 +
  157 + /**
140 158 * Static function.
141 159 * Given a web_documents primary key it will create a
142 160 * FolderCollaboration object and populate it with the
... ... @@ -188,5 +206,7 @@ class FolderCollaboration {
188 206 return false;
189 207 }
190 208  
  209 +
  210 +
191 211 }
192 212 ?>
... ...