Controller does not load automatically models in plugin (Cake 2.7.5)

2015-12-22 Thread Marco Garcia
The title already speaks exactly my problem. 

The controller does not load the standard model in the Plugin. I have to do 
manually. 

Including adding the word "Model " on the App::uses() , if not does not 
work.

e.g.: App::uses("ContactModel", "PluginName.Model")

If I insert just App::uses("Contact", "PluginName.Model"), not working.


Can someone help me?

-- 
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 https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


ROUTER for friendly URL

2015-12-22 Thread Marco Garcia
Redid a website for a client in Cake 2.X and the current site (made native 
in PHP) has a BD with friendly URLs, something like: 
city/typestore/name-of-shop. Obviously the HTACCESS is set to receive and 
treat URLs and "play" the content accordingly.

In the new application (in CakePHP) what I did was this: stores/show/123. 
Those who understand Cake know it's the controller/action/parameter. The 
123 is the ID that step as a parameter.

In the table of the site I have some columns as friendly Url and shop ID 
(in the example above would be 123)

How can I link these two information, ie, accessing the friendly URL I play 
ROUTE in the controller, action, and parameter (ID) correctly, pulling the 
BD (for ID only)?

NOTE 1: It is noteworthy that the new application does NOT have direct 
access to the database. It's all Web service/API. I have a method layout 
where I send the URL and it returns ID. Send ID return URL. I also have the 
programmer's API willingness to create what it takes to succeed.

NOTE 2: The call to the store have to be stores/show/SHOP_ID

Can someone help me?

-- 
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 https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Connecting to MSSQL Database with PDO_DBLIB

2015-10-26 Thread Marco Maranao
Hello,
I'm currently running a cakeapp on my OSX and wanting to connect to a MSSQL 
Database using the PDO_DBLIB.
I'm able to connect using freetds and using the mssql_ functions, but I'd 
like to use it as a DBO Source object.
Can anyone help?
Thanks.

-- 
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: A tool to design CakePHP schemas

2014-09-15 Thread Marco Sbragi
The problem is with the element div with  class="schemaContainer"
Below possible solution


Project: Test




Il giorno venerdì 12 settembre 2014 23:11:34 UTC+2, dariob ha scritto:
>
> Thank you HK!
> Please can you tell me your desktop resolution and browser's version?
> What doesn't work? Can you create a table?
>
> 2014-09-12 21:41 GMT+02:00 HK >:
>
>> very nice...
>>
>> but it doesn't work well on firefox (I tried it in my linux box).
>>
>>
>> On Friday, September 12, 2014 11:37:01 AM UTC+3, dariob wrote:
>>>
>>> Hi to all, I've developed a tool to design ER diagrams following CakePHP 
>>> conventions, would be great to have your feedback...
>>> http://cakeorm.com/
>>>
>>  -- 
>> 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 a topic in the 
>> Google Groups "CakePHP" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/cake-php/6Oh7UKW20dU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Unable to read uploaded file

2014-04-24 Thread Marco Maranao
Hello,

As stated in the subject, using the File API, when I try to read an 
uploaded file to prepare it to save to the database, it's blank.

Any insight is appreciated.
Thanks!

$File = new File($this->fileData['tmp_name']);

$fileData = $File->read();

$File->close();

debug($fileData); // Renders blank

-- 
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: Multi-level menu with Modified Preorder Tree Traversal

2014-04-07 Thread Marco Sbragi
You can find more info here:
Scroll down to "Finding the Depth of the Nodes"
http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/

Il giorno martedì 8 aprile 2014 08:19:40 UTC+2, Marco Sbragi ha scritto:
>
> Hi Sam,
> I don't have time to make test at this moment, and sincerely i think 
> recursion is the best method to make this work.
> I can tell you of a solution i found time ago with cake 1.0 in one of my 
> application.
> The base of the logic is in the query i wrote (the query is simplified i 
> write here only the significant fields):
> Don't know if it is correct but i think that shows the sense of this 
> approach.
>
> SELECT node.lft, node.rgt, node.id, node.parent_id, 
> (COUNT(parent.parent_id) - 1) AS depth,
>node.description, node.link FROM menu AS node, menu AS parent
>WHERE node.lft BETWEEN parent.lft AND parent.rgt;
>
> this query return a flat list with a depth field that is the hierarchical 
> level of indentantion of the item (node).
> Then at every change of depth up or down you can write the corresponding 
>  or 
> This is a logic i used many years ago, whit cake 1.0 at this time with the 
> new features of cakephp i would never use this method.
> HTH
>
> Il giorno domenica 6 aprile 2014 21:13:39 UTC+2, Sam Clauw ha scritto:
>>
>> Hi Marco, thanks 4 your answer too! I realy do appreciate those great 
>> scripts you're sending to me. But right now, I still got the problem that I 
>> can't write the essence of a multi-level menu (without recursion) on my own 
>> ;)
>> Perhaps, you can tell me if / how I can cross my tree-based database 
>> table and output it in a realy simple  list? No active class of 
>> whatever, but the real essence would help me a lot! :)
>>
>

-- 
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: Multi-level menu with Modified Preorder Tree Traversal

2014-04-07 Thread Marco Sbragi
Hi Sam,
I don't have time to make test at this moment, and sincerely i think 
recursion is the best method to make this work.
I can tell you of a solution i found time ago with cake 1.0 in one of my 
application.
The base of the logic is in the query i wrote (the query is simplified i 
write here only the significant fields):
Don't know if it is correct but i think that shows the sense of this 
approach.

SELECT node.lft, node.rgt, node.id, node.parent_id, 
(COUNT(parent.parent_id) - 1) AS depth,
   node.description, node.link FROM menu AS node, menu AS parent
   WHERE node.lft BETWEEN parent.lft AND parent.rgt;

this query return a flat list with a depth field that is the hierarchical 
level of indentantion of the item (node).
Then at every change of depth up or down you can write the corresponding 
 or 
This is a logic i used many years ago, whit cake 1.0 at this time with the 
new features of cakephp i would never use this method.
HTH

Il giorno domenica 6 aprile 2014 21:13:39 UTC+2, Sam Clauw ha scritto:
>
> Hi Marco, thanks 4 your answer too! I realy do appreciate those great 
> scripts you're sending to me. But right now, I still got the problem that I 
> can't write the essence of a multi-level menu (without recursion) on my own 
> ;)
> Perhaps, you can tell me if / how I can cross my tree-based database table 
> and output it in a realy simple  list? No active class of whatever, 
> but the real essence would help me a lot! :)
>

-- 
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: Multi-level menu with Modified Preorder Tree Traversal

2014-04-07 Thread Marco Sbragi
Hi Sam,
I don't have time to make test at this moment, and sincerely i think 
recursion is the best method to make this work.
I can tell you of a solution i found time ago with cake 1.0 in one of my 
application.
The base of the logic is in the query i wrote (the query is simplified i 
write here only the significant fields):

SELECT node.lft, node.rgt, node.id, node.parent_id, 
(COUNT(parent.parent_id) - 1) AS depth,
   node.description, node.link FROM menu AS node, menu AS parent
   WHERE node.lft BETWEEN parent.lft AND parent.rgt;

this query return a flat list with a depth field that is the level of 
indentantion of the item (node).
I think something like this can do the work:

$depth = $items['Node'][0]['depth'];
echo '';
foreach( $items as $k => $item ) {

}



Il giorno lunedì 7 aprile 2014 14:44:52 UTC+2, Jacob Stevens ha scritto:
>
> This is a great article, but doesn't have a lot to do with CakePHP. It 
> certainly spells it out clearly though, and the examples are in PHP.
>
> http://www.sitepoint.com/hierarchical-data-database/
>
>
>
>
> On Sun, Apr 6, 2014 at 3:13 PM, Sam Clauw 
> 
> > wrote:
>
>> Hi Marco, thanks 4 your answer too! I realy do appreciate those great 
>> scripts you're sending to me. But right now, I still got the problem that I 
>> can't write the essence of a multi-level menu (without recursion) on my own 
>> ;)
>> Perhaps, you can tell me if / how I can cross my tree-based database 
>> table and output it in a realy simple  list? No active class of 
>> whatever, but the real essence would help me a lot! :)
>>  
>> -- 
>> 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+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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: Multi-level menu with Modified Preorder Tree Traversal

2014-04-01 Thread Marco Sbragi
Hi Sam, this is a component and  helper i forked on github for this 
purpouse.
my implementation is written to work with bootstrap 2.3 and SQLite but 
originally was achieved to work with superfish
https://github.com/msbragi/cakemenu

Original fork

https://github.com/spiliot/cakemenu

Actually i have rewritten the code to work with bootstrap3 and font 
awesome4 but not updated the repository
HTH

Il giorno lunedì 31 marzo 2014 18:16:17 UTC+2, Sam Clauw ha scritto:
>
> Hi all,
>
> In this  well 
> known example, the indention of the levels is done by some  's instead 
> of 's.
> I wonder if there's a way to use MPPT (Modified Preorder Tree Traversal) 
> logic to dynamically build those multi-level menu without using any 
> recursion?  I can't figure out where I have to close those 's and 
> 's... :s
>
> Thx!
>

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


IBM AS400 DB2 Driver

2013-07-03 Thread Marco Ferragina
Hi all, I've recently written a db2 driver for cakephp2, compatible with 
db2 on old IBM AS400. It's available 
here https://github.com/ferama/cakephp2-db2 and it would be nice if it were 
included in next cakephp version.


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




Custom find paginate only shows 1 page result.

2013-03-28 Thread Marco Vilera
I have the following custom find function definition which is working 
correctly executing SQL query and returns correct values, but it isn't 
returning any page number correctly to paginate helper

public function _findgeneral($state, $query, $results = array()){
if($state=='before'){
if(isset($query['_modo']) && isset($query['_parametros'])){
switch($query['_modo']){
case '1':
$condiciones['Order.client_id'] = $query['_parametros'];
break;
case '2':
$condiciones['Order.control'] = $query['_parametros'];
break;
case '3':
$condiciones['Order.status'] = $query['_parametros'];
break;
default:
throw new NotFoundException(__('Tipo de búsqueda no definido.'));
break;
}
}elseif(isset($query['_status'])){
if((int)$query['_status'] > 0 && (int)$query['_status'] <= 4){
$condiciones['Order.status'] = $query['_status'];
}
else{
throw new NotFoundException(__('Error en el parámetro $status'));
}
}
$condiciones['Order.inactive'] = '0';
$query['conditions'] = $condiciones;
$query['fields'] = array(
'Order.id',
'Order.control',
'Order.commentary',
'Order.created',
'Order.modified',
'Order.status'
);
$query['contain'] =  array(
'Client' => array(
'fields' => array(
'Client.name',
'Client.id'
)
),
'Vendor' => array(
'fields' => array(
'Vendor.name',
'Vendor.id'
)
)
);
$query['limit'] = '2';
return $query;
}
if($state=='after'){
return $results; 
}
}

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cakephp 2.3 find('all')/paginate() performance question

2013-03-20 Thread Marco Vilera
Hey people,

I'm quite new to cakephp, have around a month developing a small app just 
for learning purposes.

Currently i'm having an issue, which while it's not really problematic, in 
this case. it's quite stressing me not finding a way to solve it.

Any of my paginate/find calls, are slowing my controller actions by around 
1-1.2 segs, no matter how many records I have in this table it could be 10 
records or 2000, it will always await around 1000 ms to render my view. 

I have tried several things I looked around in google, like using recursive 
= -1, disabling debug mode, properly indexing my database, using 
containable behavior, and none of this is improving my response time. Only 
thing that I haven't tried is to implement cache in find, since the way my 
app will work, it's not likely that 2 queries will be the same, or at least 
not the most used methods. 

My SQL queries are quite simple and will delay maximum around 10ms, most of 
them are around 2-3 ms according to debug_kit plugin.

Would love any kind of input, i'm falling in love with this framework but 
this issue is disturbing me.

P.S: English is not my native language, please if there is something you 
don't understand, let me know and i'll try to make it clear.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




MySQL-problem with bake and XAMPP

2011-12-15 Thread Marco K
Hello,

I am trying to do the "Simple Acl controlled Application" tutorial.
Everything works fine so far (cake bake opens the menu), but when I
choose an option or want to execute the "cake bake all" command, i get
the following error:

---
Error: Database connection "Mysql" is missing, or could not be
created.
#0 E:\xampp\htdocs\cake\lib\Cake\Model\ConnectionManager.php(98):
DboSource->__c
onstruct(Array)
#1 E:\xampp\htdocs\cake\lib\Cake\Console\Command\Task
\ModelTask.php(838): Connec
tionManager::getDataSource('default')
#2 E:\xampp\htdocs\cake\lib\Cake\Console\Command\Task
\ControllerTask.php(397): M
odelTask->getAllTables('default')
#3 E:\xampp\htdocs\cake\lib\Cake\Console\Command\Task
\ControllerTask.php(419): C
ontrollerTask->listAll(NULL)
#4 E:\xampp\htdocs\cake\lib\Cake\Console\Command\Task
\ViewTask.php(208): Control
lerTask->getName()
#5 E:\xampp\htdocs\cake\lib\Cake\Console\Command\Task
\ViewTask.php(90): ViewTask
->_interactive()
#6 E:\xampp\htdocs\cake\lib\Cake\Console\Shell.php(378): ViewTask-
>execute()
#7 E:\xampp\htdocs\cake\lib\Cake\Console\Shell.php(375): Shell-
>runCommand('exec
ute', Array)
#8 E:\xampp\htdocs\cake\lib\Cake\Console\ShellDispatcher.php(177):
Shell->runCom
mand('View', Array)
#9 E:\xampp\htdocs\cake\lib\Cake\Console\ShellDispatcher.php(69):
ShellDispatche
r->dispatch()
#10 E:\xampp\htdocs\cake\app\Console\cake.php(41):
ShellDispatcher::run(Array)
#11 {main}
---

The database exists and i get the message that cake is able to reach
it. my config file looks like this:

   public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'xx',
'password' => '',
'database' => 'cake',
'prefix' => '',
//'encoding' => 'utf8',
);

Does anybody know what's the problem?

Thanks,
Marco

-- 
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: QuickApps - CakePHP 2.0 CMS - Awesomeness.

2011-12-10 Thread Marco
Paul,

are you saying because Croogo is an excellent CMS for CakePHP no one
can try to develop something different?

There are so many frameworks and cms for PHP, are their developers
reinventing the wheel or simply they have another point of view how to
build them?

Marco

On Dec 10, 6:48 am, phpMagpie  wrote:
> What does this offer that the more established Croogo (http://croogo.org/)
> does not?  A quick look around the backend and plugins does not instantly
> hit me with anything radically different.
>
> Would be much better if everyone who wants to create a CakePHP based CMS
> worked on one project rather than wasting time reinventing the wheel.
>
> Croogo already has a growing team and a growing list of plugins, they are
> up to version 1.3.4 using Cake 1.3 and have recently released 1.4 beta
> which uses Cake 2.0.
>
> HTH, Paul.

-- 
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: Problem with separate Model folder in 2.0.x

2011-11-03 Thread Marco B
found it..

On 3 Nov., 10:52, Marco B  wrote:
> Hi,
>
> I try to upgrade to Cake2.0.2 from 1.3 and I have a problem with a
> seperate Model folder
> i initialized in the bootstrap with
> App::build(array('Model' =>  array(ROOT.DS.'CommonModels')));
>
> a var_dump(App::objects('Model')); finds all models, but if I use a
> special function inside a model i get a sql error message.
>  it seams like it finds my models, but still only loads models located
> in the standard Model Folder

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


Problem with separate Model folder in 2.0.x

2011-11-03 Thread Marco B
Hi,

I try to upgrade to Cake2.0.2 from 1.3 and I have a problem with a
seperate Model folder
i initialized in the bootstrap with
App::build(array('Model' =>  array(ROOT.DS.'CommonModels')));

a var_dump(App::objects('Model')); finds all models, but if I use a
special function inside a model i get a sql error message.
 it seams like it finds my models, but still only loads models located
in the standard Model Folder

-- 
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: Which is the better IDE for cakePHP?

2011-10-01 Thread Marco
I use a secret IDE project, you don't need to write any code

On Sep 30, 8:42 am, Sathia S  wrote:
> > Apatana
>
> > sorry I mispelled it . it is Aptana . I prefer this. it is nice for both
>
> rails and php (cakephp) .
>
> http://www.aptana.com/
>
> --
> Regards
>
> sathiahttp://www.sathia27.wordpress.com

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


Scalable CakePHP Architecture

2011-08-26 Thread Marco B
Hi everybody,

we have a photo selling/sharing web project. Our customers get a
personal portfolio page and can sell their photography.
Because of an increasing amount of users, we are planning to add some
more web servers.

Right now we have one big cake application with the tasks split into
different controllers.
With regard to scalability (scale service delivery and increase the
number of developers) and the option to outsource parts of the
development, without giving access to the whole code, we plan to split
our project into smaller parts/services.

The Services could be split into following groups:
 - static info pages of our project
 - administration interface / customer area
 - photoupload
 - scaling/cropping/converting photos
 - web pages of our customers with their galleries

Now I have three options:

1) keeping everything in one application with different controllers.
2) put every service in a individual cake app (some models can be
shared with a common directory)
3) configure every service to be a plugin

How would you split the cake-application? Which strategy would you
apply?

Thanks,
Marco

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

2011-06-11 Thread Marco
You can allow only ajax requests (see RequestHandler) to limit the use
and you can check if $this->Auth->user() is set.

On Jun 10, 12:32 pm, Niels  wrote:
> Hey everybody,
>
> I followed the Cuploadify tutorial (http://www.am05.com/2011/01/06/
> using-uploadify-in-cakephp/).
> And everything worked out great, until I start implementing it in my
> app.
>
> My app uses the Auth component of cakephp and like I experienced
> before with the Swfuploader.
> It is a f***ing mess, to get it working . Now I hope that anybody here
> can give me some advise.
>
> The only way I could get i working was to $this->Auth-
>
> >allow('upload');
>
> But when I enabled this anybody unauthorized could add new files, that
> isn't good ;).
>
> Could anybody share his/her experiences  how I could avoid this
> problem ?
>
> Thanks a lot in advance
>
> Niels

-- 
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: Welcome Page not finding CSS/Images

2011-05-15 Thread Marco Pais
I will, hopefully :)

2011/5/15 Matt Murphy 

> Do post it!  I'm most curious and it will surely help the next guy...
>
>
> On Sun, May 15, 2011 at 5:51 PM, Marco Pais  wrote:
>
>> Hehe, thanks anyway. I'll struggle until I find something..
>>
>>
>> 2011/5/15 Matt Murphy 
>>
>>> Cogent.  You, sir, have stumped the chump!
>>>
>>> Sorry :(  out of ideas.  If I find something, I'll reply again.
>>>
>>> MM
>>>
>>>
>>> On Sun, May 15, 2011 at 5:47 PM, Marco Pais wrote:
>>>
>>>> Yep, is on and is All. Plus, some configurations that I've made on these
>>>> 3 files resulted on Internal Errors, i.e, this .htaccess files are making
>>>> effect,,,
>>>>
>>>>
>>>> 2011/5/15 Matt Murphy 
>>>>
>>>>> What's the AllowOverrides setting for the vhost this thing is on?
>>>>> Maybe try it on All?
>>>>>
>>>>> MM
>>>>>
>>>>>
>>>>> On Sun, May 15, 2011 at 5:15 PM, Marco Pais wrote:
>>>>>
>>>>>> Thanks again Matt.
>>>>>>
>>>>>> I've tried several configs of the 3 .htaccess files. Right now, I have
>>>>>> cakephp in a subdirectory of htdocs:
>>>>>>
>>>>>>- htdocs - c:\xampp\htdocs
>>>>>>- cake site - c:\xampp\htdocs\subdir\cakephp
>>>>>>
>>>>>> So, my 3 .htaccess files follows like this:
>>>>>>
>>>>>> --- subdir/cakephp/.htaccess 
>>>>>>
>>>>>> 
>>>>>>RewriteEngine on
>>>>>>RewriteBase /subdir/cakephp/
>>>>>>RewriteRule^$ app/webroot/[L]
>>>>>>RewriteRule(.*) app/webroot/$1 [L]
>>>>>> 
>>>>>>
>>>>>> --- subdir/cakephp/app/.htaccess 
>>>>>>
>>>>>> 
>>>>>> RewriteEngine on
>>>>>> RewriteBase /subdir/cakephp/app/
>>>>>> RewriteRule^$ webroot/[L]
>>>>>> RewriteRule(.*) webroot/$1[L]
>>>>>>  
>>>>>>
>>>>>> --- subdir/cakephp/app/webroot/.htaccess 
>>>>>>
>>>>>> 
>>>>>> RewriteEngine On
>>>>>> RewriteBase /subdir/cakephp/app/webroot/
>>>>>> RewriteCond %{REQUEST_FILENAME} !-d
>>>>>> RewriteCond %{REQUEST_FILENAME} !-f
>>>>>> RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
>>>>>> 
>>>>>>
>>>>>> It doesn't work :(
>>>>>>
>>>>>> 2011/5/15 Matt Murphy 
>>>>>>
>>>>>>> you could try adding a RewriteBase for each .htaccess file of the 3
>>>>>>> index directories which directs to that directory.  (again, / /app, and
>>>>>>> /app/webroot).
>>>>>>> Might need terminating slashes...  Can't remember.
>>>>>>>
>>>>>>> MM
>>>>>>> On Sun, May 15, 2011 at 4:44 PM, marcopais wrote:
>>>>>>>
>>>>>>>>  Yes, .htaccess files are there. Plus, I have tried without
>>>>>>>> mod_rewrite, as explained 
>>>>>>>> here<http://wwdj.wijndaele.com/getting-started-with-cakephp-without-mod_rewrite/>
>>>>>>>>  (is
>>>>>>>> somewhere on cakephp book also), but no luck.
>>>>>>>>
>>>>>>>> I read that, although this problem is mainly caused by mod_rewrite
>>>>>>>> issues, it can happen also due to some other problems, like 
>>>>>>>> whitespaces.
>>>>>>>>
>>>>>>>> 2011/5/15 Matt Murphy [via CakePHP] <[hidden 
>>>>>>>> email]<http://user/SendEmail.jtp?type=node&node=4398501&i=0>
>>>>>>>> >
>>>>>>>>
>>>>>>>>  You may have failed to transfer the hidden files, namely
>>>>>>>>> .htaccess.  -- the relevant ones live in / /app and /app/webroot.  
>>>>>>>>> Are they
>>>>>>>>> there?
>>>>

Re: Welcome Page not finding CSS/Images

2011-05-15 Thread Marco Pais
Hehe, thanks anyway. I'll struggle until I find something..

2011/5/15 Matt Murphy 

> Cogent.  You, sir, have stumped the chump!
>
> Sorry :(  out of ideas.  If I find something, I'll reply again.
>
> MM
>
>
> On Sun, May 15, 2011 at 5:47 PM, Marco Pais  wrote:
>
>> Yep, is on and is All. Plus, some configurations that I've made on these 3
>> files resulted on Internal Errors, i.e, this .htaccess files are making
>> effect,,,
>>
>>
>> 2011/5/15 Matt Murphy 
>>
>>> What's the AllowOverrides setting for the vhost this thing is on?  Maybe
>>> try it on All?
>>>
>>> MM
>>>
>>>
>>> On Sun, May 15, 2011 at 5:15 PM, Marco Pais wrote:
>>>
>>>> Thanks again Matt.
>>>>
>>>> I've tried several configs of the 3 .htaccess files. Right now, I have
>>>> cakephp in a subdirectory of htdocs:
>>>>
>>>>- htdocs - c:\xampp\htdocs
>>>>- cake site - c:\xampp\htdocs\subdir\cakephp
>>>>
>>>> So, my 3 .htaccess files follows like this:
>>>>
>>>> --- subdir/cakephp/.htaccess 
>>>>
>>>> 
>>>>RewriteEngine on
>>>>RewriteBase /subdir/cakephp/
>>>>RewriteRule^$ app/webroot/[L]
>>>>RewriteRule(.*) app/webroot/$1 [L]
>>>> 
>>>>
>>>> --- subdir/cakephp/app/.htaccess 
>>>>
>>>> 
>>>> RewriteEngine on
>>>> RewriteBase /subdir/cakephp/app/
>>>> RewriteRule^$ webroot/[L]
>>>> RewriteRule(.*) webroot/$1[L]
>>>>  
>>>>
>>>> --- subdir/cakephp/app/webroot/.htaccess 
>>>>
>>>> 
>>>> RewriteEngine On
>>>> RewriteBase /subdir/cakephp/app/webroot/
>>>> RewriteCond %{REQUEST_FILENAME} !-d
>>>> RewriteCond %{REQUEST_FILENAME} !-f
>>>> RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
>>>> 
>>>>
>>>> It doesn't work :(
>>>>
>>>> 2011/5/15 Matt Murphy 
>>>>
>>>>> you could try adding a RewriteBase for each .htaccess file of the 3
>>>>> index directories which directs to that directory.  (again, / /app, and
>>>>> /app/webroot).
>>>>> Might need terminating slashes...  Can't remember.
>>>>>
>>>>> MM
>>>>> On Sun, May 15, 2011 at 4:44 PM, marcopais wrote:
>>>>>
>>>>>>  Yes, .htaccess files are there. Plus, I have tried without
>>>>>> mod_rewrite, as explained 
>>>>>> here<http://wwdj.wijndaele.com/getting-started-with-cakephp-without-mod_rewrite/>
>>>>>>  (is
>>>>>> somewhere on cakephp book also), but no luck.
>>>>>>
>>>>>> I read that, although this problem is mainly caused by mod_rewrite
>>>>>> issues, it can happen also due to some other problems, like whitespaces.
>>>>>>
>>>>>> 2011/5/15 Matt Murphy [via CakePHP] <[hidden 
>>>>>> email]<http://user/SendEmail.jtp?type=node&node=4398501&i=0>
>>>>>> >
>>>>>>
>>>>>>  You may have failed to transfer the hidden files, namely .htaccess.
>>>>>>> -- the relevant ones live in / /app and /app/webroot.  Are they there?
>>>>>>>
>>>>>>> MM
>>>>>>>
>>>>>>> On Sun, May 15, 2011 at 4:22 PM, marcopais <[hidden 
>>>>>>> email]<http://user/SendEmail.jtp?type=node&node=4398497&i=0>
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi there, Sorry to undig this old thread, but I'm running exactly
>>>>>>>> the same problem as @ajoberstar. My welcome page doesn't load any css 
>>>>>>>> and
>>>>>>>> some other include files, like the site mainmenu. This problem occurs 
>>>>>>>> on a
>>>>>>>> site that I've imported from a online server, where it's working fine. 
>>>>>>>> I
>>>>>>>> need to get it working locally so I can make a few changes. I'm running
>>>>>>>> XAMPP on Windows 7. I ran this 
>>

Re: Welcome Page not finding CSS/Images

2011-05-15 Thread Marco Pais
Yep, is on and is All. Plus, some configurations that I've made on these 3
files resulted on Internal Errors, i.e, this .htaccess files are making
effect,,,

2011/5/15 Matt Murphy 

> What's the AllowOverrides setting for the vhost this thing is on?  Maybe
> try it on All?
>
> MM
>
>
> On Sun, May 15, 2011 at 5:15 PM, Marco Pais  wrote:
>
>> Thanks again Matt.
>>
>> I've tried several configs of the 3 .htaccess files. Right now, I have
>> cakephp in a subdirectory of htdocs:
>>
>>- htdocs - c:\xampp\htdocs
>>- cake site - c:\xampp\htdocs\subdir\cakephp
>>
>> So, my 3 .htaccess files follows like this:
>>
>> --- subdir/cakephp/.htaccess 
>>
>> 
>>RewriteEngine on
>>RewriteBase /subdir/cakephp/
>>RewriteRule^$ app/webroot/[L]
>>RewriteRule(.*) app/webroot/$1 [L]
>> 
>>
>> --- subdir/cakephp/app/.htaccess 
>>
>> 
>> RewriteEngine on
>> RewriteBase /subdir/cakephp/app/
>> RewriteRule^$ webroot/[L]
>> RewriteRule(.*) webroot/$1[L]
>>  
>>
>> --- subdir/cakephp/app/webroot/.htaccess 
>>
>> 
>> RewriteEngine On
>> RewriteBase /subdir/cakephp/app/webroot/
>> RewriteCond %{REQUEST_FILENAME} !-d
>> RewriteCond %{REQUEST_FILENAME} !-f
>> RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
>> 
>>
>> It doesn't work :(
>>
>> 2011/5/15 Matt Murphy 
>>
>>> you could try adding a RewriteBase for each .htaccess file of the 3 index
>>> directories which directs to that directory.  (again, / /app, and
>>> /app/webroot).
>>> Might need terminating slashes...  Can't remember.
>>>
>>> MM
>>> On Sun, May 15, 2011 at 4:44 PM, marcopais  wrote:
>>>
>>>>  Yes, .htaccess files are there. Plus, I have tried without mod_rewrite,
>>>> as explained 
>>>> here<http://wwdj.wijndaele.com/getting-started-with-cakephp-without-mod_rewrite/>
>>>>  (is
>>>> somewhere on cakephp book also), but no luck.
>>>>
>>>> I read that, although this problem is mainly caused by mod_rewrite
>>>> issues, it can happen also due to some other problems, like whitespaces.
>>>>
>>>> 2011/5/15 Matt Murphy [via CakePHP] <[hidden 
>>>> email]<http://user/SendEmail.jtp?type=node&node=4398501&i=0>
>>>> >
>>>>
>>>>  You may have failed to transfer the hidden files, namely .htaccess.  --
>>>>> the relevant ones live in / /app and /app/webroot.  Are they there?
>>>>>
>>>>> MM
>>>>>
>>>>> On Sun, May 15, 2011 at 4:22 PM, marcopais <[hidden 
>>>>> email]<http://user/SendEmail.jtp?type=node&node=4398497&i=0>
>>>>> > wrote:
>>>>>
>>>>>> Hi there, Sorry to undig this old thread, but I'm running exactly the
>>>>>> same problem as @ajoberstar. My welcome page doesn't load any css and 
>>>>>> some
>>>>>> other include files, like the site mainmenu. This problem occurs on a 
>>>>>> site
>>>>>> that I've imported from a online server, where it's working fine. I need 
>>>>>> to
>>>>>> get it working locally so I can make a few changes. I'm running XAMPP on
>>>>>> Windows 7. I ran this script 
>>>>>> <http://bin.cakephp.org/saved/33005>mentioned on this thread, but still 
>>>>>> no luck. I have mod_rewrite running, as
>>>>>> I have installed a fresh cakephp site, which works fine. Only the 
>>>>>> imported
>>>>>> site don't work... Any help?
>>>>>> --
>>>>>> View this message in context: Re: Welcome Page not finding 
>>>>>> CSS/Images<http://cakephp.1045679.n5.nabble.com/Welcome-Page-not-finding-CSS-Images-tp1328476p4398451.html>
>>>>>> Sent from the CakePHP mailing list 
>>>>>> archive<http://cakephp.1045679.n5.nabble.com/>at Nabble.com.
>>>>>>
>>>>>> --
>>>>>> 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
>>>>

Re: Welcome Page not finding CSS/Images

2011-05-15 Thread Marco Pais
Thanks again Matt.

I've tried several configs of the 3 .htaccess files. Right now, I have
cakephp in a subdirectory of htdocs:

   - htdocs - c:\xampp\htdocs
   - cake site - c:\xampp\htdocs\subdir\cakephp

So, my 3 .htaccess files follows like this:

--- subdir/cakephp/.htaccess 


   RewriteEngine on
   RewriteBase /subdir/cakephp/
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]


--- subdir/cakephp/app/.htaccess 


RewriteEngine on
RewriteBase /subdir/cakephp/app/
RewriteRule^$ webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

--- subdir/cakephp/app/webroot/.htaccess 


RewriteEngine On
RewriteBase /subdir/cakephp/app/webroot/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


It doesn't work :(

2011/5/15 Matt Murphy 

> you could try adding a RewriteBase for each .htaccess file of the 3 index
> directories which directs to that directory.  (again, / /app, and
> /app/webroot).
> Might need terminating slashes...  Can't remember.
>
> MM
> On Sun, May 15, 2011 at 4:44 PM, marcopais  wrote:
>
>> Yes, .htaccess files are there. Plus, I have tried without mod_rewrite, as
>> explained 
>> here
>>  (is
>> somewhere on cakephp book also), but no luck.
>>
>> I read that, although this problem is mainly caused by mod_rewrite issues,
>> it can happen also due to some other problems, like whitespaces.
>>
>> 2011/5/15 Matt Murphy [via CakePHP] <[hidden 
>> email]
>> >
>>
>>  You may have failed to transfer the hidden files, namely .htaccess.  --
>>> the relevant ones live in / /app and /app/webroot.  Are they there?
>>>
>>> MM
>>>
>>> On Sun, May 15, 2011 at 4:22 PM, marcopais <[hidden 
>>> email]
>>> > wrote:
>>>
 Hi there, Sorry to undig this old thread, but I'm running exactly the
 same problem as @ajoberstar. My welcome page doesn't load any css and some
 other include files, like the site mainmenu. This problem occurs on a site
 that I've imported from a online server, where it's working fine. I need to
 get it working locally so I can make a few changes. I'm running XAMPP on
 Windows 7. I ran this script mentioned 
 on this thread, but still no luck. I have mod_rewrite running, as
 I have installed a fresh cakephp site, which works fine. Only the imported
 site don't work... Any help?
 --
 View this message in context: Re: Welcome Page not finding 
 CSS/Images
 Sent from the CakePHP mailing list 
 archiveat Nabble.com.

 --
 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
 [hidden email] For 
 more options, visit this group at
 http://groups.google.com/group/cake-php

>>>
>>>  --
>>> 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
>>> [hidden email] For 
>>> more options, visit this group at
>>> http://groups.google.com/group/cake-php
>>>
>>>
>>> --
>>>  If you reply to this email, your message will be added to the
>>> discussion below:
>>>
>>> http://cakephp.1045679.n5.nabble.com/Welcome-Page-not-finding-CSS-Images-tp1328476p4398497.html
>>>  To unsubscribe from Welcome Page not finding CSS/Images, click here.
>>>
>>
>>
>> --
>> View this message in context: Re: Welcome Page not finding 
>> CSS/Images
>> Sent from the CakePHP mailing list 
>> archiveat Nabble.com.
>>
>> --
>> 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
>>
>
>  --
> Our newest site for the com

Integrating Dojo in the CakePHP framework

2011-05-02 Thread Marco K
Hello,

does anybody have experience with integrating Dojo in Cake? I know
there's a Dojo-Cake Helper, but i haven't had success with it.

I am trying to integrate Dojo without this helper. This is the code-
block in my home.ctp:

-

var djConfig = {
parseOnLoad: true,
isDebug: true,
locale: 'de',
baseUrl: "<?php echo $html->url('/js');?>",
modulePaths: {mine:'widgets'}
   };



http://ajax.googleapis.com/ajax/</a>
libs/dojo/1.6/dojo/dojo.xd.js">

echo $html->image('visualizer/tag.png', array('alt' =>
'tag_hinzufuegen', 'url' => 'javascript:createTagWidget()'));?>
-

function createTagWidget() {
tagDialog = new mine.TagWidget();
}

My problem is that I can't get my own Widgets load. The errors i get
in my web-console are:

- Could not load 'mine.TagWidget'; last tried 'widgets/TagWidget.js' @
http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js:14
- uncaught exception: Could not load cross-domain resources:
mine.TagWidget

Do you have any idea what's the matter? I can't figure out what I'm
doing wrong.

kindly regards,
Marco

-- 
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: Auth->deny problem

2010-10-29 Thread Marco
Is the variable $this->Auth->authorize set to 'controller'?

On Oct 29, 5:19 am, thomaus  wrote:
> Hi there,
>
> I don't know what's happening with the Auth->deny function, but I
> can't make it work properly.
>
> Such a function:
>
> function beforeFilter()
> {
>         parent::beforeFilter();
>
>         $this->Auth->deny('overview');
>
> }
>
> in my Users controllers should forbid the access to the url '/users/
> overview' right? Well it doesn't work at all, I still can access this
> url.
>
> Does anybody know what's happening here?
>
> Thanks in advance,

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Find all query + conditions

2010-10-29 Thread Marco
It is difficult to understand what is your problem, probably you
translated your message from portuguese to english with an automatic
translator.
Try also the google group in portuguese 
http://groups.google.com/group/cakephp-pt/topics

On Oct 28, 11:59 pm, Vinícius Barbosa  wrote:
> Hello, I have a problem a few days it seems very simple, but
> I can not in any way a solution.
> I have a table, more or less like this, but has many more fields
> summarize because it's just that I need:
>    id      veiculosModelo  veiculosHodo(int)
> veiculosHodoprox(int)
>         1         carro1                    20                      60
>          2        carro2                 30                      90
>         3        carro3                23                       1
>          4        carro4                 0                      1
>          5        carro5                 0                      1
>          6        carro6                 5                      24
>         7        carro7                40                     1
>
> I run this query:
>
> $ Rec = $ this-> Vehicle-> find ('all',
> array ('conditions' => array (' veiculosHodo> '=>'')));
> veiculosHodoprox
>          $ This-> set ('vehicle', $ rec);
>
> the query result is this:
>
>        id        veiculosModelo  veiculosHodo    veiculosHodoprox
>         1         carro1                    20                      60
>          2        carro2                 30                      90
>         3        carro3                23                       1
>          6        carro6                 5                      24
>         7        carro7                40                     1
>
> It should be a primary error that's going on, but I have done all
> sorts of
> test and nothing, I even made an appointment at the bank with this
> select (SELECT *
> FROM `` WHERE `vehicles veiculosHodo`> `` veiculosHodoprox) and it
> worked
> perfectly, if anyone knows please give me a help.
>
> Thanks.
> Hug!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Build Query

2010-10-26 Thread Marco
I agree with Miles.

$this->paginate =
array('conditions'=>array('Result.location'=>'Sundown'));
$this->set('results', $this->paginate('Result'));

On Oct 25, 5:38 pm, Miles J  wrote:
> Why are you setting $results twice?
>
> If you want pagination, use paginate(), you dont need the other query.
>
> On Oct 25, 11:39 am, Briko03  wrote:
>
>
>
>
>
>
>
> > It looks like the first query is working as it should. I  am positive
> > there is a location field.
>
> > Here is a snapshot of the table
>
> > When I run the first query it works fine and returns 2615 records.
>
> > I think it has something to do with the pagination perhaps?
>
> > On Oct 25, 1:50 pm, Jeremy Burns | Class Outfit
>
> >  wrote:
> > > Are you certain you have a row in your database that matches that 
> > > criteria? The SQL looks right, but the count is zero. What happens when 
> > > you run the SQL directly against the database?
>
> > > Jeremy Burns
> > > Class Outfit
>
> > > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > > On 25 Oct 2010, at 13:46, Briko03 wrote:
>
> > > > I have a field named location.
>
> > > > This is what is coming throu from cake
>
> > > > SHOW FULL COLUMNS FROM `results`           14      14      3
> > > > 2  SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE
> > > > COLLATION_NAME= 'utf8_general_ci';         1       1       1
> > > > 3  SELECT `Result`.`id`, `Result`.`racenum`, `Result`.`bib`,
> > > > `Result`.`fname`, `Result`.`lname`, `Result`.`sex`, `Result`.`class`,
> > > > `Result`.`team`, `Result`.`firstrun`, `Result`.`secondrun`,
> > > > `Result`.`best`, `Result`.`points`, `Result`.`season`,
> > > > `Result`.`location` FROM `results` AS `Result` WHERE
> > > > `Result`.`location` = 'Sundown'            2615    2615    7
> > > > 4  SELECT COUNT(*) AS `count` FROM `results` AS `Result` WHERE 1 = 1
> > > > 1  1       0
> > > > 5  SELECT `Result`.`id`, `Result`.`racenum`, `Result`.`bib`,
> > > > `Result`.`fname`, `Result`.`lname`, `Result`.`sex`, `Result`.`class`,
> > > > `Result`.`team`, `Result`.`firstrun`, `Result`.`secondrun`,
> > > > `Result`.`best`, `Result`.`points`, `Result`.`season`,
> > > > `Result`.`location` FROM `results` AS `Result` WHERE 1 = 1 LIMIT 100
> > > > 100        100     1
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > > with their CakePHP related questions.
>
> > > > 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 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Auth's login is not working at all, nor displaying errror

2010-10-12 Thread Marco
@Jeremy

are you sure that exists a difference between $session and $this-
>Session, for me they are the same object? The only difference is
$this->Helper allows view variables and helpers to share names and not
create collisions.

On Oct 11, 9:35 am, Jeremy Burns | Class Outfit
 wrote:
> To be precise, it's echo $this->Session->flash('auth');
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 11 Oct 2010, at 13:31, Marco wrote:
>
>
>
> > I think you need to write: echo $session->flash('auth');
>
> > On Oct 11, 2:03 am, Jeremy Burns | Class Outfit
> >  wrote:
> >> One small suggestion. Are you using 1.3? If so, refer to $this->Session 
> >> rather than $session. At least you might get a message that could help 
> >> track down the problem.
>
> >> Jeremy Burns
> >> Class Outfit
>
> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> On 11 Oct 2010, at 01:18, Farhanx wrote:
>
> >>> one correction i have made it here
>
> >>> $this->Auth->fields = array('username' => 'k_userid', 'password' =>
> >>> 'k_passw');
>
> >>> but still same thing happening
>
> >>> i tried to dump the data information inside login but it came as NULL.
> >>> Does it mean my form is not even posting data information??
>
> >>> function login()
> >>> {
> >>>    // No form processing needed, Auth does it automatically
> >>>     var_dump($this->data);
> >>> }
>
> >>> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> >>> with their CakePHP related questions.
>
> >>> 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 
> >>> athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Auth's login is not working at all, nor displaying errror

2010-10-11 Thread Marco
I think you need to write: echo $session->flash('auth');

On Oct 11, 2:03 am, Jeremy Burns | Class Outfit
 wrote:
> One small suggestion. Are you using 1.3? If so, refer to $this->Session 
> rather than $session. At least you might get a message that could help track 
> down the problem.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 11 Oct 2010, at 01:18, Farhanx wrote:
>
>
>
>
>
> > one correction i have made it here
>
> > $this->Auth->fields = array('username' => 'k_userid', 'password' =>
> > 'k_passw');
>
> > but still same thing happening
>
> > i tried to dump the data information inside login but it came as NULL.
> > Does it mean my form is not even posting data information??
>
> > function login()
> > {
> >    // No form processing needed, Auth does it automatically
> >     var_dump($this->data);
> > }
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Auth component variables

2010-10-07 Thread Marco
did you try 'allowedActions' => '*', 'allow' is the method.

Marco

On Oct 6, 2:31 am, Jeremy Burns  wrote:
> Looking at this page in the 
> guide:http://book.cakephp.org/view/1251/Setting-Auth-Component-Variables,
> you'd think you could do this:
>
> var $components = array(
>   'Auth' => array(
>         /.../
>         'allow' => '*',
>         /.../
>  )
> );
>
> ...but it seems this is ignored. You have to specify $this->Auth-
>
> >allow('*'); in beforeFilter().
>
> Is this correct, or is it a bug?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Validation errors not shown in a form

2010-07-30 Thread Marco
Are you sure you are using the $form->input for all the fields and
$form->create?

On Jul 30, 2:19 am, Norman Paniagua  wrote:
> Can you show your code?
> ---
>
> Norman Paniagua
>
> 2010/7/29 Roland Pish 
>
>
>
> > Hi.
>
> > Suddenly a form stopped showing the error messages with the  > class="error-message"> beside input fields with validation.
> > When a validation error occurs. If I debug($this->Themodel-
> > >validationErrors) it shows me the errors but there is no  > class="error-message"> anymore.
>
> > What could be wrong?
>
> > I don't remember changing anything in cake's core.
>
> > Any clue on this?
>
> > Regards
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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 > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Release: CakePHP 1.3.1

2010-06-02 Thread Marco
For the bake problem:
http://groups.google.com/group/cake-php/browse_thread/thread/fddcb1c8f628d5ee

On Jun 2, 6:01 am, Quess  wrote:
> Beside that what you guys say I also can't bake any model files, after
> baking is done model files are empty (file size = 0) so I back to
> 1.3.0
>
> On 30 Maj, 02:48, Sergei  wrote:
>
>
>
> > Hi,
>
> > just tried 1.3.1 with one of my project (Cake 1.3). It instantly gave
> > me an errors on almost *every* page (see below). Removing TMP\cache
> > \persistent\ files doesn't help.
>
> > =
> > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of
> > 1661 bytes [CORE\cake\libs\cache\file.php, line 176]
> > Code | Context
> > $key    =       "cake_core_file_map"
> > $time   =       1275179913
> > $cachetime      =       1275179919
> > $data   =       ""
> > unserialize - [internal], line ??
> > FileEngine::read() - CORE\cake\libs\cache\file.php, line 176
> > Cache::read() - CORE\cake\libs\cache.php, line 347
> > App::getInstance() - CORE\cake\libs\configure.php, line 967
> > App::build() - CORE\cake\libs\configure.php, line 650
> > Configure::__loadBootstrap() - CORE\cake\libs\configure.php, line 431
> > Configure::getInstance() - CORE\cake\libs\configure.php, line 52
> > include - CORE\cake\bootstrap.php, line 38
> > [main] - APP\webroot\index.php, line 77
>
> > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of
> > 28 bytes [CORE\cake\libs\cache\file.php, line 176]
> > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of
> > 5 bytes [CORE\cake\libs\cache\file.php, line 176]
> > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of
> > 105 bytes [CORE\cake\libs\cache\file.php, line 176]
> > ==
>
> > On May 30, 2:29 am, mark_story  wrote:
>
> > > The CakePHP development team is happy to announce the release of
> > > CakePHP 1.3.1[1].  1.3.1 is the first  maintenance release for 1.3 and
> > > contains bugfixes and optimizations for features found in 1.3.  No new
> > > features will be introduced in the maintenance releases for 1.3.
> > > Regular maintenance releases for 1.3 are planned on a monthly basis
> > > for the near future.
>
> > > Since the release of CakePHP 1.3.0 last month, there have been more
> > > than 70 commits and 45 tickets resolved. There have been a few changes
> > > that may affect your application.
>
> > >  - The conditional check around including custom session configuration
> > > files was removed.  This fixes issues where requestAction could cause
> > > loss of session settings, and improves the end developers ability to
> > > customize the session.  Custom session files should ensure that
> > > classes/functions are conditionally declared.
>
> > >  - How virtualFields are detected and parsed was modified to allow
> > > virtualFields on the same table.  A virtualFieldSeparator property was
> > > added to DboSource to allow customization of the virtualField
> > > separator.  If you have fields containing '__' you may have to modify
> > > this setting to avoid issues.
>
> > >  - EmailComponent had a number of changes made to better support ELHO
> > > and slow SMTP servers.
>
> > > Be sure to check the full changelog[2] for all changes that have
> > > occurred. We'd like to welcome Juan Basso[3] to the development team.
> > > Juan has been very active in the brazilian community and we're really
> > > happy to have him.  Work on the 2.0 branch continues to progress.
> > > Currently much of the effort is focused on getting our migration to
> > > PHPUnit complete. We'd like to thank the ongoing community efforts
> > > around the documentation.  There are now over 18,500 revisions in the
> > > cookbook and 4 languages now have more than 70% of the documentation
> > > translated.
>
> > > As always, thank you for helping us make a great framework and
> > > fantastic community.
>
> > > Download a packaged release [1]
> > > View the changelog [2]
>
> > > [1]http://github.com/cakephp/cakephp/downloads
> > > [2]http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-1
> > > [3]http://blog.cakephp-brasil.org/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Bake Shell in CakePHP 1.3.1

2010-06-01 Thread Marco
Take a look at this:
http://cakephp.lighthouseapp.com/projects/42648/tickets/771-wrong-core-path-in-templatephp

On May 31, 5:06 am, kanickl  wrote:
> Besides the filecache errors described in other posts the download of
> CakePHP 1.3.1 brought me a broken Bake Shell which reports after
> running "cake bake all":
> Notice: Undefined offset: 0 in D:\xampp\htdocs\cake\cake\console\libs
> \tasks\temp
> late.php on line 183
>
> Notice: Undefined offset: 1 in D:\xampp\htdocs\cake\cake\console\libs
> \tasks\temp
> late.php on line 184
> Could not find template for model
>
> However, there is no Error message, but nothing is written to the
> disk!
>
> Running "cake bake model" for a database table reports the same
> notices, but produces a php-file for the model without any content!
>
> With cake 1.3.0 I did not have any of these problems.
> Anyone got an idea?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

2010-05-25 Thread Marco
Have you tried:

Router::connect('/:alias/:controller/:action', array(),
array('alias'=> '[a-zA-z0-9]+'));

Marco

On May 24, 10:31 am, emanuele  wrote:
> Hello pals,
>
> I can't really figure out one thing about Routes..
>
> My url is something like localhost/acme/mycontroller/myaction.. my question
> is how can I remap the previous url in something like
> localhost/mycontroller/myaction using route?
>
> I ve added the following line in routes.php
> Router::connect('/:alias/:controller/:action',
>         array(),
>         array(
>             'alias', '[a-zA-z0-9]+')
>         );
>
> but it dosen't seem really work..
>
> thanks in advance
> --
> Emanuele Gringeri
> Computer Engineer
> University of Pisa
> Be my mirror, my sword and shield
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> 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 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: LinkableBehavior for CakePHP 1.3

2010-04-29 Thread Marco
Thank you Arjen, I already use the Linkable behavior and I will test
this version.

On Apr 28, 4:57 pm, Terr  wrote:
> Hi fellow bakers,
>
> When upgrading to CakePHP 1.3, some of you might be running into
> problems when with LinkableBehavior. I've got an updated version on my
> GitHub page that will remove the obsolete warnings and enables
> Linkable to be used in pagination:http://github.com/Terr/linkable.
>
> That page has also become the place to open any issue tickets (and, of
> course, to fork and help improve the plugin!). Rafael Bandeira, the
> original author, couldn't update the project anymore and has asked me
> if I could keep an eye on it :)
>
> Note: When updating to this version, you might notice some changed
> behavior from Linkable. The old Linkable didn't fetch any fields of
> linked models when none were asked. To match the behavior of Cake /
> Containable, I've changed it to include all fields by default.
>
> Cheers,
> Arjen
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> 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 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Model Associations - just feels wrong

