From e5b1a19b681d467890654ca9557c3fadc8812f6a Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 6 Aug 2013 06:36:56 +0200 Subject: [PATCH] theme fixes --- util/db-upgrade-0.1.23-vs-0.1.24.sql | 2 + webui/config.php | 1 + webui/model/audit/audit.php | 2 +- webui/model/policy/retention.php | 2 +- webui/view/javascript/piler-in.js | 29 +++++++++++- .../default/templates/common/layout-audit.tpl | 2 +- .../default/templates/common/layout-email.tpl | 2 +- .../templates/common/layout-search.tpl | 2 +- .../theme/default/templates/common/layout.tpl | 2 +- .../theme/default/templates/login/login.tpl | 2 +- .../theme/default/templates/search/popup.tpl | 17 ++----- .../theme/mobile/stylesheet/style-mobile.css | 8 +++- .../mobile/templates/common/layout-audit.tpl | 2 + .../mobile/templates/common/layout-email.tpl | 2 + .../mobile/templates/common/layout-search.tpl | 2 + .../theme/mobile/templates/common/layout.tpl | 2 + .../theme/mobile/templates/login/login.tpl | 46 +++++++++---------- .../theme/mobile/templates/search/popup.tpl | 10 ++-- 18 files changed, 85 insertions(+), 50 deletions(-) diff --git a/util/db-upgrade-0.1.23-vs-0.1.24.sql b/util/db-upgrade-0.1.23-vs-0.1.24.sql index dcd0d058..62bd33d6 100644 --- a/util/db-upgrade-0.1.23-vs-0.1.24.sql +++ b/util/db-upgrade-0.1.23-vs-0.1.24.sql @@ -13,6 +13,8 @@ create unique index `entry` on retention_rule (`domain`,`from`,`to`,`subject`,`_ drop view if exists `v_messages`; create view `v_messages` AS select `metadata`.`id` AS `id`,`metadata`.`piler_id` AS `piler_id`,`metadata`.`from` AS `from`,`metadata`.`fromdomain` AS `fromdomain`,`rcpt`.`to` AS `to`,`rcpt`.`todomain` AS `todomain`,`metadata`.`subject` AS `subject`, `metadata`.`size` AS `size`, `metadata`.`direction` AS `direction`, `metadata`.`sent` AS `sent`, `metadata`.`retained` AS `retained`, `metadata`.`arrived` AS `arrived`, `metadata`.`digest` AS `digest`, `metadata`.`bodydigest` AS `bodydigest` from (`metadata` join `rcpt`) where (`metadata`.`id` = `rcpt`.`id`); +update user_settings set theme='mobile' where theme='orig'; + create table if not exists `ldap` ( `id` int not null auto_increment primary key, `description` varchar(255) not null, diff --git a/webui/config.php b/webui/config.php index 7fbf14be..854bf550 100644 --- a/webui/config.php +++ b/webui/config.php @@ -17,6 +17,7 @@ $config['PILERGETD_PASSWORD'] = ''; $config['BRANDING_TEXT'] = ''; $config['BRANDING_URL'] = ''; $config['BRANDING_LOGO'] = ''; +$config['BRANDING_FAVICON'] = ''; $config['SUPPORT_LINK'] = ''; $config['BOOTSTRAP_THEME'] = '-cosmo'; diff --git a/webui/model/audit/audit.php b/webui/model/audit/audit.php index 9a913f1a..32ce7073 100644 --- a/webui/model/audit/audit.php +++ b/webui/model/audit/audit.php @@ -39,7 +39,7 @@ class ModelAuditAudit extends Model { $where .= " AND ( " . $this->append_search_criteria("meta_id", $data['ref'], $arr) . " )"; } - if(Registry::get('admin_user') == 0) { + if(Registry::get('admin_user') == 0 && RESTRICTED_AUDITOR == 1) { while(list($k, $v) = each($_SESSION['auditdomains'])) { if($q) { $q .= ","; } $q .= "?"; diff --git a/webui/model/policy/retention.php b/webui/model/policy/retention.php index 330e062c..903eaa73 100644 --- a/webui/model/policy/retention.php +++ b/webui/model/policy/retention.php @@ -47,7 +47,7 @@ class ModelPolicyRetention extends Model { $default_retention = DEFAULT_RETENTION * 86400; $delta = NOW + 86400 * $data['days'] - $default_retention; - $start_ts = NOW - $default_retention; + $start_ts = NOW - 2*$default_retention; $query = $this->db->query("UPDATE " . VIEW_MESSAGES . " SET retained=? WHERE arrived > ? AND (todomain=? OR fromdomain=?)", array($delta, $start_ts, $data['domain'], $data['domain'])); diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index 15057b8e..f26d7a6a 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -633,7 +633,11 @@ var Piler = $('input#xbody').val(''); $('input#xtag').val(''); $('input#xnote').val(''); - $('input#xhas_attachment')[0].checked = 0; + $('input#xhas_attachment_doc')[0].checked = 0; + $('input#xhas_attachment_xls')[0].checked = 0; + $('input#xhas_attachment_pdf')[0].checked = 0; + $('input#xhas_attachment_image')[0].checked = 0; + $('input#xhas_attachment_any')[0].checked = 0; $('input#date1').val(''); $('input#date2').val(''); @@ -641,6 +645,29 @@ var Piler = }, + /* + * when clicked on the "any" attachment type, clear the other types + */ + + clear_attachment_others: function() + { + $('input#xhas_attachment_doc')[0].checked = 0; + $('input#xhas_attachment_xls')[0].checked = 0; + $('input#xhas_attachment_pdf')[0].checked = 0; + $('input#xhas_attachment_image')[0].checked = 0; + }, + + + /* + * when clicked on any of the named attachment types, clear the "any" type + */ + + clear_attachment_any: function() + { + $('input#xhas_attachment_any')[0].checked = 0; + }, + + /* * show a temporary message to the user */ diff --git a/webui/view/theme/default/templates/common/layout-audit.tpl b/webui/view/theme/default/templates/common/layout-audit.tpl index 469a5b77..e92cd9f9 100644 --- a/webui/view/theme/default/templates/common/layout-audit.tpl +++ b/webui/view/theme/default/templates/common/layout-audit.tpl @@ -30,7 +30,7 @@ - + diff --git a/webui/view/theme/default/templates/common/layout-email.tpl b/webui/view/theme/default/templates/common/layout-email.tpl index d11f4a67..9ca2694b 100644 --- a/webui/view/theme/default/templates/common/layout-email.tpl +++ b/webui/view/theme/default/templates/common/layout-email.tpl @@ -24,7 +24,7 @@ - + diff --git a/webui/view/theme/default/templates/common/layout.tpl b/webui/view/theme/default/templates/common/layout.tpl index f0e6c7ae..1138fec5 100644 --- a/webui/view/theme/default/templates/common/layout.tpl +++ b/webui/view/theme/default/templates/common/layout.tpl @@ -29,7 +29,7 @@ - + - + diff --git a/webui/view/theme/default/templates/search/popup.tpl b/webui/view/theme/default/templates/search/popup.tpl index f26df8af..1bb14ea9 100644 --- a/webui/view/theme/default/templates/search/popup.tpl +++ b/webui/view/theme/default/templates/search/popup.tpl @@ -55,18 +55,11 @@
- checked="checked" /> -
-
- -
- -
- Word checked="checked" /> - Excel checked="checked" /> - PDF checked="checked" /> - image checked="checked" /> - any checked="checked" /> + Word checked="checked" onclick="Piler.clear_attachment_any();" /> + Excel checked="checked" onclick="Piler.clear_attachment_any();" /> + PDF checked="checked" onclick="Piler.clear_attachment_any();" /> + image checked="checked" onclick="Piler.clear_attachment_any();" /> + any checked="checked" onclick="Piler.clear_attachment_others();" />
diff --git a/webui/view/theme/mobile/stylesheet/style-mobile.css b/webui/view/theme/mobile/stylesheet/style-mobile.css index 2ecbdaa2..2438341b 100644 --- a/webui/view/theme/mobile/stylesheet/style-mobile.css +++ b/webui/view/theme/mobile/stylesheet/style-mobile.css @@ -7,6 +7,13 @@ .mybody { background-color: #6D6D6D; color: #3d3d3d; } + .loginpage {background-color: #fcfcfc; padding-top: 40px; padding-bottom: 40px;} + #logo-lg {width: 300px; margin: 0 auto 20px;} + #compatibility { max-width: 300px; margin:0 auto; color:#444; text-align: justify; } + .form-signin{ max-width:300px; padding:19px 29px 29px; margin:0 auto 20px; background-color:#fff; border:1px solid #e5e5e5; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; -webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); box-shadow:0 1px 2px rgba(0, 0, 0, 0.05); } + .form-signin .form-signin-heading,.form-signin .checkbox{ margin-bottom: 10px; } + .form-signin input[type="text"], .form-signin input[type="password"]{ font-size:16px; height:auto; margin-bottom:15px; padding:7px 9px; } + #piler1 { width: 100%; height: 100%; background: #ffffff; border: 0px solid black; position: absolute; margin-left: auto; margin-right: auto; padding-top: 0px; } #messagebox1 { position: absolute; top: 0px; left: 50%; border: 3px solid red; display: none; background: orange; color: #000000; font-weight: bold; padding: 15px; z-index: 1; } @@ -160,7 +167,6 @@ .message_highlight { background: lightblue; } - } diff --git a/webui/view/theme/mobile/templates/common/layout-audit.tpl b/webui/view/theme/mobile/templates/common/layout-audit.tpl index 2f91280f..8c3640c1 100644 --- a/webui/view/theme/mobile/templates/common/layout-audit.tpl +++ b/webui/view/theme/mobile/templates/common/layout-audit.tpl @@ -24,6 +24,8 @@ + + diff --git a/webui/view/theme/mobile/templates/common/layout-email.tpl b/webui/view/theme/mobile/templates/common/layout-email.tpl index fcf95f92..d12bf9cd 100644 --- a/webui/view/theme/mobile/templates/common/layout-email.tpl +++ b/webui/view/theme/mobile/templates/common/layout-email.tpl @@ -27,6 +27,8 @@ + + diff --git a/webui/view/theme/mobile/templates/common/layout-search.tpl b/webui/view/theme/mobile/templates/common/layout-search.tpl index 128d3946..55c64e7d 100644 --- a/webui/view/theme/mobile/templates/common/layout-search.tpl +++ b/webui/view/theme/mobile/templates/common/layout-search.tpl @@ -24,6 +24,8 @@ + + diff --git a/webui/view/theme/mobile/templates/common/layout.tpl b/webui/view/theme/mobile/templates/common/layout.tpl index 3a6fb8d7..fae1b072 100644 --- a/webui/view/theme/mobile/templates/common/layout.tpl +++ b/webui/view/theme/mobile/templates/common/layout.tpl @@ -25,6 +25,8 @@ + + - + @@ -24,42 +24,40 @@ + - - -
- - + + - - -
- + + diff --git a/webui/view/theme/mobile/templates/search/popup.tpl b/webui/view/theme/mobile/templates/search/popup.tpl index cdc32f2f..49e2311b 100644 --- a/webui/view/theme/mobile/templates/search/popup.tpl +++ b/webui/view/theme/mobile/templates/search/popup.tpl @@ -48,11 +48,11 @@
:
- Word checked="checked" /> - Excel checked="checked" /> - PDF checked="checked" /> - image checked="checked" /> - any checked="checked" /> + Word checked="checked" onclick="Piler.clear_attachment_any();" /> + Excel checked="checked" onclick="Piler.clear_attachment_any();" /> + PDF checked="checked" onclick="Piler.clear_attachment_any();" /> + image checked="checked" onclick="Piler.clear_attachment_any();" /> + any checked="checked" onclick="Piler.clear_attachment_others();" />