phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.bocommon.inc.php, 1.90, 1.91 class


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] property/inc class.bocommon.inc.php, 1.90, 1.91 class.uientity.inc.php, 1.6, 1.7 class.soentity.inc.php, 1.7, 1.8 class.boadmin_entity.inc.php, 1.6, 1.7 class.boentity.inc.php, 1.4, 1.5 class.uilookup.inc.php, 1.30, 1.31
Date: Wed, 29 Oct 2003 20:46:17 +0000

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv23390/inc

Modified Files:
        class.bocommon.inc.php class.uientity.inc.php 
        class.soentity.inc.php class.boadmin_entity.inc.php 
        class.boentity.inc.php class.uilookup.inc.php 
Log Message:
no message

Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** class.bocommon.inc.php      29 Oct 2003 17:28:42 -0000      1.90
--- class.bocommon.inc.php      29 Oct 2003 20:46:13 -0000      1.91
***************
*** 461,496 ****
  
  
-               function initiate_ab_lookup($data)
-               {
- //_debug_array($data);
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
- 
-                       if($data['type']=='view')
-                       {
-                               
$GLOBALS['phpgw']->xslttpl->add_file(array('ab_view'));
-                       }
-                       else
-                       {
-                               
$GLOBALS['phpgw']->xslttpl->add_file(array('ab_form'));
-                       }
- 
-                       $contact['ab_id']                       = 
$data['ab_id'];
-                       $contact['org_name']            = $data['org_name'];
- 
-                       if($data['ab_id'] && !$data['ab_name'])
-                       {
-                               $ab_data                                        
= 
$contacts->read_single_entry($data['ab_id'],array('org_name'=>'org_name','email'=>'email'));
-                               $contact['org_name']            = 
$ab_data[0]['org_name'];
-                       }
- 
-                       $contact['contact_link']                                
= 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook');
-                       $contact['input_text']                                  
= $data['input_text'];
-                       $contact['status_text']                                 
= $data['status_text'];
- 
-                       unset($contacts);
- //_debug_array($contact);
-                       return $contact;
-               }
- 
                function initiate_ui_vendorlookup($data)
                {
--- 461,464 ----
***************
*** 660,664 ****
                                'R' => 'Muliple radio',
                                'CH' => 'Muliple checkbox',
!                               'LB' => 'Listbox'
                        );
  
--- 628,633 ----
                                'R' => 'Muliple radio',
                                'CH' => 'Muliple checkbox',
!                               'LB' => 'Listbox',
!                               'AB' => 'Contact'
                        );
  
***************
*** 679,683 ****
                                'R' => 'int',
                                'CH' => 'text',
!                               'LB' => 'int'
                        );
  
--- 648,653 ----
                                'R' => 'int',
                                'CH' => 'text',
!                               'LB' => 'int',
!                               'AB' => 'int'
                        );
  

Index: class.boentity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boentity.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** class.boentity.inc.php      28 Oct 2003 15:14:37 -0000      1.4
--- class.boentity.inc.php      29 Oct 2003 20:46:14 -0000      1.5
***************
*** 283,286 ****
--- 283,287 ----
  
                        $soadmin_entity = 
CreateObject($this->currentapp.'.soadmin_entity');
+                       $contacts                       = 
CreateObject('phpgwapi.contacts');
  
                        $input_type_array = array(
***************
*** 298,301 ****
--- 299,303 ----
                        $dateformat= (implode($sep,$dlarr));
  
+                       $m=0;
                        for ($i=0;$i<count($entity['attributes']);$i++)
                        {
***************
*** 305,308 ****
--- 307,325 ----
                                        $entity['attributes'][$i]['value']      
= $GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
                                }
+                               if($entity['attributes'][$i]['datatype']=='AB')
+                               {
+                                       if($entity['attributes'][$i]['value'])
+                                       {
+                                               $contact_data                   
        = 
$contacts->read_single_entry($entity['attributes'][$i]['value'],array('org_name'=>'org_name','email'=>'email'));
+                                               
$entity['attributes'][$i]['org_name']   = $contact_data[0]['org_name'];
+                                       }
+ 
+                                       $insert_record_entity[] = 
$entity['attributes'][$i]['name'];
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook&column='
 . $entity['attributes'][$i]['name']);
+ 
+                                       $lookup_functions[$m]['name'] = 
'lookup_'. $entity['attributes'][$i]['name'] .'()';
+                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+                                       $m++;
+                               }
                                if($entity['attributes'][$i]['datatype']=='R' 
|| $entity['attributes'][$i]['datatype']=='CH' || 
$entity['attributes'][$i]['datatype']=='LB')
                                {
***************
*** 329,337 ****
                                }
  
