From 9accf9a482bd7742b1e204e45ac77495c98eadca Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 29 May 2015 14:29:21 +0200 Subject: [PATCH] =?UTF-8?q?Parameter=20zum=20Pruefen=20von=20SVNR=20Nummer?= =?UTF-8?q?n=20hinzugef=C3=BCgt=20damit=20beim=20Editieren=20die=20eigene?= =?UTF-8?q?=20Person=20nicht=20mitgepr=C3=BCft=20wird?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/person.class.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/person.class.php b/include/person.class.php index 89405fac3..b5d29c77b 100644 --- a/include/person.class.php +++ b/include/person.class.php @@ -833,10 +833,20 @@ class person extends basis_db } return true; } - - public function checkSvnr($svnr) + + /** + * Prueft ob eine SVNR bereits vergeben ist, Optional kann eine Person übergeben werden die nicht + * beruecksichtigt werden soll + * @param $svnr + * @param $person_id + * @return true wenn bereits vorhanden sonst false + */ + public function checkSvnr($svnr, $person_id=null) { - $qry = "Select 1 from public.tbl_person where svnr =".$this->db_add_param($svnr).";"; + $qry = "Select 1 from public.tbl_person where svnr =".$this->db_add_param($svnr); + if(!is_null($person_id)) + $qry.=" AND person_id!=".$this->db_add_param($person_id); + if($result = $this->db_query($qry)) { @@ -845,7 +855,6 @@ class person extends basis_db else return false; } - } public function getFullName($allFirstnames=FALSE)