[Kolab-devel] [issue3860] kronolith: fixed display of wrong organizer - german translation update

Soenke Schwardt-Krummrich issues at kolab.org
Fri Sep 11 17:26:50 CEST 2009


New submission from Soenke Schwardt-Krummrich <schwardt at univention.de>:

Without this patch kronolith displays "me" as event's creator/modifier if
the true creator/modifier cannot be determined. This gets very confusive
in conjunction with shared calendars if not all readers have write permission.
Additionally the patch switches event's german "owner" translation from 
"Besitzer" to "Organisator".

----------
files: t_kronolith_HK_UV_lastModificationOfEvents.diff
keyword: web client
messages: 21653
nosy: schwardt
status: unread
title: kronolith: fixed display of wrong organizer - german translation update

______________________________________
Kolab issue tracker <issues at kolab.org>
<https://issues.kolab.org/issue3860>
______________________________________
-------------- next part --------------
Patch by schwardt at univention.de (Fri Sep 11 15:31:05 2009 +0200):

kronolith: fixed display of wrong organizer - german translation update

Without this patch kronolith displays "me" as event's creator/modifier if
the true creator/modifier cannot be determined. This gets very confusive
in conjunction with shared calendars if not all readers have write permission.
Additionally the patch switches event's german "owner" translation from 
"Besitzer" to "Organisator".