2010-03-19 Thread Antônio Marco
Hi, TheKerk, morning!

Can you post the models association's code here?

Thanks.

On 17 mar, 23:41, TheHerk  wrote:
> Here is a link to a screenshot of a class diagram I am working on,
> with noted model associations. There are several relationships in the
> diagram that feel wrong to me. The one in the diagram that illustrates
> this is between ZipLocation and State. In this case, state is
> enumerated in its own table. For some reason, to me, it seems strange
> that  ZipLocation, the parent, is belongsTo. I keep thinking in my
> head, “Each ZipLocation has one associated State,” but it doesn't seem
> to work that way. There are several more instances of this dilemma,
> but they are just the same.
>
> http://i8.photobucket.com/albums/a24/atomickeg/public/classes.png
>
> Does this look remotely correct?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Further Datasource documentation

2010-03-18 Thread Marco
What helped me was:

http://www.neilcrookes.com/2009/01/30/cakephp-site-search-with-yahoo-boss/

Marco


On Mar 18, 9:09 pm, Lucca Mordente  wrote:
> Hello there,
>
> I've been trying to create a Datasource for Google Picasa, thought the
> documentation about this is too poor.
>
> Does anyone know where can I find more docs about how to implement
> CakePHP Datasources?
>
> Cheers,
> Lucca Mordente

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Multiple forms on single page

2010-02-19 Thread Marco
I don't know if I understood your question but what I use when I need
a step by step form is this component:

http://bakery.cakephp.org/articles/view/wizard-component-1-2-1

On Feb 18, 7:11 pm, McScreech  wrote:
> Is it possible to define several _independent_ data entry forms on a
> single page where each one posts data back to different models? Maybe
> with a redirect back to the same multi-form page on each Submit until
> a 'Done' button is clicked?
>
> And of course, if so, any suggestions on how to do so?
>
> DaveT.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Database encryption & security

2009-12-19 Thread Marco
I think you can take a look at this behaviour:

http://bakery.cakephp.org/articles/view/cryptable-behavior

I didn't try it but I use something similar. You need the mcrypt
library installed on your server.

On Dec 18, 3:52 pm, WhyNotSmile 
wrote:
> I am doing this for a client.  He has access to the database through
> his control panel of his web host.  I want it to be encrypted so he
> can't read the data.  It's not that I don't want him to see it, but
> that there is data which clients might not want him to see.  I also
> have access to the database, and they might not want me to see it
> either.  So, basically, when you go to PHPadmin, it should be
> encrypted.  Does that make sense?
>
> Also, if anyone was to hack into the database somehow, I don't want
> them to be able to read the data.
>
> Thanks,
> Sharon
>
> On Dec 18, 2:04 pm, robustsolution  wrote:
>
>
>
> > of course you are talking about two-way encryption not hashing (one
> > way).
>
> > by the way what do you mean by the database owner?
>
> > either the guy have a full access to the database or a custom access.
>
> > if you are the one who has full access, give him a mysql account with
> > custom access to all tables except the tables that have sensitive
> > info.
>
> > otherwise an alternative solution should be required here.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Media Plugin Warnings on upload for specific MIME-Types

2009-12-11 Thread Marco
Hi guys,

i'm using Marius Wilms aka David Persson CakePHP Media Plugin. Works
fine in a certain way. I modified it a little bit to be able to set
database column names in configuration part. I doesn't changed any
Media filter settings. As I tried to upload a TIFF image the plugin
throws the following warnings:

Warning (512): Medium::make - Instruction `ImageMedium::convert()`
failed. [APP/plugins/media/vendors/medium/medium.php, line 302]
Warning (512): MediaBehavior::make - Failed to make version `xxs` of
file `/Applications/MAMP/htdocs/fn/app/webroot/assets/transfer/img/
jesus_3.tiff`.  [APP/plugins/media/models/behaviors/media.php, line
340]
Warning (512): MediaBehavior::make - Failed to make version `xs` of
file `/Applications/MAMP/htdocs/fn/app/webroot/assets/transfer/img/
jesus_3.tiff`.  [APP/plugins/media/models/behaviors/media.php, line
340]
Warning (512): MediaBehavior::make - Failed to make version `s` of
file `/Applications/MAMP/htdocs/fn/app/webroot/assets/transfer/img/
jesus_3.tiff`.  [APP/plugins/media/models/behaviors/media.php, line
340]
Warning (512): MediaBehavior::make - Failed to make version `m` of
file `/Applications/MAMP/htdocs/fn/app/webroot/assets/transfer/img/
jesus_3.tiff`.  [APP/plugins/media/models/behaviors/media.php, line
340]
Warning (512): MediaBehavior::make - Failed to make version `l` of
file `/Applications/MAMP/htdocs/fn/app/webroot/assets/transfer/img/
jesus_3.tiff`.  [APP/plugins/media/models/behaviors/media.php, line
340]
Warning (512): MediaBehavior::make - Failed to make version `xl` of
file `/Applications/MAMP/htdocs/fn/app/webroot/assets/transfer/img/
jesus_3.tiff`.  [APP/plugins/media/models/behaviors/media.php, line
340]

The same with a PDF file of which I expacted, there would be generated
a preview.

Any hints, suggestions or best solutions?

Thanks in advance.
Marco

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: CakePHP Modified and Created GMT Time

2009-12-08 Thread Marco
It is not a problem of CakePHP, if you want php considers as default
the GMT timezone add

date_default_timezone_set('UTC');

in bootstrap.php file.

On Dec 7, 7:20 pm, Josh K  wrote:
> When CakePHP automatically updates the modified and created columns
> (http://book.cakephp.org/view/69/created-and-modified), it uses the
> server's timezone, and not the GMT timezone (i.e - gmdate(), etc.).
> Why is this?
>
> If I were to move to a server in a different timezone, I would have to
> adjust any timezone offset calculated from the modified and created
> columns.
>
> Is there are way around this problem without editing the core CakePHP
> files?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Use of Multiple Fields in $displayField var in Models

2009-12-08 Thread Marco
Yes, it is what Marcelo already mentioned.

On Dec 8, 10:56 am, Dave  wrote:
> I asked about this a while ago and I know there is a multiple displayField
> behavior in the bakery
>
>
>
> On Mon, Dec 7, 2009 at 8:12 PM, Marcelo Andrade  wrote:
> > On Mon, Dec 7, 2009 at 2:44 AM, Mohammad Raheel
> >  wrote:
> > > I want to use 2 Concatenated fields in $displayField variable in a
> > > model so that the view can show both FirstName and LastName in the
> > > dropdown selection.
>
> > > var $displayField = "firstName";
>
> > > I need something like
> > > var $displayField = "firstName"." "."lastName";
>
> > This is not the correct syntax.  About using more
> > than one field in displayField, I've found this old
> > ticket[1] and this article at bakery[2].
>
> > But, as Marco said, Set::combine is so powerfull.
> > Maybe you should give it a try.
>
> > [1]https://trac.cakephp.org/ticket/644
> > [2]http://bakery.cakephp.org/articles/view/multiple-display-field-3
>
> > Atenciosamente.
>
> > --
> > MARCELO DE F. ANDRADE
> > Belem, PA, Amazonia, Brazil
> > Linux User #221105
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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 > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: paginator help

2009-12-07 Thread Marco
Try something link that:

(isset($this->data['User']['fname'])? $firstname = $this->data['User']
['fname'] : $firstname = $this->params['named']['fname']);
(isset($this->data['User']['lname'])? $lastname = $this->data['User']
['lname'] : $lastname = $this->params['named']['lname']);

$paginator->options(array('url'=>array_merge(array('fname'=>
$firstname, 'lname'=>$lastname), $this->passedArgs)));



On Dec 7, 9:11 am, Amit Rawat  wrote:
> It not working. Well the problem is i m posting a search form whenever a
> user enters some value for first name or last name the paginator give me
> result but when i click on next button, i need to post the form again so
> that page2 give me result according to search critera

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Populate a dropdown using Ajax

2009-12-07 Thread Marco
Quick answer

I use http://jquery.malsup.com/form/

view:

$('#yourForm').ajaxSubmit( {
  success: function(responseText, responseCode) {

var index = responseText.lastIndexOf(':');
var name = responseText.substr(0, index);
var id = responseText.substr(index + 1);

//add new role to Roles in dropdown
  }

});

controller:

function admin_add() {
if ($this->Role->save($this->data)) {
if ($this->RequestHandler->isAjax()) {
Configure::write('debug', 0);
$this->autoRender = false;
echo $this->data['Role']['name'].':'.$this-> Role->id;
exit();
} else {
$this->redirect(array('action'=>'index'));
}
}
}

On Dec 7, 8:44 am, SugarCRM Geek  wrote:
> Hello all,
>     i have 2 fields in a page. one is a dropdown(Roles) & other is a
> text field(Add New Role).
> The Rolesin the dropdown are coming from the database.
> Now i need to add a New Role. this has to be saved in the DB as i
> click on create. When the page loads again this New Role should be
> shown in the DropDown(Roles) list.
> These 2 fields are part of form, consisting of other stuff too.
>
> Can somebody gimme an idea on this.
> am trying to use AJAX here but its not working.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Use of Associations in Add / Insert

2009-12-07 Thread Marco
Something like that should work with model association hasOne between
User and Customer models, check
http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo
for details

view:

echo $form->create('User', array('action'=>'add'));
echo $form->input('FirstName');
echo $form->input('LastName');
echo $form->input('Customer.FirstName');
echo $form->input('Customer.LastName');
echo $form->end('Submit');

controller:

function add() {
   if(!empty($this->data)) {
  $this->User->saveAll($this->data);
   }
}



On Dec 7, 2:55 am, Mohammad Raheel  wrote:
> I have 3 different roles in my application. "Customers", "Customer
> Support Agent", "Sales Rep".
>
> Common fields in all 3 are:
>
> FirstName
> LastName
> Email
> username
> password
> role_id
> etc...
>
> Role Specific Fields are:
>
> Customers:
> ==
>
> 1. Social Security Number
> 2. Date of Birth
> 3. Credit Card Number
> 4. ExpiryMonth , ExpiryYear
> etc..
>
> Customer Support Agent & Sales Rep
> ===
> Nothing unique.
>
> I want to create a user management plugin to be reused in all projects
> and want to keep common fields in users table. Question is how do i
> generate a single view for customers add action so that it asks for
> fields in both users and customers table and saves it appropriately in
> both the tables. Rather can creating a user first and then selecting
> that user in the customer add screen, i want simply a view to create
> customer which inserts data in both the tables.
>
> If above design looks wrong, please advice any improvements and proper
> solution to bake the MVCs.
>
> Thanks in advance

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Use of Multiple Fields in $displayField var in Models

2009-12-07 Thread Marco
I think you can't do it.

One solution:

controller:

$this->User->recursive = -1;

$users= $this->User->find('all', array('fields'=>array('User.id',
'User.FirstName', 'User.LastName')));

$users = Set::combine($users, '{n}.User.id',
array('%s %s', '{n}.User.LastName', '{n}.User.FirstName'));

$this->set('users', $users')

view:

echo $form->input('id', array('options'=>$users));


Marco

On Dec 7, 3:44 am, Mohammad Raheel  wrote:
> I want to use 2 Concatenated fields in $displayField variable in a
> model so that the view can show both FirstName and LastName in the
> dropdown selection.
>
> var $displayField = "firstName";
>
> I need something like
> var $displayField = "firstName"." "."lastName";
>
> The above statement is not valid in a variable declaration inside a
> class.
>
> Please advice.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Containable together with Translate Behavior

2009-11-02 Thread Marco

Had to add some facts:

I removed AppModel's beforeFind and beforeSave (I forgot to write
Config.language, which is used by Translate Behavior). So forget about
these lines.
Another important thing is, that field_a and field_b in my real world
app are named equal. But tested it also with different names. Same
result.
I actually don't really know, how should be responsible for replacing
field_a / field_b with I18n__field_a / I18n__field_b which comes from
Translate Behavior. And I'm also not sure, if Translate Behavior works
also for contained Models.

Marco


On 2 Nov., 16:22, Marco  wrote:
> Hi guys,
>
> i'm trying to combine Containable and Translate Behavior.
>
> My setup:
>
> Models:
> A hasMany B
> A Translate = 'field_a'
> B belongsTo A
> B Translate = 'field_b'
>
> Controllers:
> A->contain('B');
> A->read(null, $id);
>
> AppModel:
> beforeFind:
> $this->locale = 'de_de';
> beforeSave:
> $this->locale = 'de_de';
>
> So what I expected was translated content for associated datasets of B
> in reading A. But what automagically happens with field_a from
> instance A, doesn't appear with field_b from instance B. I checked the
> sql command. This seems to be correct.
>
> SELECT B.*, I18n__field_b.content FROM b AS B LEFT JOIN i18n AS
> I18n__field_b ON (B.id = I18n__field_b.foreign_key AND
> I18n__name_field_b.model = B AND I18n__field_b.field = field_b) WHERE
> a_id = 1 AND I18n__field_b.locale = de_de
>
> Any suggestions? I don't know how to use it together. Of course I can
> make the find call manually for B, but I wanted to use the normally
> really good Containable Behavior.
>
> Thanks in advance.
> Marco
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Containable together with Translate Behavior

2009-11-02 Thread Marco

Hi guys,

i'm trying to combine Containable and Translate Behavior.

My setup:

Models:
A hasMany B
A Translate = 'field_a'
B belongsTo A
B Translate = 'field_b'

Controllers:
A->contain('B');
A->read(null, $id);

AppModel:
beforeFind:
$this->locale = 'de_de';
beforeSave:
$this->locale = 'de_de';

So what I expected was translated content for associated datasets of B
in reading A. But what automagically happens with field_a from
instance A, doesn't appear with field_b from instance B. I checked the
sql command. This seems to be correct.

SELECT B.*, I18n__field_b.content FROM b AS B LEFT JOIN i18n AS
I18n__field_b ON (B.id = I18n__field_b.foreign_key AND
I18n__name_field_b.model = B AND I18n__field_b.field = field_b) WHERE
a_id = 1 AND I18n__field_b.locale = de_de

Any suggestions? I don't know how to use it together. Of course I can
make the find call manually for B, but I wanted to use the normally
really good Containable Behavior.

Thanks in advance.
Marco
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Test Suite: How to Use Models in Controller?

2009-10-09 Thread Marco

I have a test case, example:

class ArticlesControllerTest extends CakeTestCase {

   function testAdd() {
 $data = array('Article' => array('user_id' => 1, 'published'
  => 1, 'slug'=>'new-article', 'title' => 'New Article',
'body' => 'New Body'));
 $result = $this->testAction('/articles/add',
 array('data' => $data, 'method' => 'post'));
$this->assertTrue($result );
   }
}

Now I want add a new test in the same function to check if another
table was affected, suppose Users:

class ArticlesControllerTest extends CakeTestCase {

   function testAdd() {
 $data = array('Article' => array('user_id' => 1, 'published'
  => 1, 'slug'=>'new-article', 'title' => 'New Article',
'body' => 'New Body'));
 $result = $this->testAction('/articles/add',
 array('data' => $data, 'method' => 'post'));
$this->assertTrue($result );

//** New Test ***
    $this->User =& ClassRegistry::init('User');
$result = $this->User->field('articles_counter', array('id'=>1));
$this->assertEqual($result, 5);
   }
}

The example works but the new test check the live table not the one
created with the prefix "test_suite_". How do I get the records in the
fixture table?

Marco
--~--~-~--~~~---~--~~
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: Cache View dose not work

2009-10-09 Thread Marco

Did you set Configure::Cache.check to true in core.php?

Marco

On Oct 8, 1:45 pm, Simon  wrote:
> i tired both
> element('logininfo', array('cache' => false)); ?>
> => this dosen't work at all
>
> in the element i tired  which i see no
> debug error even though i set the debug 2
> but when i see the view source page i get the errorr that i posted
> above
> thats wired problem that i cant figure out
> thank you
>
> On Oct 8, 9:29 am, Miles J  wrote:
>
>
>
> > Try playing the nocache tags in the element itself. You can also pass
> > an option to the element of cache = false.
>
> > element('logininfo', array('cache' => false)); ?>
>
> > On Oct 8, 9:26 am, Simon  wrote:
>
> > > haven't tried to remove the cache helper would  that make any
> > > difference ?
>
> > > sorry i just wrote the  twice in this post  but the code
> > > is like this see below in my layout
>
> > > 
> > > element('logininfo'); ?>
> > > 
>
> > > On Oct 8, 9:17 am, Miles J  wrote:
>
> > > > Do you get an error when we remove the cache helper?
>
> > > > Also the code should be:
>
> > > > 
> > > > element('logininfo'); ?>
> > > > 
>
> > > > On Oct 8, 7:44 am, Simon  wrote:
>
> > > > > well in that element it has the login user info which you dont wanna
> > > > > cache
> > > > > here is what i have in post controller
>
> > > > >  var $helpers = array('Cache');
>
> > > > > in my view  action i have this
>
> > > > > $this->cacheAction = '1 hour';
>
> > > > > then in my default layout i have this element which i put the
> > > > > 
> > > > > 
> > > > > element('logininfo'); ?>
> > > > > 
> > > > > then i get errorr which i can't see in the browser i did view source
>
> > > > > this is the ouput of error
>
> > > > > 
> > > > > Notice > > > > b> (8): Undefined property: stdClass::$model [CORE\cake\libs
> > > > > \view\helper.php, line 333]
> > > > > 
> > > > > Code |
> > > > > Context > > > > a>$entity  =       "User."
> > > > > $setScope       =       true
> > > > > $view   =       stdClass
> > > > > stdClass::$modelScope = false > > > > class="cake-code-dump" style="display: none;"> > > > > style="color:
> > > > > #00">} > > > > code>
> > > > > 
> > > > > 
> > > > > $model = $view->model;
> > > > > Helper::setEntity() - CORE\cake\libs\view\helper.php,
> > > > > line 333
> > > > > FormHelper::create() - CORE\cake\libs\view\helpers\form.php, line 122
> > > > > include - APP\views\elements\slide.ctp, line 9
> > > > > View::_render() - CORE\cake\libs\view\view.php, line 654
> > > > > View::element() - CORE\cake\libs\view\view.php, line 339
> > > > > include - APP\tmp\cache\views\new_recipes_category_Basics.php, line
> > > > > 121
> > > > > View::renderCache() - CORE\cake\libs\view\view.php, line 483
> > > > > Dispatcher::cached() - CORE\cake\dispatcher.php, line 718
> > > > > Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 130
> > > > > [main] - APP\webroot\index.php, line 90
> > > > > 
> > > > > Notice > > > > b> (8): Undefined property: stdClass::$association [CORE\cake
> > > > > \libs\view\helper.php, line 366]
> > > > > 
> > > > > Code |
> > > > > Context > > > > a>$entity  =       "User."
> > > > > $setScope       =       true
> > > > > $view   =       stdClass
> > > > > stdClass::$modelScope = false
> > > > > $model  =       null
> > > > > $hasField       =       false
> > > > > $sameScope      =       true
> > > > > $parts  =       array(
> > > > >         "User"
> > > > > )} > > > > code>
> > > > > 
> > > > > if (!
> > > > > $view->association && $parts[0] == 
> > > > >

Re: Master Filter for HABTM-Relationships

2009-09-15 Thread Marco

This brought the solution: 
http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find

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



Master Filter for HABTM-Relationships

2009-09-14 Thread Marco

Hi guys,

i'm using some HABTM-relationships between models, from whom one is an
adaptation model. By switching the adaptation i want to set a kind of
master filter for example in beforeFilter of app_controller.php. But i
always receive a sql error because the adaptation code column isn't
part of the other tables i wan't to filter.

What's the best way for solving this problem?

Thanks in advance.
Marco
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Complete i18n & l10n setup for language routes needed!

2009-09-08 Thread Marco

Hi guys,

I want to setup an i18n & i10n setup with language domains domain.tld/
language/controller/action/* parallel to a custom admin route named
backup.

Currently my routes.php looks like this:
Router::connect('/', array('controller' => 'pages', 'action' =>
'display', 'home'));
Router::connect('/pages/*', array('controller' => 'pages', 'action'
=> 'display'));
Router::connect('/backend', array('controller' => 'pages', 'action'
=> 'display', 'backend' => true, 'home'));
Router::connect('/:language/:controller/:action/*', array(), array
('language' => '[a-z]{3}');

The app_controller.php beforeFilter-function writes the language to
the Config array:
$lang = null;
if (!empty($this->params['language'])) {
$lang = $this->params['language'];
$this->Cookie->write('language', $lang, false, '+365 days');
} else {
$lang = $this->Cookie->read('language');
}
if (empty($lang)) {
$lang = Configure::read('Config.defaultLanguage');
}
Configure::write('Config.language', $lang);

The app_helper.php extends the url method:
if (!isset($url['language']) && isset($this->params['language'])) {
$url['language'] = $this->params['language'];
}

But the whole setup doesn't work. Does anybody have a complete setup
for my language approach?

Thanks in advance.
Marco
--~--~-~--~~~---~--~~
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: Validation for FCK Editors field

2009-09-05 Thread Marco

bhushan,

I think the problem is the text is not yet inside the textarea. Before
you validate the value you can do this:

get the content from fck:

var oEditor = FCKeditorAPI.GetInstance(instancename);
var contents = oEditor.GetXHTML(true);

validate the var contents or copy the content into your element:

document.getElementById('').value = contents

I hope this helps



On Sep 4, 7:18 am, bhushan A  wrote:
> Hi All,
>
>    I have integrated fck editor in cakephp. But unable to apply JS
> validation for that field. I have tried with
>     " document.getElementById('').value". But it is
> showing blank value though i have entered sometext in it. Please
> help.
> You can mail me on bhushanahir...@gmail.com
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



CKEditor in combination with images controller

2009-09-04 Thread Marco

Hi guys,

I'm wondering how I can combine CKEditor's image function with my own
image controller, responsible for managing image upload and image
detail data. My goal was to select from an image list provided by the
image controller from inside CKEditor's image dialog. But maybe this
is the wrong way. What would be the best practise?

Thanks in advance.
Marco
--~--~-~--~~~---~--~~
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: Simpletest Model Test Cases with HABTM Relationsships delete Tables from Test Database

2009-09-03 Thread Marco

... and added a fixture for the HABTM relationship between messages
and tags:

 array('type'=>'integer', 'null' => false, 
'length'
=> 10),
'tag_id' => array('type'=>'integer', 'null' => false, 'length' 
=>
10)
);
var $records = array(array(
'message_id' => 1,
'tag_id' => 1
));
}

?>

Marco
--~--~-~--~~~---~--~~
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: Simpletest Model Test Cases with HABTM Relationsships delete Tables from Test Database

2009-09-03 Thread Marco

Solved in a way. I added all fixtures to the Model Test Cases like
this:

var $fixtures = array('app.message', 'app.tag', 'app.user');

Marco


On 3 Sep., 14:55, Marco  wrote:
> Hi guys,
>
> I set up a really basic cake 1.2.4 project to verify a behaviour I
> observed.
>
> This is my database layout:
>
> CREATE TABLE `messages` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `text` text NOT NULL,
>   `user_id` int(10) unsigned NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
>
> CREATE TABLE `messages_tags` (
>   `message_id` int(10) unsigned NOT NULL,
>   `tag_id` int(10) unsigned NOT NULL,
>   UNIQUE KEY `message_id` (`message_id`,`tag_id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
>
> CREATE TABLE `tags` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `text` varchar(20) NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
>
> CREATE TABLE `users` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `name` varchar(100) NOT NULL,
>   `type` enum('default','admin') NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
>
> Here are my fixtures (everything made by the bake shell):
>
>  /* SVN FILE: $Id$ */
> /* Message Fixture generated on: 2009-09-03 08:06:40 : 1251958000*/
>
> class MessageFixture extends CakeTestFixture {
>         var $name = 'Message';
>         var $table = 'messages';
>         var $fields = array(
>                 'id' => array('type'=>'integer', 'null' => false, 'default' 
> => NULL,
> 'length' => 10, 'key' => 'primary'),
>                 'text' => array('type'=>'text', 'null' => false),
>                 'user_id' => array('type'=>'integer', 'null' => false, 
> 'length' =>
> 10),
>                 'indexes' => array('PRIMARY' => array('column' => 'id', 
> 'unique' =>
> 1))
>         );
>         var $records = array(array(
>                 'id'  => 1,
>                 'text'  => 'Lorem ipsum dolor sit amet, aliquet feugiat. 
> Convallis
> morbi fringilla gravida,phasellus feugiat dapibus velit nunc, pulvinar
> eget sollicitudin venenatis cum nullam,vivamus ut a sed, mollitia
> lectus. Nulla vestibulum massa neque ut et, id hendrerit sit,feugiat
> in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum
> nunc mattis convallis.',
>                 'user_id'  => 1
>         ));}
>
> ?>
>
>  /* SVN FILE: $Id$ */
> /* Tag Fixture generated on: 2009-09-03 08:06:53 : 1251958013*/
>
> class TagFixture extends CakeTestFixture {
>         var $name = 'Tag';
>         var $table = 'tags';
>         var $fields = array(
>                 'id' => array('type'=>'integer', 'null' => false, 'default' 
> => NULL,
> 'length' => 10, 'key' => 'primary'),
>                 'text' => array('type'=>'string', 'null' => false, 'length' 
> => 20),
>                 'indexes' => array('PRIMARY' => array('column' => 'id', 
> 'unique' =>
> 1))
>         );
>         var $records = array(array(
>                 'id'  => 1,
>                 'text'  => 'Lorem ipsum dolor '
>         ));}
>
> ?>
>
>  /* SVN FILE: $Id$ */
> /* User Fixture generated on: 2009-09-03 08:07:04 : 1251958024*/
>
> class UserFixture extends CakeTestFixture {
>         var $name = 'User';
>         var $table = 'users';
>         var $fields = array(
>                 'id' => array('type'=>'integer', 'null' => false, 'default' 
> => NULL,
> 'length' => 10, 'key' => 'primary'),
>                 'name' => array('type'=>'string', 'null' => false, 'length' 
> => 100),
>                 'indexes' => array('PRIMARY' => array('column' => 'id', 
> 'unique' =>
> 1))
>         );
>         var $records = array(array(
>                 'id'  => 1,
>   

Simpletest Model Test Cases with HABTM Relationsships delete Tables from Test Database

2009-09-03 Thread Marco
  $this->assertTrue(!empty($results));

$expected = array('Tag' => array(
'id'  => 1,
'text'  => 'Lorem ipsum dolor '
));
$this->assertEqual($results, $expected);
}
}
?>

User =& ClassRegistry::init('User');
}

function testUserInstance() {
$this->assertTrue(is_a($this->User, 'User'));
}

function testUserFind() {
$this->User->recursive = -1;
$results = $this->User->find('first');
$this->assertTrue(!empty($results));

$expected = array('User' => array(
'id'  => 1,
'name'  => 'Lorem ipsum dolor sit amet'
));
$this->assertEqual($results, $expected);
}
}
?>

Running the corresponding controller tests is no problem. I get a
green bar. But running the model tests fails. Running the Message
Model Test passes with no errors, but deletes the tables Messages and
Users.

I'm confused. Can anyone help?

Thanks in advance.
Marco

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



Changing datasource or database of a model during runtime

2009-08-24 Thread Marco Pietschmann

Hi,

got the following problem.

Need to combine several tables from different datasources that are
associated to each other. So far so good.

But I've got the following problem:
The data retreived from the default database defines which datasource
should be used.

Example:

Project belongsTo Customer belongsTo Address belongsTo Country
Project hasMany Invoices

The Invoices are stored in different databases depending on the
Customers country.

I tried different things with changing the datasource of the invoice
model, but since I set it with beforeFind the change only effects the
next query, not the current one and I had to start additional queries.

Since also a list of projects on one view is needed I need a solution
that changes the datasource easily during runtime, not only once at
the beginning of the lifecycle. I need a possibility to change the
models datasource after loading the default data and before the data
of the associated model is loaded.

Any ideas?

Thanks a lot,
Marco

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



Scaffolding with data in different PostgreSQL schemas

2009-08-12 Thread Antônio Marco

Hi, folks!

I'm having a problem with Scaffolding with data in different
PostgreSQL schemas.

There are 2 different PostgreSQL schemas with related tables:

- dme
- habitacao

Some habitation's tables has foreign key to dme's tables.

There are 2 different Cake application each one with your own models
but also related:

- dme
- habitacao

