phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: addressbook/inc class.remote.inc.php,NONE,1.1 cl


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: addressbook/inc class.remote.inc.php,NONE,1.1 class.uiaddressbook.inc.php,1.39,1.40
Date: Thu, 14 Mar 2002 09:06:07 -0500

Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv27349

Modified Files:
        class.uiaddressbook.inc.php 
Added Files:
        class.remote.inc.php 
Log Message:
Add the beginnings of remote ldap search capability (with add)



***** Error reading new file: [Errno 2] No such file or directory: 
'class.remote.inc.php'
Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** class.uiaddressbook.inc.php 28 Feb 2002 04:23:16 -0000      1.39
--- class.uiaddressbook.inc.php 14 Mar 2002 14:06:04 -0000      1.40
***************
*** 37,45 ****
                        'view' => True,
                        'add'  => True,
                        'add_email' => True,
                        'copy' => True,
                        'edit' => True,
                        'delete' => True,
!                       'preferences' => True
                );
  
--- 37,47 ----
                        'view' => True,
                        'add'  => True,
+                       'addfromremote' => True,
                        'add_email' => True,
                        'copy' => True,
                        'edit' => True,
                        'delete' => True,
!                       'preferences' => True,
!                       'remote_search' => True
                );
  
***************
*** 193,196 ****
--- 195,226 ----
                }
  
+               function remote_search_option()
+               {
+                       $remote  = CreateObject('addressbook.remote');
+                       $servers = $remote->servers;
+                       $search_remote = '';
+ 
+                       /* show search box and server dropdown */
+                       while(list($server,$data) = @each($servers))
+                       {
+                               $search_remote .= '      <option value="' . 
$server . '"';
+                               if($server == $this->server)
+                               {
+                                       $search_remote .= ' selected';
+                               }
+                               $search_remote .= '>' . $server . '</option>' . 
"\n";
+                       }
+ 
+                       return $search_remote;
+               }
+ 
+               function remote_search()
+               {
+ //                    _debug_array($GLOBALS['HTTP_POST_VARS']);
+                       $remote = 
CreateObject('addressbook.remote',$GLOBALS['HTTP_POST_VARS']['serverid']);
+                       $entries = 
$remote->search($GLOBALS['HTTP_POST_VARS']['remote_query']);
+                       $this->index($entries);
+               }
+ 
                /* this cleans up the fieldnames for display */
                function display_name($column)
***************
*** 258,262 ****
                        Former index.php
                */
!               function index()
                {
                        $GLOBALS['phpgw']->common->phpgw_header();
--- 288,292 ----
                        Former index.php
                */
!               function index($entries='')
                {
                        $GLOBALS['phpgw']->common->phpgw_header();
***************
*** 412,421 ****
                        }
  
!                       if($nosearch && !$this->query)
                        {
                                $entries = array();
                                $total_records = 0;
                        }
!                       else
                        {
                                /* read the entry list */
--- 442,451 ----
                        }
  
!                       if($nosearch && !$this->query && !$entries)
                        {
                                $entries = array();
                                $total_records = 0;
                        }
!                       elseif(!$entries)
                        {
                                /* read the entry list */
***************
*** 430,443 ****
                                ));
                                $total_records = $this->bo->total;
                        }
- 
-                       /* global here so nextmatchs accepts our setting of 
$query and $filter */
- //                    $GLOBALS['query']  = $this->query;
- //                    $GLOBALS['filter'] = $this->filter;
  
                        $search_filter = 
$GLOBALS['phpgw']->nextmatchs->show_tpl('/index.php',
                                $this->start, 
$total_records,'&menuaction=addressbook.uiaddressbook.index&fcat_id='.$this->cat_id,'75%',
                                
$GLOBALS['phpgw_info']['theme']['th_bg'],1,1,1,1,$this->cat_id);
! //                    $query = $filter = '';
  
                        $lang_showing = 
$GLOBALS['phpgw']->nextmatchs->show_hits($total_records,$this->start);
--- 460,477 ----
                                ));
                                $total_records = $this->bo->total;
+                               
$this->template->set_var('lang_view',lang('View'));
+                       }
+                       else
+                       {
+                               $total_records = count($entries);
+                               
$this->template->set_var('lang_view',lang('Add'));
+                               $showadd = True;
                        }
  
                        $search_filter = 
$GLOBALS['phpgw']->nextmatchs->show_tpl('/index.php',
                                $this->start, 
$total_records,'&menuaction=addressbook.uiaddressbook.index&fcat_id='.$this->cat_id,'75%',
                                
$GLOBALS['phpgw_info']['theme']['th_bg'],1,1,1,1,$this->cat_id);
! 
!                       $search_remote = $this->remote_search_option();
  
                        $lang_showing = 
$GLOBALS['phpgw']->nextmatchs->show_hits($total_records,$this->start);
***************
*** 445,456 ****
                        /* set basic vars and parse the header */
                        
$this->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']);
!                       $this->template->set_var('lang_view',lang('View'));
                        $this->template->set_var('lang_vcard',lang('VCard'));
                        $this->template->set_var('lang_edit',lang('Edit'));
                        $this->template->set_var('lang_owner',lang('Owner'));
  
                        $this->template->set_var('searchreturn',$noprefs . ' ' 
. $searchreturn);
                        $this->template->set_var('lang_showing',$lang_showing);
                        
$this->template->set_var('search_filter',$search_filter);
                        $this->template->set_var('cats',lang('Category'));
                        
$this->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
--- 479,496 ----
                        /* set basic vars and parse the header */
                        
$this->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']);
!                       
$this->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
! //                    $this->template->set_var('lang_view',lang('View'));
                        $this->template->set_var('lang_vcard',lang('VCard'));
                        $this->template->set_var('lang_edit',lang('Edit'));
                        $this->template->set_var('lang_owner',lang('Owner'));
+                       $this->template->set_var('lang_go',lang('Go'));
  
                        $this->template->set_var('searchreturn',$noprefs . ' ' 
. $searchreturn);
+                       
$this->template->set_var('remote_search',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.remote_search'));
+                       
$this->template->set_var('remote_query',$GLOBALS['HTTP_POST_VARS']['remote_query']);
+                       
$this->template->set_var('lang_remote_search',lang('Remote Search'));
                        $this->template->set_var('lang_showing',$lang_showing);
                        
$this->template->set_var('search_filter',$search_filter);
+                       
$this->template->set_var('search_remote',$search_remote);
                        $this->template->set_var('cats',lang('Category'));
                        
$this->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
***************
*** 532,536 ****
                                }
  
!                               if(1)
                                {
                                        
$this->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php',
--- 572,576 ----
                                }
  
!                               if(!$showadd)
                                {
                                        
$this->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php',
***************
*** 539,544 ****
                                else
                                {
!                                       
$this->template->set_var('row_view_link','');
!                                       
$this->template->set_var('lang_view',lang('Private'));
                                }
  
--- 579,585 ----
                                else
                                {
!                                       
$this->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php',
!                                               
'menuaction=addressbook.uiaddressbook.addfromremote&fields=' . 
urlencode(serialize($entries[$i]))));
! //                                    
$this->template->set_var('lang_view',lang('Add'));
                                }
  
***************
*** 623,626 ****
--- 664,677 ----
                }
  
+               function addfromremote()
+               {
+                       $fields = get_var('fields',array('GET'));
+                       $fields = stripslashes(urldecode($fields));
+                       $fields = unserialize($fields);
+                       $fields['note'] = "\nCopied from remote search.";
+                       $ab_id = $this->bo->add_entry($fields);
+                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.edit&ab_id='
 . $ab_id));
+               }
+ 
                function add()
                {
***************
*** 647,651 ****
                        echo parse_navbar();
  
!                       
$this->addressbook_form('','menuaction=addressbook.uiaddressbook.add','Add','',$customfields,$this->cat_id);
  
                        $this->template->set_var('lang_ok',lang('ok'));
--- 698,702 ----
                        echo parse_navbar();
  
!                       
$this->addressbook_form('','menuaction=addressbook.uiaddressbook.add','Add','',$customfields,$this->cat_id,True);
  
                        $this->template->set_var('lang_ok',lang('ok'));




reply via email to

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