Skip to content

Commit

Permalink
Dev: Add phpdoc; indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Sep 23, 2016
1 parent 28fcc79 commit 0db0891
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 79 deletions.
25 changes: 19 additions & 6 deletions application/controllers/admin/participantsaction.php
Expand Up @@ -1337,7 +1337,8 @@ public function openAddToSurvey()
* 'ParticipantAttributeNameLanguages' (array),
* 'ParticipantAttributeNamesDropdown' (array|null),
* 'oper' (string) ['edit'|'new']
* @return json-encoded array 'success' (array), 'successMessage' (string)
* Echoes json-encoded array 'success' (array), 'successMessage' (string)
* @return void
*/
public function editAttributeName()
{
Expand Down Expand Up @@ -1392,7 +1393,8 @@ public function editAttributeName()
/**
* Deletes a translation from an Attribute, if it has at least one translation
* Requires POST 'attribute_id' (int), 'lang' (string) [language-code]
* @return 'success' (boolean), 'successMessage' (string|null), 'errorMessage' (string|null)
* Echoes 'success' (boolean), 'successMessage' (string|null), 'errorMessage' (string|null)
* @return void
*/
public function deleteLanguageFromAttribute()
{
Expand All @@ -1418,7 +1420,8 @@ public function deleteLanguageFromAttribute()
/**
* Deletes a single Attribute via AJAX-call
* Requires POST 'attribute_id' (int)
* @return json-encoded array 'success' (boolean), successMessage (string)
* Echoes json-encoded array 'success' (boolean), successMessage (string)
* @return void
*/
public function deleteSingleAttribute()
{
Expand Down Expand Up @@ -1750,7 +1753,7 @@ public function sharePanel()
* Sends the shared participant info to the share panel using JSON encoding
* Called after the share panel grid is loaded
* Returns the json depending on the user logged in by checking it from the session
* @return JSON encoded string containg sharing information
* @return void
*/
public function getShareInfo_json()
{
Expand Down Expand Up @@ -1832,6 +1835,9 @@ public function editShareInfo()
}
}

/**
* @return string HTML
*/
private function generateExtraAttributeEditHtml($name, $value, $attribute, $model)
{
$attributes_control_group_text_template =
Expand Down Expand Up @@ -1910,7 +1916,8 @@ private function generateExtraAttributeEditHtml($name, $value, $attribute, $mode
* Receives an ajax call containing the participant id in the fourth segment of the url
* Supplies list of survey links - surveys of which this participant is on the tokens table
* URL: [localurl]/limesurvey/admin/participants/getSurveyInfo_json/pid/[participant_id]
* RETURNS: json data containing linked survey information (Survey name, survey id, token_id and date_added)
* Echoes json data containing linked survey information (Survey name, survey id, token_id and date_added)
* @return void
*/
public function getSurveyInfo_json()
{
Expand Down Expand Up @@ -2002,18 +2009,21 @@ public function getSearchIDs()

/**
* Equal to getParticipants_json() but now with a search
* @return void
*/
public function getParticipantsResults_json()
{
$searchcondition = Yii::app()->request->getpost('searchcondition');
$finalcondition = array();
$condition = explode("||", $searchcondition);
$search = Participant::model()->getParticipantsSearchMultipleCondition($condition);
return $this->getParticipants_json($search);
$this->getParticipants_json($search);
}

/*
* Sends the data in JSON format extracted from the database to be displayed using the jqGrid
* Echoes json
* @return void
*/
public function getParticipants_json($search = null)
{
Expand Down Expand Up @@ -2095,6 +2105,8 @@ public function summaryview()

/**
* Responsible for setting the session variables for attribute map page redirect
* @todo Use user session?
* @todo Used?
*/
public function setSession()
{
Expand Down Expand Up @@ -2314,6 +2326,7 @@ public function addToTokenattmap()
return;
}

// TODO: This code can't be reached
echo "<p>";
printf(gT("%s participants have been copied to the survey token table"), "<span class='badge alert-success'>" . $response['success'] . "</span>");
echo "</p>";
Expand Down

0 comments on commit 0db0891

Please sign in to comment.