Index: branches/2.2/mobile/setup/phpgw_pt-br.lang =================================================================== --- branches/2.2/mobile/setup/phpgw_pt-br.lang (revision 5023) +++ branches/2.2/mobile/setup/phpgw_pt-br.lang (revision 5063) @@ -1,4 +1,5 @@ attachment mobile pt-br Anexo Add Recipient mobile pt-br Adicionar Destinatário +At %1, %2 hours, %3 wrote: mobile pt-br Em %1 às %2 horas, %3 escreveu: more attachment mobile pt-br mais anexo cancel mobile pt-br Cancelar Index: branches/2.2/mobile/inc/class.ui_mobilecc.inc.php =================================================================== --- branches/2.2/mobile/inc/class.ui_mobilecc.inc.php (revision 4762) +++ branches/2.2/mobile/inc/class.ui_mobilecc.inc.php (revision 5063) @@ -23,5 +23,5 @@ 'contact_add' => true, 'contact_edit' => true, - 'getPhoto' => true + 'getPhoto' => true ); var $template; @@ -42,7 +42,4 @@ $this->set_page_info_to_default(); } - - //if() - } @@ -66,24 +63,26 @@ public function change_max_results($params) { $this->page_info['actual_max_contacts'] = $params['results']; + $this->save_session(); $this->contacts_list(); + } + + public function change_letter($params) + { + if( $params['letter'] ) + { + $this->page_info['actual_letter'] = $params['letter']; + } + $this->page_info['actual_max_contacts'] = 10; $this->save_session(); - } - - public function change_letter($params) { - $this->page_info['actual_letter'] = $params['letter']; + $this->contacts_list($params); + } + + public function change_catalog($params) + { + $this->page_info['actual_catalog'] = $params['catalog']; + $this->page_info['actual_letter'] = 'a'; $this->page_info['actual_max_contacts'] = 10; - $this->contacts_list(); $this->save_session(); - } - - public function change_catalog($params) { - - if( $params['catalog'] ) $this->page_info['actual_catalog'] = $params['catalog']; - $this->page_info['actual_max_contacts'] = 10; - $this->page_info['actual_letter'] = 'a'; - $this->contacts_list($params); - - $this->save_session(); } @@ -97,6 +96,6 @@ $this->set_page_info_to_default(); $this->page_info['request_from'] = $params['request_from']; //Para escolher contato vindo de outro modulo, mudo apenas o request_from + $this->save_session(); $this->contacts_list(); - $this->save_session(); } @@ -109,6 +108,6 @@ public function init_cc($params) { $this->set_page_info_to_default(); + $this->save_session(); $this->contacts_list($params); - $this->save_session(); } @@ -162,18 +161,38 @@ //Combo de catálogos $catalogs = $this->bo->get_all_catalogs(); - foreach($catalogs as $catalog) { + + foreach($catalogs as $catalog) + { $this->template->set_var("catalog_value",$catalog["catalog"]); $this->template->set_var("catalog_name",$catalog["label"]); - if($this->page_info['actual_catalog']==$catalog['catalog']) + + if( $this->page_info['actual_catalog'] == $catalog['catalog'] ) $this->template->set_var("selected","selected"); else $this->template->set_var("selected"," "); + $this->template->fp("catalogs","catalog_row",true); } - $this->bo->set_catalog($this->page_info["actual_catalog"]); - $contacts = $this->bo->search($this->page_info["actual_letter"]."%", - $this->page_info["actual_max_contacts"]); - - + + $catalog = ( isset($params['catalog']) ) ? $params['catalog'] : $this->page_info['actual_catalog']; + + if( strpos( $catalog, "bo_global_ldap_catalog") !== false ) + { + $dn = $GLOBALS['phpgw_info']['user']['account_dn']; + $dn = substr( $dn, strpos($dn, "ou=" ) ); + $exploded = explode("#", $catalog ); + $catalog = 'bo_people_catalog'; + + if( count($exploded) > 2 ) + { + $exploded[2] = $dn; + $actual_catalog = implode("#", $exploded); + $catalog = $actual_catalog; + } + } + + $this->bo->set_catalog($catalog); + $contacts = $this->bo->search($this->page_info["actual_letter"]."%", $this->page_info["actual_max_contacts"]); + //Letras da paginação $max_letters = 5; @@ -243,5 +262,6 @@ */ - function delete_contacts($params) { + function delete_contacts($params) + { $this->bo->set_catalog($params['catalog']); @@ -370,7 +390,9 @@ * @return $contact */ - function contact_view($params) { - - if ( empty($params['id']) || empty($params['catalog']) ){ + function contact_view($params) + { + + if ( empty($params['id']) || empty($params['catalog']) ) + { header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); } @@ -398,186 +420,195 @@ $email_to = ""; - switch ($params['catalog']){ + switch ($params['catalog']) + { case 'bo_shared_people_manager'; case 'bo_people_catalog': - $this->template->set_var('lang_contact_title',lang("context contact")); - $this->bo->set_catalog($params['catalog']); - - $result = $this->bo->bo->get_single_entry($params['id'], array("given_names"=>true,"names_ordered"=>true,"alias"=>true,"family_names"=>true,"companies"=>true,"relations"=>true,"connections"=>true)); - - asort($result['connections']); - - $this->template->set_var('photo', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo&id='.$params['id']); - $this->template->set_var('id',$params['id']); - $this->template->set_var('catalog',$params['catalog']); - - $this->template->set_var('cc_name',$result['names_ordered']); - $this->template->set_var('lang_title_alias',lang("Alias")); - $this->template->set_var('lang_alias',$result['alias']); + $this->template->set_var('lang_contact_title',lang("context contact")); + $this->bo->set_catalog($params['catalog']); + + $result = $this->bo->bo->get_single_entry($params['id'], array("given_names"=>true,"names_ordered"=>true,"alias"=>true,"family_names"=>true,"companies"=>true,"relations"=>true,"connections"=>true)); + + asort($result['connections']); + + $this->template->set_var('photo', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo&id='.$params['id']); + $this->template->set_var('id',$params['id']); + $this->template->set_var('catalog',$params['catalog']); + + $this->template->set_var('cc_name',$result['names_ordered']); + $this->template->set_var('lang_title_alias',lang("Alias")); + $this->template->set_var('lang_alias',$result['alias']); + + $this->template->set_var('lang_title_name',lang("Name")); + $this->template->set_var('lang_name',$result['given_names']); + + $this->template->set_var('lang_title_lastname',lang("Family Names")); + $this->template->set_var('lang_lastname',$result['family_names']); + + $var_phone = ""; + $var_email = ""; + foreach($result['connections'] as $conn): + if ( $conn['id_type'] == 1 ){ + if ( !empty($var_email) ) + $var_email .= ' | '; + $var_email .= $conn['connection_value']; + + if ( empty($email_to) ) + $email_to = $var_email; + + }else if ($conn['id_type'] == 2){ + if ( !empty($var_phone)) + $var_phone .= ' | '; + $var_phone .= $conn['connection_value']; + } + + if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ + if ( $conn['type'] == 'email' ){ + if ( !empty($var_email) ) + $var_email .= ' | '; + $var_email .= $conn['connection_value']; - $this->template->set_var('lang_title_name',lang("Name")); - $this->template->set_var('lang_name',$result['given_names']); + if ( empty($email_to) ) + $email_to = $var_email; - $this->template->set_var('lang_title_lastname',lang("Family Names")); - $this->template->set_var('lang_lastname',$result['family_names']); - - $var_phone = ""; - $var_email = ""; - foreach($result['connections'] as $conn): - if ( $conn['id_type'] == 1 ){ - if ( !empty($var_email) ) - $var_email .= ' | '; - $var_email .= $conn['connection_value']; - - if ( empty($email_to) ) - $email_to = $var_email; - - }else if ($conn['id_type'] == 2){ - if ( !empty($var_phone)) - $var_phone .= ' | '; - $var_phone .= $conn['connection_value']; - } - - if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ - if ( $conn['type'] == 'email' ){ - if ( !empty($var_email) ) - $var_email .= ' | '; - $var_email .= $conn['connection_value']; - - if ( empty($email_to) ) - $email_to = $var_email; - - }else if ($conn['type'] == 'phone'){ - if ( !empty($var_phone)) - $var_phone .= ' | '; - $var_phone .= $conn['connection_value']; - } - } - endforeach; - - $this->template->set_var('lang_title_email',lang("Email")); - $this->template->set_var('lang_email',$var_email); - - $this->template->set_var('lang_title_phone',lang("Phone")); - $this->template->set_var('lang_phone',$var_phone); - - $this->template->set_var('lang_edit',lang("edit")); - - $this->template->parse("row_body","people"); - - if ($params['catalog'] == 'bo_people_catalog') - $this->template->parse("buttom_editar","buttom"); - - break; + }else if ($conn['type'] == 'phone'){ + if ( !empty($var_phone)) + $var_phone .= ' | '; + $var_phone .= $conn['connection_value']; + } + } + endforeach; + + $this->template->set_var('lang_title_email',lang("Email")); + $this->template->set_var('lang_email',$var_email); + + $this->template->set_var('lang_title_phone',lang("Phone")); + $this->template->set_var('lang_phone',$var_phone); + + $this->template->set_var('lang_edit',lang("edit")); + + $this->template->parse("row_body","people"); + + if ($params['catalog'] == 'bo_people_catalog') + $this->template->parse("buttom_editar","buttom"); + + break; case 'bo_group_manager': - $this->template->set_var('lang_contact_title',lang("context group")); - $this->bo->set_catalog($params['catalog']); - $result = $this->bo->bo->get_single_entry($params['id'], array("id_group"=>true,"title"=>true,"short_name"=>true)); - $data = $this->bo->bo->get_contacts_by_group($params['id']); - - $email_to = '<'.$result['short_name'].'>'; - - $this->template->set_var('title_view_contact', $result['title']); - $this->template->set_var('email_to', $email_to); - - $this->template->set_var('lang_title_name',lang("Name")); - $this->template->set_var('lang_title_email',lang("Email")); - - foreach($data as $dados){ - $this->template->set_var('lang_name', $dados['names_ordered']); - $this->template->set_var('lang_email', $dados['connection_value']); - $this->template->set_var('bg',$bg=="bg-azul"?$bg="bg-branco":$bg="bg-azul"); + + $this->template->set_var('lang_contact_title',lang("context group")); + $this->bo->set_catalog($params['catalog']); + $result = $this->bo->bo->get_single_entry($params['id'], array("id_group"=>true,"title"=>true,"short_name"=>true)); + $data = $this->bo->bo->get_contacts_by_group($params['id']); + + $email_to = '<'.$result['short_name'].'>'; + + $this->template->set_var('title_view_contact', $result['title']); + $this->template->set_var('email_to', $email_to); + + $this->template->set_var('lang_title_name',lang("Name")); + $this->template->set_var('lang_title_email',lang("Email")); + + foreach($data as $dados){ + $this->template->set_var('lang_name', $dados['names_ordered']); + $this->template->set_var('lang_email', $dados['connection_value']); + $this->template->set_var('bg',$bg=="bg-azul"?$bg="bg-branco":$bg="bg-azul"); + + $this->template->set_var('href_details',"ui_mobilecc.contact_view&id=".$dados['id_contact']."&catalog=bo_people_catalog"); + + $this->template->fp('group_rows','group_row',True); + } + + $this->template->set_var('email_to', $email_to); + $this->template->parse("buttom_use","buttom_use_contact"); + + $this->template->parse("row_body","group"); + + break; + + default: + if( strpos($params['catalog'],'bo_global_ldap_catalog#') === false ) + { + header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); + } + else + { + $this->bo->set_catalog($params['catalog']); + $fields = $this->bo->bo->get_fields(true); + $result = $this->bo->bo->get_single_entry($params['id'], $fields); + + // SessionStart + session_start(); + $_SESSION['phpgw_info']['mobile']['photoCatalog'][$params['id']] = $result['photo']; + session_write_close(); + + $this->template->set_var('photo', '../index.php?menuaction=mobile.ui_mobilecc.getPhoto&id=' . $params["id"]); + + $this->template->set_var('cc_name',$result['names_ordered'][0]); + + $this->template->set_var('lang_title_name',lang("Name")); + $this->template->set_var('lang_name',$result['given_names'][0]); + + $this->template->set_var('lang_title_lastname',lang("Family Names")); + $this->template->set_var('lang_lastname',$result['family_names'][0]); + + $var_phone = ""; + $var_email = ""; + foreach($result['connections'] as $conn) + { + if ( $conn['id_type'] == 1 ) + { + if ( !empty($var_email) ) + $var_email .= ' | '; + + $var_email .= $conn['connection_value']; + + if ( empty($email_to) ) + $email_to = $var_email; + } + else if ($conn['id_type'] == 2) + { + if ( !empty($var_phone)) + $var_phone .= ' | '; + + $var_phone .= $conn['connection_value']; + } + + if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')) + { + if ( $conn['type'] == 'email' ) + { + if ( !empty($var_email) ) + $var_email .= ' | '; - $this->template->set_var('href_details',"ui_mobilecc.contact_view&id=".$dados['id_contact']."&catalog=bo_people_catalog"); + $var_email .= $conn['connection_value']; + + if ( empty($email_to) ) + $email_to = $var_email; + } + else if ($conn['type'] == 'phone') + { + if ( !empty($var_phone) ) + $var_phone .= ' | '; - $this->template->fp('group_rows','group_row',True); + $var_phone .= $conn['connection_value']; } - - $this->template->set_var('email_to', $email_to); - $this->template->parse("buttom_use","buttom_use_contact"); - - $this->template->parse("row_body","group"); - break; - - default: - - if( strpos($params['catalog'],'bo_global_ldap_catalog') === false ) - { - header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); - } - else - { - - $this->bo->set_catalog($params['catalog']); - - $fields = $this->bo->bo->get_fields(true); - $result = $this->bo->bo->get_single_entry($params['id'], $fields); - - // SessionStart - session_start(); - $_SESSION['phpgw_info']['mobile']['photoCatalog'][$params['id']] = $result['photo']; - session_write_close(); - - - $this->template->set_var('photo', '../index.php?menuaction=mobile.ui_mobilecc.getPhoto&id=' . $params["id"]); - - $this->template->set_var('cc_name',$result['names_ordered'][0]); - - $this->template->set_var('lang_title_name',lang("Name")); - $this->template->set_var('lang_name',$result['given_names'][0]); - - $this->template->set_var('lang_title_lastname',lang("Family Names")); - $this->template->set_var('lang_lastname',$result['family_names'][0]); - - $var_phone = ""; - $var_email = ""; - foreach($result['connections'] as $conn): - if ( $conn['id_type'] == 1 ){ - if ( !empty($var_email) ) - $var_email .= ' | '; - $var_email .= $conn['connection_value']; - - if ( empty($email_to) ) - $email_to = $var_email; - - }else if ($conn['id_type'] == 2){ - if ( !empty($var_phone)) - $var_phone .= ' | '; - $var_phone .= $conn['connection_value']; - } - - if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ - if ( $conn['type'] == 'email' ){ - if ( !empty($var_email) ) - $var_email .= ' | '; - $var_email .= $conn['connection_value']; + } + } - if ( empty($email_to) ) - $email_to = $var_email; - - }else if ($conn['type'] == 'phone'){ - if ( !empty($var_phone)) - $var_phone .= ' | '; - $var_phone .= $conn['connection_value']; - } - } - endforeach; - - $this->template->set_var('email_to', $email_to); - - $this->template->set_var('lang_title_email',lang("Email")); - $this->template->set_var('lang_email',$var_email); - - $this->template->set_var('lang_title_phone',lang("Phone")); - $this->template->set_var('lang_phone',$var_phone); - - $this->template->parse("row_body","people_ldap"); - - } - - break; + $this->template->set_var('email_to', $email_to); + + $this->template->set_var('lang_title_email',lang("Email")); + $this->template->set_var('lang_email',$var_email); + + $this->template->set_var('lang_title_phone',lang("Phone")); + $this->template->set_var('lang_phone',$var_phone); + + $this->template->parse("row_body","people_ldap"); + + } + + break; } @@ -587,13 +618,17 @@ $this->template->parse("buttom_use","buttom_use_contact"); $this->template->parse("row_operacao","row_view_operacao"); - }else if ($params['catalog'] == 'bo_people_catalog'){ + } + else if ($params['catalog'] == 'bo_people_catalog') + { $this->template->parse("row_operacao","row_view_operacao"); } $linkBack = explode("&", $GLOBALS['phpgw_info']['mobiletemplate']->get_back_link() ); - $link = $linkBack[0]."&".$params['catalog']."&".$linkBack[2]; + $link = $linkBack[0]."&catalog=".$params['catalog']."&".$linkBack[2]; $this->template->set_var('lang_back',lang("back")); + $this->template->set_var('href_back',$link); + $this->template->set_var('lang_use_contact',lang("use contact")); $this->template->set_var('lang_selecteds',lang("selecteds")); @@ -602,35 +637,35 @@ } - function getPhoto() - { - $id = $_GET['id']; - - session_start(); - - if( isset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ) ) - { - $photo = imagecreatefromstring($_SESSION['phpgw_info']['mobile']['photoCatalog'][$id]); - - header("Content-Type: image/jpeg"); - $width = imagesx($photo); - $height = imagesy($photo); - $twidth = 70; - $theight = 90; - $small_photo = imagecreatetruecolor ($twidth, $theight); - imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); - imagejpeg($small_photo,'',100); - - unset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ); - } - else - { - header('Content-type: image/png'); - echo file_get_contents(PHPGW_INCLUDE_ROOT.'/contactcenter/templates/default/images/photo_celepar.png'); - } - - session_write_close(); - - return; - } + function getPhoto() + { + $id = $_GET['id']; + + session_start(); + + if( isset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ) ) + { + $photo = imagecreatefromstring($_SESSION['phpgw_info']['mobile']['photoCatalog'][$id]); + + header("Content-Type: image/jpeg"); + $width = imagesx($photo); + $height = imagesy($photo); + $twidth = 70; + $theight = 90; + $small_photo = imagecreatetruecolor ($twidth, $theight); + imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); + imagejpeg($small_photo,'',100); + + unset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ); + } + else + { + header('Content-type: image/png'); + echo file_get_contents(PHPGW_INCLUDE_ROOT.'/contactcenter/templates/default/images/photo_celepar.png'); + } + + session_write_close(); + + return; + } /** @@ -679,5 +714,6 @@ $view = true; - if ( !isset($params['erro'])){ + if ( !isset($params['erro'])) + { $this->bo->set_catalog($params['catalog']); $result = $this->bo->bo->get_single_entry($params['id'], array("given_names"=>true,"names_ordered"=>true,"alias"=>true,"family_names"=>true,"companies"=>true,"relations"=>true,"connections"=>true)); @@ -773,5 +809,4 @@ $data['connections']['default_phone']['connection_value'] = $params['phone']; } - $this->bo->set_catalog($params['catalog']); $contact_id = $this->bo->bo->quick_add($data); @@ -807,5 +842,4 @@ else { - $this->bo->set_catalog($params['catalog']); $types = $this->bo->bo->get_all_connections_types(); @@ -896,8 +930,4 @@ } - - } - - ?> Index: branches/2.2/mobile/templates/default/pc_template.tpl =================================================================== --- branches/2.2/mobile/templates/default/pc_template.tpl (revision 4694) +++ branches/2.2/mobile/templates/default/pc_template.tpl (revision 5063) @@ -95,5 +95,5 @@
Projeto ExpressoLivre 2004 - 2010 :: Licença de Software
- + -