diff --git a/vilesci/stammdaten/firma_details.php b/vilesci/stammdaten/firma_details.php index 654cd6a05..07d0c9e5b 100644 --- a/vilesci/stammdaten/firma_details.php +++ b/vilesci/stammdaten/firma_details.php @@ -361,7 +361,7 @@ function getFirmadetail($firma_id,$adresstyp_arr,$user) //Zugriffsrechte pruefen $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); - if(!$rechte->isBerechtigt('basis/firma',null, 'suid')) + if($rechte->isBerechtigt('basis/firma',null, 'suid')) { $htmlstr.="gesperrt?' style="background-color: #FFF4F4;" ':' style="background-color: #E3FDEE;" ')." type='checkbox' name='gesperrt' ".($firma->gesperrt?'checked':'').">\n"; } @@ -581,8 +581,7 @@ function getOrganisationsliste($firma_id,$adresstyp_arr,$user) ## var_dump($firma); $htmlstr.= ' - - + '; - $htmlstr.= ''; - $htmlstr.= ''; - + $htmlstr.= ''; + $htmlstr.= ''; $htmlstr.= ''; $htmlstr.= ''; $htmlstr.= ""; diff --git a/vilesci/stammdaten/firma_detailwork.php b/vilesci/stammdaten/firma_detailwork.php index 5aea0c626..a229d1b6a 100644 --- a/vilesci/stammdaten/firma_detailwork.php +++ b/vilesci/stammdaten/firma_detailwork.php @@ -232,20 +232,23 @@ if(isset($_GET['type']) && $_GET['type']=='getortcontent' && isset($_GET['plz']) - + + + - + + errormsg; return false; } - $bezeichnung=($bezeichnung?$bezeichnung:$organisationseinheit_obj->bezeichnung); + //$bezeichnung=($bezeichnung?$bezeichnung:$organisationseinheit_obj->bezeichnung); } else { @@ -657,6 +662,11 @@ function saveFirmaorganisationseinheit($firma_id,$firma_organisationseinheit_id, $firma->kundennummer=$kundennummer; $firma->ext_id=$ext_id; + if($firma->get_firmaorganisationseinheit($firma->firma_id, $firma->oe_kurzbz)) + { + echo "Organisationseinheit ".$firma->oe_kurzbz." ist bereits zugeteilt!"; + return false; + } if (!$firma->saveorganisationseinheit()) echo $firma->errormsg; return $firma->firma_organisationseinheit_id; @@ -684,8 +694,8 @@ function eingabeOrganisationseinheit($firma_id,$firma_organisationseinheit_id,$o '; // - // - $htmlstr.= ' + $htmlstr.= ' + '; @@ -716,8 +726,8 @@ function eingabeOrganisationseinheit($firma_id,$firma_organisationseinheit_id,$o //$htmlstr.= ''; //$htmlstr.= ''; - //$htmlstr.= ''; - $htmlstr.= ""; + $htmlstr.= ""; + $htmlstr.= ""; $htmlstr.= ''; $htmlstr.= ''; $htmlstr.="\n"; @@ -734,15 +744,15 @@ function eingabeOrganisationseinheit($firma_id,$firma_organisationseinheit_id,$o $htmlstr.= ""; } $htmlstr.= " - - - + "; + // + $htmlstr.= " "; //$htmlstr.= ''; - //$htmlstr.= ''; - $htmlstr.= ""; + $htmlstr.= ""; + $htmlstr.= ""; $htmlstr.= ''; $htmlstr.= ''; $htmlstr.="\n"; @@ -1212,9 +1222,9 @@ function eingabePersonenfunktionen($firma_id,$standort_id,$personfunktionstandor $htmlstr.=""; $htmlstr.=""; $htmlstr.="\n"; - $htmlstr.=""; + $htmlstr.=""; $htmlstr.=""; - $htmlstr.="\n"; + $htmlstr.="'; $htmlstr.=""; $person=($standort_obj->person_anrede?$standort_obj->person_anrede.' ':'').($standort_obj->titelpre?$standort_obj->titelpre.' ':'').($standort_obj->vorname?$standort_obj->vorname.' ':'').($standort_obj->nachname?$standort_obj->nachname.' ':''); $htmlstr.=($person?'':'')."
KurzbezeichnungTypOrganisationseinheit Bezeichnung Kundennummer \n"; $i++; - $htmlstr.= ''.$row->oe_kurzbz.''.$row->organisationseinheittyp_kurzbz.''.$row->bezeichnung.''.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.''.$row->fobezeichnung.''.$row->kundennummer.'editierenfirma_organisationseinheit_id."&oe_kurzbz=".$row->oe_kurzbz."&firma_id=".$firma_id."' onclick='return confdel()'>loeschen
Bezeichnung OrganisationseinheitKurzbezeichnungBezeichnungKundennummerBezeichnungKundennummer  
'.$row->organisationseinheittyp_kurzbz.''.$row->oe_kurzbz.''.$row->bezeichnung.'
 Anrede:  
 
Person: \n"; $htmlstr.=" "; - + //$htmlstr.'
'; + //$htmlstr.='?
 '.$person.'
"; @@ -1244,7 +1255,7 @@ function eingabePersonenfunktionen($firma_id,$standort_id,$personfunktionstandor $htmlstr.="    "; $htmlstr.=''; $htmlstr.="    "; - $htmlstr.=""; + $htmlstr.=""; $htmlstr.=""; $htmlstr.="\n"; diff --git a/vilesci/stammdaten/firma_frameset.html b/vilesci/stammdaten/firma_frameset.html index 1627588d1..8ade5ef41 100644 --- a/vilesci/stammdaten/firma_frameset.html +++ b/vilesci/stammdaten/firma_frameset.html @@ -8,7 +8,7 @@ - + diff --git a/vilesci/stammdaten/firma_zusammen_details.php b/vilesci/stammdaten/firma_zusammen_details.php index 24b638f50..f6e81d6f9 100644 --- a/vilesci/stammdaten/firma_zusammen_details.php +++ b/vilesci/stammdaten/firma_zusammen_details.php @@ -1,5 +1,5 @@ + * Authors: Christian Paminger < christian.paminger@technikum-wien.at > * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > - * Rudolf Hangl < rudolf.hangl@technikum-wien.at > + * Rudolf Hangl < rudolf.hangl@technikum-wien.at > * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > */ - - require_once('../../config/vilesci.config.inc.php'); - require_once('../../include/functions.inc.php'); - require_once('../../include/firma.class.php'); - require_once('../../include/standort.class.php'); - require_once('../../include/adresse.class.php'); - require_once('../../include/kontakt.class.php'); - require_once('../../include/person.class.php'); - require_once('../../include/nation.class.php'); - require_once('../../include/benutzerberechtigung.class.php'); - - if (!$db = new basis_db()) - die('Es konnte keine Verbindung zum Server aufgebaut werden.'); - - // Benutzerinformation - $user=get_uid(); - - // Zugriffsrechte pruefen - $rechte = new benutzerberechtigung(); - $rechte->getBerechtigungen($user); - if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('basis/firma',null,'suid')) - die('Sie haben keine Berechtigung für diese Seite'); - // Parameter - $firma_id_geloescht = (isset($_REQUEST['firma_id_geloescht'])?$_REQUEST['firma_id_geloescht']:''); - if (empty($firma_id_geloescht)) - exit('Es fehlt welche Firma gelöscht werden soll !'); - $firma_id_bleibt = (isset($_REQUEST['firma_id_bleibt'])?$_REQUEST['firma_id_bleibt']:''); - if (empty($firma_id_bleibt)) - exit('Es fehlt welche Firma bleibt !'); - if ($firma_id_geloescht==$firma_id_bleibt) - exit('Zusammenlegen nicht möglich ! Firmendaten sind gleich '); - $work = (isset($_REQUEST['work'])?$_REQUEST['work']:''); +require_once('../../config/vilesci.config.inc.php'); +require_once('../../include/functions.inc.php'); +require_once('../../include/firma.class.php'); +require_once('../../include/standort.class.php'); +require_once('../../include/adresse.class.php'); +require_once('../../include/kontakt.class.php'); +require_once('../../include/person.class.php'); +require_once('../../include/nation.class.php'); +require_once('../../include/benutzerberechtigung.class.php'); + +if (!$db = new basis_db()) + die('Es konnte keine Verbindung zum Server aufgebaut werden.'); + +// Benutzerinformation +$user=get_uid(); + +// Zugriffsrechte pruefen +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($user); +if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('basis/firma:begrenzt',null,'suid')) + die('Sie haben keine Berechtigung für diese Seite'); + +// Parameter +$firma_id_geloescht = (isset($_REQUEST['firma_id_geloescht'])?$_REQUEST['firma_id_geloescht']:''); +if (empty($firma_id_geloescht)) + exit('Es fehlt welche Firma gelöscht werden soll !'); +$firma_id_bleibt = (isset($_REQUEST['firma_id_bleibt'])?$_REQUEST['firma_id_bleibt']:''); +if (empty($firma_id_bleibt)) + exit('Es fehlt welche Firma bleibt !'); +if ($firma_id_geloescht==$firma_id_bleibt) + exit('Zusammenlegen nicht möglich ! Firmendaten sind gleich '); +$work = (isset($_REQUEST['work'])?$_REQUEST['work']:''); //---------------------------------------------------------------------------------------- // wenn Work ok (Voranzeige) PopUp Anzeige , und Ende / Funktion am Ende //---------------------------------------------------------------------------------------- - if (empty($work) ) - { - if (!$standort=getFirmaUndStandorte($firma_id_geloescht,$firma_id_bleibt)) - exit("Fehler beim Ermitteln der Daten! Firma $firma_id_geloescht die geloescht werden soll, und Firma $firma_id_bleibt die bleibt."); - $geloescht=$standort['geloescht']; - $bleibt=$standort['bleibt']; +if (empty($work) ) +{ + if (!$standort=getFirmaUndStandorte($firma_id_geloescht,$firma_id_bleibt)) + exit("Fehler beim Ermitteln der Daten! Firma $firma_id_geloescht die geloescht werden soll, und Firma $firma_id_bleibt die bleibt."); + $geloescht=$standort['geloescht']; + $bleibt=$standort['bleibt']; - } +} ?> Firmen zusammenlegen - + + + + + + + + + - - - - + + @@ -154,7 +169,7 @@
-
+
schliessen  

 
@@ -174,10 +189,10 @@ -
- firma_id.' '.$geloescht->firmentyp_kurzbz.' '.$geloescht->name ;?> wird gelöscht -
- Standorte +
+ firma_id.' '.$geloescht->firmentyp_kurzbz.' '.$geloescht->name ;?> wird gelöscht +
+ Standorte standorte) @@ -185,34 +200,35 @@ foreach ($geloescht->standorte as $standort) { - echo ' - +
'.$standort->standort_id.' '.$standort->bezeichnung.''; - echo ''; - echo ''; + echo ''; @@ -225,39 +241,43 @@ -
- Organisation +
+ Organisation
'.$standort->bezeichnung.'
Adressen zu '.$standort->kurzbz.''; - if ($standort->adresse) - { - echo ''; - } - echo '
'.$standort->adresse->strasse.'
'.$standort->adresse->plz.' '.$standort->adresse->ort.'
'.$standort->standort_id.' '.($standort->bezeichnung==NULL?$standort->kurzbz:$standort->bezeichnung).''; + echo ''; + echo ''; - echo ''; - - echo ''; + echo ''; + + echo ''; echo '
'.(($standort->bezeichnung==NULL||$standort->bezeichnung=="")?$standort->kurzbz:$standort->bezeichnung).'
Adressen zu '.$standort->kurzbz.''; + if ($standort->adresse) + { + echo ''; + } + echo '
'.$standort->adresse->strasse.'
'.$standort->adresse->plz.' '.$standort->adresse->ort.'
Direktekontakte zu '.$standort->kurzbz.''; - if ($standort->kontakt->result) - { - foreach ($standort->kontakt->result as $kontakt) - { - echo ''; - } - } - echo '
'.$kontakt->kontakttyp.' '.$kontakt->kontakt.'
'.$kontakt->anmerkung.'
Personenkontakte zu '.$standort->kurzbz.''; - if ($standort->personfunktion->result) - { - foreach ($standort->personfunktion->result as $personfunktion) - { - echo ''; - } - } - echo '
'.$personfunktion->funktion_kurzbz.'
'.$personfunktion->position.'
'.$personfunktion->anrede.'
Direktekontakte zu '.$standort->kurzbz.''; + //if ($standort->kontakt->result) + if ($standort->kontakt) + { + foreach ($standort->kontakt->result as $kontakt) + { + echo ''; + } + } + echo '
'.$kontakt->kontakttyp.' '.$kontakt->kontakt.'
'.$kontakt->anmerkung.'
Personenkontakte zu '.$standort->kurzbz.''; + if ($standort->personfunktion->result) + { + foreach ($standort->personfunktion->result as $personfunktion) + { + echo ''; + } + } + echo '
'.$personfunktion->funktion_kurzbz.'
'.$personfunktion->position.'
'.$personfunktion->anrede.'
firmaorganisationseinheit) { foreach ($geloescht->firmaorganisationseinheit as $firmaorganisationseinheit) { - echo ''; + //var_dump($firmaorganisationseinheit); + echo ''; + echo ''; + echo ''; } } - ?> + ?>
'.$firmaorganisationseinheit->bezeichnung.'
'.$firmaorganisationseinheit->bezeichnung.'
'.$firmaorganisationseinheit->fobezeichnung.'
KNr.: '.$firmaorganisationseinheit->kundennummer.'
 
-
- firma_id.' '.$bleibt->firmentyp_kurzbz.' '.$bleibt->name ;?> bleibt +
+ firma_id.' '.$bleibt->firmentyp_kurzbz.' '.$bleibt->name ;?> bleibt -
- Standorte +
+ Standorte standorte) { foreach ($bleibt->standorte as $standort) { - echo '
'.$standort->standort_id.' '.$standort->bezeichnung.''; + echo '
'.$standort->standort_id.' '.$standort->bezeichnung.''; echo ''; - echo '
'.$standort->bezeichnung.'
Adressen zu '.$standort->kurzbz.''; + echo ''; - echo '
Adressen zu '.$standort->kurzbz.''; if ($standort->adresse) { echo ''; @@ -265,8 +285,9 @@ echo '
'.$standort->adresse->strasse.'
'.$standort->adresse->plz.' '.$standort->adresse->ort.'
Direktekontakte zu '.$standort->kurzbz.''; - if ($standort->kontakt->result) + echo ''; - echo '
Direktekontakte zu '.$standort->kurzbz.''; + //if ($standort->kontakt->result) + if ($standort->kontakt) { foreach ($standort->kontakt->result as $kontakt) { @@ -278,12 +299,13 @@ echo '
Personenkontakte zu '.$standort->kurzbz.''; + echo ''; @@ -298,8 +320,8 @@ -
- Organisation +
+ Organisation
Personenkontakte zu '.$standort->kurzbz.''; if ($standort->personfunktion->result) - { + { + //var_dump($standort->personfunktion); foreach ($standort->personfunktion->result as $personfunktion) { - echo ''; + echo ''; } } echo '
'.$personfunktion->funktion_kurzbz.'
'.$personfunktion->position.'
'.$personfunktion->anrede.'
'.$personfunktion->funktion_kurzbz.'
'.$personfunktion->position.'
Anrede: '.$personfunktion->anrede.'
'.trim($personfunktion->titelpre.' '.$personfunktion->vorname.' '.$personfunktion->nachname.' '.$personfunktion->titelpost).'
firmaorganisationseinheit) @@ -307,6 +329,8 @@ foreach ($bleibt->firmaorganisationseinheit as $firmaorganisationseinheit) { echo ''; + echo ''; + echo ''; } } ?> @@ -335,6 +359,24 @@ $personfunktionstandort = (isset($firmendaten['personfunktionstandort'])?$firmendaten['personfunktionstandort']:array()); $firmaorganisationseinheit = (isset($firmendaten['firmaorganisationseinheit'])?$firmendaten['firmaorganisationseinheit']:array()); + //Überprüfung auf doppelte Organisationseinheiten + $firmaorganisationseinheit_check=array(); + for ($i=0;$iresult[$i] = new firma(); + if($firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($firmaorganisationseinheit[$i])) + { + if (isset($firmaorganisationseinheit_obj->result[$i])) + { + if(array_key_exists($firmaorganisationseinheit_obj->result[$i]->oe_kurzbz,$firmaorganisationseinheit_check)) + { + exit("Es wurden Zuordnungen von Organisationseiheiten mehrfach ausgewählt!
Bitte Auswahl korrigieren.
"); + } + $firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]=$firmaorganisationseinheit[$i]; + } + } + } + if (is_array($standort) && count($standort)) { // Array mit Standort als Key fuer Kontrolle der Adressen ob der Standort noch gueltig ist oder neu zugeordnet wird @@ -395,23 +437,33 @@ { // Array mit Standort als Key fuer Kontrolle der Adressen ob der Standort noch gueltig ist oder neu zugeordnet wird $firmaorganisationseinheit_check=array(); + $firmaorganisationseinheit_ok=array(); for ($i=0;$iload_firmaorganisationseinheit('','',$firmaorganisationseinheit[$i])) + $firmaorganisationseinheit_obj->result[$i] = new firma(); + + + if($firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($firmaorganisationseinheit[$i])) { - if (isset($firmaorganisationseinheit_obj->result[0])) - $firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[0]->oe_kurzbz]=$firmaorganisationseinheit[$i]; + if (isset($firmaorganisationseinheit_obj->result[$i])) + { + if(!array_key_exists($firmaorganisationseinheit_obj->result[$i]->oe_kurzbz,$firmaorganisationseinheit_check)) + { + $firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]=$firmaorganisationseinheit[$i]; + //echo $firmaorganisationseinheit_obj->result[$i]->oe_kurzbz." ".$firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]."
"; + } + } } else - echo "
".$firmaorganisationseinheit_obj->errormsg; + echo "
".$firmaorganisationseinheit_obj->errormsg; } + //var_dump($firmaorganisationseinheit_check); foreach ($firmaorganisationseinheit_check as $key => $val) + { $firmaorganisationseinheit_ok[]=$val; - + } + $firmaorganisationseinheit=$firmaorganisationseinheit_ok; $firmaorganisationseinheit_ok=null; $firmaorganisationseinheit_check=null; @@ -419,14 +471,14 @@ $firma = new firma(); if(!$firma->load($firma_id_bleibt)) - exit('Welche Firma bleibt fehler :'.$firma->errormsg); + exit('Welche Firma bleibt Fehler :'.$firma->errormsg); ?>
- Informationen nach der Zusammenlegung + Informationen nach der Zusammenlegung
- Firma firma_id; ?> + Firma firma_id; ?> '; echo '
'.$firmaorganisationseinheit->bezeichnung.'
'.$firmaorganisationseinheit->fobezeichnung.'
KNr.: '.$firmaorganisationseinheit->kundennummer.'
'.$firma->firmentyp_kurzbz.' '.$firma->name @@ -456,7 +508,7 @@ { ?>
- Standort name; ?> + Standort name; ?> result=array(); @@ -468,7 +520,7 @@ // Kontakt zum Standort if (!isset($kontakt[$key]) || !is_array($kontakt[$key]) || !count($kontakt[$key])) { - echo 'Keinen Kontakte zum Standort !
'; + echo 'Keine Kontakte zum Standort !
'; } else { @@ -477,7 +529,7 @@ // Kontakte zum Standort $kontakt_obj = new kontakt(); if($kontakt_obj->load($vals)) - echo 'Kontakt ' + echo 'Kontakt ' ." Zustellung:zustellung?' style="background-color: #E3FDEE;" ':' style="background-color: #FFF4F4;" ')." type='checkbox' name='schule' ".($kontakt_obj->zustellung?'checked':'')."> " . $vals.' '.$kontakt_obj->kontakttyp.' '.$kontakt_obj->kontakt .' '.$kontakt_obj->beschreibung @@ -490,20 +542,25 @@ // Personfunktionstandort zum Standort if (!isset($personfunktionstandort[$key]) || !is_array($personfunktionstandort[$key]) || !count($personfunktionstandort[$key])) { - echo 'Keinen Personen mit Funktionen zum Standort !
'; + echo 'Keine Personen mit Funktionen zum Standort !
'; } else { foreach ($personfunktionstandort[$key] as $keys => $vals) { - // Personfunktion zum Standort - $personfunktion_obj = new person(); - if($personfunktion_obj->load_personfunktion('','','','',$vals)) - echo 'Personen und Funktion ' - . $vals.' '.$personfunktion_obj->funktion_kurzbz.' '.$personfunktion_obj->position.' '.$personfunktion_obj->anrede - .'
'; - else - echo $personfunktion_obj->errormsg.'
'; + // Personfunktion zum Standort + $personfunktion_obj = new person(); + if($personfunktion_obj->load_personfunktion('','','','',$vals)) + { + //var_dump($personfunktion_obj); + echo 'Personen und Funktion ' + . $vals.' '.$personfunktion_obj->result[0]->funktion_kurzbz.' '.$personfunktion_obj->result[0]->position.' '.$personfunktion_obj->result[0]->anrede.'
     '.trim($personfunktion_obj->result[0]->titelpre.' '.$personfunktion_obj->result[0]->vorname.' '.$personfunktion_obj->result[0]->nachname.' '.$personfunktion_obj->result[0]->titelpost) + .'
'; + } + else + { + echo $personfunktion_obj->errormsg.'
'; + } } } ?> @@ -514,29 +571,33 @@
- Organisationseinheit zur Firma name; ?> - Organisationseinheit zur Firma name; ?> + $val) { - $firmaorganisationseinheit_obj = new firma(); + $firmaorganisationseinheit_obj->result[$i] = new firma(); $bleibt->firmaorganisationseinheit=array(); - if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit('','',$val)) + if(!$firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($val)) { echo $firmaorganisationseinheit_obj->errormsg.'
'; } - else if ($firmaorganisationseinheit_obj->result) + else if ($firmaorganisationseinheit_obj->result[$i]) { - foreach ($firmaorganisationseinheit_obj->result as $keys => $vals) - echo $vals->firma_organisationseinheit_id.' '.$vals->name.', '. $vals->organisationseinheittyp_kurzbz.' '.$vals->bezeichnung.'
'; - } + //var_dump($firmaorganisationseinheit_obj->result[$i]); + echo $firmaorganisationseinheit_obj->result[$i]->firma_organisationseinheit_id.' '.$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz.'
'.$firmaorganisationseinheit_obj->result[$i]->bezeichnung.', KNr.: '.$firmaorganisationseinheit_obj->result[$i]->kundennummer.'
'; + } + $i++; } } else { echo 'Keine Organisationseinheit zur Firma !
'; - } + } ?>
@@ -565,6 +626,25 @@ $personfunktionstandort = (isset($firmendaten['personfunktionstandort'])?$firmendaten['personfunktionstandort']:array()); $firmaorganisationseinheit = (isset($firmendaten['firmaorganisationseinheit'])?$firmendaten['firmaorganisationseinheit']:array()); + //Überprüfung auf doppelte Organisationseinheiten + $firmaorganisationseinheit_check=array(); + for ($i=0;$iresult[$i] = new firma(); + if($firmaorganisationseinheit_obj->result[$i]->load_firmaorganisationseinheit($firmaorganisationseinheit[$i])) + { + if (isset($firmaorganisationseinheit_obj->result[$i])) + { + if(array_key_exists($firmaorganisationseinheit_obj->result[$i]->oe_kurzbz,$firmaorganisationseinheit_check)) + { + exit("Es wurden Zuordnungen von Organisationseiheiten mehrfach ausgewählt!
Bitte Auswahl korrigieren.
"); + } + $firmaorganisationseinheit_check[$firmaorganisationseinheit_obj->result[$i]->oe_kurzbz]=$firmaorganisationseinheit[$i]; + } + } + } + + // Ermitteln der Standorte zu den Firmen - geloescht und bleibt. Wichtiger Teil zum ermitteln welche Standorte entfernt werden sollen $standorte_vorhanden=array(); $standort_obj = new standort(); @@ -723,7 +803,7 @@ foreach ($firmaorganisationseinheit as $key => $firma_organisationseinheit_id) { $firmaorganisationseinheit_obj = new firma(); - if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit('','',$firma_organisationseinheit_id)) + if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit($firma_organisationseinheit_id)) { echo 'Firma - Organisationseinheit: '.$firmaorganisationseinheit_obj->errormsg.'
'; } @@ -760,7 +840,7 @@ $firmaorganisationseinheit_check[$vals]=$vals; $firmaorganisationseinheit_obj = new firma(); - if($firmaorganisationseinheit_obj->load_firmaorganisationseinheit($firma_id_bleibt)) + if($firmaorganisationseinheit_obj->get_firmaorganisationseinheit($firma_id_bleibt)) { if (is_array($firmaorganisationseinheit_obj->result) && count($firmaorganisationseinheit_obj->result) ) { @@ -800,115 +880,117 @@ function getFirmaUndStandorte($firma_id_geloescht,$firma_id_bleibt) { -//---------------------------------------------------------------------------------------- -// zwei Teileanzeigen a) wird geloescht b) bleibt -//---------------------------------------------------------------------------------------- + //---------------------------------------------------------------------------------------- + // zwei Teileanzeigen a) wird geloescht b) bleibt + //---------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // Firmenstammdaten holen - // ------------------------------------------------------------------------- - $firma = new firma(); - if(!$firma->load($firma_id_geloescht)) - exit('Firma wird gelöscht fehler :'.$firma->errormsg); - $geloescht=$firma; - - $firma = new firma(); - if(!$firma->load($firma_id_bleibt)) - exit('Welche Firma bleibt fehler :'.$firma->errormsg); - $bleibt=$firma; - - // ------------------------------------------------------------------------- - // Standorte je Firmenstammdaten holen - // ------------------------------------------------------------------------- - // - wird geloescht - $standort_obj = new standort(); - $standort_obj->result=array(); - $standort_obj->load_firma($geloescht->firma_id); - $geloescht->standorte=array(); - if ($standort_obj->result) - { - $geloescht->standorte=$standort_obj->result; - for ($i=0;$istandorte);$i++) + // ------------------------------------------------------------------------- + // Firmenstammdaten holen + // ------------------------------------------------------------------------- + $firma = new firma(); + if(!$firma->load($firma_id_geloescht)) + exit('Firma wird gelöscht Fehler :'.$firma->errormsg); + $geloescht=$firma; + + $firma = new firma(); + if(!$firma->load($firma_id_bleibt)) + exit('Welche Firma bleibt Fehler :'.$firma->errormsg); + $bleibt=$firma; + + // ------------------------------------------------------------------------- + // Standorte je Firmenstammdaten holen + // ------------------------------------------------------------------------- + // - wird geloescht + $standort_obj = new standort(); + $standort_obj->result=array(); + $standort_obj->load_firma($geloescht->firma_id); + $geloescht->standorte=array(); + if ($standort_obj->result) { - // Adresse zum Standort - $adresse_obj = new adresse(); - $geloescht->standorte[$i]->adresse=array(); - if($geloescht->standorte[$i]->adresse_id && $adresse_obj->load($geloescht->standorte[$i]->adresse_id)) + $geloescht->standorte=$standort_obj->result; + for ($i=0;$istandorte);$i++) { - $geloescht->standorte[$i]->adresse=$adresse_obj; - } - // Kontakte zum Standort - $kontakt_obj = new kontakt(); - $geloescht->standorte[$i]->kontakt=array(); - if($geloescht->standorte[$i]->standort_id && $kontakt_obj->load_standort($geloescht->standorte[$i]->standort_id)) - { - $geloescht->standorte[$i]->kontakt=$kontakt_obj; - } - - // Personen zum Standort - $personfunktion_obj = new person(); - $geloescht->personen[$i]->personfunktion=array(); - if($geloescht->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($geloescht->standorte[$i]->standort_id,'',$geloescht->firma_id)) - { - $geloescht->standorte[$i]->personfunktion=$personfunktion_obj; - } - } - } - - $firmaorganisationseinheit_obj = new firma(); - $geloescht->firmaorganisationseinheit=array(); - if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit($geloescht->firma_id)) - $geloescht->firmaorganisationseinheit=array(); - if ($firmaorganisationseinheit_obj->result) - { - $geloescht->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result; - } + // Adresse zum Standort + $adresse_obj = new adresse(); + $geloescht->standorte[$i]->adresse=array(); + if($geloescht->standorte[$i]->adresse_id && $adresse_obj->load($geloescht->standorte[$i]->adresse_id)) + { + $geloescht->standorte[$i]->adresse=$adresse_obj; + } + // Kontakte zum Standort + $kontakt_obj = new kontakt(); + $geloescht->standorte[$i]->kontakt=array(); + if($geloescht->standorte[$i]->standort_id && $kontakt_obj->load_standort($geloescht->standorte[$i]->standort_id)) + { + $geloescht->standorte[$i]->kontakt=$kontakt_obj; + } + // Personen zum Standort + $personfunktion_obj = new person(); + $geloescht->personen[$i]->personfunktion=array(); + if($geloescht->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($geloescht->standorte[$i]->standort_id,'',$geloescht->firma_id)) + { + $geloescht->standorte[$i]->personfunktion=$personfunktion_obj; + } + } + } - // - bleibt - $standort_obj = new standort(); - $standort_obj->result=array(); - $standort_obj->load_firma($bleibt->firma_id); - $bleibt->standorte=array(); - if ($standort_obj->result) - { - $bleibt->standorte=$standort_obj->result; - for ($i=0;$istandorte);$i++) + $firmaorganisationseinheit_obj = new firma(); + $geloescht->firmaorganisationseinheit=array(); + if(!$firmaorganisationseinheit_obj->get_firmaorganisationseinheit($geloescht->firma_id)) { - // Adresse zum Standort - $adresse_obj = new adresse(); - $bleibt->standorte[$i]->adresse=array(); - if($bleibt->standorte[$i]->adresse_id && $adresse_obj->load($bleibt->standorte[$i]->adresse_id)) - { - $bleibt->standorte[$i]->adresse=$adresse_obj; - } - // Kontakte zum Standort - $kontakt_obj = new kontakt(); - $bleibt->standorte[$i]->kontakt=array(); - if($bleibt->standorte[$i]->standort_id && $kontakt_obj->load_standort($bleibt->standorte[$i]->standort_id)) - { - $bleibt->standorte[$i]->kontakt=$kontakt_obj; - } + $geloescht->firmaorganisationseinheit=array(); + } + if ($firmaorganisationseinheit_obj->result) + { + $geloescht->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result; + } - // Personen zum Standort - $personfunktion_obj = new person(); - $bleibt->personen[$i]->personfunktion=array(); - if($bleibt->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($bleibt->standorte[$i]->standort_id,'',$bleibt->firma_id)) + // - bleibt + $standort_obj = new standort(); + $standort_obj->result=array(); + $standort_obj->load_firma($bleibt->firma_id); + $bleibt->standorte=array(); + if ($standort_obj->result) + { + $bleibt->standorte=$standort_obj->result; + for ($i=0;$istandorte);$i++) { - $bleibt->standorte[$i]->personfunktion=$personfunktion_obj; - } - } - } - - $firmaorganisationseinheit_obj = new firma(); - $bleibt->firmaorganisationseinheit=array(); - if(!$firmaorganisationseinheit_obj->load_firmaorganisationseinheit($bleibt->firma_id)) + // Adresse zum Standort + $adresse_obj = new adresse(); + $bleibt->standorte[$i]->adresse=array(); + if($bleibt->standorte[$i]->adresse_id && $adresse_obj->load($bleibt->standorte[$i]->adresse_id)) + { + $bleibt->standorte[$i]->adresse=$adresse_obj; + } + // Kontakte zum Standort + $kontakt_obj = new kontakt(); + $bleibt->standorte[$i]->kontakt=array(); + if($bleibt->standorte[$i]->standort_id && $kontakt_obj->load_standort($bleibt->standorte[$i]->standort_id)) + { + $bleibt->standorte[$i]->kontakt=$kontakt_obj; + } + + // Personen zum Standort + $personfunktion_obj = new person(); + $bleibt->personen[$i]->personfunktion=array(); + if($bleibt->standorte[$i]->standort_id && $personfunktion_obj->load_personfunktion($bleibt->standorte[$i]->standort_id,'',$bleibt->firma_id)) + { + $bleibt->standorte[$i]->personfunktion=$personfunktion_obj; + } + } + } + + $firmaorganisationseinheit_obj = new firma(); $bleibt->firmaorganisationseinheit=array(); - if ($firmaorganisationseinheit_obj->result) - { - $bleibt->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result; - } - return $standort=array("geloescht"=>$geloescht,"bleibt"=>$bleibt); -} + if(!$firmaorganisationseinheit_obj->get_firmaorganisationseinheit($bleibt->firma_id)) + $bleibt->firmaorganisationseinheit=array(); + if ($firmaorganisationseinheit_obj->result) + { + $bleibt->firmaorganisationseinheit=$firmaorganisationseinheit_obj->result; + } + //var_dump($geloescht); + return $standort=array("geloescht"=>$geloescht,"bleibt"=>$bleibt); + } ?> diff --git a/vilesci/stammdaten/firma_zusammen_uebersicht.php b/vilesci/stammdaten/firma_zusammen_uebersicht.php index 071b0b5ec..1851900a9 100644 --- a/vilesci/stammdaten/firma_zusammen_uebersicht.php +++ b/vilesci/stammdaten/firma_zusammen_uebersicht.php @@ -1,5 +1,5 @@ + * Authors: Christian Paminger < christian.paminger@technikum-wien.at > * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > - * Rudolf Hangl < rudolf.hangl@technikum-wien.at > + * Rudolf Hangl < rudolf.hangl@technikum-wien.at > * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > */ require_once('../../config/vilesci.config.inc.php'); @@ -73,7 +73,24 @@ - + + +