Thursday, December 31, 2009

Hi

I raise my question first:

How to remove the query table that is below of all my page, it shows
some query and " Nr Query Error Affected Num. rows Took (ms)" like
that.
I built my first blog application and i was wondering how to remove
the below table,

I am very new to cakePHP, but I know my question is very easy.
I didn't know the correct name of it, i searched for "default remove
table query" and similars but no help.

can you help me?

Saran

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Out of office reply

Hi,

I am out the office until the 14th of January. If you require urgent assistance then please contact pete@citadelsecure.com or call him on 07890 592198 - otherwise I will answer your email on my return.

Regards

Jim


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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: anybody tried the 1.3 console yet

To add in new bake templates use a non 'default' directory for your
templates. They would go in vendors/shells/templates/<yourtemplate>
and use the same directories as the core default templates do. If you
don't supply all the templates the core templates will be used as a
fallback.

-Mark

On Dec 30, 7:38 pm, euromark <dereurom...@googlemail.com> wrote:
> this now seems to be fixed in the current HEAD version
>
> but:
> in 1.3 the templates have a different folder structure
>
> \cake\console\templates\default
> - actions
> - classes
> - views
>
> instead of just
> - default
> (<= 1.2)
>
> does anyone know how to override the core template files from the app
> or even the global vendors folder?
> is it:
>     \app\vendors\shells\templates\default
> and for several apps:
>     \vendors\shells\templates\default
> with the corresponding subfolders? does not seem to work anyway.
>
> i thought cake first looks in \app\vendors\shells
> then in \vendors\shells and finally in the default folder in \cake
>
> but right now neither "app" nor "vendors" would override the default
> templates
> only modifying the core files directly does
>
> thx in advance
> mark
>
> On 21 Dez., 20:44, euromark <dereurom...@googlemail.com> wrote:
>
>
>
> > after switching the core folder from 1.2 to 1.3 the console of course
> > is now 1.3 as well
>
> > but where does 1.3 "cake bake" save/get the lists of database tables
> > now?
> > it does not seem to cake them out of the tmp/cache/models folder -
> > therefore my new tables cannot be found in the console - although i
> > cleared the cache folder completely
> > in 1.2 this was enough to regenerate the array of all available
> > tables...
>
> > after switching back to 1.2 the new tables appeared again in the
> > console
>
> > thx

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: testing a controller's add action

I don't have an issue if someone wants to copy/paste/modify the
article I wrote into the book. There is no need to file tickets about
improving the documentation on testing, you can simply edit/add to the
existing documentation instead. testAction as you are aware is
exceptionally limited in what it is capable of doing, and regular
testing methods are clearer and easier to work with.

I also use mocks in my controller tests, and covered using mocks in a
different post too. http://www.mark-story.com/posts/view/testing-cakephp-controllers-mock-objects-edition.
I find I usually mock Auth, Session and Email components as they are
the most disruptive to automated testing.

As for planned improvements to the test suite, I didn't really have
much planned, there are some fixes and improvements to be done with
the code coverage, but as far as making controller testing easier, I
didn't have anything planned.

-Mark

On Dec 29, 4:04 am, Lorenzo Bettini <bett...@dsi.unifi.it> wrote:
> Thanks for all the information!
>
> Let's see how testing is in the next release, and in particular the
> documentation; as for proposing an alternative in the book I guess I
> should file a ticket, right?
>
> For the moment I'm testing controllers' actions the "hard way" :)
>
> cheers
>         Lorenzo
>
>
>
>
>
> nurvzy wrote:
> > Lorenzo Bettini <bett...@dsi.unifi.it> wrote:
> >> I'm not getting errors: as I said before, I can see that data is not
> >> populated using the debugger, and also because it executes the
> >> instructions to be executed when data is null; thus it basically does
> >> not faulter, it simply does not get any data...  can it be a bug?
>
> > It's possible, I never had a whole lot of luck with testAction other
> > than just really basic tests, as such I almost never use it.  It's
> > possible we're missing something really simple.  /shrug.  testAction
> > does a lot of the 'magic' on it own, but I prefer doing things in such
> > a way I have complete control over the test -- less surprises that
> > way.  I read, in 1.3/2.0 the testsuite is getting a major makeover.
>
> >> yes, with the instructions in this post I can successfully test mycontroller'sadd and edit actions.
>
> >> But I guess the documentation of cakephp should be updated to include
> >> such way oftestingcontrollers, especially since testAction, as you
> >> also noticed, is not powerful enough (and probably buggy due to the
> >> missing data ;)
>
> > I agree, I like the way Mark tests his controllers, it makes a lot
> > more sense to me.   If you're feeling generous go ahead and post an
> > alternative in the Book, they always like people helping them make the
> > documentation better.
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

When I use Media View ,my session deleted

i use my custom auth system in my project and it save user
informatin into session(no used Auth Component)


$this->Session->write( 'Cms.User', array (...) );


when is use This Code


function profile_donwload( $paperID )
{
if ( $file = $this->Paper->Attachment->read( null, $paperID ) )
{
$this->view = 'Media';
$params = array(
'id' => 'paper.'.$file['Attachment']['format'],
'name' => $file['Attachment']['fname'],
'download' => true,
'extension' => $file['Attachment']['format'],
'path' => WWW_ROOT .'data'.DS.$file['Attachment']
['for'].DS.$file['Attachment']['paper_id'].DS
);
$this->set($params);
}
}


after Downloading file or Canceling it ,my session's deleted,why ?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Temp data question

Hi Dave,

> Thanks for the inspiration...

Happy to help :)

Happy new year Cakers :)

--
jon bennett - www.jben.net - blog.jben.net

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Need direction - passing data between users

If anyone can provide me with some direction here I would greatly
appreciate it. I am not a super experienced programmer but I can
usually figure everything out if I have a general direction.

Lets say you have 2 users that randomly generate three numbers each.
User 1 selects a number and passes the remaining two numbers to User
2, who in turn does the same until both users have selected three
numbers.

