ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilAssignmentsTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
16 
20  function __construct($a_parent_obj, $a_parent_cmd, $a_exc)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  $this->exc = $a_exc;
25  $this->setId("excass".$a_exc->getId());
26 
27  parent::__construct($a_parent_obj, $a_parent_cmd);
28 
29  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
30  $this->setData(ilExAssignment::getAssignmentDataOfExercise($this->exc->getId()));
31  $this->setTitle($lng->txt("exc_assignments"));
32  $this->setTopCommands(true);
33 
34  // if you add pagination and disable the unlimited setting:
35  // fix saving of ordering of single pages!
36  $this->setLimit(9999);
37 
38  $this->addColumn("", "", "1", true);
39  $this->addColumn($this->lng->txt("title"), "title");
40  $this->addColumn($this->lng->txt("exc_presentation_order"), "val_order");
41  $this->addColumn($this->lng->txt("exc_start_time"), "start_time");
42  $this->addColumn($this->lng->txt("exc_deadline"), "deadline");
43  $this->addColumn($this->lng->txt("exc_mandatory"), "mandatory");
44  $this->addColumn($this->lng->txt("exc_instruction"), "", "40%");
45  $this->addColumn($this->lng->txt("actions"));
46 
47  $this->setDefaultOrderField("val_order");
48  $this->setDefaultOrderDirection("asc");
49 
50  //$this->setDefaultOrderField("name");
51  //$this->setDefaultOrderDirection("asc");
52 
53  $this->setEnableHeader(true);
54  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
55  $this->setRowTemplate("tpl.exc_assignments_row.html", "Modules/Exercise");
56  //$this->disable("footer");
57  $this->setEnableTitle(true);
58  $this->setSelectAllCheckbox("id");
59 
60  $this->addMultiCommand("confirmAssignmentsDeletion", $lng->txt("delete"));
61 
62  $this->addCommandButton("orderAssignmentsByDeadline", $lng->txt("exc_order_by_deadline"));
63  $this->addCommandButton("saveAssignmentOrder", $lng->txt("exc_save_order"));
64  //$this->addCommandButton("addAssignment", $lng->txt("exc_add_assignment"));
65  }
66 
70  protected function fillRow($d)
71  {
72  global $lng, $ilCtrl;
73 
74  $this->tpl->setVariable("ID", $d["id"]);
75  $this->tpl->setVariable("TXT_DEADLINE",
77  if ($d["start_time"] > 0)
78  {
79  $this->tpl->setVariable("TXT_START_TIME",
81  }
82  $this->tpl->setVariable("TXT_INSTRUCTIONS",
83  ilUtil::shortenText($d["instruction"], 200, true));
84 
85  if ($d["mandatory"])
86  {
87  $this->tpl->setVariable("TXT_MANDATORY", $lng->txt("yes"));
88  }
89  else
90  {
91  $this->tpl->setVariable("TXT_MANDATORY", $lng->txt("no"));
92  }
93 
94  $this->tpl->setVariable("TXT_TITLE", $d["title"]);
95  $this->tpl->setVariable("ORDER_VAL", $d["order_val"]);
96 
97  $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
98  $ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]);
99  $this->tpl->setVariable("CMD_EDIT",
100  $ilCtrl->getLinkTarget($this->parent_obj, "editAssignment"));
101  }
102 
103 }
104 ?>