Changeset 285 for trunk/contactcenter
- Timestamp:
- 05/23/08 17:10:39 (16 years ago)
- Location:
- trunk/contactcenter
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/doc/change_log.txt
r284 r285 3 3 Nilton Emilio Buhrer Neto. 4 4 5 --------------------------- NOTA IMPORTANTE -------------------------- 5 6 7 A partir de Agosto de 2007, todos os registros de bugs aqui relatados foram 8 transferidos para o site do ExpressoLivre, no Wiki-Trac do módulo. 9 Vide: http://www.expressolivre.org/dev/wiki/contactcenter/changelog 10 11 ---------------------------------------------------------------------- 6 12 27/02/2007 - [1.0.005] 7 13 - Excluído o diretorio contactcenter/templates/celepar e seus arquivos foram movidos para -
trunk/contactcenter/inc/class.bo_catalog_group_catalog.inc.php
r284 r285 20 20 21 21 include_once('class.abo_catalog.inc.php'); 22 22 23 23 class bo_catalog_group_catalog extends abo_catalog 24 24 { 25 26 25 var $external; 27 28 26 var $fields = array( 29 27 'id_contact' => true, … … 40 38 'pgp_key' => true, 41 39 'notes' => true, 42 40 43 41 /* Array fields */ 44 42 'companies' => true, … … 47 45 'connections' => true 48 46 ); 49 50 /*! 51 47 48 /*! 49 52 50 @function bo_people_catalog 53 51 @abstract Constructor 54 52 @author Raphael Derosso Pereira 55 53 56 54 */ 57 function bo_catalog_group_catalog(& $bo_contactcenter, & $catalog, $external = 0 )55 function bo_catalog_group_catalog(& $bo_contactcenter, & $catalog, $external = 0 ) 58 56 { 59 57 $this->bo_contactcenter = & $bo_contactcenter; … … 61 59 $this->external = $external; 62 60 } 63 61 64 62 65 63 /*! … … 71 69 72 70 @param SEE class bo_contactcenter for usage 73 71 74 72 */ 75 73 function find($what, $rules, $other) … … 77 75 if ($ldap_info = $this->catalog['ldap']) 78 76 { 79 80 77 $meta_catalog =& CreateObject('contactcenter.bo_global_ldap_catalog',$ldap_info['id_source'], $ldap_info['context'], $this->external); 81 78 return $meta_catalog->find($what, $rules, $other); 82 79 } 83 80 84 81 $results = array(); 85 82 86 83 reset($this->catalog); 87 84 while(list(, $new_catalog) = each($this->catalog['sub_branch'])) … … 90 87 //echo 'Setting catalog: <b>'.$new_catalog['name'].'</b><br>'; 91 88 $new_catalog = $this->bo_contactcenter->set_catalog($new_catalog); 92 89 93 90 //if($new_catalog) echo 'Setado corretamente!<br><br>'; else echo 'Erro ao setar<br><br>'; 94 91 95 92 if ($new_catalog['type'] === 'empty') 96 93 { 97 94 continue; 98 95 } 99 96 100 97 $temp_res = $this->bo_contactcenter->catalog->find($what, $rules, $other); 101 98 if (is_array($temp_res) and count($temp_res)) … … 111 108 return $result; 112 109 } 113 114 /*! 115 110 111 /*! 112 116 113 @function get_single_entry 117 114 @abstract Returns all information requested about one contact 118 115 @author Raphael Derosso Pereira 119 116 120 117 @param integer $id_contact The contact ID 121 118 @param array $fields The array returned by get_fields whith true 122 119 on the fields to be taken. 123 120 124 121 */ 125 122 function get_single_entry ( $id_contact, $fields ) 126 { 127 if (!is_array($fields)) 128 { 129 if (is_object($GLOBALS['phpgw']->log)) 123 { 124 if (!is_array($fields)) 125 { 126 if (is_object($GLOBALS['phpgw']->log)) 130 127 { 131 128 $GLOBALS['phpgw']->log->message(array( … … 133 130 'line' => __LINE__, 134 131 'file' => __FILE__)); 135 132 136 133 $GLOBALS['phpgw']->log->commit(); 137 134 } 138 else 135 else 139 136 { 140 137 exit('Argument Error on: <br>File:'.__FILE__.'<br>Line:'.__LINE__.'<br>'); 141 138 } 142 139 } 143 140 144 141 $contact_array = $this->get_multiple_entries(array($id_contact), $fields); 145 142 146 143 if (!count($contact_array)) 147 144 { … … 153 150 else 154 151 $contact_data = $contact_array[$id_contact]; 155 152 156 153 if (!is_array($contact_data)) 157 154 { 158 155 return false; 159 156 } 160 157 161 158 return $contact_data; 162 159 } 163 164 /*! 165 160 161 /*! 162 166 163 @function get_multiple_entries 167 164 @abstract Returns multiple Contacts data into one array … … 176 173 'sort' => <sort>, 177 174 'order_by' => <order by> 178 ); 179 175 ); 176 180 177 */ 181 178 function get_multiple_entries ( $id_contacts, $fields, $other_data = false ) … … 183 180 if (!is_array($id_contacts) or !is_array($fields) or ($other_data != false and !is_array($other_data))) 184 181 { 185 if (is_object($GLOBALS['phpgw']->log)) 182 if (is_object($GLOBALS['phpgw']->log)) 186 183 { 187 184 $GLOBALS['phpgw']->log->message(array( … … 189 186 'line' => __LINE__, 190 187 'file' => __FILE__)); 191 188 192 189 $GLOBALS['phpgw']->log->commit(); 193 190 } … … 196 193 } 197 194 } 198 195 199 196 $contacts = array(); 200 197 201 198 if ($other_data) 202 199 { 203 200 //TODO 204 201 } 205 206 //error_log("bo_ldap_catalog_group_catalog->get_multiple_entries \n", 3, '/var/www/teste.log'); 207 202 208 203 /* First check if this is a LDAP Catalog Group. In this case, just leave the 209 204 * subtree search for the LDAP server … … 214 209 return $meta_catalog->get_multiple_entries($id_contacts, $fields, $other_data); 215 210 } 216 211 217 212 /* Search for the catalog of the first entry and try to get all ids from that 218 213 * catalog. Repeat to the ones not found until there's none missing or no more … … 226 221 $this->bo_contactcenter->set_catalog($branch); 227 222 $contacts += $this->bo_contactcenter->catalog->get_multiple_entries($id_contacts, $fields, $other_data); 228 223 229 224 reset($contacts); 230 225 while (list($id) = each($contacts)) … … 243 238 244 239 $this->bo_contactcenter->set_catalog($this->catalog); 245 240 246 241 return $contacts; 247 242 } 248 243 249 244 function get_all_entries_ids () 250 245 { … … 252 247 return null; 253 248 } 254 249 255 250 /*********************************************************************\ 256 251 * Methods to get general fields * 257 252 \*********************************************************************/ 258 253 259 254 /*********************************************************************\ 260 255 * Methods to Include Data * -
trunk/contactcenter/inc/class.bo_contactcenter.inc.php
r284 r285 5 5 * Written by: * 6 6 * - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net> * 7 * sponsored by Thyamad - http://www.thyamad.com *7 * sponsored by Thyamad - http://www.thyamad.com 8 8 * ------------------------------------------------------------------------- * 9 9 * This program is free software; you can redistribute it and/or modify it * … … 25 25 */ 26 26 var $catalog; 27 27 28 28 /*! 29 29 The Security Manager 30 30 */ 31 31 var $security; 32 32 33 33 34 34 function bo_contactcenter($catalog=false) … … 37 37 $this->catalog_level = $GLOBALS['phpgw']->session->appsession('bo_contactcenter.catalog_level','contactcenter'); 38 38 $this->security = CreateObject('contactcenter.bo_security_manager'); 39 39 40 40 if ($catalog) 41 41 { … … 56 56 } 57 57 } 58 58 59 59 /* 60 60 * … … 108 108 109 109 /*! 110 110 111 111 @function find 112 112 @abstract Performs a search in the DB based on the parameters 113 113 @author Raphael Derosso Pereira (algorithm and code) 114 114 @author Vinicius Cubas Brand (algorithm) 115 115 116 116 @param array $what The list of fields to be returned. The format is: 117 117 $what = array( … … 119 119 'contact.names_ordered' 120 120 ); 121 121 122 122 @param array $rules The restrictions. 123 123 124 124 The restrictions format is quite complicated, but is very complete. 125 125 As defined here, there is the possibility to do almost any type of 126 126 search (tell me if you can't do any). For example, imagine the 127 127 following search: 128 128 129 129 and(a,or(d,e,and(f,g))) 130 130 131 131 That is represented by the folloowing tree: 132 132 133 133 and 134 134 | … … 148 148 The rules that should be passed to the find function for this tree 149 149 is: 150 150 151 151 $rules = array( 152 152 0 => array( … … 189 189 ); 190 190 191 192 The restriction type can be: =, !=, <=, <, >, >=, NULL, IN, LIKE, 191 192 The restriction type can be: =, !=, <=, <, >, >=, NULL, IN, LIKE, 193 193 NOT NULL, NOT IN, NOT LIKE 194 194 Value of branch can be AND, OR, NOT 195 196 @param array $other Other parameter to the search 195 196 @param array $other Other parameter to the search 197 197 $other = array( 198 198 'offset' => (int), … … 204 204 205 205 @return array $array[<field_name>][<row_number>] 206 206 207 207 */ 208 208 function find($what, $rules=false, $other=false) … … 210 210 return $this->catalog->find($what, $rules, $other); 211 211 } 212 213 /*! 214 212 213 /*! 214 215 215 @function get_catalog_tree 216 216 @abstract Returns an array describing the available … … 223 223 @param (boolean) $recursive Retrive the whole tree from 224 224 the level specified until the leaves 225 225 226 226 @return The format of the return is: 227 227 $return = array( … … 246 246 1 => array(...),... 247 247 ); 248 248 249 249 <branch_type> can be 'catalog_group', 'catalog' or 'view'; 250 <branch_class> is the name of the class that is capable of 250 <branch_class> is the name of the class that is capable of 251 251 handling the information for this catalog/view 252 252 <branch_class_args> is an array that holds the arguments to … … 254 254 <brach_find_args> is the string that should precede the search 255 255 string 256 257 If the branch is actually a leaf, than 'sub_branch' is false; 258 259 256 257 If the branch is actually a leaf, than 'sub_branch' is false; 258 259 260 260 TODO: This method is hard-coded, but it should grab the tree 261 261 from the DB using the View Manager... … … 269 269 return $this->tree['branches']; 270 270 } 271 271 272 272 $lvl_vector = explode('.', $level); 273 273 $id = $lvl_vector[1]; … … 275 275 $branch =& $this->get_branch_by_level($level); 276 276 $info = $this->get_info_by_level($level); 277 277 278 278 if ($branch['type'] === 'unknown') 279 279 { … … 281 281 { 282 282 $ldap = CreateObject('contactcenter.bo_ldap_manager'); 283 284 283 if ($this->tree['branches'][$id]['external']) 285 284 { … … 292 291 $new_branch = $ldap->get_ldap_tree($info['src'], $branch['value'], $recursive); 293 292 } 294 295 293 if ($new_branch) 296 294 { … … 304 302 $new_branch['external'] = $branch['external']; 305 303 $branch = $new_branch; 306 307 304 } 308 305 else … … 312 309 } 313 310 $GLOBALS['phpgw']->session->appsession('bo_contactcenter.tree','contactcenter',$this->tree); 311 314 312 return $branch; 315 313 } … … 318 316 return $branch; 319 317 } 320 318 321 319 return false; 322 320 } 323 321 324 322 if ($level !== '0') 325 323 { 326 324 return false; 327 325 } 328 326 329 327 $this->tree = array( 330 328 0 => array( … … 338 336 'icon' => 'people-mini.png', 339 337 'sub_branch' => false 340 ),/* 341 1 => array( 342 'name' => lang('Companies'), 343 'type' => 'catalog', 344 'class' => 'bo_company_manager', 345 'find_args' => 'company', 346 'icon' => 'company-mini.png', 347 'sub_branch' => false 348 ),*/ 349 338 ), 350 339 1 => array( 351 340 'name' => lang('Groups'), … … 357 346 ) 358 347 ); 359 348 360 349 $ldap = CreateObject('contactcenter.bo_ldap_manager'); 361 350 $ldap_srcs = $ldap->get_all_ldap_sources(); 362 351 363 352 if ($ldap_srcs) 364 353 { … … 411 400 // External catalogs are now identified as type unknown during initialization. An optimization change. 412 401 413 /*414 if (($tree = $ldap->get_external_ldap_tree($id, $ldap_srcs[$id]['dn'], $recursive)))415 {416 if (array_key_exists('error_msg', $tree))417 {418 if (isset($this->tree['branches']['msg']))419 {420 $this->tree['branches']['msg'] .= "\n" . lang('Catalog %1 not showed due to error: ' .421 $tree['error_msg'], $ldap_srcs[$id]['name']);422 }423 else424 {425 $this->tree['branches']['msg'] = lang('Catalog %1 not showed due to error: ' .426 $tree['error_msg'], $ldap_srcs[$id]['name']);427 }428 }429 430 else431 {432 */433 402 $tree['name'] = $ldap_srcs[$id]['name']; 434 403 $tree['type'] = 'unknown'; 435 404 $tree['value'] = $ldap_srcs[$id]['dn']; 436 405 $tree['external'] = true; 437 //$tree['sub_branch'] = false;438 406 array_push($this->tree['branches'], $tree); 439 407 $this->tree[$i]['type'] = 'ldap'; 440 408 $this->tree[$i]['src'] = $id; 441 // }442 //}443 409 $i++; 444 410 } 445 411 } 446 412 447 413 $GLOBALS['phpgw']->session->appsession('bo_contactcenter.tree','contactcenter',$this->tree); 448 414 return $this->tree['branches']; 449 //return null; 450 } 451 452 /*! 453 415 } 416 417 /*! 418 454 419 @function get_branch_by_level 455 420 @abstract Returns the branch and it's informations given the level 456 421 @author Raphael Derosso Pereira 457 422 458 423 @param (string) $level The level to be used 459 424 460 425 */ 461 426 function & get_branch_by_level($level) … … 463 428 $path = @explode('.',$level); 464 429 $n_ways = count($path); 465 430 466 431 if ($n_ways <= 1) 467 432 { 468 433 return false; 469 434 } 470 435 471 436 $code = '$branch =& $this->tree[\'branches\']'; 472 437 for ($i = 1; $i < $n_ways-1; $i++) … … 478 443 //echo 'Codigo: '.$code.'<br>'; 479 444 eval($code); 480 445 481 446 return $branch; 482 447 } 483 448 484 449 /*! 485 450 486 451 @function get_info_by_level 487 452 @abstract Returns the information about the catalog, given the level … … 495 460 $path = @explode('.',$level); 496 461 $n_ways = count($path); 497 462 498 463 if ($n_ways <= 1) 499 464 { 500 465 return false; 501 466 } 502 467 503 468 $info = $this->tree[$path[1]]; 504 469 505 470 return $info; 506 471 } … … 553 518 554 519 $search = $this->get_level_by_branch($catalog, $bcatalog['sub_branch'], (string) $level); 555 520 556 521 if ($search !== false) 557 522 { … … 567 532 return false; 568 533 } 569 570 /*! 571 534 535 /*! 536 572 537 @function get_actual_catalog 573 @abstract Returns the information about the Catalog that is 538 @abstract Returns the information about the Catalog that is 574 539 instantiated 575 540 576 541 @author Raphael Derosso Pereira 577 542 578 543 */ 579 544 function get_actual_catalog() … … 582 547 return $catalog; 583 548 } 584 585 /*! 586 549 550 /*! 551 587 552 @function set_catalog 588 553 @abstract Sets the actual catalog 589 554 @author Raphael Derosso Pereira 590 555 591 556 @param array $to_catalog The catalog in the format returned by 592 557 get_available_tree or the level 593 558 594 559 */ 595 560 function set_catalog(& $to_catalog ) … … 614 579 { 615 580 $catalog =& $to_catalog; 616 //echo "Daqui!<br>";617 581 $level = $this->get_level_by_branch($to_catalog, $this->tree['branches']); 618 582 } 619 620 583 $lvl_vector = explode('.', $level); 621 584 $id = $lvl_vector[1]; 622 585 623 586 switch($catalog['type']) 624 587 { … … 642 605 $call .= ','.implode(',',$args); 643 606 } 644 607 645 608 $call .= ');'; 646 609 647 610 // print_r($catalog); 648 611 // echo '<br><br><b>Setando Catalogo '.$catalog['name'].': </b>'.$call.'<br>'; 649 612 650 613 eval($call); 651 614 652 615 return $catalog; 653 616 654 617 default: return false; 655 618 } 656 619 } 657 620 658 621 659 622 … … 661 624 * Methods to set general fields * 662 625 \*********************************************************************/ 663 664 /*! 665 626 627 /*! 628 666 629 @function add_vcard 667 630 @abstract Insert a VCard to the squema … … 669 632 @param string $uploaded_file The path to the file that were 670 633 uploaded. 671 634 672 635 */ 673 636 function add_vcard ( $uploaded_file ) … … 676 639 677 640 678 641 679 642 /*********************************************************************\ 680 643 * Methods to get general data * 681 644 \*********************************************************************/ 682 645 683 646 } 684 647 ?> -
trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php
r284 r285 16 16 */ 17 17 include_once('class.abo_catalog.inc.php'); 18 18 19 19 class bo_global_ldap_catalog extends abo_catalog 20 20 { 21 21 var $ldap; 22 22 23 23 var $src_info; 24 24 25 25 var $trans_table; 26 27 26 // used to determine if a catalog is external 28 27 var $external; 29 30 28 var $fields = array( 31 29 'id_contact' => true, … … 43 41 'pgp_key' => true, 44 42 'notes' => true, 45 'department' => true, 46 47 'empNumber' => true, 48 43 49 44 /* Array fields */ 50 45 'companies' => true, … … 53 48 'connections' => true 54 49 ); 55 50 56 51 /* 57 52 58 53 @function global_ldap_catalog 59 54 @abstract Constructor … … 64 59 @param string $context Ldap bind DN 65 60 @param integer $external 0 = internal catalog, 1 = external catalog 66 67 61 */ 68 62 function bo_global_ldap_catalog ( $id_source, $context, $external = 0 ) 69 63 { 70 71 64 $this->external = $external; 72 73 65 if (!function_exists('ldap_search')) 74 66 { 75 67 exit('PHP LDAP support Unavailable!'); 76 68 } 77 69 78 70 $this->ldap = CreateObject('contactcenter.bo_ldap_manager'); 79 71 80 72 if ($this->external) 81 73 { … … 100 92 } 101 93 else 102 { 94 { 103 95 $this->trans_table = $this->ldap->get_ldap_fields_association($id_source); 104 96 } 105 97 } 106 98 107 99 /* 108 100 109 101 @function find 110 102 @abstract Searches the LDAP directory for the specified fields with … … 112 104 that matches the rules. 113 105 @author Raphael Derosso Pereira 114 106 115 107 @param array $what The fields to be taken 116 108 @param array $rules The rules to be match. See class.abo_catalog.inc.php … … 121 113 'offset' => (integer) [NOT IMPLEMENTED] 122 114 ) 123 115 124 116 */ 125 117 function find($what, $rules=false, $other=false) 126 118 { 127 119 $restric_fields = $this->get_restrictions_without_branch($rules); 128 120 129 121 $trans_f = $this->translate_fields($what, $restric_fields); 130 122 131 123 foreach($trans_f as $orig => $field_a) 132 124 { … … 136 128 } 137 129 } 138 130 139 131 $fields = array_unique($fields); 140 132 141 133 $filter = $this->process_restrictions($rules, $trans_f); 142 134 143 135 if(strstr($this->src_info['context'], "ldap://")) { 144 136 $refer_context = str_replace("??base","",preg_replace('!^(ldap://[^/]+)/(.*$)!', '\\2', $this->src_info['context'])); 145 $host = preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $this->src_info['context']); 137 $host = preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $this->src_info['context']); 146 138 $this->src_info['host'] = $host; 147 $this->src_info['acc'] = ''; 148 $this->src_info['pw'] = ''; 149 } 150 151 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], true); 152 153 if (!$ldap) 154 { 139 } 140 141 if($refer_context || "ou" === strtolower(substr($this->src_info['context'], 0, 2))) 142 { 143 $followReferral = false; 144 } 145 elseif(trim($rules[4]['value']) != "inetOrgPerson") 146 { 147 $followReferral = true; 148 } 149 else 150 { 155 151 return false; 156 152 } 157 158 if (!$this->external) 159 { 160 $fields[] ='phpgwAccountVisible'; 161 } 162 163 $result_r = @ldap_search($ldap ,($refer_context ? $refer_context : $this->src_info['context']), $filter, $fields, 0); 153 154 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], $followReferral); 155 $result_r = ldap_search($ldap ,($refer_context ? $refer_context : $this->src_info['context']), $filter, $fields, 0); 164 156 165 157 if (!$result_r) … … 167 159 return false; 168 160 } 169 161 170 162 if ($other['order']) 171 163 { … … 181 173 } 182 174 } 183 175 184 176 $result_u = ldap_get_entries($ldap, $result_r); 185 177 186 178 $i = 0; 187 179 foreach ($result_u as $index => $result_p) … … 191 183 continue; 192 184 } 193 185 194 186 foreach ($trans_f as $orig => $trans) 195 187 { … … 209 201 $i++; 210 202 } 211 203 212 204 return $return; 213 205 } 214 206 215 207 /* 216 208 217 209 @function translate_fields 218 210 @abstract Return the LDAP objectClass fields that corresponds to the 219 211 specified parameter fields 220 212 @author Raphael Derosso Pereira 221 213 222 214 @param array $fields The fields in the standard ContactCenter format 223 215 @param array $rules The rules 224 216 225 217 */ 226 218 function translate_fields ( $fields, &$restric_fields ) 227 219 { 228 220 $return = array(); 229 221 230 222 $i = 0; 231 223 foreach ($fields as $field) … … 235 227 continue; 236 228 } 237 229 238 230 if (!is_array($this->trans_table[$field])) 239 231 { 240 232 $reference = $this->trans_table[$field]; 241 233 242 234 reset($restric_fields); 243 235 while(list(,$field_r) = each($restric_fields)) 244 236 { 245 246 237 if ($field_r['field'] === $reference and array_key_exists($field_r['value'], $this->trans_table[$reference])) 247 238 { … … 252 243 else 253 244 { 254 255 245 if (!is_array($return[$field])) 256 246 { … … 263 253 } 264 254 } 265 255 266 256 if (count($return)) 267 257 { 268 258 return $return; 269 259 } 270 260 271 261 return false; 272 262 } 273 263 274 264 /* 275 265 276 266 @function process_restrictions 277 267 @abstract Returns a LDAP filter string that corresponds to the 278 268 specified restriction rules 279 269 @author Raphael Derosso Pereira 280 270 281 271 @param string $rules The restriction rules 282 272 283 273 */ 284 274 function process_restrictions( $rules, &$trans_table, $join_type='&' ) … … 288 278 return null; 289 279 } 290 280 291 281 foreach($rules as $rule_i => $rule) 292 282 { … … 300 290 $join = '|'; 301 291 break; 302 292 303 293 case 'AND': 304 294 $join = '&'; 305 295 break; 306 296 307 297 case 'NOT': 308 298 $join = '!'; 309 299 break; 310 300 311 301 default: 312 302 $join = $join_type; … … 314 304 $return_t[] = $this->process_restrictions($rule['sub_branch'], $trans_table, $join); 315 305 break; 316 306 317 307 case '=': 318 308 if (array_key_exists($rule['field'], $trans_table)) … … 325 315 } 326 316 break; 327 328 case '!=': 317 318 case '!=': 329 319 if (array_key_exists($rule['field'], $trans_table)) 330 320 { … … 336 326 } 337 327 break; 338 328 339 329 case '<=': 340 330 case '<': … … 348 338 } 349 339 break; 350 340 351 341 case '>': 352 342 case '>=': … … 360 350 } 361 351 break; 362 352 363 353 case 'NULL': 364 354 if (array_key_exists($rule['field'], $trans_table)) … … 371 361 } 372 362 break; 373 363 374 364 case 'IN': 375 365 if (array_key_exists($rule['field'], $trans_table)) … … 391 381 $value_1 = strtoupper(str_replace('%', '*', $rule['value'])); 392 382 $value_2 = strtolower($value_1); 393 383 394 384 foreach($trans_table[$rule['field']] as $field) 395 385 { … … 400 390 } 401 391 break; 402 392 403 393 */ case 'LIKE': 404 394 if (array_key_exists($rule['field'], $trans_table)) 405 395 { 406 396 $value = str_replace('%', '*', $rule['value']); 407 397 408 398 foreach($trans_table[$rule['field']] as $field) 409 399 { … … 413 403 } 414 404 break; 415 405 416 406 case 'NOT NULL': 417 407 if (array_key_exists($rule['field'], $trans_table)) … … 424 414 } 425 415 break; 426 416 427 417 case 'NOT IN': 428 418 if (array_key_exists($rule['field'], $trans_table)) … … 444 434 $value_1 = strtoupper(str_replace('%', '*', $rule['value'])); 445 435 $value_2 = strtolower($value_1); 446 436 447 437 foreach($trans_table[$rule['field']] as $field) 448 438 { … … 458 448 { 459 449 $value = str_replace('%', '*', $rule['value']); 460 450 461 451 foreach($trans_table[$rule['field']] as $field) 462 452 { … … 468 458 } 469 459 } 470 460 471 461 if (count($return_t)) 472 462 { … … 486 476 487 477 /*! 488 478 489 479 @function get_restrictions_without_branch 490 480 @abstract Returns an array containing the restrictions ignoring the 491 481 branches 492 482 @author Raphael Derosso Pereira 493 483 494 484 @param array $restrictions The restrictions 495 485 496 486 */ 497 487 function get_restrictions_without_branch(&$restrictions) … … 501 491 return null; 502 492 } 503 493 504 494 $fields = array(); 505 495 506 496 foreach ($restrictions as $restrict_data) 507 497 { … … 511 501 $fields = array_merge($fields, $this->get_restrictions_without_branch($restrict_data['sub_branch'])); 512 502 break; 513 503 514 504 case '=': 515 case '!=': 505 case '!=': 516 506 case '<=': 517 507 case '<': … … 528 518 array_push($fields, $restrict_data); 529 519 break; 530 520 531 521 default: 532 exit('Error in '.__FILE__.' on '.__LINE__.'<br>The restriction type passed was: '.$restrict_data['type']); 533 } 534 } 535 522 exit('Error in '.__FILE__.' on '.__LINE__.'<br>The restriction type passed was: '.$restrict_data['type']); 523 } 524 } 525 536 526 return $fields; 537 527 } 538 539 528 529 540 530 /*********************************************************************\ 541 531 * Methods to Get Data * 542 532 \*********************************************************************/ 543 544 533 534 545 535 /*! 546 536 547 537 @function get_single_entry 548 538 @abstract Returns all information requested about one contact 549 539 @author Raphael Derosso Pereira 550 540 551 541 @param integer $id_contact The contact ID 552 542 @param array $fields The array returned by get_fields with true 553 543 on the fields to be taken. 554 544 555 545 */ 556 546 function get_single_entry ( $id_contact, $fields ) 557 547 { 558 if (!is_array($fields)) 559 { 560 if (is_object($GLOBALS['phpgw']->log)) 548 if (!is_array($fields)) 549 { 550 if (is_object($GLOBALS['phpgw']->log)) 561 551 { 562 552 $GLOBALS['phpgw']->log->message(array( … … 564 554 'line' => __LINE__, 565 555 'file' => __FILE__)); 566 556 567 557 $GLOBALS['phpgw']->log->commit(); 568 558 } 569 else 559 else 570 560 { 571 561 exit('Argument Error on: <br>File:'.__FILE__.'<br>Line:'.__LINE__.'<br>'); 572 562 } 573 563 } 574 564 575 565 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'],$this->src_info['acc'],$this->src_info['pw'],true); 576 566 577 567 if (!$ldap) 578 568 { 579 569 return false; 580 570 } 581 571 582 572 $resource = ldap_read($ldap, $id_contact, 'objectClass='.$this->src_info['obj']); 583 573 $n_entries = ldap_count_entries($ldap, $resource); … … 586 576 return false; 587 577 } 588 578 589 579 $first_entry = ldap_first_entry($ldap, $resource); 590 580 $contact = ldap_get_attributes($ldap,$first_entry); 591 if($contact['jpegPhoto']){ 592 $contact['jpegPhoto'] = ldap_get_values_len ($ldap, $first_entry, "jpegPhoto"); 581 if($contact['jpegPhoto']){ 582 $contact['jpegPhoto'] = ldap_get_values_len ($ldap, $first_entry, "jpegPhoto"); 593 583 } 594 584 595 585 // print_r($contact); 596 586 597 587 // $contact_data = $this->fields; 598 588 599 589 foreach($fields as $field => $trueness) 600 590 { … … 604 594 continue; 605 595 } 606 596 607 597 switch ($field) 608 598 { … … 613 603 $l_fields['department'] = $this->trans_table['contact.business_info.department']; 614 604 $l_fields['company_notes'] = $this->trans_table['contact.company.company_notes']; 615 605 616 606 $contact_data['companies'] = array(); 617 607 foreach($l_fields as $l_field => $l_value) … … 621 611 continue; 622 612 } 623 613 624 614 $contact_data['companies']['company1'][$l_field] = utf8_decode($contact[$l_value[0]][0]); 625 615 } 626 616 627 617 if (!(count($contact_data['companies']))) 628 618 { … … 630 620 } 631 621 break; 632 622 633 623 case 'relations': 634 624 unset($l_fields); … … 637 627 unset($contact_data['relations']); 638 628 } 639 629 640 630 $contact_data['relations'] = array(); 641 631 if (!is_array($this->trans_table['contact.contact_related.names_ordered'])) … … 645 635 continue; 646 636 } 647 637 648 638 $i = 1; 649 639 foreach($trans as $l_type => $l_type_fields) … … 653 643 continue; 654 644 } 655 645 656 646 $contact_data['relations']['relation'.$i]['type'] = $l_type; 657 647 $contact_data['relations']['relation'.$i]['names_ordered'] = utf8_decode($contact[$l_type_fields[0]][0]); … … 659 649 } 660 650 } 661 651 662 652 if (!(count($contact_data['relations']))) 663 653 { … … 665 655 } 666 656 break; 667 657 668 658 case 'addresses': 669 659 unset($l_fields); … … 694 684 continue; 695 685 } 696 686 697 687 $i = 1; 698 688 foreach($trans as $l_type => $l_type_fields) … … 702 692 continue; 703 693 } 704 694 705 695 $contact_data['addresses']['address'.$i]['type'] = $l_type; 706 696 $contact_data['addresses']['address'.$i][$l_field] = utf8_decode($contact[$l_type_fields[0]][0]); … … 713 703 } 714 704 } 715 705 716 706 if (!(count($contact_data['addresses']))) 717 707 { … … 719 709 } 720 710 break; 721 711 722 712 case 'connections': 723 713 $preferences = ExecMethod('contactcenter.ui_preferences.get_preferences'); … … 740 730 continue; 741 731 } 742 732 743 733 $i = 1; 744 734 foreach($trans as $l_type => $l_type_fields) … … 748 738 continue; 749 739 } 750 740 751 741 switch ($l_type) 752 742 { … … 768 758 } 769 759 } 770 760 771 761 if (!(count($contact_data['connections']))) 772 762 { … … 774 764 } 775 765 break; 776 766 777 767 case 'prefix': 778 768 unset($l_fields); … … 783 773 continue; 784 774 } 785 775 786 776 $contact_data['prefix'] = utf8_decode($contact[$l_fields[0]][0]); 787 777 break; 788 778 789 779 case 'suffix': 790 780 unset($l_fields); … … 795 785 continue; 796 786 } 797 787 798 788 $contact_data['suffix'] = utf8_decode($contact[$l_fields[0]][0]); 799 789 break; 800 790 801 791 case 'status': 802 792 unset($l_fields); … … 807 797 continue; 808 798 } 809 799 810 800 $contact_data['status'] = utf8_decode($contact[$l_fields[0]][0]); 811 801 break; 812 802 813 803 case 'photo': 814 804 unset($l_fields); … … 819 809 continue; 820 810 } 821 811 822 812 $contact_data['photo'] = $contact[$l_fields[0]][0]; 823 break; 813 break; 824 814 825 815 default: … … 831 821 continue; 832 822 } 833 823 834 824 if(count($contact[$l_fields[0]]) > 1) 835 825 { … … 848 838 } 849 839 } 850 840 851 841 if (!is_array($contact_data)) 852 842 { 853 843 return false; 854 844 } 855 845 856 846 return $contact_data; 857 847 } 858 848 //SERPRO 859 849 /*! 860 850 … … 932 922 $l_fields['department'] = $this->trans_table['contact.business_info.department']; 933 923 $l_fields['company_notes'] = $this->trans_table['contact.company.company_notes']; 934 935 ///Relaciona o array com o atributo 'employeeNumber' do RHDS936 $l_fields['empNumber'] = $this->trans_table['contact.business_info.empNumber'];937 924 938 925 $contact_data['companies'] = array(); … … 1181 1168 return $contacts; 1182 1169 } 1183 1170 1184 1171 function get_multiple_entries ( $id_contacts, $fields, $other_data = false ) 1185 1172 { 1186 1173 if (!is_array($id_contacts) or !is_array($fields) or ($other_data != false and !is_array($other_data))) 1187 1174 { 1188 if (is_object($GLOBALS['phpgw']->log)) 1175 if (is_object($GLOBALS['phpgw']->log)) 1189 1176 { 1190 1177 $GLOBALS['phpgw']->log->message(array( … … 1192 1179 'line' => __LINE__, 1193 1180 'file' => __FILE__)); 1194 1181 1195 1182 $GLOBALS['phpgw']->log->commit(); 1196 1183 } … … 1199 1186 } 1200 1187 } 1201 1202 $contacts = array(); 1203 1188 1189 foreach ($id_contacts as $id) 1190 { 1191 $contacts[$id] = $this->get_single_entry($id,$fields); 1192 } 1193 1194 return $contacts; 1195 1196 // SERPRO 1197 1198 /*$contacts = array(); 1199 1204 1200 if ($other_data) 1205 1201 { … … 1211 1207 //$teste = $this->get_all_entries($filter, $fields); 1212 1208 1213 return $this->get_all_entries($filter, $fields); 1214 } 1215 1209 return $this->get_all_entries($filter, $fields);*/ 1210 1211 } 1212 1213 // CELEPAR 1214 function generate_filter($id_contacts) 1215 { 1216 if (($size = count($id_contacts))) 1217 { 1218 $contacts[$id] = $this->get_single_entry($id,$fields); 1219 } 1220 1221 return $contacts; 1222 } 1223 1224 // SERPRO 1225 /* 1216 1226 function generate_filter($id_contacts) 1217 1227 { … … 1222 1232 { 1223 1233 1224 / *1225 *Não utiliza mais a função ldap_explode, usa a expressão regular a seguir para pegar o primeiro1226 *componente da dn1227 */1234 // 1235 // Não utiliza mais a função ldap_explode, usa a expressão regular a seguir para pegar o primeiro 1236 // componente da dn 1237 // 1228 1238 preg_match('/^(\w*=[^,]*),.*$/', $id_contacts[$i], $cn); 1229 1239 1230 /* 1231 * Adicionados os str_replace para adicionar caracteres de escape em frente aos caracteres '(' e ')', 1232 * posteriormente poderá ser necessário substituir por uma expressão regular mais genérica. 1233 */ 1240 // 1241 // Adicionados os str_replace para adicionar caracteres de escape em frente aos caracteres '(' e ')', 1242 // posteriormente poderá ser necessário substituir por uma expressão regular mais genérica. 1243 // 1244 1234 1245 if ($cn[1]) 1235 1246 { 1236 / *1237 *Esta operação resolve o problema causado pela conversão de caracteres acentuados realizada1238 *pela função ldap_explode_dn(). Talvez seja necessário utilizar esta tradução em outros lugares,1239 *neste caso é mais apropriado colocar dentro de uma função.1240 */1247 // 1248 // Esta operação resolve o problema causado pela conversão de caracteres acentuados realizada 1249 // pela função ldap_explode_dn(). Talvez seja necessário utilizar esta tradução em outros lugares, 1250 // neste caso é mais apropriado colocar dentro de uma função. 1251 // 1241 1252 //foreach($cn as $key=>$value){ 1242 1253 // $cn[$key]=preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $value); … … 1252 1263 1253 1264 } 1265 */ 1254 1266 1255 1267 function get_all_entries_ids () … … 1280 1292 return null; 1281 1293 } 1282 1294 1283 1295 function get_relations ($id_contact,$extra=false) 1284 1296 { 1285 1297 } 1286 1298 1287 1299 function get_addresses ( $id_contact,$extra=false ) 1288 1300 { 1289 1301 } 1290 1302 1291 1303 function get_connections ( $id_contact,$extra=false ) 1292 1304 { 1293 1305 } 1294 1306 1295 1307 function get_companies ( $id_contact, $extra=false ) 1296 1308 { 1297 1309 } 1298 1310 1299 1311 function get_all_prefixes ( ) 1300 1312 { 1301 1313 } 1302 1314 1303 1315 function get_all_suffixes ( ) 1304 1316 { 1305 1317 } 1306 1318 1307 1319 function get_all_status ( ) 1308 1320 { 1309 1321 } 1310 1322 1311 1323 function get_all_relations_types ( ) 1312 1324 { 1313 1325 } 1314 1326 1315 1327 function get_all_addresses_types ( ) 1316 1328 { 1317 1329 } 1318 1330 1319 1331 function get_all_connections_types ( ) 1320 1332 { 1321 1333 } 1322 1334 1323 1335 function get_vcard ( $id_contact ) 1324 1336 { 1325 1337 } 1326 1327 1328 1329 1338 1339 1340 1341 1330 1342 function get_global_tree ( $root ) 1331 1343 { 1332 1344 } 1333 1345 1334 1346 function get_actual_brach ( ) 1335 1347 { 1336 1348 } 1337 1349 1338 1350 function set_actual_branch ( $branch ) 1339 1351 { -
trunk/contactcenter/inc/class.bo_ldap_manager.inc.php
r284 r285 12 12 \***************************************************************************/ 13 13 14 14 15 15 /* 16 16 This class is responsible for the LDAP control/generic functions and for … … 19 19 include_once('class.Thread.inc.php'); 20 20 21 class bo_ldap_manager 21 class bo_ldap_manager 22 22 { 23 23 24 24 var $srcs; 25 25 26 26 27 function bo_ldap_manager () 27 28 { 28 29 29 if (!($this->srcs = $GLOBALS['phpgw']->session->appsession('bo_ldap_manager.srcs','contactcenter'))) 30 30 { 31 31 $c = CreateObject('phpgwapi.config','contactcenter'); 32 32 $data = $c->read_repository(); 33 33 34 34 if (!$data or $data['cc_global_source0'] !== 'ldap') 35 35 { … … 37 37 return; 38 38 } 39 39 40 40 $this->srcs = array( 41 41 1 => array( … … 46 46 'pw' => $data['cc_ldap_pw0'], 47 47 'obj' => 'inetOrgPerson', 48 'branch' => strtolower('ou') 48 'branch' => strtolower('ou'), 49 'visible' => $data['cc_ldap_query_automatic'] 49 50 ) 50 51 51 ); 52 52 } … … 56 56 { 57 57 } 58 58 59 59 /* 60 60 61 61 @function get_all_ldap_sources 62 62 @abstract Returns an array containing all LDAP sources informations 63 63 @author Raphael Derosso Pereira 64 64 65 65 @return array All LDAP information 66 66 $return = array( … … 69 69 'dn' => (string), 70 70 'acc' => (string), 71 'pw' => (string) 71 'pw' => (string) 72 72 ), 73 73 ... 74 74 ) 75 75 76 76 TODO: Return multiple sources... 77 77 */ … … 80 80 return $this->srcs; 81 81 } 82 82 83 83 /* 84 84 * @function get_external_ldap_sources … … 102 102 function get_ldap_fields_association ( $id_source ) 103 103 { 104 104 105 105 $op_iop = array( 106 106 'contact.id_contact' => array('dn'), … … 111 111 'contact.family_names' => array('sn'), 112 112 'contact.names_ordered' => array('cn'),//,'displayName'), 113 114 113 'contact.suffixes.suffix' => false, 115 114 'contact.birthdate' => false, … … 117 116 'contact.pgp_key' => false, 118 117 'contact.notes' => false, 119 'contact.mail_forwarding_address' 120 'contact.account_type' 121 122 118 'contact.mail_forwarding_address' => array('mailForwardingAddress'), 119 'contact.account_type' => array('phpgwAccountType'), 120 'contact.account_status' => array('phpgwAccountStatus'), 121 'contact.account_visible' => array('phpgwAccountVisible'), 123 122 'contact.object_class' => array('objectClass'), 124 123 'contact.business_info.title' => array('title'), 125 'contact.business_info.department' => array('ou'), // Setor do empregado... 126 'contact.business_info.empNumber' => array('employeeNumber'), // Matricula do empregado 124 'contact.business_info.department' => array('ou'), 127 125 'contact.company.company_name' => array('o'), 128 126 'contact.company.company_notes' => array('businessCategory'), 129 127 130 128 'contact.contact_related.names_ordered' => 'contact.contact_related.typeof_relation.contact_relation_name', 131 129 'contact.contact_related.typeof_relation.contact_relation_name' => array( … … 133 131 'secretary' => array('secretary') 134 132 ), 135 133 136 134 'contact.address.address1' => 'contact.address.typeof_address.contact_address_type_name', 137 135 'contact.address.typeof_address.contact_address_type_name' => array( 138 136 'home' => array('street', 'st', 'postalAddress', 'homePostalAddress'), 139 137 ), 140 138 141 139 'contact.address.postal_code' => 'contact.address.typeof_address.contact_address_type_name', 142 140 'contact.address.typeof_address.contact_address_type_name' => array( 143 141 'home' => array('PostalCode'), 144 142 ), 145 143 146 144 'contact.address.city.city_name' => 'contact.address.typeof_address.contact_address_type_name', 147 145 'contact.address.typeof_address.contact_address_type_name' => array( 148 146 'home' => array('l'), 149 147 ), 150 148 151 149 'contact.address.city.state.state_name' => 'contact.address.typeof_address.contact_address_type_name', 152 150 'contact.address.typeof_address.contact_address_type_name' => array( 153 151 'home' => false, 154 152 ), 155 153 156 154 'contact.address.city.country.id_country' => 'contact.address.typeof_address.contact_address_type_name', 157 155 'contact.address.typeof_address.contact_address_type_name' => array( 158 156 'home' => array('c') 159 157 ), 160 158 161 159 'contact.connection.connection_value' => 'contact.connection.typeof_connection.contact_connection_type_name', 162 160 'contact.connection.typeof_connection.contact_connection_type_name' => array ( … … 169 167 ), 170 168 ); 171 169 172 170 return $op_iop; 173 174 171 } 175 172 … … 232 229 233 230 /*! 234 231 235 232 @function get_ldap_tree 236 233 @abstract Returns the LDAP tree corresponding to the specified level 237 234 @author Raphael Derosso Pereira 238 235 239 236 @param (integer) $id_source The ID of the LDAP source 240 237 241 238 @param (string) $context The context to be used as root branch 242 239 243 240 @param (boolean) $recursive Make it a recursive construction. 244 241 CAUTION! This is EXTREMELY SLOW on large LDAP databases, 245 242 specially when they're not indexed 246 */ 247 function get_ldap_tree($id_source, $context = false, $recursive = false) 243 */ 244 function get_ldap_tree($id_source, $context = false, $recursive = false) 248 245 { 249 246 if (!$this->srcs[$id_source]) … … 251 248 return null; 252 249 } 253 250 254 251 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->srcs[$id_source]['host'], $this->srcs[$id_source]['acc'],$this->srcs[$id_source]['pw'], false); 255 252 if (!$ldap) … … 257 254 return false; 258 255 } 259 256 260 257 if ($recursive) 261 258 { … … 265 262 return $tree; 266 263 } 267 268 return $this->get_ldap_tree_level($id_source, $ldap, $context, $this->srcs[$id_source]['obj'],$this->srcs[$id_source]['branch'], 0); 269 } 264 265 return $this->get_ldap_tree_level($id_source, $ldap, $context, $this->srcs[$id_source]['obj'],$this->srcs[$id_source]['branch']); 266 } 267 // SERPRO 270 268 271 269 /*! … … 336 334 return null; 337 335 } 338 336 339 337 $count = ldap_count_entries($resource,$result_res); 340 338 if ( $count == 0 ) … … 353 351 } 354 352 } 355 353 356 354 $entries = ldap_get_entries($resource, $result_res); 357 355 358 356 for ($i = 0; $i < $entries['count']; $i++) 359 357 { 360 358 $subtree = $this->get_ldap_tree_recursive($resource, $entries[$i]['dn'], $objectClass); 361 359 362 360 $dn_parts=ldap_explode_dn($entries[$i]['dn'],1); 363 364 365 366 if ($subtree !== null and is_array($subtree)) 361 362 if ($subtree !== null and is_array($subtree)) 367 363 { 368 364 $tree[$i]['name'] = $dn_parts[0]; … … 381 377 'sub_branch' => false 382 378 ); 383 } 379 } 384 380 } 385 381 … … 393 389 } 394 390 } 395 391 396 392 function get_ldap_referrals($ds, $dn, $filter) { 397 393 398 394 ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); 399 395 ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3); 400 396 401 397 if ($ds) { 402 398 ldap_bind($ds); 403 $sr=ldap_list($ds,$dn, $filter); 399 $sr=ldap_list($ds,$dn, $filter); 404 400 $ref = ldap_first_reference($ds, $sr); 405 401 $array_referral = array(); 406 402 $idx = 0; 407 403 408 404 while ($ref) { 409 405 $array_referral[$idx++] = ldap_get_dn($ds, $ref); … … 412 408 return $array_referral; 413 409 } 414 else 410 else 415 411 return false; 416 412 } 417 413 418 414 function get_ldap_sub_branches_referrals($ds, $dn, $filter) { 419 415 420 416 $referral = $this -> get_ldap_referrals($ds, $dn, $filter); 421 417 $sub_branches = array(); 422 418 423 419 for($i = 0; $i <count($referral); $i++) { 424 420 $dn = str_replace("??base","",preg_replace('!^(ldap://[^/]+)/(.*$)!', '\\2', $referral[$i])); 425 $dn = explode(",",$dn); 421 $dn = explode(",",$dn); 426 422 $dn = strtoupper(str_replace("ou=", "",$dn[0])); 427 423 $dn = str_replace("DC=", "",$dn); 428 424 429 425 $sub_branch = array( 430 426 'name' => $dn, 431 427 'type' => 'unknown', 432 428 'value' => $referral[$i], 433 'sub_branch' => false 434 ); 435 $sub_branches[$i] = $sub_branch; 429 'sub_branch' => false 430 ); 431 $sub_branches[$i] = $sub_branch; 436 432 } 437 433 return $sub_branches; 438 434 } 435 439 436 440 437 function translate_accentuation($text) … … 464 461 //$filter = '(!(objectClass='.$objectClass.'))'; 465 462 // Don't show OU's whith phpgwAccountVisible equal to '-1' 466 467 463 if ($external) 468 464 { … … 483 479 if ($result_res === false) 484 480 { 485 if (ldap_errno($resource) === 3)486 {487 return array('error_msg' => ldap_error($resource));488 }489 481 return null; 490 482 } … … 591 583 $tree['ldap'] = array('id_source' => $id_source, 'context' => $context); 592 584 } 585 593 586 usort($tree['sub_branch'], array($this, "compareTreeNodes")); 594 587 return $tree; … … 596 589 597 590 function compareTreeNodes($a, $b) { 598 591 599 592 return strnatcasecmp($a['name'], $b['name']); 600 } 593 } 601 594 602 595 } -
trunk/contactcenter/inc/class.bo_people_catalog.inc.php
r284 r285 1417 1417 if ($altered) 1418 1418 { 1419 $contact->set_field("last_status", 'U'); 1420 $contact->set_field("last_update",time()."000"); 1419 1421 return $contact->commit(); 1420 1422 } -
trunk/contactcenter/inc/class.so_contact.inc.php
r284 r285 110 110 'is_global' => array( 111 111 'name' => 'is_global', 112 'type' => false, 113 'state' => 'empty', 114 'value' => false), 115 'last_status' => array( 116 'name' => 'last_status', 117 'type' => false, 118 'state' => 'empty', 119 'value' => false), 120 'last_update' => array( 121 'name' => 'last_update', 112 122 'type' => false, 113 123 'state' => 'empty', -
trunk/contactcenter/inc/class.so_group.inc.php
r284 r285 117 117 'A.id_contact = B.id_contact and B.id_connection = C.id_connection and '. 118 118 'C.connection_is_default = true and B.id_typeof_contact_connection = 1 and '. 119 'A.id_owner ='.$this->owner.' order by A.names_ordered ';119 'A.id_owner ='.$this->owner.' order by A.names_ordered,C.connection_value'; 120 120 121 121 -
trunk/contactcenter/inc/class.ui_api.inc.php
r284 r285 18 18 * 19 19 */ 20 20 21 21 class ui_api 22 22 { 23 23 var $commons; 24 24 var $commons_loaded = false; 25 25 26 26 function ui_api() 27 27 { 28 28 $preferences = ExecMethod('contactcenter.ui_preferences.get_preferences'); 29 29 30 30 if (!is_array($preferences)) 31 31 { … … 33 33 //$preferences['personCardPhone'] = 2; 34 34 } 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); 38 39 39 40 $template->set_file(array('api' => 'api_common.tpl')); 40 41 41 42 $template->set_var('cc_email_id_type', $preferences['personCardEmail']); 42 43 44 43 45 /* Messages */ 44 46 $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.')); 46 48 $template->set_var('cc_msg_err_timeout',lang('Operation Timed Out.')); 47 49 $template->set_var('cc_msg_err_serialize_data_unknown',lang('Data to be serialized is of unknown type!')); … … 75 77 $template->set_var('cc_js_djswin', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/js/dJSWin/dJSWin.js'); 76 78 $template->set_var('cc_js_catalog_tree', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_tree.js'); 77 79 78 80 $template->parse('out','api'); 79 81 … … 81 83 $this->commons_loaded = false; 82 84 } 83 85 84 86 /* DEPRECTED! Use get_email_win() instead */ 85 87 function ui_get_email_win() … … 91 93 { 92 94 //$search = $this->ui_get_search_win(); 93 95 94 96 $template_dir = PHPGW_SERVER_ROOT . '/contactcenter/templates/default/'; 95 97 $template = CreateObject('phpgwapi.Template', $template_dir); 96 98 97 99 $template->set_file(array('email_win' => 'email_win.tpl')); 98 100 99 101 if (!$this->commons_loaded) 100 102 { … … 106 108 $template->set_var('cc_api', ''); 107 109 } 108 110 109 111 //$template->set_var('cc_search_win', $search); 110 112 $template->set_var('cc_js_search', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search.js'); 111 113 112 114 $template->set_var('cc_email_id_type', $search); 113 115 114 116 $template->set_var('cc_email_win_title',lang('Contact Center').' - '.lang('Catalog Entries Emails')); 115 117 $template->set_var('cc_email_status',lang('Status').':'); 116 118 $template->set_var('cc_email_search_text',lang('Search').'...'); 117 119 118 120 $template->set_var('cc_choose_catalogue',lang('Choose a catalogue').'...'); 119 121 $template->set_var('cc_choose_ordinance',lang('Choose a ordinance').'...'); 120 122 121 123 $template->set_var('cc_btn_to_add',lang('To').' >>'); 122 124 $template->set_var('cc_btn_to_del','<< '.lang('To')); … … 130 132 $template->set_var('cc_btn_ok',lang('Ok')); 131 133 $template->set_var('cc_btn_cancel',lang('Cancel')); 132 134 133 135 $template->set_var('cc_label_to',lang('To').':'); 134 136 $template->set_var('cc_label_cc',lang('Cc').':'); … … 138 140 $template->set_var('cc_label_catalogue_type',lang('Type Of Catalogue').':'); 139 141 $template->set_var('cc_label_ordinance_type',lang('Type Of Ordinace').':'); 140 142 141 143 $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images'); 142 144 143 145 $template->set_var('cc_js_email_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_email_win.js'); 144 146 145 147 $template->parse('out','email_win'); 146 148 … … 159 161 160 162 $template->set_file(array('search' => 'search_win.tpl')); 161 163 162 164 if (!$this->commons_loaded) 163 165 { … … 169 171 $template->set_var('cc_api', ''); 170 172 } 171 173 172 174 $template->set_var('cc_search_title',lang('Contact Center - Search for Catalog Entries')); 173 175 $template->set_var('cc_search_minimize',lang('Minimize')); … … 178 180 $template->set_var('cc_search_go',lang('Go')); 179 181 $template->set_var('cc_search_cancel',lang('Cancel')); 180 182 181 183 $template->set_var('cc_js_search_win', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/cc_search_win.js'); 182 184 183 185 $template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images'); 184 186 185 187 $template->parse('out','search'); 186 188 … … 203 205 204 206 $template->set_file(array('full_add' => 'full_add.tpl')); 205 207 206 208 if (!$this->commons_loaded) 207 209 { … … 213 215 $template->set_var('cc_api', ''); 214 216 } 215 217 216 218 $template->set_var('cc_contact_title',lang('Contact Center').' - '.lang('Contacts')); 217 219 … … 221 223 $template->set_var('cc_msg_type_city',lang('Type new city here').'...'); 222 224 /* End Messages */ 223 225 224 226 /* Contact */ 225 227 $template->set_var('cc_contact_save',lang('Save')); … … 230 232 $template->set_var('cc_contact_addrs',lang('Addresses')); 231 233 $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 232 237 /* End Contact */ 233 238 234 239 /* Contact - Personal Data */ 235 240 $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; 236 241 237 242 $j = 0; 238 243 for ($i = 0; $i < 5; $i+=2) … … 257 262 $j++; 258 263 } 259 264 260 265 $template->set_var('cc_pd_birth_size_0', "{$date[0]['size']}"); 261 266 $template->set_var('cc_pd_birth_size_1', "{$date[1]['size']}"); 262 267 $template->set_var('cc_pd_birth_size_2', "{$date[2]['size']}"); 263 268 264 269 $template->set_var('cc_pd_birthdate_0', "{$date[0]['name']}"); 265 270 $template->set_var('cc_pd_birthdate_1', "{$date[1]['name']}"); … … 268 273 $template->set_var('cc_pd_select_photo_b', lang('Browse').'...'); 269 274 $template->set_var('cc_form_photo_src', 'photo_form.html'); 270 275 271 276 $template->set_var('cc_pd_select_photo',lang('Select Photo')); 272 277 $template->set_var('cc_pd_alias',lang('Alias')); … … 286 291 $template->set_var('cc_pd_female',lang('Female')); 287 292 /* End Contact - Personal Data */ 288 293 289 294 /* Contact - Addresses */ 290 295 $template->set_var('cc_addr_types',lang('Type of Address')); … … 310 315 $template->set_var('cc_available',lang('Available')); 311 316 /* End Contact - Addresses */ 312 317 318 313 319 /* Contact - Connections */ 314 320 $template->set_var('cc_conn_type',lang('Type of Connection')); 315 321 $template->set_var('cc_conn_name',lang('Connection Name')); 316 322 $template->set_var('cc_conn_value',lang('Connection Value')); 317 323 318 324 $template->set_var('cc_new_same_type',lang('New from the same Type').'...'); 319 325 320 326 $template->set_var('cc_conn_type_none',lang('Choose Type of Connection').'...'); 321 327 /* End Contact - Connections */ 322 328 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 323 333 $template->parse('out_full', 'full_add'); 324 334 … … 332 342 333 343 $template->set_file(array('quickAdd' => 'quickAddPlugin.tpl')); 334 344 335 345 if (!$this->commons_loaded) 336 346 { … … 342 352 $template->set_var('cc_api', ''); 343 353 } 344 354 345 355 $template->set_var('ccQAPluginFile', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/contactcenter/js/ccQuickAdd-plugin.js'); 346 356 … … 350 360 $nFields = 5; 351 361 $fields = array( 352 lang('Alias'), 353 lang('Given Names'), 354 lang('Family Names'), 362 lang('Alias'), 363 lang('Given Names'), 364 lang('Family Names'), 355 365 lang('Phone'), 356 366 lang('Email') 357 367 ); 358 368 359 369 $template->set_var('ccQAnFields', $nFields); 360 370 361 371 $fieldsHTML = ''; 362 372 $fieldsTop = 10; … … 379 389 $template->set_var('ccQAWinHeight', ($i+1)*$fieldsSpace+$fieldsTop); 380 390 $template->set_var('ccQAFunctionsTop', ($fieldsTop+$i*$fieldsSpace).'px'); 381 391 382 392 /* Images Dir */ 383 393 $template->set_var('ccQACardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/'); 384 394 385 395 /* Texts */ 386 396 $template->set_var('ccQATitle', lang('Contact Center').' - '.lang('Quick Add')); … … 388 398 $template->set_var('ccQAClear', lang('Reset')); 389 399 $template->set_var('ccQACancel', lang('Cancel')); 390 400 391 401 $template->parse('out_QA', 'quickAdd'); 392 402 393 403 return $template->get_var('out_QA'); 394 404 } 395 405 396 406 function get_add_group() 397 407 { … … 400 410 401 411 $template->set_file(array('addGroup' => 'addGroup.tpl')); 402 412 403 413 if (!$this->commons_loaded) 404 414 { … … 408 418 else 409 419 { 410 420 411 421 $template->set_var('cc_api', ''); 412 422 } 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'); 416 426 $template->set_var('ccAGWinHeightMO', '335'); 417 427 418 428 /* Images Dir */ 419 429 $template->set_var('ccAGCardImgRoot', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/'); 420 430 421 431 /* Texts */ 422 432 $template->set_var('ccAGTitle', lang('Contact Center').' - '.lang('Group Add')); … … 424 434 $template->set_var('ccAGClear', lang('Reset')); 425 435 $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); 429 439 // set content and label variables. 430 440 $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'), 433 443 'txt_cancel'=> lang('cancel'), 434 'txt_add'=> lang('Add'), 444 'txt_add'=> lang('Add'), 435 445 'txt_rem'=> lang('Remove'), 436 446 'txt_personal_contacts' => lang('Personal Contacts'), 437 447 'txt_contacts_in_list' => lang("Participants"), 438 448 'txt_name' => lang('Full Name'))); 439 449 440 450 $template->parse('out_AG', 'addGroup'); 441 451 442 452 return $template->get_var('out_AG'); 443 453 } -
trunk/contactcenter/inc/class.ui_data.inc.php
r284 r285 14 14 \***************************************************************************/ 15 15 16 16 17 17 class ui_data 18 18 { … … 20 20 'data_manager' => true, 21 21 ); 22 22 23 23 var $bo; 24 24 var $typeContact; 25 25 26 26 var $page_info = array( 27 27 'n_cards' => 20, … … 34 34 'actual_catalog' => false 35 35 ); 36 36 37 37 /*! 38 38 39 39 @function ui_data 40 40 @abstract The constructor. Sets the initial parameters and loads 41 41 the data saved in the session 42 42 @author Raphael Derosso Pereira 43 43 44 44 */ 45 45 function ui_data() … … 47 47 $temp = $GLOBALS['phpgw']->session->appsession('ui_data.page_info','contactcenter'); 48 48 $temp2 = $GLOBALS['phpgw']->session->appsession('ui_data.all_entries','contactcenter'); 49 50 //TODO: Achar um modo de descarregar este array da sessï¿œo quando o usuï¿œrio sair da tela do contactcenter. 51 //TODO: Descarregar este array da memï¿œria toda vez que uma nova consulta por letras ou mudanï¿œa de catï¿œlogo for feita. 52 $temp3 = $GLOBALS['phpgw']->session->appsession('ui_data.last_search_ids','contactcenter'); 53 49 54 50 $this->bo = CreateObject('contactcenter.bo_contactcenter'); 55 51 56 52 if ($temp) 57 53 { … … 63 59 $this->all_entries = $temp2; 64 60 } 65 66 if ($temp3) 67 { 68 $this->last_search_ids = $temp3; 69 } 70 61 71 62 if (!$this->page_info['actual_catalog']) 72 63 { … … 74 65 $this->page_info['actual_catalog'] = $catalogs[0]; 75 66 } 76 77 $this->page_info['actual_catalog'] =& $this->bo->set_catalog($this->page_info['actual_catalog']); 78 67 68 $this->page_info['actual_catalog'] =& $this->bo->set_catalog($this->page_info['actual_catalog']); 69 79 70 if($this->page_info['actual_catalog']['class'] == 'bo_group_manager') 80 71 $this -> typeContact = 'groups'; … … 84 75 85 76 /*! 86 77 87 78 @function index 88 79 @abstract Builds the Main Page 89 80 @author Raphael Derosso Pereira 90 81 @author Jonas Goes 91 92 */ 82 83 */ 93 84 function index() 94 { 85 { 95 86 if(!@is_object($GLOBALS['phpgw']->js)) 96 87 { … … 101 92 $GLOBALS['phpgw']->js->validate_file('venus','jsStructUtil'); 102 93 $GLOBALS['phpgw']->js->validate_file('venus','cssUtil'); 103 94 104 95 // $GLOBALS['phpgw']->js->set_onload('setTimeout(\'updateCards()\',1000)'); 105 96 $GLOBALS['phpgw']->common->phpgw_header(); 106 97 107 98 $GLOBALS['phpgw']->template->set_file(array('index' => 'index.tpl')); 108 99 $GLOBALS['phpgw']->template->set_var('cc_root_dir', $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/'); 109 100 110 101 /* Quick Add */ 111 102 $GLOBALS['phpgw']->template->set_var('cc_qa_alias',lang('Alias').':'); … … 116 107 $GLOBALS['phpgw']->template->set_var('cc_qa_save',lang('Save')); 117 108 $GLOBALS['phpgw']->template->set_var('cc_qa_clear',lang('Clear')); 109 $GLOBALS['phpgw']->template->set_var('cc_qa_close',lang('Close')); 118 110 /* End Quick Add */ 119 111 120 112 $cc_css_file = $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/styles/cc.css'; 121 113 $cc_card_image_file = $GLOBALS['phpgw_info']['server']['webserver_url'].'/contactcenter/templates/default/images/card.png'; … … 123 115 $GLOBALS['phpgw']->template->set_var('cc_dtree_css', $cc_dtree_file); 124 116 $GLOBALS['phpgw']->template->set_var('cc_card_image',$cc_card_image_file); 125 117 126 118 $GLOBALS['phpgw']->template->set_var('cc_personal',lang('Personal')); 127 119 128 120 $GLOBALS['phpgw']->template->set_var('cc_full_add',lang('Full Add')); 129 121 $GLOBALS['phpgw']->template->set_var('cc_reset',lang('Reset')); 130 122 131 123 $GLOBALS['phpgw']->template->set_var('cc_personal_data',lang('Personal Data')); 132 124 $GLOBALS['phpgw']->template->set_var('cc_addresses',lang('Addresses')); … … 137 129 $GLOBALS['phpgw']->template->set_var('cc_catalogs',lang('Catalogues')); 138 130 $GLOBALS['phpgw']->template->set_var('cc_group_add',lang('Group Add')); 139 131 140 132 /* Panel */ 141 133 $GLOBALS['phpgw']->template->set_var('cc_panel_new',lang('New').'...'); … … 143 135 $GLOBALS['phpgw']->template->set_var('cc_panel_table',lang('Table View')); 144 136 $GLOBALS['phpgw']->template->set_var('cc_panel_cards',lang('Cards View')); 145 137 $GLOBALS['phpgw']->template->set_var('cc_btn_import_export', lang('Import/Export')); 138 $GLOBALS['phpgw']->template->set_var('cc_btn_new', lang("New...")); 139 146 140 $GLOBALS['phpgw']->template->set_var('cc_panel_search_found',lang('Showing found entries')); 147 141 $GLOBALS['phpgw']->template->set_var('cc_panel_first_page',lang('First Page')); … … 151 145 $GLOBALS['phpgw']->template->set_var('cc_all',lang('all')); 152 146 /* End Panel */ 153 147 154 148 /* Messages */ 155 149 $GLOBALS['phpgw']->template->set_var('cc_msg_no_cards',lang('No Cards')); … … 166 160 $GLOBALS['phpgw']->template->set_var('cc_empty',lang('Empty')); 167 161 /* End Messages */ 168 162 169 163 $GLOBALS['phpgw']->template->set_var('cc_results',lang('Results')); 170 164 $GLOBALS['phpgw']->template->set_var('cc_is_my',lang('Is My')); 165 $GLOBALS['phpgw']->template->set_var('cc_ie_personal',lang('Import/Export pesonal contacts')); 171 166 $GLOBALS['phpgw']->template->set_var('cc_btn_search',lang('Search')); 172 167 $GLOBALS['phpgw']->template->set_var('cc_add_relation',lang('Add Relation')); 173 $GLOBALS['phpgw']->template->set_var('cc_del_relation',lang('Remove Selected Relations')); 168 $GLOBALS['phpgw']->template->set_var('cc_del_relation',lang('Remove Selected Relations')); 174 169 $GLOBALS['phpgw']->template->set_var('cc_msg_group',lang('Group')); 175 170 $GLOBALS['phpgw']->template->set_var('cc_msg_contact_full',lang('Contact [Full]')); … … 179 174 $GLOBALS['phpgw']->template->set_var('phpgw_img_dir', $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/images'); 180 175 176 $GLOBALS['phpgw']->template->set_var('cc_msg_import_contacts', lang('Import Contacts')); 177 $GLOBALS['phpgw']->template->set_var('cc_msg_export_contacts', lang('Export Contacts')); 178 $GLOBALS['phpgw']->template->set_var('cc_msg_expresso_info_csv', lang('The Expresso supports the contacts importation in the CSV file format.')); 179 $GLOBALS['phpgw']->template->set_var('cc_msg_choose_file_type', lang('Select the file type')); 180 $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_express', lang('Outlook Express')); 181 $GLOBALS['phpgw']->template->set_var('cc_msg_outlook2k', lang('Outlook 2000')); 182 $GLOBALS['phpgw']->template->set_var('cc_msg_expresso_default', lang('Expresso (default)')); 183 $GLOBALS['phpgw']->template->set_var('cc_msg_choose_contacts_file', lang('Select the file that contains the contacts to be imported:')); 184 $GLOBALS['phpgw']->template->set_var('cc_msg_close_win', lang('Close')); 185 $GLOBALS['phpgw']->template->set_var('cc_msg_close', lang('Close')); 186 $GLOBALS['phpgw']->template->set_var('cc_msg_ie_personal', lang('Import / Export personal Contacts')); 187 $GLOBALS['phpgw']->template->set_var('cc_msg_import_fail', lang('The importation has failed. Verify the file format.')); 188 $GLOBALS['phpgw']->template->set_var('cc_msg_importing_contacts', lang('Importing Contacts...')); 189 $GLOBALS['phpgw']->template->set_var('cc_msg_import_finished', lang('The importation has finished.')); 190 $GLOBALS['phpgw']->template->set_var('cc_msg_new', lang(' new')); 191 $GLOBALS['phpgw']->template->set_var('cc_msg_failure', lang(' failed')); 192 $GLOBALS['phpgw']->template->set_var('cc_msg_exists', lang(' were existent')); 193 $GLOBALS['phpgw']->template->set_var('cc_msg_show_more_info', lang('show more info')); 194 $GLOBALS['phpgw']->template->set_var('cc_msg_clean', lang('Clean')); 195 $GLOBALS['phpgw']->template->set_var('cc_msg_invalid_csv', lang('Select a valid CSV file to import your contacts')); 196 $GLOBALS['phpgw']->template->set_var('cc_msg_export_csv', lang('Select the format type that you want to export your contacts')); 197 $GLOBALS['phpgw']->template->set_var('cc_msg_automatic', lang('Automatic')); 198 $GLOBALS['phpgw']->template->set_var('cc_msg_export_error', lang('An error has occurred while the exportation.')); 199 $GLOBALS['phpgw']->template->set_var('cc_msg_new_email', lang('New Email')); 200 $GLOBALS['phpgw']->template->set_var('cc_msg_main', lang('Main')); 201 $GLOBALS['phpgw']->template->set_var('cc_msg_alternative', lang('Alternative')); 202 $GLOBALS['phpgw']->template->set_var('cc_msg_select_email', lang('Select E-Mail')); 203 $GLOBALS['phpgw']->template->set_var('cc_msg_new_phone', lang('New Telephone')); 204 $GLOBALS['phpgw']->template->set_var('cc_msg_home', lang('Home')); 205 $GLOBALS['phpgw']->template->set_var('cc_msg_cellphone', lang('Cellphone')); 206 $GLOBALS['phpgw']->template->set_var('cc_msg_work', lang('Work')); 207 $GLOBALS['phpgw']->template->set_var('cc_msg_fax', lang('Fax')); 208 $GLOBALS['phpgw']->template->set_var('cc_msg_pager', lang('Pager')); 209 $GLOBALS['phpgw']->template->set_var('cc_msg_choose_phone', lang('Select the telephone')); 210 $GLOBALS['phpgw']->template->set_var('cc_msg_warn_firefox', lang('Warning: Too old version of Firefox')); 211 $GLOBALS['phpgw']->template->set_var('cc_msg_firefox_half1', lang('For this application work correctly</u>')); 212 $GLOBALS['phpgw']->template->set_var('cc_msg_firefox_half2', lang('it\'s necessary to update your Firefox Browser for a new version (version > 1.5) Install now clicking in the link bellow, or if you want to update it later')); 213 $GLOBALS['phpgw']->template->set_var('cc_msg_click_close', lang('click Close')); 214 $GLOBALS['phpgw']->template->set_var('cc_msg_install_now', lang('Install Now')); 215 $GLOBALS['phpgw']->template->set_var('cc_msg_install_new_firefox', lang('Install a new Firefox version')); 216 $GLOBALS['phpgw']->template->set_var('cc_msg_moz_thunderbird', lang('Export as Mozilla Thunderbird CSV.')); 217 $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_express_pt', lang('Export as Outlook Express (Portuguese) CSV.')); 218 $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_express_en', lang('Export as Outlook Express (English) CSV.')); 219 $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_2k_pt', lang('Export as Outlook 2000 (Portuguese) CSV.')); 220 $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_2k_en', lang('Export as Outlook 2000 (English) CSV.')); 221 $GLOBALS['phpgw']->template->set_var('cc_msg_expresso_default_csv', lang('Export as Expresso (Default) CSV.')); 222 $GLOBALS['phpgw']->template->set_var('cc_msg_copy_to_catalog', lang('Copy to personal catalog.')); 223 $GLOBALS['phpgw']->template->set_var('cc_msg_add_contact_to_group', lang('You did not add any contact for this group.')); 224 $GLOBALS['phpgw']->template->set_var('cc_msg_fill_field_name', lang('Fill the field Full Name')); 225 181 226 $GLOBALS['phpgw']->template->parse('out','index'); 182 227 183 228 $api = CreateObject('contactcenter.ui_api'); 184 229 $main = $api->get_full_add(); … … 191 236 } 192 237 193 238 194 239 /*! 195 240 196 241 @function data_manager 197 @abstract Calls the right method and passes to it the right 242 @abstract Calls the right method and passes to it the right 198 243 parameters 199 244 @author Raphael Derosso Pereira 200 245 201 246 */ 202 247 function data_manager() … … 207 252 case 'set_n_cards': 208 253 return $this->set_n_cards((int)$_GET['ncards']); 209 210 case 'get_cards_data': 211 254 255 case 'get_cards_data': 212 256 $ids = false; 213 257 // To support ldap catalogs using accentuation 214 258 if ($_POST['letter'] == 'search' && isset($_POST['data'])) 215 259 { 216 //$ids = utf8_decode($this->search($_POST['data'])); 217 $ids = $this->search($_POST['data']); 260 $ids = utf8_decode($this->search($_POST['data'])); 218 261 } 219 220 //return $this->get_cards_data($_POST['letter'], $_POST['page'], unserialize(str_replace('\\"','"',$ids)));221 return $this->get_cards_data($_POST['letter'], $_POST['page'], $ids);222 //return $this->get_cards_data($_POST['letter'], $_POST['page'], unserialize(str_replace('\\"','"',$_POST['ids'])));223 262 263 if(isset($_SESSION['ids'])) 264 $ids = $_SESSION['ids']; 265 266 return $this->get_cards_data($_POST['letter'], $_POST['page'], $ids); 224 267 case 'get_cards_data_get': 225 268 return $this->get_cards_data($_GET['letter'], $_GET['page'], unserialize(str_replace('\\"','"',$_GET['ids']))); … … 229 272 return $this->get_photo($_GET['id']); 230 273 231 274 case 'get_visible_all_ldap': 275 echo $this->get_visible_all_ldap(); 276 return; 277 232 278 /* Catalog Methods */ 233 279 case 'set_catalog': 234 280 return $this->set_catalog($_GET['catalog']); 235 281 236 282 case 'get_catalog_tree': 237 283 echo serialize($this->get_catalog_tree($_GET['level'])); … … 250 296 echo serialize($this->get_catalog_add_contact(utf8_decode($_POST['id']))); 251 297 return; 252 298 253 299 /* Full Add Methods */ 254 300 case 'get_full_data': 255 301 return $this->get_full_data($_GET['id']); 256 302 257 303 case 'get_group': 258 304 return $this->get_group_data($_GET['id']); 259 305 260 306 case 'get_contact_full_add_const': 261 307 return $this->get_contact_full_add_const(); … … 269 315 case 'get_states': 270 316 return $this->get_states($_GET['country']); 271 317 272 318 case 'get_cities': 273 319 return $this->get_cities($_GET['country'], $_GET['state'] ? $_GET['state'] : null); 274 275 320 321 276 322 /* Other Methods */ 277 case 'quick_add': 323 case 'quick_add': 278 324 return $this->quick_add($_POST['add']); 279 280 case 'add_group': 325 326 case 'add_group': 281 327 return $this->add_group($_POST['add']); 282 328 283 329 case 'remove_entry': 284 330 return $this->remove_entry((int)$_GET['remove']); 285 331 286 332 case 'remove_all_entries': 287 333 return $this->remove_all_entries(); 288 334 289 335 case 'remove_group': 290 291 return $this->remove_group((int)$_GET['remove']); 336 337 return $this->remove_group((int)$_GET['remove']); 292 338 293 339 case 'search': 294 return $this->search(str_replace('\\"', '"', $_GET['data'])); 340 $ids = false; 341 $ids = $this->search($_GET['data']); 342 return $this->get_cards_data('search', '1', $ids); 295 343 296 344 case 'email_win': … … 326 374 327 375 /*! 328 376 329 377 @function set_n_cards 330 378 @abstract Informs the class the number of cards the page can show 331 379 @author Raphael Derosso Pereira 332 380 333 381 @param integer $n_cards The number of cards 334 382 335 383 */ 336 384 function set_n_cards($n_cards) … … 341 389 echo 1; 342 390 } 343 391 344 392 $this->save_session(); 345 393 } 346 394 347 395 /*! 348 396 349 397 @function set_catalog 350 398 @abstract Sets the current catalog selected by the user 351 399 @author Raphael Derosso Pereira 352 400 353 401 @param string $id_catalog The sequence of IDs to reach the catalog 354 402 separated by commas 355 403 356 404 */ 357 405 function set_catalog($id_catalog) … … 359 407 $id_catalog = str_replace('\\"', '"', $id_catalog); 360 408 $temp =& $this->bo->set_catalog($id_catalog); 361 409 362 410 if ($temp) 363 411 { … … 366 414 $this->page_info['actual_catalog'] =& $temp; 367 415 $this->save_session(); 368 416 369 417 $catalog_info = $this->bo->get_branch_by_level($this->bo->catalog_level[0]); 370 418 371 419 if ($catalog_info['class'] === 'bo_global_ldap_catalog' || 372 420 $catalog_info['class'] === 'bo_catalog_group_catalog') … … 378 426 $perms = 15; 379 427 } 380 428 381 429 echo serialize(array( 382 430 'status' => 'ok', … … 386 434 return; 387 435 } 388 436 389 437 echo serialize(array( 390 438 'status' => 'ok', … … 392 440 )); 393 441 } 394 395 442 443 396 444 /*! 397 445 398 446 @function get_catalog_tree 399 447 @abstract Returns the JS serialized array to used as the tree 400 448 level 401 449 @author Raphael Derosso Pereira 402 @author Mï¿œrio Cï¿œsar Kolling (error messages and timeout)403 404 @param (string) $level The level to be taken 405 450 @author Mário César Kolling (error messages and timeout) 451 452 @param (string) $level The level to be taken 453 406 454 */ 407 455 function get_catalog_tree($level) … … 412 460 413 461 $parent = '0'; 414 462 415 463 if (!($tree = $this->bo->get_catalog_tree($level))) 416 464 { … … 426 474 $parent = substr($level, 0, $last_dot); 427 475 $child = substr($level, $last_dot+1, strlen($level)); 428 476 429 477 if (!($tree[$child] = $this->bo->get_catalog_tree($level))) 430 478 { … … 445 493 } 446 494 } 447 495 448 496 $folderImageDir = $GLOBALS['phpgw']->common->image('contactcenter','globalcatalog-mini.png'); 449 497 $folderImageDir = substr($folderImageDir, 0, strpos($folderImageDir, 'globalcatalog-mini.png')); 450 498 451 499 // Deals with error messages from the server and returns them to the browser 452 500 if ($tree['msg']) … … 474 522 'status' => 'error' 475 523 ); 476 477 524 } 478 525 } 479 480 /* function get_catalog_tree($level, $name = 'tree') 481 { 482 if ($level === '0') 483 { 484 $folderImageDir = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/phpgwapi/dftree/images/'; 485 $tree_js = $name." = new dFTree({'name': '".$name."'});\n"; 486 487 $parent = '0'; 488 $child = '0'; 489 490 if (!($tree = $this->bo->get_catalog_tree($level))) 491 { 492 return '0'; 493 } 494 } 495 else 496 { 497 $last_dot = strrpos($level,'.'); 498 $parent = substr($level, 0, $last_dot); 499 $child = substr($level, $last_dot+1, strlen($level)); 500 501 $tree_js = ''; 502 503 if (!($tree[$child] = $this->bo->get_catalog_tree($level))) 504 { 505 return '0'; 506 } 507 } 508 509 $folderImageDir = $GLOBALS['phpgw']->common->image('contactcenter','globalcatalog-mini.png'); 510 $folderImageDir = substr($folderImageDir, 0, strpos($folderImageDir, 'globalcatalog-mini.png')); 511 512 $tree_js .= $this->convert_tree($tree, $name, $folderImageDir, $parent); 513 514 return $tree_js; 515 } 516 */ 517 526 518 527 /*! 519 528 520 529 @function get_actual_catalog 521 530 @abstract Returns the actual selected Catalog … … 524 533 */ 525 534 function get_actual_catalog() 526 { 535 { 527 536 $level = $this->bo->get_level_by_branch($this->bo->get_actual_catalog(), $this->bo->tree['branches'], '0'); 528 537 529 538 if ($level) 530 539 { … … 540 549 ); 541 550 } 542 551 543 552 /*! 544 553 545 554 @function get_cards_data 546 555 @abstract Returns the information that is placed on the cards 547 556 @author Raphael Derosso Pereira 548 557 549 558 @param string $letter The first letter to be searched 550 @param (int) $page The page to be taken 559 @param (int) $page The page to be taken 551 560 @param (str) $ids The ids to be taken in case of search 552 561 … … 556 565 function get_cards_data($letter, $page, $ids) 557 566 { 567 if( $ids ) 568 $_SESSION['ids'] = $ids; 558 569 559 570 // It's an external catalog? 560 571 $external = $this->bo->is_external($this->page_info['actual_catalog']); 561 562 572 //echo $page."\n"; 563 573 if ($letter !== 'search' and ($letter != $this->page_info['actual_letter'] or 564 ($letter == $this->page_info['actual_letter'] and $page == $this->page_info['actual_page']) or 574 ($letter == $this->page_info['actual_letter'] and $page == $this->page_info['actual_page']) or 565 575 $this->page_info['changed'])) 566 576 { 567 577 unset($ids); 568 578 $this->page_info['changed'] = false; 569 579 570 580 switch ($this->page_info['actual_catalog']['class']) 571 581 { … … 654 664 ); 655 665 } 656 666 657 667 $find_field[0] = array('contact.id_contact','contact.names_ordered'); 658 668 659 669 $find_other[0] = array( 660 670 //'offset' => (($page-1)*$this->page_info['n_cards']), … … 662 672 'order' => 'contact.names_ordered' 663 673 ); 664 674 665 675 break; 666 667 //case 'bo_external_ldap_catalog': 668 669 // break; 670 676 671 677 case 'bo_global_ldap_catalog': 678 672 679 $field_name = 'id_contact'; 673 680 … … 718 725 'value' => 'u' 719 726 ), 720 /*1 => array( 721 'field' => 'contact.account_type', 722 'type' => '=', 723 'value' => 'g' 724 ),*/ 725 2 => array( 727 1 => array( 726 728 'field' => 'contact.account_type', 727 729 'type' => '=', … … 834 836 'value' => 'g' 835 837 ),*/ 836 2=> array(838 1 => array( 837 839 'field' => 'contact.account_type', 838 840 'type' => '=', … … 842 844 ); 843 845 } 844 845 846 } 846 847 … … 858 859 $find_field[0] = array('contact.id_contact','contact.names_ordered'); 859 860 } 860 861 861 862 $find_other[0] = array( 862 863 //'offset' => (($page-1)*$this->page_info['n_cards']), … … 864 865 'order' => 'contact.names_ordered' 865 866 ); 866 867 867 868 break; 868 869 869 870 case 'bo_company_manager': 870 871 $field_name = 'id_company'; 871 872 872 873 $find_field[0] = array('company.id_company','company.company_name'); 873 874 874 875 $find_other[0] = array( 875 876 //'offset' => (($page-1)*$this->page_info['n_cards']), … … 877 878 'order' => 'company.company_name' 878 879 ); 879 880 880 881 $find_restric[0] = array( 881 882 0 => array( … … 885 886 ) 886 887 ); 887 888 888 889 break; 889 890 890 891 case 'bo_group_manager': 891 892 892 893 $field_name = 'id_group'; 893 894 894 895 if ($letter !== 'number') { 895 896 896 897 $find_restric[0] = array( 897 898 0 => array( … … 903 904 } 904 905 else { 905 906 906 907 $find_restric[0] = array( 907 908 0 => array( 908 909 'field' => 'group.title', 909 910 'type' => 'LIKE', 910 'value' => '0%' 911 'value' => '0%' 911 912 ) 912 ); 913 ); 913 914 } 914 915 915 916 array_push($find_restric[0], array( 916 917 'field' => 'group.owner', 917 918 'type' => '=', 918 'value' => $GLOBALS['phpgw_info']['user']['account_id'] 919 'value' => $GLOBALS['phpgw_info']['user']['account_id'] 919 920 ) 920 921 ); 921 922 $find_field[0] = array('group.id_group','group.title','group.short_name'); 922 923 $find_field[0] = array('group.id_group','group.title','group.short_name'); 923 924 $find_other[0] = array( 924 925 'order' => 'group.title' 925 926 ); 926 927 927 928 break; 928 929 929 930 case 'bo_catalog_group_catalog': 930 931 $this->page_info['actual_entries'] = false; 931 932 932 933 $this->page_info['actual_letter'] = $letter; 933 934 $this->page_info['actual_page'] = 0; 934 935 935 936 $this->save_session(); 936 937 $final[0] = 0; 937 $final[1] = $this ->typeContact;938 echo serialize($final); 938 $final[1] = $this->typeContact; 939 echo serialize($final); 939 940 return; 940 941 941 942 } 942 943 943 944 $result = $this->bo->find($find_field[0],$find_restric[0],$find_other[0]); 944 945 $n_entries = count($result); 945 946 946 947 if ($n_entries) 947 948 { … … 957 958 { 958 959 $this->page_info['actual_entries'] = false; 959 960 960 961 $this->page_info['actual_letter'] = $letter; 961 962 $this->page_info['actual_page'] = 0; 962 963 $this->save_session(); 963 964 $this->save_session(); 964 965 $final[0] = 0; 965 $final[1] = $this ->typeContact;966 echo serialize($final); 966 $final[1] = $this->typeContact; 967 echo serialize($final); 967 968 return; 968 969 } … … 973 974 { 974 975 $this->page_info['actual_entries'][] = $value[$field_name]; 975 } 976 }977 }978 //************************************************************************* 976 } 977 //print_r($this->page_info['actual_entries']); 978 } 979 } 979 980 else if ($letter === 'search') 980 981 { 981 982 //if (!$ids and $this->page_info['actual_letter'] !== 'search') 982 if (!$ids && !$this->last_search_ids)983 if (!$ids) 983 984 { 984 985 error_log('!$ids e $this->page_info[\'actual_letter\'] != search'); 985 986 $this->page_info['actual_entries'] = false; 986 987 987 988 $this->page_info['actual_letter'] = $letter; 988 989 $this->page_info['actual_page'] = 0; 989 990 990 991 $this->save_session(); 991 992 $final[0] = 0; 992 993 $final[1] = $this -> typeContact; 993 echo serialize($final); 994 echo serialize($final); 994 995 return; 995 996 } … … 1007 1008 return; 1008 1009 } 1009 else if ($ids || $this->last_search_ids) 1010 { 1011 1012 if ($ids) 1013 { 1014 1015 $this->last_search_ids = $ids; 1016 1017 } 1018 else { 1019 1020 $ids = $this->last_search_ids; 1021 1022 } 1023 1010 else if ($ids) 1011 { 1024 1012 $this->page_info['actual_letter'] = $letter; 1025 1013 $this->page_info['actual_entries'] = $ids; … … 1038 1026 $page = $this->page_info['n_pages']; 1039 1027 } 1040 1028 1041 1029 $final = array( 1042 1030 0 => (int)$this->page_info['n_pages'], … … 1050 1038 5 => 'cc_alias', 1051 1039 6 => 'cc_id', 1052 7 => 'cc_forwarding_address', 1053 8 => 'cc_empNumber', 1054 9 => 'cc_department' 1040 7 => 'cc_forwarding_address' 1055 1041 ) 1056 1042 ); 1057 1043 1058 1044 //echo 'Page: '.$page.'<br>'; 1059 1045 $id_i = (($page-1)*$this->page_info['n_cards']); 1060 1046 $id_f = $id_i + $this->page_info['n_cards']; 1061 1047 $n_entries = count($this->page_info['actual_entries']); 1062 1048 1063 1049 //echo 'ID_I: '.$id_i.'<br>'; 1064 1050 //echo 'ID_F: '.$id_f.'<br>'; 1065 ///---------------- Corre ᅵᅵo Temporï¿œria PHP5 -----------------------///1051 ///---------------- Correção Temporária PHP5 -----------------------/// 1066 1052 $ids = array(); 1067 $array_temp = array(); 1068 1053 $array_temp = array(); 1054 1069 1055 foreach($this->page_info['actual_entries'] as $key=>$tmp){ 1070 $array_temp[] = $tmp; 1071 } 1072 1056 $array_temp[] = $tmp; 1057 } 1058 1073 1059 for($i = $id_i; $i < $id_f and $i < $n_entries; $i++) 1074 1060 { 1075 1061 $ids[] = $array_temp[$i]; 1076 1062 } 1077 1063 1078 1064 /// Original 1079 1065 //for($i = $id_i; $i < $id_f and $i < $n_entries; $i++) … … 1082 1068 //} 1083 1069 /// 1084 1070 1085 1071 $fields = $this->bo->catalog->get_fields(false); 1086 1072 1087 if( $this ->typeContact == 'groups') {1073 if( $this->typeContact == 'groups') { 1088 1074 $final = array( 1089 1075 0 => (int)$this->page_info['n_pages'], … … 1094 1080 2 => 'cc_id', 1095 1081 3 => 'cc_contacts' 1096 ) 1097 ); 1098 1082 ) 1083 ); 1084 1099 1085 $groups =& $this->bo->catalog->get_multiple_entries($ids,$fields); 1100 1086 1101 1087 $i = 0; 1102 1088 // contatos do grupo 1103 $boGroups = CreateObject('contactcenter.bo_group'); 1089 $boGroups = CreateObject('contactcenter.bo_group'); 1104 1090 $contacts = array(); 1105 1091 foreach($groups as $group) { 1106 1092 1107 1093 $final[3][$i][0] = $group['title'] ? $group['title'] : 'none'; 1108 $final[3][$i][1] = $group['short_name'] ? $group['short_name'] : 'none'; 1094 $final[3][$i][1] = $group['short_name'] ? $group['short_name'] : 'none'; 1109 1095 $final[3][$i][2] = $group['id_group'] ? $group['id_group'] : 'none'; 1110 1096 $contacts = $boGroups -> get_contacts_by_group($group['id_group']); 1111 1097 $final[3][$i][3] = $contacts; 1112 $i++; 1098 $i++; 1113 1099 } 1114 1100 1115 1101 $this->page_info['actual_letter'] = $letter; 1116 $this->page_info['actual_page'] = $page; 1117 1118 1102 $this->page_info['actual_page'] = $page; 1103 1104 1119 1105 $lnk_compose = "location.href=('../expressoMail1_2/index.php?to="; 1120 1106 1121 1107 $final[5] = '<span class="link" onclick="'.$lnk_compose; 1122 $final[10] = 'groups'; 1123 $this->save_session(); 1108 $final[10] = 'groups'; 1109 $this->save_session(); 1124 1110 echo serialize($final); 1125 return; 1126 } 1127 1111 return; 1112 } 1113 1128 1114 $fields['photo'] = true; 1129 1115 $fields['names_ordered'] = true; … … 1132 1118 $fields['companies'] = 'default'; 1133 1119 $fields['connections'] = 'default'; 1134 1135 // ?aqui alterar a chamada desse mï¿œtodo para receber o base dn?1136 $contacts =& $this->bo->catalog->get_multiple_entries($ids,$fields);1137 1120 // ?aqui alterar a chamada desse método para receber o base dn? 1121 $contacts = &$this->bo->catalog->get_multiple_entries($ids,$fields); 1122 1123 1138 1124 if (!is_array($contacts) or !count($contacts)) 1139 1125 { … … 1143 1129 return; 1144 1130 } 1145 1131 1146 1132 $i = 0; 1147 1133 foreach($contacts as $index => $contact) 1148 1134 { 1149 1135 /* 1150 * TODO: Os timeouts de conex ï¿œo foram retirados, ver se serï¿œ necessï¿œrio retornar essa funcionalidade, e,1151 * neste caso, terminar a implementa ᅵᅵo das mensagens de retorno.1136 * TODO: Os timeouts de conexão foram retirados, ver se será necessário retornar essa funcionalidade, e, 1137 * neste caso, terminar a implementação das mensagens de retorno. 1152 1138 */ 1153 1139 if ($index !== 'error'){ … … 1156 1142 $final[3][$i][2] = $contact['companies']['company1']['title']?$contact['companies']['company1']['title']:'none'; 1157 1143 1158 //Para exibir a matricula do empregado1159 $final[3][$i][8] = $contact['companies']['company1']['empNumber']?$contact['companies']['company1']['empNumber']:'none';1160 //Para exibir o setor/lotaᅵᅵo do empregado1161 $final[3][$i][9] = $contact['companies']['company1']['department']?$contact['companies']['company1']['department']:'none';1162 1163 1144 /* Select the correct Email and Telephone to be shown */ 1164 1145 $preferences = ExecMethod('contactcenter.ui_preferences.get_preferences'); 1146 1165 1147 if (!is_array($preferences)) 1166 1148 { … … 1188 1170 $default_phone_found = true; 1189 1171 } 1190 1191 if (!($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['telephone_number'] == $conn_info['connection_value']) && $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] && $conn_info['connection_value'] && preg_match('/^\([0-9]{2}\)[0-9]{4}\-[0-9]{4}$/',$conn_info['connection_value'])==1 && !$external) { 1172 if (!($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['telephone_number'] == $conn_info['connection_value']) && $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] && $conn_info['connection_value'] && preg_match('/^\([0-9]{2}\)[0-9]{4}\-[0-9]{4}$/',$conn_info['connection_value'])==1 && !$external){ 1192 1173 $conn_info['connection_value'] = "<a title=\"".lang("Call Extension")."\" href=\"#\" onclick=\"connectVoip('".$conn_info['connection_value']."', 'com')\">".$conn_info['connection_value']."</a>"; 1193 } 1194 1174 } 1195 1175 $final[3][$i][3] = $conn_info['connection_value'] ? $conn_info['connection_value'] : 'none'; 1196 1176 } 1197 1177 } 1198 1178 } 1199 1179 1200 1180 if (!$final[3][$i][3]) 1201 1181 { … … 1217 1197 $final[4][$i] = $contact['photo'] ? 1 : 0; 1218 1198 $i++; 1219 1220 1199 } 1221 1200 else … … 1230 1209 $this->page_info['actual_letter'] = $letter; 1231 1210 $this->page_info['actual_page'] = $page; 1232 1233 $this->save_session(); 1234 1211 1212 $this->save_session(); 1235 1213 echo serialize($final); 1236 1214 return; 1237 1215 } 1238 1216 1239 1217 $this->page_info['actual_letter'] = $letter; 1240 1218 $this->page_info['actual_page'] = $page; 1241 1219 1242 1220 $this->save_session(); 1243 1221 1244 1222 $final[0] = 0; 1245 1223 $final[1] = $this -> typeContact; 1246 1224 echo serialize($final); 1247 1225 } 1248 1226 1227 function get_visible_all_ldap() 1228 { 1229 $bo = CreateObject('contactcenter.bo_ldap_manager'); 1230 $ldap_query = $bo->srcs; 1231 return $ldap_query[1]['visible']; 1232 } 1233 1234 1249 1235 /*! 1250 1236 1251 1237 @function get_group_data 1252 1238 @abstract Returns all the information of a given Group 1253 1239 @author Nilton Emilio Buhrer Neto 1254 1240 1255 1241 @param (integer) $id The id to get information 1256 1257 */ 1242 1243 */ 1258 1244 function get_group_data($id) 1259 1245 { … … 1261 1247 $fields = $this->bo->catalog->get_fields(true); 1262 1248 $data = $this->bo->catalog->get_single_entry($id,$fields); 1263 1264 if($id) { 1249 1250 if($id) { 1265 1251 // get All Contacts by group. 1266 $data['contact_in_list'] = $this->bo->catalog->get_contacts_by_group($id); 1267 } 1268 1252 $data['contact_in_list'] = $this->bo->catalog->get_contacts_by_group($id); 1253 } 1254 1269 1255 $boGroup = CreateObject('contactcenter.bo_group'); 1270 1271 $data['contact_list'] = $boGroup->get_all_contacts(); 1272 1273 $data['result'] = 'ok'; 1274 echo serialize($data); 1275 } 1276 1256 1257 $all_contacts = $boGroup->get_all_contacts(); 1258 1259 $contact_options = ""; 1260 if(count($all_contacts)) { 1261 foreach($all_contacts as $idx => $contact) { 1262 $contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']." (".$contact['connection_value'].")</OPTION>"; 1263 } 1264 } 1265 $data['contact_list'] = $contact_options; 1266 $data['result'] = 'ok'; 1267 echo serialize($data); 1268 } 1269 1277 1270 /*! 1278 1271 1279 1272 @function get_full_data 1280 1273 @abstract Returns all the information of a given Entry 1281 1274 @author Raphael Derosso Pereira 1282 1275 1283 1276 @param (integer) $id The id to get information 1284 1277 1285 1278 */ 1286 1279 function get_full_data($id) 1287 1280 { 1288 1281 $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; 1289 $this->bo->catalog = CreateObject('contactcenter.bo_people_catalog'); 1282 $this->bo->catalog = CreateObject('contactcenter.bo_people_catalog'); 1290 1283 $fields = $this->bo->catalog->get_fields(true); 1291 1284 $fields['photo'] = false; … … 1320 1313 } 1321 1314 $datecount = 0; 1322 1315 1323 1316 $data['result'] = 'ok'; 1324 1317 $data['cc_full_add_contact_id'] = $id; … … 1362 1355 1363 1356 /* Relations */ 1364 1357 1365 1358 echo serialize($data); 1366 1359 } … … 1399 1392 return; 1400 1393 } 1401 1394 1402 1395 echo 0; 1403 1396 } 1404 1397 1405 1398 /*! 1406 1399 1407 1400 @function quick_add 1408 1401 @abstract Adds a new Contact using the Quick Add interface 1409 1402 @author Raphael Derosso Pereira 1410 1403 1411 1404 @param string $sdata Serialized data 1412 1405 */ 1413 1406 function quick_add($sdata) 1414 1407 { 1415 1408 1416 1409 $sdata = str_replace('\\"', '"', $sdata); 1417 1410 $new_array = unserialize($sdata); 1418 1411 $tdata = array(); 1419 1412 1420 1413 foreach($new_array as $tmp) 1421 1414 $tdata[] = $tmp; 1422 1415 1423 1416 if (!$tdata) 1424 1417 { … … 1427 1420 'status' => 'abort' 1428 1421 )); 1429 1422 1430 1423 return; 1431 1424 } 1432 1433 // verifica se email j ï¿œexiste!1425 1426 // verifica se email já existe! 1434 1427 $boGroup = CreateObject('contactcenter.bo_group'); 1435 1428 $contact = $boGroup->verify_contact($tdata[4]); 1436 1429 1437 1430 if($contact) 1438 { 1431 { 1439 1432 $str_contact = "\r\n - ".implode("\r\n - ",$contact); 1440 1433 1441 1434 echo serialize(array( 1442 1435 'msg' => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 1443 1436 'status' => 'alreadyExists' 1444 1437 )); 1445 1446 return; 1438 1439 return; 1447 1440 } 1448 1441 … … 1460 1453 1461 1454 if ($boPeople ->quick_add($data)) 1462 { 1455 { 1463 1456 $this->page_info['changed'] = true; 1464 1457 1465 1458 echo serialize(array( 1466 1459 'msg' => lang('Entry added with success!'), … … 1476 1469 } 1477 1470 1478 $this->save_session(); 1479 1471 $this->save_session(); 1472 1480 1473 } 1481 1474 1482 1475 /*! 1483 1476 1484 1477 @function add_group 1485 1478 @abstract Adds a new Group using the Add Group interface 1486 1479 @author Nilton Emilio Buhrer Neto 1487 1480 1488 1481 @param string $sdata Serialized data 1489 1482 */ … … 1493 1486 $tdata = unserialize($sdata); 1494 1487 $new_tdata = array(); 1495 1488 1496 1489 if (!$tdata) 1497 1490 { … … 1500 1493 'status' => 'abort' 1501 1494 )); 1502 1495 1503 1496 return; 1504 1497 } 1505 1498 1506 1499 foreach($tdata as $tmp) 1507 1500 $new_tdata[] = $tmp; 1508 1509 $data['title'] = $new_tdata[0]; 1501 1502 $data['title'] = $new_tdata[0]; 1510 1503 $data['contact_in_list'] = $new_tdata[1]; 1511 1504 $data['id_group'] = $new_tdata[2]; 1512 1505 1513 1506 $boGroup = CreateObject('contactcenter.bo_group_manager'); 1514 1507 $id = $boGroup -> add_group($data); 1515 1508 1516 1509 if ($id) 1517 1510 { 1518 1511 $this->page_info['changed'] = true; 1519 1512 1520 1513 echo serialize(array( 1521 1514 'msg' => lang('Entry added with success!'), … … 1535 1528 1536 1529 /*! 1537 1530 1538 1531 @function remove_group 1539 1532 @abstract Removes a group if the user has the right to do it 1540 @author Nilton Emilio Buhrer Neto 1533 @author Nilton Emilio Buhrer Neto 1541 1534 @param (integer) $id The id to be removed 1542 1535 1543 1536 */ 1544 1537 function remove_group($id) 1545 { 1546 $soGroup = CreateObject('contactcenter.so_group'); 1538 { 1539 $soGroup = CreateObject('contactcenter.so_group'); 1547 1540 $data = array ('id_group' => $id); 1548 1541 if($soGroup -> delete($data)) { … … 1550 1543 'msg' => lang('Removed Entry ID '.$id.'!'), 1551 1544 'status' => 'ok' 1552 )); 1545 )); 1553 1546 } 1554 1547 else { … … 1559 1552 } 1560 1553 1561 $this->save_session(); 1554 $this->save_session(); 1562 1555 } 1563 1556 1564 1557 1565 1558 function remove_all_entries (){ 1566 1559 1567 1560 $error = false; 1568 1561 $this->all_entries = $this->bo->catalog->get_all_entries_ids(); … … 1572 1565 if(!$result) { 1573 1566 $error = true; 1574 break; 1567 break; 1575 1568 } 1576 1569 } … … 1581 1574 'status' => 'ok' 1582 1575 )); 1583 } 1576 } 1584 1577 else { 1585 1578 echo serialize(array( … … 1593 1586 1594 1587 /*! 1595 1588 1596 1589 @function remove_entry 1597 1590 @abstract Removes an entry if the user has the right to do it 1598 1591 @author Raphael Derosso Pereira 1599 1592 1600 1593 @param (integer) $id The id to be removed 1601 1594 1602 1595 */ 1603 1596 function remove_entry ($id) … … 1608 1601 return; 1609 1602 } 1610 1603 1611 1604 $this->page_info['changed'] = true; 1612 1605 $result = $this->bo->catalog->remove_single_entry($id); 1613 1606 1614 1607 if ($result) 1615 1608 { … … 1618 1611 unset($this->page_info['actual_entries'][$pos]); 1619 1612 } 1620 1613 1621 1614 $temp = false; 1622 1615 reset($this->page_info['actual_entries']); … … 1625 1618 $temp[] = $t; 1626 1619 } 1627 1620 1628 1621 $this->page_info['actual_entries'] = $temp; 1629 1622 … … 1640 1633 )); 1641 1634 } 1642 1635 1643 1636 $this->save_session(); 1644 1637 } 1645 1638 1646 1639 1647 1640 /*! 1648 1641 1649 1642 @function post_full_add 1650 1643 @abstract Saves all the information altered/entered in the Full Add … … 1655 1648 function post_full_add() 1656 1649 { 1657 $data = unserialize(str_replace('\\"', '"', $_POST['data'])); 1650 $data = $_POST['data']; 1651 // Exceptions!!! utf8 special chars. 1652 $data = preg_replace("/\%u2(\d+)(\d+)(\d+)/","-",$data); 1653 $data = unserialize(str_replace('\\"', '"', $data)); 1658 1654 $this -> bo -> catalog = CreateObject('contactcenter.bo_people_catalog'); 1659 1660 // echo str_replace('\\"', '"', $_POST['data']);1661 1655 1662 1656 if (!is_array($data)) … … 1682 1676 'status' => 'fatal' 1683 1677 )); 1684 1678 1685 1679 return; 1686 1680 } … … 1696 1690 $id_photo = '_new_'; 1697 1691 } 1698 1699 /* 1700 * Process Photo, if available 1692 1693 /* 1694 * Process Photo, if available 1701 1695 */ 1702 1696 $sleep_count = 0; … … 1715 1709 } 1716 1710 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('wait', 'n')); 1717 1711 1718 1712 if (isset($this->page_info['photos'][$id_photo])) 1719 1713 { … … 1732 1726 $this->save_session(); 1733 1727 } 1734 1728 1735 1729 /* 1736 1730 * Arrange Date so it gets inserted correctly 1737 1731 */ 1738 1732 1739 1733 $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; 1740 1734 1741 1735 $j = 0; 1742 1736 for ($i = 0; $i < 5; $i+=2) … … 1771 1765 continue; 1772 1766 } 1773 1767 1774 1768 switch($field) 1775 1769 { … … 1783 1777 /* Do Nothing. This is just to make sure no invalid field is passed */ 1784 1778 break; 1785 1779 1786 1780 case 'id_status': 1787 1781 case 'id_prefix': … … 1792 1786 } 1793 1787 break; 1794 1788 1795 1789 case 'birthdate_0': 1796 1790 case 'birthdate_1': 1797 1791 case 'birthdate_2': 1798 1792 1799 1793 switch($date[$datecount]['digit']) 1800 1794 { … … 1818 1812 break; 1819 1813 } 1820 1814 1821 1815 if (!checkdate($date['value'][0], $date['value'][1], $date['value'][2])) 1822 1816 { … … 1827 1821 return; 1828 1822 } 1829 1823 1830 1824 $data['birthdate'] = $date['value'][2].'-'.$date['value'][0].'-'.$date['value'][1]; 1831 1825 break; … … 1850 1844 { 1851 1845 $index = 'address'.$type; 1852 1846 1853 1847 $id_state = $this->bo->catalog->add_state($state_info); 1854 1848 $data['addresses'][$index]['id_state'] = $id_state; … … 1868 1862 { 1869 1863 $index = 'address'.$type; 1870 1864 1871 1865 $id_city = $this->bo->catalog->add_city($city_info); 1872 1866 $data['addresses'][$index]['id_city'] = $id_city; … … 1909 1903 ); 1910 1904 } 1911 1905 1912 1906 eval($code); 1913 1907 … … 1925 1919 1926 1920 /*! 1927 1921 1928 1922 @function post_photo 1929 1923 @abstract Wrapper to post a photo without reload a page. … … 1935 1929 //print_r($_FILES); 1936 1930 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('wait', 'y')); 1937 1931 1938 1932 if (!is_array($_FILES) and is_array(!$_FILES['cc_pd_photo'])) 1939 1933 { 1940 1934 $this->page_info['photos'][$id]['status'] = 'no_upload'; 1941 1935 $this->page_info['photos'][$id]['msg'] = lang('No Photos uploaded to Server.'); 1942 1936 1943 1937 $this->save_session(); 1944 1938 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('ok', 'y')); … … 1950 1944 $this->page_info['photos'][$id]['status'] = 'no_GD_lib'; 1951 1945 $this->page_info['photos'][$id]['msg'] = lang('Cannot manipulate Image. No Image added. Please, if you want to use images, ask the Administrator to install GD library.'); 1952 1946 1953 1947 $this->save_session(); 1954 1948 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('ok', 'y')); … … 1976 1970 return; 1977 1971 } 1978 1972 1979 1973 switch($_FILES['cc_pd_photo']['type']) 1980 1974 { … … 2006 2000 2007 2001 default: 2008 2002 2009 2003 $this->page_info['photos'][$id]['status'] = 'invalid_image'; 2010 2004 $this->page_info['photos'][$id]['msg'] = lang('The file must be an JPEG, PNG or GIF Image.'); … … 2019 2013 $this->page_info['photos'][$id]['status'] = 'invalid_file'; 2020 2014 $this->page_info['photos'][$id]['msg'] = lang('Couldn\'t open Image. It may be corrupted or internal library doesn\'t support this format.'); 2021 2015 2022 2016 $this->save_session(); 2023 2017 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('ok', 'y')); 2024 2018 return; 2025 2019 } 2026 2020 2027 2021 $img_size = getimagesize($_FILES['cc_pd_photo']['tmp_name']); 2028 2022 $dst_img = imagecreatetruecolor(60, 80); 2029 2023 2030 2024 if (!imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, 60, 80, $img_size[0], $img_size[1])) 2031 2025 { 2032 2026 $this->page_info['photos'][$id]['status'] = 'invalid_file'; 2033 2027 $this->page_info['photos'][$id]['msg'] = lang('Couldn\'t open Image. It may be corrupted or internal library doesn\'t support this format.'); 2034 2028 2035 2029 $this->save_session(); 2036 2030 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('ok', 'y')); 2037 2031 return; 2038 2032 } 2039 2033 2040 2034 ob_start(); 2041 2035 imagepng($dst_img); … … 2047 2041 2048 2042 $this->save_session(); 2049 2043 2050 2044 $GLOBALS['phpgw']->session->appsession('ui_data.photo','contactcenter', array('ok', 'y')); 2051 2045 … … 2068 2062 $fields = $this->bo->catalog->get_fields(false); 2069 2063 $fields['photo'] = true; 2070 2064 2071 2065 $contact = $this->bo->catalog->get_single_entry($id, $fields); 2072 2066 … … 2077 2071 return; 2078 2072 } 2079 2073 2080 2074 header('Content-type: image/jpeg'); 2081 2075 $photo = imagecreatefromstring ($contact['photo']); … … 2089 2083 return; 2090 2084 } 2091 2085 2092 2086 /*! 2093 2087 2094 2088 @function get_states 2095 2089 @abstract Echos a serialized array containing all the states for the given country … … 2113 2107 return; 2114 2108 } 2115 2109 2116 2110 $result = array( 2117 2111 'msg' => lang('States Successfully retrieved!'), 2118 2112 'status' => 'ok' 2119 2113 ); 2120 2114 2121 2115 foreach ($states as $state_info) 2122 2116 { … … 2157 2151 return; 2158 2152 } 2159 2153 2160 2154 $result = array( 2161 2155 'msg' => lang('Cities Successfully retrieved!'), 2162 2156 'status' => 'ok' 2163 2157 ); 2164 2158 2165 2159 foreach ($cities as $city_info) 2166 2160 { 2167 2161 $result['data'][$city_info['id_city']] = $city_info['name']; 2168 2162 } 2169 2163 2170 2164 echo serialize($result); 2171 2165 } … … 2173 2167 2174 2168 /*! 2175 2169 2176 2170 @function search 2177 2171 @abstract Echos a serialized array containing the IDs 2178 2172 of the entries that matches the search argument 2179 2173 @author Raphael Derosso Pereira 2180 @author M ï¿œrio Cï¿œsar Kolling (external catalogs)2174 @author Mário César Kolling (external catalogs) 2181 2175 2182 2176 @param string $str_data A serialized array with two informations: … … 2187 2181 2188 2182 */ 2183 // SERPRO 2189 2184 function search($str_data) 2190 2185 { … … 2192 2187 // It's an external catalog? 2193 2188 $external = $this->bo->is_external($this->page_info['actual_catalog']); 2194 2195 if (!is_array($data) || !$data['search_for'] || !is_array($data['fields'])) 2196 { 2197 //echo serialize(array( 2198 // 'msg' => lang('Invalid parameters'), 2199 // 'status' => 'abort' 2200 //)); 2201 2202 return array('error' => lang('Invalid parameters')); 2203 } 2204 2189 2190 if (!is_array($data) || !$data['search_for'] || !is_array($data['fields'])) 2191 { 2192 echo serialize(array( 2193 'msg' => lang('Invalid parameters'), 2194 'status' => 'abort' 2195 )); 2196 2197 return array('error' => lang('Invalid parameters')); 2198 } 2199 2200 2205 2201 /* 2206 2202 * TODO: look into the database to discover the database's encoding and convert the search_for field accordingly … … 2213 2209 $data['search_for'] = utf8_encode($data['search_for']); 2214 2210 } 2215 2216 $rules = array(); 2217 2218 if ($data['search_for'] === '*') 2219 { 2220 $rules = array( 2221 0 => array( 2222 'field' => $data['fields']['search'], 2223 'type' => 'LIKE', 2224 'value' => '%' 2225 ) 2226 ); 2227 } 2228 else 2229 { 2230 $names = explode(' ', $data['search_for']); 2231 2232 if (!is_array($names)) 2233 { 2234 //echo serialize(array( 2235 // 'msg' => lang('Invalid Search Parameter'), 2236 // 'status' => 'abort' 2237 //)); 2238 2239 return array('error' => lang('Invalid Search Parameter')); 2240 2211 2212 $rules = array(); 2213 2214 2215 if ($data['search_for'] === '*') 2216 { 2217 $rules = array( 2218 0 => array( 2219 'field' => $data['fields']['search'], 2220 'type' => 'LIKE', 2221 'value' => '%' 2222 ) 2223 ); 2224 } 2225 else 2226 { 2227 $names = explode(' ', $data['search_for']); 2228 2229 if (!is_array($names)) 2230 { 2231 echo serialize(array( 2232 'msg' => lang('Invalid Search Parameter'), 2233 'status' => 'abort' 2234 )); 2235 2236 } 2241 2237 2242 2238 if (!$external && $this->page_info['actual_catalog']['class'] != 'bo_people_catalog' && … … 2271 2267 ); 2272 2268 } 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2269 2270 foreach ($names as $name) 2271 { 2272 if ($name != '') 2273 { 2274 array_push($rules, array( 2275 'field' => $data['fields']['search'], 2276 'type' => 'iLIKE', 2277 'value' => '%'.$name.'%' 2278 )); 2279 } 2280 } 2281 } 2286 2282 2287 2283 if ($external || $this->page_info['actual_catalog']['class'] == 'bo_people_catalog' || … … 2305 2301 } 2306 2302 2307 if (!is_array($ids) || !count($ids)) 2308 { 2309 //echo serialize(array( 2310 // 'msg' => lang('No Entries Found!'), 2311 // 'status' => 'empty' 2312 //)); 2313 2303 if (!is_array($ids) || !count($ids)) 2304 { 2314 2305 $this->last_search_ids = null; 2315 2306 $this->save_session(); 2316 2307 return null; 2317 } 2318 2319 $id_field = substr($data['fields']['id'], strrpos($data['fields']['id'], '.')+1); 2320 2321 $ids_f = array(); 2322 foreach ($ids as $e_info) 2323 { 2324 //$ids_f[] = "base64::" . base64_encode($e_info[$id_field]); 2325 $ids_f[] = $e_info[$id_field]; 2326 } 2327 2328 //error_log("ids_f serializados: " . serialize($ids_f) . "\n", 3, '/var/www/teste.log'); 2329 2330 //return serialize($ids_f); 2308 } 2309 2310 $id_field = substr($data['fields']['id'], strrpos($data['fields']['id'], '.')+1); 2311 2312 $ids_f = array(); 2313 2314 foreach ($ids as $e_info) 2315 { 2316 $ids_f[] = $e_info[$id_field]; 2317 } 2318 2331 2319 return $ids_f; 2332 2333 //echo serialize(array(2334 // 'data' => $ids_f,2335 // 'msg' => lang('Found %1 Entries', count($ids)),2336 // 'status' => 'ok'2337 //));2338 2320 } 2339 2321 2322 // CELEPAR 2323 /* 2324 function search($str_data) 2325 { 2326 $data = unserialize($str_data); 2327 2328 if (!is_array($data) || !$data['search_for'] || !is_array($data['fields'])) 2329 { 2330 echo serialize(array( 2331 'msg' => lang('Invalid parameters'), 2332 'status' => 'abort' 2333 )); 2334 2335 return; 2336 } 2337 2338 $rules = array(); 2339 2340 if ($data['search_for'] === '*') 2341 { 2342 $rules = array( 2343 0 => array( 2344 'field' => $data['fields']['search'], 2345 'type' => 'LIKE', 2346 'value' => '%' 2347 ) 2348 ); 2349 } 2350 else 2351 { 2352 $names = explode(' ', $data['search_for']); 2353 2354 if (!is_array($names)) 2355 { 2356 echo serialize(array( 2357 'msg' => lang('Invalid Search Parameter'), 2358 'status' => 'abort' 2359 )); 2360 2361 return; 2362 } 2363 2364 foreach ($names as $name) 2365 { 2366 if ($name != '') 2367 { 2368 array_push($rules, array( 2369 'field' => $data['fields']['search'], 2370 'type' => 'iLIKE', 2371 'value' => '%'.$name.'%' 2372 )); 2373 } 2374 } 2375 } 2376 2377 2378 2379 //$catalog = $this->bo->get_branch_by_level($this->bo->catalog_level[0]); 2380 2381 //if ($catalog['class'] === 'bo_people_catalog') 2382 //{ 2383 // array_push($rules, array( 2384 // 'field' => 'contact.id_owner', 2385 // 'type' => '=', 2386 // 'value' => $GLOBALS['phpgw_info']['user']['account_id'] 2387 // )); 2388 //} 2389 2390 2391 $ids = $this->bo->find(array($data['fields']['id'], $data['fields']['search']), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC')); 2392 2393 if (!is_array($ids) || !count($ids)) 2394 { 2395 echo serialize(array( 2396 'msg' => lang('No Entries Found!'), 2397 'status' => 'empty' 2398 )); 2399 2400 return; 2401 } 2402 $id_field = substr($data['fields']['id'], strrpos($data['fields']['id'], '.')+1); 2403 2404 $ids_f = array(); 2405 foreach ($ids as $e_info) 2406 { 2407 $ids_f[] = $e_info[$id_field]; 2408 } 2409 2410 echo serialize(array( 2411 'data' => $ids_f, 2412 'msg' => lang('Found %1 Entries', count($ids)), 2413 'status' => 'ok' 2414 )); 2415 2416 return; 2417 }*/ 2340 2418 /*! 2341 2419 … … 2345 2423 @author Raphael Derosso Pereira 2346 2424 2347 @param array str_data A serialized array containing the ID's of the entries 2425 @param array str_data A serialized array containing the ID's of the entries 2348 2426 to be taken, the fields to be taken and the rules to be used on the 2349 2427 retrieval: … … 2358 2436 { 2359 2437 $data = unserialize($str_data); 2360 2438 2361 2439 if (!is_array($data) or !count($data) or !count($data['fields']) or !count($data['ids'])) 2362 2440 { … … 2368 2446 2369 2447 $entries = $this->bo->catalog->get_multiple_entries($data['ids'], $data['fields']); 2370 2448 2371 2449 if (!is_array($entries) or !count($entries)) 2372 2450 { … … 2387 2465 2388 2466 @function get_all_entries 2389 @abstract Returns the specified fields for all catalog's entries 2467 @abstract Returns the specified fields for all catalog's entries 2390 2468 in the default CC UI format 2391 2469 @author Raphael Derosso Pereira 2392 2470 2393 @params array str_data A serialized array containing the fields to 2471 @params array str_data A serialized array containing the fields to 2394 2472 be grabbed, the maximum number of entries to be returned and a 2395 2473 boolean specifying if the calls refers to a new grab or to an … … 2400 2478 { 2401 2479 $data = unserialize($str_data); 2402 2403 if (!is_array($data) or 2404 !count($data) or 2405 !count($data['fields']) or 2480 2481 if (!is_array($data) or 2482 !count($data) or 2483 !count($data['fields']) or 2406 2484 !$data['maxlength'] or 2407 2485 (!$data['new'] and !$data['offset'])) … … 2429 2507 $data['offset'] = 0; 2430 2508 } 2431 2509 2432 2510 if ($data['maxlength'] != -1) 2433 2511 { … … 2440 2518 2441 2519 $prefs = ExecMethod('contactcenter.ui_preferences.get_preferences'); 2442 2520 2443 2521 $jsCode = array(); 2444 2522 $count = 0; … … 2450 2528 } 2451 2529 2452 if($this-> typeContact == 'groups') { 2453 2530 if($this-> typeContact == 'groups') { 2531 2454 2532 foreach ($each as $field => $value) { 2455 2533 2456 2534 if ($field === 'title') { 2457 2535 $optionName = '\\"'.$value.'\\"'; 2458 2536 2459 2537 } 2460 2538 else if ($field === 'short_name') { 2461 2539 2462 2540 $jsCode[] = '_this.entries.options[_this.entries.options.length] = new Option("'.$optionName.' ('.$value.')", "'.$count.'");'; 2463 $count++; 2464 } 2541 $count++; 2542 } 2465 2543 } 2466 2544 } 2467 2468 else { 2545 2546 else { 2469 2547 foreach ($each as $field => $value) { 2470 2548 if ($field === 'names_ordered') { … … 2474 2552 } 2475 2553 else if ($field === 'connections') { 2476 2554 2477 2555 foreach ($value as $connection) { 2478 2556 if ($connection['id_type'] == $prefs['personCardEmail']) { … … 2487 2565 2488 2566 $jsCodeFinal = implode("\n", $jsCode); 2489 2567 2490 2568 $nEntries = count($result); 2491 2569 2492 2570 if (!$nEntries) 2493 2571 { … … 2507 2585 ); 2508 2586 } 2509 2587 2510 2588 /*********************************************************************\ 2511 2589 * Auxiliar Methods * … … 2513 2591 2514 2592 /*! 2515 2593 2516 2594 @function save_session 2517 2595 @abstract Saves the data on the session 2518 2596 @author Raphael Derosso Pereira 2519 2597 2520 2598 */ 2521 2599 function save_session() … … 2523 2601 $GLOBALS['phpgw']->session->appsession('ui_data.page_info','contactcenter',$this->page_info); 2524 2602 $GLOBALS['phpgw']->session->appsession('ui_data.all_entries','contactcenter',$this->all_entries); 2525 $GLOBALS['phpgw']->session->appsession('ui_data.last_search_ids','contactcenter',$this->last_search_ids);2526 2603 } 2527 2604 2528 2605 /*! 2529 2606 2530 2607 @function convert_tree 2531 2608 @abstract Converts the tree array in the BO format to a JS tree array compatible 2532 2609 with the one available in eGW 2533 2610 @author Raphael Derosso Pereira 2534 2611 2535 2612 @param (array) $tree The tree in the BO format 2536 2613 @param (string) $name The tree name … … 2566 2643 'caption' => $value['name'] 2567 2644 ); 2568 2645 2569 2646 switch($value['type']) 2570 2647 { … … 2589 2666 $this->bo->catalog->src_info = $ldap->srcs[1]; 2590 2667 } 2591 2592 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true); 2668 2669 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true); 2593 2670 $dn=$this->bo->catalog->src_info['dn']; 2594 2671 $justThese = array("givenname","givenname","sn","telephonenumber","mail"); 2595 $sr = ldap_read($ds,$id, "objectClass=*",$justThese); 2596 $info = ldap_get_entries($ds, $sr); 2672 $sr = ldap_read($ds,$id, "objectClass=*",$justThese); 2673 $info = ldap_get_entries($ds, $sr); 2597 2674 for($z = 0; $z < 5; $z++) { 2598 $participant = $info[0][$justThese[$z]]; 2675 $participant = $info[0][$justThese[$z]]; 2599 2676 array_push($array_participants, $participant); 2600 2677 } … … 2602 2679 ldap_close($ds); 2603 2680 echo serialize($array_participants); 2604 } 2605 2606 function get_catalog_participants_list($id) 2681 } 2682 2683 function get_catalog_participants_list($id) 2607 2684 { 2608 2609 $fields = $this->bo->catalog->get_fields(false); 2685 2686 $fields = $this->bo->catalog->get_fields(false); 2610 2687 $fields['names_ordered'] = true; 2611 $fields['mail_forwarding_address'] = true; 2612 $contact = $this->bo->catalog->get_single_entry($id,$fields); 2613 2688 $fields['mail_forwarding_address'] = true; 2689 $contact = $this->bo->catalog->get_single_entry($id,$fields); 2690 2614 2691 $array_participants = array(); 2615 2692 $array_emails = array(); 2616 2693 2617 2694 $filter = null; 2618 for($z = 0; $z < $contact['mail_forwarding_address']['count']; $z++) { 2695 for($z = 0; $z < $contact['mail_forwarding_address']['count']; $z++) { 2619 2696 if(strstr($contact['mail_forwarding_address'][$z],'@')) { 2620 2697 $filter.="(mail=".$contact['mail_forwarding_address'][$z].")"; 2621 2698 $array_emails[$contact['mail_forwarding_address'][$z]] = "<font color=black>".$contact['mail_forwarding_address'][$z]."</font>"; 2622 } 2623 else 2699 } 2700 else 2624 2701 $array_participants[$z] = "<font color=red>".$contact['mail_forwarding_address'][$z]."</font>"; 2625 } 2626 2702 } 2703 2627 2704 if($filter) { 2628 $filter = "(|".$filter.")"; 2705 $filter = "(|".$filter.")"; 2629 2706 if(!$this->bo->catalog->src_info) { 2630 2707 $ldap = CreateObject('contactcenter.bo_ldap_manager'); 2631 2708 $this->bo->catalog->src_info = $ldap->srcs[1]; 2632 2709 } 2633 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true); 2710 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true); 2634 2711 $dn=$this->bo->catalog->src_info['dn']; 2635 2712 $justThese = array("cn","mail"); 2636 $sr = ldap_search($ds,$dn, $filter,$justThese); 2637 $info = ldap_get_entries($ds, $sr); 2713 $sr = ldap_search($ds,$dn, $filter,$justThese); 2714 $info = ldap_get_entries($ds, $sr); 2638 2715 for($z = 0; $z < $info['count']; $z++) { 2639 2716 $participant = '<font color=\'DARKBLUE\'> "'.$info[$z]['cn'][0].'" <'.$info[$z]['mail'][0].'></font><br>'; 2640 $array_emails[$info[$z]['mail'][0]] = null; 2641 array_push($array_participants, $participant); 2642 } 2643 2717 $array_emails[$info[$z]['mail'][0]] = null; 2718 array_push($array_participants, $participant); 2719 } 2720 2644 2721 foreach($array_emails as $index => $email) 2645 if($email) 2646 array_push($array_participants, " ".$email."<br>"); 2647 2722 if($email) 2723 array_push($array_participants, " ".$email."<br>"); 2724 2648 2725 ldap_close($ds); 2649 2726 } 2650 2727 sort($array_participants); 2651 $innerHTML = ''; 2728 $innerHTML = ''; 2652 2729 foreach($array_participants as $index => $participant){ 2653 2730 $innerHTML .= $participant; 2654 2731 } 2655 $return = array('size' => count($array_participants), 'names_ordered'=> $contact['names_ordered'], 'inner_html' => $innerHTML); 2732 $return = array('size' => count($array_participants), 'names_ordered'=> $contact['names_ordered'], 'inner_html' => $innerHTML); 2656 2733 echo serialize($return); 2657 } 2658 2734 } 2735 2659 2736 function export_contacts($typeExport){ 2660 2737 … … 2667 2744 2668 2745 2669 // Essa itera ᅵᅵo transforma uma esturuta com contatos redundantes e separados por email ou tel.2746 // Essa iteração transforma uma esturuta com contatos redundantes e separados por email ou tel. 2670 2747 // em outra com apenas 1 elemento pra cada contato 2671 2748 $i=0; … … 2678 2755 $all_contacts[$i]['phone']=$object['connection_value']; 2679 2756 } 2680 2757 2681 2758 switch($typeExport) { 2682 2759 2683 2760 case 'outlook_en': 2684 2761 $streamBuffer = "Name;E-mail Address;Notes;Mobile Phone;Pager;Company;". 2685 "Job Title;Home Phone;Home Fax;Business Phone;Business Fax\r\n"; 2762 "Job Title;Home Phone;Home Fax;Business Phone;Business Fax\r\n"; 2686 2763 foreach($all_contacts as $index => $object){ 2687 2764 $streamBuffer.= $object['name'].";".$object['email'].";;;;;;".$object['phone'].";;;\r\n"; 2688 2765 } 2689 2766 break; 2690 2767 2691 2768 case 'outlook_pt-BR': 2692 $streamBuffer = "Nome;End. de email;Endere ï¿œo residencial;".2693 "Cidade do endere ï¿œo residencial;CEP do endereï¿œo residencial;".2694 "Estado;Pa ï¿œs/regiï¿œo do endereï¿œo residencial;Telefone residencial;".2695 "Rua do endere ï¿œo comercial;Cidade do endereï¿œo comercial;".2696 "CEP do endere ï¿œo comercial;Estado do endereï¿œo comercial;".2697 "Pa ï¿œs/regiï¿œo do endereï¿œo comercial;Telefone comercial;Empresa;Cargo\r\n";2769 $streamBuffer = "Nome;End. de email;Endereço residencial;". 2770 "Cidade do endereço residencial;CEP do endereço residencial;". 2771 "Estado;País/região do endereço residencial;Telefone residencial;". 2772 "Rua do endereço comercial;Cidade do endereço comercial;". 2773 "CEP do endereço comercial;Estado do endereço comercial;". 2774 "País/região do endereço comercial;Telefone comercial;Empresa;Cargo\r\n"; 2698 2775 foreach($all_contacts as $index => $object){ 2699 2776 $streamBuffer.= $object['name'].";".$object['email'].";;;;;;".$object['phone'].";;;;;;;;\r\n"; 2700 2777 } 2701 2778 break; 2702 2779 2703 2780 case 'outlook2000_pt-BR': 2704 2781 $streamBuffer = "\"Tratamento\",\"Nome\",\"Segundo Nome\",\"Sobrenome\",\"Sufixo\",". 2705 "\"Empresa\",\"Departamento\",\"Cargo\",\"Rua do endere ï¿œo comercial\",\"Rua do endereï¿œo comercial 2\",".2706 "\"Rua do endere ï¿œo comercial 3\",\"Cidade do endereï¿œo comercial\",\"Estado do endereï¿œo comercial\",".2707 "\"CEP do endere ï¿œo comercial\",\"Paï¿œs do endereï¿œo comercial\",\"Endereï¿œo residencial\",\"Rua residencial 2\",".2708 "\"Rua residencial 3\",\"Cidade do endere ï¿œo residencial\",\"Estado\",\"CEP do endereï¿œo residencial\",\"Paï¿œs do endereï¿œo residencial\",".2709 "\"Outro endere ï¿œo\",\"Outro endereï¿œo 2\",\"Outro endereï¿œo 3\",\"Cidade\",\"Estado\",\"CEP\",\"Paï¿œs\",".2782 "\"Empresa\",\"Departamento\",\"Cargo\",\"Rua do endereço comercial\",\"Rua do endereço comercial 2\",". 2783 "\"Rua do endereço comercial 3\",\"Cidade do endereço comercial\",\"Estado do endereço comercial\",". 2784 "\"CEP do endereço comercial\",\"País do endereço comercial\",\"Endereço residencial\",\"Rua residencial 2\",". 2785 "\"Rua residencial 3\",\"Cidade do endereço residencial\",\"Estado\",\"CEP do endereço residencial\",\"País do endereço residencial\",". 2786 "\"Outro endereço\",\"Outro endereço 2\",\"Outro endereço 3\",\"Cidade\",\"Estado\",\"CEP\",\"País\",". 2710 2787 "\"Telefone do assistente\",\"Fax comercial\",\"Telefone comercial\",\"Telefone comercial 2\",\"Retorno de chamada\",". 2711 2788 "\"Telefone do carro\",\"Telefone principal da empresa\",\"Fax residencial\",\"Telefone residencial\",". 2712 2789 "\"Telefone residencial 2\",\"ISDN\",\"Telefone celular\",\"Outro fax\",\"Outro telefone\",\"Pager\",\"Telefone principal\",". 2713 "\"Radiofone\",\"Telefone TTY/TDD\",\"Telex\",\"Anivers ï¿œrio\",\"Anotaᅵᅵes\",\"Caixa postal\",\"Categorias\",".2714 "\"C ï¿œdigo da empresa\",\"Cï¿œdigo do governo\",\"Cï¿œnjuge\",\"Conta\",\"Endereï¿œo de correio eletrï¿œnico\",".2715 "\"Nome de exibi ᅵᅵo do correio eletr.\",\"Endereï¿œo de correio eletrï¿œnico 2\",".2716 "\"Nome de exibi ᅵᅵo do correio eletr.2\",\"Endereï¿œo de correio eletrï¿œnico 3\",".2717 "\"Nome de exibi ᅵᅵo do correio eletr.3\",\"Datas especiais\",\"Disponibilidade da Internet\",".2718 "\"Filhos\",\"Hobby\",\"Idioma\",\"Indica ᅵᅵo\",\"Informaᅵᅵes para cobranï¿œa\",\"Iniciais\",\"Local\",".2719 "\"Nome do assistente\",\"Nome do gerenciador\",\"P ï¿œgina da Web\",\"Palavras-chave\",\"Particular\",\"Personalizado 1\",\"Personalizado 2\",".2720 "\"Personalizado 3\",\"Personalizado 4\",\"Prioridade\",\"Profiss ï¿œo\",\"Quilometragem\",\"Sala\",\"Sensibilidade\",\"Servidor de diretï¿œrio\",".2790 "\"Radiofone\",\"Telefone TTY/TDD\",\"Telex\",\"Aniversário\",\"Anotações\",\"Caixa postal\",\"Categorias\",". 2791 "\"Código da empresa\",\"Código do governo\",\"Cônjuge\",\"Conta\",\"Endereço de correio eletrônico\",". 2792 "\"Nome de exibição do correio eletr.\",\"Endereço de correio eletrônico 2\",". 2793 "\"Nome de exibição do correio eletr.2\",\"Endereço de correio eletrônico 3\",". 2794 "\"Nome de exibição do correio eletr.3\",\"Datas especiais\",\"Disponibilidade da Internet\",". 2795 "\"Filhos\",\"Hobby\",\"Idioma\",\"Indicação\",\"Informações para cobrança\",\"Iniciais\",\"Local\",". 2796 "\"Nome do assistente\",\"Nome do gerenciador\",\"Página da Web\",\"Palavras-chave\",\"Particular\",\"Personalizado 1\",\"Personalizado 2\",". 2797 "\"Personalizado 3\",\"Personalizado 4\",\"Prioridade\",\"Profissão\",\"Quilometragem\",\"Sala\",\"Sensibilidade\",\"Servidor de diretório\",". 2721 2798 "\"Sexo\"\r\n"; 2722 2799 foreach($all_contacts as $index => $object){ … … 2724 2801 } 2725 2802 break; 2726 2803 2727 2804 case 'outlook2000_en': 2728 2805 $streamBuffer = "Title,First Name,Middle Name,Last Name,Suffix,Company,Department,Job Title,". … … 2740 2817 } 2741 2818 break; 2742 2819 2743 2820 case 'thunderbird': 2744 $streamBuffer = "\n"; 2821 $streamBuffer = "\n"; 2745 2822 foreach($all_contacts as $index => $object){ 2746 2823 $streamBuffer.= ",,".$object['name'].",,".$object['email'].",,".$object['phone'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n"; 2747 2824 } 2748 2825 break; 2749 2750 default:2826 2827 case 'expresso': 2751 2828 $streamBuffer = "Nome,Email,Telefone\r\n"; 2752 2829 foreach($all_contacts as $index => $object){ … … 2754 2831 } 2755 2832 break; 2756 2833 2757 2834 } 2758 2835 … … 2762 2839 if(!$f) 2763 2840 echo null; 2764 2841 2765 2842 fputs($f,$streamBuffer); 2766 2843 fclose($f); … … 2769 2846 } 2770 2847 2848 // Get the csv field and put into array, from php.net 2849 function parse_line($input_text, $delimiter = ',', $text_qualifier = '"') { 2850 $text = trim($input_text); 2851 if(is_string($delimiter) && is_string($text_qualifier)) { 2852 $re_d = '\x' . dechex(ord($delimiter)); //format for regexp 2853 $re_tq = '\x' . dechex(ord($text_qualifier)); //format for regexp 2854 2855 $fields = array(); 2856 $field_num = 0; 2857 while(strlen($text) > 0) { 2858 if($text{0} == $text_qualifier) { 2859 preg_match('/^' . $re_tq . '((?:[^' . $re_tq . ']|(?<=\x5c)' . $re_tq . ')*)' . $re_tq . $re_d . '?(.*)$/', $text, $matches); 2860 2861 $value = str_replace('\\' . $text_qualifier, $text_qualifier, $matches[1]); 2862 $text = trim($matches[2]); 2863 2864 $fields[$field_num++] = $value; 2865 } else { 2866 preg_match('/^([^' . $re_d . ']*)' . $re_d . '?(.*)$/', $text, $matches); 2867 2868 $value = $matches[1]; 2869 $text = trim($matches[2]); 2870 2871 $fields[$field_num++] = $value; 2872 } 2873 } 2874 return $fields; 2875 } else 2876 return false; 2877 } 2771 2878 2772 2879 function import_contacts($typeImport){ 2773 2880 2774 $delim = ($typeImport == 'outlook' ? ';' : ','); 2775 2776 if($file = $_SESSION['contactcenter']['importCSV']) { 2777 unset($_SESSION['contactcenter']['importCSV']); 2881 if($file = $_SESSION['contactcenter']['importCSV']) { 2882 unset($_SESSION['contactcenter']['importCSV']); 2778 2883 $len = filesize($file); 2779 2884 $count = 0; 2780 2885 $return = array('error' => false, '_new' => 0, '_existing' => 0, '_failure' => 0); 2781 2886 $handle = @fopen($file, "r") or die(serialize($return['error'] = true)); 2887 2888 $input_header = fgets($handle); 2889 if ($typeImport == 'outlook') 2890 $delim = ';'; 2891 else if ($typeImport == 'auto') 2892 $delim = strstr($input_header,',') ? ',' : ';'; 2893 else 2894 $delim = ','; 2895 $csv_header = $this->parse_line($input_header,$delim); 2896 $firstContact = fgets($handle); 2897 preg_match("/\"(.+)\"[,;]/sU",$firstContact,$matches); // yahoo csv 2898 rewind($handle); 2899 2782 2900 $header = @fgetcsv($handle, $len, $delim) or die(serialize($return['error'] = true)); 2783 2901 if(count($header) < 2 || count($header) > 100) { … … 2787 2905 return; 2788 2906 } 2789 2790 $boGroup = CreateObject('contactcenter.bo_group'); 2791 $boPeople = CreateObject('contactcenter.bo_people_catalog'); 2792 2907 2908 if ($matches[0][strlen($matches[0])-1] == ';') 2909 $delim = ';'; 2910 2911 $boGroup = CreateObject('contactcenter.bo_group'); 2912 $boPeople = CreateObject('contactcenter.bo_people_catalog'); 2793 2913 switch($typeImport){ 2794 2914 case 'outlook2000': … … 2807 2927 $phone_pos=7; 2808 2928 break; 2809 default:2929 case 'expresso': 2810 2930 $name_pos=0; 2811 2931 $email_pos=1; 2812 2932 $phone_pos=2; 2813 } 2933 break; 2934 default: 2935 foreach($csv_header as $index => $fieldName) 2936 { 2937 switch($fieldName){ 2938 case 'Name': 2939 case 'Nome': 2940 case 'First Name': 2941 $name_pos = $index; 2942 break; 2943 case 'E-mail': 2944 case 'Email': 2945 case 'E-mail Address': 2946 case 'Endereço de correio eletrônico': 2947 case 'End. de email': 2948 $email_pos = $index; 2949 break; 2950 case 'Home Phone': 2951 case 'Phone': 2952 case 'Telefone': 2953 case 'Telefone principal': 2954 case 'Telefone comercial': 2955 $phone_pos = $index; 2956 break; 2957 } 2958 } 2959 break; 2960 } 2961 2814 2962 2815 2963 while (($data = fgetcsv($handle, $len, $delim))) { 2816 2817 2964 foreach ($header as $key=>$heading) 2818 2965 $row[$heading]=(isset($data[$key])) ? $data[$key] : ''; 2819 2966 2820 2967 $sdata = array(); 2821 2968 $full_name = trim($row[$header[$name_pos]]); … … 2831 2978 $sdata['connections']['default_phone']['connection_name'] = lang('Main'); 2832 2979 $sdata['connections']['default_phone']['connection_value'] = $phone; 2833 2834 // verifica se email j ï¿œexiste!2980 2981 // verifica se email já existe! 2835 2982 $contact = $boGroup->verify_contact($email); 2836 2983 2984 if(!$sdata['given_names'] && $email){ 2985 $a_email = explode("@",$email); 2986 $sdata['given_names'] = $a_email[0]; 2987 } 2988 2989 $line_iteration = $return['_failure'] + $return['_existing'] + $return['_new']; 2837 2990 if($contact){ 2838 2991 $return['_existing']++; 2839 } 2992 } 2840 2993 else if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { 2841 2994 $return['_failure']++; 2995 $return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid E-Mail address: " . $email ."<br>"; 2842 2996 } 2843 2997 else if (!$sdata['given_names'] || !$email || !$boPeople ->quick_add($sdata)){ 2844 $return['_failure']++; 2998 $return['_failure']++; 2999 $return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid Name: " . $sdata['given_names'] ."<br>"; 2845 3000 } 2846 3001 else 2847 3002 $return['_new']++; 2848 } 3003 } 2849 3004 fclose($handle); 2850 3005 unlink($file); … … 2860 3015 $new = null; 2861 3016 $code = null; 2862 3017 2863 3018 if ($parent === '0') 2864 3019 { … … 2866 3021 $code .= $name.".add(new dNode({id:'0', caption: '".lang('Catalogues')."'}),'none');\n"; 2867 3022 } 2868 3023 2869 3024 foreach ($tree as $id => $value) 2870 3025 { … … 2872 3027 2873 3028 switch ($value['type']) 2874 { 3029 { 2875 3030 case 'unknown': 2876 $code .= $name.".add(new dNode({id: '{$parent}.{$id}', caption:'{$value['name']}', onFirstOpen: 'getCatalogTree(\\'{$parent}.{$id}\\');', onClick: 'getCatalogTree(\\'{$parent}.{$id}\\'); waitForTree(\\'{$parent}.{$id}\\', 0)'}),'$parent');\n"; 3031 $code .= $name.".add(new dNode({id: '{$parent}.{$id}', caption:'{$value['name']}', onFirstOpen: 'getCatalogTree(\\'{$parent}.{$id}\\');', onClick: 'getCatalogTree(\\'{$parent}.{$id}\\'); waitForTree(\\'{$parent}.{$id}\\', 0)'}),'$parent');\n"; 2877 3032 break; 2878 3033 2879 3034 case 'catalog_group': 2880 $code .= $name.".add(new dNode({id: '{$parent}.{$id}', caption: '{$value['name']}'}),'$parent');\n"; 3035 $code .= $name.".add(new dNode({id: '{$parent}.{$id}', caption: '{$value['name']}'}),'$parent');\n"; 2881 3036 $code .= $this->convert_tree($value['sub_branch'],$name,$iconDir,$parent.'.'.$id); 2882 3037 break; … … 2887 3042 $code .= $this->convert_tree($value['sub_branch'],$name,$iconDir,$parent.'.'.$id); 2888 3043 break; 2889 3044 2890 3045 case 'catalog': 2891 3046 $code .= $name.".add(new dNode({id: '{$parent}.{$id}', caption: '{$value['name']}', onClick: 'setCatalog(\\'{$parent}.{$id}\\')'}),'$parent');\n"; 2892 2893 } 2894 } 2895 3047 3048 } 3049 } 3050 2896 3051 return $code; 2897 3052 } -
trunk/contactcenter/inc/class.ui_preferences.inc.php
r2 r285 35 35 $pCatalog = CreateObject('contactcenter.bo_people_catalog'); 36 36 $types = $pCatalog->get_all_connections_types(); 37 38 if ( count($types))37 38 if (is_array($types)) 39 39 { 40 40 $options_email = ''; -
trunk/contactcenter/index.php
r284 r285 24 24 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber']; 25 25 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] = true; 26 27 26 $obj = CreateObject('contactcenter.ui_data'); 28 27 $obj->index(); 29 30 31 28 $GLOBALS['phpgw']->common->phpgw_footer(); 32 29 ?> -
trunk/contactcenter/js/cc.js
r284 r285 57 57 var CC_full_add_const = false; 58 58 var CC_full_add_photo = false; 59 59 60 60 var CC_last_height = window.innerHeight; 61 61 var CC_last_width = window.innerWidth; … … 90 90 photo_input = photo_frame.contentDocument.createElement('input'); 91 91 } 92 92 93 93 photo_frame.id = 'cc_photo_frame'; 94 94 photo_frame.style.position = 'absolute'; … … 96 96 photo_frame.style.top = '600px'; 97 97 photo_frame.style.left = '0px'; 98 98 99 99 photo_form.id = 'cc_photo_form'; 100 100 photo_form.method = 'POST'; 101 101 photo_form.enctype = 'multipart/form-data'; 102 102 103 103 photo_input.id = 'cc_photo_input'; 104 104 photo_input.type = 'file'; 105 105 106 106 if (is_ie) 107 107 { … … 113 113 } 114 114 photo_form.appendChild(photo_input); 115 115 116 116 } 117 117 … … 121 121 var obj = Element(id); 122 122 var max = obj.options.length; 123 123 124 124 if (option == undefined) 125 125 { … … 161 161 function openFullAdd(){ 162 162 // Build the FullAdd Window. 163 if(!fullAddWin && !is_ie) 163 if(!fullAddWin && !is_ie) 164 164 __f(); 165 165 … … 168 168 fullAddWin.open(); 169 169 tabs._showTab('cc_contact_tab_0'); 170 Element("cc_conn_type_1").checked = false; 170 Element("cc_conn_type_1").checked = false; 171 171 Element("cc_conn_type_2").checked = false; 172 172 Element("cc_conn_type_sel").disabled = true; … … 189 189 function editGroup(id){ 190 190 populateEditGroup(id); 191 ccAddGroup.window.open(); 191 ccAddGroup.window.open(); 192 192 } 193 193 /* … … 199 199 { 200 200 CC_full_add_const = false; 201 201 202 202 setTimeout('populateFullAddConstAsync()', 10); 203 203 } … … 207 207 var handler = function(responseText) 208 208 { 209 //Element('cc_debug').innerHTML = responseText; 209 //Element('cc_debug').innerHTML = responseText; 210 210 var data = unserialize(responseText); 211 211 var i = 1; 212 212 var j; 213 213 214 214 if (typeof(data) != 'object') 215 215 { … … 217 217 return; 218 218 } 219 219 220 220 /* Populate Prefixes */ 221 221 for (j in data[0]) … … 224 224 i++; 225 225 } 226 226 227 227 /* Populate Suffixes */ 228 228 i = 1; … … 246 246 { 247 247 Element('cc_addr_countries').options[i] = new Option(data[3][j], j); 248 248 249 249 if (j == 'BR' || j == 'br') 250 250 { 251 251 CC_br_index = i; 252 252 } 253 253 254 254 i++; 255 255 } 256 256 257 257 /* Populate Connection Types */ 258 258 i = 1; … … 262 262 i++; 263 263 } 264 264 265 265 /* Populate Relations Types */ 266 266 i = 0; … … 270 270 i++; 271 271 } 272 272 273 273 CC_full_add_const = true; 274 274 … … 305 305 { 306 306 var handler = function(responseText) 307 { 308 var data = unserialize(responseText); 309 Element('group_id').value = data['id_group']; 310 311 if(data['contact_list']) { 312 for(i = 0; i < data['contact_list'].length; i++) { 313 option = document.createElement('option'); 314 option.value = data['contact_list'][i]['id_connection']; 315 option.text = data['contact_list'][i]['names_ordered']+' ('+data['contact_list'][i]['connection_value']+')'; 316 Element('contact_list').options[Element('contact_list').options.length] = option; 317 } 307 { 308 var data = unserialize(responseText); 309 Element('group_id').value = data['id_group']; 310 var options_contact_list = Element('contact_list'); 311 if(data['contact_list']) { 312 options_contact_list.innerHTML = data['contact_list']; 318 313 } 319 314 320 315 if(data['id_group']) { 321 322 if(data['contact_in_list']) { 323 for(i = 0; i < data['contact_in_list'].length; i++) { 316 317 if(data['contact_in_list']) { 318 for(i = 0; i < data['contact_in_list'].length; i++) { 324 319 option = document.createElement('option'); 325 320 option.value = data['contact_in_list'][i]['id_connection']; 326 option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')'; 321 option.text = data['contact_in_list'][i]['names_ordered']+' ('+data['contact_in_list'][i]['connection_value']+')'; 327 322 Element('contact_in_list').options[Element('contact_in_list').options.length] = option; 328 323 } 329 } 330 324 } 325 331 326 Element('title').value = data['title']; 332 327 } 333 328 334 329 if (typeof(data) != 'object' || data['result'] != 'ok') 335 330 { … … 338 333 } 339 334 }; 340 335 341 336 id = typeof(id) == 'undefined' ? id = 0 : id; 342 343 ccAddGroup.clear(true); 337 338 ccAddGroup.clear(true); 344 339 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 345 340 } … … 376 371 return false; 377 372 } 378 373 379 374 /* First thing: Send Photo */ 380 375 if (Element('cc_pd_select_photo').value != '' && !is_ie) … … 394 389 frame = old_frame; 395 390 } 396 391 397 392 frame.id = 'cc_photo_frame'; 398 393 frame.style.visibility = 'hidden'; … … 403 398 404 399 form = frame.contentDocument.createElement('form'); 405 400 406 401 var id_contact = Element('cc_full_add_contact_id').value; 407 402 form.id = 'cc_form_photo'; … … 409 404 form.enctype = 'multipart/form-data'; 410 405 form.action = 'http://'+ document.domain + Element('cc_root_dir').value+'../index.php?menuaction=contactcenter.ui_data.data_manager&method=post_photo&id='+(id_contact != '' && id_contact != 'null' ? id_contact : ''); 411 406 412 407 var input_clone = Element('cc_pd_select_photo').cloneNode(false); 413 408 form.appendChild(input_clone); 414 409 415 410 frame.contentDocument.body.appendChild(form); 416 411 form.submit(); … … 466 461 var empty = true; 467 462 var replacer = '__##AND##__'; 468 463 469 464 data['commercialAnd'] = replacer; 470 465 471 466 if (Element('cc_full_add_contact_id').value != '' && Element('cc_full_add_contact_id').value != 'null') 472 467 { … … 477 472 /* Status: Full Added */ 478 473 data['id_status'] = CC_STATUS_FULL_ADD; 479 474 480 475 /* Personal Data */ 481 476 data['alias'] = replaceComAnd(Element('cc_pd_alias').value, replacer); … … 515 510 data['connections'] = new Array(); 516 511 } 517 512 518 513 for (var i in CC_contact_full_info['connections'][type]) 519 514 { … … 527 522 data['connections']['connection'+connNumber] = new Array(5); 528 523 } 529 524 530 525 data['connections']['connection'+connNumber]['id_connection'] = CC_contact_full_info['connections'][type][i]['id']; 531 526 data['connections']['connection'+connNumber]['id_typeof_connection'] = type; … … 536 531 data['connections']['connection'+connNumber]['connection_is_default'] = 'TRUE'; 537 532 } 538 else 533 else 539 534 data['connections']['connection'+connNumber]['connection_is_default'] = 'FALSE'; 540 535 } 541 536 542 537 // data['connections']['connection'+connNumber].length = 5; 543 538 544 539 empty = false; 545 540 connNumber++; … … 548 543 549 544 } 550 545 551 546 if (!empty) 552 547 { … … 555 550 } 556 551 } 557 552 558 553 if (CC_contact_full_info['removed_conns']) 559 554 { 560 555 empty = false; 561 556 562 557 if (typeof(data['connections']) != 'object') 563 558 { … … 594 589 for (var i in CC_contact_full_info['connections'][type]){ 595 590 if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 596 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 597 showMessage('Endere ï¿œo para conexï¿œo de ' + CC_contact_full_info['connections'][type][i]['name'] + ', nï¿œo ï¿œ vï¿œlido');591 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 592 showMessage('Endereço para conexão de ' + CC_contact_full_info['connections'][type][i]['name'] + ', não é válido'); 598 593 return false; 599 594 } … … 601 596 var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); 602 597 if(_options_default.value == '-1') { 603 alert(" ï¿œ necessï¿œrio escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrï¿œo!");598 alert("É necessário escolher um "+ (type == 1 ? 'E-mail' : 'Telefone')+" como padrão!"); 604 599 return false; 605 600 } 606 601 } 607 602 608 603 } 609 604 … … 614 609 615 610 /********* Personal Data Functions *********/ 616 /* 611 /* 617 612 * data[0] => cc_pd_select_photo 618 613 * data[1] => cc_pd_alias … … 662 657 { 663 658 Element('cc_addr_types').selectedIndex = 0; 664 659 665 660 Element('cc_addr_countries').selectedIndex = 0; 666 661 Element('cc_addr_countries').disabled = true; 667 662 668 663 Element('cc_addr_states').selectedIndex = 0; 669 664 Element('cc_addr_states').disabled = true; … … 716 711 var type = Element('cc_addr_types'); 717 712 var oldSelected = type.value; 718 713 719 714 saveAddressFields(); 720 715 721 716 if (oldSelected == '_NONE_') 722 717 { … … 724 719 return true; 725 720 } 726 721 727 722 CC_addr_last_selected = type.selectedIndex; 728 723 729 724 Element('cc_addr_countries').disabled = false; 730 725 731 726 var data = CC_contact_full_info['addresses']; 732 727 var addrIndex = 'address'+Element('cc_addr_types').value; 733 734 if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 728 729 if (typeof(data) != 'object' || typeof(data[addrIndex]) != 'object') 735 730 { 736 731 resetAddressFields(); … … 741 736 return true; 742 737 } 743 738 744 739 var addrTypeID = Element('cc_addr_types').value; 745 740 746 741 data = CC_contact_full_info['addresses'][addrIndex]; 747 742 748 743 Element('cc_addr_id').value = data['id_address'] ? data['id_address'] : ''; 749 744 Element('cc_addr_1').value = data['address1'] ? data['address1'] : ''; … … 767 762 states.selectedIndex = 0; 768 763 clearSelectBox(states, 4); 769 updateAddrCities(); 764 updateAddrCities(); 770 765 return; 771 766 } … … 782 777 { 783 778 var data = unserialize(responseText); 784 779 785 780 clearSelectBox(states, 1); 786 781 787 782 if (typeof(data) != 'object') 788 783 { 789 784 showMessage(Element('cc_msg_err_contacting_server').value); 790 785 791 786 return; 792 787 } … … 795 790 { 796 791 states.disabled = true; 797 cities.disabled = true; 792 cities.disabled = true; 798 793 states.selectedIndex = 0; 799 794 cities.selectedIndex = 0; … … 835 830 } 836 831 }; 837 832 838 833 Connector.newRequest('populateStates', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_states&country='+Element('cc_addr_countries').value, 'GET', handler); 839 834 } … … 863 858 newState.disabled = false; 864 859 updateAddrNewStateOnMouseOut(); 865 860 866 861 cities.disabled = false; 867 862 clearSelectBox(cities, 3); … … 874 869 case '_NOSTATE_': 875 870 clearSelectBox(cities, 3); 876 871 877 872 cities.disabled = false; 878 873 cities.selectedIndex = 0; 879 874 880 875 requestStr = 'country='+Element('cc_addr_countries').value; 881 876 break; 882 877 883 878 default: 884 879 requestStr = 'country='+Element('cc_addr_countries').value+'&state='+states.value; … … 895 890 { 896 891 var cities = Element('cc_addr_cities'); 897 892 898 893 var handler = function (responseText) 899 894 { 900 895 var data = unserialize(responseText); 901 896 902 897 clearSelectBox(cities, 1); 903 898 904 899 if (typeof(data) != 'object') 905 900 { 906 901 showMessage(Element('cc_msg_err_contacting_server').value); 907 902 908 903 return; 909 904 } … … 950 945 } 951 946 }; 952 947 953 948 Connector.newRequest('populateCities', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cities&'+requestStr, 'GET', handler); 954 949 } … … 956 951 function updateAddrNewStateOnMouseOver () 957 952 { 958 if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 953 if (Element('cc_addr_states_new').value == Element('cc_msg_type_state').value && Element('cc_addr_states').selectedIndex == 1) 959 954 { 960 955 Element('cc_addr_states_new').value = ''; … … 964 959 function updateAddrNewStateOnMouseOut () 965 960 { 966 if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 961 if (Element('cc_addr_states_new').value.length == 0 && Element('cc_addr_states').selectedIndex == 1) 967 962 { 968 963 Element('cc_addr_states_new').value = Element('cc_msg_type_state').value; … … 984 979 return; 985 980 } 986 981 987 982 Element('cc_addr_1').readonly = false; 988 983 Element('cc_addr_1').disabled = false; … … 1014 1009 1015 1010 //resetAddrFillingFields(); 1016 1011 1017 1012 return; 1018 1013 … … 1022 1017 newCity.disabled = false; 1023 1018 updateAddrNewCityOnMouseOut(); 1024 1019 1025 1020 break; 1026 1021 … … 1036 1031 function updateAddrNewCityOnMouseOver () 1037 1032 { 1038 if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 1033 if (Element('cc_addr_cities_new').value == Element('cc_msg_type_city').value && Element('cc_addr_cities').selectedIndex == 1) 1039 1034 { 1040 1035 Element('cc_addr_cities_new').value = ''; … … 1044 1039 function updateAddrNewCityOnMouseOut () 1045 1040 { 1046 if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 1041 if (Element('cc_addr_cities_new').value.length == 0 && Element('cc_addr_cities').selectedIndex == 1) 1047 1042 { 1048 1043 Element('cc_addr_cities_new').value = Element('cc_msg_type_city').value; … … 1058 1053 return true; 1059 1054 } 1060 1061 var addrFields = new Array('cc_addr_1', 1062 'cc_addr_2', 1063 'cc_addr_complement', 1055 1056 var addrFields = new Array('cc_addr_1', 1057 'cc_addr_2', 1058 'cc_addr_complement', 1064 1059 'cc_addr_other', 1065 'cc_addr_postal_code', 1060 'cc_addr_postal_code', 1066 1061 'cc_addr_po_box', 1067 1062 'cc_addr_countries', … … 1070 1065 1071 1066 var empty = true; 1072 1067 1073 1068 for (var i = 0; i < 8; i++) 1074 1069 { … … 1079 1074 } 1080 1075 } 1081 1076 1082 1077 if (empty) 1083 1078 { … … 1108 1103 default: 1109 1104 addrInfo['id_country'] = Element('cc_addr_countries').value; 1110 1105 1111 1106 } 1112 1107 … … 1122 1117 default: 1123 1118 addrInfo['id_state'] = Element('cc_addr_states').value; 1124 1119 1125 1120 } 1126 1121 … … 1135 1130 default: 1136 1131 addrInfo['id_city'] = Element('cc_addr_cities').value; 1137 1138 } 1132 1133 } 1139 1134 1140 1135 addrInfo['id_typeof_address'] = Element('cc_addr_types').options[lastIndex].value; … … 1149 1144 CC_contact_full_info['addresses']['address'+Element('cc_addr_types').options[lastIndex].value] = addrInfo; 1150 1145 1151 if (Element('cc_addr_cities').value == '_NEW_' && 1146 if (Element('cc_addr_cities').value == '_NEW_' && 1152 1147 Element('cc_msg_type_city').value != Element('cc_addr_cities_new').value && 1153 1148 Element('cc_addr_cities_new').value != '') 1154 1149 { 1155 1150 var addrRootInfo = CC_contact_full_info['addresses']['new_cities']; 1156 1151 1157 1152 if (!addrRootInfo) 1158 1153 { 1159 1154 addrRootInfo = new Array(); 1160 1155 } 1161 1156 1162 1157 var i = addrRootInfo.length; 1163 1158 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1168 1163 } 1169 1164 1170 if (Element('cc_addr_states').value == '_NEW_' && 1171 Element('cc_msg_type_state').value != Element('cc_addr_states_new').value && 1165 if (Element('cc_addr_states').value == '_NEW_' && 1166 Element('cc_msg_type_state').value != Element('cc_addr_states_new').value && 1172 1167 Element('cc_addr_states_new').value != '') 1173 1168 { 1174 1169 var addrRootInfo = CC_contact_full_info['addresses']['new_states']; 1175 1170 1176 1171 if (!addrRootInfo) 1177 1172 { 1178 1173 addrRootInfo = new Array(); 1179 1174 } 1180 1175 1181 1176 var i = addrRootInfo.length; 1182 1177 addrRootInfo[addrInfo['id_typeof_address']] = new Array(); … … 1208 1203 for(idx_conn; idx_conn < cc_conn_default.options.length; idx_conn++) 1209 1204 if(cc_conn_default.options[idx_conn].value == _label) 1210 break; 1211 1205 break; 1206 1212 1207 if(idx_conn == cc_conn_default.options.length) 1213 1208 cc_conn_default.options[idx_conn] = new Option (_label,_label, false,false); 1214 1209 1215 1210 if (!document.all) 1216 1211 { 1217 if (Element("cc_conn_type_1").checked) 1218 { 1219 return '<td style="position: absolute; left: 0; top: 0; z-index: -1; visibility: hidden"><input id="cc_conn_id_' + CC_conn_count + '" type="hidden" value="_NEW_"><input id="cc_conn_is_default_' + CC_conn_count + '" type="hidden" value="false"></td>'+ 1220 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1221 '<td style="width: 10px;" align="right"><input id="cc_conn_name_'+CC_conn_count+'" type="hidden"><td style="width: 100px;" align="right"><span style="width: 150px;" id="cc_conn_label_'+CC_conn_count+'">'+_label+'</span></td>' + 1222 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="100" type="text"> ' + 1223 '<img align="top" alt="X" src="templates/default/images/x.png" style="width:18px; height:18px" onclick="javascript:removeConnField(\'cc_conn_tr_' + CC_conn_count + '\')"></td>'; 1224 } 1225 else if (Element("cc_conn_type_2").checked) 1226 { 1227 return '<td style="position: absolute; left: 0; top: 0; z-index: -1; visibility: hidden"><input id="cc_conn_id_' + CC_conn_count + '" type="hidden" value="_NEW_"><input id="cc_conn_is_default_' + CC_conn_count + '" type="hidden" value="false"></td>'+ 1228 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1229 '<td style="width: 10px;" align="right"><input id="cc_conn_name_'+CC_conn_count+'" type="hidden"><td style="width: 100px;" align="right"><span style="width: 150px;" id="cc_conn_label_'+CC_conn_count+'">'+_label+'</span></td>' + 1230 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="50" type="text"> ' + 1231 '<img align="top" alt="X" src="templates/default/images/x.png" style="width:18px; height:18px" onclick="javascript:removeConnField(\'cc_conn_tr_' + CC_conn_count + '\')"></td>'; 1232 } 1212 return '<td style="position: absolute; left: 0; top: 0; z-index: -1; visibility: hidden"><input id="cc_conn_id_' + CC_conn_count + '" type="hidden" value="_NEW_"><input id="cc_conn_is_default_' + CC_conn_count + '" type="hidden" value="false"></td>'+ 1213 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1214 '<td style="width: 10px;" align="right"><input id="cc_conn_name_'+CC_conn_count+'" type="hidden"><td style="width: 100px;" align="right"><span style="width: 150px;" id="cc_conn_label_'+CC_conn_count+'">'+_label+'</span></td>' + 1215 '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" type="text"> ' + 1216 '<img align="top" alt="X" src="templates/default/images/x.png" style="width:18px; height:18px" onclick="javascript:removeConnField(\'cc_conn_tr_' + CC_conn_count + '\')"></td>'; 1233 1217 } 1234 1218 else … … 1254 1238 img.align = 'top'; 1255 1239 img.onclick = function(e){ removeConnField(remove_id);}; 1256 1240 1257 1241 for (var i = 0; i < 3; i++) 1258 1242 { … … 1265 1249 1266 1250 inputs[1].id = 'cc_conn_name_'+CC_conn_count; 1267 inputs[1].type = 'hidden'; 1251 inputs[1].type = 'hidden'; 1268 1252 1269 1253 inputs[2].id = 'cc_conn_value_'+CC_conn_count; … … 1294 1278 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected]) == 'undefined' 1295 1279 || typeof(CC_contact_full_info['connections'][CC_conn_last_selected][CC_conn_count]) == 'undefined'); 1296 1297 if(_emptyLine) { 1298 1280 1281 if(_emptyLine) { 1282 1299 1283 if(Element("cc_conn_type_sel").value == '-1'){ 1300 return false; 1301 } 1302 1284 return false; 1285 } 1286 1303 1287 for(k = 0; k < CC_conn_count; k++) { 1304 1288 if(Element("cc_conn_name_"+k) && Element("cc_conn_name_"+k).value != "" && Element("cc_conn_name_"+k).value == Element("cc_conn_type_sel").value) { 1305 alert('Voc ï¿œ jï¿œpossui uma entrada para o tipo "'+Element("cc_conn_type_sel").value+'"!');1306 Element("cc_conn_type_sel").options.selectedIndex = 0; 1289 alert('Você já possui uma entrada para o tipo "'+Element("cc_conn_type_sel").value+'"!'); 1290 Element("cc_conn_type_sel").options.selectedIndex = 0; 1307 1291 return false; 1308 1292 } 1309 1293 } 1310 } 1294 } 1311 1295 if (!document.all) 1312 1296 { … … 1335 1319 1336 1320 function connRemoveLine(id) 1337 { 1321 { 1338 1322 var p = Element(id).parentNode; 1339 1323 var cc_conn_default = Element("cc_phone_default").style.display == '' ? Element("cc_phone_default") : Element("cc_email_default"); … … 1374 1358 } 1375 1359 } 1376 1360 1377 1361 CC_conn_count = 0; 1378 1362 } … … 1396 1380 function updateConnFields() 1397 1381 { 1398 1382 1399 1383 var connID; 1400 1384 var i; … … 1405 1389 var cc_conn_is_default = ''; 1406 1390 var selected_index = ''; 1407 1391 1408 1392 cc_conn_type_sel.disabled = false; 1409 1393 div_cc_conn_is_default.style.display = ""; 1410 1394 1411 1395 for(var i = 0;i < cc_conn_type_sel.options.length; i++) 1412 cc_conn_type_sel.options[i--] = null; 1413 1396 cc_conn_type_sel.options[i--] = null; 1397 1414 1398 if(Element('cc_conn_type_1').checked) { 1415 cc_conn_type_sel[0] = new Option('Novo Email...','-1'); 1416 cc_conn_type_sel[1] = new Option('Principal','Principal'); 1417 cc_conn_type_sel[2] = new Option('Alternativo','Alternativo'); 1399 var lang_new_email = Element('cc_msg_new_email').value; 1400 var lang_main = Element('cc_msg_main').value; 1401 var lang_alternative = Element('cc_msg_alternative').value; 1402 cc_conn_type_sel[0] = new Option(lang_new_email,'-1'); 1403 cc_conn_type_sel[1] = new Option(lang_main,lang_main); 1404 cc_conn_type_sel[2] = new Option(lang_alternative,lang_alternative); 1418 1405 connID = 1; 1419 1406 selected_index = cc_email_default.options.selectedIndex; … … 1422 1409 } 1423 1410 1424 cc_email_default.options[0] = new Option('Selecionar Email...','-1');1425 1411 var lang_select_email = Element('cc_msg_select_email').value; 1412 cc_email_default.options[0] = new Option(lang_select_email,'-1'); 1426 1413 cc_phone_default.style.display = 'none'; 1427 cc_email_default.style.display = ''; 1414 cc_email_default.style.display = ''; 1428 1415 cc_conn_is_default = cc_email_default; 1429 1416 } 1430 1417 else if(Element('cc_conn_type_2').checked) { 1431 cc_conn_type_sel[0] = new Option('Novo Telefone...','-1'); 1432 cc_conn_type_sel[1] = new Option('Residencial','Residencial'); 1433 cc_conn_type_sel[2] = new Option('Celular','Celular'); 1434 cc_conn_type_sel[3] = new Option('Comercial','Comercial'); 1435 cc_conn_type_sel[4] = new Option('Fax','Fax'); 1436 cc_conn_type_sel[5] = new Option('Pager','Pager'); 1418 var lang_new_telephone = Element('cc_msg_new_phone').value; 1419 var lang_home = Element('cc_msg_home').value; 1420 var lang_cellphone = Element('cc_msg_cellphone').value; 1421 var lang_work = Element('cc_msg_work').value; 1422 var lang_fax = Element('cc_msg_fax').value; 1423 var lang_pager = Element('cc_msg_pager').value; 1424 cc_conn_type_sel[0] = new Option(lang_new_telephone,'-1'); 1425 cc_conn_type_sel[1] = new Option(lang_home,lang_home); 1426 cc_conn_type_sel[2] = new Option(lang_cellphone,lang_cellphone); 1427 cc_conn_type_sel[3] = new Option(lang_work,lang_work); 1428 cc_conn_type_sel[4] = new Option(lang_fax,lang_fax); 1429 cc_conn_type_sel[5] = new Option(lang_pager,lang_pager); 1430 1437 1431 connID = 2; 1438 1432 selected_index = cc_phone_default.options.selectedIndex; … … 1441 1435 } 1442 1436 1443 cc_phone_default.options[0] = new Option('Selecionar Telefone...','-1'); 1437 var lang_choose_phone = Element('cc_msg_choose_phone').value; 1438 cc_phone_default.options[0] = new Option(lang_choose_phone,'-1'); 1444 1439 cc_email_default.style.display = 'none'; 1445 1440 cc_phone_default.style.display = ''; 1446 1441 cc_conn_is_default = cc_phone_default; 1447 1442 } 1448 1443 1449 1444 Element("cc_conn_type_sel").options.selectedIndex = 0; 1450 1445 /* First save the data */ … … 1452 1447 1453 1448 CC_conn_last_selected = connID; 1454 1449 1455 1450 clearConn(); 1456 1451 1457 1452 if (connID == '_NONE_') 1458 1453 { cc_conn_is_default.disabled = true; 1459 1454 return; 1460 1455 } 1461 1456 1462 1457 /* If no data already available, return */ 1463 1458 if (!CC_contact_full_info['connections']) … … 1483 1478 } 1484 1479 } 1485 } 1480 } 1486 1481 if(cc_conn_is_default.options.length > selected_index) 1487 1482 cc_conn_is_default.options.selectedIndex = (selected_index == "-1" ? 0 : selected_index); … … 1504 1499 CC_contact_full_info['connections'][CC_conn_last_selected] = new Array(); 1505 1500 } 1506 else 1501 else 1507 1502 { 1508 1503 delete CC_contact_full_info['connections'][CC_conn_last_selected]; … … 1516 1511 var subNodes = nodes[i].childNodes; 1517 1512 var found = false; 1518 1513 1519 1514 for (var j = 0; j < subNodes.length; j++) 1520 1515 { 1521 if (subNodes[j].childNodes.length > 0 && 1516 if (subNodes[j].childNodes.length > 0 && 1522 1517 subNodes[j].childNodes[0].id) 1523 1518 { … … 1527 1522 CC_contact_full_info['connections'][CC_conn_last_selected][k] = new Array(); 1528 1523 } 1529 1524 1530 1525 if (subNodes[j].childNodes[0].id.indexOf('cc_conn_name') != -1) 1531 1526 { … … 1547 1542 else 1548 1543 { 1549 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1544 CC_contact_full_info['connections'][CC_conn_last_selected][k]['value'] = ''; 1550 1545 } 1551 1546 } … … 1558 1553 } 1559 1554 } 1560 1555 1561 1556 if (found) 1562 1557 { … … 1575 1570 delete CC_contact_full_info['connections'][CC_conn_last_selected]; 1576 1571 } 1577 1572 1578 1573 } 1579 1574 … … 1601 1596 var number = randomString().toLowerCase(); 1602 1597 var result = ''; 1603 1598 1604 1599 if(!is_ie) 1605 result = prompt("Essa opera ᅵᅵo removerï¿œ TODOS os seus \ncontatos pessoais, e Nï¿œO PODERï¿œ ser \ndesfeita. Digite o cï¿œdigo abaixo:\n\tCï¿œdigo de confirmaᅵᅵo: "+number);1600 result = prompt("Essa operação removerá TODOS os seus \ncontatos pessoais, e NÃO PODERÁ ser \ndesfeita. Digite o código abaixo:\n\tCódigo de confirmação: "+number); 1606 1601 else 1607 result = prompt("Essa opera ᅵᅵo removerï¿œ TODOS os seus contatos pessoais, e Nï¿œO PODERï¿œ ser desfeita. Digite o seguinte cï¿œdigo de confirmaᅵᅵo: "+number,"");1602 result = prompt("Essa operação removerá TODOS os seus contatos pessoais, e NÃO PODERÁ ser desfeita. Digite o seguinte código de confirmação: "+number,""); 1608 1603 1609 1604 if(result) { … … 1611 1606 Connector.newRequest('removeAllEntries', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_all_entries', 'GET', handler); 1612 1607 else 1613 alert('C ï¿œdigo Incorreto');1614 } 1608 alert('Código Incorreto'); 1609 } 1615 1610 } 1616 1611 … … 1623 1618 return; 1624 1619 } 1625 1620 1626 1621 var handler = function (responseText) 1627 1622 { … … 1633 1628 return; 1634 1629 } 1635 1630 1636 1631 if (data['status'] != 'ok') 1637 1632 { … … 1639 1634 return; 1640 1635 } 1641 1636 1642 1637 setTimeout('updateCards()',80);; 1643 1638 }; 1644 1639 1645 1640 typeArg = (type == 'groups' ? 'group' : 'entry'); 1646 1641 1647 1642 Connector.newRequest('removeEntry', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=remove_'+typeArg+'&remove=' + id, 'GET', handler); 1648 1643 } … … 1667 1662 var w_height = 0; 1668 1663 var w_extra = 200; 1669 1664 1670 1665 if (document.body.clientHeight) 1671 1666 { … … 1706 1701 } 1707 1702 } 1708 1709 1703 function getActualPage () 1710 1704 { … … 1771 1765 final_page = 1; 1772 1766 } 1773 1767 1774 1768 html_pages += '<a href="javascript:setPages('+npages+', '+ actual_page +', '+ final_page +')">...</a> '; 1775 1769 1776 1770 page = showing_page ? showing_page : actual_page; 1777 1771 } 1778 1772 1779 1773 for (; page <= npages; page++) 1780 1774 { … … 1836 1830 Element('cc_panel_arrow_last').style.cursor = 'hand'; 1837 1831 } 1838 1832 1839 1833 Element('cc_panel_pages').innerHTML = html_pages; 1840 1834 } … … 1842 1836 function populateCards(data, type) 1843 1837 { 1844 1838 if (data[3].length >= 100 ) 1839 { 1840 alert("Critério de pesquisa muito abrangente, achados " + data[3].length + " resultados"); 1841 for (i = 0; i < (Math.sqrt(data[3].length)-1); i++) 1842 for (j = 0; j < 3; j++) 1843 document.getElementById("cc_card:"+j+":"+i).innerHTML = ''; 1844 return false; 1845 } 1846 1845 1847 if(type == 'groups') 1846 1848 return populateGroupsInCards(data); 1847 1849 1848 1850 var pos = 0; 1849 1851 var ncards = data[3].length; 1850 1852 1851 1853 if (typeof(data[3]) == 'object' && ncards > 0) 1852 1854 { … … 1856 1858 { 1857 1859 id = 'cc_card:'+j+':'+i; 1858 1860 1859 1861 for (var k = 0; k < data[2].length; k++) 1860 1862 { 1861 1862 if(data[2][k] == 'cc_mail' && data[3][pos][k] == 'none' && !(ccTree.catalog_perms & 2) ) { 1863 if(!(ccTree.catalog_perms & 2)) 1864 { 1865 switch(data[2][k]) 1866 { 1867 case 'cc_mail' : 1868 1869 if(data[3][pos][k] === 'none') 1870 data[3][pos][k] = ' '; 1871 break; 1872 case 'cc_phone' : 1873 1874 if(data[3][pos][k] === 'none') 1875 data[3][pos][k] = ' '; 1876 break; 1877 } 1878 1879 } 1880 1881 1882 /*if(data[2][k] == 'cc_mail' && data[3][pos][k] == 'none' && !(ccTree.catalog_perms & 2) ) { 1863 1883 Element(id).style.display = 'none'; 1864 1884 continue; 1865 } 1866 1885 }*/ 1886 1867 1887 if(data[3][pos][k] != 'none') 1868 1888 { … … 1880 1900 } 1881 1901 break; 1882 1902 1883 1903 case 'cc_mail': 1904 1884 1905 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) 1885 1906 { … … 1889 1910 else 1890 1911 { 1891 Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 1912 Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 1892 1913 } 1893 1914 break; 1894 1915 1895 1916 case 'cc_phone': 1896 1917 if (data[3][pos][k].length > 20) … … 1923 1944 Element(id+':cc_photo').src = '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo' + (data[4][pos] != 0 ? '&id='+data[3][pos][k] : ''); 1924 1945 if(ccTree.catalog_perms == 1) 1925 Element(id+':cc_icon_data').innerHTML = '<span title=" Copiar para o Catï¿œlogo Pessoal" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccQuickAddContact.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/address-conduit-16.png" align="center"></span>';1946 Element(id+':cc_icon_data').innerHTML = '<span title="'+Element('cc_msg_copy_to_catalog').value+'" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccQuickAddContact.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/address-conduit-16.png" align="center"></span>'; 1926 1947 break; 1927 1948 1928 1949 case 'cc_forwarding_address': 1929 1950 var contacts = data[3][pos][k]; 1930 1951 1931 1952 if( !contacts) 1932 1953 break; 1933 1954 1934 1955 Element(id+':cc_icon_group').innerHTML = '<span title="'+Element('cc_participants').value+'" onmouseout="window.status=\'\';" onclick="ccListParticipants.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/people-mini.png" align="center"> </span>'; 1935 break;1936 1937 case 'cc_empNumber':1938 if (data[3][pos][k].length > 20)1939 {1940 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20);1941 Element(id+':'+data[2][k]).title = data[3][pos][k];1942 }1943 else1944 {1945 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20);1946 }1947 Element(id+':cc_empNumber').innerHTML = data[3][pos][k];1948 break;1949 1950 //Para tratar tamanho do campo "departamento" do empregado1951 case 'cc_department':1952 if (data[3][pos][k].length > 15)1953 {1954 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15);1955 Element(id+':'+data[2][k]).title = data[3][pos][k];1956 }1957 else1958 {1959 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15);1960 }1961 Element(id+':cc_department').innerHTML = data[3][pos][k];1962 1956 break; 1963 1957 … … 1970 1964 else 1971 1965 { 1972 if (Element(id+':'+data[2][k]) == null) alert('ï¿œ nulovgdfv');1973 1966 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 1974 1967 } … … 1976 1969 } 1977 1970 } 1978 1971 1979 1972 if (--ncards == 0) 1980 1973 { … … 1982 1975 i = CC_max_cards[1]; 1983 1976 } 1984 1977 1985 1978 pos++; 1986 1979 } … … 1990 1983 1991 1984 function populateGroupsInCards(data) 1992 { 1985 { 1993 1986 var pos = 0; 1994 var contacts = data[5]; 1987 var contacts = data[5]; 1995 1988 var ncards = data[3].length; 1996 1989 1997 1990 if (typeof(data[3]) == 'object' && ncards > 0) 1998 1991 { … … 2002 1995 { 2003 1996 id = 'cc_card:'+j+':'+i; 2004 1997 2005 1998 for (var k = 0; k < data[2].length; k++) 2006 1999 { 2007 2000 2008 2001 if(data[3][pos][k] != 'none') 2009 { 2010 2002 { 2003 2011 2004 switch (data[2][k]) 2012 { 2005 { 2013 2006 case 'cc_title': 2014 2007 if (data[3][pos][k].length > 50) … … 2022 2015 } 2023 2016 break; 2024 2017 2025 2018 case 'cc_short_name': 2026 2019 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) … … 2034 2027 } 2035 2028 break; 2036 2029 2037 2030 case 'cc_contacts': 2038 2031 … … 2043 2036 var email = ""; 2044 2037 2045 for (var d = 0; d < contacts.length; d++) { 2038 for (var d = 0; d < contacts.length; d++) { 2046 2039 contact += contacts[d]['names_ordered']+ ","; 2047 2040 email += contacts[d]['connection_value']+","; 2048 2041 } 2049 2042 2050 2043 Element(id+':cc_participantes').innerHTML = '<span title="Ver Participantes" id="' + id + ':ccQuickAdd" onmouseout="window.status=\'\';" onclick="ccListParticipants.showList(\''+ Element(id+':cc_id').value+'value\', \''+contact+'\', \''+email+'\', \''+title+'\', \''+id_group+'\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img title="Ver participantes" align="center" src="templates/default/images/people-mini.png">  </span>'; 2051 2044 2052 2045 break; 2053 2046 2054 2047 case 'cc_id': 2055 2048 var id_contact = data[3][pos][k]; 2056 2049 Element(id+':'+data[2][k]).value = data[3][pos][k]; 2057 2050 2058 2051 break; 2059 2052 2060 2053 } 2061 2054 } 2062 2055 } 2063 2056 2064 2057 if (--ncards == 0) 2065 2058 { … … 2067 2060 i = CC_max_cards[1]; 2068 2061 } 2069 2062 2070 2063 pos++; 2071 2064 } … … 2096 2089 }; 2097 2090 2098 Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 2091 Connector.newRequest('setMaxCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=set_n_cards&ncards=' + ncards, 'GET'); 2099 2092 } 2100 2093 … … 2102 2095 { 2103 2096 var coord = new Array(); 2104 2097 2105 2098 //Element('cc_card_space').innerHTML = ''; 2106 2099 //return; … … 2109 2102 //card_space_width = parseInt(is_ie ? document.body.offsetWidth : window.innerWidth) - parseInt(Element('cc_left').offsetWidth) - parseInt(CC_card_extra) - 40; 2110 2103 card_space_height = parseInt(Element('cc_card_space').offsetHeight) - parseInt(CC_card_extra); 2111 2104 2112 2105 card_width = CC_card_image_width + CC_card_extra; 2113 2106 card_height = CC_card_image_height + CC_card_extra; … … 2115 2108 ncols = parseInt(card_space_width / card_width); 2116 2109 nlines = parseInt(card_space_height / card_height); 2117 2110 2118 2111 coord[0] = ncols; 2119 2112 //coord[1] = nlines; … … 2129 2122 { 2130 2123 if(type != 'groups') { 2131 2124 2132 2125 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2133 2126 '<div style="border: 0px solid #999; position: relative;">' + 2134 '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2127 '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2135 2128 ( ccTree.catalog_perms == 1 ? 2136 2129 '<span id="' + id + ':cc_icon_data" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1"></span>':'') + … … 2138 2131 '<img title="'+Element('cc_msg_card_edit').value+'" id="' + id + ':cc_card_edit" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1" onclick="editContact(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_edit\',0)" onmouseout="resizeIcon(\''+id+':cc_card_edit\',1)" src="templates/default/images/cc_card_edit.png">' + 2139 2132 '<img title="'+Element('cc_msg_card_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' : '') + 2140 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2133 '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2141 2134 '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 14px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' + 2142 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2143 //Para exibir a matricula do empregado nos cartoes 2144 '<span id="' + id + ':cc_empNumber" style="position: absolute; top: 15px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 2145 '<span id="' + id + ':cc_name" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 2146 '<span id="' + id + ':cc_title" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 2147 //Para exibir o setor/lotacao do empregado nos cartoes 2148 '<span id="' + id + ':cc_department" style="position: absolute; top: 70px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2149 '<span id="' + id + ':cc_phone" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2150 '<span id="' + id + ':cc_mail" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2151 '<span id="' + id + ':cc_alias" style="position: absolute; top: 95px; left: 10px; width: 60px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 2135 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2136 '<span id="' + id + ':cc_name" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 2137 '<span id="' + id + ':cc_title" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 2138 '<span id="' + id + ':cc_phone" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2139 '<span id="' + id + ':cc_mail" style="position: absolute; top: 105px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 2140 '<span id="' + id + ':cc_alias" style="position: absolute; top: 95px; left: 10px; width: 60px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 2152 2141 '<input id="' + id + ':cc_id" type="hidden">' + 2153 2142 '</div>' + '</td>'; 2154 2143 2155 2144 } else { 2156 2145 html_card = '<td id="' + id + '" style="width: ' + CC_card_image_width + 'px; height: ' + CC_card_image_height + '">' + 2157 '<div style="border: 0px solid #999; position: relative;">' + 2146 '<div style="border: 0px solid #999; position: relative;">' + 2158 2147 '<img src="templates/default/images/card.png" border="0" width="' + CC_card_image_width +'" height="' + CC_card_image_height + '"i ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 2159 2148 '<img title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style="position: absolute; top: 35px; left: 222px; width: 18px; height: 18px; cursor: pointer; cursor: hand; z-index: 1" onclick="editGroup(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_edit\',0)" onmouseout="resizeIcon(\''+id+':cc_card_edit\',1)" src="templates/default/images/cc_card_edit.png">' + 2160 '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' + 2149 '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' + 2161 2150 '<span id="' + id + ':cc_title" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 2162 2151 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 15px; left: 15px"></span>' + … … 2165 2154 '</div>' + '</td>'; 2166 2155 } 2167 2156 2168 2157 2169 2158 return html_card; … … 2177 2166 else 2178 2167 bg = "this.style.background=\'#EEEEEE\'"; 2179 2168 2180 2169 if(type != 'groups') { 2181 2182 html_card = '<tr style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 2183 //Para exibir a matricula do empregado na tabela 2184 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' + 2185 '<td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;"><span valign="bottom" id="' + id + ':cc_icon_group"> </span><span id="' + id + ':cc_name"></span></td>' + 2170 2171 html_card = '<tr style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE"><td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;">' + 2172 '<span valign="bottom" id="' + id + ':cc_icon_group"> </span><span id="' + id + ':cc_name"></span></td>' + 2186 2173 '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 2187 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 2188 //Para exibir o setor/lotacao do empregado na tabela 2189 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_department"></span></td>' + 2190 // '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' + 2191 '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 2174 '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 2192 2175 ( ccTree.catalog_perms == 1 ? 2193 2176 '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') + … … 2201 2184 '<span id="' + id + ':cc_title" style="display:none"></span>' + 2202 2185 '<span id="' + id + ':cc_alias" style="display:none"></span>' + 2203 // Esse campo ï¿œ necessï¿œrio se o contato possui dados no campo cc_company2186 // Esse campo é necessário se o contato possui dados no campo cc_company 2204 2187 '<span id="' + id + ':cc_company" style="display:none"></span>' + 2205 2188 '</td></tr>'; … … 2214 2197 ' | '+ 2215 2198 '<img title="'+Element('cc_msg_group_remove').value+'" id="' + id + ':cc_card_remove" style="width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value,\'groups\');" src="templates/default/images/cc_x.png">' + 2216 '<input id="' + id + ':cc_id" type="hidden">'+ 2199 '<input id="' + id + ':cc_id" type="hidden">'+ 2217 2200 '</td></tr>'; 2218 2201 } … … 2224 2207 { 2225 2208 var pos; 2226 2209 2227 2210 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1"><table width="100%" border="0" cellpadding="0" cellspacing="3">'; 2228 2211 2229 2212 if (ncards > 0) 2230 2213 { … … 2246 2229 if((ccTree.catalog_perms & 2) && type != 'groups') 2247 2230 html_cards += '<tr><td colspan=4 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 2248 } 2231 } 2249 2232 else if (CC_max_cards != 0) 2250 2233 { … … 2266 2249 html_cards = '<div id="divScrollMain" style="overflow:auto;z-index:1">'; 2267 2250 html_cards += '<table border="0" cellpadding="0" cellspacing="' + CC_card_extra + '">'; 2268 2251 2269 2252 if (ncards > 0) 2270 2253 { … … 2285 2268 if((ccTree.catalog_perms & 2) && type != 'groups') 2286 2269 html_cards += '<tr><td colspan=3 align="right"><button id="cc_button_tools" value="" type="button" onclick="javascript:removeAllEntries()">Remover Todos</button></td></tr>'; 2287 } 2270 } 2288 2271 else if (CC_max_cards != 0) 2289 2272 { … … 2322 2305 else if(CC_visual == 'table') 2323 2306 drawTable(0); 2324 2307 2325 2308 setPages(0,0); 2326 2309 return; … … 2332 2315 data = unserialize(responseText); 2333 2316 if (data[0] == '0') 2334 { 2335 Element('cc_type_contact').value = data[1]; 2317 { 2318 Element('cc_type_contact').value = data[1]; 2336 2319 CC_npages = 0; 2337 2320 CC_actual_page = 1; … … 2345 2328 else 2346 2329 Element('cc_type_contact').value = data[10]; 2347 2348 // Element('cc_debug').innerHTML = responseText; 2349 2330 2331 // Element('cc_debug').innerHTML = responseText; 2332 2350 2333 if (typeof(data) != 'object') 2351 2334 { … … 2353 2336 return; 2354 2337 } 2355 2338 2356 2339 if (typeof(data[3]) == 'object') 2357 2340 { 2358 2341 CC_npages = parseInt(data[0]); 2359 CC_actual_page = parseInt(data[1]); 2342 CC_actual_page = parseInt(data[1]); 2360 2343 if(CC_visual == 'cards') 2361 2344 drawCards(data[3].length, data[10]); … … 2365 2348 populateCards(data, data[10]); 2366 2349 setPages(data[0], data[1]); 2367 2368 } 2369 else if (data['error']) 2370 { 2371 showMessage(data['error']); 2350 2372 2351 } 2373 2352 else … … 2381 2360 Connector.newRequest('showCards', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_cards_data', 'POST', handler, info); 2382 2361 } 2383 2384 2362 2385 2363 function clearCards() … … 2406 2384 var table_h = Element('cc_panel_table'); 2407 2385 var cards_h = Element('cc_panel_cards'); 2408 2386 2409 2387 switch (type) 2410 2388 { … … 2419 2397 break; 2420 2398 } 2421 2399 2422 2400 CC_visual = type; 2423 2401 showCards(getActualLetter(), getActualPage()); 2424 2402 } 2425 2403 2426 /*function ccSearchUpdate(ids)2404 function ccSearchUpdate(ids) 2427 2405 { 2428 2406 Element('cc_panel_letters').style.display = 'none'; 2429 2407 Element('cc_panel_search').style.display = 'inline'; 2430 2408 2431 2409 if(CC_visual == 'cards') 2432 2410 drawCards(0); … … 2436 2414 if (!ids) 2437 2415 { 2438 //ccSearchHide();2416 ccSearchHide(); 2439 2417 return; 2440 2418 } 2441 2419 2442 2420 var sIds = serialize(ids); 2443 2421 … … 2447 2425 } 2448 2426 showCards('search', '1', sIds); 2449 }2450 */2451 2452 function ccSearchUpdate()2453 {2454 Element('cc_panel_letters').style.display = 'none';2455 Element('cc_panel_search').style.display = 'inline';2456 2457 if(CC_visual == 'cards')2458 drawCards(0);2459 else if(CC_visual == 'table')2460 drawTable(0);2461 2462 if (CC_actual_letter != 'search')2463 {2464 CC_last_letter = CC_actual_letter;2465 }2466 //showCards('search', '1', sIds);2467 2427 } 2468 2428 … … 2507 2467 data[3] = Element('cc_qa_phone').value; 2508 2468 data[4] = Element('cc_qa_email').value; 2509 2469 2510 2470 return data; 2511 2471 } … … 2514 2474 { 2515 2475 var data = getQuickAdd(); 2516 2476 2517 2477 var str = serialize(data); 2518 2478 … … 2532 2492 } 2533 2493 2534 2535 2494 function connectVoip (phoneUser, typePhone){ 2536 2495 var handler_voip = function (responseText){ -
trunk/contactcenter/js/ccAddGroup.js
r284 r285 158 158 159 159 if(!this.title.value) { 160 alert( 'Preencha o campo obrigatório "Nome Completo"');160 alert(Element('cc_msg_fill_field_name').value); 161 161 this.title.focus(); 162 162 return false; … … 164 164 165 165 if(! contacts.length) { 166 alert( 'Você não adicionou nenhum contato para esse grupo');166 alert(Element('cc_msg_add_contact_to_group').value); 167 167 return false; 168 168 } -
trunk/contactcenter/js/ccIEContacts.js
r284 r285 3 3 this.el; 4 4 this.wWidth = 395; 5 this.wHeight = 2 40;5 this.wHeight = 255; 6 6 } 7 7 … … 16 16 } 17 17 } 18 19 cIEContacts.prototype.showFailures = function(data){ 20 if (data == 'undefined') 21 return; 22 if (data){ 23 var lang_clean = Element('cc_msg_clean').value; 24 var info_box = document.getElementById('s_info2'); 25 info_box.innerHTML = data; 26 info_box.style.visibility = ''; 27 var cleanButton = document.createElement('input'); 28 cleanButton.type='button'; 29 cleanButton.value=lang_clean; 30 cleanButton.onclick= function() { ccIEContacts.cleanInfo() }; 31 info_box.appendChild(cleanButton); 32 } 33 } 34 35 cIEContacts.prototype.cleanInfo = function(){ 36 var info_box = document.getElementById('s_info2'); 37 info_box.innerHTML = ''; 38 } 18 39 19 40 cIEContacts.prototype.showList = function(){ … … 37 58 this.el.id = 'cc_rectIEContacts'; 38 59 document.body.appendChild(this.el); 60 61 var lang_import_contacts = Element('cc_msg_import_contacts').value; 62 var lang_close_win = Element('cc_msg_close_win').value 63 var lang_export_contacts = Element('cc_msg_export_contacts').value; 64 var lang_expresso_info_csv = Element('cc_msg_expresso_info_csv').value; 65 var lang_expresso_default = Element('cc_msg_expresso_default').value; 66 var lang_choose_contacts_file = Element('cc_msg_choose_contacts_file').value; 67 var lang_msg_choose_type = Element('cc_msg_choose_file_type').value; 68 var lang_msg_expresso_info_csv = Element('cc_msg_expresso_info_csv').value; 69 var lang_msg_export_csv = Element('cc_msg_export_csv').value; 70 var lang_msg_automatic = Element('cc_msg_automatic').value; 71 var lang_close = Element('cc_msg_close').value; 72 var lang_moz_tb = Element('cc_msg_moz_thunderbird').value; 73 var lang_outl_pt = Element('cc_msg_outlook_express_pt').value; 74 var lang_outl_en = Element('cc_msg_outlook_express_en').value; 75 var lang_outl2k_pt = Element('cc_msg_outlook_2k_pt').value; 76 var lang_outl2k_en = Element('cc_msg_outlook_2k_en').value; 77 var lang_expresso_default_csv = Element('cc_msg_expresso_default_csv').value; 78 79 39 80 this.el.innerHTML = 40 81 '<div align="left" id="divAppbox"><table width="100%" border=0>'+ 41 '<tr><td style="border-bottom:1px solid black"><input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" value="i" style="border:0" checked> Importar Contatos'+42 ' <input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/> Exportar Contatos<br></td></tr>'+82 '<tr><td style="border-bottom:1px solid black"><input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" value="i" style="border:0" checked>'+lang_import_contacts+ 83 ' <input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/>'+lang_export_contacts+' <br></td></tr>'+ 43 84 '</table>'+ 44 85 '<table border=0 height="208px" width="100%" id="import_span">'+ 45 86 '<tr><td>'+ 46 '<font color="DARKBLUE" size="2"> O Expresso suporta a importação de contatos no formato de arquivo CSV.</font></td></tr>'+87 '<font color="DARKBLUE" size="2">'+lang_expresso_info_csv+'</font></td></tr>'+ 47 88 '<tr><td height="75px" valign="top">'+ 48 '<form name="formCSV" method="POST" enctype="multipart/form-data">'+ 49 ' Selecione o tipo do arquivo: <select id="typeImport">'+50 '<option value="outlook"> Outlook Express</option>'+51 '<option value="outlook2000"> Outlook 2000</option>'+52 '<option value="thunderbird"> Mozilla Thunderbird</option>'+53 '<option value="expresso" selected> Expresso (padrão)</option></select><br>'+54 '<br> Selecione o arquivo que contém os contatos a serem importados:<br><br>'+89 '<form name="formCSV" method="POST" enctype="multipart/form-data">'+ lang_msg_choose_type + 90 ': <select id="typeImport"><option value="auto" selected>'+lang_msg_automatic+'</option>'+ 91 '<option value="outlook">'+("Outlook Express")+'</option>'+ 92 '<option value="outlook2000">'+("Outlook 2000")+'</option>'+ 93 '<option value="thunderbird">'+("Mozilla Thunderbird")+'</option>'+ 94 '<option value="expresso" selected>'+lang_expresso_default+'</option></select><br>'+ 95 '<br>'+lang_choose_contacts_file+'<br><br>'+ 55 96 '<input id="import_file" type="file" name="import_file">'+ 56 97 '</form></td></tr>'+ 57 98 '<tr><td height="10px" align="center" nowrap><span style="visibility:hidden" id="s_info"></span></td></tr>'+ 58 99 '<tr><td height="10px" align="center"></td></tr>'+ 59 '<tr><td nowrap><center><input id="import_button" type="button" value= "Importar Contatos"onClick="javascript:ccIEContacts.importCSV(this)"> '+60 '<input type="button" value= "Fechar"onClick="javascript:ccIEContacts.close()"></center></td></tr>'+61 '< /table>'+100 '<tr><td nowrap><center><input id="import_button" type="button" value='+lang_import_contacts+' onClick="javascript:ccIEContacts.importCSV(this)"> '+ 101 '<input type="button" value='+lang_close_win+' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 102 '<tr><td height="10px" align="center" nowrap><span style="visibility:hidden" id="s_info2"></span></td></tr></table>'+ 62 103 '<table border=0 height="208px" width="100%" style="display:none" id="export_span">'+ 63 104 '<tr><td>'+ 64 '<font color="DARKBLUE" size="2">O Expresso suporta a exportação de contatos no formato de arquivo CSV.</font></td></tr>'+ 65 '<tr><td height="85px" valign="top">'+ 66 'Selecione o tipo do formato que deseja exportar seus contatos:<br><br>'+ 67 '<input style="border:0" id="typeExport_0" name="radio" type="radio" value="expresso" checked/>Exportar como CSV do Expresso (padrão)<br>'+ 68 '<input style="border:0" id="typeExport_1" name="radio" type="radio" value="outlook_pt-BR">Exportar como CSV do Outlook Express (Português)<br>'+ 69 '<input style="border:0" id="typeExport_2" name="radio" type="radio" value="outlook_en">Exportar como CSV do Outlook Express (Inglês)<br>'+ 70 '<input style="border:0" id="typeExport_3" name="radio" type="radio" value="outlook2000_pt-BR">Exportar como CSV do Outlook 2000 (Português)<br>'+ 71 '<input style="border:0" id="typeExport_4" name="radio" type="radio" value="outlook2000_en">Exportar como CSV do Outlook 2000 (Inglês)<br>'+ 72 '<input style="border:0" id="typeExport_5" name="radio" type="radio" value="thunderbird">Exportar como CSV do Mozilla Thunderbird<br>'+ 105 '<font color="DARKBLUE" size="2">'+ lang_msg_expresso_info_csv+'</font></td></tr>'+ 106 '<tr><td height="85px" valign="top">'+lang_msg_export_csv+'<br><br>'+ 107 '<select id="typeExport">'+ 108 '<option value="expresso" selected>'+lang_expresso_default_csv+'</option>'+ 109 '<option value="outlook_pt-BR">'+lang_outl_pt+'</option>'+ 110 '<option value="outlook_en">'+lang_outl_en+'</option>'+ 111 '<option value="outlook2000_pt-BR">'+lang_outl2k_pt+'</option>'+ 112 '<option value="outlook2000_en">'+lang_outl2k_en+'</option>'+ 113 '<option value="thunderbird">'+lang_moz_tb+'</option>'+ 114 '</select>'+ 73 115 '</td></tr>'+ 74 116 '<tr><td align="center"> </td></tr>'+ 75 '<tr><td nowrap><center><input id="export_button" type="button" value= "Exportar Contatos"onClick="javascript:ccIEContacts.exportCSV(this)"> '+76 '<input type="button" value= "Fechar"onClick="javascript:ccIEContacts.close()"></center></td></tr>'+117 '<tr><td nowrap><center><input id="export_button" type="button" value='+lang_export_contacts+ ' onClick="javascript:ccIEContacts.exportCSV(this)"> '+ 118 '<input type="button" value='+lang_close_win+ ' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 77 119 '</table></div>'; 78 120 } 79 121 this.showWindow(); 80 122 } 81 123 82 124 cIEContacts.prototype.showWindow = function () 83 125 { 84 126 if(!this.win) { 85 86 this.win = new dJSWin({127 128 this.win = new dJSWin({ 87 129 id: 'ccIEContacts', 88 130 content_id: this.el.id, … … 91 133 title_color: '#3978d6', 92 134 bg_color: '#eee', 93 title: "Importar / Exportar Contatos Pessoais",135 title: Element('cc_msg_ie_personal').value, 94 136 title_text_color: 'white', 95 137 button_x_img: '../phpgwapi/images/winclose.gif', … … 112 154 var status = ''; 113 155 114 var l_1 = '<font face="Verdana" size="1" color="GREEN">['+args[1]+' novos]</font>'; 115 var l_2 = '<font face="Verdana" size="1" color="RED">['+args[2]+' falharam]</font>'; 116 var l_3 = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+' já existiam]</font>'; 117 var l_error = '<span style="height:15px;background:#cc4444"> <font face="Verdana" size="1" color="WHITE">A importação falhou. Verifique o formato do arquivo. </font></span>'; 118 var l_importing = '<span style="height:15px;background:rgb(250, 209, 99)"> <font face="Verdana" size="1" color="DARKBLUE">Importando contatos .... </font></span>'; 156 var lang_import_fail = Element('cc_msg_import_fail').value; 157 var lang_importing = Element('cc_msg_importing_contacts').value; 158 var lang_import_finish = Element('cc_msg_import_finished').value; 159 var lang_new = Element('cc_msg_new').value; 160 var lang_failure = Element('cc_msg_failure').value; 161 var lang_exists = Element('cc_msg_exists').value; 162 var lang_show_more_info = Element('cc_msg_show_more_info').value; 163 164 var l_1 = '<font face="Verdana" size="1" color="GREEN">['+args[1]+lang_new+']</font>'; 165 var l_2 = '<font face="Verdana" size="1" color="RED">['+args[2]+lang_failure+']</font>'; 166 var l_3 = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+lang_exists+']</font>'; 167 var l_4 = '<br><a font face="Verdana" size="1" href="javascript:ccIEContacts.showFailures(\''+args[4]+'\')">'+lang_show_more_info+'</a>'; 168 var l_error = '<span style="height:15px;background:#cc4444"> <font face="Verdana" size="1" color="WHITE">'+lang_import_fail+ ' </font></span>'; 169 var l_importing = '<span style="height:15px;background:rgb(250, 209, 99)"> <font face="Verdana" size="1" color="DARKBLUE">'+lang_importing + ' </font></span>'; 119 170 120 171 if(args[0] == 'success') { 121 172 122 for(i = 1; i < 4; i++) {173 for(i = 1; i < 5; i++) { 123 174 status += " "+eval('l_'+i); 124 175 } 125 Element('s_info').innerHTML = ' <font face="Verdana" size="1" color="BLACK"><b> A importação foi concluída.</b></font><br> '+status;176 Element('s_info').innerHTML = ' <font face="Verdana" size="1" color="BLACK"><b>'+lang_import_finish+'</b></font><br> '+status; 126 177 } 127 178 else … … 148 199 cIEContacts.prototype.importCSV = function () 149 200 { 201 var lang_msg_invalid_csv = Element('cc_msg_invalid_csv').value; 150 202 var form = document.formCSV; 151 152 203 if ((form.import_file.value.length < 10) || 153 (form.import_file.value.substring(form.import_file.value.length - 4, form.import_file.value.length) != ".csv")){154 alert( 'Selecione um arquivo CSV válido para importar seus contatos.');204 (form.import_file.value.substring(form.import_file.value.length - 4, form.import_file.value.length).toLowerCase() != ".csv")){ 205 alert(lang_msg_invalid_csv); 155 206 return; 156 207 } … … 170 221 args[2] = data._failure ? data._failure : 0; 171 222 args[3] = data._existing ? data._existing : 0; 223 args[4] = data._failure_status 224 172 225 } 173 226 _this.importWriteStatus(args); … … 208 261 209 262 cIEContacts.prototype.exportCSV = function() { 210 263 var lang_export_error = Element('cc_msg_export_error'); 211 264 var handler_export = function(data) { 212 265 if(!data){ 213 alert( "Ocorreu um erro durante a exportação.");266 alert(lang_export_error ); 214 267 return; 215 268 } … … 226 279 } 227 280 var typeExport = Element("typeExport"); 228 229 for(var index = 0; index < 5; index++){230 if(Element('typeExport_'+index).checked)231 break;232 }233 234 281 Element('export_button').disabled = true; 235 Connector.newRequest('export_contacts', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=export_contacts', 'POST', handler_export, 'typeExport='+ Element('typeExport_'+index).value);282 Connector.newRequest('export_contacts', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=export_contacts', 'POST', handler_export, 'typeExport='+typeExport.value); 236 283 } 237 284 -
trunk/contactcenter/js/ccMain.js
r284 r285 1 var last_id = 0; 2 3 function openwindow(url){ 4 var window_features = "scrollbars=yes,resizable=yes,location=no,menubar=no," + 5 "personalbar=no,status=no,titlebar=no,toolbar=no," + 6 "screenX=0,screenY=0,top=0,left=0,width=" + 7 screen.width + ",height=" + screen.height/5*3; 8 9 window.open(url,'', window_features); 1 var last_id = 0; 2 3 function openwindow(url){ 4 var window_features = "scrollbars=yes,resizable=yes,location=no,menubar=no," + 5 "personalbar=no,status=no,titlebar=no,toolbar=no," + 6 "screenX=0,screenY=0,top=0,left=0,width=" + 7 screen.width + ",height=" + screen.height/5*3; 8 9 window.open(url,'', window_features); 10 10 } 11 11 12 12 var Main_pre_load = document.body.onload; 13 13 var ccSearch, ccTree; 14 var Main_load = function () 15 { 14 var Main_load = function () 15 { 16 16 Connector.setProgressBox(Element('cc_loading'), true); 17 Connector.setProgressHolder(Element('cc_loading_inner')); 17 Connector.setProgressHolder(Element('cc_loading_inner')); 18 18 /* Associate the Quick Add Button with the Plugin */ 19 19 20 20 21 21 /* Create the Search Object */ … … 37 37 ccSearch.DOMresult.style.visibility = 'hidden'; 38 38 ccSearch.onSearchFinish = ccSearchUpdate; 39 39 40 40 Connector.setProgressBox(Element('cc_loading'), true); 41 41 Connector.setProgressHolder(Element('cc_loading_inner')); 42 42 43 /* Create the Tree Object */ 43 try 44 { 45 function ViewLdap(data) 46 { 47 if( boolData = eval(data) ) 48 { 49 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 50 showCards('all',getActualPage()); 51 selectLetter('27'); 52 } 53 else 54 { 55 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); clearCards();'}); 56 } 57 } 58 59 Connector.newRequest('ViewLdap', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_visible_all_ldap', 'POST', ViewLdap); 60 61 ccTree.Connector = Connector; 62 } 63 catch(e){} 64 65 /* Create the Tree Object */ 44 66 //ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'}); 45 ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); clearCards();'}); 46 47 ccTree.Connector = Connector; 67 //ccTree.Connector = Connector; 48 68 } 49 69 var menuStarted = false; … … 65 85 var _timeout = ''; 66 86 var menu = function () { 67 87 68 88 if(! this.menuStarted) 69 89 this.menuStarted = true; 70 90 71 91 submenu = []; 72 92 textmenu = []; 73 93 74 94 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_group"] 75 textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"]; 95 textmenu[1] = ["cc_quick_add", "cc_full_add", "cc_add_group"]; 76 96 function show(){ 77 97 clearTimeout(_timeout); 78 98 button = document.getElementById("cc_button_new"); 79 80 this.style.top = 19 + findPosY(button) + "px"; 81 this.style.visibility='visible'; 99 100 this.style.top = 19 + findPosY(button) + "px"; 101 this.style.visibility='visible'; 82 102 } 83 103 function hide(){ _timeout = setTimeout("menu.style.visibility='hidden';",200); }; 84 104 85 105 if(document.getElementById) { 86 106 menu = document.getElementById("Layer1"); 87 107 88 108 for (i=0; i< textmenu[0].length; i++) { 89 109 textmenu[0][i] = "<span onclick= 'menu.onmouseout();'>" + document.getElementById(textmenu[0][i]).value + "</span><br>"; 90 submenu[i] = document.createElement("DIV"); 110 submenu[i] = document.createElement("DIV"); 91 111 submenu[i].innerHTML = textmenu[0][i]; 92 112 submenu[i].id = textmenu[1][i]; 93 113 submenu[i].onmouseover = function () {this.style.backgroundColor = 'LIGHTYELLOW';this.style.color = 'DARKBLUE';}; 94 submenu[i].onmouseout = function () { this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';}; 114 submenu[i].onmouseout = function () { this.style.backgroundColor = '#DCDCDC'; this.style.color = '#006699';}; 95 115 submenu[i].setAttribute("className", "special"); 96 116 submenu[i].setAttribute("class", "special"); 97 submenu[i].style.padding = "5px"; 117 submenu[i].style.padding = "5px"; 98 118 menu.appendChild(submenu[i]); 99 } 100 119 } 120 101 121 menu.onmouseover = show; 102 122 menu.onmouseout = hide; 103 123 } 104 124 105 125 ccQuickAdd.associateAsButton(Element('cc_quick_add')); 106 126 ccAddGroup.associateAsButton(Element('cc_add_group')); 107 127 document.getElementById("cc_full_add").onclick= newContact; 108 109 128 129 110 130 ccQuickAdd.afterSave = function () 111 131 { 112 132 updateCards(); 113 } 114 115 ccAddGroup.load = function () 116 { 117 editGroup(); 118 } 119 133 } 134 135 ccAddGroup.load = function () 136 { 137 editGroup(); 138 } 139 120 140 ccAddGroup.afterSave = function () 121 141 { 122 142 updateCards(); 123 143 } 124 144 125 145 return true; 126 146 } … … 128 148 if (is_ie) 129 149 { 130 150 131 151 document.body.onload = function (e) 132 { 133 Main_pre_load(); 134 Main_load(); 135 152 { 153 Main_pre_load(); 154 Main_load(); 155 136 156 } 137 157 } 138 158 else 139 { 140 Main_load(); 141 142 } 159 { 160 Main_load(); 161 162 } 143 163 144 164 // BEGIN: FUNCTION RESIZE WINDOW … … 157 177 showBar = __showBar; 158 178 hideBar = __hideBar; 159 179 160 180 var _onResize = window.onresize; 161 181 window.onresize = resizeWindow; 162 182 var defaultHeight = 0; 163 183 function setDefaultHeight(){ 164 184 165 185 var bar = Element("toolbar"); 166 186 var offset = 0; 167 if(bar.style.visibility != 'hidden') 168 offset = (bar.offsetHeight ? bar.offsetHeight : bar.clientHeight); 187 if(bar.style.visibility != 'hidden') 188 offset = (bar.offsetHeight ? bar.offsetHeight : bar.clientHeight); 169 189 170 190 var screenHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight; 171 defaultHeight = screenHeight - offset; 172 Element("cc_tree").style.height = defaultHeight - 68; 173 Element("cc_left_main").style.height = defaultHeight - 68; 191 defaultHeight = screenHeight - offset; 192 Element("cc_tree").style.height = defaultHeight - 68; 193 Element("cc_left_main").style.height = defaultHeight - 68; 174 194 } 175 195 … … 177 197 setDefaultHeight(); 178 198 if(Element("divScrollMain")) 179 Element("divScrollMain").style.height = defaultHeight - 108; 199 Element("divScrollMain").style.height = defaultHeight - 108; 180 200 if (!is_ie) 181 201 Element('tableDivAppbox').width = '100%'; … … 185 205 setDefaultHeight(); 186 206 Element('cc_main').style.height = defaultHeight; 207 var lang_warn_firefox = Element('cc_msg_warn_firefox'); 208 var lang_firefox_msg1 = Element('cc_msg_firefox_half1'); 209 var lang_firefox_msg2 = Element('cc_msg_firefox_half2'); 210 var lang_install_now = Element('cc_msg_install_now'); 211 var lang_install_new_firefox = Element('cc_msg_install_new_firefox'); 212 var lang_close = Element('cc_msg_close'); 187 213 function buildWarningMsg(_version) { 188 214 var screenWidth = document.body.clientWidth ? document.body.clientWidth: document.body.offsetWidth; … … 191 217 "border:1px solid black;left:"+(screenWidth - 330)+";top:10px;width:300px;padding:10px;"+ 192 218 (document.body.clientWidth ? "-moz-border-radius: 9px 9px 9px 9px;'>" : "")+ 193 "<font color='RED' size='2'>Aviso: Versão muito antiga do Firefox ("+_version+")</font><BR>"+ 194 "<font color='black' size='2'><p style='text-align:justify'> Para que essa aplicação funcione <u>corretamente</u> "+ 195 "é necessário atualizar o seu navegador Firefox para uma versão mais nova (versão > 1.5). "+ 196 "Instale agora clicando no link abaixo ou caso queira atualizar mais tarde (não recomendável), clique em Fechar.</p></font><div style='width:100%' align='center'>"+ 197 "<a title='Instalar agora' href='http://br.mozdev.org/firefox/download.html' target='_blank'>Instalar nova versão do Firefox</a>"+ 219 "<font color='RED' size='2'>"+lang_warn_firefox + "("+_version+")</font><BR>"+ 220 "<font color='black' size='2'><p style='text-align:justify'> "+lang_firefox_msg1+ 221 lang_firefox_msg2 + ".</p></font><div style='width:100%' align='center'>"+ 222 "<a title='"+lang_install_now+"' href='http://br.mozdev.org/firefox/download.html' target='_blank'>"+lang_install_new_firefox+ "</a>"+ 198 223 " "+ 199 "<a title='Fechar' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>Fechar</a></div>"+ 224 "<a title='"+lang_close+"' href='javascript:void(0)' onclick='javascript:myOpacity.toggle()'>"+lang_close+"</a></div>"+ 225 200 226 "</DIV>"; 201 227 … … 203 229 204 230 myOpacity = new fx.Opacity('warning_msg', {duration: 600}); 205 document.getElementById("warning_msg").style.visibility = 'hidden'; 231 document.getElementById("warning_msg").style.visibility = 'hidden'; 206 232 myOpacity.now = 0; 207 233 setTimeout("myOpacity.toggle()",3000); -
trunk/contactcenter/js/ccQuickAddContact.js
r284 r285 6 6 } 7 7 8 8 9 9 cQuickAddContact.prototype.showList = function(id){ 10 10 _this = this; 11 11 var handler = function (responseText) { 12 12 var contacts = unserialize(responseText); 13 var title = contacts['names_ordered']; 14 el = document.createElement("DIV"); 15 el.style.visibility = "hidden"; 13 var title = contacts['names_ordered']; 14 el = document.createElement("DIV"); 15 el.style.visibility = "hidden"; 16 16 el.style.position = "absolute"; 17 17 el.style.left = "0px"; … … 21 21 el.style.height = wHeight + 'px'; 22 22 el.className = "div_cc_rectQuickAddContact"; 23 el.id = id+':cc_rectQuickAddContact'; 24 document.body.appendChild(el); 25 el.innerHTML = ""; 23 el.id = id+':cc_rectQuickAddContact'; 24 document.body.appendChild(el); 25 el.innerHTML = ""; 26 26 27 27 var fieldsTop = 10; 28 28 var fieldsSpace = 30; 29 29 fields = new Array(Element('cc_qa_alias').value, Element('cc_qa_given_names').value, Element('cc_qa_family_names').value, Element('cc_qa_phone').value, Element('cc_qa_email').value); 30 30 31 31 for (i=0; i<fields.length; i++) { 32 32 var contact = contacts[i] != null ? contacts[i] : ''; … … 43 43 { 44 44 el.innerHTML += '<input id="ccQuickAddCI' + i + id + '" type="text" value="' + contact + '" maxlength="50" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 110px; width: 135px;">'; 45 } 45 } 46 46 } 47 47 48 48 el.innerHTML +='<div id="ccQAFuncitons" style="border: 0px solid black; width: 220px; height: 20px">' + 49 '<input title=" ccQASave"type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' +50 '<input title=" ccQAClear" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_clear').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' +49 '<input title="' + Element('cc_qa_save').value + '" type="button" onclick="ccQuickAddContact.send(\'' + id + '\');" value="' + Element('cc_qa_save').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 75px; width: 60px" />' + 50 '<input title="' + Element('cc_qa_close').value + '" type="button" onclick="ccQuickAddContact.fechar(\'' + id + '\');" value="' + Element('cc_qa_close').value + '" style="position: absolute; top: ' + (fieldsTop+i*fieldsSpace) + 'px; left: 140px; width: 60px" />' + 51 51 '</div>'; 52 52 el.innerHTML += "<br>"; 53 53 54 54 _this.showWindow(el); 55 55 } 56 56 57 57 div = document.getElementById(id+':cc_rectQuickAddContact'); 58 58 59 59 if(div) 60 60 this.showWindow(div); … … 63 63 } 64 64 } 65 65 66 66 cQuickAddContact.prototype.showWindow = function (div) 67 { 67 { 68 68 if(! this.arrayWin[div.id]) { 69 69 70 win = new dJSWin({ 70 win = new dJSWin({ 71 71 id: 'ccQuickAddContact_'+div.id, 72 72 content_id: div.id, … … 75 75 title_color: '#3978d6', 76 76 bg_color: '#eee', 77 title: Element('ccQATitle').value, 77 title: Element('ccQATitle').value, 78 78 title_text_color: 'white', 79 79 button_x_img: Element('cc_phpgw_img_dir').value+'/winclose.gif', 80 80 border: true }); 81 81 82 82 this.arrayWin[div.id] = win; 83 win.draw(); 83 win.draw(); 84 84 } 85 85 else { 86 86 win = this.arrayWin[div.id]; 87 } 87 } 88 88 win.open(); 89 89 } 90 90 91 91 cQuickAddContact.prototype.send = function (id) 92 92 { … … 115 115 return; 116 116 } 117 117 118 118 win.close(); 119 119 … … 132 132 } 133 133 } 134 134 135 135 var sdata = new Array(); 136 136 137 137 for (var f = 0; f < 5; f++){ 138 138 sdata[f] = document.getElementById('ccQuickAddCI' + f + id).value; 139 139 } 140 140 141 141 //Utiliza expressão regular para validar email 142 142 var reEmail = /^[A-Za-z\d_-]+(\.[A-Za-z\d_-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; … … 147 147 return false; 148 148 } 149 149 150 150 //Utiliza expressão regular para validar telefone 151 151 var rePhone = /^[0-9|(-)| |-]{0,15}$/; 152 152 153 153 if (!rePhone.test(sdata[3])){ 154 154 alert("O número de telefone '" + sdata[3] + "' não é valido! Utilize apenas números.\n" + 155 155 "Parenteses, traços ou espaços em branco podem ser usados como carácter separador."); 156 156 return false; 157 } 158 157 } 158 159 159 var sdata = 'add='+escape(serialize(sdata)); 160 160 161 161 Connector.newRequest('cQuickAdd.Send', CC_url+'quick_add', 'POST', handler, sdata); 162 162 } 163 163 164 164 cQuickAddContact.prototype.fechar = function(id) { 165 165 166 166 div = document.getElementById(id+':cc_rectQuickAddContact'); 167 167 win = this.arrayWin[div.id]; 168 168 win.close(); 169 169 } 170 171 170 171 172 172 /* Build the Object */ 173 173 var ccQuickAddContact ; … … 175 175 176 176 if (is_ie) 177 { 178 document.body.onload = function (e) 179 { 177 { 178 document.body.onload = function (e) 179 { 180 180 cQuickAddContact_pre_load(); 181 181 ccQuickAddContact = new cQuickAddContact(); 182 182 183 183 }; 184 184 } -
trunk/contactcenter/js/cc_search.js
r284 r285 60 60 this.DOMinput.value = params['value'] ? params['value'] : ''; 61 61 this.DOMinput.style.width = params['input_width'] ? params['input_width'] : '200px'; 62 this.DOMinput.onkeypress = function (e) { 62 this.DOMinput.onkeypress = function (e) { 63 63 if (is_ie) 64 64 { … … 86 86 if (params['progress_color']) 87 87 this.DOMprogHold.style.color = params['progress_color']; 88 88 89 89 this.DOMresult.style.position = 'absolute'; 90 90 this.DOMresult.style.top = params['progress_top'] ? params['progress_top'] : '0px'; … … 96 96 this.DOMresult.style.color = params['progress_color']; 97 97 98 this.DOMholder.appendChild(this.DOMdiv); 98 this.DOMholder.appendChild(this.DOMdiv); 99 99 this.DOMdiv.appendChild(this.DOMfields); 100 100 this.DOMdiv.appendChild(this.DOMinput); … … 104 104 this.DOMdiv.appendChild(this.DOMresult); 105 105 } 106 106 107 107 ccSearchClass.prototype.go = function() 108 108 { 109 109 var data = new Array(); 110 110 111 111 this.DOMresult.innerHTML = ''; 112 112 113 113 //TODO: Make Generic! 114 114 var type = Element('cc_type_contact').value; 115 115 116 116 data['fields'] = new Array(); 117 117 118 118 if (type == 'groups') { 119 data['fields']['id'] = 'group.id_group'; 119 data['fields']['id'] = 'group.id_group'; 120 120 data['fields']['search'] = 'group.title'; 121 } 122 else { 123 data['fields']['id'] = 'contact.id_contact'; 124 data['fields']['search'] = 'contact.names_ordered'; 125 } 126 121 } 122 else { 123 data['fields']['id'] = 'contact.id_contact'; 124 data['fields']['search'] = 'contact.names_ordered'; 125 } 126 127 127 data['search_for'] = this.DOMinput.value; 128 //data['recursive'] = this.recursive.checked ? true : false;129 // Exige que a consulta por nome seja feita com no mínimo 4 caracteres130 128 var search_for = data['search_for'].split(' '); 131 129 var greaterThan4 = false; … … 145 143 146 144 var _this = this; 147 148 var handler = function (responseText) 149 { 150 var data = new Array(); 151 data = unserialize(responseText); 152 153 ccSearchUpdate(); 154 155 letter = 'search'; 156 157 if ( letter != CC_actual_letter ) 158 { 159 CC_actual_page = '1'; 160 } 161 else 162 { 163 CC_actual_page = parseInt(data[1]); 164 } 165 166 CC_actual_letter = letter; 167 168 if (CC_max_cards[0] == 0) 169 { 170 171 if(CC_visual == 'cards') 172 drawCards(0); 173 else if(CC_visual == 'table') 174 drawTable(0); 175 176 setPages(0,0); 177 return; 178 } 179 180 if (data[0] == '0') 181 { 182 Element('cc_type_contact').value = data[1]; 183 CC_npages = 0; 184 CC_actual_page = 1; 185 if(CC_visual == 'cards') 186 drawCards(0); 187 else if(CC_visual == 'table') 188 drawTable(0); 189 setPages(0,0); 190 return; 191 } 192 else 193 { 194 Element('cc_type_contact').value = data[10]; 195 } 196 197 // Element('cc_debug').innerHTML = responseText; 198 199 if (typeof(data) != 'object') 200 { 201 showMessage(Element('cc_msg_err_contacting_server').value); 202 return; 203 } 204 205 if (typeof(data[3]) == 'object') 206 { 207 CC_npages = parseInt(data[0]); 208 CC_actual_page = parseInt(data[1]); 209 if(CC_visual == 'cards') 210 drawCards(data[3].length, data[10]); 211 else if(CC_visual == 'table') 212 drawTable(data[3].length, data[10]); 213 resizeWindow(); 214 populateCards(data, data[10]); 215 setPages(data[0], data[1]); 216 } 217 else if (data['error']) 218 { 219 showMessage(data['error']); 220 } 221 else 222 { 223 showMessage(Element('cc_msg_err_contacting_server').value); 224 return; 225 } 226 227 228 }; 229 230 231 /* 145 232 146 var handler = function (responseText) 233 147 { 234 Element('cc_debug').innerHTML = responseText; 235 236 var data = unserialize(responseText); 237 238 if (!data || !data['status']) 148 var data = new Array(); 149 data = unserialize(responseText); 150 151 if( !data ) 152 return false; 153 154 if( data[0] == 0 ) 155 { 156 if (_this.onSearchFinish) 157 _this.onSearchFinish(null); 158 return false; 159 } 160 161 if (data[3].length > 300) 162 { 163 alert("Mais de 300 resultados foram retornados! \n Favor refinar sua busca."); 164 165 if (_this.onSearchFinish) 166 _this.onSearchFinish(null); 167 168 return false; 169 } 170 171 ccSearchUpdate(); 172 173 letter = 'search'; 174 175 if ( letter != CC_actual_letter ) 176 { 177 CC_actual_page = '1'; 178 } 179 else 180 { 181 CC_actual_page = parseInt(data[1]); 182 } 183 184 CC_actual_letter = letter; 185 186 if (CC_max_cards[0] == 0) 187 { 188 if(CC_visual == 'cards') 189 drawCards(0); 190 else if(CC_visual == 'table') 191 drawTable(0); 192 193 setPages(0,0); 194 return; 195 } 196 197 if (data[0] == '0') 198 { 199 Element('cc_type_contact').value = data[1]; 200 CC_npages = 0; 201 CC_actual_page = 1; 202 if(CC_visual == 'cards') 203 drawCards(0); 204 else if(CC_visual == 'table') 205 drawTable(0); 206 setPages(0,0); 207 return; 208 } 209 else 210 { 211 Element('cc_type_contact').value = data[10]; 212 } 213 214 if (typeof(data) != 'object') 239 215 { 240 216 showMessage(Element('cc_msg_err_contacting_server').value); 241 return false; 242 } 243 244 if (data['status'] == 'empty') 245 { 246 //showMessage(data['msg']); 247 _this.DOMresult.innerHTML = data['msg']; 248 setTimeout(function(){_this.DOMresult.innerHTML = '';}, 1000); 249 250 if (_this.onSearchFinish) 251 { 252 _this.onSearchFinish(null); 253 } 254 return false; 255 } 256 257 if (data['status'] != 'ok') 258 { 259 //showMessage(data['msg']); 260 _this.DOMresult.innerHTML = data['msg']; 261 setTimeout(function(){_this.DOMresult.innerHTML = '';}, 1000); 262 return false; 263 } 264 265 // Mostra a mensagem se a busca retornar mais de 300 resultados. 266 if (data['data'].length > 300) 267 { 268 269 TODO: Usar o esquema de tradução do expresso para este alert 270 271 alert("Mais de 300 resultados foram retornados!\n" + 272 "Favor refinar sua busca."); 273 } 274 275 if (_this.onSearchFinish) 276 { 277 _this.onSearchFinish(data['data']); 217 return; 218 } 219 220 if (typeof(data[3]) == 'object') 221 { 222 CC_npages = parseInt(data[0]); 223 CC_actual_page = parseInt(data[1]); 224 if(CC_visual == 'cards') 225 drawCards(data[3].length, data[10]); 226 else if(CC_visual == 'table') 227 drawTable(data[3].length, data[10]); 228 resizeWindow(); 229 populateCards(data, data[10]); 230 setPages(data[0], data[1]); 231 } 232 else if (data['error']) 233 { 234 showMessage(data['error']); 235 } 236 else 237 { 238 showMessage(Element('cc_msg_err_contacting_server').value); 239 return; 278 240 } 279 241 }; 280 */ 281 var info = "letter="+'search'+"&page="+'1'+"&data="+serialize(data); 282 this.Connector.newRequest('get_cards_data', CC_url+'get_cards_data', 'POST', handler, info); 242 243 this.Connector.newRequest('search', CC_url+'search&data='+serialize(data), 'GET', handler); 283 244 } -
trunk/contactcenter/js/cc_tree.js
r284 r285 20 20 throw('dFTree lib must be loaded!'); 21 21 } 22 22 23 23 function ccCatalogTree(params) 24 24 { … … 29 29 30 30 var _tree = this; 31 31 32 32 /* This is the property that holds the Tree Object */ 33 33 this.name = params['name']; … … 39 39 this.Connector = params['connector']; 40 40 41 /* Build the Inicial Tree */ 41 /* Build the Inicial Tree */ 42 42 //this._getActualLevel(); 43 43 setTimeout(function(){ _tree._updateTree('0', true);}, 100); … … 57 57 return; 58 58 } 59 59 60 60 if (data['status'] != 'ok') 61 61 { … … 66 66 67 67 _this.catalog_perms = parseInt(data['perms']); 68 68 69 69 if (_this.afterSetCatalog) 70 70 { … … 75 75 Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 76 76 } 77 77 78 78 ccCatalogTree.prototype.setCatalogSearch = function (catalog) { 79 79 80 80 var _this = this; 81 81 var handler = function (responseText) … … 89 89 return; 90 90 } 91 91 92 92 if (data['status'] != 'ok') 93 93 { … … 100 100 101 101 this.afterSetCatalog = ccEmailWin.search.go(); 102 102 103 103 }; 104 104 105 105 Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 106 106 } 107 108 107 108 109 109 ccCatalogTree.prototype.select = function(level, search) 110 110 { 111 if (!search) { 111 if (!search) { 112 112 this.tree.openTo(level); 113 113 this.tree.getNodeById(level)._select(); 114 114 115 115 if (level != this.actualLevel) 116 116 { … … 129 129 * Methods For Internal Use * 130 130 \*************************************************************************/ 131 131 132 132 ccCatalogTree.prototype._waitForTree = function(level, rlevel) 133 133 { … … 142 142 return; 143 143 } 144 144 145 145 setTimeout(this.name+'._waitForTree(\''+level+'\', '+rlevel+')', 100); 146 146 } … … 176 176 _this.tree.getNodeById(_this.actualLevel)._select(); 177 177 _this.setCatalog(_this.actualLevel); 178 } 179 }; 180 178 _this.expandTree(); 179 180 } 181 }; 182 181 183 Connector.newRequest(this.name+'actual', CC_url+'get_actual_catalog', 'GET', handler); 182 184 } 183 185 186 ccCatalogTree.prototype.expandTree = function() { 187 for (i=0; i < this.tree._aNodes.length; i++) 188 this._expandSubTree(this.tree._aNodes[i]); 189 } 190 191 ccCatalogTree.prototype._expandSubTree = function(node) { 192 if ( node._children == '' ) { 193 return; 194 } 195 if (node._children != '') { 196 for (i = 0; i <= node._children.length; i++) { 197 if ( node._io == false ) 198 node.changeState(); 199 this._expandSubTree(node._children[i]); 200 } 201 } 202 } 203 204 184 205 ccCatalogTree.prototype._updateTree = function(level, open) 185 206 { … … 201 222 { 202 223 showMessage(data['msg']); 203 if (data['status'] != 'error') 204 { 205 return; 206 } 224 return; 207 225 } 208 226 209 227 treeData = data['data']; 210 228 211 229 var timeout = 10; 212 230 var limit = 0; … … 243 261 timeout += 5; 244 262 } 245 263 246 264 _this.treeAvailable = true; 247 265 … … 253 271 } 254 272 }; 255 256 273 Connector.newRequest(this.name+'update', CC_url+'get_catalog_tree&level='+level, 'GET', handler); 257 274 } -
trunk/contactcenter/setup/external_catalogs.inc.php
r284 r285 44 44 * 45 45 */ 46 47 46 ?> -
trunk/contactcenter/setup/setup.inc.php
r284 r285 37 37 $setup_info['contactcenter']['hooks'][] = 'preferences'; 38 38 $setup_info['contactcenter']['hooks'][] = 'config_validate'; 39 39 40 40 /* ContactCenter Tables */ 41 41 $setup_info['contactcenter']['tables'][] = 'phpgw_cc_status'; … … 69 69 $setup_info['contactcenter']['tables'][] = 'phpgw_cc_contact_company'; 70 70 $setup_info['contactcenter']['tables'][] = 'phpgw_cc_contact_grps'; 71 71 72 72 $setup_info['contactcenter']['tables'][] = 'phpgw_cc_groups'; 73 73 74 74 /* Dependencies for this app to work */ 75 75 $setup_info['contactcenter']['depends'][] = array( -
trunk/contactcenter/setup/tables_update.inc.php
r284 r285 56 56 return $GLOBALS['setup_info']['contactcenter']['currentver']; 57 57 } 58 $test[] = '1.0.005'; 59 function contactcenter_upgrade1_0_005() { 60 $GLOBALS['setup_info']['contactcenter']['currentver'] = '1.14'; 61 return $GLOBALS['setup_info']['contactcenter']['currentver']; 62 } 63 $test[] = '1.14'; 64 function contactcenter_upgrade1_14() { 65 $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cc_connections ALTER COLUMN connection_value TYPE varchar(100)"); 66 $GLOBALS['setup_info']['contactcenter']['currentver'] = '1.150'; 67 return $GLOBALS['setup_info']['contactcenter']['currentver']; 68 } 69 $test[] = '1.15'; 70 function contactcenter_upgrade1_15() { 71 $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cc_contact ADD COLUMN last_status char(1) DEFAULT 'N'::bpchar"); 72 $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cc_contact ADD COLUMN last_update int8 DEFAULT (date_part('epoch'::text, ('now'::text)::timestamp(3) with time zone) * (1000)::double precision)"); 73 $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cc_contact ADD COLUMN category character varying(20)"); 74 75 $GLOBALS['setup_info']['contactcenter']['currentver'] = '1.20'; 76 return $GLOBALS['setup_info']['contactcenter']['currentver']; 77 } 78 58 79 ?> -
trunk/contactcenter/templates/default/config.tpl
r2 r285 50 50 <td>{lang_Password_for_the_account_above_(if_any)}:</td> 51 51 <td><input name="newsettings[cc_ldap_pw0]" type="password" value="" size="40" /></td> 52 </tr> 53 <tr class="row_off"> 54 <td>Abrir Consulta Automática :</td> 55 <td> 56 <select name="newsettings[cc_ldap_query_automatic]"> 57 <option value="true" {selected_cc_ldap_query_automatic_true}>Sim</option> 58 <option value="false" {selected_cc_ldap_query_automatic_false}>Não</option> 59 </select> 60 </td> 52 61 </tr> 53 62 -
trunk/contactcenter/templates/default/full_add.tpl
r284 r285 13 13 <input id="cc_contact_personal" type="hidden" value="{cc_contact_personal}"> 14 14 <input id="cc_contact_addrs" type="hidden" value="{cc_contact_addrs}"> 15 <input id="cc_contact_conns" type="hidden" value=" E-mails e Telefones">15 <input id="cc_contact_conns" type="hidden" value="{emails_telephones}"> 16 16 <input id="cc_pd_full_name" name="{cc_pd_full_name}" type="hidden"> 17 17 <input id="cc_pd_sex" name="{cc_pd_sex}" type="hidden"> … … 36 36 <tr class="row_on"> 37 37 <td align="right">{cc_pd_alias}:</td> 38 <td align="left" colspan="2"><input id="cc_pd_alias" name="{cc_pd_alias}" type="text" style="width:175px;z-index:-1" value="" maxlength=" 30"></td>38 <td align="left" colspan="2"><input id="cc_pd_alias" name="{cc_pd_alias}" type="text" style="width:175px;z-index:-1" value="" maxlength=""></td> 39 39 </tr> 40 40 <tr style="display:none" class="row_off"> … … 139 139 <tbody> 140 140 <tr class="th" width="100%" align="center" height="10px"> 141 <td width="60px" noWrap><input type="radio" name="cc_conn_type" id="cc_conn_type_1" value="Email" onclick="javascript:updateConnFields();"> E-mail</td>142 <td width="60px" noWrap><input type="radio" name="cc_conn_type" id="cc_conn_type_2" value="Telefone" onclick="javascript:updateConnFields();"> Telefone</td>143 <td width="*" align="left"><select style="width:160px" id="cc_conn_type_sel" onchange="javascript:connAddNewLine();"><option value="-1"> Escolha 'Email' ou 'Telefone'</option></select></td>144 </tr> 145 <tr class="row_off"> 141 <td width="60px" noWrap><input type="radio" name="cc_conn_type" id="cc_conn_type_1" value="Email" onclick="javascript:updateConnFields();">{email}</td> 142 <td width="60px" noWrap><input type="radio" name="cc_conn_type" id="cc_conn_type_2" value="Telefone" onclick="javascript:updateConnFields();">{telephone}</td> 143 <td width="*" align="left"><select style="width:160px" id="cc_conn_type_sel" onchange="javascript:connAddNewLine();"><option value="-1">{choose_email_telephone}</option></select></td> 144 </tr> 145 <tr class="row_off"> 146 146 <td valign="top" colspan="4" width="100%" style="border: 0px solid black" cellpadding="0" cellspacing="0"> 147 147 <table align="left" width="100%" style="border: 0px solid black"> 148 148 <tbody id="cc_conn"> 149 149 <!-- Code inside here is inserted dynamically --> 150 </tbody> 150 </tbody> 151 151 </table> 152 152 </td> … … 159 159 </tbody> 160 160 </table> 161 <div style="z-index:10000;position: absolute;display:none; top: 170px; left: 78px;" id="div_cc_conn_is_default"> É padrão: <select id="cc_email_default" name="cc_email_default" disabled style="display:none"></select><select id="cc_phone_default" name="cc_phone_default" disabled style="display:none"></select></div>161 <div style="z-index:10000;position: absolute;display:none; top: 170px; left: 78px;" id="div_cc_conn_is_default"> {cc_default} <select id="cc_email_default" name="cc_email_default" disabled style="display:none"></select><select id="cc_phone_default" name="cc_phone_default" disabled style="display:none"></select></div> 162 162 </div> 163 163 <!-- _BOTTOM BUTTONS --> 164 <div align="center" id="cc_contact_tab_buttons" style="position: absolute; visibility: hidden; top: 250px; left: 0px; width: 498px; height: 32px; border: 0px solid black"> 164 <div align="center" id="cc_contact_tab_buttons" style="position: absolute; visibility: hidden; top: 250px; left: 0px; width: 498px; height: 32px; border: 0px solid black"> 165 165 <table class="row_off" align="center" width="498px" cellpadding="2" cellspacing="0" border="0"> 166 166 <tr> … … 177 177 <!-- 178 178 // Overloading some methods for fix cursor problem in Firefox. 179 if(!is_ie) { 180 dJSWin.prototype.close = function() { 179 if(!is_ie) { 180 dJSWin.prototype.close = function() { 181 181 dJSWin.state = 0; 182 182 dd.elements[this.title.id].hide(); 183 Element("divScrollMain").style.overflow = 'auto'; 183 if ( dd_div = document.getElementById('divScrollMain')) 184 Element("divScrollMain").style.overflow = 'auto'; 184 185 } 185 186 dJSWin.prototype.open = function() { … … 188 189 dd.elements[this.title.id].maximizeZ(); 189 190 dd.elements[this.title.id].show(); 190 Element("divScrollMain").style.overflow = 'hidden'; 191 } 192 } 193 191 if ( dd_div = document.getElementById('divScrollMain')) 192 dd_div.style.overflow = 'hidden'; 193 } 194 } 195 194 196 var fullAdd_onload = document.body.onload; 195 197 var tabs; 196 198 var fullAddWin; 197 var photo_frame, photo_form, photo_input; 199 var photo_frame, photo_form, photo_input; 198 200 199 201 __f = function(e) 200 202 { 201 203 202 204 tabs = new dTabsManager({'id': 'cc_contact_tab', 'width': '500px'}); 203 204 tabs.addTab({'id': 'cc_contact_tab_0', 205 'name': Element('cc_contact_personal').value, 206 'selectedClass': 'tab_box_active', 205 206 tabs.addTab({'id': 'cc_contact_tab_0', 207 'name': Element('cc_contact_personal').value, 208 'selectedClass': 'tab_box_active', 207 209 'unselectedClass': 'tab_box'}); 208 209 tabs.addTab({'id': 'cc_contact_tab_2', 210 'name': Element('cc_contact_conns').value, 211 'selectedClass': 'tab_box_active', 210 211 tabs.addTab({'id': 'cc_contact_tab_2', 212 'name': Element('cc_contact_conns').value, 213 'selectedClass': 'tab_box_active', 212 214 'unselectedClass': 'tab_box'}); 213 215 214 tabs.addTab({'id': 'cc_contact_tab_1', 215 'name': Element('cc_contact_addrs').value, 216 'selectedClass': 'tab_box_active', 217 'unselectedClass': 'tab_box'}); 216 tabs.addTab({'id': 'cc_contact_tab_1', 217 'name': Element('cc_contact_addrs').value, 218 'selectedClass': 'tab_box_active', 219 'unselectedClass': 'tab_box'}); 218 220 219 221 fullAddWin = new dJSWin({'id': 'cc_full_add', … … 229 231 'border': true}); 230 232 231 fullAddWin.draw(); 232 233 fullAddWin.draw(); 234 233 235 if (is_ie) 234 236 { … … 242 244 { 243 245 Element('cc_pd_select_photo_t').style.display='none'; 244 Element('cc_pd_select_photo_b').style.display='none'; 245 } 246 246 Element('cc_pd_select_photo_b').style.display='none'; 247 } 248 247 249 }; 248 250 249 251 if (is_ie) // || is_moz1_6) 250 252 { 251 253 252 254 document.body.onload = function(e) { setTimeout('__f()', 10); fullAdd_onload ? setTimeout('fullAdd_onload()'): false;}; 253 255 } … … 270 272 271 273 272 <!-- RELATIONS 274 <!-- RELATIONS 273 275 <div id="cc_contact_tab_3" class="row_off div_cc_contact_tab"> 274 276 <table align="center" width="500px" height="100%" cellpadding="2" cellspacing="0" border="0"> -
trunk/contactcenter/templates/default/index.tpl
r284 r285 1 1 <link rel="stylesheet" type="text/css" href="{cc_css}"> 2 <style> 2 <style> 3 3 .special{ 4 4 cursor:pointer; 5 5 cursor:hand; 6 position:relative; 7 top:0px; 6 position:relative; 7 top:0px; 8 8 left:0px; 9 color: #006699; 9 color: #006699; 10 10 background-color:#DCDCDC; 11 11 } … … 15 15 <input id="cc_msg_no_cards" type="hidden" value="{cc_msg_no_cards}"> 16 16 <input id="cc_msg_err_no_room" type="hidden" value="{cc_msg_err_no_room}"> 17 18 17 <input id="cc_root_dir" type="hidden" value="{cc_root_dir}"> 19 18 <input id="cc_msg_card_new" type="hidden" value="{cc_msg_card_new}"> … … 25 24 <input id="cc_msg_card_remove_confirm" type="hidden" value="{cc_msg_card_remove_confirm}"> 26 25 <input id="cc_send_mail" type="hidden" value="{cc_send_mail}"> 27 <input id="cc_msg_group_edit" type="hidden" value="{cc_msg_group_edit}"> 26 <input id="cc_msg_group_edit" type="hidden" value="{cc_msg_group_edit}"> 28 27 <input id="cc_msg_group_remove" type="hidden" value="{cc_msg_group_remove}"> 29 28 <input id="cc_msg_group_remove_confirm" type="hidden" value="{cc_msg_group_remove_confirm}"> 30 29 <input id="cc_panel_search_text" type="hidden" value="{cc_panel_search}" style="cursor: pointer; cursor: hand;" onclick="javascript:ccSearch()" /> 30 <input id="cc_msg_close_win" type="hidden" value="{cc_msg_close_win}"> 31 <input id="cc_msg_import_contacts" type="hidden" value="{cc_msg_import_contacts}"> 32 <input id="cc_msg_export_contacts" type="hidden" value="{cc_msg_export_contacts}"> 33 <input id="cc_msg_expresso_info_csv" type="hidden" value="{cc_msg_expresso_info_csv}"> 34 <input id="cc_msg_choose_file_type" type="hidden" value="{cc_msg_choose_file_type}"> 35 <input id="cc_msg_outlook_express" type="hidden" value="{cc_msg_outlook_express}"> 36 <input id="cc_msg_outlook2k" type="hidden" value="{cc_msg_outlook2k}"> 37 <input id="cc_msg_expresso_default" type="hidden" value="{cc_msg_expresso_default}"> 38 <input id="cc_msg_choose_contacts_file" type="hidden" value="{cc_msg_choose_contacts_file}"> 39 <input id="cc_msg_close" type="hidden" value="{cc_msg_close}"> 40 <input id="cc_msg_ie_personal" type="hidden" value="{cc_msg_ie_personal}"> 41 <input id="cc_msg_import_fail" type="hidden" value="{cc_msg_import_fail}"> 42 <input id="cc_msg_export_csv" type="hidden" value="{cc_msg_export_csv}"> 43 <input id="cc_msg_automatic" type="hidden" value="{cc_msg_automatic}"> 44 <input id="cc_msg_importing_contacts" type="hidden" value="{cc_msg_importing_contacts}"> 45 <input id="cc_msg_import_finished" type="hidden" value="{cc_msg_import_finished}"> 46 <input id="cc_msg_invalid_csv" type="hidden" value="{cc_msg_invalid_csv}"> 47 <input id="cc_msg_new" type="hidden" value="{cc_msg_new}"> 48 <input id="cc_msg_failure" type="hidden" value="{cc_msg_failure}"> 49 <input id="cc_msg_exists" type="hidden" value="{cc_msg_exists}"> 50 <input id="cc_msg_show_more_info" type="hidden" value="{cc_msg_show_more_info}"> 51 <input id="cc_msg_clean" type="hidden" value="{cc_msg_clean}"> 52 <input id="cc_msg_choose_valid_csv" type="hidden" value="{cc_msg_choose_valid_csv}"> 53 <input id="cc_msg_export_error" type="hidden" value="{cc_msg_export_error}"> 54 <input id="cc_msg_new_email" type="hidden" value="{cc_msg_new_email}"> 55 <input id="cc_msg_main" type="hidden" value="{cc_msg_main}"> 56 <input id="cc_msg_alternative" type="hidden" value="{cc_msg_alternative}"> 57 <input id="cc_msg_select_email" type="hidden" value="{cc_msg_select_email}"> 58 <input id="cc_msg_new_phone" type="hidden" value="{cc_msg_new_phone}"> 59 <input id="cc_msg_home" type="hidden" value="{cc_msg_home}"> 60 <input id="cc_msg_cellphone" type="hidden" value="{cc_msg_cellphone}"> 61 <input id="cc_msg_work" type="hidden" value="{cc_msg_work}"> 62 <input id="cc_msg_fax" type="hidden" value="{cc_msg_fax}"> 63 <input id="cc_msg_pager" type="hidden" value="{cc_msg_pager}"> 64 <input id="cc_msg_choose_phone" type="hidden" value="{cc_msg_choose_phone}"> 65 <input id="cc_msg_warn_firefox" type="hidden" value="{cc_msg_warn_firefox}"> 66 <input id="cc_msg_firefox_half1" type="hidden" value="{cc_msg_firefox_half1}"> 67 <input id="cc_msg_firefox_half2" type="hidden" value="{cc_msg_firefox_half2}"> 68 <input id="cc_msg_click_close" type="hidden" value="{cc_msg_click_close}"> 69 <input id="cc_msg_install_now" type="hidden" value="{cc_msg_install_now}"> 70 <input id="cc_msg_install_new_firefox" type="hidden" value="{cc_msg_install_new_firefox}"> 71 <input id="cc_msg_close" type="hidden" value="{cc_msg_close}"> 72 <input id="cc_msg_outlook_express_pt" type="hidden" value="{cc_msg_outlook_express_pt}"> 73 <input id="cc_msg_outlook_express_en" type="hidden" value="{cc_msg_outlook_express_en}"> 74 <input id="cc_msg_outlook_2k_pt" type="hidden" value="{cc_msg_outlook_2k_pt}"> 75 <input id="cc_msg_outlook_2k_en" type="hidden" value="{cc_msg_outlook_2k_en}"> 76 <input id="cc_msg_moz_thunderbird" type="hidden" value="{cc_msg_moz_thunderbird}"> 77 <input id="cc_msg_expresso_default_csv" type="hidden" value="{cc_msg_expresso_default_csv}"> 78 <input id="cc_msg_copy_to_catalog" type="hidden" value="{cc_msg_copy_to_catalog}"> 79 <input id="cc_msg_fill_field_name" type="hidden" value="{cc_msg_fill_field_name}"> 80 <input id="cc_msg_add_contact_to_group" type="hidden" value="{cc_msg_add_contact_to_group}"> 81 82 31 83 <!-- END JS MESSAGES --> 32 84 <input id="cc_type_contact" type="hidden"> 33 85 <input id="cc_participants" type="hidden" value="{cc_participants}"> 34 86 35 87 <input id="cc_qa_alias" type="hidden" value="{cc_qa_alias}"> 36 88 <input id="cc_qa_given_names" type="hidden" value="{cc_qa_given_names}"> … … 38 90 <input id="cc_qa_phone" type="hidden" value="{cc_qa_phone}"> 39 91 <input id="cc_qa_email" type="hidden" value="{cc_qa_email}"> 40 92 41 93 <input id="cc_qa_save" type="hidden" value="{cc_qa_save}"> 42 <input id="cc_qa_cl ear" type="hidden" value="{cc_qa_clear}">43 94 <input id="cc_qa_close" type="hidden" value="{cc_qa_close}"> 95 44 96 <input id="cc_empty" type="hidden" value="{cc_empty}"> 45 97 <!-- VIEW CARDS --> … … 53 105 </tr> 54 106 <tr> 55 <td width="150px" height="100%" align="left" valign="top"> 107 <td width="150px" height="100%" align="left" valign="top"> 56 108 <div id="cc_tree" style="overflow:auto;position:relative; width: 150px;border: 0px solid #999;"></div> 57 109 </td> … … 75 127 </tr>--> 76 128 <tr align="left"> 77 <td align="left"> 78 <input id="cc_button_new" onMouseOver="if(!menuStarted) menu();menu.onmouseover()" onMouseOut="menu.onmouseout()" value=" Novo ..." type="button">129 <td align="left"> 130 <input id="cc_button_new" onMouseOver="if(!menuStarted) menu();menu.onmouseover()" onMouseOut="menu.onmouseout()" value="{cc_btn_new}" type="button"> 79 131 <div id="cc_panel_search_call" style="display: inline"></div> 80 132 <div id="cc_panel_table" style="display: none; text-align: right"> … … 82 134 </div> 83 135 <div id="cc_panel_cards" style="display: inline; text-align: right"> 84 <input type="button" value="{cc_panel_cards}" class="tab_box" style="cursor: pointer; cursor: hand;" onclick="javascript: ccChangeVisualization('cards')" /> 136 <input type="button" value="{cc_panel_cards}" class="tab_box" style="cursor: pointer; cursor: hand;" onclick="javascript: ccChangeVisualization('cards')" /> 85 137 </div> 86 138 </td> 87 139 <td align="right"> 88 <input id="cc_button_tools" value=" Importar | Exportar" type="button" onclick="javascript:ccIEContacts.showList()">140 <input id="cc_button_tools" value="{cc_btn_import_export}" type="button" onclick="javascript:ccIEContacts.showList()"> 89 141 </td> 90 142 </tr> … … 172 224 <td align="left" valign="middle"><span id="cc_panel_arrow_last"><img src="templates/default/images/last-grey.png" border="0" alt="{cc_panel_last_page}" hspace="2" /></span></td> 173 225 </tr> 174 </table> 226 </table> 175 227 </td> 176 228 </tr> … … 179 231 </tr> 180 232 <!-- ___END PANEL --> 181 <!-- __CARDS --> 233 <!-- __CARDS --> 182 234 <tr> 183 235 <td style="border: 0px solid #666;" id="cc_card_space" width="100%" height="auto" valign="top" align="center" colspan="4"></td> 184 </tr> 236 </tr> 185 237 <!-- __END CARDS --> 186 238 </table> … … 197 249 <script type="text/javascript" src="js/ccIEContacts.js"></script> 198 250 <script type="text/javascript" src="js/ccMain.js"></script> 199 <!-- END BOTTOM DETAILS--> 251 <!-- END BOTTOM DETAILS-->
Note: See TracChangeset
for help on using the changeset viewer.