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");
81 if($this->portfolio_mode &&
82 !$this->filter[
"obj_type"])
84 $this->filter[
"obj_type"] =
"prtf";
89 if(($this->filter[
"user"] && strlen($this->filter[
"user"]) > 3) ||
90 ($this->filter[
"title"] && strlen($this->filter[
"title"]) > 3) ||
91 $this->filter[
"acl_date"] ||
92 $this->filter[
"obj_type"] ||
93 $this->filter[
"acl_type"] ||
94 $this->filter[
"crsgrp"])
97 include_once
"Services/User/classes/class.ilUserUtil.php";
112 include_once
"Services/Membership/classes/class.ilParticipants.php";
116 $lng->loadLanguageModule(
"search");
119 $this->filter[
"user"] = $item->getValue();
122 if((
int)
$_REQUEST[
"shr_id"] && !$this->filter[
"user"])
125 $this->filter[
"user"] = $this->filter[
"user"][
"login"];
126 $item->setValue($this->filter[
"user"]);
130 $this->filter[
"title"] = $item->getValue();
132 $item = $this->
addFilterItemByMetaType(
"acl_date", self::FILTER_DATE,
false, $lng->txt(
"wsp_shared_date_filter"));
133 $this->filter[
"acl_date"] = $item->getDate();
135 if(!$this->portfolio_mode)
138 $options = array(
""=>$lng->txt(
"search_any"));
139 $settings_map = array(
"blog" =>
"blogs",
142 foreach(array(
"file",
"blog") as $type)
144 if(isset($settings_map[$type]) && $ilSetting->get(
"disable_wsp_".$settings_map[$type]))
148 $options[$type] = $lng->txt(
"wsp_type_".$type);
153 $options = array(
"prtf"=>$lng->txt(
"obj_prtf"));
158 $item = $this->
addFilterItemByMetaType(
"obj_type", self::FILTER_SELECT,
false, $lng->txt(
"wsp_shared_object_type"));
160 $this->filter[
"obj_type"] = $item->getValue();
165 $options[
"user"] = $lng->txt(
"wsp_set_permission_single_user");
167 if(
sizeof($this->grp_ids))
169 $options[
"group"] = $lng->txt(
"wsp_set_permission_group");
172 if(
sizeof($this->crs_ids))
174 $options[
"course"] = $lng->txt(
"wsp_set_permission_course");
177 if(!$this->handler->hasRegisteredPermission($this->parent_node_id))
179 $options[
"registered"] = $lng->txt(
"wsp_set_permission_registered");
182 if($ilSetting->get(
"enable_global_profiles"))
184 if(!$this->handler->hasGlobalPasswordPermission($this->parent_node_id))
186 $options[
"password"] = $this->lng->txt(
"wsp_set_permission_all_password");
189 if(!$this->handler->hasGlobalPermission($this->parent_node_id))
191 $options[
"all"] = $this->lng->txt(
"wsp_set_permission_all");
199 $item->setOptions(array(
""=>$lng->txt(
"search_any"))+
$options);
200 $this->filter[
"acl_type"] = $item->getValue();
203 if(
sizeof($this->crs_ids) ||
sizeof($this->grp_ids))
206 foreach($this->crs_ids as $crs_id)
210 foreach($this->grp_ids as $grp_id)
215 $item = $this->
addFilterItemByMetaType(
"crsgrp", self::FILTER_SELECT,
false, $lng->txt(
"wsp_shared_member_filter"));
216 $item->setOptions(array(
""=>$lng->txt(
"search_any"))+
$options);
217 $this->filter[
"crsgrp"] = $item->getValue();
227 $user_data = array();
229 $objects = $this->handler->findSharedObjects($this->filter, $this->crs_ids, $this->grp_ids);
232 foreach($objects as $wsp_id => $item)
234 if(!isset($user_data[$item[
"owner"]]))
241 "obj_id" => $item[
"obj_id"],
242 "type" => $item[
"type"],
243 "obj_type" => $lng->txt(
"wsp_type_".$item[
"type"]),
244 "title" => $item[
"title"],
245 "owner_id" => $item[
"owner"],
246 "lastname" => $user_data[$item[
"owner"]][
"lastname"],
247 "firstname" => $user_data[$item[
"owner"]][
"firstname"],
248 "login" => $user_data[$item[
"owner"]][
"login"],
249 "acl_type" => $item[
"acl_type"],
250 "acl_date" => $item[
"acl_date"]
257 include_once(
'./Services/Link/classes/class.ilLink.php');
269 $this->tpl->setVariable(
"LASTNAME", $node[
"lastname"]);
270 $this->tpl->setVariable(
"FIRSTNAME", $node[
"firstname"]);
271 $this->tpl->setVariable(
"LOGIN", $node[
"login"]);
273 $this->tpl->setVariable(
"TITLE", $node[
"title"]);
275 if(!$this->portfolio_mode)
277 $this->tpl->setVariable(
"TYPE", $node[
"obj_type"]);
278 $this->tpl->setVariable(
"ICON_ALT", $node[
"obj_type"]);
281 $url = $this->handler->getGotoLink($node[
"wsp_id"], $node[
"obj_id"]);
287 $this->tpl->setVariable(
"URL_TITLE", $url);
289 $this->tpl->setVariable(
"ACL_DATE",
292 asort($node[
"acl_type"]);
293 foreach($node[
"acl_type"] as $obj_id)
300 $type =
"registered";
305 $title =
$icon_alt = $this->lng->txt(
"wsp_set_permission_all_password");
306 $type =
"all_password";
312 $type =
"all_password";
319 $icon_alt = $this->lng->txt(
"obj_".$type);
334 $this->tpl->setCurrentBlock(
"acl_type_icon_bl");
335 $this->tpl->setVariable(
"ACL_ICON",
$icon);
336 $this->tpl->setVariable(
"ACL_ICON_ALT",
$icon_alt);
337 $this->tpl->parseCurrentBlock();
340 $this->tpl->setCurrentBlock(
"acl_type_bl");
341 $this->tpl->setVariable(
"ACL_TYPE",
$title);
342 $this->tpl->parseCurrentBlock();
345 if(!$this->portfolio_mode)
348 if($node[
"type"] ==
"file")
350 $ilCtrl->setParameter($this->parent_obj,
"wsp_id",
351 $this->parent_node_id);
352 $ilCtrl->setParameter($this->parent_obj,
"item_ref_id",
354 $url = $ilCtrl->getLinkTarget($this->parent_obj,
"copyshared");
356 $this->tpl->setCurrentBlock(
"action_bl");
357 $this->tpl->setVariable(
"URL_ACTION", $url);
358 $this->tpl->setVariable(
"ACTION", $lng->txt(
"copy"));
359 $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
setFilterCommand($a_val)
Set filter command.
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...
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.
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.
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
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
disable($a_module_name)
diesables particular modules of table
setFormAction($a_form_action)
Set Form action parameter.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
fillRow($node)
Fill table row.
setResetCommand($a_val)
Set reset filter command.