Skip to content
Snippets Groups Projects
Commit a563e437 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

v.2.7.15

parents c10f2a38 7ac93c9d
Branches
No related merge requests found
......@@ -68,31 +68,35 @@ $(function() {
// Выборка факультета
jFacultySelect.change(function(){
jDepartmentSelect.prop("disabled",true);
jNameFilterInput.prop("disabled",true);
$.post(
g_URLdir + "handler/map/GetDepartments",
{
"FacultyID": $(this).val()
},
function(Dep){
var Dep = $.parseJSON(Dep);
var i = 0;
if (Dep != null && Dep != undefined) {
jDepartmentSelect.html("<option value='0'>Выберите кафедру (не обязательно)</option>");
for (i in Dep) {
var dep = Dep[i];
if (!dep.Name) dep.Name = 'Служебная кафедра';
jDepartmentSelect.append("<option value='"+ dep.ID +"'>"+ dep.Name +"</option>");
if ($(this).val() === '0') {
jDepartmentSelect.html("<option value='0'>Нет кафедр</option>");
} else {
jDepartmentSelect.prop("disabled",true);
jNameFilterInput.prop("disabled",true);
$.post(
g_URLdir + "handler/map/GetDepartments",
{
"FacultyID": $(this).val()
},
function (Dep) {
var Dep = $.parseJSON(Dep);
var i = 0;
if (Dep != null && Dep != undefined) {
jDepartmentSelect.html("<option value='0'>Выберите кафедру (не обязательно)</option>");
for (i in Dep) {
var dep = Dep[i];
if (!dep.Name) dep.Name = 'Служебная кафедра';
jDepartmentSelect.append("<option value='" + dep.ID + "'>" + dep.Name + "</option>");
}
if (i <= 0)
jDepartmentSelect.html("<option value='0'>Нет кафедр</option>");
}
if (i <= 0)
jDepartmentSelect.html("<option value='0'>Нет кафедр</option>");
jDepartmentSelect.removeAttr("disabled");
jNameFilterInput.removeAttr("disabled");
}
jDepartmentSelect.removeAttr("disabled");
jNameFilterInput.removeAttr("disabled");
}
);
);
}
});
// jDepartmentSelect.change(function(){
......
......@@ -22,7 +22,7 @@ class Controller_Handler_Teachers extends Controller_Handler
}
public function action_search() {
$facultyID = $this->post['FacultyID'] ?: $this->user->Faculty->ID;
$facultyID = $this->post['FacultyID']; //?: $this->user->Faculty->ID;
$departmentID = $this->post['DepartmentID'];
$name = $this->post['Name'];
......
......@@ -33,6 +33,7 @@
<div class="SearchSettings">
<input type="hidden" class="HiddenInputFacultyID" value="{{ Discipline.FacultyID }}">
<select class="SelectFaculty defaultForm">
<option value="0">-- Фильтр по учебному подразделению --</option>
{% for Faculty in FacultiesList %}
<option value="{{ Faculty.ID }}" {{ User.FacultyID == Faculty.ID ? 'selected' }}>
{{ Faculty.Name }}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment