Fix notice CASE SCHEDULER.

This commit is contained in:
Freddy Daniel Rojas Valda
2014-02-12 12:35:03 -04:00
parent 4d681af477
commit cf5b998d5a
3 changed files with 17 additions and 14 deletions

View File

@@ -464,7 +464,7 @@ class CaseScheduler
$sStartDay = date('Y-m-d'); $sStartDay = date('Y-m-d');
} else { } else {
$size = strlen($aData['SCH_START_DAY']); $size = strlen($aData['SCH_START_DAY']);
if ($size > 4) { if ( $size > 4 ) {
$aaStartDay = explode( "|", $aData['SCH_START_DAY'] ); $aaStartDay = explode( "|", $aData['SCH_START_DAY'] );
$aaStartDay[0] = $aaStartDay[0]; $aaStartDay[0] = $aaStartDay[0];
$aaStartDay[1] = $aaStartDay[1]; $aaStartDay[1] = $aaStartDay[1];
@@ -754,7 +754,7 @@ class CaseScheduler
$sStartDay = date('Y-m-d'); $sStartDay = date('Y-m-d');
} else { } else {
$size = strlen($aData['SCH_START_DAY']); $size = strlen($aData['SCH_START_DAY']);
if ($size > 4) { if ( $size > 4 ) {
$aaStartDay = explode( "|", $aData['SCH_START_DAY'] ); $aaStartDay = explode( "|", $aData['SCH_START_DAY'] );
$aaStartDay[0] = $aaStartDay[0]; $aaStartDay[0] = $aaStartDay[0];
$aaStartDay[1] = $aaStartDay[1]; $aaStartDay[1] = $aaStartDay[1];

View File

@@ -35,20 +35,25 @@ class FilesManager
* Return the Process Files Manager Path * Return the Process Files Manager Path
* *
* @param string $sProcessUID {@min 32} {@max 32} * @param string $sProcessUID {@min 32} {@max 32}
* @param string $sMainDirectory * @param string $path
* *
* return array * return array
* *
* @access public * @access public
*/ */
public function getProcessFilesManagerPath($sProcessUID, $sMainDirectory) public function getProcessFilesManagerPath($sProcessUID, $path)
{ {
try { try {
$sMainDirectory = current(explode("/", $path));
if ($path)
$sSubDirectory = substr($path, strpos($path, "/"));
switch ($sMainDirectory) { switch ($sMainDirectory) {
case 'mailTemplates': case 'templates':
//$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sSubDirectory;
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP; $sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP;
break; break;
case 'public': case 'folder':
//$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP . $sSubDirectory;
$sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP; $sDirectory = PATH_DATA_PUBLIC . $sProcessUID . PATH_SEP;
break; break;
default: default:
@@ -59,13 +64,16 @@ class FilesManager
$aTheFiles = array(); $aTheFiles = array();
$aDirectories = array(); $aDirectories = array();
$aFiles = array(); $aFiles = array();
$sCurrentDirectory = $sSubDirectory;
$oDirectory = dir($sDirectory); $oDirectory = dir($sDirectory);
while ($sObject = $oDirectory->read()) { while ($sObject = $oDirectory->read()) {
if (($sObject !== '.') && ($sObject !== '..')) { if (($sObject !== '.') && ($sObject !== '..')) {
$sPath = $sDirectory . $sObject; $sPath = $sDirectory . $sObject;
$sCurrentDirectory = end(explode("/",$sPath));
if (is_dir($sPath)) { if (is_dir($sPath)) {
$aDirectories[] = array('PATH' => ($sCurrentDirectory != '' ? $sCurrentDirectory . PATH_SEP : '') . $sObject, 'DIRECTORY' => $sObject ); $aTheFiles[] = array('name' => $sObject,
'type' => "folder",
//'path' => $sDirectory);
'path' => ($sCurrentDirectory != '' ? $sCurrentDirectory . PATH_SEP : '') . $sObject);
} else { } else {
$aAux = pathinfo($sPath); $aAux = pathinfo($sPath);
$aAux['extension'] = (isset($aAux['extension'])?$aAux['extension']:''); $aAux['extension'] = (isset($aAux['extension'])?$aAux['extension']:'');
@@ -83,7 +91,7 @@ class FilesManager
} }
$aTheFiles[] = array('name' => $aFile['FILE'], $aTheFiles[] = array('name' => $aFile['FILE'],
'type' => "file", 'type' => "file",
'path' => $sDirectory.$aFile['FILE'], 'path' => $sDirectory,
'editable' => $sEditable); 'editable' => $sEditable);
} }
return $aTheFiles; return $aTheFiles;

View File

@@ -22,11 +22,6 @@ class FilesManager extends Api
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \BusinessModel\FilesManager();
if ($path != '') { if ($path != '') {
if ($path == 'templates') {
$path = 'mailTemplates';
} else {
$path = 'public';
}
$arrayData = $filesManager->getProcessFilesManagerPath($prjUid, $path); $arrayData = $filesManager->getProcessFilesManagerPath($prjUid, $path);
} else { } else {
$arrayData = $filesManager->getProcessFilesManager($prjUid); $arrayData = $filesManager->getProcessFilesManager($prjUid);