isurup
29 January 2020 10:10
1
Silvertripe 4.5
I want to customise the admin area so that I can add a new popup.
https://www.evernote.com/l/AOWNu9Br1KROe4INVAmqFuTa17ERduuia4c
Please see the screenshot. Instead of the client drop down (which requires me to have the client already in the database) I would like to have the ability to add the client here, perhaps in a pop up form.
Is there anyway I can add a form in a pop up? I did search but could not find anything related.
Thanks,
Isuru
Tim
29 January 2020 10:13
2
It might be worth a look at one of the following add-ons, which might provide what you need:
1 Like
isurup
31 January 2020 01:27
3
Thank you very much for your reply.
This is what I want. But it does not redirect me back when I add the save the “has one” data object. Just trying to figure that out.
isurup
2 February 2020 06:13
4
Unfortunately I could not get the above extensions working. I ended up adding new fields
https://www.evernote.com/l/AOXv7gt_tK1EvYSjX662U7My8xvOctJMfzY
and doing this in my DataObject
function onBeforeWrite()
{
Parent::onBeforeWrite();
if(!empty($this->NewClientReference)){
$client = Client::create();
$client->ClientReference = $this->NewClientReference;
$client->FirstName = $this->NewClientFirstName;
$client->LastName = $this->NewClientLastName;
$id = $client->write();
$this->ClientID = $id;
}
}
Hope this helps someone.