<?php

require_once "common.php";
global $session, $inventory;
page_header("Inventory");
//$op = httpget("op");
$items_useitem = httpget("items_useitem");
$items_discarditem = httpget("items_discarditem");
$items_transferitem = httpget("items_transferitem");
$items_transferto = httpget("items_transferto");
$context = httpget("items_context");
//handle moving, using, discarding, and contexts
if ($items_transferitem && $items_transferto) {
    move_item($items_transferitem, $items_transferto);
}
if ($items_useitem) {
    use_item($items_useitem, $context);
}
if ($items_discarditem) {
    delete_item($items_discarditem);
}
load_inventory();
//debug($inventory);
$hook = array('inventory' => $inventory, 'context' => $context);
$hook = modulehook("inventory-predisplay", $hook);
addnav("Sort by...");
addnav("Recently Acquired", "inventory.php?items_sort=key&items_context={$context}");
addnav("Alphabetical", "inventory.php?items_sort=alpha&items_context={$context}");
addnav("Quantity", "inventory.php?items_sort=qty&items_context={$context}");
$sort = httpget("items_sort");
$gr = group_items($inventory, $sort);
Exemple #2
0
     exit;
     break;
 case 'move_smiley':
     if (isset($_GET['move_up_smiley'])) {
         move_item($db_settings['smilies_table'], intval($_GET['move_up_smiley']), 'up');
     } elseif (isset($_GET['move_down_smiley'])) {
         move_item($db_settings['smilies_table'], intval($_GET['move_down_smiley']), 'down');
     }
     header('Location: index.php?mode=admin&action=smilies');
     exit;
     break;
 case 'move_category':
     if (isset($_GET['move_up_category'])) {
         move_item($db_settings['category_table'], intval($_GET['move_up_category']), 'up');
     } elseif (isset($_GET['move_down_category'])) {
         move_item($db_settings['category_table'], intval($_GET['move_down_category']), 'down');
     }
     header('Location: index.php?mode=admin&action=categories');
     exit;
     break;
 case 'reorder':
     $ranking = 1;
     foreach ($_POST['items'] as $item_id) {
         if ($_POST['data'] == 'pages') {
             @mysql_query("UPDATE " . $db_settings['pages_table'] . " SET order_id = " . $ranking . " WHERE id = " . intval($item_id), $connid);
         } elseif ($_POST['data'] == 'smilies') {
             @mysql_query("UPDATE " . $db_settings['smilies_table'] . " SET order_id = " . $ranking . " WHERE id = " . intval($item_id), $connid);
         } elseif ($_POST['data'] == 'categories') {
             @mysql_query("UPDATE " . $db_settings['category_table'] . " SET order_id = " . $ranking . " WHERE id = " . intval($item_id), $connid);
         }
         $ranking++;
Exemple #3
0
function delete_date($termin_id, $topic_delete = TRUE, $folder_move = TRUE, $sem_id = 0)
{
    global $RELATIVE_PATH_RESOURCES;
    if (Config::get()->RESOURCES_ENABLE) {
        include_once $RELATIVE_PATH_RESOURCES . "/lib/VeranstaltungResourcesAssign.class.php";
    }
    if (!$folder_move) {
        ## Dateiordner muessen weg!
        recursiv_folder_delete($termin_id);
    } else {
        ## Dateiordner werden verschoben, wenn Ordner nicht leer, ansonsten auch weg
        if (!doc_count($termin_id)) {
            recursiv_folder_delete($termin_id);
        } else {
            $query = "SELECT folder_id FROM folder WHERE range_id = ?";
            $statement = DBManager::get()->prepare($query);
            $statement->execute(array($termin_id));
            $folder_id = $statement->fetchColumn();
            move_item($folder_id, $sem_id, $sem_id);
            $query = "UPDATE folder SET name = ?, description = ? WHERE folder_id = ?";
            $statement = DBManager::get()->prepare($query);
            $statement->execute(array(_('Dateiordner zu gelöschtem Termin'), _('Dieser Ordner enthält Dokumente und Termine eines gelöschten Termins'), $folder_id));
        }
    }
    ## Und den Termin selbst loeschen
    $query = "DELETE FROM termine WHERE termin_id = ?";
    $statement = DBManager::get()->prepare($query);
    $statement->execute(array($termin_id));
    if ($statement->rowCount() && Config::get()->RESOURCES_ENABLE) {
        $insertAssign = new VeranstaltungResourcesAssign($sem_id);
        $insertAssign->killDateAssign($termin_id);
    }
}
Exemple #4
0
        }
        $new_id = create_guid();
        $DB->exec('insert into `' . $tab_files . '` (`id`           , `name`        , `type`, `parent_id`                                         , `caption`        )' . 'values                      (\'' . $new_id . '\', \'' . $alias . '\', 1     , \'' . $_SESSION['gallery_' . DB_PREFIX]['folder_id'] . '\', \'' . $caption . '\' )');
        break;
    case 'delete':
        $id = @$_POST['id'];
        if (get_as_regexp($id, $re_guid) == '') {
            echo '500';
            break;
        }
        delete_item($id);
        break;
    case 'move':
        $id = @$_POST['id'];
        if (get_as_regexp($id, $re_guid) == '') {
            echo '500';
            break;
        }
        $target_id = @$_POST['target'];
        if (get_as_regexp($target_id, $re_guid) == '') {
            echo '500';
            break;
        }
        move_item($id, $target_id);
        break;
    default:
        break;
}
if (!isset($_POST['no_redirect'])) {
    header('Location: main.php?id=' . $_SESSION['gallery_' . DB_PREFIX]['folder_id']);
}
Exemple #5
0
                    $msg .= "error§" . _("Kopieren konnte nicht durchgeführt werden. Eventuell wurde im Ziel der Allgemeine Dateiordner nicht angelegt.") . "§";
                } else {
                    $s_name = get_object_name($sid, Request::submitted('move_to_sem') ? "sem" : "inst");
                    $msg .= "msg§" . $s_name['name'] . ": " . sprintf(_("%s Ordner, %s Datei(en) wurden kopiert."), $done[0], $done[1]) . '§';
                }
            }
        }
    }
    $folder_system_data["move"]='';
    $folder_system_data["mode"]='';
}
//verschieben / kopieren innerhalb der Veranstaltung
//wurde Code fuer Starten der Verschiebung uebermittelt (=id+"_md_"), wird entsprechende Funktion aufgerufen
if ($open_cmd == 'md' && $folder_tree->isWritable($open_id, $user->id) && !Request::submitted("cancel") && (!$folder_tree->isFolder($folder_system_data["move"]) || ($folder_tree->isFolder($folder_system_data["move"]) && $folder_tree->checkCreateFolder($open_id, $user->id)))) {
    if ($folder_system_data["mode"] == 'move'){
        $done = move_item($folder_system_data["move"], $open_id);
        if (!$done){
            $msg .= "error§" . _("Verschiebung konnte nicht durchgeführt werden.") . "§";
        } else {
            $msg .= "msg§" . sprintf(_("%s Ordner, %s Datei(en) wurden verschoben."), $done[0], $done[1]) . '§';
        }
    } else {
        $done = copy_item($folder_system_data["move"], $open_id);
        if (!$done){
            $msg .= "error§" . _("Kopieren konnte nicht durchgeführt werden.") . "§";
        } else {
            $msg .= "msg§" . sprintf(_("%s Ordner, %s Datei(en) wurden kopiert."), $done[0], $done[1]) . '§';
        }
    }
    $folder_system_data["move"]='';
    $folder_system_data["mode"]='';