Don't redirect to studs when you edit a vote from adminstuds

This commit is contained in:
Olivier PEREZ 2015-04-11 17:03:10 +02:00
parent e7da951c9b
commit e4b61ff54b
3 changed files with 15 additions and 14 deletions

View File

@ -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";
}
}

View File

@ -5,7 +5,7 @@
<h3>{__('Poll results', 'Votes of the poll')} {if $hidden}<i>({__('PollInfo', 'Results are hidden.')})</i>{/if}</h3>
<div id="tableContainer" class="tableContainer">
<form action="{poll_url id=$poll_id}" method="POST" id="poll_form">
<form action="{if $admin}{poll_url id=$admin_poll_id admin=true}{else}{poll_url id=$poll_id}{/if}" method="POST" id="poll_form">
<table class="results">
<caption class="sr-only">{__('Poll results', 'Votes of the poll')} {$poll->title|html}</caption>
<thead>
@ -89,7 +89,7 @@
{if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)}
<td>
<a href="{poll_url id=$poll->id vote_id=$vote->uniqId}" class="btn btn-link btn-sm" title="{__('Poll results', 'Edit the line:')|html} {$vote->name|html}">
<a href="{if $admin}{poll_url id=$poll->admin_id vote_id=$vote->uniqId admin=true}{else}{poll_url id=$poll->id vote_id=$vote->uniqId}{/if}" class="btn btn-link btn-sm" title="{__('Poll results', 'Edit the line:')|html} {$vote->name|html}">
<span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span>
</a>
{if $admin}

View File

@ -4,8 +4,9 @@
<h3>{__('Poll results', 'Votes of the poll')} {if $hidden}<i>({__('PollInfo', 'Results are hidden.')})</i>{/if}</h3>
<div id="tableContainer" class="tableContainer">
<form action="{poll_url id=$poll_id}" method="POST" id="poll_form">
<form action="{if $admin}{poll_url id=$admin_poll_id admin=true}{else}{poll_url id=$poll_id}{/if}" method="POST" id="poll_form">
<table class="results">
<caption class="sr-only">{__('Poll results', 'Votes of the poll')} {$poll->title|html}</caption>
<thead>
@ -136,7 +137,7 @@
{if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)}
<td>
<a href="{poll_url id=$poll->id vote_id=$vote->uniqId}" class="btn btn-link btn-sm" title="{__('Poll results', 'Edit the line:')|escape} {$vote->name|html}">
<a href="{if $admin}{poll_url id=$poll->admin_id vote_id=$vote->uniqId admin=true}{else}{poll_url id=$poll->id vote_id=$vote->uniqId}{/if}" class="btn btn-link btn-sm" title="{__('Poll results', 'Edit the line:')|escape} {$vote->name|html}">
<span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span>
</a>
{if $admin}