summaryrefslogtreecommitdiff
path: root/patches/horde-webmail/1.2.0/merges/t_dimp_H_GW_FoldersView.diff
blob: 5f64660ee4ba594c0700e21e1b2cb714af9b12f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
From: Gunnar Wrobel <p@rdus.de>
Subject: [PATCH] t/dimp/H/GW/FoldersView

Provide a folders menu for dimp.

kolab/issue3456 (There is no view in dimp that allows folder subscription)
https://www.intevation.de/roundup/kolab/issue3456

[#8059] DIMP provides no view to subscribe/unsubscribe to folders
http://bugs.horde.org/ticket/8059

Signed-off-by: Gunnar Wrobel <p@rdus.de>

---
 horde-webmail/dimp/config/menu.php               |    6 ++++++
 horde-webmail/imp/folders.php                    |   17 ++++++++++++-----
 horde-webmail/imp/templates/folders/actions.html |    2 ++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/horde-webmail/dimp/config/menu.php b/horde-webmail/dimp/config/menu.php
index 5dcf354..99a4b8c 100644
--- a/horde-webmail/dimp/config/menu.php
+++ b/horde-webmail/dimp/config/menu.php
@@ -28,6 +28,12 @@
 //         'text' => 'Say Hi!',
 //         'icon' => $GLOBALS['registry']->getImageDir('horde') . '/horde.png'),
 // );
+$site_menu = array(
+    'folders' => array(
+        'action' => 'DimpBase.go("app:horde", "' . Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/folders.php', true) . '")',
+        'text' => _('Folders'),
+        'icon' => $GLOBALS['registry']->getImageDir('imp') . '/folders/folder.png'),
+);
 if (file_exists(dirname(__FILE__) . '/menu.local.php')) {
   require_once(dirname(__FILE__) . '/menu.local.php');
 }
diff --git a/horde-webmail/imp/folders.php b/horde-webmail/imp/folders.php
index a0425aa..c46b0e5 100644
--- a/horde-webmail/imp/folders.php
+++ b/horde-webmail/imp/folders.php
@@ -324,7 +324,9 @@ $folders_url = Util::addParameter($folders_url, 'folders_token', $folders_token)
 
 $title = _("Folder Navigator");
 require IMP_TEMPLATES . '/common-header.inc';
-IMP::menu();
+if ($_SESSION['imp']['default_view'] != 'dimp') {
+    IMP::menu();
+}
 IMP::status();
 IMP::quota();
 
@@ -375,6 +377,7 @@ if ($a_template->get('javascript')) {
 }
 
 $a_template->set('create_folder', !empty($GLOBALS['conf']['hooks']['permsdenied']) || (IMP::hasPermission('create_folders') && IMP::hasPermission('max_folders')));
+$a_template->set('imp_view', $_SESSION['imp']['default_view'] != 'dimp');
 if ($prefs->getValue('subscribe')) {
     $a_template->set('subscribe', true);
     $subToggleText = ($showAll) ? _("Hide Unsubscribed") : _("Show Unsubscribed");
@@ -414,9 +417,11 @@ $rowct = 0;
 $morembox = $rows = array();
 foreach ($raw_rows as $val) {
     $val['nocheckbox'] = !empty($val['vfolder']);
-    if (!empty($val['vfolder']) && ($val['value'] != IMPTREE_VFOLDER_KEY)) {
-        $val['delvfolder'] = Horde::link($imp_search->deleteURL($val['value']), _("Delete Virtual Folder")) . _("Delete") . '</a>';
-        $val['editvfolder'] = Horde::link($imp_search->editURL($val['value']), _("Edit Virtual Folder")) . _("Edit") . '</a>';
+    if ($_SESSION['imp']['default_view'] != 'dimp') {
+        if (!empty($val['vfolder']) && ($val['value'] != IMPTREE_VFOLDER_KEY)) {
+            $val['delvfolder'] = Horde::link($imp_search->deleteURL($val['value']), _("Delete Virtual Folder")) . _("Delete") . '</a>';
+            $val['editvfolder'] = Horde::link($imp_search->editURL($val['value']), _("Edit Virtual Folder")) . _("Edit") . '</a>';
+        }
     }
 
     $val['class'] = (++$rowct % 2) ? 'item0' : 'item1';
@@ -433,7 +438,9 @@ foreach ($raw_rows as $val) {
         if (!empty($val['unseen'])) {
             $val['name'] = '<strong>' . $val['name'] . '</strong>';
         }
-        $val['name'] = Horde::link(Util::addParameter($name_url, 'mailbox', $val['value']), sprintf(_("View messages in %s"), ($val['vfolder']) ? $val['base_elt']['l'] : $val['display'])) . $val['name'] . '</a>';
+        if ($_SESSION['imp']['default_view'] != 'dimp') {
+            $val['name'] = Horde::link(Util::addParameter($name_url, 'mailbox', $val['value']), sprintf(_("View messages in %s"), ($val['vfolder']) ? $val['base_elt']['l'] : $val['display'])) . $val['name'] . '</a>';
+        }
     }
 
     $dir2 = _image($val, null, 'folder');
diff --git a/horde-webmail/imp/templates/folders/actions.html b/horde-webmail/imp/templates/folders/actions.html
index f882a82..8e39b8a 100644
--- a/horde-webmail/imp/templates/folders/actions.html
+++ b/horde-webmail/imp/templates/folders/actions.html
@@ -12,12 +12,14 @@
     <select id="action_choose<tag:id />">
      <option selected="selected"><gettext>Choose Action</gettext></option>
      <option value="">--------------------</option>
+<if:view_imp>
 <if:create_folder>
      <option value="create_folder"><gettext>Create</gettext></option>
 </if:create_folder>
      <option value="rename_folder"><gettext>Rename</gettext></option>
      <option value="delete_folder_confirm"><gettext>Delete</gettext></option>
      <option value="folders_empty_mailbox_confirm"><gettext>Empty</gettext></option>
+</if:view_imp>
 <if:notrash>
      <option value="expunge_folder"><gettext>Purge</gettext></option>
 </if:notrash>
-- 
tg: (eff636a..) t/dimp/H/GW/FoldersView (depends on: t/kronolith/H/GW/UseDayHourStartEndAlsoInFBView)
-- 
TOPGIT patch commit log
=======================

commit a1966161022108d9bf4831a8613b1db9a4e68c4d
Author: Gunnar Wrobel <p@rdus.de>
Date:   Fri Mar 13 11:06:45 2009 +0000

    Include issue references in the patch description.

commit de8c5e8cac0bfb29c9cf94989016487302da653f
Author: Gunnar Wrobel <p@rdus.de>
Date:   Fri Mar 13 11:04:54 2009 +0000

    Exclude IMP specific functionality as requested by Sascha wilde in  kolab/issue3456 (There is no view in dimp that allows folder subscription).

commit 9c9a343c04cf11f857bfeb4148f0ab9d9df7dce6
Author: Gunnar Wrobel <p@rdus.de>
Date:   Sun Mar 8 19:06:05 2009 +0000

    Completed the hack.

commit caa539aac138c4b77376ab9f4a4a86691709a96b
Author: Gunnar Wrobel <p@rdus.de>
Date:   Sun Mar 8 19:01:41 2009 +0000

    Completed the hack.