mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge branch 'feature-14811/neuer_adresstyp_fuer_homeoffice'
This commit is contained in:
@@ -293,36 +293,9 @@ if (!$ansicht)
|
||||
$adresse = new adresse();
|
||||
$adresse->load_pers($user->person_id);
|
||||
|
||||
function sortAdresse($a , $b)
|
||||
{
|
||||
if ($a->typ === $b->typ)
|
||||
return 0;
|
||||
|
||||
return ($a->typ < $b->typ) ? -1 : 1;
|
||||
}
|
||||
usort($adresse->result, "sortAdresse");
|
||||
foreach($adresse->result as $a)
|
||||
{
|
||||
if ($a->zustelladresse)
|
||||
{
|
||||
switch ($a->typ)
|
||||
{
|
||||
case "h":
|
||||
$typ = $p->t("global/hauptwohnsitz");
|
||||
break;
|
||||
case "n":
|
||||
$typ = $p->t("global/nebenwohnsitz");
|
||||
break;
|
||||
default:
|
||||
$typ = NULL;
|
||||
break;
|
||||
}
|
||||
if ($typ !== NULL)
|
||||
{
|
||||
echo "<b>".$typ.": </b><br>";
|
||||
echo $a->strasse."<br>".$a->plz." ".$a->ort."<br><br>";
|
||||
}
|
||||
}
|
||||
echo $a->strasse . "<b> (" . $a->bezeichnung_mehrsprachig[$sprache] .") </b>" . "<br>".$a->plz." ".$a->ort."<br><br>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,13 +70,15 @@ else
|
||||
<row>
|
||||
<label value="Typ" control="adresse-menulist-typ"/>
|
||||
<menulist id="adresse-menulist-typ"
|
||||
flex="1">
|
||||
datasources="<?php echo APP_ROOT ?>rdf/adressentyp.rdf.php" flex="1"
|
||||
ref="http://www.technikum-wien.at/adressentyp/liste">
|
||||
<template>
|
||||
<menupopup>
|
||||
<menuitem value="h" label="Hauptwohnsitz"/>
|
||||
<menuitem value="n" label="Nebenwohnsitz"/>
|
||||
<menuitem value="f" label="Firma"/>
|
||||
<menuitem value="r" label="Rechnungsadresse"/>
|
||||
<menuitem value="rdf:http://www.technikum-wien.at/adressentyp/rdf#adressentyp"
|
||||
label="rdf:http://www.technikum-wien.at/adressentyp/rdf#bezeichnung"
|
||||
uri="rdf:*"/>
|
||||
</menupopup>
|
||||
</template>
|
||||
</menulist>
|
||||
</row>
|
||||
<row>
|
||||
|
||||
@@ -53,6 +53,9 @@ class adresse extends basis_db
|
||||
public $rechnungsadresse=false; // boolean
|
||||
public $anmerkung; // string
|
||||
public $co_name;
|
||||
public $adressentyp;
|
||||
public $bezeichnung;
|
||||
public $bezeichnung_mehrsprachig;
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -133,10 +136,10 @@ class adresse extends basis_db
|
||||
$this->errormsg = 'person_id muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
$sprache = new sprache();
|
||||
//Lesen der Daten aus der Datenbank
|
||||
$qry = "SELECT * FROM public.tbl_adresse WHERE person_id=".$this->db_add_param($pers_id, FHC_INTEGER, false);
|
||||
$qry.=" ORDER BY zustelladresse DESC";
|
||||
$qry = "SELECT *, ". $sprache->getSprachQuery('bezeichnung_mehrsprachig') ." FROM public.tbl_adresse JOIN public.tbl_adressentyp ON typ = adressentyp_kurzbz WHERE person_id=".$this->db_add_param($pers_id, FHC_INTEGER, false);
|
||||
$qry.=" ORDER BY zustelladresse DESC, sort";
|
||||
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
@@ -167,6 +170,7 @@ class adresse extends basis_db
|
||||
$adr_obj->co_name = $row->co_name;
|
||||
$adr_obj->rechnungsadresse = $this->db_parse_bool($row->rechnungsadresse);
|
||||
$adr_obj->anmerkung = $row->anmerkung;
|
||||
$adr_obj->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig',$row);
|
||||
|
||||
$this->result[] = $adr_obj;
|
||||
}
|
||||
@@ -519,5 +523,29 @@ class adresse extends basis_db
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getAdressentyp()
|
||||
{
|
||||
$qry = "SELECT * FROM public.tbl_adressentyp ORDER BY sort";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new adresse();
|
||||
|
||||
$obj->adressentyp = $row->adressentyp_kurzbz;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+1
-10
@@ -76,15 +76,6 @@ function draw_rdf($row)
|
||||
global $rdf_url;
|
||||
$db = new basis_db();
|
||||
|
||||
$typ='';
|
||||
switch ($row->typ)
|
||||
{
|
||||
case 'h': $typ='Hauptwohnsitz'; break;
|
||||
case 'n': $typ='Nebenwohnsitz'; break;
|
||||
case 'f': $typ='Firma'; break;
|
||||
case 'r': $typ='Rechnungsadresse'; break;
|
||||
}
|
||||
|
||||
$firma_name='';
|
||||
if($row->firma_id!='')
|
||||
{
|
||||
@@ -109,7 +100,7 @@ function draw_rdf($row)
|
||||
<ADRESSE:gemeinde><![CDATA['.$row->gemeinde.']]></ADRESSE:gemeinde>
|
||||
<ADRESSE:nation><![CDATA['.$row->nation.']]></ADRESSE:nation>
|
||||
<ADRESSE:typ><![CDATA['.$row->typ.']]></ADRESSE:typ>
|
||||
<ADRESSE:typ_name><![CDATA['.$typ.']]></ADRESSE:typ_name>
|
||||
<ADRESSE:typ_name><![CDATA['.$row->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE].']]></ADRESSE:typ_name>
|
||||
<ADRESSE:heimatadresse><![CDATA['.($row->heimatadresse?'Ja':'Nein').']]></ADRESSE:heimatadresse>
|
||||
<ADRESSE:zustelladresse><![CDATA['.($row->zustelladresse?'Ja':'Nein').']]></ADRESSE:zustelladresse>
|
||||
<ADRESSE:co_name><![CDATA['. $row->co_name.']]></ADRESSE:co_name>
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
// header für no cache
|
||||
header("Cache-Control: no-cache");
|
||||
header("Cache-Control: post-check=0, pre-check=0",false);
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Pragma: no-cache");
|
||||
// content type setzen
|
||||
header("Content-type: application/xhtml+xml");
|
||||
// xml
|
||||
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
|
||||
// DAO
|
||||
require_once('../config/vilesci.config.inc.php');
|
||||
require_once('../include/adresse.class.php');
|
||||
|
||||
$adresse = new adresse();
|
||||
|
||||
$rdf_url='http://www.technikum-wien.at/adressentyp';
|
||||
echo '
|
||||
<RDF:RDF
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:ADRESSENTYP="'.$rdf_url.'/rdf#"
|
||||
>
|
||||
|
||||
<RDF:Seq about="'.$rdf_url.'/liste">
|
||||
';
|
||||
|
||||
if ($adresse->getAdressentyp())
|
||||
{
|
||||
foreach ($adresse->result as $row)
|
||||
{
|
||||
echo '
|
||||
<RDF:li>
|
||||
<RDF:Description id="'.$row->adressentyp.'" about="'.$rdf_url.'/'.$row->adressentyp.'" >
|
||||
<ADRESSENTYP:adressentyp><![CDATA['.$row->adressentyp.']]></ADRESSENTYP:adressentyp>
|
||||
<ADRESSENTYP:bezeichnung><![CDATA['.$row->bezeichnung.']]></ADRESSENTYP:bezeichnung>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $adresse->errormsg;
|
||||
}
|
||||
?>
|
||||
</RDF:Seq>
|
||||
</RDF:RDF>
|
||||
@@ -5022,6 +5022,43 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus_status
|
||||
echo ' public.tbl_zgvpruefungstatus_status: Tabelle hinzugefuegt<br>';
|
||||
}
|
||||
|
||||
// Add table adressentyp
|
||||
if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_adressentyp LIMIT 1;"))
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE public.tbl_adressentyp
|
||||
(
|
||||
adressentyp_kurzbz varchar(32),
|
||||
bezeichnung varchar(256),
|
||||
bezeichnung_mehrsprachig varchar(256)[],
|
||||
sort smallint
|
||||
);
|
||||
|
||||
COMMENT ON TABLE public.tbl_adressentyp IS 'Types of Addresses';
|
||||
ALTER TABLE public.tbl_adressentyp ADD CONSTRAINT pk_tbl_adressentyp PRIMARY KEY (adressentyp_kurzbz);
|
||||
|
||||
INSERT INTO public.tbl_adressentyp(adressentyp_kurzbz, bezeichnung, bezeichnung_mehrsprachig, sort) VALUES ('h', 'Hauptwohnsitz', '{\"Hauptwohnsitz\", \"Principal residence\"}', 1);
|
||||
INSERT INTO public.tbl_adressentyp(adressentyp_kurzbz, bezeichnung, bezeichnung_mehrsprachig, sort) VALUES ('n', 'Nebenwohnsitz', '{\"Nebenwohnsitz\", \"Secondary residence\"}', 2);
|
||||
INSERT INTO public.tbl_adressentyp(adressentyp_kurzbz, bezeichnung, bezeichnung_mehrsprachig, sort) VALUES ('ho', 'Homeoffice', '{\"Homeoffice\", \"Homeoffice\"}', 3);
|
||||
INSERT INTO public.tbl_adressentyp(adressentyp_kurzbz, bezeichnung, bezeichnung_mehrsprachig, sort) VALUES ('r', 'Rechnungsadresse', '{\"Rechnungsadresse\", \"Billing address\"}', 4);
|
||||
INSERT INTO public.tbl_adressentyp(adressentyp_kurzbz, bezeichnung, bezeichnung_mehrsprachig, sort) VALUES ('f', 'Firma', '{\"Firma\", \"Company\"}', 5);
|
||||
|
||||
UPDATE public.tbl_adresse SET typ = 'f' WHERE person_id IS NULL AND (typ IS NULL OR typ = '');
|
||||
UPDATE public.tbl_adresse SET typ = 'h' WHERE person_id IS NOT NULL AND typ IS NULL;
|
||||
|
||||
ALTER TABLE public.tbl_adresse ADD CONSTRAINT fk_tbl_adresse_adressentyp FOREIGN KEY (typ) REFERENCES public.tbl_adressentyp (adressentyp_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT;
|
||||
ALTER TABLE public.tbl_adresse ALTER COLUMN typ TYPE varchar(32);
|
||||
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_adressentyp TO vilesci;
|
||||
GRANT SELECT ON public.tbl_adressentyp TO web;
|
||||
";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_adressentyp: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo ' public.tbl_adressentyp: Tabelle hinzugefuegt<br>';
|
||||
}
|
||||
|
||||
// Add index to lehre.tbl_pruefung
|
||||
if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_pruefung_student_uid'"))
|
||||
{
|
||||
@@ -5782,6 +5819,7 @@ $tabellen=array(
|
||||
"lehre.tbl_zeugnisnote" => array("lehrveranstaltung_id","student_uid","studiensemester_kurzbz","note","uebernahmedatum","benotungsdatum","bemerkung","updateamum","updatevon","insertamum","insertvon","ext_id","punkte"),
|
||||
"public.ci_apikey" => array("apikey_id","key","level","ignore_limits","date_created"),
|
||||
"public.tbl_adresse" => array("adresse_id","person_id","name","strasse","plz","ort","gemeinde","nation","typ","heimatadresse","zustelladresse","firma_id","updateamum","updatevon","insertamum","insertvon","ext_id","rechnungsadresse","anmerkung", "co_name"),
|
||||
"public.tbl_adressentyp" => array("adressentyp_kurzbz", "bezeichnung", "bezeichnung_mehrsprachig", "sort"),
|
||||
"public.tbl_akte" => array("akte_id","person_id","dokument_kurzbz","uid","inhalt","mimetype","erstelltam","gedruckt","titel","bezeichnung","updateamum","updatevon","insertamum","insertvon","ext_id","dms_id","nachgereicht","anmerkung","titel_intern","anmerkung_intern","nachgereicht_am","ausstellungsnation","formal_geprueft_amum","archiv","signiert","stud_selfservice","akzeptiertamum"),
|
||||
"public.tbl_ampel" => array("ampel_id","kurzbz","beschreibung","benutzer_select","deadline","vorlaufzeit","verfallszeit","insertamum","insertvon","updateamum","updatevon","email","verpflichtend","buttontext"),
|
||||
"public.tbl_ampel_benutzer_bestaetigt" => array("ampel_benutzer_bestaetigt_id","ampel_id","uid","insertamum","insertvon"),
|
||||
|
||||
Reference in New Issue
Block a user