Commit e7164dd1 by Denis Chenu

[feature] Add restriction by attributes

parent ee83ff42
......@@ -2,6 +2,13 @@
Only partial changelog, [commit history](https://framagit.org/SondagePro-LimeSurvey-plugin/sendMailCron/commits/master) show all changelog.
## [2.1.0] - Unreleased
### Feature
- Move settings to own page
- Add restriction by attribute
## [1.1.0] - 2017-06-15
### Fix
......
/**
* @file Part of sendMailCron plugin
* @author Denis Chenu
* @copyright Denis Chenu <http://www.sondages.pro>
* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat (MIT)
*/
$("[data-moveto='surveybarid']").appendTo("#surveybarid > .row >.col-md-12");
$("[data-click-name]").on('click',function(e){
e.preventDefault();
$("button[name='"+$(this).data('click-name')+"'][value='"+$(this).data('click-value')+"']").trigger("click");
});
<div class="row">
<div class="col-lg-12 content-right">
<h3>Send mail cron settings</h3>
<?php if($warningString) {
echo CHtml::tag("p",array('class'=>'alert alert-warning'),$warningString);
} ?>
<?php echo CHtml::beginForm();?>
<?php foreach($aSettings as $legend=>$settings) {
$this->widget('ext.SettingsWidget.SettingsWidget', array(
//'id'=>'summary',
'title'=>$legend,
//'prefix' => $pluginClass, This break the label (id!=name)
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'labelWidth'=>6,
'controlWidth'=>6,
'settings' => $settings,
));
} ?>
<div class='row'>
<div class='col-md-offset-6 submit-buttons'>
<?php
echo CHtml::htmlButton('<i class="fa fa-check" aria-hidden="true"></i> '.gT('Save'),array('type'=>'submit','name'=>'save'.$pluginClass,'value'=>'save','class'=>'btn btn-primary'));
echo " ";
echo CHtml::htmlButton('<i class="fa fa-check-circle-o " aria-hidden="true"></i> '.gT('Save and close'),array('type'=>'submit','name'=>'save'.$pluginClass,'value'=>'redirect','class'=>'btn btn-default'));
echo " ";
echo CHtml::link(gT('Close'),Yii::app()->createUrl('admin/survey',array('sa'=>'view','surveyid'=>$surveyId)),array('class'=>'btn btn-danger'));
?>
<div class='hidden' style='display:none'>
<div data-moveto='surveybarid' class='pull-right hidden-xs'>
<?php
echo CHtml::link('<i class="fa fa-check" aria-hidden="true"></i> '.gT('Save'),"#",array('class'=>'btn btn-primary','data-click-name'=>'save'.$pluginClass,'data-click-value'=>'save'));
echo " ";
echo CHtml::link('<i class="fa fa-check-circle-o" aria-hidden="true"></i> '.gT('Save and close'),"#",array('class'=>'btn btn-default','data-click-name'=>'save'.$pluginClass,'data-click-value'=>'redirect'));
echo " ";
echo CHtml::link(gT('Close'),Yii::app()->createUrl('admin/survey',array('sa'=>'view','surveyid'=>$surveyId)),array('class'=>'btn btn-danger'));
?>
</div>
</div>
</div>
</div>
<?php echo CHtml::endForm();?>
</div>
</div>
<?php
Yii:app()->clientScript->registerScriptFile($assetUrl.'/settings.js',CClientScript::POS_END);
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment