Logo Search packages:      
Sourcecode: egroupware version File versions  Download package


      * eGroupWare -  Addressbook Chooser                                                *
      * http://www.egroupware.org                                              *
        * Written by Alex Borges <alex@sogrp.com>                          *
      * Inherited some code from the addressbook.php file
      * Low Level Design also by    Dave Hall [dave.hall@mbox.com.au]                          *
      * UI Design and market research by Gerardo Ramirez [gramirez@grupogonher.com]
      *-----------------------------------------------                          *
      *  This program is free software; you can redistribute it and/or modify it *
      *  under the terms of the GNU General Public License as published by the   *
      *  Free Software Foundation; either version 2 of the License, or (at your  *
      *  option) any later version.                                              *
      /* $Id: class.uijsaddressbook.inc.php,v 1.7 2004/01/27 16:27:24 reinerj Exp $ */
  @class bojsaddressbook
  @abstract User interface (which means input and output) logic goes here 
  @author Lex
  @ discussion  Understand that
  this is my first attempt to a bo,ui pair of objects
  that will do the job. I turned to do this because
  this thingie has to be available for use by all the
  phpgw 0.9.14 apps.
  My approach is to use abstraction as much as possible.
  This class will handle all user interaction logic.
  ONLY USER INTERACTION. This means that this class has practically no
  state except for the categories cache. What im trying to say here is
  that this class does not query, does not call the contacts backend at all
  it only visually represents whatever the bo class has in its state.
  Now, for how this works:
  Look at the templates. There is a frameset template that decares two frames.
  The mainframe, and the secondary frame. 

  The frameset:
      The frameset template is the main startpoint for this whole system. This
      template declares the main and secondary frames. More importantly, this frame
      declares all functions that are events in the framework. Look into the comments 
      in the frameset template to understand this event framework.
  The mainframe:
      The mainframe is not a large computer. It is an html frame that actaully 
      presents all the user interface to the browser. In the frameset template
      you can see it declared as holding 100% of the screen. And is the frame
      where all the buttons go. Its template file is addressbook-js.tpl
      It should be named addressbook-js-mainframe.tpl in the next release
  The secondaryframe:
      This frame does not have a corresponding template. It serves only as a
      medium of communication with this class by the js framework. This frame
      is directed to the diferent public functions in this class designed to
      generate javascript arrays, strings and onLoad="funcall" type function calls
      to the mainframe. The whole idea is that we server back data in js and tell
      the main frame its data is here by sending a call by the onLoad event (which is
      called just after we finish passing our data.

00059       class uijsaddressbook
            var $public_functions=array ('show' => True,
                                   'show_mainframe' => True,
                                   'show_userdata' => True,
                                   'set_destboxes' => True,
                                   'forget_destboxes' => True,
                                   'forget_all' => True);
            //@param viewmore The value of the viewmore checkbox
            var $viewmore;
            //@param fontsizes The font sizes array that relates screensize to font size in the 
            //renderd css for the main frame
            var $fontsizes=array(
                        '700' =>'xx-small', //800x600 screens
                        '800'  => 'x-small', //1024x768 screens
                        '900'  => 'small' //1600x1200 screens
            //@param searchbox The value of the top search box. This will be the value of the query
            var $searchbox;
            //@param template  We use our own template, cant use the global one if we want to be called
            //from another app...which is one of the objectives of the present class
            var $template;
            //@param toselectbox this exactly what is in the toselectbox input selectbox on the mainform form
            var $toselectbox;
            //@param ccselectbox ditto, ccselectbox
            var $ccselectbox;
            //@param bccselectbox ditto, bccselectbox
            var $bccselectbox;
            //@param cat_id Whatever category id was selected in the category selectbox
            var $cat_id;
            //@param catlist This holds a string of <option> which is given by the getlist call to the category class
            //We cache this result the first time we are called
            var $catlist;
            //@param categoryobject the phpgwapi.category object
            var $categoryobject;
            //@param boxcoming deprecated
            var $boxcoming=false;
            //@param start The value of the start parameter to be passed to the bo class for the query
            var $start;
            //@param order The value of the orther parameter to be passed to the bo class for the query
            var $order;
            //@param filter The value of the filter parameter to be passed to the bo class for the query
            //this value is set by selecting in the drop down right next to the searchautocomplete 
            var $filter;
            //@param sort The value of the filter parameter to be passed to the bo class for the query
            var $sort;
            //@param nameselectbox The value of the selected fields on the name selectbox (center select box)
            var $nameselectbox;
            //@param nameselect The value of the first selected field on the name selectbox (center select box)
            var $nameselect;
            //@param searchautocomplete The value of the searchautocomplete textbox, just above the name selectbox
            var $searchautocomplete;
            //@param hideto If this is set to 1, this framework will hide the toselctbox
            var $hideto;
            //@param hidecc If this is set to 1, this framework will hide the ccselctbox
            var $hidecc;
            //@param hidebcc If this is set to 1, this framework will hide the bccselctbox
            var $hidebcc;
            //@param first_column_label What to show as text at the top of the first column
            var $first_column_label="Select Categories";
            //@param second_column_label What to show as text at the top of the second column
            var $second_column_label="Select Destination";
            //@param third_column_label What to show as text at the top of the third column
            var $third_column_label="Destination Options";
            //@param search_button_value The value to show as "label" for the search button
            var $search_button_value="Search";
            //@param to_button_value The value to show as "label" for the to button
            var $to_button_value="To";
            //@param cc_button_value The value to show as "label" for the cc button
            var $cc_button_value="CC";
            //@param bcc_button_value The value to show as "label" for the cc button
            var $bcc_button_value="BCC";
            //@param cancel_button_value The value to show as "label" for the cancel button
            var $cancel_button_value="Cancel";
            //@param done_button_value The value to show as "label" for the done button
            var $done_button_value="Done";
            //@param remove_button_value The value to show as "label" for the remove button
            var $remove_button_value="Remove";
            //@param bcc_button_value The value to show as "label" for the bcc button
            var $none_button_value="None";
            //@param selected_category_name The selected category to show at the top of the second column 
            var $selected_category_name;
            //@param select_query_command the string to show in the query command drop down box as default
            var $select_query_command="Select Command";
            //@param go_query_command the string to show in the query command as the Search command
            var $go_query_command="Search";
            //@param clear_query_command the string to show in the query command as the clear query command
            var $clear_query_command="Clear Query";
            //@param selected_cat_name of the currently selected category
            var $selected_cat_name;
            //@param globaluid Okay, this is a very strange feature but i need it for my own deployment
            //if this value is set to something, an extra filter option will appear. It will
            //say global directory. My personal way to doing the global directory trick
            //was to make a user called addressmaster, who exports his ontacts to all
            //this valueshould be the addressmaster's uid for your deployment
            var $globaladduid='';
            //@param field_trans
            //This array converts field names of the contact backend (or the bo class for that matter)
            //to english so they can be passed through a lang called to be shown to the user
            var $field_trans = array(
                        'fn'                  => 'full name',
                        'sound'               => 'Sound',
                        'org_name'            => 'company name',
                        'org_unit'            => 'department',
                        'title'               => 'title',
                        'n_prefix'            => 'prefix',
                        'n_given'             => 'first name',
                        'n_middle'            => 'middle name',
                        'n_family'            => 'last name',
                        'n_suffix'            => 'suffix',
                        'label'               => 'label',
                        'adr_one_street'      => 'business street',
                        'adr_one_locality'    => 'business city',
                        'adr_one_region'      => 'business state',
                        'adr_one_postalcode'  => 'business zip code',
                        'adr_one_countryname' => 'business country',
                        'adr_one_type'        => 'business address type',
                        'adr_two_street'      => 'home street',
                        'adr_two_locality'    => 'home city',
                        'adr_two_region'      => 'home state',
                        'adr_two_postalcode'  => 'home zip code',
                        'adr_two_countryname' => 'home country',
                        'adr_two_type'        => 'home address type',
                        'tz'                  => 'time zone',
                        'geo'                 => 'geo',
                        'tel_work'            => 'business phone',
                        'tel_home'            => 'home phone',
                        'tel_voice'           => 'voice phone',
                        'tel_msg'             => 'message phone',
                        'tel_fax'             => 'fax',
                        'tel_pager'           => 'pager',
                        'tel_cell'            => 'mobile phone',
                        'tel_bbs'             => 'bbs phone',
                        'tel_modem'           => 'modem phone',
                        'tel_isdn'            => 'isdn phone',
                        'tel_car'             => 'car phone',
                        'tel_video'           => 'video phone',
                        'tel_prefer'          => 'preferred phone',
                        'email'               => 'business email',
                        'email_type'          => 'business email type',
                        'email_home'          => 'home email',
                        'email_home_type'     => 'home email type',
                        'address2'            => 'address line 2',
                        'address3'            => 'address line 3',
                        'ophone'              => 'Other Phone',
                        'bday'                => 'birthday',
                        'url'                 => 'url',
                        'pubkey'              => 'public key',
                        'note'                => 'notes'

            //@function uijsaddressbook constructor
            //This is the main initializator. Here, we output the mainframe. Tats all we do. Its an important function
            //because the links for the events of the secondaryframe are built and presented to the browser
            //so that when the mainframe triggers an event, it will call some functions in the frameset (its window.parent)
            //And when the secondary frame returns from this public functions (which are all declared and defined in this file)
            //It will also call some of the functions in the frameset.
            function uijsaddressbook()
                  //We create our template
                  //We set its root (we need to be called from other apps as well)
                  // (angles) fix suggested by Dave Hall allows email app compose page to be used with any template, 
                  // fixes bug where email app compose page needed an (empty) template named dir in the email dir tree to use said named template 
                                    'mainframe_t' => 'addressbook-js-frameset.tpl'
                  //Set the charset (important for translations)
                  $charset = $GLOBALS['phpgw']->translation->charset();
                  //Set your normal variables
                  //Dont forget to include oour main javascript file
                  //Get the hider values where needed
                  $this->hideto  = $GLOBALS['HTTP_POST_VARS']['hideto'] ? $GLOBALS['HTTP_POST_VARS']['hideto'] : $GLOBALS['HTTP_GET_VARS']['hideto'];
                  $this->hidecc  = $GLOBALS['HTTP_POST_VARS']['hidecc'] ? $GLOBALS['HTTP_POST_VARS']['hidecc'] : $GLOBALS['HTTP_GET_VARS']['hidecc'];
                  $this->hidebcc  = $GLOBALS['HTTP_POST_VARS']['hidebcc'] ? $GLOBALS['HTTP_POST_VARS']['hidebcc'] : $GLOBALS['HTTP_GET_VARS']['hidebcc'];
                  $this->cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? $GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
                  //Set the link to the main frame...see, this is what im talking about
                  //asd soon as this frameset is server to the browser it will go GET
                  //the given url which is a call to the public function show_mainframe
                  //declared and defined bellow....see what i mean?
                  $this->template->set_var('mainframe_link', $GLOBALS['phpgw']->link(
                                                                              "viewmore" => "1",
                                                                              "cat_id" => $this->cat_id,
                                                                              "hideto" => $this->hideto,
                                                                              "hidecc" => $this->hidecc,
                                                                              "hidebcc" => $this->hidebcc
                  //Set the link for the showuserdata js event. The mainframe will call the get_user_data function
                  //on the frameset if it finds that u have the viewmore checkbox turned on and u clikc on a single
                  //name in the nameselectbox or any of the destination boxes. The get_user_data function
                  //simply directs the secondary frame to this url which acutally passes back the
                  //record for the needed user in urlencoded form as a js string.
                  //This show_userdata public function will also aoutput the body onLoad event call and
                  //will set it to window.parent.userdata_got, so thats the function that will get called in the parent.
                  //That function, in turn, calls the event_userdata_got in the mainframe which actually updates
                  //the contents of the userdata textarea as well as its size. Cool huh?
                  $this->template->set_var('get_user_data_link', $GLOBALS['phpgw']->link(
                                                                              "viewmore" => "1",
                                                                              "cat_id" => "-1"
                  //This does the same as the above (mainly) but it directs the secondary frame to
                  //the set_destboxes function. This is a very complex function that, abstractly, sets
                  //whatever values we pass it through GET, to the destboxes on the bo class (by a call to
                  //bo->set_destboxes) and outputs the emails of those users being set.
                  //It does this in three javascripts array per destination box....lets not get into
                  //that (look for documentation in selectboxes.js), but it works okay.
                  $this->template->set_var('set_destboxes_link', $GLOBALS['phpgw']->link(
                                                                              "hideto" => $this->hideto,
                                                                              "hidecc" => $this->hidecc,
                                                                              "hidebcc" => $this->hidebcc,
                                                                              "viewmore" => "1",
                                                                              "cat_id" => "-1"
                  //This is another event that makes this class call bo->forget_all and makes us forget about our own data too
                  //which are only catlist
                  $this->template->set_var('forget_all_link', $GLOBALS['phpgw']->link(
                  //Important to know our own screensize...
            //@function show
            //@abstract public function merely outputs the parsed frameset template
            function show()
                  // (angles) param False tells it now to try parse_navber_end in phpgwapi functions.inc.php, eliminates this php error:
                  // PHP Fatal error:  Call to undefined function:  parse_navbar_end() in /phpgwapi/inc/footer.inc.php on line 62
            //@function setup_main_frame
            //@abstract This function is very large. Its the code that prebuilds all static data for the mainframe
            function setup_main_frame()
                  //Git our templates
                                    'addressbook_names_t' => 'addressbook-js.tpl',
                                    'addressbook_names' => 'addressbook-js.tpl',
                                    'secofile_t' => 'addressbook-js-bits.tpl',
                                    'hidden_emails_t' => 'addressbook-js-bits.tpl',
                                    'selectboxes_t' => 'addressbook-js-bits.tpl'

                  /* DEPRECATED We initialize this switch that tells the code if any comes with data in it */

                  $this->searchbox  = $GLOBALS['HTTP_POST_VARS']['searchbox'] ? $GLOBALS['HTTP_POST_VARS']['searchbox'] : $GLOBALS['HTTP_GET_VARS']['searchbox'];
                  $this->querycommand=$GLOBALS['HTTP_POST_VARS']['querycommand'] ? $GLOBALS['HTTP_POST_VARS']['querycommand'] : $GLOBALS['HTTP_GET_VARS']['querycommand'];
                  if($this->querycommand=='cleanquery')//We have been ordered to clean the query
                  elseif(!$this->searchbox)//wow, nothing in the searchbox, and weve been ordered to serve
                                    //....look for it in the cache
                  /*      This is the View More checkbox */
                  $this->viewmore = $GLOBALS['HTTP_POST_VARS']['viewmore'] ? $GLOBALS['HTTP_POST_VARS']['viewmore'] : $GLOBALS['HTTP_GET_VARS']['viewmore'];

                        The next three are, respectively, the selected To:,cc and bcc  selectboxes. We need them to remember if
                        they something was selected on them and we, for example, clicked on a name and, thus, submited the form.
                        We need to keep all values in this boxes. This is why the js code autoselects all of the options
                        just before submiting. BTW, this should come in post allways but its a good practice to allways try and 
                        get from both. Good thing about get_var in 0.9.15.
                  $this->toselectbox=$GLOBALS['HTTP_POST_VARS']['toselectbox']? $GLOBALS['HTTP_POST_VARS']['toselectbox'] : $GLOBALS['HTTP_GET_VARS']['toselectbox'];
                  $this->ccselectbox=$GLOBALS['HTTP_POST_VARS']['ccselectbox']? $GLOBALS['HTTP_POST_VARS']['ccselectbox'] : $GLOBALS['HTTP_GET_VARS']['ccselectbox'];
                  $this->bccselectbox=$GLOBALS['HTTP_POST_VARS']['bccselectbox']? $GLOBALS['HTTP_POST_VARS']['bccselectbox'] : $GLOBALS['HTTP_GET_VARS']['bccselectbox'];
                  $this->nameselectbox  = $GLOBALS['HTTP_POST_VARS']['nameselect'] ? $GLOBALS['HTTP_POST_VARS']['nameselect'] : $GLOBALS['HTTP_GET_VARS']['nameselect'];
                  //nameselect is the value of the first selection in the nameselectbox
                  $this->nameselect = $this->nameselectbox[0];
                  $this->start  = $GLOBALS['HTTP_POST_VARS']['start'] ? $GLOBALS['HTTP_POST_VARS']['start'] : $GLOBALS['HTTP_GET_VARS']['start'];
                  $this->filter  = $GLOBALS['HTTP_POST_VARS']['filter'] ? $GLOBALS['HTTP_POST_VARS']['filter'] : $GLOBALS['HTTP_GET_VARS']['filter'];
                  //To selectbox must be hidden,set variables acordinlgy....likewise for cc and bcc
                        $this->template->set_var('hideto_open',"<!-- ");
                        $this->template->set_var('hideto_close'," --> ");
                        $this->template->set_var('hideto_close'," ");
                        $this->template->set_var('hidecc_open',"<!-- ");
                        $this->template->set_var('hidecc_close'," --> ");
                        $this->template->set_var('hidecc_close'," ");
                        $this->template->set_var('hidebcc_open',"<!-- ");
                        $this->template->set_var('hidebcc_close'," --> ");
                        $this->template->set_var('hidebcc_close'," ");
                  //In the same idea, see if we really want the directory option turned on

                  //Set the template vars as needed to remember the selected filter in
                  //the filter dropdown (right besides the autocomplete textbox)
                        case "none":
                        case "private":
                        case "user_only":
                              $this->template->set_var('mine_is_selected'," selected");
                        case "directory":

                  //Get our category id
                  $this->cat_id  = $GLOBALS['HTTP_POST_VARS']['cat_id'] ? $GLOBALS['HTTP_POST_VARS']['cat_id'] : $GLOBALS['HTTP_GET_VARS']['cat_id'];
                  //print "<br> ".$this->cat_id;
                  //Check if we have to check in the cache
                  if($this->cat_id == -1)
                        //Supposedly, the user wants us to show nothing, no query being made.
                        //BUT, we check if we have cache that needs has another value
                        if(!$this->cat_id)//if we still have nothing
                              //Then we believe the user wants no query, otherwise, we used
                              //the cached cat_id
                  //When the category id is -2, this means we selected all
                  $this->cat_id = ($this->cat_id == -2)?"":$this->cat_id;
                  //SPecial Personal category means filter=mine, catid=none
                  if($this->cat_id == -3)
                  //The order query field...NOT USED ATM
                  $this->order  = $GLOBALS['HTTP_POST_VARS']['order'] ? $GLOBALS['HTTP_POST_VARS']['order'] : $GLOBALS['HTTP_GET_VARS']['order'];
                  //So we remember the autocomplete's value
                  $this->searchautocomplete  = $GLOBALS['HTTP_POST_VARS']['searchautocomplete'] ? $GLOBALS['HTTP_POST_VARS']['searchautocomplete'] : $GLOBALS['HTTP_GET_VARS']['searchautocomplete'];
                  if(!$this->searchautocomplete&&($this->querycommand != 'cleanquery'))//again, not found in the vars, look for it in cache
                  elseif($this->querycommand == 'cleanquery')//wants us to clean the cache
                  //The sort field ... NOTUSED ATM
                  $this->sort = $GLOBALS['HTTP_POST_VARS']['sort'] ? $GLOBALS['HTTP_POST_VARS']['sort'] : $GLOBALS['HTTP_GET_VARS']['sort'];
                  //Starnge.... i have no idea what does this do
                  $catid_string=($this->cat_id) ? "cat_id=".$this->cat_id : "";
                  /*      We need to get some preferences here so we can set the width the addressbook will have */

                  /*      Block initialization... u see why i got the previous variables first dont you? */
                  /*      Normal stuff and setting of template vars as they come  */
                  $this->template->set_var('lang_addressbook_action',lang('Address book'));
                  $this->template->set_var('searchbox_value',(($searchbox) ? $searchbox : ""));
                  $this->template->set_var('search_ac_value',(($this->searchautocomplete) ? $this->searchautocomplete : ""));
                  //Label settings------------
                  //for columns!
                  //for buttons!
                  //for query command dropdown!
                  $this->categoryobject->app_name = 'addressbook';
                  //End Label setting--------------
                  $this->template->set_var('viewmore_checked',($this->viewmore ? "checked" :""));
//                //Try and get the <option> string for the categories form cache
//                $this->catlist=$GLOBALS['phpgw']->session->appsession('jsuibook_catlist','email');
//                //We dont have none
//                if(!$this->catlist)
//                {
                        //We get it from the category class and ...
                        $this->categoryobject->app_name = 'addressbook';
                        $this->catlist=ereg_replace( '&nbsp;&lt;' . lang('Global') . '&nbsp;' . lang($this->categoryobject->app_name).'&gt;'
                        //....save it in the cache
//                      $GLOBALS['phpgw']->session->appsession('jsuibook_catlist','email',$catlist);
//                }

                                          'menuaction'      => "email.uijsaddressbook.show_mainframe",
                                          'sort'          => $this->sort,
                                          'order'         => $this->order,
                                          'filter'        => $this->filter,
                                          'start'         => $this->start,
                                          'query'         => $this->query,
                                          'cat_id'        => $this->cat_id,
                                          'hideto'    => $this->hideto,
                                          'hidecc'    => $this->hidecc,
                                          'hidebcc'   => $this->hidebcc
                  //Try and remember what values where selected so that we can put them back in the boxes as needed
                  //The contactquery to send to the bo class constructor. Look into the bo class
                  //for a discussion of this parameter
                  $contactquery=($this->cat_id==-1) ?"":array('start' => $this->start,
                                              'order' => $this->order,
                                              'categories' => ($this->cat_id<0)?"":$this->cat_id,
                                              'filter' => ($this->filter) ? $this->filter:"none",
                                              'query' => $this->searchbox,
                                              'sort' => $this->sort,
                                              'directory_uid' => $this->globaladduid
      //          print "<BR>";
      //          print_r($contactquery);           
                        //This means the nameselect box was clicked to find out info for a given user
                        //So, no need to requery the database, the bo class already knows what the names are
            //@function show_mainframe
            //@abstract Actual public function that outputs the main frame
            //This is in need of serious chaneg, i inherited most of this code from the previous
            //addressbook and really its not meant to do the same thing....
            function show_mainframe()
                  //Initialize the static data ....
                  //Get ourselves the result from the query made in setup_main_frame
                  //Go and parse the destinationboxes first
                  //Iterate from the result, see if we dont need
                  //to output anything that was outputed in the selectboxes
                  for ($i=0;$i<count($entries);$i++)
                        if(trim($entries[$i]['fn'])== '')
                              $fullname=$firstname." ".$lastname;
                        // --------------------- template declaration for list records --------------------------
                        //if it went into the other boxes, we dont let him be in the select from box
                        if((!$this->toselectbox[$id]) && (!$this->ccselectbox[$id]) && (!$this->bccselectbox[$id]))
                              //Remember selected
                                          $this->template->set_var('name_option_selected'," selected");

//                      $this->template->set_var('hidden_value',$email);
//                      $this->template->set_var('hidden_name',"emails[$id]");
//                      $this->template->parse('V_hidden_emails_list','B_hidden_emails_list',True);
                  // --------------------------- end record declaration ---------------------------


            //@function show_destboxes
            //@abstract This function outputs the destination boxes. 
            //@access private
            //@discussion this private function prints the destination boxes content
            //This functions queries the bo class for the destination boxes it has
            //cached. It then proceeds to parse that data out by templates
            //Importantly, this calss takes good care of outputing hidden email[] fields
            //for every element. Its important because the js frontend uses this to
            //naturaly put the email into the compose textboxes
            function show_destboxes()
                  //Make shure this guy doesnt go into the to,cc or bcc selectboxes
                  //it expects the templates are well initialized as far as the destboxes blocks go
                  $this->bo=(isset($this->bo)) ? $this->bo : CreateObject("email.bojsaddressbook");
                  if(is_array($selectboxes['toselectbox']) && (!$this->hideto))
                  if(is_array($selectboxes['ccselectbox']) && (!$this->hidecc))
                  if(is_array($selectboxes['bccselectbox']) && (!$this->hidebcc))

            //@function set_detboxes
            //@access public
            //@abstract Sets the destination boxes valeus in the boclass
            //outputs email,keys and names js arrays for the js framwork to use
            //@discussion this public function gets called from a secondary frame by uri to 
            //set the values for the destination boxes..... it expects
            //the destination boxes options to come in through GPC vars
            function set_destboxes()
                  $this->toselectbox=$GLOBALS['HTTP_POST_VARS']['toselectbox']? $GLOBALS['HTTP_POST_VARS']['toselectbox'] : $GLOBALS['HTTP_GET_VARS']['toselectbox'];
                  $this->ccselectbox=$GLOBALS['HTTP_POST_VARS']['ccselectbox']? $GLOBALS['HTTP_POST_VARS']['ccselectbox'] : $GLOBALS['HTTP_GET_VARS']['ccselectbox'];
                  $this->bccselectbox=$GLOBALS['HTTP_POST_VARS']['bccselectbox']? $GLOBALS['HTTP_POST_VARS']['bccselectbox'] : $GLOBALS['HTTP_GET_VARS']['bccselectbox'];
                  $deleted=$GLOBALS['HTTP_POST_VARS']['deleted']? $GLOBALS['HTTP_POST_VARS']['deleted'] : $GLOBALS['HTTP_GET_VARS']['deleted'];
                  $forget_after=$GLOBALS['HTTP_POST_VARS']['forget_after']? $GLOBALS['HTTP_POST_VARS']['forget_after'] : $GLOBALS['HTTP_GET_VARS']['forget_after'];
                              "toselectbox" => $this->toselectbox,
                              "ccselectbox" => $this->ccselectbox,
                              "bccselectbox" => $this->bccselectbox
                  //leftover will hold any info that has not already been outputed
                  //hint: emails are in a hidden field, if we are asyncronically calling this
                  //    we need to return a js array with the missing emails and stuff
                  //    so the caller JS can update the selectboxes as needed
                              if(is_array($boxar) && (count($boxar) > 0))
                                    if(!($hide[$boxk]==1) )

                  print $this->final_js($arrays,"window.parent.destboxes_set();");
            //@function forget_destboxes
            //@access public
            //@abstract This function makes the bo class forget all destboxes data

            //@function forget_all
            //@access public
            //@abstract This function makes the bo class forget everything in cache
                  //forget our own cache
                        print $this->final_js("","window.parent.all_forgoten();");

            //@function show_userdata
            //@access public
            //@abstract this function queries the bo class for the given
            //id field in the addressbook
            //We need to drop all this userdata talk, this are not users, they are
            //addressbook entries. This expects the id to the addressbook record
            //to come in through the nameselect userdata field
            //If it gets it, it will query the bo class for its data
            //It will then make a js string and the corresponding call to the frameset to
            //tell the mainframe userdata has arrived
            function show_userdata()
                                    'userdata_t' => 'addressbook-js-bits.tpl'
                  $this->nameselect  = $GLOBALS['HTTP_POST_VARS']['nameselect'] ? $GLOBALS['HTTP_POST_VARS']['nameselect'] : $GLOBALS['HTTP_GET_VARS']['nameselect'];
                  $data = $this->bo->recordinfo($this->nameselect);
                        exit("user not found");
                        if($actualsize > $largest)
                        if($this->field_trans[$k] && strlen($v))
                              $largestfull=($largestfull < $actualsize) ? $actualsize : $largestfull;
                  print $this->final_js("var userdata_rows; 
                                    var userdata_cols; 
                                    var userdata; 
            //@function ary_to_js
            //@access private
            //@discussion The idea is to have an array whose keys will tell us the varname (js)
            //and, those will point to the actual array to be converted
            function ary_to_js($ary)
                        if(is_array($v) && (count($v)>0))
                              $ret=$ret."var ".$k.";";
                              $ret=$ret." $k = new Array(".count($v).");";
                  return $ret;
            //@function final_js
            //@access private
            //@param innerstring Js code to be put within script tags
            //@param functioncall the name of the function to call onLoad
            //@discussion This builds the pages of the secondary frame
            //As you can see, its prepared to accept some js in its
            //innerstring parameter to be inserted in the middle of script tags
            //Also, it accepts a string that is supposed to be the javascript call to the frameset function
            //that tells the js framework we have outputed the data it queried for.
            function final_js($innerstring,$functioncall)
                        <script language=\"javascript\">";
                        <body onLoad=\"$functioncall\">
                  return $retstr.''.$innerstring.''.$close;

Generated by  Doxygen 1.6.0   Back to index