Navigation Menu

Skip to content

Commit

Permalink
Merge branch '2.05' of github.com:LimeSurvey/LimeSurvey into 2.05
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Mar 29, 2013
2 parents 924db29 + f07957d commit 8787423
Show file tree
Hide file tree
Showing 73 changed files with 48 additions and 18,237 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -11,4 +11,5 @@
/upload/.htaccess
/nbproject
/tmp/assets/*
.svn
.svn
/third_party/jqgrid/src
2 changes: 1 addition & 1 deletion application/controllers/admin/participantsaction.php
Expand Up @@ -243,7 +243,7 @@ function displayParticipants()
'tokensurveynames' => $tSurveyNames,
'urlsearch' => $urlSearch
);

App()->getClientScript()->registerPackage('jqueryui');
App()->getClientScript()->registerPackage('jqgrid');
App()->getClientScript()->registerPackage('jquery-multiselect');
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('adminstyleurl') . 'displayParticipants.css');
Expand Down
12 changes: 6 additions & 6 deletions application/helpers/qanda_helper.php
Expand Up @@ -4634,7 +4634,7 @@ function do_array_yesnouncertain($ia)
$answer_t_content .= CHECKED;
}
// --> START NEW FEATURE - SAVE
$answer_t_content .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n</label>\n\t</td>\n"
$answer_t_content .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n\t</td>\n"
. "\t<td class=\"answer_cell_N answer-item radio-item\">\n"
. "<label class=\"hide read\" for=\"answer$myfname-N\">".$clang->gT('No')."</label>\n"
. "<input class=\"radio\" type=\"radio\" name=\"$myfname\" id=\"answer$myfname-N\" value=\"N\" ";
Expand Down Expand Up @@ -4803,7 +4803,7 @@ function do_array_increasesamedecrease($ia)
$answer_body .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n"
. "\t</td>\n"
. "\t<td class=\"answer_cell_D answer-item radio-item\">\n"
. "<label class=\"hide read\" for=\"answer$myfname-D\">".$clang->gT('Decrease')."<label>\n"
. "<label class=\"hide read\" for=\"answer$myfname-D\">".$clang->gT('Decrease')."</label>\n"
. "\t<input class=\"radio\" type=\"radio\" name=\"$myfname\" id=\"answer$myfname-D\" value=\"D\" ";
// --> END NEW FEATURE - SAVE
if (isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == 'D')
Expand All @@ -4820,7 +4820,7 @@ function do_array_increasesamedecrease($ia)
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
{
$answer_body .= "\t<td class=\"answer-item radio-item noanswer-item\">\n"
. "<label class=\"hide read\" for=\"answer$myfname-\">".$clang->gT('No answer')."<label>\n"
. "<label class=\"hide read\" for=\"answer$myfname-\">".$clang->gT('No answer')."</label>\n"
. "\t<input class=\"radio\" type=\"radio\" name=\"$myfname\" id=\"answer$myfname-\" value=\"\" ";
if (!isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == '')
{
Expand Down Expand Up @@ -5024,7 +5024,7 @@ function do_array($ia)
$answer .= CHECKED;
}
// --> START NEW FEATURE - SAVE
$answer .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n</label>\n\t</td>\n";
$answer .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n\t</td>\n";
// --> END NEW FEATURE - SAVE
}

Expand Down Expand Up @@ -6052,7 +6052,7 @@ function do_arraycolumns($ia)
// because I think $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] is always set (by save.php ??) !
// should remove the !isset part I think !!
}
$answer .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n</label>\n\t</td>\n";
$answer .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n\t</td>\n";
}
unset($trbc);
$answer .= "</tr>\n";
Expand Down Expand Up @@ -6500,7 +6500,7 @@ function do_array_dual($ia)
{
$answer .= "\t</colgroup>\n";
}
$answer .= "\t<col class=\"ddarrayseparator\"{$separatorwidth} />\n";
$answer .= "\t<col class=\"ddarrayseparator\" width=\"{$separatorwidth}%\" />\n";
if($ddprefix != '' || $ddsuffix != '')
{
$answer .= "\t<colgroup width=\"$cellwidth%\">\n";
Expand Down
9 changes: 8 additions & 1 deletion application/models/Participant.php
Expand Up @@ -371,7 +371,14 @@ function deleteParticipants($rows, $bFilter=true)
{
$aParticipantsIDs=$this->filterParticipantIDs($aParticipantsIDs);
}

foreach($aParticipantsIDs as $aID){
$oParticipant=Participant::model()->findByPk($aID);
if ($oParticipant)
{
$oParticipant->delete();
}
}

Yii::app()->db->createCommand()->delete(Participant::model()->tableName(), array('in', 'participant_id', $aParticipantsIDs));

// Delete survey links
Expand Down
31 changes: 29 additions & 2 deletions plugins/AuditLog/AuditLog.php
Expand Up @@ -16,6 +16,7 @@ public function __construct(PluginManager $manager, $id) {
$this->subscribe('beforeUserDelete');
$this->subscribe('beforePermissionSetSave');
$this->subscribe('beforeParticipantSave');
$this->subscribe('beforeParticipantDelete');
}

/**
Expand All @@ -36,6 +37,7 @@ public function beforePermissionSetSave(PluginEvent $event)
$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$oCurrentUser->uid;
$oAutoLog->entity='permission';
$oAutoLog->entityid=$aNewPermissions['uid'].'-'.$aNewPermissions['sid'];
$oAutoLog->action=$sAction;
$oAutoLog->oldvalues=json_encode(array_diff_assoc_recursive($oOldPermission,$aNewPermissions));
$oAutoLog->newvalues=json_encode(array_diff_assoc_recursive($aNewPermissions,$oOldPermission));
Expand Down Expand Up @@ -64,18 +66,41 @@ public function beforeParticipantSave(PluginEvent $event)

if (count(array_diff_assoc($aNewValues,$aOldValues)))
{

$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$oCurrentUser->uid;
$oAutoLog->entity='participant';
$oAutoLog->action='update';
$oAutoLog->entityid=$aNewValues['participant_id'];
$oAutoLog->oldvalues=json_encode(array_diff_assoc($aOldValues,$aNewValues));
$oAutoLog->newvalues=json_encode(array_diff_assoc($aNewValues,$aOldValues));
$oAutoLog->fields=implode(',',array_keys(array_diff_assoc($aNewValues,$aOldValues)));
$oAutoLog->save();
}
}

/**
* Function catches if a participant was modified or created
* All data is saved - only the password hash is anonymized for security reasons
*
* @param PluginEvent $event
*/
public function beforeParticipantDelete(PluginEvent $event)
{
$oNewParticipant=$event->getSender();
$oCurrentUser=$this->api->getCurrentUser();

$aValues=$oNewParticipant->getAttributes();

$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$oCurrentUser->uid;
$oAutoLog->entity='participant';
$oAutoLog->action='delete';
$oAutoLog->entityid=$aValues['participant_id'];
$oAutoLog->oldvalues=json_encode($aValues);
$oAutoLog->fields=implode(',',array_keys($aValues));
$oAutoLog->save();
}


