コード例 #1
0
function UWrebuild()
{
    global $log;
    global $db;
    $log->info('Deleting Relationship Cache. Relationships will automatically refresh.');
    echo "\n\t<div id='rrresult'></div>\n\t<script>\n\t\tvar xmlhttp=false;\n\t\t/*@cc_on @*/\n\t\t/*@if (@_jscript_version >= 5)\n\t\t// JScript gives us Conditional compilation, we can cope with old IE versions.\n\t\t// and security blocked creation of the objects.\n\t\t try {\n\t\t  xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t } catch (e) {\n\t\t  try {\n\t\t   xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t  } catch (E) {\n\t\t   xmlhttp = false;\n\t\t  }\n\t\t }\n\t\t@end @*/\n\t\tif (!xmlhttp && typeof XMLHttpRequest!='undefined') {\n\t\t\ttry {\n\t\t\t\txmlhttp = new XMLHttpRequest();\n\t\t\t} catch (e) {\n\t\t\t\txmlhttp = false;\n\t\t\t}\n\t\t}\n\t\tif (!xmlhttp && window.createRequest) {\n\t\t\ttry {\n\t\t\t\txmlhttp = window.createRequest();\n\t\t\t} catch (e) {\n\t\t\t\txmlhttp = false;\n\t\t\t}\n\t\t}\n\t\txmlhttp.onreadystatechange = function() {\n\t\t            if(xmlhttp.readyState == 4) {\n\t\t              document.getElementById('rrresult').innerHTML = xmlhttp.responseText;\n\t\t            }\n\t\t          }\n\t\txmlhttp.open('GET', 'index.php?module=Administration&action=RebuildRelationship&to_pdf=true', true);\n\t\txmlhttp.send(null);\n\t\t</script>";
    $log->info('Rebuilding everything.');
    require_once 'ModuleInstall/ModuleInstaller.php';
    $mi = new ModuleInstaller();
    $mi->rebuild_all();
}
コード例 #2
0
function UWrebuild()
{
    global $db;
    Log::info('Deleting Relationship Cache. Relationships will automatically refresh.');
    echo "\n\t<div id='rrresult'></div>\n\t<script>\n\t\tvar xmlhttp=false;\n\t\t/*@cc_on @*/\n\t\t/*@if (@_jscript_version >= 5)\n\t\t// JScript gives us Conditional compilation, we can cope with old IE versions.\n\t\t// and security blocked creation of the objects.\n\t\t try {\n\t\t  xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t } catch (e) {\n\t\t  try {\n\t\t   xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t  } catch (E) {\n\t\t   xmlhttp = false;\n\t\t  }\n\t\t }\n\t\t@end @*/\n\t\tif (!xmlhttp && typeof XMLHttpRequest!='undefined') {\n\t\t\ttry {\n\t\t\t\txmlhttp = new XMLHttpRequest();\n\t\t\t} catch (e) {\n\t\t\t\txmlhttp = false;\n\t\t\t}\n\t\t}\n\t\tif (!xmlhttp && window.createRequest) {\n\t\t\ttry {\n\t\t\t\txmlhttp = window.createRequest();\n\t\t\t} catch (e) {\n\t\t\t\txmlhttp = false;\n\t\t\t}\n\t\t}\n\t\txmlhttp.onreadystatechange = function() {\n\t\t            if(xmlhttp.readyState == 4) {\n\t\t              document.getElementById('rrresult').innerHTML = xmlhttp.responseText;\n\t\t            }\n\t\t          }\n\t\txmlhttp.open('GET', 'index.php?module=Administration&action=RebuildRelationship&to_pdf=true', true);\n\t\txmlhttp.send(null);\n\t\t</script>";
    Log::info('Rebuilding everything.');
    require_once 'ModuleInstall/ModuleInstaller.php';
    $mi = new ModuleInstaller();
    $mi->rebuild_all();
    $query = "DELETE FROM versions WHERE name='Rebuild Extensions'";
    Log::info($query);
    $db->query($query);
    // insert a new database row to show the rebuild extensions is done
    $id = create_guid();
    $gmdate = TimeDate::getInstance()->nowDb();
    $date_entered = db_convert("'{$gmdate}'", 'datetime');
    $query = 'INSERT INTO versions (id, deleted, date_entered, date_modified, modified_user_id, created_by, name, file_version, db_version) ' . "VALUES ('{$id}', '0', {$date_entered}, {$date_entered}, '1', '1', 'Rebuild Extensions', '4.0.0', '4.0.0')";
    Log::info($query);
    $db->query($query);
}
コード例 #3
0
ファイル: uw_utils.php プロジェクト: Terradex/sugar
/**
 * runs rebuild scripts
 */
