Пример #1
0
    if (tool::securePost('taskdone') == "1") {
        $taskInst->stop();
        $taskInst->update();
    }
} elseif (tool::securePost('action') == "save") {
    // start job
    $jobInst->fill(tool::securePostAll());
    $jobInst->taskId = $taskInst->id;
    $jobInst->start = $toolInst->timestampToSec(tool::securePost('startyear'), tool::securePost('startmonth'), tool::securePost('startday'), tool::securePost('starthour'), tool::securePost('startmin'));
    $saveflags = 0;
    // handle job flags
    if (tool::securePost('privatejob') == "1") {
        $saveflags += JOB_FLAG_PRIVATE;
    }
    $jobInst->flags = $saveflags;
    $jobId = $jobInst->start();
    $jobInst->activate($jobId);
} elseif (tool::securePost('action') == "deleteattach") {
    $attachment = new attachment(tool::securePost('id'));
    $attachment->delete();
    // we need to reload the task to clear the attachment member in this object
    $taskInst->activate($taskInst->id);
}
if (tool::securePost('action') == "delete") {
    $jobInst->activate(tool::securePost('id'));
    $jobInst->delete();
}
if (tool::securePost('action') == "edit") {
    $status = 1;
    $jobInst->activate(tool::securePost('id'));
}