<div dir="ltr">I think Philippe is probably right about userenv not being set in your plugin.  If that is the case you could try calling get_template_and_user() ( which calls checkauth() ), or calling checkauth() directly, to build userenv for you.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 24, 2015 at 6:06 AM, Philippe Blouin <span dir="ltr"><<a href="mailto:philippe.blouin@inlibro.com" target="_blank">philippe.blouin@inlibro.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Like that, I doubt your userenv will
      contain anything.  You first need to log in.<br>
      <br>
      But you could add the code in cataloguing/<a href="http://addbooks.pl" target="_blank">addbooks.pl</a> for example.<br>
      Somewhere after the <br>
          my ( $template, $loggedinuser, $cookie ) = <b>get_template_and_user</b>(<br>
      ...<br>
      <br>
      You could have something like <br>
          warn "AKAFORTES " . C4::Context->userenv->{'surname'};
      <br>
      and look into your koha-error_log to see it.<br>
      <br>
      But this would probably be used somewhere where is done the <b>ModBiblio</b>
      call in cataloguing, just before, to add something like<br>
          my $z042 = $record->field('042');<br>
          if($z042){<br>
              $z042->add_subfields('a',
      C4::Context->userenv->{'surname'});<br>
          }<br>
      <br>
      That code is a bit naive, but you get the idea.<br>
      <br>
      <div>
        
        <div>
          <div><span class=""> <span>Philippe Blouin,</span><br>
            <span>Responsable du développement
              informatique</span><br>
            </span><p> Tél.  : <a href="tel:%28888%29%20604-2627" value="+18886042627" target="_blank">(888) 604-2627</a><br>
              <a href="mailto:philippe.blouin@inLibro.com" target="_blank">philippe.blouin@inLibro.com</a>
            </p>
          </div><span class="">
          <div> <span>in</span><span>Libro</span> <span>|
              pour esprit libre |</span> <a href="http://www.inLibro.com" target="_blank">www.inLibro.com</a> </div>
        </span></div>
      </div><div><div class="h5">
      On 09/24/2015 02:09 AM, akafortes wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <pre>Thank you very much!!!! That was just what I needed 
Based on the "EXAMPLE.pl", I just did this:

use Modern::Perl;

use C4::Auth;
use C4::Output;

my $builder= sub {
    my $params = shift;
    my $id = $params->{id};
        my $user=C4::Context->userenv->{'surname'};

    return qq|
|;
};

return { builder => $builder};


Philippe Blouin wrote
</pre>
      <blockquote type="cite">
        <pre>Are you looking for the information itself, like the content of 
C4::Context->userenv ?  It is a hash with the logged user info, like 
C4::Context->userenv->{'surname'}

(i think :) )

Regards,

Philippe Blouin,
Responsable du développement informatique

Tél.  : <a href="tel:%28888%29%20604-2627" value="+18886042627" target="_blank">(888) 604-2627</a>
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <pre>philippe.blouin@
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <pre> &lt;mailto:
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <pre>philippe.blouin@
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <pre>&gt;

inLibro | pour esprit libre | <a href="http://www.inLibro.com" target="_blank">www.inLibro.com</a>
&lt;<a href="http://www.inLibro.com&gt" target="_blank">http://www.inLibro.com&gt</a>;
On 09/22/2015 09:16 AM, akafortes wrote:
</pre>
        <blockquote type="cite">
          <pre>Hello G.K.MANJUNATH,
thank you for your answer but I'm afraid that's not what I'm looking for.
It's my understanding that this field is used for when the specified
record
is stored in an electronic form and in this field you save information
about
its location and maybe credentials (or something like that) in order to
access it.

G.K.MANJUNATH wrote
</pre>
          <blockquote type="cite">
            <pre>Marc tag 856$l  is for  Logon (NR).

I do not know whether the login code gets added to this field.  If can
customise you may be able store it.

check at <a href="http://www.loc.gov/marc/bibliographic/bd856.html" target="_blank">http://www.loc.gov/marc/bibliographic/bd856.html</a>


tks
g.k.m


On Tue, 22 Sep 2015, akafortes wrote:

</pre>
            <blockquote type="cite">
              <pre>Hello,
is it possible to get the username of the logged in user and use it in
a
MARC field?
I would like to add a field where I keep info about who catalogued a
record.



--
View this message in context:
<a href="http://koha.1045719.n5.nabble.com/Cataloguer-s-info-in-MARC-field-tp5854171.html" target="_blank">http://koha.1045719.n5.nabble.com/Cataloguer-s-info-in-MARC-field-tp5854171.html</a>
Sent from the Koha-devel mailing list archive at Nabble.com.
_______________________________________________
Koha-devel mailing list

</pre>
            </blockquote>
            <pre><a href="mailto:Koha-devel@.koha-community" target="_blank">Koha-devel@.koha-community</a>
</pre>
            <blockquote type="cite">
              <pre><a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a>
git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a>
bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a>

</pre>
            </blockquote>
            <pre>_______________________________________________
Koha-devel mailing list
<a href="mailto:Koha-devel@.koha-community" target="_blank">Koha-devel@.koha-community</a>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a>
git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a>
bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a>
</pre>
          </blockquote>
          <pre>


--
View this message in context:
<a href="http://koha.1045719.n5.nabble.com/Cataloguer-s-info-in-MARC-field-tp5854171p5854258.html" target="_blank">http://koha.1045719.n5.nabble.com/Cataloguer-s-info-in-MARC-field-tp5854171p5854258.html</a>
Sent from the Koha-devel mailing list archive at Nabble.com.
_______________________________________________
Koha-devel mailing list

</pre>
        </blockquote>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <pre><a href="mailto:Koha-devel@.koha-community" target="_blank">Koha-devel@.koha-community</a>
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre><a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a>
git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a>
bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a>
</pre>
        </blockquote>
        <pre>
_______________________________________________
Koha-devel mailing list
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <pre><a href="mailto:Koha-devel@.koha-community" target="_blank">Koha-devel@.koha-community</a>
</pre>
      </blockquote>
      <pre></pre>
      <blockquote type="cite">
        <pre><a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a>
git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a>
bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a>
</pre>
      </blockquote>
      <pre>



--
View this message in context: <a href="http://koha.1045719.n5.nabble.com/Cataloguer-s-info-in-MARC-field-tp5854171p5854481.html" target="_blank">http://koha.1045719.n5.nabble.com/Cataloguer-s-info-in-MARC-field-tp5854171p5854481.html</a>
Sent from the Koha-devel mailing list archive at Nabble.com.
_______________________________________________
Koha-devel mailing list
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a>
git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a>
bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a></pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Michael Hafen<br></div>Washington County School District Technology Department<br></div>Systems Analyst<br><div><br><img src="http://logos.washk12.org/100year.png"><br></div></div></div>
</div>