From 183962bd3b2aa6d5038350b26c42aac7c61c0a8c Mon Sep 17 00:00:00 2001 From: Andreas Moik Date: Tue, 13 Dec 2016 16:13:30 +0100 Subject: [PATCH] - statistik: removed r and php --- include/statistik.class.php | 14 +- system/dbupdate_3.2.php | 29 ++- vilesci/stammdaten/statistik_details.php | 22 +- vilesci/statistik/statistik.php | 245 +++++++++++++++-------- 4 files changed, 200 insertions(+), 110 deletions(-) diff --git a/include/statistik.class.php b/include/statistik.class.php index 46fcef12f..744a6b121 100644 --- a/include/statistik.class.php +++ b/include/statistik.class.php @@ -32,8 +32,6 @@ class statistik extends basis_db public $bezeichnung; public $url; public $sql; - public $php; - public $r; public $gruppe; public $publish; public $insertamum; @@ -92,8 +90,6 @@ class statistik extends basis_db $this->bezeichnung = $row->bezeichnung; $this->url = $row->url; $this->sql = $row->sql; - $this->php = $row->php; - $this->r = $row->r; $this->gruppe = $row->gruppe; $this->publish = $this->db_parse_bool($row->publish); $this->insertamum = $row->insertamum; @@ -141,8 +137,6 @@ class statistik extends basis_db $obj->bezeichnung = $row->bezeichnung; $obj->url = $row->url; $obj->sql = $row->sql; - $obj->php = $row->php; - $obj->r = $row->r; $obj->gruppe = $row->gruppe; $obj->publish = $this->db_parse_bool($row->publish); $obj->insertamum = $row->insertamum; @@ -187,8 +181,6 @@ class statistik extends basis_db $obj->bezeichnung = $row->bezeichnung; $obj->url = $row->url; $obj->sql = $row->sql; - $obj->php = $row->php; - $obj->r = $row->r; $obj->gruppe = $row->gruppe; $obj->publish = $this->db_parse_bool($row->publish); $obj->insertamum = $row->insertamum; @@ -267,14 +259,12 @@ class statistik extends basis_db if($new) { $qry = 'INSERT INTO public.tbl_statistik(statistik_kurzbz, content_id, bezeichnung, url, sql, - php, r, gruppe, publish, insertamum, insertvon, updateamum, updatevon, preferences, berechtigung_kurzbz) VALUES('. + gruppe, publish, insertamum, insertvon, updateamum, updatevon, preferences, berechtigung_kurzbz) VALUES('. $this->db_add_param($this->statistik_kurzbz).','. $this->db_add_param($this->content_id,FHC_INTEGER).','. $this->db_add_param($this->bezeichnung).','. $this->db_add_param($this->url).','. $this->db_add_param($this->sql).','. - $this->db_add_param($this->php).','. - $this->db_add_param($this->r).','. $this->db_add_param($this->gruppe).','. $this->db_add_param($this->publish, FHC_BOOLEAN).','. $this->db_add_param($this->insertamum).','. @@ -294,8 +284,6 @@ class statistik extends basis_db ' statistik_kurzbz='.$this->db_add_param($this->statistik_kurzbz).','. ' url='.$this->db_add_param($this->url).','. ' sql='.$this->db_add_param($this->sql).','. - ' php='.$this->db_add_param($this->php).','. - ' r='.$this->db_add_param($this->r).','. ' gruppe='.$this->db_add_param($this->gruppe).','. ' publish='.$this->db_add_param($this->publish, FHC_BOOLEAN).','. ' insertamum='.$this->db_add_param($this->insertamum).','. diff --git a/system/dbupdate_3.2.php b/system/dbupdate_3.2.php index be5a92cc7..dc64c4e80 100755 --- a/system/dbupdate_3.2.php +++ b/system/dbupdate_3.2.php @@ -1431,6 +1431,33 @@ if($result = @$db->db_query("SELECT 1 FROM kommune.tbl_match")) echo 'kommune schema is dropped
'; } + + +// Removing column "r" from tbl_statistik +if ($result = @$db->db_query("SELECT r FROM public.tbl_statistik LIMIT 1;")) +{ + $qry = "ALTER TABLE public.tbl_statistik DROP COLUMN r;"; + + if (!$db->db_query($qry)) + echo 'public.tbl_statistik: ' . $db->db_last_error() . '
'; + else + echo ' public.tbl_statistik: Spalte r entfernt.
'; +} + + +// Removing column "php" from tbl_statistik +if ($result = @$db->db_query("SELECT php FROM public.tbl_statistik LIMIT 1;")) +{s + $qry = "ALTER TABLE public.tbl_statistik DROP COLUMN php;"; + + if (!$db->db_query($qry)) + echo 'public.tbl_statistik: ' . $db->db_last_error() . '
'; + else + echo ' public.tbl_statistik: Spalte php entfernt.
'; +} + + + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -1643,7 +1670,7 @@ $tabellen=array( "public.tbl_service" => array("service_id", "bezeichnung","beschreibung","ext_id","oe_kurzbz","content_id"), "public.tbl_sprache" => array("sprache","locale","flagge","index","content","bezeichnung"), "public.tbl_standort" => array("standort_id","adresse_id","kurzbz","bezeichnung","insertvon","insertamum","updatevon","updateamum","ext_id", "firma_id","code"), - "public.tbl_statistik" => array("statistik_kurzbz","bezeichnung","url","r","gruppe","sql","php","content_id","insertamum","insertvon","updateamum","updatevon","berechtigung_kurzbz","publish","preferences"), + "public.tbl_statistik" => array("statistik_kurzbz","bezeichnung","url","gruppe","sql","content_id","insertamum","insertvon","updateamum","updatevon","berechtigung_kurzbz","publish","preferences"), "public.tbl_student" => array("student_uid","matrikelnr","prestudent_id","studiengang_kz","semester","verband","gruppe","updateamum","updatevon","insertamum","insertvon","ext_id"), "public.tbl_studentlehrverband" => array("student_uid","studiensemester_kurzbz","studiengang_kz","semester","verband","gruppe","updateamum","updatevon","insertamum","insertvon","ext_id"), "public.tbl_studiengang" => array("studiengang_kz","kurzbz","kurzbzlang","typ","bezeichnung","english","farbe","email","telefon","max_semester","max_verband","max_gruppe","erhalter_kz","bescheid","bescheidbgbl1","bescheidbgbl2","bescheidgz","bescheidvom","orgform_kurzbz","titelbescheidvom","aktiv","ext_id","zusatzinfo_html","moodle","sprache","testtool_sprachwahl","studienplaetze","oe_kurzbz","lgartcode","mischform","projektarbeit_note_anzeige", "onlinebewerbung"), diff --git a/vilesci/stammdaten/statistik_details.php b/vilesci/stammdaten/statistik_details.php index ee89633dd..f5217d5cd 100644 --- a/vilesci/stammdaten/statistik_details.php +++ b/vilesci/stammdaten/statistik_details.php @@ -71,8 +71,6 @@ if(!$rechte->isBerechtigt('basis/statistik')) $sql = (isset($_POST['sql']) ? $_POST['sql'] : die('SQL fehlt')); $gruppe = (isset($_POST['gruppe']) ? $_POST['gruppe'] : die('Gruppe fehlt')); $content_id = (isset($_POST['content_id']) ? $_POST['content_id'] : die('ContentID fehlt')); - $php = (isset($_POST['php']) ? $_POST['php'] : die('PHP fehlt')); - $r = (isset($_POST['r']) ? $_POST['r'] : die('R fehlt')); $publish = (isset($_POST['publish']) ? true : false); $berechtigung_kurzbz = (isset($_POST['berechtigung_kurzbz']) ? $_POST['berechtigung_kurzbz'] : die('Berechtigungkurzbz fehlt')); $preferences = (isset($_POST['preferences']) ? $_POST['preferences'] : die('preferences fehlt')); @@ -91,8 +89,6 @@ if(!$rechte->isBerechtigt('basis/statistik')) $statistik->sql = $sql; $statistik->gruppe = $gruppe; $statistik->content_id = $content_id; - $statistik->php = $php; - $statistik->r = $r; $statistik->publish = $publish; $statistik->updateamum = date('Y-m-d H:i:s'); $statistik->updatevon = $user; @@ -177,14 +173,6 @@ EOT; SQL - R - - - - - PHP - - Publish @@ -192,11 +180,19 @@ EOT; + Preferences - + + + + + + + + diff --git a/vilesci/statistik/statistik.php b/vilesci/statistik/statistik.php index 35aec8af8..49ed209c9 100644 --- a/vilesci/statistik/statistik.php +++ b/vilesci/statistik/statistik.php @@ -1,5 +1,5 @@ - * Andreas Oesterreicher - * Karl Burkhart - * Robert Hofer + * Authors: Christian Paminger < christian.paminger@technikum-wien.at > + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Karl Burkhart < burkhart@technikum-wien.at > */ /** - * Statistik Uebersichtsseite - * - zeigt die Beschreibung einer Statistik ein - * - Link zum Starten der Statistik - * - Eventuelle Parametereingabe für die Statistik + * Seite zur Wartung der Statistiken */ require_once('../../config/vilesci.config.inc.php'); require_once('../../include/statistik.class.php'); -require_once('../../include/filter.class.php'); -require_once('../../include/functions.inc.php'); +require_once('../../include/benutzerberechtigung.class.php'); +require_once('../../include/berechtigung.class.php'); -$statistik_kurzbz = filter_input(INPUT_GET, 'statistik_kurzbz'); - -$statistik = new statistik(); - -if(!$statistik->load($statistik_kurzbz)) +if(!$db = new basis_db()) { - die($statistik->errormsg); + die('Es konnte keine Verbindung zum Server aufgebaut werden.'); } -?> - + +$user = get_uid(); + +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($user); + +if(!$rechte->isBerechtigt('basis/statistik')) + die('Sie haben keine Berechtigung fuer diese Seite'); +?> - Statistik - - - - - - + Statistik - Details + + -

Report - bezeichnung ?>

content_id): ?> - - Beschreibung anzeigen -

