Beispiel #1
0
     $_STATE->calendar = serialize(clone $calendar);
     $_STATE->msgGreet = $_STATE->project_name . "<br>Select the list style and date range";
     $_STATE->status = SELECT_SPECS;
     break 2;
 case SELECT_SPECS:
     //set the from and to dates
     require_once "calendar.php";
     //catches $_GET refresh
     require_once "date_select.php";
     $dates = unserialize($_STATE->date_select);
     if (!$dates->POST()) {
         $calendar = unserialize($_STATE->calendar);
         $_STATE->msgGreet = $_STATE->project_name . "<br>Select the list style and date range";
         break 2;
     }
     set_state($dates);
     $_STATE->inactive_date = clone $_STATE->to_date;
     $_STATE->inactive_date->add(new DateInterval('P1D'));
     total_hours($_STATE);
     //for all projects
     $_STATE->status = SELECTED_SPECS;
     //for possible goback
     $_STATE->replace();
     //	break 1; //re_switch
 //	break 1; //re_switch
 case SELECTED_SPECS:
     log_list($_STATE);
     $_STATE->msgGreet = "Log entry for " . $_STATE->person_name . "<br>To add or change hours: click on the lefthand column";
     $_STATE->extension = "";
     set_closedCols();
     $_STATE->scion_start("SHEET");
function interpret($parsed, $disabled = false, $makediff = true, $stats = false)
{
    global $gitpath;
    if (isset($parsed['file'])) {
        if ($parsed['strstaged'] == '?' || $parsed['strstaged'] == 'A') {
            if ($makediff) {
                $command = 'diff';
                $args = array('-u', '/dev/null', $parsed['file']);
                if (isset($parsed['staged']) && $parsed['staged'] == 'A') {
                    $args = array('diff', '--cached', $parsed['file']);
                    $command = $gitpath;
                }
                $h = start_command($command, $args);
                close_stdin($h);
                $diff = htmlentities(get_all_data($h));
                clean_up($h);
            } else {
                $diff = false;
            }
            $parsed['state'] = set_state($parsed['strmodified'], $parsed['strstaged']);
            $parsed['staged'] = set_staged($parsed['strmodified'], $parsed['strstaged']);
            list($str, $prefix) = html_file($parsed['file'], $parsed['state'], $parsed['staged'], $parsed['hash'], $diff, $disabled);
            echo $str;
            $parsed['prefix'] = $prefix;
        } elseif ($parsed['strmodified'] == 'M' || $parsed['strstaged'] == 'M' && $parsed['strmodified'] == ' ') {
            if ($makediff) {
                $args = array('diff', $parsed['file']);
                if ($parsed['strstaged'] == 'M' && $parsed['strmodified'] == ' ') {
                    $args = array('diff', '--cached', $parsed['file']);
                }
                $h = start_command($gitpath, $args);
                close_stdin($h);
                $str = get_all_data($h);
                $diff = htmlentities($str);
                $exit = get_exit_code($h);
                clean_up($h);
            } else {
                $diff = false;
            }
            $parsed['state'] = set_state($parsed['strmodified'], $parsed['strstaged']);
            $parsed['staged'] = set_staged($parsed['strmodified'], $parsed['strstaged']);
            list($str, $prefix) = html_file($parsed['file'], $parsed['state'], $parsed['staged'], $parsed['hash'], $diff, $disabled);
            echo $str;
            $parsed['prefix'] = $prefix;
        } elseif ($parsed['strmodified'] == 'D') {
            if ($makediff) {
                $args = array('diff', '--', $parsed['file']);
                $h = start_command($gitpath, $args);
                close_stdin($h);
                $str = get_all_data($h);
                $diff = htmlentities($str);
                $exit = get_exit_code($h);
                clean_up($h);
            } else {
                $diff = false;
            }
            $parsed['state'] = set_state($parsed['strmodified'], $parsed['strstaged']);
            $parsed['staged'] = set_staged($parsed['strmodified'], $parsed['strstaged']);
            list($str, $prefix) = html_file($parsed['file'], $parsed['state'], $parsed['staged'], $parsed['hash'], $diff, $disabled);
            echo $str;
            $parsed['prefix'] = $prefix;
        } elseif ($parsed['strstaged'] == 'D') {
            if ($makediff) {
                $args = array('diff', '--cached', '--', $parsed['file']);
                $h = start_command($gitpath, $args);
                close_stdin($h);
                $str = get_all_data($h);
                $diff = htmlentities($str);
                $exit = get_exit_code($h);
                clean_up($h);
            } else {
                $diff = false;
            }
            $parsed['state'] = set_state($parsed['strmodified'], $parsed['strstaged']);
            $parsed['staged'] = set_staged($parsed['strmodified'], $parsed['strstaged']);
            list($str, $prefix) = html_file($parsed['file'], $parsed['state'], $parsed['staged'], $parsed['hash'], $diff, $disabled);
            echo $str;
            $parsed['prefix'] = $prefix;
        } elseif ($parsed['strstaged'] == 'R') {
            if ($makediff) {
                $args = array('diff', '--cached', '--', $parsed['file']);
                $h = start_command($gitpath, $args);
                close_stdin($h);
                $str = get_all_data($h);
                $diff = htmlentities($str);
                $exit = get_exit_code($h);
                clean_up($h);
            } else {
                $diff = false;
            }
            $parsed['state'] = set_state($parsed['strmodified'], $parsed['strstaged']);
            $parsed['staged'] = set_staged($parsed['strmodified'], $parsed['strstaged']);
            list($str, $prefix) = html_file($parsed['file'], $parsed['state'], $parsed['staged'], $parsed['hash'], $diff, $disabled);
            echo $str;
            $parsed['prefix'] = $prefix;
        } elseif ($parsed['strstaged'] == 'C') {
            $info = htmlentities('file ' . $parsed['newfile'] . ' is a copy of ' . $parsed['oldfile']);
            $parsed['state'] = set_state($parsed['strmodified'], $parsed['strstaged']);
            $parsed['staged'] = set_staged($parsed['strmodified'], $parsed['strstaged']);
            list($str, $prefix) = html_file($parsed['file'], $parsed['state'], $parsed['staged'], $parsed['hash'], $info, $disabled);
            echo $str;
            $parsed['prefix'] = $prefix;
        } else {
            interpret_not_supported($parsed, __FILE__, __LINE__);
        }
    } else {
        if (isset($parsed['dir']) && $parsed['strmodified'] == '?' && $parsed['strstaged'] == '?') {
            // is a dir, handled outside this function
        } else {
            // if type == 'link' -> readlink ( see Github issue #3 )
            interpret_not_supported($parsed, __FILE__, __LINE__);
        }
    }
    return $parsed;
}
Beispiel #3
0
function welcome()
{
    set_state(1);
    ?>
<br>
Welcome to the <?php 
    echo APP_NAME;
    ?>
 Database Upgrade Wizard.<P> If you have just updated
your <?php 
    echo APP_NAME;
    ?>
 code base, you will need to complete the upgrade process in order to ensure your system is fully operational with the new version.
<P>
You will not be able to log into <?php 
    echo APP_NAME;
    ?>
 until your the database upgrade process is completed.
<P>
<font color=orange>!!NB!! You are advised to backup the database before attempting the upgrade. !!NB!!</font>
<P>
If you have already done this, you may skip this step can continue directly to the upgrade.
<P>


&nbsp;&nbsp; &nbsp; &nbsp;  <input type=button value="cancel" onclick="document.location='..';">
&nbsp;&nbsp; &nbsp; &nbsp;  <input type=button value="backup now" onclick="javascript:do_start('BackupConfirm');">
&nbsp;&nbsp; &nbsp; &nbsp;  <input type=button value="next" onclick="javascript:do_start('UpgradeConfirm');">
&nbsp;&nbsp; &nbsp; &nbsp;  <input type=button value="restore database" onclick="javascript:do_start('RestoreConfirm');">


<?php 
}