Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-neil committed Dec 18, 2023
2 parents 7d44508 + 7f23a64 commit 24142d4
Show file tree
Hide file tree
Showing 13 changed files with 494 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

.idea/

composer.lock
symfony.lock

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Confcall
This file keep track of the changes.

## UNRELEASED

# [1.1.0] - 2023-12-18
### ADDED
- Ajout des templates manquants

# [1.0.0] - 2023-01-01
- Initial project
33 changes: 33 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bin/.phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
>
<php>
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="7.5" />
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
7 changes: 5 additions & 2 deletions src/Service/AsteriskApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ class AsteriskApi {
public static string $ASTERISK_DEL_CMD = 'database del conf ';
public static string $ASTERISK_ADD_CMD = 'database put conf ';

public static function cron() {
/**
* @return void
*/
public static function cron(): void {
$today = date('d-m-Y G:i:s');

foreach(AsteriskAPI::getConfList() as $call) {
Expand All @@ -23,7 +26,7 @@ public static function cron() {
* Delete a conference by his id
* @param $id string|int The conference ID to delete
*/
public static function deleteConference($id) {
public static function deleteConference($id): void {
$asm = new AGI_AsteriskManager();

if($asm->connect()) {
Expand Down
121 changes: 121 additions & 0 deletions templates/admin.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{% extends 'base.html.twig' %}

{% block javascripts %}
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="https://kit.fontawesome.com/a88882c5e9.js" crossorigin="anonymous"></script>
<script src="{{ asset('assets/js/util.js') }}"></script>
<script src="{{ asset('assets/js/jquery.toast.min.js') }}"></script>
<script src="{{ asset('assets/js/util.js') }}"></script>
{% endblock %}

{% block title %}Tableau de bord{% endblock %}

{% block body %}
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Utilisateur {{ app.user.username }}</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="/">Liste des conférences</a></li>
</ul>
</div>
</div>
</nav>

<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<img src="{{ asset('assets/img/logo.jpg') }}" class="logo" alt="Logo du centre hospitalier">
<ul class="nav nav-sidebar">
<li class="active"><a href="#">Vue globale <span class="sr-only">(current)</span></a></li>
</ul>
<p>Bonjour {{ app.user.extraFields.givenName }} {{ app.user.extraFields.sn }}</p>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h1 class="page-header">Tableau de bord</h1>
<p><button class="btn btn-danger" onclick="flush()">Purger la base</button></p>
<h2 class="sub-header">Conférences planifiées</h2>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Numéro</th>
<th>Utilisateur</th>
<th>Date</th>
<th>Heure de début</th>
<th>Heure de fin</th>
<th>Durée</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% if calls is empty %}
<p>Aucune conférence</p>
{% else %}
{% for call in calls %}
{% set diff = date(call.end).diff(date(call.start)) %}
<tr>
<td>{{ call.id }}</td>
<td>{{ call.user }}</td>
<td>
{% if (call.creation is null) %}
Aujourd'hui
{% else %}
{{ call.start|date("d-m-Y") }}
{% endif %}
</td>
<td>{{ call.start|date("H:i")}}</td>
<td>{{ call.end|date("H:i")}}</td>
<td>{{ diff.h }}h{{ "%02d"|format(diff.i) }}</td>
<td>
<a href="{{ path('del_conf', {"id": call.id} ) }}">Supprimer</a>
</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
<h2 class="sub-header">Conférences en cours</h2>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Identifiant</th>
<th>Nombre d'utilisateurs connectés</th>
</tr>
</thead>
<tbody>
{% if confs is empty %}
<tr>
<td colspan="2">Aucunne conférence en cours</td>
</tr>
{% else %}
{% for conf in confs %}
<tr>
<td>{{ conf.id }}</td>
<td>{{ conf.nb }}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
<p><a href="#" onclick="document.location.reload()">Rafraichir la liste</a></p>
</div>
</div>
</div>
</div>
{% endblock %}

21 changes: 21 additions & 0 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Welcome!{% endblock %}</title>

<link rel="stylesheet" href="{{ asset('assets/css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ asset('assets/css/dashboard.css') }}">
<link rel="stylesheet" href="{{ asset('assets/css/jquery-toast-plugin.css') }}">

{% block stylesheets %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<script src="{{ asset('assets/js/jquery.min.js') }}"></script>
<script src="{{ asset('assets/js/jquery.toast.min.js') }}"></script>
{% block javascripts %}{% endblock %}
</body>
</html>
5 changes: 5 additions & 0 deletions templates/emails/invitation.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{# templates/email.html.twig #}
<p>Madame, Monsieur,</p>
<p>vous trouverez l'invitation en pièce jointe.</p>
<br>
<p><small>Message envoyé automatiquement à partir d'une adresse qui ne peut pas recevoir de mails.</small></p>
Loading

0 comments on commit 24142d4

Please sign in to comment.