Last Comment Bug 251681 - Can't copy field from LDAP Address Book
: Can't copy field from LDAP Address Book
Status: VERIFIED FIXED
: fixed-seamonkey1.0, fixed1.8.1
Product: MailNews Core
Classification: Components
Component: Address Book (show other bugs)
: Trunk
: All All
-- enhancement (vote)
: ---
Assigned To: Mark Banner (:standard8)
:
:
Mentors:
: 299977 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-16 00:50 PDT by Tim Gerundt
Modified: 2008-07-31 04:30 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Thunderbird version (31.05 KB, patch)
2005-11-27 13:39 PST, Mark Banner (:standard8)
mozilla: review+
Details | Diff | Splinter Review
SeaMonkey version (checked in) (15.72 KB, patch)
2005-11-27 13:51 PST, Mark Banner (:standard8)
neil: review+
neil: superreview+
Details | Diff | Splinter Review
Thunderbird version 2 (checked in) (31.12 KB, patch)
2005-11-28 12:46 PST, Mark Banner (:standard8)
standard8: review+
mscott: superreview+
mscott: approval‑branch‑1.8.1+
Details | Diff | Splinter Review

Description User image Tim Gerundt 2004-07-16 00:50:23 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7) Gecko/20040616

I can't copy values from an LDAP Address Book, because the textboxes are disabled.

So I do not have a possibility to copy a telephone number or street name for
example.
Quite unpractically! ;-)

Reproducible: Always
Steps to Reproduce:
1. Search for entries in a LDAP Directory.
2. Show properties from an Address Card.
3. Try to copy a telephone number or street name for example.

Actual Results:  
Can't copy values from the textboxes.

Expected Results:  
Possibility to copy values from the textboxes.
Comment 1 User image R.K.Aa. 2004-07-16 08:31:29 PDT
Dup of bug 35837, by way of dup bug 124230 and others
Related: bug 96968

*** This bug has been marked as a duplicate of 35837 ***
Comment 2 User image Tim Gerundt 2004-07-16 11:26:43 PDT
Excuse me, but this is not a dup of bug 35837!

I don't want to copy the *whole* address cards, only a single value from it!
For example the telephone number or street name. I want to copy it to the 
clipboard and paste it in an other program (maybe Word, OpenOffice, ...).
Because LDAP Address Books are read-only, the textbox are disabled.
That is logical, but unpractically. Maybe just set the textbox *read-only*, so 
that one have still the edit menu (without cut & paste)?

Bug 96968 is a similar problem, but not the same (because the bug is for the 
preview-pane and not for LDAP Addresses).
Comment 3 User image Wayne Mery (:wsmwk, NI for questions) 2005-04-06 16:43:40 PDT
confirming
Comment 4 User image Alexey N. Solofnenko 2005-07-08 19:31:54 PDT
*** Bug 299977 has been marked as a duplicate of this bug. ***
Comment 5 User image Mark Banner (:standard8) 2005-11-26 14:03:09 PST
I think we should just be able to change the disable of the text boxes to making them readonly - that way the events to allow copy etc will still be enabled, but the user won't be able to change them.
Comment 6 User image Mark Banner (:standard8) 2005-11-27 13:39:09 PST
Created attachment 204303 [details] [diff] [review]
Thunderbird version

This patch (for Thunderbird):
- Changes from setting disable to readonly for read-only address books.
- Re-uses the useful array of field names to set readonly for most of the field which
- allows removal of "disableforreadonly" attribute setting in the xul code.

Note that (at least on my Linux box) the default thunderbird theme the text boxes appear "normal", as read-only is white background and black text. The disabled text boxes are white background & grey text

Should this be changed as well?
Comment 7 User image Mark Banner (:standard8) 2005-11-27 13:51:36 PST
Created attachment 204307 [details] [diff] [review]
SeaMonkey version (checked in)

This patch (for SeaMonkey):
- Changes from setting disable to readonly for read-only address books.
- Re-uses the useful array of field names to set readonly for most of the field
which
- allows removal of "disableforreadonly" attribute setting in the xul code.
Comment 8 User image neil@parkwaycc.co.uk 2005-11-28 06:14:36 PST
Comment on attachment 204307 [details] [diff] [review]
SeaMonkey version (checked in)

>+        // Disable all the editable vcard fields.
>+        for (var i = kVcardFields.length; i-- > 0; )
>+          document.getElementById(kVcardFields[i][0]).readonly = true;
If only kVcardFields was a hash i.e.
const kVcardFields = {
  FirstName: "firstName",
...
  Notes: "notes"};
