[symfony-users] PHP 5.3 Changes

2009-01-28 Thread roberto german puentes diaz
It's very interesting
http://wiki.php.net/doc/scratchpad/upgrade/53

The article cause me to make my own function for any PHP function.??.. As
almost we can not trust in nothing more,
example:
usort (don't take objects anymore as parameters)
__toString magic method can not accept parameters :(   jejej :p


Quiz:
(int) ( ((0.7) + (0.1)) * 10 ) = ( ((0.7) + (0.1)) * 10 ) 

How do you think is the better way???

http://wiki.php.net/rfc/rounding
-- 
Cr. Puentes Diaz
MP 10.12726.9
Córdoba - Argentina

www.puentesdiaz.com.ar/blog/
www.puentesdiaz.com.ar/blog/novedades
www.puentesdiaz.com.ar/blog/curriculum-vitae
Linux User n° 441474
Ubuntu/Symfony/Eclipse Rocks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



Re: Re : [symfony-users] Re: New symfony eclipse plugin -sfEclipse

2009-01-28 Thread Nathanael D. Noblet

cokker wrote:
> Hi all
> 
> machomic already wrote me a mail concerning this. I think this is a good 
> idea. We have to talk about this and will you inform you of the result.
> 
> During waiting you could suggest a new name of a common project. :)

I don't really care what the project is called, but I would think 
sfEclipse, or eclipse-symfony, or just plain symfony. Yeah, why not 
symfony? eclipse.org/projects/symfony ?


-- 
Nathanael d. Noblet
Gnat Solutions, Inc
T: 403.875.4613

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



Re: Re : [symfony-users] Re: New symfony eclipse plugin -sfEclipse

2009-01-28 Thread Nathanael D. Noblet

Loïc Vernet wrote:
> Big +1  

Yeah, I wish I had more time and I would also help. I think this is 
likely the third plugin out there... so combining the skills everyone 
has is so much more useful.

-- 
Nathanael d. Noblet
Gnat Solutions, Inc
T: 403.875.4613

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



Re: Re : [symfony-users] Re: New symfony eclipse plugin -sfEclipse

2009-01-28 Thread cokker

Hi all

machomic already wrote me a mail concerning this. I think this is a good 
idea. We have to talk about this and will you inform you of the result.

During waiting you could suggest a new name of a common project. :)

greets
Sven

Loïc Vernet schrieb:
> Big +1   
> 
> 
> 
> 
> 
> De : Nathanael D.. Noblet 
> À : symfony-users@googlegroups.com
> Envoyé le : Mercredi, 28 Janvier 2009, 21h15mn 02s
> Objet : [symfony-users] Re: New symfony eclipse plugin -sfEclipse
> 
> 
> machomic wrote:
>> Hi, I'd like to introduce my symfony eclipse plugin called sfEclipse.
>> It is hosted on sourceforge at http://sfeclipse.sourceforge.net. This
>> is a first pre-alpha release, so can has some bugs and it's cuted to
>> only few finished features. I don't have so much time and list of
>> features which should be implemented is very long, so need some help.
>> If anyone would join project and participate developing please contact
>> me directly. I’ll appreciate any feedback.
> 
> Just a thought, but you might want to combine forces/efforts with
> http://sfdt.borox.ch/ author emailed this list a while ago 
> (cokker...@googlemail.com). Two people working on one plugin is likely 
> better than two people on separate plugins...
> 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



Re : [symfony-users] Re: New symfony eclipse plugin -sfEclipse

2009-01-28 Thread Loïc Vernet
Big +1   





De : Nathanael D.. Noblet 
À : symfony-users@googlegroups.com
Envoyé le : Mercredi, 28 Janvier 2009, 21h15mn 02s
Objet : [symfony-users] Re: New symfony eclipse plugin -sfEclipse


machomic wrote:
> Hi, I'd like to introduce my symfony eclipse plugin called sfEclipse.
> It is hosted on sourceforge at http://sfeclipse.sourceforge.net. This
> is a first pre-alpha release, so can has some bugs and it's cuted to
> only few finished features. I don't have so much time and list of
> features which should be implemented is very long, so need some help.
> If anyone would join project and participate developing please contact
> me directly. I’ll appreciate any feedback.

Just a thought, but you might want to combine forces/efforts with
http://sfdt.borox.ch/ author emailed this list a while ago 
(cokker...@googlemail.com). Two people working on one plugin is likely 
better than two people on separate plugins...

-- 
Nathanael d. Noblet
Gnat Solutions, Inc
T: 403.875.4613



  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: New symfony eclipse plugin -sfEclipse

2009-01-28 Thread Nathanael D. Noblet

machomic wrote:
> Hi, I'd like to introduce my symfony eclipse plugin called sfEclipse.
> It is hosted on sourceforge at http://sfeclipse.sourceforge.net. This
> is a first pre-alpha release, so can has some bugs and it's cuted to
> only few finished features. I don't have so much time and list of
> features which should be implemented is very long, so need some help.
> If anyone would join project and participate developing please contact
> me directly. I’ll appreciate any feedback.

Just a thought, but you might want to combine forces/efforts with
http://sfdt.borox.ch/ author emailed this list a while ago 
(cokker...@googlemail.com). Two people working on one plugin is likely 
better than two people on separate plugins...

-- 
Nathanael d. Noblet
Gnat Solutions, Inc
T: 403.875.4613

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: sfDoctrineGuardPlugin, User-model, is_active column

2009-01-28 Thread Jonathan Wage
Copy the schema for sfGuardUser from the plugin to your project and you can
customize it.

- Jon

On Wed, Jan 28, 2009 at 7:17 AM, FX Poster  wrote:

>
> Yes, and what? :)
> >
>


-- 
Jonathan H. Wage
Open Source Software Developer & Evangelist
http://www.jwage.com
http://www.doctrine-project.org
http://www.symfony-project.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Override save() of embedded forms

2009-01-28 Thread Michael Smith

I have an embedded sfFormDoctrine which I was trying to override the
save method so that if key fields are blank then the object isn't
saved to the db but it appears that saveEmbeddedForms() at line 396
saves the object of embeded forms directly without calling the
embedded form's save method. Is there a way around this?

Thanks,
Michael
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Routing Rules

2009-01-28 Thread bpfar...@gmail.com

Also, if it helps, it works perfectly in my dev environment but not in
prod.

On Jan 28, 9:49 am, "bpfar...@gmail.com"  wrote:
> I'm trying to use a custom routing rule so that users can have a
> dedicated URL that goes to a specific dynamic page.  The routing rule
> is this:
>
> network_custom:
>   url:     /:custom_url
>   class:   sfPropelRoute
>   options: { model: Network, type: object }
>   param:   { module: network, action: view }
>
> The first problem is that any module indexes are misinterpreted as
> network URL's.  I got around this by defining each module index as a
> routing rule, for example:
>
> home_index:
>   url:    /home
>   param:  { module: home, action: index }
>
> The problem I'm running into now is that whenever I go to /home, I
> can't render the network_custom routing rule, this code throws an
> error:
>
> getName(), 'network_custom', $network) ?>
>
> "The "/:state_slug/:id/:name_slug" route has some missing mandatory
> parameters (:state_slug, :id, :name_slug)."
>
> However, when I go to /home/index, everything is fine.  This seems
> like a weird error, if anyone could help I would hugely appreciate it.
>
> Thanks,
>
> -Brendan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Routing Rules

2009-01-28 Thread bpfar...@gmail.com

I'm trying to use a custom routing rule so that users can have a
dedicated URL that goes to a specific dynamic page.  The routing rule
is this:

network_custom:
  url: /:custom_url
  class:   sfPropelRoute
  options: { model: Network, type: object }
  param:   { module: network, action: view }

The first problem is that any module indexes are misinterpreted as
network URL's.  I got around this by defining each module index as a
routing rule, for example:

home_index:
  url:/home
  param:  { module: home, action: index }

The problem I'm running into now is that whenever I go to /home, I
can't render the network_custom routing rule, this code throws an
error:

getName(), 'network_custom', $network) ?>

"The "/:state_slug/:id/:name_slug" route has some missing mandatory
parameters (:state_slug, :id, :name_slug)."

However, when I go to /home/index, everything is fine.  This seems
like a weird error, if anyone could help I would hugely appreciate it.

Thanks,

-Brendan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfDoctrinePlugin and DB clustering (master slave replication)

2009-01-28 Thread Janek

Hello,

After reading those articles:
http://www.doctrine-project.org/documentation/cookbook/1_1/e n/master-
and-slave-connections
http://www.symfony-project.org/book/doctrine/1_2/en/03-Confi guration

I wanted to create my own classes to handle master/slave DB
connections in Symfony using sfDoctrinePlugin.

I have created /lib/myDoctrineQuery.class.php file:

class rdDoctrineQuery extends Doctrine_Query
{
// Since php doesn't support late static binding in 5.2 we need to
override
// this method to instantiate a new MyQuery instead of
Doctrine_Query

public static function create($conn = null)
{
return new rdDoctrineQuery ($conn);
}

public function preQuery()
{
// If this is a select query then set connection to one of the
slaves

if ($this->getType() == Doctrine_Query::SELECT) {
$this->_conn = Doctrine_Manager::getInstance()-
>getConnection('slave_' . rand(1, 2));
// All other queries are writes so they need to go to the
master

} else {
$this->_conn = Doctrine_Manager::getInstance()-
>getConnection('master');
}
}
}


an /lib/myDoctrineRecord.class.php:

abstract class rdDoctrineRecord extends sfDoctrineRecord
{
  public function save(Doctrine_Connection $conn = null)
  {
// If specific connection is not provided then lets force the
connection
// to be the master

if ($conn === null)
{
$conn = Doctrine_Manager::getInstance()->getConnection
('master');
}
parent::save($conn);
  }
}

In my /config/ProjectConfigration.class.php I've added following code:

  public function configureDoctrine(Doctrine_Manager $manager)
  {
$options = array('baseClassName' => 'rdDoctrineRecord');
sfConfig::set('doctrine_model_builder_options', $options);
  }

It works well with single objects, but I'd really love to take
advantage of master slave DB replication in Doctrine::getTable().

The articles I found on the Internet and in Doctrine Cookbook say
about extending Doctrine_Record and Doctrine_Query, but is it possible
to use this strategy with Doctrine::getTable() as well?

Thanks in advance for your replies,
Janek

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: sfDoctrineGuardPlugin, User-model, is_active column

2009-01-28 Thread FX Poster

Yes, and what? :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: sfDoctrineGuardPlugin, User-model, is_active column

2009-01-28 Thread Lee Bolding

Really, it should be false by default IMHO.

It's the more secure approach. Users disabled by default, unless  
specifically enabled via code (1 line extra in a registration logic,  
no change needed for a "you must activate this account" paradigm).

Makes sense, no?

On 28 Jan 2009, at 12:36, FX Poster wrote:

