Skip to content

Commit

Permalink
Dev Fixed problematic comments
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Nov 23, 2017
1 parent 2a60fee commit 64c24bb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 22 deletions.
5 changes: 2 additions & 3 deletions application/controllers/admin/dataentry.php
Expand Up @@ -180,8 +180,7 @@ private function _getFieldInfo($aFileContents)
$aFieldnames = explode("\t", trim($aFileContents[1]));

$nbOfFields = count($aFieldnames) - 1;
while (trim($aFieldnames[$nbOfFields]) == "" && $nbOfFields > -1) // get rid of blank entries
{
while (trim($aFieldnames[$nbOfFields]) == "" && $nbOfFields > -1) { // get rid of blank entries
unset($aFieldnames[$nbOfFields]);
$nbOfFields--;
}
Expand Down Expand Up @@ -682,7 +681,7 @@ public function editdata($subaction, $id, $surveyid, $language = '')
$aDataentryoutput .= '<span class="five-point">';
$aDataentryoutput .= CHtml::radioButton($fname['fieldname'], $checked, array('class'=>'', 'value'=>$i, 'id'=>'5-point-choice-'.$i));
$aDataentryoutput .= '<label for="5-point-choice-'.$i.'">'.$i.'</label>';
$aDataentryoutput .= '</span>   ';
$aDataentryoutput .= '</span>   ';
}
break;
case "D": //DATE
Expand Down
12 changes: 4 additions & 8 deletions application/controllers/admin/participantsaction.php
Expand Up @@ -827,8 +827,7 @@ public function uploadCSV()
{
$uploadcharset = 'auto';
}
foreach ($tokenlistarray as $buffer) //Iterate through the CSV file line by line
{
foreach ($tokenlistarray as $buffer) { //Iterate through the CSV file line by line
$buffer = @mb_convert_encoding($buffer, "UTF-8", $uploadcharset);
if ($recordcount == 0) {
//The first time we iterate through the file we look at the very
Expand Down Expand Up @@ -1061,8 +1060,7 @@ public function exporttocsv()
{
$this->checkPermission('export');

if (Yii::app()->request->getPost('searchcondition', '') !== '') // if there is a search condition then only the participants that match the search criteria are counted
{
if (Yii::app()->request->getPost('searchcondition', '') !== '') { // if there is a search condition then only the participants that match the search criteria are counted
$condition = explode("%7C%7C", Yii::app()->request->getPost('searchcondition', ''));
$search = Participant::model()->getParticipantsSearchMultipleCondition($condition);
}
Expand Down Expand Up @@ -1103,8 +1101,7 @@ public function exporttocsvcount()
$searchconditionurl = basename($searchconditionurl);

$search = new CDbCriteria;
if ($searchconditionurl != 'getParticipants_json') // if there is a search condition then only the participants that match the search criteria are counted
{
if ($searchconditionurl != 'getParticipants_json') { // if there is a search condition then only the participants that match the search criteria are counted
$condition = explode("||", $searchcondition);
$search = Participant::model()->getParticipantsSearchMultipleCondition($condition);
} else {
Expand Down Expand Up @@ -1943,8 +1940,7 @@ public function getSearchIDs()
* EG: fname||eq||jason||lname||ct||c
*
*/
if ($sSearchURL != 'getParticipants_json') // if there is a search condition present
{
if ($sSearchURL != 'getParticipants_json') { // if there is a search condition present
$participantid = "";
$condition = explode("||", $searchcondition); // explode the condition to the array
$query = Participant::model()->getParticipantsSearchMultiple($condition, 0, 0);
Expand Down
12 changes: 6 additions & 6 deletions application/controllers/admin/questions.php
Expand Up @@ -938,8 +938,7 @@ public function getSubquestionRow($surveyid, $gid, $qid, $codes, $language, $fir
{
$currentCharacter = substr($stringCode, -$n, 1); // get the current character

if (ctype_digit($currentCharacter)) // check if it's numerical
{
if (ctype_digit($currentCharacter)) { // check if it's numerical
$numericSuffix = $currentCharacter.$numericSuffix; // store it in a string
$n = $n + 1;
}
Expand Down Expand Up @@ -1226,8 +1225,9 @@ public function index($sa, $surveyid, $gid, $qid = null)

foreach ($egresult as $esrow)
{
if (!array_key_exists($esrow->language, $questlangs)) // Language Exists, BUT ITS NOT ON THE SURVEY ANYMORE.
if (!array_key_exists($esrow->language, $questlangs)) { // Language Exists, BUT ITS NOT ON THE SURVEY ANYMORE.
$esrow->delete();
}
else
$questlangs[$esrow->language] = 99;

Expand Down Expand Up @@ -1559,7 +1559,7 @@ public function setMultipleQuestionGroup()
$oQuestionGroup = QuestionGroup::model()->find('gid=:gid', array(':gid'=>$iGid)); // The New Group object
$oSurvey = $oQuestionGroup->survey; // The Survey associated with this group

if (Permission::model()->hasSurveyPermission($oSurvey->sid, 'surveycontent', 'update')) // Permissions check
if (Permission::model()->hasSurveyPermission($oSurvey->sid, 'surveycontent', 'update'))
{
if ($oSurvey->active == 'N') // If survey is active it should not be possible to update
{
Expand Down Expand Up @@ -1616,7 +1616,7 @@ public function setMultipleMandatory()
$iSid = Yii::app()->request->getPost('sid');
$bMandatory = (Yii::app()->request->getPost('mandatory') === 'true') ? 'Y' : 'N';

if (Permission::model()->hasSurveyPermission($iSid, 'surveycontent', 'update')) // Permissions check
if (Permission::model()->hasSurveyPermission($iSid, 'surveycontent', 'update'))
{
$oSurvey = Survey::model()->findByPk($iSid);
$aSurveyLanguages = $oSurvey->additionalLanguages;
Expand Down Expand Up @@ -1650,7 +1650,7 @@ public function setMultipleOther()
$iSid = $_POST['sid'];
$bOther = (Yii::app()->request->getPost('other') === 'true') ? 'Y' : 'N';

if (Permission::model()->hasSurveyPermission($iSid, 'surveycontent', 'update')) // Permissions check
if (Permission::model()->hasSurveyPermission($iSid, 'surveycontent', 'update'))
{
$oSurvey = Survey::model()->findByPk($iSid);
$aSurveyLanguages = $oSurvey->additionalLanguages;
Expand Down
7 changes: 4 additions & 3 deletions application/core/LSYii_Controller.php
Expand Up @@ -99,9 +99,10 @@ protected function _init()
if ($dieoutput != '')
throw new CException($dieoutput);

if (ini_get("max_execution_time") < 1200) @set_time_limit(1200); // Maximum execution time - works only if safe_mode is off
if (ini_get('memory_limit') != -1 && convertPHPSizeToBytes(ini_get("memory_limit")) < convertPHPSizeToBytes(Yii::app()->getConfig('memory_limit').'M'))
{
if (ini_get("max_execution_time") < 1200) {
@set_time_limit(1200); // Maximum execution time - works only if safe_mode is off
}
if (ini_get('memory_limit') != -1 && convertPHPSizeToBytes(ini_get("memory_limit")) < convertPHPSizeToBytes(Yii::app()->getConfig('memory_limit').'M')) {
@ini_set("memory_limit", Yii::app()->getConfig('memory_limit').'M'); // Set Memory Limit for big surveys
}

Expand Down
3 changes: 1 addition & 2 deletions application/core/UserIdentity.php
Expand Up @@ -48,8 +48,7 @@ public function authenticate($sOneTimePassword = '')
$this->errorCode = self::ERROR_NONE;
}
}
elseif (Yii::app()->getConfig("auth_webserver") === true && (isset($_SERVER['PHP_AUTH_USER']) || isset($_SERVER['LOGON_USER']) || isset($_SERVER['REMOTE_USER']))) // normal login through webserver authentication
{
elseif (Yii::app()->getConfig("auth_webserver") === true && (isset($_SERVER['PHP_AUTH_USER']) || isset($_SERVER['LOGON_USER']) || isset($_SERVER['REMOTE_USER']))) { // normal login through webserver authentication
if (isset($_SERVER['PHP_AUTH_USER'])) {
$sUser = $_SERVER['PHP_AUTH_USER'];
}
Expand Down

0 comments on commit 64c24bb

Please sign in to comment.