Пример #1
0
        || ($marked_clip_ids) || ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["reload"])) {

        unset ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["reload"]);
        if (!isset($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_low"])) {
            $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_low"] = 0;
            $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_high"] = 10;
        }
        $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["considered_resources"] = array();

        $semester = new SemesterData;
        $all_semester = $semester->getAllSemesterData();

        $reqObj = new RoomRequest($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["request_id"]);
        $semObj = Seminar::GetInstance($reqObj->getSeminarId(), true);
        $multiOverlaps = new CheckMultipleOverlaps();
        $semResAssign = new VeranstaltungResourcesAssign($semObj->getId());

        //add the requested ressource to selection
        if ($reqObj->getResourceId())
            $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["considered_resources"][$reqObj->getResourceId()] = array("type"=>"requested");

        //add resource_ids from room groups
        if (get_config('RESOURCES_ENABLE_GROUPING')){
            $room_group = RoomGroups::GetInstance();
            $group_id = $_SESSION['resources_data']['actual_room_group'];
            if ($room_group->getGroupCount($group_id)){
                foreach ($room_group->getGroupContent($group_id) as $val) {
                    $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["considered_resources"][$val] = array("type"=>"grouped");
                }
            }
        }
Пример #2
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);
    }
}