Changeset 42 for trunk/calendar/inc/class.uicalendar.inc.php
- Timestamp:
- 07/27/07 16:54:47 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/class.uicalendar.inc.php
r36 r42 4017 4017 $user_ou = explode(",",str_replace($context,"",implode(",",$user_context))); 4018 4018 $user_context = trim(strtolower($user_ou[count($user_ou) - 2].",".$context)); 4019 // Fim 4020 $combo_org = $this->get_sectors(trim(strtolower($user_context))); 4019 // Fim 4020 // Verifica o tipo da visualização da árvore LDAP, configurado no admin da Agenda 4021 $recursive = $GLOBALS['phpgw_info']['server']['cal_type_tree_participants'] == '1' ? true : false; 4022 $combo_org = $this->get_organizations(trim(strtolower($context)),$user_context, $recursive); 4021 4023 $footer_ext_participantes = lang("Tip: To search in the <b>Global Catalog</b>, type the <b>F9</b> key, like the ExpressoMail."); 4022 4024 … … 4040 4042 '<td valign="bottom">'. 4041 4043 ' '.lang("Organization").': '. 4042 ' <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\',this.value );">'.$combo_org.'</select>'.4044 ' <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\',this.value,\''.($recursive ? "" : "search").'\');">'.$combo_org.'</select>'. 4043 4045 ' <br>'. 4044 4046 ' <font color="red"><span id="cal_span_searching"> </span></font>'. … … 4057 4059 "<script type='text/javascript'>var DEFAULT_URL = '".$module_name."/controller.php?action=';</script> ". 4058 4060 "<script type='text/javascript'>" . 4059 "setTimeout('get_available_users(\"".$module_name."\",\'".$user_context."\' )',1000);".4061 "setTimeout('get_available_users(\"".$module_name."\",\'".$user_context."\',\'".($recursive ? "" : "search")."\')',1000);". 4060 4062 "</script> " 4061 4063 … … 4641 4643 return $daily; 4642 4644 } 4643 4644 function get_ sectors($selected='')4645 4646 function get_organizations($context, $selected='', $recursive = false) 4645 4647 { 4646 4648 $s = CreateObject('phpgwapi.sector_search_ldap'); 4647 $sectors_info = $s->get_sectors($selected, false, false); 4648 return $sectors_info; 4649 } 4650 4651 /* 4652 function get_organizations($context, $selected='') 4653 { 4654 $first_sector_ufn = ldap_dn2ufn($context); 4655 $first_sector_string = split(",", $first_sector_ufn); 4656 4657 $s = CreateObject('phpgwapi.sector_search_ldap'); 4658 $sectors_info = $s->sector_search($context); 4659 4660 $sector_select = ""; 4661 $sector_select .= "<option value='" .$context . "'"; 4662 $sector_select .= ">".$first_sector_string[0]."</option>\n"; 4663 4664 foreach($sectors_info as $sector) 4665 { 4666 if ($sector->sector_level == 1) 4667 { 4668 $sector->sector_name = '+ '.$sector->sector_name; 4669 } 4670 else 4671 { 4672 $sector_space = ''; 4673 for ($i=1; $i < $sector->sector_level; $i++) 4674 $sector_space = '---'.$sector_space; 4675 $sector->sector_name = $sector_space.' '.$sector->sector_name; 4676 } 4677 $sector_select .= '<option value="' . $sector->sector_context . '"'; 4678 4679 if (trim(strtolower($sector->sector_context)) == $selected) 4680 $sector_select .= ' selected>' . $sector->sector_name . "</option>\n"; 4681 else 4682 $sector_select .= '>' . $sector->sector_name . "</option>\n"; 4683 } 4684 //$sector_select .= "</select>"; 4685 return $sector_select; 4686 } 4687 */ 4649 4650 return ($recursive ? 4651 $s->get_organizations($context, $selected, false ,false) : 4652 $s->get_sectors($selected, false, false)); 4653 } 4688 4654 } 4689 4655 ?>
Note: See TracChangeset
for help on using the changeset viewer.