Name

advanced scheduling field (asf)

Description

This field allows content editors to do advanced un/publishing.
Basics
- schedule publication and depublication (most simple behavior)
- schedule (cron like) daily publication from/to a specific time
- schedule weekly de/publication of a node
- schedule monthly de/publication of a node
- schedule daily publication of a node on only weekdays 1,3,5
- schedule daily publication of a node on only days of month 1,2,3,4
- schedule daily publication of a node , on weekdays until a iteration count has been reached
- schedule daily publication of a node , on mondays until a date is reached
At the moment the module supports only one field of advanced scheduling, but this can easily be expanded.
Advanced Possibilities
The possibilities are mind blowing (because multiple fields can exists of this field):
- schedule on next 10 mondays also on tuesdays until date x and on wednesday from time x to time y
- ...

Repo

Git: http://drupalcode.org/sandbox/wouters_frederik/1689696.git
project page : http://drupal.org/sandbox/wouters_frederik/1689696

Drupal version

Drupal 7

Status

I have the need for this for a client, and development is not finished. More development and testing will happen on this module.
It is better when this testing and dev is contributed.

Comments

wouters_f’s picture

Assigned: wouters_f » Unassigned
Category: feature » task
Status: Active » Needs review

It should be a task...in review...

sanchi.girotra’s picture

Status: Needs review » Needs work

1. Add direct link to your git repository (git clone ...) in the Issue Summary. Refer:http://drupal.org/node/1011698.
2.There is still a master branch and to remove that can use following commands:
git branch -d master (make sure active branch(git branch) is not master then run)
git push origin :master
Manual Review:
1File names should start with module name.
2.install file have empty hooks like asf_install(), its not necessary to have a .install file in a module refer http://drupal.org/node/51220.

wouters_f’s picture

Status: Needs review » Needs work

I have

  • added the direct link to the code
  • pushed removal of master brand
  • removed empty hooks
  • added a TODO

I don't understand what you mean by

File names should start with module name.

The module's name is advanced scheduling field, but (a la display suite -> ds) asf seems much more usable in the code.
*EDIT Can you please explain what I'm doing wrong? I understood and created a module asf, so the name of the files is consistent with the repo.

wouters_f’s picture

Issue summary: View changes

added asf moduel in stead of module with wrong name.

wouters_f’s picture

Status: Needs work » Needs review
wouters_f’s picture

Issue summary: View changes

added link to code

vaibhavjain’s picture

Status: Needs work » Needs review

Just to update you, your links are still incorrect.
Please edit your project application and provide correct links
Project page - http://drupal.org/sandbox/wouters_frederik/1679534
GIT - http://git.drupal.org/sandbox/wouters_frederik/1679534.git

wouters_f’s picture

Issue summary: View changes

added git clone command to summary

wouters_f’s picture

The links you add in your reply are not correct, and are not in the project application, where did you find those?
The last one even renders me a page not found error.

It should be

Git: http://drupalcode.org/sandbox/wouters_frederik/1689696.git
project page : http://drupal.org/sandbox/wouters_frederik/1689696

Those are both in the project application if I can see correctly.

*edit typo

vaibhavjain’s picture

@drupal_sensei

The last link in my previous reply will definitely show you a page not found. It is path to your GIT Repo.
While cloning your code, we use this path.
Try looking at your project page when you are not logged into drupal, this is the path which we use.

For project page link, you have updated the project page link, so that is an old one.

wouters_f’s picture

I'm sorry.
What is wrong now, in IRC they tell me it's as it should be.

millette it works for git clone
millette drupal_sensei, it's working as expected

Don't know what to do more.

jrsinclair’s picture

Status: Needs review » Needs work

Automated review:
There are a few (very minor) issues being found by code sniffer: http://ventral.org/pareview/httpgitdrupalorgsandboxwoutersfrederik168969...

Manual review
First of all, looks like this could be a very handy module.

  • The functions asf_schema() and asf_field_schema() should be in a file called asf.install
  • This is really minor, but there are a few spelling errors in the comments and README file. For example, on line 27 of asf.module, "fuime grained publishing" should be "fine grained publishing". I realise this doesn't affect the code's operation, but it helps reviewers like myself. Good on you for writing them in the first place though.
  • Another really minor point (a matter of style and personal preference): I'm curious as to why you pass actions as anonymous objects. Would it not simply be easier to create them as associative arrays, and then pass them directly to the fields method? For example, your asf_insert_action() function would then look like this:
    function asf_insert_action($action) {
      $action['created'] = REQUEST_TIME;
      $aid = db_insert('asf_schedule')
        ->fields($action)
        ->execute();
      return $aid;
    }
    

Those last two items are minor, but the first does need changing.

wouters_f’s picture

Thanks for the review!

  • I addressed the required changes (all of them).
  • About the code style remark.

You are probably right.
I think I did it that way because the selection function returns objects and I thought it would be easy to change a property and save them like that without object=>array.
an example of this:

function _asf_dismiss_action($action) {
  $action->status = ASF_STATUS_EXECUTED;
  asf_update_action($action);
}
klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

wouters_f’s picture

Status: Closed (won't fix) » Needs work

re-opened because I still am working on it.
Il just did a major rewrite of the UI.
And added some functionality (inheritanbce of publication schema from other nodes).

peterx’s picture

Documentation: I looked at your sandbox page for documentation about how this module fits into things I do on existing sites. The image shows a lot of useful information and is an excellent starting point for documentation.

The iteration option is not obvious and could be mentioned to give us an idea of the range of options. Why do you say Loop until?

Cron is not mentioned. I presume cron has to run daily to start your process for a publication by date. What happens for publication by time? If I want to publish a special offer from 4:00 pm to 6:00 pm, do I have to set cron to every hour? Should I use something like Elysia cron?

The last bit is the inheritance. How exactly will that work? An example would be nice when you implement that feature. A common situation is the publication of an issue of a magazine. When the issue is published, all the articles are published. I think, from reading the sandbox page, I would connect the articles to the issue and they would inherit the same publication schedule.

The module looks like a useful step forward for people publishing notes about events where every article has a different timeframe of usefulness.

wouters_f’s picture

Good to see you are interested in the module.

There are following modes

  1. publish from a specific date(+time)
  2. publish from a specific date(+time) unpublish on another date(+time)
  3. publish from a specific date(+time) unpublish on another date(+time)
  4. iterate publication (publish every monday from 2 - 4 untiel end date)
  5. Inherit publication (do same as node x, also after it changes)

Your question is about the iteration,

Iteration

The iteration option does the following:
Iterate publication of this node every day from H:m to H:m.
You need the following fields for this:

  1. start date of publication
  2. end date of publication
  3. type of iteration
    • You may stop the iteration after x iterations (loop until)
    • you may stop the iteration at a specified date
    • you may stop the iterating if either one of the above is reached.
  4. publish at (start publication on iterated day on hour)
  5. unpublish at (end publication on iterated day on hour)
  6. cron fields for the iteration (calender days, weekdays , month)
  7. (optional) max amount of iterations

This functionality should work fine in the current sandbox version.

Cron

There is a implementation of the hook_cronapi (elysia). I run this elysia cron every minute as my client needs publication on the minute of nodes (and its related nodes). You may do this as you which.
This is already tested and works nice.

Inheritance

An example of how I will be using in this module. We have actions that will be published at a specific time and then depublished after a specific time (on the minute).
Related banners and other promo content types will have to do accordingly. They will inherit the publication schema of the parent node.
This can be set up by using the option interit / and there entering the title in the entityreference field.
I first created a textfield for the node id, but this is not really user friendly.
This input textfield needs a little work still, as the entity reference field does not implement hook_element_info. Kenneth has made a patch for this (http://drupal.org/node/1678412).

More feedback is more than welcome!
Please give the module a try.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

edit better readability

avpaderno’s picture

Title: Advanced scheduling field » [D7] Advanced scheduling field
Issue summary: View changes