예제 #1
0
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Badges. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$badge = new PluginBadgesBadge();
if (isset($_POST["add"])) {
    $badge->check(-1, 'w', $_POST);
    $newID = $badge->add($_POST);
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $badge->check($_POST['id'], 'w');
        $badge->delete($_POST);
        $badge->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $badge->check($_POST['id'], 'w');
            $badge->restore($_POST);
            $badge->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $badge->check($_POST['id'], 'w');
예제 #2
0
파일: badge.form.php 프로젝트: AssAB/badges
GNU General Public License for more details.

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