[Alba-desarrollo] SVN Alba r4873 - in prosistem/alba/trunk/alba: apps/principal/modules/docenteHorario/actions apps/principal/modules/docenteHorario/templates lib/model

commits en pressenter.com.ar commits en pressenter.com.ar
Mie Jul 25 19:51:18 CEST 2007


Author: josx
Date: 2007-07-25 14:51:16 -0300 (Wed, 25 Jul 2007)
New Revision: 4873

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/templates/listSuccess.php
   prosistem/alba/trunk/alba/lib/model/DocenteHorario.php
   prosistem/alba/trunk/alba/lib/model/Horarioescolar.php
   prosistem/alba/trunk/alba/lib/model/RelDivisionActividadDocente.php
Log:
Borrado para los eventos desde las tablas en donde estan los foreign keys

Modified: prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/actions/actions.class.php	2007-07-25 17:35:31 UTC (rev 4872)
+++ prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/actions/actions.class.php	2007-07-25 17:51:16 UTC (rev 4873)
@@ -73,11 +73,14 @@
   }
 
     public function executeDeleteHorario ()  {
-        $this->docenteHorario = DocenteHorarioPeer::retrieveByPk( array( $this->getRequestParameter('docente_id'), $this->getRequestParameter('evento_id')));
+//         $this->docenteHorario = DocenteHorarioPeer::retrieveByPk( array( $this->getRequestParameter('idDocente'), $this->getRequestParameter('idEvento')));
+        $c = new Criteria();
+        $c->add(DocenteHorarioPeer::FK_DOCENTE_ID, $this->getRequestParameter('idDocente'));
+        $c->add(DocenteHorarioPeer::FK_EVENTO_ID, $this->getRequestParameter('idEvento'));
+        $this->docenteHorario = DocenteHorarioPeer::doSelectOne($c);
         $this->forward404Unless($this->docenteHorario);
         $idDocente = $this->docenteHorario->getFkDocenteId();
         $link = 'docenteHorario/list?idDocente='.$idDocente;
-        $this->docenteHorario->delete();
         try {
             $this->docenteHorario->delete();
         }
@@ -85,7 +88,6 @@
             $this->getRequest()->setError('delete', 'Could not delete the selected Docente Horario. Make sure it does not have any associated items.');
             return $this->redirect($link);
         }
-
         return $this->redirect($link);
     }
 

Modified: prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/templates/listSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/templates/listSuccess.php	2007-07-25 17:35:31 UTC (rev 4872)
+++ prosistem/alba/trunk/alba/apps/principal/modules/docenteHorario/templates/listSuccess.php	2007-07-25 17:51:16 UTC (rev 4873)
@@ -36,7 +36,7 @@
 <td>
 <ul class="sf_admin_td_actions">
   <li><?php echo link_to(image_tag('/sf/sf_admin/images/edit_icon.png', array('alt' => __('edit'), 'title' => __('edit'))), 'docenteHorario/edit?idDocente='.$docente_horario->getFkDocenteId()."&idEvento=".$docente_horario->getFkEventoId()) ?></li>
-  <li><?php echo link_to(image_tag('/sf/sf_admin/images/delete_icon.png', array('alt' => __('delete'), 'title' => __('delete'))), 'docenteHorario/delete?idDocente='.$docente_horario->getFkDocenteId()."&idEvento=".$docente_horario->getFkEventoId(), array (
+  <li><?php echo link_to(image_tag('/sf/sf_admin/images/delete_icon.png', array('alt' => __('delete'), 'title' => __('delete'))), 'docenteHorario/deleteHorario?idDocente='.$docente_horario->getFkDocenteId()."&idEvento=".$docente_horario->getFkEventoId(), array (
   'post' => true,
   'confirm' => __('Are you sure?'),
 )) ?></li>

Modified: prosistem/alba/trunk/alba/lib/model/DocenteHorario.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/DocenteHorario.php	2007-07-25 17:35:31 UTC (rev 4872)
+++ prosistem/alba/trunk/alba/lib/model/DocenteHorario.php	2007-07-25 17:51:16 UTC (rev 4873)
@@ -16,4 +16,32 @@
  */	
 class DocenteHorario extends BaseDocenteHorario {
 
+    public function delete($con = null)
+    {
+        if ($this->isDeleted()) {
+            throw new PropelException("This object has already been deleted.");
+        }
+
+        if ($con === null) {
+            $con = Propel::getConnection(DocenteHorarioPeer::DATABASE_NAME);
+        }
+
+        try {
+            $con->begin();
+
+            $evento = EventoPeer::retrieveByPk($this->getFkEventoId());
+            $evento->delete();
+
+            DocenteHorarioPeer::doDelete($this, $con);
+            $this->setDeleted(true);
+
+            $con->commit();
+        } catch (PropelException $e) {
+            $con->rollback();
+            throw $e;
+        }
+    }
+
+
+
 } // DocenteHorario

Modified: prosistem/alba/trunk/alba/lib/model/Horarioescolar.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/Horarioescolar.php	2007-07-25 17:35:31 UTC (rev 4872)
+++ prosistem/alba/trunk/alba/lib/model/Horarioescolar.php	2007-07-25 17:51:16 UTC (rev 4873)
@@ -16,4 +16,31 @@
  */	
 class Horarioescolar extends BaseHorarioescolar {
 
+    public function delete($con = null)
+    {
+        if ($this->isDeleted()) {
+            throw new PropelException("This object has already been deleted.");
+        }
+
+        if ($con === null) {
+            $con = Propel::getConnection(HorarioescolarPeer::DATABASE_NAME);
+        }
+
+        try {
+            $con->begin();
+
+            $evento = EventoPeer::retrieveByPk($this->getFkEventoId());
+            $evento->delete();
+
+            HorarioescolarPeer::doDelete($this, $con);
+            $this->setDeleted(true);
+
+            $con->commit();
+        } catch (PropelException $e) {
+            $con->rollback();
+            throw $e;
+        }
+    }
+
+
 } // Horarioescolar

Modified: prosistem/alba/trunk/alba/lib/model/RelDivisionActividadDocente.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/RelDivisionActividadDocente.php	2007-07-25 17:35:31 UTC (rev 4872)
+++ prosistem/alba/trunk/alba/lib/model/RelDivisionActividadDocente.php	2007-07-25 17:51:16 UTC (rev 4873)
@@ -16,4 +16,32 @@
  */	
 class RelDivisionActividadDocente extends BaseRelDivisionActividadDocente {
 
+
+    public function delete($con = null)
+    {
+        if ($this->isDeleted()) {
+            throw new PropelException("This object has already been deleted.");
+        }
+
+        if ($con === null) {
+            $con = Propel::getConnection(RelDivisionActividadDocentePeer::DATABASE_NAME);
+        }
+
+        try {
+            $con->begin();
+
+            $evento = EventoPeer::retrieveByPk($this->getFkEventoId());
+            $evento->delete();
+
+            RelDivisionActividadDocentePeer::doDelete($this, $con);
+            $this->setDeleted(true);
+
+            $con->commit();
+        } catch (PropelException $e) {
+            $con->rollback();
+            throw $e;
+        }
+    }
+
+
 } // RelDivisionActividadDocente




Más información sobre la lista de distribución Alba-desarrollo