Re: Form width fieldset and different button types

2015-05-19 Thread Rob M
In CakePHP 2.x, FormHelper::inputs doesn't make buttons. It makes input 
elements. If you want a button, try using FormHelper::submit for a submit 
button, or in this case FormHelper::button as in:

echo $this->Form->button('Cancel upload', 
array('type' => 'reset',
  'class' => 'btn btn-warning cancel')
);

 
HTH!

On Monday, May 18, 2015 at 1:48:35 PM UTC-4, Sam Clauw wrote:
>
> Hi there!
>
> I'm trying to use the jquery file uploader 
>  in combination with 
> CakePHP.
>
> The HTML form uses 3 different button types:
>
>- submit (Start upload)
>- reset (Start upload)
>- button (Start upload)
>
> With CakePHP, I try to create those buttons via $this->Form->inputs, but I 
> don't find out how I should sum up those different type of inputs.
>
> I tried the following, but it ends up that those buttons are becoming 
> input fields instead:
>
> echo $this->Form->create('OutletPhoto', array(
> 'type' => 'file',
> 'novalidate' => true, // browser validatie
> 'inputDefaults' => array(
> 'label' => true,
> 'div' => 'form-group',
> 'class' => 'form-control'
> ),
> 'role' => 'form'
> ));
>
> echo $this->Form->inputs(array(
> 'legend' => false,
> 'name' => array(
> 'type' => 'file',
> 'multiple',
> 'label' => false,
> 'id' => 'file_upload',
> 'name' => 'file_upload',
> 'class' => false,
> 'before' => 'Pick photos',
> 'after' => ''
> ),
> 'Start upload' => array(
> 'type' => 'submit',
> 'label' => false,
> 'class' => 'btn btn-primary start'
> ),
> 'Cancel upload' => array(
> 'type' => 'reset',
> 'label' => false,
> 'class' => 'btn btn-warning cancel'
> ),
> 'Delete' => array(
> 'type' => 'button',
> 'label' => false,
> 'class' => 'btn btn-danger delete'
> )
> ));
>
> echo $this->Form->end('Save');
>
> Here's the HTML output of this code:
>
> **
> * class="btn btn-warning cancel" type="reset" id="OutletPhotoAnnuleerUpload">*
> 
>  type="submit">Delete
>
> Anyone who can tell me why my Start upload and Cancel upload don't show up 
> as a button? Thanks in advance! ;)
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: prevent uploaded file duplicate or double click in cake php?

2014-06-04 Thread Rob M
First you need to identify what makes a file unique. Is it the contents of 
a row? a set of rows? a row ID? Second, you need to write code to query 
your existing database to see if your uploaded file has already been added 
(run a SELECT to see if the rows you are about to add have already been 
added).

Adding rows to a database from an uploaded CSV file is not a typical 
CakePHP project. It can be done. Actually it's on my someday/maybe ToDo 
list.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Site down after restart

2014-06-04 Thread Rob M
If this happens, start checking logs. CakePHP logs errors to /tmp/, and 
your server access and error logs should also be reviewed. CakePHP depends 
on an operating system, a web server, and a database server. Each of these 
need to be up and running for Cake to do its thing.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 2 tables wont display

2014-05-24 Thread Rob M
It looks like your `posts` table doesn't have a `user_id` column. CakePHP 
convention wants it to have one so Cake can make the association "Posts 
belongs to Users".

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 2 tables wont display

2014-05-24 Thread Rob M
It looks like your `posts` table doesn't have a `user_id` column. CakePHP 
convention wants it to have one so Cake can make the association "Posts 
belongs to Users".