I have the randomization and everything in place for a single user,
but to have more than one user do I need to use Sessions? I have been
doing some reading and from what I can deduce cakePHP is something I
could use to help with this but I'm not entirely sure. Can anyone
possibly point me in the right direction?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Managing lots of components? Namespaces? PEAR?

I was thinking of making an upgrade to PHP 5.3.1 and using the
namespace support. Any suggestions? I imagine App::import would work
fine, no?

Does anybody have any other suggestions for managing lots of
components? The PEAR method violates cake naming conventions.

Please let me know if anybody has a good solution for managing many
components across many modules.

Thanks

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: UML

thanks

On Dec 31, 12:17 am, Abdul Rahman Riza <abdulrahmanr...@gmail.com>
wrote:
> try Umbrello
>
> 2009/12/31 Josh <joshs.silver...@gmail.com>
>
>
>
> > Does anybody have a recommendation for a good UML tool? Do many of you
> > make UML diagrams of your more complex web apps?
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: i18n and anonymous surfers - bug?

thats it :)

actually, you need to put it in
__construct()

as beforeFilter() is not invoked on errors (404 etc)
otherwise it would print the error layout without translation

PS: i still think this is a bug as it should always fall back to the
default language set in configs

mark

On 31 Dez., 11:01, John Andersen <j.andersen...@gmail.com> wrote:
> Using CakePHP 1.2.5 with medium security.
>
> anonymouse.org removes the HTTP_ACCEPT_LANGUAGE information from the
> browser, thus CakePHP can't determine the default language to use.
>
> Add the code below to the AppController beforeFiler method to ensure
> that a default language is used.
> [code]
>       if ( !isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) {
>           Configure::write('Config.language', 'eng'); // <== my
> default language!
>       }
> [/code]
>
> That works with my development site. Enjoy,
>    John
>
> On Dec 31, 12:42 am, euromark <dereurom...@googlemail.com> wrote:
>
>
>
> > i should probably add:
> > security level is to low (as there are strange happening with higher
> > security levels anyway)
>
> > if nobody has a reason/solution i am forced to open a ticket for this
> > i guess
>
> > On 30 Dez., 15:47, euromark <dereurom...@googlemail.com> wrote:
>
> > > right
> > > i think this must be some bug in the core
> > > although i could not figure out where it happens
>
> > > my version is the 1.3 head right now
>
> > > On 30 Dez., 11:08, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > > I can confirm this. Just tried it with my development site, which
> > > > works well in english and danish, depending on the language
> > > > information received from the browser.
> > > > With anonymouse.org this completely does not work, nothing is
> > > > translated.
> > > > Enjoy,
> > > >    John
>
> > > > On Dec 29, 5:38 am, euromark <dereurom...@googlemail.com> wrote:
>
> > > > > i would have never found that out if i hadnt built myself a bot-
> > > > > tracking component
> > > > > it basically logs all non-js-browsing and tries to detect if it was a
> > > > > known search bot
>
> > > > > anyway
> > > > > this way i found out that my website has been visited by users usinghttp://anonymouse.org/
>
> > > > > i tried it out myself and was really shocked that i18n doesnt work
> > > > > anymore
> > > > > from my understanding it uses (at least in cakephp1.2 it did and
> > > > > should do it in 1.3)
> > > > > a) define('MY_DEFAULT_LANGUAGE','de');
> > > > > b) Configure::write('Config.language', 'de-de')
>
> > > > > right now it does not translate at all if you visit it via services
> > > > > like anonymouse.org
> > > > > neither english nor german nor any other language
>
> > > > > Configure::read('Config.language') returns NULL (and was definitely
> > > > > set before)
> > > > > which could lead to the false assumption that my website is not german
> > > > > (although its the main language - and the only present language in the
> > > > > po files!), or even worse: buggy and defect. i mean, the untranslated
> > > > > strings are appearing...
>
> > > > > after some research i found out that this service scambles the cookies
> > > > > before passing them to the cake app
> > > > > so this might have something to do with it - it is probably like
> > > > > cookies beeing deactivated
>
> > > > > right now i intercept any call from this service via 406 error code
> > > > > and the message "With such services the page cannot be displayed
> > > > > properly"
> > > > > but it should probably get fixed somehow
> > > > > the "primary" language should always be active - even with cookies off
> > > > > etc
> > > > > any ideas?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: i18n and anonymous surfers - bug?

Using CakePHP 1.2.5 with medium security.

anonymouse.org removes the HTTP_ACCEPT_LANGUAGE information from the
browser, thus CakePHP can't determine the default language to use.

Add the code below to the AppController beforeFiler method to ensure
that a default language is used.
[code]
if ( !isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) {
Configure::write('Config.language', 'eng'); // <== my
default language!
}
[/code]

That works with my development site. Enjoy,
John


