Closed (duplicate)
Project:
Privatemsg
Version:
6.x-1.0-rc2
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2009 at 17:35 UTC
Updated:
5 Nov 2009 at 19:06 UTC
i need to set up a site, where users can offer stuff to each other. i need a module that can do the following:
User A makes an offer to user B. that is send as a pm, but has the options of answering and/or accepting the offer. then, A can answer and or set the state of the discussion tto fulfilled.
i hope it is clear what i mean... basicly user A and B are negotiating a contract. the discussion should look like PMs are handled in facebook. but the state of the discussion can change... and the last state will close the discussion.
is this possible with privatemsg?
Comments
Comment #1
litwol commentedno it is not possible at this time.
Comment #2
berdirIt is not built-in, but you should be able to build something like this on top of privatemsg, atleast with my API patch which is hopefully soon ready to be commited. See #288183: Provide api function for other modules to send messages..
As soon as the patch is commited, I'm going to write some documentation, some things that are possible with privatemsg (without modifing the code, just with hooks etc):
- Either use the API functions to automatically send a private message from your own code/form or use/extend the privatemsg_new form
- Add links to each message when viewing a thread
- extend SELECT-Queries generated by privatemsg
- theme the privatemsg list and add multi-thread actions (See also #348907: Per thread/Multiple thread actions)
Of course, you need to code to extend it. If you have any questions regarding the linked issues, feel free to ask here or there, it would be nice to have some feedback, too.
Comment #3
litwol commented@berdir: food for thought. this brings good new feature to pmsg which is to be able to have multiple types of message formats. similar to node types. bear in mind that perhaps for drupal6 pmsg we are about 99.99% sure not to include this functionality into pmsg. but as of drupal7, which allows adding arbitrary fields to any object (such as message object) we should perhaps explore the possibility of moving to node system for the d7 branch. This is nothing that should happen now, especially since its not finished feature yet(fields), but certainly food for thought for inclusion in the roadmap.
Comment #4
jogebau commentedwow, that was a quick answer...
im not really a programmer myself, but i used to do quite a bit of programming, not in php though. how much programming would be involved to bring this functionality into privatemsg, and which features would needto be implemented?
edit: any time schedule for the patch? thank you for your work
Comment #5
litwol commented@jogebau: i dont think anyone is going to work on this since its such specialized feature for your site. your best bet is to hire a programmer to do it for you and then contribute a patch back.
Comment #6
jogebau commentedim no trying to get someone to do it for me, at least not for free, iwas trying to find out how much work would be involved. right now i see two options: do it myself, or hire someone.
although, i might be mistaken, but i dont see that this functionality is so specialised. Doesanybody know, whether something like this could be accomplished with other modules?
Comment #7
naheemsays commentedHave you had a look at some of the ecommerce modules? They may have something similar (I remember reading of a new module recently for I think ubercart that seemed auction-like and may have the necessary functionality).
Comment #8
jogebau commentedhm, no i did not yet...
there are quite alot of modules there, and a quick look didnt gget me anythhing... do you remember which module you mean?
Comment #9
jogebau commentedOk, after a bit more research, i could not find any other module that comes close to what i need. which brings me back to the question, how much effort would i need to invest to get the needed functionality?
Comment #10
berdirThe question is too generic, nobody can answer that without knowing what you really need... Adding "Action Links" to private messages needs two functions.. one hook and one page to handle it. So that part is easy.
However, I'm sure this is not the only thing you need.. UI for proposing such "offers" (No idea what these offers are... text, attachments, ...), displaying in thread display and list, and maybe administration/payment/security stuff (Note: privatemsg is "secure", I'm talking about verifying users and such things..)
I started to document the Privatemsg API here: http://drupal.org/node/369399 but it's far from complete. Especially all those hooks are still missing.
@litwol: fields definity sounds interesting, but that's stuff for the (far) future..
Comment #11
jogebau commentedthat sounds quite good...
what exactly do "Action Links" do? what i would like are some extra buttons in the message editor, which can promote the thread to a different status, but only for one user!
The offers are only textmessages, which can then be answered, and answered again.
Thanks alot for your help. i cannot start any coding right now, as i dislocated my shoulder a few weeks ago.
Comment #12
berdirI can see two ways of doing something like this:
a) Use hook_form_alter to add buttons/fields to the form, every form in Drupal can be extended with this hook, see http://api.drupal.org/api/function/hook_form_alter/6. If you go with this option, there is only one form for sending "normal" messages and offers. Extending could simply mean to add a "[ ] This is a offer" checkbox.
b) You could also define your own page, call privatemsg_new and extend/change it there. Then you would have a different form to create a offer.
Of course, you also need to store somehwere if it's a offer and if it has been accepted or declined. preferable in a own table with a reference to pm_message. Look at at the implementation of hook_form_alter and hook_privatemsg_message_insert in #342733: Create upgrade path from privatemsg_attachments to filefield
Comment #13
jogebau commentedthanks for the help... ive got something else to finish first, and will start working on this as soon as i finish that. my arm is better now, so i can start coding. it doesnt seem to hard to do, but i will keep you posted on where i get with this, and will keep asking questions here :)
thanks for the help!
Comment #14
berdirSame topic as #443784: Adding new fields to Private Messages, setting this to a duplicate.