|
Summary: Calculation of total budget
Priority (1<5) = 3
Raised by: hal
Description:
Calculate total budgets to be shown on summary page. This will also work as a check on the budget numbers entered. Suggestion, sent to eprints tech list 8jul2005We have research project descriptions in our archive. We ask for their budget divided into three parts (entered as three integer fields: intfunding, natfunding, otherfunding). I would like Eprints to automatically calculate the total budget by way of the set_eprint_automatic_fields sub in Archive Metadata Fields Config?.pm. We already have something in this sub, and I thought of adding the lines that are commented out below to do this task. Any ideas on whether this might work or not (I don’t know much perl …) ## This sub sets publicfulltext to true if it is available without password
sub set_eprint_automatic_fields
{
my( $eprint ) = @_;
my @docs = $eprint→get_all_documents();
my $pft = “FALSE”;
foreach( @docs )
{
$pft = “TRUE” unless( $_→is_set( “security” ) );
}
$eprint→set_value( “publicfulltext”, $pft );
## calculate total budget
# my $tb = “0″;
# foreach( @docs )
# {
# $tb = $intfunding + $natfunding + $otherfunding;
# }
# $eprint→set_value( “budget”, $tb );
}
|
New IssueOpen IssuesOrganic Eprints Wiki
Based on PmWiki |