Skip to content

Commit 8288344

Browse files
polossonpolosson
polosson
authored and
polosson
committed
INTIAL commit du ROBERT Open Source (0.5)
0 parents  commit 8288344

File tree

258 files changed

+24354
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+24354
-0
lines changed

.gitignore

Whitespace-only changes.

.htaccess

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SetEnv PHP_VER 5
2+
SetEnv MAGIC_QUOTES 0
3+
AddType x-mapp-php5 .php

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
robert
2+
======
3+
4+
Gestion de parc de matériel, techniciens, calendrier...

bugHunter.php

+196
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<?php
2+
session_start();
3+
require_once ('initInclude.php');
4+
require_once ('common.inc'); // OBLIGATOIRE pour les sessions, à placer TOUJOURS EN HAUT du code !!
5+
require_once ('checkConnect.php' );
6+
7+
if ( !isset($_SESSION['user']) || !$_SESSION['user']->isLevelMod())
8+
header('Location: index.php');
9+
10+
$titrePageBar = "ROBERT - BUG hunter";
11+
include('inc/head_html.php');
12+
require_once('bugHunter/xmlBUGparser.php');
13+
14+
if (!$_SESSION['user']->isAdmin())
15+
$showPanic = 'hide';
16+
17+
$nomUser = $_SESSION['user']->getUserInfos('prenom');
18+
19+
?>
20+
<style>
21+
.colsBug { position:absolute; top:70px; bottom:5px; z-index: 500; }
22+
</style>
23+
24+
<script> var prenomUser = '<? echo $nomUser ?>'; </script>
25+
<script src="./bugHunter/bugHunter.js"></script>
26+
27+
<body>
28+
<div id="bigDiv">
29+
<div id="Page" class="ui-widget fondPage bordPage">
30+
<div class="leftText pad20 gros">
31+
<div class="inline mid mini">
32+
<span class="bouton"><a href="index.php">RETOUR INDEX</a></span>
33+
</div>
34+
<div class="inline mid gros center" style="width:80%;">
35+
<span class="enorme marge30l">BUG HUNTER</span>
36+
<span class="enorme marge30l"> - </span>
37+
<span class="enorme marge30l"><img src="gfx/Robert2.png" height="45" alt="ROBERT" /></span>
38+
<span class="gros">v <? echo R_VERSION; ?></span>
39+
</div>
40+
</div>
41+
42+
<div class="colonne bordSection ui-widget ui-corner-all fondSect1 center colsBug" style="left:5px; width:155px; box-shadow: inset 0 0 5px #888888;">
43+
<div class='ui-state-highlight ui-corner-all bouton menuBH' id="menuBug">
44+
<img src='gfx/icones/menu/bugs.png' />
45+
<br />BUGs
46+
</div>
47+
<div class='ui-state-default ui-corner-all bouton menuBH margeTop10' id="menuWishes">
48+
<img src='gfx/icones/menu/wish.png' />
49+
<br />WE WANT MORE
50+
</div>
51+
<div class='ui-state-default ui-corner-all bouton menuBH margeTop10 <? echo @$showPanic; ?>' id="menuPanic">
52+
<img src='gfx/icones/menu/panic.png' />
53+
<br />PANIC
54+
</div>
55+
</div>
56+
57+
<div class="colonne bordSection ui-widget ui-corner-all fondSect1 colsBug" style="left:180px; right:5px; box-shadow: 0 1px 3px #888888;">
58+
59+
<div class="ui-widget-content ui-corner-all leftText BHsection" id="bugDiv">
60+
<div class="ui-widget-header ui-corner-all gros pad3">Liste des BUGS trouvés</div>
61+
<?
62+
$bugList = readXML('bugs.xml');
63+
$nbBugs = count($bugList);
64+
?>
65+
<script> var nextIDbug = <? echo $nbBugs + 1; ?>;</script>
66+
67+
<div class="petit margeTop5 padV10">
68+
<button class="bouton" id="addBugBtn">J'ai trouvé un bug !</button>
69+
</div>
70+
<div class="margeTop10 padV10" id="bugsList">
71+
<?
72+
$bugList = readXML('bugs.xml');
73+
if ($nbBugs != 0) {
74+
foreach ($bugList as $bug) {
75+
echo '<div class="ui-state-default ui-corner-all pad3 marge15bot" id="bug-'.$bug['id'].'">
76+
<div class="inline top" style="width:150px;">#'.$bug['id'].' <i>par <b>'.$bug['by'].'</b></i></div>
77+
<div class="inline top">'.$bug['descr'].'</div>
78+
<br />
79+
<div class="fixerDiv inline top mini" style="width:150px;">';
80+
if ($_SESSION['user']->isDev() && $bug['fixer'] == '')
81+
echo '<button class="bouton bugFixeur" bug="'.$bug['id'].'" fixer="'.$nomUser.'">Jm\'en occupe</button>';
82+
elseif ($bug['fixer'] != '')
83+
echo '<span class="ui-state-error ui-corner-all" style="padding:1px;"><b>'.$bug['fixer'].'</b> s\'en occupe</span>';
84+
if ($_SESSION['user']->isDev() && $bug['fixer'] == $nomUser)
85+
echo '<br /><button class="ui-state-error bouton bugKiller margeTop5" bug="'.$bug['id'].'"><b>Kill da Bug</b></button>';
86+
echo '</div>
87+
<div class="inline top pad10 margeTop5 shadowIn ui-corner-all">'.$bug['repro'].'</div>
88+
</div>';
89+
}
90+
}
91+
else {
92+
echo '<div class="ui-state-disabled ui-corner-all pad3 gros marge15bot">Pas de bug connu pour le moment !</div>';
93+
}
94+
?>
95+
96+
</div>
97+
</div>
98+
<div class="ui-widget-content ui-corner-all leftText BHsection hide" id="wishesDiv">
99+
<div class="ui-widget-header ui-corner-all gros pad3">Trucs que vous aimeriez pouvoir faire...</div>
100+
<?
101+
$wishList = readXML('wishes.xml');
102+
$nbWish = count($wishList);
103+
?>
104+
<script> var nextIDwish = <? echo $nbWish + 1; ?>;</script>
105+
106+
<div class="petit margeTop5 padV10">
107+
<button class="bouton" id="addWishBtn">J'aimerai bien que...</button>
108+
</div>
109+
<div class="margeTop10 padV10" id="wishesList">
110+
<?
111+
if ($nbWish != 0) {
112+
$tmp = Array(); // tri des wishes par priorité
113+
foreach($wishList as &$bugSort)
114+
$tmp[] = &$bugSort["prio"];
115+
array_multisort($tmp, SORT_DESC, $wishList);
116+
117+
foreach ($wishList as $wish) {
118+
echo '<div class="ui-state-default ui-corner-all pad5 marge15bot" id="wish-'.$wish['id'].'">
119+
<div class="inline top" style="width:130px;">#'.$wish['id'].' <i>par <b>'.$wish['by'].'</b></i></div>
120+
<div class="inline top mini" style="width:90px;">Priorité <b>'.$wish['prio'].'</b>/10</div>
121+
<div class="inline top">'.$wish['descr'].'</div>
122+
<br />
123+
<div class="fixerDiv inline top mini" style="width:220px;">';
124+
if ($_SESSION['user']->isDev() && $wish['fixer'] == '')
125+
echo '<button class="bouton wishFixeur" wish="'.$wish['id'].'" fixer="'.$nomUser.'">Jm\'en occupe</button>';
126+
elseif ($wish['fixer'] != '')
127+
echo '<span class="ui-state-error ui-corner-all" style="padding:1px;"><b>'.$wish['fixer'].'</b> s\'en occupe</span>';
128+
if ($_SESSION['user']->isDev() && $wish['fixer'] == $nomUser)
129+
echo '<br /><button class="ui-state-error bouton wishKiller margeTop5" wish="'.$wish['id'].'"><b>DONE ?</b></button>';
130+
echo '</div>
131+
</div>';
132+
}
133+
}
134+
else {
135+
echo '<div class="ui-state-disabled ui-corner-all pad3 gros marge15bot">Aucun truc à ajouter, le Robert est parfait !</div>';
136+
}
137+
?>
138+
</div>
139+
</div>
140+
141+
<div class="ui-widget-content ui-corner-all leftText BHsection hide" id="panicDiv">
142+
<div class="ui-widget-header ui-corner-all gros pad3">AU SECOURS !!!!!!</div>
143+
<div class="pad10">
144+
Envoie un mail aux développeurs, en cas d'urgence... Pas de panique, expliquez leur :<br />
145+
</div>
146+
<div class="margeTop10 padV10">
147+
<textarea id="panicMessage" cols="80" rows="20"></textarea>
148+
<button class="inline top bouton" id="sendPanic">ENVOYER</button>
149+
</div>
150+
</div>
151+
152+
</div>
153+
154+
</div>
155+
156+
157+
<div id="dialogBug" class="hide petit" title="Ajouter un bug">
158+
Soyez précis, mais concis !
159+
<br /><br />
160+
<div class="ui-widget-header ui-corner-all pad3">Description :</div>
161+
<textarea id="newBugDescr" cols="60" rows="5"></textarea>
162+
<br /><br />
163+
<div class="ui-widget-header ui-corner-all pad3">Comment le reproduire :</div>
164+
<textarea id="newBugRepro" cols="60" rows="5"></textarea>
165+
</div>
166+
167+
168+
<div id="dialogWish" class="hide petit" title="Ajouter un truc que vous aimeriez">
169+
Expliquez en détail à quoi vous vous attendez, et pour quelle partie du Robert.
170+
<br /><br />
171+
<div class="ui-widget-header ui-corner-all pad3">Description :</div>
172+
<textarea id="newWishDescr" cols="60" rows="5"></textarea>
173+
<br /><br />
174+
<div class="ui-widget-header ui-corner-all pad3">
175+
Priorité :
176+
<select id="newWishPrio">
177+
<option value="1">1</option>
178+
<option value="2">2</option>
179+
<option value="3">3</option>
180+
<option value="4">4</option>
181+
<option value="5" selected>5</option>
182+
<option value="6">6</option>
183+
<option value="7">7</option>
184+
<option value="8">8</option>
185+
<option value="9">9</option>
186+
<option value="10">10</option>
187+
</select>
188+
sur 10
189+
<span class="mini marge30l"><i>10 = "priorité maxi, limite urgent"</span><span class="mini marge30l"> 1 = "bah, juste comme ça"</i></span>
190+
</div>
191+
</div>
192+
193+
194+
</div>
195+
</body>
196+
</html>

