Updated: Comment #8

Problem/Motivation

Rooms Node extend the funcionalities of the Rooms module for all node types.

- Availability and prices dates for the nodes types
- An index of dates with prices and availabilities for using views exposed filters
- All of the fields of a rooms_unit is cloned into the node type

- When a node is deleted also the Room unit is deleted
- When a price, availability or a customer booking a resource the index is updated automatically
- Provide a block with checkin checkout selection for booking into the node page

At the moment all this functionalities working without any hack to the Rooms module.

WHY ROOMS NODE

Proposed resolution

This module is thinked to manage thousands of bookable items and search them using views, at the moment this is not possible with rooms.
To bypass this issue, all functionalities of rooms module are been imported into node types for better flexibility and management.

Rooms node provide a linear index that add a row for each day/nid with price and state. Is possible to query the availabilities of rooms_unit using "sql standard" and not php code using views by a new filter rooms date, that search in a range of dates.

A secondary improvement is in node management that provide per user permissions.

LINKS

GIT: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ziomizar/2086255.git rooms_node
SANDBOX PAGE: https://drupal.org/sandbox/ziomizar/2086255

PAREVIEW

http://pareview.sh/pareview/httpgitdrupalorgsandboxziomizar2086255git

Review of other projects:

1. https://www.drupal.org/node/2477289#comment-9864511
2. https://www.drupal.org/node/2477121#comment-9864547
3. https://www.drupal.org/node/2478481#comment-9872273
4. https://www.drupal.org/node/2479227#comment-9875829
5. https://www.drupal.org/node/2479471#comment-9875869
6. https://www.drupal.org/node/2477359#comment-9876001

Comments

ziomizar’s picture

Issue summary: View changes
klausi’s picture

Status: Active » Needs review

I guess this needs review? See the project applications workflow.

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxziomizar2086255git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

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

ziomizar’s picture

Status: Needs work » Needs review
ziomizar’s picture

Tnx klausi need review!

balagan’s picture

This still needs work. Check the http://pareview.sh/pareview/httpgitdrupalorgsandboxziomizar2086255git page, and try to correct the errors listed there.

balagan’s picture

Status: Needs review » Needs work
areke’s picture

Issue summary: View changes
christianadamski’s picture

Hey,
would it be a good idea to offer your improvements to the rooms module itself?
Would your module supersede the original rooms module completely?
Are you in contact with the creators of that module?

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 (see also the project application workflow).

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

ziomizar’s picture

Hi,

I've restarted to work on this project, after some months i tried to search something similar to this module but no luck.

ChristianAdamski:
- i've let some messages on the issue list of rooms but the creator of the module dont responded me.
- this module don't superseded rooms, but improve it, offer some functionalities like views search, book now button in full node page, and integrate into node the rooms functionalities.

I've commited some improvements and fix all open issues on the sandbox page.

ziomizar’s picture

