mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-10-17 05:22:23 +00:00
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Implementation of TransferDocument controller
|
|
*
|
|
* @category DMS
|
|
* @package SeedDMS
|
|
* @license GPL 2
|
|
* @version @version@
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
* @copyright Copyright (C) 2017 Uwe Steinmann
|
|
* @version Release: @package_version@
|
|
*/
|
|
|
|
/**
|
|
* Class which does the busines logic for downloading a document
|
|
*
|
|
* @category DMS
|
|
* @package SeedDMS
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
* @copyright Copyright (C) 2017 Uwe Steinmann
|
|
* @version Release: @package_version@
|
|
*/
|
|
class SeedDMS_Controller_TransferDocument extends SeedDMS_Controller_Common {
|
|
|
|
public function run() {
|
|
$dms = $this->params['dms'];
|
|
$user = $this->params['user'];
|
|
$settings = $this->params['settings'];
|
|
$document = $this->params['document'];
|
|
$newuser = $this->params['newuser'];
|
|
|
|
$folder = $document->getFolder();
|
|
|
|
if(false === $this->callHook('preTransferDocument')) {
|
|
if(empty($this->errormsg))
|
|
$this->errormsg = 'hook_preTransferDocument_failed';
|
|
return null;
|
|
}
|
|
|
|
$result = $this->callHook('transferDocument', $document);
|
|
if($result === null) {
|
|
if (!$document->transferToUser($newuser)) {
|
|
return false;
|
|
} else {
|
|
if(!$this->callHook('postTransferDocument')) {
|
|
}
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|