summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fcfa0de)
raw | patch | inline | side by side (parent: fcfa0de)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Jan 2010 13:38:10 +0000 (13:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Jan 2010 13:38:10 +0000 (13:38 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14997 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/gofon/gofon/conference/class_divListConferences.inc | [deleted file] | patch | blob | history |
gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc | patch | blob | history | |
gosa-plugins/gofon/gofon/conference/conf-filter.tpl | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofon/gofon/conference/conf-filter.xml | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofon/gofon/conference/conf-list.tpl | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofon/gofon/conference/conf-list.xml | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofon/gofon/conference/main.inc | patch | blob | history | |
gosa-plugins/gofon/gofon/conference/remove.tpl | patch | blob | history |
diff --git a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc
+++ /dev/null
@@ -1,248 +0,0 @@
-<?php
-
-class divListConference extends MultiSelectWindow
-{
-
- /* Current base */
- var $selectedBase = "";
- var $departments = array();
-
- /* Regex */
- var $Regex = "*";
-
- /* checkboxes */
- var $ShowSendBocklists ;
- var $ShowReceiveMacros ;
-
- /* Subsearch checkbox */
- var $SubSearch;
-
- var $parent ;
- var $ui ;
-
- function divListConference (&$config,$parent)
- {
- MultiSelectWindow::MultiSelectWindow($config,"Conferences", "gofonconference");
-
- $this->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 = "<input type='checkbox' id='select_all' name='select_all' title='"._("Select all")."'
- onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
-
- /* 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")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
- " <input class='center' type='image' src='images/lists/submit.png' align='middle'
- title='"._("Submit department")."' name='submit_department' alt='". _("Submit"). "'> ";
-
- /* Create Layers menu */
- $s = ".|"._("Actions")."|\n";
-
- /* Append create options */
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
- $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
- " "._("Create")."|\n";
- $s.= "...|<input class='center' type='image' src='plugins/gofon/images/list_new_conference.png' alt=''>".
- " "._("Conference")."|conference_new|\n";
- $s.= "..|---|\n";
- }
-
- /* Multiple options */
- $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
- " "._("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 = "<img class='center' src='plugins/gofon/images/select_conference.png' alt='User' title='%s'>";
- $editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=edit_entry'>%s</a>";
-
- /* 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.= "<input class='center' type='image' src='images/lists/edit.png'
- alt='"._("edit")."' name='conference_edit_%KEY%' title='"._("Edit this entry")."'>";
-
- /* 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.= "<input class='center' type='image' src='images/lists/trash.png'
- alt='"._("delete")."' name='conference_del_%KEY%' title='"._("Delete this entry")."'>";
- }
-
- /* 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 = "<img class='center' src='plugins/gofon/images/pin.png' title='PIN : ".$conference['goFonPIN'][0]."' alt='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 = "<font color='#999999'>".$display."</font>";
- break;
- }
- }
- }
-
- /* Create each field */
- $field0 = array("string" => "<input type='checkbox' id='item_selected_".$conferencekey."' name='item_selected_".$conferencekey."'>" ,
- "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 = "<img class='center' src='plguins/gofon/images/select_conference.png'
- title='".$num_obj_str."' alt='".$num_obj_str."'> ".$num_objs." ";
- $str.= "<img class='center' src='images/lists/folder.png'
- title='".$num_dep_str."' alt='".$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 61fd3f93bf053e0e7758102a26bb77180109e234..49f4ab0d33d111d2a939064f344e8c73aaf55928 100644 (file)
<?php
/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2003 Cajus Pollmeier
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id: class_roleManagement.inc 14742 2009-11-04 13:18:33Z hickert $$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-class phoneConferenceManagment extends plugin
+class phoneConferenceManagment extends management
{
- /* Definitions */
- var $plHeadline = "Phone conferences";
- var $plDescription = "Management";
- var $plIcon = "plugins/gofon/images/conference.png";
-
- /* attribute list for save action */
- var $attributes = array();
- var $objectclasses = array();
-
- var $conferences = array();
- var $conftab = false;
- var $ui = NULL;
- var $DivListConference = NULL;
-
- var $CopyPasteHandler = NULL;
- var $start_pasting_copied_objects = FALSE;
- var $dns = array();
-
- var $acl_module = array("gofonconference");
-
- /* Initialise Class */
- function phoneConferenceManagment (&$config, $ui)
- {
- $this->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.= "<p style=\"text-align:right\">
- <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">
- </p>";
- }elseif (!$this->conftab->by_object[$this->conftab->current]->dialog){
- $display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
- $display.= " \n";
- if ($this->dn != "new"){
- $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
- $display.= " \n";
- }
- $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
- $display.= "</p>";
- }
- 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
--- /dev/null
@@ -0,0 +1,33 @@
+<div class="contentboxh">
+ <p class="contentboxh">
+ <img src="images/launch.png" align="right" alt="[F]">{t}Filter{/t}
+ </p>
+</div>
+
+<div class="contentboxb">
+
+<div style="border-top:1px solid #AAAAAA"></div>
+
+ {$SCOPE}
+
+ <table summary="" style="width:100%;border-top:1px solid #B0B0B0;">
+ <tr>
+ <td>
+ <label for="NAME">
+ <img src="images/lists/search.png" align=middle> Name
+ </label>
+ </td>
+ <td>
+ {$NAME}
+ </td>
+ </tr>
+ </table>
+
+ <table summary="" width="100%" style="background:#EEEEEE;border-top:1px solid #B0B0B0;">
+ <tr>
+ <td width="100%" align="right">
+ {$APPLY}
+ </td>
+ </tr>
+ </table>
+</div>
diff --git a/gosa-plugins/gofon/gofon/conference/conf-filter.xml b/gosa-plugins/gofon/gofon/conference/conf-filter.xml
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<filterdef>
+ <definition>
+ <category>conferences</category>
+ <template>conf-filter.tpl</template>
+ <initial>true</initial>
+ </definition>
+
+ <search>
+ <query>
+ <backend>LDAP</backend>
+ <filter>(&(objectClass=goFonConference)$NAME)</filter>
+ <attribute>dn</attribute>
+ <attribute>objectClass</attribute>
+ <attribute>cn</attribute>
+ <attribute>description</attribute>
+ </query>
+ <scope>auto</scope>
+ </search>
+
+ <element>
+ <type>textfield</type>
+ <tag>NAME</tag>
+ <size>20</size>
+ <maxlength>60</maxlength>
+ <default></default>
+ <unset></unset>
+ <set>(cn=*$*)</set>
+ <alphabet>false</alphabet>
+ <autocomplete>
+ <backend>LDAP</backend>
+ <filter>(&(objectClass=goFonConference)(cn=*$NAME*))</filter>
+ <attribute>cn</attribute>
+ <frequency>0.5</frequency>
+ <characters>3</characters>
+ </autocomplete>
+ </element>
+
+</filterdef>
diff --git a/gosa-plugins/gofon/gofon/conference/conf-list.tpl b/gosa-plugins/gofon/gofon/conference/conf-list.tpl
--- /dev/null
@@ -0,0 +1,31 @@
+<input type='image' src='images/empty.png' name='no_action_posted' value='do_nothing' alt='' style='width:2px;height:2px;'>
+
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=2>
+ <tr>
+ <td style="vertical-align:top; width:50%;">
+ <div class="contentboxh">
+ <p class="contentboxh"> {$HEADLINE} {$SIZELIMIT}</p>
+ </div>
+
+ <div class="contentboxb">
+ <div style='background:white;padding:0px;padding:3px;'>
+ <table><tr>
+ <td>{$ROOT} </td><td>{$BACK} </td><td>{$HOME} </td><td>{$RELOAD} </td><td>{$SEPARATOR} </td><td>{t}Base{/t} {$BASE} <input class='center' type='image' src='images/lists/submit.png' align='middle' title='{t}Update{/t}' name='submit_department' alt='{t}Submit{/t}'> </td><td>{$SEPARATOR} </td><td><img src='images/rocket.png' alt='' class='center'></td><td> {$ACTIONS}</td>
+ </tr></table>
+ </div>
+ </div>
+
+ <div style='height:4px;'>
+ </div>
+
+ <input type="hidden" id="d_save" value="450">
+ <input type="hidden" id="d_space" value="760">
+ {$LIST}
+ </td>
+ <td style='vertical-align:top'>
+ {$FILTER}
+ </td>
+ </tr>
+</table>
+
+<input type="hidden" name="ignore">
diff --git a/gosa-plugins/gofon/gofon/conference/conf-list.xml b/gosa-plugins/gofon/gofon/conference/conf-list.xml
--- /dev/null
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<list>
+ <definition>
+ <departmentBrowser>true</departmentBrowser>
+ <departmentRootVisible>false</departmentRootVisible>
+ <baseMode>true</baseMode>
+ <multiSelect>true</multiSelect>
+ <template>conf-list.tpl</template>
+ <module>gofonconference</module>
+ <label>List of conferences</label>
+ <defaultSortColumn>1</defaultSortColumn>
+
+ <objectType>
+ <label>Conference</label>
+ <objectClass>goFonConference</objectClass>
+ <category>gofonconference</category>
+ <class>conference</class>
+ <image>plugins/conference/images/conference.png</image>
+ </objectType>
+
+ </definition>
+
+ <table>
+ <layout>|16px||250px|170px;r|</layout>
+
+ <department>
+ <value>%{filter:objectType(dn,objectClass)}</value>
+ </department>
+
+ <department>
+ <value>%{filter:departmentLink(row,dn,description)}</value>
+ <span>2</span>
+ </department>
+
+ <column>
+ <value>%{filter:objectType(dn,objectClass)}</value>
+ </column>
+
+ <column>
+ <label>Name</label>
+ <sortAttribute>cn</sortAttribute>
+ <sortType>string</sortType>
+ <value>%{filter:link(row,dn,"%s",cn)}</value>
+ <export>true</export>
+ </column>
+
+ <column>
+ <label>Description</label>
+ <sortAttribute>description</sortAttribute>
+ <sortType>string</sortType>
+ <value>%{filter:link(row,dn,"%s",description)}</value>
+ <export>true</export>
+ </column>
+
+ <column>
+ <label>Actions</label>
+ <value>%{filter:actions(dn,row,objectClass)}</value>
+ </column>
+
+ </table>
+
+ <actionmenu>
+
+ <action>
+ <type>sub</type>
+ <image>images/lists/new.png</image>
+ <label>Create</label>
+
+ <action>
+ <name>new</name>
+ <type>entry</type>
+ <image>plugins/conference/images/new.png</image>
+ <label>Conference</label>
+ </action>
+ </action>
+
+ <action>
+ <type>separator</type>
+ </action>
+
+ <action>
+ <name>edit</name>
+ <type>entry</type>
+ <image>images/lists/edit.png</image>
+ <label>Edit</label>
+ </action>
+
+ <action>
+ <name>remove</name>
+ <type>entry</type>
+ <image>images/lists/trash.png</image>
+ <label>Remove</label>
+ </action>
+
+ <action>
+ <type>exporter</type>
+ </action>
+
+ <action>
+ <type>separator</type>
+ </action>
+
+ <action>
+ <type>copypaste</type>
+ </action>
+
+ <action>
+ <type>snapshot</type>
+ </action>
+
+ </actionmenu>
+
+ <actiontriggers snapshot="true" copypaste="true">
+
+ <action>
+ <name>cp</name>
+ <type>copypaste</type>
+ </action>
+
+ <action>
+ <name>edit</name>
+ <type>entry</type>
+ <image>images/lists/edit.png</image>
+ <label>Edit</label>
+ </action>
+
+ <action>
+ <name>snapshot</name>
+ <type>snapshot</type>
+ </action>
+
+ <action>
+ <name>remove</name>
+ <type>entry</type>
+ <image>images/lists/trash.png</image>
+ <acl>gofonconference/conference[d]</acl>
+ <label>Remove</label>
+ </action>
+
+ </actiontriggers>
+
+</list>
diff --git a/gosa-plugins/gofon/gofon/conference/main.inc b/gosa-plugins/gofon/gofon/conference/main.inc
index 43ad9547c8521e84b68345294b82816e38c3439e..68118db1844f32ce3f27889a66c324eca8853946 100644 (file)
<?php
/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2003 Cajus Pollmeier
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id: main.inc 14740 2009-11-04 09:41:16Z hickert $$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
/* Remove locks created by this plugin
*/
-$lock_msg ="";
if ($remove_lock){
- if(session::is_set('conference')){
- $macl = session::get('conference');
+ if(session::is_set('phoneConferenceManagment')){
+ $macl = session::get('phoneConferenceManagment');
$macl->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"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png')."\"> ".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 7f4b8f1e63d46d609430747f3e3332e7f6ddad51..29adedf1b6b018f89299e906b111e32f6518ab03 100644 (file)
<div style="font-size:18px;">
- <img alt="" src="images/warning.png" align=top> {t}Warning{/t}
+ <img alt="" src="images/warning.png" align=top> {t}Warning{/t}
</div>
- {$info}
<p>
- {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}
</p>
<p>
- {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}
</p>
<p class="plugbottom">
-{if $multiple}
- <input type=submit name="delete_multiple_conference_confirm" value="{msgPool type=delButton}">
-
- <input type=submit name="delete_multiple_conference_cancel" value="{msgPool type=cancelButton}">
-{else}
- <input type=submit name="delete_department_confirm" value="{msgPool type=delButton}">
-
- <input type=submit name="delete_cancel" value="{msgPool type=cancelButton}">
-{/if}
+ <input type=submit name="delete_confirmed" value="{msgPool type=delButton}">
+
+ <input type=submit name="delete_cancel" value="{msgPool type=cancelButton}">
</p>
-