Пример #1
0
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Tasklists. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$task = new PluginTasklistsTask();
if (isset($_POST["add"])) {
    $task->check(-1, CREATE, $_POST);
    $newID = $task->add($_POST);
    if ($_SESSION['glpibackcreated']) {
        Html::redirect($task->getFormURL() . "?id=" . $newID);
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $task->check($_POST['id'], DELETE);
        $task->delete($_POST);
        $task->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $task->check($_POST['id'], PURGE);
            $task->restore($_POST);
            $task->redirectToList();