fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15297] booking: date and file handling


From: sigurdne
Subject: [Fmsystem-commits] [15297] booking: date and file handling
Date: Thu, 16 Jun 2016 12:51:43 +0000 (UTC)

Revision: 15297
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15297
Author:   sigurdne
Date:     2016-06-16 12:51:43 +0000 (Thu, 16 Jun 2016)
Log Message:
-----------
booking: date and file handling

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

Modified: trunk/booking/inc/class.uiapplication.inc.php
===================================================================
--- trunk/booking/inc/class.uiapplication.inc.php       2016-06-16 10:30:24 UTC 
(rev 15296)
+++ trunk/booking/inc/class.uiapplication.inc.php       2016-06-16 12:51:43 UTC 
(rev 15297)
@@ -43,7 +43,9 @@
                        $this->resource_bo = CreateObject('booking.boresource');
                        $this->building_bo = CreateObject('booking.bobuilding');
                        $this->organization_bo = 
CreateObject('booking.boorganization');
-                       $this->document_bo = 
CreateObject('booking.bodocument_building');
+                       $this->document_building = 
CreateObject('booking.bodocument_building');
+                       $this->document_resource = 
CreateObject('booking.bodocument_resource');
+
                        self::set_active_menu('booking::applications');
                        $this->fields = array('description', 'equipment', 
'resources', 'activity_id',
                                'building_id', 'building_name', 'contact_name',
@@ -550,8 +552,19 @@
                        $comment_text = lang('The user has accepted the 
following documents') . ': ';
                        foreach ($application['accepted_documents'] as $doc)
                        {
-                               $doc_id = substr($doc, strrpos($doc, ':') + 1); 
// finding the document_building.id
-                               $document = 
$this->document_bo->read_single($doc_id);
+                               $doc_info = explode('::', $doc);
+                               $doc_type = $doc_info[0];
+                               $doc_id = $doc_info[1];
+                               switch ($doc_type)
+                               {
+                                       default:
+                                       case 'building':
+                                               $document = 
$this->document_building->read_single($doc_id);
+                                               break;
+                                       case 'resource':
+                                               $document = 
$this->document_resource->read_single($doc_id);
+                                               break;
+                               }
                                $comment_text .= $document['description'] . ' 
(' . $document['name'] . '), ';
                        }
                        $comment_text = substr($comment_text, 0, -2);

Modified: trunk/booking/inc/class.uievent.inc.php
===================================================================
--- trunk/booking/inc/class.uievent.inc.php     2016-06-16 10:30:24 UTC (rev 
15296)
+++ trunk/booking/inc/class.uievent.inc.php     2016-06-16 12:51:43 UTC (rev 
15297)
@@ -369,11 +369,11 @@
 
                                foreach ($_POST['from_'] as &$from)
                                {
-//                                     $from = date("Y-m-d H:i:s", 
phpgwapi_datetime::date_to_timestamp($from));
+                                       $from = date("Y-m-d H:i:s", 
phpgwapi_datetime::date_to_timestamp($from));
                                }
                                foreach ($_POST['to_'] as &$to)
                                {
-//                                     $to = date("Y-m-d H:i:s", 
phpgwapi_datetime::date_to_timestamp($to));
+                                       $to = date("Y-m-d H:i:s", 
phpgwapi_datetime::date_to_timestamp($to));
                                }
 
                                $event['dates'] = array_map(array(self, 
'_combine_dates'), $_POST['from_'], $_POST['to_']);

Modified: trunk/bookingfrontend/inc/class.uiapplication.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.uiapplication.inc.php       2016-06-16 
10:30:24 UTC (rev 15296)
+++ trunk/bookingfrontend/inc/class.uiapplication.inc.php       2016-06-16 
12:51:43 UTC (rev 15297)
@@ -129,7 +129,17 @@
 
                        phpgwapi_jquery::formvalidator_generate(array('file'), 
'file_form');
 
-                       self::render_template_xsl('application', 
array('application' => $application,
-                               'audience' => $audience, 'agegroups' => 
$agegroups, 'frontend' => 'true'));
+                       $config = CreateObject('phpgwapi.config', 'booking');
+                       $config->read();
+                       $application_text = $config->config_data;
+
+                       self::render_template_xsl('application', array(
+                               'application' => $application,
+                               'audience' => $audience,
+                               'agegroups' => $agegroups,
+                               'frontend' => 'true',
+                               'config' => $application_text
+                               )
+                       );
                }
        }
\ No newline at end of file

Modified: trunk/bookingfrontend/templates/base/application.xsl
===================================================================
--- trunk/bookingfrontend/templates/base/application.xsl        2016-06-16 
10:30:24 UTC (rev 15296)
+++ trunk/bookingfrontend/templates/base/application.xsl        2016-06-16 
12:51:43 UTC (rev 15297)
@@ -393,9 +393,11 @@
                                        <div class="heading">
                                                <br />8. <xsl:value-of 
select="php:function('lang', 'Terms and conditions')" />
                                        </div>
-                                       <p>
-                                               <xsl:value-of 
select="php:function('lang', 'All that borrow premises from Bergen Kommune must 
verify that they have read the terms and conditions, this is usually fire 
regulations and house rules.')" />
-                                       </p>
+                                               <xsl:if 
test="config/application_terms">
+                                                       <p>
+                                                               <xsl:value-of 
select="config/application_terms"/>
+                                                       </p>
+                                               </xsl:if>
                                        <br />
                                        <div 
id='regulation_documents'>&nbsp;</div>
                                        <br />




reply via email to

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