On Dec 31, 12:42 am, euromark <dereurom...@googlemail.com> wrote:
> i should probably add:
> security level is to low (as there are strange happening with higher
> security levels anyway)
>
> if nobody has a reason/solution i am forced to open a ticket for this
> i guess
>
> On 30 Dez., 15:47, euromark <dereurom...@googlemail.com> wrote:
>
> > right
> > i think this must be some bug in the core
> > although i could not figure out where it happens
>
> > my version is the 1.3 head right now
>
> > On 30 Dez., 11:08, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > I can confirm this. Just tried it with my development site, which
> > > works well in english and danish, depending on the language
> > > information received from the browser.
> > > With anonymouse.org this completely does not work, nothing is
> > > translated.
> > > Enjoy,
> > >    John
>
> > > On Dec 29, 5:38 am, euromark <dereurom...@googlemail.com> wrote:
>
> > > > i would have never found that out if i hadnt built myself a bot-
> > > > tracking component
> > > > it basically logs all non-js-browsing and tries to detect if it was a
> > > > known search bot
>
> > > > anyway
> > > > this way i found out that my website has been visited by users usinghttp://anonymouse.org/
>
> > > > i tried it out myself and was really shocked that i18n doesnt work
> > > > anymore
> > > > from my understanding it uses (at least in cakephp1.2 it did and
> > > > should do it in 1.3)
> > > > a) define('MY_DEFAULT_LANGUAGE','de');
> > > > b) Configure::write('Config.language', 'de-de')
>
> > > > right now it does not translate at all if you visit it via services
> > > > like anonymouse.org
> > > > neither english nor german nor any other language
>
> > > > Configure::read('Config.language') returns NULL (and was definitely
> > > > set before)
> > > > which could lead to the false assumption that my website is not german
> > > > (although its the main language - and the only present language in the
> > > > po files!), or even worse: buggy and defect. i mean, the untranslated
> > > > strings are appearing...
>
> > > > after some research i found out that this service scambles the cookies
> > > > before passing them to the cake app
> > > > so this might have something to do with it - it is probably like
> > > > cookies beeing deactivated
>
> > > > right now i intercept any call from this service via 406 error code
> > > > and the message "With such services the page cannot be displayed
> > > > properly"
> > > > but it should probably get fixed somehow
> > > > the "primary" language should always be active - even with cookies off
> > > > etc
> > > > any ideas?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

User Auth

Hello,,,

I've been looking for user auth with php.
I want to create a user management where admin can easly grant or revoke access to user?

i've been following this link
http://www.studiocanaria.com/articles/cakephp_auth_component_users_groups_permissions_revisited#form

but i stuck when accessing "http://localhost/permissions" it keep show me login page...


--
This transmission may contain confidential or privileged material. Any use of
this information by anyone other than the intended recipient is prohibited. If
you have received this transmission in error, please immediately throw away your computer because this message will explode in 10 second.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: HABTM with one Tag Model and 2 or more Other Models

Yes, just create the othermodels_tags table for the new HABTM
relationship, that is the CakePHP way.
Enjoy,
John

On Dec 31, 4:36 am, Parris <presid...@parrisstudios.com> wrote:
> Hi All,
> So I have a habtm with Tags and Posts, now I want to add more tables
> that have HABTM relationships with Tags.... is this possible? Should I
> create a separated table? It does not seem neccesary to do so but I
> seem mistaken. I suppose I would just need to create a new table
> called othermodel_tags to link each other model to a tag. Then just
> say do things as normal in my models.
>
> Is there are different way I should be doing this? Is there anything
> else I should know.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Sessions table already in the database

Call your Session something else in your CakePHP application - but in
your model, define that the model uses the table "sessions", that
should be the only place that the table "sessions" is used, thus
hopefully not conflict with CakePHP.

See http://book.cakephp.org/view/71/Model-Attributes#useTable-436 for
the table definition.

Enjoy,
John

On Dec 30, 4:44 pm, ecote <ecote....@gmail.com> wrote:
> HI,
>
> Is there a way to change the default session handling?
>
> Reason: we have a database of events (conferences, speakers,
> attendees, etc... and, sadly, " sessions " !!). This database is used
> by some other applications so it would be difficult to change the
> table name. However, once the MVCs (thus the " Session controller ")
> for this table are created, they cause total confusion to cakePHP !!
>
> What is the best workaround ?
>
> Sorry if it's a noob question... but can't find the answer anywhere !
>
> Thanks
> ECote

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Wednesday, December 30, 2009

RE: Conceptual problem Model on View ..

Not sure if I follow 100% but why not just grab the data where its OPEN?

$this->find('all', array('conditions' => array('MODEL_A.status' =>
'open')));

Or if you need to grab all the data then add the "close" link to OPEN cases
do the foreach
Controller: (or better yet make a function in the MODEL)
$this->set('cases', $this->find('all'));

VIEW:

Foreach ($cases as $case)
{
if ($case['Model']['status'] = 'open')
{

$case_status = "button code here";


} else {

$case_status = 'Case Closed';


}


Your looped data / html <?php echo $case_status; ?> so if its open it will
add the button,if not "Case Closed" will be there


}

Not 100% ure of the question but hope that helps. Maybe someone else has a
different idea.

Dave

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Bottazzo
Sent: December-30-09 10:31 AM
To: CakePHP
Subject: Conceptual problem Model on View ..

Hi guys, im don't speak english but ill try to explain my problem for u. So,
sorry for my poor english.

Ok, let imagine that I have an Model named MODEL_A that have an status field
( OPENED and CLOSED )..
I have an method on MODEL_A named can_close() that return true if i can
close the element..

I want to show a list of MODEL_A elements in the page.. so in the controller
I call a MODEL_A->find(all).. ok.. get all instances...and $this->set to
view... nice!

Ok, now i have all my MODEL_A elements on VIEW... and I want to do
this: foreach element check .. if MODEL_A->can_close() == true...
show button CLOSE .. on the side of element name.. if can_close() == false..
hide it.


So... a ill need to import my model to the view.. to call can_close method..
right? but.. call model on view is the worst sin for MVC pattern ahn??

So.. what I do now friends?

Thank you for all..

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+unsubscribe@googlegroups.com For more options, visit this group
cake-php+at http://groups.google.com/group/cake-php?hl=en
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.722 / Virus Database: 270.14.122/2590 - Release Date: 12/30/09
03:57:00

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: UML

try Umbrello

2009/12/31 Josh <joshs.silverman@gmail.com>
Does anybody have a recommendation for a good UML tool? Do many of you
make UML diagrams of your more complex web apps?

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+unsubscribe@googlegroups.com 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

UML

Does anybody have a recommendation for a good UML tool? Do many of you
make UML diagrams of your more complex web apps?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Out of office reply

Hi,

I am out the office until the 14th of January. If you require urgent assistance then please contact pete@citadelsecure.com or call him on 07890 592198 - otherwise I will answer your email on my return.

Regards

Jim


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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Getting incremental number from the counter

The generated number is always 1. Does that mean that everytime I hit this
controller action (processForm), a new Post model is created and static num
variable is always set to null ?

