fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [16948] booking: preserve linebreaks


From: sigurdne
Subject: [Fmsystem-commits] [16948] booking: preserve linebreaks
Date: Wed, 2 Aug 2017 09:00:34 -0400 (EDT)

Revision: 16948
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16948
Author:   sigurdne
Date:     2017-08-02 09:00:33 -0400 (Wed, 02 Aug 2017)
Log Message:
-----------
booking: preserve linebreaks

Modified Paths:
--------------
    trunk/booking/inc/class.boapplication.inc.php
    trunk/booking/inc/class.socommon.inc.php
    trunk/booking/inc/class.uiapplication.inc.php
    trunk/booking/templates/base/application.xsl
    trunk/bookingfrontend/inc/class.uiapplication.inc.php
    trunk/bookingfrontend/templates/base/application.xsl

Modified: trunk/booking/inc/class.boapplication.inc.php
===================================================================
--- trunk/booking/inc/class.boapplication.inc.php       2017-08-02 12:04:25 UTC 
(rev 16947)
+++ trunk/booking/inc/class.boapplication.inc.php       2017-08-02 13:00:33 UTC 
(rev 16948)
@@ -37,7 +37,7 @@
                                $body = "<p>Din søknad i " . 
$config->config_data['application_mail_systemname'] . " om leie/lån er " . 
lang($application['status']) . '</p>';
                                if ($application['comment'] != '')
                                {
-                                       $body .= '<p>Kommentar fra 
saksbehandler:<br />' . $application['comment'] . '</p>';
+                                       $body .= '<p>Kommentar fra 
saksbehandler:<br />' . nl2br($application['comment']) . '</p>';
                                }
                                $body .= "<pre>" . 
$config->config_data['application_mail_pending'] . "</pre>";
                                $body .= '<p><a href="' . $link . '">Link til ' 
. $config->config_data['application_mail_systemname'] . ': søknad #' . 
$application['id'] . '</a></p>';
@@ -80,7 +80,7 @@
                                $body = "<p>Din søknad i " . 
$config->config_data['application_mail_systemname'] . " om leie/lån er " . 
lang($application['status']) . '</p>';
                                if ($application['comment'] != '')
                                {
-                                       $body .= "<p>Kommentar fra 
saksbehandler:<br />" . $application['comment'] . "</p>";
+                                       $body .= "<p>Kommentar fra 
saksbehandler:<br />" . nl2br($application['comment']) . "</p>";
                                }
                                $body .= '<pre>' . 
$config->config_data['application_mail_accepted'] . '<br /><a href="' . $link . 
'">Link til ' . $config->config_data['application_mail_systemname'] . ': søknad 
#' . $application['id'] . '</a></pre>';
                                if ($adates)
@@ -128,7 +128,7 @@
                                $body = "<p>Din søknad i " . 
$config->config_data['application_mail_systemname'] . " om leie/lån er " . 
lang($application['status']) . '</p>';
                                if ($application['comment'] != '')
                                {
-                                       $body .= '<p>Kommentar fra 
saksbehandler:<br />' . $application['comment'] . '</p>';
+                                       $body .= '<p>Kommentar fra 
saksbehandler:<br />' . nl2br($application['comment']) . '</p>';
                                }
                                $body .= '<pre>' . 
$config->config_data['application_mail_rejected'] . ' <a href="' . $link . 
'">Link til ' . $config->config_data['application_mail_systemname'] . ': søknad 
#' . $application['id'] . '</a></pre>';
                        }
@@ -136,7 +136,7 @@
                        {
                                $subject = 
$config->config_data['application_comment_mail_subject'];
                                $body = "<pre><p>" . 
$config->config_data['application_comment_added_mail'] . "</p>";
-                               $body .= '<p>Kommentar fra saksbehandler:<br 
/>' . $application['comment'] . '</p></pre>';
+                               $body .= '<p>Kommentar fra saksbehandler:<br 
/>' . nl2br($application['comment']) . '</p></pre>';
                                $body .= '<p><a href="' . $link . '">Link til ' 
. $config->config_data['application_mail_systemname'] . ': søknad #' . 
$application['id'] . '</a></p>';
                        }
                        $body .= "<p>" . 
$config->config_data['application_mail_signature'] . "</p>";