The problem occurs in the habitacao's INDEX action with does not print
the displayField of the dme's related models.

Make I myself clear?

Any help will be wellcome.
--~--~-~--~~~---~--~~
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: Form with saving of true/false/null

2009-08-01 Thread Antônio Marco

I would use delocalizer's idea just changing the $optarray to:

('0' => 'No', '1' => 'Yes', 'null' => 'No info')

Good look.

On Jul 31, 7:33 am, delocalizer  wrote:
> As for the coding, just use the form helper's automagic radio input:
> eg
> input('fieldname',array('type'=>'radio','options'=>
> $optarray)); ?>
> $optarray is the array of options, eg. array
> ('0'=>'No','1'=>'Yes','2'=>'No info') for the example you give.
>
> On Jul 31, 8:29 pm, delocalizer  wrote:
>
> > The other way you can approach clearing radio input groups is to add
> > some little button or widget next to each group with a javascript
> > onClick function that sets the values to empty. At least that's what I
> > do. It looks prettier & and a bit more logical than an extra radio
> > option.
>
> > cheers,
> > Conrad.
>
> > On Jul 31, 4:13 pm, Kanten  wrote:
>
> > > I have been giving this some thought and I do get what you mean, but
> > > it is very important that the user can always change e.g. an "yes"
> > > answer into "not info on subject". Database wise I think you are
> > > right, that I should define three different values (no = 0, yes = 1,
> > > no info = 2) instead of using no info = Null.
>
> > > Thank you very much for your help.
>
> > > /Anders
>
> > > On Jul 30, 9:41 am, delocalizer  wrote:
>
> > > > You sure you want an explicit third option 'no information on the
> > > > subject'? Wouldn't it be better to just have a radio group with 2
> > > > buttons (Yes/No or True/False) with a default value of NULL for that
> > > > field in your database? Or if you really want to have a third option
> > > > to force a user to enter something, mapping to a value other than
> > > > empty string or 'null' might be wise, as depending on how your db
> > > > field is defined, these may not be distinguishable from 'no data
> > > > entered'. The 'right' solution really depends on the particular logic
> > > > of your application - what data your users should enter and how that
> > > > data will be used and analysed once it's in the database.
>
> > > > On Jul 30, 12:40 am, "rich...@home"  wrote:
>
> > > > > I'd use a drop down select instead of an option group.
>
> > > > > This should do the trick:
>
> > > > > input("Model.field", array("options"=>array(""=>"No
> > > > > information on subject", true=>"True", false=>"False))); ?>
>
> > > > > On Jul 29, 12:29 pm, Kanten  wrote:
>
> > > > > > Is there really noone, that can help me with this one?
>
> > > > > > Thanks
> > > > > > Anders
>
> > > > > > On Jul 10, 1:49 pm, Kanten  wrote:
>
> > > > > > > Hi,
>
> > > > > > > I am making a database for research and for this project I have a 
> > > > > > > lot
> > > > > > > of dichotomous (binary) variables where I need to be able to
> > > > > > > discrimate between true, false and "no information on
> > > > > > > subject" (=null). I would like to store it as a bool field in 
> > > > > > > MySQL.
> > > > > > > User interface wise I was thinking of using radio buttons with the
> > > > > > > option of choosing between the three posibilities.
>
> > > > > > > Is there some easy way of doing this using the builtin form 
> > > > > > > helper, or
> > > > > > > do I need to to modify it somehow?
>
> > > > > > > Thanks
> > > > > > > Anders
--~--~-~--~~~---~--~~
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: Cakephp multilingual

2009-07-30 Thread Marco

Yannis,

I think you are using the translate behavior.

Try this everytime user changes language:

if (!class_exists('L10n')) {
App::import('Core', 'L10n');
}

$l10n = new L10n();
$l10n->get($lang);



On Jul 29, 8:37 am, Yannis  wrote:
> I can see from the  debug output that when I click on the code you
> have
> given me for changing language there is no change on the database
> request.
>
> I have tried different language codes but nothing. The only thing that
> can bring
> a change to the database is if I change the Configure::wite
> ('Config.language'...
> on the core.php or if I set the locale on the articles_controller.php
> like this
> $this->Article->locale = 'gre';
> I cannot find other way to change the language of the database query.
>
> The code you've provided for changing language:
> -
>  $currLang = Configure::read('Config.language');
> if ($currLang<>"ca" && $currLang<>"spa")
> {
>   $currLang = "ca";
>   Configure::write('Config.language',$currLang);
>
> }
>
> ?>
> "ca") ? ' ca">Català' : 'Català' ; ?>
> "spa") ? ' spa">Castellano' : 'Castellano' ; ?>
> -
> Does not work 100%. It can change the i10n language to greek but then
> it does not
> change currLang
>
> L
>
> On Jul 28, 5:17 pm, leop  wrote:
>
>
>
> > > Do I have to add something else to change the database locale?
>
> > No, I don't think so. That's all I have!
>
> > I can only suggest that you look carefully at the folder names and the
> > two or three letter acronyms to ensure that you have the correct ones
> > in the correct places.
>
> > Start with just two languages that have standard acronyms, e.g. en /
> > eng & es / spa.  That way you can be certain which goes where.
> > This page might help (it takes a while to 
> > load):http://www.sil.org/iso639-3/codes.asp?order=scope&letter=%25
>
> > L
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Changing field type in scaffold form

2009-07-24 Thread Antônio Marco

Hi, folks!

FACTS:

[1] I'm using scaffolding;
[2] I have a table wich contains a INT2 column named LEVEL. This
column accepts only values IN (0, 1, 2, 3, 4, 5, 6);
[3] When the scaffold form is shown, the LEVEL field is a simple *
TEXT type * field.

My question is:

Would be possible to change a * TEXT type * field to a * SELECT type *
field by manipulating the $this->viewVars OR setting up something in
the related model OR something else?

Notice that I do not want manually create a form.

Any help will be welcome.
--~--~-~--~~~---~--~~
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: jquery cakephp post data problem

2009-07-05 Thread Marco

I think you can try with $_POST['id']
--~--~-~--~~~---~--~~
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: Proxy server

2009-06-05 Thread Marco

Hi Fred,
I have the same problem.
Let me know if you find a solution.
Marco

On 4 Giu, 05:00, Fred  wrote:
> I am having trouble with sessions and a proxy server. My site uses
> Auth and ACL and it works fine in all my testing. However, now someone
> with Microsoft Proxy server is using it and the sessions are getting
> mixed up - when one user logs in they sometimes get another users info
> (i.e. the sessions are confused). They claim this doesn't happen on
> other web sites and if they change the computers to point through
> separate proxy servers (rather than using their array of proxies) it
> works fine.
>
> Any ideas what could cause this or how to diagnosis this since I
> cannot replicate it?
>
> Thanks.
> Fred

--~--~-~--~~~---~--~~
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: Lang in url and named parameters

2009-05-11 Thread Marco

Changing ['language'] with ['lang'] in your case

On May 11, 7:48 am, Marco  wrote:
> On May 10, 10:25 am, Pixelastic  wrote:
>
> > I want to keep the :lang parameter in the url for SEO purposes. This
> > way each ressource of my app will have a different url and my pages
> > will be indexed in all the available languages (seems logical as their
> > content will be different).
>
> You don't need an extra parameter, I think you can use this code on
> app_helper.php:
>
> class AppHelper extends Helper {
>
>    function url($url = null, $full = false) {
>         if(!isset($url['language']) && isset($this->params
> ['language'])) {
>           $url['language'] = $this->params['language'];
>         }
>
>         return parent::url($url, $full);
>    }
>
> }
>
> Seehttp://teknoid.wordpress.com/2008/11/28/cakephp-url-based-language-sw...
>
> Marco
--~--~-~--~~~---~--~~
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: Lang in url and named parameters

2009-05-11 Thread Marco

On May 10, 10:25 am, Pixelastic  wrote:
> I want to keep the :lang parameter in the url for SEO purposes. This
> way each ressource of my app will have a different url and my pages
> will be indexed in all the available languages (seems logical as their
> content will be different).
>

You don't need an extra parameter, I think you can use this code on
app_helper.php:

class AppHelper extends Helper {

   function url($url = null, $full = false) {
if(!isset($url['language']) && isset($this->params
['language'])) {
  $url['language'] = $this->params['language'];
}

return parent::url($url, $full);
   }

}

See 
http://teknoid.wordpress.com/2008/11/28/cakephp-url-based-language-switching-for-i18n-and-l10n-internationalization-and-localization/

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



An external URL pointing to the application

2009-04-02 Thread Antônio Marco

Hi folks, morning (here in Brazil)!

I'm developing an application wich sends an e-mail to a claimant. This
e-mail contains a complete URL that points to an action wich validates
the claimant's e-mail account.

The problem is I have two development environments: test (my CPU) and
production (the HTTP server).

So, how to send the correct ***domain*** in the URL, automaticaly?

CakePHP controllers has both $base and $here properties "relative to
the webroot of the application", but these properties don't solve my
problem.

Thanks for any help.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



HABTM and findAll

2009-03-12 Thread Antônio Marco

Hi!

I have an app with a few models; Claimant, Professional and
ApprovalRequisition among them.

Some of most important associations are:

- Claimant hasMany ApprovalRequisitions;
- Professional hasAndBelongsToMany ApprovalRequisition; and,
- ApprovalRequisition hasAndBelongsToMany Professional.

Starting from the ApprovalRequisition model, I need to retrieve all
Claimant's ApprovalRequisitions. Until now, no problem.

I'm using the code:

$claimant_approval_requisitions = $this->ApprovalRequisition->find(
'all',
array(
'conditions' => array(
'ApprovalRequisition.claimant_id' => $claimant_id
)
)
);

debug($claimant_approval_requisitions) shows:

Array(
[0] => Array(
[ApprovalRequisition] => Array(
[id] => 1
[created] => 2009-03-11 11:27:35
[modified] => 2009-03-11 11:27:35
[claimant_id] => 1
)

[Claimant] => Array(
[id] => 1
[created] => 2009-02-17 16:55:30
[modified] => 2009-02-17 16:55:30
)

[Professional] => Array(
[0] => Array(
[id] => 2
[created] => 2009-03-12 09:37:38
[modified] => 2009-03-12 09:37:38
[ApprovalRequisitionsProfessional] => Array(
[id] => 3
[created] => 2009-03-12 09:40:46
[modified] => 2009-03-12 09:40:46
[requisition_id] => 1
[professional_id] => 2
)
)

[1] => Array(
[id] => 1
[created] => 2009-02-17 16:55:30
[modified] => 2009-03-04 10:08:37
[ApprovalRequisitionsProfessional] => Array(
[id] => 1
[created] => 2009-03-11 11:27:35
[modified] => 2009-03-11 11:27:35
[requisition_id] => 1
[professional_id] => 1
)
)
)
)

[1] => Array(
[ApprovalRequisition] => Array(
[id] => 2
[created] => 2009-03-12 11:26:01
[modified] => 2009-03-12 11:26:01
[claimant_id] => 1
)

[Claimant] => Array(
[id] => 1
[created] => 2009-02-17 16:55:30
[modified] => 2009-02-17 16:55:30
)

[Professional] => Array(
[0] => Array(
[id] => 1
[created] => 2009-02-17 16:55:30
[modified] => 2009-03-04 10:08:37
[ApprovalRequisitionsProfessional] => Array(
[id] => 4
[created] => 2009-03-12 11:26:01
[modified] => 2009-03-12 11:26:01
[requisition_id] => 2
[professional_id] => 1
)
)
)
)
)

My problem is retrieving all Professional's ApprovalRequisitions...

Basically, I wish to retrieve *ONLY* ApprovalRequisitions that belongs
to a given Professional. Simple like that.

Yes, I know that would be much more simple starting from the
Professional model to obtain all yours ApprovalRequisitions.

Can someone help me?

Thanks a lot.


--~--~-~--~~~---~--~~
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: Directory permissions

2009-03-12 Thread Marco

Hi David,

thank you very much!!

The problem was the quotes. The behaviour I downloaded from cakephp
website uses '777' to create the directory, I use now 0775.

Thank you again for your professional help.

Marco


On Mar 12, 3:25 pm, David Persson  wrote:
> Hi Marco,
>
> Please verify that you are using 0777 or 0755 and not '0777' or
> '0755'. Pay attention to the quotes.
>
> 0777 is not the same as '0777'
> The first one is an octal integer and the second one a string.
>
> intval(0777) // is 511
> intval('0777') // is 777
>
> See:http://php.net/manual/de/language.types.integer.php
>
> -David
>
> On 12 Mrz., 17:56, Marco  wrote:
>
> > Thank you David.
>
> > I tried to modify with a leading 0 but the result is the same.
> > Your are right when you say permission 777 is not a good idea. I
> > modified with 0755 and the result is d-wxrw--wt (363)
>
> > What is the 't' at the end? Is the problem something related to the
> > server configuration?
>
> > Marco
>
> > On Mar 12, 10:01 am, David Persson  wrote:
>
> > > Hi Marco,
>
> > > You need to specify the permissions as 0777 (octal) with a leading
> > > zero:
>
> > > new Folder('/tmp/a', true, 0777);
>
> > > But be careful with that as it makes the created dir world read and
> > > writable.
> > > Seehttp://php.net/manual/en/function.chmod.phpformorinformation on
> > > modes.
>
> > > -David
>
> > > On 12 Mrz., 12:13, Marco  wrote:
>
> > > > Hello,
>
> > > > I have a problem with directories permissions created by CakePhp in a
> > > > hosting server that I never had.
> > > > The folder is created by this line of code:
>
> > > > $folder = &new Folder($path = $folderName, $create = true, $mode =
> > > > '777');
>
> > > > The folder is created with these permissions on server drx--t
>
> > > > The guys of server support told me that when CakePhp creates folders
> > > > they have Apache permission and I have to change the configuration of
> > > > CakePhp.
>
> > > > I don't know how to solve this problem.
>
> > > > Marco
--~--~-~--~~~---~--~~
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: Directory permissions

2009-03-12 Thread Marco

Thank you David.

I tried to modify with a leading 0 but the result is the same.
Your are right when you say permission 777 is not a good idea. I
modified with 0755 and the result is d-wxrw--wt (363)

What is the 't' at the end? Is the problem something related to the
server configuration?

Marco

On Mar 12, 10:01 am, David Persson  wrote:
> Hi Marco,
>
> You need to specify the permissions as 0777 (octal) with a leading
> zero:
>
> new Folder('/tmp/a', true, 0777);
>
> But be careful with that as it makes the created dir world read and
> writable.
> Seehttp://php.net/manual/en/function.chmod.phpfor mor information on
> modes.
>
> -David
>
> On 12 Mrz., 12:13, Marco  wrote:
>
> > Hello,
>
> > I have a problem with directories permissions created by CakePhp in a
> > hosting server that I never had.
> > The folder is created by this line of code:
>
> > $folder = &new Folder($path = $folderName, $create = true, $mode =
> > '777');
>
> > The folder is created with these permissions on server drx--t
>
> > The guys of server support told me that when CakePhp creates folders
> > they have Apache permission and I have to change the configuration of
> > CakePhp.
>
> > I don't know how to solve this problem.
>
> > Marco
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Directory permissions

2009-03-12 Thread Marco

Hello,

I have a problem with directories permissions created by CakePhp in a
hosting server that I never had.
The folder is created by this line of code:

$folder = &new Folder($path = $folderName, $create = true, $mode =
'777');

The folder is created with these permissions on server drx--t

The guys of server support told me that when CakePhp creates folders
they have Apache permission and I have to change the configuration of
CakePhp.

I don't know how to solve this problem.

Marco
--~--~-~--~~~---~--~~
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: l10n and Auth

2009-02-16 Thread Marco

Anyone?

On Feb 13, 4:23 pm, Marco  wrote:
> Hello,
>
> probably I'm not understanding nothing about how cakephp manage l10n.
> Why when I enable the componentAuththe function $this->L10n->get
> ('some language') doesn't work?
> WithAuthdisactivated all work fine.
>
> Thanks,
>
> Marco
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