Yes
 
If that is so, how can I make a method that increment number in a model ??

Store it on a persistent storage like the database, then retrieve it and update accordingly. 

Regards,

Pablo Viojo
pviojo@gmail.com
http://pviojo.net

¿Que necesitas?
http://needish.com

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Getting incremental number from the counter

I tried to do as you wrote, creating static method that generates number in
app model. But it doesn't get incremented as I press the refresh button in
the browser (new submit)
here's the code
//model post.php
class Post extends AppModel {
var $name = 'Post';
static $num = null;

static function getNumber() {
self::$num = self::$num + 1;

return self::$num;
}
}

//controller posts_controller.php
class PostsController extends AppController {
var $name = 'Posts';
function processForm() {
$no = Post::getNumber();
$this->set('no', $no);
//debug($no);
}
}

//view process_form.ctp
<?
echo "generated number is " . $no;
?>
The generated number is always 1. Does that mean that everytime I hit this
controller action (processForm), a new Post model is created and static num
variable is always set to null ?
If that is so, how can I make a method that increment number in a model ??
Thanks


John Andersen-6 wrote:
>
> Based on what you wrote, I would put the method together with the
> model that handles the registration, so that when the registration
> data have been validated, the model requests a registration number and
> saves it together with the registration data.
>
> Hope this helps ;)
> John
>
> On Dec 28, 4:08 pm, aveev <nashrullah_a...@yahoo.com> wrote:
>> Well I mistakenly wrote it as an app number. It's actually a registration
>> number.>1) What are the requirements for the application?
>>
>> So here's the process:
>> After a user is finished filling up the form, his app will be given a reg
>> number. We will store this user data along with the reg number on a table
>> (registration table).
>> And then we put this user data on pdf file, which the user can download
>> and
>> print.
>> the user will bring the printed form to our office, and then we make some
>> checks to the data. If it's ok, then we approve his application and give
>> his
>> app an app number and store it in another table (user table).
>> If his/her data doesn't pass our check, we will correct the data in our
>> office.
>>
>> This reg number will have a validity period. As of the requirement,it is
>> 3
>> years. If the applicant doesn't come within this validity period, his/her
>> record will be deleted.>a) Is the application to be available for a long
>> time?
>>
>> yes. We will keep the user data for a long time.>b) Can the application
>> expire?
>> yes.
>> >c) What information does the application contain?
>>
>> it contains about the user details (name, add, pob, dob, his/her pics,
>> and
>> id copy as an uploaded file).
>>
>> So my previous question is about generating the reg number ..Should I put
>> it
>> as a static method  in the component, model, or what ??
>>
>>
>>
>> John Andersen-6 wrote:
>>
>> > Your problem can be solved in many ways, so for me/us to better be
>> > able to help you, I have the following questions:
>>
>> > 1) What are the requirements for the application?
>> > a) Is the application to be available for a long time?
>> > b) Can the application expire?
>> > c) What information does the application contain?
>>
>> > Assuming that the application must be available for a long time
>> > (statistics, etc.) and that the application can expire (the
>> > application was granted but the user never confirmed the grant), I
>> > suggest you to store the application in a database table and to use
>> > the tables primary key as the unique application number.
>>
>> > That is just for a start! Looking forward to hearing more about your
>> > requirements :)
>> > Enjoy,
>> >    John
>>
>> > On Dec 26, 3:08 pm, aveev <nashrullah_a...@yahoo.com> wrote:
>> >> I'm newbie to cakephp..
>> >> I have this scenario.
>> >> User fills in a form. Upon finishing filling the form, his/her
>> >> application
>> >> will be given an app number. This app number comes from a counter.
>> >> So I need to make a static method that returns this app number. What I
>> >> don't
>> >> know is where I should put this method at best ??
>> >> Should I wrap it in a component (making static method in a component),
>> >> model
>> >> (making static method in a model) or what ?
>> >> Let's say If I put it in the component, here's what I've come up with
>> :
>> >> class Counter extends Object {
>> >>         static $num = 0;
>>
>> >>         static function get_num() {
>> >>             $num = $num + 1;
>> >>             return $num;
>> >>         }
>> >>     }
>>
>> >> So in controller I can call this static method like this:
>> >> class SomeController extends AppController {
>> >>   App::import('Component', 'Counter');
>> >>  some_function() {
>> >>       $app_num = Counter::get_num();}
>> >> }
>>
>> >> Is it the right way to solve my problem ??
>> >> Any help would be appreciated.
>> >> Thanks
>>
>> >> I use cakephp 1.2
>> >> --
>> >> View this message in
>> >>
>> context:http://old.nabble.com/Getting-incremental-number-from-the-counter-tp2...
>> >> Sent from the CakePHP mailing list archive at Nabble.com.
>>
>> > 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+unsubscribe@googlegroups.com For more options, visit this
>> group
>> > athttp://groups.google.com/group/cake-php?hl=en
>>
>> --
>> View this message in
>> context:http://old.nabble.com/Getting-incremental-number-from-the-counter-tp2...
>> Sent from the CakePHP mailing list archive at Nabble.com.
>
> 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+unsubscribe@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>

--
View this message in context: http://old.nabble.com/Getting-incremental-number-from-the-counter-tp26927052p26974761.html
Sent from the CakePHP mailing list archive at Nabble.com.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

HABTM with one Tag Model and 2 or more Other Models

Hi All,
So I have a habtm with Tags and Posts, now I want to add more tables
that have HABTM relationships with Tags.... is this possible? Should I
create a separated table? It does not seem neccesary to do so but I
seem mistaken. I suppose I would just need to create a new table
called othermodel_tags to link each other model to a tag. Then just
say do things as normal in my models.

Is there are different way I should be doing this? Is there anything
else I should know.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Creating tests for bake tool

Hello everyone,

So I wanted to try to contribute to the cake core, and I had an idea for a (trivial) update I could make.   One change is to the bake script to output a more "edit" friendly version of the validation info.