-                               
$entity['attributes'][$i]['lang_attribute_statustext'] = lang('Enter the 
attribute value for this entity');
                                $entity['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($entity['attributes'][$i]['datatype']);
                                $entity['attributes'][$i]['counter']    = $i;
                                $entity['attributes'][$i]['type_id']    = 
$data['type_id'];
                        }
  
  //_debug_array($entity);
--- 346,363 ----
                                }
  
                                $entity['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($entity['attributes'][$i]['datatype']);
                                $entity['attributes'][$i]['counter']    = $i;
                                $entity['attributes'][$i]['type_id']    = 
$data['type_id'];
                        }
+ 
+                       for ($j=0;$j<count($lookup_functions);$j++)
+                       {
+                               $entity['lookup_functions'] .= 'function ' . 
$lookup_functions[$j]['name'] ."\r\n";
+                               $entity['lookup_functions'] .= '{'."\r\n";
+                               $entity['lookup_functions'] .= 
$lookup_functions[$j]['action'] ."\r\n";
+                               $entity['lookup_functions'] .= '}'."\r\n";
+                       }
+ 
+                       
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp,$insert_record_entity);
  
  //_debug_array($entity);

Index: class.boadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin_entity.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** class.boadmin_entity.inc.php        28 Oct 2003 15:14:37 -0000      1.6
--- class.boadmin_entity.inc.php        29 Oct 2003 20:46:14 -0000      1.7
***************
*** 352,355 ****
--- 352,357 ----
                        $datatypes[8]['id']= 'LB';
                        $datatypes[8]['name']= lang('ListBox');
+                       $datatypes[9]['id']= 'AB';
+                       $datatypes[9]['name']= lang('Contact');
  
  

Index: class.uilookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilookup.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** class.uilookup.inc.php      27 Aug 2003 16:35:12 -0000      1.30
--- class.uilookup.inc.php      29 Oct 2003 20:46:14 -0000      1.31
***************
*** 69,73 ****
                {
  
!                       $this->cats                                     = 
CreateObject('phpgwapi.categories');
                        $this->cats->app_name = 'addressbook';
  
--- 69,73 ----
                {
  
!                       $this->cats             = 
CreateObject('phpgwapi.categories');
                        $this->cats->app_name = 'addressbook';
  
***************
*** 77,94 ****
  
                        $second_display = 
get_var('second_display',array('POST','GET'));
  
  
                        $default_category = 
$GLOBALS['phpgw_info']['user']['preferences']['addressbook']['default_category'];
  
- //echo 'second_display :'.$second_display .'<br>';
- 
                        if ($default_category && !$second_display)
                        {
- //echo 'default_category :'.$default_category .'<br>';
                                $this->bo->cat_id       = $default_category;
                                $this->cat_id           = $default_category;
                        }
  
- 
                        $addressbook_list = $this->bo->read_addressbook();
  
--- 77,91 ----
  
                        $second_display = 
get_var('second_display',array('POST','GET'));
+                       $column = get_var('column',array('POST','GET'));
  
  
                        $default_category = 
$GLOBALS['phpgw_info']['user']['preferences']['addressbook']['default_category'];
  
                        if ($default_category && !$second_display)
                        {
                                $this->bo->cat_id       = $default_category;
                                $this->cat_id           = $default_category;
                        }
  
                        $addressbook_list = $this->bo->read_addressbook();
  
***************
*** 144,147 ****
--- 141,154 ----
                        );
  
+                       if($column)
+                       {
+                               $contact_id     =$column;
+                               $org_name       =$column . '_org_name';
+                       }
+                       else
+                       {
+                               $contact_id     ='vendor_id';
+                               $org_name       ='vendor_name';
+                       }
  
                        $data = array
***************
*** 167,171 ****
                                'table_header_addressbook'              => 
$table_header,
                                'values_addressbook'                    => 
$content,
!                               'table_done'                                    
=> $table_done
                        );
  
