Пример #1
0
    $oP->add_script(<<<EOF
\tfunction GetAbsoluteUrlAppRoot()
\t{
\t\treturn '../';
\t}
\t
\tfunction doApply(bFull)
\t{
\t\tif (bFull)
\t\t{
\t\t\tvar oMap = { operation: 'update_code_db' };
\t\t\tvar bOk = confirm('Are you sure you want to compile the code and patch the database ?');
\t\t}
\t\telse
\t\t{
\t\t\tvar oMap = { operation: 'update_code' };
\t\t\tvar bOk = confirm('Are you sure you want to compile the code ?');
\t\t}
\t\tvar oUseSymlinks = \$('#symlink:checked');
\t\tif (oUseSymlinks.length > 0)
\t\t{
\t\t\toMap.symlink = 1;
\t\t}
\t\tvar iCount = 0;
\t\t
\t\tif (bOk)
\t\t{
\t\t\t\$('#apply_sql_indicator').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" />');\t\t\t\t\t
\t\t\tajax_request = \$.post(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', oMap,
\t\t\t\t\tfunction(data)
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_apply_sql').empty();
\t\t\t\t\t\tif (data == '')
\t\t\t\t\t\t{
\t\t\t\t\t\t\t\$('#content_apply_sql').append('Nothing done !');
\t\t\t\t\t\t}
\t\t\t\t\t\telse
\t\t\t\t\t\t{
\t\t\t\t\t\t\t\$('#content_apply_sql').append(data);
\t\t\t\t\t\t}
\t\t\t\t\t\t\$('#content_apply_sql').slideDown('slow');\t\t\t\t\t
\t\t\t\t\t\t\$('#apply_sql_indicator').html('');\t\t\t\t\t
\t\t\t\t\t}
\t\t\t);\t\t
\t\t}
\t}
\t
\tfunction CheckConsistency(bRefresh)
\t{
\t\t\$('#content_php').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" /> Checking the consistency of the data model definition...');
\t\tajax_request = \$.get(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', { 'operation': 'check_model', 'rebuild_toolkit_env': bRefresh },
\t\t\t\tfunction(data)
\t\t\t\t{
\t\t\t\t\t\$('#content_php').empty();
\t\t\t\t\tif (data == '')
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_php').append('Ok, no problem detected.');
\t\t\t\t\t\t\$('#content_php').append('<p><input type="button" value=" Refresh " onClick="CheckConsistency(true);"/></p>');
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_php').append(data);
\t\t\t\t\t\t\$('#content_php>div p>b').each( function() {
\t\t\t\t\t\t\tvar sClassName = \$(this).html();
\t\t\t\t\t\t\t\$(this).parent().after('<h2 class="class_name">Class '+sClassName+'</h2>');\t\t\t\t\t
\t\t\t\t\t\t\t}
\t\t\t\t\t\t);
\t\t\t\t\t\t\$('#content_php').append('<p><input type="button" value=" Refresh " onClick="CheckConsistency(true);"/></p>');
\t\t\t\t\t\t\$('#content_php>div').css( {'background':'transparent'} );\t\t\t\t\t
\t\t\t\t\t}
\t\t\t\t}
\t\t);\t\t
\t}
\t
\tfunction CheckDBSchema(bRefresh)
\t{
\t\t\$('#content_schema').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" /> Checking database schema...');
\t\tajax_request = \$.get(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', { 'operation': 'check_db_schema', 'rebuild_toolkit_env': bRefresh },
\t\t\t\tfunction(data)
\t\t\t\t{
\t\t\t\t\t\$('#content_schema').empty();
\t\t\t\t\tif (data == '')
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_schema').append('<p>Ok, no problem detected.</p>');
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_schema').append(data);
\t\t\t\t\t}
\t\t\t\t}
\t\t);\t\t
\t}
\t
\tfunction CheckDataSources(bRefresh)
\t{
\t\t\$('#content_datasources').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" /> Checking data sources integrity...');
\t\tajax_request = \$.get(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', { 'operation': 'check_datasources', 'rebuild_toolkit_env': false },
\t\t\t\tfunction(data)
\t\t\t\t{
\t\t\t\t\t\$('#content_datasources').empty();
\t\t\t\t\tif (data == '')
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_datasources').append('<p>Ok, no problem detected.</p>');
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_datasources').append(data);
\t\t\t\t\t}
\t\t\t\t}
\t\t);\t\t
\t}
\t
\tfunction FixDataSources()
\t{
\t\t\$('#content_datasources').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" /> Fixing data sources integrity...');
\t\tajax_request = \$.get(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', { 'operation': 'fix_datasources' },
\t\t\t\tfunction(data)
\t\t\t\t{
\t\t\t\t\t\$('#content_datasources').empty();
\t\t\t\t\tif (data == '')
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_datasources').append('<p>Ok, no problem detected.</p>');
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_datasources').append(data);
\t\t\t\t\t}
\t\t\t\t}
\t\t);\t\t
\t}
\t
\tfunction CheckHK(bRefresh)
\t{
\t\t\$('#content_hk').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" /> Checking hierarchical keys integrity...');
\t\tajax_request = \$.get(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', { 'operation': 'check_hk', 'rebuild_toolkit_env': false },
\t\t\t\tfunction(data)
\t\t\t\t{
\t\t\t\t\t\$('#content_hk').empty();
\t\t\t\t\tif (data == '')
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_hk').append('<p>Ok, no problem detected.</p>');
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_hk').append(data);
\t\t\t\t\t}
\t\t\t\t}
\t\t);\t\t
\t}
\t
\tfunction BuildHK(bForce)
\t{
\t\t\$('#content_hk').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" /> Fixing hierarchical keys integrity...');
\t\tajax_request = \$.get(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', { 'operation': 'build_hk', 'force': bForce },
\t\t\t\tfunction(data)
\t\t\t\t{
\t\t\t\t\t\$('#content_hk').empty();
\t\t\t\t\tif (data == '')
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_hk').append('<p>Ok, no problem detected.</p>');
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\t\$('#content_hk').append(data);
\t\t\t\t\t}
\t\t\t\t}
\t\t);\t\t
\t}
\t
\tfunction CheckDictionary(bRefresh)
\t{
\t\tvar oLang = \$('#language');
\t\tvar sLang = 'EN US';
\t\tif (oLang.length > 0)
\t\t{
\t\t\tsLang = oLang.val();
\t\t}
\t\tvar oModules = \$('#modules');
\t\tvar sModules = 'bizmodel';
\t\tif (oModules.length > 0)
\t\t{
\t\t\tsModules = oModules.val();
\t\t}
\t\t\$('#content_dictionary').html('<img title=\\"loading...\\" src=\\"../images/indicator.gif\\" /> Searching for missing dictionary items');
\t\tajax_request = \$.get(GetAbsoluteUrlAppRoot()+'toolkit/ajax.toolkit.php', { 'operation': 'check_dictionary', 'rebuild_toolkit_env': bRefresh, 'lang': sLang },
\t\t\t\tfunction(data)
\t\t\t\t{
\t\t\t\t\t\$('#content_dictionary').empty();
\t\t\t\t\t\$('#content_dictionary').append(data);
\t\t\t\t}
\t\t);\t\t
\t}
EOF
);