[TYPO3-dev] 'insert new record' with preselected fields in BE-Modul

Markus Lange markus.lange at bgm-gmbh.de
Wed Sep 27 14:06:31 CEST 2006


Hi,

Georg Ringer wrote:
> I just develop a Backend-Module for google maps and everything works fine
>  but I have got one problem: I have the data of the point and want in my
> BE-Module a link. "create new record " which opens the usual form but
> some fields should be preselected with data of my BE-Module. worst case
> scenario is just a INSERT-query
>
> How can I do that?


this is just a method i used for creating records within a be module:
take a look at devVals

function getNewButton ($table,$pid) {
	 $params = '&edit['.$table.']['.$pid.']=new';

	 if ($table=='fe_users')
$params.='&defVals[fe_users][status]=1&defVals[fe_users][usergroup]=2';
	 if ($GLOBALS["HTTP_POST_VARS"]['firma']) {
	    $params.='&defVals['.$table.'][ownerfirma]='.$GLOBALS["HTTP_POST_VARS"]['firma'];
	  }
	 if ($table=='tx_bgmsemica_stellenanzeige' ||
$table=='tx_bgmsemica_profil'){
	    $params.='&defVals['.$table.'][hidden]=1';
	 }
	 $new= '<a href="#"
onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">'.'<b>Neuen
Datensatz erstellen</b></a><br/>';
	 $out = '<table border="1" cellpadding="0" cellspacing="0"
width="100%"><tr><td align="center">'.$new.'</td></tr></table>';
	 return $out;
	}

hth


-- 
Markus Lange








More information about the TYPO3-dev mailing list