-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6140 from chlulei/mt_29772_release_8
Mantis Ticket 29772, release 8
- Loading branch information
1 parent
a7eadb4
commit c5fe95c
Showing
4 changed files
with
87 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=0); | ||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
|
@@ -17,6 +16,8 @@ | |
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=0); | ||
|
||
/** | ||
* TableGUI for material assignments of course objectives | ||
* @author Stefan Meyer <[email protected]> | ||
|
@@ -36,6 +37,7 @@ public function __construct(object $a_parent_obj, ilObject $a_course_obj, int $a | |
$this->objectDefinition = $DIC['objDefinition']; | ||
$this->objective_id = $a_objective_id; | ||
|
||
$this->setId('tbl_crs_obj_mat_assignment'); | ||
parent::__construct($a_parent_obj, 'materialAssignment'); | ||
$this->lng->loadLanguageModule('crs'); | ||
|
||
|
@@ -46,7 +48,7 @@ public function __construct(object $a_parent_obj, ilObject $a_course_obj, int $a | |
$this->setFormAction($this->ctrl->getFormAction($a_parent_obj)); | ||
$this->setRowTemplate("tpl.crs_objective_list_materials_row.html", "Modules/Course"); | ||
$this->setDefaultOrderField('title'); | ||
$this->setLimit(200); | ||
$this->setShowRowsSelector(true); | ||
$this->setNoEntriesText($this->lng->txt('crs_no_objective_lms_found')); | ||
$this->addCommandButton('updateMaterialAssignment', $this->lng->txt('crs_wiz_next')); | ||
$this->initObjectiveAssignments(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=0); | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
|
@@ -18,6 +16,8 @@ | |
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=0); | ||
|
||
/** | ||
* class ilCourseObjectiveMaterials | ||
* @author Stefan Meyer <[email protected]> | ||
|
@@ -293,6 +293,26 @@ public function add(): int | |
return $next_id; | ||
} | ||
|
||
public function deleteMaterial(int $ref_id, int $obj_id): bool | ||
{ | ||
$query = "DELETE FROM crs_objective_lm " . | ||
"WHERE objective_id = " . $this->db->quote($this->getObjectiveId(), 'integer') . " " . | ||
"AND ref_id = " . $this->db->quote($ref_id, 'integer') . " " . | ||
"AND obj_id = " . $this->db->quote($obj_id, 'integer'); | ||
$this->db->manipulate($query); | ||
return true; | ||
} | ||
|
||
public function isMaterialAssigned(int $ref_id, int $obj_id): bool | ||
{ | ||
$query = "SELECT * FROM crs_objective_lm " . | ||
"WHERE ref_id = " . $this->db->quote($ref_id, 'integer') . " " . | ||
"AND obj_id = " . $this->db->quote($obj_id, 'integer') . " " . | ||
"AND objective_id = " . $this->db->quote($this->getObjectiveId(), 'integer') . " "; | ||
$res = $this->db->query($query); | ||
return (bool) $res->numRows(); | ||
} | ||
|
||
public function delete(int $lm_id): bool | ||
{ | ||
if (!$lm_id) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters