fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8148] bkbooking: update single file agresso export,


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [8148] bkbooking: update single file agresso export, allocation delete info text, event organization info on calender frontend
Date: Mon, 21 Nov 2011 12:35:22 +0000

Revision: 8148
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8148
Author:   kjell
Date:     2011-11-21 12:35:22 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------
bkbooking: update single file agresso export, allocation delete info text, 
event organization info on calender frontend

Modified Paths:
--------------
    trunk/booking/inc/class.socompleted_reservation_export.inc.php
    trunk/booking/inc/class.soevent.inc.php
    trunk/booking/setup/phpgw_no.lang
    trunk/booking/templates/base/account_code_dimension.xsl
    trunk/booking/templates/base/allocation_delete.xsl
    trunk/bookingfrontend/inc/class.uievent.inc.php
    trunk/bookingfrontend/templates/base/event_info.xsl

Modified: trunk/booking/inc/class.socompleted_reservation_export.inc.php
===================================================================
--- trunk/booking/inc/class.socompleted_reservation_export.inc.php      
2011-11-21 12:06:53 UTC (rev 8147)
+++ trunk/booking/inc/class.socompleted_reservation_export.inc.php      
2011-11-21 12:35:22 UTC (rev 8148)
@@ -98,14 +98,6 @@
                 * Normalizes data on entity.
                 */
                public function initialize_entity(&$entity) {
-                       ob_start();
-                       $myFile = "/tmp/debug2.txt";
-                       $fh = fopen($myFile, 'w') or die("can't open file");
-                       echo '<pre>';print_r($entity);
-                       $op = ob_get_contents();
-                       fwrite($fh, $op);
-                       fclose($fh);
-                       ob_end_clean();
                if (isset($entity['__initialized__']) && 
$entity['__initialized__'] === true) { return $entity; }
                        
                        $entity['__initialized__'] = true;
@@ -262,13 +254,23 @@
                }
                
                public function select_external($reservation) {
-                       return $reservation['customer_type'] == 
booking_socompleted_reservation::CUSTOMER_TYPE_EXTERNAL;
+
+            if ($config->config_data['output_files'] == 'single')
+                       {
+                               return true;
+                       } else {
+                               return $reservation['customer_type'] == 
booking_socompleted_reservation::CUSTOMER_TYPE_EXTERNAL;
+                       }
                }
                
                public function select_internal($reservation) {
-                       return $reservation['customer_type'] == 
booking_socompleted_reservation::CUSTOMER_TYPE_INTERNAL;
+            if ($config->config_data['output_files'] == 'single')
+                       {
+                               return false;
+                       } else {
+                               return $reservation['customer_type'] == 
booking_socompleted_reservation::CUSTOMER_TYPE_INTERNAL;
+                       }
                }
-               
                /**
                 * @return array with three elements where index 0: total_rows, 
index 1: total_cost, index 2: formatted data
                 */
@@ -286,7 +288,7 @@
                                                $export_format,
                                                
count(array_filter($external_reservations, array($this, 'not_free'))),
                                                
$this->calculate_total_cost($external_reservations),
-                                               
$this->format_agresso($external_reservations, $account_codes, 
$number_generator,'external')
+                                               
$this->format_agresso($external_reservations, $account_codes, $number_generator)
                                        );
                                }
                        }
@@ -307,7 +309,7 @@
             elseif ($config->config_data['internal_format'] == 'AGGRESSO')
             {
                        $export_format = 'agresso';
-            } 
+                       } 
                        
                        if (is_array($reservations)) {
                                if (count($internal_reservations = 
array_filter($reservations, array($this, 'select_internal'))) > 0) {
@@ -330,7 +332,7 @@
                                                $export_format,
                                                
count(array_filter($internal_reservations, array($this, 'not_free'))),
                                                
$this->calculate_total_cost($internal_reservations),
-                                               
$this->format_agresso($internal_reservations, $account_codes, 
$number_generator,'internal')
+                                               
$this->format_agresso($internal_reservations, $account_codes, $number_generator)
                                                );
                         }
                                }
