BibEdit: autocompletion of fields from KBs

*  In CFG_BIBEDIT_AUTOCOMPLETE we declare for which fields
   data will be loaded from which Knowledge Base,
   in order to help user by autocompleting the value.
   Also we choose if the data will be loaded when page is
   loaded or when typing and how will be displayed.

*  addHandler_autocompleteAffiliations is replaced
   from a generic function that handles the behavior for
   any given tag.

*  Handles both static and dynamic KBs

Reviewed-by: Javier Martin Montull <javier.martin.montull@cern.ch>
BibEdit: remove old autocomplete code

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
BibEdit: fixes wrongly displayed HP changeset bug

* When switching from table to marc view
  cache was created again without adding
  information about the disabled_hp_entries.

* As a result when record was retrieved again
  all HP changesets were displayed as non applied.

* When changing from marc to table view
  gDisabledHpEntries are saved to the cache.

* Displays a message when user has applied a HP
  changeset, has not taken action for all changes
  and tries to switch to marc view.

Reviewed-by: Javier Martin Montull <javier.martin.montull@cern.ch>
BibAuthorID: Fixed bibref selection dropdown bug in claiming system.
BibAuthorID: fixed name resolution problem

* Clicking on a name on a paper now brings correctly to the author page
  instead of a person search page. Solves some minor ambiguity problems.
BibAuthorID: fix crash on /manage_profile without args

* Now /author/manage_profile/ correctly displays an error message
  when visited without the expected argument.

Signed-off-by: Samuele Carli <samuele.carli@cern.ch>
Reviewed-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibAuthorID: fix wrong string replacement in assertion

* The assertion message was generating an exception due to a bad
  string replacement.

Signed-off-by: Carli Samuele <samuele.carli@cern.ch>
BibAuthorID: fix in import_publication_from_orcid

* The system crashed in case something goes wrong and the
  orcid was not assignet to a profile yet when the import
  was called. Now this is handled gracefully.

Signed-off-by: Carli Samuele <samuele.carli@cern.ch>
crossrefutils: handle UnboundLocalError

* Fixes UnboundLocalError when number of server retries reach
  it's maximum and the code is trying to call a variable that
  is not defined.

* Fixes a few PEP8 issues.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
BibAuthorID: exception when merging profiles

* Fixes a bug when setting the primary profile. The merge_primary_profile
  was initizialized properly.

Reviewed-by: Petros Ioannidis <petros.ioannidis@cern.ch>
BibAuthorID: change hepnames js source

* Changes captcha JS source to https

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
BibAuthorID: get_papers_affected_since() timestamp

* Fixes get_papers_affected_since() to consider timestamps
  in an inclusive manner.

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reviewed-by: Samuele Carli <samuele.carli@cern.ch>
BibAuthorID: affiliations bookkeeping

* Adds a step in rabbit to keep a list of mappings pid -> affiliations.

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Signed-off-by: Samuele Carli <samuele.carli@cern.ch>
BibAuthorID: Fix for name decoding in affiliations daemon.
BibAuthorID: handling inconsistent data in affiliations
BibAuthorID: error handling in affiliations engine

* The process does not crash anymore in case of inconsistent
data, but proceeds gracefully.

Reviewed-by: Javier Martin Montull <javier.martin.montull@cern.ch>
BibAuthorID: more error handling in affiliations

* Gracefully continue in case of data corruption
installation: jquery plugins
BibAuthorID: amends tests
inveniocfg: affiliations in atlantis

* Computes affiliations during inveniocfg --load-demo-records