function UWrebuild()
{
    global $db;
    global $path;
    logThis('Rebuilding everything...', $path);
    require_once 'ModuleInstall/ModuleInstaller.php';
    $mi = new ModuleInstaller();
    $mi->rebuild_all(true);
    $query = "DELETE FROM versions WHERE name='Rebuild Extensions'";
    $db->query($query);
    logThis('Registering rebuild record: ' . $query, $path);
    logThis('Rebuild done.', $path);
    // insert a new database row to show the rebuild extensions is done
    $id = create_guid();
    $gmdate = gmdate($GLOBALS['timedate']->get_db_date_time_format());
    $date_entered = db_convert("'{$gmdate}'", 'datetime');
    $query = 'INSERT INTO versions (id, deleted, date_entered, date_modified, modified_user_id, created_by, name, file_version, db_version) ' . "VALUES ('{$id}', '0', {$date_entered}, {$date_entered}, '1', '1', 'Rebuild Extensions', '4.0.0', '4.0.0')";
    $db->query($query);
    logThis('Registering rebuild record in versions table: ' . $query, $path);
}
コード例 #4
0
 public function rebuildExtensions()
 {
     global $mod_strings;
     if ($this->show_output) {
         echo $mod_strings['LBL_QR_REBUILDEXT'];
     }
     global $current_user;
     require_once 'ModuleInstall/ModuleInstaller.php';
     $mi = new ModuleInstaller();
     $mi->rebuild_all(!$this->show_output);
     // Remove the "Rebuild Extensions" red text message on admin logins
     if ($this->show_output) {
         echo $mod_strings['LBL_REBUILD_REL_UPD_WARNING'];
     }
     // clear the database row if it exists (just to be sure)
     $query = "DELETE FROM versions WHERE name='Rebuild Extensions'";
     $GLOBALS['log']->info($query);
     $GLOBALS['db']->query($query);
     // insert a new database row to show the rebuild extensions is done
     $id = create_guid();
     $gmdate = gmdate('Y-m-d H:i:s');
     $date_entered = db_convert("'{$gmdate}'", 'datetime');
     $query = 'INSERT INTO versions (id, deleted, date_entered, date_modified, modified_user_id, created_by, name, file_version, db_version) ' . "VALUES ('{$id}', '0', {$date_entered}, {$date_entered}, '1', '1', 'Rebuild Extensions', '4.0.0', '4.0.0')";
     $GLOBALS['log']->info($query);
     $GLOBALS['db']->query($query);
     // unset the session variable so it is not picked up in DisplayWarnings.php
     if (isset($_SESSION['rebuild_extensions'])) {
         unset($_SESSION['rebuild_extensions']);
     }
 }
コード例 #5
0
 function rebuildExtensions()
 {
     global $mod_strings;
     if ($this->show_output) {
         echo $mod_strings['LBL_QR_REBUILDEXT'];
     }
     global $current_user;
     require_once 'ModuleInstall/ModuleInstaller.php';
     $mi = new ModuleInstaller();
     $mi->rebuild_all(!$this->show_output);
 }
