[Svn] r4576 - in trunk/roundcubemail: . program/localization/de_CH program/localization/en_US program/steps/addressbook

trac at roundcube.net trac at roundcube.net
Sun Feb 27 14:51:46 CET 2011


Author: thomasb
Date: 2011-02-27 07:51:46 -0600 (Sun, 27 Feb 2011)
New Revision: 4576

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/localization/de_CH/messages.inc
   trunk/roundcubemail/program/localization/en_US/messages.inc
   trunk/roundcubemail/program/steps/addressbook/import.inc
Log:
Better display of vcard import results (#1485457)

Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-02-27 13:30:34 UTC (rev 4575)
+++ trunk/roundcubemail/CHANGELOG	2011-02-27 13:51:46 UTC (rev 4576)
@@ -1,6 +1,8 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Better display of vcard import results (#1485457)
+- Improved vcard import
 - Interactive update script with improved DB schema check
 - jQuery 1.5.1
 - Fix problem with contactgroupmembers table creation on MySQL 4.x, add index on contact_id column

Modified: trunk/roundcubemail/program/localization/de_CH/messages.inc
===================================================================
--- trunk/roundcubemail/program/localization/de_CH/messages.inc	2011-02-27 13:30:34 UTC (rev 4575)
+++ trunk/roundcubemail/program/localization/de_CH/messages.inc	2011-02-27 13:51:46 UTC (rev 4576)
@@ -107,7 +107,8 @@
 $messages['contactremovedfromgroup'] = 'Kontakte wurden aus dieser Gruppe entfernt';
 $messages['importwait'] = 'Daten werden importiert, bitte warten...';
 $messages['importerror'] = 'Import fehlgeschlagen! Die hochgeladene Datei ist nicht im vCard-Format.';
-$messages['importconfirm'] = '<b>Es wurden $inserted Adressen erfolgreich importiert und $skipped bestehende Einträge übersprungen</b>:<p><em>$names</em></p>';
+$messages['importconfirm'] = '<b>Es wurden $inserted Adressen erfolgreich importiert</b>';
+$messages['importconfirmskipped'] = '<b>$skipped bestehende Einträge wurden übersprungen</b>';
 $messages['opnotpermitted'] = 'Operation nicht erlaubt!';
 $messages['nofromaddress'] = 'Fehlende E-Mail-Adresse in ausgewählter Identität';
 $messages['editorwarning'] = 'Beim Wechseln in den Texteditor gehen alle Textformatierungen verloren. Möchten Sie fortfahren?';

Modified: trunk/roundcubemail/program/localization/en_US/messages.inc
===================================================================
--- trunk/roundcubemail/program/localization/en_US/messages.inc	2011-02-27 13:30:34 UTC (rev 4575)
+++ trunk/roundcubemail/program/localization/en_US/messages.inc	2011-02-27 13:51:46 UTC (rev 4576)
@@ -107,7 +107,8 @@
 $messages['contactremovedfromgroup'] = 'Successfully removed contacts from this group';
 $messages['importwait'] = 'Importing, please wait...';
 $messages['importerror'] = 'Import failed! The uploaded file is not a valid vCard file.';
-$messages['importconfirm'] = '<b>Successfully imported $inserted contacts, $skipped existing entries skipped</b>:<p><em>$names</em></p>';
+$messages['importconfirm'] = '<b>Successfully imported $inserted contacts</b>';
+$messages['importconfirmskipped'] = '<b>Skipped $skipped existing entries</b>';
 $messages['opnotpermitted'] = 'Operation not permitted!';
 $messages['nofromaddress'] = 'Missing e-mail address in selected identity';
 $messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?';

Modified: trunk/roundcubemail/program/steps/addressbook/import.inc
===================================================================
--- trunk/roundcubemail/program/steps/addressbook/import.inc	2011-02-27 13:30:34 UTC (rev 4575)
+++ trunk/roundcubemail/program/steps/addressbook/import.inc	2011-02-27 13:51:46 UTC (rev 4576)
@@ -62,13 +62,27 @@
   global $IMPORT_STATS;
   
   $vars = get_object_vars($IMPORT_STATS);
-  $vars['names'] = join(', ', array_map('Q', $IMPORT_STATS->names));
+  $vars['names'] = $vars['skipped_names'] = '';
   
-  return html::p($attrib, Q(rcube_label(array(
-    'name' => 'importconfirm',
-    'nr' => $IMORT_STATS->inserted,
-    'vars' => $vars,
-  )), 'show'));
+  $content = html::p(null, rcube_label(array(
+      'name' => 'importconfirm',
+      'nr' => $IMORT_STATS->inserted,
+      'vars' => $vars,
+    )) . ($IMPORT_STATS->names ? ':' : '.'));
+    
+  if ($IMPORT_STATS->names)
+    $content .= html::p('em', join(', ', array_map('Q', $IMPORT_STATS->names)));
+  
+  if ($IMPORT_STATS->skipped) {
+      $content .= html::p(null, rcube_label(array(
+          'name' => 'importconfirmskipped',
+          'nr' => $IMORT_STATS->skipped,
+          'vars' => $vars,
+        )) . ':');
+      $content .= html::p('em', join(', ', array_map('Q', $IMPORT_STATS->skipped_names)));
+  }
+  
+  return html::div($attrib, $content);
 }
 
 
@@ -120,6 +134,7 @@
   else {
     $IMPORT_STATS = new stdClass;
     $IMPORT_STATS->names = array();
+    $IMPORT_STATS->skipped_names = array();
     $IMPORT_STATS->count = count($vcards);
     $IMPORT_STATS->inserted = $IMPORT_STATS->skipped = $IMPORT_STATS->nomail = $IMPORT_STATS->errors = 0;
     
@@ -146,6 +161,7 @@
         }
         if ($existing->count) {
           $IMPORT_STATS->skipped++;
+          $IMPORT_STATS->skipped_names[] = $vcard->displayname;
           continue;
         }
       }

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn


More information about the Svn mailing list