From 987f1bd2fd0da45e2a1c8fd28d71cf794b2bd41b Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Thu, 30 Nov 2006 23:53:30 +0000 Subject: [PATCH] signaler un bug envoie un mail au support au lieu de creer un bug flyspray git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1216 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 14 +++--- classes/pltableeditor.php | 9 +++- htdocs/javascript/flyspray.js | 97 ------------------------------------------ modules/events.php | 15 ++++++- templates/bug.tpl | 28 ++++++++++++ templates/skin/common.bug.tpl | 37 ---------------- templates/skin/common.menu.tpl | 2 +- 7 files changed, 59 insertions(+), 143 deletions(-) delete mode 100644 htdocs/javascript/flyspray.js create mode 100644 templates/bug.tpl delete mode 100644 templates/skin/common.bug.tpl diff --git a/ChangeLog b/ChangeLog index 920450c..75417f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,24 +3,28 @@ VERSION 0.9.13 ?? ?? 2007 New: + * Events: + - Tips. -FRU/Car + - Signal bug send to OTRS and not trackers. -Car + * Payment: - - Directly integrated into Xnet -FRU + - Directly integrated into Xnet. -FRU Bug/Wish: * Register: - - #277: Improve ergonomy -FRU + - #277: Improve ergonomy. -FRU * Xnet: - - #570: Fix geoloc skin -FRU + - #570: Fix geoloc skin. -FRU From 0.9.12 branch: * Search: - - #566: Fix accent detection -FRU + - #566: Fix accent detection. -FRU * Xnet: - - #574: Fix subscription link customization -FRU + - #574: Fix subscription link customization. -FRU ================================================================================ VERSION 0.9.12 25 11 2006 diff --git a/classes/pltableeditor.php b/classes/pltableeditor.php index c849f37..3fe9dce 100644 --- a/classes/pltableeditor.php +++ b/classes/pltableeditor.php @@ -75,7 +75,12 @@ class PLTableEditor { elseif (substr($a['Type'],0,4) == 'set(') { // get the list of options $a['List'] = explode('§',str_replace("','","§",substr($a['Type'], 5, strlen($a['Type']) - 7))); - $a['Type'] = 'set'; + if (count($a['List']) == 1) { + $a['Type'] = 'checkbox'; + $a['Value'] = $a['List'][0]; + } else { + $a['Type'] = 'set'; + } } elseif (substr($a['Type'],0,5) == 'enum(') { // get the list of options @@ -196,6 +201,8 @@ class PLTableEditor { $val .= $option; } $val = "'".addslashes($val)."'"; + } elseif ($descr['Type'] == 'checkbox') { + $val = Post::has($field)?"'".addslashes($descr['Value'])."'":"''"; } elseif (Post::has($field)) { $val = Post::v($field); if ($descr['Type'] == 'timestamp') { diff --git a/htdocs/javascript/flyspray.js b/htdocs/javascript/flyspray.js deleted file mode 100644 index 3cd41d1..0000000 --- a/htdocs/javascript/flyspray.js +++ /dev/null @@ -1,97 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2003-2006 Polytechnique.org * - * http://opensource.polytechnique.org/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - ***************************************************************************/ - -function send_bug() { - var h = windowHeight(); - var y = getScrollY(); - y += (h - 470) /2; - document.getElementById('flyspray_report').style.display = 'block'; - document.getElementById('flyspray_report').style.top = y+'px'; - return false; -} - -function getScrollY() { - var scrOfX = 0, scrOfY = 0; - if( typeof( window.pageYOffset ) == 'number' ) { - //Netscape compliant - scrOfY = window.pageYOffset; - } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { - //DOM compliant - scrOfY = document.body.scrollTop; - } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { - //IE6 standards compliant mode - scrOfY = document.documentElement.scrollTop; - } - return scrOfY; -} -function windowHeight() { - if( typeof( window.innerWidth ) == 'number' ) { - //Non-IE - return window.innerHeight; - } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { - return document.documentElement.clientHeight; - } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { - //IE 4 compatible - return document.body.clientHeight; - } - return 0; -} - -function close_bug(f,send) { - var detail = document.getElementById('flyspray_detail'); - detail.value = utf8(detail.value); - var title = document.getElementById('flyspray_title'); - title.value = utf8(title.value); - if (send) { - f.target = '_blank'; - f.submit(); - } - f.reset(); - document.getElementById('flyspray_report').style.display = 'none'; -} - -function utf8(isotext) -{ - var utf8text = ""; - for ( i=0; ihandler_ev($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_ev(&$page, $action = 'list', $eid = null, $pound = null) diff --git a/templates/bug.tpl b/templates/bug.tpl new file mode 100644 index 0000000..49c1049 --- /dev/null +++ b/templates/bug.tpl @@ -0,0 +1,28 @@ +
+{if $bug_sent} + +{/if} +
+

Signaler un bug ou demander une amélioration

+
+ +   Sujet : + +
+ + +
+
+
+
diff --git a/templates/skin/common.bug.tpl b/templates/skin/common.bug.tpl deleted file mode 100644 index 5ef8f3d..0000000 --- a/templates/skin/common.bug.tpl +++ /dev/null @@ -1,37 +0,0 @@ - - -
-

Signaler un bug ou demander une amélioration

-
- - - - -   Sujet : - - - - - - - - - - -
- - -
-
-
diff --git a/templates/skin/common.menu.tpl b/templates/skin/common.menu.tpl index c610d21..bc1f2ea 100644 --- a/templates/skin/common.menu.tpl +++ b/templates/skin/common.menu.tpl @@ -70,7 +70,7 @@ - + {include file=skin/common.bug.tpl} {if $smarty.session.perms eq admin} -- 2.1.4