- Posts: 2
- Thank you received: 0
All questions about EDocman extension
Upload form customisation
- Lyn Major
- Topic Author
- Offline
- New Member
-
Less
More
12 years 4 months ago #22386
by Lyn Major
Upload form customisation was created by Lyn Major
Hi Tuan,
I would like to have the logged in user name automatically inserted in to the title field of the upload form, have trawled the code but just cant see where to mod this?
Any help would be greatly received...
Thanks
Lyn
I would like to have the logged in user name automatically inserted in to the title field of the upload form, have trawled the code but just cant see where to mod this?
Any help would be greatly received...
Thanks
Lyn
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
12 years 4 months ago #22436
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Upload form customisation
Hi Lyn
I hope you know php programming alitle to do this modification. Please follow the instruction below :
1. Open the file components/com_edocman/models/document.php
2. Find the function getForm within that file .
3. Add the line of code below to the end of that function :
After that, it should work as expected .
Tuan
I hope you know php programming alitle to do this modification. Please follow the instruction below :
1. Open the file components/com_edocman/models/document.php
2. Find the function getForm within that file .
3. Add the line of code below to the end of that function :
Code:
if (!$id)
$form->setValue('title', null, JFactory::getUser()->get('username'));
After that, it should work as expected .
Tuan
Please Log in or Create an account to join the conversation.
- Lyn Major
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
12 years 4 months ago #22453
by Lyn Major
Replied by Lyn Major on topic Re: Upload form customisation
Hi Tuan,
Thanks, worked a treat!!
I also added a date/time stamp:
Great support !
Regards
Lyn
Thanks, worked a treat!!
I also added a date/time stamp:
Code:
if (!$id)
$datestamp = date('_d-m-Y_H:i:s');
$usernametitle = JFactory::getUser()->get('username');
$usertitle = $usernametitle.$datestamp;
$form->setValue('title', null, $usertitle);
Great support !
Regards
Lyn
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
12 years 4 months ago #22454
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Upload form customisation
OK Lyn. Thanks for confirming !
Tuan
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Mr. Dam
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.