Skip to content
Snippets Groups Projects
Commit 41130bfb authored by Антон Шалимов's avatar Антон Шалимов
Browse files

super mega fix ...

parent 2963842b
Branches
Tags
No related merge requests found
...@@ -234,21 +234,21 @@ class Controller_Handler_Map extends Controller_Handler { ...@@ -234,21 +234,21 @@ class Controller_Handler_Map extends Controller_Handler {
$this->post->offsetGet('DisciplineID'), $this->post->offsetGet('DisciplineID'),
'' ''
); );
$data['ModuleID'] = $result[0]['Num']; $data['moduleID'] = $result[0]['Num'];
if ($data['ModuleID'] > 0) { if ($data['moduleID'] > 0) {
// Добавление мероприятия // Добавление мероприятия
// Т.к. модуль должен содержать хотя бы // Т.к. модуль должен содержать хотя бы
// 1 мероприятие // 1 мероприятие
$result = $this->model->AddSubmodule( $result = $this->model->AddSubmodule(
$this->user['TeacherID'], $this->user['TeacherID'],
$data['ModuleID'], $data['moduleID'],
'0', //MaxRate '0', //MaxRate
'', '',
'', //Description '', //Description
'CurrentControl' 'CurrentControl'
); );
$data['SubmoduleID'] = $result[0]['Num']; $data['submoduleID'] = $result[0]['Num'];
if ($data['SubmoduleID'] > 0) if ($data['submoduleID'] > 0)
$data['success'] = true; $data['success'] = true;
} }
...@@ -259,19 +259,19 @@ class Controller_Handler_Map extends Controller_Handler { ...@@ -259,19 +259,19 @@ class Controller_Handler_Map extends Controller_Handler {
// Добавление мероприятия // Добавление мероприятия
public function action_AddSubmodule() { public function action_AddSubmodule() {
$data['success'] = false; $data['success'] = false;
$this->post -> rule('ModuleID', 'not_empty') $this->post -> rule('submoduleID', 'not_empty')
-> rule('ModuleID', 'digit'); -> rule('submoduleID', 'digit');
if($this->post->check()) { if($this->post->check()) {
$result = $this->model->AddSubmodule( $result = $this->model->AddSubmodule(
$this->user['TeacherID'], $this->user['TeacherID'],
$this->post->offsetGet('ModuleID'), $this->post->offsetGet('submoduleID'),
'0', //MaxRate '0', //MaxRate
'', '',
'', //Description '', //Description
'CurrentControl' 'CurrentControl'
); );
$data['SubmoduleID'] = $result[0]['Num']; $data['submoduleID'] = $result[0]['Num'];
if ($data['SubmoduleID'] > 0) if ($data['submoduleID'] > 0)
$data['success'] = true; $data['success'] = true;
} }
$this->response->body(json_encode($data)); $this->response->body(json_encode($data));
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
{% block map_content %} {% block map_content %}
<p class="notification" style="display: none;">{{ Discipline.SemesterNum }} семестр {{ Discipline.SemesterYear }}/{{ Discipline.SemesterYear + 1 }} учебного года</p> <p class="notification" style="display: none;">{{ Discipline.SemesterNum }} семестр {{ Discipline.SemesterYear }}/{{ Discipline.SemesterYear + 1 }} учебного года</p>
<div class="RateIndicatorDIV"> <div class="rateIndicatorDIV">
Количество баллов: <span class="RateIndicator">{{ Map.MaxRate }}</span>{% if Map.isSetBonus == true %} + 10 бонусных баллов{% endif %} Количество баллов: <span class="rateIndicator">{{ Map.MaxRate }}</span>{% if Map.isSetBonus == true %} + 10 бонусных баллов{% endif %}
</div> </div>
<div class="studyMap StructureTable"> <div class="studyMap StructureTable">
<div class="name">Виды контрольных мероприятий</div> <div class="name">Виды контрольных мероприятий</div>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="moduleGroup" id="{{ Map[i].ModuleID }}"> <div class="moduleGroup" id="{{ Map[i].ModuleID }}">
<div class="moduleHead"> <div class="moduleHead">
<div class="name"> <div class="name">
<input type="text" class="inputName ModuleName" placeholder="Наименование модуля" value="{{ Map[i].ModuleTitle }}" > <input type="text" class="inputName moduleName" placeholder="Наименование модуля" value="{{ Map[i].ModuleTitle }}" >
</div> </div>
<div class="currentControl">{{ Map[i].CurrentControl }}</div> <div class="currentControl">{{ Map[i].CurrentControl }}</div>
<div class="landmarkControl">{{ Map[i].LandmarkControl }}</div> <div class="landmarkControl">{{ Map[i].LandmarkControl }}</div>
...@@ -35,26 +35,26 @@ ...@@ -35,26 +35,26 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
<div class="subModules"> <div class="submodules">
{% for j in range(1, Map[i].SubmodulesCount) if Map[i].SubmodulesCount > 0 %} {% for j in range(1, Map[i].SubmodulesCount) if Map[i].SubmodulesCount > 0 %}
<div class="subModule" id="{{ Map[i][j].SubmoduleID }}"> <div class="submodule" id="{{ Map[i][j].SubmoduleID }}">
<div class="name"> <div class="name">
<input type="text" class="inputName SubmoduleName" placeholder="Наименование мероприятия" value="{{ Map[i][j].Title }}"> <input type="text" class="inputName submoduleName" placeholder="Наименование мероприятия" value="{{ Map[i][j].Title }}">
</div> </div>
<div class="currentControl"><input type="text" class="inputCredit inputCurrentControl" value="{% if Map[i][j].SubmoduleControl == 'CurrentControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div> <div class="currentControl"><input type="text" class="inputCredit inputCurrentControl" value="{% if Map[i][j].SubmoduleControl == 'CurrentControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div>
<div class="landmarkControl"><input type="text" class="inputCredit inputLandmarkControl" value="{% if Map[i][j].SubmoduleControl == 'LandmarkControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div> <div class="landmarkControl"><input type="text" class="inputCredit inputLandmarkControl" value="{% if Map[i][j].SubmoduleControl == 'LandmarkControl' %}{{ Map[i][j].MaxRate }}{% else %}0{% endif %}"></div>
{% if Discipline.isLocked != 1 %} {% if Discipline.isLocked != 1 %}
<div class="actions"> <div class="actions">
<div class="deleteSubModule icon delete"></div> <div class="deleteSubmodule icon delete"></div>
<div class="downSubModule icon down"></div> <div class="downSubmodule icon down"></div>
<div class="upSubModule icon up"></div> <div class="upSubmodule icon up"></div>
</div> </div>
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% if Discipline.isLocked != 1 %} {% if Discipline.isLocked != 1 %}
<button class="addSubModule">Добавить мероприятие</button> <button class="addSubmodule">Добавить мероприятие</button>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
......
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
margin: 5px 0 15px 0 margin: 5px 0 15px 0
} }
/* Количество баллов (индикатор) */ /* Количество баллов (индикатор) */
.RateIndicatorDIV { .rateIndicatorDIV {
margin: 15px 0 25px 0; margin: 15px 0 25px 0;
font-size: 18px; font-size: 18px;
text-align: center; text-align: center;
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
color: #00CC00 color: #00CC00
} }
.confirmDeleteSubModule { .confirmDeleteSubmodule {
margin-left: 10px; margin-left: 10px;
cursor: pointer; cursor: pointer;
background: transparent; background: transparent;
...@@ -260,10 +260,10 @@ ...@@ -260,10 +260,10 @@
} }
/* Список мероприятий (подмодулей) */ /* Список мероприятий (подмодулей) */
.subModules { .submodules {
} }
/* Мероприятие (Подмодуль) */ /* Мероприятие (Подмодуль) */
.subModule { .submodule {
background-color: #e4e4e4; background-color: #e4e4e4;
padding: 6px 15px; padding: 6px 15px;
margin: 5px 8px margin: 5px 8px
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
font-weight: bold; font-weight: bold;
} }
/* Кнопка добавления мероприятия */ /* Кнопка добавления мероприятия */
.addSubModule { .addSubmodule {
float: right; float: right;
background: url(icons/add.png) no-repeat 10px center #e4e4e4; background: url(icons/add.png) no-repeat 10px center #e4e4e4;
padding: 8px 20px 8px 40px; padding: 8px 20px 8px 40px;
......
...@@ -34,7 +34,7 @@ $(function() { ...@@ -34,7 +34,7 @@ $(function() {
if (errCount === 0) { if (errCount === 0) {
$.post( $.post(
g_URL + "handler/map/AddDiscipline", g_URLdir + "handler/map/AddDiscipline",
{ {
"Grade": gradeID, "Grade": gradeID,
"SubjectID": subjectID, "SubjectID": subjectID,
...@@ -49,7 +49,7 @@ $(function() { ...@@ -49,7 +49,7 @@ $(function() {
{ {
data = $.parseJSON(data); data = $.parseJSON(data);
if(data.success === true) { if(data.success === true) {
setTimeout("location.replace('"+g_URL+"discipline/structure/"+data.DisciplineID+"')", 800); setTimeout("location.replace('"+g_URLdir+"discipline/structure/"+data.DisciplineID+"')", 800);
} else { } else {
jThis.removeAttr("disabled"); jThis.removeAttr("disabled");
EventInspector_ShowMsg("Ошибка при добавлении дисциплины", "error"); EventInspector_ShowMsg("Ошибка при добавлении дисциплины", "error");
......
...@@ -201,7 +201,7 @@ $(function() { ...@@ -201,7 +201,7 @@ $(function() {
{ {
var jThis = $(this); var jThis = $(this);
var value = parseInt(jThis.val()); var value = parseInt(jThis.val());
if (value === LectionCount) if (value === practiceCount)
return; return;
$(this).prop("disabled", true); $(this).prop("disabled", true);
$.post( $.post(
......
This diff is collapsed.
...@@ -5,6 +5,8 @@ var $ = jQuery; ...@@ -5,6 +5,8 @@ var $ = jQuery;
$(function() { $(function() {
g_URL = (window.location.href).split("/"); g_URL = (window.location.href).split("/");
g_disciplineID = g_URL[g_URL.length - 1]; g_disciplineID = g_URL[g_URL.length - 1];
DisciplineID = g_disciplineID;
var subjectsGlobal = []; var subjectsGlobal = [];
......
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