Changeset 4901 in subversion
- Timestamp:
- Jul 2, 2011 11:27:46 AM (2 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 6 edited
-
program/js/app.js (modified) (1 diff)
-
program/steps/addressbook/edit.inc (modified) (6 diffs)
-
program/steps/addressbook/func.inc (modified) (2 diffs)
-
program/steps/addressbook/save.inc (modified) (1 diff)
-
skins/default/addressbook.css (modified) (1 diff)
-
skins/default/templates/contactadd.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/js/app.js
r4898 r4901 638 638 // contacts/identities 639 639 else { 640 if ((input = $("input[name='_name']", form)) &&input.length && input.val() == '') { 640 // 641 if (props == 'reload') { 642 form.action += '?_reload=1'; 643 } 644 else if ((input = $("input[name='_name']", form)) &&input.length && input.val() == '') { 641 645 alert(this.get_label('nonamewarning')); 642 646 input.focus(); -
trunk/roundcubemail/program/steps/addressbook/edit.inc
r4892 r4901 56 56 $SOURCE_ID = $source; 57 57 58 58 59 function rcmail_get_edit_record() 59 60 { … … 106 107 } 107 108 108 109 109 function rcmail_contact_editform($attrib) 110 110 { … … 167 167 return $form_start . $out . $form_end; 168 168 } 169 170 169 171 170 function rcmail_upload_photo_form($attrib) … … 205 204 } 206 205 207 208 206 // similar function as in /steps/settings/edit_identity.inc 209 207 function get_form_tags($attrib) 210 208 { 211 global $CONTACTS, $EDIT_FORM, $RCMAIL ;209 global $CONTACTS, $EDIT_FORM, $RCMAIL, $SOURCE_ID; 212 210 213 211 $form_start = $form_end = ''; 214 212 215 213 if (empty($EDIT_FORM)) { 216 $hiddenfields = new html_hiddenfield(array( 217 'name' => '_source', 'value' => get_input_value('_source', RCUBE_INPUT_GPC))); 214 $hiddenfields = new html_hiddenfield(); 215 216 if ($RCMAIL->action == 'edit') 217 $hiddenfields->add(array('name' => '_source', 'value' => $SOURCE_ID)); 218 218 $hiddenfields->add(array('name' => '_gid', 'value' => $CONTACTS->group_id)); 219 219 … … 235 235 } 236 236 237 function rcmail_source_selector($attrib) 238 { 239 global $RCMAIL, $SOURCE_ID; 240 241 $sources_list = $RCMAIL->get_address_sources(true); 242 243 if (count($sources_list) < 2) { 244 $source = $sources_list[$SOURCE_ID]; 245 $hiddenfield = new html_hiddenfield(array('name' => '_source', 'value' => $SOURCE_ID)); 246 return html::span($attrib, Q($source['name']) . $hiddenfield->show()); 247 } 248 249 $attrib['name'] = '_source'; 250 $attrib['onchange'] = JS_OBJECT_NAME . ".command('save', 'reload', this.form)"; 251 252 $select = new html_select($attrib); 253 254 foreach ($sources_list as $source) 255 $select->add($source['name'], $source['id']); 256 257 return $select->show($SOURCE_ID); 258 } 259 237 260 238 261 $OUTPUT->add_handlers(array( … … 241 264 'contactphoto' => 'rcmail_contact_photo', 242 265 'photouploadform' => 'rcmail_upload_photo_form', 266 'sourceselector' => 'rcmail_source_selector', 243 267 )); 244 268 -
trunk/roundcubemail/program/steps/addressbook/func.inc
r4892 r4901 69 69 $source = $js_list[key($js_list)]['id']; 70 70 71 // find writeable source 71 // count writeable sources 72 $writeable = 0; 72 73 foreach ($js_list as $s) { 73 74 if (!$s['readonly']) { 74 $OUTPUT->set_env('writable_source', $s['id']); 75 break; 75 $writeable++; 76 76 } 77 77 } … … 80 80 $OUTPUT->set_env('search_mods', $search_mods); 81 81 $OUTPUT->set_env('address_sources', $js_list); 82 $OUTPUT->set_env('writable_source', $writeable); 82 83 83 84 $OUTPUT->set_pagetitle(rcube_label('addressbook')); 84 85 $_SESSION['addressbooks_count'] = count($js_list); 86 $_SESSION['addressbooks_count_writeable'] = $writeable; 85 87 86 88 $CONTACTS = rcmail_contact_source($source, true); -
trunk/roundcubemail/program/steps/addressbook/save.inc
r4850 r4901 24 24 $return_action = empty($cid) ? 'add' : 'edit'; 25 25 26 27 // Source changed, display the form again 28 if (!empty($_GET['_reload'])) { 29 rcmail_overwrite_action($return_action); 30 return; 31 } 26 32 27 33 // cannot edit record -
trunk/roundcubemail/skins/default/addressbook.css
r4880 r4901 220 220 { 221 221 position: relative; 222 padding-bottom: 22px;222 padding-bottom: 12px; 223 223 } 224 224 -
trunk/roundcubemail/skins/default/templates/contactadd.html
r4834 r4901 11 11 <div id="contact-details" class="boxcontent"> 12 12 <form name="editform" method="post" action="./"> 13 <div id="sourcename" style="height: 20px"> 14 <roundcube:label name="addressbook" />: <roundcube:object name="sourceselector" class="hint" id="sourceselect" /> 15 </div> 13 16 <div id="contactphoto"> 14 17 <roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" />
Note: See TracChangeset
for help on using the changeset viewer.
