fix send_bug to otrs for xnet too
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 2 Dec 2006 11:23:17 +0000 (11:23 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 2 Dec 2006 11:23:17 +0000 (11:23 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1223 839d8a87-29fc-0310-9880-83ba4fa771e5

include/xnet/page.inc.php
modules/events.php
modules/xnet.php
templates/xnet/skin.tpl

index 003237a..ce6d324 100644 (file)
@@ -69,7 +69,7 @@ class XnetPage extends PlatalPage
         $sub = array();
         $sub['liste des groupes'] = 'plan';
         $sub['documentation']     = 'Xnet';
-        $sub['Signaler un bug']   = array('link' => 'send_bug', 'onclick' => 'send_bug();return false'); 
+        $sub['signaler un bug']   = array('href' => 'send_bug', 'class' => 'popup_840x600'); 
         $menu["no_title"]   = $sub;
         
         if (S::logged() && $globals->asso()) {
index 4e25980..89dcfa8 100644 (file)
@@ -77,7 +77,6 @@ class EventsModule extends PLModule
         $page->addJsLink('close_on_esc.js');
         if (Env::has('send')) {
             $page->assign('bug_sent',1);
-            
             require_once "diogenes/diogenes.hermes.inc.php";
             $mymail = new HermesMailer();
             $mymail->setFrom('"'.S::v('prenom').' '.S::v('nom').'" <'.S::v('bestalias').'@polytechnique.org>');
index f3cf0f9..ce9ed09 100644 (file)
@@ -38,8 +38,18 @@ class XnetModule extends PLModule
 
     function handler_bug(&$page)
     {
-        $this->handler_index(&$page);
-        $page->assign('bug', 1);
+        $page->changeTpl('bug.tpl',SIMPLE);
+        $page->addJsLink('close_on_esc.js');
+        if (Env::has('send')) {
+            $page->assign('bug_sent',1);
+            require_once "diogenes/diogenes.hermes.inc.php";
+            $mymail = new HermesMailer();
+            $mymail->setFrom('"'.S::v('prenom').' '.S::v('nom').'" <'.S::v('bestalias').'@polytechnique.org>');
+            $mymail->addTo('support+platal@polytechnique.org');
+            $mymail->setSubject('Plat/al '.Env::v('task_type').' : '.Env::v('item_summary'));
+            $mymail->setTxtBody(Env::v('detailed_desc'));
+            $mymail->send();
+        }
     }
     
     function handler_index(&$page)
index e4e1065..683c7a9 100644 (file)
   </head>
   <body>
     {include file=skin/common.devel.tpl}
-    {include file=skin/common.bandeau.tpl}
+    {if !$simple}
+      {include file=skin/common.bandeau.tpl}
+    {/if}
 
     <table id="layout" cellspacing="0" cellpadding="0">
+    {if !$simple}
       <tr>
         <td colspan="2">
         <table cellspacing="0" cellpadding="0" id="top">
         </table>
         </td>
       </tr>
+    {/if}{* fin simple *}
 
-      {if $menu}
+      {if $menu && !$simple}
       <tr>
         <td id="menu">
           {foreach from=$menu key=title item=submenu}
-          {if $title neq 'no_title'}<h1>{$title}</h1>{/if}
-          {foreach from=$submenu key=tit item=url}
-          {if is_array($url)}
-          <a href="{$url.link}" onclick="{$url.onclick}">{$tit}</a>
-          {else}
-          <a href="{$url}">{$tit}</a>
-          {/if}
-          {/foreach}
+            {if $title neq 'no_title'}<h1>{$title}</h1>{/if}
+            {foreach from=$submenu key=tit item=url}
+              {if is_array($url)}
+                <a{foreach from=$url key=var item=val} {$var}="{$val}"{/foreach}>{$tit}</a>
+              {else}
+                <a href="{$url}">{$tit}</a>
+              {/if}
+            {/foreach}
           {/foreach}
         </td>
         <td id="body">
           <div class="breadcrumb">
             <a href=".">X.net</a> »
             {if $asso}
-            <a href="groups/{$asso.cat}">{$asso.cat|cat_pp}</a> »
-            {if $asso.dom}
-            <a href="groups/{$asso.cat}/{$asso.dom}">{$asso.domnom}</a> »
-            {/if}
-            {$asso.nom}
+              <a href="groups/{$asso.cat}">{$asso.cat|cat_pp}</a> »
+              {if $asso.dom}
+                <a href="groups/{$asso.cat}/{$asso.dom}">{$asso.domnom}</a> »
+              {/if}
+              {$asso.nom}
             {elseif $cat}
-            <a href="groups/{$cat}">{$cat|cat_pp}</a> »
-            {if $dom || !$doms}
-            {if $cat eq 'promotions'}
-            Choix de la promotion
-            {else}
-            Choix de l'Asso
-            {/if}
-            {else}
-            Choix du domaine
-            {/if}
+              <a href="groups/{$cat}">{$cat|cat_pp}</a> »
+              {if $dom || !$doms}
+                {if $cat eq 'promotions'}
+                  Choix de la promotion
+                {else}
+                  Choix de l'Asso
+                {/if}
+              {else}
+                Choix du domaine
+              {/if}
             {elseif $wikipage}
-            <a href="Xnet">Documentation</a>
+              <a href="Xnet">Documentation</a>
             {/if}
           </div>
           {include file="skin/common.content.tpl"}
           {include file="skin/common.content.tpl"}
         </td>
       </tr>
-
+      {if !$simple}
       <tr><td colspan="2"><img src="images/barre.png" alt="----------" width="100%" /></td></tr>
 
       <tr>
         </td>
       </tr>
       {/if}
-
+      {/if}
+    {if !$simple}
       <tr><td colspan="2"><img src="images/barre.png" alt="----------" width="100%" /></td></tr>
 
       <tr>
           <a href="Xnet/APropos">à propos de ce site</a> -
           {mailto address="contact@polytechnique.org" text="nous contacter" encode="javascript"}
           {if $smarty.session.auth}
-            - <a href="send_bug" onclick="send_bug();return false">signaler un bug</a>
-            {include file=skin/common.bug.tpl}
+            - <a href="send_bug" class="popup_840x600">signaler un bug</a>
           {/if}
           <br />
           © Copyright 2000-2006 <a href="http://x-org.polytechnique.org/">Association Polytechnique.org</a>
         </td>
       </tr>
-
+    {/if}
     </table>
   </body>
 </html>