>
> In plugin's sfGuardUser model the is_active column is set to true by
> default. How can it be set to false without modifying the plugin and
> without writing code (I know, that I can override column definition in
> setTableDefinition, but I'd like keep such things in yaml-files).
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfDoctrineGuardPlugin, User-model, is_active column

2009-01-28 Thread FX Poster

In plugin's sfGuardUser model the is_active column is set to true by
default. How can it be set to false without modifying the plugin and
without writing code (I know, that I can override column definition in
setTableDefinition, but I'd like keep such things in yaml-files).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: functional test authentication

2009-01-28 Thread dantleech

thanks Jerome

I am doing something similar, though our project started life off with
sf1.0 so the login page doesnt use the form framework.

-- test browser
class emTestBrowser extends sfTestFunctional
{
  public function loadData()
  {
// load fixtures..
  }
  public function loginOk()
  {
$this -> post('/customer/login', array('email' =>
'ad...@example.com', 'password' => 'wibble');
$this -> isRedirected();

return $this;
  }
}

 test
$browser = new emTestBrowser(new sfBrowser());
$browser -> initialize();
$browser -> loadData();
$browser -> loginOk();

$browser->
  get('/someModule/index')->
  isStatusCode(200)->
  isRequestParameter('module', 'someModule')->
  isRequestParameter('action', 'index')->
  isRequestParameter('mailbox_id', 1)->
  checkResponseElement('body', 'Something')->
  end();



The problem is that we do not get as far as the first assertion in
emTestBrowser::loginOk. The login code calls [->redirect] and that
throws an sfStopException which, err, stops everything. If I remove
the redirect from the login code then the tests proceed as expected. I
know I must be missing something here otherwise assertions such as [-
>isRedirected] would be pretty pointless :)

On 28 Jan, 09:34, Jérôme TEXIER  wrote:
> Did you try to use the specific sfTesterUser to check the state of the
> your user :
>
> with('user')->begin()->
>  isAuthenticated()->
> end()
>
> One good point dealing with signin/signout operations on functional
> test is to write a reusable class for those kind of test, something
> like :
>
> class sfGuardTestFunctional extends sfTestFunctional {
>   public function signinOk($user_data)
>   {
>     return $this->
>       info(sprintf('Connexion with login : "%s" and password "%s"
> should be ok OK.', $user_data['username'], $user_data['password']))->
>       get('/login')->
>       click('login',array('signin'=>$user_data))->
>
>       with('form')->begin()->
>         hasErrors(false)->
>       end()->
>
>       with('user')->begin()->
>         isCulture('en')->
>         isAuthenticated(true)->
>       end()->
>
>       with('request')->begin()->
>         isParameter('module', 'sfGuardAuth')->
>         isParameter('action', 'signin')->
>       end()->
>
>       isRedirected();
>   }
>   //could add signout, signinError methods here
> ?>
>
> So on your fonctional test, you can use the signin test :
>
> $browser = new sfGuardTestFunctional(new sfBrowser()); //rather than
> $browser = new sfTestFunctional(new sfBrowser())
> $browser->signinOk(array('username'=>'foo','password'=>'bar'));
>
> Regards.
>
> Jérôme
>
> On 27 jan, 15:00, dantleech  wrote:
>
> > cheers alecs
>
> > though im not sure that your examples addresses my problem of
> > authenticating the user before function testing a page ... what I
> > meant by sfContext::getUser() was
>
> >  >   $user = sfContext::getInstance() -> getUser();
> >   $user -> login($user_object);
>
> > On 27 Jan, 13:00, Lupu Alexandru-Emil  wrote:
>
> > > On Tue, Jan 27, 2009 at 1:17 PM, dantleech  wrote:
>
> > > > I am trying to write functional tests for an authenticated
> > > > application, but every time I authenticate the user it seems that the
> > > > users state is reset every time,
>
> > > >  i.e. the next [-> get] doesn't seem to recognize the fact that I
> > > > have previously authenticated the user and when running the test I
> > > > receive the login HTML rather than the page I want to test
>
> > > > I have tried both authenticating the user using sfContext::getUser()
> > > > and logging in manually by using:
>
> > > > $sf_test_functional -> post('/user_plugin_module/login', array('email'
> > > > => 'b...@blah.com', 'password' => 'blah');
>
> > > > and the dev log seems to suggest that the user was indeed logged in,
> > > > but the subsequent request redirects to the login page anyway ..
>
> > > > cheers
>
> > > > dan
>
> > > Hi!
> > > before you call "sfContext::getUser()" each time, you could try
> > > 
> > > $my_test_user = sfContext::getUser();
> > > $my_test_user->getFOO();
> > > 
> > > ?>
> > > Also you might wanna try :
> > >  > > $context = sfContext::getInstance();
> > > $my_test_user = $context->getUser();
> > > $my_test_user->getFOO();
> > > 
> > > ?>
>
> > > Alecs
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Liste de selection en cascade dans l'admin generator

2009-01-28 Thread Olivier Revollat
I have a module generated by the admin generator to manage customer
testimony related to a product ... so in my schema I have :

  testimony:
id:
  type: INTEGER
  required: true
  autoIncrement: true
  primaryKey: true
product_id:
  type: INTEGER
  required: true
  foreignTable: product
  foreignReference: id
...
...


so in the corresponding sfForm I have the following widget :

'product_id'=> new sfWidgetFormPropelChoice(array('model' => 'Product',
'add_empty' => false)),

So I choose the product with a select list ... so far so good ...

BUT ... I have many products so it's not practical to associate a product to
a testimony like this ...
On the other hand, my products are under categorie/sub-categorie so what I
want to do is to chose a product with cascading select box (other something
else) so I can choose the category, then the sub-category and then the
product ... but I don't know how to implement this in the admin generator
... create a new widget ? with embrded forms ?

Any ideas, suggestions, code sample , ... ?

Thanks :)

Le 28 janvier 2009 10:45, Lupu Alexandru-Emil  a écrit
:

> HI!
> English please!
> Alecs
>
> 2009/1/28 Olivier Revollat 
>
>> Bonjour,
>>
>> j'ai un module développé avec l'admin generator qui liste des témoignages
>> clients relatifs à des produits.
>> Dans l'admin, pour ajouter un de ces témoignages je dois donc lui associer
>> un produit ... seulement la liste des produits généré via le widget suivant
>> est longue :
>>
>> 'product_id'=> new sfWidgetFormPropelChoice(array('model' =>
>> 'Product', 'add_empty' => false)),
>>
>> Or les produits sont classés par famille / sous-famille (un produit
>> appartient a un unique couple famille/sous-famille)
>>
>> L'idée serait donc d'avoir trois liste de selection : on choisit la
>> famille (ce qui rafraichit la liste des sous familles) ensuite on choisit la
>> sous famille (ce qui liste les produits disponibles dans cete sous-famille)
>> ...
>>
>> Mais je ne sais pas trop par ou commencer pour avoir ce comportement via
>> l'admin generator (embedded form ? Avec Ajax ? comment faire pour les
>> valiators ?)
>>
>>
>> Si vous avez des suggestions, bout de codes, exemples concrets , ...
>> j'éspère avoir été assez clair ...
>>
>> Merci à vous tous !! :)
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Admin generator and casdading refresh select list

2009-01-28 Thread Olivier Revollat
Hi !
I have a module generated by the admin generator to manage customer
testimony related to a product ... so in my schema I have :

  testimony:
id:
  type: INTEGER
  required: true
  autoIncrement: true
  primaryKey: true
product_id:
  type: INTEGER
  required: true
  foreignTable: product
  foreignReference: id
...
...


so in the corresponding sfForm I have the following widget :

'product_id'=> new sfWidgetFormPropelChoice(array('model' => 'Product',
'add_empty' => false)),

So I choose the product with a select list ... so far so good ...

BUT ... I have many products so it's not practical to associate a product to
a testimony like this ...
On the other hand, my products are under categorie/sub-categorie so what I
want to do is to chose a product with cascading select box (other something
else) so I can choose the category, then the sub-category and then the
product ... but I don't know how to implement this in the admin generator
... create a new widget ? with embrded forms ?

Any ideas, suggestions, code sample , ... ?

Thanks :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Liste de selection en cascade dans l'admin generator

2009-01-28 Thread Olivier Revollat
Oops sorry, I would like to send to symfony...@googlegroups.com and I send
it here, it's a mistake ...however , I want to implement multiple select box
how refresh each other to select a product (before I select a category and a
sub category) ...

Le 28 janvier 2009 10:45, Lupu Alexandru-Emil  a écrit
:

> HI!
> English please!
> Alecs
>
> 2009/1/28 Olivier Revollat 
>
>> Bonjour,
>>
>> j'ai un module développé avec l'admin generator qui liste des témoignages
>> clients relatifs à des produits.
>> Dans l'admin, pour ajouter un de ces témoignages je dois donc lui associer
>> un produit ... seulement la liste des produits généré via le widget suivant
>> est longue :
>>
>> 'product_id'=> new sfWidgetFormPropelChoice(array('model' =>
>> 'Product', 'add_empty' => false)),
>>
>> Or les produits sont classés par famille / sous-famille (un produit
>> appartient a un unique couple famille/sous-famille)
>>
>> L'idée serait donc d'avoir trois liste de selection : on choisit la
>> famille (ce qui rafraichit la liste des sous familles) ensuite on choisit la
>> sous famille (ce qui liste les produits disponibles dans cete sous-famille)
>> ...
>>
>> Mais je ne sais pas trop par ou commencer pour avoir ce comportement via
>> l'admin generator (embedded form ? Avec Ajax ? comment faire pour les
>> valiators ?)
>>
>>
>> Si vous avez des suggestions, bout de codes, exemples concrets , ...
>> j'éspère avoir été assez clair ...
>>
>> Merci à vous tous !! :)
>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Symfony 1.2 + Doctrine + memcached.

2009-01-28 Thread Lee Bolding

With sf1.1, yes.

It works great :)