/**
* Function catches if a user was modified or created
Expand Down Expand Up @@ -109,10 +134,10 @@ public function beforeUserSave(PluginEvent $event)

if (count(array_diff_assoc($aNewValues,$aOldValues)))
{

$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$oCurrentUser->uid;
$oAutoLog->entity='user';
if ($sAction=='update') $oAutoLog->entityid=$oOldUser['uid'];
$oAutoLog->action=$sAction;
$oAutoLog->oldvalues=json_encode(array_diff_assoc($aOldValues,$aNewValues));
$oAutoLog->newvalues=json_encode(array_diff_assoc($aNewValues,$aOldValues));
Expand All @@ -133,6 +158,7 @@ public function beforeUserDelete(PluginEvent $event)
$oAutoLog = $this->api->newModel($this, 'log');
$oAutoLog->uid=$oCurrentUser->uid;
$oAutoLog->entity='user';
$oAutoLog->entityid=$oOldUser['uid'];
$oAutoLog->action='delete';
$oAutoLog->oldvalues=json_encode($aOldValues);
$oAutoLog->fields=implode(',',array_keys($aOldValues));
Expand All @@ -150,6 +176,7 @@ public function beforeActivate(PluginEvent $event)
'created'=>'datetime',
'uid'=>'string',
'entity'=>'string',
'entityid'=>'string',
'action'=>'string',
'fields'=>'text',
'oldvalues'=>'text',
Expand Down
2 changes: 1 addition & 1 deletion scripts/admin/displayParticipant.js
Expand Up @@ -333,7 +333,7 @@ $(document).ready(function() {
{
caption:"",
title: fullSearchTitle,
buttonicon:'searchicon',
buttonicon:'ui-icon-search',
onClickButton:function(){
var dialog_buttons={};
dialog_buttons[searchBtn]=function(){
Expand Down
5 changes: 0 additions & 5 deletions styles/blobblueish/displayParticipants.css
@@ -1,8 +1,3 @@
.ui-icon.searchicon {
width: 16px;
height: 16px;
background-image:url('images/search.gif');
}
#selectable .ui-selecting { background: #7FFFD4; }
#selectable .ui-selected { background: #5CB3FF; color: #000000; }
#selectable { list-style-type: none; margin: 2px; padding: 0; width: 90%; }
Expand Down
5 changes: 0 additions & 5 deletions styles/gringegreen/displayParticipants.css
@@ -1,8 +1,3 @@
.ui-icon.searchicon {
width: 16px;
height: 16px;
background-image:url('images/search.gif');
}
#selectable .ui-selecting { background: #8CCE00; }
#selectable .ui-selected { background: #C1DD7F; color: #000000; }
#selectable { list-style-type: none; margin: 2px; padding: 0; width: 90%; }
Expand Down
1 change: 1 addition & 0 deletions styles/gringegreen/jquery-ui/jquery-ui.css
Expand Up @@ -799,6 +799,7 @@ body .ui-tooltip {
.ui-widget-content {
border: 0px solid #cdf078;
color: #666;
background-color: #fff;
}
.ui-widget-content a {
color: #666;
Expand Down

0 comments on commit 8787423

Please sign in to comment.