From a1cc95d35271e8b4040ae5b1f3198ed7048a89a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 23 Nov 2014 16:26:55 +0100 Subject: [PATCH 1/7] Fixed design of edit page of a bookmark --- htdocs/bookmarks/card.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 640e7e72c5747..1d217b6415428 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -153,7 +153,7 @@ print_fiche_titre($langs->trans("NewBookmark")); - dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark'); + dol_fiche_head($head, 'card', $langs->trans("Bookmark"),0,'bookmark'); print ''; @@ -196,8 +196,15 @@ $bookmark=new Bookmark($db); $bookmark->fetch($id); + $head = array( + array( + '', + $langs->trans('Card'), + 'card' + ) + ); - dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark'); + dol_fiche_head($head, 'card', $langs->trans("Bookmark"),0,'bookmark'); if ($action == 'edit') { From c40be71dcdd817e19619983acf92d6754578bfca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 23 Nov 2014 16:44:49 +0100 Subject: [PATCH 2/7] Fixed design of new bookmark page --- htdocs/bookmarks/card.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 1d217b6415428..2c1c61c5981ab 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -153,8 +153,6 @@ print_fiche_titre($langs->trans("NewBookmark")); - dol_fiche_head($head, 'card', $langs->trans("Bookmark"),0,'bookmark'); - print '
'; print ''; @@ -183,8 +181,6 @@ print ''; print ''; - - dol_fiche_end(); } @@ -220,12 +216,12 @@ print ''; - print ''; - print ''; From 52eb4943e2492a0a733800e1c557f96b3bf35e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 23 Nov 2014 16:46:48 +0100 Subject: [PATCH 3/7] Fixed entities problems in error messages when creating a bookmark --- htdocs/bookmarks/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 2c1c61c5981ab..5e8f770c91c39 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -69,12 +69,12 @@ if (! $title) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle")), 'errors'); + setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->trans("BookmarkTitle")), 'errors'); } if (! $url) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink")), 'errors'); + setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->trans("UrlOrLink")), 'errors'); } if (! $error) @@ -95,7 +95,7 @@ if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - setEventMessage($langs->trans("WarningBookmarkAlreadyExists"), 'warnings'); + setEventMessage($langs->transnoentities("WarningBookmarkAlreadyExists"), 'warnings'); } else { From 373bdcf5d7cc1169c1c3039626aa749534c2fa4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 23 Nov 2014 16:54:09 +0100 Subject: [PATCH 4/7] Fixed problem when editing a bookmark and failing --- htdocs/bookmarks/card.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 5e8f770c91c39..9e115a611e672 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -50,6 +50,13 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') { + + if ($action == 'update') { + $invertedaction = 'edit'; + } else { + $invertedaction = 'create'; + } + $error = 0; if (GETPOST("cancel")) @@ -101,12 +108,12 @@ { setEventMessage($bookmark->error, 'errors'); } - $action='create'; + $action = $invertedaction; } } else { - $action='create'; + $action = $invertedaction; } } From 231ad04fbd5555b42a535934226141e1830359d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 23 Nov 2014 16:58:46 +0100 Subject: [PATCH 5/7] Highlight of required fields should be only in edit mode --- htdocs/bookmarks/card.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 9e115a611e672..5896f63106a04 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2014 Marcos GarcĂ­a * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -223,12 +224,31 @@ print ''; - print ''; - print ''; From b76a58b898d64f7548de2d8d813298641786112a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 23 Nov 2014 17:03:25 +0100 Subject: [PATCH 6/7] Fixed typo --- htdocs/bookmarks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index a22b24388b151..748a4d9b7fa4d 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -59,7 +59,7 @@ } else { - $setEventMessage($bookmark->error, 'errors'); + setEventMessage($bookmark->error, 'errors'); } } From 496a3fcaaef0f6e4a36bfe8d9aff9fad8b23d24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 23 Nov 2014 17:06:51 +0100 Subject: [PATCH 7/7] Removed unused action of card.php --- htdocs/bookmarks/card.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 5896f63106a04..05d6a0b48433e 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -118,28 +118,6 @@ } } -if ($action == 'delete') -{ - $bookmark=new Bookmark($db); - $bookmark->id=$_GET["bid"]; - $bookmark->url=$user->id; - $bookmark->target=$user->id; - $bookmark->title='xxx'; - $bookmark->favicon='xxx'; - - $res=$bookmark->remove(); - if ($res > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - setEventMessage($bookmark->error, 'errors'); - } -} - - /* * View */
'.$langs->trans("BookmarkTitle").''.$langs->trans("SetHereATitleForLink").'
'.$langs->trans("Ref").''.$bookmark->ref.'
'.$langs->trans("BookmarkTitle").''; + print '
'.$langs->trans("BookmarkTitle").''; if ($action == 'edit') print 'title).'">'; else print $bookmark->title; print '
'.$langs->trans("UrlOrLink").''; + print '
'.$langs->trans("UrlOrLink").''; if ($action == 'edit') print 'url).'">'; else print 'target?' target="_blank"':'').'>'.$bookmark->url.''; print '
'.$langs->trans("Ref").''.$bookmark->ref.'
'.$langs->trans("BookmarkTitle").''; + print '
'; + if ($action == 'edit') { + print ''; + } + + print $langs->trans("BookmarkTitle"); + + if ($action == 'edit') { + print ''; + } + + print ''; if ($action == 'edit') print 'title).'">'; else print $bookmark->title; print '
'.$langs->trans("UrlOrLink").''; + print '
'; + if ($action == 'edit') { + print ''; + } + print $langs->trans("UrlOrLink"); + if ($action == 'edit') { + print ''; + } + print ''; if ($action == 'edit') print 'url).'">'; else print 'target?' target="_blank"':'').'>'.$bookmark->url.''; print '