steffen: server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist index.php, 1.13, 1.14 list.php, 1.20, 1.21

cvs at intevation.de cvs at intevation.de
Thu Oct 13 03:50:03 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist
In directory doto:/tmp/cvs-serv29305/kolab-webadmin/www/admin/distributionlist

Modified Files:
	index.php list.php 
Log Message:
Fix for issue886 (i18n problem)

Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist/index.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- index.php	28 Jul 2005 02:14:38 -0000	1.13
+++ index.php	13 Oct 2005 01:50:01 -0000	1.14
@@ -50,7 +50,7 @@
   $result = ldap_search($ldap->connection, $base_dn, $filter);
   if( $result ) {
 	$count = ldap_count_entries($ldap->connection, $result);
-	$title = _("Manage Distribution Lists ($count Lists)");
+	$title = sprintf( _("Manage Distribution Lists (%d Lists)"), $count);
 	$template = 'distlistall.tpl';
 	ldap_sort($ldap->connection,$result,'cn');
 	$entry = ldap_first_entry($ldap->connection, $result);

Index: list.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist/list.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- list.php	28 Jul 2005 02:14:38 -0000	1.20
+++ list.php	13 Oct 2005 01:50:01 -0000	1.21
@@ -47,7 +47,7 @@
 	foreach( $lst as $a ) {
 	  debug("Trying $a");
 	  ($dn = $ldap->dnForMail($a)) || ($dn = $ldap->dnForUid($a)) || ($dn = $ldap->dnForAlias($a));
-	  if( !$dn ) return _("No user with email address, UID or alias $a");
+	  if( !$dn ) return sprintf( _("No user with email address, UID or alias %s"), $a);
 	}
   }
   return '';
@@ -132,7 +132,7 @@
   if( $_REQUEST['dn'] ) {
 	$dn = $_REQUEST['dn'];
   } else {  
-	array_push($errors, _("Error: DN required for $action operation") );
+	array_push($errors, sprintf(_("Error: DN required for %s operation"), $action ) );
   }
 }
 
@@ -176,7 +176,7 @@
 		  if( $memberdn ) {
 			$ldap_object['member'][] = $memberdn;
 		  } else {
-			$errors[] = _("No user with address $a");
+			$errors[] = sprintf(_("No user with address %s"), $a);
 			break;
 		  }
 		}
@@ -192,18 +192,18 @@
 				  ($oldattrs=ldap_get_attributes($ldap->connection,$entry))) {
 				if (!ldap_add($ldap->connection,$newdn, $ldap_object) 
 					|| !ldap_delete($ldap->connection,$dn)) {
-				  array_push($errors, _("LDAP Error: Could not rename $dn to $newdn: ")
-							 .ldap_error($ldap->connection));
+				  array_push($errors, sprintf( _("LDAP Error: Could not rename %1\$s to %2\$s: %3\$s"), $dn, $newdn,
+											   ldap_error($ldap->connection)));
 				} else {
 				  $messages[] = _('Distribution List updated');
 				}
 				$dn = $newdn;
-			  } else array_push($errors, _("LDAP Error: Could not read $dn: ")
-								.ldap_error($ldap->connection));
+			  } else array_push($errors, sprintf( _("LDAP Error: Could not read %s: %s"), $dn,
+												  ldap_error($ldap->connection)));
 			} else {
 			  if (!ldap_modify($ldap->connection, $dn, $ldap_object))
-				array_push($errors, _("LDAP Error: Could not modify object $dn: ")
-						   .ldap_error($ldap->connection)); 
+				array_push($errors, sprintf( _("LDAP Error: Could not modify object %s: %s"), $dn,
+											 ldap_error($ldap->connection)));
 			  else $messages[] = _('Distribution List updated');
 			}
 		  } 
@@ -213,8 +213,8 @@
 			if( !$ldap_object['member'] ) unset($ldap_object['member']); 
 			$dn = "cn=".$ldap_object['cn'].",".$dl_root;
 			if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object)) {
-			  array_push($errors, _("LDAP Error: Could not add object $dn: ")
-						 .ldap_error($ldap->connection));
+			  array_push($errors, sprintf( _("LDAP Error: Could not add object %s: %s"), $dn,
+										   ldap_error($ldap->connection)));
 			  debug("dn is $dn");
 			  debug_var_dump( $ldap_object );
 			}
@@ -231,17 +231,18 @@
 				  $ldap_object['cn'] = $newcn; 
 				  $ldap_object['dn'] = 'cn='.$ldap->escape($newcn).','.$dl_root;
 				  if (!ldap_rename($ldap->connection, $dn, 'cn='.$ldap->escape($newcn), $dl_root,true)) {
-					$errors[] = _("LDAP Error: Could not modify object $dn: ")
-					  .ldap_error($ldap->connection);
+					$errors[] = sprintf(_("LDAP Error: Could not modify object %s: %s"), $dn,
+										ldap_error($ldap->connection));
 				  }
-				  $error[] = _("Mid-air collision detected, email address $mail renamed to $newmail");
+				  $error[] = sprintf( _("Mid-air collision detected, email address %1\$s renamed to %2\$s"), 
+									  $mail, $newmail);
 				  break;
 				}
 			  }
 			}
 		  }
 		  if( !$errors ) {
-			$messages[] = _("Distribution List '$cn' added");
+			$messages[] = sprintf(_("Distribution List '%s' added"), $cn );
 		  }
 		}
 		if ($errors) {
@@ -270,7 +271,7 @@
 		$heading = _('Modify Distribution List');
 		$content = $form->outputForm();
 	} else {
-	  array_push($errors, _("Error: No results returned for DN '$dn'") );
+	  array_push($errors, sprintf( _("Error: No results returned for DN ''"), $dn));
 	}
 	break;
   case 'delete':
@@ -285,18 +286,18 @@
 	  $heading = _('Delete Distribution List'); 
 	  $content = $form->outputForm();
 	} else {
-	  array_push($errors, _("Error: No results returned for DN '$dn'"));
+	  array_push($errors, sprintf( _("Error: No results returned for DN '%s'"), $dn));
 	}
 	break;
   case 'kill':
 	if (!$errors) {
 	  /* Just delete the object and let kolabd clean up */
-	 if ($ldap->deleteGroupOfNames($dn)) {
+	  if ($ldap->deleteGroupOfNames($dn)) {
 		$messages[] = _('Distribution List ').$_REQUEST['cn']._(' deleted');
 		$heading = _('Entry Deleted');
 		$contenttemplate = 'sfdeleted.tpl';
 	  } else {
-		array_push($errors, _("LDAP Error: Nould not delete $dn: ").$ldap->error());		
+		array_push($errors, sprintf(_("LDAP Error: Nould not delete %s: %s"), $dn, $ldap->error()));
 	  }
 	}
 	break;





More information about the commits mailing list