Skip to content

Commit

Permalink
Merge master via github (#1137)
Browse files Browse the repository at this point in the history
Dev: updated icons in permission
Dev: small amendmend for questionThemes
Dev: usage of model for getQuestionThemeAttributeValues
  • Loading branch information
Shnoulle committed Oct 6, 2018
1 parent 561b1ef commit 14583c5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
10 changes: 7 additions & 3 deletions application/helpers/questionHelper.php
Expand Up @@ -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']);
}

/**
Expand Down
40 changes: 20 additions & 20 deletions application/models/Permission.php
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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"));
Expand Down Expand Up @@ -199,44 +199,44 @@ 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,
'delete' => false,
'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"));
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions application/models/QuestionAttribute.php
Expand Up @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/user/setuserpermissions.php
Expand Up @@ -37,7 +37,7 @@
<tr>
<!-- Icon -->
<td>
<span class="icon-<?php echo $aCRUDPermissions['img']; ?> text-success"></span>
<i class="<?php echo $aCRUDPermissions['img']; ?> text-success"></i>
<?php echo $aCRUDPermissions['description'];?>
</td>

Expand Down

0 comments on commit 14583c5

Please sign in to comment.