Skip to content
Snippets Groups Projects
Commit 91c3f437 authored by Andrew Rudenets's avatar Andrew Rudenets Committed by RomanSteinberg
Browse files

FIX: редактирование профиля

parent c5a696d1
Branches
Tags
No related merge requests found
......@@ -6,6 +6,7 @@ class Controller_Teacher_Profile extends Controller_UserEnvi {
$twig = Twig::factory('profile/settings');
$twig->JobPositions = $this->getJobPositions();
$twig->Faculties = $this->getFaculties();
$twig->Departments = DataArray::factory('Departments')->byFaculty($this->UserInfo['FacultyID']);
$twig->User = $this->UserInfo;
$this->response->body($twig);
}
......
......@@ -28,19 +28,19 @@
<a href="settings.twig"></a>
<div class="inputGroup_input">
<select id="jobPositionSelect">
<option value="0">--- Академическая должность ---</option>
{% for row in JobPositions %}
<option value="{{ row.ID }}" {% if User.JobPositionName == row.Name %}selected="selected"{% endif %}>{{ row.Name }}</option>
<option value="{{ row.ID }}" {% if User.JobPositionName == row.Name %}selected="selected"{% endif %}>{{ row.Name }}</option>
{% endfor %}
</select>
<select id="facultySelect">
<option value="0">--- Подразделение ЮФУ ---</option>
{% for row in Faculties %}
<option value="{{ row.ID }}" {% if User.JobPositionName == row.Name %}selected="selected"{% endif %}>{{ row.Name }} ({{ row.Abbr }})</option>
<option value="{{ row.ID }}" {% if User.FacultyName == row.Name %}selected="selected"{% endif %}>{{ row.Name }} ({{ row.Abbr }})</option>
{% endfor %}
</select>
<select id="departmentSelect">
<option value="0">--- Кафедра ---</option>
{% for row in Departments %}
<option value="{{ row.ID }}" {% if User.DepID == row.ID %}selected="selected"{% endif %}>{{ row.Name }}</option>
{% endfor %}
</select>
</div>
</div>
......
......@@ -40,21 +40,8 @@
.inputGroup_submit button
{
border: 0;
width: 80%;
padding: 6px 20px;
background: #3A84A6;
font-weight: bold;
font-size: 13px;
color: #ffffff;
border-radius: 3px;
moz-border-radius: 3px;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
}
.inputGroup_submit button:hover {
background: #3399CC;
cursor: pointer;
border: 1px solid #ddd;
padding: 4px;
width: 95%;
}
var URLdir = '/~dev_rating/';
\ No newline at end of file
var URLdir = '/~dev_rating/';
var sitePath = 'http://mmcs.sfedu.ru/rating';
\ No newline at end of file
$(function()
{
$("#facultySelect [value='0']").attr('selected', 'selected');
$('#departmentSelect').attr('disabled', 'disabled');
$("#departmentSelect [value='0']").attr('selected', 'selected');
$('#inputGroupSubmit').attr('disabled', 'disabled');
// Выбор факультета
$('#facultySelect').change(function(){
if (($('#facultySelect option:selected').val()!= '0')) {
$("#departmentSelect").html('<option value="0">--- Кафедра ---</option>');
$('#inputGroupSubmit').removeAttr('disabled');
$("#departmentSelect").html('');
$('#departmentSelect').attr('disabled', 'disabled');
$.post(URLdir + 'handler/settings/getDepartmentsList', {'facultyID': $('#facultySelect option:selected').val()}, function(data){
$.each(data, function(i){
......@@ -22,12 +20,36 @@ $(function()
}
});
$('#firstName').change(function(){
if (($('#firstName').val()!= '0')) {
$('#inputGroupSubmit').removeAttr('disabled');
}
});
$('#secondName').change(function(){
if (($('#secondName').val()!= '0')) {
$('#inputGroupSubmit').removeAttr('disabled');
}
});
$('#lastName').change(function(){
if (($('#lastName').val()!= '0')) {
$('#inputGroupSubmit').removeAttr('disabled');
}
});
$('#departmentSelect').change(function(){
if (($('#departmentSelect option:selected').val()!= '0')) {
$('#inputGroupSubmit').removeAttr('disabled');
}
});
$('#jobPositionSelect').change(function(){
if (($('#jobPositionSelect option:selected').val()!= '0')) {
$('#inputGroupSubmit').removeAttr('disabled');
}
});
$('#inputGroupSubmit').click(function(){
$('#inputGroupSubmit').attr('disabled', 'disabled');
$.post(URLdir + 'handler/settings/editProfile',
......@@ -45,6 +67,7 @@ $(function()
});
$('.inputGroupMessages').append('</ul>');
$('#inputGroupSubmit').removeAttr('disabled');
window.location.href = sitePath;
}, "json");
});
});
\ No newline at end of file
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