Skip to content

Commit

Permalink
Merge branch 'Yii' of github.com:LimeSurvey/LimeSurvey into Question_…
Browse files Browse the repository at this point in the history
…Objects
  • Loading branch information
aaronschmitz committed Aug 16, 2012
2 parents 5396211 + 203e899 commit 9d89ae5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
4 changes: 2 additions & 2 deletions application/controllers/admin/database.php
Expand Up @@ -969,8 +969,8 @@ function index($sa = null)
unset($aURLParam['act']);
unset($aURLParam['title']);
unset($aURLParam['id']);
if ($aURLParam['targetqid']=='') $aURLParam['targetqid']='NULL';
if ($aURLParam['targetsqid']=='') $aURLParam['targetsqid']='NULL';
if ($aURLParam['targetqid']=='') $aURLParam['targetqid']=NULL;
if ($aURLParam['targetsqid']=='') $aURLParam['targetsqid']=NULL;
$aURLParam['sid']=$surveyid;

$param = new Survey_url_parameters;
Expand Down
@@ -1,4 +1,8 @@
<script type="text/javascript">
var deleteCaption = "<?php $clang->eT("Delete attribute") ?>";
var deleteMsg = "<?php $clang->eT("Delete selected attribute(s) and it's associated data?") ?>";
var addCaption = "<?php $clang->eT("Add attribute") ?>";

var attributeInfoUrl = "<?php echo Yii::app()->getController()->createUrl("admin/participants/getAttributeInfo_json"); ?>";
var editAttributeUrl = "<?php echo Yii::app()->getController()->createUrl("admin/participants/editAttributeInfo"); ?>";
var attributeControlCols = '["<?php $clang->eT('Actions'); ?>", "<?php $clang->eT('Attribute name'); ?>", "<?php $clang->eT('Attribute type'); ?>", "<?php $clang->eT('Visible in participants panel'); ?>"]';
Expand Down
45 changes: 30 additions & 15 deletions scripts/admin/attributeControl.js
Expand Up @@ -30,32 +30,47 @@ $(document).ready(function() {
});

jQuery.extend($.fn.fmatter , {
rowactions : function(rid,gid,act) {
rowactions : function(rid,gid,act, pos) {
var delOptions = {
caption: deleteCaption,
msg: deleteMsg,
reloadAfterSubmit: true,
width: 400
};
switch(act)
{
case 'edit' :
window.open(attributeEditUrl + '/' + rid, '_top');
break;
case 'del':
$('#'+gid).jqGrid('delGridRow', rid);
$('#'+gid).jqGrid('delGridRow', rid, delOptions);
break;
}
}
});

jQuery('#attributeControl').jqGrid('navGrid',
'#pager',
{add:true, del:true, edit:true},
{closeAfterAdd: true
}, //Add options
{ width:400,
reloadAfterSubmit: true,
afterSubmit: function (response) {
return [true, '', response.responseText];
}
}, //Del options
{}, //Edit options
{multipleSearch:true, width:600},
jQuery('#attributeControl').jqGrid('navGrid', '#pager',
{ add:true,
edit:false,
del:true},
{}, //Default settings for edit
{ addCaption: addCaption,
closeAfterAdd: true,
width: 400,
afterSubmit: function () {
$(this).jqGrid('setGridParam', {datatype: 'json'});
return [true,'',false]; //no error and no new rowid
},
}, //default settings for add
{ reloadAfterSubmit: true,
caption: deleteCaption,
msg: deleteMsg,
width: 500
}, //Default settings for delete
{ multipleSearch:true,
width:600,
closeAfterSearch: true,
closeAfterReset: true}, //Default settings for search
{closeAfterAdd:true}
);

Expand Down
2 changes: 1 addition & 1 deletion scripts/admin/surveysettings.js
Expand Up @@ -53,7 +53,7 @@ $(document).ready(function(){
$('#btnSave').click(saveParameter);
$('#addnewsurvey').submit(PostParameterGrid);
$( "#tabs" ).bind( "tabsselect", function(event, ui) {
if (ui.index>4)
if (ui.index!=5)
{$('#btnSave').hide();}
else
{$('#btnSave').show();}
Expand Down

0 comments on commit 9d89ae5

Please sign in to comment.