Modified: trunk/booking/inc/class.socommon.inc.php
===================================================================
--- trunk/booking/inc/class.socommon.inc.php    2017-08-02 12:04:25 UTC (rev 
16947)
+++ trunk/booking/inc/class.socommon.inc.php    2017-08-02 13:00:33 UTC (rev 
16948)
@@ -294,7 +294,7 @@
                        }
                        else if ($type == 'string')
                        {
-                               return 
htmlspecialchars_decode(stripslashes(str_replace(array('&#40&#59;', 
'&#41&#59;'), array('(', ')'), $value)),ENT_QUOTES);
+                               return 
html_entity_decode(stripslashes(str_replace(array('&#40&#59;', '&#41&#59;'), 
array('(', ')'), $value)),ENT_QUOTES);
                        }
 
                        //Sanity check

Modified: trunk/booking/inc/class.uiapplication.inc.php
===================================================================
--- trunk/booking/inc/class.uiapplication.inc.php       2017-08-02 12:04:25 UTC 
(rev 16947)
+++ trunk/booking/inc/class.uiapplication.inc.php       2017-08-02 13:00:33 UTC 
(rev 16948)
@@ -1196,6 +1196,15 @@
 
                        $application['description'] = 
html_entity_decode(nl2br($application['description']));
                        $application['equipment'] = 
html_entity_decode(nl2br($application['equipment']));
+
+                       if(!empty($application['comments']))
+                       {
+                               foreach ($application['comments'] as  
&$comments)
+                               {
+                                       $comments['comment'] = 
html_entity_decode(nl2br($comments['comment']));
+                               }
+                       }
+
                        self::render_template_xsl('application', 
array('application' => $application,
                                'audience' => $audience, 'agegroups' => 
$agegroups,
                                'num_associations' => $num_associations, 
'assoc' => $from, 'collision' => $collision_dates,

Modified: trunk/booking/templates/base/application.xsl
===================================================================
--- trunk/booking/templates/base/application.xsl        2017-08-02 12:04:25 UTC 
(rev 16947)
+++ trunk/booking/templates/base/application.xsl        2017-08-02 13:00:33 UTC 
(rev 16948)
@@ -140,7 +140,9 @@
                                                                                
</xsl:when>
                                                                                
<xsl:otherwise>
                                                                                
        <span>
-                                                                               
                <xsl:value-of select="comment"/>
+                                                                               
                <!--xsl:value-of select="comment"/-->
+                                                                               
                <xsl:value-of select="comment" disable-output-escaping="yes"/>
+
                                                                                
        </span>
                                                                                
</xsl:otherwise>
                                                                        
</xsl:choose>

Modified: trunk/bookingfrontend/inc/class.uiapplication.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.uiapplication.inc.php       2017-08-02 
12:04:25 UTC (rev 16947)
+++ trunk/bookingfrontend/inc/class.uiapplication.inc.php       2017-08-02 
13:00:33 UTC (rev 16948)
@@ -125,6 +125,14 @@
                        $application['description'] = 
html_entity_decode(nl2br($application['description']));
                        $application['equipment'] = 
html_entity_decode(nl2br($application['equipment']));
 
+                       if(!empty($application['comments']))
+                       {
+                               foreach ($application['comments'] as  
&$comments)
+                               {
+                                       $comments['comment'] = 
html_entity_decode(nl2br($comments['comment']));
+                               }
+                       }
+
                        $agegroups = 
$this->agegroup_bo->fetch_age_groups($top_level_activity);
                        $agegroups = $agegroups['results'];
                        $audience = 
$this->audience_bo->fetch_target_audience($top_level_activity);

Modified: trunk/bookingfrontend/templates/base/application.xsl
===================================================================
--- trunk/bookingfrontend/templates/base/application.xsl        2017-08-02 
12:04:25 UTC (rev 16947)
+++ trunk/bookingfrontend/templates/base/application.xsl        2017-08-02 
13:00:33 UTC (rev 16948)
@@ -139,7 +139,7 @@
                                                        <xsl:otherwise>
                                                                <dd>
                                                                        <div 
style="width: 80%;">
-                                                                               
<xsl:value-of select="comment"/>
+                                                                               
<xsl:value-of select="comment" disable-output-escaping="yes"/>
                                                                        </div>
                                                                </dd>
                                                        </xsl:otherwise>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]