4include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
 
   25                $this->
setId(
"registration_code");
 
   27                parent::__construct($a_parent_obj, $a_parent_cmd);
 
   32                        if($c == 
"role_local" || $c == 
"alimit")
 
   36                        $this->
addColumn($this->lng->txt($caption), $c);
 
   42                $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj, 
"listCodes"));
 
   43                $this->
setRowTemplate(
"tpl.code_list_row.html", 
"Services/Registration");
 
   55                $this->
addCommandButton(
"exportCodes", $lng->txt(
"registration_codes_export"));
 
   65                global $rbacreview, $ilObjDataCache;
 
   69                include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
 
   82                        $this->filter[
"code"],
 
   83                        $this->filter[
"role"],
 
   84                        $this->filter[
"generated"],
 
   85                        $this->filter[
"alimit"]
 
   88                if (count($codes_data[
"set"]) == 0 && $this->
getOffset() > 0)
 
   96                                $this->filter[
"code"],
 
   97                                $this->filter[
"role"],
 
   98                                $this->filter[
"generated"],
 
   99                                $this->filter[
"alimit"]
 
  103                include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  105                foreach($rbacreview->getGlobalRoles() as $role_id)
 
  107                        if(!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID)))
 
  109                                $role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
 
  114                foreach ($codes_data[
"set"] as $k => $code)
 
  116                        $result[$k][
"code"] = $code[
"code"];
 
  117                        $result[$k][
"code_id"] = $code[
"code_id"];
 
  128                                $result[$k][
"role"] = $this->role_map[$code[
"role"]];
 
  131                        if($code[
"role_local"])
 
  134                                foreach(explode(
";", $code[
"role_local"]) as $role_id)
 
  145                                        $result[$k][
"role_local"] = implode(
"<br />", $local); 
 
  151                                switch($code[
"alimit"])
 
  154                                                $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_none");
 
  158                                                $result[$k][
"alimit"] =  $this->lng->txt(
"reg_access_limitation_mode_absolute_target").
 
  163                                                $limit_caption = array();
 
  164                                                $limit = unserialize($code[
"alimitdt"]);                                                                                                
 
  167                                                        $limit_caption[] = (int)
$limit[
"d"].
" ".$this->lng->txt(
"days");
 
  171                                                        $limit_caption[] = (int)
$limit[
"m"].
" ".$this->lng->txt(
"months");
 
  175                                                        $limit_caption[] = (int)
$limit[
"y"].
" ".$this->lng->txt(
"years");
 
  177                                                if(
sizeof($limit_caption))
 
  179                                                        $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_mode_relative_target").
 
  180                                                                ": ".implode(
", ", $limit_caption);
 
  197                global 
$lng, $rbacreview, 
$ilUser, $ilObjDataCache;
 
  199                include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
 
  202                include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  206                $ti->setSubmitFormOnEnter(
true);
 
  208                $ti->readFromSession();
 
  209                $this->filter[
"code"] = $ti->getValue();
 
  213                $this->role_map = array();
 
  214                foreach($rbacreview->getGlobalRoles() as $role_id)
 
  216                        if(!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID)))
 
  218                                $this->role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
 
  222                include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  223                include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  224                $options = array(
"" => $this->lng->txt(
"registration_roles_all"))+
 
  229                $si->readFromSession();
 
  230                $this->filter[
"role"] = 
$si->getValue();
 
  233                $options = array(
"" => $this->lng->txt(
"registration_codes_access_limitation_all"),
 
  234                        "unlimited" => $this->lng->txt(
"reg_access_limitation_none"),
 
  235                        "absolute" => $this->lng->txt(
"reg_access_limitation_mode_absolute"),
 
  236                        "relative" => $this->lng->txt(
"reg_access_limitation_mode_relative"));  
 
  240                $si->readFromSession();
 
  241                $this->filter[
"alimit"] = 
$si->getValue();
 
  244                include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  245                $options = array(
"" => $this->lng->txt(
"registration_generated_all"));
 
  253                $si->readFromSession();
 
  254                $this->filter[
"generated"] = 
$si->getValue();
 
  259                return array(
"code" => 
"registration_code", 
 
  260                        "role" => 
"registration_codes_roles", 
 
  261                        "role_local" => 
"registration_codes_roles_local", 
 
  262                        "alimit" => 
"reg_access_limitations",
 
  263                        "generated" => 
"registration_generated", 
 
  264                        "used" => 
"registration_used");
 
  269                $this->tpl->setVariable(
"ID", $code[
"code_id"]);                
 
  272                        $this->tpl->setVariable(
"VAL_".strtoupper($c), $code[$c]);
 
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static _lookupTitle($a_id)
lookup object title
static getGenerationDates()
static getCodesData($order_field, $order_direction, $offset, $limit, $filter_code, $filter_role, $filter_generated, $filter_access_limitation)
TableGUI class for registration codes.
getSelectedColumns()
Get selected columns.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
getItems()
Get user items.
fillRow($code)
Standard Version of Fill Row.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setEnableHeader($a_enableheader)
Set Enable Header.
setExternalSorting($a_val)
Set external sorting.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setData($a_data)
set table data @access public
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
resetOffset($a_in_determination=false)
Reset offset.
addMultiCommand($a_cmd, $a_text)
Add Command button.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setExternalSegmentation($a_val)
Set external segmentation.
setOrderField($a_order_field)
set order column
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
getDefaultOrderField()
Get Default order field.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
getOrderDirection()
Get order direction.
setMaxCount($a_max_count)
set max.
This class represents a text property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
if(!is_array($argv)) $options