On Friday, May 23, 2014 12:56:48 AM UTC-4, Andrew Townsley wrote:
>
> I am getting an error on a simple display of 2 tables as i am just 
> learning it.
> I know sql but cakephp is awkward with sql/
>
> Anyway I have
>
> *Error: * SQLSTATE[42S22]: Column not found: 1054 Unknown column 
> 'Post.user_id' in 'on clause'
>
> *SQL Query: * SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, 
> `Post`.`created`, `Post`.`modified`, `User`.`two`, `User`.`three`, 
> `User`.`id` FROM `jagguy`.`posts` AS `Post` LEFT JOIN `jagguy`.`users` AS 
> `User` ON (`Post`.`user_id` = `User`.`id`) WHERE 1 = 1 
>
> models ( I have 2 tables with 1 files with id in common
>
> class Post extends AppModel
> {
> /*var $name='User';*/
> public $belongsTo = array('User');
> }
>
> class User extends AppModel
> {
> public $hasMany = 'Post';
> }
>
>
> class PostsController extends AppController
> {
> 
> public  function home2()
> {
>
> $everything=  $this->Post->find('all', array('contain' => 
> array('User')));
> } 
>
>
> view
>
> 
>
>   echo ''. $item['Post']['id']. '';
> echo ''. $item['Post']['title'].'';
>echo ''. $item['Post']['body'].'';
>
>
>
>
>  
> *P: (03) 9866 7737*
> *E: in...@itfutures.edu.au *
> *A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004 
> *
>
>
> *Connect with us: *
>
>  
> 
>     
>   
>
> Please consider the environment before printing this email.
>
>  
>
> This e-mail and any attachments to it (the "Communication") is, unless 
> otherwise stated, confidential,  may contain copyright material and is for 
> the use only of the intended recipient. If you receive the Communication in 
> error, please notify the sender immediately by return e-mail, delete the 
> Communication and the return e-mail, and do not read, copy, retransmit or 
> otherwise deal with it. Any views expressed in the Communication are those 
> of the individual sender only, unless expressly stated to be those of 
> National Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any 
> of its related entities. NTSP does not accept liability in connection with 
> the integrity of or errors in the Communication, computer virus, data 
> corruption, interference or delay arising from or in respect of the 
> Communication.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakeDC's Users plugin action overriding

2014-05-02 Thread Rob M
I think the result you seek is the default functionality? Suggestions:
1. First set it up exactly as directed in the box without overriding, and 
get it working. This makes you certain of correct installation, schema 
set-up, etc.
2. Next extend the controller as you have, with the following extra steps
3. Copy the view files from app\Plugin\Users\View\Users to 
\app\View\AppUsers
4. Add this line to your empty AppUsersController::add() method: return 
parent::add();

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakeDC's Users plugin action overriding

2014-05-02 Thread Rob M
I think the result you seek is the default functionality? Suggestions:
1. First set it up exactly as directed in the box without overriding, and 
get it working. This makes you certain of correct installation, schema 
set-up, etc.
2. Next extend the controller as you have, with the following extra steps
3. Copy the view files from app\Plugin\Users\View\Users to 
\app\View\AppUsers
4. Add this line to your empty AppUsersController::model() method: return 
parent::add();

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakeDC's Users plugin action overriding

2014-05-02 Thread Rob M
I think that the result you are expecting is simply to have the default 
plugin functionality?
Suggestions:
1. First install and get it working out-of-the-box without any overriding.
2. After that, come back to what you've started (override UsersController 
as directed in the documentation) and also do this:
3. Copy your view files from \app\Plugin\Users\View\Users to 
\app\View\AppUsers
4. In you AppUsersController::add() method (which is empty) add the line 
return parent::add();

On Thursday, May 1, 2014 3:40:42 PM UTC-4, giolef...@gmail.com wrote:
>
> I have installed CakeDC's Users plugin and I have loaded all the required 
> files in bootstrap.php, as shown below:
>
> CakePlugin::load('Users'); // Loads the Users 
> pluginCakePlugin::load('Search'); // Loads the Search 
> pluginCakePlugin::load('Utils'); // Loads the Utils 
> pluginCakePlugin::load('Users', array('routes' => true));
>
> I would like to override the add() action of the UsersController of the 
> plugin, so I created the AppUsersController.php file in app/Controller, as 
> instructed here:https://github.com/CakeDC/users#extending-the-controller
>
> Then I created an add() action inside the AppUsersController.php, with an 
> empty body, but the original action was not overridden. What am I doing 
> wrong?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Access to specific data cakephp 2.x

2012-12-25 Thread Rob M
Hi Paulo:
To answer your first question: give everyone access to every post by 
*not*checking to see who owns it in the Controller::index() and 
Controller::view() methods. Give only the post's writer the ability to 
edit/delete the post by checking first to see who owns it in the 
Controller::edit() and Controller::delete() methods. With the 
aforementioned WhoDidIt behavior we're talking about only one additional 
line of controller code plus one additional condition:
$user = $this->Session->Read('Auth.User.id');

...so in the Controller::delete() function (for example):
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Post'));
$this->redirect(array('action'=>'index'));
}
*$*user* = $this->Session->Read('Auth.User.id'); *// Only allow deletes 
from user's own records
if (*$this->Post->field('created_by', array('id' => $id)) == $user* && 
$this->Post->delete($id)) {
$this->Session->setFlash(__('Post deleted'));
}
$this->Session->setFlash(__('Post was not deleted'));
}