The other change is in the field detection for bake.  Right now it just checks if $fieldName === 'email', which means email_address, user_email, and other variations are not picked up.  I modified it to check strpos($fieldName,'email')!==FALSE to pick up the variations, as well as adding a check for strpos($fieldName,'phone')!==FALSE as well.

I am not familiar with testing at all, but I know I should create some test cases before attempting to submit this patch to show that this change works as intended.  How would I go about creating a test case for this part of the cake core?

Thanks any advice is greatly appreciated!

Dave

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

RE: Temp data question

Better idea!

I'm just going to limit access with 0 credits if they did not buy any
(cancelled) or run out then when they login it takes them to purchase page.
That's all they can access then.

Thanks for the inspiration...

Dave

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jon Bennett
Sent: December-30-09 10:27 PM
To: cake-php@googlegroups.com
Subject: Re: Temp data question

Hi Dave,

> I have a registration form where user enters all their info and
> selects an option for membership level which sends them to PayPal to
> complete the signup process.
> Problem:
> If user fills out the form, validates, it saved the new user but at
> PayPal they cancel the transaction so they now have an account with no
> access since they cancelled.
>
> I figured the best way would be save that data to a temp table and
> when the transaction is complete pull that temp data then save the
> user info creating the actual account.
>
> Ideas? Suggestions?

You can ask paypal to send a confirmation request after a successful
transaction (an IPN or 'instant payment notification'), so I would create
the user account as per usual, but flag it as 'unconfirmed', paypal will
include the email address in the IPN request, which you can use to look up
the user record and update it as confirmed.

cheers,

J

--
jon bennett - www.jben.net - blog.jben.net

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+unsubscribe@googlegroups.com For more options, visit this group
cake-php+at http://groups.google.com/group/cake-php?hl=en
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.722 / Virus Database: 270.14.122/2590 - Release Date: 12/30/09
03:57:00

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

RE: Temp data question

Hello Jon,

I am using the PayPal IPN to get responses from its transactions but my main
concern is a user creating an account, then has no transaction can login.
For my setup a user buys "credits" so they can still log into their account
if they run out of credits since access is now limited with no credits. I
just want to prevent new users from creating accounts when cancelling
transactions and can still login and see "behind the scenes" when in theory
only if you buy something do I want them to have an account and login.

The idea of field that gets flagged by the IPN makes sense but still the
account is created. Just don't want to end up with accounts that do nothing
or dummy empty accounts.

Thanks,

Dave

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jon Bennett
Sent: December-30-09 10:27 PM
To: cake-php@googlegroups.com
Subject: Re: Temp data question

Hi Dave,

> I have a registration form where user enters all their info and
> selects an option for membership level which sends them to PayPal to
> complete the signup process.
> Problem:
> If user fills out the form, validates, it saved the new user but at
> PayPal they cancel the transaction so they now have an account with no
> access since they cancelled.
>
> I figured the best way would be save that data to a temp table and
> when the transaction is complete pull that temp data then save the
> user info creating the actual account.
>
> Ideas? Suggestions?

You can ask paypal to send a confirmation request after a successful
transaction (an IPN or 'instant payment notification'), so I would create
the user account as per usual, but flag it as 'unconfirmed', paypal will
include the email address in the IPN request, which you can use to look up
the user record and update it as confirmed.

cheers,

J

--
jon bennett - www.jben.net - blog.jben.net

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+unsubscribe@googlegroups.com For more options, visit this group
cake-php+at http://groups.google.com/group/cake-php?hl=en
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.722 / Virus Database: 270.14.122/2590 - Release Date: 12/30/09
03:57:00

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Temp data question

Hi Dave,

> I have a registration form where user enters all their info and selects an
> option for membership level which sends them to PayPal to complete the
> signup process.
> Problem:
> If user fills out the form, validates, it saved the new user but at PayPal
> they cancel the transaction so they now have an account with no access since
> they cancelled.
>
> I figured the best way would be save that data to a temp table and when the
> transaction is complete pull that temp data then save the user info creating
> the actual account.
>
> Ideas? Suggestions?

You can ask paypal to send a confirmation request after a successful
transaction (an IPN or 'instant payment notification'), so I would
create the user account as per usual, but flag it as 'unconfirmed',
paypal will include the email address in the IPN request, which you
can use to look up the user record and update it as confirmed.

cheers,

J

--
jon bennett - www.jben.net - blog.jben.net

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Temp data question

I am wondering what is the best way to handle this situation.
 
I have a registration form where user enters all their info and selects an option for membership level which sends them to PayPal to complete the signup process.
Problem:
If user fills out the form, validates, it saved the new user but at PayPal they cancel the transaction so they now have an account with no access since they cancelled.
 
I figured the best way would be save that data to a temp table and when the transaction is complete pull that temp data then save the user info creating the actual account.
 
Ideas? Suggestions?
 
Thanks
 
Dave

Re: anybody tried the 1.3 console yet

this now seems to be fixed in the current HEAD version

but:
in 1.3 the templates have a different folder structure

\cake\console\templates\default
- actions
- classes
- views

instead of just
- default
(<= 1.2)

does anyone know how to override the core template files from the app
or even the global vendors folder?
is it:
\app\vendors\shells\templates\default
and for several apps:
\vendors\shells\templates\default
with the corresponding subfolders? does not seem to work anyway.

i thought cake first looks in \app\vendors\shells
then in \vendors\shells and finally in the default folder in \cake

but right now neither "app" nor "vendors" would override the default
templates
only modifying the core files directly does

thx in advance
mark


On 21 Dez., 20:44, euromark <dereurom...@googlemail.com> wrote:
> after switching the core folder from 1.2 to 1.3 the console of course
> is now 1.3 as well
>
> but where does 1.3 "cake bake" save/get the lists of database tables
> now?
> it does not seem to cake them out of the tmp/cache/models folder -
> therefore my new tables cannot be found in the console - although i
> cleared the cache folder completely
> in 1.2 this was enough to regenerate the array of all available
> tables...
>
> after switching back to 1.2 the new tables appeared again in the
> console
>
> thx

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Cakephp 1.2 Paginator Helper, setting limit from view

