Changeset 4857 in subversion
- Timestamp:
- Jun 16, 2011 8:20:19 AM (2 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 7 edited
-
program/include/rcube_addressbook.php (modified) (6 diffs)
-
program/include/rcube_contacts.php (modified) (2 diffs)
-
program/include/rcube_ldap.php (modified) (27 diffs)
-
program/steps/addressbook/func.inc (modified) (1 diff)
-
program/steps/addressbook/show.inc (modified) (1 diff)
-
skins/default/addressbook.css (modified) (1 diff)
-
skins/default/templates/contact.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_addressbook.php
r4752 r4857 34 34 const ERROR_SAVING = 4; 35 35 const ERROR_SEARCH = 5; 36 36 37 37 /** public properties (mandatory) */ 38 38 public $primary_key; … … 44 44 public $page_size = 10; 45 45 public $coltypes = array('name' => array('limit'=>1), 'firstname' => array('limit'=>1), 'surname' => array('limit'=>1), 'email' => array('limit'=>1)); 46 46 47 47 protected $error; 48 49 /** 50 * Returns addressbook name (e.g. for addressbooks listing) 51 */ 52 abstract function get_name(); 48 53 49 54 /** … … 130 135 return $this->error; 131 136 } 132 137 133 138 /** 134 139 * Setter for errors for internal use … … 379 384 } 380 385 } 381 386 382 387 return $out; 383 388 } … … 398 403 array(' ', '\\1\\2', ' '), 399 404 $str)); 400 405 401 406 foreach ($arr as $i => $part) { 402 407 if (utf8_encode(utf8_decode($part)) == $part) { // is latin-1 ? … … 409 414 $arr[$i] = mb_strtolower($part); 410 415 } 411 416 412 417 return join(" ", $arr); 413 418 } -
trunk/roundcubemail/program/include/rcube_contacts.php
r4839 r4857 42 42 private $filter = null; 43 43 private $result = null; 44 private $name; 44 45 private $cache; 45 46 private $table_cols = array('name', 'email', 'firstname', 'surname'); … … 77 78 78 79 /** 80 * Returns addressbook name 81 */ 82 function get_name() 83 { 84 return $this->name; 85 } 86 87 88 /** 79 89 * Save a search string for future listings 80 90 * 81 * @param string SQL params to use in listing method91 * @param string SQL params to use in listing method 82 92 */ 83 93 function set_search_set($filter) -
trunk/roundcubemail/program/include/rcube_ldap.php
r4851 r4857 293 293 294 294 /** 295 * Bind connection with DN and password 296 * 297 * @param string Bind DN 298 * @param string Bind password 299 * @return boolean True on success, False on error 300 */ 295 * Bind connection with DN and password 296 * 297 * @param string Bind DN 298 * @param string Bind password 299 * 300 * @return boolean True on success, False on error 301 */ 301 302 private function _bind($dn, $pass) 302 303 { … … 325 326 326 327 /** 327 * Close connection to LDAP server328 */328 * Close connection to LDAP server 329 */ 329 330 function close() 330 331 { … … 339 340 340 341 /** 341 * Set internal list page 342 * 343 * @param number Page number to list 344 * @access public 345 */ 342 * Returns address book name 343 * 344 * @return string Address book name 345 */ 346 function get_name() 347 { 348 return $this->prop['name']; 349 } 350 351 352 /** 353 * Set internal list page 354 * 355 * @param number $page Page number to list 356 */ 346 357 function set_page($page) 347 358 { … … 351 362 352 363 /** 353 * Set internal page size 354 * 355 * @param number Number of messages to display on one page 356 * @access public 357 */ 364 * Set internal page size 365 * 366 * @param number $size Number of messages to display on one page 367 */ 358 368 function set_pagesize($size) 359 369 { … … 363 373 364 374 /** 365 * Save a search string for future listings366 *367 * @param stringFilter string368 */375 * Save a search string for future listings 376 * 377 * @param string $filter Filter string 378 */ 369 379 function set_search_set($filter) 370 380 { … … 374 384 375 385 /** 376 * Getter for saved search properties377 *378 * @return mixed Search properties used by this class379 */386 * Getter for saved search properties 387 * 388 * @return mixed Search properties used by this class 389 */ 380 390 function get_search_set() 381 391 { … … 385 395 386 396 /** 387 * Reset all saved results and search parameters388 */397 * Reset all saved results and search parameters 398 */ 389 399 function reset() 390 400 { … … 396 406 397 407 /** 398 * List the current set of contact records 399 * 400 * @param array List of cols to show 401 * @param int Only return this number of records 402 * @return array Indexed list of contact records, each a hash array 403 */ 408 * List the current set of contact records 409 * 410 * @param array List of cols to show 411 * @param int Only return this number of records 412 * 413 * @return array Indexed list of contact records, each a hash array 414 */ 404 415 function list_records($cols=null, $subset=0) 405 416 { … … 454 465 455 466 /** 456 * Search contacts457 *458 * @param mixed $fields The field name of array of field names to search in459 * @param mixed $value Search value (or array of values when $fields is array)460 * @param boolean $strict True for strict, False for partial (fuzzy) matching461 * @param boolean $select True if results are requested, False if count only462 * @param boolean $nocount (Not used)463 * @param array $required List of fields that cannot be empty464 *465 * @return array Indexed list of contact records and 'count' value466 */467 * Search contacts 468 * 469 * @param mixed $fields The field name of array of field names to search in 470 * @param mixed $value Search value (or array of values when $fields is array) 471 * @param boolean $strict True for strict, False for partial (fuzzy) matching 472 * @param boolean $select True if results are requested, False if count only 473 * @param boolean $nocount (Not used) 474 * @param array $required List of fields that cannot be empty 475 * 476 * @return array Indexed list of contact records and 'count' value 477 */ 467 478 function search($fields, $value, $strict=false, $select=true, $nocount=false, $required=array()) 468 479 { … … 544 555 545 556 /** 546 * Count number of available contacts in database547 *548 * @return object rcube_result_set Resultset with values for 'count' and 'first'549 */557 * Count number of available contacts in database 558 * 559 * @return object rcube_result_set Resultset with values for 'count' and 'first' 560 */ 550 561 function count() 551 562 { … … 571 582 572 583 /** 573 * Return the last result set574 *575 * @return object rcube_result_set Current resultset or NULL if nothing selected yet576 */584 * Return the last result set 585 * 586 * @return object rcube_result_set Current resultset or NULL if nothing selected yet 587 */ 577 588 function get_result() 578 589 { … … 582 593 583 594 /** 584 * Get a specific contact record 585 * 586 * @param mixed Record identifier 587 * @param boolean Return as associative array 588 * @return mixed Hash array or rcube_result_set with all record fields 589 */ 595 * Get a specific contact record 596 * 597 * @param mixed Record identifier 598 * @param boolean Return as associative array 599 * 600 * @return mixed Hash array or rcube_result_set with all record fields 601 */ 590 602 function get_record($dn, $assoc=false) 591 603 { … … 625 637 * 626 638 * @param array Assoziative array with data to save 639 * 627 640 * @return boolean True if input is valid, False if not. 628 641 */ … … 634 647 return false; 635 648 } 636 649 637 650 // validate e-mail addresses 638 651 return parent::validate($save_data); … … 641 654 642 655 /** 643 * Create a new contact record 644 * 645 * @param array Hash array with save data 646 * @return encoded record ID on success, False on error 647 */ 656 * Create a new contact record 657 * 658 * @param array Hash array with save data 659 * 660 * @return encoded record ID on success, False on error 661 */ 648 662 function insert($save_cols) 649 663 { … … 699 713 700 714 /** 701 * Update a specific contact record 702 * 703 * @param mixed Record identifier 704 * @param array Hash array with save data 705 * @return boolean True on success, False on error 706 */ 715 * Update a specific contact record 716 * 717 * @param mixed Record identifier 718 * @param array Hash array with save data 719 * 720 * @return boolean True on success, False on error 721 */ 707 722 function update($id, $save_cols) 708 723 { … … 714 729 $replacedata = array(); 715 730 $deletedata = array(); 731 716 732 foreach ($this->fieldmap as $col => $fld) { 717 733 $val = $save_cols[$col]; … … 817 833 818 834 /** 819 * Mark one or more contact records as deleted 820 * 821 * @param array Record identifiers 822 * @return boolean True on success, False on error 823 */ 835 * Mark one or more contact records as deleted 836 * 837 * @param array Record identifiers 838 * 839 * @return boolean True on success, False on error 840 */ 824 841 function delete($ids) 825 842 { … … 857 874 858 875 /** 859 * Execute the LDAP search based on the stored credentials 860 * 861 * @access private 862 */ 876 * Execute the LDAP search based on the stored credentials 877 */ 863 878 private function _exec_search($count = false) 864 879 { … … 895 910 return false; 896 911 } 897 912 898 913 /** 899 914 * Set server controls for Virtual List View (paginated listing) … … 918 933 919 934 /** 920 * @access private921 */935 * Converts LDAP entry into an array 936 */ 922 937 private function _ldap2result($rec) 923 938 { … … 948 963 949 964 /** 950 * @access private951 */965 * Return real field name (from fields map) 966 */ 952 967 private function _map_field($field) 953 968 { … … 957 972 958 973 /** 959 * @access private960 */961 private function _attr_name($name)974 * Returns unified attribute name (resolving aliases) 975 */ 976 private static function _attr_name($name) 962 977 { 963 978 // list of known attribute aliases … … 974 989 975 990 /** 976 * @access private977 */991 * Prints debug info to the log 992 */ 978 993 private function _debug($str) 979 994 { … … 984 999 985 1000 /** 986 * @static 987 */ 988 private function _quote_string($str, $dn=false) 1001 * Quotes attribute value string 1002 * 1003 * @param string $str Attribute value 1004 * @param bool $dn True if the attribute is a DN 1005 * 1006 * @return string Quoted string 1007 */ 1008 private static function _quote_string($str, $dn=false) 989 1009 { 990 1010 // take firt entry if array given … … 1296 1316 # construct the string from right to left 1297 1317 $str = "020100"; # contentCount 1298 1318 1299 1319 $ber_val = self::_ber_encode_int($offset); // returns encoded integer value in hex format 1300 1320 … … 1358 1378 $val = dechex($offset); 1359 1379 $prefix = ''; 1360 1380 1361 1381 // check if bit 8 of high byte is 1 1362 1382 if (preg_match('/^[89abcdef]/', $val)) -
trunk/roundcubemail/program/steps/addressbook/func.inc
r4852 r4857 82 82 83 83 $OUTPUT->set_pagetitle(rcube_label('addressbook')); 84 $_SESSION['addressbooks_count'] = count($js_list); 84 85 85 86 $CONTACTS = rcmail_contact_source($source, true); -
trunk/roundcubemail/program/steps/addressbook/show.inc
r4850 r4857 33 33 } 34 34 35 // get address book name (for display) 36 if ($_SESSION['addressbooks_count'] > 1) { 37 $name = $CONTACTS->get_name(); 38 if (!$name && $source == 0) { 39 $name = rcube_label('personaladrbook'); 40 } 41 $OUTPUT->set_env('sourcename', $name); 42 } 43 35 44 // return raw photo of the given contact 36 45 if ($RCMAIL->action == 'photo') { -
trunk/roundcubemail/skins/default/addressbook.css
r4834 r4857 385 385 padding: 2px; 386 386 } 387 388 #sourcename 389 { 390 color: #666; 391 font-size: 10px; 392 margin-left: 2px; 393 } -
trunk/roundcubemail/skins/default/templates/contact.html
r4424 r4857 10 10 <div id="contact-title" class="boxtitle"><roundcube:label name="contactproperties" /></div> 11 11 <div id="contact-details" class="boxcontent"> 12 <roundcube:if condition="strlen(env:sourcename)" /> 13 <div id="sourcename"><roundcube:label name="addressbook" />: <roundcube:var name="env:sourcename" /></div> 14 <roundcube:endif /> 15 12 16 <div id="contactphoto"><roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" /></div> 13 17 <roundcube:object name="contacthead" id="contacthead" />
Note: See TracChangeset
for help on using the changeset viewer.
