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_pt.sh

27 lines
649 B
Bash

# DEPENDS ON: Organisations (process_orgas.sh)
# Colors
PT_COLOR="${COLOR3}" # patron_types
# Main configuration
shape="polygon"
color="${PT_COLOR}"
additionals="sides=7"
while read pt
do
pid=$(echo $pt|jq -r .pid)
name=$(echo $pt|jq -r .name)
orga=$(echo $pt|jq -r .organisation)
# write result in output
identifier="Type${pid}"
label="$(render templates/label_patron_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 "patron_types")