Revisión 411
Añadido por Francisco Damián Méndez Palma hace más de 12 años
controlies/trunk/applications/controlies/views/reports/users.html | ||
---|---|---|
{{response.files.append(URL('static','js/utils.js'))}}
|
||
|
||
{{extend 'layout.html'}}
|
||
<script>
|
||
$(function() {
|
||
$("#tabsSearch").tabs().css("font-size","13px");
|
||
$("#buttonReport")
|
||
.button({ icons: { primary: "ui-icon-document"}})
|
||
.click( function(){ report(); });
|
||
|
||
getGroups();
|
||
showFields();
|
||
})
|
||
|
||
function getGroups(){
|
||
jQuery.get("call/json/getClassrooms",
|
||
function(data){
|
||
jQuery.each(data.classrooms, function(i,item){
|
||
jQuery("#classroom").append("<option value='"+item+"'>"+item+"</option>");
|
||
});
|
||
}
|
||
);
|
||
}
|
||
|
||
function restartStyle(){
|
||
jQuery('#messageReport').html("");
|
||
}
|
||
|
||
function report(){
|
||
restartStyle();
|
||
jQuery.ajax({url:"report",data:jQuery("#form_authorization").serialize()})
|
||
.done(function ( data ){
|
||
switch(data){
|
||
case 'noPeople':{
|
||
jQuery('#messageReport').html("No se han encontrado datos").effect("highlight", {"color":"yellow"}, 1000);
|
||
break
|
||
}
|
||
default: eval(data);
|
||
}
|
||
}
|
||
);
|
||
}
|
||
|
||
function hideAllFields(){
|
||
restartStyle();
|
||
jQuery("#form_authorization #searchTD").hide();
|
||
jQuery("#form_authorization #classroomsTD").hide();
|
||
}
|
||
|
||
function showFields(){
|
||
hideAllFields();
|
||
switch(jQuery("#form_authorization #id_user_type").val()){
|
||
case '1':{ // Profesores
|
||
jQuery("#form_authorization #searchTD").show();
|
||
break;
|
||
}
|
||
case '2':{
|
||
jQuery("#form_authorization #classroomsTD").show();
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<form id="form_authorization">
|
||
<table width="100%" cellspacing="12">
|
||
<tr>
|
||
<td>
|
||
<div id="tabsSearch">
|
||
<ul>
|
||
<li><a href="#tabs-1"><span id="actions">Listados de Usuarios</span></a></li>
|
||
</ul>
|
||
<div id="tabs-1" style="padding:3px;">
|
||
<table style="width:100%">
|
||
<tr>
|
||
<td>
|
||
Tipo usuario<br>
|
||
<select id="id_user_type" name="id_user_type" onChange="javascript:showFields();">
|
||
<option value="1">Profesores</option>
|
||
<option value="2">Alumnos</option>
|
||
</select>
|
||
</td>
|
||
<td id="classroomsTD">
|
||
Curso<br><select id="classroom" name="classroom"></select>
|
||
</td>
|
||
<td id="searchTD">
|
||
Filtro<br><input type="text" id="search" name="search"/>
|
||
</td>
|
||
<td>
|
||
Tipo Informe<br>
|
||
<select id="report_type" name="report_type">
|
||
<option value="listado">Listado de Usuarios (Nombre y Username)</option>
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="4" style="text-align:center;">
|
||
<br><div id="messageReport" style="text-align:center; font-weight:bold; color:red; padding:3px; "></div>
|
||
<button type="button" id="buttonReport">Generar informe</button>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</form>
|
||
|
||
<div id="dialog-details"></div>
|
controlies/trunk/applications/controlies/controllers/reports.py | ||
---|---|---|
def laptops():
|
||
return dict()
|
||
|
||
def users():
|
||
return dict()
|
||
|
||
@service.json
|
||
def getClassrooms():
|
||
import applications.controlies.modules.Utils.LdapUtils as LdapUtils
|
controlies/trunk/applications/controlies/models/menu.py | ||
---|---|---|
|
||
response.menu+=[('Informes', False, None,[
|
||
('Compromisos Portátiles', False,URL( 'reports', 'laptops')),
|
||
('Usuarios', False,URL( 'reports', 'users')),
|
||
]
|
||
)]
|
||
|
Exportar a: Unified diff
Informes de Usuarios