Status: Closed (won't fix) » Active
ziomizar’s picture

Fixed a lot of errors on pareview i think that remain only false positive.

http://pareview.sh/pareview/httpgitdrupalorgsandboxziomizar2086255git

ziomizar’s picture

Issue summary: View changes
ziomizar’s picture

Issue summary: View changes
ziomizar’s picture

Status: Active » Needs review
ziomizar’s picture

Issue summary: View changes
ziomizar’s picture

Issue summary: View changes
ziomizar’s picture

Issue summary: View changes
RavindraSingh’s picture

There are still many errors needs fix:

FILE: ...7-pareview/pareview_temp/views/rooms_node_handler_filter_datetime.inc
---------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------
10 | ERROR | Class name must begin with a capital letter
10 | ERROR | Class name must use UpperCamel naming without underscores
18 | ERROR | Method name "rooms_node_handler_filter_datetime::op_simple"
| | is not in lowerCamel format
18 | ERROR | Visibility must be declared on method "op_simple"
37 | ERROR | Method name "rooms_node_handler_filter_datetime::op_between"
| | is not in lowerCamel format
37 | ERROR | Visibility must be declared on method "op_between"
87 | ERROR | Method name
| | "rooms_node_handler_filter_datetime::format_date" is not in
| | lowerCamel format
87 | ERROR | Visibility must be declared on method "format_date"
---------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/rooms_node.module
---------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------
290 | ERROR | Expected type hint "Date"; found "DateTime" for $start_date
290 | ERROR | Expected type hint "Date"; found "DateTime" for $end_date
---------------------------------------------------------------------------

Time: 315ms; Memory: 12.25Mb
ziomizar’s picture

Hi RavindraSingh,

This errors are views related, i follow the style of views to write extend the views handler, i think that the errors you reported are minor or false positive.

ziomizar’s picture

I have corrected only the Date parameters in the comment that was different from the function parameters.

novitsh’s picture

First of all your GIT clone url should be: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ziomizar/2086255.git rooms_node
This is without your username in it.

Automated Review

You have issues (as mentioned above) according to PAReview: http://pareview.sh/pareview/httpgitdrupalorgsandboxziomizar2086255git

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follow the guidelines for in-project documentation and/or the README Template. Your titles/headings should be underlined for better reading. I'm missing a bit of extra helpful headings like 'installation' etc..
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. >Your .info file contains commented out files.
  2. It's not adviced that you have code in comments. Example in rooms_node.index.inc: // db_query("DELETE FROM {rooms_availability_index

Conclusion: I have not tested the module in my local, I've just looked at the code. It seems like a very good module and I know for sure that this could benefit many people. I have a feeling your module can use finetuning like mentioned in the topics above. But then again, those are probably minor things and easy to fix.

I'm really looking forward to this module myself! Keep up the work.

This review uses the Project Application Review Template.

ziomizar’s picture

Issue summary: View changes
ziomizar’s picture

Hi Novitsh,

Tnx for your review!

I set these points:

I will not solve the problems in Pareview because it is the same style used in filters handler of the views module.

I hope you will test it soon!

ziomizar’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
ziomizar’s picture

Issue summary: View changes
ziomizar’s picture

Issue summary: View changes
ziomizar’s picture

Issue summary: View changes
klausi’s picture

Assigned: Unassigned » naveenvalecha
Status: Needs review » Reviewed & tested by the community

Git errors:

Review of the 7.x-1.x branch (commit 00af6e9):

  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. So it looks like all this stuff should live in the rooms module? Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. If you cannot reach the maintainer(s) please follow the abandoned project process.
  2. rooms_node_schema(): description is wrong for most columns and for the tables as well? You should also specify the primary and foreign keys of your tables, see https://api.drupal.org/api/drupal/includes!database!schema.inc/group/sch...
  3. rooms_node_admin_paths(): why do you define those paths as admin paths? Please add a comment.
  4. rooms_node_block_view(): do not call drupal_render() here, just return the render array. Drupal core will render it leter for you. Same for rooms_node_update_booking_price_infos(), don't call theme() there, jsut return a render array. See https://www.drupal.org/node/930760
  5. "t('from') . " " . $start_date->format('d-m-Y') .": do not concatenate dynamic variables to translatable strings, use placeholders with t() instead. See https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7
  6. rooms_node_update_index(): you must not use db_query() for insert query, use db_insert() instead.
  7. rooms_node_form_node_type_form_alter(): doc block is wrong, this is hook_form_FORM_ID_alter().

But that are not critical application blockers, looks RTBC to me otherwise.

Assigning to Naveen as he might have time to take a final look at this.

ziomizar’s picture

Hi klausi,

- I have removed the master branch.

1. The mantainer of rooms do not seems interested on include rooms_node into rooms module.
2. I have added on rooms_node_schema() the primary key, foreign keys, indexes and unique keys and fixed all the descriptions
3. rooms_node_admin_paths() is not used on this version of the module and has been removed
4. rooms_node_block_view now return just the render array without call any theme or render functions
5. Changed the concatenated variables in t() functions with placeholders
6. Changed db_query with db_insert on rooms_node_update_index()
7. Fix doc description of the hook in hook_form_FORM_ID_alter()

Thanks for your review..

naveenvalecha’s picture

Review of the 7.x-1.x branch (commit 8b4ba03):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: ...modules/pareview_temp/views/rooms_node_handler_filter_datetime.inc
    ---------------------------------------------------------------------------
    FOUND 8 ERROR(S) AFFECTING 4 LINE(S)
    ---------------------------------------------------------------------------
     10 | ERROR | Class name must begin with a capital letter
     10 | ERROR | Class name must use UpperCamel naming without underscores
     18 | ERROR | Method name "rooms_node_handler_filter_datetime::op_simple"
        |       | is not in lowerCamel format, it must not contain underscores
     18 | ERROR | Visibility must be declared on method "op_simple"
     37 | ERROR | Method name "rooms_node_handler_filter_datetime::op_between"
        |       | is not in lowerCamel format, it must not contain underscores
     37 | ERROR | Visibility must be declared on method "op_between"
     87 | ERROR | Method name
        |       | "rooms_node_handler_filter_datetime::format_date" is not in
        |       | lowerCamel format, it must not contain underscores
     87 | ERROR | Visibility must be declared on method "format_date"
    ---------------------------------------------------------------------------
    UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
    ---------------------------------------------------------------------------
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

Manual Review :

  1. Readme.txt is nice.hook_help is missing.P
  2. Need to add dependency on the views module in rooms_node.info file.Rooms module has not any dependency on views http://cgit.drupalcode.org/rooms/tree/rooms.info
  3. rooms_node.admin.inc : There are no admin functions in this file that operates at administration art.So I suggest it should be renamed to rooms_node.helper.inc . The orgranization I worked with, we keep the *.admin.inc files for keeping the administration functions that use in administration pages.

Already RTBC by@klausi.Found no blocker.

naveenvalecha’s picture

Assigned: naveenvalecha » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, @ziomizar!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

ziomizar’s picture

Hi naveenvalecha,

- the code in rooms_node.admin.inc alter the content type configuration form, like admin/structure/types/manage/your-content-type

- I've fixed views dependencies and implemented hook_help

Thanks! :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.