Files/EditBufHacks

From EPrints Documentation
Revision as of 14:48, 11 January 2007 by Tajoli (Talk | contribs)

Jump to: navigation, search

Hacks for the Submission process

The submisson process is quite complex, you need to be careful to do modification on this section of the software. Those hacks are all done on the cgi 'edit_eprint' avaible in the dir .../cgi/users/staff/.

1)Hack to Bc the mail of rejection also to the editor

When a editor reject a paper, he writes a mail to the submitter. To send this mail as Bc you need to work in the sub bounce:

Lines arond 522

       # Get the user's details
       my $user = $eprint->get_user();
       my $editor = $session->current_user();

Lines from 568

       # Successfully transferred, mail the user with the reason
       if( $user->mail(
               "cgi/users/edit_eprint:subject_bounce",
               $mail,
               $session->current_user() ) )
       {
               # Successfully bounced, redirect
               #19/12/2006 TJL to send a copy to editor
               $editor->mail("cgi/users/edit_eprint:subject_bounce", $mail, $session->current_user() );
               $session->redirect( "buffer" );
               return;
       }


2)Hack to send a mail to the submitter when the paper is online.

This function is a option, as default is inactive. When it is active, the submitter receives a mail when his papers is gone on-line in the main archive. To do it you must:

a) add a new field in user metadata, in metadata-types.xml:

  <dataset name="user">
   <type name="user" >
     [...]
     <field name="onlinemail" />
     [...]
   <type name="editor" >
     [...]
     <field name="onlinemail" />
     [...]   
   <type name="admin" >
     [...]
     <field name="onlinemail" />
     [...]

In ArchiveMetadataFieldsConfig.pm:

  $fields->{user} = [
       [...]
       { name => "onlinemail", type => "boolean" },

In phrases-<lng>.xml

<ep:phrase ref="user_fieldname_onlinemail">An Email when the work is online</ep:phrase>

b) If you have a live archive go to to insert the field with SQL in the archive

The code of the hacked cgi is avaible from http://eprints.rclis.org/fixsoft/edit_eprint.gz