l10n and Auth

2009-02-13 Thread Marco

Hello,

probably I'm not understanding nothing about how cakephp manage l10n.
Why when I enable the component Auth the function $this->L10n->get
('some language') doesn't work?
With Auth disactivated all work fine.

Thanks,

Marco
--~--~-~--~~~---~--~~
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: Problem with text encoding

2009-01-12 Thread Marco

Thank you very much brian and Henrique. Problem solved. All view have
to be saved with ANSI or UTF-8 without BOM, as you suggested. Even
models and controllers files.

On Jan 11, 2:54 am, Henrique Machado  wrote:
> I'm using notepad++ too
>
> Always save your file in UTF-8 Without BOM
>
> in the status bar need to appear: Ansi as UTF-8
>
> good luck
>
> 2009/1/10 brian 
>
>
>
>
>
>
>
> > It seems that you're running into the infamous UTF-8 byte-order mark
> > issue. I do all my work on Linux and am unfamiliar with Notepad++ so I
> > can't say for sure, nor give you the solution directly. I know that
> > certain versions of Homesite (well, the version one of my clients
> > used) causes this.
>
> > Search online for "UTF-8 BOM PHP" and, maybe, "notepad++" for the lowdown.
>
> > On Sat, Jan 10, 2009 at 10:28 AM, Marco  wrote:
>
> > > Hello,
>
> > > I have a strange and serious problem with two project in CakePHP 1.2.
> > > I don't know why some pages render with hidden characters in UTF8 but
> > > visible in ISO-8859. Usually they are rendered in the beginning of the
> > > page, before doctype.
> > > I'm using wamp in Windows XP and deploying in Linux, editing files in
> > > Notepad++ using UTF8 encoding.
> > > The rendering of these characters affects presentation, cache and
> > > sessions.
> > > I tried to overwrite views encoding them with different format but
> > > nothing.
> > > Any idea?
>
> > > Thanks, Marco
>
>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem with text encoding

2009-01-10 Thread Marco

Hello,

I have a strange and serious problem with two project in CakePHP 1.2.
I don't know why some pages render with hidden characters in UTF8 but
visible in ISO-8859. Usually they are rendered in the beginning of the
page, before doctype.
I'm using wamp in Windows XP and deploying in Linux, editing files in
Notepad++ using UTF8 encoding.
The rendering of these characters affects presentation, cache and
sessions.
I tried to overwrite views encoding them with different format but
nothing.
Any idea?

Thanks, Marco

--~--~-~--~~~---~--~~
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: How should I associate these tables?

2008-12-04 Thread Antônio Marco

No, I can't move all my tables to same schema.

But thanks anyway.