--- 174,180 ----
                                'table_header_addressbook'              => 
$table_header,
                                'values_addressbook'                    => 
$content,
!                               'table_done'                                    
=> $table_done,
!                               'contact_id'                                    
=> $contact_id,
!                               'org_name'                                      
        => $org_name
                        );
  

Index: class.soentity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soentity.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** class.soentity.inc.php      28 Oct 2003 15:14:37 -0000      1.7
--- class.soentity.inc.php      29 Oct 2003 20:46:14 -0000      1.8
***************
*** 431,442 ****
                        }
  
- 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
                                foreach($values_attribute as $entry)
- 
                                {
!                                       $cols[] = $entry['name'];
!                                       $vals[] = $entry['value'];
                                }
                        }
--- 431,443 ----
                        }
  
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
                                foreach($values_attribute as $entry)
                                {
!                                       if($entry['value'])
!                                       {
!                                               $cols[] = $entry['name'];
!                                               $vals[] = $entry['value'];
!                                       }
                                }
                        }
***************
*** 467,472 ****
                function edit($values,$values_attribute,$entity_id,$cat_id)
                {
- //_debug_array($values);
- 
                        if($values['street_name'])
                        {
--- 468,471 ----
***************
*** 503,509 ****
                        {
                                foreach($values_attribute as $entry)
- 
                                {
!                                       $value_set[$entry['name']]      = 
$entry['value'];
                                }
                        }
--- 502,510 ----
                        {
                                foreach($values_attribute as $entry)
                                {
!                                       if($entry['datatype']!='AB')
!                                       {
!                                               $value_set[$entry['name']]      
= $entry['value'];
!                                       }
                                }
                        }

Index: class.uientity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uientity.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** class.uientity.inc.php      29 Oct 2003 17:28:42 -0000      1.6
--- class.uientity.inc.php      29 Oct 2003 20:46:14 -0000      1.7
***************
*** 489,493 ****
                        $values_attribute       = 
get_var('values_attribute',array('POST','GET'));
  
!                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
  
                        $GLOBALS['phpgw']->xslttpl->add_file(array('entity'));
--- 489,499 ----
                        $values_attribute       = 
get_var('values_attribute',array('POST','GET'));
  
!                       $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
!                       $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
! 
!                       for ($j=0;$j<count($insert_record_entity);$j++)
!                       {
!                               $insert_record['extra'][]       = 
$insert_record_entity[$j];
!                       }
  
                        $GLOBALS['phpgw']->xslttpl->add_file(array('entity'));
***************
*** 572,576 ****
                        else
                        {
!                               $temp   = 
$this->bo->read_single(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id));
                        }
  
--- 578,582 ----
                        else
                        {
!                               $values = 
$this->bo->read_single(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id));
                        }
  
***************
*** 612,623 ****
                        }
  
-                       if($values['attributes'])
-                       {
-                               $attributes_values=$values['attributes'];
-                       }
-                       else
-                       {
-                               $attributes_values=$temp['attributes'];
-                       }
  
                        $attributes_header[]    = array(
--- 618,621 ----
***************
*** 687,691 ****
                                'lang_attributes'                               
=> lang('Attributes'),
                                'attributes_header'                             
=> $attributes_header,
!                               'attributes_values'                             
=> $attributes_values,
                                'dateformat'                                    
=> $dateformat,
                                'lang_none'                                     
        => lang('None'),
--- 685,690 ----
                                'lang_attributes'                               
=> lang('Attributes'),
                                'attributes_header'                             
=> $attributes_header,
!                               'attributes_values'                             
=> $values['attributes'],
!                               'lookup_functions'                              
=> $values['lookup_functions'],
                                'dateformat'                                    
=> $dateformat,
                                'lang_none'                                     
        => lang('None'),





reply via email to

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