summaryrefslogtreecommitdiffstats
path: root/doc/locationinfo
blob: a439748061936b2a3fe0f1ebfbd90a2f235a8d6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
########## API ##########

/slx-admin/api.php?do=locationinfo

&action=roominfo
&id= (1 or 1,2,3…)
[optional] &coords= (true/false)
Returns an array with the information of the room(s). (JSON) pcState => (IDLE, OCCUPIED, OFF, BROKEN))
e.g.:
[{"id":"11","computer":[{"id":"6BF41E7F-C663-E211-9BAC-C5625F50F9E8","pcState":"OFF"}]}]

&action=openingtime
&id= (1 or 1,2,3...)
Return an array with the openingtime of the room(s). (JSON)
e.g.:
[{"id":"11","openingtime":{"Monday":[{"HourOpen":"7","MinutesOpen":"00","HourClose":"20","MinutesClose":"00"}],"Tuesday":[{"HourOpen":"7","MinutesOpen":"00","HourClose":"20","MinutesClose":"00"}],"Wednesday":[{"HourOpen":"7","MinutesOpen":"00","HourClose":"20","MinutesClose":"00"}],"Thursday":[{"HourOpen":"7","MinutesOpen":"00","HourClose":"20","MinutesClose":"00"}],"Friday":[{"HourOpen":"7","MinutesOpen":"00","HourClose":"20","MinutesClose":"00"}],"Saturday":[{"HourOpen":"9","MinutesOpen":"00","HourClose":"13","MinutesClose":"00"}]}}]

&action=roomtree
&id= (1 or 1,2,3...)
Returns the roomtree. (JSON)
e.g.:
[{"id":"8","name":"4er-Netz","childs":[{"id":"1","name":"4er-Netz(1-10)","childs":[{"id":"5","name":"bwLehrstuhl 4.4","childs":[]}]},{"id":"11","name":"Raum -113","childs":[]}]}]

&action=config
&id= (1)
Return the config of a room. (JSON)
e.g.:
{"language":"en","mode":1,"vertical":false,"eco":false,"scaledaysauto":false,"daystoshow":7,"rotation":0,"scale":50,"switchtime":20,"calupdate":30,"roomupdate":30,"configupdate":180,"room":"Raum -113","time":"2017-3-27 2:36:40"}

&action=pcstates
&id= (1 or 1,2,3...)
Returns an array of the state stats of the room(s). (JSON)
e.g.:
[{"id":"11","idle":0,"occupied":0,"off":1,"broken":0}]

&action=calendar
&id= (1 or 1,2,3...)
Returns an array with the calendar of the room(s). (JSON)
e.g.:
[{"id":7,"calendar":[{"title":"test exam","start":"2017-3-08 13:00:00","end":"2017-3-08 16:00:00"}]}]

##############################
########## Frontend ##########
##############################

Doorsign
========

1.Usage
=======
parameter

required:
    id: [integer] room id, see in admin panel. For e.g.: id=5 or multiple, up to 4 e.g.: id=5,6,7,8

optional:

    lang:[en,de] set the language
    mode:[1,2,3,4] sets the displaying
        1: Calendar & Room
        2: only Calendar
        3: only Room
        4: Calendar & Room alternately
    daystoshow:[1,2,3,4,5,6,7] sets how many days the calendar shows
    scale:[10-90] scales the calendar and Roomplan in mode 1
    switchtime:[1-120] sets the time between switchen in mode 4  (in seconds)
    calupdate: Time the calendar queries for updates,in minutes.
    roomupdate: Time the PCs in the room gets updated,in seconds.
    rotation:[0-3] rotation of the roomplan
    vertical:[true] only mode 1, sets the calendar above the roomplan
    configupdate: Time interval the config gets updated (in minutes)
    scaledaysauto: [true] if true it finds automatically the daystoshow parameter depending on display size


All the optional parameters will overwrite the config settings in the admin panel. If more then one room is shown,then it will
overwrite it for all rooms.

2. Add an overlay
=================
First you need an Image(svg,png,jpg), add it to ./locationinfo/frontend/img/overlay.
You can add your own css class if you want. To do so create an css  calss named .overlay-YOUR_IMAGE_NAME in the doorsign.html.
You can find an example in the doorsign.html called ".overlay-rollstuhl".
The backend functionality is right now not implemented since it relays on the roominfo module.
But you can add it manually.
You need to add the image name (without ending) in the machine database on the position column with the key overlays in an array.

For example (the name of the images could be overlay1.jpg, overlay1.svg):

{"gridRow":"41","gridCol":"48","itemlook":"pc-south", "overlays":["overlay1","overlay2"]}


3.Tipps & Tricks
==================

-if you show 2-3 rooms in mode 1, it's useful to use vertical mode.
-if calendar items don't fit, show less days or if in mode 1 give the calendar more space(calendar width);
-it is possible to use different modes if you show more then one room

4.CourseBackend
===============
fetchSchedule returns an array containing an array as value and the local room ID as key.
The contained array contains arrays that have this form ["start"=>'JJJJ-MM-DD HH:MM:SS',"end"=>'JJJJ-MM-DD HH:MM:SS',"title"=>string].
getError returns the last errormessage.
checkConection uses a hardcoded room for test purposes.
If you want to write a new Class you can look at the Dummy Class to learn the structure.
You also should write the language files for your options into the lang directory.

Panel
=====

parameter

required:
    id: [integer] room id, see in admin panel. For e.g.: id=5 or multiple, up to 4 e.g.: id=5,6,7,8