DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: dm Address Edit

Created:2005-05-07T23:53:20
Changed:2005-05-27T17:26:33
Author:Dieter Mayer
Email:Dieter_Mayer@gmx.net
Info 3:
Info 4:

EXT: dm Address Edit

Extension Key: dmaddredit

Copyright 2004, Dieter Mayer, < Dieter_Mayer@gmx.net >

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: dm Address Edit 1

Introduction 1

What does it do? 1

Users manual 2

Tips 4

Fields to hide 4

What to export as csv? 5

How to configure the output? 5

Hint if you plan to overwork the template 5

What's the secret behind the 'newsletter category mask'? 5

How to adapt the language related output? 6

Spamprotect for tt_address 6

Adminstration 6

Configuration 6

Reference 6

Known problems 8

To-Do list 8

Changelog 8

Introduction

What does it do?

This extension is a mix of some FE extensions with some error corrections, particularly nicosdirectory, sp_directory and fileUpload. I nedded a FE extension for fast and user friendly editing of tt_address records (including the fields for the direct mail extension) with an simplecsv export of all records.

With dmAddrEdit it's possible to define for each FE user:

- the tt_address sysfolder(s) that can be edited

- which tt_address fields are visible

- which tt_address fields will be exported in a csv file.

Why did I wrote this extension? Well, imagine there's a large page tree with many independent branches and corresponding domains (= sites). Each site has it's own direct mail module and therefore one ore more relevant sysfolders for the storage of the tt_address records. Every sysfolder should be edited by another FE user. Normally, you must install a separate edit page for every sysfolder/FE user or you have to use extensions like sp_directory , but without the possibility to edit the direct mail related fields.

With dmAddrEdit you get a powerful extension to edit tt_address records in the Frontend (FE) without the need to edit parts in the Backend (BE). If direct mail is installed, the corresponding fields will also be shown and modified. The output of the extension is fully configurable trough TS and tuning the template.

Users manual

Install the extension through the extension manager

img-1

img-2 Configure the sysfolders that should be used as source. You have three possibilities for this:1. Select the sysfolders in the extension dialog, or2. Configure the sysfolders via TS in the template setup (in this example two sysfolders with the id's 51 and 138):

plugin.tx_dmaddredit_pi1.pidList = 51,138

(TS has priority bevor extension setup) or3. Configure the sysfolders in the template setup with the help of the great extension kb_betterstdwrap (available in TER), which needs to be installed for using this trick. With thefollowing lines the content of the new generated fe_user field tx_dmaddredit_addrfolder will be read and transfered as a TS parameter to dmAddrEdit (so it's possible to have only one page in the page tree to display the sysfolder contents depending on the actual FE user):

temp.pidList = TEXT
temp.pidList.value = {glob:TSFE:fe_user:user:tx_dmaddredit_addrfolder}
temp.pidList.insertData = 1
plugin.tx_dmaddredit_pi1.pidList.cObject < temp.pidList

img-3 Store the individual sysfolder id's in the tx_dmaddredit_addrfolder field in the fe_user table:

After that you can see a similar list view in the FE:

img-4

Configure further TS options as needed.

From the list view (see above) you can show the details of a record with the option to edit this record. In this view the user sees only the fields he is allowed to (see 'configuration').

img-5

Editing a record includes features like moving the record to another sysfolder (if two or more sysfolders are configured), changing the settings for direct mail (html or text format as soon as the newsletter category mask for the newsletter subscribtions – read more in the tips section) or uploading a (new) image (max. Image size depends on TS setting).

img-6

You are also able to delete the record. But beware! There is no further questioning about deleting it, a click on the corresponding link will erase the address record immediate! I've done that this way because it's more comfortable to execute this action with one click contrary to three clicks with an adequate questioning.

Obviously you can create a new address record – if direct mail is installed the corresponding fields will be editable also.

Last but not least it's possible to export the whole address list as a csv file for further use with your desktop programs. The output of the csv list is fully configurable through TS setup.

Tips

Fields to hide

You can set in TS template setup the names of the tt_address fields that will be hidden in the single view:

plugin.tx_dmaddredit_pi1.hideFields = fax,mobile,www

In this case you set this option for the extension independently of the actual FE user. If you want to hide fields depending on the FE user, use the field tx_dmaddredit_hidefields in the fe_user table and enter the names of the fields to hide:

img-7

Then, use the folling TS code lines in the template setup ( kb_betterstdwrap (available in TER) needs to be installed for using this feature):

temp.hideFields = TEXT
temp.hideFields.value = {glob:TSFE:fe_user:user:tx_dmaddredit_hidefields}
temp.hideFields.insertData = 1
plugin.tx_dmaddredit_pi1.hideFields.cObject < temp.hideFields

What to export as csv?

Normally, when a FE user exports the address list to a csv file, all fields in the tt_address table will be used. Example:

::

a

uid,pid,tstamp,hidden,name,title,email,phone,mobile,www,address,company,city,zip,country,image,fax,deleted,description,module_sys_dmail_category,module_sys_dmail_html
::

a

51,"51","1115408448","0","Sebastian Heinzelhuber","","seb@grmbl.edu","98643","457634","www.ffdgsdfg.com","Elsterweg 111","","Nembech","99999","","pic_mann.gif","134787","0","Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore.","3","1"

But what if you want to offer the FE user only a selection? Use this line (without line breaks) in the TS template setup:

plugin.tx_dmaddredit_pi1.csvFields = uid,pid,name,email,module_sys_dmail_category,module_sys_dmail_html

The result will look like this:

::

a

uid,pid,name,email,module_sys_dmail_category,module_sys_dmail_html
::

a

51,"51","Sebastian Heinzelhuber","seb@grmbl.edu","3","1"

You set this option with the above line of TS code for the extension independently of the actual FE user. If you want to export fields depending on the FE user, use the field tx_dmaddredit_csvfields in the fe_user table and enter the names of the fields to use:

img-8 Again, use the folling TS code lines in the template setup ( kb_betterstdwrap (available in TER) needs to be installed for using this feature):

temp.csvFields = TEXT
temp.csvFields.value = {glob:TSFE:fe_user:user:tx_dmaddredit_csvfields}
temp.csvFields.insertData = 1
plugin.tx_dmaddredit_pi1.csvFields.cObject < temp.csvFields

Now it works depending on the actual FE user.

How to configure the output?

You can modify the apperance of the output by setting some TS values (see 'Configuration') and adapting the template. Copy the extension template (...dmaddredit/pi1/directory.tmpl) to a folder of your choice an style the code in the copied template file as you like.

Hint if you plan to overwork the template

You may want to present the user a overworked template with a minimal selection of fields in the ENTERVIEW_xx part. For example, the FE user should see only the input fields for 'name' and 'eMail' and nothing else. But it's necessary for the edit form to submit the pid of the sysfolder, where the new or modified record should be stored.

In this case you must provide a hidden input field in the form, ENTERVIEW_xx part, that transmits this value:

<input type="hidden" name="tx_dmaddredit_pi1[sysfoldername]" id="sysfoldername" value="###DEFAULTSYSFOLDER###" />

If there are more than one sysfolders possible (see 'Configuration' -> 'pidList'), the value of DEFAULTSYSFOLDER will be the first pid in the array (e.g. 'pidList = 51,138' will be converted to '51' and 'pidList = 138,51' changes to '138').

Don't use this hidden input in conjunction with SYSFOLDERNAME!

What's the secret behind the 'newsletter category mask'?

For the use with the direct mail module, the newsletter format (HTML or plain) is easy to understand (field module_sys_dmail_html in table tt_address ). But what does the number in the 'newsletter category mask' mean (field module_sys_dmail_category in table tt_address )? (By the way: it's a good tip to read the direct mail tutorial from Marlies Cohen first (available in TER). You get a better understanding of the following part.)

Well, if there is only one newsletter that can be subscribed in the direct mail subscription module then the corresponding value for the newsletter categorie mask is '1' for a subscription or '0' for no newsletter subscription.

But what if there are two or more newsletter categories (NL) a user can subscribe to? How is this coded?

Well, simple: the first category has the value '1', the second category is '2' and so on... If a user subscribes to NL1 you need the value '1', for NL2 it's '2' and for the combination NL1+NL2 the value is '3'.

Check this out if you have a corresponding setup with two or more direct mail categories. What values do you see in the field module_sys_dmail_category for all the possible combinations? Then you know what values to write in the newsletter categorie mask part of the edit dialog.

Spamprotect for tt_address

Under some circumstances the global spam protection

config {
  spamProtectEmailAddresses = 2
  spamProtectEmailAddresses_atSubst = (at)
}

has no effect. Then this code snippet may be helpful (thanks to Peter Bachmann):

###############################
# Spam Protect für tt_Address #
###############################
tt_address {
  20 {
    25 >
    25 = TEXT
    25.if.isTrue.field = email
    25.typolink.parameter.field = email
    25.dataWrap = <br /><a href={field:email}></a>
  }
}

(see this german posting: http://www.typo3.net/forum/list/list_post/ /11007/?sword_list%5B%5D=spamprotect )

Adminstration

See Configuration.

Configuration

The following variables should be self explaining.

Reference

templateFile

Property

templateFile

Data type

string

Description

Path to the template file.

Usage example:

plugin.tx_dmaddredit_pi1.templateFile = fileadmin/addrtemplate.tmpl

Default

EXT:dmaddredit/pi1/directory.tmpl
pidList

Property

pidList

Data type

string

Description

Comma separated list of pid's of the sysfolder(s) to use, e.g. 51,138

Default

hideFields

Property

hideFields

Data type

string

Description

This tt_address fields will be hidden in the detail view. Possible values are:

title,phone,mobile,www,address,company,city,zip,country,image,fax,description,module_sys_dmail_category,module_sys_dmail_html

or

*

* i s used as a wildcard and hides all of the fields above except name and email

module_sys_dmail_category and module_sys_dmail_html are only significant if the extension direct mail is installed

Default

csvFields

Property

csvFields

Data type

string

Description

List of tt_address fields that will be exported in the csv file. Possible values are:

uid,pid,tstamp,hidden,name,title,email,phone,mobile,www,address,compan y,city,zip,country,image,fax,deleted,description,module_sys_dmail_c ategory,module_sys_dmail_html

or

*

* i s used as a wildcard an exports all tt_address fields

module_sys_dmail_category and module_sys_dmail_html are only significant if the extension direct mail is installed

Default

*
showFolderTitle

Property

showFolderTitle

Data type

integer

Description

1 or 0. Select 1 if you want the name(s) of the sysfolders (see pidList) to be shown at the beginning of each address listing.

Default

1
itemsPerPage

Property

itemsPerPage

Data type

integer

Description

Number of address records to display on one page

Default

10
maxImageSize

Property

maxImageSize

Data type

integer

Description

The max. allowed size (in bytes) of the image file

Default

210000
wrap1

Property

wrap1

Data type

string

Description

The marker ###W1B### ###W1E### in the template file will be replaced with the provided value. Used in the list view -> Address storage folder

Default

<table border=0><tr><td><img src=/t3lib/gfx/i/folder.gif><strong> | </strong></td></tr></table>
NLSubscription

Property

NLSubscription

Data type

string

Description

This icon will indicate the status of the newsletter subscription (used in the list view if subscribed to a newsletter)

Default

EXT:dmaddredit/pi1/check_on2.gif
noNLSubscription

Property

noNLSubscription

Data type

string

Description

This icon will indicate the status of the newsletter subscription (used in the list view if no newsletter subscription)

Default

EXT:dmaddredit/pi1/check_off2.gif
NLHTML

Property

NLHTML

Data type

string

Description

This icon will indicate the format of the newsletter (used in the list view if HTML newsletter ordered)

Default

EXT:dmaddredit/pi1/check_on2.gif
NLPlain

Property

NLPlain

Data type

string

Description

This icon will indicate the format of the newsletter (used in the list view if newsletter is ordered in test format or no newsletter subscription active)

Default

EXT:dmaddredit/pi1/check_off2.gif
image

Property

image

Data type

string

Description

Defines the image properties of the preview and the large images. Example:

plugin.tx_dmaddredit_pi1.image {
    params = border=0 style="float:left;margin-left:10px;margin-bottom:10px";
    file.maxH = 120
    file.maxW = 120
    imageLinkWrap = 1
    imageLinkWrap {
      enable = 1
      bodyTag (
        <body bgcolor="#FFFFFF" leftmargin="2" topmargin="2" marginwidth="2" marginheight="2">
      )
      wrap = <a href="javascript:close();"> | </a>
      width = 800m
      height = 600m
      JSwindow = 1
      JSwindow.newWindow = 1
      JSwindow.expand = 4,4
      title = Big view
    }
  }

Default

_CSS_DEFAULT_STYLE

Property

_CSS_DEFAULT_STYLE

Data type

string

Description

The default style sheet definitions

Default

.tx_dmaddredit-pi1-myform { font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px; }
.tx_dmaddredit-pi1-myformactive { font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px; color: #CC0000; }
.tx_dmaddredit-pi1-dotted { border: 1px solid #DADADA; }
.tx_dmaddredit-pi1-small { font-size: 10px; }
.tx_dmaddredit-pi1-mini { align: right; font-size: 8px; }
.tx_dmaddredit-pi1-dottedcorner { border-top: 0px none; border-right: 0px none; border-bottom: 2px dotted #DADADA; border-left: 2px dotted #DADADA; }
.tx_dmaddredit-pi1-dottedcolor { border: 2px dashed #EEEEFD; }
.tx_dmaddredit-pi1-active { color: #CC0000; }
.tx_dmaddredit-pi1-inactive { color: #999999; }
.tx_dmaddredit-pi1-mini-light { font-size: 9px; color: gray; }

[plugin.dmaddredit]

Known problems

Some display errors under IE, working on that...

To-Do list

Feel free to make suggestions!

If you think something is missing in the documentation or you need a special function, feel free to contact me as well.

I'm planning more FE extensions for other tables with similar handling like this. Please respond to me: does the concept of this extension fit your needs / is it useful for you, do you have comments on it's usability?

Further development plans (yes, you can provide me with code snippets :-) ):

  • csv import
  • optimized template
  • showCSV and hideFields also possible for FE groups

Changelog

  • 0.0.2 Initial public release (May 2005)
  • 0.1.0 Added manual (no pics because of TER limit)
  • 0.2.0 Improved manual (more pics)New marker in the template: DEFAULTSYSFOLDER (see 'Tips' -> 'Hint if you plan to overwork the template')
  • 0.2.7 Bugfix in DEFAULTSYSFOLDER, that corrects a zero value if an error occured in the formular check
  • 0.2.9 Bugfix in the delete routine, works now as expected
  • 0.3.1 New marker in the template: INTROTEXTTemplate adaptedlocallang.php adaptedSmall bugfix in delete routine: after delting a record the list view is now shown correct('all' highlighted and pagebrowser active)
  • 0.3.2 Added a 'status report' screen for the delete function to inform the user that a record was successfully deleted.Modified the function 'makeSuccess()' to return a more detailed result string.
  • 0.3.3 Fixed a small irritation in the search function. Now the extension searches in the fields name , email and description .
  • 0.3.4 New marker in the template, section 'SUCCESSVIEW': ###NEW### - gives the user the possibility to generatea new record from the status box, saves one mouse click (no need to go back to the list view to generate a newrecord)Fixed a silly error that could cause an invalid 'Back to list'-link under some circumstances.
  • 0.3.5 Another stupid error fixed: forgot to include class 'basicfilefunc'. Picture uploading should work fine now.Removed one excessed brace in the TS Setup, caused an error in the Setup Object Browser (thanks to PeterBachmann for both notifications)
  • 0.4.0 Corrected a path in 'ext_typoscript_constants.txt'Added a hint in the tips section: 'spamprotect for tt_adress'

img-9 EXT: dm Address Edit - 9