On 28 Jan 2009, at 10:03, Tsyrulnik V. wrote:

>
> Hello.
>
> If someone want to share experience about using memcached with
> doctrine on symfony - that would be great.
> Im interesting in caching results of quries. I saw manual @
> doctrine-project, but i just want to know if any has implemented it
> yet inside sf project ?
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Symfony 1.2 + Doctrine + memcached.

2009-01-28 Thread Tsyrulnik V.

Hello.

If someone want to share experience about using memcached with
doctrine on symfony - that would be great.
Im interesting in caching results of quries. I saw manual @
doctrine-project, but i just want to know if any has implemented it
yet inside sf project ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Liste de selection en cascade dans l'admin generator

2009-01-28 Thread Lupu Alexandru-Emil
HI!
English please!
Alecs

2009/1/28 Olivier Revollat 

> Bonjour,
> j'ai un module développé avec l'admin generator qui liste des témoignages
> clients relatifs à des produits.
> Dans l'admin, pour ajouter un de ces témoignages je dois donc lui associer
> un produit ... seulement la liste des produits généré via le widget suivant
> est longue :
>
> 'product_id'=> new sfWidgetFormPropelChoice(array('model' => 'Product',
> 'add_empty' => false)),
>
> Or les produits sont classés par famille / sous-famille (un produit
> appartient a un unique couple famille/sous-famille)
>
> L'idée serait donc d'avoir trois liste de selection : on choisit la famille
> (ce qui rafraichit la liste des sous familles) ensuite on choisit la sous
> famille (ce qui liste les produits disponibles dans cete sous-famille) ...
>
> Mais je ne sais pas trop par ou commencer pour avoir ce comportement via
> l'admin generator (embedded form ? Avec Ajax ? comment faire pour les
> valiators ?)
>
>
> Si vous avez des suggestions, bout de codes, exemples concrets , ...
> j'éspère avoir été assez clair ...
>
> Merci à vous tous !! :)
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Liste de selection en cascade dans l'admin generator

