Hi guys,

I love this module and the jquery plugin. I started to integrated for my module but I needed a way to create my event by drag and drop from the calendar, like it can be done on google calendar. There is a demo with this possibility on the fullcalendar website. So I modified the fullcalendar module. And I continued the same with edit and delete.

It works now for my module as you can see in the screenshot in attachment but it not generic yet to be integrated in the fullcalendar module. I'm now working on the migration of the code from my module to fullcalendar.

What has been done and what to do:
- create an event by drag and drop: complete
- node creation form open in colorbox and save with ajax: complete
- right click to open a context menu on the event: complete (with jquery plugin contextMenu)
- edit the event in colorbox and save with ajax: complete
- delete the event with ajax: complete
- permission for create, edit, delete: todo
- detect the date field: todo
- add settings in the view to select the content type that can be created: todo
- open form for all content type: todo
- save all the node field from the node form whatever the content type: todo (and I don't know exactly how to do that...)

I think I can submit a first patch this week end this week end.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jmaties’s picture

Great!!!

subscribing ;)

huslabs’s picture

subscribing too ;)

leilyrken’s picture

Quick update:
- permission for create, edit, delete: complete
- detect the date field: complete
- add settings in the view to select the content type that can be created: complete
- open form for all content type: complete

Todo:
- handle full form validation (currently just title)
- handle preview and delete button in create or edit form
- find my problem with fullcalendar_date_fields() and several date field

tim.plunkett’s picture

leilyrken, can we see a patch?
Or better yet, a Drupal git sandbox?

jhaski’s picture

Awesome... subscribing.

leilyrken’s picture

I'm installing git to create a patch. I also I upload a zip with the dev version with what has been complete.

It's working but not completely tested and some part are imcomplete (see the TODO in the code).

How it works:
- configure the view with the content type to create in the style configuration
- configure the permission (create any fullcalendar event, delete any fullcalendar event, edit any fullcalendar event)
- drag on the calendar to create the create type configured
- right click on the mouse icon to open the context menu with edit and delete option

Not fully tested:
- Permissions
- Alternative for fields for date, title and url
Todo:
- handle correct validation (in the edit/create form and in the the ajax save): now only the title is checked
- save all the field: now only the title and the date field are saved
- the multi days are not displayed correctly in the calendar but maybe it's a fullcalendar stuff

leilyrken’s picture

Status: Active » Needs work
FileSize
25.23 KB

And here the patch.

tim.plunkett’s picture

Is there any way to possible do this in D7 first?
I understand if you want to leave it for D6.

Please use two spaces, not tabs.

This is a big change, it would be very helpful if you could set up a Drupal git sandbox.

leilyrken’s picture

I will setup a Drupal Git sandbox. But I developp it for Drupal 6 because I use it for my feature for Open Atrium.

I have no idea about how to do the migration to Drupal7, I can try later. But there is 2 major todo to complete and I have no idea how to handle it. If you know you can give me a clue. Then I can start migration to D7

tim.plunkett’s picture

I would take some time to review the Drupal coding standards before writing any more patches, please.

zhuoyan’s picture

subscribing

panosp’s picture

In Reply to #7.
Great work. I tested it a bit and I came across two issues:

1. In View configuration -> FullCalendar style options -> Node manipulation settings are not saved. Every time the view is edited the information in that set is back to default (i.e. the first content type found and empty fields).

2. Drag on the calendar is not populating the form with the chosen date-time but the current. I tried a variety of settings (on cck field, node, view) but nothing seemed to work. Your code looks right though...

Thank you.

leilyrken’s picture

Thanks, I will have a look this week end and update the code with Drupal coding standart.

Vidus’s picture

Subscribing. Keep up the great work. Very excited about using these features.

leilyrken’s picture

I've been quite busy but I took time to create the git sandbox:
http://drupal.org/sandbox/leilyrken/1112686

I will check the issues from #12.

lindsayo’s picture

subscribing

lindsayo’s picture

subscribing

abaihaki’s picture

any news on this thing?

alexio2170’s picture

great idea (D7) any subscribing too

arnemaine’s picture

Subscribing. Definitely thinking D7.

leilyrken’s picture

Hi guys... Long time without news. I'm very busy those days (I'm gonna get married \ o /) and have unfortunately no time to spend on this module right now.

If someone want to get a look to the code to implement it for D7 it could be great.

tim.plunkett’s picture

Assigned: leilyrken » Unassigned

Congrats leilyrken!
Hopefully I'll have some time, or someone else can step up.

Open Social’s picture

We love this module and will try to free some time to help you out with patching!

The module is also requested for Drupal Commons:
http://commons.acquia.com/blog/eventslots-shifts-module

aspilicious’s picture

I looked at the sandbox and I alrdy have 1 concern. Colorbox is not and will not be a dependency. Please be carefull with this while coding stuff :)

Open Social’s picture

Hey!

I have worked on it, made some little changes. http://drupal.org/node/1184044

Download the sandbox version via git and apply the patch in the comment.

@aspilicious, Why won't colorbox be a dependency?

tim.plunkett’s picture

Colorbox is not going to be a dependency of FullCalendar because it currently works without it. If this can be a sub-module, that'd be great, and it can depend on whatever is needed.
I have to look at the code, but I imagine it could easily hook_menu_alter to take over the callbacks.

