From: Jan Schneider Date: Fri, 2 Jul 2010 20:02:25 +0000 (+0200) Subject: Simplify X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5bfe6334b67c110636716c4b6225cea8e4fe2b80;p=horde.git Simplify --- diff --git a/turba/lib/Object.php b/turba/lib/Object.php index f0968270c..c3a0663ca 100644 --- a/turba/lib/Object.php +++ b/turba/lib/Object.php @@ -205,34 +205,18 @@ class Turba_Object { ->getInstance('Horde_History') ->getHistory($this->getGuid()); foreach ($log as $entry) { - switch ($entry['action']) { - case 'add': + if ($entry['action'] == 'add' || $entry['action'] == 'modify') { if ($GLOBALS['registry']->getAuth() != $entry['who']) { - $createdby = sprintf(_("by %s"), Turba::getUserName($entry['who'])); + $by = sprintf(_("by %s"), Turba::getUserName($entry['who'])); } else { - $createdby = _("by me"); + $by = _("by me"); } - $history['created'] + $history[$entry['action'] == 'add' ? 'created' : 'modified'] = strftime($GLOBALS['prefs']->getValue('date_format'), $entry['ts']) . ' ' . date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:i a', $entry['ts']) . ' ' - . @htmlspecialchars($createdby, ENT_COMPAT, Horde_Nls::getCharset()); - break; - - case 'modify': - if ($GLOBALS['registry']->getAuth() != $entry['who']) { - $modifiedby = sprintf(_("by %s"), Turba::getUserName($entry['who'])); - } else { - $modifiedby = _("by me"); - } - $history['modified'] - = strftime($GLOBALS['prefs']->getValue('date_format'), $entry['ts']) - . ' ' - . date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:i a', $entry['ts']) - . ' ' - . @htmlspecialchars($modifiedby, ENT_COMPAT, Horde_Nls::getCharset()); - break; + . @htmlspecialchars($by, ENT_COMPAT, Horde_Nls::getCharset()); } } } catch (Exception $e) {