To answer your second question: same idea. Check that the manager logged in 
has access to the controller function on that hotel *in the appropriate 
controller function*.
-Rob

On Monday, December 24, 2012 6:12:02 PM UTC-5, Paulo Braga wrote:
>
> Hi Rob. Thanks for your answer, the behavior is very interesting. 
>
> I think I did not express myself well, I dont want just to set that a user 
> has only access to the posts he created.
>
> I want also to configure for example:
>
> We have hotels around a country from the same organization, so in each 
> city there's a manager, and I want a manager to manage just the hotels in 
> his city. but this hotels can be created by another user(admin), is it 
> possible?   I did it with isAuthorized() method, but it requires a lot of 
> "code (ugly code)° :p 
>
> Paulo
>
> On Monday, December 24, 2012 3:08:31 PM UTC+2, Rob M wrote:
>>
>> Hi Paulo: You are describing row-level access control, and I am doing 
>> that with CakePHP 2.0 using a modified version of Daniel 
>> Vecchiato's WhoDidIt Model Behavior (
>> https://github.com/danfreak/4cakephp/tree/master/models/behaviors). Then 
>> I check in the controller to see if the id in the table for the person who 
>> created the record matches the id of the person who is trying to modify it. 
>> - Rob
>>
>> On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>>>
>>> Hi people.
>>>
>>> I am using cakephp 2.x, and I am trying to build a system with group 
>>> permissions, ok, I used Acl and Auth component without problem.
>>>
>>> Now I want to configure access to specific data. for example: 
>>>
>>> we have a blog app, and we have users, posts, etc.
>>> an admin can do anything(no problems);
>>> a post is posted by a user. (some problems here);
>>>
>>> With acl I configured that admin group can do anything. and that user 
>>> group can just do anything in posts(add, list, edit, delete). everything is 
>>> working.
>>>
>>> But I dont want a user to edit,delete,list posts that were not created 
>>> by him. 
>>>
>>> I used to do it with the method isAuthorized(), but imagining a big app, 
>>> I think it will be too hard to codify it.
>>>
>>> is there a "clean" way to do it???
>>>
>>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Access to specific data cakephp 2.x

