Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
[WIP] Show SQL et compagnies (#761)
Browse files Browse the repository at this point in the history
* Bottom without sql

* Syntax 1

* Factorisation headers

* Factorisation bottom

* Good header

* Unused fonctions

* Unused 2

* Move test to Tests

* Suite review

* Syntax (codacy)

* Refacto index

* Added css

* Functions

* Review codacy

* Closed scope config

* Scope utilisateur

* Scope responsable

* Scope config export hr

* Scope edition
  • Loading branch information
prytoegrian authored Dec 27, 2018
1 parent 1e3b0ff commit cd4e2b6
Show file tree
Hide file tree
Showing 38 changed files with 2,363 additions and 2,916 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
debug/
cfg/env.php
cfg/dbconnect.php
cfg/config_ldap.php
Expand Down
1 change: 0 additions & 1 deletion App/ProtoControllers/Groupe/Gestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Gestion {
*/
public function postHtmlCommon(array $post, array &$errorLst)
{
$user = $_SESSION['userlogin'];
$data = $this->FormData2Array($post);
$return = 1;

Expand Down
2 changes: 1 addition & 1 deletion App/ProtoControllers/Groupe/Responsable.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function getListResponsableByGroupeIds(array $groupeIds)
$respLogin = [];
while ($data = $query->fetch_array()) {
$login = $data['gr_login'];
if(!in_array($login, $respLogin)) {
if (!in_array($login, $respLogin)) {
$respLogin[] = $login;
}
}
Expand Down
2 changes: 1 addition & 1 deletion App/ProtoControllers/Utilisateur.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function getListId($activeSeul = false)
$sql = \includes\SQL::singleton();
$req = 'SELECT u_login
FROM conges_users';
if ($activeSeul){
if ($activeSeul) {
$req .= ' WHERE u_is_active = "Y"';
}
$req .= ' ORDER BY u_nom ASC, u_prenom ASC';
Expand Down
2 changes: 1 addition & 1 deletion App/Tools/libraries
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define('LAST_VERSION_FILE', '/tmp/lt-last-version');
define('LOCALE_PATH', ROOT_PATH . 'locale/');

require_once ROOT_PATH . 'vendor/autoload.php';
require_once INCLUDE_PATH . 'fonctions_conges.php';
require_once INCLUDE_PATH . 'fonctions.php';
if (is_file(CONFIG_PATH . 'dbconnect.php')) {
require_once CONFIG_PATH . 'dbconnect.php';
}
Expand Down
2 changes: 1 addition & 1 deletion App/Views/JourFerie/Liste.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
?>
<h1> <?= $title ?></h1>
<div class="pager">
<div class="onglet calendar-nav">
<div class="calendar-nav">
<ul>
<li><a href="<?= $prev_link ?>" class="calendar-prev"><i class="fa fa-chevron-left"></i><span>année précédente</span></a></li>
&nbsp;<li class="current-year"><?= $annee ?></li>
Expand Down
2 changes: 1 addition & 1 deletion App/Views/Responsable/AjoutAbsence.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</tr>
<?php endforeach ?>
<tr align="center"><td class="histo" style="background-color: #CCC;" colspan="50"><i><?= _('resp_etat_users_titre_double_valid') ?></i></td></tr>
<?php foreach($subalternesActifsGrandResponsable as $login => $donneesSubalterne) : ?>
<?php foreach ($subalternesActifsGrandResponsable as $login => $donneesSubalterne) : ?>
<tr>
<td><?= $tab_current_user['nom'] ?></td>
<td><?= $tab_current_user['prenom'] ?></td>
Expand Down
74 changes: 1 addition & 73 deletions Public/Assets/Css/reboot.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,79 +227,7 @@ content-title {
font-weight: bold;
margin: 0
}
#onglet_menu {
overflow: hidden
}
#onglet_menu .onglet {
font-size: 14px;
font-size: 1.4rem;
border-bottom: #eceff6 1px solid;
float: left;
text-align: center;
line-height: 40px
}
#onglet_menu .onglet .current-year {
color: #00aad4
}
#onglet_menu .onglet.active {
border-bottom: transparent;
font-weight: bold
}
#onglet_menu .onglet.active a {
background-color: #fff
}
#onglet_menu .onglet:first-child a {
border-left: none
}
#onglet_menu .onglet a {
display: block;
text-align: center;
color: #6e6e6e;
background-color: #f6f8fb;
border-left: solid 1px #eceff6;
-webkit-transition: background-color, 1s, ease-out;
-moz-transition: background-color, 1s, ease-out;
-o-transition: background-color, 1s, ease-out;
transition: background-color, 1s, ease-out
}
#onglet_menu .onglet a:hover {
text-decoration: none;
background-color: #fff
}
#onglet_menu .onglet a .current-year {
color: #00aad4
}
#onglet_menu .onglet.calendar-nav {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f6f8fb;
border-left: solid 1px #eceff6
}
#onglet_menu .onglet.calendar-nav ul {
float: right;
margin: 0 20px;
padding: 0
}
#onglet_menu .onglet.calendar-nav ul li {
padding: 0 5px;
margin: 0;
list-style-type: none;
float: left
}
#onglet_menu .onglet.calendar-nav ul li a {
border: none;
padding: 0 5px;
color: #00aad4
}
#onglet_menu .onglet.calendar-nav ul li a span {
display: none
}
#onglet_menu .onglet.calendar-nav ul li.current-year {
color: #00aad4;
line-height: 40px;
font-weight: bold
}

