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".(
int)$this->portfolio_mode);
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";
102 include_once
"Services/User/classes/class.ilUserUtil.php";
119 include_once
"Services/Membership/classes/class.ilParticipants.php";
123 $lng->loadLanguageModule(
"search");
126 $this->filter[
"user"] = $item->getValue();
129 if((
int)$_REQUEST[
"shr_id"] &&
131 !$this->filter[
"user"])
134 $this->filter[
"user"] = $this->filter[
"user"][
"login"];
135 $item->setValue($this->filter[
"user"]);
139 $this->filter[
"title"] = $item->getValue();
141 $item = $this->
addFilterItemByMetaType(
"acl_date", self::FILTER_DATE,
false, $lng->txt(
"wsp_shared_date_filter"));
142 $this->filter[
"acl_date"] = $item->getDate();
144 if(!$this->portfolio_mode)
148 $settings_map =
array(
"blog" =>
"blogs",
151 foreach(
array(
"file",
"blog") as $type)
153 if(isset($settings_map[$type]) && $ilSetting->get(
"disable_wsp_".$settings_map[$type]))
157 $options[$type] = $lng->txt(
"wsp_type_".$type);
167 $item = $this->
addFilterItemByMetaType(
"obj_type", self::FILTER_SELECT,
false, $lng->txt(
"wsp_shared_object_type"));
169 $this->filter[
"obj_type"] = $item->getValue();
174 $options[
"user"] = $lng->txt(
"wsp_set_permission_single_user");
176 if(
sizeof($this->grp_ids))
178 $options[
"group"] = $lng->txt(
"wsp_set_permission_group");
181 if(
sizeof($this->crs_ids))
183 $options[
"course"] = $lng->txt(
"wsp_set_permission_course");
186 if(!$this->handler->hasRegisteredPermission($this->parent_node_id))
188 $options[
"registered"] = $lng->txt(
"wsp_set_permission_registered");
191 if($ilSetting->get(
"enable_global_profiles"))
193 if(!$this->handler->hasGlobalPasswordPermission($this->parent_node_id))
195 $options[
"password"] = $this->lng->txt(
"wsp_set_permission_all_password");
198 if(!$this->handler->hasGlobalPermission($this->parent_node_id))
200 $options[
"all"] = $this->lng->txt(
"wsp_set_permission_all");
208 $item->setOptions(
array(
""=>$lng->txt(
"search_any"))+
$options);
209 $this->filter[
"acl_type"] = $item->getValue();
212 if(
sizeof($this->crs_ids) ||
sizeof($this->grp_ids))
215 foreach($this->crs_ids as $crs_id)
219 foreach($this->grp_ids as $grp_id)
224 $item = $this->
addFilterItemByMetaType(
"crsgrp", self::FILTER_SELECT,
false, $lng->txt(
"wsp_shared_member_filter"));
225 $item->setOptions(
array(
""=>$lng->txt(
"search_any"))+
$options);
226 $this->filter[
"crsgrp"] = $item->getValue();
236 $user_data =
array();
238 $objects = $this->handler->findSharedObjects($this->filter, $this->crs_ids, $this->grp_ids);
241 foreach($objects as $wsp_id => $item)
243 if(!isset($user_data[$item[
"owner"]]))
249 if(!$user_data[$item[
"owner"]][
"login"])
256 "obj_id" => $item[
"obj_id"],
257 "type" => $item[
"type"],
258 "obj_type" => $lng->txt(
"wsp_type_".$item[
"type"]),
259 "title" => $item[
"title"],
260 "owner_id" => $item[
"owner"],
261 "lastname" => $user_data[$item[
"owner"]][
"lastname"],
262 "firstname" => $user_data[$item[
"owner"]][
"firstname"],
263 "login" => $user_data[$item[
"owner"]][
"login"],
264 "acl_type" => $item[
"acl_type"],
265 "acl_date" => $item[
"acl_date"]
272 include_once(
'./Services/Link/classes/class.ilLink.php');
284 $this->tpl->setVariable(
"LASTNAME", $node[
"lastname"]);
285 $this->tpl->setVariable(
"FIRSTNAME", $node[
"firstname"]);
286 $this->tpl->setVariable(
"LOGIN", $node[
"login"]);
288 $this->tpl->setVariable(
"TITLE", $node[
"title"]);
290 if(!$this->portfolio_mode)
292 $this->tpl->setVariable(
"TYPE", $node[
"obj_type"]);
293 $this->tpl->setVariable(
"ICON_ALT", $node[
"obj_type"]);
296 $url = $this->handler->getGotoLink($node[
"wsp_id"], $node[
"obj_id"]);
302 $this->tpl->setVariable(
"URL_TITLE",
$url);
304 $this->tpl->setVariable(
"ACL_DATE",
307 asort($node[
"acl_type"]);
308 foreach($node[
"acl_type"] as $obj_id)
315 $type =
"registered";
319 $title =
$icon_alt = $this->lng->txt(
"wsp_set_permission_all_password");
320 $type =
"all_password";
325 $type =
"all_password";
355 $this->tpl->setCurrentBlock(
"acl_type_bl");
356 $this->tpl->setVariable(
"ACL_TYPE",
$title);
357 $this->tpl->parseCurrentBlock();
360 if(!$this->portfolio_mode)
363 if($node[
"type"] ==
"file")
365 $ilCtrl->setParameter($this->parent_obj,
"wsp_id",
366 $this->parent_node_id);
367 $ilCtrl->setParameter($this->parent_obj,
"item_ref_id",
369 $url = $ilCtrl->getLinkTarget($this->parent_obj,
"copyshared");
371 $this->tpl->setCurrentBlock(
"action_bl");
372 $this->tpl->setVariable(
"URL_ACTION",
$url);
373 $this->tpl->setVariable(
"ACTION", $lng->txt(
"copy"));
374 $this->tpl->parseCurrentBlock();
378 $this->tpl->touchBlock(
"action_col_bl");
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
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.
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, $a_return_data_array=false)
Default behaviour is:
__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
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.
Create styles array
The data for the language used.
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
fillRow($node)
Fill table row.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFilterCommand($a_val, $a_caption=null)
Set filter command.