summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7bb300f)
raw | patch | inline | side by side (parent: 7bb300f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Jan 2010 16:09:34 +0000 (16:09 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Jan 2010 16:09:34 +0000 (16:09 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15015 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/gofax/gofax/blocklists/blocklist-filter.tpl | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofax/gofax/blocklists/blocklist-filter.xml | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofax/gofax/blocklists/blocklist-list.tpl | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofax/gofax/blocklists/blocklist-list.xml | [new file with mode: 0644] | patch | blob |
gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc | patch | blob | history | |
gosa-plugins/gofax/gofax/blocklists/main.inc | patch | blob | history |
diff --git a/gosa-plugins/gofax/gofax/blocklists/blocklist-filter.tpl b/gosa-plugins/gofax/gofax/blocklists/blocklist-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/gofax/gofax/blocklists/blocklist-filter.xml b/gosa-plugins/gofax/gofax/blocklists/blocklist-filter.xml
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<filterdef>
+ <definition>
+ <category>gofaxlist</category>
+ <template>blocklist-filter.tpl</template>
+ <initial>true</initial>
+ </definition>
+
+ <search>
+ <query>
+ <backend>LDAP</backend>
+ <filter>(&(|(objectClass=goFaxSBlock)(objectClass=goFaxRBlock))$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=goFaxSBlock)(objectClass=goFaxRBlock))(cn=*$NAME*))</filter>
+ <attribute>cn</attribute>
+ <frequency>0.5</frequency>
+ <characters>3</characters>
+ </autocomplete>
+ </element>
+
+</filterdef>
diff --git a/gosa-plugins/gofax/gofax/blocklists/blocklist-list.tpl b/gosa-plugins/gofax/gofax/blocklists/blocklist-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/gofax/gofax/blocklists/blocklist-list.xml b/gosa-plugins/gofax/gofax/blocklists/blocklist-list.xml
--- /dev/null
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<list>
+ <definition>
+ <departmentBrowser>true</departmentBrowser>
+ <departmentRootVisible>false</departmentRootVisible>
+ <baseMode>true</baseMode>
+ <multiSelect>true</multiSelect>
+ <template>blocklist-list.tpl</template>
+ <module>gofaxlist</module>
+ <label>List of blocklists</label>
+ <defaultSortColumn>1</defaultSortColumn>
+
+ <objectType>
+ <label>Send blocklist</label>
+ <objectClass>goFaxSBlock</objectClass>
+ <category>gofaxlist</category>
+ <class>blocklistGeneric</class>
+ <image>plugins/gofax/images/list_blocklist.png</image>
+ </objectType>
+
+ <objectType>
+ <label>Receive blocklist</label>
+ <objectClass>goFaxSBlock</objectClass>
+ <category>gofaxlist</category>
+ <class>blocklistGeneric</class>
+ <image>plugins/gofax/images/list_blocklist.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/gofax/images/list_new_blocklist.png</image>
+ <label>Macro</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>gofaxlist/blocklistGeneric[d]</acl>
+ <label>Remove</label>
+ </action>
+
+ </actiontriggers>
+
+</list>
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc
index 99afef0db096ee12a7ec398f3efed9729621cfbe..d04958a42c93dd0f8b0aff0b7d5fb08495324d3e 100644 (file)
<?php
-class blocklist extends plugin
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id: class_phoneConferenceManagment.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 blocklistManagement extends management
{
- /* Definitions */
- var $plHeadline= "FAX blocklists";
- var $plDescription= "This does something";
- var $plIcon = "plugins/gofax/images/blocklists.png";
-
- var $blocklists = array();
- var $DivListBlocklist = NULL;
- var $CopyPasteHandler = NULL;
- var $dns = array();
- var $start_pasting_copied_objects = FALSE;
-
- var $acl_module = array("gofaxlist");
-
- function blocklist (&$config, $ui)
- {
- $this->ui = $ui;
- $this->dn = "";
- $this->config = &$config;
- $this->base = session::get('CurrentMainBase');
- $this->DivListBlocklist = new divListBlocklist($this->config,$this);
-
- /* Initialize copy&paste queue */
- if ($this->config->boolValueIsTrue("main", "copyPaste")){
- $this->CopyPasteHandler= new CopyPasteHandler($this->config);
- }
- }
-
-
- function execute()
+ var $plHeadline = "Blocklists";
+ var $plDescription = "Blocklist management";
+ var $plIcon = "plugins/gofax/images/blocklists.png";
+
+ // Tab definition
+ protected $tabClass = "faxblocktabs";
+ protected $tabType = "FAXBLOCKTABS";
+ protected $aclCategory = "gofaxlist";
+ protected $aclPlugin = "blocklistGeneric";
+ protected $objectName = "blocklist";
+
+ function __construct($config,$ui)
{
- /* Call parent execute */
- plugin::execute();
-
- session::set('LOCK_VARS_TO_USE',array("/^menu_action/","/^goFaxBlocklist_/","/^act$/","/^id$/","/^remove_multiple_blocklists/","/^item_selected/"));
-
- /***************
- Init vars
- ***************/
-
- /* Get global smarty instance */
- $smarty = get_smarty();
- $s_action = ""; // Contains the action to proceed
- $s_entry = ""; // The value for s_action
- $base_back = ""; // The Link for Backbutton
-
-
- /***************
- Fetch posts
- ***************/
-
- /* Test Posts */
- foreach($_POST as $key => $val){
- // Post for delete
- if(preg_match("/^goFaxBlocklist_del.*/",$key)){
- $s_action = "del";
- $s_entry = preg_replace("/^goFaxBlocklist_del_/i","",$key);
- // Post for edit
- }elseif(preg_match("/^goFaxBlocklist_edit_.*/",$key)){
- $s_action="edit";
- $s_entry = preg_replace("/^goFaxBlocklist_edit_/i","",$key);
- // Post for new
- }elseif(preg_match("/^goFaxBlocklist_new.*/",$key)){
- $s_action="new";
- }elseif(preg_match("/^remove_multiple_blocklists/",$key)){
- $s_action="del_multiple";
- }elseif(preg_match("/^copy/",$key)){
- $s_action = "copy";
- $s_entry= preg_replace("/^copy_/i", "", $key);
- }elseif(preg_match("/^cut/",$key)){
- $s_action = "cut";
- $s_entry= preg_replace("/^cut_/i", "", $key);
- }
-
- }
- if((isset($_GET['act']))&&($_GET['act']=="edit_entry")){
- $s_action ="edit";
- $s_entry = $_GET['id'];
- }
-
- $s_entry = preg_replace("/_.$/","",$s_entry);
+ $this->config = $config;
+ $this->ui = $ui;
+ $this->storagePoints = array(get_ou("faxBlocklistRDN"));
- /* 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'] == "goFaxBlocklist_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";
- }
-
-
- /***************
- Handle copy & paste
- ***************/
-
- $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry);
- if($ret){
- return($ret);
- }
-
-
- /***************
- Cancel some dialogs
- ***************/
-
- /* Cancel dialog */
- if (isset($_POST['edit_cancel']) ||
- isset($_POST['delete_blocklist_cancel']) ||
- isset($_POST['delete_lock'])){
-
- $this->remove_lock();
- $this->dialog = NULL;
- set_object_info();
- }
-
-
- /***************
- Save blocklist
- ***************/
-
- /* What about finish? */
- if (isset($_POST['edit_finish']) || isset($_POST['edit_apply'])){
-
- /* No errors, save object */
- $this->dialog->save_object();
- $message= $this->check();
- if (count ($message) == 0){
-
- $this->dialog->save ();
-
- if (!isset($_POST['edit_apply'])){
- $this->remove_lock();
- $this->dn= "";
- $this->dialog = NULL;
- set_object_info();
- }else{
-
- /* Reinitialize tab */
- if($this->dialog instanceof tabs){
- $this->dialog->re_init();
- }
- }
- } else {
- /* Errors found, show message */
- msg_dialog::displayChecks($message);
- }
- }
-
-
- /***************
- Create a new blocklist (dialog)
- ***************/
-
- /* Create new blocklist? */
- if ($s_action=="new"){
- $this->dn= "new";
- $this->dialog = new faxblocktabs($this->config,$this->config->data['TABS']['FAXBLOCKTABS'],$this->dn);
- $this->dialog->set_acl_base($this->base);
- }
-
-
- /***************
- Edit blocklist
- ***************/
-
- if ($s_action=="edit" && !is_object($this->dialog)){
-
- $this->dn=$this->blocklists[$s_entry]['dn'];
-
- if (($user= get_lock($this->dn)) != ""){
- return(gen_locked_message($user, $this->dn,TRUE));
- }else{
- add_lock ($this->dn, $this->ui->dn);
- }
- set_object_info(trim($this->dn));
- $this->dialog = new faxblocktabs($this->config,$this->config->data['TABS']['FAXBLOCKTABS'],$this->dn);
- $this->dialog->set_acl_base($this->dn);
- }
-
-
- /***************
- Display dialog
- ***************/
-
- if(is_object($this->dialog) && ($this->dialog instanceof faxblocktabs)){
- $this->dialog->save_object();
- return($this->dialog->execute());
- }
-
-
- /********************
- Delete MULTIPLE entries requested, display confirm dialog
- ********************/
-
- if ($s_action=="del_multiple"){
-
- $this->dns = array();
- $ids = $this->list_get_selected_items();
-
- if(count($ids)){
- $disallowed = array();
- foreach($ids as $id){
- $dn = $this->blocklists[$id]['dn'];
- $acl = $this->ui->get_permissions($dn, "gofaxlist/blocklistGeneric");
- 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)){
-
- if ($user= get_multiple_locks($this->dns)){
- return(gen_locked_message($user,$this->dns));
- }
-
- $dns_names = array();
- foreach($this->dns as $dn){
- $dns_names[]=LDAP::fix( $dn);
- }
- add_lock ($this->dns, $this->ui->dn);
-
- /* Lock the current entry, so nobody will edit it during deletion */
- $smarty->assign("info", msgPool::deleteInfo($dns_names,_("blocklist")));
- $smarty->assign("multiple", true);
- return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
- }
- }
- }
-
-
- /********************
- Delete MULTIPLE entries confirmed
- ********************/
-
- /* Confirmation for deletion has been passed. */
- if (isset($_POST['delete_multiple_blocklist_confirm'])){
-
- /* Remove user by user and check acls before removeing them */
- foreach($this->dns as $key => $dn){
- $this->dn = $dn;
- if (preg_match("/d/",$this->ui->get_permissions($this->dn,"gofaxlist/blocklistGeneric"))){
- $this->dialog = new faxblocktabs($this->config,$this->config->data['TABS']['FAXBLOCKTABS'],$this->dn);
- $this->dialog->delete();
- $this->dialog = NULL;
- } else {
- msg_dialog::display(_("Permission error"), msgPool::permDelete($dn), ERROR_DIALOG);
- }
- /* Remove lock file after successfull deletion */
- }
- $this->remove_lock();
- $this->dns = array();
- $this->reload();
- }
+# // 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("blocklist-filter.xml", true));
+ $filter->setObjectStorage($this->storagePoints);
+# }
+ $this->setFilter($filter);
+ // Build headpage
+ $headpage = new listing(get_template_path("blocklist-list.xml", true));
+ $headpage->setFilter($filter);
- /********************
- Delete MULTIPLE entries Canceled
- ********************/
-
- /* Remove lock */
- if(isset($_POST['delete_multiple_blocklist_cancel'])){
- foreach($this->dns as $key => $dn){
- $this->remove_lock();
- unset($this->dns[$key]);
- }
- }
-
-
- /***************
- Remove blocklist
- ***************/
-
- /* Delete blocklist requested */
- if ($s_action=="del"){
- $this->dn=$this->blocklists[$s_entry]['dn'];
-
- /* Check locking */
- if (($user= get_lock($this->dn)) != ""){
- return(gen_locked_message($user, $this->dn));
- } else {
-
- // Lock this dn for editing
- add_lock ($this->dn, $this->ui->dn);
- $smarty->assign("info", msgPool::deleteInfo(LDAP::fix($this->dn),_("blocklist")));
- $smarty->assign("multiple", false);
- return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
- }
- }
-
-
- /***************
- Remove blocklist confirmed
- ***************/
-
- /* Finally delete blocklist */
- if (isset($_POST['delete_blocklist_confirm'])){
- if (preg_match("/d/",$this->ui->get_permissions($this->dn,"gofaxlist/blocklistGeneric"))){
- $this->dialog = new faxblocktabs($this->config,$this->config->data['TABS']['FAXBLOCKTABS'],$this->dn);
- $this->dialog->delete();
- $this->dialog = NULL;
- $this->remove_lock();
- } else {
- msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
- }
- }
-
- /***************
- Divlist dialog
- ***************/
-
- /* Check if there is a snapshot dialog open */
- $base = $this->DivListBlocklist->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
- return($str);
- }
-
- /* Display dialog with system list */
- $this->DivListBlocklist->parent = $this;
- $this->DivListBlocklist->execute();
-
- /* Add departments if subsearch is disabled */
- if(!$this->DivListBlocklist->SubSearch){
- $this->DivListBlocklist->AddDepartments($this->DivListBlocklist->selectedBase,3,1);
- }
- $this->reload();
- $this->DivListBlocklist->setEntries($this->blocklists);
- return($this->DivListBlocklist->Draw());
- }
-
-
- 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);
- }
-
-
- /* Return departments, that will be included within snapshot detection */
- function get_used_snapshot_bases()
- {
- return(array(get_ou('faxBlocklistRDN').$this->DivListBlocklist->selectedBase));
- }
-
-
- /* Reload the list of known blocklists */
- function reload()
- {
- /* Init some vars */
- $filter = $filter2 = "";
- $base = $this->DivListBlocklist->selectedBase;
- $Regex = $this->DivListBlocklist->Regex;
- $SubSearch = $this->DivListBlocklist->SubSearch;
- $ShowSendBocklists = $this->DivListBlocklist->ShowSendBocklists;
- $ShowReceiveBlocklists = $this->DivListBlocklist->ShowReceiveBlocklists;
- $Flags = GL_SIZELIMIT;
- $res = $res2 = array();
-
- /* Append subsearch to Flags */
- if($SubSearch){
- $Flags |= GL_SUBSEARCH;
- }else{
- $base = get_ou('faxBlocklistRDN').$base;
- }
-
- /* Create filter */
- if ($ShowSendBocklists){
- $filter = "(&(objectClass=goFaxSBlock)(|(cn=".$Regex.")(goFaxSBlocklist=".$Regex.")))";
- $res= get_list($filter, "gofaxlist", $base,array("*"), $Flags);
- }
- if ($ShowReceiveBlocklists){
- $filter2= "(&(objectClass=goFaxRBlock)(|(cn=".$Regex.")(goFaxRBlocklist=".$Regex.")))";
- $res2= get_list($filter2, "gofaxlist", $base,array("*"), $Flags);
- }
-
- $this->blocklists = array_merge($res,$res2);
-
- /* appen && sort */
- $tmp=array();
- foreach($this->blocklists as $tkey => $val ){
-
- $acl = $this->ui ->get_permissions($base,"gofaxlist/blocklistGeneric");
- if(preg_match("/r/",$acl)){
- $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
- }
- }
- ksort($tmp);
- $this->blocklists=array();
- foreach($tmp as $val){
- $this->blocklists[]=$val;
- }
- reset ($this->blocklists);
- }
-
-
- /* Save data to object */
- function save_object()
- {
- $this->DivListBlocklist->save_object();
- if(is_object($this->CopyPasteHandler)){
- $this->CopyPasteHandler->save_object();
- }
- }
-
-
-
-
-
- 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->blocklists[$s_entry]['dn'];
- if($s_action == "copy" && $ui->is_copyable($dn,"gofaxlist","blocklistGeneric")){
- $this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist");
- }
- if($s_action == "cut" && $ui->is_cutable($dn,"gofaxlist","blocklistGeneric")){
- $this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist");
- }
- }
-
- /* 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->blocklists[$id]['dn'];
-
- if($s_action == "copy_multiple" && $ui->is_copyable($dn,"gofaxlist","blocklistGeneric")){
- $this->CopyPasteHandler->add_to_queue($dn,"copy","faxblocktabs","FAXBLOCKTABS","gofaxlist");
- }
- if($s_action == "cut_multiple" && $ui->is_cutable($dn,"gofaxlist","blocklistGeneric")){
- $this->CopyPasteHandler->add_to_queue($dn,"cut","faxblocktabs","FAXBLOCKTABS","gofaxlist");
- }
- }
- }
-
- /* 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->DivListBlocklist->selectedBase);
- $data = $this->CopyPasteHandler->execute();
-
- /* Return dialog data */
- if(!empty($data)){
- return($data);
- }
+ // Add copy&paste and snapshot handler.
+ if ($this->config->boolValueIsTrue("main", "copyPaste")){
+ $this->cpHandler = new CopyPasteHandler($this->config);
}
-
- /* Automatically disable status for pasting */
- if(!$this->CopyPasteHandler->entries_queued()){
- $this->start_pasting_copied_objects = FALSE;
+ if($this->config->get_cfg_value("enableSnapshots") == "true"){
+ $this->snapHandler = new SnapshotHandler($this->config);
}
- return("");
- }
-
-
- /*! \brief Remove entry locks if the plugin was aborted.
- */
- function remove_lock()
- {
- if($this->dn) del_lock($this->dn);
- if(is_array($this->dns) && count($this->dns)) del_lock($this->dns);
+ parent::__construct($config, $ui, "blocklists", $headpage);
}
-}
+}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/gosa-plugins/gofax/gofax/blocklists/main.inc b/gosa-plugins/gofax/gofax/blocklists/main.inc
index 602d617a8d24a7b12cfbf46ac46add7104d027c8..17dc229d6f24bee80f638373a8eb38f5248344d4 100644 (file)
<?php
+/*
+ * 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
*/
if ($remove_lock){
- if(session::is_set('blocklist')){
- $macl = session::get('blocklist');
+ if(session::is_set('blocklistManagement')){
+ $macl = session::get('blocklistManagement');
$macl->remove_lock();
}
}
/* Remove this plugin from session
*/
if ( $cleanup ){
- session::un_set('blocklist');
+ session::un_set('blocklistManagement');
}else{
- /* Create blocklist object on demand */
- if (!session::is_set('blocklist')){
- $blocklist= new blocklist($config, $ui);
- $blocklist->set_acl_category("gofaxlist");
- session::set('blocklist',$blocklist);
- }
- $blocklist = session::get('blocklist');
- $blocklist->save_object();
- $output= $blocklist->execute();
-
- /* Reset requested? */
- if (isset($_GET['reset']) && $_GET['reset'] == 1){
- session::un_set ('blocklist');
- }
+ /* Create blocklistManagement object on demand */
+ if (!session::is_set('blocklistManagement')){
+ $blocklistManagement= new blocklistManagement ($config, $ui);
+ session::set('blocklistManagement',$blocklistManagement);
+ }
+ $blocklistManagement = session::get('blocklistManagement');
+ $display= $blocklistManagement->execute();
- /* Page header*/
- if (get_object_info() != ""){
- $display= print_header(get_template_path($blocklist->plIcon), _("Blocklist 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($blocklist->plIcon), _("Blocklist management"));
- }
- $display.= $output;
+ /* Reset requested? */
+ if (isset($_GET['reset']) && $_GET['reset'] == 1){
+ session::un_set ('blocklistManagement');
+ }
- session::set('blocklist',$blocklist);
+ /* Show and save dialog */
+ session::set('blocklistManagement',$blocklistManagement);
}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>