workflows: task_counter value check

* Checks if the task_counter parameter is a list when saving
  an BibWorkflowObject. It is required to avoid a problem with the
  underlying workflow engine.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
workflows: Holding Pen details fix

* Fixes a problem where the detailed page for Holding Pen
  object caused an exception when information on next/previous
  objects from the table were missing.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
workflows: always save current object

* Adds missing saving points of BibWorkflowObjects in the workflow
  engine when using engine execution manipulation functions such
  as `continueNextToken()`, `jumpTokenBack()`, `jumpTokenForward()`.

* Removes duplicate setting of error_msg.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
access: fix PEP8 and PEP257 for models

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
access: new has_(super)_admin_role methods

* Adds new properties to `User` model in order to ease access control
  calculations.  (closes #2509)

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
access: Flask-Admin interface addition

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
legacy: webuser usage cleanup

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
utils: datacite ssl protocol fix

* Fixes issue with SSL protocol version due to change by DataCite.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
debug_toolbar: error reporting fix

* Fixes an issue where an error message would be produced even if
  Flask-DebugToolbar was explicitly disabled via DEBUG_TB_ENABLED
  set to False.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
email: celery error email fix

* Fixes issue with celery not sending error emails due to config
  variable ADMIN being set different by the Flask Email extension.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
webhooks: minor documentation update

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
tests: testsuite iteration fix

* Fixes invalid attribute access to application configuration.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
search: requirejs facets fix

* Wraps facets JavasScript module in requirejs definition.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
deposit: jquery datepicker leftovers

* Removes jQueryUI css which is no longer needed after integrating
  bootstrap-datetimepicker.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
deposit: form button click fix

* Fixes refactoring issue with form button clicks not being sent to
  server.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
deposit: field_display kwargs support

* Adds support for passing kwargs to Jinja macro field_display
  that can pass it to the field. This is useful for passing
  attributes to specific field widgets like (e.g. rows/cols
  for a textarea).

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
knowledge: API migration to SQLAlchemy

* Replaces run_sql queries with SQLAlchemy query.

* Refactors module in order to move logic from api to model.

* Fixes bibknowledge webinterface kb mapping update.

* NOTE If you are running Invenio 1 and Invenio 2 on top of
  the same database, please use only Invenio 2 knowledge base
  administration interface from now on, in order to ensure
  data consistency.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
groups: user selection by autocomplete

* Implements a reusable RemoteAutocompleteField.

* Implements a Jasmine testsuite.

* Improves user selection with the autocomplete field.

* Improves group selection with the autocomplete field.
  (addresses #1788)

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
deposit: js uploader component

* Adds flightjs uploader component with support for pluggable
  uploader engines such as PLUpload and DropBox.

* NOTE RequireJS path to FlightJS was changed from vendors/flight/lib
  to vendors/flight. Scripts defining flight components MUST update
  their require statement from require('flight/lib/component') to
  require('flight/component').

Reviewed-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
Signed-off-by: Adrian Pawel Baran <adrian.pawel.baran@cern.ch>
deposit: InvalidDepositionType handling

* Handles the InvalidDepositionType exception being raised when
  trying to initialize a deposition type on older submissions which
  is disabled via the DEPOSITION_TYPES config variable.

Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>