Page 1 of 1
New Module: Publications
Posted: Mon May 31, 2010 7:49 pm
by tallphil
Hi all,
I've released the first beta of my new module
Publications today.
It allows
FrontEndUsers to create and maintain a list of Publications (designed for scientific publications / references). There are fields for Title, Reference, DOI and a single upload. They can edit and order publications once added.
The module also allows the display of publications, and uses a templating system for control of output. Output can also be restricted to one or many users, or to a FEU group of users.
This is the first release of my first ever module, so I'm sure that there will be loads of bugs and mistakes - all comments / critiques / suggestions welcome!
Phil
Re: New Module: Publications
Posted: Tue Jun 01, 2010 10:36 am
by Peciura
Release has files like '._file_name.ext' also folders '.svn'
Installation is not smoth
Code: Select all
Index: method.install.php
===================================================================
--- method.install.php (revision 1)
+++ method.install.php (working copy)
@@ -75,13 +75,13 @@
$this->SetTemplate('form_Sample',$template);
$this->SetPreference('current_form_template','detail_Sample');
}
// Set Preferences
- $this->SetPreference('morelink_text') = $this->Lang('default_morelink_text');
- $this->SetPreference('allowed_upload_types') = 'pdf, doc, docx, rtf';
- $this->SetPreference('feu_redirect') = '';
+ $this->SetPreference('morelink_text',$this->Lang('default_morelink_text'));
+ $this->SetPreference('allowed_upload_types','pdf, doc, docx, rtf');
+ $this->SetPreference('feu_redirect','');
// put mention into the admin log
$this->Audit( 0, $this->Lang('friendlyname'), $this->Lang('installed',$this->GetVersion()));
?>
Preference 'allowed_upload_types' are handeled as string (is not expolded to array).
while adding file user name is '-user-'
not enough documentations about FEU submit
It is not clear what should be in line 28 on 'function.admin_listtab.php'
$pubs_row = $pubs_result->FetchRow();
if($pubs_row.fields !== 'fields'){
// User has publications, get new $i from size of array
Publicatoins are isted after file upload from back end but 'List' tab is empty.
Re: New Module: Publications
Posted: Tue Jun 01, 2010 11:46 am
by tallphil
Many thanks for your detailed comments Peciura, looking back at the code I think I need to go through and re-write a lot of it. I was very much working things out as I went along, so when I see pages like function.admin_listtab.php (one of the first I wrote) I can see that there are better ways to get the same result.
As for 'allowed_upload_types' - this is exploded to an array in the upload file function, so doesn't need to be handled as an array in the preference. I'm not sure what you mean about setting the file user name? I hope to write more extensive help and documentation in the code - I'll do this with the next release I think.
And I think I need to enable 'view hidden files'!
Re: New Module: Publications
Posted: Tue Jun 01, 2010 12:29 pm
by Peciura
when i uploaded '.doc' file i was warned that file is not of type 'pdf, doc, docx, rtf'

.
There is only one FEU on test site and instead of its name (email ATM) i can choose '-user-' or empty name.
If i choose '-user-' i am asked to 'Please Select a User To Associate with Publications' so i chose empty value.
Re: New Module: Publications
Posted: Tue Jun 01, 2010 1:02 pm
by tallphil
Ah, ok - I think that the bug with the filetypes is because of the spaces (I need to use the trim() function I think), and the username problem is a stupid mistake on my part - it's using custom FEU fields which I had set up, oops! This will also cause the 'Lists' tab to be empty...
I've noted these down, I'll fix them when I go through and sort out the code... Thanks for flagging them up!
Re: New Module: Publications
Posted: Mon Jun 07, 2010 3:41 pm
by tallphil
Right, I've gone through and re-written a whole load of code. The module now defaults to using FEUsers usernames, but will use the custom fields
firstname and
lastname if they're available. I've fixed the upload filetypes bug and I've also removed all direct database interactions for the FEU module, replacing these with FEU API calls. Finally, I've updated the help and language files, repackaged the module and tested it on a blank install of CMSMS. I don't think that there are any unnecessary files included this time! The updated release is again available through the
CMSMS Forge.
If anyone finds any problems or has any comments, please let me know! Thanks again for your help Peciura...