Esempio n. 1
0
function incStatusBar($todo_id, $empl_id)
{
    global $objResponse;
    if (!($todo = new todo())) {
        header('HTTP/1.0 500 Internal Server Error');
    } else {
        if ($todo->incStatusBar($todo_id, $empl_id)) {
            switch ($todo->newStatusBar) {
                case 0:
                    $title = '0%';
                    break;
                case 1:
                    $title = '25%';
                    break;
                case 2:
                    $title = '50%';
                    break;
                case 3:
                    $title = '75%';
                    break;
                case 4:
                    $title = '100%';
                    break;
                default:
                    $title = '0%';
            }
            $objResponse->addAssign("statusbar" . $todo_id, "src", "images/s" . $todo->newStatusBar . ".png");
            $objResponse->addAssign("statusbar" . $todo_id, "title", $title);
            if (!empty($_SESSION['edit_todo_id']) && $_SESSION['edit_todo_id'] == $todo_id) {
                $objResponse->addScript("setDegreeOfComplete({$todo->newStatusBar})");
            }
        }
    }
    return $objResponse->getXML();
}