summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-06-04 12:10:49 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-06-04 12:10:49 +0200
commit24e89eceed9694882ff943c4106519fab449705f (patch)
tree64d12a7774175b5b01b193ae6fe68ef846b2c490 /program
parent77043f8469ba8e7b64af5b0192b0297ded5c615f (diff)
Add fieldset legends and input element labels to contact edit form
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js17
-rw-r--r--program/localization/en_US/labels.inc2
-rw-r--r--program/steps/addressbook/edit.inc3
-rw-r--r--program/steps/addressbook/func.inc6
-rw-r--r--program/steps/addressbook/show.inc1
5 files changed, 16 insertions, 13 deletions
diff --git a/program/js/app.js b/program/js/app.js
index ea7265d59..1f6582bf6 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -5562,6 +5562,7 @@ function rcube_webmail()
if (appendcontainer.length && appendcontainer.get(0).nodeName == 'FIELDSET') {
var input, colprop = this.env.coltypes[col],
+ input_id = 'ff_' + col + (colprop.count || 0),
row = $('<div>').addClass('row'),
cell = $('<div>').addClass('contactfieldcontent data'),
label = $('<div>').addClass('contactfieldlabel label');
@@ -5569,13 +5570,13 @@ function rcube_webmail()
if (colprop.subtypes_select)
label.html(colprop.subtypes_select);
else
- label.html(colprop.label);
+ label.html('<label for="' + input_id + '">' + colprop.label + '</label>');
var name_suffix = colprop.limit != 1 ? '[]' : '';
if (colprop.type == 'text' || colprop.type == 'date') {
input = $('<input>')
.addClass('ff_'+col)
- .attr({type: 'text', name: '_'+col+name_suffix, size: colprop.size})
+ .attr({type: 'text', name: '_'+col+name_suffix, size: colprop.size, id: input_id})
.appendTo(cell);
this.init_edit_field(col, input);
@@ -5586,7 +5587,7 @@ function rcube_webmail()
else if (colprop.type == 'textarea') {
input = $('<textarea>')
.addClass('ff_'+col)
- .attr({ name: '_'+col+name_suffix, cols:colprop.size, rows:colprop.rows })
+ .attr({ name: '_'+col+name_suffix, cols:colprop.size, rows:colprop.rows, id: input_id })
.appendTo(cell);
this.init_edit_field(col, input);
@@ -5621,7 +5622,7 @@ function rcube_webmail()
else if (colprop.type == 'select') {
input = $('<select>')
.addClass('ff_'+col)
- .attr('name', '_'+col+name_suffix)
+ .attr({ 'name': '_'+col+name_suffix, id: input_id })
.appendTo(cell);
var options = input.attr('options');
@@ -6953,13 +6954,7 @@ function rcube_webmail()
container.data('callback')($(this).data('id'));
return false;
});
-/*
- // hide selector on click out of selector element
- var fn = function(e) { if (e.target != container.get(0)) container.hide(); };
- $(document.body).on('mouseup', fn);
- $('iframe').contents().on('mouseup', fn)
- .load(function(e) { try { $(this).contents().on('mouseup', fn); } catch(e) {}; });
-*/
+
this.folder_selector_element = container;
}
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 9d3863497..d1c642bd2 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -353,7 +353,9 @@ $labels['addcontact'] = 'Add new contact';
$labels['editcontact'] = 'Edit contact';
$labels['contacts'] = 'Contacts';
$labels['contactproperties'] = 'Contact properties';
+$labels['contactnameandorg'] = 'Name and Organization';
$labels['personalinfo'] = 'Personal information';
+$labels['contactphoto'] = 'Contact photo';
$labels['edit'] = 'Edit';
$labels['cancel'] = 'Cancel';
diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc
index 3bbbfccdf..0fc753056 100644
--- a/program/steps/addressbook/edit.inc
+++ b/program/steps/addressbook/edit.inc
@@ -98,12 +98,15 @@ function rcmail_get_edit_record()
function rcmail_contact_edithead($attrib)
{
+ global $RCMAIL;
+
// check if we have a valid result
$record = rcmail_get_edit_record();
$i_size = !empty($attrib['size']) ? $attrib['size'] : 20;
$form = array(
'head' => array(
+ 'name' => $RCMAIL->gettext('contactnameandorg'),
'content' => array(
'prefix' => array('size' => $i_size),
'firstname' => array('size' => $i_size, 'visible' => true),
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index e68a694ef..8955488bd 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -649,6 +649,8 @@ function rcmail_contact_form($form, $record, $attrib = null)
if ($subtypes[$i])
$subtype = $subtypes[$i];
+ $colprop['id'] = 'ff_' . $col . intval($coltypes[$field]['count']);
+
// render composite field
if ($colprop['type'] == 'composite') {
$composite = array(); $j = 0;
@@ -714,7 +716,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
// display row with label
if ($label) {
$rows .= html::div('row',
- html::div('contactfieldlabel label', $select_subtype ? $select_subtype->show($subtype) : rcube::Q($label)) .
+ html::div('contactfieldlabel label', $select_subtype ? $select_subtype->show($subtype) : html::label($colprop['id'], rcube::Q($label))) .
html::div('contactfieldcontent '.$colprop['type'], $val));
}
else // row without label
@@ -803,7 +805,7 @@ function rcmail_contact_photo($attrib)
else
$ff_value = '-del-'; // will disable delete-photo action
- $img = html::img(array('src' => $photo_img, 'border' => 1, 'alt' => ''));
+ $img = html::img(array('src' => $photo_img, 'border' => 1, 'alt' => $RCMAIL->gettext('contactphoto')));
$content = html::div($attrib, $img);
if ($CONTACT_COLTYPES['photo'] && ($RCMAIL->action == 'edit' || $RCMAIL->action == 'add')) {
diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc
index f4224a3e2..4471ea658 100644
--- a/program/steps/addressbook/show.inc
+++ b/program/steps/addressbook/show.inc
@@ -60,6 +60,7 @@ function rcmail_contact_head($attrib)
$form = array(
'head' => array( // section 'head' is magic!
+ 'name' => $RCMAIL->gettext('contactnameandorg'),
'content' => array(
'prefix' => array('type' => 'text'),
'firstname' => array('type' => 'text'),