Skip to content

Commit

Permalink
Dev: clean common_helper from unused things (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonisOrmisson authored and Shnoulle committed Jul 7, 2017
1 parent 5e55aa3 commit da93c70
Show file tree
Hide file tree
Showing 7 changed files with 283 additions and 967 deletions.
6 changes: 3 additions & 3 deletions application/controllers/admin/tokens.php
Expand Up @@ -459,7 +459,7 @@ public function editToken($iSurveyId)
'usesleft' => flattenText(Yii::app()->request->getPost('usesleft')),
'validfrom' => $from,
'validuntil' => $until);
$attrfieldnames = GetParticipantAttributes($iSurveyId);
$attrfieldnames = getParticipantAttributes($iSurveyId);
foreach ($attrfieldnames as $attr_name => $desc)
{
$value = flattenText(Yii::app()->request->getPost($attr_name));
Expand Down Expand Up @@ -947,7 +947,7 @@ public function addDummies($iSurveyId, $subaction = '')
$aData['surveyid'] = $iSurveyId;
$aData['tokenlength'] = $iTokenLength;
$aData['dateformatdetails'] = getDateFormatData(Yii::app()->session['dateformat'],App()->language);
$aData['aAttributeFields']=GetParticipantAttributes($iSurveyId);
$aData['aAttributeFields']=getParticipantAttributes($iSurveyId);
$this->_renderWrappedTemplate('token', array( 'dummytokenform'), $aData);
}
}
Expand Down Expand Up @@ -2094,7 +2094,7 @@ public function import($iSurveyId)
if(Yii::app()->request->getPost('showwarningtoken')){
$aMissingAttrFieldName = array_diff($aAttrFieldNames, $aFirstLine);
// get list of mandatory attributes
$allAttrFieldNames = GetParticipantAttributes($iSurveyId);
$allAttrFieldNames = getParticipantAttributes($iSurveyId);
//if it isn't mandantory field we don't need to show in warning
if(!empty($aAttrFieldNames)){
if(!empty($aMissingAttrFieldName)){
Expand Down
2 changes: 1 addition & 1 deletion application/core/Survey_Common_Action.php
Expand Up @@ -811,7 +811,7 @@ function _surveybar($aData)
$aData['surveysecurity'] = Permission::model()->hasSurveyPermission($iSurveyID, 'surveysecurity', 'read');
// CHANGE QUESTION GROUP ORDER BUTTON
$aData['surveycontentread'] = Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'read');
$aData['groupsum'] = (getGroupSum($iSurveyID, $surveyinfo['language']) > 1);
$aData['groupsum'] = ($oSurvey->groupsCount > 1);
// SET SURVEY QUOTAS BUTTON
$aData['quotas'] = Permission::model()->hasSurveyPermission($iSurveyID, 'quotas', 'read');
// Assessment menu item
Expand Down
3 changes: 2 additions & 1 deletion application/helpers/admin/export/CsvWriter.php
Expand Up @@ -103,6 +103,7 @@ public function close()
*/
protected function csvEscape($value)
{
return CSVEscape($value);
$sString = preg_replace(array('~\R~u'), array(PHP_EOL), $value);
return '"' . str_replace('"','""', $sString) . '"';
}
}

0 comments on commit da93c70

Please sign in to comment.