From: hickert Date: Mon, 4 Jan 2010 13:38:10 +0000 (+0000) Subject: Updated conference list handling, not yet finished. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b47fe0a5738814435b34cd7e865a72d6ff4234fa;p=gosa.git Updated conference list handling, not yet finished. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14997 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc deleted file mode 100644 index 442f552cf..000000000 --- a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc +++ /dev/null @@ -1,248 +0,0 @@ -parent = $parent; - $this->ui = get_userinfo(); - - /* Set list strings */ - $this->SetTitle(_("List of conference rooms")); - $this->SetSummary(_("List of conference rooms")); - - /* Result page will look like a headpage */ - $this->SetHeadpageMode(); - - $this->EnableAplhabet(true); - - /* Disable buttonsm */ - $this->EnableCloseButton(false); - $this->EnableSaveButton (false); - - /* Dynamic action col, depending on snapshot icons */ - $action_col_size = 100; - if($this->parent->snapshotEnabled()){ - $action_col_size += 20; - } - - /* Toggle all selected / deselected */ - $chk = ""; - - /* set Page header */ - $this->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); - $this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'")); - $this->AddHeader(array("string" =>_("Name")." - "._("Number"), "attach" => "style=''")); - $this->AddHeader(array("string" => _("Owner"), "attach" => "style='width:200px;'")); - $this->AddHeader(array("string" => _("PIN"), "attach" => "style='width:50px;'")); - $this->AddHeader(array("string" =>_("Actions"), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'")); - - /* Add Checkboxes / SubSearch checkbox */ - $this->AddCheckBox("SubSearch", msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false); - - /* Name ,Text ,Default , Connect with alphabet */ - $this->AddRegex ("Regex", _("Regular expression for matching conference names"),"*" , true); - } - - - function GenHeader() - { - /* Get all departments within this subtree */ - $base = $this->config->current['BASE']; - $options = $this->create_department_list($this->module); - - /* Get acls */ - $acls = $this->ui->get_permissions($this->selectedBase,"gofonconference/conference"); - $acl_all = $this->ui->has_complete_category_acls($this->selectedBase,"gofonconference") ; - - /* Add default header */ - $listhead = MultiSelectWindow::get_default_header(); - - /* Add the rest (base select ....)*/ - $listhead .= _("Base")." ". - "  "; - - /* Create Layers menu */ - $s = ".|"._("Actions")."|\n"; - - /* Append create options */ - if(preg_match("/(c.*w|w.*c)/",$acl_all)){ - $s .= "..|". - " "._("Create")."|\n"; - $s.= "...|". - " "._("Conference")."|conference_new|\n"; - $s.= "..|---|\n"; - } - - /* Multiple options */ - $s.= "..|". - " "._("Remove")."|"."remove_multiple|\n"; - - /* Add Copy & Paste header */ - $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module); - - $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module); - - $this->SetDropDownHeaderMenu($s); - $this->SetListHeader($listhead); - } - - function execute() - { - $this->ClearElementsList(); - $this->GenHeader(); - } - - function setEntries($list) - { - $userimg = "User"; - $editlink = "%s"; - - /* Dynamic action col, depending on snapshot icons */ - $action_col_size = 100; - if($this->parent->snapshotEnabled()){ - $action_col_size += 20; - } - - $ui = get_userinfo(); - - /* Insert conferneces*/ - foreach($list as $conferencekey => $conference ){ - - $acl = $this->ui->get_permissions($conference['dn'],"gofonconference/conference"); - $acl_all = $this->ui->has_complete_category_acls($conference['dn'],"gofonconference"); - - /* You will need at least read access for the - current conference informations to display it */ - if(!preg_match("/r/",$acl)){ - continue; - } - - $actions =""; - - /* Add copy & cut functionality */ - $actions.= $this->parent->get_copypaste_action($conference['dn'],"gofonconference","conference"); - - /* Add edit icon - This is allowed when we have at least read access. */ - $actions.= ""; - - /* Add snapshot icon */ - $actions.= $this->parent->get_snapshot_action($conference['dn'],$this->module); - - /* Create delete link - Only if we are allowed to delete this entry */ - if(preg_match("/d/",$acl)){ - $actions.= ""; - } - - /* Display PIN icon, only if we are the owner of the given conference */ - $owner = $this->parent->ui->dn==$conference['goFonConferenceOwner'][0]; - $p_acl = $this->ui->get_permissions($conference['dn'],"gofonconference/conference","goFonPIN"); - if((isset($conference['goFonPIN'][0])) && $owner && preg_match("/r/",$p_acl)){ - $pin = "PIN"; - }else{ - $pin = " "; - } - - /* Display numer of the conference if we are allowed to view it */ - $n_acl = $this->ui->get_permissions($conference['dn'],"gofonconference/conference","telephoneNumber"); - if(isset($conference['telephoneNumber'][0]) && preg_match("/r/",$n_acl)){ - $number = " - ".$conference['telephoneNumber'][0]; - }else{ - $number = "  - ?"; - } - - /* Get conference owner name */ - $ldap= $this->parent->config->get_ldap_link(); - $ldap->cat($conference['goFonConferenceOwner'][0], array('cn','dn')); - $data = $ldap->fetch(); - if(isset($data['cn'][0])){ - $cn = $data['cn'][0]; - }else{ - $cn = _("Unknown"); - } - - /* Create title */ - $title=""; - if(isset($data['dn'])){ - $title = " title='".preg_replace("/ /"," ",LDAP::fix($data['dn']))."' "; - } - - /* Cutted objects should be displayed in light grey */ - $display = $conference['cn'][0].$number; - if($this->parent->CopyPasteHandler){ - foreach($this->parent->CopyPasteHandler->queue as $queue_key => $queue_data){ - if($queue_data['dn'] == $conference['dn']) { - $display = "".$display.""; - break; - } - } - } - - /* Create each field */ - $field0 = array("string" => "" , - "attach" => "style='width:20px;'"); - $a_field1 = array("string"=>sprintf($userimg,_("Conference")), "attach" => $title." style='text-align:center;width:20px;'"); - $a_field2 = array("string"=>sprintf($editlink,$conferencekey,$display), "attach" => $title." style=''"); - $a_field3 = array("string"=> $cn , "attach" => $title." style='width:200px;'"); - $a_field4 = array("string"=> $pin, "attach" => $title." style='width:50px;'"); - $a_field5 = array("string"=> preg_replace("/%KEY%/",$conferencekey,$actions), - "attach"=> $title."style='width:".$action_col_size."px;border-right:0px;text-align:right;'"); - - $this->AddElement(array($field0,$a_field1,$a_field2,$a_field3,$a_field4,$a_field5)); - } - - /* Create summary string for list footer */ - $num_deps=0; - if(!$this->SubSearch){ - $num_deps = count($this->Added_Departments); - } - $num_objs = count($list); - - $num_obj_str = sprintf(_("Number of listed '%s'"),_("conferences")); - $num_dep_str = sprintf(_("Number of listed '%s'"),_("departments")); - - $str = "".$num_obj_str." ".$num_objs."    "; - $str.= "".$num_dep_str." ".$num_deps."    "; - - $this->set_List_Bottom_Info($str); - } - - function Save() - { - MultiSelectWindow :: Save(); - } - - function save_object() - { - /* Save automatic created POSTs like regex, checkboxes */ - MultiSelectWindow :: save_object(); - } -} -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?> diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc index 61fd3f93b..49f4ab0d3 100644 --- a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc +++ b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc @@ -1,586 +1,67 @@ ui = $ui; - $this->dn = ""; - $this->config = $config; - $this->DivListConference = new divListConference($this->config,$this); - - /* Copy & Paste enabled ?*/ - if ($this->config->get_cfg_value("copyPaste") == "true"){ - $this->CopyPasteHandler = new CopyPasteHandler($this->config); - } - } - - - /* Execute class and display something */ - function execute() - { - /* Call parent execute */ - plugin::execute(); - - session::set('LOCK_VARS_TO_USE',array("/^menu_action/","/^id$/","/^act$/","/^conference_/","/^item_selected/","/^remove_multiple_conferences/")); - - /*************** - Variable initialisation - ***************/ - - /* Reload departments */ - $smarty = get_smarty(); - $display = ""; - $s_action = ""; // Will contain an action, like del or edit - $s_entry = ""; // The entry name for edit delete -... - - - /*************** - Check posts - ***************/ - - foreach($_POST as $key => $post){ - if(preg_match("/^conference_new.*/i",$key)){ - $s_action = "new"; - // Post for delete - }elseif(preg_match("/^conference_del.*/",$key)){ - $s_action = "del"; - $s_entry = preg_replace("/^conference_del_/i","",$key); - $s_entry = preg_replace("/_.*$/","",$s_entry); - // Post for edit - }elseif(preg_match("/conference_edit_.*/",$key)){ - $s_action="edit"; - $s_entry = preg_replace("/conference_edit_/i","",$key); - $s_entry = preg_replace("/_.*$/","",$s_entry); - }elseif(preg_match("/^remove_multiple_conferences/",$key)){ - $s_action="del_multiple"; - }elseif(preg_match("/^editPaste.*/i",$key)){ - $s_action="editPaste"; - }elseif(preg_match("/^copy_.*/",$key)){ - $s_action="copy"; - $s_entry = preg_replace("/^copy_/i","",$key); - $s_entry = preg_replace("/_.$/","",$s_entry); - }elseif(preg_match("/^cut_.*/",$key)){ - $s_action="cut"; - $s_entry = preg_replace("/^cut_/i","",$key); - $s_entry = preg_replace("/_.$/","",$s_entry); - }elseif(preg_match("/^multiple_copy_objects/",$key)){ - $s_action = "copy_multiple"; - }elseif(preg_match("/^multiple_cut_objects/",$key)){ - $s_action = "cut_multiple"; - } - } - - /* Edit Entry */ - if((isset($_GET['act']))&&($_GET['act']=="edit_entry")){ - $s_action = "edit"; - $s_entry = $_GET['id']; - } - - /* handle C&P from layers menu */ - if(isset($_POST['menu_action']) && preg_match("/^multiple_copy_systems/",$_POST['menu_action'])){ - $s_action = "copy_multiple"; - } - if(isset($_POST['menu_action']) && preg_match("/^multiple_cut_systems/",$_POST['menu_action'])){ - $s_action = "cut_multiple"; - } - if(isset($_POST['menu_action']) && preg_match("/^editPaste/",$_POST['menu_action'])){ - $s_action = "editPaste"; - } - - /* Create options */ - if(isset($_POST['menu_action']) && $_POST['menu_action'] == "conference_new"){ - $s_action = "new"; - } - - /* handle remove from layers menu */ - if(isset($_POST['menu_action']) && preg_match("/^remove_multiple/",$_POST['menu_action'])){ - $s_action = "del_multiple"; - } - - - /*************** - Cancel dialogs - ***************/ - - /* Reset requested? */ - if (isset($_POST['edit_cancel'])){ - $this->remove_lock(); - $this->conftab= NULL; - $this->lognames= array();; - $this->cn= ""; - set_object_info(); - } - - - /******************** - Copy & Paste Handling ... - ********************/ - - /* Display the copy & paste dialog, if it is currently open */ - $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry); - if($ret){ - return($ret); - } - - - /******************** - Delete MULTIPLE entries requested, display confirm dialog - ********************/ - - if ($s_action=="del_multiple"){ - $ids = $this->list_get_selected_items(); - - $this->dns = array(); - if(count($ids)){ - $disallowed = array(); - foreach($ids as $id){ - $dn = $this->conferences[$id]['dn']; - $acl = $this->ui->get_permissions($dn, "gofonconference/conference"); - if(preg_match("/d/",$acl)){ - $this->dns[$id] = $dn; - }else{ - $disallowed[] = $dn; - } - } - - if(count($disallowed)){ - msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG); - } - - if(count($this->dns)){ - - /* Check locks */ - if ($user= get_multiple_locks($this->dns)){ - return(gen_locked_message($user,$this->dns)); - } - - /* Prepare entry list to be displayed */ - $dns_names = array(); - foreach($this->dns as $dn){ - $dns_names[] = LDAP::fix($dn); - } - - /* Lock the current entry, so nobody will edit it during deletion */ - add_lock ($this->dns, $this->ui->dn); - - $smarty->assign("info", msgPool::deleteInfo($dns_names,_("conference"))); - $smarty->assign("multiple", true); - return($smarty->fetch(get_template_path('remove.tpl', TRUE))); - } - } - } - - - /******************** - Delete MULTIPLE entries confirmed - ********************/ - - /* Confirmation for deletion has been passed. Users should be deleted. */ - if (isset($_POST['delete_multiple_conference_confirm'])){ - - /* Remove user by user and check acls before removeing them */ - foreach($this->dns as $key => $dn){ - $this->dn = $dn; - $acl = $this->ui->get_permissions($this->dn,"gofonconference/conference"); - if(preg_match("/d/",$acl)){ - $this->remove_from_parent(); - } else { - msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG); - } - } - - /* Remove lock file after successfull deletion */ - $this->remove_lock(); - $this->dns = array(); - } - - - /******************** - Delete MULTIPLE entries Canceled - ********************/ - - /* Remove lock */ - if(isset($_POST['delete_multiple_conference_cancel'])){ - $this->remove_lock(); - $this->dns =array(); - } - - - /*************** - Delete - ***************/ - - /* Delete Entry if Posted action (s_action) == del - * The entry which will be deleted is defined in $s_entry - */ - if ($s_action =="del"){ - - $acl = $this->ui->get_permissions($this->conferences[$s_entry]['dn'],"gofonconference/conference"); - if(preg_match("/d/",$acl)){ - $this->dn= $this->conferences[$s_entry]['dn']; - - /* Check locking */ - if (($conf= get_lock($this->dn)) != ""){ - return(gen_locked_message($conf, $this->dn)); - } else { - add_lock ($this->dn, $this->ui->dn); - $smarty->assign("info", msgPool::deleteInfo(LDAP::fix($this->dn),_("conference"))); - $smarty->assign("multiple", false); - $display.= $smarty->fetch (get_template_path('remove.tpl', TRUE)); - return ($display); - } - } - } - - - /*************** - Delete confirmed - ***************/ - - /* If department deletion is accepted ... - * Finally delete department - */ - if (isset($_POST['delete_department_confirm'])){ - $acl = $this->ui->get_permissions($this->dn,"gofonconference/conference"); - if(preg_match("/d/",$acl)){ - $this->remove_from_parent(); - } else { - msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG); - } - } - - - /*************** - Edit - ***************/ - - /* Edit Entry if Posted action (s_action) == edit - * The entry which will be edited is defined in $s_entry - */ - if (($s_action=="edit") && (!isset($this->conftab->config))){ - - $this->dn= $this->conferences[$s_entry]['dn']; - - if (($conf= get_lock($this->dn)) != ""){ - return(gen_locked_message ($conf, $this->dn,TRUE)); - } - - /* Lock the current entry, so everyone will get the above dialog */ - add_lock ($this->dn, $this->ui->dn); - - /* Register conftab to trigger edit dialog */ - $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofonconference"); - $this->conftab->set_acl_base($this->dn); - set_object_info($this->dn); - } - - - /*************** - Create new - ***************/ - - /* Insert new entry*/ - if($s_action == "new" ){ - - $dummy_dn = "cn=dummy,".get_ou('phoneConferenceRDN').$this->DivListConference->selectedBase; - $acl = $this->ui->get_permissions($dummy_dn,"gofonconference/conference"); - if(preg_match("/c/",$acl)){ - /* Set up the users ACL's for this 'dn' */ - $this->dn= "new"; - $this->conftab= new conferencetabs($this->config,$this->config->data['TABS']['CONFERENCETABS'], $this->dn,"gofonconference"); - $this->conftab->set_acl_base($dummy_dn); - set_object_info(); - } - } - - - /*************** - Save entry - ***************/ - - /* Edit finished, check and save changes */ - if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply'])) && (isset($this->conftab->config))){ - /* Check tabs, will feed message array */ - $this->conftab->last= $this->conftab->current; - $this->conftab->save_object(); - $message= $this->conftab->check(); - - if (count($message) == 0){ - if($this->conftab->save() == 1){ - gosa_log ("goFonConference object '".$this->dn."' saving failed."); - return; - } - gosa_log ("goFonConference object '".$this->dn."' has been saved"); - - if (!isset($_POST['edit_apply'])){ - $this->remove_lock(); - $this->conftab= NULL; - set_object_info(); - }else{ - - /* Reinitialize tab */ - if($this->conftab instanceof tabs){ - $this->conftab->re_init(); - } - } - - } else { - msg_dialog::displayChecks($message); - } - } - - - /*************** - Display dialogs - ***************/ - - /* if edit or new, show dialog */ - if(($this->conftab) && (isset($this->conftab->config))){ - $display= $this->conftab->execute(); - - /* Don't show buttons if tab dialog requests this */ - - if(($this->conftab instanceOf tabs || $this->conftab instanceOf plugin) && $this->conftab->read_only == TRUE){ - $display.= "

- -

"; - }elseif (!$this->conftab->by_object[$this->conftab->current]->dialog){ - $display.= "

\n"; - $display.= "\n"; - $display.= " \n"; - if ($this->dn != "new"){ - $display.= "\n"; - $display.= " \n"; - } - $display.= "\n"; - $display.= "

"; - } - return ($display); - } - - - /*************** - display divlist - ***************/ - - /* Check if there is a snapshot dialog open */ - $base = $this->DivListConference->selectedBase; - if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){ - return($str); - } - - /* Return rendered main page */ - /* Display dialog with system list */ - $this->DivListConference->parent = $this; - $this->DivListConference->execute(); - - /* Add departments if subsearch is disabled */ - if(!$this->DivListConference->SubSearch){ - $this->DivListConference->AddDepartments($this->DivListConference->selectedBase,5,1); - } - $this->reload(); - $this->DivListConference->setEntries($this->conferences); - return($this->DivListConference->Draw()); - } - - - /* Return departments, that will be included within snapshot detection */ - function get_used_snapshot_bases() - { - return(array(get_ou('phoneConferenceRDN').$this->DivListConference->selectedBase)); - } - - - /* Reload entries for divlist. - * reload all conferences for the current base, with the given regex - */ - function reload() - { - $SubSearch = $this->DivListConference->SubSearch; - $Regex = $this->DivListConference->Regex; - $Flags = GL_SIZELIMIT ; - $Filter = "(&(|(cn=".$Regex.")(description=".$Regex."))(objectClass=goFonConference))"; - $Attrs = array("cn","goFonConferenceOwner","goFonPIN","telephoneNumber"); - - if($SubSearch){ - $Flags |= GL_SUBSEARCH; - $Base = $this->DivListConference->selectedBase; - $this->conferences= get_list($Filter, "gofonconference", $Base, $Attrs, $Flags); - }else{ - $Base = get_ou('phoneConferenceRDN').$this->DivListConference->selectedBase; - $this->conferences= get_list($Filter, "gofonconference", $Base, $Attrs, $Flags); - } - } - - - function remove_from_parent() - { - /* Ehm what are we doinf here ? */ - - $cfg = new conference($this->config, $this->dn); - $cfg->set_acl_category("gofonconference"); - $cfg->set_acl_base($this->dn); - - $cfg->remove_from_parent(); - $ldap= $this->config->get_ldap_link(); - $ldap->cd ($this->dn); - $ldap->recursive_remove(); - - /* Optionally execute a command after we're done */ - $this->postremove(); - - /* Delete references to object groups */ - $ldap->cd ($this->config->current['BASE']); - $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn")); - while ($ldap->fetch()){ - $og= new conftab($this->config, $ldap->getDN()); - unset($og->member[$this->dn]); - $og->save (); - } - - } - - - function copyPasteHandling_from_queue($s_action,$s_entry) - { - /* Check if Copy & Paste is disabled */ - if(!is_object($this->CopyPasteHandler)){ - return(""); - } - - $ui = get_userinfo(); - - /* Add a single entry to queue */ - if($s_action == "cut" || $s_action == "copy"){ - - /* Cleanup object queue */ - $this->CopyPasteHandler->cleanup_queue(); - $dn = $this->conferences[$s_entry]['dn']; - - if($s_action == "copy" && $ui->is_copyable($dn,"gofonconference","conference")){ - $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference"); - } - if($s_action == "cut" && $ui->is_cutable($dn,"gofonconference","conference")){ - $this->CopyPasteHandler->add_to_queue($dn,$s_action,"conferencetabs","CONFERENCETABS","gofonconference"); - } - } - - /* Add entries to queue */ - if($s_action == "copy_multiple" || $s_action == "cut_multiple"){ - - /* Cleanup object queue */ - $this->CopyPasteHandler->cleanup_queue(); - - /* Add new entries to CP queue */ - foreach($this->list_get_selected_items() as $id){ - $dn = $this->conferences[$id]['dn']; - - if($s_action == "copy_multiple" && $ui->is_copyable($dn,"gofonconference","conference")){ - $this->CopyPasteHandler->add_to_queue($dn,"copy","conferencetabs","CONFERENCETABS","gofonconference"); - } - if($s_action == "cut_multiple" && $ui->is_cutable($dn,"gofonconference","conference")){ - $this->CopyPasteHandler->add_to_queue($dn,"cut","conferencetabs","CONFERENCETABS","gofonconference"); - } - } - } - - /* Start pasting entries */ - if($s_action == "editPaste"){ - $this->start_pasting_copied_objects = TRUE; - } - /* Return C&P dialog */ - if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){ - - /* Get dialog */ - $this->CopyPasteHandler->SetVar("base",$this->DivListConference->selectedBase); - $data = $this->CopyPasteHandler->execute(); - - /* Return dialog data */ - if(!empty($data)){ - return($data); - } - } - - /* Automatically disable status for pasting */ - if(!$this->CopyPasteHandler->entries_queued()){ - $this->start_pasting_copied_objects = FALSE; - } - return(""); - } - - - function save_object() + var $plHeadline = "Conferences"; + var $plDescription = "Role management"; + var $plIcon = "plugins/conference/images/plugin.png"; + + // Tab definition + protected $tabClass = "conferencetabs"; + protected $tabType = "CONFERENCETABS"; + protected $aclCategory = "gofonconference"; + protected $aclPlugin = "conference"; + protected $objectName = "phone conference"; + + function __construct($config,$ui) { - $this->DivListConference->save_object(); + $this->config = $config; + $this->ui = $ui; + + $this->storagePoints = array(get_ou("phoneConferenceRDN")); + + // Build filter +# if (session::global_is_set(get_class($this)."_filter")){ + # $filter= session::global_get(get_class($this)."_filter"); + # } else { + $filter = new filter(get_template_path("conf-filter.xml", true)); + $filter->setObjectStorage($this->storagePoints); + # } + $this->setFilter($filter); + + // Build headpage + $headpage = new listing(get_template_path("conf-list.xml", true)); + $headpage->setFilter($filter); + + // Add copy&paste and snapshot handler. + if ($this->config->boolValueIsTrue("main", "copyPaste")){ + $this->cpHandler = new CopyPasteHandler($this->config); + } + if($this->config->get_cfg_value("enableSnapshots") == "true"){ + $this->snapHandler = new SnapshotHandler($this->config); + } + parent::__construct($config, $ui, "conferences", $headpage); } - - - /*! \brief Remove entry locks if the plugin was aborted. - */ - function remove_lock() - { - if($this->dn) { - del_lock($this->dn); - }elseif(isset($this->conftab) && isset($this->conftab->dn)){ - del_lock ($this->conftab->dn); - } - if(is_array($this->dns) && count($this->dns)) del_lock($this->dns); - } - - - function list_get_selected_items() - { - $ids = array(); - foreach($_POST as $name => $value){ - if(preg_match("/^item_selected_[0-9]*$/",$name)){ - $id = preg_replace("/^item_selected_/","",$name); - $ids[$id] = $id; - } - } - return($ids); - } - - -} +} // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/gofon/gofon/conference/conf-filter.tpl b/gosa-plugins/gofon/gofon/conference/conf-filter.tpl new file mode 100644 index 000000000..ba7af5cde --- /dev/null +++ b/gosa-plugins/gofon/gofon/conference/conf-filter.tpl @@ -0,0 +1,33 @@ +
+

+ [F]{t}Filter{/t} +

+
+ +
+ +
+ + {$SCOPE} + + + + + + +
+ + + {$NAME} +
+ + + + + +
+ {$APPLY} +
+
diff --git a/gosa-plugins/gofon/gofon/conference/conf-filter.xml b/gosa-plugins/gofon/gofon/conference/conf-filter.xml new file mode 100644 index 000000000..0ab4b8691 --- /dev/null +++ b/gosa-plugins/gofon/gofon/conference/conf-filter.xml @@ -0,0 +1,40 @@ + + + + + conferences + + true + + + + + LDAP + (&(objectClass=goFonConference)$NAME) + dn + objectClass + cn + description + + auto + + + + textfield + NAME + 20 + 60 + + + (cn=*$*) + false + + LDAP + (&(objectClass=goFonConference)(cn=*$NAME*)) + cn + 0.5 + 3 + + + + diff --git a/gosa-plugins/gofon/gofon/conference/conf-list.tpl b/gosa-plugins/gofon/gofon/conference/conf-list.tpl new file mode 100644 index 000000000..b233c5874 --- /dev/null +++ b/gosa-plugins/gofon/gofon/conference/conf-list.tpl @@ -0,0 +1,31 @@ + + + + + + + +
+
+

 {$HEADLINE} {$SIZELIMIT}

+
+ +
+
+ + +
{$ROOT} {$BACK} {$HOME} {$RELOAD} {$SEPARATOR} {t}Base{/t} {$BASE}  {$SEPARATOR}  {$ACTIONS}
+
+
+ +
+
+ + + + {$LIST} +
+ {$FILTER} +
+ + diff --git a/gosa-plugins/gofon/gofon/conference/conf-list.xml b/gosa-plugins/gofon/gofon/conference/conf-list.xml new file mode 100644 index 000000000..ac46b0a24 --- /dev/null +++ b/gosa-plugins/gofon/gofon/conference/conf-list.xml @@ -0,0 +1,143 @@ + + + + + true + false + true + true + + gofonconference + + 1 + + + + goFonConference + gofonconference + conference + plugins/conference/images/conference.png + + + + + + |16px||250px|170px;r| + + + %{filter:objectType(dn,objectClass)} + + + + %{filter:departmentLink(row,dn,description)} + 2 + + + + %{filter:objectType(dn,objectClass)} + + + + + cn + string + %{filter:link(row,dn,"%s",cn)} + true + + + + + description + string + %{filter:link(row,dn,"%s",description)} + true + + + + + %{filter:actions(dn,row,objectClass)} + + +
+ + + + + sub + images/lists/new.png + + + + new + entry + plugins/conference/images/new.png + + + + + + separator + + + + edit + entry + images/lists/edit.png + + + + + remove + entry + images/lists/trash.png + + + + + exporter + + + + separator + + + + copypaste + + + + snapshot + + + + + + + + cp + copypaste + + + + edit + entry + images/lists/edit.png + + + + + snapshot + snapshot + + + + remove + entry + images/lists/trash.png + gofonconference/conference[d] + + + + + +
diff --git a/gosa-plugins/gofon/gofon/conference/main.inc b/gosa-plugins/gofon/gofon/conference/main.inc index 43ad9547c..68118db18 100644 --- a/gosa-plugins/gofon/gofon/conference/main.inc +++ b/gosa-plugins/gofon/gofon/conference/main.inc @@ -1,29 +1,30 @@ remove_lock(); } } @@ -31,33 +32,25 @@ if ($remove_lock){ /* Remove this plugin from session */ if ( $cleanup ){ - session::un_set('conference'); + session::un_set('phoneConferenceManagment'); }else{ + /* Create phoneConferenceManagment object on demand */ + if (!session::is_set('phoneConferenceManagment')){ + $phoneConferenceManagment= new phoneConferenceManagment ($config, $ui); + session::set('phoneConferenceManagment',$phoneConferenceManagment); + } + $phoneConferenceManagment = session::get('phoneConferenceManagment'); + $display= $phoneConferenceManagment->execute(); - /* Create usermanagement object on demand */ - if (!session::is_set('conference')){ - session::set("conference",new phoneConferenceManagment($config, $ui)); - } - $conference = session::get('conference'); - $conference->save_object(); - $output= $conference->execute(); - - /* Page header*/ - if (get_object_info() != ""){ - $display= print_header(get_template_path('plugins/gofon/images/conference.png'), _("Conference management"), "\"\" ".LDAP::fix(get_object_info())); - } else { - $display= print_header(get_template_path('plugins/gofon/images/conference.png'), _("Conference management")); - } - - /* Reset requested? */ - if (isset($_GET['reset']) && $_GET['reset'] == 1){ - session::un_set ('conference'); - } + /* Reset requested? */ + if (isset($_GET['reset']) && $_GET['reset'] == 1){ + session::un_set ('phoneConferenceManagment'); + } - /* Show and save dialog */ - $display.= $output; - session::set('conference',$conference); + /* Show and save dialog */ + session::set('phoneConferenceManagment',$phoneConferenceManagment); } +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/gofon/gofon/conference/remove.tpl b/gosa-plugins/gofon/gofon/conference/remove.tpl index 7f4b8f1e6..29adedf1b 100644 --- a/gosa-plugins/gofon/gofon/conference/remove.tpl +++ b/gosa-plugins/gofon/gofon/conference/remove.tpl @@ -1,24 +1,17 @@
-  {t}Warning{/t} +  {t}Warning{/t}
- {$info}

- {t}This includes 'all' accounts, systems, etc. in this subtree. Please double check if your really want to do this since there is no way for GOsa to get your data back.{/t} + {$info} + {t}Please double check if you really want to do this since there is no way for GOsa to get your data back.{/t}

- {t}Best thing to do before performing this action would be to save the current contents of your LDAP tree in a file. So - if you've done so - press 'Delete' to continue or 'Cancel' to abort.{/t} + {t}So - if you're sure - press 'Delete' to continue or 'Cancel' to abort.{/t}

-{if $multiple} - -   - -{else} - -   - -{/if} + +   +

-