bugHunter/bugHunter.js

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
2+
$(function () {
3+
$('#menuBug').click(function(){
4+
$('.menuBH').removeClass('ui-state-highlight').addClass('ui-state-default');
5+
$(this).addClass('ui-state-highlight');
6+
$('.BHsection').hide();
7+
$('#bugDiv').show();
8+
});
9+
$('#menuWishes').click(function(){
10+
$('.menuBH').removeClass('ui-state-highlight').addClass('ui-state-default');
11+
$(this).removeClass('ui-state-default').addClass('ui-state-highlight');
12+
$('.BHsection').hide();
13+
$('#wishesDiv').show();
14+
});
15+
$('#menuPanic').click(function(){
16+
$('.menuBH').removeClass('ui-state-highlight').addClass('ui-state-default');
17+
$(this).removeClass('ui-state-default').addClass('ui-state-highlight');
18+
$('.BHsection').hide();
19+
$('#panicDiv').show();
20+
});
21+
22+
23+
/// TRAITEMENT DES BUGS
24+
$('#addBugBtn').click(function() {
25+
$('#dialogBug').dialog({
26+
autoOpen: true, height: 400, width: 550, modal: true,
27+
buttons: {"AJOUTER" : function() {addBug();},
28+
"Fermer" : function() {$(this).dialog("close");}
29+
}
30+
});
31+
});
32+
33+
$('.bugFixeur').click(function() {
34+
var idBug = $(this).attr('bug');
35+
var fixeur = $(this).attr('fixer');
36+
var strAjax = 'action=modXML&type=bug&id='+idBug+'&fixer='+fixeur;
37+
AjaxJson(strAjax, 'bugHunter_actions', showBugFixer);
38+
});
39+
40+
$('#bugsList').on('click', '.bugKiller', function() {
41+
var idBug = $(this).attr('bug');
42+
var strAjax = 'action=supprXML&type=bug&id='+idBug;
43+
AjaxJson(strAjax, 'bugHunter_actions', removeBug);
44+
});
45+
46+
47+
48+
/// TRAITEMENT DES WISHES
49+
$('#addWishBtn').click(function() {
50+
$('#dialogWish').dialog({
51+
autoOpen: true, height: 400, width: 550, modal: true,
52+
buttons: {"AJOUTER" : function() {addWish();},
53+
"Fermer" : function() {$(this).dialog("close");}
54+
}
55+
});
56+
});
57+
58+
$('.wishFixeur').click(function() {
59+
var idWish = $(this).attr('wish');
60+
var fixeur = $(this).attr('fixer');
61+
var strAjax = 'action=modXML&type=wish&id='+idWish+'&fixer='+fixeur;
62+
AjaxJson(strAjax, 'bugHunter_actions', showWishFixer);
63+
});
64+
65+
$('#wishesList').on('click', '.wishKiller', function() {
66+
var idWish = $(this).attr('wish');
67+
var strAjax = 'action=supprXML&type=wish&id='+idWish;
68+
AjaxJson(strAjax, 'bugHunter_actions', removeWish);
69+
});
70+
71+
72+
73+
/// BOUTON PANIC !!
74+
$('#sendPanic').click(function() {
75+
var messageTxt = $('#panicMessage').val();
76+
if (messageTxt == '') {
77+
alert("Merci d'être plus clair...");
78+
return;
79+
}
80+
messageTxt = encodeURIComponent(messageTxt);
81+
var strAjax = 'action=sendPanic&type=panic&prenomUser='+prenomUser+'&message='+messageTxt;
82+
AjaxJson(strAjax, 'bugHunter_actions', alerteErr);
83+
});
84+
85+
});
86+
// FIN DU DOCUMENT READY
87+
88+
89+
90+
///////////////////////////////////////////////////////////// FONCTIONS DES BUGS //////////////////////////////////////////////////////////
91+
92+
function addBug () {
93+
var descr = $('#newBugDescr').val();
94+
var repro = $('#newBugRepro').val();
95+
if (descr == '' || repro == '') {alert("Merci d'être plus précis !");return;}
96+
var strAjax = 'action=addToXML&type=bug&id='+nextIDbug+'&descr='+descr+'&repro='+repro+'&user='+prenomUser;
97+
AjaxJson(strAjax, 'bugHunter_actions', refreshBugList);
98+
}
99+
100+
function refreshBugList (data) {
101+
if (data.error != undefined && data.error != '') {
102+
alert(data.error);
103+
return;
104+
}
105+
nextIDbug++;
106+
$('#bugsList').append('<div class="ui-state-default ui-corner-all pad3 marge15bot" id="bug-'+data.id+'">'+
107+
'<div class="inline top" style="width:130px;"><i>par <b>'+data.by+'</b></i></div>'+
108+
'<div class="inline top">'+data.descr+'</div>'+
109+
'<br />'+
110+
'<div class="fixerDiv inline top mini" style="width:130px;">'+
111+
data.mailSent +
112+
'</div>'+
113+
'<div class="inline top pad10 margeTop5 shadowIn ui-corner-all">'+data.repro+'</div>'+
114+
'</div>');
115+
$('#dialogBug').dialog("close");
116+
}
117+
118+
function showBugFixer (data) {
119+
if (data.error != undefined && data.error != '') {
120+
alert(data.error);
121+
return;
122+
}
123+
$('#bug-'+data.id).children('.fixerDiv')
124+
.html('<span class="ui-state-error ui-corner-all" style="padding:1px;"><b>'+data.fixer+'</b> s\'en occupe</span>');
125+
if (data.fixer == prenomUser)
126+
$('#bug-'+data.id).children('.fixerDiv')
127+
.append('<br /><button class="ui-state-error bouton bugKiller margeTop5" bug="'+data.id+'"><b>Kill da Bug</b></button>');
128+
$('.bouton').button();
129+
}
130+
131+
function removeBug (data) {
132+
$('#bug-'+data.id).remove();
133+
}
134+
135+
136+
137+
138+
/////////////////////////////////////////////////////////////// FONCTIONS DES WISHES ////////////////////////////////////////////////////////
139+
140+
function addWish () {
141+
var descr = $('#newWishDescr').val();
142+
var prior = $('#newWishPrio').val();
143+
if (descr == '') {alert("Merci d'être plus précis !");return;}
144+
var strAjax = 'action=addToXML&type=wish&id='+nextIDwish+'&descr='+descr+'&prio='+prior+'&user='+prenomUser;
145+
AjaxJson(strAjax, 'bugHunter_actions', refreshWishList);
146+
}
147+
148+
function refreshWishList (data) {
149+
if (data.error != undefined && data.error != '') {
150+
alert(data.error);
151+
return;
152+
}
153+
nextIDwish++;
154+
$('#wishesList').append('<div class="ui-state-default ui-corner-all pad5 marge15bot" id="wish-'+data.id+'">'+
155+
'<div class="inline top" style="width:130px;"><i>par <b>'+data.by+'</b></i></div>'+
156+
'<div class="inline top mini" style="width:90px;">Priorité <b>'+data.prio+'</b>/10</div>'+
157+
'<div class="inline top">'+data.descr+'</div>'+
158+
'<br />'+
159+
'<div class="fixerDiv inline top mini" style="width:220px;">'+
160+
data.mailSent +
161+
'</div>'+
162+
'</div>');
163+
$('#dialogWish').dialog("close");
164+
}
165+
166+
function showWishFixer (data) {
167+
if (data.error != undefined && data.error != '') {
168+
alert(data.error);
169+
return;
170+
}
171+
$('#wish-'+data.id).children('.fixerDiv')
172+
.html('<span class="ui-state-error ui-corner-all" style="padding:1px;"><b>'+data.fixer+'</b> s\'en occupe</span>');
173+
if (data.fixer == prenomUser)
174+
$('#wish-'+data.id).children('.fixerDiv')
175+
.append('<br /><button class="ui-state-error bouton wishKiller margeTop5" wish="'+data.id+'"><b>DONE ?</b></button>');
176+
$('.bouton').button();
177+
}
178+
179+
function removeWish (data) {
180+
$('#wish-'+data.id).remove();
181+
}

bugHunter/bugs.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<bugs>
3+
<bugList/>
4+
</bugs>

0 commit comments

Comments
 (0)