.main-content {
padding: 20px
}
Expand Down
2 changes: 2 additions & 0 deletions Public/template/bottom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
</body>
</html>
44 changes: 2 additions & 42 deletions Public/template/error_bottom.php
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
<?php
$querys = \includes\SQL::getQuerys();
$total = 0;
?>
</div>
<footer>
<?php if(SHOW_SQL): ?>
<div id="show-sql">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>Time</th>
<th>Total</th>
<th>Results</th>
<th>File</th>
<th>Line</th>
<th>Query</th>
</tr>
</thead>
<tbody>
<?php
foreach ($querys as $num => $v):
$time = $v['t2'] - $v['t1'];
$total += $time;
?>
<tr>
<td><?= $num ?></td>
<td><?= $time ?></td>
<td><?= $total ?></td>
<td><?= $v['results'] ?></td>
<td><?= $v['back']['file'] ?></td>
<td><?= $v['back']['line'] ?></td>
<td><?= $v['query'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</footer>
</body>
</html>
<?php
include_once 'bottom.php';
54 changes: 1 addition & 53 deletions Public/template/error_header.php
Original file line number Diff line number Diff line change
@@ -1,58 +1,6 @@
<?php
defined( '_PHP_CONGES' ) or die( 'Restricted access' );
include TEMPLATE_PATH . 'template_define.php';
global $environnement;
include_once 'header.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?= $title ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php /* FAVICONS */ ?>
<link rel="apple-touch-icon" href="<?= IMG_PATH ?>Favicons/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="57x57" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?= IMG_PATH ?>Favicons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?= IMG_PATH ?>Favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="<?= IMG_PATH ?>Favicons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="192x192" href="<?= IMG_PATH ?>Favicons/android-chrome-192x192.png">
<link rel="manifest" href="<?= IMG_PATH ?>Favicons/manifest.json">
<link rel="mask-icon" href="<?= IMG_PATH ?>Favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="<?= IMG_PATH ?>Favicons/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<?php /* JQUERY */ ?>
<?php /* BOOTSTRAP */?>
<link type="text/css" href="<?= NODE_PATH ?>bootstrap/dist/css/bootstrap.min.css?v=<?= $config_php_conges_version ?>" rel="stylesheet" media="screen">
<?php /* FONT AWESOME */ ?>
<link href="<?= ASSETS_PATH ?>font-awesome/css/font-awesome.min.css?v=<?= $config_php_conges_version ?>" rel="stylesheet">
<?php /* REBOOT STYLE */ ?>
<link type="text/css" href="<?= CSS_PATH ?>reboot.css?v=<?= $config_php_conges_version ?>" rel="stylesheet" media="screen">
<?php /* SCRIPTS */ ?>
<script>
var _rollbarConfig = {
accessToken: "<?= LOGGER_TOKEN ?>",
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment: "<?= $environnement ?>",
code_version : "<?= $config_php_conges_version ?>"
}
};
</script>
<script type="text/javascript" src="<?= JS_PATH ?>rollbar.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= NODE_PATH ?>jquery/dist/jquery.min.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= JS_PATH ?>reboot.js?v=<?= $config_php_conges_version ?>"></script>
<?= $additional_head; ?>
</head>
<body class="error">
<header><h1 class="login-heading">Libertempo</h1></header>
<div class="container">
Expand Down
71 changes: 71 additions & 0 deletions Public/template/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
defined( '_PHP_CONGES' ) or die( 'Restricted access' );
include TEMPLATE_PATH . 'template_define.php';
global $environnement;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?= $title; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php /* FAVICONS */ ?>
<link rel="apple-touch-icon" href="<?= IMG_PATH ?>Favicons/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="57x57" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="<?= IMG_PATH ?>Favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?= IMG_PATH ?>Favicons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?= IMG_PATH ?>Favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="<?= IMG_PATH ?>Favicons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="192x192" href="<?= IMG_PATH ?>Favicons/android-chrome-192x192.png">
<link rel="manifest" href="<?= IMG_PATH ?>Favicons/manifest.json">
<link rel="mask-icon" href="<?= IMG_PATH ?>Favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="<?= IMG_PATH ?>Favicons/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<?php /* BOOTSTRAP */?>
<link type="text/css" href="<?= NODE_PATH ?>bootstrap/dist/css/bootstrap.min.css?v=<?= $config_php_conges_version ?>" rel="stylesheet" media="screen,print">
<link type="text/css" href="<?= NODE_PATH ?>bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css?v=<?= $config_php_conges_version ?>" rel="stylesheet" media="screen">
<link type="text/css" href="<?= NODE_PATH ?>bootstrap-timepicker/css/bootstrap-timepicker.min.css?v=<?= $config_php_conges_version ?>" rel="stylesheet" media="screen" />
<?php /* FONT AWESOME */ ?>
<link href="<?= ASSETS_PATH ?>font-awesome/css/font-awesome.min.css?v=<?= $config_php_conges_version ?>" rel="stylesheet">
<?php /* REBOOT STYLE */ ?>
<link type="text/css" href="<?= CSS_PATH ?>reboot.css?v=<?= $config_php_conges_version ?>" rel="stylesheet" media="screen,print">
<?php /* JQUERY */ ?>
<script>
var _rollbarConfig = {
accessToken: "<?= LOGGER_TOKEN ?>",
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment: "<?= $environnement ?>",
code_version : "<?= $config_php_conges_version ?>"
}
};
</script>
<script type="text/javascript" src="<?= JS_PATH ?>rollbar.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= NODE_PATH ?>jquery/dist/jquery.min.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= NODE_PATH ?>bootstrap/dist/js/bootstrap.min.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= NODE_PATH ?>bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= NODE_PATH ?>bootstrap-datepicker/dist/locales/bootstrap-datepicker.fr.min.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= NODE_PATH ?>bootstrap-timepicker/js/bootstrap-timepicker.min.js?v=<?= $config_php_conges_version ?>"></script>
<script type="text/javascript" src="<?= JS_PATH ?>reboot.js?v=<?= $config_php_conges_version ?>"></script>
<script language="JavaScript" type="text/javascript">
<!--
// Les cookies sont obligatoires
if (! navigator.cookieEnabled) {
document.write("<font color=\'#FF0000\'><br><br><center>'. _('cookies_obligatoires') .'</center></font><br><br>");
}
//-->
</script>
<noscript>
<font color="#FF0000"><br><br><center>'. _('javascript_obligatoires') .'</center></font><br><br>
</noscript>
<?= $additional_head ?>
</head>
41 changes: 1 addition & 40 deletions Public/template/login_bottom.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,2 @@
<?php
$querys = \includes\SQL::getQuerys();
$total = 0;
?>
<footer>
<?php if(SHOW_SQL): ?>
<div id="show-sql">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>Time</th>
<th>Total</th>
<th>Results</th>
<th>File</th>
<th>Line</th>
<th>Query</th>
</tr>
</thead>
<tbody>
<?php foreach($querys as $num => $v):
$time = $v['t2'] - $v['t1'];
$total += $time;
?>
<tr>
<td><?= $num ?></td>
<td><?= $time ?></td>
<td><?= $total ?></td>
<td><?= $v['results'] ?></td>
<td><?= $v['back']['file'] ?></td>
<td><?= $v['back']['line'] ?></td>
<td><?= $v['query'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</footer>
</body>
</html>
include_once 'bottom.php';
Loading

0 comments on commit cd4e2b6

Please sign in to comment.