[symfony-users] sfGuard, securing and Templates
Good morning everyone Just want a few pointers on how to do the following. 1) Add a link to the sfGuard login on an application template 2) Secure selected modules of an application based upon user group 3) Allow "main" module to be accessible to everyone All assistance would be appreciated. Adrian --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] RE: Complex criteria creation - hotel room bookings problem
Another adjunct to the problem... I have got the filter working, but still would like to see: Is there a way to do the above using the addCriteria/addAscendingOrderByColumn and other Propel capabilities? It would be nicer than using the SQL code below just in case the structure of the database changed! Adrian - from BookingPeer.php - class BookingPeer extends BaseBookingPeer { function getBookedUnbooked($date) { $con = Propel::getConnection(); $sql = " SELECT booking.* FROM booking WHERE '".$date."' BETWEEN start_date AND end_date UNION SELECT 0 as id, 0 as client_id, id AS room_id, '-00-00' as start_date, '-00-00' as end_date, 0 as adults, 0 as children, '-00-00 00:00:00' as created_at FROM room WHERE room.id NOT IN ( SELECT room_id FROM booking WHERE '".$date."' BETWEEN start_date AND end_date ) ORDER BY room_id "; $stmt = $con->createStatement(); $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM); // $this->bookings = BookingPeer::populateObjects(BookingPeer::doSelectRS($rs, $con)); return BookingPeer::populateObjects($rs); } } - from actions.class.php - public function executeShowbooked() { if (!$this->getRequestParameter('checkDate') ) { $this->checkDate = date('Y-m-d'); } else { $this->checkDate = $this->getRequestParameter('checkDate'); } $this->checkDate = $this->getRequestParameter('checkDate'); $this->bookings = BookingPeer::getBookedUnbooked( $this->checkDate); } - from showbookedSuccess.php - Check this date: true, 'withtime' => false, )) ?> - the rest of the form / results display is not shown - Still will want to take this a step further and show rooms and dates booked in a "grid" or "matrix" as shown below: Room Date 101 102 103 201 202 203 20080612YNYNYN 20080613YNNNYY 20080614NYYNYY 20080615NNYNYN Adrian --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] RE: Complex criteria creation - hotel room bookings problem
Further to my original message, I have managed to work some of the problem out... creating a function in the BookingPeer.php file... This current version uses no passed criteria for the current date or date selected by the user in the view... function getBookedUnbooked() { $con = Propel::getConnection(); $sql = " SELECT booking.* FROM booking WHERE '2008-06-12' BETWEEN start_date AND end_date UNION SELECT 0 as id, 0 as client_id, id AS room_id, '-00-00' as start_date, '-00-00' as end_date, 0 as adults, 0 as children, '-00-00 00:00:00' as created_at FROM room WHERE room.id NOT IN ( SELECT room_id FROM booking WHERE '2008-06-12' BETWEEN start_date AND end_date ) ORDER BY room_id "; $stmt = $con->createStatement(); $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM); return BookingPeer::populateObjects($rs); } // end function Next step is to add the passed criteria... Also, is there a way to do the above using the addCriteria/addAscendingOrderByColumn and other Propel capabilities? It would be nicer than using the above just in case the structure of the database changed! Adrian -Original Message- From: Gould, Adrian Sent: Fri 6/13/2008 13:52 To: Symfony Googlegroup Subject: Complex criteria creation - hotel room bookings problem Hi all I am trying to create the following SQL as a PROPEL criteria to sit in the Bookings model. Details are: Schema-- booking: id: ~ client_id: integer room_id:integer start_date: date end_date: date adults: integer children: integer created_at: timestamp client: id: ~ name: varchar(128) created_at: timestamp room: id: ~ name: varchar(128) price: decimal bed:integer created_at: timestamp SQL- [with checkDate being the date to be checked that is passed from the view] SELECT room_id, 'Y' AS booked FROM booking WHERE checkDate BETWEEN start_date AND end_date UNION SELECT id AS room_id, 'N' AS booked FROM room WHERE id NOT IN ( SELECT room_id FROM booking WHERE checkDate BETWEEN start_date AND end_date ) ORDER BY room_id The eventual purpose is to display a table in the view with rooms and dates booked: Room Date 101 102 103 201 202 203 20080612YNYNYN 20080613YNNNYY 20080614NYYNYY 20080615NNYNYN Now I am making an assumption that this is best placed in the Booking.php file in lib/model so that results are available to more than one controller. I am not that familiar with PROPEL yet, so help is appreciated. Once I have this little application working I am aiming to provide it to the symfony community as a tutorial via our IT web site, so help will be credited both here and in the articles. Adrian --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Complex criteria creation - hotel room bookings problem
Hi all I am trying to create the following SQL as a PROPEL criteria to sit in the Bookings model. Details are: Schema-- booking: id: ~ client_id: integer room_id:integer start_date: date end_date: date adults: integer children: integer created_at: timestamp client: id: ~ name: varchar(128) created_at: timestamp room: id: ~ name: varchar(128) price: decimal bed:integer created_at: timestamp SQL- [with checkDate being the date to be checked that is passed from the view] SELECT room_id, 'Y' AS booked FROM booking WHERE checkDate BETWEEN start_date AND end_date UNION SELECT id AS room_id, 'N' AS booked FROM room WHERE id NOT IN ( SELECT room_id FROM booking WHERE checkDate BETWEEN start_date AND end_date ) ORDER BY room_id The eventual purpose is to display a table in the view with rooms and dates booked: Room Date 101 102 103 201 202 203 20080612YNYNYN 20080613YNNNYY 20080614NYYNYY 20080615NNYNYN Now I am making an assumption that this is best placed in the Booking.php file in lib/model so that results are available to more than one controller. I am not that familiar with PROPEL yet, so help is appreciated. Once I have this little application working I am aiming to provide it to the symfony community as a tutorial via our IT web site, so help will be credited both here and in the articles. Adrian --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Custom helpers - version 1.0 vs 1.1 and how to write?
Hi everyone I am struggling with the Helpers... I am finding the official documentation a little hard to roll into a practical example. Has anyone got a small example they can show to assist this? Maybe a good contribution to the docs? Is Symfony 1.1 using the same principle for helpers as is in version 1.0? Ady --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Accessing a "foreign" model from a different module/controller - SOLVED
Thanks Thomas DOH! I missed a simple thing in the solution I had - a semicolon! BUGGER :-) Ady --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Accessing a "foreign" model from a different module/controller
Problem Taking the my_first symfony tutorial as the basis for this problem... We have a module called main which has no associated table/model. We want to access the Post model from this controller so that we can put the last five posts on the default page that is displayed using the main module. How do we do this? Cheers Ady --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: installing symfony via PEAR
Dean I have had the same problem here where there is a proxy that runs not on port 80 [transparent proxying]... I ended up using the offline solution successfuly. Adrian Adrian Gould Lecturer in Information Technology Business, Finance and Computing PO BOX 1336, Midland WA 6936 Ph: +61-8-9374 6378 Fx: +61-8-9374 6375 Web: www.swantafe.wa.edu.au Content of this may eMail may not reflect the author or college's viewpoint: If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time--a tremendous whack. - Sir Winston Leonard Spencer Churchill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Survey System built upon Symfony
Good morning all, quick question: has anyone designed and/or seen an open source survey system built upon symfony? Thanks Adrian --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance & Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---