CVS edit link for agill

Hello my name is Andreas.
I am a software developer from/in Germany.
Normaly i work with Clarion(4. generation templatelanguage),java JSF(i hate it).

I stumbled on drupal 1 year ago and i am
still impressed by its architecture. For me
Drupal is not "just" a CMS, its a development platform for
bored Developers like me!

"Describe what modules, themes, or translations you want to maintain and why. Please provide as much information as possible along with appropriate links if available."->

The AGRESERVATIONS module i want to provide makes heavy use
of the well known MERCI-module and the CALENDAR module.
I think of it as the "missing link" to be able to build sites / applications
for the hotelbuisiness or every buisiness where resources are for rent on a
daily basis .

"If your contributions implement existing functionality explain why you want to duplicate it or why you cannot extend any of the existing projects." ->

There are other modules which try the same, yes. But what i try to provide is a solution that
is for front AND backend: Sitevisitors can make a search for a resource(rooms).
Siteowners/Receptionists can see which Resource on which Day is reserved by which person.
AND i took the time to make use of hooks and functions and the Drupal mechanisms of overwriting
themes to build up a solutions that is more "the Drupal way".

I don`t know, its my first cvs-application. If you have
any further questions please ask!
a demo of some of the functionality can be seen
on the demosite: http://hoteldemo.mightech.de
(....yes a cheesy name, i am really bad at naming things....)
log in as User: "Rezeptionist" with PW: "demo"

Thanks in advance for your time and patience.

Andreas

Comments

agill’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new29.18 KB
avpaderno’s picture

Issue tags: +Module review
agill’s picture

Some things i forgot(i am sure there is more i forgot...)

1.: this module is for drupal 6

2.: make sure the Calendar, Merci, Views, Views Ui,and prepopulate modules are installed

2.: install the agreservations modules.

3.: after that BEFORE adding agreservations_units go to Administer->content types -> agreservations_unit->edit
->MERCI setting->here: chose for "Reservable item type" Resource, "Status" has to be active, also check: "Allow overnight reservation" AND
"Allow weekend reservation".
-without this step the rooms will be shown in the bookingcalendar but will not be reservable items.

4.: add the merci reservations date in a calendar view OR import the calendar view which is suplied in the readme.txt
in Views UI

5.: add some agreservation_unittypes like: standard, large...

6.: add some agreservations units like: Room #1, Guestroom, Room#2, the boat,...

A detailed documentation is in work. I also work on the next version where it will be possible for the admin/Receptionist
to make reservations/orders for new/other users in 1 step on 1 formular.

Again thanks for your time and patience.

Andreas

agill’s picture

StatusFileSize
new27.15 KB

As you may have noticed i have not
yet fully understood the ubercart-hooks used in
the agres_bookings module.

I cleaned up a bit. Here is the newest attachment:

AjK’s picture

Assigned: Unassigned » AjK
Status: Needs review » Needs work
  $bookedunits = db_query("SELECT  tn.nid AS tnid, tn.title AS title, nt.type, nt.name FROM {merci_reservation_detail} m INNER JOIN {node} pn ON m.placeholder_nid = pn.nid INNER JOIN {node_type} nt ON pn.type = nt.type LEFT JOIN {node} tn ON m.item_nid = tn.nid WHERE m.vid = %d", $paramnid);
  1. The query is not wrapped by db_rewrite_sql()
  2. The query doesn't include WHERE node.status = 1
  3. {node} tn should be {node} n
  4. Not sure but I think you should SELECT from the {node} n table and INNER JOIN the other tables.

Didn't get any further as that jumped out at me on page 1.

agill’s picture

Yes i think i have not thought about that in several places.
Also i noticed some other issues already. I will upload a corrected version this week.

agill’s picture

Status: Needs work » Needs review
StatusFileSize
new21.53 KB

Hello, here comes the updated version.
Please have a look. thanks!

Andreas

avpaderno’s picture

Status: Needs review » Needs work
  1.     $sql = db_rewrite_sql("SELECT n.nid, n.title AS title,ctar.nid ,ctar.field_agreservations_unitnumber_value  FROM {node} n INNER JOIN {content_type_agreservations_unit} ctar ON n.nid = ctar.nid WHERE (status=1 and type='agreservations_unit') order by ctar.field_agreservations_unitnumber_value");
        $res = db_query(db_rewrite_sql($sql));
    

    What is wrong in that code?

  2. Why is the module overwriting the theme functions it defines? Why isn't giving the correct definition in hook_theme()?
  3.     $units = _agreservations_get_unitnodes();//A.Gill Alle Räume aus der Datenbank holen
    

    Comments should be in English.

  4. Check the character used to indent the code, which should be 2 spaces.
  5.                     $tmpdefaultdate1 = new DateTime($_REQUEST['default_merci_date']);
    

    Drupal 6 is still compatible with PHP 4; is the class DateTime available for PHP 4?

  6.     if (isset($form['type'])) {
            if (isset($form['type']['#value'])) {
                if ($form['type']['#value'] == 'merci_reservation') {
    

    The code can be simplified.

  7.     $node->field_agres_userref[0]['uid']   = $userid;
        node_save($node);
    

    That is not the correct way to save a node object.

  8.   require_once './' . drupal_get_path('module', 'content')
          . '/modules/content_copy/content_copy.module';
    

    There is a Drupal function that should be called instead of executing that code.

  9. _agreservations_install_cck_unit(), and _agreservations_install_cck_mercireservation() could be replaced by a single function that accepts parameters.
  10. Verify the code is respecting the module namespace.
agill’s picture

Status: Needs work » Needs review
StatusFileSize
new22.54 KB

Hello, i believe i solved all the problems you mentioned,
except 10. which i didn´t understand.
Could you please provide an example where there is a namespaceproblem
in the modulesource. So i can better understand and look over my code
again. But the Points 1. to 9. should be solved now.
Attached is a new version.
I did not yet implement new functionality as it took some time.
But i think its better to get everything straight bevore moving on.
Thanks for reviewing.

sreynen’s picture

The only thing I see that's not properly namespaced under the module name is the _remove_cck_fields function in agreservations.install.

avpaderno’s picture

Status: Needs review » Needs work

I confirm what reported by sreynen. Functions defined by the module needs to respect the namespace, which means the function names must follow a defined schema.

agill’s picture

Status: Needs work » Needs review
StatusFileSize
new21.58 KB

Ok the namespaceproblem is solved now too.
Also i wrote an actualized README.TXT.
The module now automatically provides the default-view bookingcalendar
and adds it to the navigation as a menuentry.
Please review the attached module.

avpaderno’s picture

Status: Needs review » Fixed
agill’s picture

Thanks for your time and patience.
I will begin with the further work on the module when i return from my vacations in
2 weeks.

Greetings
Andreas

P.S. Happy new year!

Status: Fixed » Closed (fixed)
Issue tags: -Module review

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

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: AjK » Unassigned
Issue summary: View changes