Se modifica paginado en ASSIGNEE y ASSIGNEE ADHOC. Se concluye upload y se modifican end points FILESMANAGER. Se cambia BEHAT en FILESMANAGER. Se incluye upload de fotos para USER
This commit is contained in:
@@ -5,21 +5,21 @@ Feature: Files Manager Resources
|
|||||||
Given that I have a valid access_token
|
Given that I have a valid access_token
|
||||||
|
|
||||||
Scenario: Get a list of main process files manager
|
Scenario: Get a list of main process files manager
|
||||||
Given I request "project/1265557095225ff5c688f46031700471/process-file-manager"
|
Given I request "project/1265557095225ff5c688f46031700471/file-manager"
|
||||||
Then the response status code should be 200
|
Then the response status code should be 200
|
||||||
And the response charset is "UTF-8"
|
And the response charset is "UTF-8"
|
||||||
And the content type is "application/json"
|
And the content type is "application/json"
|
||||||
And the type is "array"
|
And the type is "array"
|
||||||
|
|
||||||
Scenario: Get a list public folder of process files manager
|
Scenario: Get a list public folder of process files manager
|
||||||
Given I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=public"
|
Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=public"
|
||||||
Then the response status code should be 200
|
Then the response status code should be 200
|
||||||
And the response charset is "UTF-8"
|
And the response charset is "UTF-8"
|
||||||
And the content type is "application/json"
|
And the content type is "application/json"
|
||||||
And the type is "array"
|
And the type is "array"
|
||||||
|
|
||||||
Scenario: Get a list templates folder of process files manager
|
Scenario: Get a list templates folder of process files manager
|
||||||
Given I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=templates"
|
Given I request "project/1265557095225ff5c688f46031700471/file-manager?path=templates"
|
||||||
Then the response status code should be 200
|
Then the response status code should be 200
|
||||||
And the response charset is "UTF-8"
|
And the response charset is "UTF-8"
|
||||||
And the content type is "application/json"
|
And the content type is "application/json"
|
||||||
@@ -34,7 +34,7 @@ Feature: Files Manager Resources
|
|||||||
"content": "<content>"
|
"content": "<content>"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
And I request "project/1265557095225ff5c688f46031700471/process-file-manager"
|
And I request "project/1265557095225ff5c688f46031700471/file-manager"
|
||||||
Then the response status code should be 200
|
Then the response status code should be 200
|
||||||
And the response charset is "UTF-8"
|
And the response charset is "UTF-8"
|
||||||
And the content type is "application/json"
|
And the content type is "application/json"
|
||||||
@@ -58,7 +58,7 @@ Feature: Files Manager Resources
|
|||||||
"content": "<content>"
|
"content": "<content>"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
And I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=<path>"
|
And I request "project/1265557095225ff5c688f46031700471/file-manager?path=<path>"
|
||||||
Then the response status code should be 200
|
Then the response status code should be 200
|
||||||
And the response charset is "UTF-8"
|
And the response charset is "UTF-8"
|
||||||
And the content type is "application/json"
|
And the content type is "application/json"
|
||||||
@@ -73,7 +73,7 @@ Feature: Files Manager Resources
|
|||||||
|
|
||||||
Scenario Outline: Delete User
|
Scenario Outline: Delete User
|
||||||
Given that I want to delete a "<path>"
|
Given that I want to delete a "<path>"
|
||||||
And I request "project/1265557095225ff5c688f46031700471/process-file-manager?path=<path>"
|
And I request "project/1265557095225ff5c688f46031700471/file-manager?path=<path>"
|
||||||
And the content type is "application/json"
|
And the content type is "application/json"
|
||||||
Then the response status code should be 200
|
Then the response status code should be 200
|
||||||
And the response charset is "UTF-8"
|
And the response charset is "UTF-8"
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ class FilesManager
|
|||||||
try {
|
try {
|
||||||
$aDirectories[] = array('name' => "templates",
|
$aDirectories[] = array('name' => "templates",
|
||||||
'type' => "folder",
|
'type' => "folder",
|
||||||
'path' => PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP,
|
'path' => "/",
|
||||||
'editable' => false);
|
'editable' => false);
|
||||||
$aDirectories[] = array('name' => "public",
|
$aDirectories[] = array('name' => "public",
|
||||||
'type' => "folder",
|
'type' => "folder",
|
||||||
'path' => PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP,
|
'path' => "/",
|
||||||
'editable' => false);
|
'editable' => false);
|
||||||
return $aDirectories;
|
return $aDirectories;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -70,9 +70,9 @@ class FilesManager
|
|||||||
if (($sObject !== '.') && ($sObject !== '..')) {
|
if (($sObject !== '.') && ($sObject !== '..')) {
|
||||||
$sPath = $sDirectory . $sObject;
|
$sPath = $sDirectory . $sObject;
|
||||||
if (is_dir($sPath)) {
|
if (is_dir($sPath)) {
|
||||||
$aTheFiles[] = array('name' => $sObject,
|
$aTheFiles[] = array('prf_name' => $sObject,
|
||||||
'type' => "folder",
|
'prf_type' => "folder",
|
||||||
'path' => $sDirectory);
|
'prf_path' => $sMainDirectory);
|
||||||
} else {
|
} else {
|
||||||
$aAux = pathinfo($sPath);
|
$aAux = pathinfo($sPath);
|
||||||
$aAux['extension'] = (isset($aAux['extension'])?$aAux['extension']:'');
|
$aAux['extension'] = (isset($aAux['extension'])?$aAux['extension']:'');
|
||||||
@@ -81,16 +81,32 @@ class FilesManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($aFiles as $aFile) {
|
foreach ($aFiles as $aFile) {
|
||||||
$extention = end(explode(".", $aFile['FILE']));
|
$arrayFileUid = $this->getFileManagerUid($sDirectory.$aFile['FILE']);
|
||||||
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp' || $extention == 'xlsx' || $extention == 'xls' || $extention == 'js' || $extention == 'css' || $extention == 'txt') {
|
$fileUid = $arrayFileUid["PRF_UID"];
|
||||||
$sEditable = true;
|
if ($fileUid) {
|
||||||
|
$oProcessFiles = \ProcessFilesPeer::retrieveByPK($fileUid);
|
||||||
|
$aTheFiles[] = array( 'prf_filename' => $aFile['FILE'],
|
||||||
|
'prf_uid' => $oProcessFiles->getPrfUid(),
|
||||||
|
'usr_uid' => $oProcessFiles->getUsrUid(),
|
||||||
|
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
|
||||||
|
'prf_path' => $sMainDirectory. PATH_SEP .$sSubDirectory,
|
||||||
|
'prf_type' => $oProcessFiles->getPrfType(),
|
||||||
|
'prf_editable' => $oProcessFiles->getPrfEditable(),
|
||||||
|
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
||||||
|
'prf_update_date' => $oProcessFiles->getPrfUpdateDate());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$sEditable = false;
|
$aTheFiles[] = array('prf_filename' => $aFile['FILE'],
|
||||||
|
'prf_uid' => '',
|
||||||
|
'usr_uid' => '',
|
||||||
|
'prf_update_usr_uid' => '',
|
||||||
|
'prf_path' => $sMainDirectory. PATH_SEP .$sSubDirectory,
|
||||||
|
'prf_type' => 'file',
|
||||||
|
'prf_editable' => '',
|
||||||
|
'prf_create_date' => '',
|
||||||
|
'prf_update_date' => '');
|
||||||
}
|
}
|
||||||
$aTheFiles[] = array('name' => $aFile['FILE'],
|
|
||||||
'type' => "file",
|
|
||||||
'path' => $sDirectory,
|
|
||||||
'editable' => $sEditable);
|
|
||||||
}
|
}
|
||||||
return $aTheFiles;
|
return $aTheFiles;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -112,32 +128,31 @@ class FilesManager
|
|||||||
public function addProcessFilesManager($sProcessUID, $userUID, $aData)
|
public function addProcessFilesManager($sProcessUID, $userUID, $aData)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$aData['prf_path'] = rtrim($aData['prf_path'], '/') . '/';
|
||||||
$aData['path'] = rtrim($aData['path'], '/') . '/';
|
$sMainDirectory = current(explode("/", $aData['prf_path']));
|
||||||
$sMainDirectory = current(explode("/", $aData['path']));
|
|
||||||
if ($sMainDirectory != 'public' && $sMainDirectory != 'templates') {
|
if ($sMainDirectory != 'public' && $sMainDirectory != 'templates') {
|
||||||
throw (new \Exception( 'invalid value specified for `prf_path`. Expecting `templates/` or `public/`'));
|
throw (new \Exception( 'invalid value specified for `prf_path`. Expecting `templates/` or `public/`'));
|
||||||
}
|
}
|
||||||
if (strstr($aData['path'],'/')) {
|
if (strstr($aData['prf_path'],'/')) {
|
||||||
$sSubDirectory = substr($aData['path'], strpos($aData['path'], "/")+1) ;
|
$sSubDirectory = substr($aData['prf_path'], strpos($aData['prf_path'], "/")+1) ;
|
||||||
} else {
|
} else {
|
||||||
$sSubDirectory = '';
|
$sSubDirectory = '';
|
||||||
}
|
}
|
||||||
switch ($sMainDirectory) {
|
switch ($sMainDirectory) {
|
||||||
case 'templates':
|
case 'templates':
|
||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['file_name'];
|
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||||
$sCheckDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory;
|
$sCheckDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory;
|
||||||
$sEditable = false;
|
$sEditable = false;
|
||||||
break;
|
break;
|
||||||
case 'public':
|
case 'public':
|
||||||
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['file_name'];
|
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||||
$sCheckDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectory;
|
$sCheckDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectory;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['file_name'];
|
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$extention = end(explode(".", $aData['file_name']));
|
$extention = end(explode(".", $aData['prf_filename']));
|
||||||
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp' ||
|
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp' ||
|
||||||
$extention == 'xlsx' || $extention == 'xls' || $extention == 'js' || $extention == 'css' || $extention == 'txt') {
|
$extention == 'xlsx' || $extention == 'xls' || $extention == 'js' || $extention == 'css' || $extention == 'txt') {
|
||||||
$sEditable = true;
|
$sEditable = true;
|
||||||
@@ -150,7 +165,7 @@ class FilesManager
|
|||||||
}
|
}
|
||||||
$sPkProcessFiles = \G::generateUniqueID();
|
$sPkProcessFiles = \G::generateUniqueID();
|
||||||
$oProcessFiles = new \ProcessFiles();
|
$oProcessFiles = new \ProcessFiles();
|
||||||
$sDate = date('Y-m-d H:i');
|
$sDate = date('Y-m-d H:i:s');
|
||||||
$oProcessFiles->setPrfUid($sPkProcessFiles);
|
$oProcessFiles->setPrfUid($sPkProcessFiles);
|
||||||
$oProcessFiles->setProUid($sProcessUID);
|
$oProcessFiles->setProUid($sProcessUID);
|
||||||
$oProcessFiles->setUsrUid($userUID);
|
$oProcessFiles->setUsrUid($userUID);
|
||||||
@@ -161,14 +176,14 @@ class FilesManager
|
|||||||
$oProcessFiles->setPrfCreateDate($sDate);
|
$oProcessFiles->setPrfCreateDate($sDate);
|
||||||
$oProcessFiles->save();
|
$oProcessFiles->save();
|
||||||
$fp = fopen($sDirectory, 'w');
|
$fp = fopen($sDirectory, 'w');
|
||||||
$content = $aData['content'];
|
$content = $aData['prf_content'];
|
||||||
fwrite($fp, $content);
|
fwrite($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
||||||
'pro_uid' => $oProcessFiles->getProUid(),
|
'pro_uid' => $oProcessFiles->getProUid(),
|
||||||
'usr_uid' => $oProcessFiles->getUsrUid(),
|
'usr_uid' => $oProcessFiles->getUsrUid(),
|
||||||
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
|
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
|
||||||
'prf_path' => $oProcessFiles->getPrfPath(),
|
'prf_path' => $sMainDirectory. PATH_SEP . $sSubDirectory,
|
||||||
'prf_type' => $oProcessFiles->getPrfType(),
|
'prf_type' => $oProcessFiles->getPrfType(),
|
||||||
'prf_editable' => $oProcessFiles->getPrfEditable(),
|
'prf_editable' => $oProcessFiles->getPrfEditable(),
|
||||||
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
||||||
@@ -182,23 +197,37 @@ class FilesManager
|
|||||||
/**
|
/**
|
||||||
* Return the Process Files Manager
|
* Return the Process Files Manager
|
||||||
*
|
*
|
||||||
* @param string $aData {@min 32} {@max 32}
|
* @param string $prjUid {@min 32} {@max 32}
|
||||||
|
* @param array $aData
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function uploadProcessFilesManager($aData)
|
public function uploadProcessFilesManager($prjUid, $aData)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$prfUid = str_replace('"','',$aData['prf_uid']);
|
$prfUid = $aData['prf_uid'];
|
||||||
// $oProcessFiles = \ProcessFilesPeer::retrieveByPK($prfUid);
|
$path = '';
|
||||||
// if (is_null($oProcessFiles)) {
|
$criteria = new \Criteria("workflow");
|
||||||
|
$criteria->addSelectColumn(\ProcessFilesPeer::PRF_PATH);
|
||||||
|
$criteria->add(\ProcessFilesPeer::PRF_UID, $prfUid, \Criteria::EQUAL);
|
||||||
|
$rsCriteria = \ProcessFilesPeer::doSelectRS($criteria);
|
||||||
|
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$rsCriteria->next();
|
||||||
|
while ($aRow = $rsCriteria->getRow()) {
|
||||||
|
$path = $aRow['PRF_PATH'];
|
||||||
|
$rsCriteria->next();
|
||||||
|
}
|
||||||
|
if ($path == ''){
|
||||||
|
throw new \Exception(\G::LoadTranslation('ID_PMTABLE_UPLOADING_FILE_PROBLEM'));
|
||||||
|
}
|
||||||
|
$file = end(explode("/",$path));
|
||||||
|
$path = str_replace($file,'',$path);
|
||||||
if ($_FILES['my_file']['error'] != 1) {
|
if ($_FILES['my_file']['error'] != 1) {
|
||||||
if ($_FILES['my_file']['tmp_name'] != '') {
|
if ($_FILES['my_file']['tmp_name'] != '') {
|
||||||
\G::uploadFile($_FILES['my_file']['tmp_name'], 'public/1265557095225ff5c688f46031700471', $_FILES['my_file']['name']);
|
\G::uploadFile($_FILES['my_file']['tmp_name'],$path , $_FILES['my_file']['name']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
@@ -253,50 +282,47 @@ class FilesManager
|
|||||||
}
|
}
|
||||||
switch ($sMainDirectory) {
|
switch ($sMainDirectory) {
|
||||||
case 'templates':
|
case 'templates':
|
||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['file_name'];
|
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||||
$sEditable = false;
|
$sEditable = false;
|
||||||
break;
|
break;
|
||||||
case 'public':
|
case 'public':
|
||||||
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['file_name'];
|
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $aData['file_name'];
|
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $aData['prf_filename'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$arrayTaskUid = $this->getFileManagerUid($sDirectory);
|
$arrayFileUid = $this->getFileManagerUid($sDirectory);
|
||||||
if (!$arrayTaskUid) {
|
if (!$arrayFileUid) {
|
||||||
throw (new \Exception( 'invalid value specified for `path`.'));
|
throw (new \Exception( 'invalid value specified for `path`.'));
|
||||||
}
|
}
|
||||||
$extention = end(explode(".", $aData['file_name']));
|
$extention = end(explode(".", $aData['prf_filename']));
|
||||||
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp' ||
|
if ($extention == 'docx' || $extention == 'doc' || $extention == 'html' || $extention == 'php' || $extention == 'jsp' ||
|
||||||
$extention == 'xlsx' || $extention == 'xls' || $extention == 'js' || $extention == 'css' || $extention == 'txt') {
|
$extention == 'xlsx' || $extention == 'xls' || $extention == 'js' || $extention == 'css' || $extention == 'txt') {
|
||||||
$sEditable = true;
|
$sEditable = true;
|
||||||
} else {
|
} else {
|
||||||
$sEditable = false;
|
$sEditable = false;
|
||||||
}
|
}
|
||||||
$sPkProcessFiles = \G::generateUniqueID();
|
if ($sEditable == false) {
|
||||||
$oProcessFiles = new \ProcessFiles();
|
throw (new \Exception( 'Can`t edit. Make sure your file has an editable extension.'));
|
||||||
$sDate = date('Y-m-d H:i');
|
}
|
||||||
$oProcessFiles->setPrfUid( $sPkProcessFiles);
|
$fileUid = $arrayFileUid["PRF_UID"];
|
||||||
$oProcessFiles->setProUid( $sProcessUID );
|
$oProcessFiles = \ProcessFilesPeer::retrieveByPK($fileUid);
|
||||||
$oProcessFiles->setUsrUid( $userUID );
|
$sDate = date('Y-m-d H:i:s');
|
||||||
$oProcessFiles->setPrfUpdateUsrUid( '' );
|
$oProcessFiles->setPrfUpdateUsrUid($userUID);
|
||||||
$oProcessFiles->setPrfPath( $sDirectory );
|
$oProcessFiles->setPrfUpdateDate($sDate);
|
||||||
$oProcessFiles->setPrfType('file');
|
|
||||||
$oProcessFiles->setPrfEditable( $sEditable );
|
|
||||||
$oProcessFiles->setPrfCreateDate( $sDate );
|
|
||||||
$oProcessFiles->save();
|
$oProcessFiles->save();
|
||||||
$fp = fopen($sDirectory, 'w');
|
$fp = fopen($sDirectory, 'w');
|
||||||
$content = $aData['content'];
|
$content = $aData['prf_content'];
|
||||||
fwrite($fp, $content);
|
fwrite($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
||||||
'pro_uid' => $oProcessFiles->getProUid(),
|
'pro_uid' => $oProcessFiles->getProUid(),
|
||||||
'usr_uid' => $oProcessFiles->getUsrUid(),
|
'usr_uid' => $oProcessFiles->getUsrUid(),
|
||||||
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
|
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
|
||||||
'prf_path' => $oProcessFiles->getPrfPath(),
|
'prf_path' => $sMainDirectory. PATH_SEP . $sSubDirectory,
|
||||||
'prf_type' => $oProcessFiles->getPrfType(),
|
'prf_type' => $oProcessFiles->getPrfType(),
|
||||||
'prf_editable' => $oProcessFiles->getPrfEditable(),
|
'prf_editable' => $sEditable,
|
||||||
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
||||||
'prf_update_date' => $oProcessFiles->getPrfUpdateDate());
|
'prf_update_date' => $oProcessFiles->getPrfUpdateDate());
|
||||||
return $oProcessFile;
|
return $oProcessFile;
|
||||||
@@ -391,7 +417,6 @@ class FilesManager
|
|||||||
switch ($sMainDirectory) {
|
switch ($sMainDirectory) {
|
||||||
case 'mailTemplates':
|
case 'mailTemplates':
|
||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectoryCheck . $sfile;
|
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectoryCheck . $sfile;
|
||||||
$sEditable = false;
|
|
||||||
break;
|
break;
|
||||||
case 'public':
|
case 'public':
|
||||||
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectoryCheck . $sfile;
|
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectoryCheck . $sfile;
|
||||||
@@ -400,18 +425,8 @@ class FilesManager
|
|||||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sfile;
|
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sfile;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$url = $sDirectory;
|
$oProcessMap = new \processMap(new \DBConnection());
|
||||||
$sPath = PATH_DOCUMENT.$sfile;//path to
|
$oProcessMap->downloadFile($sProcessUID,$sMainDirectory,$sSubDirectory,$sfile);
|
||||||
set_time_limit(0);
|
|
||||||
ini_set('display_errors',true);//Just in case we get some errors, let us know
|
|
||||||
$fp = fopen ($sPath, 'w');//This is the file where we save the information
|
|
||||||
$ch = curl_init(str_replace(" ","%20",$url));
|
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
|
|
||||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
|
||||||
curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
fclose($fp);
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -764,11 +764,6 @@ class Task
|
|||||||
$aUIDS1[] = $aGroup['GRP_UID'];
|
$aUIDS1[] = $aGroup['GRP_UID'];
|
||||||
}
|
}
|
||||||
$groups = new \Groupwf();
|
$groups = new \Groupwf();
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$totalCount = 0;
|
$totalCount = 0;
|
||||||
$criteria = new \Criteria( 'workflow' );
|
$criteria = new \Criteria( 'workflow' );
|
||||||
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
@@ -786,12 +781,6 @@ class Task
|
|||||||
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
if ($start != '') {
|
|
||||||
$criteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
if ($limit != '') {
|
|
||||||
$criteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
if ($filter != '') {
|
if ($filter != '') {
|
||||||
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
||||||
}
|
}
|
||||||
@@ -843,24 +832,6 @@ class Task
|
|||||||
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
|
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
|
||||||
$oCriteria->add(\TaskUserPeer::TU_TYPE, 1);
|
$oCriteria->add(\TaskUserPeer::TU_TYPE, 1);
|
||||||
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
|
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
|
||||||
if ($start) {
|
|
||||||
if ($start < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `start`.'));
|
|
||||||
} else {
|
|
||||||
$oCriteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `limit`.'));
|
|
||||||
} else {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
} else {
|
|
||||||
$oCriteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
@@ -874,6 +845,25 @@ class Task
|
|||||||
}
|
}
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
}
|
}
|
||||||
|
if ($start) {
|
||||||
|
if ($start < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `start`.'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$start = 0;
|
||||||
|
}
|
||||||
|
if (isset($limit)) {
|
||||||
|
if ($limit < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `limit`.'));
|
||||||
|
} else {
|
||||||
|
if ($limit == 0) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$limit = 1000;
|
||||||
|
}
|
||||||
|
$aUsers = $this->arrayPagination($aUsers, $start, $limit);
|
||||||
return $aUsers;
|
return $aUsers;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
@@ -933,11 +923,6 @@ class Task
|
|||||||
$aUIDS1[] = $aGroup['GRP_UID'];
|
$aUIDS1[] = $aGroup['GRP_UID'];
|
||||||
}
|
}
|
||||||
$groups = new \Groupwf();
|
$groups = new \Groupwf();
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$totalCount = 0;
|
$totalCount = 0;
|
||||||
$criteria = new \Criteria( 'workflow' );
|
$criteria = new \Criteria( 'workflow' );
|
||||||
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
@@ -955,12 +940,6 @@ class Task
|
|||||||
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
if ($start != '') {
|
|
||||||
$criteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
if ($limit != '') {
|
|
||||||
$criteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
if ($filter != '') {
|
if ($filter != '') {
|
||||||
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
||||||
}
|
}
|
||||||
@@ -1008,24 +987,6 @@ class Task
|
|||||||
}
|
}
|
||||||
$oCriteria->add(\UsersPeer::USR_STATUS, 'ACTIVE');
|
$oCriteria->add(\UsersPeer::USR_STATUS, 'ACTIVE');
|
||||||
$oCriteria->add(\UsersPeer::USR_UID, $aUIDS2, \Criteria::NOT_IN);
|
$oCriteria->add(\UsersPeer::USR_UID, $aUIDS2, \Criteria::NOT_IN);
|
||||||
if ($start) {
|
|
||||||
if ($start < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `start`.'));
|
|
||||||
} else {
|
|
||||||
$oCriteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `limit`.'));
|
|
||||||
} else {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
} else {
|
|
||||||
$oCriteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oDataset = \UsersPeer::doSelectRS($oCriteria);
|
$oDataset = \UsersPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
@@ -1040,6 +1001,25 @@ class Task
|
|||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if ($start) {
|
||||||
|
if ($start < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `start`.'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$start = 0;
|
||||||
|
}
|
||||||
|
if (isset($limit)) {
|
||||||
|
if ($limit < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `limit`.'));
|
||||||
|
} else {
|
||||||
|
if ($limit == 0) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$limit = 1000;
|
||||||
|
}
|
||||||
|
$aUsers = $this->arrayPagination($aUsers, $start, $limit);
|
||||||
return $aUsers;
|
return $aUsers;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
@@ -1356,11 +1336,6 @@ class Task
|
|||||||
$aUIDS1[] = $aGroup['GRP_UID'];
|
$aUIDS1[] = $aGroup['GRP_UID'];
|
||||||
}
|
}
|
||||||
$groups = new \Groupwf();
|
$groups = new \Groupwf();
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$totalCount = 0;
|
$totalCount = 0;
|
||||||
$criteria = new \Criteria( 'workflow' );
|
$criteria = new \Criteria( 'workflow' );
|
||||||
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
@@ -1378,12 +1353,6 @@ class Task
|
|||||||
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
if ($start != '') {
|
|
||||||
$criteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
if ($limit != '') {
|
|
||||||
$criteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
if ($filter != '') {
|
if ($filter != '') {
|
||||||
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
||||||
}
|
}
|
||||||
@@ -1435,24 +1404,6 @@ class Task
|
|||||||
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
|
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
|
||||||
$oCriteria->add(\TaskUserPeer::TU_TYPE, 2);
|
$oCriteria->add(\TaskUserPeer::TU_TYPE, 2);
|
||||||
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
|
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
|
||||||
if ($start) {
|
|
||||||
if ($start < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `start`.'));
|
|
||||||
} else {
|
|
||||||
$oCriteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `limit`.'));
|
|
||||||
} else {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
} else {
|
|
||||||
$oCriteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
@@ -1466,6 +1417,25 @@ class Task
|
|||||||
}
|
}
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
}
|
}
|
||||||
|
if ($start) {
|
||||||
|
if ($start < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `start`.'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$start = 0;
|
||||||
|
}
|
||||||
|
if (isset($limit)) {
|
||||||
|
if ($limit < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `limit`.'));
|
||||||
|
} else {
|
||||||
|
if ($limit == 0) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$limit = 1000;
|
||||||
|
}
|
||||||
|
$aUsers = $this->arrayPagination($aUsers, $start, $limit);
|
||||||
return $aUsers;
|
return $aUsers;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
@@ -1492,6 +1462,7 @@ class Task
|
|||||||
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "RbacUsers.php");
|
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "RbacUsers.php");
|
||||||
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "TaskUser.php");
|
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "TaskUser.php");
|
||||||
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "GroupUser.php");
|
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "GroupUser.php");
|
||||||
|
$aUsers = array();
|
||||||
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
||||||
if (is_null($oProcess)) {
|
if (is_null($oProcess)) {
|
||||||
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process'));
|
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process'));
|
||||||
@@ -1500,8 +1471,8 @@ class Task
|
|||||||
if (is_null($oActivity)) {
|
if (is_null($oActivity)) {
|
||||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$iType = 2;
|
$iType = 2;
|
||||||
$aUsers = array();
|
|
||||||
$oTasks = new \Tasks();
|
$oTasks = new \Tasks();
|
||||||
$aAux = $oTasks->getGroupsOfTask($sTaskUID, $iType);
|
$aAux = $oTasks->getGroupsOfTask($sTaskUID, $iType);
|
||||||
$aUIDS1 = array();
|
$aUIDS1 = array();
|
||||||
@@ -1525,11 +1496,6 @@ class Task
|
|||||||
$aUIDS1[] = $aGroup['GRP_UID'];
|
$aUIDS1[] = $aGroup['GRP_UID'];
|
||||||
}
|
}
|
||||||
$groups = new \Groupwf();
|
$groups = new \Groupwf();
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$totalCount = 0;
|
$totalCount = 0;
|
||||||
$criteria = new \Criteria( 'workflow' );
|
$criteria = new \Criteria( 'workflow' );
|
||||||
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
@@ -1547,12 +1513,6 @@ class Task
|
|||||||
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
if ($start != '') {
|
|
||||||
$criteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
if ($limit != '') {
|
|
||||||
$criteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
if ($filter != '') {
|
if ($filter != '') {
|
||||||
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
$criteria->add( \ContentPeer::CON_VALUE, '%' . $filter . '%', \Criteria::LIKE );
|
||||||
}
|
}
|
||||||
@@ -1600,24 +1560,6 @@ class Task
|
|||||||
}
|
}
|
||||||
$oCriteria->add(\UsersPeer::USR_STATUS, 'ACTIVE');
|
$oCriteria->add(\UsersPeer::USR_STATUS, 'ACTIVE');
|
||||||
$oCriteria->add(\UsersPeer::USR_UID, $aUIDS2, \Criteria::NOT_IN);
|
$oCriteria->add(\UsersPeer::USR_UID, $aUIDS2, \Criteria::NOT_IN);
|
||||||
if ($start) {
|
|
||||||
if ($start < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `start`.'));
|
|
||||||
} else {
|
|
||||||
$oCriteria->setOffset( $start );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($limit)) {
|
|
||||||
if ($limit < 0) {
|
|
||||||
throw (new \Exception( 'invalid value specified for `limit`.'));
|
|
||||||
} else {
|
|
||||||
if ($limit == 0) {
|
|
||||||
return $aUsers;
|
|
||||||
} else {
|
|
||||||
$oCriteria->setLimit( $limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$oDataset = \UsersPeer::doSelectRS($oCriteria);
|
$oDataset = \UsersPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
@@ -1631,12 +1573,33 @@ class Task
|
|||||||
}
|
}
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
}
|
}
|
||||||
|
if ($start) {
|
||||||
|
if ($start < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `start`.'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$start = 0;
|
||||||
|
}
|
||||||
|
if (isset($limit)) {
|
||||||
|
if ($limit < 0) {
|
||||||
|
throw (new \Exception( 'invalid value specified for `limit`.'));
|
||||||
|
} else {
|
||||||
|
if ($limit == 0) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$limit = 1000;
|
||||||
|
}
|
||||||
|
$aUsers = $this->arrayPagination($aUsers, $start, $limit);
|
||||||
return $aUsers;
|
return $aUsers;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a single Adhoc user or group assigned to an activity
|
* Return a single Adhoc user or group assigned to an activity
|
||||||
*
|
*
|
||||||
@@ -1934,5 +1897,21 @@ class Task
|
|||||||
}
|
}
|
||||||
return $act_uid;
|
return $act_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array $display_array. array of groups and users
|
||||||
|
* @var int $page. start
|
||||||
|
* @var int $show_per_page. limit
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function arrayPagination($display_array, $page, $show_per_page) {
|
||||||
|
$page = $page+1;
|
||||||
|
$show_per_page = $show_per_page -1;
|
||||||
|
$start = ($page - 1) * ($show_per_page + 1);
|
||||||
|
$offset = $show_per_page + 1;
|
||||||
|
$outArray = array_slice($display_array, $start, $offset);
|
||||||
|
return $outArray;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -363,18 +363,6 @@ class User
|
|||||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||||
$oUser = new \Users();
|
$oUser = new \Users();
|
||||||
$oUser -> create( $aData );
|
$oUser -> create( $aData );
|
||||||
// comment photos files
|
|
||||||
/*
|
|
||||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
|
||||||
//print (PATH_IMAGES_ENVIRONMENT_USERS);
|
|
||||||
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
|
|
||||||
\G::uploadFile($_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$result->success = false;
|
|
||||||
$result->fileError = true;
|
|
||||||
throw new \Exception($oError->$result);
|
|
||||||
}*/
|
|
||||||
if ((isset($form['USR_CALENDAR']))) {
|
if ((isset($form['USR_CALENDAR']))) {
|
||||||
//Save Calendar ID for this user
|
//Save Calendar ID for this user
|
||||||
\G::LoadClass("calendar");
|
\G::LoadClass("calendar");
|
||||||
@@ -413,6 +401,12 @@ class User
|
|||||||
if ($countPermission != 1) {
|
if ($countPermission != 1) {
|
||||||
throw new \Exception('This user: '.$usrLoggedUid. ', can`t update the data.');
|
throw new \Exception('This user: '.$usrLoggedUid. ', can`t update the data.');
|
||||||
}
|
}
|
||||||
|
$criteria = new \Criteria();
|
||||||
|
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||||
|
$criteria->add(\UsersPeer::USR_USERNAME, utf8_encode($arrayData['USR_USERNAME']));
|
||||||
|
if (\UsersPeer::doCount($criteria) > 0) {
|
||||||
|
throw new \Exception('`usr_username`. '.\G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $arrayData['USR_USERNAME'])));
|
||||||
|
}
|
||||||
if (isset($usrUid)) {
|
if (isset($usrUid)) {
|
||||||
$form['USR_UID'] = $usrUid;
|
$form['USR_UID'] = $usrUid;
|
||||||
} else {
|
} else {
|
||||||
@@ -599,18 +593,6 @@ class User
|
|||||||
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
|
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
|
||||||
$oUser = new \Users();
|
$oUser = new \Users();
|
||||||
$oUser->update($aData);
|
$oUser->update($aData);
|
||||||
// photo file comment
|
|
||||||
/*
|
|
||||||
*/
|
|
||||||
/* Saving preferences comment */
|
|
||||||
/*$def_lang = $form['PREF_DEFAULT_LANG'];
|
|
||||||
$def_menu = $form['PREF_DEFAULT_MENUSELECTED'];
|
|
||||||
$def_cases_menu = isset($form['PREF_DEFAULT_CASES_MENUSELECTED']) ? $form['PREF_DEFAULT_CASES_MENUSELECTED'] : '';
|
|
||||||
\G::loadClass('configuration');
|
|
||||||
$oConf = new \Configurations();
|
|
||||||
$aConf = Array('DEFAULT_LANG' => $def_lang, 'DEFAULT_MENU' => $def_menu, 'DEFAULT_CASES_MENU' => $def_cases_menu);
|
|
||||||
$oConf->aConfig = $aConf;
|
|
||||||
$oConf->saveConfig('USER_PREFERENCES', '', '', $usrLoggedUid);*/
|
|
||||||
$oCriteria = $this->getUser($usrUid);
|
$oCriteria = $this->getUser($usrUid);
|
||||||
return $oCriteria;
|
return $oCriteria;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class FilesManager extends Api
|
|||||||
* @param string $prjUid {@min 32} {@max 32}
|
* @param string $prjUid {@min 32} {@max 32}
|
||||||
* @param string $path
|
* @param string $path
|
||||||
*
|
*
|
||||||
* @url GET /:prjUid/process-file-manager
|
* @url GET /:prjUid/file-manager
|
||||||
*/
|
*/
|
||||||
public function doGetProcessFilesManager($prjUid, $path = '')
|
public function doGetProcessFilesManager($prjUid, $path = '')
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ class FilesManager extends Api
|
|||||||
* @param string $prjUid {@min 32} {@max 32}
|
* @param string $prjUid {@min 32} {@max 32}
|
||||||
* @param ProcessFilesManagerStructure $request_data
|
* @param ProcessFilesManagerStructure $request_data
|
||||||
*
|
*
|
||||||
* @url POST /:prjUid/process-file-manager
|
* @url POST /:prjUid/file-manager
|
||||||
*/
|
*/
|
||||||
public function doPostProcessFilesManager($prjUid, ProcessFilesManagerStructure $request_data)
|
public function doPostProcessFilesManager($prjUid, ProcessFilesManagerStructure $request_data)
|
||||||
{
|
{
|
||||||
@@ -62,13 +62,13 @@ class FilesManager extends Api
|
|||||||
* @param string $prjUid {@min 32} {@max 32}
|
* @param string $prjUid {@min 32} {@max 32}
|
||||||
* @param array $request_data
|
* @param array $request_data
|
||||||
*
|
*
|
||||||
* @url POST /:prjUid/process-file-manager/upload
|
* @url POST /:prjUid/file-manager/upload
|
||||||
*/
|
*/
|
||||||
public function doPostProcessFilesManagerUpload($prjUid, $request_data)
|
public function doPostProcessFilesManagerUpload($prjUid, $request_data)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$filesManager = new \BusinessModel\FilesManager();
|
$filesManager = new \BusinessModel\FilesManager();
|
||||||
$filesManager->uploadProcessFilesManager($request_data);
|
$filesManager->uploadProcessFilesManager($prjUid, $request_data);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
@@ -80,7 +80,7 @@ class FilesManager extends Api
|
|||||||
* @param ProcessFilesManagerStructurePut $request_data
|
* @param ProcessFilesManagerStructurePut $request_data
|
||||||
* @param string $path
|
* @param string $path
|
||||||
*
|
*
|
||||||
* @url PUT /:prjUid/process-file-manager
|
* @url PUT /:prjUid/file-manager
|
||||||
*/
|
*/
|
||||||
public function doPutProcessFilesManager($prjUid, ProcessFilesManagerStructurePut $request_data, $path)
|
public function doPutProcessFilesManager($prjUid, ProcessFilesManagerStructurePut $request_data, $path)
|
||||||
{
|
{
|
||||||
@@ -102,7 +102,7 @@ class FilesManager extends Api
|
|||||||
* @param string $prjUid {@min 32} {@max 32}
|
* @param string $prjUid {@min 32} {@max 32}
|
||||||
* @param string $path
|
* @param string $path
|
||||||
*
|
*
|
||||||
* @url DELETE /:prjUid/process-file-manager
|
* @url DELETE /:prjUid/file-manager
|
||||||
*/
|
*/
|
||||||
public function doDeleteProcessFilesManager($prjUid, $path)
|
public function doDeleteProcessFilesManager($prjUid, $path)
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@ class FilesManager extends Api
|
|||||||
* @param string $prjUid {@min 32} {@max 32}
|
* @param string $prjUid {@min 32} {@max 32}
|
||||||
* @param string $path
|
* @param string $path
|
||||||
*
|
*
|
||||||
* @url GET /:prjUid/process-file-manager/download
|
* @url GET /:prjUid/file-manager/download
|
||||||
*/
|
*/
|
||||||
public function doGetProcessFilesManagerDownload($prjUid, $path)
|
public function doGetProcessFilesManagerDownload($prjUid, $path)
|
||||||
{
|
{
|
||||||
@@ -138,17 +138,17 @@ class ProcessFilesManagerStructure
|
|||||||
/**
|
/**
|
||||||
* @var string {@from body}
|
* @var string {@from body}
|
||||||
*/
|
*/
|
||||||
public $file_name;
|
public $prf_filename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string {@from body}
|
* @var string {@from body}
|
||||||
*/
|
*/
|
||||||
public $path;
|
public $prf_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string {@from body}
|
* @var string {@from body}
|
||||||
*/
|
*/
|
||||||
public $content;
|
public $prf_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -157,11 +157,11 @@ class ProcessFilesManagerStructurePut
|
|||||||
/**
|
/**
|
||||||
* @var string {@from body}
|
* @var string {@from body}
|
||||||
*/
|
*/
|
||||||
public $file_name;
|
public $prf_filename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string {@from body}
|
* @var string {@from body}
|
||||||
*/
|
*/
|
||||||
public $content;
|
public $prf_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user