コード例 #6
0
 public function rebuildExtensions($objects = array())
 {
     $modules = array();
     global $beanList;
     $modBeans = array_flip($beanList);
     foreach ($objects as $obj) {
         //We expect $objects to be a list of bean classes that we need to map back to modules
         //But also check if the list is actually modules
         if (isset($modBeans[$obj])) {
             $modules[] = $modBeans[$obj];
         } else {
             if (isset($beanList[$obj])) {
                 $modules[] = $obj;
             }
         }
     }
     // Rebuild extensions may have already been called. Don't do it again.
     if (isset($this->called['rebuildExtensions'])) {
         return;
     }
     global $mod_strings;
     if ($this->show_output) {
         echo $mod_strings['LBL_QR_REBUILDEXT'];
     }
     $mi = new ModuleInstaller();
     $mi->rebuild_all(!$this->show_output, $modules);
     // Remove the "Rebuild Extensions" red text message on admin logins
     if ($this->show_output) {
         echo $mod_strings['LBL_REBUILD_REL_UPD_WARNING'];
     }
     // clear the database row if it exists (just to be sure)
     $query = "DELETE FROM versions WHERE name='Rebuild Extensions'";
     $GLOBALS['log']->info($query);
     $GLOBALS['db']->query($query);
     // insert a new database row to show the rebuild extensions is done
     $id = create_guid();
     $gmdate = gmdate('Y-m-d H:i:s');
     $date_entered = db_convert("'{$gmdate}'", 'datetime');
     $query = 'INSERT INTO versions (id, deleted, date_entered, date_modified, modified_user_id, created_by, name, file_version, db_version) ' . "VALUES ('{$id}', '0', {$date_entered}, {$date_entered}, '1', '1', 'Rebuild Extensions', '4.0.0', '4.0.0')";
     $GLOBALS['log']->info($query);
     $GLOBALS['db']->query($query);
     // unset the session variable so it is not picked up in DisplayWarnings.php
     if (isset($_SESSION['rebuild_extensions'])) {
         unset($_SESSION['rebuild_extensions']);
     }
 }
