XML output

2015-06-30 Thread Juan Ezquerro LLanes
I'm using cake 2.x, how can i use _rootNode for custom xml output?

I would like to delete the  labels.

-- 
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.


Saving datetime

2013-07-27 Thread Juan Ezquerro LLanes
How can i save an array like:

array(
'OnOff' => array(
'module_id' => '23',
'date_start' => array(
'month' => '07',
'day' => '28',
'year' => '2013',
'hour' => '01',
'min' => '40',
'meridian' => 'am'
),
'date_end' => array(
'month' => '07',
'day' => '28',
'year' => '2013',
'hour' => '01',
'min' => '40',
'meridian' => 'am'
),
'minutes_on' => '100',
'minutes_off' => '100'
)
)

Validation is:

public $validate = array(
'date_start' => array(
'rule' => array('datetime', 'mdy'),
'required' => true,
'allowEmpty' => false,
'message' => 'Please enter a valid date and time.'
),
'date_end' => array(
'rule' => array('datetime', 'mdy'),
'required' => true,
'allowEmpty' => false,
'message' => 'Please enter a valid date and time.'
),
'minutes_on' => array(
'rule' => 'numeric',
'required' => true,
'allowEmpty' => false,
'message' => 'Numbers only'
),
'minutes_off' => array(
'rule' => 'numeric',
'required' => true,
'allowEmpty' => false,
'message' => 'Numbers only'
)
);

And always fail with 'Please enter a valid date and time.'

-- 
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/groups/opt_out.




HABTM update

2012-10-15 Thread Juan Ezquerro LLanes
if i have an Agent who have one associated Plugin and i want to add one 
Plugin more how can i do? if i do:

 $this->Agent->save(
array(
 'id' => $data['Agent']['id'],
 'Plugin' => array($data['Plugin']['id'])
)
)

Old plugin is deleted and new is added but i don't want to delete first 
Plugin, i want to add one Plugin more

-- 
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: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause

2012-10-03 Thread Juan Ezquerro LLanes
solved with  'counterCache' => TRUE

El jueves, 4 de octubre de 2012 01:39:51 UTC+2, Juan Ezquerro LLanes 
escribió:
>
> I read 
> http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html#using-containable
>
> Where say:
>
> "ContainableBehavior can sometimes cause issues with other behaviors or 
> queries that use aggregate functions and/or GROUP BY statements. If you get 
> invalid SQL errors due to mixing of aggregate and non-aggregate fields, try 
> disabling the autoFields setting.:
>
>  $this->Post->Behaviors->attach('Containable', array('autoFields' => 
> false));"
>
> But i do:
>
> $this->AllowedDomain->Behaviors->load('Containable', 
> array('autoFields' => false));
>
> $this->paginate = array(
> 'conditions' => array('AllowedDomain.client_id' => 
> $this->Session->read('Auth.User.Client.id')),
> 'fields' => array('id', 'domain'),
> 'contain' => array('SecureScan' => array('fields' => 
> 'COUNT(id) AS urls'))
> );
>
> And always crash, can help please?
>

-- 
Like Us on FacekBook 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.




Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause

2012-10-03 Thread Juan Ezquerro LLanes
I 
read 
http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html#using-containable

Where say:

"ContainableBehavior can sometimes cause issues with other behaviors or 
queries that use aggregate functions and/or GROUP BY statements. If you get 
invalid SQL errors due to mixing of aggregate and non-aggregate fields, try 
disabling the autoFields setting.:

Post->Behaviors->attach('Containable', array('autoFields' => 
false));"

But i do:

$this->AllowedDomain->Behaviors->load('Containable', 
array('autoFields' => false));

$this->paginate = array(
'conditions' => array('AllowedDomain.client_id' => 
$this->Session->read('Auth.User.Client.id')),
'fields' => array('id', 'domain'),
'contain' => array('SecureScan' => array('fields' => 'COUNT(id) 
AS urls'))
);

And always crash, can help please?

-- 
Like Us on FacekBook 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: Some core code to review

2012-08-21 Thread Juan Ezquerro LLanes
this happens in other parts of the code ... I'm misinterpreting something?

El martes, 21 de agosto de 2012 17:56:54 UTC+2, Juan Ezquerro LLanes 
escribió:
>
> Is that a bug? 'log' index is twice?
>
> File: CAKE/lib/Cake/Utility/Debugger.php line 55
>
> protected $_templates = array(
> 'log' => array(
> 'trace' => '{:reference} - {:path}, line {:line}',
> 'error' => "{:error} ({:code}): {:description} in [{:file}, line {:line}]"
> ),
> 'js' => array(
> 'error' => '',
> 'info' => '',
> 'trace' => '{:trace}',
> 'code' => '',
> 'context' => '',
> 'links' => array(),
> 'escapeContext' => true,
> ),
> 'html' => array(
> 'trace' => 'Trace 
> {:trace}',
> 'context' => 'Context 
> {:context}',
> 'escapeContext' => true,
> ),
> 'txt' => array(
> 'error' => "{:error}: {:code} :: {:description} on line {:line} of 
> {:path}\n{:info}",
> 'code' => '',
> 'info' => ''
> ),
> 'base' => array(
> 'traceLine' => '{:reference} - {:path}, line {:line}',
> 'trace' => "Trace:\n{:trace}\n",
> 'context' => "Context:\n{:context}\n",
> ),
> 'log' => array(),
> );
>

-- 
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-US.




Some core code to review

2012-08-21 Thread Juan Ezquerro LLanes
Is that a bug? 'log' index is twice?

File: CAKE/lib/Cake/Utility/Debugger.php line 55

protected $_templates = array(
'log' => array(
'trace' => '{:reference} - {:path}, line {:line}',
'error' => "{:error} ({:code}): {:description} in [{:file}, line {:line}]"
),
'js' => array(
'error' => '',
'info' => '',
'trace' => '{:trace}',
'code' => '',
'context' => '',
'links' => array(),
'escapeContext' => true,
),
'html' => array(
'trace' => 'Trace 
{:trace}',
'context' => 'Context 
{:context}',
'escapeContext' => true,
),
'txt' => array(
'error' => "{:error}: {:code} :: {:description} on line {:line} of 
{:path}\n{:info}",
'code' => '',
'info' => ''
),
'base' => array(
'traceLine' => '{:reference} - {:path}, line {:line}',
'trace' => "Trace:\n{:trace}\n",
'context' => "Context:\n{:context}\n",
),
'log' => array(),
);

-- 
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-US.




Using test database

2012-07-23 Thread Juan Ezquerro LLanes
If i write a test case i want use the test database config without 
fixtures, i insert the data manually, i just want to say to my test case 
'just use that db with the data and tables already contains'. how can i do 
that? fixtures do not work with my datasource, i'm using cassandra.

-- 
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


Test Case and login

2012-07-23 Thread Juan Ezquerro LLanes
Hi,

I write a test case for a controller but i need a user logged to do the 
test, i try something like:

 public function testIndex()
{
// TEST USER NORMAL 
$this->Auth->login(
array(
 'user' => 'aa',
 'client_id' => 12345678,
 '_row_key' => 
serialize(UUID::import('0fbr75bgrjv7buyygu78h6gugbu35gbu9'))
)
);
$this->_testAction(
'/SermepaConfig/index',
array('return' => 'vars')
);
debug($this->vars);

$this->Auth->logout();
}

But $this->vars is empty:

## DEBUG ##
array(
'clients_list' => array(
(int) 0 => false
)
)

How can i test actions with several levels of access by user?

I  can do something like assertEqual calling 
$this->MyController->function() but not run if the call to the action must 
be a post ajax data, like:


 $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';

$this->_testAction(
'/SermepaConfig/get_filtered_list',
array(
 'data' => array(
 'SermepaConfig' => array(
 'client_id' => 123456
 )
 ),
 'method' => 'post',
 'return' => 'result'
)
);

-- 
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


Acl alternative

2012-06-03 Thread Juan Ezquerro LLanes
Hi,

I'm using cakephp 2.0 and cassandra as database, so i can't work with 
default acl implementation, any suggestions,  options, ...?

Thanks

-- 
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