From: hickert Date: Mon, 24 Sep 2007 11:19:28 +0000 (+0000) Subject: Added kolab folder type to trunk. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dd3060db87b65ed2090f4a06d5a13a6b0e5d2790;p=gosa.git Added kolab folder type to trunk. It wasn't implemented in trunk currently. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7390 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index f62805de9..46a521a8a 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -28,6 +28,8 @@ class mailgroup extends plugin '%members%' => 'lrswp', // %members% are all group-members '' => 'p'); // Every user added gets this right + var $kolabFolderType_SubType = ""; + var $kolabFolderType_Type = ""; var $gosaSpamSortLevel = ""; var $gosaSpamMailbox = ""; @@ -93,6 +95,14 @@ class mailgroup extends plugin $this->uid= $this->attrs['cn'][0]; } + /* Get folder type */ + if(isset($this->config->current['MAILMETHOD'])&&preg_match("/olab/i",$this->config->current['MAILMETHOD'])){ + if(isset($this->attrs['kolabFolderType'])){ + $tmp = split("\.",$this->attrs['kolabFolderType'][0]); + $this->kolabFolderType_Type = $tmp[0]; + $this->kolabFolderType_SubType = $tmp[1]; + } + } /* If this ins't new mailgroup, read all required data from ldap */ @@ -643,6 +653,29 @@ class mailgroup extends plugin $smarty->assign("quotadefined", "false"); } + if(isset($this->config->current['MAILMETHOD'])&&preg_match("/olab/i",$this->config->current['MAILMETHOD'])){ + + $smarty->assign("kolab", TRUE); + $smarty->assign("JS",$_SESSION['js']); + $smarty->assign("kolabFolderType_Types", array ( '' => _('Unspecified'), 'mail' => _('Mails'), + 'task' => _('Tasks') , 'journal' => _('Journals'), + 'calendar' => _('Calendar'), 'contact' => _('Contacts'), + 'note' => _('Notes'))); + if($this->kolabFolderType_Type == "mail"){ + $smarty->assign("kolabFolderType_SubTypes", array( + '' => _('Unspecified'), 'inbox' => _("Inbox") , + 'drafts' => _("Drafts"), 'sentitems' => _("Sent items"), + 'junkemail' => _("Junk mail"))); + }else{ + $smarty->assign("kolabFolderType_SubTypes", array( 'default' => _("Default"))); + } + $smarty->assign("kolabFolderType_Type", $this->kolabFolderType_Type); + $smarty->assign("kolabFolderType_SubType", $this->kolabFolderType_SubType); + }else{ + $smarty->assign("kolab", FALSE); + } + + $display.= $smarty->fetch (get_template_path('mail.tpl', TRUE)); return ($display); } @@ -704,6 +737,14 @@ class mailgroup extends plugin function save_object() { + /* Add special kolab attributes */ + if(isset($this->config->current['MAILMETHOD'])&&preg_match("/olab/i",$this->config->current['MAILMETHOD'])){ + if(isset($_POST['kolabFolderType_Type'])){ + $this->kolabFolderType_Type = get_post("kolabFolderType_Type"); + $this->kolabFolderType_SubType = get_post("kolabFolderType_SubType"); + } + } + /* Check if user wants to remove the shared folder from imap too */ if($this->initially_was_account && !$this->is_account){ if(isset($_POST['remove_folder_from_imap'])){ @@ -816,6 +857,12 @@ I: Only insider delivery */ $this->attrs['acl'][]= "$user $acl"; } } + + if(!empty($this->kolabFolderType_Type)){ + $this->attrs['kolabFolderType'] = $this->kolabFolderType_Type.".".$this->kolabFolderType_SubType; + }else{ + $this->attrs['kolabFolderType'] = array(); + } }else{ /* Save acl's */ $this->attrs['acl']= array(); diff --git a/plugins/admin/groups/mail.tpl b/plugins/admin/groups/mail.tpl index b162fc345..e7eb7083a 100644 --- a/plugins/admin/groups/mail.tpl +++ b/plugins/admin/groups/mail.tpl @@ -48,6 +48,24 @@ {t}MB{/t} + {if $kolab} + + + {t}Folder type{/t} + + + + + {if !$JS} + + {/if} + + + {/if}