Skip to content

Commit ea9ab2f

Browse files
committed
tag to 2.0.1 fix labels. set new tablet as default
1 parent 44c81fa commit ea9ab2f

10 files changed

+193
-190
lines changed

agility/tablet2/index.php agility/old_tablet/index.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<script src="/agility/scripts/auth.js.php" type="text/javascript" charset="utf-8" > </script>
7979
<script src="/agility/scripts/competicion.js" type="text/javascript" charset="utf-8" > </script>
8080
<script src="/agility/scripts/events.js" type="text/javascript" charset="utf-8" > </script>
81-
<script src="/agility/tablet2/tablet.js" type="text/javascript" charset="utf-8" > </script>
81+
<script src="/agility/old_tablet/tablet.js" type="text/javascript" charset="utf-8" > </script>
8282

8383
<script type="text/javascript" charset="utf-8">
8484
function initialize() {
@@ -261,7 +261,7 @@ class="easyui-validatebox" data-options="required:true,validType:'length[1,255]'
261261
if (p===null) return; // no selection
262262
if (parseInt(p.Inscritos) > parseInt(p.UserLimit)) {
263263
var message='<img src="/agility/images/sad_dog.png" width="100" alt="sad dog" style="float:right;"/>'+
264-
'<p style="font-weight:bold;">Los permisos de la licencia instalada<br/> ' +
264+
'<p style="font-weight:bold;">Los permisos de la licencia instalada<br /> ' +
265265
'no permiten la gesti&oacute;n de pruebas</br> con m&aacute;s de '+p.UserLimit+' inscripciones</p>';
266266
$.messager.alert({
267267
title: 'Access denied',
@@ -377,12 +377,12 @@ function() {
377377
workingData.datosSesion=s;
378378
workingData.nombreJornada=j.Nombre;
379379
// jornadas "normales", equipos3 y Open comparten el mismo fichero
380-
var page="/agility/tablet2/tablet_main.php";
380+
var page="/agility/tablet/tablet_competicion.php";
381381
if (workingData.datosJornada.Equipos4==1) {
382-
page="/agility/tablet2/tablet_main.php"; // parche temporal
382+
page="/agility/tablet/tablet_competicion.php"; // parche temporal
383383
}
384384
if (workingData.datosJornada.KO==1) {
385-
page="/agility/tablet2/tablet_main_ko.php";
385+
page="/agility/tablet/tablet_competicion_ko.php";
386386
}
387387
$('#seltablet-dialog').dialog('close');
388388
// and load page
@@ -392,8 +392,6 @@ function(response,status,xhr){
392392
if (status=='error') $('#tablet_contenido').load('/agility/frm_notavailable.php');
393393
// start event manager
394394
startEventMgr(workingData.sesion,tablet_processEvents);
395-
setDataEntryEnabled(false);
396-
$('#tablet-layout').layout('panel','west').panel('setTitle',p.Nombre+" - "+ j.Nombre);
397395
}
398396
); // load
399397
} // close dialog; open main window

agility/tablet2/tablet.js agility/old_tablet/tablet.js

+29-122
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,14 @@ function tandasStyler(val,row,idx) {
2222
return str;
2323
}
2424

25-
/******************* funciones de manejo del panel de orden de tandas y orden de salida en el tablet *******************/
25+
/******************* funciones de manejo de las ventana de orden de tandas y orden de salida en el tablet *******************/
2626

27-
/**
28-
* expande/contrae activa/desactiva entrada de datos en el tablet
29-
* @param {boolean} flag true if activate; false on deactivate
30-
*/
31-
function setDataEntryEnabled(flag) {
32-
$('#tdialog-fieldset').prop('disabled',!flag);
33-
if (flag) $('#tablet-layout').layout('collapse','west');
34-
else $('#tablet-layout').layout('expand','west');
27+
function tablet_showOrdenSalida() {
28+
$('#tablet-window').window('open');
29+
$('#tdialog-window').window('close');
3530
}
3631

37-
/******************* funciones de manejo del panel de entrada de resultados del tablet *****************/
32+
/******************* funciones de manejo de la ventana de entrada de resultados del tablet *****************/
3833

3934
/**
4035
* send events
@@ -79,8 +74,8 @@ function tablet_updateSession(row) {
7974
Tanda: row.ID
8075
};
8176
if (parseInt(row.Manga)==0) {
82-
var str= row.Nombre.toLowerCase();
83-
if (str.indexOf("econo")>0) return false;
77+
var str= strval(row.Nombre).toLowerCase();
78+
if ( strpos(str,"econo")>0 ) return false;
8479
else tablet_reconocimiento();
8580
}
8681
$.ajax({
@@ -320,8 +315,7 @@ function tablet_cancel() {
320315
doBeep();
321316
// retrieve original data from parent datagrid
322317
var dgname=$('#tdialog-Parent').val();
323-
var dg=$(dgname).datagrid();
324-
var row =dg.datagrid('getSelected');
318+
var row =$(dgname).datagrid('getSelected');
325319
if (row) {
326320
// update database according row data
327321
row.Operation='update';
@@ -345,31 +339,14 @@ function tablet_cancel() {
345339
);
346340
}
347341
});
348-
var index=row =dg.datagrid('getRowIndex',row);
349-
dg.datagrid('scrollTo',index);
350342
}
351343
// and close panel
352344
tablet_cronoManual('stop');
353345
tablet_cronoManual('reset');
354-
setDataEntryEnabled(false);
346+
$('#tdialog-window').window('close');
355347
return false;
356348
}
357349

358-
function nextRow(dg, cb){
359-
var opts = dg.datagrid('options');
360-
var row = dg.datagrid('getSelected');
361-
var index = dg.datagrid('getRowIndex', row);
362-
if (index>=(opts.numRows-1)) return false;
363-
dg.datagrid('scrollTo', {
364-
index: index+1,
365-
callback: function(index){
366-
$(this).datagrid('selectRow', index);
367-
cb(index, $(this).datagrid('getRows')[index]);
368-
}
369-
});
370-
return true;
371-
}
372-
373350
function tablet_accept() {
374351
doBeep();
375352
// save results
@@ -409,102 +386,32 @@ function tablet_accept() {
409386
tablet_cronoManual('reset');
410387
}
411388
if (!ac_config.tablet_next) { // no go to next row entry
412-
setDataEntryEnabled(false);
389+
$('#tdialog-window').window('close'); // close window
413390
dg.datagrid('refreshRow',rowindex);
414391
return false;
415392
}
416393
// seleccionamos fila siguiente
417-
var res=nextRow(dg,function(index,data) {
418-
// alert ("index:"+index+" data:"+JSON.stringify(data));
419-
if (index<0) return false; // no selection
420-
if (data==null) { // at end of rows. should not occurs
421-
dg.datagrid('scrollTo',rowindex);
422-
setDataEntryEnabled(false);
423-
return false;
424-
}
425-
data.Session=workingData.sesion;
426-
data.RowIndex=index; // not really used, but....
427-
data.Parent=dgname; // store datagrid reference
428-
$('#tdialog-form').form('load',data);
429-
});
430-
if (res==false) { // at end of list
431-
setDataEntryEnabled(false);
432-
dg.datagrid('refreshRow',rowindex);
433-
}
434-
return false; // prevent follow onClick event chain
435-
}
436-
437-
/**
438-
* retrieve from server data row on provided dorsal
439-
* call to callback(idx,row) provided function
440-
* @param {array} tanda current selected tanda
441-
* @param {object} dg datagrid for current selected tanda
442-
* @param {int} dorsal Dog dorsal to search for
443-
* @param cb(page) what to do if Dorsal found in tanda
444-
*/
445-
function loadDorsalPage(tanda,dg,dorsal,cb) {
446-
$.ajax({
447-
type: 'GET',
448-
url: "/agility/server/database/tandasFunctions.php",
449-
dataType:'json',
450-
data: {
451-
Operation: 'getDataByDorsal',
452-
Prueba: tanda.Prueba,
453-
Jornada: tanda.Jornada,
454-
Sesion: tanda.Sesion,
455-
ID: tanda.ID,
456-
Dorsal: dorsal
457-
},
458-
success: function(row) {
459-
var idx=row.RowIndex;
460-
if (idx<0) {
461-
$.messager.alert("Not found","El perro con dorsal "+dorsal+" no participa en esta manga","info");
462-
$('#tablet-datagrid-search').val('---- Dorsal ----');
463-
return false;
464-
}
465-
cb(idx);
466-
},
467-
error: function(XMLHttpRequest,textStatus,errorThrown) {
468-
alert("error: "+textStatus + " "+ errorThrown );
469-
}
470-
});
471-
}
472-
473-
function tablet_editByDorsal() {
474-
var i,len;
475-
var dg=$('#tablet-datagrid');
476-
var drs=$('#tablet-datagrid-search');
477-
var rows=dg.datagrid('getRows');
478-
var dorsal=parseInt(drs.val());
479-
drs.blur();// remove focus to hide tooltip
480-
// si no hay tandas activas muestra error e ignora
481-
for (i=0,len=rows.length;i<len;i++) {
482-
if (typeof(rows[i].expanded)==="undefined") continue;
483-
if (rows[i].expanded==0) continue;
484-
// obtenemos el datagrid y buscamos el dorsal
485-
var dgname='#tablet-datagrid-'+rows[i].ID;
486-
var dg2=$(dgname);
487-
loadDorsalPage(rows[i],dg2,dorsal,function(idx){
488-
dg2.datagrid('scrollTo', {
489-
index: idx,
490-
callback: function (index) {
491-
if (index < 0) return false; // no selection
492-
dg2.datagrid('selectRow', index);
493-
var data = dg2.datagrid('getRows')[index];
494-
data.Session = workingData.sesion;
495-
data.RowIndex = index; // not really used, but....
496-
data.Parent = dgname; // store datagrid reference
497-
$('#tdialog-form').form('load', data);
498-
setDataEntryEnabled(true);
499-
}
500-
});
501-
});
502-
drs.val('---- Dorsal ----');
394+
/*
395+
var count=dg.datagrid('getRows').length; // row count
396+
if ( (rowindex)>=count ) { // at end of datagrid
397+
$('#tdialog-window').window('close'); // close window
398+
dg.datagrid('refreshRow',rowindex-1);
399+
return false;
400+
}
401+
*/
402+
dg.datagrid('scrollTo',rowindex+1);
403+
dg.datagrid('selectRow', rowindex+1);
404+
var data=dg.datagrid('getSelected');
405+
if (data==null) {// at end of datagrid
406+
$('#tdialog-window').window('close'); // close window
407+
dg.datagrid('refreshRow',rowindex);
503408
return false;
504409
}
505-
// arriving here means that there are no expanded row
506-
$.messager.alert("No selection","No hay ninguna manga seleccionada","error");
507-
drs.val('---- Dorsal ----');
410+
data.Session=workingData.sesion;
411+
data.RowIndex=rowindex; // not really used, but....
412+
data.Parent=dgname; // store datagrid reference
413+
$('#tdialog-form').form('load',data);
414+
return false; // prevent follow onClick event chain
508415
}
509416

510417
function isExpected(event) {

agility/server/auth/config.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ restricted = "0"
22
debug_level = "8"
33
register_events = "1"
44
reset_events = "1"
5-
version_name = "2.0.0"
6-
version_date = "20150723_1935"
5+
version_name = "2.0.1"
6+
version_date = "20150805_2139"
77
lang = "es_ES.UTF-8"
88
proximity_alert = "5"
99
database_name = "agility"

agility/server/pdf/print_common.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class PrintCommon extends FPDF {
5151
protected $myDBObject;
5252
protected $pageName; // name of file to be printed
5353
protected $authManager;
54+
protected $regInfo; // registration info from current license
5455

5556
protected $centro;
5657

@@ -99,8 +100,8 @@ function __construct($orientacion,$file,$prueba,$jornada=0) {
99100
if ($this->icon==$this->icon2) $this->icon2=$this->federation->getParentLogo();
100101
}
101102
$this->authManager=new AuthManager("print_common");
102-
$ri=$this->authManager->getRegistrationInfo();
103-
if ($ri['Serial']==="00000000") $this->icon="agilitycontest.png";
103+
$this->regInfo=$this->authManager->getRegistrationInfo();
104+
if ($this->regInfo['Serial']==="00000000") $this->icon="agilitycontest.png";
104105
}
105106

106107
/**

agility/server/pdf/print_etiquetas_pdf.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,7 @@ class Etiquetas_PDF extends PrintCommon {
4343
protected $manga1;
4444
protected $manga2;
4545
public $resultados;
46-
protected $icon;
47-
48-
function ac_SetDrawColor($str) {
49-
$val=intval(str_replace('#','0x',$str),0);
50-
$r=(0x00FF0000&$val)>>16;
51-
$g=(0x0000FF00&$val)>>8;
52-
$b=(0x000000FF&$val);
53-
$this->SetDrawColor($r,$g,$b);
54-
}
46+
protected $serialno;
5547

5648
/** Constructor
5749
* @param {obj} $manga datos de la manga
@@ -63,9 +55,10 @@ function __construct($prueba,$jornada,$mangas) {
6355
$dbobj=new DBObject("print_etiquetas_pdf");
6456
$this->manga1=$dbobj->__getObject("Mangas",$mangas[0]);
6557
$this->manga2=$dbobj->__getObject("Mangas",$mangas[1]);
66-
// evaluage logo info
67-
$this->icon="rsce.png";
68-
if (isset($this->club)) $this->icon=$this->club->Logo;
58+
// add version date and license serial to every label
59+
$ser= substr( $this->regInfo['Serial'],4,4);
60+
$ver= substr( $this->config->getEnv("version_date"),2,6) ;
61+
$this->serialno="{$ver}-${ser}";
6962
}
7063

7164
// No tenemos cabecera: no cabe
@@ -93,7 +86,8 @@ function writeCell($idx,$row) {
9386
$y10= $top+17*$idx+10;
9487
$y7= $top+17*$idx+7;
9588
$y8= $top+17*$idx+8;
96-
$y9= $top+17*$idx+9;
89+
$y9= $top+17*$idx+9;
90+
$y12= $top+17*$idx+12;
9791
$ynext=$top+17*($idx+1);
9892

9993
$this->SetFont('Arial','B',24); // bold 11px
@@ -119,6 +113,12 @@ function writeCell($idx,$row) {
119113
//Fecha (45,y+5,38,5) left
120114
$this->SetXY($left+36,$y9);
121115
$this->Cell(38,5,$this->jornada->Fecha,0,0,'L',false);
116+
// licencia
117+
$this->SetFont('Arial','',5); // font for licencia
118+
$this->SetXY($left+36,$y12);
119+
$this->Cell(38,5,$this->serialno,0,0,'L',false);
120+
$this->SetFont('Arial','I',8); // font for prueba,name
121+
122122
//Perro (45,y+10,38,7) right
123123
$this->SetXY($left+36,$y10);
124124
$this->Cell(38,7,"{$row['Licencia']} - {$row['Nombre']}",0,0,'R',false);
@@ -232,7 +232,7 @@ function composeTable($rowcount=0,$listadorsales="") {
232232
$dbobj=new DBObject("print_etiquetas_csv");
233233
$mng=$dbobj->__getObject("Mangas",$mangas[0]);
234234
$prb=$dbobj->__getObject("Pruebas",$prueba);
235-
$c= new Clasificaciones("print_podium_pdf",$prueba,$jornada);
235+
$c= new Clasificaciones("print_etiquetas_pdf",$prueba,$jornada);
236236

237237
// obtenemos la clasificacion de la tanda seleccionada
238238
$r=$c->clasificacionFinal($rondas,$mangas,$mode);

0 commit comments

Comments
 (0)