Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Being able to view the list of users attached to an organisation on the pro platform #6978

Closed
Tracked by #5521
manon-corneille opened this issue Jun 29, 2022 · 9 comments · Fixed by #8511
Closed
Tracked by #5521
Assignees
Labels
✨ Feature Features or enhancements to Open Food Facts server good first issue Welcome to Open Food Facts. This issue should be approachable if you're new. Get in touch for help. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.

Comments

@manon-corneille
Copy link
Contributor

manon-corneille commented Jun 29, 2022

What

  • It would be helpful to know which users are behind an organisation so that I can contact them easily.

Solution

  • I can imagine the solution as a button on the left panel : "View the organisation users".
  • it could be on the org profile page.

It would be great to have :

  • userid: kurzeja12
  • name: kurzeja12
  • email: kur****2@blabla.com
  • langage (lc)
  • country (cc)
  • date of last activity
  • In the future: CRM status?
  • Any other field you might find relevant :)

Part of

@manon-corneille manon-corneille added the ✨ Feature Features or enhancements to Open Food Facts server label Jun 29, 2022
@teolemon teolemon added the 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers label Jun 29, 2022
@teolemon
Copy link
Member

@manon-corneille I've removed the email

@alexgarel
Copy link
Member

Related issue :

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Oct 20, 2022
@alexgarel
Copy link
Member

In fact it should be really easy to do as we have a "members" and "admins" field in the org sto file.

@alexgarel alexgarel added the good first issue Welcome to Open Food Facts. This issue should be approachable if you're new. Get in touch for help. label May 18, 2023
@MonalikaPatnaik
Copy link
Collaborator

Hey...wanted to resolve this issue..kindly assign it to me!
Thanks!

@alexgarel
Copy link
Member

@monalika Patnaik for this issue here is the structure of a typical org:

{
   "admins" : {
      "xxxxx" : 1,
      "yyyyy" : 1,
      "zzzzz" : 1
   },
   "created_t" : 1620718096,
   "creator" : "zzzzz",
   "members" : {
      "xxxxx" : 1,
      "yyyyy" : 1,
      "zzzzz" : 1
   },
   "name" : "My Food Company",
   "org_id" : "my-food-company"
}

The best would be if you are capable of writing an integration test, where you create an org create multiple users and assign them to org, then display org page. But it might be harder than I think !

@MonalikaPatnaik
Copy link
Collaborator

Okay...let me try i think I have to make changes in cgi/org.pl right?

@stephanegigandet
Copy link
Contributor

@MonalikaPatnaik: @manon-corneille suggested to put it on the org profile page. That's a page like this one: https://world.openfoodfacts.org/editor/org-unilever-france-gms

It is rendered using the template /templates/web/pages/org_profile/org_profile.tt.html

The template is called from this code in Display.pm:

` # Display the user or organization profile

			my $user_template_data_ref = dclone($user_or_org_ref);

			my $profile_html = "";

			if ($tagid =~ /^org-/) {

				# Display the organization profile

				if (is_user_in_org_group($user_or_org_ref, $User_id, "admins") or $admin) {
					$user_template_data_ref->{edit_profile} = 1;
					$user_template_data_ref->{orgid} = $orgid;
				}

				process_template('web/pages/org_profile/org_profile.tt.html',
					$user_template_data_ref, \$profile_html)
					or $profile_html
					= "<p>web/pages/org_profile/org_profile.tt.html template error: " . $tt->error() . "</p>";
			}`

When the user is an admin, you can have the template show a table with the org members. You will first have to generate the list of users from the structure that is in $user_or_org_ref (the one @alexgarel pointed to above), and pass the list to the template through the $user_template_data_ref structure.

@MonalikaPatnaik
Copy link
Collaborator

MonalikaPatnaik commented Jun 2, 2023

Okay okay..Working on it<3
Thankyou so muchh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Features or enhancements to Open Food Facts server good first issue Welcome to Open Food Facts. This issue should be approachable if you're new. Get in touch for help. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.
Projects
Status: Done
5 participants