Merge branch 'master' into feature/template_webComponent

This commit is contained in:
nathan 2024-11-14 10:15:01 -07:00
commit eef04636db
15 changed files with 113 additions and 70 deletions

View File

@ -940,14 +940,6 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
{
this.selectedNodes = event.detail.selection
}*/
if(typeof this.onclick == "function")
{
// wait for the update, so app founds DOM in the expected state
this._tree.updateComplete.then(() =>
{
this.onclick(nodes[0].id, this, event.detail.previous)
});
}
}
protected async finishedLazyLoading()

View File

@ -269,9 +269,11 @@ export class Et2Tabs extends Et2InputWidget(SlTabGroup) implements et2_IResizeab
const initial = firstTab.hasAttribute("active");
firstTab.setAttribute("active", '');
const tabHeight = getComputedStyle(firstTab).height;
if (parseInt(maxHeight) > 50 && parseInt(maxHeight) < parseInt(tabHeight))
if (parseInt(maxHeight) > 50 && parseInt(maxHeight) < parseInt(tabHeight)) //there was a reasonable max height set
{
this.tabHeight = maxHeight;
} else if(maxHeight != '0px'){ //max height was set but is unreasonable small
this.tabHeight = '86vh' // use most of available space, but not all so Tabbox header fits too, and does not need second scrollbar
} else
{
this.tabHeight = tabHeight;

View File

@ -73,21 +73,6 @@ class Script
$this->extensions = [];
}
private function _setExtensionsStatus(Sieve $connection)
{
$this->extensions = [
'vacation' => $connection->hasExtension('vacation'),
'vacation-seconds' => $connection->hasExtension('vacation-seconds'),
'regex' => $connection->hasExtension('regex'),
'enotify' => $connection->hasExtension('enotify'),
'body' => $connection->hasExtension('body'),
'variables' => $connection->hasExtension('variables'),
'date' => $connection->hasExtension('date'),
'imap4flags' => $connection->hasExtension('imap4flags'),
'relational' => $connection->hasExtension('relational'),
];
}
// get sieve script rules for this user
/**
* Retrieve the rules
@ -103,7 +88,6 @@ class Script
$anyofbit = 4;
$keepbit = 8;
$regexbit = 128;
$this->_setExtensionsStatus($connection);
if (!isset($this->name)){
$this->errstr = 'retrieveRules: no script name specified';
@ -273,19 +257,17 @@ class Script
//include "$default->lib_dir/version.php";
// set extensions status
$this->_setExtensionsStatus($connection);
if (!$this->extensions['vacation']) $this->vacation = false;
if (!$connection->hasExtension('vacation')) $this->vacation = false;
// for vacation with redirect we need to keep track were the mail goes, to add an explicit keep
if ($this->extensions['variables'] && $this->vacation)
if ($connection->hasExtension('variables') && $this->vacation)
{
$newscriptbody = 'set "action" "inbox";'."\n\n";
}
$continue = 1;
foreach ($this->rules as $rule) {
foreach ($this->rules as $rule)
{
$newruletext = "";
// don't print this rule if disabled.
@ -302,7 +284,13 @@ class Script
}
$started = 0;
if (empty($rule['unconditional'])) {
if (!isset($rule['unconditional']))
{
$rule['unconditional'] = $rule['action'] && !$rule['from'] && !$rule['to'] && !$rule['subject'] &&
!$rule['field'] && !$rule['size'] && !$rule['field_bodytransform'] && !$rule['ctype'];
}
if (empty($rule['unconditional']))
{
if (!$continue) $newruletext .= "els";
$newruletext .= "if " . $anyall . " (";
if ($rule['from']) {
@ -363,7 +351,7 @@ class Script
$newruletext .= "size " . $xthan . $rule['size'] . "K";
$started = 1;
}
if ($this->extensions['body']){
if ($connection->hasExtension('body')){
if (!empty($rule['field_bodytransform'])){
if ($started) $newruletext .= ", ";
$btransform = " :raw ";
@ -389,21 +377,57 @@ class Script
// actions
if (empty($rule['unconditional'])) $newruletext .= ") {\n\t";
if (empty($rule['unconditional'])) $newruletext .= ") {\n";
$newruletext .= "\t";
if (preg_match("/folder/i",$rule['action'])) {
$newruletext .= "fileinto \"" . ($utf7imap_fileinto ?
Translation::convert($rule['action_arg'],'utf-8', 'utf7-imap') : $rule['action_arg']) . "\";";
}
if (preg_match("/reject/i",$rule['action'])) {
if (preg_match("/reject/i",$rule['action']))
{
$newruletext .= "reject text: \n" . $rule['action_arg'] . "\n.\n;";
$rejectused = 1;
}
if (preg_match("/address/i",$rule['action'])) {
foreach(preg_split('/, ?/',$rule['action_arg']) as $addr)
if (preg_match("/address/i",$rule['action']))
{
// forward with recipients address as envelope and header From, to avoid SPF and DKIM problems,
// if editheader Sieve extension is available (needs to be enabled for Dovecot!)
// From header of forwarded mail will be "'sender-address' <recipient-address>", so original sender is still visible
if ($connection->hasExtension('editheader'))
{
$newruletext .= 'if header :matches "From" "*" { set "from_header" "${1}"; }'."\n";
$newruletext .= "\t".'if address :matches "From" "*" { set "from" "${1}"; }'."\n";
// we don't delete ReplyTo header to keep it, if it was already set
$newruletext .= "\t".'addheader "ReplyTo" "${from}";'."\n";
if ($connection->hasExtension('envelope'))
{
$newruletext .= "\tredirect \"".trim($addr)."\";\n";
$newruletext .= "\t".'if envelope :matches "to" "*" { set "user_email" "${1}"; }'."\n";
}
else
{
$newruletext .= "\t".'if address :matches "to" "*" { set "user_email" "${1}"; }'."\n";
}
// we need to delete From header, to be able to overwrite it!
$newruletext .= "\t".'deleteheader "from";'."\n";
$newruletext .= "\t".'addheader "From" "\'${from}\' <${user_email}>";'."\n";
// we need to delete the DKIM-Signature header, as we change the from
$newruletext .= "\t".'if header :matches "DKIM-Signature" "*" { set "dkim_signature" "${1}"; }'."\n";
$newruletext .= "\t".'deleteheader "dkim-signature";'."\n\n";
}
foreach(preg_split('/, ?/',$rule['action_arg']) as $addr)
{
$newruletext .= "\tredirect \"".trim($addr)."\";\n";
}
if ($connection->hasExtension('editheader'))
{
// we restore the From header, in case we keep the mail, or other rules
$newruletext .= "\n\t".'deleteheader "from";'."\n";
$newruletext .= "\t".'addheader "From" "${from_header}";'."\n";
// we restore the DKIM-Signature header
$newruletext .= "\t".'addheader "DKIM-Signature" "${dkim_signature}";'."\n";
}
}
if (preg_match("/discard/i",$rule['action'])) {
$newruletext .= "discard;";
@ -416,7 +440,7 @@ class Script
$newruletext .= "\n\tkeep;";
}
// for vacation with redirect we need to keep track were the mail goes, to NOT add an explicit keep
elseif ($this->extensions['variables'] && $this->vacation &&
elseif ($connection->hasExtension('variables') && $this->vacation &&
preg_match('/(folder|reject|address|discard)/', $rule['action']))
{
$newruletext .= "\n\tset \"action\" \"$rule[action]\";";
@ -458,7 +482,7 @@ class Script
$vac_rule = '';
if ($vacation['text'])
{
if ($this->extensions['regex'])
if ($connection->hasExtension('regex'))
{
$vac_rule .= "if header :regex " . '"X-Spam-Status" ' . '"\\\\bYES\\\\b"' . "{\n\tstop;\n}\n"; //stop vacation reply if it is spam
$regexused = 1;
@ -484,9 +508,9 @@ class Script
$vac_rule .= "\tredirect \"" . trim($addr) . "\";\n";
}
// if there is no other action e.g. fileinto before, we need to add an explicit keep, as the implicit on is canceled by the vaction redirect!
if ($this->extensions['variables']) $vac_rule .= "\tif string :is \"\${action}\" \"inbox\" {\n";
if ($connection->hasExtension('variables')) $vac_rule .= "\tif string :is \"\${action}\" \"inbox\" {\n";
$vac_rule .= "\t\tkeep;\n";
if ($this->extensions['variables']) $vac_rule .= "\t}\n";
if ($connection->hasExtension('variables')) $vac_rule .= "\t}\n";
$vac_rule .= "}\n";
}
if (!isset($vacation['modus']) || $vacation['modus'] !== 'store')
@ -527,7 +551,7 @@ class Script
{
$vac_rule .= "discard;\n";
}
if ($vacation['status'] === 'by_date' && $this->extensions['date'] && $vacation['start_date'] && $vacation['end_date'])
if ($vacation['status'] === 'by_date' && $connection->hasExtension('date') && $vacation['start_date'] && $vacation['end_date'])
{
$vac_rule = "if allof (\n".
"currentdate :value \"ge\" \"date\" \"". date('Y-m-d', $vacation['start_date']) ."\",\n".
@ -549,10 +573,10 @@ class Script
// format notification body
$egw_site_title = $GLOBALS['egw_info']['server']['site_title'];
if ($this->extensions['enotify']==true)
if ($connection->hasExtension('enotify')==true)
{
$notification_body = lang("You have received a new message on the")." {$egw_site_title}";
if ($this->extensions['variables'])
if ($connection->hasExtension('variables'))
{
$notification_body .= ", ";
$notification_body .= 'From: ${from}';
@ -595,18 +619,20 @@ class Script
if ($activerules) {
$newscripthead .= "require [\"fileinto\"";
if ($this->extensions['regex'] && $regexused) $newscripthead .= ",\"regex\"";
if ($connection->hasExtension('regex') && $regexused) $newscripthead .= ",\"regex\"";
if ($rejectused) $newscripthead .= ",\"reject\"";
if ($this->vacation && $vacation_active) {
$newscripthead .= (string)$this->vacation['days'] === '0' ? ',"vacation-seconds"' : ',"vacation"';
}
if ($this->extensions['body']) $newscripthead .= ",\"body\"";
if ($this->extensions['date']) $newscripthead .= ",\"date\"";
if ($this->extensions['relational']) $newscripthead .= ",\"relational\"";
if ($this->extensions['variables']) $newscripthead .= ",\"variables\"";
if ($this->extensions['imap4flags']) $newscripthead .= ",\"imap4flags\"";
if ($connection->hasExtension('body')) $newscripthead .= ",\"body\"";
if ($connection->hasExtension('date')) $newscripthead .= ",\"date\"";
if ($connection->hasExtension('relational')) $newscripthead .= ",\"relational\"";
if ($connection->hasExtension('variables')) $newscripthead .= ",\"variables\"";
if ($connection->hasExtension('imap4flags')) $newscripthead .= ",\"imap4flags\"";
if ($connection->hasExtension('envelope')) $newscripthead .= ",\"envelope\"";
if ($connection->hasExtension('editheader')) $newscripthead .= ",\"editheader\"";
if ($this->emailNotification && $this->emailNotification['status'] == 'on') $newscripthead .= ',"'.($this->extensions['enotify']?'e':'').'notify"'.($this->extensions['variables']?',"variables"':''); // Added email notifications
if ($this->emailNotification && $this->emailNotification['status'] == 'on') $newscripthead .= ',"'.($connection->hasExtension('enotify')?'e':'').'notify"'.($connection->hasExtension('variables')?',"variables"':''); // Added email notifications
$newscripthead .= "];\n\n";
} else {
// no active rules, but might still have an active vacation rule
@ -614,10 +640,10 @@ class Script
if ($this->vacation)
{
$newscripthead .= 'require['.((string)$this->vacation['days'] === '0' ? '"vacation-seconds"' : '"vacation"');
if ($this->extensions['variables']) $newscripthead .= ',"variables"';
if ($this->extensions['regex'] && $regexused) $newscripthead .= ",\"regex\"";
if ($this->extensions['date']) $newscripthead .= ",\"date\"";
if ($this->extensions['relational']) $newscripthead .= ",\"relational\"";
if ($connection->hasExtension('variables')) $newscripthead .= ',"variables"';
if ($connection->hasExtension('regex') && $regexused) $newscripthead .= ",\"regex\"";
if ($connection->hasExtension('date')) $newscripthead .= ",\"date\"";
if ($connection->hasExtension('relational')) $newscripthead .= ",\"relational\"";
$closeRequired=true;
}
@ -625,11 +651,11 @@ class Script
{
if ($this->vacation && $vacation_active)
{
$newscripthead .= ",\"".($this->extensions['enotify']?'e':'')."notify\"".($this->extensions['variables']?',"variables"':'')."];\n\n"; // Added email notifications
$newscripthead .= ",\"".($connection->hasExtension('enotify')?'e':'')."notify\"".($connection->hasExtension('variables')?',"variables"':'')."];\n\n"; // Added email notifications
}
else
{
$newscripthead .= "require [\"".($this->extensions['enotify']?'e':'')."notify\"".($this->extensions['variables']?',"variables"':'')."];\n\n"; // Added email notifications
$newscripthead .= "require [\"".($connection->hasExtension('enotify')?'e':'')."notify\"".($connection->hasExtension('variables')?',"variables"':'')."];\n\n"; // Added email notifications
}
}
if ($closeRequired) $newscripthead .= "];\n\n";
@ -652,7 +678,7 @@ class Script
$newscriptfoot .= "#rule&&" . $rule['priority'] . "&&" . $rule['status'] . "&&" .
addslashes($rule['from']) . "&&" . addslashes($rule['to']) . "&&" . addslashes($rule['subject']) . "&&" . $rule['action'] . "&&" .
$rule['action_arg'] . "&&" . $rule['flg'] . "&&" . addslashes($rule['field']) . "&&" . addslashes($rule['field_val']) . "&&" . $rule['size'];
if ($this->extensions['body'] && (!empty($rule['field_bodytransform']) || ($rule['ctype']!= '0' && !empty($rule['ctype'])))) $newscriptfoot .= "&&" . $rule['bodytransform'] . "&&" . $rule['field_bodytransform']. "&&" . $rule['ctype'] . "&&" . $rule['field_ctype_val'];
if ($connection->hasExtension('body') && (!empty($rule['field_bodytransform']) || ($rule['ctype']!= '0' && !empty($rule['ctype'])))) $newscriptfoot .= "&&" . $rule['bodytransform'] . "&&" . $rule['field_bodytransform']. "&&" . $rule['ctype'] . "&&" . $rule['field_ctype_val'];
$newscriptfoot .= "\n";
$pcount = $pcount+2;
//error_log(__CLASS__."::".__METHOD__.__LINE__.array2string($newscriptfoot));
@ -704,7 +730,7 @@ class Script
throw $e;
}
$this->errstr = 'updateScript: putscript failed: ' . $e->getMessage().($e->details?': '.$e->details:'');
if ($regexused && !$this->extensions['regex']) $this->errstr .= " REGEX is not an supported CAPABILITY";
if ($regexused && !$connection->hasExtension('regex')) $this->errstr .= " REGEX is not an supported CAPABILITY";
error_log(__METHOD__.__LINE__.' # Error: ->'.$this->errstr);
error_log(__METHOD__.__LINE__.' # ScriptName:'.$this->name.' Script:'.$newscript);
error_log(__METHOD__.__LINE__.' # Instance='.$GLOBALS['egw_info']['user']['domain'].', User='.$GLOBALS['egw_info']['user']['account_lid']);

View File

@ -1019,7 +1019,7 @@ class mail_sieve
$complete = lang('IF').' ';
if ($rule['unconditional'])
{
$complete = "[Unconditional] ";
$complete = '['.lang('Unconditional').'] ';
}
if ($rule['from'])
{
@ -1121,11 +1121,11 @@ class mail_sieve
}
if ($rule['continue'])
{
$complete .= " [Continue]";
$complete .= ' ['.lang('Continue').']';
}
if ($rule['keep'])
{
$complete .= " [Keep a copy]";
$complete .= ' ['.lang('Keep a copy').']';
}
return $complete;
}

View File

@ -115,6 +115,7 @@ connection status mail de Verbindungsstatus
contact label mail de Anzeige Kontakt
contains mail de beinhaltet
contains(*) mail de enthält(*)
continue mail de Fortsetzen
convert mail to item and attach its attachments to this item (standard) mail de Konvertiere E-Mail zum Eintrag und füge die E-Mail-Anhänge hinzu (Standard)
convert mail to item, attach its attachments and add raw message (message/rfc822 (.eml)) as attachment mail de Konvertiere E-Mail zum Eintrag und füge die Anhänge sowie die original E-Mail (als .eml) hinzu
convert only mail to item (ignore possible attachments) mail de Konvertiere nur den E-Mail-Text zum Eintrag (keine Anhänge und keine E-Mail als .eml)
@ -324,6 +325,7 @@ insert the signature at top of the new (or reply) message when opening compose d
job mail de Dienstlich
junk mail de Spam
junk folder mail de Ordner für Spam-Nachrichten
keep a copy mail de Eine Kopie behalten
keep a copy of the message in your inbox mail de Eine Kopie der Nachricht im Posteingang behalten
kilobytes mail de Kilobyte
later mail de Später
@ -650,6 +652,7 @@ trust the server when retrieving the folder status. if you select no, we will se
trying to recover from session data mail de Versuch der Wiederherstellung aus den gespeicherten Session-Daten
turn off horizontal line between signature and composed message (this is not according to rfc).<br>if you use templates, this option is only applied to the text part of the message. mail de Deaktivieren Sie die horizontale Trennlinie zwischen dem Text Ihrer E-Mail und der Signatur.
unable to fetch vacation! mail de Abwesenheitsnotiz konnte nicht gelesen werden!
unconditional mail de immer
undelete mail de Als gelöscht markiert entfernen
unflagged mail de Markierung entfernen
unread mail de ungelesen

View File

@ -115,6 +115,7 @@ connection status mail en Connection status
contact label mail en Contact label
contains mail en contains
contains(*) mail en contains(*)
continue mail en Continue
convert mail to item and attach its attachments to this item (standard) mail en Convert email to item and attach its attachments to this item (standard)
convert mail to item, attach its attachments and add raw message (message/rfc822 (.eml)) as attachment mail en Convert email to item, attach its attachments and add raw message (.eml) as attachment
convert only mail to item (ignore possible attachments) mail en Convert only email to item (ignore possible attachments)
@ -324,6 +325,7 @@ insert the signature at top of the new (or reply) message when opening compose d
job mail en Job
junk mail en Junk
junk folder mail en Junk folder
keep a copy mail en Keep a copy
keep a copy of the message in your inbox mail en Keep a copy of the message in your inbox
kilobytes mail en kilobytes
later mail en Later
@ -650,6 +652,7 @@ trust the server when retrieving the folder status. if you select no, we will se
trying to recover from session data mail en Trying to recover from session data
turn off horizontal line between signature and composed message (this is not according to rfc).<br>if you use templates, this option is only applied to the text part of the message. mail en Turn off horizontal line between signature and composed message.<br>If you use templates, this option is only applied to the text part of the message.
unable to fetch vacation! mail en Unable to fetch vacation!
unconditional mail en Unconditional
undelete mail en Undelete
unflagged mail en Unflagged
unread mail en unread

View File

@ -12,7 +12,7 @@
<et2-description value="Match:"></et2-description>
<et2-select id="anyof"></et2-select>
</row>
<row class="sieveRowActive">
<row>
<et2-description value="If from contains:(*)"></et2-description>
<et2-textbox id="from"></et2-textbox>
</row>

View File

@ -4319,8 +4319,9 @@ body.scrollVertical {
font-size: 120%;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select {
width: 50% !important;
width: auto;
margin-left: 10px;
margin-right: 10px;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select sl-menu-item::part(checked-icon) {
border-radius: 50%;
@ -7341,3 +7342,6 @@ div.flatpickr-calendar .shortcut-buttons-flatpickr-buttons button:last-child {
#egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_content .egw_fw_ui_category ul li {
border-radius: var(--sl-border-radius-medium);
}
select {
border-radius: var(--sl-border-radius-medium);
}

View File

@ -174,6 +174,7 @@ div.flatpickr-calendar .shortcut-buttons-flatpickr-buttons button:last-child {
right: 0px;
top: 2px
}
//end tabs header styling
//sidebox
@ -195,3 +196,9 @@ div.flatpickr-calendar .shortcut-buttons-flatpickr-buttons button:last-child {
border-radius: var(--sl-border-radius-medium);
}
}
//end sidebox
//not et2-select should also have rounded corners
select{
border-radius: var(--sl-border-radius-medium);
}

View File

@ -4322,8 +4322,9 @@ body.scrollVertical {
font-size: 120%;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select {
width: 50% !important;
width: auto;
margin-left: 10px;
margin-right: 10px;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select sl-menu-item::part(checked-icon) {
border-radius: 50%;

View File

@ -4301,8 +4301,9 @@ body.scrollVertical {
font-size: 120%;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select {
width: 50% !important;
width: auto;
margin-left: 10px;
margin-right: 10px;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select sl-menu-item::part(checked-icon) {
border-radius: 50%;

View File

@ -4312,7 +4312,7 @@ body.scrollVertical {
font-size: 120%;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select {
width: 50% !important;
width: 70% !important;
margin-left: 10px;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select sl-menu-item::part(checked-icon) {

View File

@ -108,8 +108,9 @@
font-size: 120%;
}
#rc_status_select {
width: 50% !important;
width: auto;
margin-left: 10px;
margin-right: 10px;
sl-menu-item::part(checked-icon) {
border-radius: 50%;
width: 12px;

View File

@ -4332,8 +4332,9 @@ body.scrollVertical {
font-size: 120%;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select {
width: 50% !important;
width: auto;
margin-left: 10px;
margin-right: 10px;
}
#egw_fw_header #egw_fw_topmenu #egw_fw_topmenu_items #rc_status_select sl-menu-item::part(checked-icon) {
border-radius: 50%;
@ -9138,6 +9139,7 @@ table.egwGridView_grid img.et2_appicon {
}
body .et2_toolbar .ui-toolbar-menulist {
width: 100%;
max-height: 90vh;
left: 0px;
overflow-y: auto !important;
box-shadow: 2px 3px 13px #666666;

View File

@ -1352,6 +1352,7 @@
.ui-toolbar-menulist
{
width: 100%;
max-height: 90vh;
left:0px;
overflow-y: auto !important;
box-shadow: 2px 3px 13px #666666;