/** * @param int $vorgang_von_id * @param int $vorgang_zu_id */ public static function vorgangMerge($vorgang_von_id, $vorgang_zu_id) { $vorgang_von_id = IntVal($vorgang_von_id); $vorgang_zu_id = IntVal($vorgang_zu_id); $str = "Vorgang Merge: von {$vorgang_von_id} => {$vorgang_zu_id}\n"; try { /** @var Vorgang $vorgang_von */ $vorgang_von = Vorgang::model()->findByPk($vorgang_von_id); if (!$vorgang_von) { throw new Exception("Vorgangs-ID nicht gefunden: " . $vorgang_von_id); } foreach ($vorgang_von->antraege as $ant) { $ant->vorgang_id = $vorgang_zu_id; $ant->save(false); $str .= "Antrag: " . $ant->getName() . "\n"; } foreach ($vorgang_von->dokumente as $dok) { $dok->vorgang_id = $vorgang_zu_id; $dok->save(false); $str .= "Dokument: " . $dok->name . "\n"; } foreach ($vorgang_von->ergebnisse as $erg) { $erg->vorgang_id = $vorgang_zu_id; $erg->save(false); $str .= "Ergebnis: " . $erg->getName() . "\n"; } Yii::app()->db->createCommand("UPDATE IGNORE `benutzerInnen_vorgaenge_abos` SET vorgaenge_id = :VorgangIdNeu WHERE vorgaenge_id = :VorgangIdAlt")->bindValues([':VorgangIdNeu' => $vorgang_zu_id, ':VorgangIdAlt' => $vorgang_von_id])->execute(); Yii::app()->db->createCommand("DELETE FROM `benutzerInnen_vorgaenge_abos` WHERE vorgaenge_id = :VorgangIdAlt")->bindValues([':VorgangIdAlt' => $vorgang_von_id])->execute(); $str .= "Gelöscht.\n"; } catch (Exception $e) { $str .= $e; } RISTools::send_email(Yii::app()->params['adminEmail'], "Vorgang:vorgangMerge Error", $str, null, "system"); }
public function actionIndex($code = "") { $this->top_menu = "benachrichtigungen"; $this->requireLogin($this->createUrl("index/benachrichtigungen"), $code); /** @var BenutzerIn $ich */ $ich = $this->aktuelleBenutzerIn(); $this->load_leaflet_css = true; $this->load_leaflet_draw_css = true; if (AntiXSS::isTokenSet("einstellungen_speichern")) { $einstellungen = $ich->getEinstellungen(); if (isset($_REQUEST["intervall"]) && $_REQUEST["intervall"] == "tag") { $einstellungen->benachrichtigungstag = null; } if (isset($_REQUEST["intervall"]) && $_REQUEST["intervall"] == "woche") { if (isset($_REQUEST["wochentag"])) { $einstellungen->benachrichtigungstag = IntVal($_REQUEST["wochentag"]); } } $ich->setEinstellungen($einstellungen); $ich->save(); $this->msg_ok = "Die Einstellung wurde gespeichert."; } if (AntiXSS::isTokenSet("del_ben")) { foreach ($_REQUEST[AntiXSS::createToken("del_ben")] as $ben => $_val) { $bena = json_decode(rawurldecode($ben), true); $krit = new RISSucheKrits($bena); $ich->delBenachrichtigung($krit); $this->msg_ok = "Die Benachrichtigung wurde entfernt."; } } if (AntiXSS::isTokenSet("ben_add_text")) { $suchbegriff = trim($_REQUEST["suchbegriff"]); if ($suchbegriff == "") { $this->msg_err = "Bitte gib einen Suchausdruck an."; } else { $ben = new RISSucheKrits(); $ben->addVolltextsucheKrit($suchbegriff); $ich->addBenachrichtigung($ben); $this->msg_ok = "Die Benachrichtigung wurde hinzugefügt."; } } if (AntiXSS::isTokenSet("ben_add_ba")) { $ben = new RISSucheKrits(); $ben->addBAKrit($_REQUEST["ba"]); $ich->addBenachrichtigung($ben); $this->msg_ok = "Die Benachrichtigung wurde hinzugefügt."; } if (AntiXSS::isTokenSet("ben_add_geo")) { if ($_REQUEST["geo_lng"] == 0 || $_REQUEST["geo_lat"] == 0 || $_REQUEST["geo_radius"] <= 0) { $this->msg_err = "Ungültige Eingabe."; } else { $ben = new RISSucheKrits(); $ben->addGeoKrit($_REQUEST["geo_lng"], $_REQUEST["geo_lat"], $_REQUEST["geo_radius"]); $ich->addBenachrichtigung($ben); $this->msg_ok = "Die Benachrichtigung wurde hinzugefügt."; } } if (AntiXSS::isTokenSet("del_vorgang_abo")) { foreach (AntiXSS::getTokenVal("del_vorgang_abo") as $vorgang_id => $_tmp) { /** @var Vorgang $vorgang */ $vorgang = Vorgang::model()->findByPk($vorgang_id); $vorgang->deabonnieren($ich); $this->msg_ok = "Der Vorgang wurde entfernt."; } } if (AntiXSS::isTokenSet("account_loeschen")) { $this->top_menu = "Accountlöschung"; $this->requireLogin($this->createUrl("index/benachrichtigungen")); $ich = $this->aktuelleBenutzerIn(); $id = $ich->id; if ($ich != NULL) { $ich->email = NULL; $ich->email_bestaetigt = 0; $ich->pwd_enc = NULL; $ich->datum_angelegt = NULL; $ich->datum_letzte_benachrichtigung = NULL; $ich->berechtigungen_flags = 0; $ich->einstellungen_object = NULL; $ich->einstellungen = NULL; $ich->save(false); Yii::app()->db->createCommand("DELETE FROM `benutzerInnen_vorgaenge_abos` WHERE `benutzerInnen_id` = :BenutzerInId")->bindValues([':BenutzerInId' => $ich->id])->execute(); $this->msg_ok = "Account gelöscht"; /** @var CWebUser $user */ $user = Yii::app()->getUser(); if ($user) { $user->logout(); } } else { $this->msg_err = "Sie sind nicht angemeldet"; } $this->redirect(Yii::app()->createUrl("index/startseite")); Yii::app()->end(); } if (AntiXSS::isTokenSet("passwort_aendern")) { /** @var null|BenutzerIn $ich */ $ich = $this->aktuelleBenutzerIn(); if ($ich) { if ($_REQUEST["password"] == $_REQUEST["password2"]) { $ich->pwd_enc = BenutzerIn::create_hash($_REQUEST["password"]); $ich->save(); $this->msg_ok = "Passwort geändert"; } else { $this->msg_err = "Die beiden Passwörter stimmen nicht überein"; } } else { $this->render('/index/error', ["code" => 403, "message" => "Sie sind nicht angemeldet."]); } } $this->render("index", ["ich" => $ich]); }
} else { echo "<li>" . CHtml::link($dokument->getName(), $dokument->getLinkZumDokument()) . "</li>\n"; } } if ($dokument != null) { if ($dokument->antrag_id) { dokumentenliste(Antrag::model()->findByPk($dokument->antrag_id), "Antragsseite", $dokument, true); } else { if ($dokument->tagesordnungspunkt_id) { dokumentenliste(Tagesordnungspunkt::model()->findByPk($dokument->tagesordnungspunkt_id), "Ergebnisseite", $dokument, true); } else { if ($dokument->termin_id) { dokumentenliste(Termin::model()->findByPk($dokument->termin_id), "Terminseite", $dokument, true); } else { if ($dokument->vorgang_id) { dokumentenliste(Vorgang::model()->findByPk($dokument->vorgang_id), "Vorgangsseite", $dokument, false); } else { echo "<li class=\"active\">" . CHtml::encode($dokument->getName()) . "</li>"; } } } } } ?> </ul> <div class="pdf_download_holder"><a href="<?php echo CHtml::encode($dokument->getLink()); ?> " download="<?php echo $dokument->antrag_id; ?>