From e4b61ff54b73781e105feb28a4f2249a5597f3f2 Mon Sep 17 00:00:00 2001 From: Olivier PEREZ Date: Sat, 11 Apr 2015 17:03:10 +0200 Subject: [PATCH] Don't redirect to studs when you edit a vote from adminstuds --- app/classes/Framadate/Utils.php | 20 ++++++++++---------- tpl/part/vote_table_classic.tpl | 4 ++-- tpl/part/vote_table_date.tpl | 5 +++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php index 9c0ab32..6d5254d 100644 --- a/app/classes/Framadate/Utils.php +++ b/app/classes/Framadate/Utils.php @@ -106,21 +106,21 @@ class Utils { public static function getUrlSondage($id, $admin = false, $vote_id='') { if (URL_PROPRE) { if ($admin === true) { - $url = str_replace('/admin', '', self::get_server_name()) . $id . '/admin'; + $url = self::get_server_name() . $id . '/admin'; } else { - $url = str_replace('/admin', '', self::get_server_name()) . $id; - if ($vote_id != '') { - $url .= '/vote/'.$vote_id."#edit"; - } + $url = self::get_server_name() . $id; + } + if ($vote_id != '') { + $url .= '/vote/'.$vote_id."#edit"; } } else { if ($admin === true) { - $url = str_replace('/admin', '', self::get_server_name()) . 'adminstuds.php?poll=' . $id; + $url = self::get_server_name() . 'adminstuds.php?poll=' . $id; } else { - $url = str_replace('/admin', '', self::get_server_name()) . 'studs.php?poll=' . $id; - if ($vote_id != '') { - $url .= '&vote='.$vote_id."#edit"; - } + $url = self::get_server_name() . 'studs.php?poll=' . $id; + } + if ($vote_id != '') { + $url .= '&vote='.$vote_id."#edit"; } } diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 5ec4db5..cc48236 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -5,7 +5,7 @@

{__('Poll results', 'Votes of the poll')} {if $hidden}({__('PollInfo', 'Results are hidden.')}){/if}

-
+ @@ -89,7 +89,7 @@ {if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)}
{__('Poll results', 'Votes of the poll')} {$poll->title|html}
- + {__('Generic', 'Edit')} {if $admin} diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index f8bc22e..37fa876 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -4,8 +4,9 @@

{__('Poll results', 'Votes of the poll')} {if $hidden}({__('PollInfo', 'Results are hidden.')}){/if}

+
- + @@ -136,7 +137,7 @@ {if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)}
{__('Poll results', 'Votes of the poll')} {$poll->title|html}
- + {__('Generic', 'Edit')} {if $admin}