> I would like to put in the view a link like the following:
>
> Show 20 50 100 Records
>
> And change the limit parameter if the user clicks on 20 50 100.

Yep, use the paginator helper:

<?php
echo $paginator->link('20', array('limit' => 20));
echo $paginator->link('50', array('limit' => 50));
echo $paginator->link('100', array('limit' => 100));
?>

etc

j

--
jon bennett - www.jben.net - blog.jben.net

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: i18n and anonymous surfers - bug?

i should probably add:
security level is to low (as there are strange happening with higher
security levels anyway)

if nobody has a reason/solution i am forced to open a ticket for this
i guess


On 30 Dez., 15:47, euromark <dereurom...@googlemail.com> wrote:
> right
> i think this must be some bug in the core
> although i could not figure out where it happens
>
> my version is the 1.3 head right now
>
> On 30 Dez., 11:08, John Andersen <j.andersen...@gmail.com> wrote:
>
>
>
> > I can confirm this. Just tried it with my development site, which
> > works well in english and danish, depending on the language
> > information received from the browser.
> > With anonymouse.org this completely does not work, nothing is
> > translated.
> > Enjoy,
> >    John
>
> > On Dec 29, 5:38 am, euromark <dereurom...@googlemail.com> wrote:
>
> > > i would have never found that out if i hadnt built myself a bot-
> > > tracking component
> > > it basically logs all non-js-browsing and tries to detect if it was a
> > > known search bot
>
> > > anyway
> > > this way i found out that my website has been visited by users usinghttp://anonymouse.org/
>
> > > i tried it out myself and was really shocked that i18n doesnt work
> > > anymore
> > > from my understanding it uses (at least in cakephp1.2 it did and
> > > should do it in 1.3)
> > > a) define('MY_DEFAULT_LANGUAGE','de');
> > > b) Configure::write('Config.language', 'de-de')
>
> > > right now it does not translate at all if you visit it via services
> > > like anonymouse.org
> > > neither english nor german nor any other language
>
> > > Configure::read('Config.language') returns NULL (and was definitely
> > > set before)
> > > which could lead to the false assumption that my website is not german
> > > (although its the main language - and the only present language in the
> > > po files!), or even worse: buggy and defect. i mean, the untranslated
> > > strings are appearing...
>
> > > after some research i found out that this service scambles the cookies
> > > before passing them to the cake app
> > > so this might have something to do with it - it is probably like
> > > cookies beeing deactivated
>
> > > right now i intercept any call from this service via 406 error code
> > > and the message "With such services the page cannot be displayed
> > > properly"
> > > but it should probably get fixed somehow
> > > the "primary" language should always be active - even with cookies off
> > > etc
> > > any ideas?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Need some directions on how to build something like phpMyAdmin

Greeting,

A traditional programmer who is starting to learn CakePHP and MVC
design. I have a pilot project to build a light version of something
like PhpMyAdmin.

Just trying to figure out how do I achieve this with this framework?
Can I have a generic controller to map dynamically to a different
database and a different table. And how do I achieve something as
simple as listing out all the databases of a specific server in the
MVC model.

I appreciate very much if someone can provide me some directions.
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

recursive not working?

Hi

I have a model where Paper and Author are in HABTM relation. I also
have a model for the join table AuthorsPaper.

When doing this operation (in a method of the Author model class)

$this->AuthorsPaper->updateAll(
array('author_id' => $first_author),
array('author_id' => $second_author)
);

I'd like to avoid the join in the generated query, thus I put

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

but the joins are performed anyway...

Instead, if I do this (instead of setting recursive)

$this->AuthorsPaper->unbindModel(
array('belongsTo' => array('Paper'))
);
$this->AuthorsPaper->unbindModel(
array('belongsTo' => array('Author'))
);

the joins are not performed...

am I missing something? Shouldn't this be the same of setting recursive
to -1?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Cakephp 1.2 Paginator Helper, setting limit from view

I would like to put in the view a link like the following:

Show 20 50 100 Records

And change the limit parameter if the user clicks on 20 50 100.

There is an easy way to do it?

Thanks

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: i18n and anonymous surfers - bug?

right
i think this must be some bug in the core
although i could not figure out where it happens

my version is the 1.3 head right now


On 30 Dez., 11:08, John Andersen <j.andersen...@gmail.com> wrote:
> I can confirm this. Just tried it with my development site, which
> works well in english and danish, depending on the language
> information received from the browser.
> With anonymouse.org this completely does not work, nothing is
> translated.
> Enjoy,
>    John
>
> On Dec 29, 5:38 am, euromark <dereurom...@googlemail.com> wrote:
>
> > i would have never found that out if i hadnt built myself a bot-
> > tracking component
> > it basically logs all non-js-browsing and tries to detect if it was a
> > known search bot
>
> > anyway
> > this way i found out that my website has been visited by users usinghttp://anonymouse.org/
>
> > i tried it out myself and was really shocked that i18n doesnt work
> > anymore
> > from my understanding it uses (at least in cakephp1.2 it did and
> > should do it in 1.3)
> > a) define('MY_DEFAULT_LANGUAGE','de');
> > b) Configure::write('Config.language', 'de-de')
>
> > right now it does not translate at all if you visit it via services
> > like anonymouse.org
> > neither english nor german nor any other language
>
> > Configure::read('Config.language') returns NULL (and was definitely
> > set before)
> > which could lead to the false assumption that my website is not german
> > (although its the main language - and the only present language in the
> > po files!), or even worse: buggy and defect. i mean, the untranslated
> > strings are appearing...
>
> > after some research i found out that this service scambles the cookies
> > before passing them to the cake app
> > so this might have something to do with it - it is probably like
> > cookies beeing deactivated
>
> > right now i intercept any call from this service via 406 error code
> > and the message "With such services the page cannot be displayed
> > properly"
> > but it should probably get fixed somehow
> > the "primary" language should always be active - even with cookies off
> > etc
> > any ideas?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Sessions table already in the database

