SVN Alba r6307 - in prosistem/alba/trunk/alba: config data/sql data/sql/1.1 lib/model lib/model/map lib/model/om
Author: ftoledo Date: 2009-12-16 15:26:28 -0300 (Wed, 16 Dec 2009) New Revision: 6307 Added: prosistem/alba/trunk/alba/data/sql/1.1/ prosistem/alba/trunk/alba/data/sql/1.1/01_sporte_formula.sql Modified: prosistem/alba/trunk/alba/config/schema.yml prosistem/alba/trunk/alba/lib/model/Alumno.php prosistem/alba/trunk/alba/lib/model/map/PeriodoMapBuilder.php prosistem/alba/trunk/alba/lib/model/om/BasePeriodo.php prosistem/alba/trunk/alba/lib/model/om/BasePeriodoPeer.php Log: campos formula y calcular en periodo para el boletin Modified: prosistem/alba/trunk/alba/config/schema.yml =================================================================== --- prosistem/alba/trunk/alba/config/schema.yml 2009-12-04 19:55:25 UTC (rev 6306) +++ prosistem/alba/trunk/alba/config/schema.yml 2009-12-16 18:26:28 UTC (rev 6307) @@ -955,7 +955,15 @@ type: varchar size: 255 required: true - + calcular: + type: boolean + required: true + default: false + formula: + type: varchar + size: 1000 + required: false + tipodocente: _attributes: idMethod: native Added: prosistem/alba/trunk/alba/data/sql/1.1/01_sporte_formula.sql =================================================================== --- prosistem/alba/trunk/alba/data/sql/1.1/01_sporte_formula.sql (rev 0) +++ prosistem/alba/trunk/alba/data/sql/1.1/01_sporte_formula.sql 2009-12-16 18:26:28 UTC (rev 6307) @@ -0,0 +1,2 @@ +alter table periodo add column (calcular tinyint default 0 not null, formula varchar(1000)); + Modified: prosistem/alba/trunk/alba/lib/model/Alumno.php =================================================================== --- prosistem/alba/trunk/alba/lib/model/Alumno.php 2009-12-04 19:55:25 UTC (rev 6306) +++ prosistem/alba/trunk/alba/lib/model/Alumno.php 2009-12-16 18:26:28 UTC (rev 6307) @@ -90,7 +90,9 @@ $aBoletinActividades = BasePeer::doSelect($criteria); foreach($aBoletinActividades as $boletinActividades) { $notaAlumno[$boletinActividades[0]][$boletinActividades[1]] = $boletinActividades[2]; + $notaAlumno['calcular'] = true; } + return $notaAlumno; } @@ -122,7 +124,7 @@ if($rsColumna) { while($res_c = $rsColumna->fetch()) { - $aAsistencia[$res_c[0]] = 0; // indice: nombre del Grupo, contenido: + $aAsistencia[$res_c[0]] = 0; // indice: nombre del Grupo, contenido: } } if($rsValor) { @@ -137,7 +139,7 @@ public function getAsistenciasPorCiclolectivo($ciclo_lectivo) { - $aAsistencia = array(); + $aAsistencia = array(); $criteria = new Criteria(); $criteria->add(PeriodoPeer::FK_CICLOLECTIVO_ID, $ciclo_lectivo); $aPeriodo = PeriodoPeer::doSelect($criteria); Modified: prosistem/alba/trunk/alba/lib/model/map/PeriodoMapBuilder.php =================================================================== --- prosistem/alba/trunk/alba/lib/model/map/PeriodoMapBuilder.php 2009-12-04 19:55:25 UTC (rev 6306) +++ prosistem/alba/trunk/alba/lib/model/map/PeriodoMapBuilder.php 2009-12-16 18:26:28 UTC (rev 6307) @@ -43,5 +43,9 @@ $tMap->addColumn('DESCRIPCION', 'Descripcion', 'VARCHAR', true, 255); + $tMap->addColumn('CALCULAR', 'Calcular', 'BOOLEAN', true, null); + + $tMap->addColumn('FORMULA', 'Formula', 'VARCHAR', false, 1000); + } } \ No newline at end of file Modified: prosistem/alba/trunk/alba/lib/model/om/BasePeriodo.php =================================================================== --- prosistem/alba/trunk/alba/lib/model/om/BasePeriodo.php 2009-12-04 19:55:25 UTC (rev 6306) +++ prosistem/alba/trunk/alba/lib/model/om/BasePeriodo.php 2009-12-16 18:26:28 UTC (rev 6307) @@ -25,6 +25,12 @@ protected $descripcion; + protected $calcular; + + + protected $formula; + + protected $aCiclolectivo; @@ -61,6 +67,7 @@ public function applyDefaultValues() { + $this->calcular = false; } @@ -136,6 +143,18 @@ } + public function getCalcular() + { + return $this->calcular; + } + + + public function getFormula() + { + return $this->formula; + } + + public function setId($v) { if ($v !== null) { @@ -246,12 +265,44 @@ return $this; } + public function setCalcular($v) + { + if ($v !== null) { + $v = (boolean) $v; + } + + if ($this->calcular !== $v || $v === false) { + $this->calcular = $v; + $this->modifiedColumns[] = PeriodoPeer::CALCULAR; + } + + return $this; + } + + public function setFormula($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->formula !== $v) { + $this->formula = $v; + $this->modifiedColumns[] = PeriodoPeer::FORMULA; + } + + return $this; + } + public function hasOnlyDefaultValues() { - if (array_diff($this->modifiedColumns, array())) { + if (array_diff($this->modifiedColumns, array(PeriodoPeer::CALCULAR))) { return false; } + if ($this->calcular !== false) { + return false; + } + return true; } @@ -264,6 +315,8 @@ $this->fecha_inicio = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; $this->fecha_fin = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; $this->descripcion = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; + $this->calcular = ($row[$startcol + 5] !== null) ? (boolean) $row[$startcol + 5] : null; + $this->formula = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; $this->resetModified(); $this->setNew(false); @@ -272,7 +325,7 @@ $this->ensureConsistency(); } - return $startcol + 5; + return $startcol + 7; } catch (Exception $e) { throw new PropelException("Error populating Periodo object", $e); } @@ -529,6 +582,12 @@ case 4: return $this->getDescripcion(); break; + case 5: + return $this->getCalcular(); + break; + case 6: + return $this->getFormula(); + break; default: return null; break; @@ -544,6 +603,8 @@ $keys[2] => $this->getFechaInicio(), $keys[3] => $this->getFechaFin(), $keys[4] => $this->getDescripcion(), + $keys[5] => $this->getCalcular(), + $keys[6] => $this->getFormula(), ); return $result; } @@ -574,6 +635,12 @@ case 4: $this->setDescripcion($value); break; + case 5: + $this->setCalcular($value); + break; + case 6: + $this->setFormula($value); + break; } } @@ -586,6 +653,8 @@ if (array_key_exists($keys[2], $arr)) $this->setFechaInicio($arr[$keys[2]]); if (array_key_exists($keys[3], $arr)) $this->setFechaFin($arr[$keys[3]]); if (array_key_exists($keys[4], $arr)) $this->setDescripcion($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setCalcular($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setFormula($arr[$keys[6]]); } @@ -598,6 +667,8 @@ if ($this->isColumnModified(PeriodoPeer::FECHA_INICIO)) $criteria->add(PeriodoPeer::FECHA_INICIO, $this->fecha_inicio); if ($this->isColumnModified(PeriodoPeer::FECHA_FIN)) $criteria->add(PeriodoPeer::FECHA_FIN, $this->fecha_fin); if ($this->isColumnModified(PeriodoPeer::DESCRIPCION)) $criteria->add(PeriodoPeer::DESCRIPCION, $this->descripcion); + if ($this->isColumnModified(PeriodoPeer::CALCULAR)) $criteria->add(PeriodoPeer::CALCULAR, $this->calcular); + if ($this->isColumnModified(PeriodoPeer::FORMULA)) $criteria->add(PeriodoPeer::FORMULA, $this->formula); return $criteria; } @@ -636,7 +707,11 @@ $copyObj->setDescripcion($this->descripcion); + $copyObj->setCalcular($this->calcular); + $copyObj->setFormula($this->formula); + + if ($deepCopy) { $copyObj->setNew(false); Modified: prosistem/alba/trunk/alba/lib/model/om/BasePeriodoPeer.php =================================================================== --- prosistem/alba/trunk/alba/lib/model/om/BasePeriodoPeer.php 2009-12-04 19:55:25 UTC (rev 6306) +++ prosistem/alba/trunk/alba/lib/model/om/BasePeriodoPeer.php 2009-12-16 18:26:28 UTC (rev 6307) @@ -13,7 +13,7 @@ const CLASS_DEFAULT = 'lib.model.Periodo'; - const NUM_COLUMNS = 5; + const NUM_COLUMNS = 7; const NUM_LAZY_LOAD_COLUMNS = 0; @@ -34,6 +34,12 @@ const DESCRIPCION = 'periodo.DESCRIPCION'; + const CALCULAR = 'periodo.CALCULAR'; + + + const FORMULA = 'periodo.FORMULA'; + + public static $instances = array(); @@ -41,20 +47,20 @@ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('Id', 'FkCiclolectivoId', 'FechaInicio', 'FechaFin', 'Descripcion', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'fkCiclolectivoId', 'fechaInicio', 'fechaFin', 'descripcion', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::FK_CICLOLECTIVO_ID, self::FECHA_INICIO, self::FECHA_FIN, self::DESCRIPCION, ), - BasePeer::TYPE_FIELDNAME => array ('id', 'fk_ciclolectivo_id', 'fecha_inicio', 'fecha_fin', 'descripcion', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) + BasePeer::TYPE_PHPNAME => array ('Id', 'FkCiclolectivoId', 'FechaInicio', 'FechaFin', 'Descripcion', 'Calcular', 'Formula', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'fkCiclolectivoId', 'fechaInicio', 'fechaFin', 'descripcion', 'calcular', 'formula', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::FK_CICLOLECTIVO_ID, self::FECHA_INICIO, self::FECHA_FIN, self::DESCRIPCION, self::CALCULAR, self::FORMULA, ), + BasePeer::TYPE_FIELDNAME => array ('id', 'fk_ciclolectivo_id', 'fecha_inicio', 'fecha_fin', 'descripcion', 'calcular', 'formula', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) ); private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'FkCiclolectivoId' => 1, 'FechaInicio' => 2, 'FechaFin' => 3, 'Descripcion' => 4, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'fkCiclolectivoId' => 1, 'fechaInicio' => 2, 'fechaFin' => 3, 'descripcion' => 4, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::FK_CICLOLECTIVO_ID => 1, self::FECHA_INICIO => 2, self::FECHA_FIN => 3, self::DESCRIPCION => 4, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'fk_ciclolectivo_id' => 1, 'fecha_inicio' => 2, 'fecha_fin' => 3, 'descripcion' => 4, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'FkCiclolectivoId' => 1, 'FechaInicio' => 2, 'FechaFin' => 3, 'Descripcion' => 4, 'Calcular' => 5, 'Formula' => 6, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'fkCiclolectivoId' => 1, 'fechaInicio' => 2, 'fechaFin' => 3, 'descripcion' => 4, 'calcular' => 5, 'formula' => 6, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::FK_CICLOLECTIVO_ID => 1, self::FECHA_INICIO => 2, self::FECHA_FIN => 3, self::DESCRIPCION => 4, self::CALCULAR => 5, self::FORMULA => 6, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'fk_ciclolectivo_id' => 1, 'fecha_inicio' => 2, 'fecha_fin' => 3, 'descripcion' => 4, 'calcular' => 5, 'formula' => 6, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) ); @@ -106,6 +112,10 @@ $criteria->addSelectColumn(PeriodoPeer::DESCRIPCION); + $criteria->addSelectColumn(PeriodoPeer::CALCULAR); + + $criteria->addSelectColumn(PeriodoPeer::FORMULA); + }
participants (1)
-
commits@pressenter.com.ar