Skip to content

Commit

Permalink
Fixed: Quota member delete was deleting all matching members, not jus…
Browse files Browse the repository at this point in the history
…t individual items

New Feature: Quota dataentry screen returns to previous page position after adding new member or quota (makes data entry on large quota lists faster)
New Feature: Total quota limit shown at end of list

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey181@6567 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 19, 2009
1 parent 4bc6dda commit a19880b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions admin/quota.php
Expand Up @@ -244,7 +244,7 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)
if($subaction == "quota_delans")
{
$_POST = array_map('db_quote', $_POST);
$query = "DELETE FROM ".db_table_name('quota_members')." WHERE qid='{$_POST['quota_qid']}' and code='{$_POST['quota_anscode']}'";
$query = "DELETE FROM ".db_table_name('quota_members')." WHERE id = '{$_POST['quota_member_id']}' AND qid='{$_POST['quota_qid']}' and code='{$_POST['quota_anscode']}'";
$connect->Execute($query) or safe_die($connect->ErrorMsg());
$viewquota = "1";

Expand Down Expand Up @@ -325,6 +325,7 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)
</table>';
}

$totalquotas=0;
if (($action == "quotas" && !isset($subaction)) || isset($viewquota))
{

Expand Down Expand Up @@ -354,7 +355,7 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)
while ($quotalisting = $result->FetchRow())
{
$quotasoutput .='<tr>
<td align="center">'.$quotalisting['name'].'</td>
<td align="center"><a name="quota_'.$quotalisting['id'].'">'.$quotalisting['name'].'</a></td>
<td align="center">';
if ($quotalisting['active'] == 1)
{
Expand All @@ -370,6 +371,7 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)
} elseif ($quotalisting['action'] == 2) {
$quotasoutput .= $clang->gT("Terminate Survey With Warning");
}
$totalquotas+=$quotalisting['qlimit'];
$quotasoutput .='</td>
<td align="center">'.$quotalisting['qlimit'].'</td>
<td align="center">'.get_quotaCompletedCount($surveyid, $quotalisting['id']).'</td>
Expand Down Expand Up @@ -424,6 +426,7 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)
<input name="submit" type="submit" id="submit" value="'.$clang->gT("Remove").'">
<input type="hidden" name="sid" value="'.$surveyid.'" />
<input type="hidden" name="action" value="quotas" />
<input type="hidden" name="quota_member_id" value="'.$quota_questions['id'].'" />
<input type="hidden" name="quota_qid" value="'.$quota_questions['qid'].'" />
<input type="hidden" name="quota_anscode" value="'.$quota_questions['code'].'" />
<input type="hidden" name="subaction" value="quota_delans" />
Expand Down Expand Up @@ -451,9 +454,9 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)
<input type="hidden" name="sid" value="'.$surveyid.'" />
<input type="hidden" name="action" value="quotas" />
<input type="hidden" name="subaction" value="new_quota" /></form></td>
<td align="center"><a name="quota_end">&nbsp;</a></td>
<td align="center">&nbsp;</td>
<td align="center">&nbsp;</td>
<td align="center">&nbsp;</td>
<td align="center">'.$totalquotas.'</td>
<td align="center">&nbsp;</td>
<td align="center" style="padding: 3px;">&nbsp;</td>
</tr>
Expand Down Expand Up @@ -562,7 +565,7 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)
</table>';
} else
{
$quotasoutput .='<form action="'.$scriptname.'" method="post">
$quotasoutput .='<form action="'.$scriptname.'#quota_'.$_POST['quota_id'].'" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F8F8FF">
<tr>
<td valign="top">
Expand Down Expand Up @@ -613,7 +616,7 @@ function getQuotaAnswers($qid,$surveyid,$quota_id)

if ($subaction == "new_quota")
{
$quotasoutput .='<form action="'.$scriptname.'" method="post">
$quotasoutput .='<form action="'.$scriptname.'#quota_end" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F8F8FF">
<tr>
<td valign="top">
Expand Down

0 comments on commit a19880b

Please sign in to comment.