Improvement in Alfresco PM functions

This commit is contained in:
Julio Cesar Laura
2013-05-27 16:44:14 -04:00
parent e72dbfcc53
commit f2f74e1885
2 changed files with 10 additions and 10 deletions

View File

@@ -208,9 +208,9 @@ function deleteObject($alfrescoServerUrl, $objetcId, $user, $pwd)
function downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd, $mainFolder = 'Sites') function downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd, $mainFolder = 'Sites')
{ {
if (!(G::verifyPath($pathFolder))) { if (!(G::verifyPath($pathFolder))) {
G::SendTemporalMessage('ID_FILE_PLUGIN_NOT_EXISTS', 'error', 'labels', null, null, array('pluginFile' => $pathFolder)); $result = new stdclass();
G::header('Location: ' . $_SERVER['HTTP_REFERER']); $result->error = G::Loadtranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array('pluginFile' => $pathFolder));
die; return $result;
} }
$dataPathFile = pathinfo($pathFile); $dataPathFile = pathinfo($pathFile);
@@ -223,9 +223,9 @@ function downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd, $m
$xmlObject = simplexml_load_string((string) $sXmlArray); $xmlObject = simplexml_load_string((string) $sXmlArray);
if (!isset($xmlObject->content)) { if (!isset($xmlObject->content)) {
G::SendTemporalMessage('ID_FILE_PLUGIN_NOT_EXISTS', 'error', 'labels', null, null, array('pluginFile' => $nameFile . ' in Alfresco')); $result = new stdclass();
G::header('Location: ' . $_SERVER['HTTP_REFERER']); $result->error = G::Loadtranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array('pluginFile' => $nameFile));
die; return $result;
} }
$linkContent = (string) $xmlObject->content->attributes()->src; $linkContent = (string) $xmlObject->content->attributes()->src;
@@ -323,9 +323,9 @@ function getFolderChildren($alfrescoServerUrl, $folderId, $user, $pwd)
function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docType, $user, $pwd, $path = '', $mainFolder= 'Sites') function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docType, $user, $pwd, $path = '', $mainFolder= 'Sites')
{ {
if (!(file_exists($fileSource))) { if (!(file_exists($fileSource))) {
G::SendTemporalMessage('ID_FILE_PLUGIN_NOT_EXISTS', 'error', 'labels', null, null, array('pluginFile' => $fileSource)); $result = new stdclass();
G::header('Location: ' . $_SERVER['HTTP_REFERER']); $result->error = G::Loadtranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array('pluginFile' => $fileSource));
die; return $result;
} }
$filep = fopen($fileSource, "r"); $filep = fopen($fileSource, "r");
$fileLength = filesize($fileSource); $fileLength = filesize($fileSource);

View File

@@ -153,7 +153,7 @@ try {
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button ); $template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
// $template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "", // $template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "",
// str_replace ( '"', '', $paramDefaultValue ) ) ); // str_replace ( '"', '', $paramDefaultValue ) ) );
$paramValue = $_GET[trim( str_replace( "$", "", $paramName ) )]; $paramValue = isset($_GET[trim( str_replace( "$", "", $paramName ) )]) ? $_GET[trim( str_replace( "$", "", $paramName ) )] : '';
$template->assign ( 'ADD_TRI_VALUE', str_replace("\'", "'", $paramValue) ); $template->assign ( 'ADD_TRI_VALUE', str_replace("\'", "'", $paramValue) );
//turn single quotes to double quotes into an array asignation //turn single quotes to double quotes into an array asignation
$template->assign ( 'ADD_TRI_VALUE', str_replace("'", """, $paramValue) ); $template->assign ( 'ADD_TRI_VALUE', str_replace("'", """, $paramValue) );