summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd8ab59)
raw | patch | inline | side by side (parent: bd8ab59)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 20 Jun 2007 09:16:00 +0000 (09:16 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 20 Jun 2007 09:16:00 +0000 (09:16 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6634 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc
index 26e46ce1a8750f04faa388ad60b3decc31b8f66e..d08d22cd14c3bbbb3556ce20f7b106b097b29355 100644 (file)
title='"._("Remove selected groups")."' alt='"._("Remove groups")."' name='remove_multiple_groups'> ";
/* Add multiple copy & cut icons */
- if(is_object($this->parent->CopyPasteHandler)){
+ if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
$listhead .= " <input class='center' type='image' align='middle' src='images/editcopy.png'
title='"._("Copy selected group")."' alt='"._("Copy groups")."' name='multiple_copy_groups'> ";
$listhead .= " <input class='center' type='image' align='middle' src='images/editcut.png'
diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc
index b9500e4fc047ff946b0f63d7d078c626f0e8a298..88af3d7f1a29534f3efb298d261bdedec56046ba 100644 (file)
title='"._("Remove selected user")."' alt='"._("Remove user")."' name='remove_multiple_users'> ";
/* Add multiple copy & cut icons */
- if(is_object($this->parent->CopyPasteHandler)){
+ if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
$listhead .= " <input class='center' type='image' align='middle' src='images/editcopy.png'
title='"._("Copy selected user")."' alt='"._("Copy users")."' name='multiple_copy_users'> ";
$listhead .= " <input class='center' type='image' align='middle' src='images/editcut.png'
diff --git a/plugins/personal/scalix/class_scalixAccount.inc b/plugins/personal/scalix/class_scalixAccount.inc
index cc970d43cec3080b096ef12aa775b43b76027dc8..8bffd873de8453401e61a22c105326fe8e28e33c 100644 (file)
$this->dialog= FALSE;
}
- /* Add email addresses */
- if (isset($_POST['add_email'])){
-
- /* Check write access */
- if(!$this->acl_is_writeable("scalixEmailAddress")){
- print_red(_("You are not allowed to modify alternate addresses"));
- }else{
-
- /* Check if given value is not empty */
- if ($_POST['email_address'] != ""){
- $valid= FALSE;
-
- /* Valid mail address */
- if( ($this->is_template && !is_email($_POST['email_address'], TRUE)) ||
- (!$this->is_template && !is_email($_POST['email_address'])) ){
- print_red (_("You're trying to add an invalid email address to the list of alternate addresses."));
- }else{
- $valid = TRUE;
- }
-
- /* Mail address already in use ? */
- if ($valid && ($user= $this->addEmail ($_POST['email_address'])) != ""){
- $ui= get_userinfo();
- if ($user != $ui->username){
- print_red (_("The address you're trying to add is already used by user")." '$user'.");
- }
- }
- }
- }
- }
-
- /* Delete email addresses */
- if (isset($_POST['delete_email']) && isset ($_POST['emails_list'])){
- if(!$this->acl_is_writeable("scalixEmailAddress")){
- print_red(_("You are not allowed to modify alternate addresses"));
- }else{
- if (count($_POST['emails_list'])){
- $this->delEmail ($_POST['emails_list']);
- }
- }
- }
$smarty->assign("mailboxClasses", $mailboxClasses);
$smarty->assign("serverLanguages", $serverLanguages);
));
}
+
+ function saveCopyDialog()
+ {
+ if (isset($_POST['scalixTab'])){
+
+ /* Add email addresses */
+ if (isset($_POST['add_email'])){
+
+ /* Check write access */
+# if(!$this->acl_is_writeable("scalixEmailAddress")){
+# print_red(_("You are not allowed to modify alternate addresses"));
+# }else{
+
+ /* Check if given value is not empty */
+ if ($_POST['email_address'] != ""){
+ $valid= FALSE;
+
+ /* Valid mail address */
+ if( ($this->is_template && !is_email($_POST['email_address'], TRUE)) ||
+ (!$this->is_template && !is_email($_POST['email_address'])) ){
+ print_red (_("You're trying to add an invalid email address to the list of alternate addresses."));
+ }else{
+ $valid = TRUE;
+ }
+
+ /* Mail address already in use ? */
+ if ($valid && ($user= $this->addEmail ($_POST['email_address'])) != ""){
+ $ui= get_userinfo();
+ if ($user != $ui->username){
+ print_red (_("The address you're trying to add is already used by user")." '$user'.");
+ }
+ }
+# }
+ }
+ }
+
+ /* Delete email addresses */
+ if (isset($_POST['delete_email']) && isset ($_POST['emails_list'])){
+# if(!$this->acl_is_writeable("scalixEmailAddress")){
+# print_red(_("You are not allowed to modify alternate addresses"));
+# }else{
+ if (count($_POST['emails_list'])){
+ $this->delEmail ($_POST['emails_list']);
+# }
+ }
+ }
+ }
+ }
+
+
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+ foreach ($this->fakeBooleanAttributes as $val){
+ if (isset($source["$val"][0])&&$source["$val"][0]=="TRUE"){
+ $this->$val = TRUE;
+ } else {
+ $this->$val = FALSE;
+ }
+ }
+
+ /* Load attributes containing arrays */
+ foreach (array("scalixEmailAddress") as $val){
+ if (isset($source["$val"]["count"])){
+ for ($i= 0; $i<$source["$val"]["count"]; $i++){
+ array_push($this->$val, $source["$val"][$i]);
+ }
+ }
+ }
+ }
+
+
+ /* Create the posix dialog part for copy & paste */
+ function getCopyDialog()
+ {
+ $smarty = get_smarty();
+ $smarty->assign("scalixEmailAddress",$this->scalixEmailAddress);
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+
+ }
}
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:rulere
?>
diff --git a/plugins/personal/scalix/paste_generic.tpl b/plugins/personal/scalix/paste_generic.tpl
--- /dev/null
@@ -0,0 +1,25 @@
+<table>
+ <tr>
+ <td style="vertical-align:top;">
+ <h2><img class="center" alt="" align="middle" src="images/envelope.png" /><label for="emails_list"> {t}Scalix email addresses{/t}</label></h2>
+ <select id="emails_list" style="width:100%;height:100px;" name="emails_list[]" size="15"
+ multiple title="{t}List of scalix email addresses{/t}" >
+ {html_options values=$scalixEmailAddress output=$scalixEmailAddress}
+ <option disabled> </option>
+ </select>
+ <br />
+ <input name="email_address" size="30" align="middle" maxlength="65" value="">
+ <input type=submit value="{t}Add{/t}" name="add_email">
+ <input type=submit value="{t}Delete{/t}" name="delete_email">
+ </td>
+ </tr>
+</table>
+
+<input type="hidden" name="scalixTab" value="scalixTab">
+
+<!-- Place cursor -->
+<script language="JavaScript" type="text/javascript">
+ <!-- // First input field on page
+ document.mainform.scalixMailnode.focus();
+ -->
+</script>