Skip to content

Commit

Permalink
Fixed Issue : Remove obsolete RevertUpgradeConditionsToRelevance in d…
Browse files Browse the repository at this point in the history
…elete_group

Dev: Added check for groups with dependencies
  • Loading branch information
trougakoss committed Jul 31, 2012
1 parent 07cb8eb commit 0ed6000
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions application/controllers/admin/remotecontrol.php
Expand Up @@ -1018,17 +1018,18 @@ public function delete_group($sSessionKey, $iSurveyID, $iGroupID)
return array('status' => 'Error:Survey is active and not editable');

if (hasSurveyPermission($iSurveyID, 'surveycontent', 'delete'))
{
LimeExpressionManager::RevertUpgradeConditionsToRelevance($iSurveyID);
{
$depented_on = getGroupDepsForConditions($oGroup->sid,"all",$iGroupID,"by-targgid");
if(isset($depented_on))
return array('status' => 'Group with depencdencies - deletion not allowed');

$iGroupsDeleted = Groups::deleteWithDependency($iGroupID, $iSurveyID);

if ($iGroupsDeleted === 1)
fixSortOrderGroups($iSurveyID);

LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyID);

if ($iGroupsDeleted === 1)
{
fixSortOrderGroups($iSurveyID);
return $iGroupID;
}
else
return array('status' => 'Group deletion failed');
}
Expand Down

0 comments on commit 0ed6000

Please sign in to comment.