gestion 1.9.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +48 -0
  3. data/.project +14 -0
  4. data/Binaries/adduser_to_buzz +15 -0
  5. data/Binaries/backup +7 -0
  6. data/Binaries/check_gestion +8 -0
  7. data/Binaries/gestion.gnumail +22 -0
  8. data/Binaries/gestion.logrotate +34 -0
  9. data/Binaries/gestion.service +12 -0
  10. data/Binaries/gestion_update.rb +183 -0
  11. data/Binaries/gestion_update.service +10 -0
  12. data/Binaries/get_compta +11 -0
  13. data/Binaries/kill_gestion +16 -0
  14. data/Binaries/ldap/add_indexes +51 -0
  15. data/Binaries/ldap/backup +2 -0
  16. data/Binaries/ldap/install_ldap +92 -0
  17. data/Binaries/ldap/restore +7 -0
  18. data/Binaries/lib_backup +5 -0
  19. data/Binaries/log_scan_errors +8 -0
  20. data/Binaries/loop_gestion +64 -0
  21. data/Binaries/onetimers/sync_courses_from_compta.rb +74 -0
  22. data/Binaries/onetimers/transfer_cash_from_ldap_to_csv +26 -0
  23. data/Binaries/reboot +5 -0
  24. data/Binaries/restore +3 -0
  25. data/Binaries/restore_do +22 -0
  26. data/Binaries/sort_events +31 -0
  27. data/Binaries/start_gestion +18 -0
  28. data/Binaries/swipe_gestion +18 -0
  29. data/Binaries/update_africompta +21 -0
  30. data/Binaries/update_users +3 -0
  31. data/Diplomas.src/accredited.odg +0 -0
  32. data/Diplomas.src/diploma.odg +0 -0
  33. data/Diplomas.src/label.odg +0 -0
  34. data/Diplomas.src/presence_sheet.ods +0 -0
  35. data/Diplomas.src/presence_sheet_small.ods +0 -0
  36. data/Diplomas.src/student_card.odg +0 -0
  37. data/Doc/130514-it-ideas.odt +0 -0
  38. data/Doc/Compta-cash.mm +179 -0
  39. data/Doc/General.odt +0 -0
  40. data/Entities/AccessGroups.rb +117 -0
  41. data/Entities/Activity.rb +178 -0
  42. data/Entities/ChatMsg.rb +142 -0
  43. data/Entities/Classroom.rb +11 -0
  44. data/Entities/Client.rb +19 -0
  45. data/Entities/Computer.rb +21 -0
  46. data/Entities/ConfigBase.rb +280 -0
  47. data/Entities/Course.rb +1588 -0
  48. data/Entities/CourseType.rb +171 -0
  49. data/Entities/DFiles.rb +466 -0
  50. data/Entities/FilesManage.rb +226 -0
  51. data/Entities/Grade.rb +186 -0
  52. data/Entities/Internet.rb +300 -0
  53. data/Entities/Netdev.rb +10 -0
  54. data/Entities/Person.rb +1175 -0
  55. data/Entities/Plug.rb +98 -0
  56. data/Entities/Quiz.rb +33 -0
  57. data/Entities/Recharges.rb +37 -0
  58. data/Entities/Report.rb +136 -0
  59. data/Entities/Room.rb +12 -0
  60. data/Entities/SMS.rb +30 -0
  61. data/Entities/ScheduleType.rb +33 -0
  62. data/Entities/Share.rb +120 -0
  63. data/Entities/Task.rb +51 -0
  64. data/Entities/Ticket.rb +72 -0
  65. data/Entities/Usage.rb +143 -0
  66. data/Entities/Worker.rb +29 -0
  67. data/Files/apache-profeda.conf +36 -0
  68. data/Files/label.erb +121 -0
  69. data/Files/label_notfound.erb +64 -0
  70. data/Files/label_notpassed.erb +84 -0
  71. data/Files/mobileinfo.erb +115 -0
  72. data/Files/smb.conf +333 -0
  73. data/Files/timetable.html +36 -0
  74. data/Files/timetable.js +239 -0
  75. data/Gemfile +12 -0
  76. data/Gemfile.dev +12 -0
  77. data/Gemfile.dev.lock +127 -0
  78. data/Gemfile.lock +127 -0
  79. data/Gemfile.prod +8 -0
  80. data/Gestion +35 -0
  81. data/Gestion.rb +220 -0
  82. data/INSTALL +40 -0
  83. data/Images/connection.xcf +0 -0
  84. data/Images/connection_no.png +0 -0
  85. data/Images/connection_wait.png +0 -0
  86. data/Images/connection_yes.png +0 -0
  87. data/Paths/Exas.rb +13 -0
  88. data/Paths/Files.rb +19 -0
  89. data/Paths/GetDiplomas.rb +20 -0
  90. data/Paths/Info.rb +114 -0
  91. data/Paths/Label.rb +187 -0
  92. data/Paths/MobileInfo.rb +19 -0
  93. data/Paths/internetCash.rb +34 -0
  94. data/Paths/internetWifi.rb +54 -0
  95. data/README.md +60 -0
  96. data/Rakefile +13 -0
  97. data/TODO +1391 -0
  98. data/Test/.gitignore +3 -0
  99. data/Test/Diplomas/base_gestion.odt +0 -0
  100. data/Test/Diplomas/base_report.odt +0 -0
  101. data/Test/Diplomas/carte_etudiant.odg +0 -0
  102. data/Test/Diplomas/exam_language.odt +0 -0
  103. data/Test/Diplomas/label.odg +0 -0
  104. data/Test/Diplomas/presence_sheet.ods +0 -0
  105. data/Test/Diplomas/presence_sheet_small.ods +0 -0
  106. data/Test/Diplomas/student_card.odg +0 -0
  107. data/Test/Manual/testMerge +18 -0
  108. data/Test/config_test.yaml +26 -0
  109. data/Test/db.testGestion +0 -0
  110. data/Test/dfiles/descs/avg-rescue.desc +10 -0
  111. data/Test/dfiles/descs/avg.desc +8 -0
  112. data/Test/dfiles/descs/driver.desc +8 -0
  113. data/Test/dfiles/descs/linuxmint.desc +7 -0
  114. data/Test/dfiles/files/avg-160203.exe +1 -0
  115. data/Test/dfiles/files/avg.iso +1 -0
  116. data/Test/dfiles/files/driver.exe +1 -0
  117. data/Test/dfiles/index_post.html +3 -0
  118. data/Test/dfiles/index_pre.html +8 -0
  119. data/Test/dfiles/priorities +5 -0
  120. data/Test/ge_activity.rb +124 -0
  121. data/Test/ge_chat.rb +106 -0
  122. data/Test/ge_compta.rb +67 -0
  123. data/Test/ge_configbase.rb +54 -0
  124. data/Test/ge_course.rb +1114 -0
  125. data/Test/ge_dfiles.rb +121 -0
  126. data/Test/ge_filesmanage.rb +180 -0
  127. data/Test/ge_info.rb +27 -0
  128. data/Test/ge_internet.rb +246 -0
  129. data/Test/ge_login.rb +55 -0
  130. data/Test/ge_person.rb +373 -0
  131. data/Test/ge_qvinfo.rb +28 -0
  132. data/Test/ge_report.rb +97 -0
  133. data/Test/ge_share.rb +27 -0
  134. data/Test/ge_sms.rb +34 -0
  135. data/Test/ge_tasks.rb +19 -0
  136. data/Test/ge_usage.rb +168 -0
  137. data/Test/ge_view.rb +46 -0
  138. data/Test/multiconf-captive +29 -0
  139. data/Test/test.conf +7 -0
  140. data/Test/test.rb +49 -0
  141. data/Test/test_bytes.png +0 -0
  142. data/VERSION +140 -0
  143. data/Views/Admin/Backup.rb +91 -0
  144. data/Views/Admin/Configuration.rb +44 -0
  145. data/Views/Admin/Credit.rb +32 -0
  146. data/Views/Admin/FilesManage.rb +219 -0
  147. data/Views/Admin/Function.rb +39 -0
  148. data/Views/Admin/Power.rb +49 -0
  149. data/Views/Admin/Printer.rb +37 -0
  150. data/Views/Admin/Server.rb +252 -0
  151. data/Views/Admin/Tabs.rb +5 -0
  152. data/Views/Admin/Update.rb +73 -0
  153. data/Views/Admin/UpdateSystem.rb +26 -0
  154. data/Views/Cashbox/Activity.rb +191 -0
  155. data/Views/Cashbox/Course.rb +141 -0
  156. data/Views/Cashbox/Credit.rb +79 -0
  157. data/Views/Cashbox/Report.rb +115 -0
  158. data/Views/Cashbox/Service.rb +105 -0
  159. data/Views/Cashbox/Tabs.rb +10 -0
  160. data/Views/Compta/Accounts.rb +36 -0
  161. data/Views/Compta/Course.rb +96 -0
  162. data/Views/Compta/Show.rb +6 -0
  163. data/Views/Compta/Transfer.rb +66 -0
  164. data/Views/Course/Diploma.rb +203 -0
  165. data/Views/Course/Grade.rb +401 -0
  166. data/Views/Course/Modify.rb +447 -0
  167. data/Views/Course/Print.rb +94 -0
  168. data/Views/Course/Responsible.rb +44 -0
  169. data/Views/Course/Stats.rb +76 -0
  170. data/Views/Course/Students.rb +92 -0
  171. data/Views/Course/Tabs.rb +220 -0
  172. data/Views/Internet/Access.rb +134 -0
  173. data/Views/Internet/ClassEdit.rb +24 -0
  174. data/Views/Internet/ClassUsers.rb +81 -0
  175. data/Views/Internet/Config.rb +32 -0
  176. data/Views/Internet/Mobile.rb +213 -0
  177. data/Views/Internet/Recharges.rb +49 -0
  178. data/Views/Internet/Tabs.rb +6 -0
  179. data/Views/Inventory/Computer.rb +24 -0
  180. data/Views/Inventory/Room.rb +18 -0
  181. data/Views/Inventory/Tabs.rb +9 -0
  182. data/Views/Inventory/TicketClosed.rb +7 -0
  183. data/Views/Inventory/TicketOpen.rb +23 -0
  184. data/Views/Library/Person.rb +36 -0
  185. data/Views/Library/Tabs.rb +7 -0
  186. data/Views/Network/Block.rb +87 -0
  187. data/Views/Network/Netdevs.rb +21 -0
  188. data/Views/Network/Restriction.rb +37 -0
  189. data/Views/Network/Share.rb +167 -0
  190. data/Views/Network/Tables.rb +28 -0
  191. data/Views/Network/Tabs.rb +6 -0
  192. data/Views/Person/Admin.rb +99 -0
  193. data/Views/Person/Center.rb +48 -0
  194. data/Views/Person/Course.rb +72 -0
  195. data/Views/Person/Modify.rb +153 -0
  196. data/Views/Person/Tabs.rb +162 -0
  197. data/Views/Report/ComptaExecutive.rb +221 -0
  198. data/Views/Report/ComptaFlat.rb +79 -0
  199. data/Views/Report/ReportCourse.rb +47 -0
  200. data/Views/Report/Tabs.rb +8 -0
  201. data/Views/Report/Usage.rb +52 -0
  202. data/Views/Report/UsageCases.rb +59 -0
  203. data/Views/Self/Cash.rb +67 -0
  204. data/Views/Self/Chat.rb +55 -0
  205. data/Views/Self/Concours.rb +109 -0
  206. data/Views/Self/Email.rb +34 -0
  207. data/Views/Self/Internet.rb +255 -0
  208. data/Views/Self/Results.rb +17 -0
  209. data/Views/Self/Services.rb +85 -0
  210. data/Views/Self/Show.rb +47 -0
  211. data/Views/Self/Tabs.rb +5 -0
  212. data/Views/Special/DFileEdit.rb +13 -0
  213. data/Views/Special/PlugEdit.rb +56 -0
  214. data/Views/Special/Tabs.rb +6 -0
  215. data/Views/Special/Vnc.rb +39 -0
  216. data/Views/Task/Client.rb +21 -0
  217. data/Views/Task/Edit.rb +33 -0
  218. data/Views/Task/List.rb +55 -0
  219. data/Views/Task/Tabs.rb +9 -0
  220. data/Views/Task/Worker.rb +30 -0
  221. data/Views/Template/Activity.rb +33 -0
  222. data/Views/Template/CourseType.rb +63 -0
  223. data/Views/Template/ScheduleType.rb +29 -0
  224. data/Views/Template/Tabs.rb +5 -0
  225. data/Views/Welcome.rb +121 -0
  226. data/config.yaml.default +36 -0
  227. data/po/Gestion-ar.po +2356 -0
  228. data/po/Gestion-en.mo +0 -0
  229. data/po/Gestion-en.po +4363 -0
  230. data/po/Gestion-fr.mo +0 -0
  231. data/po/Gestion-fr.po +4345 -0
  232. data/po/traduction-ar.rtf +76 -0
  233. metadata +381 -0
data/Test/ge_usage.rb ADDED
@@ -0,0 +1,168 @@
1
+ require 'test/unit'
2
+ require 'benchmark'
3
+
4
+ class TC_Usage < Test::Unit::TestCase
5
+
6
+ def setup
7
+ Entities.delete_all_data()
8
+ end
9
+
10
+ def teardown
11
+
12
+ end
13
+
14
+ def new_usage(name, dir, glob, filter)
15
+ Usages.create(:name => name, :file_dir => dir,
16
+ :file_glob => glob, :file_filter => filter)
17
+ end
18
+
19
+ def test_none
20
+ dp "Usage is missing the 'reports/'-directory"
21
+ end
22
+
23
+ def tes_usage
24
+ grep = "g\\.html HTTP\n"
25
+ fname = "fname::.*?([0-9\\.]{7,15}).*\n"
26
+ name = '192.168.99.146'
27
+ fdate = "fdate::.*\\[(.*)\\].*::%d/%b/%Y:%H:%M:%S\n"
28
+ time = Time.strptime('2014-09-05 20:49:02 +0100',
29
+ '%Y-%m-%d %H:%M:%S')
30
+ felement = "felement::.*GET.*wiki.(.*) HTTP.*\n"
31
+ element = 'Portal%253AContents/Portals.html'
32
+
33
+ f_name_element = "fname,element::.*?([0-9\\.]{7,15}).*.*GET.*wiki.(.*) HTTP.*\n"
34
+
35
+ u1 = new_usage('wiki', 'reports', 'test.log', grep + fname)
36
+ assert_equal({name: name}, u1.filter_files.first)
37
+
38
+ u1.file_filter = grep + fdate
39
+ assert_equal({date: time}, u1.filter_files.first)
40
+
41
+ u1.file_filter = grep + felement
42
+ assert_equal({element: element}, u1.filter_files.first)
43
+
44
+ u1.file_filter = grep + fname + felement
45
+ assert_equal({name: name, element: element}, u1.filter_files.first)
46
+
47
+ u1.file_filter = grep + f_name_element
48
+ assert_equal({name: name, element: element}, u1.filter_files.first)
49
+ end
50
+
51
+ def tes_filter_line
52
+ logline = 'wiki.profeda.org is the URL'
53
+ logurl = 'wiki.profeda.org'
54
+ assert_equal logurl,
55
+ Usage.filter_line(logline, 's/ .*//')
56
+
57
+ assert_nil Usage.filter_line(logline, 'ghtml')
58
+ assert_not_nil Usage.filter_line(logline, 'gwiki')
59
+
60
+ assert_nil Usage.filter_line(logline, 'vwiki')
61
+ assert_not_nil Usage.filter_line(logline, 'vhtml')
62
+
63
+ assert_nil Usage.filter_line(logline, 'gis The')
64
+ assert_not_nil Usage.filter_line(logline, 'gis the')
65
+ end
66
+
67
+ def tes_filter_field
68
+ name = 'foo'
69
+ assert_equal({},
70
+ Usage.filter_field("name is - #{name}",
71
+ 'name', '.*:(.*)'))
72
+
73
+ name = 'foo'
74
+ assert_equal({name: name},
75
+ Usage.filter_field("name is - #{name}",
76
+ 'name', '.*- (.*)'))
77
+ date = Date.today
78
+ assert_equal({date: date.to_time},
79
+ Usage.filter_field("Date is - #{date.strftime('%Y%M%D')}",
80
+ 'date', '.*- (.*)', '%Y%M%D'))
81
+
82
+ element = 'one two three'
83
+ assert_equal({element: element},
84
+ Usage.filter_field("These are my elements - #{element}",
85
+ 'element', '.*- (.*)'))
86
+
87
+ assert_equal({element: element, name: name},
88
+ Usage.filter_field("#{name}:#{element}",
89
+ 'name,element', '(.*):(.*)'))
90
+
91
+ end
92
+
93
+ def tes_speed
94
+ #dputs_func
95
+
96
+ results = ''
97
+ dputs(1) { 'Benchmarking different search strategies' }
98
+ dputs(1) { ' total description' }
99
+ dputs(1) { Benchmark.measure('finding with grep') {
100
+ results = System.run_str("grep 'GET /Files' reports/report_long")
101
+ assert_equal 31, results.split("\n").count
102
+ }.format('%t %n') }
103
+
104
+ dputs(1) { Benchmark.measure('finding with grep') {
105
+ results = System.run_str("grep 'GET /Files' reports/report_long")
106
+ assert_equal 31, results.split("\n").count
107
+ }.format('%t %n') }
108
+
109
+ results = []
110
+ dputs(1) { Benchmark.measure('Searching with =~') {
111
+ File.open('reports/report_long', 'r') { |f|
112
+ f.readlines.each { |l|
113
+ results.push l if l =~ /GET \/Files/
114
+ }
115
+ }
116
+ assert_equal 31, results.length
117
+ }.format('%t %n') }
118
+
119
+ results = []
120
+ dputs(1) { Benchmark.measure('Searching with =~ and variable') {
121
+ File.open('reports/report_long', 'r') { |f|
122
+ term = /GET \/Files/
123
+ f.readlines.each { |l|
124
+ results.push l if l =~ term
125
+ }
126
+ }
127
+ assert_equal 31, results.length
128
+ }.format('%t %n') }
129
+
130
+ results = []
131
+ grep = 'gGET /Files'
132
+ dputs(1) { Benchmark.measure('Searching with =~ in case') {
133
+ File.open('reports/report_long', 'r') { |f|
134
+ f.readlines.each { |l|
135
+ case grep
136
+ when /^g/
137
+ results.push l if l =~ /GET \/Files/
138
+ end
139
+ }
140
+ }
141
+ assert_equal 31, results.length
142
+ }.format('%t %n') }
143
+
144
+ results = []
145
+ dputs(1) { Benchmark.measure('Searching with index') {
146
+ File.open('reports/report_long', 'r') { |f|
147
+ f.readlines.each { |l|
148
+ results.push l if l.index('GET /Files')
149
+ }
150
+ }
151
+ assert_equal 31, results.length
152
+ }.format('%t %n') }
153
+
154
+ results = []
155
+ u = Usages.create( name: 'test', file_dir: 'reports', file_glob: 'report_long',
156
+ file_filter: "gGET /Files\nfname::(.*)")
157
+ dputs(1) { Benchmark.measure('Searching with Usages') {
158
+ results = u.filter_file( 'reports/report_long')
159
+ assert_equal 31, results.length
160
+ }.format('%t %n') }
161
+
162
+ results = []
163
+ dputs(1) { Benchmark.measure('Searching with Usages a gzip-file') {
164
+ results = u.filter_file( 'reports/report_long.gz')
165
+ assert_equal 31, results.length
166
+ }.format('%t %n') }
167
+ end
168
+ end
data/Test/ge_view.rb ADDED
@@ -0,0 +1,46 @@
1
+ require 'test/unit'
2
+
3
+ class TC_View < Test::Unit::TestCase
4
+
5
+ def setup
6
+ Entities.delete_all_data()
7
+ @admin = Entities.Persons.create(:login_name => 'admin', :password => 'super123',
8
+ :permissions => ['default'])
9
+ @foo = Entities.Persons.create(:login_name => 'foo', :password => 'bar',
10
+ :permissions => %w(default internet admin))
11
+ end
12
+
13
+ def teardown
14
+
15
+ end
16
+
17
+ def get_reply(service, method, session, arguments = [])
18
+ #dp RPCQooxdooService::services
19
+ s = RPCQooxdooService::services["View.#{service}"]
20
+ m = "rpc_#{method}"
21
+ parsed = s.parse_request(m, session, arguments)
22
+ s.parse_reply(m, session, parsed)
23
+ end
24
+
25
+ def test_speed_login
26
+ Struct.new('Webreq', :header, :peeraddr)
27
+ (1..200).each { |i|
28
+ Timing.measure("Measure #{i}", 3) {
29
+ session = Sessions.create
30
+ session.web_req = Struct::Webreq.new({host: 'nil'}, [0, 0, 0, '192.168.1.1'])
31
+ ret = get_reply(:Welcome, :button, session,
32
+ ['simple_connect', {'username' => 'foo', 'password' => 'bar'}])
33
+ session = Sessions.match_by_sid(ret[0]._data)
34
+ get_reply(:SelfTabs, :show, session, [])
35
+ get_reply(:SelfTabs, :list_tabs, session, [])
36
+ get_reply(:SelfInternet, :show, session, [])
37
+ get_reply(:PersonTabs, :show, session)
38
+ get_reply(:PersonTabs, :list_tabs, session)
39
+ get_reply(:PersonModify, :show, session)
40
+ if i % 10 == 0
41
+ Entities.save_all
42
+ end
43
+ }
44
+ }
45
+ end
46
+ end
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+
3
+ # Example of a captive-configuration
4
+
5
+ # The ISP - for the moment we have Prestabist, Tigo and Simul(ation)
6
+ ISP=simul
7
+
8
+ ISP_FILE=$( dirname $BASH_SOURCE )/multiconf-captive-$ISP
9
+ if [ -f $ISP_FILE ]; then
10
+ . $ISP_FILE
11
+ fi
12
+
13
+ # The table where to attache the captive - has to be linked with PREROUTING
14
+ #PREROUTING=PREROUTING
15
+
16
+ # Where the HTTP-proxy resides - this has to be a transparent proxy
17
+ #HTTP_PROXY=192.168.1.1:3128
18
+
19
+ # Destinations to allow always
20
+ #ALLOW_DST=""
21
+
22
+ # Override internal IP detection
23
+ #INTERNAL_IPS=""
24
+
25
+ # Set to space to disallow DHCP-requests - if empty, will allow anyway
26
+ #ALLOW_DHCP=" "
27
+
28
+ # Where to redirect the packets for non-authenticated users
29
+ #CAPTIVE_DNAT=""
data/Test/test.conf ADDED
@@ -0,0 +1,7 @@
1
+ # Configuration-file for Gestion
2
+ # This gives the basic configuration
3
+
4
+ # Where the programm is installed
5
+ BASE=/opt/gestion
6
+ DATA_DIR=.
7
+
data/Test/test.rb ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bundler/setup'
3
+ require 'test/unit'
4
+ require 'fileutils'
5
+ FileUtils.rm_rf Dir.glob('data*')
6
+
7
+ $config_file='config_test.yaml'
8
+ DEBUG_LVL=0
9
+
10
+ require 'qooxview'
11
+ require 'network'
12
+ require 'africompta'
13
+ #ACQooxView.load_entities
14
+
15
+ def permissions_init
16
+ Permission.clear
17
+ Permission.add('default', 'View,Welcome')
18
+ Permission.add('admin', '.*', '.*')
19
+ Permission.add('internet', 'Internet,PersonShow', 'default')
20
+ Permission.add('student', '', 'internet')
21
+ Permission.add('teacher', 'FlagResponsible', 'student')
22
+ Permission.add('secretary', 'PersonModify,FlagAddInternet,CashboxCredit',
23
+ 'teacher')
24
+ Permission.add('accountant', 'FlagAccounting')
25
+ Permission.add('center', 'FlagAddCenter', 'teacher')
26
+ Permission.add('director', 'FlagAddCenter', 'teacher')
27
+ end
28
+
29
+ permissions_init
30
+
31
+ dir = File.expand_path('..', __dir__)
32
+ QooxView.init("#{dir}/Entities", "#{dir}/Views")
33
+
34
+ tests = Dir.glob('ge_*.rb')
35
+ # tests = %w( activity )
36
+ #tests = %w( compta )
37
+ # tests = %w( internet )
38
+ # tests = %w( usage )
39
+ # tests = %w( configbase )
40
+
41
+ $LOAD_PATH.push '.'
42
+ tests.each { |t|
43
+ begin
44
+ require "ge_#{t}"
45
+ rescue LoadError => e
46
+ dputs(1){"Found error #{e}"}
47
+ require t
48
+ end
49
+ }
Binary file
data/VERSION ADDED
@@ -0,0 +1,140 @@
1
+ Important notices for versions:
2
+
3
+ - 150514: 1.9.9
4
+ - now using bundler to put everything into place
5
+
6
+ - 150331: 1.9.6
7
+ - made more granularity in internet-functions, check what you need!
8
+
9
+ - 150313: 1.9.5
10
+ - lots of bug-fixes
11
+ - added update and first version with pacman-support!
12
+
13
+ - 150203: 1.9.4
14
+ - better account-updates with much fewer traffic to AfriCompta
15
+ - use tables and naming in Course::Grades
16
+
17
+ - 150122: 1.9.3
18
+ - lots of work on Network-part with regard to USB-keys
19
+
20
+ - 150109: 1.9.2
21
+ - small improvements with regard to accounts and reports
22
+
23
+ - 141219: 1.9.1
24
+ - Added ComptaCheck and different fixes for account-setup for new installations
25
+
26
+ - 141210: 1.9.0
27
+ - changed accounts for Persons ! Might break !
28
+
29
+ - 141204: 1.8.4
30
+ - better handling of lots of the Airtel-implementation
31
+
32
+ - 141126: 1.8.3
33
+ - first more or less usable Airtel-implementation
34
+ - fixed QooxView::Storages::CSV - again
35
+
36
+ - 141113: 1.8.2
37
+ - much better integration of serialmodems
38
+ - correctly using network::captive
39
+
40
+ - 141031: 1.8.1
41
+ - Saving-error in QooxView::Storages::CSV - again. Looking forward to migrate to
42
+ ActiveRecord one day - cleaned up the data/-directory, should be more nice now.
43
+
44
+ - 141023: 1.8.0
45
+ - Good-bye LibNet. It's been nice, but complicated. Hello to Network! You still have
46
+ a lot to learn...
47
+
48
+ - 141014: 1.7.0
49
+ - added librarian
50
+ - added activities
51
+ - synchronisation of exams
52
+ - _id of 0 should not be used anymore! Unfortunately this is difficult to
53
+ update... Migrate with vi/sed
54
+
55
+ - 140830: 1.5.3
56
+ - reworked synchronisation of exams when only some changed
57
+ - BIG BAD SAVE BUG!
58
+
59
+ - 140428: 1.4.3
60
+ - Important update due to bad reworking of reply( :update, ... )
61
+
62
+ - 140402: 1.4.0
63
+ - Working Cashbox-theme
64
+ - Replaced Config::Acounting::Courses by entry in CourseType
65
+
66
+ - 140319: 1.3.7
67
+ - Started to move stuff out of config.yaml and into ConfigBase:
68
+ - libnet_uri
69
+ - debug_lvl
70
+ - internet_cash
71
+ - locale_force
72
+ - version_local
73
+ - welcome_text
74
+
75
+ - 140303: 1.3.6
76
+ - Changes in config.yaml - :log and :terminal_width moved under :DPuts
77
+
78
+ - 131028: 1.2.2-alpha
79
+ - Changes in QooxView: needs to run Config/install, for different docsplit-libs
80
+
81
+ - 130819: 1.1.15
82
+ - changes in LibNet: now you need to compile a small tool "msgtool", so that
83
+ the ruby-part and the bash-part can communicate
84
+
85
+ - 130627: 1.1.11
86
+ - changes of names in templates for diplomas:
87
+ - MENTION -> GRADE
88
+ - fiche_presence.ods is defined now in Config::Entities:Courses:presence_sheet and
89
+ presence_sheet_small
90
+ - carte_etudiant.odg is defined now in Config::Entities:Persons:student_card
91
+ - views are chosen according to AdminFunction
92
+ - Config::OpenPrint:search_remote defaults to "none"
93
+ - Config::Courses:* are moved to Config::Entities:Courses
94
+ - Renamed in Config::Courses
95
+ - diploma_dir -> dir_diplomas
96
+ - exas_dir -> dir_exas
97
+ - exas_share -> dir_exas_share
98
+ - All config-variables are
99
+ - CamelCased and start with a capital for the categories
100
+ - start with a lowercase and are seperated with "_" for the values
101
+ - PersonAdd and CourseAdd have been moved to a button, the views-admins have
102
+ been moved to FlagAdminPerson (add and delete), FlagAdminCourse (add and delete)
103
+
104
+ - 130425: 1.0.3
105
+ - config-vars
106
+ DiplomaDir -> Courses::DiplomaDir
107
+ -- -> Courses::ExaDir
108
+
109
+ - 130420: 1.0.2
110
+ - Different changes to LibNet/multiconf-*, verify that all is OK
111
+
112
+ - 130401: 1.0.0
113
+ - Made the jump to a 1.0.0-version
114
+
115
+ - 130323: 0.9.6
116
+ - Added Network-access-control and Samba-shares
117
+ - LibNet/Tools-directory with lots of useful files
118
+
119
+ - 130221: 0.9.4
120
+ - Renaming of some config-vars:
121
+ - compta_due::src,dst ->
122
+ Accounting::Lending - where the secretaries write how much they owe
123
+ Accounting::Service - where the center sees how much came in
124
+ Accounting::Cash - where the accountant stores its cash
125
+
126
+ - 121210: 0.9.2
127
+ - Renaming of some views:
128
+ AdminAccess / Admin/ControlAccess -> AdminRestriction / Admin/Restriction
129
+ AdminInternet / Admin/InternetSimple -> ../ Admin/Internet
130
+ AdminTigo / Admin/InternetTigo -> .. / Admin/Tigo
131
+ InventoryComputers / Inventory/Computers -> InventoryComputer / Inventory/Computer
132
+ InventoryRoom / Inventory/Rooms -> .. / Inventory/Room
133
+
134
+ - 121101: 0.9.1
135
+ - version at AlTatawwur
136
+
137
+ - 120928:
138
+ - base_gestion needs to have all items inbetween "-" instead of "_"
139
+ - base_gestion now takes -DESC1- and -DESC2-
140
+
@@ -0,0 +1,91 @@
1
+ # Presents a simple interface to allow for backup and restore
2
+ #
3
+ # The following functions are implemented:
4
+ # do_backup - call Binaries/backup to save files in data, Exas and Diplomas
5
+ # do_restore - re-starts Gestion which will restore the backupped data
6
+ # upload_backup - send a backup-file to the server
7
+ # download_backup - get a backup-file from the server
8
+
9
+ class AdminBackup < View
10
+ def layout
11
+ @order = 200
12
+ @update = true
13
+
14
+ gui_hbox :nogroup do
15
+ gui_vbox do
16
+ show_list_single :backups, 'View.AdminBackup.list_backups', :width => 400
17
+ show_upload :upload_backup, callback: true
18
+ show_button :do_backup, :do_restore, :do_download
19
+ end
20
+
21
+ gui_window :status do
22
+ show_html :txt
23
+ show_button :restore, :close
24
+ end
25
+ end
26
+ end
27
+
28
+ def rpc_update(session)
29
+ reply(:update, upload_backup: 'Upload backup')
30
+ end
31
+
32
+ def rpc_button_upload_backup(session, data)
33
+ file = data._filename
34
+ if file =~ /\.tgz$/
35
+ FileUtils.mv "/tmp/#{file}", "#{GESTION_DIR}/Backups"
36
+ reply(:empty_update, backups: list_backups) +
37
+ reply(:select, backups: [file]) +
38
+ reply(:window_show, :status) +
39
+ reply(:unhide, %w(close restore)) +
40
+ reply(:update, txt: "Do you want to restore #{file}?")
41
+ else
42
+ reply(:window_show, :status) +
43
+ reply_show_hide(:close, :restore) +
44
+ reply(:update, txt: "#{file} does not end in .tgz")
45
+ end
46
+ end
47
+
48
+ def rpc_button_restore(session, data)
49
+ rpc_button_do_restore(session, data)
50
+ end
51
+
52
+ def rpc_button_do_download(session, data)
53
+ if file = data._backups[0]
54
+ FileUtils.cp "#{GESTION_DIR}/Backups/#{file}", "/tmp/#{file}"
55
+ reply(:eval, "window.open('/tmp/#{file}', '_blank');") +
56
+ reply(:window_show, :status) +
57
+ reply_show_hide(:close, :restore) +
58
+ reply(:update, txt: 'If the file is not downloaded, click the following link:' +
59
+ "<br><a href='/tmp/#{file}' target='_blank'>#{file}</a>")
60
+ else
61
+ reply(:window_show, :status) +
62
+ reply_show_hide(:close, :restore) +
63
+ reply(:update, txt: 'Please chose a backup first')
64
+ end
65
+ end
66
+
67
+ def rpc_button_do_backup(session, data)
68
+ Entities.save_all
69
+ log_msg :backup, 'Creating new backup'
70
+ System.run_bool "#{GESTION_DIR}/Binaries/backup"
71
+ reply(:empty_update, backups: list_backups)
72
+ end
73
+
74
+ def rpc_button_do_restore(session, data)
75
+ file = data['backups'][0]
76
+ if File::exists? "Backups/#{file}"
77
+ dputs(1) { "Going to call restore for #{file}" }
78
+ File.open('dorestore', 'w') { |f| f.write file }
79
+ Thread.new {
80
+ Platform.restart('gestion')
81
+ }
82
+ reply(:window_show, :status) +
83
+ reply(:hide, %w(restore close)) +
84
+ reply(:update, :txt => '<h1>Recharger le navigateur avec ctrl+r ou F5</h1>')
85
+ end
86
+ end
87
+
88
+ def list_backups
89
+ System.run_str('ls Backups').split("\n").sort { |a, b| b <=> a }
90
+ end
91
+ end
@@ -0,0 +1,44 @@
1
+ class AdminConfiguration < View
2
+ def layout
3
+ @order = 600
4
+ @update = true
5
+ set_data_class(:ConfigBases)
6
+
7
+ gui_vbox do
8
+ gui_hbox :nogroup do
9
+ gui_vbox :nogroup do
10
+ show_str :dputs_logfile
11
+ show_str :dputs_logall
12
+ show_block :vars_wide
13
+ show_field :template_dir
14
+ show_field :diploma_dir
15
+ show_field :exam_dir
16
+ show_list_drop :card_student, 'ConfigBase.templates'
17
+ show_list_drop :card_responsible, 'ConfigBase.templates'
18
+ show_list_drop :presence_sheet, 'ConfigBase.templates'
19
+ show_list_drop :presence_sheet_small, 'ConfigBase.templates'
20
+ show_arg :server_url, :width => 300
21
+ end
22
+ gui_vbox :nogroup do
23
+ show_block :narrow
24
+ end
25
+ gui_vbox :nogroup do
26
+ show_block :vars_narrow
27
+ end
28
+ end
29
+ show_button :save
30
+ end
31
+ end
32
+
33
+ def rpc_update(session)
34
+ reply(:empty_nonlists) +
35
+ update_form_data(ConfigBases.singleton)
36
+ end
37
+
38
+ def rpc_button_save(session, data)
39
+ ConfigBase.store(data.to_sym)
40
+ dputs(3) { "Configuration is now #{ConfigBase.get_functions.inspect}" }
41
+
42
+ rpc_update(session)
43
+ end
44
+ end
@@ -0,0 +1,32 @@
1
+ # Unused function to import credits from another LDAP-file
2
+
3
+ class AdminCredit < View
4
+ def layout
5
+ @order = 300
6
+ @visible = false
7
+
8
+ gui_vbox do
9
+ show_text :user_credit
10
+ show_button :update_credits
11
+ end
12
+ end
13
+
14
+ def rpc_button_update_credits( session, data )
15
+ data['user_credit'].split(/\n/).each{|l|
16
+ u, c = l.split
17
+ if user = Persons.match_by_login_name(u)
18
+ log_msg :admincredit, "Setting credit of #{u}:#{user.full_name} to #{c}"
19
+ user.internet_credit = c.to_i
20
+ if not user.permissions
21
+ user.permissions = ['internet']
22
+ elsif not user.permissions.index('internet')
23
+ user.permissions.push 'internet'
24
+ end
25
+ else
26
+ dputs(0){"Error: Didn't find #{u}"}
27
+ end
28
+ }
29
+ Entities.save_all
30
+ reply( :empty_nonlists )
31
+ end
32
+ end