dossier_lookup : enter = submit
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="row">
|
||||
<form method="POST" id="frm" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-xs-4">
|
||||
<select class="form-control" id="agenda" name="agenda" onChange="$('#frm').submit()" tal:condition="isCommercial==False">
|
||||
<div tal:repeat="item agendas">
|
||||
<option value="${item.CD_UTI}" tal:attributes="selected agenda==item.CD_UTI and 'selected' or None">${item.NOM}</option>
|
||||
@@ -52,9 +52,9 @@
|
||||
<div class="col-xs-offset-3 col-xs-9">
|
||||
<b>le <span id=dateheureRDV>date</span></b><br />
|
||||
</div>
|
||||
<p>pour la société</p>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-offset-3 col-xs-8">
|
||||
<label class="col-xs-3 control-label">Société</label>
|
||||
<div class="col-xs-8">
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PE" checked>PE</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="ME">ME</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PL">PL</label>
|
||||
@@ -69,8 +69,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Motif</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="col-xs-3 control-label">Motif</label>
|
||||
<div class="col-xs-8">
|
||||
<select class="form-control" id="type_rdv" name="type_rdv">
|
||||
<div tal:repeat="item types_rdv">
|
||||
<option value="${item.LIB}" tal:attributes="selected type_rdv==item.LIB and 'selected' or None">${item.LIB}</option>
|
||||
@@ -82,7 +82,7 @@
|
||||
<input type="hidden" name="heureRDV" id=heureRDV value="heure">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-5 col-sm-offset-4">
|
||||
<div class="col-xs-5 col-xs-offset-4">
|
||||
<button type="submit" class="btn btn-danger" name="form.submitted">Créer</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
|
||||
</div>
|
||||
@@ -162,7 +162,7 @@
|
||||
},
|
||||
});
|
||||
},
|
||||
minLength: 6,
|
||||
minLength: 4,
|
||||
appendTo: "#confirmCreate"
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,29 +12,30 @@
|
||||
data-fv-icon-validating="glyphicon glyphicon-refresh">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-4" for="societe">Sociéte</label>
|
||||
<label class="col-sm-4 control-label">Société</label>
|
||||
<div class="col-xs-8">
|
||||
<select class="form-control" id="societe" name="societe">
|
||||
<div tal:repeat="item societes">
|
||||
<option value="${item}" tal:attributes="selected societe==item and 'selected' or None">${item}</option>
|
||||
</div>
|
||||
</select>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PE"
|
||||
tal:attributes="checked societe=='PE'">PE</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="ME"
|
||||
tal:attributes="checked societe=='ME'">ME</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PL"
|
||||
tal:attributes="checked societe=='PL'">PL</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="PO"
|
||||
tal:attributes="checked societe=='PO'">PO</label>
|
||||
<label class="radio-inline"><input type="radio" name="societe" value="CD"
|
||||
tal:attributes="checked societe=='CD'">CD</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">Nom ou numéro du chantier</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="name" value="${name}"
|
||||
data-fv-stringlength="true"
|
||||
data-fv-stringlength-min="2"
|
||||
data-fv-stringlength-max="30"
|
||||
data-fv-stringlength-message="Le nom ou le numéro doit avoir de 2 à 30 caractères de long" />
|
||||
<input type="text" class="form-control" name="name" value="${name}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button class="btn btn-primary" type="submit" name="form.submitted">
|
||||
<button id="submitButton" class="btn btn-primary" type="submit" name="form.submitted">
|
||||
<span class="glyphicon glyphicon-search"></span> Rechercher</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,9 +100,31 @@
|
||||
});
|
||||
|
||||
});
|
||||
$('#site-search-form').formValidation();
|
||||
$('#site-search-form').formValidation({
|
||||
framework: 'bootstrap',
|
||||
message: 'This value is not valid',
|
||||
icon: {
|
||||
valid: 'glyphicon glyphicon-ok',
|
||||
invalid: 'glyphicon glyphicon-remove',
|
||||
validating: 'glyphicon glyphicon-refresh'
|
||||
},
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: 'Le nom ou le numéro doit avoir de 2 à 30 caractères de long'
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
$('form input').on('keypress', function(e) {
|
||||
return e.which !== 13;
|
||||
var code = e.keyCode || e.which;
|
||||
if (code === 13) {
|
||||
e.preventDefault();
|
||||
// simuler clic bouton submit
|
||||
document.getElementById("submitButton").click();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<th>Email</th>
|
||||
<th>Agenda</th>
|
||||
<th>Fonction</th>
|
||||
<th>Société</th>
|
||||
<th>Etat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -59,7 +59,6 @@ def dossier_lookup(request):
|
||||
|
||||
logged_in = request.authenticated_userid.upper()
|
||||
message = ''
|
||||
societes = ['PE','ME','PL','PO','CD']
|
||||
member = get_member_by_id(request, logged_in)
|
||||
societe_defaut = member.societe
|
||||
societe = societe_defaut
|
||||
@@ -71,10 +70,6 @@ def dossier_lookup(request):
|
||||
if 'form.submitted' in request.params:
|
||||
name = request.params['name']
|
||||
societe = request.params['societe']
|
||||
if access_defaut > 0:
|
||||
societe = request.params['societe']
|
||||
else:
|
||||
societe = societe_defaut
|
||||
|
||||
# lire les chantiers
|
||||
chantiers = get_chantiers_byName(request, societe, name)
|
||||
@@ -97,7 +92,6 @@ def dossier_lookup(request):
|
||||
'goto_url': goto_url,
|
||||
'message': message,
|
||||
'dt_data': json.dumps(liste),
|
||||
'societes': societes,
|
||||
'societe': societe,
|
||||
'name': name,
|
||||
'order_option': order_option,
|
||||
|
||||
@@ -65,7 +65,7 @@ def users_list(request):
|
||||
else:
|
||||
role = 'Gestion'
|
||||
|
||||
d = (item.CD_UTI, item.NOM, item.email, item.agenda, role, etat)
|
||||
d = (item.CD_UTI, item.NOM, item.email, item.agenda, role, item.societe, etat)
|
||||
liste.append(d)
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user