HOR-234
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -557,3 +557,42 @@ function getBrowserTimeZoneOffset()
|
||||
return -1 * ((new Date()).getTimezoneOffset() * 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the global state manager. By default all components that are
|
||||
* "state aware" check this class for state information if you don't pass them a
|
||||
* custom state provider. In order for this class to be useful, it must be
|
||||
* initialized with a provider when your application initializes.
|
||||
*
|
||||
* @param {string} cache
|
||||
* @param {string} additionalPrefix
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function setExtStateManagerSetProvider(cache, additionalPrefix) {
|
||||
var workspace = 'ws-undefined';
|
||||
var pathname = location.pathname.split('/');
|
||||
var cookieProvider = new Ext.state.CookieProvider();
|
||||
var i;
|
||||
if (additionalPrefix === undefined) {
|
||||
additionalPrefix = '';
|
||||
}
|
||||
if (pathname.length > 1) {
|
||||
workspace = pathname[1].replace('sys', '');
|
||||
}
|
||||
workspace = workspace + additionalPrefix;
|
||||
cookieProvider.on('statechange', function (provider, key, value) {
|
||||
if (value !== null && JSON.stringify(Ext.state.Manager.get(workspace + cache)) !== JSON.stringify(value)) {
|
||||
Ext.state.Manager.set(workspace + cache, value);
|
||||
}
|
||||
});
|
||||
Ext.state.Manager.setProvider(cookieProvider);
|
||||
Ext.state.Manager.clear(cache);
|
||||
try {
|
||||
if (window.extJsViewState !== undefined) {
|
||||
for (i in extJsViewState) {
|
||||
Ext.state.Manager.clear(i);
|
||||
}
|
||||
Ext.state.Manager.set(cache, Ext.state.Manager.getProvider().decodeValue(extJsViewState[workspace + cache]));
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,5 +737,39 @@ class headPublisher
|
||||
{
|
||||
$this->disableHeaderScripts = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array that contains the status of the view.
|
||||
*
|
||||
* @return array $views
|
||||
*/
|
||||
public function getExtJsViewState()
|
||||
{
|
||||
$views = array();
|
||||
$keyState = "extJsViewState";
|
||||
$prefixExtJs = "ys-";
|
||||
$oServerConf = &serverConf::getSingleton();
|
||||
$deleteCache = true;
|
||||
|
||||
$sjson = $oServerConf->getProperty($keyState);
|
||||
if ($sjson !== "") {
|
||||
$json = G::json_decode($sjson);
|
||||
foreach ($json as $key => $value) {
|
||||
$views[$key] = $value;
|
||||
}
|
||||
}
|
||||
$httpCookies = explode("; ", $_SERVER['HTTP_COOKIE']);
|
||||
foreach ($httpCookies as $cookie) {
|
||||
$value = explode("=", $cookie);
|
||||
if (count($value) > 1 && substr($value[0], 0, 3) === $prefixExtJs) {
|
||||
$deleteCache = false;
|
||||
$key = substr($value[0], 3);
|
||||
$views[$key] = $value[1];
|
||||
}
|
||||
}
|
||||
$oServerConf->setProperty($keyState, G::json_encode($views));
|
||||
return $views;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -222,6 +222,7 @@ $oHeadPublisher->addExtJsScript( 'app/main', true );
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesListExtJs' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||
$ieVersion = null;
|
||||
if(preg_match("/^.*\(.*MSIE (\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch) || preg_match("/^.*\(.*rv.(\d+)\..+\).*$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)){
|
||||
$ieVersion = intval($arrayMatch[1]);
|
||||
|
||||
@@ -78,6 +78,7 @@ $oHeadPublisher->assign("arrayFlagImportFileExtension", $arrayFlagImportFileExte
|
||||
$oHeadPublisher->assign("arrayFlagMenuNewOption", $arrayFlagMenuNewOption);
|
||||
$oHeadPublisher->assign("arrayMenuNewOptionPlugin", $arrayMenuNewOptionPlugin);
|
||||
$oHeadPublisher->assign("arrayContextMenuOptionPlugin", $arrayContextMenuOptionPlugin);
|
||||
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$callBackFile = $oPluginRegistry->getImportProcessCallback();
|
||||
|
||||
@@ -44,7 +44,7 @@ Ext.apply(Ext.form.VTypes, {
|
||||
});
|
||||
|
||||
Ext.onReady(function(){
|
||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||
setExtStateManagerSetProvider('gridProcessMain');
|
||||
Ext.QuickTips.init();
|
||||
|
||||
store = new Ext.data.GroupingStore( {
|
||||
|
||||
Reference in New Issue
Block a user