summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d6ef9bf)
raw | patch | inline | side by side (parent: d6ef9bf)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Jun 2007 12:46:11 +0000 (12:46 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Jun 2007 12:46:11 +0000 (12:46 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6577 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/gofon/conference/class_divListConferences.inc b/plugins/gofon/conference/class_divListConferences.inc
index 7819f676115cc17f9e43919bba74eb599258f67c..feafc1a3f8d7eb27a14adcc2c8a1dc615e75ddb3 100755 (executable)
$this->EnableSaveButton (false);
/* Dynamic action col, depending on snapshot icons */
- $action_col_size = 60;
+ $action_col_size = 100;
if($this->parent->snapshotEnabled()){
$action_col_size += 20;
}
/* Add default header */
$listhead = MultiSelectWindow::get_default_header();
+ /* Get copy & paste icon */
+ $Copy_Paste ="";
+ if(preg_match("/(c.*w|w.*c)/",$acls) && $this->parent->CopyPasteHandler){
+ $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
+ $addsep = true;
+ }
+
+
+ /* Only display snapshot settings if we are able to write && create new entries */
+ if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+ $listhead .= $this->get_snapshot_header($this->selectedBase);
+ }
+ $listhead .= $Copy_Paste;
+
/* Only display create new conference if we are allowed to create new confe... */
if(preg_match("/c/",$acls)){
$listhead .=" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
title='"._("Create new conference")."' alt='"._("New conference")."' name='conference_new'> ".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
}
-
- /* Only display snapshot settings if we are able to write && create new entries */
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
- $listhead .= $this->get_snapshot_header($this->selectedBase);
- }
/* Add the rest (base select ....)*/
$listhead .= _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
$listhead .= " <input class='center' type='image' align='middle' src='images/edittrash.png'
title='"._("Remove selected conferences")."' alt='"._("Remove conferences")."' name='remove_multiple_conferences'> ";
+ /* Add multiple copy & cut icons */
+ if(is_object($this->parent->CopyPasteHandler)){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcopy.png'
+ title='"._("Copy selected objects")."' alt='"._("Copy objects")."' name='multiple_copy_objects'> ";
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcut.png'
+ title='"._("cut selected objects")."' alt='"._("Cut objects")."' name='multiple_cut_objects'> ";
+ $listhead .= "</div>";
+ }
+
$listhead .="</div>";
$this->SetListHeader($listhead);
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=edit_entry'>%s</a>";
/* Dynamic action col, depending on snapshot icons */
- $action_col_size = 60;
+ $action_col_size = 100;
if($this->parent->snapshotEnabled()){
$action_col_size += 20;
}
continue;
}
+ $actions ="";
+ if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
+ $actions.= "<input class='center' type='image'
+ src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+ $actions.= "<input class='center' type='image'
+ src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
+ }
+
/* Add edit icon - This is allowed when we have at least read access. */
- $actions= "<input class='center' type='image' src='images/edit.png'
+ $actions.= "<input class='center' type='image' src='images/edit.png'
alt='"._("edit")."' name='conference_edit_%KEY%' title='"._("Edit this entry")."'>";
/* Add snapshot icon - This is allowed when we have create and write access for the current entry */
diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc
index 4eba32b4658dd4a6a4ce26052c41dc9639c95040..1714edca398964a2f7f8c818bbabdb2d73026997 100644 (file)
$message[] = $str;
}
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->base);
+ $ldap->search("(&(objectClass=goFonConference)(cn=".$this->cn."))",array("cn"));
+ if($ldap->count()){
+ $message[] =_("There is already a conference with this name in the current tree.");
+ }
return $message;
}
$this->postcreate();
}
+
+ function getCopyDialog()
+ {
+ $smarty = get_smarty();
+ $smarty->assign("cn" ,$this->cn);
+ $smarty->assign("telephoneNumber" ,$this->telephoneNumber);
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = $_POST['cn'];
+ }
+ if(isset($_POST['telephoneNumber'])){
+ $this->telephoneNumber = $_POST['telephoneNumber'];
+ }
+ }
+
+
/* Return plugin informations for acl handling */
function plInfo()
{
diff --git a/plugins/gofon/conference/class_phoneConferenceManagment.inc b/plugins/gofon/conference/class_phoneConferenceManagment.inc
index 715e5fe4a0d2d0f54b0eb4d775c74f88a9fec343..c79968277e6e42e03531311c15ad037d963743f4 100644 (file)
var $ui = NULL;
var $DivListConference = NULL;
+ var $CopyPasteHandler = NULL;
+ var $start_pasting_copied_objects = FALSE;
+
/* Initialise Class */
function phoneConferenceManagment ($config, $ui)
{
$this->dn = "";
$this->config = $config;
$this->DivListConference = new divListConference($this->config,$this);
+
+ /* Copy & Paste enabled ?*/
+ if((isset($this->config->data['MAIN']['ENABLECOPYPASTE']))&&(preg_match("/true/i",$this->config->data['MAIN']['ENABLECOPYPASTE']))){
+ $this->CopyPasteHandler = new CopyPasteHandler($this->config);
+ }
}
$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";
}
}
}
+ /********************
+ 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
}
+
+ function copyPasteHandling_from_queue($s_action,$s_entry)
+ {
+ /* Check if Copy & Paste is disabled */
+ if(!is_object($this->CopyPasteHandler)){
+ return("");
+ }
+
+ /* 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'];
+ $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"){
+ $this->CopyPasteHandler->add_to_queue($dn,"copy","conferencetabs","CONFERENCETABS","gofonconference");
+ }
+ if($s_action == "cut_multiple"){
+ $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()){
+
+ /* Load entry from queue and set base */
+ $this->CopyPasteHandler->load_entry_from_queue();
+ $this->CopyPasteHandler->SetVar("base",$this->DivListConference->selectedBase);
+
+ /* Get dialog */
+ $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()
{
$this->DivListConference->save_object();