Exemplo n.º 1
0
        } else {
            $tmp = explode("_", Request::quoted('mark_list_aktion'));
            $item_ids[0] = $tmp[1];
            if ($item_ids[0] == "all") {
                $item_ids = array();
                foreach ($_possible_open_items as $key => $value) {
                    if ($key != 'root') {
                        $item_ids[] = $key;
                    }
                }
            }
            for ($i = 0; $i < count($item_ids); ++$i) {
                $count_ins = 0;
                for ($j = 0; $j < count($sem_mark_list); ++$j) {
                    if ($sem_mark_list[$j]) {
                        $count_ins += StudipSemTree::InsertSemEntry($item_ids[$i], $sem_mark_list[$j]);
                    }
                }
                $_msg .= sprintf(_("%s Veranstaltung(en) in <b>" . htmlReady($the_tree->tree->tree_data[$item_ids[$i]]['name']) . "</b> eingetragen.<br>"), $count_ins);
            }
            if ($_msg) {
                $_msg = "msg§" . $_msg;
            }
            $the_tree->tree->init();
        }
    }
}
if ($the_tree->mode == "MoveItem" || $the_tree->mode == "CopyItem") {
    if ($_msg) {
        $_msg .= "§";
    }
Exemplo n.º 2
0
    /**
     *  Deletes the current seminar
     *
     * @return void       returns success-message if seminar could be deleted
     *                    otherwise an  error-message
     */

    public function delete()
    {
        $s_id = $this->id;

        // Delete that Seminar.

        // Alle Benutzer aus dem Seminar rauswerfen.
        $query = "DELETE FROM seminar_user WHERE Seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Teilnehmende und Lehrende archiviert."), $db_ar));
        }

        // Alle Benutzer aus Wartelisten rauswerfen
        $query = "DELETE FROM admission_seminar_user WHERE seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        // Alle beteiligten Institute rauswerfen
        $query = "DELETE FROM seminar_inst WHERE Seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Zuordnungen zu Einrichtungen archiviert."), $db_ar));
        }

        // user aus den Statusgruppen rauswerfen
        $count = DeleteAllStatusgruppen($s_id);
        if ($count > 0) {
            $this->createMessage(_("Einträge aus Funktionen / Gruppen gelöscht."));
        }

        // Alle Eintraege aus dem Vorlesungsverzeichnis rauswerfen
        $db_ar = StudipSemTree::DeleteSemEntries(null, $s_id);
        if ($db_ar > 0) {
            $this->createMessage(sprintf(_("%s Zuordnungen zu Bereichen archiviert."), $db_ar));
        }

        // Alle Termine mit allem was dranhaengt zu diesem Seminar loeschen.
        if (($db_ar = SingleDateDB::deleteAllDates($s_id)) > 0) {
            $this->createMessage(sprintf(_("%s Veranstaltungstermine archiviert."), $db_ar));
        }

        //Themen
        IssueDB::deleteAllIssues($s_id);

        //Cycles
        SeminarCycleDate::deleteBySQL('seminar_id = ' . DBManager::get()->quote($s_id));

        // Alle weiteren Postings zu diesem Seminar in den Forums-Modulen löschen
        foreach (PluginEngine::getPlugins('ForumModule') as $plugin) {
            $plugin->deleteContents($s_id);  // delete content irrespective of plugin-activation in the seminar

            if ($plugin->isActivated($s_id)) {   // only show a message, if the plugin is activated, to not confuse the user
                $this->createMessage(sprintf(_('Einträge in %s archiviert.'), $plugin->getPluginName()));
            }
        }


        // Alle Dokumente zu diesem Seminar loeschen.
        if (($db_ar = delete_all_documents($s_id)) > 0) {
            $this->createMessage(sprintf(_("%s Dokumente und Ordner archiviert."), $db_ar));
        }

        // Freie Seite zu diesem Seminar löschen
        $query = "DELETE FROM scm WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(_("Freie Seite der Veranstaltung archiviert."));
        }

        // delete literatur
        $del_lit = StudipLitList::DeleteListsByRange($s_id);
        if ($del_lit) {
            $this->createMessage(sprintf(_("%s Literaturlisten archiviert."),$del_lit['list']));
        }

        // Alle News-Verweise auf dieses Seminar löschen
        if ( ($db_ar = StudipNews::DeleteNewsRanges($s_id)) ) {
            $this->createMessage(sprintf(_("%s Ankündigungen gelöscht."), $db_ar));
        }
        //delete entry in news_rss_range
        StudipNews::UnsetRssId($s_id);

        //kill the datafields
        DataFieldEntry::removeAll($s_id);

        //kill all wiki-pages
        $query = "DELETE FROM wiki WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_wiki = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Wiki-Seiten archiviert."), $db_wiki));
        }

        $query = "DELETE FROM wiki_links WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        $query = "DELETE FROM wiki_locks WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        // kill all the ressources that are assigned to the Veranstaltung (and all the linked or subordinated stuff!)
        if (Config::get()->RESOURCES_ENABLE) {
            $killAssign = new DeleteResourcesUser($s_id);
            $killAssign->delete();
            if ($rr = RoomRequest::existsByCourse($s_id)) {
                RoomRequest::find($rr)->delete();
            }
        }

        // kill virtual seminar-entries in calendar
        $query = "DELETE FROM schedule_seminare WHERE seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        if(get_config('ELEARNING_INTERFACE_ENABLE')){
            global $connected_cms;
            $del_cms = 0;
            $cms_types = ObjectConnections::GetConnectedSystems($s_id);
            if(count($cms_types)){
                foreach($cms_types as $system){
                    ELearningUtils::loadClass($system);
                    $del_cms += $connected_cms[$system]->deleteConnectedModules($s_id);
                }
                $this->createMessage(sprintf(_("%s Verknüpfungen zu externen Systemen gelöscht."), $del_cms ));
            }
        }

        //kill the object_user_vists for this seminar
        object_kill_visits(null, $s_id);

        // Logging...
        $query = "SELECT CONCAT(seminare.VeranstaltungsNummer, ' ', seminare.name, '(', semester_data.name, ')')
                  FROM seminare
                  LEFT JOIN semester_data ON (seminare.start_time = semester_data.beginn)
                  WHERE seminare.Seminar_id='$s_id'";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        $semlogname = $statement->fetchColumn() ?: sprintf('unknown sem_id: %s', $s_id);

        StudipLog::log("SEM_ARCHIVE",$s_id,NULL,$semlogname);
        // ...logged

        // delete deputies if necessary
        deleteAllDeputies($s_id);

        UserDomain::removeUserDomainsForSeminar($s_id);

        AutoInsert::deleteSeminar($s_id);

        //Anmeldeset Zordnung entfernen
        $cs = $this->getCourseSet();
        if ($cs) {
            CourseSet::removeCourseFromSet($cs->getId(), $this->getId());
            $cs->load();
            if (!count($cs->getCourses())
                && $cs->isGlobal()
                && $cs->getUserid() != '') {
                $cs->delete();
            }
        }
        AdmissionPriority::unsetAllPrioritiesForCourse($this->getId());
        // und das Seminar loeschen.
        $this->course->delete();
        $this->restore();
        return true;
    }