Commit 012d5473 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by Admin Y Strator

Fix : afffichage erroné de la fin de co + réparation formulaire de recherche machine

parent be346e1b
......@@ -6,11 +6,11 @@ from django.utils.translation import ugettext_lazy as _
class BaseForm(forms.Form):
""" Formulaire de recherche pour le cableur """
uid = forms.CharField(label=u'Login', max_length=40, required=False)
chbre = forms.CharField(label=_(u'Chambre'), max_length=5, required=False)
chambre = forms.CharField(label=_(u'Chambre'), max_length=5, required=False)
nom = forms.CharField(label=_(u'Nom'), max_length=40, required=False)
class AdherentForm(BaseForm):
tel = forms.CharField(label=_(u'Téléphone'), max_length=10, required=False)
telephone = forms.CharField(label=_(u'Téléphone'), max_length=10, required=False)
aid = forms.IntegerField(label=u'Aid', required=False)
prenom = forms.CharField(label=_(u'Prénom'), max_length=40, required=False)
mail = forms.EmailField(label=u'Mail', required=False)
......@@ -19,13 +19,16 @@ class AdherentForm(BaseForm):
class FactureForm(forms.Form):
fid = forms.IntegerField(label=u'Fid', required=False)
class ClubForm(BaseForm):
class ClubForm(forms.Form):
uid_club = forms.CharField(label=u'Login', max_length=40, required=False)
local = forms.CharField(label=_(u'Local'), max_length=5, required=False)
nom_club = forms.CharField(label=_(u'Nom'), max_length=40, required=False)
cid = forms.IntegerField(label=u'Cid', required=False)
class MachineForm(forms.Form):
host = forms.CharField(label=_(u'Nom de machine'), max_length=40, required=False)
macAddress = forms.CharField(label=u'Mac', max_length=17, required=False)
ipHostNumber = forms.CharField(label=u'IP', max_length=16, required=False)
mac_address = forms.CharField(label=u'Mac', max_length=17, required=False)
ip_host_number = forms.CharField(label=u'IP', max_length=16, required=False)
mid = forms.IntegerField(label=u'Mid', required=False)
......
......@@ -144,10 +144,10 @@
{{ adherentform.prenom.help_text }}
</div>
<div class="three columns">
{{ adherentform.tel.label_tag }}
{{ adherentform.tel }}
{{ adherentform.tel.errors }}
{{ adherentform.tel.help_text }}
{{ adherentform.telephone.label_tag }}
{{ adherentform.telephone }}
{{ adherentform.telephone.errors }}
{{ adherentform.telephone.help_text }}
</div>
<div class="three columns">
{{ adherentform.mail.label_tag }}
......@@ -159,10 +159,10 @@
</div>
<div class="row">
<div class="three columns">
{{ adherentform.chbre.label_tag }}
{{ adherentform.chbre }}
{{ adherentform.chbre.errors }}
{{ adherentform.chbre.help_text }}
{{ adherentform.chambre.label_tag }}
{{ adherentform.chambre }}
{{ adherentform.chambre.errors }}
{{ adherentform.chambre.help_text }}
</div>
<div class="three columns">
{{ adherentform.aid.label_tag }}
......@@ -183,16 +183,16 @@
<h2>{% trans "Filtre club" %}</h2>
<div class="row">
<div class="three columns">
{{ clubform.nom.label_tag }}
{{ clubform.nom }}
{{ clubform.nom.errors }}
{{ clubform.nom.help_text }}
{{ clubform.nom_club.label_tag }}
{{ clubform.nom_club }}
{{ clubform.nom_club.errors }}
{{ clubform.nom_club.help_text }}
</div>
<div class="three columns">
{{ clubform.chbre.label_tag }}
{{ clubform.chbre }}
{{ clubform.chbre.errors }}
{{ clubform.chbre.help_text }}
{{ clubform.local.label_tag }}
{{ clubform.local }}
{{ clubform.local.errors }}
{{ clubform.local.help_text }}
</div>
<div class="three columns">
{{ clubform.cid.label_tag }}
......@@ -201,10 +201,10 @@
{{ clubform.cid.help_text }}
</div>
<div class="three columns">
{{ clubform.uid.label_tag }}
{{ clubform.uid }}
{{ clubform.uid.errors }}
{{ clubform.uid.help_text }}
{{ clubform.uid_club.label_tag }}
{{ clubform.uid_club }}
{{ clubform.uid_club.errors }}
{{ clubform.uid_club.help_text }}
</div>
</div>
{% endif %}
......@@ -219,16 +219,16 @@
{{ machineform.host.help_text }}
</div>
<div class="three columns">
{{ machineform.macAddress.label_tag }}
{{ machineform.macAddress }}
{{ machineform.macAddress.errors }}
{{ machineform.macAddress.help_text }}
{{ machineform.mac_address.label_tag }}
{{ machineform.mac_address }}
{{ machineform.mac_address.errors }}
{{ machineform.mac_address.help_text }}
</div>
<div class="three columns">
{{ machineform.ipHostNumber.label_tag }}
{{ machineform.ipHostNumber }}
{{ machineform.ipHostNumber.errors }}
{{ machineform.ipHostNumber.help_text }}
{{ machineform.ip_host_number.label_tag }}
{{ machineform.ip_host_number }}
{{ machineform.ip_host_number.errors }}
{{ machineform.ip_host_number.help_text }}
</div>
<div class="three columns">
{{ machineform.mid.label_tag }}
......
......@@ -24,6 +24,24 @@ else:
use_ldap_admin = lc_ldap.shortcuts.with_ldap_conn(retries=2, delay=5,
constructor=lc_ldap.shortcuts.lc_ldap_admin)
LDAP_FILTER = {
u'uid' : u'uid',
u'chambre' : u'chbre',
u'nom' : u'nom',
u'telephone' : u'tel',
u'prenom' : u'prenom',
u'mail' : u'mail',
u'fid' : u'fid',
u'uid_club' : u'uid',
u'local' : u'chbre',
u'nom_club' : u'nom',
u'cid' : u'cid',
u'host' : u'host',
u'mac_address' : u'macAddress',
u'ip_host_number' : u'ipHostNumber',
u'mid' : u'mid',
}
@login_required
def afficher(request):
""" Accueil de l'interface de cablage """
......@@ -64,7 +82,7 @@ def rechercher(request, ldap, objet):
for champ in formchanged:
valeur = formcleaned[champ]
if valeur != "*":
filtre += u"(%s=%s)" % (champ,valeur)
filtre += u"(%s=%s)" % (LDAP_FILTER[champ],valeur)
if filtre != u"":
donnees = ldap.search(u'(&%s)' % filtre)
# Tri des objets suivant ce qu'on veut à l'arrivée
......
......@@ -42,7 +42,7 @@
{% else %}
<span class="bad-thing">
{% endif %}
{% blocktrans with date_fin=luser.fin_adhesion.value %}
{% blocktrans with date_fin=luser.fin_connexion.value %}
Jusqu'au {{ date_fin }}
{% endblocktrans %}
</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment