Commit 7a013e01 authored by Σταύρος Παπαδάκης's avatar Σταύρος Παπαδάκης
Browse files

Access to forms information from restricted access users

parent 4dd337f6
......@@ -81,7 +81,7 @@ return [
],
'admin' => [
'adminhome' => [
'label' => 'Αρχική σελίδα διαχειριστή',
'label' => 'Σελίδα διαχειριστή',
'route' => 'admin',
],
]
......
......@@ -22,16 +22,6 @@ return function (App $app) {
});
$events('on', 'app.services', function (Container $container) {
// $nav = $container['settings']->get('navigation');
// $nav['admin'] = [
// 'adminhome' => [
// 'label' => 'Διαχειριστής',
// 'route' => 'admin',
// 'icon' => 'user-secret',
// ],
// ];
// $container['settings']->set('navigation', $nav);
$container[GrEduLabs\Admin\Action\Index::class] = function ($c) {
return new GrEduLabs\Admin\Action\Index($c['view']);
};
......@@ -41,6 +31,6 @@ return function (App $app) {
$view = $c->get('view');
$view->getEnvironment()->getLoader()->prependPath(__DIR__ . '/templates');
$app->get('/admin', GrEduLabs\Admin\Action\Index::class)
->setName('admin');
->setName('admin');
});
};
......@@ -6,9 +6,24 @@
<div class="panel-heading">
<h4>Σελίδα διαχειριστή</h4>
</div>
<div class="panel-body">
<p>Διαθέσιμες διαχειριστικές λειτουργίες</p>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>Διαθέσιμες διαχειριστικές λειτουργίες</th>
<th>&nbsp;</th>
<tr>
</thead>
<tbody>
<tr>
<td>Καταχωρημένες αιτήσεις εθελοντών - Εκπαιδευτικοί</td>
<td><a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_teachers'}) }}"><i class="fa fa-download"></i> Αρχείο .csv</a></td>
</tr>
<tr>
<td>Καταχωρημένες αιτήσεις εθελοντών - Ιδρύματα</td>
<td><a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_institutions'}) }}"><span class="fa fa-download"></span> Αρχείο .csv</a></td>
</tr>
</tbody>
</table>
<div class="panel-footer text-center">
<a class="btn btn-sm btn-default" href="{{ path_for('index') }}"><span class="fa fa-home"></span> Αρχική</a>
<a class="btn btn-sm btn-primary" href="{{ path_for('admin') }}"><span class="fa fa-user-secret"></span> Διαχειριστής</a>
......
This diff is collapsed.
......@@ -8,66 +8,66 @@
}());
var proto = $.ui.autocomplete.prototype,
initSource = proto._initSource;
initSource = proto._initSource;
$("#select_school").autocomplete({
source: window.location.protocol + "//" + window.location.host + "/teacher-form/mm",
minLength: 4,
select: function(event, ui) {
select: function (event, ui) {
console.log(ui);
$("#mm_id").val(ui.item.mm_id);
$("#el-school").val(ui.item.value);
$("#el-schooltelef").val(ui.item.tel);
},
html: false,
open: function(event, ui) {
open: function (event, ui) {
$(".ui-autocomplete").css("z-index", 1000);
}
});
}(window.jQuery, _, window.EDULABS.utils));
$(document).ready(function() {
var max_fields = 10; //maximum input boxes allowed
var wrapper = $(".input_fields_wrap"); //Fields wrapper
var add_button = $(".add_field_button"); //Add button ID
$(document).ready(function () {
var max_fields = 10; //maximum input boxes allowed
var wrapper = $(".input_fields_wrap"); //Fields wrapper
var add_button = $(".add_field_button"); //Add button ID
var x = 1; //initlal text box count
$(add_button).click(function(e){ //on add input button click
$(add_button).click(function (e) { //on add input button click
e.preventDefault();
if(x < max_fields){ //max input box allowed
if (x < max_fields) { //max input box allowed
x++; //text box increment
$(wrapper).append('<div><div><label for="projects">Σχετική δράση που συμμετείχατε </label><input type="text" name="projects" id="projects"></div> <div><label for="urlproject">URL δράσης που συμμετείχατε</label><input type="text" name="urlproject" id="urlproject"></div> <div><label for "commentproject">Περιγραφή δράσης που συμμετείχατε</label><input type="text" name="commentsproject" id="commentproject"></div><a href="#" class="remove_field">Διαγραφή</a></div>');
$(wrapper).append('<div><div><label for="projects">Σχετική δράση που συμμετείχατε </label><input type="text" name="projects" id="projects"></div> <div><label for="urlproject">URL δράσης που συμμετείχατε</label><input type="text" name="urlproject" id="urlproject"></div> <div><label for "commentproject">Περιγραφή δράσης που συμμετείχατε</label><input type="text" name="commentsproject" id="commentproject"></div><a href="#" class="remove_field">Διαγραφή</a></div>');
}
});
$(wrapper).on("click",".remove_field", function(e){ //user click on remove text
$(wrapper).on("click", ".remove_field", function (e) { //user click on remove text
e.preventDefault();
$(this).parent('div').remove(); x--;
})
$("#submit").click(function(){
var projects = $("input[id='projects']")
.map(function(){return $(this).val();}).get();
$(this).parent('div').remove();
x--;
});
var urlproject = $("input[id='urlproject']")
.map(function(){return $(this).val();}).get();
$("#submit").click(function () {
var commentproject = $("input[id='commentproject']")
.map(function(){return $(this).val();}).get();
var projects = $("input[id='projects']")
.map(function () {
return $(this).val();
}).get().join("_@@@_");
var newfield = projects+"#"+urlproject+"#"+commentproject;
var urlproject = $("input[id='urlproject']")
.map(function () {
return $(this).val();
}).get().join("_@@@_");
$('#projectdescription').val(newfield);
var commentproject = $("input[id='commentproject']")
.map(function () {
return $(this).val();
}).get().join("_@@@_");
})
var newfield = projects + "###@@@###" + urlproject + "###@@@###" + commentproject;
$('#projectdescription').val(newfield);
});
});
......@@ -89,7 +89,5 @@ input[type=text] {
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.3/backbone-min.js"></script>
<script src="{{ base_url }}/js/jquery-ui.autoc.min.js"></script>
<script src="{{ base_url() }}/js/teacher_form/index.js"></script>
<script src="{{ base_url() }}/js/teacher_form/index-1.1.js"></script>
{% endblock %}
(function ($, _, utils) {
'use strict';
(function () {
var form = $('#app-form form');
var messages = form.data('messages');
utils.formMessages.render(form, messages);
}());
}(window.jQuery, _, window.EDULABS.utils));
window.onload = function () {
$('#el-idrima').attr("disabled", true);
$('#el-sxolh').attr("disabled", true);
$('#el-tmhma').attr("disabled", true);
$('#el-ereunitiko').attr("disabled", true);
$('#el-institute').attr("disabled", true);
$('#el-other').attr("disabled", true);
$('label[for="el-ereunitiko"]').attr("disabled", true);
$('label[for="el-institute"]').attr("disabled", true);
$('label[for="el-other"]').attr("disabled", true);
$('label[for="el-idrima"]').attr("disabled", true);
$('label[for="el-sxolh"]').attr("disabled", true);
$('label[for="el-tmhma"]').attr("disabled", true);
if (document.getElementById("hididrima").value == '') {
} else
{
$("#newselect").prop("selectedIndex", 1);
$("#newselect").change();
}
if (document.getElementById("hidereunitiko").value == '') {
} else
{
$("#newselect").prop("selectedIndex", 2);
$("#newselect").change();
}
};
$('#el-idrima').on('change', function () {
var key = this.value;
$.post({
url: 'http://relabs1.minedu.gov.gr/mypoint/taxonomy_vocabulary/getTree.json',
type: 'POST',
data: {vid: "13"},
dataType: 'json',
}).done(function (data, statusText, resObject) {
if (document.getElementById("el-sxolh").options.length != 0) {
var i;
for (i = document.getElementById("el-sxolh").options.length - 1; i >= 1; i--)
{
document.getElementById("el-sxolh").remove(i);
}
$("#el-sxolh").append('<option value=1></option>');
}
if (document.getElementById("el-tmhma").options.length != 0) {
var i;
for (i = document.getElementById("el-tmhma").options.length - 1; i >= 1; i--)
{
document.getElementById("el-tmhma").remove(i);
}
$("#el-tmhma").append('<option value=1></option>');
}
for (var index = 0; index < data.length; index++) {
if (data[ index ].parents == data[key].tid && data[ index ].depth == 1)
$('#el-sxolh')
.append($("<option></option>")
.attr("value", index)
.text(data[ index ].name));
}
});
});
$('#el-sxolh').on('change', function () {
var key = this.value;
$.post({
url: 'http://relabs1.minedu.gov.gr/mypoint/taxonomy_vocabulary/getTree.json',
type: 'POST',
data: {vid: "13"},
dataType: 'json',
}).done(function (data, statusText, resObject) {
if (document.getElementById("el-tmhma").options.length != 0) {
var i;
for (i = document.getElementById("el-tmhma").options.length - 1; i >= 1; i--)
{
document.getElementById("el-tmhma").remove(i);
}
$("#el-tmhma").append('<option value=1></option>');
}
for (var index = 0; index < data.length; index++) {
if (data[ index ].parents == data[key].tid && data[ index ].depth == 2)
$('#el-tmhma')
.append($("<option></option>")
.attr("value", index)
.text(data[ index ].name));
}
});
});
$(document).ready(function () {
var max_fields = 10; //maximum input boxes allowed
var wrapper = $(".input_fields_wrap"); //Fields wrapper
var add_button = $(".add_field_button"); //Add button ID
var x = 1; //initlal text box count
$(add_button).click(function (e) { //on add input button click
e.preventDefault();
if (x < max_fields) { //max input box allowed
x++; //text box increment
$(wrapper).append('<div><div><label for="projects">Σχετική δράση που συμμετείχατε </label><input type="text" name="projects" id="projects"></div> <div><label for="urlproject">URL δράσης που συμμετείχατε</label><input type="text" name="urlproject" id="urlproject"></div> <div><label for "commentproject">Περιγραφή δράσης που συμμετείχατε</label><input type="text" name="commentsproject" id="commentproject"></div><a href="#" class="remove_field">Διαγραφή</a></div>');
}
});
$(wrapper).on("click", ".remove_field", function (e) { //user click on remove text
e.preventDefault();
$(this).parent('div').remove();
x--;
});
$("#submit").click(function (e) {
$('#hidnewselect').val(document.getElementById("newselect").value);
var projects = $("input[id='projects']")
.map(function () {
return $(this).val();
}).get().join("_@@@_");
var urlproject = $("input[id='urlproject']")
.map(function () {
return $(this).val();
}).get().join("_@@@_");
var commentproject = $("input[id='commentproject']")
.map(function () {
return $(this).val();
}).get().join("_@@@_");
var newfield = projects + "###@@@###" + urlproject + "###@@@###" + commentproject;
$('#projectdescription').val(newfield);
idrimadb = $("#el-idrima option:selected").text();
$('#el-idrima')
.append($("<option selected ></option>")
.attr("value", idrimadb)
.text(idrimadb));
sxolhdb = $("#el-sxolh option:selected").text();
$('#el-sxolh')
.append($("<option selected ></option>")
.attr("value", sxolhdb)
.text(sxolhdb));
tmhmadb = $("#el-tmhma option:selected").text();
$('#el-tmhma')
.append($("<option selected ></option>")
.attr("value", tmhmadb)
.text(tmhmadb));
ereunitikodb = $("#el-ereunitiko option:selected").text();
$('#el-ereunitiko')
.append($("<option selected ></option>")
.attr("value", ereunitikodb)
.text(ereunitikodb));
institutedb = $("#el-institute option:selected").text();
$('#el-institute')
.append($("<option selected ></option>")
.attr("value", institutedb)
.text(institutedb));
});
});
$('#newselect').on('change', function () {
selection = $("#newselect").val();
switch (selection)
{
case 'idrimata':
document.getElementById('second').style.display = "none";
document.getElementById('first').style.display = "block";
$('#el-ereunitiko').attr("disabled", true);
$('#el-ereunitiko').val('');
$('#el-institute').attr("disabled", true);
$('#el-institute').val('');
$('#el-other').attr("disabled", true);
$('#el-other').val('');
$('label[for="el-ereunitiko"]').attr("disabled", true);
$('label[for="el-institute"]').attr("disabled", true);
$('label[for="el-other"]').attr("disabled", true);
$('#el-idrima').attr("disabled", false);
$('#el-sxolh').attr("disabled", false);
$('#el-tmhma').attr("disabled", false);
$('label[for="el-sxolh"]').attr("disabled", false);
$('label[for="el-tmhma"]').attr("disabled", false);
$('label[for="el-idrima"]').attr("disabled", false);
if (document.getElementById("el-idrima").options.length != 0)
{
var i;
for (i = document.getElementById("el-idrima").options.length - 1; i >= 1; i--)
{
document.getElementById("el-idrima").remove(i);
}
}
$.post({
url: 'http://relabs1.minedu.gov.gr/mypoint/taxonomy_vocabulary/getTree.json',
type: 'POST',
data: {vid: "13"},
dataType: 'json',
}).done(function (data, statusText, resObject) {
for (var index = 0; index < data.length; index++) {
if (data[ index ].depth == 0)
{
if (data[ index ].name == document.getElementById("hididrima").value) {
$('#el-idrima')
.append($("<option selected ></option>")
.attr("value", index)
.text(data[ index ].name));
refresh(index);
} else
{
$('#el-idrima')
.append($("<option></option>")
.attr("value", index)
.text(data[ index ].name));
}
}
}
});
break;
case 'ereunitika':
document.getElementById('first').style.display = "none";
document.getElementById('second').style.display = "block";
$('#el-idrima').val('');
$('#el-sxolh').val('');
$('#el-tmhma').val('');
$('#el-idrima').attr("disabled", true);
$('#el-sxolh').attr("disabled", true);
$('#el-tmhma').attr("disabled", true);
$('#el-ereunitiko').attr("disabled", false);
$('#el-institute').attr("disabled", false);
$('#el-other').attr("disabled", true);
$('label[for="el-ereunitiko"]').attr("disabled", false);
$('label[for="el-institute"]').attr("disabled", false);
$('label[for="el-other"]').attr("disabled", false);
$('label[for="el-idrima"]').attr("disabled", true);
$('label[for="el-sxolh"]').attr("disabled", true);
$('label[for="el-tmhma"]').attr("disabled", true);
if (document.getElementById("el-ereunitiko").options.length != 0)
{
var i;
for (i = document.getElementById("el-ereunitiko").options.length - 1; i >= 1; i--)
{
document.getElementById("el-ereunitiko").remove(i);
}
}
$.post({
url: 'http://relabs1.minedu.gov.gr/mypoint/taxonomy_vocabulary/getTree.json',
type: 'POST',
data: {vid: "15"},
dataType: 'json',
}).done(function (data1, statusText, resObject) {
for (var index1 = 0; index1 < data1.length; index1++) {
if (data1[ index1 ].depth == 0)
{
if (data1[ index1 ].name == document.getElementById("hidereunitiko").value)
{
$('#el-ereunitiko')
.append($("<option selected ></option>")
.attr("value", index1)
.text(data1[ index1 ].name));
refresh1(index1);
} else
{
$('#el-ereunitiko')
.append($("<option></option>")
.attr("value", index1)
.text(data1[ index1 ].name));
}
}
}
});
break;
}
});
$('#el-ereunitiko').on('change', function () {
var key = this.value;
$.post({
url: 'http://relabs1.minedu.gov.gr/mypoint/taxonomy_vocabulary/getTree.json',
type: 'POST',
data: {vid: "15"},
dataType: 'json',
}).done(function (data1, statusText, resObject) {
if (document.getElementById("el-institute").options.length != 0)
{
var i;
for (i = document.getElementById("el-institute").options.length - 1; i >= 1; i--)
{
document.getElementById("el-institute").remove(i);
}
$("#el-institute").append('<option value=1></option>');
}
for (var index1 = 0; index1 < data1.length; index1++)
{
if (data1[ index1 ].parents == data1[key].tid && data1[ index1 ].depth == 1)
$('#el-institute')
.append($("<option></option>")
.attr("value", index1)
.text(data1[ index1 ].name));
}
$("#el-institute").append('<option value=1000>ΑΛΛΟ</option>');
});
val1 = document.getElementById("el-ereunitiko").value;
if (document.getElementById("el-idrima").options.length != 0) {
var i;
for (i = document.getElementById("el-idrima").options.length - 1; i >= 1; i--)
{
document.getElementById("el-idrima").remove(i);
}
}
});
$('#el-institute').on('change', function () {
sel = $("#el-institute").val();
switch (sel)
{
case '1000':
$('#el-other').attr("disabled", false);
$('#lother').attr("disabled", false);
break;
default:
$('#el-other').val("");
$('#el-other').attr("disabled", true);
}
});
function refresh(key) {
$.post({
url: 'http://relabs1.minedu.gov.gr/mypoint/taxonomy_vocabulary/getTree.json',
type: 'POST',
data: {vid: "13"},
dataType: 'json',
}).done(function (data, statusText, resObject) {
for (var index = 0; index < data.length; index++)
{
if (data[ index ].parents == data[key].tid && data[ index ].depth == 1)
if (data[ index ].name == document.getElementById("hidsxolh").value)
{
$('#el-sxolh')
.append($("<option selected></option>")
.attr("value", index)
.text(data[ index ].name));
for (var index1 = 0; index1 < data.length; index1++)
{
if (data[ index1 ].parents == data[index].tid && data[ index1