@@ -588,7 +590,7 @@
                        }
                }
                
-               public function format_agresso(array &$reservations, array 
$account_codes, $sequential_number_generator,$type) {
+               public function format_agresso(array &$reservations, array 
$account_codes, $sequential_number_generator) {
                        //$orders = array();
                        $export_info = array();
                        $output = array();
@@ -639,7 +641,7 @@
                                if ($this->get_cost_value($reservation['cost']) 
<= 0) {
                                        continue; //Don't export costless rows
                                }
-                               
+                               $type = $reservation['customer_type'];
                                $order_id = 
$sequential_number_generator->increment()->get_current();
                                $export_info[] = 
$this->create_export_item_info($reservation, $order_id);
                                

Modified: trunk/booking/inc/class.soevent.inc.php
===================================================================
--- trunk/booking/inc/class.soevent.inc.php     2011-11-21 12:06:53 UTC (rev 
8147)
+++ trunk/booking/inc/class.soevent.inc.php     2011-11-21 12:35:22 UTC (rev 
8148)
@@ -266,6 +266,22 @@
                        return $this->db->f('name', false);
                }
 
+               function get_org($orgnumber)
+               {
+                       $sql = "SELECT id,name FROM bb_organization WHERE 
customer_organization_number='".$orgnumber."'";
+
+                       $this->db->limit_query($sql,0, __LINE__, __FILE__, 1);
+                       if($this->db->next_record())
+                       {
+                               $results = array('id' => $this->db->f('id', 
false),
+                                                        'name' => 
$this->db->f('name', false));
+                       } else {
+                               return array();
+                       }
+
+                       return $results;
+               }
+
                function get_buildings()
                {
             $results = array();

Modified: trunk/booking/setup/phpgw_no.lang
===================================================================
--- trunk/booking/setup/phpgw_no.lang   2011-11-21 12:06:53 UTC (rev 8147)
+++ trunk/booking/setup/phpgw_no.lang   2011-11-21 12:35:22 UTC (rev 8148)
@@ -535,4 +535,5 @@
 Booking system settings        booking no      Bookingmodul systeminnstillinger
 Frontend users can delete bookings and allocations     booking no      Brukere 
av frontend kan slette bookinger og tildelinger direkte
 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.     
  booking no      Alle som leier lokaler hos Bergen kommune må bekrefte at de 
har lest betingelsene, dette gjelder som regel brannforskrifter og husreglement.
-
+Delete information     booking no      Hvis du kun skal slette tildeling på 
valgt dato, velg Slett-knappen nederst og tiden blir vist som ledig i 
kalenderen, og kan tildeles andre klubber/org. 
+Delete information2    booking no      Skal du slette flere kan du velge Ut 
sesong eller Slett til og velg en dato, du kan også velge intervall (f.eks. 
annen hver uke).

Modified: trunk/booking/templates/base/account_code_dimension.xsl
===================================================================
--- trunk/booking/templates/base/account_code_dimension.xsl     2011-11-21 
12:06:53 UTC (rev 8147)
+++ trunk/booking/templates/base/account_code_dimension.xsl     2011-11-21 
12:35:22 UTC (rev 8148)
@@ -100,6 +100,23 @@
                           </option>
                        </select>
                        </dd>
+            <dt><label for="field_output_files"><xsl:value-of 
select="php:function('lang', 'File output')"/></label></dt>
+                       <dd>
+                               <select id="field_output_files" 
name="output_files">
+                    <option value="seperated">
+                        <xsl:if test="config_data/output_files='seperated'">
+                            <xsl:attribute 
name="selected">checked</xsl:attribute>
+                        </xsl:if>
+                        Records splited between two files internal and 
external.
+                    </option>
+                    <option value="single">
+                        <xsl:if test="config_data/output_files='single'">
+                            <xsl:attribute 
name="selected">checked</xsl:attribute>
+                        </xsl:if>
+                        All records in the external file.
+                          </option>
+                       </select>
+                       </dd>
         </dl>
                <div class="form-buttons">
                        <input type="submit">

Modified: trunk/booking/templates/base/allocation_delete.xsl
===================================================================
--- trunk/booking/templates/base/allocation_delete.xsl  2011-11-21 12:06:53 UTC 
(rev 8147)
+++ trunk/booking/templates/base/allocation_delete.xsl  2011-11-21 12:35:22 UTC 
(rev 8148)
@@ -6,7 +6,10 @@
        </dl>
     <xsl:call-template name="msgbox"/>
        <xsl:call-template name="yui_booking_i18n"/>
-
+       <dl class="form">
+       <dd><xsl:value-of select="php:function('lang', 'Delete 
Information')"/></dd>
+       <dd><xsl:value-of select="php:function('lang', 'Delete 
Information2')"/></dd>
+       </dl>
     <form action="" method="POST">
                <input type="hidden" name="application_id" 
value="{allocation/application_id}"/>
         <input id="field_org_id" name="organization_id" type="hidden" 
value="{allocation/organization_id}" />

Modified: trunk/bookingfrontend/inc/class.uievent.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.uievent.inc.php     2011-11-21 12:06:53 UTC 
(rev 8147)
+++ trunk/bookingfrontend/inc/class.uievent.inc.php     2011-11-21 12:35:22 UTC 
(rev 8148)
@@ -23,6 +23,15 @@
                {
                        $event = 
$this->bo->read_single(intval(phpgw::get_var('id', 'GET')));
                        $resources = 
$this->resource_bo->so->read(array('filters'=>array('id'=>$event['resources']), 
'sort'=>'name'));
+                       if ($event['customer_organization_number'] != '')
+                       {
+                               $orginfo = 
$this->bo->so->get_org($event['customer_organization_number']);              
+                               if ($orginfo != array()) { 
+                                       $orginfo['link'] = 
self::link(array('menuaction' => 'bookingfrontend.uiorganization.show', 'id' => 
$orginfo['id']));
+                               }
+                       } else {
+                               $orginfo = array();
+                       }
                        $event['resources'] = $resources['results'];
                        $res_names = array();
                        foreach($event['resources'] as $res)
@@ -32,7 +41,7 @@
                        $event['resource_info'] = join(', ', $res_names);
                        $event['building_link'] = self::link(array('menuaction' 
=> 'bookingfrontend.uibuilding.show', 'id' => 
$event['resources'][0]['building_id']));
                        $event['when'] = pretty_timestamp($event['from_']).' - 
'.pretty_timestamp($event['to_']);
-                       self::render_template('event_info', 
array('event'=>$event));
+                       self::render_template('event_info', 
array('event'=>$event,'orginfo' => $orginfo));
                        $GLOBALS['phpgw']->xslttpl->set_output('wml'); // Evil 
hack to disable page chrome
                }
 

Modified: trunk/bookingfrontend/templates/base/event_info.xsl
===================================================================
--- trunk/bookingfrontend/templates/base/event_info.xsl 2011-11-21 12:06:53 UTC 
(rev 8147)
+++ trunk/bookingfrontend/templates/base/event_info.xsl 2011-11-21 12:35:22 UTC 
(rev 8148)
@@ -17,6 +17,9 @@
                <dt><xsl:value-of select="php:function('lang', 'Who')"/></dt>
                <xsl:if test="event/is_public=1">
                        <dd>
+                       <xsl:if test="orginfo">
+                               <a href="{orginfo/link}"><xsl:value-of 
select="orginfo/name"/></a>:
+                       </xsl:if>
                                <xsl:value-of select="event/contact_name"/>
                        </dd>
                </xsl:if>
@@ -26,4 +29,4 @@
                        </dd>
                </xsl:if>
        </dl>
-</xsl:template>
\ No newline at end of file
+</xsl:template>




reply via email to

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