Esempio n. 1
0
 public function executeAgregarTest(sfWebRequest $request)
 {
     $this->forward404Unless($Evaluacion = EvaluacionesPeer::retrieveByPk($request->getParameter('id')), sprintf('Object Evaluacion does not exist (%s).', $request->getParameter('id')));
     $this->forward404Unless($Test = TestsPeer::retrieveByPk($request->getParameter('tests_id')), sprintf('Object Test does not exist (%s).', $request->getParameter('tests_id')));
     $Prueba = new Pruebas();
     $Prueba->setEvaluaciones($Evaluacion);
     $Prueba->setTests($Test);
     $Prueba->setEstadopruebasId(sfConfig::get('app_prueba_inicializada'));
     // Estado Inicializado
     $Prueba->save();
     $this->redirect(url_for('evaluaciones/testList?id=' . $Evaluacion->getId()));
 }
Esempio n. 2
0
 /**
  * Constructor
  * @param {int} $prueba Prueba ID
  * @throws Exception
  */
 function __construct($prueba)
 {
     parent::__construct("clasifications.xlsx");
     setcookie('fileDownload', 'true', time() + 30, "/");
     // tell browser to hide "downloading" message box
     $p = new Pruebas("excel_Clasificaciones");
     $res = $p->selectByID($prueba);
     if (!is_array($res)) {
         $this->errormsg = "excel_Clasificaciones: getPruebaByID({$prueba}) failed";
         throw new Exception($this->errormsg);
     }
     $this->prueba = $res;
     $j = new Jornadas("excel_Clasificaciones", $prueba);
     $res = $j->selectByPrueba();
     if (!is_array($res)) {
         $this->errormsg = "excel_Clasificaciones: getJornadasByPrueba({$prueba}) failed";
         throw new Exception($this->errormsg);
     }
     $this->jornadas = $res['rows'];
     // to get mode in trs evaluation
     $this->federation = Federations::getFederation($this->prueba['RSCE']);
     $this->jdbObject = new Jueces("excelClasification");
 }
Esempio n. 3
0
 /**
  * Declares an association between this object and a Pruebas object.
  *
  * @param      Pruebas $v
  * @return     Resultados The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setPruebas(Pruebas $v = null)
 {
     if ($v === null) {
         $this->setPruebasId(NULL);
     } else {
         $this->setPruebasId($v->getId());
     }
     $this->aPruebas = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Pruebas object, it will not be re-added.
     if ($v !== null) {
         $v->addResultados($this);
     }
     return $this;
 }
Esempio n. 4
0
either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; 
if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once __DIR__ . "/../logging.php";
require_once __DIR__ . "/../tools.php";
require_once __DIR__ . "/../auth/AuthManager.php";
require_once __DIR__ . "/classes/Pruebas.php";
try {
    $result = null;
    $pruebas = new Pruebas("pruebaFunctions");
    $am = new AuthManager("pruebaFunctions");
    $operation = http_request("Operation", "s", null);
    if ($operation === null) {
        throw new Exception("Call to pruebaFunctions without 'Operation' requested");
    }
    $pruebaID = http_request("ID", "i", 0);
    switch ($operation) {
        case "insert":
            $am->access(PERMS_OPERATOR);
            $result = $pruebas->insert();
            break;
        case "update":
            $am->access(PERMS_OPERATOR);
            $result = $pruebas->update($pruebaID);
            break;
Esempio n. 5
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Pruebas $value A Pruebas object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Pruebas $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Pruebas the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Pruebas::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }