Author: david
Date: 2008-09-29 16:36:24 -0700 (Mon, 29 Sep 2008)
New Revision: 1405
Modified:
trunk/apps/qubit/modules/actor/actions/deleteNoteAction.class.php
trunk/apps/qubit/modules/actor/actions/deletePropertyAction.class.php
trunk/apps/qubit/modules/repository/templates/editISIAHSuccess.php
Log:
Apply re-direct changes from r1402 to the language, script and note
relationships on the repository/editISIAH page. Fixes Issue #450.
Modified: trunk/apps/qubit/modules/actor/actions/deleteNoteAction.class.php
===================================================================
--- trunk/apps/qubit/modules/actor/actions/deleteNoteAction.class.php
2008-09-29 23:22:40 UTC (rev 1404)
+++ trunk/apps/qubit/modules/actor/actions/deleteNoteAction.class.php
2008-09-29 23:36:24 UTC (rev 1405)
@@ -23,16 +23,26 @@
{
public function execute($request)
{
- $this->deleteNote = QubitNote::getById($this->getRequestParameter('noteId'));
-
- $this->forward404Unless($this->deleteNote);
-
- $actorId = $this->deleteNote->getObjectId();
-
- $this->deleteNote->delete();
-
- $returnTemplate = $this->getRequestParameter('ReturnTemplate');
-
- return
$this->redirect('actor/edit/?id='.$actorId.'&template='.$returnTemplate);
+ $this->deleteNote =
QubitNote::getById($this->getRequestParameter('noteId'));
+ $this->forward404Unless($this->deleteNote);
+ $actorId = $this->deleteNote->getObjectId();
+
+ // Do delete
+ $this->deleteNote->delete();
+
+ if ($this->getRequestParameter('next'))
+ {
+ // Make the $next parameter into an absolute URL because redirect()
expects
+ // an absolute URL or an array containing module and action
+ // (Pre-pend code copied from sfWebController->genUrl() method)
+ $next = 'http'.($request->isSecure() ? 's' :
'').'://'.$request->getHost().$this->getRequestParameter('next');
+ return $this->redirect($next);
+ }
+ else
+ {
+ // Default redirect to actor/edit page
+ $returnTemplate =
$this->getRequestParameter('ReturnTemplate');
+ return
$this->redirect('actor/edit/?id='.$actorId.'&template='.$returnTemplate);
+ }
}
}
Modified: trunk/apps/qubit/modules/actor/actions/deletePropertyAction.class.php
===================================================================
--- trunk/apps/qubit/modules/actor/actions/deletePropertyAction.class.php
2008-09-29 23:22:40 UTC (rev 1404)
+++ trunk/apps/qubit/modules/actor/actions/deletePropertyAction.class.php
2008-09-29 23:36:24 UTC (rev 1405)
@@ -23,16 +23,25 @@
{
public function execute($request)
{
- $this->deleteProperty =
QubitProperty::getById($this->getRequestParameter('Id'));
+ $this->deleteProperty =
QubitProperty::getById($this->getRequestParameter('Id'));
+ $this->forward404Unless($this->deleteProperty);
+ $actorId = $this->deleteProperty->getObjectId();
+
+ $this->deleteProperty->delete();
- $this->forward404Unless($this->deleteProperty);
-
- $actorId = $this->deleteProperty->getObjectId();
-
- $this->deleteProperty->delete();
-
- $returnTemplate = $this->getRequestParameter('ReturnTemplate');
-
- return
$this->redirect('actor/edit/?id='.$actorId.'&template='.$returnTemplate);
+ if ($this->getRequestParameter('next'))
+ {
+ // Make the $next parameter into an absolute URL because redirect()
expects
+ // an absolute URL or an array containing module and action
+ // (Pre-pend code copied from sfWebController->genUrl() method)
+ $next = 'http'.($request->isSecure() ? 's' :
'').'://'.$request->getHost().$this->getRequestParameter('next');
+ return $this->redirect($next);
+ }
+ else
+ {
+ // Default redirect to actor/edit page
+ $returnTemplate = $this->getRequestParameter('ReturnTemplate');
+ return
$this->redirect('actor/edit/?id='.$actorId.'&template='.$returnTemplate);
+ }
}
}
Modified: trunk/apps/qubit/modules/repository/templates/editISIAHSuccess.php
===================================================================
--- trunk/apps/qubit/modules/repository/templates/editISIAHSuccess.php
2008-09-29 23:22:40 UTC (rev 1404)
+++ trunk/apps/qubit/modules/repository/templates/editISIAHSuccess.php
2008-09-29 23:36:24 UTC (rev 1405)
@@ -323,7 +323,10 @@
<?php foreach ($languageCodes as $languageCode): ?>
<div style="margin-top: 5px; margin-bottom: 5px;">
- <?php echo format_language($languageCode->getValue()) ?> <?php
echo link_to(image_tag('delete', 'align=top'),
'actor/deleteProperty?Id='.$languageCode->getId()) ?><br/>
+ <?php echo format_language($languageCode->getValue()) ?> <?php
echo link_to(image_tag('delete', 'align=top'),
+ array('module' => 'actor', 'action' => 'deleteProperty', 'Id' =>
$languageCode->getId()),
+ array('query_string' => 'next='.url_for(array('module' =>
'repository', 'action' => 'edit', 'id' => $repository->getId())))
+ ) ?><br/>
</div>
<?php endforeach; ?>
@@ -335,7 +338,10 @@
<?php foreach ($scriptCodes as $scriptCode): ?>
<div style="margin-top: 5px; margin-bottom: 5px;">
- <?php echo format_script($scriptCode->getValue()) ?> <?php echo
link_to(image_tag('delete', 'align=top'),
'actor/deleteProperty?Id='.$scriptCode->getId()) ?><br/>
+ <?php echo format_script($scriptCode->getValue()) ?> <?php echo
link_to(image_tag('delete', 'align=top'),
+ array('module' => 'actor', 'action' => 'deleteProperty', 'Id' =>
$scriptCode->getId()),
+ array('query_string' => 'next='.url_for(array('module' =>
'repository', 'action' => 'edit', 'id' => $repository->getId())))
+ ) ?><br/>
</div>
<?php endforeach; ?>
@@ -363,7 +369,10 @@
<tr>
<td><?php echo $note->getContent(array('cultureFallback' => true))
?><br/><span class="note"><?php echo $note->getUser() ?>, <?php echo
$note->getUpdatedAt() ?></span></td>
<td><?php echo $note->getType() ?></td>
- <td style="text-align: center;"><?php echo
link_to(image_tag('delete', 'align=top'),
'actor/deleteNote?noteId='.$note->getId()) ?></td>
+ <td style="text-align: center;"><?php echo
link_to(image_tag('delete', 'align=top'),
+ array('module' => 'actor', 'action' => 'deleteNote',
'noteId' => $note->getId()),
+ array('query_string' => 'next='.url_for(array('module' =>
'repository', 'action' => 'edit', 'id' => $repository->getId())))
+ ) ?></td>
</tr>
<?php endforeach; ?>
--~--~---------~--~----~------------~-------~--~----~
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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---