diff --git a/~dev_rating/application/classes/Controller/Teacher/Profile.php b/~dev_rating/application/classes/Controller/Teacher/Profile.php index dbabce6a78f82e28575465b75ff698916afc752a..ebbed69676d7466ee288c4aa62d5fccb2a030954 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Profile.php +++ b/~dev_rating/application/classes/Controller/Teacher/Profile.php @@ -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); } diff --git a/~dev_rating/application/views/profile/settings.twig b/~dev_rating/application/views/profile/settings.twig index c42b1a359f3a3b4e3d5de4dbc5efc3c4b4308e52..e93a62824c7b3465badc5a832cb1a3ca6dd566e2 100644 --- a/~dev_rating/application/views/profile/settings.twig +++ b/~dev_rating/application/views/profile/settings.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> diff --git a/~dev_rating/media/css/inputGroup.css b/~dev_rating/media/css/inputGroup.css index d14ad9ef9e83d43684c3eb20d57ea26918c7c13a..e8d45d5b750ad6ee07d100c0e03782c83a689e0d 100644 --- a/~dev_rating/media/css/inputGroup.css +++ b/~dev_rating/media/css/inputGroup.css @@ -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%; } diff --git a/~dev_rating/media/js/config.js b/~dev_rating/media/js/config.js index 4ba9d44e64ea457bbe4501be419b68401f7624e9..3230ff9e39436310efde98914de0fbf584784ccf 100644 --- a/~dev_rating/media/js/config.js +++ b/~dev_rating/media/js/config.js @@ -1 +1,2 @@ -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 diff --git a/~dev_rating/media/js/profileSettings.js b/~dev_rating/media/js/profileSettings.js index 3a7594d214a620903942995fc0dd7ce4967c12be..39d7f209568b11ef3f7931980e672e47fdb8f9b5 100644 --- a/~dev_rating/media/js/profileSettings.js +++ b/~dev_rating/media/js/profileSettings.js @@ -1,13 +1,11 @@ $(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