source: branches/2.4/contactcenter/inc/class.ui_api.inc.php @ 7509

Revision 7509, 21.9 KB checked in by eduardow, 11 years ago (diff)

Ticket #3185 - Melhorar disposição do campo email na adição de contatos.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /***************************************************************************\
3  * eGroupWare - Contacts Center                                              *
4  * http://www.egroupware.org                                                 *
5  * Written by:                                                               *
6  *  - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net>         *
7  *  - Jonas Goes <jqhcb@users.sourceforge.net>                               *
8  *  sponsored by Thyamad - http://www.thyamad.com                            *
9  * ------------------------------------------------------------------------- *
10  *  This program is free software; you can redistribute it and/or modify it  *
11  *  under the terms of the GNU General Public License as published by the    *
12  *  Free Software Foundation; either version 2 of the License, or (at your   *
13  *  option) any later version.                                               *
14  \***************************************************************************/
15
16        /*
17         * This is the Main ContactCenter API for other eGroupWare applications
18         *
19         */
20 
21        class ui_api
22        {
23                var $commons;
24                var $commons_loaded = false;
25               
26                function ui_api()
27                {
28                        $preferences = ExecMethod('contactcenter.ui_preferences.get_preferences');
29
30                        if (!is_array($preferences))
31                        {
32                                $preferences['personCardEmail'] = 1;
33                        }
34                        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
35
36                        $template->set_file(array('api' => 'api_common.tpl'));
37                        /* Style Sheets */
38                        $template->set_var('cc_css', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/styles/cc_api.css');
39                        $template->set_var('cc_dtree_css', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/dftree/dftree.css');
40
41                        $template->set_var('cc_email_id_type', $preferences['personCardEmail']);
42                       
43                       
44                        /* Messages */
45                        $template->set_var('cc_msg_err_invalid_catalog',lang('Unavailable or empty Catalog'));
46                        $template->set_var('cc_msg_err_contacting_server',lang('Couldn\'t contact server or server response is invalid. Contact Admin.'));
47                        $template->set_var('cc_msg_err_timeout',lang('Operation Timed Out.'));
48                        $template->set_var('cc_msg_err_serialize_data_unknown',lang('Data to be serialized is of unknown type!'));
49                        $template->set_var('cc_msg_err_shared',lang('No shared catalog that has permission to add.'));
50                        $template->set_var('cc_msg_err_duplicate_group',lang('This group name already exists, please enter another name.'));
51                        /* End Messages */
52
53                        if ($preferences['displayConnector'])
54                        {
55                                $template->set_var('cc_connector_visible', 'true');
56                        }
57                        else
58                        {
59                                $template->set_var('cc_connector_visible', 'false');
60                        }
61                        $template->set_var('cc_loading_1', lang('Contacting Server...'));
62                        $template->set_var('cc_loading_2', lang('Server Contacted. Waiting for response...'));
63                        $template->set_var('cc_loading_3', lang('Processing Information...'));
64                        $template->set_var('cc_loading_image', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/templates/default/images/loading_back.png');
65                        $template->set_var('cc_server_root', $GLOBALS['phpgw_info']['server']['webserver_url']);
66                        $template->set_var('cc_phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images');
67
68                        /* JS Files */
69                        $template->set_var('cc_js_aux', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccAux.js');
70                        $template->set_var('cc_js_connector', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/connector.js');
71                        $template->set_var('cc_js_wz_dragdrop', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/wz_dragdrop/wz_dragdrop.js');
72                        $template->set_var('cc_js_dtree', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/dftree/dftree.js');
73                        $template->set_var('cc_js_dtabs', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/dTabs/dTabs.js');
74                        $template->set_var('cc_js_djswin', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/dJSWin/dJSWin.js');
75                        $template->set_var('cc_js_catalog_tree', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_tree.js');
76                       
77                        $template->parse('out','api');
78
79                        $this->commons = $template->get_var('out');
80                        $this->commons_loaded = false;                 
81                        }
82               
83                /* DEPRECTED! Use get_email_win() instead */
84                function ui_get_email_win()
85                {
86                        return $this->get_email_win();
87                }
88
89                function get_email_win()
90                {
91                        //$search = $this->ui_get_search_win();
92                       
93                        $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/';
94                        $template = CreateObject('phpgwapi.Template', $template_dir);
95
96                        $template->set_file(array('email_win' => 'email_win.tpl'));
97                       
98                        if (!$this->commons_loaded)
99                        {
100                                $template->set_var('cc_api', $this->commons);
101                                $this->commons_loaded = true;
102                        }
103                        else
104                        {
105                                $template->set_var('cc_api', '');
106                        }
107                       
108                        //$template->set_var('cc_search_win', $search);
109                        $template->set_var('cc_js_search', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search.js');
110                       
111                        $template->set_var('cc_email_id_type', $search);
112                       
113                        $template->set_var('cc_email_win_title',lang('Contact Center').' - '.lang('Catalog Entries Emails'));
114                        $template->set_var('cc_email_status',lang('Status').':');
115                        $template->set_var('cc_email_search_text',lang('Search').'...');
116                       
117                        $template->set_var('cc_choose_catalogue',lang('Choose a catalogue').'...');
118                        $template->set_var('cc_choose_ordinance',lang('Choose a ordinance').'...');
119                       
120                        $template->set_var('cc_btn_to_add',lang('To').' >>');
121                        $template->set_var('cc_btn_to_del','<< '.lang('To'));
122                        $template->set_var('cc_btn_cc_add',lang('Cc').' >>');
123                        $template->set_var('cc_btn_cc_del','<< '.lang('Cc'));
124                        $template->set_var('cc_btn_cco_add',lang('Bcc').' >>');
125                        $template->set_var('cc_btn_cco_del','<< '.lang('Bcc'));
126                        $template->set_var('cc_btn_new',lang('New').'...');
127                        $template->set_var('cc_btn_details',lang('Details').'...');
128                        $template->set_var('cc_btn_update',lang('Update'));
129                        $template->set_var('cc_btn_ok',lang('Ok'));
130                        $template->set_var('cc_btn_cancel',lang('Cancel'));
131                       
132                        $template->set_var('cc_label_to',lang('To').':');
133                        $template->set_var('cc_label_cc',lang('Cc').':');
134                        $template->set_var('cc_label_cco',lang('Bcc').':');
135                        $template->set_var('cc_label_entries',lang('Entries').':');
136                        $template->set_var('cc_label_catalogues',lang('Catalogues').':');
137                        $template->set_var('cc_label_catalogue_type',lang('Type Of Catalogue').':');
138                        $template->set_var('cc_label_ordinance_type',lang('Type Of Ordinace').':');
139                       
140                        $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images');
141                       
142                        $template->set_var('cc_js_email_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_email_win.js');
143                       
144                        $template->parse('out','email_win');
145
146                        return $template->get_var('out');
147                }
148
149                function ui_get_search_win()
150                {
151                        return $this->get_search_win();
152                }
153
154                function get_search_win()
155                {
156                        $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/';
157                        $template = CreateObject('phpgwapi.Template',$template_dir);
158
159                        $template->set_file(array('search' => 'search_win.tpl'));
160                       
161                        if (!$this->commons_loaded)
162                        {
163                                $template->set_var('cc_api', $this->commons);
164                                $this->commons_loaded = true;
165                        }
166                        else
167                        {
168                                $template->set_var('cc_api', '');
169                        }
170                       
171                        $template->set_var('cc_search_title',lang('Contact Center - Search for Catalog Entries'));
172                        $template->set_var('cc_search_minimize',lang('Minimize'));
173                        $template->set_var('cc_search_close',lang('Close'));
174                        $template->set_var('cc_search_catalogues',lang('Catalogues'));
175                        $template->set_var('cc_search_for',lang('Search for...'));
176                        $template->set_var('cc_search_recursive',lang('Recursive Search?'));
177                        $template->set_var('cc_search_go',lang('Go'));
178                        $template->set_var('cc_search_cancel',lang('Cancel'));
179                       
180                        $template->set_var('cc_js_search_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search_win.js');
181                       
182                        $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images');
183                       
184                        $template->parse('out','search');
185
186                        return $template->get_var('out');
187                }
188               
189                function get_contact_details()
190                {
191                        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
192                        $template->set_file(array('details' => 'contact_details.tpl'));
193                       
194                        if (!$this->commons_loaded)
195                        {
196                                $template->set_var('cc_api', $this->commons);
197                                $this->commons_loaded = true;
198                        }
199                        else
200                        {
201                                $template->set_var('cc_api', '');
202                        }
203                       
204                        //$template->set_var('ccContactDetails.js', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccContactDetails.js');
205                        $template->set_var('cc_contact_details_title',lang("Contact's details"));
206                        $template->set_var('cc_contact_details_close',lang("Close"));
207                        $template->set_var('cc_contact_details_no_fields',lang("The extra details are not configured."));
208                        $template->set_var('cc_contact_details_attr_name',lang("Attribute name"));
209                        $template->set_var('cc_contact_details_attr_value',lang("Value"));
210                        $template->parse('out','details');
211                        return $template->get_var('out');
212                }
213
214                function get_search_obj()
215                {
216                        return "\n".'<script type="text/javascript" src="'.$GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search.js'.'"></script>'."\n";
217                }
218
219                function ui_get_full_add()
220                {
221                        return $this->get_full_add();
222                }
223
224                function get_full_add()
225                {
226                        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
227            if($GLOBALS['phpgw_info']['server']['personal_contact_type']=='True'){
228                                $template->set_file(array('full_add' => 'corporative_full_add.tpl'));
229                                $template->set_var('cc_contact_type','advanced');
230                        }else{
231                                $template->set_file(array('full_add' => 'full_add.tpl'));
232                                $template->set_var('cc_contact_type','default');
233                        }
234                        if (!$this->commons_loaded)
235                        {
236                                $template->set_var('cc_api', $this->commons);
237                                $this->commons_loaded = true;
238                        }
239                        else
240                        {
241                                $template->set_var('cc_api', '');
242                        }
243                       
244                        $template->set_var('cc_contact_title',lang('Contact Center').' - '.lang('Contacts'));
245
246                        /* Messages */
247                        $template->set_var('cc_msg_err_empty_field',lang('field is empty'));
248                        $template->set_var('cc_msg_type_state',lang('Type new state here').'...');
249                        $template->set_var('cc_msg_type_city',lang('Type new city here').'...');
250                        /* End Messages */
251                       
252                        /* Contact */
253                        $template->set_var('cc_contact_save',lang('Save'));
254                        $template->set_var('cc_contact_cancel',lang('Cancel'));
255                        $template->set_var('cc_contact_reset',lang('Reset'));
256
257                        $template->set_var('cc_contact_personal',lang('Personal'));
258                        $template->set_var('cc_contact_addrs',lang('Addresses'));
259                        $template->set_var('cc_contact_corporative',lang('Corporative'));
260                        $template->set_var('cc_contact_conns',lang('Connections'));
261                        $template->set_var('cc_contact_grps', lang('Groups'));
262                        $template->set_var('emails_telephones', lang("E-Mails and Telephones"));
263                        $template->set_var('cc_default', lang("Default"));
264
265                        $template->set_var('cc_contact_shared',lang('Add to catalog'));
266                        $template->set_var('cc_contact_shared_types',lang('Choose in wich catalog you would like to add...'));
267
268                        /* End Contact */
269                       
270                        /* Contact - Personal Data */
271                        $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
272               
273                        $j = 0;
274                        for ($i = 0; $i < 5; $i+=2)
275                        {
276                                switch($dateformat{$i})
277                                {
278                                        case 'Y':
279                                                $date[$j]['size'] = 4;
280                                                $date[$j]['name'] = lang('Year');
281                                                break;
282
283                                        case 'm':
284                                        case 'M':
285                                                $date[$j]['size'] = 2;
286                                                $date[$j]['name'] = lang('Month');
287                                                break;
288
289                                        case 'd':
290                                                $date[$j]['size'] = 2;
291                                                $date[$j]['name'] = lang('Day');
292                                }
293                                $j++;
294                        }
295                       
296                        $template->set_var('cc_pd_birth_size_0', "{$date[0]['size']}");
297                        $template->set_var('cc_pd_birth_size_1', "{$date[1]['size']}");
298                        $template->set_var('cc_pd_birth_size_2', "{$date[2]['size']}");
299                       
300                        $template->set_var('cc_pd_birthdate_0', "{$date[0]['name']}");
301                        $template->set_var('cc_pd_birthdate_1', "{$date[1]['name']}");
302                        $template->set_var('cc_pd_birthdate_2', "{$date[2]['name']}");
303
304                        $template->set_var('cc_pd_select_photo_b', lang('Browse').'...');
305                        $template->set_var('cc_form_photo_src', 'photo_form.html');
306                       
307                        $template->set_var('cc_pd_select_photo',lang('Select Photo'));
308                        $template->set_var('cc_pd_alias',lang('Alias'));
309                        $template->set_var('cc_pd_given_names',lang('Given Names'));
310                        $template->set_var('cc_pd_family_names',lang('Family Names'));
311                        $template->set_var('cc_pd_full_name',lang('Full Name'));
312                        $template->set_var('cc_pd_birthdate',lang('Birthdate'));
313                        $template->set_var('cc_pd_gpg_finger_print',lang('GPG Finger Print'));
314                        $template->set_var('cc_pd_suffix',lang('Suffix'));
315                        $template->set_var('cc_pd_choose_suffix',lang('Choose Suffix...'));
316                        $template->set_var('cc_pd_prefix',lang('Prefix'));
317                        $template->set_var('cc_pd_choose_prefix',lang('Choose Prefix...'));
318                        $template->set_var('cc_pd_notes',lang('Notes'));
319                        $template->set_var('cc_pd_sex',lang('Sex'));
320                        $template->set_var('cc_pd_choose_sex',lang('Choose Sex ...'));
321                        $template->set_var('cc_pd_male',lang('Male'));
322                        $template->set_var('cc_pd_female',lang('Female'));
323                        /* End Contact - Personal Data */
324                       
325                        /* Contact - Addresses */
326                        $template->set_var('cc_addr_types',lang('Type of Address'));
327                        $template->set_var('cc_addr_choose_types',lang('Choose Type of Address').'...');
328                        $template->set_var('cc_addr_countries',lang('Country'));
329                        $template->set_var('cc_addr_choose_countries',lang('Choose Country').'...');
330                        $template->set_var('cc_addr_states',lang('State'));
331                        $template->set_var('cc_addr_states_new',lang('New State').'...');
332                        $template->set_var('cc_addr_states_nostate',lang('No State'));
333                        $template->set_var('cc_addr_choose_states',lang('Choose State').'...');
334                        $template->set_var('cc_addr_cities',lang('City'));
335                        $template->set_var('cc_addr_cities_new',lang('New City').'...');
336                        $template->set_var('cc_addr_choose_cities',lang('Choose City').'...');
337                        $template->set_var('cc_addr_1',lang('Address 1'));
338                        $template->set_var('cc_addr_2',lang('Address 2'));
339                        $template->set_var('cc_addr_complement',lang('Complement'));
340                        $template->set_var('cc_addr_other',lang('Address Other'));
341                        $template->set_var('cc_addr_postal_code',lang('Postal Code'));
342                        $template->set_var('cc_addr_po_box',lang('PO Box'));
343                        $template->set_var('cc_addr_is_default',lang('Is Default?'));
344                        $template->set_var('cc_addr_yes',lang('Yes'));
345                        $template->set_var('cc_addr_no',lang('No'));
346                        $template->set_var('cc_available',lang('Available'));
347                        /* End Contact - Addresses */
348                       
349                       
350                        /* Contact - Connections */
351                        $template->set_var('cc_conn_type',lang('Type of Connection'));
352                        $template->set_var('cc_conn_name',lang('Connection Name'));
353                        $template->set_var('cc_conn_value',lang('Connection Value'));
354                       
355                        $template->set_var('cc_new_same_type',lang('New from the same Type').'...');
356                       
357                        $template->set_var('cc_conn_type_none',lang('Choose Type of Connection').'...');
358                        /* End Contact - Connections */
359
360                        /* Contact - Groups */
361                        $template->set_var('cc_grps_available', lang('Groups available'));
362                        $template->set_var('cc_grps_selected', lang('Selected groups'));
363                        $template->set_var('txt_add', lang('Add'));
364                        $template->set_var('txt_rem', lang('Remove'));
365                        /* End Contact - Groups */
366
367                        /* Corporate - contact */
368                        $template->set_var('cc_name_corporate',lang('Corporate'));
369                        $template->set_var('cc_job_title',lang('Job Title'));
370                        $template->set_var('cc_department',lang('Department'));
371                        $template->set_var('cc_web_page',lang('Web Page'));
372
373                        $template->set_var('email', lang("E-Mail"));
374                        $template->set_var('telephone', lang("Telephone"));
375                        $template->set_var('choose_email_telephone', lang("Choose 'E-Mail' or 'Telephone'"));
376
377                        $template->parse('out_full', 'full_add');
378
379                        return $template->get_var('out_full');
380                }
381
382                function get_quick_add_plugin()
383                {
384                        $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/';
385                        $template = CreateObject('phpgwapi.Template',$template_dir);
386
387                        $template->set_file(array('quickAdd' => 'quickAddPlugin.tpl'));
388                       
389                        if (!$this->commons_loaded)
390                        {
391                                $template->set_var('cc_api', $this->commons);
392                                $this->commons_loaded = true;
393                        }
394                        else
395                        {
396                                $template->set_var('cc_api', '');
397                        }
398                       
399                        $template->set_var('ccQAPluginFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccQuickAdd-plugin.js');
400
401                        /* Fields Insertion */
402
403                        // TODO: get this from preferences
404                        $nFields = 5;
405                        $fields = array(
406                                lang('Alias'),
407                                lang('Given Names'),
408                                lang('Family Names'),
409                                lang('Phone'),
410                                lang('Email')
411                        );
412                       
413                        $template->set_var('ccQAnFields', $nFields);
414                       
415                        $fieldsHTML = '';
416                        $fieldsTop = 10;
417                        $fieldsSpace = 30;
418                        for ($i = 0; $i < $nFields; $i++)
419                        {
420                                $fieldsHTML .= '<span id="ccQuickAddT'.$i.'" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 5px; width: 100px; text-align: right; border: 0px solid #999;">'.$fields[$i].':</span>'."\n";
421                                if ($i == 0){
422                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" maxlength="30" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n";
423                                }
424                                else if ($i == 4){
425                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" maxlength="100" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px; text-transform:lowercase;">'."\n";
426                                }else if ($i == 3){
427                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" onkeyup="formatPhone(this)" maxlength="30" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n";
428                                }
429                                else {
430                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" maxlength="50" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n";
431                                }
432                        }
433
434                        $template->set_var('ccQAFields', $fieldsHTML);
435                        $template->set_var('ccQAWinHeight', ($i+1)*$fieldsSpace+$fieldsTop);
436                        $template->set_var('ccQAFunctionsTop', ($fieldsTop+$i*$fieldsSpace).'px');
437                       
438                        /* Images Dir */
439                        $template->set_var('ccQACardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/');
440                       
441                        /* Texts */
442                        $template->set_var('ccQATitle', lang('Contact Center').' - '.lang('Quick Add'));
443                        $template->set_var('ccQASave', lang('Save'));
444                        $template->set_var('ccQAClear', lang('Reset'));
445                        $template->set_var('ccQACancel', lang('Cancel'));
446                       
447                        $template->parse('out_QA', 'quickAdd');
448
449                        return $template->get_var('out_QA');
450                }
451
452                function parseGroupOption($level, $name, $selected=false){
453
454                    $selected = $selected?'selected="selected"':'';
455                    $optionTemplate = '<option value="{level}" {selected}>{value}</option>';
456
457                    $optionTemplate = preg_replace('/\{level\}/', $level, $optionTemplate);
458                    $optionTemplate = preg_replace('/\{selected\}/', $selected, $optionTemplate);
459                    $optionTemplate = preg_replace('/\{value\}/', $name, $optionTemplate);
460
461                    return $optionTemplate;
462
463                }
464
465                function getCatalogItens($level='0', $parentName=false){
466                    $bo = CreateObject('contactcenter.bo_contactcenter');
467
468                    $options = '';
469
470                    $catalogTree = $bo->get_catalog_tree('0');
471                    foreach ($catalogTree as $id => $catalog)
472                    {
473                        if ($level.'.'.$id !== '0.1')
474                        {
475                            $option = $level.'.'.$id === '0.0'?
476                                $this->parseGroupOption($level.'.'.$id, $catalog['name'], true):
477                                $this->parseGroupOption($level.'.'.$id, $catalog['name']);
478                            $options .= $option;
479                        }
480                    }
481                    return $options;
482                }
483               
484                function get_add_group()
485                {
486                        $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/';
487                        $template = CreateObject('phpgwapi.Template',$template_dir);
488
489                        $template->set_file(array('addGroup' => 'addGroup.tpl'));
490
491                        $catalogOptions = $this->getCatalogItens();
492                       
493                        if (!$this->commons_loaded)
494                        {
495                                $template->set_var('cc_api', $this->commons);
496                                $this->commons_loaded = true;
497                        }
498                        else
499                        {
500                               
501                                $template->set_var('cc_api', '');
502                        }
503
504                        $template->set_var('ccAGSourceSelectContent', $catalogOptions);
505                        $template->set_var('ccAGSearch', lang('Search'));
506                       
507                        $template->set_var('ccAGFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccAddGroup.js');                 
508                        $template->set_var('ccAGWinHeightIE', '340');
509                        $template->set_var('ccAGWinHeightMO', '300');
510                       
511                        /* Images Dir */
512                        $template->set_var('ccAGCardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/');
513                       
514                        /* Texts */
515                        $template->set_var('ccAGTitle', lang('Contact Center').' - '.lang('Group Add'));
516                        $template->set_var('ccAGSave', lang('Save'));
517                        $template->set_var('ccAGClear', lang('Reset'));
518                        $template->set_var('ccAGCancel', lang('Cancel'));
519                        $title = '<input type="text" id="title" name="title" value="'.$group['title'].'" size="53" maxlength="50"/>';                   
520                               
521                        $template->set_var('title', $title);                                                                                           
522                        // set content and label variables.
523                        $template->set_var(array(
524                                                'msg_text'      => lang($status),                                               
525                                                'txt_title'     => lang('Contact Group List'),                                         
526                                                'txt_cancel'=> lang('cancel'),
527                                                'txt_add'=> lang('Add'),                                               
528                                                'txt_rem'=> lang('Remove'),
529                                                'txt_personal_contacts' => lang('Personal Contacts'),
530                                                'txt_contacts_in_list' => lang("Participants"),
531                                                'txt_name'      => lang('Full Name')));
532                                               
533                        $template->parse('out_AG', 'addGroup');
534                       
535                        return $template->get_var('out_AG');
536                }
537        }
538?>
Note: See TracBrowser for help on using the repository browser.