mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-07 07:06:26 +02:00
list contacts with extended infos
This commit is contained in:
parent
0072a8b2f8
commit
e3a2dc29df
2 changed files with 34 additions and 12 deletions
|
@ -5,7 +5,7 @@
|
||||||
class contacts extends Controller
|
class contacts extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Cette fonction est appelée avant toute les autres :
|
* Cette fonction est appelée avant toute les autres :
|
||||||
* Elle vérifie que l'utilisateur est bien connecté
|
* Elle vérifie que l'utilisateur est bien connecté
|
||||||
* @return void;
|
* @return void;
|
||||||
*/
|
*/
|
||||||
|
@ -16,14 +16,18 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cette fonction retourne tous les contacts, sous forme d'un tableau permettant l'administration de ces contacts
|
* Cette fonction retourne tous les contacts, sous forme d'un tableau permettant l'administration de ces contacts
|
||||||
*/
|
*/
|
||||||
public function byDefault()
|
public function byDefault()
|
||||||
{
|
{
|
||||||
//Creation de l'object de base de données
|
//Creation de l'object de base de données
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
//Recupération des nombres des 4 panneaux d'accueil
|
//Recupération des nombres des 4 panneaux d'accueil
|
||||||
$contacts = $db->getFromTableWhere('contacts');
|
$contacts = $db->getFromTableWhere('contacts', array(), '', false, false, false, array(array(
|
||||||
|
'table' => 'contacts_infos',
|
||||||
|
'type' => 'LEFT',
|
||||||
|
'on' => 'contacts_infos.id_contact = contacts.id'
|
||||||
|
)));
|
||||||
|
|
||||||
$this->render('contacts/default', array(
|
$this->render('contacts/default', array(
|
||||||
'contacts' => $contacts,
|
'contacts' => $contacts,
|
||||||
|
@ -52,7 +56,7 @@
|
||||||
|
|
||||||
//Create de l'object de base de données
|
//Create de l'object de base de données
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$db->deleteContactsIn($ids);
|
$db->deleteContactsIn($ids);
|
||||||
header('Location: ' . $this->generateUrl('contacts'));
|
header('Location: ' . $this->generateUrl('contacts'));
|
||||||
return true;
|
return true;
|
||||||
|
@ -76,7 +80,7 @@
|
||||||
|
|
||||||
//On récupère les ids comme étant tous les arguments de la fonction
|
//On récupère les ids comme étant tous les arguments de la fonction
|
||||||
$ids = func_get_args();
|
$ids = func_get_args();
|
||||||
|
|
||||||
$contacts = $db->getContactsIn($ids);
|
$contacts = $db->getContactsIn($ids);
|
||||||
$this->render('contacts/edit', array(
|
$this->render('contacts/edit', array(
|
||||||
'contacts' => $contacts,
|
'contacts' => $contacts,
|
||||||
|
@ -180,7 +184,7 @@
|
||||||
public function jsonGetContacts()
|
public function jsonGetContacts()
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
echo json_encode($db->getFromTableWhere('contacts'));
|
echo json_encode($db->getFromTableWhere('contacts'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,17 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Nom</th>
|
<?php if (RASPISMS_SETTINGS_EXTENDED_CONTACTS_INFOS) { ?>
|
||||||
<th>Numéro</th>
|
<th>Civilité</th>
|
||||||
|
<th>Prénom</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th>Numéro</th>
|
||||||
|
<th>Date de naissance</th>
|
||||||
|
<th>Situation</th>
|
||||||
|
<?php } else { ?>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th>Numéro</th>
|
||||||
|
<?php } ?>
|
||||||
<th style="width:5%;">Sélectionner</th>
|
<th style="width:5%;">Sélectionner</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -51,8 +60,17 @@
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php secho($contact['id']); ?></td>
|
<td><?php secho($contact['id']); ?></td>
|
||||||
<td><?php secho($contact['name']); ?></td>
|
<?php if (RASPISMS_SETTINGS_EXTENDED_CONTACTS_INFOS) { ?>
|
||||||
<td><?php secho($contact['number']); ?></td>
|
<td><?php secho($contact['civility']); ?></td>
|
||||||
|
<td><?php secho($contact['first_name']); ?></td>
|
||||||
|
<td><?php secho($contact['last_name'] ? $contact['last_name'] : $contact['name']); ?></td>
|
||||||
|
<td><?php secho($contact['number']); ?></td>
|
||||||
|
<td><?php secho($contact['birthday']); ?></td>
|
||||||
|
<td><?php secho($contact['love_situation']); ?></td>
|
||||||
|
<?php } else { ?>
|
||||||
|
<td><?php secho($contact['name']); ?></td>
|
||||||
|
<td><?php secho($contact['number']); ?></td>
|
||||||
|
<?php } ?>
|
||||||
<td><input type="checkbox" value="<?php secho($contact['id']); ?>"></td>
|
<td><input type="checkbox" value="<?php secho($contact['id']); ?>"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
@ -66,7 +84,7 @@
|
||||||
<a class="btn btn-success" href="<?php echo $this->generateUrl('contacts', 'add'); ?>"><span class="fa fa-plus"></span> Ajouter un contact</a>
|
<a class="btn btn-success" href="<?php echo $this->generateUrl('contacts', 'add'); ?>"><span class="fa fa-plus"></span> Ajouter un contact</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right col-xs-6 no-padding">
|
<div class="text-right col-xs-6 no-padding">
|
||||||
<strong>Action groupée :</strong>
|
<strong>Action groupée :</strong>
|
||||||
<div class="btn-group action-dropdown" target="#table-contacts">
|
<div class="btn-group action-dropdown" target="#table-contacts">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action pour la sélection <span class="caret"></span></button>
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action pour la sélection <span class="caret"></span></button>
|
||||||
<ul class="dropdown-menu pull-right" role="menu">
|
<ul class="dropdown-menu pull-right" role="menu">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue