Changeset 631 in subversion
- Timestamp:
- Jul 2, 2007 12:01:59 PM (6 years ago)
- Location:
- branches/devel-vnext/program
- Files:
-
- 1 added
- 9 edited
-
include/bootstrap.php (modified) (1 diff)
-
include/main.inc (modified) (6 diffs)
-
include/rcube_contacts_macbay.inc (added)
-
js/app.js (modified) (2 diffs)
-
steps/addressbook/delete.inc (modified) (1 diff)
-
steps/addressbook/edit.inc (modified) (6 diffs)
-
steps/addressbook/func.inc (modified) (4 diffs)
-
steps/addressbook/search.inc (modified) (3 diffs)
-
steps/mail/compose.inc (modified) (1 diff)
-
steps/mail/func.inc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-vnext/program/include/bootstrap.php
r622 r631 34 34 $include_path.= $INSTALL_PATH . 'program' . PATH_SEPARATOR; 35 35 $include_path.= $INSTALL_PATH . 'program/lib' . PATH_SEPARATOR; 36 $include_path.= '/usr/share/Zend-SVN/library' . PATH_SEPARATOR; 36 37 $include_path.= ini_get('include_path'); 37 38 -
branches/devel-vnext/program/include/main.inc
r630 r631 73 73 $registry->set('BROWSER', $BROWSER, 'core'); 74 74 75 self::tfk_debug('// load browser');75 //self::tfk_debug('// load browser'); 76 76 77 77 // load configuration … … 79 79 $registry->set('CONFIG', $CONFIG, 'core'); 80 80 81 self::tfk_debug('// load config');81 //self::tfk_debug('// load config'); 82 82 83 83 // set session garbage collecting time according to session_lifetime … … 94 94 $registry->set('DB', $DB, 'core'); 95 95 96 self::tfk_debug('// init db');96 //self::tfk_debug('// init db'); 97 97 98 98 // use database for storing session data … … 104 104 $registry->set('sess_id', $sess_id, 'core'); 105 105 106 self::tfk_debug('// session');106 //self::tfk_debug('// session'); 107 107 108 108 // create session and set session vars … … 162 162 $conf = is_array($rcmail_config) ? $rcmail_config : array(); 163 163 164 self::tfk_debug("// test");164 //self::tfk_debug("// test"); 165 165 166 166 // load host-specific configuration … … 287 287 $_SESSION['imap_host'], 288 288 $_SESSION['username'], 289 decrypt_passwd($_SESSION['password']),289 self::decrypt_passwd($_SESSION['password']), 290 290 $_SESSION['imap_port'], 291 291 $_SESSION['imap_ssl'] -
branches/devel-vnext/program/js/app.js
r630 r631 868 868 break; 869 869 870 case 'add-contact':871 this.add_contact(props);872 break;870 case 'add-contact': 871 this.add_contact(props); 872 break; 873 873 874 874 // quicksearch … … 1937 1937 }; 1938 1938 1939 // send remote request to add a new contact1940 this.add_contact = function(value)1941 { 1942 if (value)1943 this.http_post('addcontact', '_address='+value);1944 1945 return true;1939 // send remote request to add a new contact 1940 this.add_contact = function(value) 1941 { 1942 if (value) { 1943 this.http_post('addcontact', '_address='+value); 1944 } 1945 return true; 1946 1946 }; 1947 1947 -
branches/devel-vnext/program/steps/addressbook/delete.inc
r589 r631 19 19 20 20 */ 21 $registry = rc_registry::getInstance(); 22 $CONTACTS = $registry->get('CONTACTS', 'core'); 23 $OUTPUT = $registry->get('OUTPUT', 'core'); 21 24 22 if (($cid = get_input_value('_cid', RCUBE_INPUT_POST)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $cid)) 23 { 24 $deleted = $CONTACTS->delete($cid); 25 if (!$deleted) 26 { 27 // send error message 28 exit; 25 if (($cid = get_input_value('_cid', RCUBE_INPUT_POST)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $cid)) { 26 $deleted = $CONTACTS->delete($cid); 27 if (!$deleted) { 28 // send error message 29 exit; 29 30 } 30 31 31 // count contacts for this user32 $result = $CONTACTS->count();32 // count contacts for this user 33 $result = $CONTACTS->count(); 33 34 34 // update message count display35 $OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size));36 $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result->count));35 // update message count display 36 $OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size)); 37 $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result->count)); 37 38 38 // add new rows from next page (if any) 39 $pages = ceil(($result->count + $deleted) / $CONTACTS->page_size); 40 if ($_GET['_from'] != 'show' && $pages > 1 && $CONTACTS->list_page < $pages) 41 rcmail_js_contacts_list($CONTACTS->list_records(null, -$deleted)); 42 43 // send response 44 $OUTPUT->send(); 45 } 46 39 // add new rows from next page (if any) 40 $pages = ceil(($result->count + $deleted) / $CONTACTS->page_size); 41 if ($_GET['_from'] != 'show' && $pages > 1 && $CONTACTS->list_page < $pages) { 42 rcmail_js_contacts_list($CONTACTS->list_records(null, -$deleted)); 43 } 44 // send response 45 $OUTPUT->send(); 46 } 47 47 exit; 48 48 ?> -
branches/devel-vnext/program/steps/addressbook/edit.inc
r623 r631 20 20 */ 21 21 22 $registry = rc_registry::getInstance(); 23 $CONTACTS = $registry->get('CONTACTS', 'core'); 24 $OUTPUT = $registry->get('OUTPUT', 'core'); 22 25 23 26 if (($cid = rc_main::get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true))) { … … 54 57 if ($attrib['part']) { 55 58 $out = $form_start; 56 $out .= rcmail_get_edit_field($attrib['part'], $record[$attrib['part']], $attrib); 59 $out .= rcmail_get_edit_field($attrib['part'], $record[$attrib['part']], $attrib); 57 60 return $out; 58 61 } … … 74 77 } 75 78 $out .= "\n</table>$form_end"; 76 return $out; 79 return $out; 77 80 } 78 81 … … 100 103 ) 101 104 ); 102 105 103 106 if (($result = $CONTACTS->get_result()) && ($record = $result->first())) { 104 107 $hiddenfields->add(array('name' => '_cid', 'value' => $record['ID'])); … … 108 111 $form_start .= $hiddenfields->show(); 109 112 } 110 113 111 114 $form_end = (strlen($EDIT_FORM) && !strlen($attrib['form'])) ? '</form>' : ''; 112 115 $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form'; 113 116 114 117 if (!strlen($EDIT_FORM)) { 115 118 $OUTPUT->add_gui_object('editform', $form_name); … … 118 121 $registry->set('EDIT_FORM', $EDIT_FORM, 'core'); 119 122 120 return array($form_start, $form_end); 123 return array($form_start, $form_end); 121 124 } 122 123 124 125 125 126 if (!$CONTACTS->get_result() && template_exists('addcontact')) { -
branches/devel-vnext/program/steps/addressbook/func.inc
r623 r631 22 22 require_once 'include/rcube_contacts.inc'; 23 23 require_once 'include/rcube_ldap.inc'; 24 require_once 'include/rcube_contacts_macbay.inc'; 25 26 $registry = rc_registry::getInstance(); 27 $CONFIG = $registry->get('CONFIG', 'core'); 28 $OUTPUT = $registry->get('OUTPUT', 'core'); 29 30 rc_main::tfk_debug("ABOOK PLUGIN? " . $CONFIG['addressbook_plugin']); 24 31 25 32 // instantiate a contacts object according to the given source 26 if (($source = get_input_value('_source', RCUBE_INPUT_GPC)) && isset($CONFIG['ldap_public'][$source])) 27 $CONTACTS = new rcube_ldap($CONFIG['ldap_public'][$source]); 28 else 29 $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']); 30 33 if (($source = get_input_value('_source', RCUBE_INPUT_GPC)) && isset($CONFIG['ldap_public'][$source])) { 34 $CONTACTS = new rcube_ldap($CONFIG['ldap_public'][$source]); 35 } 36 else { 37 if (isset($CONFIG['addressbook_plugin']) && empty($CONFIG['addressbook_plugin']) === FALSE) { 38 $CONTACTS = new rcube_contacts_macbay( 39 $_SESSION['username'], 40 $_SESSION['password'] 41 ); 42 } 43 else { 44 $DB = $registry->get('DB', 'core'); 45 $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']); 46 } 47 } 31 48 $CONTACTS->set_pagesize($CONFIG['pagesize']); 49 $registry->set('CONTACTS', $CONTACTS, 'core'); 32 50 33 51 // set list properties and session vars 34 if (!empty($_GET['_page'])) 35 { 36 $CONTACTS->set_page(intval($_GET['_page'])); 37 $_SESSION['page'] = $_GET['_page']; 38 } 39 else 40 $CONTACTS->set_page(isset($_SESSION['page']) ?$_SESSION['page'] : 1); 52 if (!empty($_GET['_page'])) { 53 $CONTACTS->set_page(intval($_GET['_page'])); 54 $_SESSION['page'] = $_GET['_page']; 55 } 56 else { 57 $CONTACTS->set_page(isset($_SESSION['page']) ?$_SESSION['page'] : 1); 58 } 59 $CONTACTS = $registry->set('CONTACTS', $CONTACTS, 'core'); 41 60 42 61 // set message set for search result 43 if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) 44 $CONTACTS->set_search_set($_SESSION['search'][$_REQUEST['_search']]);45 62 if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) { 63 $CONTACTS->set_search_set($_SESSION['search'][$_REQUEST['_search']]); 64 } 46 65 // set data source env 47 66 $OUTPUT->set_env('source', $source ? $source : '0'); … … 50 69 // add list of address sources to client env 51 70 $js_list = array("0" => array('id' => 0, 'readonly' => false)); 52 foreach ((array)$CONFIG['ldap_public'] as $id => $prop) 53 $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writeable']); 71 foreach ((array)$CONFIG['ldap_public'] as $id => $prop) { 72 $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writeable']); 73 } 54 74 $OUTPUT->set_env('address_sources', $js_list); 55 75 … … 57 77 function rcmail_directory_list($attrib) 58 78 { 59 global $CONFIG, $OUTPUT; 60 61 if (!$attrib['id']) 62 $attrib['id'] = 'rcmdirectorylist'; 63 64 $local_id = '0'; 65 $current = get_input_value('_source', RCUBE_INPUT_GPC); 66 $line_templ = '<li id="%s" class="%s"><a href="%s"' . 67 ' onclick="return %s.command(\'list\',\'%s\',this)"' . 68 ' onmouseover="return %s.focus_folder(\'%s\')"' . 69 ' onmouseout="return %s.unfocus_folder(\'%s\')"' . 70 ' onmouseup="return %s.folder_mouse_up(\'%s\')">%s'. 71 "</a></li>\n"; 72 73 // allow the following attributes to be added to the <ul> tag 74 $out = '<ul' . rc_main::create_attrib_string($attrib, array('style', 'class', 'id')) . ">\n"; 75 $out .= sprintf($line_templ, 76 'rcmli'.$local_id, 77 !$current ? 'selected' : '', 78 rc_main::Q(rc_main::rcmail_url('list', array('_source' => 0))), 79 JS_OBJECT_NAME, 80 $local_id, 81 JS_OBJECT_NAME, 82 $local_id, 83 JS_OBJECT_NAME, 84 $local_id, 85 JS_OBJECT_NAME, 86 $local_id, 87 rcube_label('personaladrbook')); 88 89 foreach ((array)$CONFIG['ldap_public'] as $id => $prop) 90 { 91 $js_id = rc_main_::JQ($id); 92 $dom_id = preg_replace('/[^a-z0-9\-_]/i', '', $id); 93 $out .= sprintf($line_templ, 94 'rcmli'.$dom_id, 95 $current == $id ? 'selected' : '', 96 rc_main::Q(rc_main::rcmail_url('list', array('_source' => $id))), 97 JS_OBJECT_NAME, 98 $js_id, 99 JS_OBJECT_NAME, 100 $js_id, 101 JS_OBJECT_NAME, 102 $js_id, 103 JS_OBJECT_NAME, 104 $js_id, 105 !empty($prop['name']) ? rc_main::Q($prop['name']) : rc_main::Q($id)); 106 } 107 108 $out .= '</ul>'; 109 110 $OUTPUT->add_gui_object('folderlist', $attrib['id']); 111 112 return $out; 79 $registry = rc_registry::getInstance(); 80 $CONFIG = $registry->get('CONFIG', 'core'); 81 $OUTPUT = $registry->get('OUTPUT', 'core'); 82 83 if (!$attrib['id']) { 84 $attrib['id'] = 'rcmdirectorylist'; 85 } 86 87 $local_id = '0'; 88 $current = rc_main::get_input_value('_source', RCUBE_INPUT_GPC); 89 90 $line_templ = '<li id="%s" class="%s"><a href="%s"'; 91 $line_templ.= ' onclick="return %s.command(\'list\',\'%s\',this)"'; 92 $line_templ.= ' onmouseover="return %s.focus_folder(\'%s\')"'; 93 $line_templ.= ' onmouseout="return %s.unfocus_folder(\'%s\')"'; 94 $line_templ.= ' onmouseup="return %s.folder_mouse_up(\'%s\')">%s'; 95 $line_templ.= "</a></li>\n"; 96 97 // allow the following attributes to be added to the <ul> tag 98 $out = '<ul' . rc_main::create_attrib_string($attrib, array('style', 'class', 'id')) . ">\n"; 99 $out.= sprintf( 100 $line_templ, 101 'rcmli'.$local_id, 102 !$current ? 'selected' : '', 103 rc_main::Q(rc_main::rcmail_url('list', array('_source' => 0))), 104 JS_OBJECT_NAME, 105 $local_id, 106 JS_OBJECT_NAME, 107 $local_id, 108 JS_OBJECT_NAME, 109 $local_id, 110 JS_OBJECT_NAME, 111 $local_id, 112 rcube_label('personaladrbook') 113 ); 114 115 foreach ((array)$CONFIG['ldap_public'] as $id => $prop) { 116 $js_id = rc_main_::JQ($id); 117 $dom_id = preg_replace('/[^a-z0-9\-_]/i', '', $id); 118 $out .= sprintf( 119 $line_templ, 120 'rcmli'.$dom_id, 121 $current == $id ? 'selected' : '', 122 rc_main::Q(rc_main::rcmail_url('list', array('_source' => $id))), 123 JS_OBJECT_NAME, 124 $js_id, 125 JS_OBJECT_NAME, 126 $js_id, 127 JS_OBJECT_NAME, 128 $js_id, 129 JS_OBJECT_NAME, 130 $js_id, 131 !empty($prop['name']) ? rc_main::Q($prop['name']) : rc_main::Q($id) 132 ); 133 } 134 135 $out .= '</ul>'; 136 137 $OUTPUT->add_gui_object('folderlist', $attrib['id']); 138 139 return $out; 113 140 } 114 141 … … 116 143 // return the message list as HTML table 117 144 function rcmail_contacts_list($attrib) 118 { 119 global $CONTACTS, $OUTPUT; 120 121 // count contacts for this user 122 $result = $CONTACTS->list_records(); 123 124 // add id to message list table if not specified 125 if (!strlen($attrib['id'])) 126 $attrib['id'] = 'rcmAddressList'; 127 128 // define list of cols to be displayed 129 $a_show_cols = array('name'); 130 131 // create XHTML table 132 $out = rcube_table_output($attrib, $result->records, $a_show_cols, $CONTACTS->primary_key); 133 134 // set client env 135 $OUTPUT->add_gui_object('contactslist', $attrib['id']); 136 $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page); 137 $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size)); 138 $OUTPUT->include_script('list.js'); 139 140 // add some labels to client 141 rcube_add_label('deletecontactconfirm'); 142 143 return $out; 144 } 145 { 146 $registry = rc_registry::getInstance(); 147 $CONTACTS = $registry->get('CONTACTS', 'core'); 148 $OUTPUT = $registry->get('OUTPUT', 'core'); 149 150 // count contacts for this user 151 $result = $CONTACTS->list_records(); 152 153 // add id to message list table if not specified 154 if (!strlen($attrib['id'])) { 155 $attrib['id'] = 'rcmAddressList'; 156 } 157 // define list of cols to be displayed 158 $a_show_cols = array('name'); 159 160 // create XHTML table 161 $out = rc_main::rcube_table_output( 162 $attrib, 163 $result->records, 164 $a_show_cols, 165 $CONTACTS->primary_key 166 ); 167 168 // set client env 169 $OUTPUT->add_gui_object('contactslist', $attrib['id']); 170 $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page); 171 $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size)); 172 $OUTPUT->include_script('list.js'); 173 174 // add some labels to client 175 rcube_add_label('deletecontactconfirm'); 176 177 return $out; 178 } 145 179 146 180 147 181 function rcmail_js_contacts_list($result, $prefix='') 148 {149 global $OUTPUT;150 151 if (empty($result) || $result->count == 0) 152 return;153 154 // define list of cols to be displayed155 $a_show_cols = array('name');156 157 while ($row = $result->next()) 158 {159 $a_row_cols = array();160 161 // format each col162 foreach ($a_show_cols as $col)163 $a_row_cols[$col] = $row[$col];164 165 $OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols);166 } 167 }182 { 183 $registry = rc_registry::getInstance(); 184 $OUTPUT = $registry->get('OUTPUT', 'core'); 185 186 if (empty($result) || $result->count == 0) { 187 return; 188 } 189 // define list of cols to be displayed 190 $a_show_cols = array('name'); 191 192 while ($row = $result->next()) { 193 $a_row_cols = array(); 194 195 // format each col 196 foreach ($a_show_cols as $col) { 197 $a_row_cols[$col] = $row[$col]; 198 } 199 $OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols); 200 } 201 } 168 202 169 203 170 204 // similar function as /steps/settings/identities.inc::rcmail_identity_frame() 171 205 function rcmail_contact_frame($attrib) 172 { 173 global $OUTPUT; 174 175 if (!$attrib['id']) 176 $attrib['id'] = 'rcmcontactframe'; 177 178 $attrib['name'] = $attrib['id']; 179 $attrib_str = rc_main::create_attrib_string($attrib, array('name', 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder')); 180 181 $OUTPUT->set_env('contentframe', $attrib['name']); 182 $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif'); 183 return '<iframe'. $attrib_str . '></iframe>'; 206 { 207 $registry = rc_registry::getInstance(); 208 $OUTPUT = $registry->get('OUTPUT', 'core'); 209 210 if (!$attrib['id']) { 211 $attrib['id'] = 'rcmcontactframe'; 212 } 213 $attrib['name'] = $attrib['id']; 214 $attrib_str = rc_main::create_attrib_string( 215 $attrib, 216 array( 217 'name', 218 'id', 219 'class', 220 'style', 221 'src', 222 'width', 223 'height', 224 'frameborder' 225 ) 226 ); 227 228 $OUTPUT->set_env('contentframe', $attrib['name']); 229 $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif'); 230 return '<iframe'. $attrib_str . '></iframe>'; 184 231 } 185 232 186 233 187 234 function rcmail_rowcount_display($attrib) 188 { 189 global $OUTPUT; 190 191 if (!$attrib['id']) 192 $attrib['id'] = 'rcmcountdisplay'; 193 194 $OUTPUT->add_gui_object('countdisplay', $attrib['id']); 195 196 // allow the following attributes to be added to the <span> tag 197 $attrib_str = rc_main::create_attrib_string($attrib, array('style', 'class', 'id')); 198 199 $out = '<span' . $attrib_str . '>'; 200 $out .= rcmail_get_rowcount_text(); 201 $out .= '</span>'; 202 return $out; 203 } 235 { 236 $registry = rc_registry::getInstance(); 237 $OUTPUT = $registry->get('OUTPUT', 'core'); 238 239 if (!$attrib['id']) { 240 $attrib['id'] = 'rcmcountdisplay'; 241 } 242 $OUTPUT->add_gui_object('countdisplay', $attrib['id']); 243 244 // allow the following attributes to be added to the <span> tag 245 $attrib_str = rc_main::create_attrib_string($attrib, array('style', 'class', 'id')); 246 247 $out = '<span' . $attrib_str . '>'; 248 $out .= rcmail_get_rowcount_text(); 249 $out .= '</span>'; 250 return $out; 251 } 204 252 205 253 206 254 207 255 function rcmail_get_rowcount_text() 208 { 209 global $CONTACTS; 210 211 // read nr of contacts 212 $result = $CONTACTS->get_result(); 213 if (!$result) 214 $result = $CONTACTS->count(); 215 216 if ($result->count == 0) 217 $out = rcube_label('nocontactsfound'); 218 else 219 $out = rcube_label(array( 220 'name' => 'contactsfromto', 221 'vars' => array( 222 'from' => $result->first + 1, 223 'to' => min($result->count, $result->first + $CONTACTS->page_size), 224 'count' => $result->count) 225 )); 226 227 return $out; 228 } 229 230 256 { 257 $registry = rc_registry::getInstance(); 258 $CONTACTS = $registry->get('CONTACTS', 'core'); 259 260 // read nr of contacts 261 $result = $CONTACTS->get_result(); 262 if (!$result) { 263 $result = $CONTACTS->count(); 264 } 265 if ($result->count == 0) { 266 $out = rcube_label('nocontactsfound'); 267 } 268 else { 269 $out = rcube_label(array( 270 'name' => 'contactsfromto', 271 'vars' => array( 272 'from' => $result->first + 1, 273 'to' => min($result->count, $result->first + $CONTACTS->page_size), 274 'count' => $result->count) 275 ) 276 ); 277 } 278 return $out; 279 } 280 281 231 282 // register UI objects 232 $OUTPUT->add_handlers(array( 233 'directorylist' => 'rcmail_directory_list', 234 'addresslist' => 'rcmail_contacts_list', 235 'addressframe' => 'rcmail_contact_frame', 236 'recordscountdisplay' => 'rcmail_rowcount_display', 237 'searchform' => 'rcmail_search_form' 238 )); 239 283 $OUTPUT->add_handlers( 284 array( 285 'directorylist' => 'rcmail_directory_list', 286 'addresslist' => 'rcmail_contacts_list', 287 'addressframe' => 'rcmail_contact_frame', 288 'recordscountdisplay' => 'rcmail_rowcount_display', 289 'searchform' => 'rcmail_search_form' 290 ) 291 ); 240 292 ?> -
branches/devel-vnext/program/steps/addressbook/search.inc
r589 r631 19 19 20 20 */ 21 $registry = rc_registry::getInstance(); 22 $CONTACTS = $registry->get('CONTACTS', 'core'); 23 $OUTPUT = $registry->get('OUTPUT', 'core'); 24 21 25 22 26 $CONTACTS->set_page(1); 23 27 $_SESSION['page'] = 1; 24 28 25 $search = trim( get_input_value('_q', RCUBE_INPUT_GET));29 $search = trim(rc_main::get_input_value('_q', RCUBE_INPUT_GET)); 26 30 $search_request = md5('addr'.$search); 27 31 … … 29 33 $result = $CONTACTS->search(array('name','email'), $search); 30 34 31 if ($result->count > 0) 32 { 33 // save search settings in session 34 $_SESSION['search'][$search_request] = $CONTACTS->get_search_set(); 35 36 // create javascript list 37 rcmail_js_contacts_list($result); 35 if ($result->count > 0) { 36 // save search settings in session 37 $_SESSION['search'][$search_request] = $CONTACTS->get_search_set(); 38 39 // create javascript list 40 rcmail_js_contacts_list($result); 38 41 } 39 else 40 { 41 $OUTPUT->show_message('nocontactsfound', 'warning'); 42 $search_request = -1; 42 else { 43 $OUTPUT->show_message('nocontactsfound', 'warning'); 44 $search_request = -1; 43 45 } 44 46 … … 47 49 $OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size)); 48 50 $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text()); 49 51 50 52 // send response 51 53 $OUTPUT->send(); -
branches/devel-vnext/program/steps/mail/compose.inc
r626 r631 156 156 /****** get contacts for this user and add them to client scripts ********/ 157 157 require_once 'include/rcube_contacts.inc'; 158 require_once 'include/rcube_contacts_macbay.inc'; 158 159 159 $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']); 160 $CONTACTS->set_pagesize(1000); 160 if (isset($CONFIG['addressbook_plugin'])) { 161 $CONTACTS = new rcube_contacts_macbay($_SESSION['username'], $_SESSION['password']); 162 } 163 else { 164 $DB = $registry->get('DB', 'core'); 161 165 166 $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']); 167 $CONTACTS->set_pagesize(1000); 168 } 162 169 if ($result = $CONTACTS->list_records()) { 163 170 $a_contacts = array(); -
branches/devel-vnext/program/steps/mail/func.inc
r629 r631 1281 1281 $sa_attrib = $registry->get('sa_attrib', 'core'); 1282 1282 1283 rc_main::tfk_debug('rcmail_message_headers: hello? hello!');1283 //rc_main::tfk_debug('rcmail_message_headers: hello? hello!'); 1284 1284 1285 1285 // keep header table attrib … … 1297 1297 } 1298 1298 1299 rc_main::tfk_debug('MESSAGE: ' . var_export($MESSAGE, true));1299 //rc_main::tfk_debug('MESSAGE: ' . var_export($MESSAGE, true)); 1300 1300 1301 1301 // get associative array of headers object … … 1312 1312 $standard_headers = array('subject', 'from', 'organization', 'to', 'cc', 'bcc', 'reply-to', 'date'); 1313 1313 1314 rc_main::tfk_debug('rcmail_message_headers: ' . var_export($headers, true));1314 //rc_main::tfk_debug('rcmail_message_headers: ' . var_export($headers, true)); 1315 1315 1316 1316 foreach ($standard_headers as $hkey) { … … 1718 1718 rc_main::Q($part['mailto']), 1719 1719 rc_main::Q($part['name'])); 1720 /**1721 * Build icon to allow adding to addressbook.1722 * @ignore1723 */1724 /*1725 1720 if ($addicon) { 1726 1721 $out .= sprintf( … … 1732 1727 $addicon 1733 1728 ); 1734 } */1729 } 1735 1730 } 1736 1731 else {
Note: See TracChangeset
for help on using the changeset viewer.
