Exemplo n.º 1
0
 function aLinks_Extra($mode)
 {
     if ($mode != 'upd') {
         return array();
     }
     $app = trim($this->row['application']);
     // KFD 2/4/08, part of SVN system.  If this node has been set up
     //     as a server that pulls from SVN, we do not offer the build
     //     option on applications anymore, that is only for dev
     //     workstation and old-fashioned non-svn servers.
     $retval = array();
     if (OptionGet('DEV_STATION', 'Y') == 'Y' || $app == 'andro' || OptionGet('BUILD_ALL_APPS', 'N') == 'Y') {
         $retval[] = hLinkBuild($app, 'Build This Application');
         $retval[] = hLinkPopup('', 'View Most Recent Log', array("gp_page" => "a_builder_log", "gp_out" => "info", 'x2' => 1, 'txt_application' => $app));
     }
     // If no authoritative node is listed, we must be it, so list
     // an option.  Otherwise allow code control options.
     $lnk1 = "?gp_page=appversions_p&gp_app=" . trim($this->row['application']);
     $lnk2 = "?gp_page=a_scontrol&gp_skey=" . $this->row['skey'];
     //hprint_r($this->row);
     if (isset($this->row['node'])) {
         if (trim($this->row['node']) == 'LOCAL' || trim($this->row['node']) == '' || is_null($this->row['node'])) {
             $retval[] = hLink('', "Publish Current Code", $lnk1);
         } else {
             $retval[] = hLink('', "Source Code Functions", $lnk2);
         }
     }
     return $retval;
 }
Exemplo n.º 2
0
function hLinkBuild($app, $caption, $code_only = false)
{
    $link_options = array("gp_page" => "a_builder", "gp_out" => "none", 'x2' => 1, 'txt_application' => $app);
    if ($code_only) {
        $link_options['code_only'] = 1;
    }
    return hLinkPopup('small pull-right', $caption, $link_options);
}
Exemplo n.º 3
0
    function main()
    {
        $app = gp('gp_app');
        $sApp = SQLFC(gp('gp_app'));
        $sInst = SQLFC(gp('gp_inst'));
        $hApp = hSanitize(gp('gp_app'));
        $hInst = hSanitize(gp('gp_inst'));
        $rows = SQL_AllRows("SELECT * from instances \n           where application={$sApp} AND instance={$sInst}");
        if (count($rows) != 1) {
            ?>
         <div class="errorbox">Incorrect call to instance processing.</div>
         <?php 
            return;
        }
        $row = $rows[0];
        $hVer = hSanitize(trim($row['version']));
        // Maybe we are on processing branch
        if (gp('gp_posted') == 1) {
            $this->Process($rows[0]);
            return;
        }
        // KFD 2/4/08, Modify this to look for versions on disk
        //     for an svn-enabled server node
        $hWarn = '';
        $av = '';
        if (OptionGet('DEV_STATION', '') == 'N') {
            $sq = "Select * from applications where application={$sApp}";
            $rapp = SQL_OneRow($sq);
            if (trim($rapp['svn_url']) == '') {
                $hWarn = '<br/><br/><b>Subversion url needed.</b> ' . 'You can begin by providing a URL to the subversions ' . 'repository for this application on ' . '<a href="?gp_page=applications&gp_skey=' . $rapp['skey'] . '">the editing screen</a>.';
            }
            $versions = svnVersions();
            $verx = trim($versions[$app]['local']);
            $av = "<p>Latest Andromeda Version: " . trim($versions['andro']['local']);
        } else {
            // Get the current version, and get the latest version available
            $verx = SQL_OneValue("mv", "Select max(version) as mv from appversions\n               WHERE application={$sApp}");
            if (is_null($verx)) {
                $verx = '';
            }
        }
        ?>
        <h1>Instance Upgrade</h1>
        <p>Application: <?php 
        echo $hApp;
        ?>
   </p>
        <p>Instance: <?php 
        echo $hInst;
        ?>
     </p>
        <p>Current Version: <?php 
        echo $hVer == '' ? '-none-' : $hVer;
        ?>
 </p>
        <p>Latest Version Available: <?php 
        echo $verx == '' ? '-none-' : $verx;
        ?>
 </p>
        <?php 
        echo $av;
        ?>
 
        <p>&nbsp;</p>
        <p>
        <?php 
        if ($verx == '') {
            ?>
            <b>No official versions are available.</b>  An instance can only
            be upgraded when an official version is available.  You may
            download release code for this application, or you may
            generate files out of your development code.
            </p>
            <?php 
            echo $hWarn;
            ?>
            <?php 
            return;
        } else {
            $caption = $hVer == '' ? 'Build as ' : 'Upgrade To';
            echo hLinkPopup('', $caption . ' version ' . $verx, array('gp_app' => gp('gp_app'), 'gp_inst' => gp('gp_inst'), 'gp_posted' => 1, 'gp_page' => 'instances_p2', 'gp_out' => 'none', 'gp_ver' => $verx));
        }
    }