From 76ed2e494b220780d8e247f9348f8f09a9d5fee8 Mon Sep 17 00:00:00 2001 From: mensonge Date: Tue, 19 Feb 2008 14:43:00 +0000 Subject: Interface fix: add a link to last editor profile in common description. Don't count a change if a user saves with no modifications. git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@46 b3834d28-1941-0410-a4f8-b48e95affb8f --- locales/fr_FR/LC_MESSAGES/messages.mo | Bin 18583 -> 18582 bytes locales/fr_FR/LC_MESSAGES/messages.po | 6 +++--- locales/messages.po | 4 ++-- services/commondescriptionservice.php | 14 ++++++++++++++ templates/bookmarkcommondescriptionedit.tpl.php | 4 ++-- templates/tagcommondescriptionedit.tpl.php | 4 ++-- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/locales/fr_FR/LC_MESSAGES/messages.mo b/locales/fr_FR/LC_MESSAGES/messages.mo index a80e071..aeb0b2f 100644 Binary files a/locales/fr_FR/LC_MESSAGES/messages.mo and b/locales/fr_FR/LC_MESSAGES/messages.mo differ diff --git a/locales/fr_FR/LC_MESSAGES/messages.po b/locales/fr_FR/LC_MESSAGES/messages.po index 316ad71..22ec2dc 100644 --- a/locales/fr_FR/LC_MESSAGES/messages.po +++ b/locales/fr_FR/LC_MESSAGES/messages.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Scuttle\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-02-19 10:28+0100\n" -"PO-Revision-Date: 2008-02-19 10:29+0100\n" +"POT-Creation-Date: 2008-02-19 15:30+0100\n" +"PO-Revision-Date: 2008-02-19 15:31+0100\n" "Last-Translator: BenjaminHKB \n" "Language-Team: fr-FR \n" "MIME-Version: 1.0\n" @@ -566,7 +566,7 @@ msgstr "Description" #: ../../../templates/bookmarkcommondescriptionedit.tpl.php:28 #: ../../../templates/tagcommondescriptionedit.tpl.php:21 -msgid "Last modification: " +msgid "Last modification:" msgstr "Dernière modification :" #: ../../../templates/bookmarkcommondescriptionedit.tpl.php:39 diff --git a/locales/messages.po b/locales/messages.po index f279fa5..f9d9c84 100644 --- a/locales/messages.po +++ b/locales/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-02-19 10:28+0100\n" +"POT-Creation-Date: 2008-02-19 15:30+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -553,7 +553,7 @@ msgstr "" #: ../../../templates/bookmarkcommondescriptionedit.tpl.php:28 #: ../../../templates/tagcommondescriptionedit.tpl.php:21 -msgid "Last modification: " +msgid "Last modification:" msgstr "" #: ../../../templates/bookmarkcommondescriptionedit.tpl.php:39 diff --git a/services/commondescriptionservice.php b/services/commondescriptionservice.php index 7e34219..6c591a9 100644 --- a/services/commondescriptionservice.php +++ b/services/commondescriptionservice.php @@ -16,6 +16,13 @@ class CommonDescriptionService { } function addTagDescription($tag, $desc, $uId, $time) { + // Check if no modification + $lastDesc = $this->getLastTagDescription($tag); + if($lastDesc['cdDescription'] == $desc) { + return true; + } + + // If modification $datetime = gmdate('Y-m-d H:i:s', $time); $values = array('tag'=>$tag, 'cdDescription'=>$desc, 'uId'=>$uId, 'cdDatetime'=>$datetime); $sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values); @@ -81,6 +88,13 @@ class CommonDescriptionService { } function addBookmarkDescription($bHash, $title, $desc, $uId, $time) { + // Check if no modification + $lastDesc = $this->getLastBookmarkDescription($bHash); + if($lastDesc['cdTitle'] == $title && $lastDesc['cdDescription'] == $desc) { + return true; + } + + // If modification $datetime = gmdate('Y-m-d H:i:s', $time); $values = array('bHash'=>$bHash, 'cdTitle'=>$title, 'cdDescription'=>$desc, 'uId'=>$uId, 'cdDatetime'=>$datetime); $sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values); diff --git a/templates/bookmarkcommondescriptionedit.tpl.php b/templates/bookmarkcommondescriptionedit.tpl.php index c1723de..39f20ae 100644 --- a/templates/bookmarkcommondescriptionedit.tpl.php +++ b/templates/bookmarkcommondescriptionedit.tpl.php @@ -25,9 +25,9 @@ window.onload = function() { 0) { - echo T_('Last modification: ').$description['cdDatetime'].', '; + echo T_('Last modification:').' '.$description['cdDatetime'].', '; $lastUser = $userservice->getUser($description['uId']); - echo $lastUser['username']; + echo ''.$lastUser['username'].''; } ?> diff --git a/templates/tagcommondescriptionedit.tpl.php b/templates/tagcommondescriptionedit.tpl.php index 6e09374..158142e 100644 --- a/templates/tagcommondescriptionedit.tpl.php +++ b/templates/tagcommondescriptionedit.tpl.php @@ -18,9 +18,9 @@ window.onload = function() { 0) { - echo T_('Last modification: ').$description['cdDatetime'].', '; + echo T_('Last modification:').' '.$description['cdDatetime'].', '; $lastUser = $userservice->getUser($description['uId']); - echo $lastUser['username']; + echo ''.$lastUser['username'].''; } ?> -- cgit v1.2.3