246 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.mail_search.html",
"Services/Contact");
247 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this));
248 $this->tpl->setTitle($this->lng->txt(
"mail"));
249 $this->tpl->setVariable(
'SEARCHFORM',
$form->getHtml());
253 !isset(
$_SESSION[
"mail_search_search"]) ||
254 !is_string(
$_SESSION[
"mail_search_search"]) ||
255 strlen(trim(
$_SESSION[
"mail_search_search"])) < 3
257 if (
$_GET[
"ref"] !=
"wsp") {
263 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddyList.php';
265 if (count($relations)) {
270 $query_parser->setMinWordLength(3);
271 $query_parser->parse();
274 $user_search->enableActiveCheck(
true);
275 $user_search->setFields(array(
'login'));
276 $result_obj = $user_search->performSearch();
277 $contacts_search_result->mergeEntries($result_obj);
279 $user_search->setFields(array(
'firstname'));
280 $result_obj = $user_search->performSearch();
281 $contacts_search_result->mergeEntries($result_obj);
283 $user_search->setFields(array(
'lastname'));
284 $result_obj = $user_search->performSearch();
285 $contacts_search_result->mergeEntries($result_obj);
287 $contacts_search_result->setMaxHits(100000);
288 $contacts_search_result->preventOverwritingMaxhits(
true);
289 $contacts_search_result->filter(ROOT_FOLDER_ID,
true);
292 include_once
'Services/User/classes/class.ilUserFilter.php';
294 $users = array_intersect(
$users, $relations->getKeys());
297 $tbl_contacts->setTitle($this->lng->txt(
'mail_addressbook'));
298 $tbl_contacts->setRowTemplate(
'tpl.mail_search_addr_row.html',
'Services/Contact');
300 $has_mail_addr =
false;
306 if (
$_GET[
'ref'] ==
'wsp') {
317 $has_mail_addr =
true;
326 $result[$counter][
'firstname'] =
'';
327 $result[$counter][
'lastname'] =
'';
333 if (
$_GET[
'ref'] ==
'wsp') {
334 $tbl_contacts->addColumn(
"",
"",
"1%",
true);
336 $tbl_contacts->addColumn($this->lng->txt(
'mail_to') .
'/' . $this->lng->txt(
'cc') .
'/' . $this->lng->txt(
'bc'),
'check',
'10%');
338 $tbl_contacts->addColumn($this->lng->txt(
'login'),
'login',
'15%');
339 $tbl_contacts->addColumn($this->lng->txt(
'firstname'),
'firstname',
'15%');
340 $tbl_contacts->addColumn($this->lng->txt(
'lastname'),
'lastname',
'15%');
341 if ($has_mail_addr) {
343 if ($val[
'email'] ==
'') {
348 $tbl_contacts->addColumn($this->lng->txt(
'email'),
'email',
"15%");
350 $tbl_contacts->setData(
$result);
352 $tbl_contacts->setDefaultOrderField(
'login');
353 $tbl_contacts->setPrefix(
'addr_');
354 $tbl_contacts->enable(
'select_all');
355 $tbl_contacts->setSelectAllCheckbox(
'search_name_to_addr');
356 $tbl_contacts->setFormName(
'recipients');
358 $this->tpl->setVariable(
'TABLE_ADDR', $tbl_contacts->getHTML());
365 $query_parser->setMinWordLength(3);
366 $query_parser->parse();
369 $user_search->enableActiveCheck(
true);
370 $user_search->setFields(array(
'login'));
371 $result_obj = $user_search->performSearch();
372 $all_results->mergeEntries($result_obj);
374 $user_search->setFields(array(
'firstname'));
375 $result_obj = $user_search->performSearch();
376 $all_results->mergeEntries($result_obj);
378 $user_search->setFields(array(
'lastname'));
379 $result_obj = $user_search->performSearch();
380 $all_results->mergeEntries($result_obj);
382 $all_results->setMaxHits(100000);
383 $all_results->preventOverwritingMaxhits(
true);
384 $all_results->filter(ROOT_FOLDER_ID,
true);
387 include_once
'Services/User/classes/class.ilUserFilter.php';
391 $tbl_users->setTitle($this->lng->txt(
'system') .
': ' . $this->lng->txt(
'persons'));
392 $tbl_users->setRowTemplate(
'tpl.mail_search_users_row.html',
'Services/Contact');
396 foreach (
$users as $user) {
399 if (
$_GET[
"ref"] !=
"wsp") {
413 $result[$counter][
'firstname'] =
'';
414 $result[$counter][
'lastname'] =
'';
418 $has_mail_usr =
true;
425 if (
$_GET[
"ref"] !=
"wsp") {
426 $tbl_users->addColumn($this->lng->txt(
'mail_to') .
'/' . $this->lng->txt(
'cc') .
'/' . $this->lng->txt(
'bc'),
'check',
'10%');
428 $tbl_users->addColumn(
"",
"",
"1%");
430 $tbl_users->addColumn($this->lng->txt(
'login'),
'login',
'15%');
431 $tbl_users->addColumn($this->lng->txt(
'firstname'),
'firstname',
'15%');
432 $tbl_users->addColumn($this->lng->txt(
'lastname'),
'lastname',
'15%');
433 if ($has_mail_usr ==
true) {
435 if ($val[
'email'] ==
'') {
440 $tbl_users->addColumn($this->lng->txt(
'email'),
'email',
'15%');
444 $tbl_users->setDefaultOrderField(
'login');
445 $tbl_users->setPrefix(
'usr_');
446 $tbl_users->enable(
'select_all');
447 $tbl_users->setSelectAllCheckbox(
'search_name_to_usr');
448 $tbl_users->setFormName(
'recipients');
450 $this->tpl->setVariable(
'TABLE_USERS', $tbl_users->getHTML());
453 include_once
'Services/Search/classes/class.ilQueryParser.php';
454 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
455 include_once
'Services/Search/classes/class.ilSearchResult.php';
456 include_once
'Services/Membership/classes/class.ilParticipants.php';
462 $query_parser->setMinWordLength(3);
463 $query_parser->parse();
466 $search->setFilter(array(
'grp'));
467 $result = $search->performSearch();
468 $group_results->mergeEntries(
$result);
469 $group_results->setMaxHits(PHP_INT_MAX);
470 $group_results->preventOverwritingMaxhits(
true);
471 $group_results->setRequiredPermission(
'read');
472 $group_results->filter(ROOT_FOLDER_ID,
true);
474 $visible_groups = array();
475 if ($group_results->getResults()) {
477 $tbl_grp->setTitle($this->lng->txt(
'system') .
': ' . $this->lng->txt(
'groups'));
478 $tbl_grp->setRowTemplate(
'tpl.mail_search_groups_row.html',
'Services/Contact');
483 $this->object_data_cache->preloadReferenceCache(array_keys($group_results->getResults()));
485 $groups = $group_results->getResults();
486 foreach ($groups as $grp) {
491 if (
$_GET[
"ref"] !=
"wsp") {
493 $roles = $this->rbacreview->getAssignableChildRoles($grp[
'ref_id']);
494 foreach ($roles as $role) {
495 if (substr($role[
'title'], 0, 14) ==
'il_grp_member_' ||
496 substr($role[
'title'], 0, 13) ==
'il_grp_admin_' 499 array_push($members,
'#' . $role[
'title']);
502 $str_members = implode(
',', $members);
511 $result[$counter][
'title'] = $this->object_data_cache->lookupTitle($grp[
'obj_id']);
512 $result[$counter][
'description'] = $this->object_data_cache->lookupDescription($grp[
'obj_id']);
515 $visible_groups[] = $grp;
518 if ($visible_groups) {
521 if (
$_GET[
"ref"] !=
"wsp") {
522 $tbl_grp->addColumn($this->lng->txt(
'mail_to') .
'/' . $this->lng->txt(
'cc') .
'/' . $this->lng->txt(
'bc'),
'check',
'10%');
524 $tbl_grp->addColumn(
"",
"",
"1%");
526 $tbl_grp->addColumn($this->lng->txt(
'title'),
'title',
'15%');
527 $tbl_grp->addColumn($this->lng->txt(
'description'),
'description',
'15%');
529 $tbl_grp->setDefaultOrderField(
'title');
530 $tbl_grp->setPrefix(
'grp_');
531 $tbl_grp->enable(
'select_all');
532 $tbl_grp->setSelectAllCheckbox(
'search_name_to_grp');
533 $tbl_grp->setFormName(
'recipients');
535 $this->tpl->setVariable(
'TABLE_GRP', $tbl_grp->getHTML());
539 if (count(
$users) || count($visible_groups) || count($relations)) {
541 $this->tpl->setVariable(
"ALT_ARROW",
'');
543 if (
$_GET[
"ref"] !=
"wsp") {
544 $this->tpl->setVariable(
'BUTTON_ADOPT', $this->lng->txt(
'adopt'));
546 $this->tpl->setVariable(
'BUTTON_ADOPT', $this->lng->txt(
'wsp_share_with_users'));
549 $this->lng->loadLanguageModule(
'search');
553 if (
$_GET[
"ref"] !=
"wsp") {
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static getInstanceByGlobalUser()
static getInstance()
Singelton get instance.
static hasParticipantListAccess($a_obj_id, $a_usr_id=null)
Check if (current) user has access to the participant list.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getUserSearchInstance($query_parser)
get reference of ilLikeUserSearch
if(isset($_POST['submit'])) $form
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupEmail($a_user_id)
Lookup email.
static _lookupPref($a_usr_id, $a_keyword)
static _getObjectSearchInstance($query_parser)
get reference of ilFulltext/LikeObjectSearch.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public