fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9376] bkbooking: modified customer_number so that it


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [9376] bkbooking: modified customer_number so that it can be 6 character long
Date: Fri, 11 May 2012 11:40:09 +0000

Revision: 9376
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9376
Author:   kjell
Date:     2012-05-11 11:40:09 +0000 (Fri, 11 May 2012)
Log Message:
-----------
bkbooking: modified customer_number so that it can be 6 character long

Modified Paths:
--------------
    trunk/booking/inc/class.customer_identifier.inc.php
    trunk/booking/inc/class.socompleted_reservation.inc.php
    trunk/booking/inc/class.soevent.inc.php
    trunk/booking/inc/class.uiapplication.inc.php
    trunk/booking/inc/class.uievent.inc.php
    trunk/booking/inc/class.uiorganization.inc.php
    
trunk/booking/inc/vendor/symfony/validator/sfValidatorNorwegianOrganizationNumber.class.php
    trunk/booking/setup/phpgw_no.lang

Modified: trunk/booking/inc/class.customer_identifier.inc.php
===================================================================
--- trunk/booking/inc/class.customer_identifier.inc.php 2012-05-11 11:36:14 UTC 
(rev 9375)
+++ trunk/booking/inc/class.customer_identifier.inc.php 2012-05-11 11:40:09 UTC 
(rev 9376)
@@ -27,11 +27,11 @@
                                $to_entity[$this->identifier_type_field] = 
$from_entity_customer_identifier;
                 if(intval($from_entity['customer_internal']) == 1)
                 {
-                    if (strlen($from_entity['customer_number']) == 5)          
                
+                    if ((strlen($from_entity['customer_number']) == 6) || 
(strlen($from_entity['customer_number']) == 5))                      
                     {
                        
$to_entity[$this->field_prefix.$from_entity_customer_identifier] = 
$from_entity['customer_number'];
                     }
-                    elseif 
(strlen($from_entity['customer_organization_number']) == 5) 
+                    elseif 
((strlen($from_entity['customer_organization_number']) == 6) ||  
(strlen($from_entity['customer_organization_number']) == 5)) 
                                        {
                        
$to_entity[$this->field_prefix.$from_entity_customer_identifier] = 
$from_entity['customer_organization_number'];
                                        }                       
@@ -116,7 +116,7 @@
                        $identifier_field = 
$this->field_prefix.$identifier_field;
                        $identifier_value = isset($data[$identifier_field]) ? 
trim($data[$identifier_field]) : null;
 
-                       if ($identifier_field == 'customer_organization_number' 
and (strlen($identifier_value) != 5 and strlen($identifier_value) != 9)){
+                       if ($identifier_field == 'customer_organization_number' 
and (strlen($identifier_value) != 5 and strlen($identifier_value) != 6 and 
strlen($identifier_value) != 9)){
                                return null;
                        }
 

Modified: trunk/booking/inc/class.socompleted_reservation.inc.php
===================================================================
--- trunk/booking/inc/class.socompleted_reservation.inc.php     2012-05-11 
11:36:14 UTC (rev 9375)
+++ trunk/booking/inc/class.socompleted_reservation.inc.php     2012-05-11 
11:40:09 UTC (rev 9376)
@@ -249,9 +249,9 @@
                        //Remember that the default value of customer_type is 
already
                        //set to 'external' so we only have to adjust 
customer_type
                        //when dealing with an internal customer
-                       if (strlen($customer_info['organization_number']) == 5) 
{
+                       if ((strlen($customer_info['organization_number']) == 
5) || (strlen($customer_info['organization_number']) == 6)) {
                                $entity['customer_type'] = 
self::CUSTOMER_TYPE_INTERNAL;
-                       } else if 
(strlen($customer_info['customer_organization_number']) == 5) {
+                       } else if 
((strlen($customer_info['customer_organization_number']) == 6) || 
(strlen($customer_info['customer_organization_number']) == 5)){
                                $entity['customer_type'] = 
self::CUSTOMER_TYPE_INTERNAL;
                        } else if (intval($customer_info['customer_internal']) 
== 1) {
                                $entity['customer_type'] = 
self::CUSTOMER_TYPE_INTERNAL;
@@ -261,7 +261,7 @@
                protected function set_organization(&$entity, &$organization) {
                        $entity['organization_id'] = $organization['id'];
             if (intval($organization['customer_internal']) == 1) {
-                if (strlen($organization['customer_number']) == 5) {
+                if ((strlen($organization['customer_number']) == 5) || 
(strlen($organization['customer_number']) == 6)) {
                     $entity['customer_organization_number'] = 
$organization['customer_number'];
                        $entity['customer_identifier_type'] = 
'organization_number';
                 } elseif ($organization['customer_identifier_type'] == 'ssn') {

Modified: trunk/booking/inc/class.soevent.inc.php
===================================================================
--- trunk/booking/inc/class.soevent.inc.php     2012-05-11 11:36:14 UTC (rev 
9375)
+++ trunk/booking/inc/class.soevent.inc.php     2012-05-11 11:40:09 UTC (rev 
9376)
@@ -268,7 +268,7 @@
 
                function get_org($orgnumber)
                {
-                       $sql = "SELECT id,name FROM bb_organization WHERE 
organization_number='".$orgnumber."' OR 
customer_organization_number='".$orgnumber."'";
+                       $sql = "SELECT id,name FROM bb_organization WHERE 
(organization_number='".$orgnumber."' OR 
customer_organization_number='".$orgnumber."') AND active != 0";
 
                        $this->db->limit_query($sql,0, __LINE__, __FILE__, 1);
                        if($this->db->next_record())

Modified: trunk/booking/inc/class.uiapplication.inc.php
===================================================================
--- trunk/booking/inc/class.uiapplication.inc.php       2012-05-11 11:36:14 UTC 
(rev 9375)
+++ trunk/booking/inc/class.uiapplication.inc.php       2012-05-11 11:40:09 UTC 
(rev 9376)
@@ -446,7 +446,7 @@
                                foreach($application['agegroups'] as $ag)
                                {
                                        if($ag['male'] > 9999 || $ag['female'] 
> 9999) {
-                                               $errors['agegroups'] = 
lang('Agegroups kan not be larger than 9999 peoples');
+                                               $errors['agegroups'] = 
lang('Agegroups can not be larger than 9999 peoples');
                                        }
                                }
 

Modified: trunk/booking/inc/class.uievent.inc.php
===================================================================
--- trunk/booking/inc/class.uievent.inc.php     2012-05-11 11:36:14 UTC (rev 
9375)
+++ trunk/booking/inc/class.uievent.inc.php     2012-05-11 11:40:09 UTC (rev 
9376)
@@ -339,7 +339,7 @@
                                        } else {
                                                
$_POST['customer_identifier_type'] = 'organization_number';
                                                $_POST['customer_internal'] = 
$organization['customer_internal'];
-                                               if 
(strlen($organization['customer_number']) == 5) {
+                                               if 
((strlen($organization['customer_number']) == 6) || 
(strlen($organization['customer_number']) == 5)) {
                                                        
$_POST['customer_organization_number'] = $organization['customer_number'];
                                                } else {
                                                        
$errors['resource_number'] = lang('The resource number is wrong or not 
present');
@@ -394,7 +394,7 @@
                                if(($_POST['organization_name'] != '' or 
$_POST['org_id2'] != '') and isset($errors['contact_name'])) {
                                        $errors['contact_name'] = 
lang('Organization is missing booking charge');
                                }
-                               if(!$errors['event'] && !$errors['from_'] && 
!$errors['time'] && !$errors['invoice_data'] && !$errors['resource_number'] && 
!$errors['organization_number'] && !$errors['contact_name'] && !$errors['cost'])
+                               if(!$errors['event'] && !$errors['from_'] && 
!$errors['time'] && !$errors['invoice_data'] && !$errors['resource_number'] && 
!$errors['organization_number'] && !$errors['contact_name'] && !$errors['cost'] 
&& !$errors['activity_id'])
                                {
                                        if (!$_POST['application_id'])
                                        {
@@ -529,7 +529,7 @@
                                        } else {
                                                
$event['customer_identifier_type'] = 'organization_number';
                                                $event['customer_internal'] = 
$organization['customer_internal'];
-                                               if 
(strlen($organization['customer_number']) == 5) {
+                                               if 
((strlen($organization['customer_number']) == 6) || 
(strlen($organization['customer_number']) == 5)) {
                                                        
$event['customer_organization_number'] = $organization['customer_number'];
                                                } else {
                                                        
$errors['resource_number'] = lang('The resource number is wrong or not 
present');

Modified: trunk/booking/inc/class.uiorganization.inc.php
===================================================================
--- trunk/booking/inc/class.uiorganization.inc.php      2012-05-11 11:36:14 UTC 
(rev 9375)
+++ trunk/booking/inc/class.uiorganization.inc.php      2012-05-11 11:40:09 UTC 
(rev 9376)
@@ -224,6 +224,9 @@
                                if(strlen($_POST['shortname']) > 11){
                                        $errors['shortname'] = lang('Lengt of 
shortname is to long, max 11 characters long');
                                }
+                               if((strlen($_POST['customer_number']) != 5) && 
(strlen($_POST['customer_number']) != 6) && ($_POST['customer_number'] != '')){
+                                       $errors['customer_number'] = 
lang('Resourcenumber is wrong, 5 or 6 characters long');
+                               }
                                if(!$errors)
                                {
                                        $organization['shortname'] = 
$_POST['shortname'];

Modified: 
trunk/booking/inc/vendor/symfony/validator/sfValidatorNorwegianOrganizationNumber.class.php
===================================================================
--- 
trunk/booking/inc/vendor/symfony/validator/sfValidatorNorwegianOrganizationNumber.class.php
 2012-05-11 11:36:14 UTC (rev 9375)
+++ 
trunk/booking/inc/vendor/symfony/validator/sfValidatorNorwegianOrganizationNumber.class.php
 2012-05-11 11:40:09 UTC (rev 9376)
@@ -28,6 +28,6 @@
   {    
     parent::configure($options, $messages);
     // also accept 5 digits even if its not a valid organization number
-    $this->setOption('pattern', '/(^\d{9}$)|(^\d{5}$)/');
+    $this->setOption('pattern', '/(^\d{9}$)|(^\d{6}$)|(^\d{5}$)/');
   }
 }

Modified: trunk/booking/setup/phpgw_no.lang
===================================================================
--- trunk/booking/setup/phpgw_no.lang   2012-05-11 11:36:14 UTC (rev 9375)
+++ trunk/booking/setup/phpgw_no.lang   2012-05-11 11:40:09 UTC (rev 9376)
@@ -552,3 +552,5 @@
 Organization is missing booking charge booking no      Organisasjonen mangler 
bookingansvarlig
 Logfile        booking no      Logfil
 log    booking no      Last ned
+Agegroups can not be larger than 9999 peoples  booking no      Det kan ikke 
være mer en 9999 personer i hver målgruppe.
+Resourcenumber is wrong, 5 or 6 characters long        booking no      
Ressursnummer er feil, skal være 5 eller 6 tegn langt.




reply via email to

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