Proyecto

General

Perfil

« Anterior | Siguiente » 

Revisión 399

Reports

Ver diferencias:

controlies/trunk/applications/controlies/models/menu.py
]
)]
response.menu+=[('Informes', False, None,[
('Compromisos Portátiles', False,URL( 'reports', 'laptops_authorization')),
]
)]
response.menu+=[('Acerca de', False, 'javascript:showInfo()')]
controlies/trunk/applications/controlies/views/reports/laptops_authorization.html
{{response.files.append(URL('static','js/utils.js'))}}
{{extend 'layout.html'}}
<script>
$(function() {
$("#tabsSearch").tabs().css("font-size","13px");
getGroups();
})
function getGroups(){
jQuery.post("call/json/getClassrooms",
function(data){
jQuery.each(data.classrooms, function(i,item){
jQuery("#classrooms").append("<option value='"+item+"'>"+item+"</option>");
});
}
);
}
function report(){
jQuery.ajax("report")
.done(function ( data ){
eval(data);
}
);
}
</script>
<table width="100%" cellspacing="12">
<tr>
<td>
<div id="tabsSearch">
<ul>
<li><a href="#tabs-1"><span id="actions">Compromisos portátiles</span></a></li>
</ul>
<div id="tabs-1" style="padding:3px;">
<table>
<tr>
<td HEIGHT="200PX">
Tipo usuario
<select id="user_type" name="user_type">
<option>Profesores</option>
<option>Alumnos</option>
</select>
</td>
<td>
Filtro
<input type="text" id="search" name="search"/>
</td>
<td>
Curso
<select multiple="multiple" size="20" id="classrooms" name="classrooms[]"></select>
</td>
<td>
<input type="button" value="Generar listado" onClick="javascript:report();">
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
<div id="dialog-details"></div>
controlies/trunk/applications/controlies/views/gestion/servidores_aula.html
</div>
</td></tr>
</table>-->
<table width="100" cellspacing="12">
<table width="100%" cellspacing="12">
<tr>
<td>
<div id="tabsServers">
controlies/trunk/applications/controlies/languages/es-es.py
'application "%s" uninstalled': 'aplicación "%s" desinstalada',
'application compiled': 'aplicación compilada',
'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada',
'be brave!': 'be brave!',
'cache': 'cache',
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
'cannot create file': 'no es posible crear archivo',
controlies/trunk/applications/controlies/controllers/reports.py
def laptops_authorization():
return dict()
@service.json
def getClassrooms():
import applications.controlies.modules.Utils.LdapUtils as LdapUtils
l=conecta()
response = LdapUtils.getAllGroups(l)
l.close()
return response
@auth.requires_login()
def report():
from gluon.contrib.pyfpdf import FPDF
pdf=FPDF()
pdf.add_page()
pdf.set_font('Arial','B',16)
pdf.cell(40,10,'Hello World at %s!' % request.now)
doc=pdf.output(dest='S')
doc64=embed64(data=doc,extension='application/pdf')
return 'window.location="%s";' % doc64
def call():
"""
exposes services. for example:
http://..../[app]/default/call/jsonrpc
decorate with @services.jsonrpc the functions to expose
supports xml, json, xmlrpc, jsonrpc, amfrpc, rss, csv
"""
session.forget()
return service()

Exportar a: Unified diff