[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] depositing user email in the Review table



CAUTION: This e-mail originated outside the University of Southampton.
Hi David and John,

I have now made the changes live on our repository, after some testing.

Two additional details to this:


1)    The permissions that I added for editors to be able to view user info are these two:

"user/view",

"user/details"

Just "user/view" didn't get me to an email address, just a URL and userid.



2)    For the local function provided by David, I added a safety check for non-existant user emails, otherwise, an error can occur ( I observed this error on our test repo), locking you out of the review/deposit table, if ever a user was deleted but their deposits remain in the table.  So my code looks like this:



$c->{render_user_email} = sub
{
        my( $session, $field, $alllangs, $nolink, $value, $obj ) = @_;

        my $ds = $session->get_dataset( 'user' );
        my $user = $ds->dataobj( $obj->get_value( 'userid' ) );
        if (defined $user && $user->is_set('email')){

            return $session->xml->create_text_node( $user->get_value( 'email' ) );

            }

        else {

                  return $session->xml->create_text_node( "not found" );

            }
},

Tomasz

From: eprints-tech-bounces at ecs.soton.ac.uk <eprints-tech-bounces at ecs.soton.ac.uk> On Behalf Of Tomasz Neugebauer via Eprints-tech
Sent: August 4, 2022 7:31 PM
To: David R Newman <drn at ecs.soton.ac.uk>; eprints-tech at ecs.soton.ac.uk; John Salter <J.Salter at leeds.ac.uk>
Subject: Re: [EP-tech] depositing user email in the Review table


Attention This email originates from outside the concordia.ca domain. // Ce courriel provient de l'exterieur du domaine de concordia.ca



CAUTION: This e-mail originated outside the University of Southampton.
Thank you John and David!
That's worked beautifully, and it was simple.
Why is it that the sort doesn't work on that column, the "virtual" field means it's not accessible to the sort functions?
Anyway, even with the sort issue, it's an easy improvement to our workflows.  Thanks again!
Tomasz


From: David R Newman <drn at ecs.soton.ac.uk<mailto:drn at ecs.soton.ac.uk>>
Sent: August 3, 2022 6:13 PM
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>; John Salter <J.Salter at leeds.ac.uk<mailto:J.Salter at leeds.ac.uk>>; Tomasz Neugebauer <Tomasz.Neugebauer at concordia.ca<mailto:Tomasz.Neugebauer at concordia.ca>>
Subject: Re: [EP-tech] depositing user email in the Review table


Attention This email originates from outside the concordia.ca domain. // Ce courriel provient de l'exterieur du domaine de concordia.ca




Hi Tomasz,

I think John's suggestion of a virtual field is the easiest solution.  I added the following to eprint_fields.pl:

{
        name => 'user_email',
        virtual => 1,
        type => 'text',
        render_value => 'render_user_email',
},

Then added another file in my archive's cfg/cfg.d/ directory to define the render function (and added a phrase for the field name):

$c->{render_user_email} = sub
{
        my( $session, $field, $alllangs, $nolink, $value, $obj ) = @_;

        my $ds = $session->get_dataset( 'user' );
        my $user = $ds->dataobj( $obj->get_value( 'userid' ) );
        return $session->xml->create_text_node( $user->get_value( 'email' ) );
},

Regards

David Newman


On 03/08/2022 10:26 pm, John Salter via Eprints-tech wrote:
CAUTION: This e-mail originated outside the University of Southampton.
Hi Tomasz,
I think 'user/view' is the role you'd need to grant to editors to be able to see the profiles.

For the email address aspect (I haven't fully thought these through yet):
- there may be a way to change the Review screen to use a different citation style for the user (but you wouldn't want to change e.g. how it is rendered on the summary page)
- you could add a virtual field which rendered the email address (if added to the review columns, this column would not be sortable). Let me know if you want some example script for this.
- ... (I feel there's an eprint 'trick' I'm overlooking here...)

Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Tomasz Neugebauer via Eprints-tech
Sent: 03 August 2022 21:50
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] depositing user email in the Review table

CAUTION: This e-mail originated outside the University of Southampton.
Another related question to this one, especially if it is not possible or easy to get the email address to appear in the Review Table:
Is there a specific permission/role that I could add to the editors so that they can view (but not modify) the Users Profile information?
Right now, only admins can see that info, editors see this:
You may not view this screen: Workflow::View.
and I would like to give the editors access as well, primarily for that email address.

Tomasz

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> On Behalf Of Tomasz Neugebauer via Eprints-tech
Sent: August 3, 2022 4:14 PM
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] depositing user email in the Review table


Attention This email originates from outside the concordia.ca domain. // Ce courriel provient de l'exterieur du domaine de concordia.ca



CAUTION: This e-mail originated outside the University of Southampton.
Is there any way to get the Depositing User's email address visible as a column in the Review screen?
I can get the "Depositing User" name displayed in the review screen, and the name is clickable, but is there any way to get the email right into that review table to save having to click on the name to access the user metadata screen?

Tomasz




*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C9fa9cc3306a94a7904ad08da770772af%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637953171117786412%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2Fsg%2BI1OB4Fy%2BfnYN3tEJcEzxT1uPuQZeuj%2FsjLex1ek%3D&amp;reserved=0>

*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C9fa9cc3306a94a7904ad08da770772af%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637953171117942626%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=jaoDqqIAZBuWA1htOA5PjV6udMqSbvLlAtMZ1V50Hgo%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C9fa9cc3306a94a7904ad08da770772af%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637953171117942626%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=jaoDqqIAZBuWA1htOA5PjV6udMqSbvLlAtMZ1V50Hgo%3D&amp;reserved=0>

*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C9fa9cc3306a94a7904ad08da770772af%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637953171117942626%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Z95bkbhZLciUMSNCkPV8PTXQgGyg9pSG2CX8yRiUDwo%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C9fa9cc3306a94a7904ad08da770772af%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637953171117942626%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Z95bkbhZLciUMSNCkPV8PTXQgGyg9pSG2CX8yRiUDwo%3D&amp;reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20220805/490e7a86/attachment-0001.html