Se corrige code style para CASESCHEDULER, FILESMANAGER, TASK, USER.
This commit is contained in:
@@ -346,7 +346,7 @@ class CaseScheduler
|
|||||||
$nSW = 0;
|
$nSW = 0;
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = '';
|
$aData['SCH_DAYS_PERFORM_TASK'] = '';
|
||||||
switch ($sOption) {
|
switch ($sOption) {
|
||||||
case '1':
|
case '1': // If the option is zero, set by default 1
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = '1';
|
$aData['SCH_DAYS_PERFORM_TASK'] = '1';
|
||||||
$sValue = $aData['SCH_DAYS_PERFORM_TASK'];
|
$sValue = $aData['SCH_DAYS_PERFORM_TASK'];
|
||||||
switch ($sValue) {
|
switch ($sValue) {
|
||||||
@@ -637,7 +637,7 @@ class CaseScheduler
|
|||||||
$nSW = 0;
|
$nSW = 0;
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = '';
|
$aData['SCH_DAYS_PERFORM_TASK'] = '';
|
||||||
switch ($sOption) {
|
switch ($sOption) {
|
||||||
case '1':
|
case '1': // If the option is zero, set by default 1
|
||||||
$aData['SCH_DAYS_PERFORM_TASK'] = '1';
|
$aData['SCH_DAYS_PERFORM_TASK'] = '1';
|
||||||
$sValue = $aData['SCH_DAYS_PERFORM_TASK'];
|
$sValue = $aData['SCH_DAYS_PERFORM_TASK'];
|
||||||
switch ($sValue) {
|
switch ($sValue) {
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ class FilesManager
|
|||||||
public function getProcessFilesManagerPath($sProcessUID, $path)
|
public function getProcessFilesManagerPath($sProcessUID, $path)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$checkPath = substr($path, -1);
|
||||||
|
if ($checkPath == '/') {
|
||||||
|
$path = substr($path, 0, -1);
|
||||||
|
}
|
||||||
$sMainDirectory = current(explode("/", $path));
|
$sMainDirectory = current(explode("/", $path));
|
||||||
if (strstr($path,'/')) {
|
if (strstr($path,'/')) {
|
||||||
$sSubDirectory = substr($path, strpos($path, "/")+1). PATH_SEP ;
|
$sSubDirectory = substr($path, strpos($path, "/")+1). PATH_SEP ;
|
||||||
@@ -84,10 +88,10 @@ class FilesManager
|
|||||||
$arrayFileUid = $this->getFileManagerUid($sDirectory.$aFile['FILE']);
|
$arrayFileUid = $this->getFileManagerUid($sDirectory.$aFile['FILE']);
|
||||||
$fcontent = file_get_contents($sDirectory.$aFile['FILE']);
|
$fcontent = file_get_contents($sDirectory.$aFile['FILE']);
|
||||||
$fileUid = $arrayFileUid["PRF_UID"];
|
$fileUid = $arrayFileUid["PRF_UID"];
|
||||||
if ($fileUid) {
|
if ($fileUid != null) {
|
||||||
$oProcessFiles = \ProcessFilesPeer::retrieveByPK($fileUid);
|
$oProcessFiles = \ProcessFilesPeer::retrieveByPK($fileUid);
|
||||||
$editable = $oProcessFiles->getPrfEditable();
|
$editable = $oProcessFiles->getPrfEditable();
|
||||||
if ($editable == 1){
|
if ($editable == '1') {
|
||||||
$editable = 'true';
|
$editable = 'true';
|
||||||
} else {
|
} else {
|
||||||
$editable = 'false';
|
$editable = 'false';
|
||||||
@@ -102,11 +106,10 @@ class FilesManager
|
|||||||
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
'prf_create_date' => $oProcessFiles->getPrfCreateDate(),
|
||||||
'prf_update_date' => $oProcessFiles->getPrfUpdateDate(),
|
'prf_update_date' => $oProcessFiles->getPrfUpdateDate(),
|
||||||
'prf_content' => $fcontent);
|
'prf_content' => $fcontent);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$extention = end(explode(".", $aFile['FILE']));
|
$extention = end(explode(".", $aFile['FILE']));
|
||||||
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') {
|
||||||
$editable = 'true';
|
$editable = 'true';
|
||||||
} else {
|
} else {
|
||||||
$editable = 'false';
|
$editable = 'false';
|
||||||
@@ -122,7 +125,6 @@ class FilesManager
|
|||||||
'prf_update_date' => '',
|
'prf_update_date' => '',
|
||||||
'prf_content' => $fcontent);
|
'prf_content' => $fcontent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return $aTheFiles;
|
return $aTheFiles;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -145,7 +147,7 @@ class FilesManager
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$aData['prf_path'] = rtrim($aData['prf_path'], '/') . '/';
|
$aData['prf_path'] = rtrim($aData['prf_path'], '/') . '/';
|
||||||
if (!$aData['prf_filename']){
|
if (!$aData['prf_filename']) {
|
||||||
throw (new \Exception( 'invalid value specified for `prf_filename`.'));
|
throw (new \Exception( 'invalid value specified for `prf_filename`.'));
|
||||||
}
|
}
|
||||||
$sMainDirectory = current(explode("/", $aData['prf_path']));
|
$sMainDirectory = current(explode("/", $aData['prf_path']));
|
||||||
@@ -199,6 +201,7 @@ class FilesManager
|
|||||||
fwrite($fp, $content);
|
fwrite($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
$oProcessFile = array('prf_uid' => $oProcessFiles->getPrfUid(),
|
||||||
|
'prf_filename' => $aData['prf_filename'],
|
||||||
'usr_uid' => $oProcessFiles->getUsrUid(),
|
'usr_uid' => $oProcessFiles->getUsrUid(),
|
||||||
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
|
'prf_update_usr_uid' => $oProcessFiles->getPrfUpdateUsrUid(),
|
||||||
'prf_path' => $sMainDirectory. PATH_SEP . $sSubDirectory,
|
'prf_path' => $sMainDirectory. PATH_SEP . $sSubDirectory,
|
||||||
@@ -236,7 +239,7 @@ class FilesManager
|
|||||||
$path = $aRow['PRF_PATH'];
|
$path = $aRow['PRF_PATH'];
|
||||||
$rsCriteria->next();
|
$rsCriteria->next();
|
||||||
}
|
}
|
||||||
if ($path == ''){
|
if ($path == '') {
|
||||||
throw new \Exception(\G::LoadTranslation('ID_PMTABLE_UPLOADING_FILE_PROBLEM'));
|
throw new \Exception(\G::LoadTranslation('ID_PMTABLE_UPLOADING_FILE_PROBLEM'));
|
||||||
}
|
}
|
||||||
$file = end(explode("/",$path));
|
$file = end(explode("/",$path));
|
||||||
@@ -306,14 +309,14 @@ class FilesManager
|
|||||||
$path = $aRow['PRF_PATH'];
|
$path = $aRow['PRF_PATH'];
|
||||||
$rsCriteria->next();
|
$rsCriteria->next();
|
||||||
}
|
}
|
||||||
if ($path == ''){
|
if ($path == '') {
|
||||||
throw new \Exception('invalid value specified for `prf_uid`.');
|
throw new \Exception('invalid value specified for `prf_uid`.');
|
||||||
}
|
}
|
||||||
$sFile = end(explode("/",$path));
|
$sFile = end(explode("/",$path));
|
||||||
$sPath = str_replace($sFile,'',$path);
|
$sPath = str_replace($sFile,'',$path);
|
||||||
$sSubDirectory = str_replace('/','',str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))));
|
$sSubDirectory = str_replace('/','',str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))));
|
||||||
$sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
|
$sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
|
||||||
if ($sMainDirectory == PATH_DATA_MAILTEMPLATES){
|
if ($sMainDirectory == PATH_DATA_MAILTEMPLATES) {
|
||||||
$sMainDirectory = 'mailTemplates';
|
$sMainDirectory = 'mailTemplates';
|
||||||
} else {
|
} else {
|
||||||
$sMainDirectory = 'public';
|
$sMainDirectory = 'public';
|
||||||
@@ -375,14 +378,14 @@ class FilesManager
|
|||||||
$path = $aRow['PRF_PATH'];
|
$path = $aRow['PRF_PATH'];
|
||||||
$rsCriteria->next();
|
$rsCriteria->next();
|
||||||
}
|
}
|
||||||
if ($path == ''){
|
if ($path == '') {
|
||||||
throw new \Exception('invalid value specified for `prf_uid`.');
|
throw new \Exception('invalid value specified for `prf_uid`.');
|
||||||
}
|
}
|
||||||
$sFile = end(explode("/",$path));
|
$sFile = end(explode("/",$path));
|
||||||
$sPath = str_replace($sFile,'',$path);
|
$sPath = str_replace($sFile,'',$path);
|
||||||
$sSubDirectory = str_replace('/','',str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))));
|
$sSubDirectory = str_replace('/','',str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))));
|
||||||
$sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
|
$sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
|
||||||
if ($sMainDirectory == PATH_DATA_MAILTEMPLATES){
|
if ($sMainDirectory == PATH_DATA_MAILTEMPLATES) {
|
||||||
$sMainDirectory = 'mailTemplates';
|
$sMainDirectory = 'mailTemplates';
|
||||||
} else {
|
} else {
|
||||||
$sMainDirectory = 'public';
|
$sMainDirectory = 'public';
|
||||||
@@ -419,14 +422,14 @@ class FilesManager
|
|||||||
$path = $aRow['PRF_PATH'];
|
$path = $aRow['PRF_PATH'];
|
||||||
$rsCriteria->next();
|
$rsCriteria->next();
|
||||||
}
|
}
|
||||||
if ($path == ''){
|
if ($path == '') {
|
||||||
throw new \Exception('invalid value specified for `prf_uid`.');
|
throw new \Exception('invalid value specified for `prf_uid`.');
|
||||||
}
|
}
|
||||||
$sFile = end(explode("/",$path));
|
$sFile = end(explode("/",$path));
|
||||||
$sPath = str_replace($sFile,'',$path);
|
$sPath = str_replace($sFile,'',$path);
|
||||||
$sSubDirectory = str_replace('/','',str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))));
|
$sSubDirectory = str_replace('/','',str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))));
|
||||||
$sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
|
$sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
|
||||||
if ($sMainDirectory == PATH_DATA_MAILTEMPLATES){
|
if ($sMainDirectory == PATH_DATA_MAILTEMPLATES) {
|
||||||
$sMainDirectory = 'mailTemplates';
|
$sMainDirectory = 'mailTemplates';
|
||||||
} else {
|
} else {
|
||||||
$sMainDirectory = 'public';
|
$sMainDirectory = 'public';
|
||||||
|
|||||||
@@ -1027,7 +1027,6 @@ class Task
|
|||||||
'aas_type' => "user" );
|
'aas_type' => "user" );
|
||||||
}
|
}
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($start) {
|
if ($start) {
|
||||||
if ($start < 0) {
|
if ($start < 0) {
|
||||||
@@ -1933,8 +1932,9 @@ class Task
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function arrayPagination($display_array, $page, $show_per_page) {
|
public function arrayPagination($display_array, $page, $show_per_page)
|
||||||
$page = $page+1;
|
{
|
||||||
|
$page = $page + 1;
|
||||||
$show_per_page = $show_per_page -1;
|
$show_per_page = $show_per_page -1;
|
||||||
$start = ($page - 1) * ($show_per_page + 1);
|
$start = ($page - 1) * ($show_per_page + 1);
|
||||||
$offset = $show_per_page + 1;
|
$offset = $show_per_page + 1;
|
||||||
|
|||||||
@@ -112,6 +112,5 @@ class User extends Api
|
|||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user