From 90a69f92871b797299ed52f968c276bc29bc6c53 Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 9 Aug 2013 22:11:16 +0200 Subject: [PATCH] added text colour to customer settings --- util/db-mysql.sql | 3 ++- util/db-upgrade-0.1.23-vs-0.1.24.sql | 3 ++- webui/config.php | 3 ++- webui/language/de/messages.php | 2 ++ webui/language/en/messages.php | 2 ++ webui/language/hu/messages.iso-8859-2.php | 2 ++ webui/language/hu/messages.php | 2 ++ webui/language/pt/messages.php | 2 ++ webui/model/saas/customer.php | 12 +++++++----- webui/view/javascript/piler-in.js | 6 +++--- .../theme/default/templates/common/menu.tpl | 18 +++++++++--------- .../theme/default/templates/customer/list.tpl | 16 ++++++++++++---- .../theme/mobile/templates/common/menu.tpl | 18 +++++++++--------- .../theme/mobile/templates/customer/list.tpl | 16 ++++++++++++---- 14 files changed, 68 insertions(+), 37 deletions(-) diff --git a/util/db-mysql.sql b/util/db-mysql.sql index 4eb806f2..fa34e9cd 100644 --- a/util/db-mysql.sql +++ b/util/db-mysql.sql @@ -371,7 +371,8 @@ create table if not exists `customer_settings` ( `branding_url` varchar(255) default null, `branding_logo` varchar(255) default null, `support_link` varchar(255) default null, - `colour` varchar(255) default null + `background_colour` varchar(255) default null, + `text_colour` varchar(255) default null ) Engine=InnoDB; 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 62bd33d6..87e28a0d 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 @@ -33,7 +33,8 @@ create table if not exists `customer_settings` ( `branding_url` varchar(255) default null, `branding_logo` varchar(255) default null, `support_link` varchar(255) default null, - `colour` varchar(255) default null + `background_colour` varchar(255) default null, + `text_colour` varchar(255) default null ) Engine=InnoDB; create table if not exists `online` ( diff --git a/webui/config.php b/webui/config.php index ca3de2be..0ba7d800 100644 --- a/webui/config.php +++ b/webui/config.php @@ -17,7 +17,8 @@ $config['PILERGETD_PASSWORD'] = ''; $config['BRANDING_TEXT'] = ''; $config['BRANDING_URL'] = ''; $config['BRANDING_LOGO'] = ''; -$config['BRANDING_COLOUR'] = ''; +$config['BRANDING_BACKGROUND_COLOUR'] = ''; +$config['BRANDING_TEXT_COLOUR'] = ''; $config['BRANDING_FAVICON'] = ''; $config['SUPPORT_LINK'] = ''; diff --git a/webui/language/de/messages.php b/webui/language/de/messages.php index 9fdf3a4d..0125260d 100644 --- a/webui/language/de/messages.php +++ b/webui/language/de/messages.php @@ -29,6 +29,7 @@ $_['text_attachment_type'] = "Typ Anhang"; $_['text_audit'] = "Revision"; $_['text_back'] = "ZurĂĽck"; +$_['text_background_colour'] = "Background colour"; $_['text_body'] = "Nachricht"; $_['text_branding_logo'] = "Branding logo"; $_['text_branding_text'] = "Branding text"; @@ -325,6 +326,7 @@ $_['text_tagged'] = "Kategorisiert"; $_['text_tags'] = "Kategorie(n)"; $_['text_test_connection'] = "Test connection"; $_['text_text'] = "Text"; +$_['text_text_colour'] = "Text colour"; $_['text_text2'] = "Nachricht"; $_['text_theme'] = "Thema"; $_['text_time'] = "Zeit"; diff --git a/webui/language/en/messages.php b/webui/language/en/messages.php index e148c054..70b06620 100644 --- a/webui/language/en/messages.php +++ b/webui/language/en/messages.php @@ -29,6 +29,7 @@ $_['text_attachment_type'] = "Attachment type"; $_['text_audit'] = "Audit"; $_['text_back'] = "Back"; +$_['text_background_colour'] = "Background colour"; $_['text_body'] = "Body"; $_['text_branding_logo'] = "Branding logo"; $_['text_branding_text'] = "Branding text"; @@ -325,6 +326,7 @@ $_['text_tagged'] = "Tagged"; $_['text_tags'] = "Tags"; $_['text_test_connection'] = "Test connection"; $_['text_text'] = "Text"; +$_['text_text_colour'] = "Text colour"; $_['text_text2'] = "text"; $_['text_theme'] = "Theme"; $_['text_time'] = "Time"; diff --git a/webui/language/hu/messages.iso-8859-2.php b/webui/language/hu/messages.iso-8859-2.php index bef73081..4e34f41c 100644 --- a/webui/language/hu/messages.iso-8859-2.php +++ b/webui/language/hu/messages.iso-8859-2.php @@ -29,6 +29,7 @@ $_['text_attachment_type'] = "Mell $_['text_audit'] = "Audit"; $_['text_back'] = "Vissza"; +$_['text_background_colour'] = "Háttérszín"; $_['text_branding_logo'] = "Brand logo"; $_['text_branding_text'] = "Brand szöveg"; $_['text_branding_url'] = "Brand URL"; @@ -325,6 +326,7 @@ $_['text_tagged'] = "C $_['text_tags'] = "Címkék"; $_['text_test_connection'] = "Kapcsolat tesztelése"; $_['text_text'] = "Szöveg"; +$_['text_text_colour'] = "Szövegszín"; $_['text_text2'] = "szöveg"; $_['text_theme'] = "Stílus"; $_['text_time'] = "Időpont"; diff --git a/webui/language/hu/messages.php b/webui/language/hu/messages.php index 0630ff2c..7e2dc584 100644 --- a/webui/language/hu/messages.php +++ b/webui/language/hu/messages.php @@ -29,6 +29,7 @@ $_['text_attachment_type'] = "MellĂ©klet tĂ­pus"; $_['text_audit'] = "Audit"; $_['text_back'] = "Vissza"; +$_['text_background_colour'] = "HáttĂ©rszĂ­n"; $_['text_branding_logo'] = "Brand logo"; $_['text_branding_text'] = "Brand szöveg"; $_['text_branding_url'] = "Brand URL"; @@ -325,6 +326,7 @@ $_['text_tagged'] = "CĂ­mkĂ©zve"; $_['text_tags'] = "CĂ­mkĂ©k"; $_['text_test_connection'] = "Kapcsolat tesztelĂ©se"; $_['text_text'] = "Szöveg"; +$_['text_text_colour'] = "SzövegszĂ­n"; $_['text_text2'] = "szöveg"; $_['text_theme'] = "StĂ­lus"; $_['text_time'] = "IdĹ‘pont"; diff --git a/webui/language/pt/messages.php b/webui/language/pt/messages.php index edec66f1..9815a2d9 100644 --- a/webui/language/pt/messages.php +++ b/webui/language/pt/messages.php @@ -28,6 +28,7 @@ $_['text_attachment_type'] = "Tipo de anexo"; $_['text_audit'] = "Auditoria"; $_['text_back'] = "Voltar"; +$_['text_background_colour'] = "Background colour"; $_['text_branding_logo'] = "Branding logo"; $_['text_branding_text'] = "Branding text"; $_['text_branding_url'] = "Branding URL"; @@ -318,6 +319,7 @@ $_['text_tag_selected_messages'] = "Marcar(Tag) resultados de pesquisa"; $_['text_tagged'] = "Marcados"; $_['text_tags'] = "Tags"; $_['text_text'] = "Texto"; +$_['text_text_colour'] = "Text colour"; $_['text_text2'] = "texto"; $_['text_theme'] = "Tema"; $_['text_time'] = "Hora"; diff --git a/webui/model/saas/customer.php b/webui/model/saas/customer.php index 8a84d1c0..dd09a245 100644 --- a/webui/model/saas/customer.php +++ b/webui/model/saas/customer.php @@ -41,7 +41,7 @@ class ModelSaasCustomer extends Model move_uploaded_file($_FILES['branding_logo']['tmp_name'], DIR_BASE . "/images/" . $_FILES['branding_logo']['name']); } - $query = $this->db->query("INSERT INTO " . TABLE_CUSTOMER_SETTINGS . " (domain, branding_text, branding_url, branding_logo, support_link, colour) VALUES (?,?,?,?,?,?)", array($arr['domain'], $arr['branding_text'], $arr['branding_url'], $branding_logo, $arr['support_link'], $arr['colour'])); + $query = $this->db->query("INSERT INTO " . TABLE_CUSTOMER_SETTINGS . " (domain, branding_text, branding_url, branding_logo, support_link, background_colour, text_colour) VALUES (?,?,?,?,?,?,?)", array($arr['domain'], $arr['branding_text'], $arr['branding_url'], $branding_logo, $arr['support_link'], $arr['background_colour'], $arr['text_colour'])); $rc = $this->db->countAffected(); @@ -62,10 +62,10 @@ class ModelSaasCustomer extends Model $branding_logo = $_FILES['branding_logo']['name']; move_uploaded_file($_FILES['branding_logo']['tmp_name'], DIR_BASE . "/images/" . $_FILES['branding_logo']['name']); - $query = $this->db->query("UPDATE " . TABLE_CUSTOMER_SETTINGS . " SET domain=?, branding_text=?, branding_url=?, branding_logo=?, support_link=?, colour=? WHERE id=?", array($arr['domain'], $arr['branding_text'], $arr['branding_url'], $branding_logo, $arr['support_link'], $arr['colour'], $arr['id'])); + $query = $this->db->query("UPDATE " . TABLE_CUSTOMER_SETTINGS . " SET domain=?, branding_text=?, branding_url=?, branding_logo=?, support_link=?, background_colour=?, text_colour=? WHERE id=?", array($arr['domain'], $arr['branding_text'], $arr['branding_url'], $branding_logo, $arr['support_link'], $arr['background_colour'], $arr['text_colour'], $arr['id'])); } else { - $query = $this->db->query("UPDATE " . TABLE_CUSTOMER_SETTINGS . " SET domain=?, branding_text=?, branding_url=?, support_link=?, colour=? WHERE id=?", array($arr['domain'], $arr['branding_text'], $arr['branding_url'], $arr['support_link'], $arr['colour'], $arr['id'])); + $query = $this->db->query("UPDATE " . TABLE_CUSTOMER_SETTINGS . " SET domain=?, branding_text=?, branding_url=?, support_link=?, background_colour=?, text_colour=? WHERE id=?", array($arr['domain'], $arr['branding_text'], $arr['branding_url'], $arr['support_link'], $arr['background_colour'], $arr['text_colour'], $arr['id'])); } @@ -79,7 +79,8 @@ class ModelSaasCustomer extends Model 'branding_url' => BRANDING_URL, 'branding_logo' => BRANDING_LOGO, 'support_link' => SUPPORT_LINK, - 'colour' => BRANDING_COLOUR + 'background_colour' => BRANDING_BACKGROUND_COLOUR, + 'text_colour' => BRANDING_TEXT_COLOUR ); @@ -101,7 +102,8 @@ class ModelSaasCustomer extends Model if($query->row['branding_url']) { $data['branding_url'] = $query->row['branding_url']; } if($query->row['branding_logo']) { $data['branding_logo'] = $query->row['branding_logo']; } if($query->row['support_link']) { $data['support_link'] = $query->row['support_link']; } - if($query->row['colour']) { $data['colour'] = $query->row['colour']; } + if($query->row['background_colour']) { $data['background_colour'] = $query->row['background_colour']; } + if($query->row['text_colour']) { $data['text_colour'] = $query->row['text_colour']; } } if(MEMCACHED_ENABLED && $cache_key) { diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index f26d7a6a..e6e3b8f6 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -993,10 +993,10 @@ var Piler = }, - change_box_colour: function() + change_box_colour: function(srcid, dstid) { - var colour = $('#colour').val(); - $('#cp').css('background', colour); + var colour = $('#' + srcid).val(); + $('#' + dstid).css('background', colour); } diff --git a/webui/view/theme/default/templates/common/menu.tpl b/webui/view/theme/default/templates/common/menu.tpl index e81232be..1c752cdc 100644 --- a/webui/view/theme/default/templates/common/menu.tpl +++ b/webui/view/theme/default/templates/common/menu.tpl @@ -2,7 +2,7 @@