Skip to content
Snippets Groups Projects
Commit e1932d5f authored by Andrew Rudenets's avatar Andrew Rudenets
Browse files

Interface improvements, first case is working now

parent f54d4230
Branches
Tags
No related merge requests found
......@@ -45,9 +45,11 @@ function Controller() {
transferList: JSON.stringify(groups.Transfer.getIDs())
},
function (data) {
//groups['Transfer'].clear();
//groups['Right'].setList(data);
//view.fillList('Right', data);
console.log(data);
groups['Transfer'].clear();
groups['Right'].setList(data);
view.fillList('Right', data);
view.clearList('Transfer');
}, 'json');
};
......
......@@ -5,15 +5,22 @@ function View($root) {
this.template = '<li id="%type%-%studentID%" class="TransferListItem">%studentName%</li>';
this.changeCounter = function(n) {
this.addToCounter = function(n) {
var jCounter = $('.TransferCounter');
var c = +(jCounter.html());
jCounter.html(c + n);
};
this.resetCounter = function() {
var jCounter = $('.TransferCounter');
jCounter.html('0');
};
this.clearList = function (type) {
var jList = $root.find("#" + type + "ItemsList");
jList.html('');
if(type == 'Transfer')
this.resetCounter();
};
this.fillList = function (type, students) {
......@@ -31,7 +38,7 @@ function View($root) {
checkedstudents.forEach(function(elem){
jList.find('li[id=' + type + '-' + elem.itemID + ']').remove();
});
this.changeCounter(-checkedstudents.length);
this.addToCounter(-checkedstudents.length);
};
this.clearSelection = function (type, checkedstudents) {
......@@ -54,7 +61,7 @@ function View($root) {
i++;
}
});
this.changeCounter(+i);
this.addToCounter(+i);
};
// Обработчики событий
......@@ -115,6 +122,7 @@ function View($root) {
var onTransfer = function() {
var groupID = $('#groupRight').val();
var semesterID = +semester['Right'].val();
if(groupID != -1)
self.emit('transfer', groupID, semesterID);
};
......
......@@ -17,6 +17,8 @@
border: 1px solid @ColorLightenGrey;
margin-top: 10px;
border-radius: 2px;
min-height: 750px;
height: 1px;
.ContainerTitle {
background: @ColorLightenGrey;
padding: 10px;
......@@ -30,9 +32,8 @@
}
ul {
&.Large { height: 700px; }
&.P1Height { height: 250px; }
&.P2Height { height: 415px; }
height: 362.5px;
&.P1Height { height: auto; max-height: 250px; }
&.P2Height { max-height: 665px; height: 100%; }
overflow-y: auto;
text-align: left;
li {
......
......@@ -88,5 +88,6 @@ class Controller_Handler_Students extends Controller_Handler
// TODO: review the name of this method
Model_Student::load($ID)->returnFromAcademicLeave($groupID, $semesterID);
}
$this->action_getByGroup();
}
}
......@@ -124,7 +124,7 @@ class Model_Student extends Model_Container
*/
public function returnFromAcademicLeave($group, $semesterID = null) {
$semesterID = $semesterID ? $semesterID : User::instance()->SemesterID;;
$sql = 'CALL `ControlStudentGroup`(:id, :group, "common", :semesterID)';
$sql = 'SELECT `ControlStudentGroup`(:id, :group, "common", :semesterID) AS Result';
DB::query(Database::SELECT, $sql)
->param(':id', $this->ID)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment