Changeset 1517


Ignore:
Timestamp:
10/20/09 10:56:43 (15 years ago)
Author:
eduardoalex
Message:

Ticket #684 - Implementada a aba corporativa com a opção genérica no admin

Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/templates/classic/config.tpl

    r597 r1517  
    5050   </tr> 
    5151 
     52<tr class="th"> 
     53    <td>{lang_personal_contact_type}:</td> 
     54    <td> 
     55     <select name="newsettings[personal_contact_type]"> 
     56      <option value="">{lang_default}</option> 
     57      <option value="True"{selected_personal_contact_type_True}>{lang_advanced}</option> 
     58     </select> 
     59    </td> 
     60   </tr> 
    5261   <tr class="th"> 
    5362    <td colspan="2">&nbsp;<b>{lang_security}</b></td> 
  • trunk/admin/templates/default/config.tpl

    r1327 r1517  
    5555    <td>{lang_HTML_code_of_the_organization_login}</td> 
    5656    <td><textarea cols="50" rows="2" name="newsettings[login_logo_file]">{value_login_logo_file}</textarea></td> 
     57   </tr> 
     58 
     59<tr class="th"> 
     60    <td>{lang_personal_contact_type}:</td> 
     61    <td> 
     62     <select name="newsettings[personal_contact_type]"> 
     63      <option value="">{lang_default}</option> 
     64      <option value="True"{selected_personal_contact_type_True}>{lang_advanced}</option> 
     65     </select> 
     66    </td> 
    5767   </tr> 
    5868 
  • trunk/contactcenter/inc/class.bo_people_catalog.inc.php

    r1418 r1517  
    3131                        'pgp_key'       => true, 
    3232                        'notes'         => true, 
    33                          
     33                        'corporate_name'=> true, 
     34                        'job_title'     => true, 
     35                        'department'    => true, 
     36                        'web_page'              => true, 
    3437                        /* Array fields */ 
    3538                        'companies'     => true, 
     
    923926                                        case 'id_status': 
    924927                                        case 'id_suffix': 
     928                                        case 'corporate_name': 
     929                                        case 'job_title': 
     930                                        case 'department': 
     931                                        case 'web_page': 
    925932                                        case 'given_names': 
    926933                                        case 'family_names': 
     
    13481355                                        case 'id_status': 
    13491356                                        case 'id_suffix': 
     1357                                        case 'corporate_name': 
     1358                                        case 'job_title': 
     1359                                        case 'department': 
     1360                                        case 'web_page':                                         
    13501361                                        case 'given_names': 
    13511362                                        case 'family_names': 
  • trunk/contactcenter/inc/class.so_contact.inc.php

    r503 r1517  
    5454                                'alias'                 => array( 
    5555                                        'name'          => 'alias', 
     56                                        'type'          => false, 
     57                                        'state'         => 'empty', 
     58                                        'value'         => false), 
     59                                'web_page'                      => array( 
     60                                        'name'          => 'web_page', 
     61                                        'type'          => false, 
     62                                        'state'         => 'empty', 
     63                                        'value'         => false), 
     64                                'corporate_name'                        => array( 
     65                                        'name'          => 'corporate_name', 
     66                                        'type'          => false, 
     67                                        'state'         => 'empty', 
     68                                        'value'         => false), 
     69                                'job_title'                     => array( 
     70                                        'name'          => 'job_title', 
     71                                        'type'          => false, 
     72                                        'state'         => 'empty', 
     73                                        'value'         => false), 
     74                                'department'                    => array( 
     75                                        'name'          => 'department', 
    5676                                        'type'          => false, 
    5777                                        'state'         => 'empty', 
     
    418438                        return $this->main_fields['id_prefix']['value']; 
    419439                } 
     440                 
     441                /*! 
     442                 
     443                        @function get_corporate_name 
     444                        @abstract Returns the Contact corporate_name 
     445                        @author David Buarque 
     446                 
     447                */ 
     448                function get_corporate_name (  ) 
     449                { 
     450                        return $this->main_fields['corporate_name']['value']; 
     451                } 
     452                 
     453                /*! 
     454                 
     455                        @function get_job_title 
     456                        @abstract Returns the Contact job_title 
     457                        @author David Buarque 
     458                 
     459                */ 
     460                function get_job_title (  ) 
     461                { 
     462                        return $this->main_fields['job_title']['value']; 
     463                } 
     464                 
     465                /*! 
     466                 
     467                        @function get_department 
     468                        @abstract Returns the Contact department 
     469                        @author David Buarque 
     470                 
     471                */ 
     472                function get_department (  ) 
     473                { 
     474                        return $this->main_fields['department']['value']; 
     475                } 
     476                 
     477                /*! 
     478                 
     479                        @function get_web_page 
     480                        @abstract Returns the Contact web_page 
     481                        @author David Buarque 
     482                 
     483                */ 
     484                function get_web_page (  ) 
     485                { 
     486                        return $this->main_fields['web_page']['value']; 
     487                } 
    420488         
    421489                /*! 
     
    699767                        $this->main_fields['alias']['value'] = $alias; 
    700768                        $this->manage_fields($this->main_fields['alias'], 'changed'); 
     769                } 
     770                 
     771                /*! 
     772                 
     773                        @function set_corporate_name 
     774                        @abstract Sets the Contact's corporate_name 
     775                        @author David Buaque 
     776                        @param string $corporate_name The new Contact corporate_name 
     777                 
     778                */ 
     779                function set_corporate_name ( $corporate_name ) 
     780                { 
     781                        $this->main_fields['corporate_name']['value'] = $corporate_name; 
     782                        $this->manage_fields($this->main_fields['corporate_name'], 'changed'); 
     783                } 
     784                 
     785                /*! 
     786                 
     787                        @function set_job_title 
     788                        @abstract Sets the Contact's job_title 
     789                        @author David Buaque 
     790                        @param string $alias The new Contact job_title 
     791                 
     792                */ 
     793                function set_job_title ( $job_title ) 
     794                { 
     795                        $this->main_fields['job_title']['value'] = $job_title; 
     796                        $this->manage_fields($this->main_fields['job_title'], 'changed'); 
     797                } 
     798                 
     799                /*! 
     800                 
     801                        @function set_department 
     802                        @abstract Sets the Contact's department 
     803                        @author David Buaque 
     804                        @param string $alias The new Contact department  
     805                 
     806                */ 
     807                function set_department ( $department ) 
     808                { 
     809                        $this->main_fields['department']['value'] = $department; 
     810                        $this->manage_fields($this->main_fields['department'], 'changed'); 
     811                } 
     812                 
     813                /*! 
     814                 
     815                        @function set_web_page 
     816                        @abstract Sets the Contact's web_page 
     817                        @author David Buaque 
     818                        @param string $alias The new Contact web_page  
     819                 
     820                */ 
     821                function set_web_page ( $web_page ) 
     822                { 
     823                        $this->main_fields['web_page']['value'] = $web_page; 
     824                        $this->manage_fields($this->main_fields['web_page'], 'changed'); 
    701825                } 
    702826         
  • trunk/contactcenter/inc/class.ui_api.inc.php

    r1496 r1517  
    199199                { 
    200200                        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); 
    201  
    202                         $template->set_file(array('full_add' => 'full_add.tpl')); 
    203                          
     201            if($GLOBALS['phpgw_info']['server']['personal_contact_type']=='True'){ 
     202                                $template->set_file(array('full_add' => 'corporative_full_add.tpl')); 
     203                                $template->set_var('cc_contact_type','advanced'); 
     204                        }else{ 
     205                                $template->set_file(array('full_add' => 'full_add.tpl')); 
     206                                $template->set_var('cc_contact_type','default'); 
     207                        } 
    204208                        if (!$this->commons_loaded) 
    205209                        { 
     
    227231                        $template->set_var('cc_contact_personal',lang('Personal')); 
    228232                        $template->set_var('cc_contact_addrs',lang('Addresses')); 
     233                        $template->set_var('cc_contact_corporative',lang('Corporative')); 
    229234                        $template->set_var('cc_contact_conns',lang('Connections')); 
    230235                        $template->set_var('emails_telephones', lang("E-Mails and Telephones")); 
     
    326331                        /* End Contact - Connections */ 
    327332 
     333 
     334 
     335                        /* Corporate - contact */ 
     336                        $template->set_var('cc_name_corporate',lang('Corporate')); 
     337                        $template->set_var('cc_job_title',lang('Job Title')); 
     338                        $template->set_var('cc_department',lang('Department')); 
     339                        $template->set_var('cc_web_page',lang('Web Page')); 
     340 
    328341                        $template->set_var('email', lang("E-Mail")); 
    329342                        $template->set_var('telephone', lang("Telephone")); 
  • trunk/contactcenter/inc/class.ui_data.inc.php

    r1496 r1517  
    212212                        $GLOBALS['phpgw']->template->set_var('cc_msg_home', lang('Home')); 
    213213                        $GLOBALS['phpgw']->template->set_var('cc_msg_cellphone', lang('Cellphone')); 
     214                        $GLOBALS['phpgw']->template->set_var('cc_msg_corporative_cellphone', lang('Corporative Cellphone')); 
     215                        $GLOBALS['phpgw']->template->set_var('cc_msg_corporative_fax', lang('Corporative Fax')); 
     216                        $GLOBALS['phpgw']->template->set_var('cc_msg_corporative_pager', lang('Corporative Pager'));                     
    214217                        $GLOBALS['phpgw']->template->set_var('cc_msg_work', lang('Work')); 
    215218                        $GLOBALS['phpgw']->template->set_var('cc_msg_fax', lang('Fax')); 
     
    232235                        $GLOBALS['phpgw']->template->set_var('cc_msg_fill_field_name', lang('Fill the field Full Name')); 
    233236                         
     237                        if($GLOBALS['phpgw_info']['server']['personal_contact_type']=='True'){ 
     238                                $GLOBALS['phpgw']->template->set_var('cc_contact_type', 'advanced'); 
     239                        }else{ 
     240                                $GLOBALS['phpgw']->template->set_var('cc_contact_type', 'default'); 
     241                        } 
    234242                        $GLOBALS['phpgw']->template->parse('out','index'); 
    235243                         
     
    14851493                                } 
    14861494                        } 
    1487 //                      print_r($data); 
    1488  
     1495                         
     1496                        /*Corporative*/ 
     1497                        $data['personal']['cc_name_corporate'] = $entry['corporate_name']; 
     1498                        $data['personal']['cc_job_title'] = $entry['job_title']; 
     1499                        $data['personal']['cc_department'] = $entry['department']; 
     1500                        $data['personal']['cc_name_corporate'] = $entry['corporate_name']; 
     1501                        $data['personal']['cc_web_page'] = $entry['web_page']; 
     1502                         
     1503                         
    14891504                        /* Relations */ 
    14901505                         
     
    19001915                                switch($field) 
    19011916                                { 
     1917                                        case 'corporate_name': 
     1918                                        case 'job_title': 
     1919                                        case 'department': 
     1920                                        case 'web_page': 
    19021921                                        case 'alias': 
    19031922                                        case 'given_names': 
  • trunk/contactcenter/js/cc.js

    r1496 r1517  
    455455        Element('cc_full_add_form_personal').reset(); 
    456456        Element('cc_full_add_form_addrs').reset(); 
    457  
     457        if(Element('cc_contact_type').value=='advanced') 
     458                Element('cc_full_add_form_corporative').reset(); 
    458459        /* Personal Data */ 
    459460        Element('cc_full_add_contact_id').value = null; 
     
    626627 
    627628        data.length += 14; 
     629        //corporative 
     630        if (Element('cc_contact_type').value == 'advanced') { 
     631                data['corporate_name'] = replaceComAnd(Element('cc_name_corporate').value, replacer); 
     632                data['job_title'] = replaceComAnd(Element('cc_job_title').value, replacer); 
     633                data['department'] = replaceComAnd(Element('cc_department').value, replacer); 
     634                data['web_page'] = replaceComAnd(Element('cc_web_page').value, replacer); 
     635                data.length += 18; 
     636        } 
     637 
     638                 
     639         
    628640 
    629641        /* Addresses */ 
     
    776788 * data[9] => cc_pd_gpg_finger_print 
    777789 * data[10] => cc_pd_notes 
     790 * data[11] => cc_name_corporate 
     791 * data[12] => cc_job_title 
     792 * data[13] => cc_department 
     793 * data[14] => cc_we_page 
    778794 */ 
    779795 
     
    15771593            var lang_fax = Element('cc_msg_fax').value; 
    15781594            var lang_pager = Element('cc_msg_pager').value; 
     1595                var lang_corporative_cellphone = Element('cc_msg_corporative_cellphone').value; 
     1596                var lang_corporative_fax = Element('cc_msg_corporative_fax').value; 
     1597                var lang_corporative_pager = Element('cc_msg_corporative_pager').value; 
     1598                 
    15791599            cc_conn_type_sel[0] = new Option(lang_new_telephone,'-1');   
    15801600            cc_conn_type_sel[1] = new Option(lang_home,lang_home); 
     
    15821602            cc_conn_type_sel[3] = new Option(lang_work,lang_work); 
    15831603            cc_conn_type_sel[4] = new Option(lang_fax,lang_fax); 
    1584             cc_conn_type_sel[5] = new Option(lang_pager,lang_pager); 
    1585  
     1604            if (document.getElementById('cc_contact_type').value == 'advanced') { 
     1605                        cc_conn_type_sel[5] = new Option(lang_pager, lang_pager); 
     1606                        cc_conn_type_sel[6] = new Option(lang_corporative_cellphone, lang_corporative_cellphone); 
     1607                        cc_conn_type_sel[7] = new Option(lang_corporative_fax, lang_corporative_fax); 
     1608                        cc_conn_type_sel[8] = new Option(lang_corporative_pager, lang_corporative_pager); 
     1609                } 
     1610                 
    15861611                connID = 2; 
    15871612                selected_index = cc_phone_default.options.selectedIndex; 
  • trunk/contactcenter/templates/classic/index.tpl

    r752 r1517  
    6161<input id="cc_msg_home" type="hidden" value="{cc_msg_home}"> 
    6262<input id="cc_msg_cellphone" type="hidden" value="{cc_msg_cellphone}"> 
     63<input id="cc_msg_corporative_cellphone" type="hidden" value="{cc_msg_corporative_cellphone}"> 
     64<input id="cc_msg_corporative_fax" type="hidden" value="{cc_msg_corporative_fax}"> 
     65<input id="cc_msg_corporative_pager" type="hidden" value="{cc_msg_corporative_pager}"> 
    6366<input id="cc_msg_work" type="hidden" value="{cc_msg_work}"> 
    6467<input id="cc_msg_fax" type="hidden" value="{cc_msg_fax}"> 
     
    8184<input id="cc_msg_fill_field_name" type="hidden" value="{cc_msg_fill_field_name}"> 
    8285<input id="cc_msg_add_contact_to_group" type="hidden" value="{cc_msg_add_contact_to_group}"> 
    83  
     86<input id="cc_contact_type" type="hidden" value="{cc_contact_type}"> 
    8487 
    8588 <!-- END JS MESSAGES --> 
  • trunk/contactcenter/templates/default/index.tpl

    r1496 r1517  
    6161<input id="cc_msg_home" type="hidden" value="{cc_msg_home}"> 
    6262<input id="cc_msg_cellphone" type="hidden" value="{cc_msg_cellphone}"> 
     63<input id="cc_msg_corporative_cellphone" type="hidden" value="{cc_msg_corporative_cellphone}"> 
     64<input id="cc_msg_corporative_fax" type="hidden" value="{cc_msg_corporative_fax}"> 
     65<input id="cc_msg_corporative_pager" type="hidden" value="{cc_msg_corporative_pager}"> 
    6366<input id="cc_msg_work" type="hidden" value="{cc_msg_work}"> 
    6467<input id="cc_msg_fax" type="hidden" value="{cc_msg_fax}"> 
     
    8184<input id="cc_msg_fill_field_name" type="hidden" value="{cc_msg_fill_field_name}"> 
    8285<input id="cc_msg_add_contact_to_group" type="hidden" value="{cc_msg_add_contact_to_group}"> 
    83  
     86<input id="cc_contact_type" type="hidden" value="{cc_contact_type}"> 
    8487 
    8588 <!-- END JS MESSAGES --> 
Note: See TracChangeset for help on using the changeset viewer.