2012-12-24 Thread Rob M
Hi Paulo: You are describing row-level access control, and I am doing that 
with CakePHP 2.0 using a modified version of Daniel Vecchiato's WhoDidIt 
Model Behavior 
(https://github.com/danfreak/4cakephp/tree/master/models/behaviors). Then I 
check in the controller to see if the id in the table for the person who 
created the record matches the id of the person who is trying to modify it. 
- Rob

On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>
> Hi people.
>
> I am using cakephp 2.x, and I am trying to build a system with group 
> permissions, ok, I used Acl and Auth component without problem.
>
> Now I want to configure access to specific data. for example: 
>
> we have a blog app, and we have users, posts, etc.
> an admin can do anything(no problems);
> a post is posted by a user. (some problems here);
>
> With acl I configured that admin group can do anything. and that user 
> group can just do anything in posts(add, list, edit, delete). everything is 
> working.
>
> But I dont want a user to edit,delete,list posts that were not created by 
> him. 
>
> I used to do it with the method isAuthorized(), but imagining a big app, I 
> think it will be too hard to codify it.
>
> is there a "clean" way to do it???
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.2 and Autocomplete Jquery

2012-11-21 Thread Rob M
This code snippet needs refactoring in order to use JsHelper, but it works:

controller code (Controllers/PeopleController.php):
function autoComplete() {
$this->autoRender = false;
$search_string = trim($this->request->query['term']);
if (!is_null($search_string) && $search_string != '') {
$people = $this->Person->find('all',
array(
'conditions' => array (
'OR' => array (
'Person.first_name LIKE'   => '%' . $search_string . '%',
'Person.last_name LIKE'=> '%' . $search_string . '%',
'Person.family_info LIKE'  => '%' . $search_string . '%',
'Person.comments LIKE' => '%' . $search_string . '%',
'Person.home_street LIKE'  => '%' . $search_string . '%',
'Person.work_street_1 LIKE'=> '%' . $search_string . '%',
'Person.work_street_2 LIKE'=> '%' . $search_string . '%'
)
),
'fields' => array(
'Person.first_name', 'Person.last_name',
'Person.active', 'Person.requested_do_not_call',
'Person.home_street', 'Person.home_city',
'Person.home_state', 'Person.home_zip',
'Person.work_street_1', 'Person.work_street_2',
'Person.work_city', 'Person.work_state', 'Person.work_zip',
'Person.id', 'Person.home_phone', 'Person.mobile_phone',
'Person.tty', 'Person.video_phone', 'Person.email'
),
'order' => array(
'Person.active DESC',
'Person.last_name ASC',
'Person.first_name ASC'
),
'recursive' => 0
)
);
$i=0;
foreach($people as $person){
$response[$i]['id'] = $person['Person']['id'];
$response[$i]['label'] = $person['Person']['last_name'] . ', ' . 
$person['Person']['first_name'];
$response[$i]['value'] = $person['Person']['last_name'] . ', ' . 
$person['Person']['first_name'];
$i++;
}
echo json_encode($response);
}
}


view code (Views/People/search.ctp):
Html->script('https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js',
 
array('inline' => false));
echo 
$this->Html->script('https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.js',
 
array('inline' => false));
echo $this->Html->script('autocomplete/jquery.ui.autocomplete.html.js', 
array('inline' => false));
ob_start();
?>
$(document).ready(function(){
$("#PersonQ").autocomplete({
source: "../people/autoComplete.json",
minLength: 2
});
$("input:submit").button();
$("#PersonQ").autocomplete({
select: function(event, ui) {
selected_id = ui.item.id;
$('#PersonSearchForm').append('');
$('#PersonSearchForm').submit();
}
});
$("#PersonQ").autocomplete({
open: function(event, ui) {
$('#PersonId').remove();
}
});
});
Html->scriptBlock($jscript, array('inline' => false));
?>

On Tuesday, November 20, 2012 5:34:56 AM UTC-5, franscelstain wrote:
>
> if anyone can give an example?
>
> Pada Senin, 12 November 2012 11:01:40 UTC+7, franscelstain menulis:
>>
>> Is there someone who can help me make jquery autocomplete using CakePHP 
>> 2.2
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Bad Request "URL not found" - after an JQuery change event

2012-11-18 Thread Rob M
A. To debug, I'd insert the line:
console.log(load + _this.find('option:selected').val());
just above your $.ajax() call. Then watch your Javascript console when 
running the page to see what URL is being submitted and try submitting it 
manually.
- Rob

On Friday, November 16, 2012 1:53:13 AM UTC-5, Benjamin Such wrote:
>
> Hey guys, I am really stuck with that problem. I have a JQuery Dialog 
> which contains a selectbox. When I change the option inside this selectbox, 
> another selectbox shows up with options generated from an .ajax() event. 
> Anyway... everything works fine, but when I submit the form CakePHP says: 
> 404 Bad Request - URL was not found, but it DOES EXISTS 100%. I tested it 
> several times to be sure, but another thing is: When submit the form 
> WITHOUT selecting any option from the first selectbox the form is submitted 
> correctly. I dont know what to post really but here is my Javascript:
>
> $('select[data-onchange=true]').live("change", function() {
>> 
>> var _this = $(this);
>> var element = $('select[data-onchange-trigger=' + 
>> _this.attr("id") + ']:first');
>> 
>> if (typeof element == "object") {
>> if (_this.attr("data-onchange-load")) {
>> var options = element.prop("options");
>> var load = _this.attr("data-onchange-load");
>> $.ajax({
>> dataType: "json",
>> url: load + _this.find('option:selected').val(),
>> beforeSend: function() {
>> $('.ajax-loader').show();
>> element.find('option').remove();
>> element.parent().hide();
>> },
>> success: function(data) {
>> $.each(data, function(index, _data) {
>> if (typeof _data == "object") {
>> $.each(_data, function(index, _data) {
>> options[options.length] = new Option(_
>> data.name, _data.id);
>> });
>> }
>> });
>> element.parent().show();
>> },
>> complete: function() {
>> $('.ajax-loader').hide();
>> }
>> });
>> }
>> }
>> });
>>
>
> The error occurs only when I submit the form after I change the option on 
> the selectbox.
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: 1.3->2.1 migration: aco problem

2012-06-14 Thread Rob M
After hours of trying to sniff out the problem, it came down to a model I'd 
foolishly created in App/Models (Model/Aco.php). Once deleted, this worked. 
My thanks to caggia 
<https://groups.google.com/forum/?fromgroups#!searchin/cake-php/caggia/cake-php/j0wgXoj4Ma0/iFA92tzUdiUJ>for
 
helping me find my error. - RM

On Sunday, May 27, 2012 8:13:31 AM UTC-4, Rob M wrote:
>
> Attempting to migrate my app from 1.3 to 2.1; using xampp. I'm running 
> into an error in the console when I use AclExtras to recover aco ('recover 
> aro' produces no error). The same error is encountered when attempting 
> 'aco_sync'. Would you perhaps recognize the stack trace and suggest where 
> to look for solutions? Text follows:
>
> C:\xampp\htdocs\testpeople\people>*cake AclExtras.AclExtras recover aro*
>
>
> Welcome to CakePHP v2.1.3 Console
> ---
> App : people
> Path: C:\xampp\htdocs\testpeople\people\
> ---
> Tree has been recovered, or tree did not need recovery.
>
> C:\xampp\htdocs\testpeople\people>*cake AclExtras.AclExtras recover aco*
>
>
> Welcome to CakePHP v2.1.3 Console
> ---
> App : people
> Path: C:\xampp\htdocs\testpeople\people\
> ---
> Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an 
> error in your SQL syntax; check the manual that corresponds to your MySQL 
> server version for the right syntax to use near 'recover' at line 1
> #0 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(437): 
> PDOStatement->execute(Array)
> #1 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(403): 
> DboSource->_execute('recover', Array)
> #2 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(647): 
> DboSource->execute('recover', Array, Array)
> #3 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(589): 
> DboSource->fetchAll('recover', Array, Array)
> #4 C:\xampp\htdocs\cakephp\lib\Cake\Model\Model.php(775): 
> DboSource->query('recover', Array, Object(Aco))
> #5 
> C:\xampp\htdocs\testpeople\people\Plugin\AclExtras\Console\Command\AclExtrasShell.php(300):
>  
> Model->__call('recover', Array)
> #6 
> C:\xampp\htdocs\testpeople\people\Plugin\AclExtras\Console\Command\AclExtrasShell.php(300):
>  
> Aco->recover()
> #7 C:\xampp\htdocs\cakephp\lib\Cake\Console\Shell.php(386): 
> AclExtrasShell->recover()
> #8 C:\xampp\htdocs\cakephp\lib\Cake\Console\ShellDispatcher.php(177): 
> Shell->runCommand('recover', Array)
> #9 C:\xampp\htdocs\cakephp\lib\Cake\Console\ShellDispatcher.php(69): 
> ShellDispatcher->dispatch()
> #10 C:\xampp\htdocs\cakephp\lib\Cake\Console\cake.php(41): 
> ShellDispatcher::run(Array)
> #11 {main}
> 42000
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Saving a long list of hasMany Through associasions

2012-05-28 Thread Rob M
It sounds like a HABTM table is precisely what you need. Please elaborate 
on your requirement 'cannot do HABTM due to storing meta info'. - Rob

On Friday, May 25, 2012 9:09:59 PM UTC-4, Benjamin Allison wrote:
>
> I have two models: Users and Surveys. In my Users "index" view, each User 
> row has two select lists that are populated with the names of all the 
> available Surveys.
>
> The idea is to allow someone to assign two Surveys to each user, right 
> from the Index page. The associations take place via a hasMany Through 
> association: the intermediary model is called SurveyAssignments (I can't do 
> HABTM because I'm storing meta info).
>
> What I'm struggling with is that I can't figure out how to save all those 
> associations, from one page, or how to account for each user's specifica 
> association state: some users will have association records, some will not. 
> Some will need associations created, others changed or removed.
>
> I would like to avoid large complicated nests of if statements!
>
> How can I account for multiple records one on page, and handle all of 
> their unique association states without getting overly bloated or 
> complex? Any ideas?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


1.3->2.1 migration: aco problem

2012-05-27 Thread Rob M
Attempting to migrate my app from 1.3 to 2.1; using xampp. I'm running into 
an error in the console when I use AclExtras to recover aco ('recover aro' 
produces no error). The same error is encountered when attempting 
'aco_sync'. Would you perhaps recognize the stack trace and suggest where 
to look for solutions? Text follows:

C:\xampp\htdocs\testpeople\people>*cake AclExtras.AclExtras recover aro*


Welcome to CakePHP v2.1.3 Console
---
App : people
Path: C:\xampp\htdocs\testpeople\people\
---
Tree has been recovered, or tree did not need recovery.

C:\xampp\htdocs\testpeople\people>*cake AclExtras.AclExtras recover aco*


Welcome to CakePHP v2.1.3 Console
---
App : people
Path: C:\xampp\htdocs\testpeople\people\
---
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an 
error in your SQL syntax; check the manual that corresponds to your MySQL 
server version for the right syntax to use near 'recover' at line 1
#0 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(437): 
PDOStatement->execute(Array)
#1 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(403): 
DboSource->_execute('recover', Array)
#2 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(647): 
DboSource->execute('recover', Array, Array)
#3 C:\xampp\htdocs\cakephp\lib\Cake\Model\Datasource\DboSource.php(589): 
DboSource->fetchAll('recover', Array, Array)
#4 C:\xampp\htdocs\cakephp\lib\Cake\Model\Model.php(775): 
DboSource->query('recover', Array, Object(Aco))
#5 
C:\xampp\htdocs\testpeople\people\Plugin\AclExtras\Console\Command\AclExtrasShell.php(300):
 
Model->__call('recover', Array)
#6 
C:\xampp\htdocs\testpeople\people\Plugin\AclExtras\Console\Command\AclExtrasShell.php(300):
 
Aco->recover()
#7 C:\xampp\htdocs\cakephp\lib\Cake\Console\Shell.php(386): 
AclExtrasShell->recover()
#8 C:\xampp\htdocs\cakephp\lib\Cake\Console\ShellDispatcher.php(177): 
Shell->runCommand('recover', Array)
#9 C:\xampp\htdocs\cakephp\lib\Cake\Console\ShellDispatcher.php(69): 
ShellDispatcher->dispatch()
#10 C:\xampp\htdocs\cakephp\lib\Cake\Console\cake.php(41): 
ShellDispatcher::run(Array)
#11 {main}
42000

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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