Bug 38451 - TEMPLATES: Letter Wizard for Formal Personal Letter takes instead of User Field
Summary: TEMPLATES: Letter Wizard for Formal Personal Letter takes instead of User Field
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:4.1.0 target:4.0.1
Keywords: needUITest
Depends on: 59462
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-18 10:30 UTC by Andreas Mantke
Modified: 2018-02-01 17:23 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Mantke 2011-06-18 10:30:49 UTC
Open the letter-wizard from the menu file - wizards - letter and try to write a formal private letter (second option at step 1 of the wizard). Change at step 4 of the wizard to "new sender address" and put in a different address from the one, that you have set as default in the menu tools - options - user data.
The letter wizard change only the street, the zip code and the location (city), but uses the name of the default user instead of the new sender.

If you do the same with a business letter the change of the name to the new sender works.

There is another issue with the contact data. They were taken from tools - options - user data. This should also be changed (for business letter and for formal private letter). If you write a letter for a third person this person regularly has a different phone number and an different email address.
Comment 1 Andreas Mantke 2011-06-19 01:50:31 UTC
Repruceable on Linux and on Windows.
Comment 2 Xisco Faulí 2011-07-13 02:30:18 UTC
Open the letter-wizard from the menu file - wizards - letter and try to write a
formal private letter (second option at step 1 of the wizard). Change at step 4
of the wizard to "new sender address" and put in a different address from the
one, that you have set as default in the menu tools - options - user data.
The letter wizard change only the street, the zip code and the location (city),
but uses the name of the default user instead of the new sender.

If you do the same with a business letter the change of the name to the new
sender works.

I took a look to it and I already know how to fix it.

There is another issue with the contact data. They were taken from tools -
options - user data. This should also be changed (for business letter and for
formal private letter). If you write a letter for a third person this person
regularly has a different phone number and an different email address.

Yes, you're right. we should add to the wizard textfields for changing the email, the phone and the fax. The same issue happens in the fax wizard too. The problem is there isn't enough space in the wizard for adding the new textfields. I possible solution would be to split the 4th step ( recipient and sender) into 2 steps ( one for recipient and one for sender ) but I'd like to hear from someone with more experienced about it.

Cédric, should I take it ?
Comment 3 Michael Meeks 2011-07-20 04:11:33 UTC
Its fine to take the bug yes :-) Cedric is on vacation. It would be nice to know if this problem was present in 3.3.x too.

Thanks Xisco !
Comment 4 Julien Nabet 2012-08-19 14:56:30 UTC
On pc Debian x86-64 with master sources updated today, I reproduce the problem.
Comment 5 Pedro 2013-01-16 10:40:42 UTC
I can confirm that this bug still exists in version 4.0.0.1 and for that particular option makes the wizard useless.

Xisco said (in July 2011!!!) that he knows how to fix it but it is still assigned to Cedric.

Can this be released to Xisco?
Comment 6 Rainer Bielefeld Retired 2013-01-16 12:45:37 UTC
Back to list due to facts.

I did some research and found  the reason for the problem.

If you use "normal" Sender data in the resulting letter this contents will be contributed by fields "Document - Sender", what show Data from menu 'Tools -> Options -> User Data'

If you select "New Sender" in the wizard, these fields should be replaced for the resulting document by fields type "Variables - User filed - City, Company, ..."

The bug is that only fields for Address will change to User Field, but Field "Document - Sender - Forename" and "Document - Sender - Surname" will not be replaced by "Variable - User Field - Forename", "Variable - User Field - Surname"

I have no clue concerning these fields, it seems that the problem is that "Variable - User Field - Forename", "Variable - User Field - Surname"  do not exist for LibO?
The template seems to be off-elegant_l.ott

I already see the problem in AOOo 3.4.0 OOo 3.1.1, OOo 2.0!
So this is inherited from OOo, and a so long pending bug is not critical

How to fix
-----------
a) someone has to find out what field names the Wizard wants to write with "New Sender Forename" and "New Sender Surname"
b) these fields have to be created for LibO, "Bug 59462 - CONFIGURATION: 
   Additional User Field Variables for Forename and Surname required"
c) in the relevant templates the Document data fields have to be replaced by 
   New  "Variable - User Field - Forename", "Variable - User Field - 
   Surname" in affected templates off-elegant_l.ott, off-modern_l.ott
   off-office_l.ott, 
d) someone should find out what Fax templates might be affected.

At least modification should be an EasyHack
Comment 7 Rainer Bielefeld Retired 2013-01-16 12:50:44 UTC
Wanted to say: "Templates modification should be an EasyHack"

@Michael:
Can you help to start this easyhack with some debugging info in Bug 59462 - CONFIGURATION: Additional User Field Variables for Forename and Surname required?
Comment 8 chausel 2013-02-03 17:25:18 UTC
Hi!

I filed this in the Ask LibreOffice forum:

I just looked a little bit further and found this code inside the file LetterWizardDialogImpl.py (look at end of post). It looks to me like there could be an error in the function txtSenderNameTextChanged(self). There a field "Company" is changed when the "Name" should be changed. At least it doesn't look as the other functions work. Look at "Street" and "City". Maybe that causes the generated document not to change the address as it should.

def txtSenderNameTextChanged(self):
    myFieldHandler = TextFieldHandler(
        self.myLetterDoc.xMSF, TextDocument.xTextDocument)
    myFieldHandler.changeUserFieldContent(
        "Company", self.txtSenderName.Text)

def txtSenderStreetTextChanged(self):
    myFieldHandler = TextFieldHandler(
        self.myLetterDoc.xMSF, TextDocument.xTextDocument)
    myFieldHandler.changeUserFieldContent(
        "Street", self.txtSenderStreet.Text)

def txtSenderCityTextChanged(self):
    myFieldHandler = TextFieldHandler(
        self.myLetterDoc.xMSF, TextDocument.xTextDocument)
    myFieldHandler.changeUserFieldContent(
        "City", self.txtSenderCity.Text)
Comment 9 Julien Nabet 2013-02-05 21:23:51 UTC
Xisco: you might be interested in this bugtracker. Is "Letter Wizard" one of the wizards you converted from Java to Python?
Comment 10 Xisco Faulí 2013-02-06 11:36:11 UTC
I take it.
Comment 11 Xisco Faulí 2013-02-15 19:08:40 UTC
Hello,

I'm sorry but after some investigation I've realized it's not worth doing all the changes needed to fix it. 
In order to fix it we would have to add a textfield in the UI for each Field in the template, that means, one for Fax field, one for email field, one for first name field , one for last name field and one for company field. That would propable mean a big redign of the UI. Besides, we would have to edit each of the templates we use to replace each Sender Field for User Field Field.

I don't say it's imposible neither difficult, but it's really tedious and I'm not feeling like doing it.

However, I've realized the Personal letter and the Personal Fax disable this step, so for the moment I'm going to disable this as well.

If anybody is willing to fix it properly I'll be glad to give code pointers.
Comment 12 Not Assigned 2013-02-15 19:24:27 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cc7f6a58c7d8d1cd3d2534b307dbf05b98561752

fdo#38451: Disable Sender and Recipient step



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Not Assigned 2013-02-17 14:34:46 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3e8af168ca227529b752abb9c7aecc42be4a2290&h=libreoffice-4-0

fdo#38451: Disable Sender and Recipient step


It will be available in LibreOffice 4.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Rainer Bielefeld Retired 2013-02-17 15:51:50 UTC
Not an EasyHack