- url) -{ - $action = $statistik->url; - $variablenstring = $statistik->url; -} -elseif($statistik->sql!='') -{ - $action = 'statistik_sql.php?statistik_kurzbz='.$statistik_kurzbz; - $variablenstring = $statistik->sql; -} + $statistik_kurzbz = filter_input(INPUT_GET, 'statistik_kurzbz'); + $statistik = new statistik(); -$vars = $statistik->parseVars($variablenstring); ?> - -
- + $statistik->statistik_kurzbz = $statistik_kurzbz; + $statistik->statistik_kurzbz_orig = $statistik_kurzbz_orig; + $statistik->bezeichnung = $bezeichnung; + $statistik->url = $url; + $statistik->sql = $sql; + $statistik->gruppe = $gruppe; + $statistik->content_id = $content_id; + $statistik->publish = $publish; + $statistik->updateamum = date('Y-m-d H:i:s'); + $statistik->updatevon = $user; + $statistik->berechtigung_kurzbz = $berechtigung_kurzbz; + $statistik->preferences = $preferences; + + $success = $statistik->save(); + + if($success): + ?> + Daten erfolgreich gespeichert + + + errormsg ?>loadAll(); ?> + endif; + } - - isFilter($var)): ?> - - - - - - - - - -
getHtmlWidget($var) ?>
+ $preferences = trim($statistik->preferences); + + if(empty($preferences)) + { + $statistik->preferences = << + +
+ new === false): ?> + Bearbeiten - + + Neu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KurzbzGruppe
BezeichnungContentID
URLBerechtigung + getBerechtigungen(); + ?> + +
SQL
Publishpublish ? 'checked="checked"' : '' ?>>
Preferences
+