Author: david
Date: Thu Dec 3 15:58:15 2009
New Revision: 4067
Log:
Add delete action and template for ISDF.
Added:
trunk/apps/qubit/modules/function/actions/deleteAction.class.php
(contents, props changed)
- copied, changed from r4045,
trunk/apps/qubit/modules/actor/actions/deleteAction.class.php
trunk/apps/qubit/modules/function/templates/deleteSuccess.php (contents,
props changed)
- copied, changed from r4045,
trunk/apps/qubit/modules/actor/templates/deleteSuccess.php
Copied and modified:
trunk/apps/qubit/modules/function/actions/deleteAction.class.php (from r4045,
trunk/apps/qubit/modules/actor/actions/deleteAction.class.php)
==============================================================================
--- trunk/apps/qubit/modules/actor/actions/deleteAction.class.php Thu Dec
3 07:47:45 2009 (r4045, copy source)
+++ trunk/apps/qubit/modules/function/actions/deleteAction.class.php Thu Dec
3 15:58:15 2009 (r4067)
@@ -17,43 +17,30 @@
* along with Qubit Toolkit. If not, see <http://www.gnu.org/licenses/>.
*/
-class ActorDeleteAction extends sfAction
+class FunctionDeleteAction extends sfAction
{
public function execute($request)
{
$this->form = new sfForm;
- $this->actor = QubitActor::getById($request->id);
+ $this->func = QubitFunction::getById($request->id);
- if (!isset($this->actor))
+ if (!isset($this->func))
{
$this->forward404();
}
if ($request->isMethod('delete'))
{
- foreach ($this->actor->events as $event)
- {
- if (isset($event->informationObject) && isset($event->type))
- {
- unset($event->actor);
-
- $event->save();
- }
- else
- {
- $event->delete();
- }
- }
-
- foreach
(QubitRelation::getRelationsBySubjectOrObjectId($this->actor->id) as $relation)
+ // Delete relationships
+ foreach (QubitRelation::getRelationsBySubjectOrObjectId($this->func->id)
as $relation)
{
$relation->delete();
}
- $this->actor->delete();
+ $this->func->delete();
- $this->redirect(array('module' => 'actor', 'action' => 'list'));
+ $this->redirect(array('module' => 'function', 'action' => 'list'));
}
}
}
Copied and modified:
trunk/apps/qubit/modules/function/templates/deleteSuccess.php (from r4045,
trunk/apps/qubit/modules/actor/templates/deleteSuccess.php)
==============================================================================
--- trunk/apps/qubit/modules/actor/templates/deleteSuccess.php Thu Dec 3
07:47:45 2009 (r4045, copy source)
+++ trunk/apps/qubit/modules/function/templates/deleteSuccess.php Thu Dec
3 15:58:15 2009 (r4067)
@@ -1,9 +1,9 @@
-<h1><?php echo __('Are you sure you want to delete %1%?', array('%1%' =>
render_title($actor))) ?></h1>
+<h1><?php echo __('Are you sure you want to delete <i>"%1%"</i>?', array('%1%'
=> render_title($func))) ?></h1>
-<?php echo $form->renderFormTag(url_for(array('module' => 'actor', 'action' =>
'delete', 'id' => $actor->id)), array('method' => 'delete')) ?>
+<?php echo $form->renderFormTag(url_for(array('module' => 'function', 'action'
=> 'delete', 'id' => $func->id)), array('method' => 'delete')) ?>
<ul class="actions">
- <li><?php echo link_to(__('Cancel'), array('module' => 'actor', 'action'
=> 'show', 'id' => $actor->id)) ?></li>
+ <li><?php echo link_to(__('Cancel'), array('module' => 'function',
'action' => 'show', 'id' => $func->id)) ?></li>
<li><?php echo submit_tag(__('Confirm')) ?></li>
</ul>
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.