Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Mar 11, 2013
2 parents 9ca37cc + 6d2edb0 commit 03295ca
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 57 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/surveyadmin.php
Expand Up @@ -481,7 +481,7 @@ public function activate($iSurveyID)
}
$aViewUrls['output'].="<p>" .
$clang->gT("Database error!!")."\n <font color='red'>" ."</font>\n" .
"<pre>".implode(' ', $aResult['error'])."</pre>\n
"<pre>".var_export ($aResult['error'],true)."</pre>\n
<a href='".Yii::app()->getController()->createUrl("admin/survey/sa/view/surveyid/".$iSurveyID)."'>".$clang->gT("Main Admin Screen")."</a>\n</div>" ;
}
else
Expand Down
55 changes: 25 additions & 30 deletions application/helpers/admin/label_helper.php
Expand Up @@ -157,7 +157,7 @@ function modlabelsetanswers($lid)

if ($ajax)
$lid = insertlabelset();

$aErrors=array();
if (count(array_unique($data->{'codelist'})) == count($data->{'codelist'}))
{

Expand All @@ -178,38 +178,33 @@ function modlabelsetanswers($lid)

$strTemp = 'text_'.$lang;
$title = $codeObj->$strTemp;

$p = new CHtmlPurifier();

if (Yii::app()->getConfig('filterxsshtml'))
$title = $p->purify($title);
$sortorder = $index;

$oLabel = new Label();
$oLabel->lid=$lid;
$oLabel->code=$actualcode;
$oLabel->title=$title;
$oLabel->sortorder=$sortorder;
$oLabel->assessment_value=$assessmentvalue;
$oLabel->language=$lang;
if($oLabel->validate())
{
$result=$oLabel->save();
}
else
$title = html_entity_decode($title, ENT_QUOTES, "UTF-8");


// Fix bug with FCKEditor saving strange BR types
$title = fixCKeditorText($title);
$sort_order = $index;

$insertdata = array(
'lid' => $lid,
'code' => $actualcode,
'title' => $title,
'sortorder' => $sort_order,
'assessment_value' => $assessmentvalue,
'language' => $lang
);

//$query = "INSERT INTO ".db_table_name('labels')." (`lid`,`code`,`title`,`sortorder`, `assessment_value`, `language`)
// VALUES('$lid',$actualcode,$title,$sort_order,$assessmentvalue,$lang)";

$result = Yii::app()->db->createCommand()->insert('{{labels}}', $insertdata);
{
$aErrors[]=$oLabel->getErrors();
}
}
}


Yii::app()->session['flashmessage'] = $clang->gT("Labels sucessfully updated");

