Skip to content

Commit

Permalink
Fixed issue #6773: Missing translations in CPDB
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Nov 8, 2012
1 parent e0bb1bc commit bebd197
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
1 change: 0 additions & 1 deletion application/controllers/admin/question.php
Expand Up @@ -982,7 +982,6 @@ public function ajaxlabelsetdetails()
$labelsetlanguages=explode(' ',$labelsetdata->languages);
foreach ($labelsetlanguages as $language){

//$query='select * from lime_labels where lid='.$lid." and language='{$language}' order by sortorder";
$criteria=new CDbCriteria;
$criteria->condition='lid=:lid and language=:language';
$criteria->params=array(':lid'=>$lid, ':language'=>$language);
Expand Down
Expand Up @@ -59,6 +59,10 @@
?>
<script type="text/javascript">
/* Search form titles */
var sAddCaption = "<?php $clang->eT("Add participant", 'js') ?>";
var sAddButtonCaption = "<?php $clang->eT("Add", 'js') ?>";
var sDeleteButtonCaption = "<?php $clang->eT("Delete", 'js') ?>";
var sCancel = "<?php $clang->eT("Cancel", 'js') ?>";
var fullSearchTitle = "<?php $clang->eT("Full search"); ?>";
var selectTxt="<?php $clang->eT("Select...") ?>";
var emailTxt="<?php $clang->eT("Email") ?>";
Expand Down Expand Up @@ -136,7 +140,7 @@
var deletefrompanel = "<?php $clang->eT("Delete participant(s) from central participants panel only", 'js') ?>";
var deletefrompanelandtoken = "<?php $clang->eT("Delete participant(s) from central panel and tokens tables", 'js') ?>";
var deletefrompaneltokenandresponse = "<?php $clang->eT("Delete participant(s) from central panel, tokens tables and all associated responses", 'js') ?>";
var deleteMsg = "<br/>"+deletefrompanelmsg+"<br/><br/><center><ol id='selectable' class='selectable' ><li class='ui-widget-content' id='po'>"+deletefrompanel+"</li><li class='ui-widget-content' id='ptt'>"+deletefrompanelandtoken+"</li><li class='ui-widget-content' id='ptta'>"+deletefrompaneltokenandresponse+"</li></ol></center>";
var deleteMsg = "<br/>"+deletefrompanelmsg+"<br/><br/><ol id='selectable' class='selectable' ><li class='ui-widget-content' id='po'>"+deletefrompanel+"</li><li class='ui-widget-content' id='ptt'>"+deletefrompanelandtoken+"</li><li class='ui-widget-content' id='ptta'>"+deletefrompaneltokenandresponse+"</li></ol>";
var searchBtn = "<?php $clang->eT("Search", 'js') ?>";
var shareMsg = "<?php $clang->eT("You can see and edit settings for shared participants in share panel.", 'js') ?>"; //PLEASE REVIEW
var jsonUrl = "<?php echo Yii::app()->getController()->createUrl("admin/participants/".$urlsearch); ?>";
Expand Down
6 changes: 6 additions & 0 deletions scripts/admin/admin_core.js
Expand Up @@ -702,3 +702,9 @@ function js2php(object){
return json.substr(0,json.length-1)+ "}";
}

jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
return this;
}
29 changes: 23 additions & 6 deletions scripts/admin/displayParticipant.js
Expand Up @@ -267,19 +267,36 @@ $(document).ready(function() {
jQuery("#displayparticipants").jqGrid(
'navGrid',
'#pager',
{add:true,del:true,edit:false,refresh: true,search: false,
addtitle: createParticipantTxt, deltitle: deleteParticipantTxt, refreshtitle: refreshListTxt},
{},
{width : 400},
{msg:deleteMsg, width : 700,
{add:true,
del:true,
edit:false,
refresh: true,
search: false,
addtitle: createParticipantTxt,
deltitle: deleteParticipantTxt,
refreshtitle: refreshListTxt},
{}, //Default settings for edit
{
width : 500,
addCaption: sAddCaption,
bSubmit: sAddButtonCaption,
bCancel: sCancel,
afterShowForm: function(form) {
form.closest('div.ui-jqdialog').center();
}
}, //default settings for add
{msg:deleteMsg,
bCancel: sCancel,
bSubmit: sDeleteButtonCaption,
width : 900,
afterShowForm: function($form) {
/* This code sets the position of the delete dialog to just below the last selected item */
/* Unless this would put the delete dialog off the page, in which case it will be pushed up a bit */
var dialog = $form.closest('div.ui-jqdialog'),
selRowId = jQuery("#displayparticipants").jqGrid('getGridParam', 'selrow'),
selRowCoordinates = $('#'+selRowId).offset();
selRowCoordinates.top=selRowCoordinates.top+25;
selRowCoordinates.left=50;
selRowCoordinates.left=100;
if(selRowCoordinates.top+325 > $(window).height()) {
selRowCoordinates.top=selRowCoordinates.top-325;
}
Expand Down

0 comments on commit bebd197

Please sign in to comment.