From d5906fdc38e081d856aa7c9c2184782733f75012 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 30 Oct 2018 17:18:34 +0100 Subject: [PATCH] Added display of business handy on CIS search Now if the CIS search is used to find a person or an organisational unit, the business handy will be displayed IF . no telefonklappe exists . a business handy nr is provided . Zustellung is true --- cis/private/tools/suche.php | 90 ++++++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 7 deletions(-) diff --git a/cis/private/tools/suche.php b/cis/private/tools/suche.php index f9452e114..517f3bde0 100644 --- a/cis/private/tools/suche.php +++ b/cis/private/tools/suche.php @@ -52,7 +52,7 @@ echo ' - '; + '; include('../../../include/meta/jquery.php'); include('../../../include/meta/jquery-tablesorter.php'); @@ -158,7 +158,7 @@ function searchPerson($searchItems) { $bisverwendung = new bisverwendung(); $bisverwendung->getLastAktVerwendung($row->uid); - + echo ''; //echo '',$row->titelpre,''; echo '',$row->anrede,''; @@ -171,8 +171,47 @@ function searchPerson($searchItems) echo ''; //echo '',$row->titelpost,''; echo '',($row->studiengang!=''?$row->studiengang:'-'),''; - echo '',($row->mitarbeiter_uid==NULL?'StudentIn':'MitarbeiterIn'),''; - echo '',($row->telefonklappe!=''?$row->telefonklappe:'-'),''; + echo '',($row->mitarbeiter_uid==NULL?'StudentIn':'MitarbeiterIn'),''; + // Display phone number + echo ''; + // * if user has telefonklappe, display it + if ($row->telefonklappe != '') + { + echo $row->telefonklappe; + } + // * if user has no telefonklappe, display business handy + else + { + $person = new Person(); + $person->getPersonFromBenutzer($row->uid); + $person_id = $person->person_id; + $kontakt = new Kontakt(); + + if ($kontakt->load_persKontakttyp($person_id, 'firmenhandy')) + { + $is_zugestellt = false; + foreach ($kontakt->result as $kontakt) + { + // display business handy only if zustellung is true + if ($kontakt->zustellung) + { + echo $kontakt->kontakt. "
"; + $is_zugestellt = true; + } + } + // if zustellung is false display '-' + if (!$is_zugestellt) + { + echo '-'; + } + } + // * if neither telefonklappe nor business handy, display '-' + else + { + echo '-'; + } + } + echo ''; echo '',($row->raum!=''?$row->raum:'-'),''; if($row->alias!='' && !in_array($row->studiengang_kz, $noalias)) $mail = $row->alias.'@'.DOMAIN; @@ -271,9 +310,46 @@ function searchOE($searchItems) echo ''.$bf->bezeichnung; if($bisverwendung->beschausmasscode=='5') echo ' (karenziert)'; - echo ''; - - echo '',($mitarbeiter->telefonklappe!=''?$kontakt->kontakt.'-'.$mitarbeiter->telefonklappe:'-'),''; + echo ''; + + // Display phone number + echo ''; + // * if user has telefonklappe, display it + if ($mitarbeiter->telefonklappe != '') + { + echo $kontakt->kontakt. '-'. $mitarbeiter->telefonklappe; + } + // * if user has no telefonklappe, display business handy + else + { + $person_id = $person->person_id; + + if ($kontakt->load_persKontakttyp($person_id, 'firmenhandy')) + { + $is_zugestellt = false; + foreach ($kontakt->result as $kontakt) + { + // display business handy only if zustellung is true + if ($kontakt->zustellung) + { + echo $kontakt->kontakt. "
"; + $is_zugestellt = true; + } + } + // if zustellung is false display '-' + if (!$is_zugestellt) + { + echo '-'; + } + } + // * if neither telefonklappe nor business handy, display '-' + else + { + echo '-'; + } + } + echo ''; + echo '',($mitarbeiter->ort_kurzbz!=''?$mitarbeiter->ort_kurzbz:'-'),''; //if($row->alias!='' && !in_array($row->studiengang_kz, $noalias)) ??? Was macht $noalias? if($person->alias!='')