diff --git a/application/helpers/questionHelper.php b/application/helpers/questionHelper.php index d94f6933570..7e5a3d3cb0f 100644 --- a/application/helpers/questionHelper.php +++ b/application/helpers/questionHelper.php @@ -1590,10 +1590,14 @@ public static function getQuestionThemeAttributeValues($sQuestionThemeName = nul { libxml_disable_entity_loader(false); - $xml_config = simplexml_load_file(Yii::app()->getConfig('corequestionthemerootdir').'/'.$sQuestionThemeName.'/survey/questions/answer/'.$question_template.'/config.xml'); + $sCoreThemeXmlPath = Yii::app()->getConfig('corequestionthemerootdir').'/'.$sQuestionThemeName.'/survey/questions/answer/'.$question_template.'/config.xml'; + $sUserThemeXmlPath = Yii::app()->getConfig("userquestionthemerootdir").'/'.$sQuestionThemeName.'/survey/questions/answer/'.$question_template.'/config.xml'; + + $xml_config = is_file($sCoreThemeXmlPath) ? simplexml_load_file($sCoreThemeXmlPath) : simplexml_load_file($sUserThemeXmlPath); $custom_attributes = json_decode(json_encode((array)$xml_config->custom_attributes), TRUE); - libxml_disable_entity_loader(true); - return $custom_attributes['attribute']; + libxml_disable_entity_loader(true); + // no need recursive QuestionAttribute::getDefaultSettings() is array of string or null + return array_merge(QuestionAttribute::getDefaultSettings(),$custom_attributes['attribute']); } /** diff --git a/application/models/Permission.php b/application/models/Permission.php index f7c7982e8c7..8598a96b6a7 100644 --- a/application/models/Permission.php +++ b/application/models/Permission.php @@ -79,19 +79,19 @@ public static function getSurveyBasePermissions() 'export' => false, 'title' => gT("Assessments"), 'description' => gT("Permission to create/view/update/delete assessments rules for a survey"), - 'img' => 'assessments' + 'img' => ' fa fa-comment' ), 'quotas' => array( 'import' => false, 'export' => false, 'title' => gT("Quotas"), 'description' => gT("Permission to create/view/update/delete quota rules for a survey"), - 'img' => 'quota' + 'img' => ' fa fa-tasks' ), 'responses' => array( 'title' => gT("Responses"), 'description' => gT("Permission to create(data entry)/view/update/delete/import/export responses"), - 'img' => 'browse' + 'img' => ' icon-browse' ), 'statistics' => array( 'create' => false, @@ -101,7 +101,7 @@ public static function getSurveyBasePermissions() 'export' => false, 'title' => gT("Statistics"), 'description' => gT("Permission to view statistics"), - 'img' => 'statistics' + 'img' => ' fa fa-bar-chart' ), 'survey' => array( 'create' => false, @@ -110,7 +110,7 @@ public static function getSurveyBasePermissions() 'export' => false, 'title' => gT("Survey deletion"), 'description' => gT("Permission to delete a survey"), - 'img' => 'delete' + 'img' => ' fa fa-trash' ), 'surveyactivation' => array( 'create' => false, @@ -120,12 +120,12 @@ public static function getSurveyBasePermissions() 'export' => false, 'title' => gT("Survey activation"), 'description' => gT("Permission to activate/deactivate a survey"), - 'img' => 'activate_deactivate' + 'img' => ' fa fa-play' ), 'surveycontent' => array( 'title' => gT("Survey content"), 'description' => gT("Permission to create/view/update/delete/import/export the questions, groups, answers & conditions of a survey"), - 'img' => 'add' + 'img' => ' fa fa-file-text-o' ), 'surveylocale' => array( 'create' => false, @@ -134,14 +134,14 @@ public static function getSurveyBasePermissions() 'export' => false, 'title' => gT("Survey text elements"), 'description' => gT("Permission to view/update the survey text elements, e.g. survey title, survey description, welcome and end message"), - 'img'=>'edit' + 'img'=>' fa fa-edit' ), 'surveysecurity' => array( 'import' => false, 'export' => false, 'title' => gT("Survey security"), 'description' => gT("Permission to modify survey security settings"), - 'img' => 'survey_security' + 'img' => ' fa fa-shield' ), 'surveysettings' => array( 'create' => false, @@ -150,11 +150,11 @@ public static function getSurveyBasePermissions() 'export' => false, 'title' => gT("Survey settings"), 'description' => gT("Permission to view/update the survey settings including survey participants table creation"), - 'img' => 'survey_settings' + 'img' => ' fa fa-gears' ), 'tokens' => array( 'title' => gT("Tokens"), 'description'=>gT("Permission to create/update/delete/import/export token entries"), - 'img' => 'tokens' + 'img' => ' fa fa-user' ), 'translations' => array( 'create' => false, @@ -163,7 +163,7 @@ public static function getSurveyBasePermissions() 'export' => false, 'title' => gT("Quick translation"), 'description' => gT("Permission to view & update the translations using the quick-translation feature"), - 'img' => 'translate' + 'img' => ' fa fa-language' ) ); uasort($aPermissions, array(__CLASS__, "comparePermissionTitle")); @@ -199,31 +199,31 @@ public static function getGlobalBasePermissions() 'import' => false, 'title' => gT("Surveys"), 'description' => gT("Permission to create surveys (for which all permissions are automatically given) and view, update and delete surveys from other users"), - 'img'=>'survey' + 'img'=>' icon-list' ), 'users' => array( 'import' => false, 'export' => false, 'title' => gT("Users"), 'description' => gT("Permission to create, view, update and delete users"), - 'img' => 'security' + 'img' => ' fa fa-shield' ), 'usergroups' => array( 'import' => false, 'export' => false, 'title' => gT("User groups"), 'description' => gT("Permission to create, view, update and delete user groups"), - 'img' => 'usergroup' + 'img' => ' fa fa-users' ), 'templates' => array( 'title'=> gT("Templates"), 'description' => gT("Permission to create, view, update, delete, export and import templates"), - 'img' => 'templates' + 'img' => ' fa fa-paint-brush' ), 'labelsets' => array( 'title' => gT("Label sets"), 'description' => gT("Permission to create, view, update, delete, export and import label sets/labels"), - 'img' => 'labels' + 'img' => ' icon-defaultanswers' ), 'settings' => array( 'create' => false, @@ -231,12 +231,12 @@ public static function getGlobalBasePermissions() 'export' => false, 'title' => gT("Settings & Plugins"), 'description' => gT("Permission to view and update global settings & plugins and to delete and import plugins"), - 'img' => 'global' + 'img' => 'fa fa-globe' ), 'participantpanel' => array( 'title' => gT("Central participant database"), 'description' => gT("Permission to create participants in the central participants database (for which all permissions are automatically given) and view, update and delete participants from other users"), - 'img' => 'cpdb' + 'img' => 'fa fa-user-circle-o' ), ); uasort($aPermissions, array(__CLASS__, "comparePermissionTitle")); @@ -248,7 +248,7 @@ public static function getGlobalBasePermissions() 'export' => false, 'title' => gT("Superadministrator"), 'description' => gT("Unlimited administration permissions"), - 'img' => 'superadmin' + 'img' => 'icon-superadmin' ); $aPermissions['auth_db'] = array( 'create' => false, diff --git a/application/models/QuestionAttribute.php b/application/models/QuestionAttribute.php index 65fa2381475..f6394c688f0 100644 --- a/application/models/QuestionAttribute.php +++ b/application/models/QuestionAttribute.php @@ -316,8 +316,8 @@ public function getSurvey() } /** - * Get default settings for an attribut - * @return array + * Get default settings for an attribute, return an array of string|null + * @return string|null[] */ public static function getDefaultSettings() { diff --git a/application/views/admin/user/setuserpermissions.php b/application/views/admin/user/setuserpermissions.php index 6371836ae60..c11e0e26bb1 100644 --- a/application/views/admin/user/setuserpermissions.php +++ b/application/views/admin/user/setuserpermissions.php @@ -37,7 +37,7 @@ - +