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

30 lines
782 B
Bash
Raw Normal View History

2020-02-07 13:27:29 +00:00
# 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)
# fix problems with '<' and '>' in descriptions
description=$(echo $pt|jq -r .description|sed -e 's/</\&#60;/g ; s/>/\&#62;/g')
2020-02-07 13:27:29 +00:00
orga=$(echo $pt|jq -r .organisation)
2020-02-07 13:27:29 +00:00
# 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")