To filter the responses based on user group

More
3 years 2 months ago #107560 by omarrodriguezt
omarrodriguezt created the topic: To filter the responses based on user group
I have a survey, that was filled from different departments of the company (sales, IT, HR, billling), is possible to allow every department manager to see only the answers that belongs to his department?
Thank you for all your hard job.

Please Log in to join the conversation.

More
3 years 2 months ago #107579 by c_schmitz
c_schmitz replied the topic: To filter the responses based on user group
Hello Omar,

I am sorry, but this is currently not possible :-(

Best regards

Carsten Schmitz
LimeSurvey project leader

Please Log in to join the conversation.

More
3 years 2 months ago #107580 by omarrodriguezt
omarrodriguezt replied the topic: To filter the responses based on user group
Thank you.
I'm doing the php code modifications myself, but having issues getting the actual user group.
I'm on the page application\controllers\admin\responses.php and I'm able to get the userId by:
User::model()->findByPk(Yii::app()->session);
but can you please let me know how to get the usergroup?

Please Log in to join the conversation.

More
3 years 2 months ago #107584 by DenisChenu
DenisChenu replied the topic: To filter the responses based on user group
Using Yii find all: or Yii find if you are sure user have only one group:
$oUserId= User::model()->findByPk(Yii::app()->session);
$oUserInGroup= UserInGroup::model()->find('uid= :uid',array(':uid'=>$oUserId->uid);
$oUserGroup=UserGroup::model()->find('ugid= :ugid',array(':ugid'=>$oUserInGroup->ugid);
Really bad solution, must use join here www.yiiframework.com/doc/api/1.1/CDbCommand#join%28%29

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: omarrodriguezt

Please Log in to join the conversation.

More
3 years 2 months ago #107620 by omarrodriguezt
omarrodriguezt replied the topic: To filter the responses based on user group
Thank you!

Please Log in to join the conversation.

More
2 years 10 months ago - 2 years 10 months ago #111364 by dweisser
dweisser replied the topic: To filter the responses based on user group
I have a similar question. I am on page: application/views/admin/super/header.php.

I am able to get the user by: $tempuser= Yii::app()->session;
But I am not able to get the user group. I am only trying to return a string of the user's group. I tried the solution above, but the page breaks.

Any help would be much appreciated.
David
Last Edit: 2 years 10 months ago by dweisser.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now