[Mapbender-commits] r9632 - in trunk/mapbender: http/classes http/php lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 2 07:03:31 PST 2017


Author: armin11
Date: 2017-01-02 07:03:31 -0800 (Mon, 02 Jan 2017)
New Revision: 9632

Modified:
   trunk/mapbender/http/classes/class_group.php
   trunk/mapbender/http/php/mod_editGroup.php
   trunk/mapbender/lib/editGroup.php
Log:
Possibility to change admin code of organization via web form.

Modified: trunk/mapbender/http/classes/class_group.php
===================================================================
--- trunk/mapbender/http/classes/class_group.php	2016-12-29 14:26:01 UTC (rev 9631)
+++ trunk/mapbender/http/classes/class_group.php	2017-01-02 15:03:31 UTC (rev 9632)
@@ -107,6 +107,7 @@
 	        	"email" => $this->email,
 	       	 	"logo_path" => $this->logo_path,
 			"homepage" => $this->homepage,
+			"adminCode" => $this->adminCode,
 			"uuid" => $this->uuid
 		);
 	}
@@ -173,6 +174,7 @@
 		$this->email = isset($changes->email) ? $changes->email : $this->email;
 		$this->logo_path = isset($changes->logo_path) ? $changes->logo_path : $this->logo_path;
 		$this->homepage = isset($changes->homepage) ? $changes->homepage : $this->homepage;
+		$this->adminCode = isset($changes->adminCode) ? $changes->adminCode : $this->adminCode;
 		return true;
 	}
 
@@ -192,8 +194,9 @@
 			"mb_group_facsimiletelephone = $11, ".
 			"mb_group_email = $12, ".
 			"mb_group_logo_path = $13, ".
-			"mb_group_homepage = $14 ".
-			"WHERE mb_group_id = $15";
+			"mb_group_homepage = $14, ".
+			"mb_group_admin_code = $15 ".
+			"WHERE mb_group_id = $16 ";
 
 			$v = array(
 				$this->name,
@@ -210,13 +213,14 @@
 				$this->email,
 				$this->logo_path,
 				$this->homepage,
+				$this->adminCode,
 				$this->id
 			);
 
 			$t = array(
 				"s", "i", "s", "s", "s",
 				"i", "s", "s", "s", "s", 
-				"s", "s", "s", "s", "i"
+				"s", "s", "s", "s", "s", "i"
 			);
 
 			$update_result = db_prep_query($sql_update,$v,$t);
@@ -284,7 +288,7 @@
             			$this->email = $row["mb_group_email"];
             			$this->logo_path = $row["mb_group_logo_path"];
 	    			$this->homepage = $row["mb_group_homepage"];
-	    			$this->uuid = $row["uuid"];
+				$this->uuid = $row["uuid"];
 				$this->adminCode = $row["mb_group_admin_code"];
 				$this->timestamp = $row["timestamp"];
 				

Modified: trunk/mapbender/http/php/mod_editGroup.php
===================================================================
--- trunk/mapbender/http/php/mod_editGroup.php	2016-12-29 14:26:01 UTC (rev 9631)
+++ trunk/mapbender/http/php/mod_editGroup.php	2017-01-02 15:03:31 UTC (rev 9632)
@@ -26,7 +26,7 @@
 //security_patch_log(__FILE__,__LINE__);
 //import_request_variables("PG");
 
-$postvars = explode(",", "selected_group,name,title,owner_name,owner_id,description,address,postcode,city,stateorprovince,country,voicetelephone,facsimiletelephone,email,logo_path,homepage,action");
+$postvars = explode(",", "selected_group,name,title,owner_name,owner_id,description,address,postcode,city,stateorprovince,country,voicetelephone,facsimiletelephone,email,logo_path,homepage,adminCode,action");
 foreach ($postvars as $value) {
    $$value = $_POST[$value];
 }

Modified: trunk/mapbender/lib/editGroup.php
===================================================================
--- trunk/mapbender/lib/editGroup.php	2016-12-29 14:26:01 UTC (rev 9631)
+++ trunk/mapbender/lib/editGroup.php	2017-01-02 15:03:31 UTC (rev 9632)
@@ -75,6 +75,7 @@
 		$changes->email = $email;
 		$changes->logo_path = $logo_path;
 		$changes->homepage = $homepage;
+		$changes->adminCode = $adminCode;
 		$group->change($changes);	
 		
 		$group->create();	
@@ -106,6 +107,7 @@
 		$changes->email = $email;
 		$changes->logo_path = $logo_path;
 		$changes->homepage = $homepage;
+		$changes->adminCode = $adminCode;
 		$group->change($changes);		
 
 		$group->commit();	
@@ -129,6 +131,7 @@
 	$email = "";
 	$logo_path = "";
 	$homepage = "";
+	$adminCode = "";
 }
 
 /*HTML*****************************************************************************************************/
@@ -182,6 +185,7 @@
 		$email = $data["email"];
 		$logo_path = $data["logo_path"];
 		$homepage = $data["homepage"];
+		$adminCode = $data["adminCode"];
 	}
 	$owner = new User(intval($owner_id));
 	if ($owner->isValid()) {
@@ -308,7 +312,7 @@
    echo "</td>";
 echo "</tr>";
 
-#logo
+#homepage
 echo "<tr>";
    echo "<td>Homepage: </td>";
    echo "<td>";
@@ -316,6 +320,16 @@
           htmlentities($homepage, ENT_QUOTES, "UTF-8") . "'>";
    echo "</td>";
 echo "</tr>";
+
+#adminCode
+echo "<tr>";
+   echo "<td>Verwaltungseinheit: </td>";
+   echo "<td>";
+   echo "<input type='text' size='30' name='adminCode' value='" .
+          htmlentities($adminCode, ENT_QUOTES, "UTF-8") . "'>";
+   echo "</td>";
+echo "</tr>";
+
 # blank row
 echo "<tr>";
    echo "<td colspan='2'> </td>";



More information about the Mapbender_commits mailing list