4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
32 function __construct($a_parent_obj, $a_parent_cmd, $a_handler, $a_parent_node_id = null, $a_load_data =
false)
36 $this->handler = $a_handler;
38 if(stristr(get_class($a_parent_obj),
"portfolio"))
40 $this->parent_node_id = $a_parent_node_id;
41 $this->portfolio_mode =
true;
44 parent::__construct($a_parent_obj, $a_parent_cmd);
46 $this->
setId(
"il_tbl_wspsh");
48 $this->
setTitle($lng->txt(
"wsp_shared_resources"));
50 $this->
addColumn($this->lng->txt(
"lastname"),
"lastname");
51 $this->
addColumn($this->lng->txt(
"firstname"),
"firstname");
52 $this->
addColumn($this->lng->txt(
"login"),
"login");
54 if(!$this->portfolio_mode)
56 $this->
addColumn($this->lng->txt(
"wsp_shared_object_type"),
"obj_type");
59 $this->
addColumn($this->lng->txt(
"wsp_shared_date"),
"acl_date");
60 $this->
addColumn($this->lng->txt(
"wsp_shared_title"),
"title");
61 $this->
addColumn($this->lng->txt(
"wsp_shared_type"));
63 if(!$this->portfolio_mode)
65 $this->
addColumn($this->lng->txt(
"action"));
72 $this->
setRowTemplate(
"tpl.shared_row.html",
"Services/PersonalWorkspace");
75 $this->
setResetCommand(
"resetsharefilter", $this->lng->txt(
"wsp_shared_filter_reset_button"));
76 $this->
setFilterCommand(
"applysharefilter", $this->lng->txt(
"wsp_shared_filter_button"));
81 if($this->portfolio_mode &&
82 !$this->filter[
"obj_type"])
84 $this->filter[
"obj_type"] =
"prtf";
101 include_once
"Services/User/classes/class.ilUserUtil.php";
118 include_once
"Services/Membership/classes/class.ilParticipants.php";
122 $lng->loadLanguageModule(
"search");
125 $this->filter[
"user"] = $item->getValue();
130 !$this->filter[
"user"])
133 $this->filter[
"user"] = $this->filter[
"user"][
"login"];
134 $item->setValue($this->filter[
"user"]);
138 $this->filter[
"title"] = $item->getValue();
140 $item = $this->
addFilterItemByMetaType(
"acl_date", self::FILTER_DATE,
false, $lng->txt(
"wsp_shared_date_filter"));
141 $this->filter[
"acl_date"] = $item->getDate();
143 if(!$this->portfolio_mode)
146 $options = array(
""=>$lng->txt(
"search_any"));
147 $settings_map = array(
"blog" =>
"blogs",
150 foreach(array(
"file",
"blog") as $type)
152 if(isset($settings_map[$type]) && $ilSetting->get(
"disable_wsp_".$settings_map[$type]))
156 $options[$type] = $lng->txt(
"wsp_type_".$type);
161 $options = array(
"prtf"=>$lng->txt(
"obj_prtf"));
166 $item = $this->
addFilterItemByMetaType(
"obj_type", self::FILTER_SELECT,
false, $lng->txt(
"wsp_shared_object_type"));
168 $this->filter[
"obj_type"] = $item->getValue();
173 $options[
"user"] = $lng->txt(
"wsp_set_permission_single_user");
175 if(
sizeof($this->grp_ids))
177 $options[
"group"] = $lng->txt(
"wsp_set_permission_group");
180 if(
sizeof($this->crs_ids))
182 $options[
"course"] = $lng->txt(
"wsp_set_permission_course");
185 if(!$this->handler->hasRegisteredPermission($this->parent_node_id))
187 $options[
"registered"] = $lng->txt(
"wsp_set_permission_registered");
190 if($ilSetting->get(
"enable_global_profiles"))
192 if(!$this->handler->hasGlobalPasswordPermission($this->parent_node_id))
194 $options[
"password"] = $this->lng->txt(
"wsp_set_permission_all_password");
197 if(!$this->handler->hasGlobalPermission($this->parent_node_id))
199 $options[
"all"] = $this->lng->txt(
"wsp_set_permission_all");
207 $item->setOptions(array(
""=>$lng->txt(
"search_any"))+
$options);
208 $this->filter[
"acl_type"] = $item->getValue();
211 if(
sizeof($this->crs_ids) ||
sizeof($this->grp_ids))
214 foreach($this->crs_ids as $crs_id)
218 foreach($this->grp_ids as $grp_id)
223 $item = $this->
addFilterItemByMetaType(
"crsgrp", self::FILTER_SELECT,
false, $lng->txt(
"wsp_shared_member_filter"));
224 $item->setOptions(array(
""=>$lng->txt(
"search_any"))+
$options);
225 $this->filter[
"crsgrp"] = $item->getValue();
235 $user_data = array();
237 $objects = $this->handler->findSharedObjects($this->filter, $this->crs_ids, $this->grp_ids);
240 foreach($objects as $wsp_id => $item)
242 if(!isset($user_data[$item[
"owner"]]))
248 if(!$user_data[$item[
"owner"]][
"login"])
255 "obj_id" => $item[
"obj_id"],
256 "type" => $item[
"type"],
257 "obj_type" => $lng->txt(
"wsp_type_".$item[
"type"]),
258 "title" => $item[
"title"],
259 "owner_id" => $item[
"owner"],
260 "lastname" => $user_data[$item[
"owner"]][
"lastname"],
261 "firstname" => $user_data[$item[
"owner"]][
"firstname"],
262 "login" => $user_data[$item[
"owner"]][
"login"],
263 "acl_type" => $item[
"acl_type"],
264 "acl_date" => $item[
"acl_date"]
271 include_once(
'./Services/Link/classes/class.ilLink.php');
283 $this->tpl->setVariable(
"LASTNAME", $node[
"lastname"]);
284 $this->tpl->setVariable(
"FIRSTNAME", $node[
"firstname"]);
285 $this->tpl->setVariable(
"LOGIN", $node[
"login"]);
287 $this->tpl->setVariable(
"TITLE", $node[
"title"]);
289 if(!$this->portfolio_mode)
291 $this->tpl->setVariable(
"TYPE", $node[
"obj_type"]);
292 $this->tpl->setVariable(
"ICON_ALT", $node[
"obj_type"]);
295 $url = $this->handler->getGotoLink($node[
"wsp_id"], $node[
"obj_id"]);
301 $this->tpl->setVariable(
"URL_TITLE", $url);
303 $this->tpl->setVariable(
"ACL_DATE",
306 asort($node[
"acl_type"]);
307 foreach($node[
"acl_type"] as $obj_id)
314 $type =
"registered";
319 $title =
$icon_alt = $this->lng->txt(
"wsp_set_permission_all_password");
320 $type =
"all_password";
326 $type =
"all_password";
333 $icon_alt = $this->lng->txt(
"obj_".$type);
348 $this->tpl->setCurrentBlock(
"acl_type_icon_bl");
349 $this->tpl->setVariable(
"ACL_ICON",
$icon);
350 $this->tpl->setVariable(
"ACL_ICON_ALT",
$icon_alt);
351 $this->tpl->parseCurrentBlock();
354 $this->tpl->setCurrentBlock(
"acl_type_bl");
355 $this->tpl->setVariable(
"ACL_TYPE",
$title);
356 $this->tpl->parseCurrentBlock();
359 if(!$this->portfolio_mode)
362 if($node[
"type"] ==
"file")
364 $ilCtrl->setParameter($this->parent_obj,
"wsp_id",
365 $this->parent_node_id);
366 $ilCtrl->setParameter($this->parent_obj,
"item_ref_id",
368 $url = $ilCtrl->getLinkTarget($this->parent_obj,
"copyshared");
370 $this->tpl->setCurrentBlock(
"action_bl");
371 $this->tpl->setVariable(
"URL_ACTION", $url);
372 $this->tpl->setVariable(
"ACTION", $lng->txt(
"copy"));
373 $this->tpl->parseCurrentBlock();
static _lookupName($a_user_id)
lookup user name
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
const PERMISSION_ALL_PASSWORD
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
static _lookupTitle($a_id)
lookup object title
const PERMISSION_REGISTERED
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true)
Default behaviour is:
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Workspace share handler table GUI class.
__construct($a_parent_obj, $a_parent_cmd, $a_handler, $a_parent_node_id=null, $a_load_data=false)
Constructor.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
if(!is_array($argv)) $options
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
static formatDate(ilDateTime $date)
Format a date public.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
fillRow($node)
Fill table row.
setFilterCommand($a_val, $a_caption=null)
Set filter command.