From b206cca9a18c3c44ba19b5317ec601cadc3cec69 Mon Sep 17 00:00:00 2001 From: Olivier Le Floch Date: Sun, 6 Jul 2008 23:55:56 +0200 Subject: [PATCH] Fix #832: Always include the url in bug reports --- ChangeLog | 14 ++------------ include/xnet/page.inc.php | 2 +- modules/core.php | 12 ++++++++++++ templates/core/bug.tpl | 2 +- templates/skin/common.menu.tpl | 2 +- templates/survey/error.tpl | 2 +- templates/xnet/skin.tpl | 2 +- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index c210cca..af3ce6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ Bug/Wish: * Core: - Fix email sending, correcting bugs introduced in r1897 -VZA + - #832: Always include the url in bug reports -ALK - #841: Improves contrast of links in legends in skin 'Espace' -FRU - #844: Uses INT in MySQL to store user ids -VZA - #851: Adds a direct link to GApps for gapps-active users -VZA @@ -1248,15 +1249,4 @@ ACRONYMS: * FRU: Florent Bruneau (Fruneau) * JAC: Stéphane Jacob (jacou) * JS : Jean Sébastien Bedo - * MC : Pierre Habouzit (MadCoder) - * mYk: Aymeric Augustin (mYk) - * OG : Olivier Guillaumin - * PIK: Fabien Laborde (pika) - * SHK: Jeremy Lainé (Sharky) - * THD: Thomas Deniau (Totom) - * VP : Vincent Palatin - * XdX: Alexandre Hô (XandreX) - * VZA: Vincent Zanotti (vinZ2) - -================================================================================ -vim:et:ts=4:sw=4:tw=80:enc=utf-8: + * \ No newline at end of file diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index 8acc8eb..b32adc4 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -85,7 +85,7 @@ class XnetPage extends PlatalPage $sub = array(); $sub['liste des groupes'] = 'plan'; $sub['documentation'] = 'Xnet'; - $sub['signaler un bug'] = array('href' => 'send_bug', 'class' => 'popup_840x600'); + $sub['signaler un bug'] = array('href' => 'send_bug/'.$_SERVER['REQUEST_URI'], 'class' => 'popup_840x600'); $menu["no_title"] = $sub; $perms = S::v('perms'); diff --git a/modules/core.php b/modules/core.php index a490d17..67da706 100644 --- a/modules/core.php +++ b/modules/core.php @@ -125,8 +125,20 @@ class CoreModule extends PLModule function handler_bug(&$page) { global $globals; + + if (empty($_SERVER['HTTP_REFERER'])) { + // We don't have a valid referer, we need to use the url + list($currentPage, $location) = explode('//', $_SERVER['REQUEST_URI'], 2); + + $location = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].'/'.$location; + } else { + $location = $_SERVER['HTTP_REFERER']; + } + $page->changeTpl('core/bug.tpl', SIMPLE); + $page->assign('location', $location); $page->addJsLink('close_on_esc.js'); + if (Env::has('send') && trim(Env::v('detailed_desc'))) { S::assert_xsrf_token(); diff --git a/templates/core/bug.tpl b/templates/core/bug.tpl index 15f36d8..4b3d80a 100644 --- a/templates/core/bug.tpl +++ b/templates/core/bug.tpl @@ -68,7 +68,7 @@ function fillContent() -   Sujet : +   Sujet :
diff --git a/templates/skin/common.menu.tpl b/templates/skin/common.menu.tpl index f93a58e..0c3b785 100644 --- a/templates/skin/common.menu.tpl +++ b/templates/skin/common.menu.tpl @@ -75,7 +75,7 @@ - + {if hasPerm('admin')} diff --git a/templates/survey/error.tpl b/templates/survey/error.tpl index 21e5c22..1eb652a 100644 --- a/templates/survey/error.tpl +++ b/templates/survey/error.tpl @@ -36,7 +36,7 @@ {elseif $survey_message neq ""} {$survey_message} {else} -Une erreur inconnue est survenue dans l'édition de ce sondage. N'hésite pas à signaler ce bug si il persiste. +Une erreur inconnue est survenue dans l'édition de ce sondage. N'hésite pas à signaler ce bug si il persiste. {/if}
Retour diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index a62d9d4..c671dd7 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -224,7 +224,7 @@ à propos de ce site - nous contacter {if $smarty.session.auth} - - signaler un bug + - signaler un bug {/if}
Plat/al {#globals.version#} - © Copyright 2000-2008 Association Polytechnique.org -- 2.1.4