Re: Implement ajax with select box

2012-03-28 Thread alexkd
Any more in English ?

On Mar 28, 9:57 am, romel javier gomez herrera
bmxquiksilver7...@gmail.com wrote:
 see this componet

 http://phpyalgomas.blogspot.com/2012/03/selects-dependientes-para-cak...

 El 28 de marzo de 2012 00:08, Ryan Snowden sicapi...@gmail.com escribió:







  Try not think as Cake handling the AJAX... technically it is just
  javascript... so in this regards, you are checking for a change event on
  the select list, and it's going to get the value and POST it to a function
  in a controller which is going to return a value, or render a view with the
  value in it.

  You can generate the correct url using the Html-url helper in the view.
  jQuery has .change (http://api.jquery.com/change/) and then you are also
  using $.ajax

  I don't recommend using ajax helpers unless it's a repetitive, fairly
  simple thing to do like links. Just write in raw javascript/jquery.
  Debugging is easier, the examples for plugins work in a copy paste way, and
  you get moving faster.

  On 28 March 2012 12:09, alexkd amstin.st...@gmail.com wrote:

  Although a lot of discussions can be found in this group . A beginner
  not able to understand how to implement ajax in project. And also cake
  php.org says Ajaxhelper is deprecated. I dont understand which is the
  new usage

  I am using 1.3 cakephp my problem is how to replace my calc div with
  calculated fee amount when the patients select box is selected?

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
  athttp://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 sitehttp://ask.cakephp.organd 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
  athttp://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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Implement ajax with select box

2012-03-28 Thread 32teeths
Make use of the js helper . Its quite easy . But to get the full effect of ajax 
you should hard code it using javascript . 
Sent from BlackBerry® on Airtel

-Original Message-
From: alexkd amstin.st...@gmail.com
Sender: cake-php@googlegroups.com
Date: Wed, 28 Mar 2012 01:05:16 
To: CakePHPcake-php@googlegroups.com
Reply-To: cake-php@googlegroups.com
Subject: Re: Implement ajax with select box

Any more in English ?

On Mar 28, 9:57 am, romel javier gomez herrera
bmxquiksilver7...@gmail.com wrote:
 see this componet

 http://phpyalgomas.blogspot.com/2012/03/selects-dependientes-para-cak...

 El 28 de marzo de 2012 00:08, Ryan Snowden sicapi...@gmail.com escribió:







  Try not think as Cake handling the AJAX... technically it is just
  javascript... so in this regards, you are checking for a change event on
  the select list, and it's going to get the value and POST it to a function
  in a controller which is going to return a value, or render a view with the
  value in it.

  You can generate the correct url using the Html-url helper in the view.
  jQuery has .change (http://api.jquery.com/change/) and then you are also
  using $.ajax

  I don't recommend using ajax helpers unless it's a repetitive, fairly
  simple thing to do like links. Just write in raw javascript/jquery.
  Debugging is easier, the examples for plugins work in a copy paste way, and
  you get moving faster.

  On 28 March 2012 12:09, alexkd amstin.st...@gmail.com wrote:

  Although a lot of discussions can be found in this group . A beginner
  not able to understand how to implement ajax in project. And also cake
  php.org says Ajaxhelper is deprecated. I dont understand which is the
  new usage

  I am using 1.3 cakephp my problem is how to replace my calc div with
  calculated fee amount when the patients select box is selected?

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
  athttp://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 sitehttp://ask.cakephp.organd 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
  athttp://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
cake-php+unsubscr...@googlegroups.com 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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: LdapAuthorize

2012-03-28 Thread Saket Choudhary
Any update on this ? I am stuck at the same point !

On Thursday, November 24, 2011 7:44:20 PM UTC+5:30, gloop wrote:

 Hello again,

 i try to program a LdapAuthentication and i need some help.

 First i need to configure the $components in /app/Controller/
 Component/AppController.php

 ?php
   class AppController extends Controller {
   var $components = array('Auth' = array(
 'Ldap',
   'authError' 
 = 'Did you really think you are allowed to
 see that?',
 'authenticate' 
 = array(
 'Form' = 
 array(
 'fields' = 
 array('username'
 = 'username',
 
 'password' =
 'password',
 
 'domain' = 'domain'
  )
 )
 ),
 'authorize' = true,
   ), 'Session');
   }
 ?

 Then i create a LdapAuthorize.php like

 http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#creating-custom-authorize-objects

 ?php
 App::uses('BaseAuthorize', 'Controller/Component/Auth');

 class LdapAuthorize extends BaseAuthorize {
 public function authorize($user, CakeRequest $request) {
   echo test;
 }
 }

 ?

 But when i try to login with

 if ($this-Auth-login()) {
 return $this-redirect($this-Auth-redirect());
 } else {
 $this-Session-setFlash(__('Username or password is incorrect'),
 'default', array(), 'auth');
 }

 cakephp doesn't use my authorize function.

 What i do wrong? Please help.

 Kind Regards
 gloop



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


doubt of join in cakephp

2012-03-28 Thread LITTO CHACKO
Hello, i have a doubt regarding join in cakephp. i have a primary key
which is a foreign key of other table... i want to retrieve the table
along with values s in othertable by checking some condition sin two
tables.
fields in first table:-  db_offer
offer_idseller_id   package_id  category_id 
reference_notitle
description extra_details   offer_price original_price  offer_weblink
published   offer_coverimagestart_date  end_date
gallery_typeflash_file
width   height  embed_code  notes   hot_deals   cleranace_deals 
today_special
views

other table:-db_offerpromotion
id  offer_idoffer_type  start_date  end_date
added_date  published

i want to retrive all values of offer with offerid from two tables
with condition that todays date less than end datyes of offerpromo..
can u please help..me..it's urgent?? how i can do this???

when iam using hasmany... it retreives table but it is not performing
check condition..pls help??

-- 
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: multi-level Model associations behavior

2012-03-28 Thread Mike Griffin
On Tue, Mar 27, 2012 at 20:40, Augey Mikus augeymi...@gmail.com wrote:
 I am building an eLearning site in CakePHP that has models:  Course,
 Test, Question, Answer, and others.

 Here are my associations:

 Course hasMany Test
 Test belongsTo Course
 Question belongsTo Test
 Question hasMany Answer
 Answer belongsTo Question

 As you can see, the $test array in my view stops at Question, and
 doesn't pull the associated Answer(s) for the Question(s).


You could try to use the Containable Behaviour
(http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html)

$this-Test-find(
  'all',
  array(
'contain' = array(
  'Course',
  'Question' = array(
'Answer'
  )
)
  ),
  'conditions' = array(
'Test.id' = $id
  )
);

That should bring back the proper array with the answers corresponding
to each question.

Mike.

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


Problems with Find ('all')

2012-03-28 Thread ingcara

Hello everyone,

I need a help with a issue. I´m trying to add another condition to my
Search Function (usuario_busca).

This is the Code in the Controller:

function usuario_busca() {

$this-set('meuPerfil', 1);



if(!empty($this-data['tipo']) AND 
!empty($this-data['valor'])) {

switch($this-data['tipo']) {

case 'nome':

$dados = $this-Usuario-find('all', 
array('conditions'=array(
'or'=array('nome_usuario 
LIKE'='%'.$this-
data['valor'].'%','email_usuario'=$this-data['valor'])),
 'order'=array('descricao_usuario 
ASC'), 'limit'=100));

break;

default: break;

}


if(isset($dados) AND !empty($dados)) 
$this-set('dados', $dados);

$busca = array('valor'= $this-data['valor']);

$this-set('busca', $busca);

}

else $this-redirect($this-site['url']['site'] . 'usuario/rede/
perfil');

}

}



?

When i entered the value of email or any name, cake retrieve the info
succesfully, but when I try to add more conditions or structures of
the tables and I entered the value throug the View == Nothing
Happend , for example

$dados = $this-Usuario-find('all', array('conditions'=array(
'or'=array('nome_usuario 
LIKE'='%'.$this-data['valor'].'%',
'ocupacao_usuario'=$this-data['valor'])),  'religiao_usuario'=$this-
data['valor'])), 'email_usuario'=$this-data['valor'])),
 'order'=array('descricao_usuario 
ASC'), 'limit'=100));

I will appreciate if someone can help me.



-- 
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: Problems with Find ('all')

2012-03-28 Thread Marcus James
Hi,

I think your condition clause is not properly written.

Try this

$dados = $this-Usuario-find('all', array('conditions'=array(
   'OR'=array(array('nome_usuario
LIKE'='%'.$this-data['valor'].'%',
'ocupacao_usuario'=$this-data['valor']),array('religiao_usuario'=$this-data['valor']),array('email_usuario'=$this-data['valor']);




Enjoy,

Marcus

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


Cost of cakePHP2 developers

2012-03-28 Thread DerekGardiner
Does anyone know what the typical hourly rate of a cakephp dev (in
USD) would be? For a junior, intermediate and senior developer?

-- 
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: How to test this controller?

2012-03-28 Thread Rodrigo Rodrigues Moyle
Use testAction()

http://book.cakephp.org/2.0/en/development/testing.html#testing-controllers

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


isAuthorized() is never called

2012-03-28 Thread Sony
Hi,

When I run a action, the access is refused because the method
isAuthorized() is never called.

AppController :

?php

class AppController extends Controller {

public $helpers = array ('Html', 'Form', 'Session', 'Time');

public $components = array('Session', 'Auth');

public function beforeFilter()
{
$this-Auth-userModel = 'User';
$this-Auth-fields = array('username' = 'username', 
'password' =
'password');
$this-Auth-loginAction = array('controller' = 'users', 
'action'
= 'login');
$this-Auth-loginRedirect = '/';
$this-Auth-loginError = 'Nom d\'utilisateur ou mot de passe
incorrects.';
$this-Auth-logoutRedirect = '/';
$this-Auth-authError = 'Vous n\'avez pas accès à cette page.';
$this-Auth-autoRedirect = true;
$this-Auth-authorize = 'controller';

debug('beforeFilter');
}

public function isAuthorized($user = null)
{
debug('isAuthorized');
die();
return true;
}
}

My others controllers do not implement beforeFilter or isAuthorized.

-- 
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: Controller can't access the Session

2012-03-28 Thread Felipe Roman
After long time trying figure out I found the problem and the
solution. I changed the app/config/core.php file setting:

Session.checkAgent to false so the Ajax requests do not change the
UserAgent allowing the controller to get the session.

Session.checkAgent
Setting this to TRUE means Cake will store the user agent header of a
request when a new session is created. On subsequent request, the user
agent header sent is compared with the value stored in the session. If
it does not match, the current session will be destroyed and a new
session gets created.

This rarely causes problem unless you have embedded Flash or Java
objects making separate requests to the application. You must take
note to send the user agent string of the browser in that case. If you
are using something like Aurigma’s Image Uploader where the user agent
is not configurable, you have to set this to FALSE instead.

Source
http://derickng.com/posts/36-cakephp-losing-or-missing-session

Thanks

On Mar 19, 7:50 am, euromark dereurom...@googlemail.com wrote:
 why don't your controllers have:

  public $components = array('Session');

 ?

 without it you cannot use the session component

 Am Montag, 19. März 2012 01:37:02 UTC+1 schrieb Felipe Roman:









  Hi,

  Has someone ever seen only one controller does not access the cake session
  ?

  The session works fine for all controllers except for one specific
  controller. I tried debug the problem but I didn't find the reason.

  The controller code:

  class ExecutivosController extends AppController {

          var $name = 'Executivos';
          var $uses = array('Executivo', 'FormacaoAcademica',
  'FormacaoComplementar', 'Executivo', 'Empresa', 'Unidade', 'Cargo',
  'ExecutivoCargo', 'AtuacaoProfissional', 'ExecutivoIdioma', 'Decisao',
  'Mobilidade', 'PotencialProntidao', 'Arquivo', 'Usuario');
          var $components = array('RequestHandler', 'Email');

          function index() {

                  // Get login information
                  $Login = $this-Session-read('Login');

                  debug($_SESSION);
                  debug($Login);

  and the others controllers are similar:

  ?php
  class CargosController extends AppController {

          var $name = 'Cargos';
          var $uses = array('Cargo', 'Empresa', 'Unidade', 'Executivo',
  'RespostaColaboradore');
          var $components = array('RequestHandler', 'Email');

          function index() {
              // Le informações de login
              $Login = $this-Session-read('Login');

              debug($_SESSION);
              debug($Login);

  When I access the Cargos controller all session information are
  printed by debug funcion as expected, when I try access the first one
  the Session and $_SESSION is empty. If I reload the second one again
  the session values are still there (it means the session isn't
  erased).

  The app_controller.php file:

  class AppController extends Controller {
      var $helpers = array('Html', 'Javascript', 'Session', 'Ajax',
  'Time', 'Form');

      function  beforeFilter() {
          //debug($this);
          if (($this-name != Usuarios) or ($this-action != 'login')){

              if($this-Session-read('Login')) {
              } else {
                  $this-Session-setFlash(__('Efetue o login para
  acessar o sistema', true));
                  $this-redirect(array('controller' = 'usuarios',
  'action' = 'login'));
              }
          }
      }

  Has someone have any ideas why the Executivos controller can't access
  the session ?

  Thanks

  --
  Best Regards,
  Felipe Roman
  Phone 55 51 8454 8110
  LinkedInhttp://au.linkedin.com/in/feliperoman

-- 
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: Would PHP 5.3 stop cake cron job working?

2012-03-28 Thread sarahlou
Thanks for the reply.

The problem was actually caused by depreciated function in Cake
1.2.8284 / PHP 5.3.  E.g.:

Deprecated: Assigning the return value of new by reference is
deprecated in .../cake/libs/model/connection_manager.php on line 106

Fixed by upgrading to the lastest 1.2.x version of Cake (just replaced
Cake directory), and also removing the '' from the following lines in
my APP/vendors/shells/tasks/email.php
$this-Controller = new Controller();
$this-Email = new EmailComponent(null);

Thanks,
Sarah

On Mar 27, 3:03 pm, LunarDraco mdc...@gmail.com wrote:
 Without a bit more detail, I would guess that the new PHP 5.3 does not
 have mail setup by default and from a hosting service this usually
 requires a request before they will enable it.
 You can check that if you have ssh access to the server console by
 inspecting the php.ini
 Look for the setting for mail or smtp.

 You should also see some messages in the log file for php/apache
 indicating the function you are trying to use is unavailable or not
 defined.

 On Mar 26, 10:51 am, sarahlou sa...@hexagonwebworks.com wrote:







  I have a site (originally built back in 2009) with a couple of cron
  jobs for order notification emails. The site is running CakePHP
  version 1.2.4.8284

  After the hosting server was upgraded to PHP 5.3, the cron jobs appear
  to have stopped working (they still run, but no email is sent). The
  website itself is still functioning ok.

  Is this likely to be a conflict between the Cake version  PHP 5.3.
  Does anyone have any advice as to the best way around this?

  Many thanks,

  Sarah

-- 
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: Cakephp 2.1 ACL Issue

2012-03-28 Thread 0x20h
Please provide more information on your setup and your problem,
otherwise nobody is going to be able help you.


Am 27.03.2012 09:02, schrieb sneha:
 Hi,

 I am using the ACL component of cakephp 2.1, I am facing issue with
 acl permissions check. I have integrated the ACL and created the
 groups / users. But the page level check is not working for the same.

 Please guide me on the same.


-- 
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: doubt of join in cakephp

2012-03-28 Thread Loren Cole
There's a pretty good example of a join
herehttp://bakery.cakephp.org/articles/nate/2009/01/21/quick-tip-doing-ad-hoc-joins-in-model-find
.

Essentially you want to do something like

$records = $this-offerpromo-find('all', array(
'conditions' = array('Offerpromo.end_date ' . date()),
'joins' = array(
 array( 'table'='db_offer',
  'alias' = 'Offer',
  'conditions'=''Offer.offer_id = Offerpromo.offer_id))
);

On Wed, Mar 28, 2012 at 4:12 AM, LITTO CHACKO li...@axtecindia.com wrote:

 Hello, i have a doubt regarding join in cakephp. i have a primary key
 which is a foreign key of other table... i want to retrieve the table
 along with values s in othertable by checking some condition sin two
 tables.
 fields in first table:-  db_offer
offer_idseller_id   package_id  category_id
 reference_notitle
 description extra_details   offer_price original_price
  offer_weblink
 published   offer_coverimagestart_date  end_date
  gallery_typeflash_file
 width   height  embed_code  notes   hot_deals   cleranace_deals
 today_special
 views

 other table:-db_offerpromotion
id  offer_idoffer_type  start_date  end_date
  added_date  published

 i want to retrive all values of offer with offerid from two tables
 with condition that todays date less than end datyes of offerpromo..
 can u please help..me..it's urgent?? how i can do this???

 when iam using hasmany... it retreives table but it is not performing
 check condition..pls help??

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


Call to a member function setState() on a non-object

2012-03-28 Thread Neeraj kumar
Call to a member function setState() on a non-object in /home/content/
t/m/g/tmgadvisors/html/dev/modules/mod_cn_latestarticlesplus/
helper.php on line 30


http://www.marxgroupadvisors.com/dev/contact-us...


when click on my contact-us page this error is shown plz help me out

i  will be very thank



Regard
Neeraj

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


find('all') with group by on postgres

2012-03-28 Thread Gabriela Davila
Hi Everyone!

I am using cakePHP 1.3 and I do love working with the framework, but 
sometimes, it sucks!

I am also using postgres 8.3 and I noticed some issues regarding the use of 
the group clause on the find() and paginate() the main problem is: when you 
use those methods, it ALWAYS included the id field. So I am asking, 
anyone here has a work around for that excepts writing the query it self? 
because I DO want to use the paginate() so I can manage in a better way 
filters and the view itself.

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


CakePHP Controller Testing with DB Sessions

2012-03-28 Thread jcrens8392
Hi all,

I'm new to Cake and had controller test cases working fine.

However, I just recently switched to DB sessions and now all my controller 
test cases throw a MissingTableException:

Table cake_sessions for model Session was not found in datasource test.

I have no idea even where to begin on this. Any ideas!

Thanks!

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Group By Problem with PostgreSQL

2012-03-28 Thread Gabriela Davila
Did you weere able to do a work around?

On Tuesday, September 6, 2011 4:10:56 PM UTC-3, gabrielr wrote:

 Hi everybody. 

 I Have a problem making a GROUP BY operation with PostgreSQL Database. 

 This is my  Code 
 code 
 $apoyosEstado = $this-EncApoyo-find('all',array( 
   
 'fields'=array('MAX(Estado.estado_id) AS 
 edo_id','MAX(Estado.descripcion) AS 
 estado','COUNT(EncApoyo.enc_apoyo_id) AS total'), 
 'group'= 
 array('Estado.estado_id') 
 )); 
 /code 
 And It return an ERROR because Cake Adds the primary key to the SQL 
 QUERY. some like this: 

 SELECT MAX(Estado.estado_id) AS edo_id, 
 MAX(Estado.descripcion) AS estado, 
 COUNT(EncApoyo.enc_apoyo_id) AS total, EncApoyo.enc_apoyo_id 
 AS EncApoyo__enc_apoyo_id FROM enc_apoyos AS EncApoyo LEFT JOIN 
 estados AS Estado ON (EncApoyo.estado_id = 
 Estado.estado_id) WHERE 1 = 1 GROUP BY Estado.estado_id 

 This is an error because in PostgreSQL fields to display in a GROUP BY 
 query must be contained in an aggregate function. 

 If someone knows who solve it, answer me please. 

 Thanks.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


count from different model in find by id

2012-03-28 Thread elogic
I have a find (below) that selects all users so I can loop through them in 
a foreach on the view page. I need to add in some count fields that are 
separate from another table (one of the count finds is below).

How would you suggest I can do this easily?

$staffmembers = $this-User-find('all', array(
'fields' = array('User.id', 'User.first_name', 
'User.last_name'),
'conditions' = array('User.group_id' = 3),
'recursive' = 0
));

$currenttasks = $this-Task-find('count', array('conditions' = 
array('Task.completed' = 0, 'Task.user_id' = $staffmembers['User']['id'], 
'Task.due_date ' = date(Y-m-d;


So it can somehow be displayed on the page (code is not accurate, just to 
explain the situation):

foreach $staffmembers as $user 
{
  echo $user['User']['first_name'] - $currenttasks (for this user)
}



Is there a way to use a subquery or somehow make the currenttask a field 
selected in the first thing to get into the array?

Thanks

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: read filename of current view file in pages

2012-03-28 Thread lowpass
Are you using Cake's PageController, or have you implemented your own?
Have a look at how that does it.


On Sun, Mar 25, 2012 at 12:02 PM, Ivo Wolgensinger
wolgensin...@gmail.com wrote:
 Dear all

 I'm doing my website multilingual. Now I'm working on the pages handling.
 Most of them works fine.
 If somebody calls www.mydomain/pages/about_us (or
 www.mydomain/ita/pages/about_us) then I want (in the AppController) to read
 the name of about_us. In this case it's about_us.ctp in the pages folder.
 I want to create a switch and have to ask which page it is. Then I can check
 if the file exists in the exact folder (ex. pages/ita/about_us.ctp)

 How can I get the filename? I tried to do this: $this-action, but the
 action is display, so I need another solution.

 Any ideas?

 Thank you very much.

 Ivo

 --
 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 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: count from different model in find by id

2012-03-28 Thread elogic
I ended up doing the following which works but I do wonder is there a 
better cakePHP way.

Thanks

REPORTS CONTROLLER

// LOAD REQUIRED MODELS
// ---
$this-loadModel('User');
$this-loadModel('Task');


// SELECT STAFF MEMEBRS
// ---
$staffmembers = $this-User-find('all', array(
'fields' = array('User.id', 'User.first_name', 
'User.last_name'),
'conditions' = array('User.group_id' = 3, 
'User.active' = 1),
'recursive' = 0
));
$this-set('staffmembers', $staffmembers);


// FOR EACH STAFF MEMEBR WORK OUT THE COUNT INTO AN ARRAY
// 

foreach ($staffmembers as $staff) 
{
$currenttasks[] = $this-Task-find('count', array('conditions' 
= array('Task.completed' = 0, 'Task.user_id' = $staff['User']['id'], 
'Task.due_date ' = $thedate)));
$completedtasks[] = $this-Task-find('count', 
array('conditions' = array('Task.completed' = 1, 'Task.user_id' = 
$staff['User']['id'])));
$overduetasks[] = $this-Task-find('count', array('conditions' 
= array('Task.completed' = 0, 'Task.user_id' = $staff['User']['id'], 
'Task.due_date ' = $thedate)));

$this-set('currenttasks', $currenttasks);
$this-set('completedtasks', $completedtasks);
$this-set('overduetasks', $overduetasks);
}

REPORT TASK VIEW
$i = 0;
foreach ($staffmembers as $row) 
{ 
$thefullname = $row['User']['first_name'] . ' ' . 
$row['User']['last_name'];
$theuserid = $row['User']['id'];
   echo data.addRow(['.$thefullname.', 
.$currenttasks[$i]., .$completedtasks[$i]., .$overduetasks[$i].]);; 
$i++;
} 


-- 
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: How to test this controller?

2012-03-28 Thread resting
Thanks. Manged to get it working following the documentation.

On Wednesday, 28 March 2012 20:51:20 UTC+8, Rodrigo Rodrigues Moyle wrote:

 Use testAction()

 http://book.cakephp.org/2.0/en/development/testing.html#testing-controllers


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


MeioUpload 4.0 and CakePHP 2.1

2012-03-28 Thread Thiago Silva
Hello,

I'm trying to use MeioUpload 4.0 with CakePHP 2.1, but I'm getting
this error:

Warning (2): finfo_file(A): failed to open stream: No such file or
directory [APP/Plugin/MeioUpload/Model/Behavior/
MeioUploadBehavior.php, line 578]

Warning (2): mime_content_type(A) [http://php.net/function.mime-
content-type]: failed to open stream: No such file or directory [APP/
Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 584]

Can anybody help me?

Thanks,
Thiago

-- 
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: doubt of join in cakephp

2012-03-28 Thread LITTO CHACKO
hello,guys i got amuch perfect logic fro our cakephp buddy rodigreas..
he ask me to link from offerpromo table to offer..and use belongs to
condition and i write it like this:-
function getallhot(){
$this-belongsTo=
array('Offer'=array('className'='Offer','foreignKey'='offer_id','counterCache'=true));

$date=date('Y-m-d');
$dat=strtotime($date);
$end=strtotime('Offer.`end_date`');
$cond=Offer.`hot_deals`='1' AND Offer.`published`='1' AND
TO_DAYS(Offer.`end_date`)=TO_DAYS('$date') AND
TO_DAYS(Offerpromo.`end_date`)=TO_DAYS('$date');

$data   =   $this-find('all',array('conditions'=$cond));

/*$query=SELECT t.*,b.title FROM  hly_comment AS t, hly_movies 
AS b
WHERE t.id=b.movie_id;
$data=mysql_query($query);*/
$this-totalRecords =count($data);

return $data;
}



now it works fine thanks:-)

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Doubt regarding sessions in cakephp

2012-03-28 Thread LITTO CHACKO
hai, buddies iam currently working in a project which contains as
many forms.. so i have to attach captcha to each form for ensuring
security... so the problem is that... actually captcha is working with
help of sessions... u all know.. whwn iam testing it on local server
it works fine with captcha and submitting form.. but whwn i do the
same in main server.. i didn't get the value of captcha stored in
session??? pls anyone clear this doubt by giving effective
solutions??? beacuse of this pblm by project is in vain

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