if (!empty($_POST['projectnr'])) {
    $_SESSION['projectnr'] = (int) $_POST['projectnr'];
}
// Mülleimer für Projektposition-Formular wird zunächst auf 'unsichtbar' geschaltet.
$archivestyle = 'none';
$projectposition = new projectposition();
$xajax = $xajax_todo->getJavascript('includes/xajax');
$prpos_formvars = new projectposition_foo();
$projectname = $projectposition->getProjectName();
$prpos_formvars->prpos_project_id = $_SESSION['projectnr'];
if (!empty($_POST['formsend'])) {
    /* Wenn das Eintrag gelöschet werden soll, dann brauchen wir
     * es zuerst nicht auf $_POST Variablen auswerten
     */
    if (!empty($_POST['deleteprposdata']) && !empty($_POST['projectposid'])) {
        if ($projectposition->isDeletable($_POST['projectposid'])) {
            if (!$projectposition->delete($_POST['projectposid'])) {
                $erg = $projectposition->getPostVars();
                $prpos_formvars = $projectposition->projectposition_foo;
                if (!$erg) {
                    foreach ($projectposition->errors as $errnumber) {
                        $errors[] = isset($dict[$errnumber]) ? $dict[$errnumber] : $errnumber;
                    }
                }
            }
        }
    } else {
        $erg = $projectposition->getPostVars();
        $prpos_formvars = $projectposition->projectposition_foo;
        if (!$erg) {
            foreach ($projectposition->errors as $errnumber) {
Beispiel #2
0
function getProjectPositionData($prpos_id)
{
    global $objResponse, $dict;
    if (!($projectposition = new projectposition())) {
        header('HTTP/1.0 500 Internal Server Error');
    } elseif ($obj = $projectposition->initById($prpos_id)) {
        $objResponse->addScript("markThis({$prpos_id})");
        // $objResponse->addAssign('errdiv','innerHTML','');
        $objResponse->addAssign('projectposid', 'value', $prpos_id);
        $objResponse->addAssign('projectposition', 'value', $obj->prpos_name);
        $objResponse->addAssign('prposcomment', 'value', $obj->prpos_comment);
        $projectstatus = empty($obj->prpos_status) ? false : true;
        $objResponse->addAssign('prposstatus', 'checked', $projectstatus);
        $objResponse->addScript("setProjectPosSelected({$prpos_id})");
        $objResponse->addAssign('prposcreated', 'innerHTML', $dict['created'] . ':<br />' . $obj->show_created . '<br />' . $obj->show_created_name);
        $objResponse->addAssign('prposchanged', 'innerHTML', $dict['changed'] . ':<br />' . $obj->show_changed . '<br />' . $obj->show_changed_name);
        $objResponse->addScript("setFormTitle('" . $dict['prposedit'] . "')");
        if ($projectposition->isDeletable($prpos_id)) {
            $objResponse->addAssign('removeprposdata', 'style.display', 'inline');
        } else {
            $objResponse->addAssign('removeprposdata', 'style.display', 'none');
        }
    }
    return $objResponse->getXML();
}