[feladat @ 92]
authorrejo
Mon, 24 Dec 2007 22:27:43 +0000
changeset 45 eddff78bf57f
parent 44 f8886b13c495
child 46 97ff9a7a9e75
[feladat @ 92] Fix for ticket #3. Patch supplied by Peter Beernink. Added i18n.
edit.php
locale/en_EN/LC_MESSAGES/en.po
locale/en_EN/LC_MESSAGES/messages.mo
locale/nl_NL/LC_MESSAGES/messages.mo
locale/nl_NL/LC_MESSAGES/nl.po
--- a/edit.php	Mon Dec 24 21:07:38 2007 +0000
+++ b/edit.php	Mon Dec 24 22:27:43 2007 +0000
@@ -3,12 +3,16 @@
 require_once("inc/toolkit.inc.php");
 
 // Assigning records to user: Check for records owned by user
-
+$recordOwnerError = '';
 if (isset($_POST["action"]) && $_POST["action"]=="record-user") {
-	foreach ($_POST["rowid"] as $x_user => $x_value){
-		$x_userid = $db->queryOne("SELECT id FROM record_owners WHERE user_id = '".$_POST["userid"]."' AND record_id='".$x_value."'");
-		if (empty($x_userid)) {
-			$db->query("INSERT INTO record_owners SET user_id = '".$_POST["userid"]."',record_id='".$x_value."'");
+	if (!is_array($_POST['rowid'])) {
+		$recordOwnerError = 'No records where selected to assign an sub-owner.';
+	} else {
+		foreach ($_POST["rowid"] as $x_user => $x_value){
+			$x_userid = $db->queryOne("SELECT id FROM record_owners WHERE user_id = '".$_POST["userid"]."' AND record_id='".$x_value."'");
+			if (empty($x_userid)) {
+				$db->query("INSERT INTO record_owners SET user_id = '".$_POST["userid"]."',record_id='".$x_value."'");
+			}
 		}
 	}
 }
@@ -34,6 +38,12 @@
 $domain_type=get_domain_type($_GET['id']);
 if ($domain_type == "SLAVE" ) { $slave_master=get_domain_slave_master($_GET['id']); };
 
+if (strlen($recordOwnerError)) {
+?>
+  <div class="error"><?php echo _('Error'); ?>: <?php echo _($recordOwnerError); ?></div>
+<?php	
+}
+
 if(!isset($info["ownerid"]) && $domain_type != "SLAVE")
 {
 ?>
--- a/locale/en_EN/LC_MESSAGES/en.po	Mon Dec 24 21:07:38 2007 +0000
+++ b/locale/en_EN/LC_MESSAGES/en.po	Mon Dec 24 22:27:43 2007 +0000
@@ -16,6 +16,10 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+#: edit.php:9
+msgid "No records where selected to assign an sub-owner."
+msgstr ""
+
 #: add_record.php:31
 msgid "Add record to zone"
 msgstr ""
Binary file locale/en_EN/LC_MESSAGES/messages.mo has changed
Binary file locale/nl_NL/LC_MESSAGES/messages.mo has changed
--- a/locale/nl_NL/LC_MESSAGES/nl.po	Mon Dec 24 21:07:38 2007 +0000
+++ b/locale/nl_NL/LC_MESSAGES/nl.po	Mon Dec 24 22:27:43 2007 +0000
@@ -16,6 +16,10 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+#: edit.php:9
+msgid "No records where selected to assign an sub-owner."
+msgstr "Er waren geen records geselecteerd om toe te wijzen aan een beheerder."
+
 #: add_record.php:16
 msgid "Add record to zone"
 msgstr "Record toevoegen aan zone"