HI,

Is there a way to change the default session handling?

Reason: we have a database of events (conferences, speakers,
attendees, etc... and, sadly, " sessions " !!). This database is used
by some other applications so it would be difficult to change the
table name. However, once the MVCs (thus the " Session controller ")
for this table are created, they cause total confusion to cakePHP !!

What is the best workaround ?

Sorry if it's a noob question... but can't find the answer anywhere !

Thanks
ECote

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Conceptual problem Model on View ..

Hi guys, im don't speak english but ill try to explain my problem for
u. So, sorry for my poor english.

Ok, let imagine that I have an Model named MODEL_A that have an status
field ( OPENED and CLOSED )..
I have an method on MODEL_A named can_close() that return true if i
can close the element..

I want to show a list of MODEL_A elements in the page.. so in the
controller I call a MODEL_A->find(all).. ok.. get all instances...and
$this->set to view... nice!

Ok, now i have all my MODEL_A elements on VIEW... and I want to do
this: foreach element check .. if MODEL_A->can_close() == true...
show button CLOSE .. on the side of element name.. if can_close() ==
false.. hide it.


So... a ill need to import my model to the view.. to call can_close
method.. right? but.. call model on view is the worst sin for MVC
pattern ahn??

So.. what I do now friends?

Thank you for all..

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Multiple Model Pagination

Containable could create multiple queries.

This is the solution I went for:
http://github.com/ionas/sna/blob/master/www/app/controllers/profiles_controller.php#L112

This could be another solution (not tested yet):
http://mark-story.com/posts/view/using-bindmodel-to-get-to-deep-relations

(internally pagination uses find() as well)

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Problem understanding how this model object works

Cake is auto-loading your model, meaning that it cant find the model
you are expecting. Double check your spelling etc for the $uses var to
check your correctly assigning it.

On Dec 30, 6:37 am, edwingt <edwin.al...@gmail.com> wrote:
> I have a model object called "ImpresorasProducto" that belongs to a
> NxM relationship table impresoras_productos.
>
> When I'm in "ImpresorasProductosController" and debug the model object
> it prints this:
>
> ImpresorasProducto Object
> (
>     [name] => ImpresorasProducto
>     [belongsTo] => Array
>         (
>             [Producto] => Array
>                 (
>                     [className] => Producto
>                     [foreignKey] => producto_id
> ....
>
> This is find because I can access al the realational models.
>
> The problem is when I use the "ImpresorasProducto" model in other
> controller.
> I include the model in the controller with the var $uses ....
> I can't acces the objects related to "ImpresorasProducto"  and when I
> debug the model object it prints this:
>
> AppModel Object
> (
>     [useDbConfig] => default
>     [useTable] => impresoras_productos
>     [displayField] => id
>     [id] =>
>     [data] => Array
>         (
>         )
>
>     [table] => impresoras_productos
> ....
>
> I cant uderstand why here I have an AppModel Object instead of a
> ImpresorasProducto Object

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Count column in index view

With the hasOne relationship, the query looks like:
[code]
SELECT `Author`.`id`, `Author`.`name`, COUNT(`Article`.`id`) as
article_count FROM `authors` AS `Author` LEFT JOIN `articles` AS
`Article` ON (`Article`.`author_id` = `Author`.`id`) WHERE
`Author`.`id` IN (1, 2, 13) GROUP BY `Author`.`id`, `Author`.`name`
[/code]

With the hasMany relationship, the query looks like:
[code]
SELECT `Author`.`id`, `Author`.`name`, COUNT(`Article`.`id`) as
article_count FROM `authors` AS `Author` WHERE `Author`.`id` IN (1, 2,
13) GROUP BY `Author`.`id`, `Author`.`name`
[/code]
Contain does not assist in creating a LEFT JOIN, which is why
Article.id is an unknown column!

As far as I remember, the issue is probably not in the Containable
behaviour, but somewhere in DboSource, but I may be wrong here :)

There is another way:
1) Set contain equal false.
2) Define the joins yourself, as in the example below:
[code]
$results = $this->Article->Author->find(
'all',
array(
'contain' => false,
'joins' => array(
array(
'table' => 'articles',
'type' => 'left',
'alias' => 'Article',
'foreignKey' => false,
'conditions' => array('Article.author_id =
Author.id')
)
),
'fields' => array('Author.id', 'Author.name', 'COUNT
(Article.id) as article_count'),
'group' => array('Author.id', 'Author.name'),
)
);
[/code]

But that is also not very simple!

Will keep you updated, should I find a better solution! Enjoy,
John

On Dec 30, 12:07 pm, Jeremy Burns <jeremybu...@me.com> wrote:
> Thank you John - I will try this out. Strikes me as very odd that this
> is not much much simpler!
>
> On Dec 30, 10:05 am, John Andersen <j.andersen...@gmail.com> wrote:
>
> > Hi Jeremy,
>
> > Seems like Contain can't find out to make a join when there is a
> > hasMany relationship between the Author and the Article models. I made
> > changes to Example A, so that Contain makes a LEFT JOIN, which
> > includes Authors with no Articles :)
>
> > 1) Unbind the hasMany relationship.
> > 2) Bind a hasOne relationship.
> > 3) Make the find on the Author model - I have include two author ids
> > with articles and one (13) without articles.
> > [code]
> >       $this->Article->Author->unbindModel( array('hasMany' => array
> > ('Article')));
> >       $this->Article->Author->bindModel( array('hasOne' => array
> > ('Article')));
> >       $results = $this->Article->Author->find(
> >          'all',
> >          array(
> >             'contain' => array('Article'),
> >             'fields' => array('Author.id', 'Author.name', 'COUNT
> > (Article.id) as article_count'),
> >             'conditions' => array('Author.id' => array(1,2,13)),
> >             'group' => array('Author.id', 'Author.name'),
> >          )
> >       );
> >       debug($results);
> > [/code]
>
> > The result is:
> > [result]
> > 28871\controllers\articles_controller.php (line 48)
> > Array
> > (
> >     [0] => Array
> >         (
> >             [Author] => Array
> >                 (
> >                     [id] => 1
> >                     [name] => Hans Christian Andersen
> >                 )
> >             [0] => Array
> >                 (
> >                     [article_count] => 19
> >                 )
> >         )
> >     [1] => Array
> >         (
> >             [Author] => Array
> >                 (
> >                     [id] => 2
> >                     [name] => Terry Prattchet
> >                 )
> >             [0] => Array
> >                 (
> >                     [article_count] => 19
> >                 )
> >         )
> >     [2] => Array
> >         (
> >             [Author] => Array
> >                 (
> >                     [id] => 13
> >                     [name] => Test
> >                 )
> >             [0] => Array
> >                 (
> >                     [article_count] => 0
> >                 )
> >         )
> > )
> > [/result]
>
> > Hope this helps you on the way,
> >    John
>
> > On Dec 30, 6:52 am, Jeremy Burns <jeremybu...@me.com> wrote:
>
> > > Thanks John. Option B does indeed work - sort of! It returns a list of
> > > location types with a count of their locations, but only where there
> > > is a location. In other words, it does not give me the location types
> > > that do not have have any locations.
>
> > > Any more ideas - anyone?
>
> > > On Dec 29, 12:35 pm, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > > A correction, example A gives the author with all the articles, but
> > > > the article count is 1 (one) - so no luck using that!
> > > > Enjoy,
> > > >    John
> > > > [snip]

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: i18n and anonymous surfers - bug?

I can confirm this. Just tried it with my development site, which
works well in english and danish, depending on the language
information received from the browser.
With anonymouse.org this completely does not work, nothing is
translated.
Enjoy,
John

On Dec 29, 5:38 am, euromark <dereurom...@googlemail.com> wrote:
> i would have never found that out if i hadnt built myself a bot-
> tracking component
> it basically logs all non-js-browsing and tries to detect if it was a
> known search bot
>
> anyway
> this way i found out that my website has been visited by users usinghttp://anonymouse.org/
>
> i tried it out myself and was really shocked that i18n doesnt work
> anymore
> from my understanding it uses (at least in cakephp1.2 it did and
> should do it in 1.3)
> a) define('MY_DEFAULT_LANGUAGE','de');
> b) Configure::write('Config.language', 'de-de')
>
> right now it does not translate at all if you visit it via services
> like anonymouse.org
> neither english nor german nor any other language
>
> Configure::read('Config.language') returns NULL (and was definitely
> set before)
> which could lead to the false assumption that my website is not german
> (although its the main language - and the only present language in the
> po files!), or even worse: buggy and defect. i mean, the untranslated
> strings are appearing...
>
> after some research i found out that this service scambles the cookies
> before passing them to the cake app
> so this might have something to do with it - it is probably like
> cookies beeing deactivated
>
> right now i intercept any call from this service via 406 error code
> and the message "With such services the page cannot be displayed
> properly"
> but it should probably get fixed somehow
> the "primary" language should always be active - even with cookies off
> etc
> any ideas?

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Count column in index view