--- a/horde-webmail/kronolith/lib/Driver.php
+++ b/horde-webmail/kronolith/lib/Driver.php
@@ -1433,7 +1433,7 @@ class Kronolith_Event {
      */
     function getCreatorId()
     {
-        return !empty($this->creatorID) ? $this->creatorID : Auth::getAuth();
+        return !empty($this->creatorID) ? $this->creatorID : _('User unkown');
     }
 
     /**
--- a/horde-webmail/kronolith/lib/Driver/kolab.php
+++ b/horde-webmail/kronolith/lib/Driver/kolab.php
@@ -1467,6 +1467,58 @@ class Kronolith_Event_kolab_new extends Kronolith_Event {
             $this->alarm = $event['alarm'];
         }
 
+		// update history with Kolab creation and modify timestamps
+		$history = &Horde_History::singleton();
+		$log = $history->getHistory('kronolith:' . $this->_calendar . ':' .  $event['uid']);
+
+		if (isset ($event['creation-date'])) {
+			$set_add = false;
+			if ($log && !is_a($log, 'PEAR_Error')) {
+				foreach ($log->getData() as $entry) {
+					switch ($entry['action']) {
+					case 'add':
+						$set_add = true;
+						$_date = new Horde_Date($event['creation-date']);
+						if ($entry['ts'] != $_date->timestamp ()) {
+							$history_id = 'kronolith:' . $this->_calendar . ':' .  $event['uid'];
+							$history->log($history_id, array('action' => 'add', 'ts' => $_date->timestamp(), 'who' => ''), true);
+						}
+						break;
+					}
+				}
+			}
+			if (!$set_add) {
+				$_date = new Horde_Date($event['creation-date']);
+				$history_id = 'kronolith:' . $this->_calendar . ':' .  $event['uid'];
+				$history->log($history_id, array('action' => 'add', 'ts' => $_date->timestamp(), 'who' => ''), true);
+			}
+		}
+
+		if (isset ($event['last-modification-date'])) {
+			$set_modify = false;
+			if ($log && !is_a($log, 'PEAR_Error')) {
+				if (!empty ($log)) {
+					foreach ($log->getData() as $entry) {
+						switch ($entry['action']) {
+						case 'modify':
+							$set_modify = true;
+							$_date = new Horde_Date($event['last-modification-date']);
+							if ($entry['ts'] != $_date->timestamp ()) {
+								$history_id = 'kronolith:' . $this->_calendar . ':' .  $event['uid'];
+								$history->log($history_id, array('action' => 'modify', 'ts' => $_date->timestamp(), 'who' => ''), true);
+							}
+							break;
+						}
+					}
+				}
+			}
+			if (!$set_modify) {
+				$_date = new Horde_Date($event['last-modification-date']);
+				$history_id = 'kronolith:' . $this->_calendar . ':' .  $event['uid'];
+				$history->log($history_id, array('action' => 'modify', 'ts' => $_date->timestamp(), 'who' => ''), true);
+			}
+		}
+
         $this->start = new Horde_Date($event['start-date']);
         $this->end = new Horde_Date($event['end-date']);
         $this->durMin = ($this->end->timestamp() - $this->start->timestamp()) / 60;
--- a/horde-webmail/kronolith/lib/Views/Event.php
+++ b/horde-webmail/kronolith/lib/Views/Event.php
@@ -59,7 +59,11 @@ class Kronolith_View_Event {
                     case 'add':
                         $created = $entry['ts'];
                         if ($userId != $entry['who']) {
-                            $createdby = sprintf(_("by %s"), Kronolith::getUserName($entry['who']));
+							if (empty ($entry['who'])) {
+								$createdby = '';
+							} else {
+								$createdby = sprintf(_("by %s"), Kronolith::getUserName($entry['who']));
+							}
                         } else {
                             $createdby = _("by me");
                         }
@@ -68,7 +72,11 @@ class Kronolith_View_Event {
                     case 'modify':
                         $modified = $entry['ts'];
                         if ($userId != $entry['who']) {
-                            $modifiedby = sprintf(_("by %s"), Kronolith::getUserName($entry['who']));
+							if (empty ($entry['who'])) {
+								$modifiedby = '';
+							} else {
+								$modifiedby = sprintf(_("by %s"), Kronolith::getUserName($entry['who']));
+							}
                         } else {
                             $modifiedby = _("by me");
                         }
--- a/horde-webmail/kronolith/po/de_DE.po
+++ b/horde-webmail/kronolith/po/de_DE.po
@@ -1348,8 +1348,8 @@ msgid ""
 "Only the owner or system administrator may change ownership or owner "
 "permissions for a share"
 msgstr ""
-"Nur der Besitzer oder der Systemadministrator kann den Besitzer oder die "
-"Besitzerrechte ändern"
+"Nur der Organisator oder der Systemadministrator kann den Organisator oder die "
+"Organisatorrechte ändern"
 
 #: lib/Kronolith.php:1238
 msgid "Optional"
@@ -1369,16 +1369,16 @@ msgstr "
 
 #: templates/perms/perms.inc:22 templates/view/view.inc:28
 msgid "Owner"
-msgstr "Besitzer"
+msgstr "Organisator"
 
 #: templates/perms/perms.inc:28 templates/perms/perms.inc:39
 msgid "Owner:"
-msgstr "Besitzer:"
+msgstr "Organisator:"
 
 #: lib/Driver.php:2341
 #, php-format
 msgid "Owner: %s"
-msgstr "Besitzer: %s"
+msgstr "Organisator: %s"
 
 #: templates/data/export.inc:119 templates/data/export.inc:204
 msgid "PM"
@@ -1700,7 +1700,7 @@ msgstr "Hinzuzuf
 
 #: templates/perms/perms.inc:30
 msgid "Select a new owner:"
-msgstr "Neuen Besitzer auswählen:"
+msgstr "Neuen Organisator auswählen:"
 
 #: templates/perms/perms.inc:217 templates/perms/perms.inc:219
 msgid "Select a user to add:"
@@ -2293,6 +2293,10 @@ msgstr "Benutzeroberfl
 msgid "User to add:"
 msgstr "Hinzuzufügender Benutzer:"
 
+#: lib/Views/Event.php:63
+msgid "User unkown"
+msgstr "Benutzer unbekannt"
+
 #: lib/Forms/SubscribeRemoteCalendar.php:38
 #: lib/Forms/EditRemoteCalendar.php:38
 msgid "Username"


More information about the devel mailing list