Fix #832: Always include the url in bug reports
authorOlivier Le Floch <olivier.le-floch@polytechnique.org>
Sun, 6 Jul 2008 21:55:56 +0000 (23:55 +0200)
committerOlivier Le Floch <olivier.le-floch@polytechnique.org>
Sun, 6 Jul 2008 21:59:22 +0000 (23:59 +0200)
ChangeLog
include/xnet/page.inc.php
modules/core.php
templates/core/bug.tpl
templates/skin/common.menu.tpl
templates/survey/error.tpl
templates/xnet/skin.tpl

index c210cca..af3ce6c 100644 (file)
--- 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)   <florent.bruneau@m4x.org>
     * JAC: Stéphane Jacob       (jacou)     <stephane.jacob@m4x.org>
     * JS : Jean Sébastien Bedo              <jean-sebastien.bedo@m4x.org>
-    * MC : Pierre Habouzit      (MadCoder)  <pierre.habouzit@m4x.org>
-    * mYk: Aymeric Augustin     (mYk)       <aymeric.augustin@m4x.org>
-    * OG : Olivier Guillaumin               <olivier.guillaumin@m4x.org>
-    * PIK: Fabien Laborde       (pika)      <fabien.laborde@m4x.org>
-    * SHK: Jeremy Lainé         (Sharky)    <jeremy.laine@m4x.org>
-    * THD: Thomas Deniau        (Totom)     <thomas.deniau@m4x.org>
-    * VP : Vincent Palatin                  <vincent.palatin@m4x.org>
-    * XdX: Alexandre Hô         (XandreX)   <alexandre.ho@m4x.org>
-    * VZA: Vincent Zanotti      (vinZ2)     <vincent.zanotti@m4x.org>
-
-================================================================================
-vim:et:ts=4:sw=4:tw=80:enc=utf-8:
+    * 
\ No newline at end of file
index 8acc8eb..b32adc4 100644 (file)
@@ -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');
index a490d17..67da706 100644 (file)
@@ -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();
 
index 15f36d8..4b3d80a 100644 (file)
@@ -68,7 +68,7 @@ function fillContent()
       <option value="wish">Souhait</option>\r
       <option value="help">Aide/Dépannage</option>\r
     </select>\r
-    &nbsp;&nbsp;Sujet&nbsp;: <input type="text" name="item_summary" id="flyspray_title" value="sur la page {$smarty.server.HTTP_REFERER}" size="50" maxlength="100"/>\r
+    &nbsp;&nbsp;Sujet&nbsp;: <input type="text" name="item_summary" id="flyspray_title" value="sur la page { $location }" size="50" maxlength="100"/>\r
     <textarea name="detailed_desc" id="flyspray_detail" cols="70" rows="10" style="width:100%;margin-top:10px;margin-bottom:10px;height:400px;display:block;" onFocus="cleanContent()" onBlur="fillContent()"></textarea>\r
     <input type="hidden" name="page" value="{$smarty.server.HTTP_REFERER|default:$smarty.request.page}" />\r
     <div class="center">\r
index f93a58e..0c3b785 100644 (file)
@@ -75,7 +75,7 @@
 <div class="menu_item"><a href="nl">Lettres mensuelles</a></div>
 <div class="menu_item"><a href="ax">Lettres de l'AX</a></div>
 <div class="menu_item"><a href="Xorg/NousContacter">Nous contacter</a></div>
-<div class="menu_item"><a href="send_bug" class="popup2">Signaler un bug</a></div>
+<div class="menu_item"><a href="send_bug/{ $smarty.server.REQUEST_URI }" class="popup2">Signaler un bug</a></div>
 
 {if hasPerm('admin')}
 <div class="menu_title">***</div>
index 21e5c22..1eb652a 100644 (file)
@@ -36,7 +36,7 @@
 {elseif $survey_message neq ""}
   {$survey_message}
 {else}
-Une erreur inconnue est survenue dans l'&#233;dition de ce sondage. N'hésite pas &#224; <a href='send_bug'>signaler ce bug</a> si il persiste.
+Une erreur inconnue est survenue dans l'&#233;dition de ce sondage. N'hésite pas &#224; <a href='send_bug/{ $smarty.server.REQUEST_URI }'>signaler ce bug</a> si il persiste.
 {/if}
 <br/>
 <a href="{$survey_link}">Retour</a>
index a62d9d4..c671dd7 100644 (file)
           <a href="Xnet/APropos">à propos de ce site</a> -
           <a href="mailto:contact@polytechnique.org">nous contacter</a>
           {if $smarty.session.auth}
-            - <a href="send_bug" class="popup_840x600">signaler un bug</a>
+            - <a href="send_bug/{ $smarty.server.REQUEST_URI }" class="popup_840x600">signaler un bug</a>
           {/if}
           <br />
           Plat/al {#globals.version#} - © Copyright 2000-2008 <a href="http://x-org.polytechnique.org/">Association Polytechnique.org</a>