Merge branch 'master' of git://github.com/colosa/processmaker into BUG-0000

This commit is contained in:
Victor Saisa Lopez
2013-04-16 13:09:12 -04:00
3 changed files with 54 additions and 68 deletions

View File

@@ -838,20 +838,19 @@ class Installer extends Controller
// getting configuration from env.ini
$sysConf = System::getSystemConfiguration( $envFile );
try {
// update the main index file
$indexFileUpdated = System::updateIndexFile( array ('lang' => 'en','skin' => $updatedConf['default_skin']
) );
} catch (Exception $e) {
$info->result = false;
$info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html."));
$info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL');
$this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html')));
return $info;
}
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
$this->buildParternExtras($db_username, $db_password, $_REQUEST['workspace'], SYS_LANG);
} else {
try {
// update the main index file
$indexFileUpdated = System::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin']));
} catch (Exception $e) {
$info->result = false;
$info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html."));
$info->message .= G::LoadTranslation('ID_PROCESSMAKER_UI_NOT_INSTALL');
$this->installLog( G::LoadTranslation('ID_INSTALL_BUT_ERROR', SYS_LANG, Array('index.html')));
return $info;
}
}
$this->installLog( G::LoadTranslation('ID_INDEX_FILE_UPDATED', SYS_LANG, Array($indexFileUpdated, $sysConf['default_lang'],$sysConf['default_skin'])));
@@ -1328,20 +1327,18 @@ class Installer extends Controller
// create session
$cookiefile = '/tmp/curl-session';
$cookiefile = sys_get_temp_dir() . PATH_SEP . 'curl-session';
$fp = fopen($cookiefile, "w");
fclose($fp);
chmod($cookiefile, 0777);
$user = urlencode($username);
$pass = urlencode($password);
$lang = urlencode($lang);
$ch = curl_init();
//die("$serv/sys{$workspace}/{$lang}/classic/login/authentication");
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/login/authentication");
curl_setopt($ch, CURLOPT_HEADER, 0);
@@ -1351,7 +1348,7 @@ class Installer extends Controller
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "form[USR_USERNAME]=$user&form[USR_PASSWORD]=$pass&form[USER_LANG]=$lang");
//curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
$output = curl_exec($ch);
curl_close($ch);
@@ -1362,9 +1359,9 @@ class Installer extends Controller
$ch = curl_init();
// File you want to upload/post
// File to upload/post
$postData['form[LANGUAGE_FILENAME]'] = "@".PATH_CORE."content/translations/processmaker.$lang.po";
//http://pmos/sysworkflow/en/classic/setup/skin_Ajax
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/languages_Import");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
@@ -1374,11 +1371,10 @@ class Installer extends Controller
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
// grab URL and pass it to the browser
echo $output = curl_exec($ch);
$output = curl_exec($ch);
curl_close($ch);
/**
@@ -1391,27 +1387,52 @@ class Installer extends Controller
$plugins = glob(PATH_CORE."plugins/*.tar");
if (count($plugins) > 0) {
$pluginName = $plugins[0];
var_dump($pluginName);
var_dump("$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile");
// File you want to upload/post
// File to upload/post
$postData['form[PLUGIN_FILENAME]'] = "@{$pluginName}";
//http://pmos/sysworkflow/en/classic/setup/skin_Ajax
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/pluginsImportFile");
//curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
//curl_setopt($ch, CURLOPT_TIMEOUT, 90);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
// grab URL and pass it to the browser
echo $output = curl_exec($ch);
$output = curl_exec($ch);
curl_close($ch);
}
$ch = curl_init();
$skins = glob(PATH_CORE."data/partner/*.tar");
if (count($skins) > 0) {
$skin = $skins[0];
$postData['overwrite_files'] = "on";
$postData['workspace'] = "global";
$postData['option'] = "standardupload";
$postData['action'] = "importSkin";
// File to upload/post
$postData['uploadedFile'] = "@".$skin;
curl_setopt($ch, CURLOPT_URL, "$serv/sys{$workspace}/{$lang}/classic/setup/skin_Ajax");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
echo $output = curl_exec($ch);
curl_close($ch);
}
}
}

View File

@@ -295,41 +295,6 @@ try {
die;
}
///// VERIFY PLUGIN ENTERPRISE IF IS ENABLED AND PARTNER FLAG EXIST
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
if ($partnerFlag) {
$flagEnableEnterprise = true;
G::loadClass('PMPluginRegistry');
$sSerializedFile = PATH_DATA_SITE . 'plugin.singleton';
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if (file_exists( $sSerializedFile )) {
$oPluginRegistry->unSerializeInstance( file_get_contents( $sSerializedFile ) );
$attributes = $oPluginRegistry->getAttributes();
if ( isset($attributes['_aPluginDetails']['enterprise']) &&
$attributes['_aPluginDetails']['enterprise']->enabled == 1
) {
$flagEnableEnterprise = false;
}
}
if ($flagEnableEnterprise) {
$pluginFile = 'enterprise.php';
require_once (PATH_PLUGINS . $pluginFile);
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
@$oPluginRegistry->enablePlugin( $details->sNamespace );
@$oPluginRegistry->setupPlugins();
$language = new Language();
$pathPluginTranslations = PATH_PLUGINS . 'enterprise' . PATH_SEP . 'translations' . PATH_SEP;
if (file_exists($pathPluginTranslations . 'translations.php')) {
if (!file_exists($pathPluginTranslations . 'enterprise' . '.' . SYS_LANG . '.po')) {
@$language->createLanguagePlugin('enterprise', SYS_LANG);
}
@$language->updateLanguagePlugin('enterprise', SYS_LANG);
}
}
}
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->extJsInit = true;

View File

@@ -77,7 +77,7 @@ systemInfo.application = {
width: 250,
height: 300,
html: _("ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION")
html: _("ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION") + _("ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION2")
});
var frmfsCenter = new Ext.form.FieldSet({
@@ -89,7 +89,7 @@ systemInfo.application = {
border: false,
labelWidth: 200,
width: 430,
height: 320,
height: 350,
items: [
{
xtype: "displayfield",