Skip to content

Commit

Permalink
FIxed issue #12178: fix quota-grid errors if no quotas (#655)
Browse files Browse the repository at this point in the history
Dev: fix quota-grid errors if no quotas
Dev cannot add quota if no memebers
  • Loading branch information
TonisOrmisson authored and Shnoulle committed Mar 8, 2017
1 parent 64635ca commit 65566aa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
6 changes: 1 addition & 5 deletions application/views/admin/quotas/viewquotas_quota_members.php
Expand Up @@ -17,8 +17,6 @@


?>
<?php if (!empty($aQuotaItems) ):?>


<div class="panel panel-<?php echo ($oQuota->active==1 ? 'primary' : 'default') ?>">
<div class="panel-heading">
Expand Down Expand Up @@ -58,6 +56,4 @@
}?>
</div>
</div>
</div>

<?php endif;
</div>
38 changes: 19 additions & 19 deletions application/views/admin/quotas/viewquotas_view.php
Expand Up @@ -11,8 +11,6 @@
/* @var Quota $oQuota The last Quota as base for Massive edits */
/* @var QuotaLanguageSetting[] $aQuotaLanguageSettings The last Quota LanguageSettings */



?>
<div class='side-body <?php echo getSideBodyClass(false); ?>'>
<div class="row">
Expand All @@ -29,7 +27,7 @@
</div>
<?php endif; ?>


<?php if($oDataProvider->itemCount > 0):?>
<!-- Grid -->
<div class="row">
<div class="col-sm-12 content-right">
Expand All @@ -54,14 +52,12 @@
'value'=>function($oQuota) use($oSurvey,$aQuotaItems){
/** @var Quota $oQuota */
$out = null;
if (!empty($aQuotaItems) ){
$out = '<p>'.$this->renderPartial('/admin/quotas/viewquotas_quota_members',
array(
'oSurvey'=>$oSurvey,
'oQuota'=>$oQuota,
'aQuotaItems'=>$aQuotaItems,
)).'<p>';
}
array(
'oSurvey'=>$oSurvey,
'oQuota'=>$oQuota,
'aQuotaItems'=>$aQuotaItems,
)).'<p>';
return $out;
},
),
Expand Down Expand Up @@ -109,15 +105,19 @@
));
?>
</div>
<?php endif; ?>

<?php if (Permission::model()->hasSurveyPermission($oSurvey->getPrimaryKey(), 'quotas','create')):?>
<div class="pull-left">
<?php $this->renderPartial('/admin/quotas/viewquotas_massive_selector',
array(
'oSurvey'=>$oSurvey,
'oQuota'=>$oQuota,
'aQuotaLanguageSettings'=>$aQuotaLanguageSettings,
));?>
</div>
<?php if($oDataProvider->itemCount > 0):?>
<div class="pull-left">
<?php $this->renderPartial('/admin/quotas/viewquotas_massive_selector',
array(
'oSurvey'=>$oSurvey,
'oQuota'=>$oQuota,
'aQuotaLanguageSettings'=>$aQuotaLanguageSettings,
));?>
</div>
<?php endif; ?>
<div class="pull-right">
<?php echo CHtml::beginForm(array("admin/quotas/sa/newquota/surveyid/{$oSurvey->getPrimaryKey()}"), 'post'); ?>
<?php echo CHtml::hiddenField('sid',$oSurvey->getPrimaryKey());?>
Expand All @@ -128,7 +128,7 @@
'class'=>'quota_new btn btn-default',
));?>
<?php echo CHtml::endForm();?>
</div>
</div>
<?php endif; ?>
</div>
</div>
Expand Down

2 comments on commit 65566aa

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that your forgot paginations in the new quota grid. So when more than 10 quotas: you can't see all of them ;-)

Else very good job: we have many positive feedbacks about the new design.

@TonisOrmisson
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, sorry for that (and for the XSS) :)
thanks for feedback. good to have that!

Please sign in to comment.