diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc
index 53281d0c52557c9ef27e7c34719db2d748cca24d..40f65bfc379e8935063a6a7604f0e99bc1f5fd66 100755 (executable)
/* Options */
$action= "<input type='image' src='images/edit.png' alt='"._("edit")."' name='user_edit_%KEY%' title='"._("Edit user")."'>";
- $action.= "<input type='image' src='images/editdelete.png' alt='"._("delete")."' name='user_del_%KEY%' title='"._("Delete user")."'>";
+ $action.= "<input type='image' src='images/edittrash.png' alt='"._("delete")."' name='user_del_%KEY%' title='"._("Delete user")."'>";
- $divlist = new divlist();
+ $divlist = new divlist("macrotabs");
$divlist->SetHeader(array(
array("string" => " "),
array("string" => _("Username")." / "._("Department")),
$linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
foreach($this->departments as $key=> $val){
- $field1 = array("string" => "<img src='images/folder.png' alt='department'>");
+
+ if(!isset($this->config->departments[trim($key)])){
+ $this->config->departments[trim($key)]="";
+ }
+
+ $non_empty="";
+ $keys= str_replace("/","\/",$key);
+ foreach($this->config->departments as $keyd=>$vald ){
+ if(preg_match("/".$keys."\/.*/",$keyd)){
+ $non_empty="full";
+ }
+ }
+
+ $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>");
$field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
$field3 = array("string" => " ");
$field4 = array("string" => " ", "attach" => "style='border:none'");
}
/* Generate macro list */
- $res= get_list($this->ui->subtreeACL, "(&(cn=$regex)(objectClass=goFonMacro))", TRUE, $base, array("*"), TRUE);
+ $res= get_list($this->ui->subtreeACL, "(&(cn=$regex)(objectClass=goFonMacro))", FALSE, "ou=macros,ou=asterisk,ou=config,".$base, array("*"), TRUE);
$this->macros= $res;
/* NEW LIST MANAGMENT
TRUE, $base2, array("ou", "description"), TRUE);
$this->departments= array();
+ $tmp = array();
foreach ($res3 as $value){
+ $tmp[strtolower($value['dn']).$value['dn']]=$value;
+ }
+ ksort($tmp);
+ foreach($tmp as $value){
if($value["description"][0]!=".."){
- $this->departments[$value['dn']]= convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
+ $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
}else{
$this->departments[$value['dn']]=$value["description"][0];
}
/* END NEW LIST MANAGMENT
*/
+ $tmp=array();
+ foreach($this->macros as $tkey => $val ){
+ $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
+ }
+ ksort($tmp);
+ $this->macros=array();
+ foreach($tmp as $val){
+ $this->macros[]=$val;
+ }
reset ($this->macros);
}