if(count($aErrors))
{
Yii::app()->session['flashmessage'] = $clang->gT("Labels updated but with some error");
}
else
{
Yii::app()->session['flashmessage'] = $clang->gT("Labels sucessfully updated");
}
}
else
{
Expand Down
46 changes: 33 additions & 13 deletions application/models/Label.php
Expand Up @@ -40,21 +40,41 @@ public function tableName()
*/
public function primaryKey()
{
return 'lid';
return 'lid,language';
}
/**
* Returns the static model of Settings table
*
* @static
* @access public
* @param string $class
* @return CActiveRecord
*/
public static function model($class = __CLASS__)
{
return parent::model($class);
}

/**
* Returns this model's validation rules
*
*/
public function rules()
{
return array(
array('lid','numerical', 'integerOnly'=>true),
array('code', 'unique', 'caseSensitive'=>true, 'criteria'=>array(
'condition'=>'lid = :lid AND language=:language',
'params'=>array(':lid'=>$this->lid,':language'=>$this->language)
),
'message'=>'{attribute} "{value}" is already in use.'),
array('title','LSYii_Validators'),
array('sortorder','numerical', 'integerOnly'=>true,'allowEmpty'=>true),
array('language','length', 'min' => 2, 'max'=>20),// in array languages ?
array('assessment_value','numerical', 'integerOnly'=>true,'allowEmpty'=>true),
);
}

/**
* Returns the static model of Settings table
*
* @static
* @access public
* @param string $class
* @return CActiveRecord
*/
public static function model($class = __CLASS__)
{
return parent::model($class);
}

function getAllRecords($condition=FALSE)
{
Expand Down
26 changes: 13 additions & 13 deletions locale/_template/limesurvey.pot
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: LimeSurvey language file\n"
"Report-Msgid-Bugs-To: http://translate.limesurvey.org/\n"
"POT-Creation-Date: 2013-03-08 23:05:58+00:00\n"
"POT-Creation-Date: 2013-03-09 23:05:56+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -1678,7 +1678,7 @@ msgstr ""
#: application/controllers/admin/question.php:54
#: application/controllers/admin/questiongroup.php:55
#: application/controllers/admin/surveyadmin.php:262
#: application/controllers/admin/surveyadmin.php:891
#: application/controllers/admin/surveyadmin.php:901
#: application/controllers/admin/templates.php:142
#: application/controllers/admin/templates.php:257
msgid "An error occurred uploading your file. This may be caused by incorrect permissions in your %s folder."
Expand Down Expand Up @@ -2788,7 +2788,7 @@ msgid "Remaining"
msgstr ""

#: application/controllers/admin/responses.php:58
#: application/controllers/admin/surveyadmin.php:951
#: application/controllers/admin/surveyadmin.php:947
#: application/core/Survey_Common_Action.php:363
#: application/core/Survey_Common_Action.php:517
msgid "Invalid survey ID"
Expand Down Expand Up @@ -3035,25 +3035,25 @@ msgstr ""
msgid "Survey copy summary"
msgstr ""

#: application/controllers/admin/surveyadmin.php:910
#: application/controllers/admin/surveyadmin.php:906
msgid "Import failed. You specified an invalid file type '%s'."
msgstr ""

#: application/controllers/admin/surveyadmin.php:946
#: application/controllers/admin/surveyadmin.php:942
msgid "No survey ID has been provided. Cannot copy survey"
msgstr ""

#: application/controllers/admin/surveyadmin.php:956
#: application/controllers/admin/surveyadmin.php:952
#: application/views/admin/participants/blacklist_view.php:73
#: application/views/admin/participants/userControl_view.php:43
msgid "You don't have sufficient permissions."
msgstr ""

#: application/controllers/admin/surveyadmin.php:1098
#: application/controllers/admin/surveyadmin.php:1094
msgid "The new question group/question order was successfully saved."
msgstr ""

#: application/controllers/admin/surveyadmin.php:1370
#: application/controllers/admin/surveyadmin.php:1366
#: application/views/admin/labels/labelview_view.php:138
#: application/views/admin/labels/labelview_view.php:147
#: application/views/admin/survey/Question/editQuestion_view.php:283
Expand All @@ -3065,26 +3065,26 @@ msgstr ""
msgid "Please select a file to import!"
msgstr ""

#: application/controllers/admin/surveyadmin.php:1373
#: application/controllers/admin/surveyadmin.php:1369
#: application/views/admin/labels/labelview_view.php:147
#: application/views/admin/templates/importform_view.php:17
msgid "zip library not supported by PHP, Import ZIP Disabled"
msgstr ""

#: application/controllers/admin/surveyadmin.php:1398
#: application/controllers/admin/surveyadmin.php:1394
msgid "The survey was successfully expired by setting an expiration date in the survey settings."
msgstr ""

#: application/controllers/admin/surveyadmin.php:1440
#: application/controllers/admin/surveyadmin.php:1436
#: application/views/admin/survey/editSurvey_view.php:37
msgid "(No target question)"
msgstr ""

#: application/controllers/admin/surveyadmin.php:1523
#: application/controllers/admin/surveyadmin.php:1519
msgid "Survey could not be created because it did not have a title"
msgstr ""

#: application/controllers/admin/surveyadmin.php:1655
#: application/controllers/admin/surveyadmin.php:1651
msgid "Survey was successfully added."
msgstr ""

Expand Down
Binary file modified locale/de-informal/LC_MESSAGES/de-informal.mo
Binary file not shown.
Binary file modified locale/de/LC_MESSAGES/de.mo
Binary file not shown.
Binary file modified locale/el/LC_MESSAGES/el.mo
Binary file not shown.
Binary file modified locale/fr/LC_MESSAGES/fr.mo
Binary file not shown.
Binary file modified locale/vi/LC_MESSAGES/vi.mo
Binary file not shown.
6 changes: 6 additions & 0 deletions scripts/admin/attributeMap.js
Expand Up @@ -14,6 +14,12 @@ $(document).ready(function(){
$('#tokenattribute').css({'height' : height-200});
$('#centralattribute').css({'height' : height-200});
$('#newcreated').css({'height' : height-200});
var ncHeadingHeight = $('#newcreated .heading').outerHeight();
$('.newcreate').css({
'padding-bottom':0,
'min-height':$('#newcreated').height()-ncHeadingHeight-5
});

$("#overwrite").click(function(){
if($("#overwrite").is(':checked')) {attoverwrite=true;} else {attoverwrite=false;}
});
Expand Down
10 changes: 10 additions & 0 deletions scripts/admin/attributeMapToken.js
Expand Up @@ -13,6 +13,16 @@ $(document).ready(function(){
$('#tokenattribute').css({ 'height' : height-200});
$('#centralattribute').css({ 'height' : height-200});
$('#newcreated').css({ 'height' : height-200});
var ncHeadingHeight = $('#newcreated .heading').outerHeight();
$('.newcreate').css({
'padding-bottom':0,
'min-height':$('#newcreated').height()-ncHeadingHeight-5
});
var taHeadingHeight = $('#tokenattribute .heading').outerHeight();
$('#tokenatt').css({
'min-height':$('#tokenattribute').height()-taHeadingHeight-5
});

$("#tokenatt").sortable({ connectWith:'.centralatt,.newcreate',helper: 'clone',appendTo: 'body'});
$("ul.centralatt").sortable({
helper: 'clone',
Expand Down

0 comments on commit 03295ca

Please sign in to comment.