then you could use:
  for (var id in kVcardFields)
    document.getElementById(id).readonly = true;
(In the other loops, kVcardFields[i][1] would become kVcardFields[id])

>+        // And the phonetic fields
Nit: I'd like a blank line before this comment. In fact, given the change below, I'd like these four lines moved above the previous three.

>+        document.getElementById("PhoneticLastName").disabled = true;
>+        document.getElementById("PhoneticFirstName").disabled = true;
These should be readonly right? r+sr=me with that fixed.
I guess unrolling the loop over the phonetic fields array is a win here ;-) Maybe you should cross-reference kPhoneticFields in some way though, either a comment or using [N][0]?
Comment 9 User image Mark Banner (:standard8) 2005-11-28 11:02:56 PST
Comment on attachment 204307 [details] [diff] [review]
SeaMonkey version (checked in)

Patch checked in with Neil's comments addressed (the kVcardFields array being made into a hash should be a separate bug if we decide to do it IMHO).

I'll update the Thunderbird one to match in a while.
Comment 10 User image Mark Banner (:standard8) 2005-11-28 12:46:10 PST
Created attachment 204374 [details] [diff] [review]
Thunderbird version 2 (checked in)

Updated version for Thunderbird incorporating Neil's nits from the SeaMonkey version. Carrying forward bienvenu's r (confirmed ok on irc).
Comment 11 User image Scott MacGregor 2005-11-28 14:07:27 PST
Comment on attachment 204374 [details] [diff] [review]
Thunderbird version 2 (checked in)

for me the on Windows, disabled edit fields in the address book card dialog do look correct as far as appearing to be uneditable.
Comment 12 User image Mark Banner (:standard8) 2005-11-29 09:47:56 PST
Comment on attachment 204374 [details] [diff] [review]
Thunderbird version 2 (checked in)

This patch also checked in

Checking in mail/components/addrbook/content/abCardOverlay.js;
/cvsroot/mozilla/mail/components/addrbook/content/abCardOverlay.js,v  <--  abCardOverlay.js
new revision: 1.12; previous revision: 1.11
done
Checking in mail/components/addrbook/content/abEditCardDialog.xul;
/cvsroot/mozilla/mail/components/addrbook/content/abEditCardDialog.xul,v  <--  abEditCardDialog.xul
new revision: 1.5; previous revision: 1.4
done
Checking in mail/components/addrbook/content/abNewCardDialog.xul;
/cvsroot/mozilla/mail/components/addrbook/content/abNewCardDialog.xul,v  <--  abNewCardDialog.xul
new revision: 1.6; previous revision: 1.5
Comment 13 User image Ian Neal 2005-12-14 11:56:46 PST
Comment on attachment 204307 [details] [diff] [review]
SeaMonkey version (checked in)

a=me for SM1.0b, first needed one
Comment 14 User image neil@parkwaycc.co.uk 2005-12-14 11:58:45 PST
Comment on attachment 204307 [details] [diff] [review]
SeaMonkey version (checked in)

a=me for SeaMonkey
Comment 15 User image Mark Banner (:standard8) 2005-12-14 14:16:38 PST
SeaMonkey-only patch checked into 1.8 branch in time for SeaMonkey 1.0b.
Comment 16 User image Mark Banner (:standard8) 2005-12-22 12:40:08 PST
(In reply to comment #15)
> SeaMonkey-only patch checked into 1.8 branch in time for SeaMonkey 1.0b.
> 
Also checked into the 1.8.0 branch.
Comment 17 User image Stephen Donner [:stephend] 2006-01-16 23:20:18 PST
Verified FIXED using a debug, semi-current debug build checked out on January 13th, built on Windows XP.

I can copy read-only textfields from LDAP card entries just fine.
Comment 18 User image Mark Banner (:standard8) 2006-03-24 07:10:54 PST
Comment on attachment 204374 [details] [diff] [review]
Thunderbird version 2 (checked in)

Requesting approval, This patch enables copying of ldap fields from cards for Thunderbird - its been on the trunk for a while now, should be a low risk for branch.
Comment 19 User image Scott MacGregor 2006-04-03 12:46:46 PDT
Comment on attachment 204374 [details] [diff] [review]
Thunderbird version 2 (checked in)

thanks Mark.
Comment 20 User image Mark Banner (:standard8) 2006-04-04 12:43:17 PDT
Comment on attachment 204374 [details] [diff] [review]
Thunderbird version 2 (checked in)

check into branch

Note You need to log in before you can comment on or make changes to this bug.