Ignore:
Timestamp:
05/23/08 17:10:39 (16 years ago)
Author:
brunocosta
Message:

Correção dos problemas gerados no commit anterior, a funcionalidade citada no ticket #199 foram temporariamente desativadas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/inc/class.ui_api.inc.php

    r284 r285  
    1818         * 
    1919         */ 
    20  
     20   
    2121        class ui_api 
    2222        { 
    2323                var $commons; 
    2424                var $commons_loaded = false; 
    25  
     25                 
    2626                function ui_api() 
    2727                { 
    2828                        $preferences = ExecMethod('contactcenter.ui_preferences.get_preferences'); 
    29  
     29                         
    3030                        if (!is_array($preferences)) 
    3131                        { 
     
    3333                                //$preferences['personCardPhone'] = 2; 
    3434                        } 
    35  
    36                         $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/'; 
    37                         $template = CreateObject('phpgwapi.Template',$template_dir); 
     35                         
     36                        //$template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/'; 
     37                        //$template = CreateObject('phpgwapi.Template',$template_dir); 
     38                        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); 
    3839 
    3940                        $template->set_file(array('api' => 'api_common.tpl')); 
    40  
     41                         
    4142                        $template->set_var('cc_email_id_type', $preferences['personCardEmail']); 
    42  
     43                         
     44                         
    4345                        /* Messages */ 
    4446                        $template->set_var('cc_msg_err_invalid_catalog',lang('Unavailable or empty Catalog')); 
    45                         $template->set_var('cc_msg_err_contacting_server',lang('Couldn\'t contact server or server response is invalid.')); 
     47                        $template->set_var('cc_msg_err_contacting_server',lang('Couldn\'t contact server or server response is invalid. Contact Admin.')); 
    4648                        $template->set_var('cc_msg_err_timeout',lang('Operation Timed Out.')); 
    4749                        $template->set_var('cc_msg_err_serialize_data_unknown',lang('Data to be serialized is of unknown type!')); 
     
    7577                        $template->set_var('cc_js_djswin', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/dJSWin/dJSWin.js'); 
    7678                        $template->set_var('cc_js_catalog_tree', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_tree.js'); 
    77  
     79                         
    7880                        $template->parse('out','api'); 
    7981 
     
    8183                        $this->commons_loaded = false; 
    8284                } 
    83  
     85                 
    8486                /* DEPRECTED! Use get_email_win() instead */ 
    8587                function ui_get_email_win() 
     
    9193                { 
    9294                        //$search = $this->ui_get_search_win(); 
    93  
     95                         
    9496                        $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/'; 
    9597                        $template = CreateObject('phpgwapi.Template', $template_dir); 
    9698 
    9799                        $template->set_file(array('email_win' => 'email_win.tpl')); 
    98  
     100                         
    99101                        if (!$this->commons_loaded) 
    100102                        { 
     
    106108                                $template->set_var('cc_api', ''); 
    107109                        } 
    108  
     110                         
    109111                        //$template->set_var('cc_search_win', $search); 
    110112                        $template->set_var('cc_js_search', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search.js'); 
    111  
     113                         
    112114                        $template->set_var('cc_email_id_type', $search); 
    113  
     115                         
    114116                        $template->set_var('cc_email_win_title',lang('Contact Center').' - '.lang('Catalog Entries Emails')); 
    115117                        $template->set_var('cc_email_status',lang('Status').':'); 
    116118                        $template->set_var('cc_email_search_text',lang('Search').'...'); 
    117  
     119                         
    118120                        $template->set_var('cc_choose_catalogue',lang('Choose a catalogue').'...'); 
    119121                        $template->set_var('cc_choose_ordinance',lang('Choose a ordinance').'...'); 
    120  
     122                         
    121123                        $template->set_var('cc_btn_to_add',lang('To').' >>'); 
    122124                        $template->set_var('cc_btn_to_del','<< '.lang('To')); 
     
    130132                        $template->set_var('cc_btn_ok',lang('Ok')); 
    131133                        $template->set_var('cc_btn_cancel',lang('Cancel')); 
    132  
     134                         
    133135                        $template->set_var('cc_label_to',lang('To').':'); 
    134136                        $template->set_var('cc_label_cc',lang('Cc').':'); 
     
    138140                        $template->set_var('cc_label_catalogue_type',lang('Type Of Catalogue').':'); 
    139141                        $template->set_var('cc_label_ordinance_type',lang('Type Of Ordinace').':'); 
    140  
     142                         
    141143                        $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images'); 
    142  
     144                         
    143145                        $template->set_var('cc_js_email_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_email_win.js'); 
    144  
     146                         
    145147                        $template->parse('out','email_win'); 
    146148 
     
    159161 
    160162                        $template->set_file(array('search' => 'search_win.tpl')); 
    161  
     163                         
    162164                        if (!$this->commons_loaded) 
    163165                        { 
     
    169171                                $template->set_var('cc_api', ''); 
    170172                        } 
    171  
     173                         
    172174                        $template->set_var('cc_search_title',lang('Contact Center - Search for Catalog Entries')); 
    173175                        $template->set_var('cc_search_minimize',lang('Minimize')); 
     
    178180                        $template->set_var('cc_search_go',lang('Go')); 
    179181                        $template->set_var('cc_search_cancel',lang('Cancel')); 
    180  
     182                         
    181183                        $template->set_var('cc_js_search_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search_win.js'); 
    182  
     184                         
    183185                        $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images'); 
    184  
     186                         
    185187                        $template->parse('out','search'); 
    186188 
     
    203205 
    204206                        $template->set_file(array('full_add' => 'full_add.tpl')); 
    205  
     207                         
    206208                        if (!$this->commons_loaded) 
    207209                        { 
     
    213215                                $template->set_var('cc_api', ''); 
    214216                        } 
    215  
     217                         
    216218                        $template->set_var('cc_contact_title',lang('Contact Center').' - '.lang('Contacts')); 
    217219 
     
    221223                        $template->set_var('cc_msg_type_city',lang('Type new city here').'...'); 
    222224                        /* End Messages */ 
    223  
     225                         
    224226                        /* Contact */ 
    225227                        $template->set_var('cc_contact_save',lang('Save')); 
     
    230232                        $template->set_var('cc_contact_addrs',lang('Addresses')); 
    231233                        $template->set_var('cc_contact_conns',lang('Connections')); 
     234                        $template->set_var('emails_telephones', lang("E-Mails and Telephones")); 
     235                        $template->set_var('cc_default', lang("Default")); 
     236 
    232237                        /* End Contact */ 
    233  
     238                         
    234239                        /* Contact - Personal Data */ 
    235240                        $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; 
    236  
     241                 
    237242                        $j = 0; 
    238243                        for ($i = 0; $i < 5; $i+=2) 
     
    257262                                $j++; 
    258263                        } 
    259  
     264                         
    260265                        $template->set_var('cc_pd_birth_size_0', "{$date[0]['size']}"); 
    261266                        $template->set_var('cc_pd_birth_size_1', "{$date[1]['size']}"); 
    262267                        $template->set_var('cc_pd_birth_size_2', "{$date[2]['size']}"); 
    263  
     268                         
    264269                        $template->set_var('cc_pd_birthdate_0', "{$date[0]['name']}"); 
    265270                        $template->set_var('cc_pd_birthdate_1', "{$date[1]['name']}"); 
     
    268273                        $template->set_var('cc_pd_select_photo_b', lang('Browse').'...'); 
    269274                        $template->set_var('cc_form_photo_src', 'photo_form.html'); 
    270  
     275                         
    271276                        $template->set_var('cc_pd_select_photo',lang('Select Photo')); 
    272277                        $template->set_var('cc_pd_alias',lang('Alias')); 
     
    286291                        $template->set_var('cc_pd_female',lang('Female')); 
    287292                        /* End Contact - Personal Data */ 
    288  
     293                         
    289294                        /* Contact - Addresses */ 
    290295                        $template->set_var('cc_addr_types',lang('Type of Address')); 
     
    310315                        $template->set_var('cc_available',lang('Available')); 
    311316                        /* End Contact - Addresses */ 
    312  
     317                         
     318                         
    313319                        /* Contact - Connections */ 
    314320                        $template->set_var('cc_conn_type',lang('Type of Connection')); 
    315321                        $template->set_var('cc_conn_name',lang('Connection Name')); 
    316322                        $template->set_var('cc_conn_value',lang('Connection Value')); 
    317  
     323                         
    318324                        $template->set_var('cc_new_same_type',lang('New from the same Type').'...'); 
    319  
     325                         
    320326                        $template->set_var('cc_conn_type_none',lang('Choose Type of Connection').'...'); 
    321327                        /* End Contact - Connections */ 
    322328 
     329                        $template->set_var('email', lang("E-Mail")); 
     330                        $template->set_var('telephone', lang("Telephone")); 
     331                        $template->set_var('choose_email_telephone', lang("Choose 'E-Mail' or 'Telephone'")); 
     332 
    323333                        $template->parse('out_full', 'full_add'); 
    324334 
     
    332342 
    333343                        $template->set_file(array('quickAdd' => 'quickAddPlugin.tpl')); 
    334  
     344                         
    335345                        if (!$this->commons_loaded) 
    336346                        { 
     
    342352                                $template->set_var('cc_api', ''); 
    343353                        } 
    344  
     354                         
    345355                        $template->set_var('ccQAPluginFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccQuickAdd-plugin.js'); 
    346356 
     
    350360                        $nFields = 5; 
    351361                        $fields = array( 
    352                                 lang('Alias'), 
    353                                 lang('Given Names'), 
    354                                 lang('Family Names'), 
     362                                lang('Alias'),  
     363                                lang('Given Names'),  
     364                                lang('Family Names'),  
    355365                                lang('Phone'), 
    356366                                lang('Email') 
    357367                        ); 
    358  
     368                         
    359369                        $template->set_var('ccQAnFields', $nFields); 
    360  
     370                         
    361371                        $fieldsHTML = ''; 
    362372                        $fieldsTop = 10; 
     
    379389                        $template->set_var('ccQAWinHeight', ($i+1)*$fieldsSpace+$fieldsTop); 
    380390                        $template->set_var('ccQAFunctionsTop', ($fieldsTop+$i*$fieldsSpace).'px'); 
    381  
     391                         
    382392                        /* Images Dir */ 
    383393                        $template->set_var('ccQACardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/'); 
    384  
     394                         
    385395                        /* Texts */ 
    386396                        $template->set_var('ccQATitle', lang('Contact Center').' - '.lang('Quick Add')); 
     
    388398                        $template->set_var('ccQAClear', lang('Reset')); 
    389399                        $template->set_var('ccQACancel', lang('Cancel')); 
    390  
     400                         
    391401                        $template->parse('out_QA', 'quickAdd'); 
    392402 
    393403                        return $template->get_var('out_QA'); 
    394404                } 
    395  
     405                 
    396406                function get_add_group() 
    397407                { 
     
    400410 
    401411                        $template->set_file(array('addGroup' => 'addGroup.tpl')); 
    402  
     412                         
    403413                        if (!$this->commons_loaded) 
    404414                        { 
     
    408418                        else 
    409419                        { 
    410  
     420                                 
    411421                                $template->set_var('cc_api', ''); 
    412422                        } 
    413  
    414                         $template->set_var('ccAGFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccAddGroup.js'); 
    415                         $template->set_var('ccAGWinHeightIE', '285'); 
     423                         
     424                        $template->set_var('ccAGFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccAddGroup.js');                   
     425                        $template->set_var('ccAGWinHeightIE', '285');                    
    416426                        $template->set_var('ccAGWinHeightMO', '335'); 
    417  
     427                         
    418428                        /* Images Dir */ 
    419429                        $template->set_var('ccAGCardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/'); 
    420  
     430                         
    421431                        /* Texts */ 
    422432                        $template->set_var('ccAGTitle', lang('Contact Center').' - '.lang('Group Add')); 
     
    424434                        $template->set_var('ccAGClear', lang('Reset')); 
    425435                        $template->set_var('ccAGCancel', lang('Cancel')); 
    426                         $title = '<input type="text" id="title" name="title" value="'.$group['title'].'" size="50" maxlength="50"/>'; 
    427  
    428                         $template->set_var('title', $title); 
     436                        $title = '<input type="text" id="title" name="title" value="'.$group['title'].'" size="50" maxlength="50"/>';                    
     437                                 
     438                        $template->set_var('title', $title);                                                                                             
    429439                        // set content and label variables. 
    430440                        $template->set_var(array( 
    431                                                 'msg_text'      => lang($status), 
    432                                                 'txt_title'     => lang('Contact Group List'), 
     441                                                'msg_text'      => lang($status),                                                
     442                                                'txt_title'     => lang('Contact Group List'),                                           
    433443                                                'txt_cancel'=> lang('cancel'), 
    434                                                 'txt_add'=> lang('Add'), 
     444                                                'txt_add'=> lang('Add'),                                                 
    435445                                                'txt_rem'=> lang('Remove'), 
    436446                                                'txt_personal_contacts' => lang('Personal Contacts'), 
    437447                                                'txt_contacts_in_list' => lang("Participants"), 
    438448                                                'txt_name'      => lang('Full Name'))); 
    439  
     449                                                 
    440450                        $template->parse('out_AG', 'addGroup'); 
    441  
     451                         
    442452                        return $template->get_var('out_AG'); 
    443453                } 
Note: See TracChangeset for help on using the changeset viewer.