aspilicious’s picture

Because people that don't need that feature would have to install an useless module.

This actually should be a submodule that depend on the fullcalendar module THAN it can have colorbox as a dependency.

Looking at the code it should be possible (with some small modifications to fullcalendar it self) only the javascript and views stuff I'm not certain about.

And *please* use the coding standards while coding, because its hard to read code with tabs and trailing whitespaces in it. Sometimes I forget it myself but I try to do the best I can.

Open Social’s picture

ok! Tomorrow I will go through the patch and make sure it is coding standard.

I like the idea of a submodule. Maybe I could write it. Will see.

kuemerle5’s picture

Subscribing. This is looking good.

webankit’s picture

+1

Open Social’s picture

http://drupal.org/sandbox/goalgorilla/1207988

Install instructions:

  • Install the fullcalendar module
  • Open fullcalendar.module en comment out  line number 206 like:   //drupal_add_js(drupal_get_path('module', 'fullcalendar') . '/js/fullcalendar.views.js', 'module');
  • install modalframe
  • Build a view, save it and edit it. Now you will see Fullcalendar extra's on the fullcalendar display style.

Known bugs

  • There is no delete permission check (It goes with the edit permission)
  • The hacking of the fullcalendar module is ugly. There should be a fix soon.

 

If you have ideas about how to fix these issues or you need help with implementing you can send an email to daniel@goalgorilla.com or post them in the issues queue of the sandbox

Open Social’s picture

I have added some more options:

url with a hash with the dates. This makes deeplinking possible.
z-index when hover. When overlapping you can still click edit.
some more small bugs.

if you checked the example and could add an event, it was because the pager was set to display only ten. That is fixed now.

I found another bug, will check today if it is also in the fullcalendar module.
When resizing an event and click next and back the event is in its old status (the node IS saved but displayed in its old status)

kenkasmar’s picture

This is some great work!

I have a question about varying the colors of the events. I notice that you have that function in the demo, but I'm having a hard time figuring out how to implement it on my site. Am I missing something obvious?

Open Social’s picture

Hey Ken,

If you are using the fullcalendar_extra module you can do this with a theme function

put the following in your theme template.php

function YOURTHEME_fullcalendar_extra_classname($node) {
$className = array(
'fc-event-default',
$node->type,
'color-' . $node->field_color[0]['value'],
);
return implode(' ', $className);
}

In this example we put three classes. the last one is a cck field. This one is used in the example.

UK_Rogue’s picture

Ref Commit f6600d4 fullcalendar_extras

Thanks for both these modules, they meets all requirements I have for my site, but I have bumbled into the following issues.

1. I followed instructions as per #31 but am receiving an error on all fullcalendar views before it can populate the time fields or add any content:
V.find("tr:eq(" + x + ") td div")[0] is undefined
2. It's not possible to save settings in views, it just reverts back to defaults.
3. Weekend settings although set to true, only shows Monday to Friday in the calendar.

Fullcalendar itself was working upto this point.

Once again, brill module!

******Additional*********
It appears to be the commenting out of line 206 "The Ugly Hack". Changing this back fixes fullcalendar but removes the additional functions from extras.

******Update**********
Install file was missing. Copied from initial commit.

xlyz’s picture

subscribing (+1 x D7)

paulgemini’s picture

sub +d7

tim.plunkett’s picture

Status: Needs work » Closed (duplicate)

This thread is full of pain. Marking it as a duplicate of #1275980: Drag & Drop Creation.

sterodste’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Closed (duplicate) » Active

Hi,

I'm new to Drupal. I have instal fullcalendar and colorbox and it's work great(Drupal 7). I try something in the code of the module:fullcalendar/fullcalendar_options/js/colorbox.fullcalendar.js to be able to see my events in editable mode.

L-15
if ($.colorbox) {
var url = "/?q=node/"+calEvent.eid+"/edit" ; //// Pour faire ouvrir en mode édition avant: calEvent.url;
if (settings.colorboxClass !== '') {
url += ' ' + settings.colorboxClass ;
}
$.colorbox({
href: url,
width: settings.colorboxWidth,
height: settings.colorboxHeight,
iframe: settings.colorboxIFrame === 1 ? true : false
});
}
L-26

I would like to know if it's a good thing to do or it's gone a make me suffer later?

Is there a better way?

And if you have a hint to be able to redirect the user by the way he came, after a save (like history back). I'm able to redirect with action and trigger but....not back(-1).

I came from Filemaker and I'm very impress by Drupal.....

Sorry for my english and the term I used.

Thanks

tim.plunkett’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Active » Closed (duplicate)

You can point the url to the edit link with the "customizable fields".
Open a separate support request if you need more info.

sterodste’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Category: feature » support

Thanks Tim,

I all ready try this, but I always have a "Request unsuccessful: error", Maybe I miss something?

ADD FIELD:
Content: Edit link
Provide a simple link to edit the content.

CUSTOMIZABLE FIELD:
Use a custom redirect URL - edit link

And is it correct -- reply and support request or I would have to create a new one?

tim.plunkett’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Category: support » feature

This is a D6 feature request that has been marked a duplicate. Please open a new issue.

apoc1’s picture

any update on this feature?