Community Support for OpenDocMan (Deprecated)

Full Version: altering opendocman
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
lrmalcom
2007-02-11 17:41:53 PST

I would like to make some changes to opendocman to fit my needs but before doing so I would like to know if there is anything I need to know. Your program is pretty much perfect for what I need but I don't need to update/search by author or dept. since I am the lone user.

I am planning on using opendocman to organize my genealogy files, most of which are images. The only changes I need to make are:

(1)_create a few more categories
(2)_alter the search form to include a few more search categories
(3)_possibly alter what categories are displayed

My files are basically divided into surname. I would like to be able to search say for all files for one person or one surname or one type such as marriage, death and so on. I have so many documents that I don't know what I have and for which ancestor.

I have some knoweledge of mysql and php having created a genealogy database and forms with which I could both update and search for records before searching for a document management system.

Can the changes be made?

Norma


jonathanwminer
2007-02-12 06:01:21 PST
1) Categories are designed to be added by user. Click in the "Admin" icon, then click "Add" underneath the "Categories" column.

2) Not sure what exactly you would be searching on? Currently, ODM is limited in that it can't search the content of the documents. It might be easier for you just to put keywords into the "Description" and/or "Comment" fields for each document.

3) Not sure what you want to accomplish by having "hidden" categories?

I would caution you against any changes that assume that you're the lone user. You may find someday that you want to give someone else access to the data. Have you considered creating a "Department" for each surname? Then categories for each type of document... birth, marriage, death, etc?


lrmalcom
2007-02-12 07:17:33 PST

Sorry for the confusion regarding my plans. For now, my file additions/searches would be limited to surname, first name and doc type (death, birht,etc). Possibly someday, I may wnat to search by location.

I like you idea of just using dept. for each surname and I have played with the idea but I am lacking a third category.

1_first name
2_surname
3_doc type (birth, death, etc)

I can use either the comment or description input boxes for one of the three categories as you suggested but it requires manually entering the info every time which is time consuming and error prone. I have many, many documents which I have collected over 14 years.

Any ideas how to get a third input box?

Lorrie


jonathanwminer
2007-02-12 07:41:46 PST
Hi Lorrie -

I understand your point about using "drop-down" menus with fixed values, instead of allowing free form data entry in either the comments or description field. You're right that it reduces errors and data entry time.

In order to add new fields to ODM, you'll need to alter your database to add a table (similar to the "categories" table) which lists the allowed values. Then add a column to the "data" table (similar to the "category" column). I believe that is everything that needs to be done to the database.

Looking at all the PHP files, the string "categor" is mentioned 197 times in 24 files. The brute force method would be to just go through those files, and add additional code for your new columns. This should work great for you, but if/when you decide to add additional fields, you would have to replicate your work.

If other people see value in adding these user-defined fields, then purhaps we (as in the collective developers) should submit a feature request. Anyone else have ideas?



PS... ODM isn't my project, but I like how it works, and am happy to contribute back to the project.


lrmalcom
2007-02-12 13:08:34 PST
Johnathon,

I like the program, too. I especially like its simplicity. I looked at several open-source document management systems before selecting ODM. Most were designed for businesses with features I would never use.

Thank you for your help with my questions.

Lorrie

jonathanwminer
2007-02-13 08:05:38 PST
Lorrie -

I have created a Feature Request (#1659100) and have started some work to add user defined fields (UDFs) to the database and patched details.php to display the information.


lrmalcom
2007-02-13 08:28:13 PST
Jonathon,
Thanks. I will watch for the changes. If implemented, I hope that others will find them useful, too.

Lorrie


jonathanwminer
2007-02-14 12:05:25 PST
Lorrie -

I've made enough changes to support the addition of user defined fields that support drop-down menus, like the existing Category and Department fields. Let me know how it works for you.


lrmalcom
2007-02-14 16:57:44 PST
Jonathon,

Thanks for the update. I applied the patches but cannot find a place (on the admin webpage) to add the user defined field. I see that udf.php is where the add/update is done (I think), but I cannot find a way to call that page up. Is there a modification to admin.php perhaps, or am I confused about where to add the udf?

Lorrie


jonathanwminer
2007-02-15 05:43:33 PST
Hi Lorrie -

Look at your config.php and see what user you've defined as "root". Only that user will get the menu for UDFs. You will also need to go into MySQL and manually create the "udf" table. See the udf.sql file for details. I also had to give the ODM database user permission for "alter" and "drop".


lrmalcom
2007-02-15 19:56:29 PST
Jonathon,

I have the permissions set correctly and I did create the udf table. The problem, as far as I can tell, is the page that does the inserts into the udf table (udf.php) is not referenced by any other file. If I understand correctly, there should be another column on the admin page (admin.php) that allows add/delete/etc of user defined fields, but admin.php was not patched to add this column.

I'm sorry if I seem obtuse here.

Thanks for all your effort.

Lorrie


jonathanwminer
2007-02-16 04:22:48 PST
Hi Lorrie -

I repackaged all my patches to make it easier to download and apply. I also cleaned up the code. Go back to the 1.2.4 release and grab my latest patches (now in a single zip file) plus the new udf_functions.php file


lrmalcom
2007-02-16 16:42:58 PST
Jonathon,

I used the new patches and everything looks great! Thanks! I'm out of town this weekend but I will try it out next week and report back.

Thanks again,
Lorrie


lrmalcom
2007-03-14 14:40:32 PDT
Jonathon,

Sorry for taking so long to get back to you. I finally have some time to do so. I am happy to report that OpenDocMan is operating as it should. Some changes were made, though.

I had to modify the insert command in the function udf_functions_add_udf in udf_functions.php. The insert had the id hard coded to '1'. The id is auto_increment so I just removed it from the insert. The line now reads:


$query = 'INSERT udf (table_name,display_name,field_type) VALUES
("'.$_REQUEST['table_name'].'","'.$_REQUEST['display_name'].'",'.$_REQUEST['field_type'].')';


Also, there seems to be an issue with the admin adding documents. The department gets set to '4' in the data table, although department '4' is
not defined in the departments table. It's no big deal because adding documents works fine for regular users.

Thanks for all of your help.

Lorrie



logart
2007-03-14 18:24:53 PDT
Jon and Lorrie,

Make a note that these UDF features are now part of opendocman v1.2.5. If there are bugs /issues it would be helpful if they were added to the bug tracker.

Thanks,

Steve


jonathanwminer
2007-03-15 05:28:55 PDT
OK. I know why the "1" was there. I had originally set my table up without auto_increment.

Was the other problem introduced by the UDF code?


jonathanwminer
2007-03-15 05:31:35 PDT
THANKS! Smile

I'm happy to be contributing back to the OpenSource community.


logart
2007-03-15 06:58:16 PDT
The database setup was fixed already to include auto-increment. I did find the "1" hardcoded into udf.php. I will fix that in the next release. If someone already has a patch file for this it would be helpful to have that uploaded to sf.

steve


jonathanwminer
2007-03-15 07:13:48 PDT
See patch 1681494.


s_thatte
2007-03-26 07:44:51 PDT
Hi Steve,

Playing around with this UDF feature following noticed :-

As Admin when am trying to add a new UDF the pick-list remains empty.
Adding more than one UDF, only one displays.
Maybe the patch that has been discussed before in this thread fixes it. Where does one download it from ?

One more question, If the UDF is creating a back-end table, how do I create a sub-category relationship from the front-end.

Thanks and Regards
Shyamal


jonathanwminer
2007-03-26 08:20:16 PDT
The patch is #1681494

There is currently no way to create a "sub-category" relationship. This is due to the modular design of UDFs. In the future it might be possible to create a UDF that supports sub-relationships with other UDFs, but it's not there now.


s_thatte
2007-03-28 06:50:51 PDT
Thanks downloaded the patch.

Creating UDF's working. The table name cannot have spaces.

For testing was using multiple users on the same machine. Probably is a PHP feature. If one user logs out all are logged out. And whn one user logs in all user windows get the same credentials.

Will have more of a play with this.

Thanks and Regards
Shyamal