Re: Redirect After Using render('action')

2009-09-25 Thread Tony Thomas
the form to disappear, use JS to submit the form using AJAX and hide/change certain elements of the page. On Thu, Sep 24, 2009 at 3:17 PM, Tony Thomas truet...@gmail.com wrote: I have a controller function that's using $this-render('action') to render a view that creates a CSV file after

Redirect After Using render('action')

2009-09-24 Thread Tony Thomas
I have a controller function that's using $this-render('action') to render a view that creates a CSV file after submitting some info in a form. What I want to do is redirect the user after the CSV file is downloaded. So the steps would be: 1. User submits data. 2. Queries are run and a CSV file

Re: Ajax Errors

2009-08-11 Thread Tony Thomas
please see : http://book.cakephp.org/view/410/Validating-Data-from-the-Controller On Aug 10, 3:42 pm, Tony Thomas truet...@gmail.com wrote: This is something that's so simple, I'm embarrassed to ask. But after a few dozen Google searches, I'm going to swallow my pride and post my question

Ajax Errors

2009-08-10 Thread Tony Thomas
This is something that's so simple, I'm embarrassed to ask. But after a few dozen Google searches, I'm going to swallow my pride and post my question here. I have a simple ajax function in my controller and I want it to return an error is the request is not successful. For example: function

Re: Create Dynamic Navigation Based On Tree Behavior

2009-07-29 Thread Tony Thomas
Thanks for this tip. It was exactly what I needed! On Jul 26, 7:51 pm, brian bally.z...@gmail.com wrote: I used this: http://bakery.cakephp.org/articles/view/tree-helper-1 My nav is an element with: div id=nav ?php echo $tree-generate(         $section_nodes,         array(          

Create Dynamic Navigation Based On Tree Behavior

2009-07-26 Thread Tony Thomas
I have a Pages table in my app with the following fields: id parent_id lft rght title body created modified My model uses $actsAs = array('Tree') All the data associations are correct and generatetreelist() returns the appropriate values. What I'm looking for is a way to turn the tree

Building a helper; Fatal error cake/libs/view/view.php on line 702

2009-03-24 Thread Tony Thomas
I want to build some options for use across several views, so a custom HTML helper seems like the best option. However, I'm running into problems. Here's the helper: class PositionHelper extends AppHelper { var $helpers = array('Html'); function getPositions() { $yaxes =

Re: Mod_rewrite not working

2009-03-21 Thread Tony Thomas
mod_rewrite is enabled. Like I mentioned, I can run another CakePHP app already using mod_rewrite with my current setup. It's only this brand new one that's behaving bizarrely. On Mar 20, 5:22 pm, Miles J mileswjohn...@gmail.com wrote: Id first check your apache config files anyways, to make

Re: Mod_rewrite not working

2009-03-21 Thread Tony Thomas
I still don't know exactly what the problem was, but I downloaded a new copy of cake and moved my models and controllers over and it worked right away. Something must have happened when copying the files over originally. On Mar 21, 11:10 am, Tony Thomas truet...@gmail.com wrote: mod_rewrite

Mod_rewrite not working

2009-03-20 Thread Tony Thomas
I'm starting up a fresh project in Cake, so I downloaded the latest version, built my models and controllers using $scaffold, but the app is acting like mod_rewrite is not working. The .htaccess files are all there. I'm running a local setup using MAMP on OS X. The odd thing is that I have

Retrieve Associated Count

2009-03-17 Thread Tony Thomas
I have a simple hasMany relationship set up with CakePHP and I want to retrieve a couple of fields from the parent table based on the count of the child. The scenario: I have boxes that hold 81 aliquots each. (Each box is 9X9.) I want to retrieve the id and description from the boxes table of

Re: Redirect Loop

2009-03-14 Thread Tony Thomas
:07 pm, Tony Thomas truet...@gmail.com wrote: I've been working on a local copy of my CakePHP app that runs on a my computer. Today I've only been working on a layout and the style sheet. I took a break and went back to it which prompted a new login. Suddenly I'm getting aredirectloop. Firefox

Best Way to Nest Lists w/ nestedList()

2009-03-11 Thread Tony Thomas
I'm trying to create navigation in CakePHP that uses this method with CSS drop-downs: http://www.webmonkey.com/tutorial/Add_CSS_Drop-Down_Menus So, of course I want to leverage nestedList(), but since I have two levels of nested lists, I'm getting unexpected results. Here's what I want: Main

Redirect Loop

2009-03-11 Thread Tony Thomas
I've been working on a local copy of my CakePHP app that runs on a my computer. Today I've only been working on a layout and the style sheet. I took a break and went back to it which prompted a new login. Suddenly I'm getting a redirect loop. Firefox gives me this following message: Redirect

Re: Undefined variable: javascript when Javascript is absolutely loaded

2009-02-27 Thread Tony Thomas
This problem just cropped up out of the blue for me. I made no changes to the AppController where the helpers are defined. I can't figure it out. The JavaScript file in question is clearly in the HTML, but everything is broken. I had made a simple change to a different controller that seemed to

Re: Undefined variable: javascript when Javascript is absolutely loaded

2009-02-27 Thread Tony Thomas
I forgot to add that if I remove 'echo $javascript-link('js.js');' nothing is rendered at all. Even if I hand code the link to the JavaScript. It's truly bizarre and has broken my entire application. On Friday afternoon no less. :-( On Feb 27, 1:42 pm, Tony Thomas truet...@gmail.com wrote

Re: Undefined variable: javascript when Javascript is absolutely loaded

2009-02-27 Thread Tony Thomas
with the server. On Feb 27, 1:51 pm, brian bally.z...@gmail.com wrote: On Fri, Feb 27, 2009 at 2:42 PM, Tony Thomas truet...@gmail.com wrote: This problem just cropped up out of the blue for me. I made no changes to the AppController where the helpers are defined. I can't figure it out

Odd Behavior with allow()

2009-02-13 Thread Tony Thomas
I moved my CakePHP app to a new server and everything is working fine except the one area where I have to allow public access. The controller I want to allow is 'report', so in the pertinent controller, I have this: function beforeFilter() { $this-Auth-allow('report'); }

Re: Odd Behavior with allow()

2009-02-13 Thread Tony Thomas
using for this? And, are you certain that the both servers have an identical routes.php? On Fri, Feb 13, 2009 at 1:07 PM, Tony Thomas truet...@gmail.com wrote: I moved my CakePHP app to a new server and everything is working fine except the one area where I have to allow public access

Migrating to Media Temple DV Server - Path problem

2009-01-22 Thread Tony Thomas
I'm moving my CakePHP app onto to a Media Temple Dedicated Virtual server and my paths are all wrong. There seem to be two issues, one more severe than the other: First, the paths to webroot don't work, so the head of my document links my stylesheet like so: link rel=stylesheet type=text/css

Re: Migrating to Media Temple DV Server - Path problem

2009-01-22 Thread Tony Thomas
Aha! After further investigation, the .htaccess from cake's root was missing. Once I created that, all was fixed. On Jan 22, 10:20 am, Tony Thomas truet...@gmail.com wrote: I'm moving my CakePHP app onto to a Media Temple Dedicated Virtual server and my paths are all wrong. There seem

Re: Label information for Multiple Checkboxes

2009-01-20 Thread Tony Thomas
figured out how. I could loop through and define each checkbox separately, but making a multiple selection is difficult in that scenario unless I abandon the form helpers altogether and just hand code the form. On Thu, Jan 15, 2009 at 5:02 PM, Tony Thomas truet...@gmail.com wrote: I follow you up

Re: Label information for Multiple Checkboxes

2009-01-20 Thread Tony Thomas
#0     '{n}.Specimen.type', // Field #1     '{n}.Specimen.draw_date' // Field #2   ),   '{n}.Specimen.type' )); // view echo $form-input('Aliquot', array('options' = 'aliquots', 'multiple' = 'checkbox')); hth grigri On Jan 20, 2:32 pm, Tony Thomas truet...@gmail.com wrote: On Jan 16

Label information for Multiple Checkboxes

2009-01-15 Thread Tony Thomas
I'm building a list of checkboxes like so: echo $form-input('Aliquot.id', array( 'label' = FALSE, 'type' = 'select', 'multiple' =

Re: Label information for Multiple Checkboxes

2009-01-15 Thread Tony Thomas
it, building each checkbox one at a time instead of my example below. Or am I missing something? On Jan 15, 11:01 am, grigri j...@hendersonwebdesign.com wrote: You need to set the $displayField property inside your `Aliquot` model to whatever field you want for the label. On Jan 15, 4:47 pm, Tony

Re: Label information for Multiple Checkboxes

2009-01-15 Thread Tony Thomas
- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Tony Thomas Sent: Thursday, January 15, 2009 4:52 PM To: CakePHP Subject: Re: Label information for Multiple Checkboxes The complicating factor here is that Aliquot belongs to Specimen in my model and I want

Re: Label information for Multiple Checkboxes

2009-01-15 Thread Tony Thomas
I tried that very thing, but it didn't produce the expected results. Maybe find('list', $options) isn't meant to accommodate more than a single field. I'm not sure. On Jan 15, 11:34 am, David Coleman david.cole...@connaxis.com wrote: You could also do something like this in your controller:  

Re: Label information for Multiple Checkboxes

2009-01-15 Thread Tony Thomas
I follow you up to this bit: ?php echo $form-input( 'Category', array( 'type'='select', 'multiple'='checkbox', 'options'=$ids, 'label'=false ) ); ? This doesn't seem to solve the problem of getting the

Where Does This Fall in the MVC Architecture?

2008-12-09 Thread Tony Thomas
I'm working on an application to store information on lab specimens. The lab receive specimens which are divided into aliquots which are then put into boxes and in turn stored in freezers. I want to create a function to find all unstored aliquots and display a message on every page to alert the

Re: using Google Visualization

2008-12-09 Thread Tony Thomas
http://www.google.com/jsapi; doesn't appear to be a valid URL for the library you're trying to use. On Dec 9, 7:30 am, Juan [EMAIL PROTECTED] wrote: I'm trying to use the Google Visualization API with my CakePHP app. The two first obstacles are: - how to link an external JS library? I try

Re: Where Does This Fall in the MVC Architecture?

2008-12-09 Thread Tony Thomas
Fantastic. That worked! On Dec 9, 9:30 am, Jon Bennett [EMAIL PROTECTED] wrote: I would:  * create a method in your model to fetch the data  * create a method in your controller to access this data  * create an element that calls via 'requestAction' the data from the controller  *

updateAll Syntax question

2008-12-05 Thread Tony Thomas
I have a scenario where I want to update multiple records simultaneously. In this case, I have a form with check boxes next to ids from the table I want to update. These are aliquots stored in a lab. updateAll seems like a natural solution, except I can't quite get my head around defining the

Manual Search Not Working?

2008-10-01 Thread Tony Thomas
Has something changed with the CakePHP Cookbook's search (book.cakephp.org)? Over the last few days every search turns up no results. I just tried a search for model and it returned no results. Anyone who works on that know anything? --~--~-~--~~~---~--~~ You

Re: Auth Redirect Problems

2008-09-30 Thread Tony Thomas
', 'action' = 'login');         $this-Auth-autoRedirect = FALSE; } Okto.Silaban.Net On Fri, Sep 26, 2008 at 10:00 PM, Tony Thomas [EMAIL PROTECTED] wrote: This gives me an unexpected T_VARIABLE error on the line with $this- Auth-autoRedirect = FALSE; I think the algorithm might be right

Re: Auth Redirect Problems

2008-09-26 Thread Tony Thomas
' = 'index');    $this-Auth-autoRedirect = FALSE; // so after logging in we're not auto redirected } then manually set function login() {     $this-redirect('somewhere');     exit(); } On Tue, Sep 9, 2008 at 10:12 PM, Tony Thomas [EMAIL PROTECTED] wrote: If someone is familiar with a post

Re: Best way to validate dates to prevent future dating

2008-09-25 Thread Tony Thomas
be the case It's really not difficult :-) And its a very powerful solution once you understand how it works. On Sep 16, 1:46 am, Tony Thomas [EMAIL PROTECTED] wrote: Thanks. I was afraid that might be the case. On Sep 15, 7:42 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: You can't

Re: Auth login redirect unreliable?

2008-09-09 Thread Tony Thomas
Plus, the problem I ran into with this solution is that the logout function goes into an infinite loop. I will note that I didn't have problems with redirect until I started using database sessions stopped using mod_rewrite because of restrictions on the shared server I'm using. On Jul 15,

Auth Redirect Problems

2008-09-09 Thread Tony Thomas
If someone is familiar with a post to this group or blog entry that addresses this issue, please let me know. I've spent the morning scouring both with no satisfactory results. I have a cakePHP app on a shared server. In local testing, everything worked fine. But mod_rewrite did not function

Re: Retrieving User Information with Auth/Acl

2008-07-03 Thread Tony Thomas
On Jul 3, 6:23 pm, francky06l [EMAIL PROTECTED] wrote: I do not understand the on the fly there .. Meaning I don't want to have to statically define who can do what. Instead of something like: if ($this-Auth-user('username') == 'User1') { // allow them to do stuff } else { // kick

Firefox 3 Cookies Auth

2008-06-30 Thread Tony Thomas
I spent a long time on this so I thought I'd share it with the community. I was wracking my brain trying to get Auth to work properly on a site I'm testing locally in Firefox 3. No matter what I did, the application locked me out with a message stating You are not authorized I read several

Re: Defining more than one hasMany relationship

2008-05-19 Thread Tony Thomas
); // prints 'array([0] = 1, [1] = 2 ...)' On 16 May 2008, at 22:26, Tony Thomas wrote: No. It's simply looping through and echoing the array, but once it does, the contents of the array are no longer available. As soon as I looped through using while(list($key, $value

