Archived
1
0
This repository has been archived on 2020-03-05. You can view files and clone it, but cannot push or open issues or pull requests.
rero-ils-graphs/by_json/process_it.sh
Olivier DOSSMANN d2c7cda421 by_json: Generate circulation policies
* Generate a new circulation policies file: policies.svg
  * Parses Circulation policies
  * Parses Item Types
2020-02-07 16:30:48 +01:00

28 lines
680 B
Bash

# DEPENDS ON: Organisations (process_orgas.sh)
# Colors
IT_COLOR="${COLOR4}" # item_types
# Main configuration
shape="polygon"
color="${IT_COLOR}"
additionals="sides=6"
while read it
do
pid=$(echo $it|jq -r .pid)
name=$(echo $it|jq -r .name)
orga=$(echo $it|jq -r .organisation)
itype="$(echo $it|jq -r '.type')"
# write result in output
identifier="IType${pid}"
label="$(render templates/label_item_types.tmpl)"
save "${tmpl_gizmo}"
# Make a link with organisation if present
if [[ -n "${orga}" ]]; then
orga_pid=$(echo $orga|rev|cut -d "/" -f 1|rev)
relation="Orga${orga_pid}"
save "${tmpl_link}"
fi
done <<< $(parse_json "item_types")