2009-01-28 Thread Lupu Alexandru-Emil
HI!
English please!
Alecs

2009/1/28 Olivier Revollat 

> Bonjour,
> j'ai un module développé avec l'admin generator qui liste des témoignages
> clients relatifs à des produits.
> Dans l'admin, pour ajouter un de ces témoignages je dois donc lui associer
> un produit ... seulement la liste des produits généré via le widget suivant
> est longue :
>
> 'product_id'=> new sfWidgetFormPropelChoice(array('model' => 'Product',
> 'add_empty' => false)),
>
> Or les produits sont classés par famille / sous-famille (un produit
> appartient a un unique couple famille/sous-famille)
>
> L'idée serait donc d'avoir trois liste de selection : on choisit la famille
> (ce qui rafraichit la liste des sous familles) ensuite on choisit la sous
> famille (ce qui liste les produits disponibles dans cete sous-famille) ...
>
> Mais je ne sais pas trop par ou commencer pour avoir ce comportement via
> l'admin generator (embedded form ? Avec Ajax ? comment faire pour les
> valiators ?)
>
>
> Si vous avez des suggestions, bout de codes, exemples concrets , ...
> j'éspère avoir été assez clair ...
>
> Merci à vous tous !! :)
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: functional test authentication

2009-01-28 Thread Jérôme TEXIER