コード例 #7
0
ファイル: Popup.php プロジェクト: jglaine/sugar761-ent
                        $sync_info['last_sync' . $sync_module] = $sync_end_time;
                        $sync_info['local_last_sync' . $sync_module] = $local_time;
                        unset($_SESSION['sync_start_time']);
                        require_once 'include/utils/file_utils.php';
                        add_to_msg('Storing Sync Info', false);
                        write_array_to_file('sync_info', $sync_info, 'modules/Sync/config.php');
                        add_to_msg('<b>Sync Complete</b>', false);
                        $_REQUEST['do_action'] = 'execute';
                        $_REQUEST['repair_silent'] = true;
                        global $current_user;
                        $current_user->is_admin = '1';
                        require_once 'ModuleInstall/ModuleInstaller.php';
                        global $mod_strings, $current_language;
                        $mod_strings = return_module_language($current_language, 'Administration');
                        $mi = new ModuleInstaller();
                        $mi->rebuild_all();
                        $current_user->is_admin = '0';
                        echo '<script>document.getElementById("stop_sync_btn").value="Done"</script>';
                        echo '<script>opener.location.href = "index.php?module=Home&action=index";</script>';
                        update_progress_bar('Total', sizeof($sync_modules), sizeof($sync_modules));
                        //$current_user->setPreference('last_sync'.  $sync_module, $start_time);
                        clear_sync_session();
                        unset($_SESSION['ACL']);
                    }
                }
            }
        } else {
        }
    }
} else {
    include_once 'syncconnect.php';
コード例 #8
0
ファイル: syncconnect.php プロジェクト: jglaine/sugar761-ent
 if (isset($_REQUEST['new_sync'])) {
     // run the file sync
     require_once "include/utils/disc_client_utils.php";
     $from_sync_client = true;
     //before we do a file sync we need to install any necessary upgrades
     $upgrade_applied = get_required_upgrades($soapclient, $session);
     $results = disc_client_get_zip($soapclient, $session, true, 0, $upgrade_applied);
     $_REQUEST['do_action'] = 'execute';
     $_REQUEST['repair_silent'] = true;
     $current_user->is_admin = 1;
     echo "<div id='rrresult'></div>\n                                <script>\n                                var xmlhttp=false;\n                                /*@cc_on @*/\n                                /*@if (@_jscript_version >= 5)\n                                // JScript gives us Conditional compilation, we can cope with old IE versions.\n                                // and security blocked creation of the objects.\n                                 try {\n                                  xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n                                 } catch (e) {\n                                  try {\n                                   xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n                                  } catch (E) {\n                                   xmlhttp = false;\n                                  }\n                                 }\n                                @end @*/\n                                if (!xmlhttp && typeof XMLHttpRequest!='undefined') {\n                                    try {\n                                        xmlhttp = new XMLHttpRequest();\n                                    } catch (e) {\n                                        xmlhttp = false;\n                                    }\n                                }\n                                if (!xmlhttp && window.createRequest) {\n                                    try {\n                                        xmlhttp = window.createRequest();\n                                    } catch (e) {\n                                        xmlhttp = false;\n                                    }\n                                }\n                                xmlhttp.onreadystatechange = function() {\n                                            if(xmlhttp.readyState == 4) {\n                                              document.getElementById('rrresult').innerHTML = xmlhttp.responseText;\n                                            }\n                                          }\n                                xmlhttp.open('GET', 'index.php?module=Sync&action=OfflineClientRepair', true);\n                                xmlhttp.send(null);\n                                </script>";
     //rebuild
     echo "<div id='rrresult'></div>\n                                <script>\n                                var xmlhttp=false;\n                                /*@cc_on @*/\n                                /*@if (@_jscript_version >= 5)\n                                // JScript gives us Conditional compilation, we can cope with old IE versions.\n                                // and security blocked creation of the objects.\n                                 try {\n                                  xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n                                 } catch (e) {\n                                  try {\n                                   xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n                                  } catch (E) {\n                                   xmlhttp = false;\n                                  }\n                                 }\n                                @end @*/\n                                if (!xmlhttp && typeof XMLHttpRequest!='undefined') {\n                                    try {\n                                        xmlhttp = new XMLHttpRequest();\n                                    } catch (e) {\n                                        xmlhttp = false;\n                                    }\n                                }\n                                if (!xmlhttp && window.createRequest) {\n                                    try {\n                                        xmlhttp = window.createRequest();\n                                    } catch (e) {\n                                        xmlhttp = false;\n                                    }\n                                }\n                                xmlhttp.onreadystatechange = function() {\n                                            if(xmlhttp.readyState == 4) {\n                                              document.getElementById('rrresult').innerHTML = xmlhttp.responseText;\n                                            }\n                                          }\n                                xmlhttp.open('GET', 'index.php?module=Administration&action=RebuildRelationship&to_pdf=true', true);\n                                xmlhttp.send(null);\n                                </script>";
     require_once 'ModuleInstall/ModuleInstaller.php';
     $mi = new ModuleInstaller();
     $mi->rebuild_all(true);
     $current_user->is_admin = 0;
     $db =& DBManagerFactory::getInstance();
     $query = "DELETE FROM versions WHERE name='Rebuild Extensions'";
     $db->query($query);
     // insert a new database row to show the rebuild extensions is done
     $id = create_guid();
     $gmdate = TimeDate::getInstance()->nowDb();
     $date_entered = db_convert("'{$gmdate}'", 'datetime');
     $query = 'INSERT INTO versions (id, deleted, date_entered, date_modified, modified_user_id, created_by, name, file_version, db_version) ' . "VALUES ('{$id}', '0', {$date_entered}, {$date_entered}, '1', '1', 'Rebuild Extensions', '4.0.0', '4.0.0')";
     $db->query($query);
     $current_step++;
     update_progress_bar('sync_setup', $current_step, $module_steps);
     add_to_msg('Done updating files<br>');
     add_to_msg('Updating User Information<br>');
     $current_step++;
コード例 #9
0
ファイル: System.php プロジェクト: inetprocess/libsugarcrm
 /**
  * Specific for a fast rebuild of Extentions files for application
  */
 public function rebuildApplication()
 {
     require_once 'ModuleInstall/ModuleInstaller.php';
     $moduleInstaller = new \ModuleInstaller();
     $moduleInstaller->silent = true;
     $moduleInstaller->rebuild_all(true, array('application'));
 }
コード例 #10
0
 public function rebuildExtensions()
 {
     global $mod_strings;
     if ($this->show_output) {
         echo $mod_strings['LBL_QR_REBUILDEXT'];
     }
     global $current_user;
     require_once 'ModuleInstall/ModuleInstaller.php';
     $mi = new ModuleInstaller();
     $mi->rebuild_all(!$this->show_output);
     // Remove the "Rebuild Extensions" red text message on admin logins
     if ($this->show_output) {
         echo $mod_strings['LBL_REBUILD_REL_UPD_WARNING'];
     }
     // unset the session variable so it is not picked up in DisplayWarnings.php
     if (isset($_SESSION['rebuild_extensions'])) {
         unset($_SESSION['rebuild_extensions']);
     }
 }