Defining more than one hasMany relationship

2008-05-15 Thread Tony Thomas
Hi All, I'm building a CakePHP app for tracking clinic patients, their visits, their symptoms and questionnaire answers. The barrier I've encountered is that each patient has many visits AND many symptoms. I want to view the patient record and their aggregate visits and symptoms. I've defined a

Re: Defining more than one hasMany relationship

2008-05-15 Thread Tony Thomas
print_r($patient['M5Symptom']) results in the expected list of symptoms: Array ( [0] = Array ( [id] = 19 [patient_id] = 5007 [symptom] = Stuffy Nose [start_date] = 12/18/2006 [end_date] = 12/21/2006 [severity] =

Re: Defining more than one hasMany relationship

2008-05-15 Thread Tony Thomas
, Tony Thomas [EMAIL PROTECTED] wrote: Hi All, I'm building a CakePHP app for tracking clinic patients, their visits, their symptoms and questionnaire answers. The barrier I've encountered is that each patient has many visits AND many symptoms. I want to view the patient record

Re: Defining more than one hasMany relationship

2008-05-15 Thread Tony Thomas
the same Undefined index message. How can I preserve that array to reuse it to make a second table? On May 15, 12:35 pm, Tony Thomas [EMAIL PROTECTED] wrote: debug($patient) produces: Array ( [Patient] = Array ( [id] = 5007 [med_hist_id] = 0 [gender

Re: Defining more than one hasMany relationship

2008-05-15 Thread Tony Thomas
the foreach() operates on a copy of the array and list($key, $value) = each($array) doesn't. http://us2.php.net/foreach http://us2.php.net/manual/en/function.list.php (Links for reference to those who might come upon this in the future. Hello from the past.) On May 15, 2:26 pm, Tony Thomas [EMAIL