From 62fe7203e641696566af66d8ea447482a0398426 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 21 Sep 2013 05:40:25 -0400
Subject: [PATCH] Hide Delivery Status Notification option when smtp_server is unset (#1489336)

---
 CHANGELOG                            |    1 +
 skins/classic/templates/compose.html |   15 +++++++++++----
 config/main.inc.php.dist             |    1 +
 skins/larry/templates/compose.html   |    2 ++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index f70dcf6..b003bae 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Hide Delivery Status Notification option when smtp_server is unset (#1489336)
 - Display full attachment name using title attribute when name is too long to display (#1489320)
 - Fix attachment icon issue when rare font/language is used (#1489326)
 - Fix expanded thread root message styling after refreshing messages list (#1489327)
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index 0b81529..bb29654 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -872,6 +872,7 @@
 $rcmail_config['mdn_default'] = 0;
 
 // Delivery Status Notification checkbox default state
+// Note: This can be used only if smtp_server is non-empty
 $rcmail_config['dsn_default'] = 0;
 
 // Place replies in the folder of the message being replied to
diff --git a/skins/classic/templates/compose.html b/skins/classic/templates/compose.html
index 5b0b479..b6dab2c 100644
--- a/skins/classic/templates/compose.html
+++ b/skins/classic/templates/compose.html
@@ -178,16 +178,23 @@
     <tr>
         <td><label for="rcmcomposereceipt"><roundcube:label name="returnreceipt" />:</label></td>
         <td><roundcube:object name="receiptCheckBox" form="form" id="rcmcomposereceipt" /></td>
-    </tr><tr>
+    </tr>
+    <roundcube:if condition="config:smtp_server != ''" />
+    <tr>
         <td><label for="rcmcomposedsn"><roundcube:label name="dsn" />:</label></td>
         <td><roundcube:object name="dsnCheckBox" form="form" id="rcmcomposedsn" /></td>
-    </tr><tr>
+    </tr>
+    <roundcube:endif />
+    <tr>
         <td><label for="rcmcomposepriority"><roundcube:label name="priority" />:</label></td>
         <td><roundcube:object name="prioritySelector" form="form" id="rcmcomposepriority" /></td>
-    </tr><roundcube:if condition="!config:no_save_sent_messages" /><tr>
+    </tr>
+    <roundcube:if condition="!config:no_save_sent_messages" />
+    <tr>
         <td><label><roundcube:label name="savesentmessagein" />:</label></td>
         <td><roundcube:object name="storetarget" maxlength="30" /></td>
-    </tr><roundcube:endif />
+    </tr>
+    <roundcube:endif />
     </table>
 </div>
 
diff --git a/skins/larry/templates/compose.html b/skins/larry/templates/compose.html
index 9cfe7fe..1e2a459 100644
--- a/skins/larry/templates/compose.html
+++ b/skins/larry/templates/compose.html
@@ -140,9 +140,11 @@
 	<span class="composeoption">
 		<label><roundcube:object name="receiptCheckBox" form="form" id="rcmcomposereceipt" /> <roundcube:label name="returnreceipt" /></label>
 	</span>
+	<roundcube:if condition="config:smtp_server != ''" />
 	<span class="composeoption">
 		<label><roundcube:object name="dsnCheckBox" form="form" id="rcmcomposedsn" /> <roundcube:label name="dsn" /></label>
 	</span>
+	<roundcube:endif />
 	<roundcube:if condition="!config:no_save_sent_messages" />
 	<span class="composeoption">
 		<label><roundcube:label name="savesentmessagein" /> <roundcube:object name="storetarget" maxlength="30" style="max-width:12em" /></label>

--
Gitblit v1.9.1