Example #1
0
/************************************************************************/
/* AChecker                                                             */
/************************************************************************/
/* Copyright (c) 2008 - 2011                                            */
/* Inclusive Design Institute                                           */
/*                                                                      */
/* This program is free software. You can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License          */
/* as published by the Free Software Foundation.                        */
/************************************************************************/
// $Id$
define('AC_INCLUDE_PATH', '../include/');
require AC_INCLUDE_PATH . 'vitals.inc.php';
require_once AC_INCLUDE_PATH . 'classes/DAO/MyownPatchesDAO.class.php';
require_once AC_INCLUDE_PATH . 'classes/DAO/MyownPatchesDependentDAO.class.php';
require_once AC_INCLUDE_PATH . 'classes/DAO/MyownPatchesFilesDAO.class.php';
if (!isset($_REQUEST["myown_patch_id"])) {
    $msg->addError('NO_ITEM_SELECTED');
    exit;
}
$myown_patch_id = intval($_REQUEST["myown_patch_id"]);
$myownPatchesDAO = new MyownPatchesDAO();
$myownPatchesDependentDAO = new MyownPatchesDependentDAO();
$myownPatchesFilesDAO = new MyownPatchesFilesDAO();
// URL called by form action
$savant->assign('url', dirname($_SERVER['PHP_SELF']) . "/patch_creator.php?myown_patch_id=" . $myown_patch_id);
$savant->assign('patch_row', $myownPatchesDAO->getByID($myown_patch_id));
$savant->assign('dependent_rows', $myownPatchesDependentDAO->getByPatchID($myown_patch_id));
$savant->assign('file_rows', $myownPatchesFilesDAO->getByPatchID($myown_patch_id));
$savant->display('updater/patch_create_edit.tmpl.php');
Example #2
0
    $msg->addFeedback('CANCELLED');
    header('Location: myown_patches.php');
    exit;
} else {
    if (isset($_POST['submit_yes'])) {
        /* delete has been confirmed, delete this category */
        $myown_patch_id = intval($_POST['myown_patch_id']);
        $myownPatchesDependentDAO = new MyownPatchesDependentDAO();
        $myownPatchesFilesDAO = new MyownPatchesFilesDAO();
        $myownPatchesDAO->Delete($myown_patch_id);
        $myownPatchesDependentDAO->DeleteByPatchID($myown_patch_id);
        $myownPatchesFilesDAO->DeleteByPatchID($myown_patch_id);
        $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
        header('Location: myown_patches.php');
        exit;
    }
}
//require('../../include/header.inc.php');
require TR_INCLUDE_PATH . 'header.inc.php';
$_GET['myown_patch_id'] = intval($_GET['myown_patch_id']);
$row = $myownPatchesDAO->getByID($_GET[myown_patch_id]);
if (!$row) {
    $msg->printErrors('ITEM_NOT_FOUND');
} else {
    $hidden_vars['system_patch_id'] = $row['system_patch_id'];
    $hidden_vars['myown_patch_id'] = $row['myown_patch_id'];
    $confirm = array('DELETE_MYOWN_UPDATE', $row['system_patch_id']);
    $msg->addConfirm($confirm, $hidden_vars);
    $msg->printConfirm();
}
require TR_INCLUDE_PATH . 'footer.inc.php';