Skip to content

Commit 538d53f

Browse files
committed
Add module RFEC-FMC-2022. Fix some warns on obsolete functions
1 parent eb2acdc commit 538d53f

File tree

4 files changed

+39
-15
lines changed

4 files changed

+39
-15
lines changed

AgilityContest.exe

-1.02 KB
Binary file not shown.

agility/server/mail/PHPMailer-5.2.22/PHPMailerAutoload.php

+11-5
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,26 @@ function PHPMailerAutoload($classname)
3030
}
3131
}
3232

33+
spl_autoload_register('PHPMailerAutoload', true, true);
34+
35+
/*
36+
// this code is no longer required as AgilityContest uses at least php-5.6
37+
3338
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
3439
//SPL autoloading was introduced in PHP 5.1.2
3540
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
36-
spl_autoload_register('PHPMailerAutoload', true, true);
41+
3742
} else {
3843
spl_autoload_register('PHPMailerAutoload');
3944
}
4045
} else {
41-
/**
42-
* Fall back to traditional autoload for old PHP versions
43-
* @param string $classname The name of the class to load
44-
*/
46+
//
47+
//Fall back to traditional autoload for old PHP versions
48+
//@param string $classname The name of the class to load
49+
//
4550
function __autoload($classname)
4651
{
4752
PHPMailerAutoload($classname);
4853
}
4954
}
55+
*/

agility/server/modules/competiciones/Puntuable_FMC_2018.php

+12-10
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@
2222

2323
class Puntuable_FMC_2018 extends Puntuable_RFEC_2018 {
2424

25-
function __construct() {
26-
parent::__construct("Puntuable Liga FMC");
25+
protected $ptsmanga;
26+
protected $ptsglobal;
27+
28+
function __construct($name="Puntuable Liga FMC 2018") {
29+
parent::__construct($name);
2730
$this->federationID=1;
2831
$this->federationDefault=1;
2932
$this->competitionID=2;
3033
$this->moduleVersion="1.2.0";
3134
$this->moduleRevision="20180125_1113";
3235
$this->federationLogoAllowed=true;
36+
$this->ptsmanga=array(7,5,3,2,1); // puntos por manga y puesto
37+
$this->ptsglobal = array("15", "12", "9", "7", "6", "5", "4", "3", "2", "1"); //puestos por general
3338
}
3439

3540
function getModuleInfo($contact = null) {
@@ -65,15 +70,14 @@ public function evalPartialCalification($m,&$perro,$puestocat) {
6570
Competitions::evalPartialCalification($m,$perro,$puestocat);
6671
return;
6772
}
68-
$ptsmanga=array(7,5,3,2,1); // puntos por manga y puesto
73+
6974
$pt1=0;
7075
if ($penal<6.0) $pt1++; // 1 punto por excelente
7176
if ($penal==0.0) $pt1+=2; // 3 puntos por cero
72-
// puntos a los 5 primeros de la zona liguera por manga/categoria tienen excelente o muy bueno
73-
// en madrid se permite que los perros NC puntuen
77+
// calculamos puntos para los que tienen
7478
$puesto=$puestocat[$cat]-$this->poffset[$cat];
7579
if ( ($puestocat[$cat]>0) && ($penal<16) ) {
76-
if ($puesto<=5) $pt1 += $ptsmanga[$puesto-1];
80+
if ($puesto<=count($this->ptsmanga)) $pt1 += $this->ptsmanga[$puesto-1];
7781
} else { // no points or not qualified; discard
7882
Competitions::evalPartialCalification($m,$perro,$puestocat);
7983
return;
@@ -97,7 +101,7 @@ public function evalPartialCalification($m,&$perro,$puestocat) {
97101
$perro['Calificacion'] = _("Not Clasified");
98102
$perro['CShort'] = _("N.C.");
99103
}
100-
else if ($penal>=16) { // en el 2018 solo puntuan excelentes y muy buenos
104+
else if ($penal>=16) {
101105
$perro['Calificacion'] = _("Good");
102106
$perro['CShort'] = _("Good");
103107
}
@@ -156,8 +160,6 @@ public function evalFinalCalification($mangas,$resultados,&$perro,$puestocat){
156160
return;
157161
}
158162

159-
$ptsglobal = array("15", "12", "9", "7", "6", "5", "4", "3", "2", "1"); //puestos por general si tiene excelente o muy bueno
160-
161163
// manga 1
162164
$pt1 = "0";
163165
if ($resultados[0] !== null) { // extraemos los puntos de la primera manga
@@ -181,7 +183,7 @@ public function evalFinalCalification($mangas,$resultados,&$perro,$puestocat){
181183
// evaluamos puesto real una vez eliminados los "extranjeros"
182184
$puesto=$puestocat[$cat]-$this->pfoffset[$cat];
183185
// si esta entre los 10 primeros cogemos los puntos
184-
if ($puesto<11) $pfin=$ptsglobal[$puesto-1];
186+
if ($puesto<=count($this->ptsglobal)) $pfin=$this->ptsglobal[$puesto-1];
185187
// y asignamos la calificacion final
186188
$perro['Calificacion']="$pt1 - $pt2 - $pfin";
187189
$perro['Puntos']=intval($pt1)+intval($pt2)+intval($pfin);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
require_once(__DIR__.'/Puntuable_FMC_2018.php');
3+
4+
class Puntuable_FMC_2022 extends Puntuable_FMC_2018 {
5+
function __construct($name="Puntuable Liga FMC 2022") {
6+
parent::__construct($name);
7+
$this->federationID=1;
8+
$this->federationDefault=1;
9+
$this->competitionID=7;
10+
$this->moduleVersion="1.2.0";
11+
$this->moduleRevision="20180125_1113";
12+
$this->federationLogoAllowed=true;
13+
$this->ptsmanga=array(10,8,6,4,3,2,1); // puntos por manga y puesto
14+
$this->ptsglobal = array("10", "8", "6", "4", "3", "2", "1"); //puestos por general
15+
}
16+
}

0 commit comments

Comments
 (0)