Did you try to use the specific sfTesterUser to check the state of the
your user :

with('user')->begin()->
 isAuthenticated()->
end()

One good point dealing with signin/signout operations on functional
test is to write a reusable class for those kind of test, something
like :

class sfGuardTestFunctional extends sfTestFunctional {
  public function signinOk($user_data)
  {
return $this->
  info(sprintf('Connexion with login : "%s" and password "%s"
should be ok OK.', $user_data['username'], $user_data['password']))->
  get('/login')->
  click('login',array('signin'=>$user_data))->

  with('form')->begin()->
hasErrors(false)->
  end()->

  with('user')->begin()->
isCulture('en')->
isAuthenticated(true)->
  end()->

  with('request')->begin()->
isParameter('module', 'sfGuardAuth')->
isParameter('action', 'signin')->
  end()->

  isRedirected();
  }
  //could add signout, signinError methods here
?>

So on your fonctional test, you can use the signin test :

$browser = new sfGuardTestFunctional(new sfBrowser()); //rather than
$browser = new sfTestFunctional(new sfBrowser())
$browser->signinOk(array('username'=>'foo','password'=>'bar'));

Regards.

Jérôme

On 27 jan, 15:00, dantleech  wrote:
> cheers alecs
>
> though im not sure that your examples addresses my problem of
> authenticating the user before function testing a page ... what I
> meant by sfContext::getUser() was
>
>    $user = sfContext::getInstance() -> getUser();
>   $user -> login($user_object);
>
> On 27 Jan, 13:00, Lupu Alexandru-Emil  wrote:
>
> > On Tue, Jan 27, 2009 at 1:17 PM, dantleech  wrote:
>
> > > I am trying to write functional tests for an authenticated
> > > application, but every time I authenticate the user it seems that the
> > > users state is reset every time,
>
> > >  i.e. the next [-> get] doesn't seem to recognize the fact that I
> > > have previously authenticated the user and when running the test I
> > > receive the login HTML rather than the page I want to test
>
> > > I have tried both authenticating the user using sfContext::getUser()
> > > and logging in manually by using:
>
> > > $sf_test_functional -> post('/user_plugin_module/login', array('email'
> > > => 'b...@blah.com', 'password' => 'blah');
>
> > > and the dev log seems to suggest that the user was indeed logged in,
> > > but the subsequent request redirects to the login page anyway ..
>
> > > cheers
>
> > > dan
>
> > Hi!
> > before you call "sfContext::getUser()" each time, you could try
> > 
> > $my_test_user = sfContext::getUser();
> > $my_test_user->getFOO();
> > 
> > ?>
> > Also you might wanna try :
> >  > $context = sfContext::getInstance();
> > $my_test_user = $context->getUser();
> > $my_test_user->getFOO();
> > 
> > ?>
>
> > Alecs
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Liste de selection en cascade dans l'admin generator

2009-01-28 Thread Olivier Revollat
Bonjour,
j'ai un module développé avec l'admin generator qui liste des témoignages
clients relatifs à des produits.
Dans l'admin, pour ajouter un de ces témoignages je dois donc lui associer
un produit ... seulement la liste des produits généré via le widget suivant
est longue :

'product_id'=> new sfWidgetFormPropelChoice(array('model' => 'Product',
'add_empty' => false)),

Or les produits sont classés par famille / sous-famille (un produit
appartient a un unique couple famille/sous-famille)

L'idée serait donc d'avoir trois liste de selection : on choisit la famille
(ce qui rafraichit la liste des sous familles) ensuite on choisit la sous
famille (ce qui liste les produits disponibles dans cete sous-famille) ...

Mais je ne sais pas trop par ou commencer pour avoir ce comportement via
l'admin generator (embedded form ? Avec Ajax ? comment faire pour les
valiators ?)


Si vous avez des suggestions, bout de codes, exemples concrets , ...
j'éspère avoir été assez clair ...

Merci à vous tous !! :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---