All questions about EDocman extension

Upload form customisation

  • Lyn Major
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 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

Please Log in or Create an account to join the conversation.

More
11 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 :
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
  • New Member
More
11 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:
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.

More
11 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

Please Log in or Create an account to join the conversation.

Moderators: Mr. Dam