On 25 nov, 13:35, teknoid <[EMAIL PROTECTED]> wrote:
> I assume in that case you'll need to create a model for your join
> table (which is otherwise created for you)...
> and specify which schema (db) it uses.
> Otherwise, if you can, move them all to the same schema.
>
> On Nov 25, 7:55 am, Antônio Marco <[EMAIL PROTECTED]> wrote:
>
> > Thanks, teknoid!
>
> > But now I'm having a new problem... My applications uses tables
> > separated in different schemas.Thesetables are related one each
> > other as shown above.
>
> > I'm trying the HBTM association between "geo.plots" and
> > "dme.addresses" tables. I created the "geo.addresses_plots" table but
> > when I run my application I receives the message bellow:
>
> > Warning (2): pg_query() [function.pg-query]: Query failed: ERRO:
> > relation "addresses_plots" do not exists [CORE.rc2/libs/model/
> > datasources/dbo/dbo_postgres.php, line 152]
>
> > Can you help me once more?
>
> > I hope so.
>
> > On 24 nov, 18:50, teknoid <[EMAIL PROTECTED]> wrote:
>
> > > This is a basic HABTM (hasAndBelongsToMany) relationship.
> > > Read up on it in the manual... you should also rename the join table
> > > (if you'd like to keep consistent with conventions).
>
> > > On Nov 24, 2:40 pm, Antônio Marco <[EMAIL PROTECTED]> wrote:
>
> > > > Hi folks!
>
> > > > I created 3 tables as shown bellow:
>
> > > > CREATE TABLE geo.plots
> > > > (
> > > >   id  serial   NOT NULL,
> > > >   created timestamp,
> > > >   modifiedtimestamp,
>
> > > >   the_geomvarchar(255),
>
> > > >   inscricao_imobiliaria   varchar(14) NOT NULL,
>
> > > >   quadra  varchar(10),
> > > >   lotesmallint,
>
> > > >   numero_residencial_previo   smallint,
>
> > > >   PRIMARY KEY (id)
> > > > )
> > > > WITH OIDS;
>
> > > > CREATE TABLE geo.plot_addresses
> > > > (
> > > >   id  serial   NOT NULL,
> > > >   created timestamp,
> > > >   modifiedtimestamp,
>
> > > >   plot_id int  NOT NULL,
> > > >   address_id  int  NOT NULL,
>
> > > >   endereco_principal  bool NOT NULL DEFAULT true,
>
> > > >   PRIMARY KEY (id),
> > > >   FOREIGN KEY (plot_id) REFERENCES geo.plots (id),
> > > >   FOREIGN KEY (address_id) REFERENCES dme.addresses (id)
> > > > )
> > > > WITH OIDS;
>
> > > > CREATE TABLE dme.addresses
> > > > (
> > > >   idserial   NOT NULL,
> > > >   created   timestamp,
> > > >   modified  timestamp,
>
> > > >   habilitadobool NOT NULL DEFAULT true,
>
> > > >   street_postal_code_id int  NOT NULL,
> > > >   parent_id int,
>
> > > >   complemento   bool NOT NULL DEFAULT false,
>
> > > >   numerosmallint,
>
> > > >   bloco varchar(10),
> > > >   andar smallint,
> > > >   unidade   smallint,
>
> > > >   posicao   smallint,
>
> > > >   caixa_postal  smallint,
>
> > > >   complemento_livre varchar(255),
>
> > > >   PRIMARY KEY (id),
>
> > > >   FOREIGN KEY (street_postal_code_id) REFERENCES
> > > > dme.street_postal_codes (id),
> > > >   FOREIGN KEY (parent_id) REFERENCES dme.addresses (id)
> > > > )
> > > > WITH OIDS;
>
> > > > They are associated as shown bellow:
>
> > > > //
> > > > class Plot extends AppModel {
> > > > var $name = 'Plot';
>
> > > > var $useDbConfig = 'geo';
>
> > > > var $hasMany = array(
> > > > 'PlotAddresses' => array(
> > > > 'className'  => 'PlotAddress',
> > > > 'foreignKey' => 'plot_id'
&

Re: How should I associate these tables?

2008-11-27 Thread Antônio Marco

No, I don't move all my tables to same schema.

But thanks anyway.

On 25 nov, 13:35, teknoid <[EMAIL PROTECTED]> wrote:
> I assume in that case you'll need to create a model for your join
> table (which is otherwise created for you)...
> and specify which schema (db) it uses.
> Otherwise, if you can, move them all to the same schema.
>
> On Nov 25, 7:55 am, Antônio Marco <[EMAIL PROTECTED]> wrote:
>
> > Thanks, teknoid!
>
> > But now I'm having a new problem... My applications uses tables
> > separated indifferentschemas. These tables are related one each
> > other as shown above.
>
> > I'm trying the HBTM association between "geo.plots" and
> > "dme.addresses" tables. I created the "geo.addresses_plots" table but
> > when I run my application I receives the message bellow:
>
> > Warning (2): pg_query() [function.pg-query]: Query failed: ERRO:
> > relation "addresses_plots" do not exists [CORE.rc2/libs/model/
> > datasources/dbo/dbo_postgres.php, line 152]
>
> > Can you help me once more?
>
> > I hope so.
>
> > On 24 nov, 18:50, teknoid <[EMAIL PROTECTED]> wrote:
>
> > > This is a basic HABTM (hasAndBelongsToMany) relationship.
> > > Read up on it in the manual... you should also rename the join table
> > > (if you'd like to keep consistent with conventions).
>
> > > On Nov 24, 2:40 pm, Antônio Marco <[EMAIL PROTECTED]> wrote:
>
> > > > Hi folks!
>
> > > > I created 3 tables as shown bellow:
>
> > > > CREATE TABLE geo.plots
> > > > (
> > > >   id  serial   NOT NULL,
> > > >   created timestamp,
> > > >   modifiedtimestamp,
>
> > > >   the_geomvarchar(255),
>
> > > >   inscricao_imobiliaria   varchar(14) NOT NULL,
>
> > > >   quadra  varchar(10),
> > > >   lotesmallint,
>
> > > >   numero_residencial_previo   smallint,
>
> > > >   PRIMARY KEY (id)
> > > > )
> > > > WITH OIDS;
>
> > > > CREATE TABLE geo.plot_addresses
> > > > (
> > > >   id  serial   NOT NULL,
> > > >   created timestamp,
> > > >   modifiedtimestamp,
>
> > > >   plot_id int  NOT NULL,
> > > >   address_id  int  NOT NULL,
>
> > > >   endereco_principal  bool NOT NULL DEFAULT true,
>
> > > >   PRIMARY KEY (id),
> > > >   FOREIGN KEY (plot_id) REFERENCES geo.plots (id),
> > > >   FOREIGN KEY (address_id) REFERENCES dme.addresses (id)
> > > > )
> > > > WITH OIDS;
>
> > > > CREATE TABLE dme.addresses
> > > > (
> > > >   idserial   NOT NULL,
> > > >   created   timestamp,
> > > >   modified  timestamp,
>
> > > >   habilitadobool NOT NULL DEFAULT true,
>
> > > >   street_postal_code_id int  NOT NULL,
> > > >   parent_id int,
>
> > > >   complemento   bool NOT NULL DEFAULT false,
>
> > > >   numerosmallint,
>
> > > >   bloco varchar(10),
> > > >   andar smallint,
> > > >   unidade   smallint,
>
> > > >   posicao   smallint,
>
> > > >   caixa_postal  smallint,
>
> > > >   complemento_livre varchar(255),
>
> > > >   PRIMARY KEY (id),
>
> > > >   FOREIGN KEY (street_postal_code_id) REFERENCES
> > > > dme.street_postal_codes (id),
> > > >   FOREIGN KEY (parent_id) REFERENCES dme.addresses (id)
> > > > )
> > > > WITH OIDS;
>
> > > > They are associated as shown bellow:
>
> > > > //
> > > > class Plot extends AppModel {
> > > > var $name = 'Plot';
>
> > > > var $useDbConfig = 'geo';
>
> > > > var $hasMany = array(
> > > > 'PlotAddresses' => array(
> > > > 'className'  => 'PlotAddress',
> > > > 'foreignKey' => 'plot_id'
&

Re: How should I associate these tables?

2008-11-25 Thread Antônio Marco

Thanks, teknoid!

But now I'm having a new problem... My applications uses tables
separated in different schemas. These tables are related one each
other as shown above.

I'm trying the HBTM association between "geo.plots" and
"dme.addresses" tables. I created the "geo.addresses_plots" table but
when I run my application I receives the message bellow:

Warning (2): pg_query() [function.pg-query]: Query failed: ERRO:
relation "addresses_plots" do not exists [CORE.rc2/libs/model/
datasources/dbo/dbo_postgres.php, line 152]

Can you help me once more?

I hope so.

On 24 nov, 18:50, teknoid <[EMAIL PROTECTED]> wrote:
> This is a basic HABTM (hasAndBelongsToMany) relationship.
> Read up on it in the manual... you should also rename the join table
> (if you'd like to keep consistent with conventions).
>
> On Nov 24, 2:40 pm, Antônio Marco <[EMAIL PROTECTED]> wrote:
>
> > Hi folks!
>
> > I created 3 tables as shown bellow:
>
> > CREATE TABLE geo.plots
> > (
> >   id  serial   NOT NULL,
> >   created timestamp,
> >   modifiedtimestamp,
>
> >   the_geomvarchar(255),
>
> >   inscricao_imobiliaria   varchar(14) NOT NULL,
>
> >   quadra  varchar(10),
> >   lotesmallint,
>
> >   numero_residencial_previo   smallint,
>
> >   PRIMARY KEY (id)
> > )
> > WITH OIDS;
>
> > CREATE TABLE geo.plot_addresses
> > (
> >   id  serial   NOT NULL,
> >   created timestamp,
> >   modifiedtimestamp,
>
> >   plot_id int  NOT NULL,
> >   address_id  int  NOT NULL,
>
> >   endereco_principal  bool NOT NULL DEFAULT true,
>
> >   PRIMARY KEY (id),
> >   FOREIGN KEY (plot_id) REFERENCES geo.plots (id),
> >   FOREIGN KEY (address_id) REFERENCES dme.addresses (id)
> > )
> > WITH OIDS;
>
> > CREATE TABLE dme.addresses
> > (
> >   idserial   NOT NULL,
> >   created   timestamp,
> >   modified  timestamp,
>
> >   habilitadobool NOT NULL DEFAULT true,
>
> >   street_postal_code_id int  NOT NULL,
> >   parent_id int,
>
> >   complemento   bool NOT NULL DEFAULT false,
>
> >   numerosmallint,
>
> >   bloco varchar(10),
> >   andar smallint,
> >   unidade   smallint,
>
> >   posicao   smallint,
>
> >   caixa_postal  smallint,
>
> >   complemento_livre varchar(255),
>
> >   PRIMARY KEY (id),
>
> >   FOREIGN KEY (street_postal_code_id) REFERENCES
> > dme.street_postal_codes (id),
> >   FOREIGN KEY (parent_id) REFERENCES dme.addresses (id)
> > )
> > WITH OIDS;
>
> > They are associated as shown bellow:
>
> > //
> > class Plot extends AppModel {
> > var $name = 'Plot';
>
> > var $useDbConfig = 'geo';
>
> > var $hasMany = array(
> > 'PlotAddresses' => array(
> > 'className'  => 'PlotAddress',
> > 'foreignKey' => 'plot_id'
> > )
> > );
>
> > }
>
> > //
> > class PlotAddress extends AppModel {
> > var $name = 'PlotAddress';
>
> > var $useDbConfig = 'geo';
>
> > var $belongsTo = array(
> > 'Plot' => array(
> > 'className'  => 'Plot',
> > 'foreignKey' => 'plot_id'
> > ),
>
> > 'Address' => array(
> > 'className'  => 'Address',
> > 'foreignKey' => 'address_id'
> > )
> > );
>
> > }
>
> > //
> > class Address extends AppModel {
> > var $name = 'Address';
>
> > var $useDbConfig = 'dme';
>
> > var $hasOne = array(
> > 'PlotAddress' => array(
> > 'className' => 'PlotAddress',
> > 'foreignKey' => 'address_id'
> > )
> > );
>
> > }
>
> > I have used Scaffolding in this application but when I run the index
> > of PlotAddresses, I receive the message bellow:
>
> > Notice (8): Undefined index:  Address [CORE.rc2/libs/view/scaffolds/
> > index.ctp, line 81]
>
> > Verifing the line, I saw that the problem is related to "belongTo"
> > association.
>
> > Can anybody help me to solve this problem? Is my association
> > incorrect?
>
> > Thanks a lot.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How should I associate these tables?

2008-11-24 Thread Antônio Marco

Hi folks!

I created 3 tables as shown bellow:

CREATE TABLE geo.plots
(
  id  serial   NOT NULL,
  created timestamp,
  modifiedtimestamp,

  the_geomvarchar(255),

  inscricao_imobiliaria   varchar(14) NOT NULL,

  quadra  varchar(10),
  lotesmallint,

  numero_residencial_previo   smallint,

  PRIMARY KEY (id)
)
WITH OIDS;

CREATE TABLE geo.plot_addresses
(
  id  serial   NOT NULL,
  created timestamp,
  modifiedtimestamp,

  plot_id int  NOT NULL,
  address_id  int  NOT NULL,

  endereco_principal  bool NOT NULL DEFAULT true,

  PRIMARY KEY (id),
  FOREIGN KEY (plot_id) REFERENCES geo.plots (id),
  FOREIGN KEY (address_id) REFERENCES dme.addresses (id)
)
WITH OIDS;

CREATE TABLE dme.addresses
(
  idserial   NOT NULL,
  created   timestamp,
  modified  timestamp,

  habilitadobool NOT NULL DEFAULT true,

  street_postal_code_id int  NOT NULL,
  parent_id int,

  complemento   bool NOT NULL DEFAULT false,

  numerosmallint,

  bloco varchar(10),
  andar smallint,
  unidade   smallint,

  posicao   smallint,

  caixa_postal  smallint,

  complemento_livre varchar(255),

  PRIMARY KEY (id),

  FOREIGN KEY (street_postal_code_id) REFERENCES
dme.street_postal_codes (id),
  FOREIGN KEY (parent_id) REFERENCES dme.addresses (id)
)
WITH OIDS;

They are associated as shown bellow:

//
class Plot extends AppModel {
var $name = 'Plot';

var $useDbConfig = 'geo';

var $hasMany = array(
'PlotAddresses' => array(
'className'  => 'PlotAddress',
'foreignKey' => 'plot_id'
)
);
}

//
class PlotAddress extends AppModel {
var $name = 'PlotAddress';

var $useDbConfig = 'geo';

var $belongsTo = array(
'Plot' => array(
'className'  => 'Plot',
'foreignKey' => 'plot_id'
),

'Address' => array(
'className'  => 'Address',
'foreignKey' => 'address_id'
)
);
}

//
class Address extends AppModel {
var $name = 'Address';

var $useDbConfig = 'dme';

var $hasOne = array(
'PlotAddress' => array(
'className' => 'PlotAddress',
'foreignKey' => 'address_id'
)
);
}

I have used Scaffolding in this application but when I run the index
of PlotAddresses, I receive the message bellow:

Notice (8): Undefined index:  Address [CORE.rc2/libs/view/scaffolds/
index.ctp, line 81]

Verifing the line, I saw that the problem is related to "belongTo"
association.

Can anybody help me to solve this problem? Is my association
incorrect?

Thanks a lot.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Reserved words

2008-10-10 Thread Antônio Marco

Hi, there!

Is "Plot" a CakePHP reserved word?

I'm receiving the message below:

Notice (8): Undefined index:  Plot [CORE/libs/view/scaffolds/
index.ctp, line 56]

When I change the "Plot" to another one the message goes out.

Thanks a lot.

--~--~-~--~~~---~--~~
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 Cake model relations (hasMany, belongsTo, etc)

2007-09-24 Thread Marco

If I undestood wll your need, it should be enough to define 'username'
as displayField for the user model:

model user
var $displayField = 'username';
User hasMany Note
User hasMany Followup

On 24 Set, 16:44, jwerd <[EMAIL PROTECTED]> wrote:
> I'm using 1.2.x (latest SVN from trunk) fyi.
>
> Anyways I've set up a notes system to keep track of my notes
> internally, which is scaling to be quite efficient for what I need /
> what.  Now here is my dilema.  I have three tables:
>
> notes
> id
> title
> body
> created
> user_id
>
> users
> id
> username
> password
>
> followups
> id
> comment
> user_id
> note_id
> created
>
> I believe I'm following the Cake style table layout and structure
> because most of my relations work.  The followups table is supposed to
> like comments on the note.
>
> Anyways when I'm viewing a note that has follow ups it appears below
> the note's properties and says Related Followups and it's a list of
> all the connected followups to that note.  Now the thing is here is
> what it looks like (from scaffolding)
>
> |Comment| --- | User | Note | Action
> |
> |This is doable, don't worry  | 1  | 1  | View,
> Edit, Delete |
>
> The problem is, I can't seem to change that 1 to the actual username
> and I'm not sure how without writing a custom sql query to handle the
> entire fetching of the followups to notes relationship.
>
> Can someone please help me out?  Here's my cake relationship layout
>
> model user
> User hasMany Note
> User hasMany Followup
>
> model followup
> Followup belongsTo Note
> Followup belongsTo User
>
> model note
> Note belongsTo User
> Note hasMany Followup
>
> I'm not asking for someone to completely write my script just to lend
> a helping hand as to if it's doable with the cake relations or do I
> have to custom query this certain thign I want.
>
> thanks for your time appreciate any response i get.


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



YACCA: My first article on bakery

2007-03-23 Thread marco

Hello all I have written my first article on bakery and i am waiting
for publish.
I dunno if it were ever published,  if anyone wants a preview can go
here.

http://blog.nospace.net/?p=8


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



R: Class dependence and overriding Methods to do garbage collection on files

2007-03-17 Thread Marco \(GMail\)

Looking at the Api the beforedelete function is cahined from the del 
function del($id = null, $cascade = true) {
00957 if ($id) {
00958 $this->id = $id;
00959 }
00960 
00961 $id = $this->id;
00962 
00963 if ($this->exists() && $this->beforeDelete()) { 

As you can see on line 958 the passed id is assigned to model->id 

Then you can surely write

function beforeDelete() {
$photo = $this->Photo->findById($this->id); // NOTE $this->id
instead of $id

$file_path = substr($photo['Photo']['file_path'], 1); // remove the
leading slash for cake
// Code from Chris Partridge:
if($file = new File($file_path)) {
if(!$file->delete()) {
trigger_error('delete error');
return false;
}
} else {
return false;
}
return true;
}

-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di Joshua McFarren
Inviato: sabato 17 marzo 2007 19.49
A: Cake PHP
Oggetto: Re: Class dependence and overriding Methods to do garbage
collection on files


> I'm new to cake so I may not be 100% right, but why not you create a
> beforeDelete() method in your Photo model? Use this delete the 
> associated image file.

This looked promising until i realized that I need the $id to get the file
path of the photo and delete it. I would need to put something like this in
my Model:

function beforeDelete($id) {
$photo = $this->Photo->findById($id);
$file_path = substr($photo['Photo']['file_path'], 1); // remove the
leading slash for cake
// Code from Chris Partridge:
if($file = new File($file_path)) {
if(!$file->delete()) {
trigger_error('delete error');
return false;
}
} else {
return false;
}
return true;
}

Unfortunately, looking at the API the beforeDelete method takes no arguments
when its called by del:

http://api.cakephp.org/model__php4_8php-source.html#l00956

So how would my beforeDelete method know what to do?

Is this a dead end or am I wrong?




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



R: Format ID field throughout

2007-03-17 Thread Marco \(GMail\)

 All ok  but you must return $results ;-)
 function afterFind($results) {
  foreach ($results as $result_id => $result) {
$results[$result_id]['Model']['id'] = 'FLW' . $result['Model'] ['id'];
  }
  return $results; // <<
}

-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di djiize
Inviato: sabato 17 marzo 2007 19.35
A: Cake PHP
Oggetto: Re: Format ID field throughout


try to play with the Model's function afterFind

A quick try, in your model:
function afterFind($results) {
  foreach ($results as $result_id => $result) {
$results[$result_id]['Model']['id'] = 'FLW' . $result['Model'] ['id'];
  }
}

On 17 mar, 13:30, "Mike Digital Egg" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am looking for the best way to format an ID field every time it 
> appears, without having to specifcally tell it to. Let me explain a 
> bit further:
>
> I have a table called Projects, each project has an ID (numeric auto
> increment) so a typical output from a db call would be:
>
> ID, Project Name, Owner, Created
> 1,My Project,Mike,14/03/2007
> 2,My Second Project,Nigel,16/03/2007
>
> Idealy I would like to transform the ID field output to something
> like:
>
> FWL0001
> FWL0002
>
> I know this can be done easily in the view, but what if I could make 
> the model output the ID in this format every time.
>
> I think this is possible in RoR but I'm not sure how to do it in Cake, 
> is this what the 'behaviors' folder is for in the model folder?
>
> Any help would be appreciated.
>
> Cheers
>
> Mike




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



R: Any diagram to sql DDL script generator for MySQL?

2007-02-16 Thread Marco \(GMail\)

Try this

http://fabforce.net/dbdesigner4/

 

-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di [EMAIL PROTECTED]
Inviato: venerdì 16 febbraio 2007 22.28
A: Cake PHP
Oggetto: Re: Any diagram to sql DDL script generator for MySQL?



The MySQL tools aren't bad, but I've also used Access a fair bit.
http://dev.mysql.com/downloads/gui-tools/5.0.html

The problem with Access is some slight compatibility issues with field
types, especially date/time.

phpMyAdmin is what I now use the most.

http://www.phpmyadmin.net/home_page/index.php

On Feb 17, 7:26 am, "einzeln" <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm new to LAMP and cake, trying to make a project from scratch. Is 
> there any GUI database creating tools from ER diagram recommended? So 
> i can work out my DB table definitions like in M$ Access, to jump into 
> baking rapidly.
>
> Thanks 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
-~--~~~~--~~--~--~---



R: Custom Scaffold view

2007-02-06 Thread Marco \(GMail\)

This is tested and work :)

action == 'index') {
  unset($this->viewVars['fieldNames']['field01'];
  unset($this->viewVars['fieldNames']['field02'];
  unset($this->viewVars['fieldNames']['field03'];
}
return true;
  }
  
}
?>

-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di Petry
Inviato: martedì 6 febbraio 2007 18.45
A: Cake PHP
Oggetto: Custom Scaffold view


Hi all

I have a table with 5 fields, and I temporary use scaffold for  list, edit
and delete functions. But in list view, all field are visible.
Why i set some items to invisible, only on list view?




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



R: Custom Scaffold view

2007-02-06 Thread Marco \(GMail\)

Excuse me for double posting but there is a typo in the preceding message
This is tested and work :)

action == 'index') {
  unset($this->viewVars['fieldNames']['field01']);
  unset($this->viewVars['fieldNames']['field02']);
  unset($this->viewVars['fieldNames']['field03']);
}
return true;
  }
  
}
?> 

-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di Petry
Inviato: martedì 6 febbraio 2007 18.45
A: Cake PHP
Oggetto: Custom Scaffold view


Hi all

I have a table with 5 fields, and I temporary use scaffold for  list, edit
and delete functions. But in list view, all field are visible.
Why i set some items to invisible, only on list view?




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



R: Pluralisation and bake error

2007-01-26 Thread Marco \(GMail\)

In /app/config/inflections.php add all words that you want uninflected

For examples I think this can solve your problem

$uninflectedPlural = array('competencia'); 

-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di albertordz
Inviato: sabato 27 gennaio 2007 2.17
A: Cake PHP
Oggetto: Re: Pluralisation and bake error


Hope this help you:
I had the same error, I got a Model named Reactivo which is associated with
model Competencia this way: Reactivo belongsTo Competencia Competencia has
the $displayField = 'competencia' declared variable and I realized that cake
was trying to singularize competencia into competencium (I don't know why)
What I did was to delete the line 181 from cake/libs/inflector

'/([ti])a$/i' => '\1um',

and now everything is ok




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



R: Ready to upload cakePHp files to my Hostgator account.

2007-01-26 Thread Marco \(GMail\)

I prefer this type of layout:

For single application
/Httpdocs
   /CakeCore
   /app
   /www

For multiple application on same web site
/Httpdocs
   /CakeCore
   /Application01
 /app
 /www
   /Application02
 /app
 /www

-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di beetlecube
Inviato: venerdì 26 gennaio 2007 21.51
A: Cake PHP
Oggetto: Ready to upload cakePHp files to my Hostgator account.


HI,
  I have a question about folder organization of a CakePHp installation.

  I'm about to upload my cakephp files to my Hostgator "baby croc"
Shared server space.

 In the CAkePHP manual, the suggested folder structure is:

../path_to_cake_install
/app
/controllers
/models
/webroot <-- Should be DocumentRoot
.htaccess
index.php

Should I send a Support Email to Hostgator that I need to have the
httpd.conf changed for rmy account, so that my webroot is
"Mydomain.com/app/webroot"  ?

I really have no particular way that I prefer the folder organization to be.

I just want it to work, basically,  and preferably with the mod_rewrite
enabled, so that I don't have to stick that "index.php" in the middle
of everything.But if I do have to use the "index.php" inside the
URL,  no big deal even.

( if anyone has a method by which I need to rely on H.G. support as little
as possible, please let me know. )

Thanks, Steve




--~--~-~--~~~---~--~~
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: Component vs. AppController vs. requestAction

2007-01-26 Thread marco

Hello All folks this is my first post.
I'm using cakephp for a intranet project in my company.
In my opinion the requestAction is the best method to mantain code
readability with large projects.
In my approach:
1. Every controller maps its own model for CRUD:
2. Expose methods like read, find, generatelist etc for interprocess
call.
for example in {Users Controller} that uses {User Model} I have the
function read($id) to return data to everyone needs a user record.
Really you don't need to declare the function in every controller but
you can easily  move the logic in app_controller with something like

function read( $id=null ) {
  // Its only an example
  if($id) {
$this->{$this-modelclass}->id = $id;
return $this->{$this-modelclass}->read();
  }
  return null;
}

It's my opinion would be glad to see yours
cheers.
Marco

On Jan 19, 2:53 am, "nate" <[EMAIL PROTECTED]> wrote:
> I generally discourage the use ofrequestActionunless you have some
> specific reason to do so, and there are a few, i.e. if view code is
> involved (well, in that case you'd probably be using it *in* a view
> anyway).
>
> Basically, if you have a set of methods that could logically be grouped
> in an object, a component is the way to go.  Otherwise, go with 
> anAppControllermethod.


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



Cake 1.2,HABTM relations and the Form Helper

2007-01-26 Thread Marco

Hi,

I am fairly new to Cake and currently are trying to get some things to
work with Cake 1.2. Generally, everything looks nice and
straight-forward, so I have to say, I really like Cake.

Now, my problem:

I have two models (Product and Group), where each product can belong to
one or more groups, so it is modelled as a HABTM relation.

// MODELS:

// Product:

class Product extends AppModel {
var $name = 'Product';
var $hasAndBelongsToMany = array(
'Group' => array(
'className' => 'Group',
'joinTable' => 'groups_products',
'foreignKey' => 'product_id',
'associationForeignKey' => 'group_id'
)
);
}

// Group:

class Group extends AppModel {
var $name = 'Group';
var $hasAndBelongsToMany = array(
'Product' => array(
'className' => 'Product',
'joinTable' => 'groups_products',
'foreignKey' => 'group_id',
'associationForeignKey' => 'product_id',
'order' => 'Product.bot ASC'
)
);
}

If I use scaffolding for the products controller, I get an edit action
that is working out-of-the-box, it displays a select box for groups,
the currently related groups pre-selected.

Now i wanted to write my own edit action for products, and tried this
as a start:

// Controller:

class ProductsController extends AppController {

var $name = 'Products';
var $scaffold;
var $helpers = array('Html', 'Form');
var $uses = array('Product','Group');

function edit($id) {
$this->Product->id = $id;
$this->data = $this->Product->read();
$fields = $this->generateFieldNames();
$this->set('fieldnames', $fields);
$this->set('data',$this->data);
}
}

// View edit.thtml

echo $form->create('Product');
echo $form->inputs($fieldnames);
echo $form->end();

This generates the same fields as when using scaffolding, but the
related groups are NOT preselected (all other inputs have the correct
values set for the given ID).

Then, I tried to generate the fields "by hand", so my view looks like
this:

// View edit.thtml

echo $form->create('Product');
echo $form->input('bot');
echo $form->input('Group/Group');
echo $form->end();

It generates an text input for field 'bot' and populates it with
correct data. It then creates it with another text input, which is
empty.

How can I generate a multiple select field, that contains the correct
group names from groups-table and preselects the right values?

Btw, if I output $data in the view, it contains the correct
information, for the selected product and the associated group(s).

Any hints? Do you need more information?

TIA, Marco


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