Skip to content

Commit

Permalink
Fixed issue #10848: Can't edit quota
Browse files Browse the repository at this point in the history
Dev: Styling.
  • Loading branch information
olleharstedt committed Apr 5, 2016
1 parent 11fb149 commit 62fe156
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 28 deletions.
3 changes: 3 additions & 0 deletions application/controllers/admin/quotas.php
Expand Up @@ -415,6 +415,9 @@ function editquota($iSurveyId)
$aData['surveybar']['closebutton']['url'] = 'admin/quotas/sa/index/surveyid/'.$iSurveyId; // Close button
$aData['surveybar']['savebutton']['form'] = 'frmeditgroup';

$aData['langs'] = $aData['aLangs'];
$aData['baselang'] = $aData['sBaseLang'];

$this->_renderWrappedTemplate('quotas', $aViewUrls, $aData);
}

Expand Down
75 changes: 56 additions & 19 deletions application/views/admin/quotas/editquota_view.php
Expand Up @@ -6,28 +6,65 @@
</h3>


<?php echo CHtml::form(array("admin/quotas/sa/modifyquota/surveyid/{$iSurveyId}"), 'post', array('id'=>'editquota','class'=>'form30')); ?>
<ul>
<li><label for='quota_name'><?php eT("Quota name:");?></label> <input id="quota_name" name="quota_name" type="text" size="30" maxlength="255" value="<?php echo $quotainfo['name'];?>" /></li>
<li><label for='quota_limit'><?php eT("Quota limit:");?></label><input id="quota_limit" name="quota_limit" type="text" size="12" maxlength="8" value="<?php echo $quotainfo['qlimit'];?>" /></li>
<li><label for='quota_action'><?php eT("Quota action:");?></label> <select name="quota_action" id="quota_action" class="form-control">
<option value ="1" <?php if($quotainfo['action'] == 1) echo "selected='selected'"; ?>><?php eT("Terminate survey");?></option>
<option value ="2" <?php if($quotainfo['action'] == 2) echo "selected='selected'"; ?>><?php eT("Terminate survey with warning");?></option>
</select></li>
<li><label for='autoload_url'><?php eT("Autoload URL:");?></label><input id="autoload_url" name="autoload_url" type="checkbox" value="1"<?php if($quotainfo['autoload_url'] == "1") {echo " checked";}?> /></li>
</ul>
<div id="tabs">
<ul>
<?php foreach ($aTabTitles as $i => $sTabTitle)
{
echo CHtml::tag('li', array('style' => 'clear:none;'), CHtml::link($sTabTitle, "#edittxtele{$i}"));
}?>
<?php echo CHtml::form(array("admin/quotas/sa/modifyquota/surveyid/{$iSurveyId}"), 'post', array('id'=>'editquota','class'=>'form-horizontal')); ?>
<div class='form-group'>
<label class='control-label col-sm-2' for='quota_name'><?php eT("Quota name:");?></label>
<div class='col-sm-5'>
<input class='form-control' id="quota_name" name="quota_name" type="text" size="30" maxlength="255" value="<?php echo $quotainfo['name'];?>" />
</div>
</div>
<div class='form-group'>
<label class='control-label col-sm-2' for='quota_limit'><?php eT("Quota limit:");?></label>
<div class='col-sm-5'>
<input class='form-control' id="quota_limit" name="quota_limit" type="number" size="12" maxlength="8" value="<?php echo $quotainfo['qlimit'];?>" />
</div>
</div>
<div class='form-group'>
<label class='control-label col-sm-2' for='quota_action'><?php eT("Quota action:");?></label>
<div class='col-sm-5'>
<select name="quota_action" id="quota_action" class="form-control">
<option value ="1" <?php if($quotainfo['action'] == 1) echo "selected='selected'"; ?>><?php eT("Terminate survey");?></option>
<option value ="2" <?php if($quotainfo['action'] == 2) echo "selected='selected'"; ?>><?php eT("Terminate survey with warning");?></option>
</select>
</div>
</div>
<div class='form-group'>
<label class='control-label col-sm-2' for='autoload_url'><?php eT("Autoload URL:");?></label>
<div class='col-sm-5'>
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'autoload_url',
'id'=>'autoload_url',
'value' => $quotainfo['autoload_url'],
'onLabel'=>gT('Yes'),
'offLabel' => gT('No')));
?>
</div>
</div>

<!-- Language tabs -->
<ul class="nav nav-tabs">
<?php foreach ($langs as $lang): ?>
<li role="presentation" <?php if ($lang==$baselang){echo 'class="active"';}?>>
<a data-toggle="tab" href="#edittxtele<?php echo $lang ?>">
<?php echo getLanguageNameFromCode($lang,false); ?>
<?php if ($lang==$baselang) {echo '('.gT("Base language").')';} ;?>
</a>
</li>
<?php endforeach?>
</ul>
<div class='tab-content'>
<?php foreach ($aTabContents as $i => $sTabContent)
{
echo CHtml::tag('div', array('id' => 'edittxtele' . $i), $sTabContent);
echo CHtml::tag(
'div',
array(
'id' => 'edittxtele' . $i,
'class' => 'tab-pane fade in' . ($i == $baselang ? ' active ' : ''),
),
$sTabContent
);
}?>
</div>
</div>
<p>
<input type="hidden" name="sid" value="<?php echo $surveyid;?>" />
<input type="hidden" name="action" value="quotas" />
Expand All @@ -36,4 +73,4 @@
</p>
</form>

</div></div></div>
</div></div></div>
27 changes: 22 additions & 5 deletions application/views/admin/quotas/editquotalang_view.php
@@ -1,7 +1,24 @@
<div class="tabpage_<?php echo $lang; ?>">
<ul>
<li><label for='quotals_message_<?php echo $lang;?>'><?php eT("Quota message");?>:</label><textarea id="quotals_message_<?php echo $lang;?>" name="quotals_message_<?php echo $lang;?>" cols="60" rows="6"><?php echo htmlspecialchars($langquotainfo['quotals_message']);?></textarea></li>
<li><label for='quotals_url_<?php echo $lang;?>'><?php eT("URL");?>:</label><input id="quotals_url_<?php echo $lang;?>" name="quotals_url_<?php echo $lang;?>" type="text" size="30" maxlength="255" value="<?php echo htmlspecialchars($langquotainfo['quotals_url']);?>" /></li>
<li><label for='quotals_urldescrip_<?php echo $lang;?>'><?php eT("URL description");?>:</label><input id="quotals_urldescrip_<?php echo $lang;?>" name="quotals_urldescrip_<?php echo $lang;?>" type="text" size="30" maxlength="255" value="<?php echo htmlspecialchars($langquotainfo['quotals_urldescrip']);?>" /></li>
</ul>

<div class='form-group'>
<label class='control-label col-sm-2' for='quotals_message_<?php echo $lang;?>'><?php eT("Quota message");?>:</label>
<div class='col-sm-5'>
<textarea id="quotals_message_<?php echo $lang;?>" name="quotals_message_<?php echo $lang;?>" cols="60" rows="6"><?php echo htmlspecialchars($langquotainfo['quotals_message']);?></textarea>
</div>
</div>

<div class='form-group'>
<label class='control-label col-sm-2' for='quotals_url_<?php echo $lang;?>'><?php eT("URL");?>:</label>
<div class='col-sm-5'>
<input id="quotals_url_<?php echo $lang;?>" name="quotals_url_<?php echo $lang;?>" class='form-control' type="text" size="30" maxlength="255" value="<?php echo htmlspecialchars($langquotainfo['quotals_url']);?>" />
</div>
</div>

<div class='form-group'>
<label class='control-label col-sm-2' for='quotals_urldescrip_<?php echo $lang;?>'><?php eT("URL description");?>:</label>
<div class='col-sm-5'>
<input id="quotals_urldescrip_<?php echo $lang;?>" name="quotals_urldescrip_<?php echo $lang;?>" type="text" class='form-control' size="30" maxlength="255" value="<?php echo htmlspecialchars($langquotainfo['quotals_urldescrip']);?>" />
</div>
</div>

</div>
8 changes: 4 additions & 4 deletions application/views/admin/quotas/newquota_view.php
Expand Up @@ -17,7 +17,7 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="quota_limit"><?php eT("Quota limit:");?></label>
<div class="col-sm-2">
<input class="form-control" id="quota_limit" name="quota_limit" type="text" size="12" maxlength="8" />
<input class="form-control" id="quota_limit" name="quota_limit" type="number" size="12" maxlength="8" />
</div>
</div>

Expand Down Expand Up @@ -71,23 +71,23 @@
<!-- Quota message -->
<div class="form-group">
<label class="col-sm-2 control-label" for="quotals_message_<?php echo $lang;?>"><?php eT("Quota message:");?></label>
<div class="col-sm-10">
<div class="col-sm-5">
<textarea class="form-control" id="quotals_message_<?php echo $lang;?>" name="quotals_message_<?php echo $lang;?>" cols="60" rows="6"><?php eT("Sorry your responses have exceeded a quota on this survey.");?></textarea>
</div>
</div>

<!-- URL -->
<div class="form-group">
<label class="col-sm-2 control-label" for="quotals_url_<?php echo $lang;?>"><?php eT("URL:");?></label>
<div class="col-sm-10">
<div class="col-sm-5">
<input class="form-control" id="quotals_url_<?php echo $lang;?>" name="quotals_url_<?php echo $lang;?>" type="text" size="50" maxlength="255" value="<?php echo $thissurvey['url'];?>" />
</div>
</div>

<!-- URL Description -->
<div class="form-group">
<label class="col-sm-2 control-label" for="quotals_urldescrip_<?php echo $lang;?>"><?php eT("URL description:");?></label>
<div class="col-sm-10">
<div class="col-sm-5">
<input class="form-control" id="quotals_urldescrip_<?php echo $lang;?>" name="quotals_urldescrip_<?php echo $lang;?>" type="text" size="50" maxlength="255" value="<?php echo $thissurvey['urldescrip'];?>" />
</div>
</div>
Expand Down

0 comments on commit 62fe156

Please sign in to comment.