From c3cef1c5f12e290df7497121c53ec2a5b5ab143e Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 23 Feb 2022 16:17:29 +0100 Subject: [PATCH] adressentyp class hinzugefuegt dynamische anzeige der adressentypen --- include/adresse.class.php | 26 ---------------- include/adressentyp.class.php | 41 ++++++++++++++++++++++++++ rdf/adressentyp.rdf.php | 6 ++-- vilesci/personen/kontaktdaten_edit.php | 27 +++++++++-------- vilesci/personen/personendetails.php | 4 +-- 5 files changed, 59 insertions(+), 45 deletions(-) create mode 100644 include/adressentyp.class.php diff --git a/include/adresse.class.php b/include/adresse.class.php index 0d4e6a7ca..3426d358d 100644 --- a/include/adresse.class.php +++ b/include/adresse.class.php @@ -53,8 +53,6 @@ class adresse extends basis_db public $rechnungsadresse=false; // boolean public $anmerkung; // string public $co_name; - public $adressentyp; - public $bezeichnung; public $bezeichnung_mehrsprachig; /** @@ -523,29 +521,5 @@ 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; - } - } } ?> diff --git a/include/adressentyp.class.php b/include/adressentyp.class.php new file mode 100644 index 000000000..b3f005a94 --- /dev/null +++ b/include/adressentyp.class.php @@ -0,0 +1,41 @@ +db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $obj = new adressentyp(); + + $obj->adressentyp = $row->adressentyp_kurzbz; + $obj->bezeichnung = $row->bezeichnung; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } +} + +?> diff --git a/rdf/adressentyp.rdf.php b/rdf/adressentyp.rdf.php index b34a96cc6..1f12cc6eb 100644 --- a/rdf/adressentyp.rdf.php +++ b/rdf/adressentyp.rdf.php @@ -30,9 +30,9 @@ header("Content-type: application/xhtml+xml"); echo ''; // DAO require_once('../config/vilesci.config.inc.php'); -require_once('../include/adresse.class.php'); +require_once('../include/adressentyp.class.php'); -$adresse = new adresse(); +$adresse = new adressentyp(); $rdf_url='http://www.technikum-wien.at/adressentyp'; echo ' @@ -44,7 +44,7 @@ echo ' '; -if ($adresse->getAdressentyp()) +if ($adresse->getAll()) { foreach ($adresse->result as $row) { diff --git a/vilesci/personen/kontaktdaten_edit.php b/vilesci/personen/kontaktdaten_edit.php index 198809b2d..a882b1350 100644 --- a/vilesci/personen/kontaktdaten_edit.php +++ b/vilesci/personen/kontaktdaten_edit.php @@ -27,6 +27,7 @@ require_once('../../include/benutzerberechtigung.class.php'); require_once('../../include/person.class.php'); require_once('../../include/datum.class.php'); require_once('../../include/adresse.class.php'); +require_once('../../include/adressentyp.class.php'); require_once('../../include/nation.class.php'); require_once('../../include/firma.class.php'); require_once('../../include/standort.class.php'); @@ -70,11 +71,11 @@ if(isset($_GET['getstandort'])) - - - - - + + + + + @@ -260,8 +261,6 @@ if(isset($_POST['saveadresse'])) $adresse_obj->updateamum = date('Y-m-d H:i:s'); $adresse_obj->updatvon = $user; - //var_dump($adresse_obj); - if(!$adresse_obj->save()) { $errormsg = 'Fehler beim Speichern der Adresse:'.$adresse_obj->errormsg; @@ -342,8 +341,6 @@ $firma->getAll(); foreach($firma->result as $row) $firma_arr[$row->firma_id]=$row->name; -$adresstyp_arr = array('h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma'); - //Kontakttypen laden $kontakttyp_arr = array(); $kontakt_obj = new kontakt(); @@ -369,7 +366,7 @@ foreach ($adresse_obj->result as $row) echo "$row->ort"; echo "$row->gemeinde"; echo "".(isset($nation_arr[$row->nation])?$nation_arr[$row->nation]:'').""; - echo "".(isset($adresstyp_arr[$row->typ])?$adresstyp_arr[$row->typ]:'').""; + echo "".(isset($row->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE])?$row->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]:'').""; echo "".($row->heimatadresse?'Ja':'Nein').""; echo "".($row->zustelladresse?'Ja':'Nein').""; echo "".($row->firma_id!=''?$firma_arr[$row->firma_id]:'').""; @@ -426,15 +423,19 @@ else } echo ""; + + $adressetyp = new adressentyp(); + $adressetyp->getAll(); + echo ""; echo ""; diff --git a/vilesci/personen/personendetails.php b/vilesci/personen/personendetails.php index a14a178fb..a20e34c5d 100644 --- a/vilesci/personen/personendetails.php +++ b/vilesci/personen/personendetails.php @@ -191,8 +191,6 @@ $nation_arr['']=''; foreach($nation->nation as $row) $nation_arr[$row->code]=$row->kurztext; -$adresstyp_arr = array(''=>'','h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma'); - // *** ADRESSEN *** echo '

Adressen:

'; echo ' @@ -222,7 +220,7 @@ foreach ($adresse_obj->result as $row) echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; $firma=new firma();
$row->ort$row->gemeinde".$nation_arr[$row->nation]."".$adresstyp_arr[$row->typ]."".$row->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]."".($row->heimatadresse?'Ja':'Nein')."".($row->zustelladresse?'Ja':'Nein')."