Thank you John - I will try this out. Strikes me as very odd that this
is not much much simpler!

On Dec 30, 10:05 am, John Andersen <j.andersen...@gmail.com> wrote:
> Hi Jeremy,
>
> Seems like Contain can't find out to make a join when there is a
> hasMany relationship between the Author and the Article models. I made
> changes to Example A, so that Contain makes a LEFT JOIN, which
> includes Authors with no Articles :)
>
> 1) Unbind the hasMany relationship.
> 2) Bind a hasOne relationship.
> 3) Make the find on the Author model - I have include two author ids
> with articles and one (13) without articles.
> [code]
>       $this->Article->Author->unbindModel( array('hasMany' => array
> ('Article')));
>       $this->Article->Author->bindModel( array('hasOne' => array
> ('Article')));
>       $results = $this->Article->Author->find(
>          'all',
>          array(
>             'contain' => array('Article'),
>             'fields' => array('Author.id', 'Author.name', 'COUNT
> (Article.id) as article_count'),
>             'conditions' => array('Author.id' => array(1,2,13)),
>             'group' => array('Author.id', 'Author.name'),
>          )
>       );
>       debug($results);
> [/code]
>
> The result is:
> [result]
> 28871\controllers\articles_controller.php (line 48)
> Array
> (
>     [0] => Array
>         (
>             [Author] => Array
>                 (
>                     [id] => 1
>                     [name] => Hans Christian Andersen
>                 )
>             [0] => Array
>                 (
>                     [article_count] => 19
>                 )
>         )
>     [1] => Array
>         (
>             [Author] => Array
>                 (
>                     [id] => 2
>                     [name] => Terry Prattchet
>                 )
>             [0] => Array
>                 (
>                     [article_count] => 19
>                 )
>         )
>     [2] => Array
>         (
>             [Author] => Array
>                 (
>                     [id] => 13
>                     [name] => Test
>                 )
>             [0] => Array
>                 (
>                     [article_count] => 0
>                 )
>         )
> )
> [/result]
>
> Hope this helps you on the way,
>    John
>
> On Dec 30, 6:52 am, Jeremy Burns <jeremybu...@me.com> wrote:
>
>
>
> > Thanks John. Option B does indeed work - sort of! It returns a list of
> > location types with a count of their locations, but only where there
> > is a location. In other words, it does not give me the location types
> > that do not have have any locations.
>
> > Any more ideas - anyone?
>
> > On Dec 29, 12:35 pm, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > A correction, example A gives the author with all the articles, but
> > > the article count is 1 (one) - so no luck using that!
> > > Enjoy,
> > >    John
> > > [snip]

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en