Skip to content

Commit

Permalink
fixed the file parser
Browse files Browse the repository at this point in the history
  • Loading branch information
caseysoftware committed May 26, 2014
1 parent 763206d commit 01ed67f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/files/files.class.php
Expand Up @@ -28,6 +28,7 @@ class CFile extends w2p_Core_BaseObject {
public $file_co_reason = null;
public $file_indexed = null;

protected $indexer = false;
protected $_file_id = 0;
protected $_file_system = null;
// This "breaks" check-in/upload if helpdesk is not present class variable needs to be added "dymanically"
Expand Down Expand Up @@ -97,6 +98,7 @@ protected function hook_preUpdate() {

public function hook_cron()
{
$this->indexer = true;
$q = $this->_getQuery();
$q->addQuery('file_id, file_name');
$q->addTable('files');
Expand All @@ -107,6 +109,7 @@ public function hook_cron()
$this->load($file_id);
$this->indexStrings($this->_AppUI);
}
$this->indexer = false;
}

public function hook_search()
Expand Down Expand Up @@ -167,6 +170,11 @@ public function addHelpDeskTaskLog()
return null;
}

public function canView()
{
return ($this->indexer || parent::canView());
}

public function canAdmin() {
if (!$this->file_project) {
return false;
Expand Down

0 comments on commit 01ed67f

Please sign in to comment.