fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6827] Merge 6823:6826 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [6827] Merge 6823:6826 from trunk
Date: Fri, 21 Jan 2011 14:19:32 +0000

Revision: 6827
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6827
Author:   sigurdne
Date:     2011-01-21 14:19:31 +0000 (Fri, 21 Jan 2011)
Log Message:
-----------
Merge 6823:6826 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php
    branches/Version-1_0-branch/property/inc/import/default/Import_fra_BKK_csv

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826

Modified: branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php     
2011-01-21 14:18:20 UTC (rev 6826)
+++ branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php     
2011-01-21 14:19:31 UTC (rev 6827)
@@ -232,17 +232,17 @@
                                $errors = $this->bo->validate($booking);
 
 
-                               if (strtotime($_POST['from_']) < $today[0])
-                               {
-                                       if($_POST['recurring'] == 'on' || 
$_POST['outseason'] == 'on')
-                                       {                                       
-                                               $errors['booking'] = lang('Can 
not repeat from a date in the past');
-                                       }
-                                       else
-                                       {
-                                               $errors['booking'] = lang('Can 
not create a booking in the past');
-                                       }
-                               } 
+#                              if (strtotime($_POST['from_']) < $today[0])
+#                              {
+#                                      if($_POST['recurring'] == 'on' || 
$_POST['outseason'] == 'on')
+#                                      {                                       
+#                                              $errors['booking'] = lang('Can 
not repeat from a date in the past');
+#                                      }
+#                                      else
+#                                      {
+#                                              $errors['booking'] = lang('Can 
not create a booking in the past');
+#                                      }
+#                              } 
                                if (!$allocation_id &&  $_POST['outseason'] == 
'on')
                                {
                                        $errors['booking'] = lang('This booking 
is not connected to a season');

Modified: 
branches/Version-1_0-branch/property/inc/import/default/Import_fra_BKK_csv
===================================================================
--- branches/Version-1_0-branch/property/inc/import/default/Import_fra_BKK_csv  
2011-01-21 14:18:20 UTC (rev 6826)
+++ branches/Version-1_0-branch/property/inc/import/default/Import_fra_BKK_csv  
2011-01-21 14:19:31 UTC (rev 6827)
@@ -84,15 +84,16 @@
                {
                        $this->soXport          = 
CreateObject('property.soXport');     
                        $this->invoice          = 
CreateObject('property.boinvoice');
-                       $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->dateformat       = $this->bocommon->dateformat;
-                       $this->datetimeformat   = 
$this->bocommon->datetimeformat;
                        $this->config = 
CreateObject('phpgwapi.config','property');
                        $this->config->read_repository();
                        $this->meter_table = 
$this->config->config_data['meter_table'];
 
-                       $this->db               = $this->bocommon->new_db();
-                       $this->join             = $this->bocommon->join;
+                       $this->db                               = & 
$GLOBALS['phpgw']->db;
+                       $this->join                             = & 
$this->db->join;
+                       $this->left_join                = & 
$this->db->left_join;
+                       $this->like                             = & 
$this->db->like;
+                       $this->datetimeformat   = $this->db->datetime_format();
+                       $this->dateformat               = 
$this->db->date_format();
                }
 
                function import($invoice_common,$download)
@@ -126,7 +127,7 @@
                                                if ($name=='Maalepunktid')
                                                {
                                                        $name='anleggsnr';
-                                                       $value= '7070575000' . 
$value;
+                       //                              $value= '7070575000' . 
$value;
                                                }
                                                if ($name=='Girobeloep')
                                                {
@@ -213,8 +214,7 @@
 
                                if($name=='anleggsnr')
                                {
-                                       $buffer[$this->id]['merknad'] .= "\r\n" 
. 'anleggsnr:' . $this->bocommon->ascii2utf($value);
-                                       
+                                       $buffer[$this->id]['merknad'] .= 
"\r\nanleggsnr: {$value}";                                     
                                        
$maalerinfo=$this->anleggsnr_to_objekt($value,$this->meter_table);
                                        $dima=$maalerinfo['dima'];
                                        $loc1=$maalerinfo['loc1'];
@@ -241,23 +241,23 @@
                                }
                                if($name=='maalernr')
                                {
-                                       $buffer[$this->id]['merknad'] .= "\r\n" 
. 'maalernr: '  . $value;
+                                       $buffer[$this->id]['merknad'] .= 
"\r\nmaalernr: {$value}";
                                }
                                if($name=='under_fakturanr')
                                {
-                                       $buffer[$this->id]['merknad'] .= "\r\n" 
. 'Fakturanr: '  . $value;
+                                       $buffer[$this->id]['merknad'] .= 
"\r\nFakturanr: {$value}";
                                }
                                if($name=='kundenr')
                                {
-                                       $buffer[$this->id]['merknad'] .= "\r\n" 
. 'Kundenr: '  . $value;
+                                       $buffer[$this->id]['merknad'] .= 
"\r\nKundenr: {$value}";
                                }
                                if($name=='kunde_navn')
                                {
-                                       $buffer[$this->id]['merknad'] .= "\r\n" 
. 'Kundenavn: '  . $this->bocommon->ascii2utf($value);
+                                       $buffer[$this->id]['merknad'] .= 
"\r\nKundenavn: {$value}";                                     
                                }
                                if($name=='stedsnavn')
                                {
-                                       $buffer[$this->id]['merknad'] .= "\r\n" 
. 'Adresse: '  . $this->bocommon->ascii2utf($value);
+                                       $buffer[$this->id]['merknad'] .= 
"\r\nAdresse: {$value}";
                                }
 
                                $buffer[$this->id][$name] = $value;
@@ -296,9 +296,11 @@
 
                function anleggsnr_to_objekt($anleggsnr,$meter_table)
                {
-                       $this->db->query("select 
$meter_table.ext_meter_id,$meter_table.loc1,$meter_table.loc2,$meter_table.loc3,fm_part_of_town.district_id
 "
-                       . " from $meter_table $this->join fm_location1 ON 
$meter_table.loc1 = fm_location1.loc1 $this->join "
-                         . " fm_part_of_town ON fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id where 
$meter_table.ext_system_id2='$anleggsnr'");
+                       $sql = "SELECT 
{$meter_table}.ext_meter_id,{$meter_table}.loc1,{$meter_table}.loc2,{$meter_table}.loc3,fm_part_of_town.district_id
 "
+                       . " FROM {$meter_table} {$this->join} fm_location1 ON 
{$meter_table}.loc1 = fm_location1.loc1 $this->join "
+                         . " fm_part_of_town ON fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id WHERE {$meter_table}.ext_system_id2 
{$this->like} '%{$anleggsnr}'";
+//     _debug_array($sql);
+                       $this->db->query($sql);
 
                        $this->db->next_record();
                        $loc1 = $this->db->f('loc1');
@@ -377,4 +379,3 @@
                        }
                }
        }
-?>




reply via email to

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