Database Date/Time Functions?

2009-08-18 Thread Elmo

I would like to use the built in database date/time functions as part
of a 'conditions'. How is this done?

i.e.: select foo from bar where created = (NOW() - interval '7
days');

I tried: 'conditions'=array('Bar.created' = = (NOW() - interval '7
days')) to no avail.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake best practice method

2009-02-26 Thread Elmo

I have an action such that I can retrieve all comments for a single
user using pagination helper.

Should I have the action in the users controller

Users::viewComments($userId, $fromDate, $toDate)

Or in the comments controller

Comments::viewUser($userId, $fromDate, $toDate)

Btw: User hasMany Comments

-Elmo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Security.level with Blackberry over SSL

2009-01-15 Thread Elmo

So I finally figured out why the sessions keep mysteriously dropping
on my blackberry. The symptoms are simple. Login to the cake app, and
you get to the first logged in page. Then when you click on anything
else to take you deeper into the site, you get redirected back to the
login page.

The problem was that this was only really happening in the test
staging site and not on my development site. So I 'diff -r' the
directories, and the only differences I could find were in the
core.php files. In the development site, I have debug set to level 2,
and I have the security level to low. In the production training site
I have security level set to high. Lo-and-behold, changing the
security level to low would allow for the blackberry to continue on
its merry way. I then ratcheted the staging site up to medium, and the
blackberry continued to work.

So the only thing I could think of is that the blackberry couldn't
handle swapping of session ID's between requests. According to the
cakephp cookbook, section 3.4.3.2 High and medium enable
session.referer_check, while in high the CakePHP session IDs are
regenerated between requests. The blackberry typically goes through a
proxy server, so that might be it.

-e


On Jan 14, 10:25 pm, Elmo emre...@gmail.com wrote:
 I am having a problem. While developing I keep my Security.level to
 low while also using SSL. When I am ready to stage my site for
 testing, I have the production setting which is Security.level on high
 and SSL. The entire site is locked down (you need to login to access
 the site).
 My problem is that while using aBlackberryto visit the pre-
 production site, session information is not stored past the Login
 click. The next click afterwards goes back to the login page.

 - If I go to a non-SSL version of the pre-production site with myblackberry, 
 everything works.
 - If I go to a Security.level low SSL version of the pre-production
 site with myblackberry, everything works.
 - If I go to a Security.level medium (SSL or non-SSL) version of the
 pre-production site with myblackberryeverything works.

 I want to keep it on Security.level high. Why can't I do so with 
 theblackberry?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Security.level with Blackberry over SSL

2009-01-14 Thread Elmo

I am having a problem. While developing I keep my Security.level to
low while also using SSL. When I am ready to stage my site for
testing, I have the production setting which is Security.level on high
and SSL. The entire site is locked down (you need to login to access
the site).
My problem is that while using a Blackberry to visit the pre-
production site, session information is not stored past the Login
click. The next click afterwards goes back to the login page.

- If I go to a non-SSL version of the pre-production site with my
blackberry, everything works.
- If I go to a Security.level low SSL version of the pre-production
site with my blackberry, everything works.
- If I go to a Security.level medium (SSL or non-SSL) version of the
pre-production site with my blackberry everything works.

I want to keep it on Security.level high. Why can't I do so with the
blackberry?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: hasAndBelongsToMany - Pagination

2008-08-27 Thread Elmo

make sure you're not using version 1.2 stable. There were lots of
issues with HABTM relationships with that version. The version I found
works okay is the current RC, 1.2.0.7296 RC2

On Aug 27, 5:05 pm, lordojazz [EMAIL PROTECTED] wrote:
 I'm having problems in filtering results from the controller on
 hasAndBelongsToMany. Is there any other way to do this? can you please
 help me... I'm passing arguments on my controller, the argument then
 must be use to filter the results from hasAndBelongsToMany
 relationship.

 Thanks...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $ajax-form('/cntr/action'...) problem RC2

2008-07-25 Thread Elmo

From the test case(s) for the $ajax-form() helper, the book was wrong
(or at least according to the latest RC2). The correct syntax is:
?php
// WRONG: $ajax-form('/notes/addquick', 'post',
array('update'='notes'));
// RIGHT: (Note: I still don't know what the 'showForm' is for)
echo $ajax-form('showForm', 'post',
array('model' = 'Note',
'url' = array('action'= 'addquick',
'controller' = 'notes'),
'update' = 'notes_div'));
?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



generating api docs from nightlys

2008-05-17 Thread Elmo

Where is the doxygen config file so that I can regenerate the API docs
locally from a Nightly build? Or if I don't need a config file, how
would I run doxygen on the sources?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Open Flash Charts in Cake

2008-05-07 Thread Elmo

Also check out this blog entry about App::import():

http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/

On Apr 21, 2:23 pm, ScottieBoy4 [EMAIL PROTECTED] wrote:
 I've found a really slick library for generating flash charts and
 graphs w/a PHP wrapper.  I can get it to work outside of cake, but not
 inside.  Has any one used the Open Flash Charts code in Cake?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using pagination helper on a view element

2008-04-23 Thread Elmo

Can I add to this and say ditto?

On Apr 7, 10:19 pm, Juan Luis Baptiste [EMAIL PROTECTED]
wrote:
 Hi,

 I'm trying to make a view element and reuse it in various  views. The
 element uses the pagination helper, the problem is that the element
 can't see the paginator helper object:

 : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7]

 If I add the helper to the uses variable of the controller which
 calls the action that includes the element on its view, then the
 helper is found but I get these errors:

 Warning (2): array_merge() [function.array-merge]: Argument #1 is not
 an array [CORE/cake/libs/view/helpers/paginator.php, line 139]

 The code of my element is something like the the following:

 $servers = $this-requestAction('servers/index/');
 ?
 table cellpadding=0 cellspacing=0
 tr
 th?= $paginator-sort('Server Name', 'name');?/th
 th?= $paginator-sort('IP Address', 'ip_address');?/th
 /tr
 ?php foreach ($servers as $server): ?
 tr
 td?= $server['Server']['name']; ?/td
 td?= $server['Server']['ip_address']; ?/td
 /tr
 ?php endforeach; ?
 /table
 ?php $paginate= $paginator-prev(' Previous ', null, null);?
 ?php $paginate.= $paginator-next(' Next ', null, null);?
 ?php $paginate.=  'br/'.$paginator-counter(); ?
 ?=$html-div(null,$paginate, array('align' = 'center')); ?

 on the view that includes it:

 echo $this-renderElement('servers');

 and the controller action:

 function index($id = null) {
   $servers = $this-paginate('Server');
   $this-set(compact('servers'));
   if(isset($this-params['requested'])) {
  return $servers;
   }

 }

 So how is the propper way to use the pagination helper on a view element ?

 Thanks.
 --
 Juan Luis Baptiste
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: UTF8 monthname in date-picker

2008-04-02 Thread Elmo

Is this fixed? I am running into the same issue from the
1.2.x.x_27.03.2008 I don't want to have to upgrade if I don't have to
(and introduce other bugs).

-E

On Mar 27, 10:38 am, Molt [EMAIL PROTECTED] wrote:

 Anyway, now i tried the nightly of 2008-03-25 and it does not like
 this way :(
 Instead of the german März (for march) i get simply nothing, an empty
 string.

 Does anybody know, whats up with this? I know this is a nightly, but
 i'd like to know if i made some mistake or i just have to wait for
 some codechanges :)

 thanks a lot in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



link() and __() problem

2008-04-01 Thread Elmo

So I have this piece of code:
h1?=$html-link( __('Create an Incident.'), '/incidents/add' );?/
h1

And it seems like the link isn't created correctly. The only thing
that shows up is:
Create an Incident.a href='/incidents/add'/a

(or in whatever language I select. If I do this:
h1?=$html-link( __('Create an Incident.').'[*]', '/incidents/
add' );?/h1

The only thing that is clickable is the '[*]'

Is this a bug or is there something I am missing? CakePHP is from:
1.2.x.x_27.03.2008.tar.bz2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: link() and __() problem

2008-04-01 Thread Elmo

Disregard, I forgot to add 'true' to the __() statement so that it
RETURNS the value instead of outputting it. It should read: h1?=
$html-link( __('Create an Incident.', true), '/incidents/add' );?/
h1

I guess it's getting way late, and I should go to bed.

On Apr 2, 1:25 am, Elmo [EMAIL PROTECTED] wrote:

 h1?=$html-link( __('Create an Incident.'), '/incidents/add' );?/
 h1

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: link() and __() problem

2008-04-01 Thread Elmo

Thanks! It's late here and I should go to bed! :)

On Apr 2, 1:40 am, Dr. Tarique Sani [EMAIL PROTECTED] wrote:

 Try ?=$html-link( __('Create an Incident.',true), '/incidents/add' );?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---