[symfony-users] Re: Multiple kind of profile with sfGuard

2011-06-01 Thread Olivier Revollat
up :)

2011/5/31 Olivier Revollat revol...@gmail.com

 I want to use http://www.symfony-project.org/plugins/sfDoctrineApplyPlugin
 To allow users to register themselves but I have two kind of profile with
 different fields ...

 for example say that
 profile_type_1 has type_1_fields_1 and type_1_field_2, ...
 and
 profile_type_2 has type_2_fields_1 and type_2_field_2

 my first idea was to mix all the fields in the same table
 (sf_guard_user_profile) and only display the required fields on the
 registration form ... but it sound very ugly :(
 So I think the best solution is the have two separate tables :

 sf_guard_user_profile_type_1
 and
 sf_guard_user_profile_type_2

 and dynamically get the right profile regarding, for example, the group
 whom the user belong to ...

 What do you think ? what is the best practice ?? code code examples ??

 Thansks for your help :)




-- 
*Pour résoudre un problème intéressant, commencez par trouver un problème
qui vous intéresse.*

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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: Multiple kind of profile with sfGuard

2011-06-01 Thread Olivier Revollat
I know inheritance in doctrine but I wonder if this could work correctly
with symfony forms ??
Does anybody use inheritance for the same kind of pb ??

2011/6/1 Grzegorz Śliwiński fi...@fizyk.net.pl

 Check out those two links about inheritance in Doctrine:


 http://www.symfony-project.org/more-with-symfony/1_4/en/09-Doctrine-Form-Inheritance

 http://www.doctrine-project.org/projects/orm/1.2/docs/manual/inheritance/en#inheritance



 On Jun 1, 9:46 am, Olivier Revollat revol...@gmail.com wrote:
  up :)
 
  2011/5/31 Olivier Revollat revol...@gmail.com
 
 
 
 
 
   I want to usehttp://
 www.symfony-project.org/plugins/sfDoctrineApplyPlugin
   To allow users to register themselves but I have two kind of profile
 with
   different fields ...
 
   for example say that
   profile_type_1 has type_1_fields_1 and type_1_field_2, ...
   and
   profile_type_2 has type_2_fields_1 and type_2_field_2
 
   my first idea was to mix all the fields in the same table
   (sf_guard_user_profile) and only display the required fields on the
   registration form ... but it sound very ugly :(
   So I think the best solution is the have two separate tables :
 
   sf_guard_user_profile_type_1
   and
   sf_guard_user_profile_type_2
 
   and dynamically get the right profile regarding, for example, the group
   whom the user belong to ...
 
   What do you think ? what is the best practice ?? code code examples ??
 
   Thansks for your help :)
 
  --
  *Pour résoudre un problème intéressant, commencez par trouver un problème
  qui vous intéresse.*

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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




-- 
*Pour résoudre un problème intéressant, commencez par trouver un problème
qui vous intéresse.*

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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: Multiple kind of profile with sfGuard

2011-06-01 Thread Olivier Revollat
Hey
http://www.symfony-project.org/plugins/sfForkedDoctrineApplyPlugin
sound good :)

2011/6/1 Olivier Revollat revol...@gmail.com

 I know inheritance in doctrine but I wonder if this could work correctly
 with symfony forms ??
 Does anybody use inheritance for the same kind of pb ??

 2011/6/1 Grzegorz Śliwiński fi...@fizyk.net.pl

 Check out those two links about inheritance in Doctrine:


 http://www.symfony-project.org/more-with-symfony/1_4/en/09-Doctrine-Form-Inheritance

 http://www.doctrine-project.org/projects/orm/1.2/docs/manual/inheritance/en#inheritance



 On Jun 1, 9:46 am, Olivier Revollat revol...@gmail.com wrote:
  up :)
 
  2011/5/31 Olivier Revollat revol...@gmail.com
 
 
 
 
 
   I want to usehttp://
 www.symfony-project.org/plugins/sfDoctrineApplyPlugin
   To allow users to register themselves but I have two kind of profile
 with
   different fields ...
 
   for example say that
   profile_type_1 has type_1_fields_1 and type_1_field_2, ...
   and
   profile_type_2 has type_2_fields_1 and type_2_field_2
 
   my first idea was to mix all the fields in the same table
   (sf_guard_user_profile) and only display the required fields on the
   registration form ... but it sound very ugly :(
   So I think the best solution is the have two separate tables :
 
   sf_guard_user_profile_type_1
   and
   sf_guard_user_profile_type_2
 
   and dynamically get the right profile regarding, for example, the
 group
   whom the user belong to ...
 
   What do you think ? what is the best practice ?? code code examples ??
 
   Thansks for your help :)
 
  --
  *Pour résoudre un problème intéressant, commencez par trouver un
 problème
  qui vous intéresse.*

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 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




 --
 *Pour résoudre un problème intéressant, commencez par trouver un problème
 qui vous intéresse.*




-- 
*Pour résoudre un problème intéressant, commencez par trouver un problème
qui vous intéresse.*

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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] Multiple kind of profile with sfGuard

2011-05-31 Thread Olivier Revollat
I want to use http://www.symfony-project.org/plugins/sfDoctrineApplyPlugin
To allow users to register themselves but I have two kind of profile with
different fields ...

for example say that
profile_type_1 has type_1_fields_1 and type_1_field_2, ...
and
profile_type_2 has type_2_fields_1 and type_2_field_2

my first idea was to mix all the fields in the same table
(sf_guard_user_profile) and only display the required fields on the
registration form ... but it sound very ugly :(
So I think the best solution is the have two separate tables :

sf_guard_user_profile_type_1
and
sf_guard_user_profile_type_2

and dynamically get the right profile regarding, for example, the group whom
the user belong to ...

What do you think ? what is the best practice ?? code code examples ??

Thansks for your help :)

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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 Doctrine column aggregation inheritance

2009-08-04 Thread Olivier Revollat
Hi does anybody tried to use Admin generator (1.2) with  this concept (column
aggregation inheritance) ... because it seems to have a bug
http://trac.symfony-project.org/ticket/6853
But it's not solved 

Any suggestion, info ?

--~--~-~--~~~---~--~~
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: sfLucene update

2009-07-27 Thread Olivier Revollat
Thanks for your work ... :) Do you know where can I find the last
documentation ?
2009/2/9 Thomas Rabaix thomas.rab...@gmail.com

 Hello,

 I have updated the sfLucene plugin with new tasks :

- rebuild-index : index only one index
- update-model : index one model for one index (doctrine only)
- update-model-system : index models or one model for one index using
sub system calls to avoid memory leak and issues with to many open files
(doctrine only)

 The changes are available on the svn :
  -
 http://svn.symfony-project.com/plugins/sfLucenePlugin/branches/1.2-Doctrine/

 Please feel free to report any bug/issues you may have. The plugin may
 works fine with symfony 1.1 and doctrine too.

 --
 Thomas Rabaix


 


--~--~-~--~~~---~--~~
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: sfLucene update

2009-07-27 Thread Olivier Revollat
When I try to rebuild the index I get this error (see below) . I am using
symfony 1.2.9-DEV ..
$ ./symfony lucene:rebuild frontend
Processing MyIndex/en now...
 LuceneRebuilding index...

Fatal error: Call to undefined method sfConfigCache::getinstance() in
C:\workspa
ces\zend\escotav2\plugins\sfLucenePlugin\lib\indexer\sfLuceneActionIndexerHandler.class.php
on line 45



2009/2/9 Thomas Rabaix thomas.rab...@gmail.com

 Hello,

 I have updated the sfLucene plugin with new tasks :

- rebuild-index : index only one index
- update-model : index one model for one index (doctrine only)
- update-model-system : index models or one model for one index using
sub system calls to avoid memory leak and issues with to many open files
(doctrine only)

 The changes are available on the svn :
  -
 http://svn.symfony-project.com/plugins/sfLucenePlugin/branches/1.2-Doctrine/

 Please feel free to report any bug/issues you may have. The plugin may
 works fine with symfony 1.1 and doctrine too.

 --
 Thomas Rabaix


 


--~--~-~--~~~---~--~~
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: sfLucene update

2009-07-27 Thread Olivier Revollat
Ok that explain why I have sevral error with this ...
I have replace

include(sfConfigCache::getInstance()-checkConfig($config));

With

include(sfContext::getInstance()-getConfigCache()-checkConfig($config));

Now this line of code work, but I still have problems loading actions name
... As you said, it's because it has not been rewite for sf 1.2 (this apply
only to action idexation, isn't it ?)
If I can help you, I will be glad ...

2009/7/27 Thomas Rabaix thomas.rab...@gmail.com

 The action indexation has not been ported to 1.1 and 1.2. I will try to fix
 that this week  shoot me an email if not ;)
 On Mon, Jul 27, 2009 at 3:54 PM, Olivier Revollat revol...@gmail.comwrote:

 When I try to rebuild the index I get this error (see below) . I am using
 symfony 1.2.9-DEV ..
 $ ./symfony lucene:rebuild frontend
 Processing MyIndex/en now...
  LuceneRebuilding index...

 Fatal error: Call to undefined method sfConfigCache::getinstance() in
 C:\workspa
 ces\zend\escotav2\plugins\sfLucenePlugin\lib\indexer\sfLuceneActionIndexerHandler.class.php
 on line 45



 2009/2/9 Thomas Rabaix thomas.rab...@gmail.com

 Hello,


 I have updated the sfLucene plugin with new tasks :

- rebuild-index : index only one index
- update-model : index one model for one index (doctrine only)
- update-model-system : index models or one model for one index using
sub system calls to avoid memory leak and issues with to many open files
(doctrine only)

 The changes are available on the svn :
  -
 http://svn.symfony-project.com/plugins/sfLucenePlugin/branches/1.2-Doctrine/

 Please feel free to report any bug/issues you may have. The plugin may
 works fine with symfony 1.1 and doctrine too.

 --
 Thomas Rabaix









 --
 Thomas Rabaix
 http://rabaix.net

 


--~--~-~--~~~---~--~~
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: Doctrine Behaviour: Usertraceable ... how to create the relationships

2009-07-16 Thread Olivier Revollat
You have to create the Listener :
?php
class Doctrine_Template_Listener_Usertraceable extends
Doctrine_Record_Listener {
/**
 *
 * @var string
 */
protected $_options = array();

/**
 * __construct
 *
 * @param string $options
 * @return void
 */
public function __construct(array $options)
{
$this-_options = $options;
}

/**
 *
 * @param Doctrine_Event $event
 * @return void
 */
public function preInsert(Doctrine_Event $event)
{
 $guard_user = sfContext::getInstance()-getUser()-getGuardUser();
if ( ! $this-_options['created']['disabled']) {
$createdName =
$event-getInvoker()-getTable()-getFieldName($this-_options['created']['name']);
$modified = $event-getInvoker()-getModified();
if ( ! isset($modified[$createdName])) {
$event-getInvoker()-$createdName = $guard_user;
}
}

if ( ! $this-_options['updated']['disabled']) {
$updatedName =
$event-getInvoker()-getTable()-getFieldName($this-_options['updated']['name']);
$modified = $event-getInvoker()-getModified();
if ( ! isset($modified[$updatedName])) {
$event-getInvoker()-$updatedName = $guard_user;
}
}
}

/**
 *
 * @param Doctrine_Event $evet
 * @return void
 */
public function preUpdate(Doctrine_Event $event)
{
 $guard_user = sfContext::getInstance()-getUser()-getGuardUser();

if ( ! $this-_options['updated']['disabled']) {
$updatedName =
$event-getInvoker()-getTable()-getFieldName($this-_options['updated']['name']);
$modified = $event-getInvoker()-getModified();
if ( ! isset($modified[$updatedName])) {
$event-getInvoker()-$updatedName = $guard_user;
}
}
}

/**
 * Set the updated field for dql update queries
 *
 * @param Doctrine_Event $evet
 * @return void
 */
public function preDqlUpdate(Doctrine_Event $event)
{
 $guard_user = sfContext::getInstance()-getUser()-getGuardUser();

if ( ! $this-_options['updated']['disabled']) {
$params = $event-getParams();
$updatedName =
$event-getInvoker()-getTable()-getFieldName($this-_options['updated']['name']);
$field = $params['alias'] . '.' . $updatedName;
$query = $event-getQuery();

if ( ! $query-contains($field)) {
$query-set($field, '?', $guard_user);
}
}
}

}
?

2009/6/26 juro fo...@juro.at


 Hi,
 using the sfDoctrineGuardPlugin, I have created a new Doctrine
 behaviour/template (similar to the Timestampable behaviour). This
 creates two fields created_by and updated_by that *should* be foreign
 keys to the sfGuardUser.id field. Currently the behaviour creates the
 fields but not the relationships. Can anyone check why not?

 juro


 ?php
 /**
  * Doctrine Template that creates two fields created_by and updated_by
  * @author: Roland Jungwirth
  * @version: 0.9
  */
 class Doctrine_Template_Usertraceable extends Doctrine_Template
 {
  /* Array of Timestampable options
   *
   * @var string
   */
  protected $_options = array('created' =  array('name'  =
 'created_by',
  'type'  =
 'integer',
  'length'=
 4,
  'disabled'  =
 false,
  'options'   =
 array()),
  'updated' =  array('name'  =
 'updated_by',
  'type'  =
 'integer',
  'length'=
 4,
  'disabled'  =
 false,
  'options'   =
 array()));

  public function setTableDefinition()
  {
if( ! $this-_options['created']['disabled']) {
  $this-hasColumn($this-_options['created']['name'], $this-
 _options['created']['type'], 4, $this-_options['created']
 ['options']);
}

if( ! $this-_options['updated']['disabled']) {
  $this-hasColumn($this-_options['updated']['name'], $this-
 _options['updated']['type'], 4, $this-_options['updated']
 ['options']);
}
  }

  public function setUp()
  {
$this-hasOne('sfGuardUser as CreatedBy', array('local' = $this-
 _options['created']['name'], 'foreign' = 'id'));
$this-hasOne('sfGuardUser as UpdatedBy', array('local' = $this-
 _options['updated']['name'], 'foreign' = 'id'));
  }
 }
 ?
 


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

[symfony-users] Timestamp and date previous to 1/1/1970

2009-05-28 Thread Olivier Revollat
I have the following widget in a form:
$this-setWidget('birthdate_at', new sfWidgetFormI18nDate(array('culture' =
sfContext::getInstance()-getUser()-getCulture(), 'format' =
'%day%/%month%/%year%', 'years'  = $years)));

And my database field is :
birthdate_at:
  type: DATE

But When I enter 17 january 1967 I have 2032-01-17 in my database ... I
think it's because the date is converted in timestamp during the process so
it cannot manage date before 01/01/1970 ...
How can I save my date properly ?

Thanks for your help...

--~--~-~--~~~---~--~~
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: validating sfWidgetFormDate

2009-05-28 Thread Olivier Revollat
I have the same pb ... any suggestions ?
Thanks

2008/7/5 kiszl ki...@tmit.bme.hu


 Hi,

 I would like to use an sfWidgetFormDate as an input for the date of
 birth; and to store the value in an sql date field.
 What would be the best way to validate the widget's value, and convert
 it to the desired '-mm-dd' format ?
 Currently sfValidatorDate relies on mktime, what makes it invalidate
 dates prior to 1970 (and it also cleans the date into a unix
 timestamp).

 Thank you,
 kiszl.
 


--~--~-~--~~~---~--~~
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 : Use different Peer method according to the credential of the connected user

2009-03-20 Thread Olivier Revollat
I would like to know if it's possible to make an admin generator based
module to use a different SQL request for the 'list' action depending on the
credential of the connected user ...In practice, I have two credential admin
and operator and I show a lisitng of orders : I would like that the 'admin'
shows all of the orders whereas the 'operator' can only shows the orders
where the boolean column 'is_verrou' is equal to false ... how can I do that
natively or with a hack ?

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: Admin generator : Use different Peer method according to the credential of the connected user

2009-03-20 Thread Olivier Revollat
Thanks for your answers :)I also see that you can put your peer method
directly in the generator.yml file like this :

config:
  list:
peer_method: myOwnPeerMethod

I work, but I think their is some pb with filter now ...

2009/3/20 Alan Bem alan@gmail.com

 Use *your_module*GeneratorConfiguration.class.php. Its PHP based generator
 configuration.
 U can specify peer there without touching actions.

 Cheers, Alan


 On Fri, Mar 20, 2009 at 1:07 PM, Tomasz Ignatiuk tomek.ignat...@gmail.com
  wrote:


 You can ovverride buildCriteria() method in actions. Check there
 credentials and add Criteria to it



 


--~--~-~--~~~---~--~~
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] Insert object filters in an existing application (Question about sfShop (e-commerce app) in particular)

2009-02-09 Thread Olivier Revollat
Hello !!

I am asking a question on sfShop project, but I also post a message here
because I think that my question is also general and can apply to any
symfony application (or other frameworks)

I use a great symfony application called sfShop to make an e-commerce site
... But I want to use a feature that is not available in sfShop : I want to
be able to change the price of a product according to price campaigns.
The principle is :  The price of the product is the normal price unless a
price campaign is active, That is to say the current date is between the
beginning date and the end date of the price campaign in that case the price
is determine by the campaign itself.

My problem/Question is to handle this in the front application :

The different front views :  product list, product detail, shopping
cart must show the product price of the current active campaign (if any)
for a given product and not the normal product price ... am I clear ?

I have implement this using symfony events ...I have register an event
called 'ama.filter_product_campagne'

$this-dispatcher-connect('ama.filter_product_campagne',
array('amaEventsListener', 'filterProductForCampagne'));

And I added a method to Product class:

public function applyCampagneFilter(){
 sfContext::getInstance()-getEventDispatcher()-notify(new
sfEvent($this, 'ama.filter_product_campagne', array()));
}

I don't know if this is the best way to do this (the advantage I see by
doing this is that that I can easily unregister the event listener to ignore
campaign) but my problem is not exactly here 

The real problem is that, as I said, the products must be filter wherever
they appear on the front :

Product list,
Product details,
Shopping cart,
...

To do this I have override the corresponding methods of the Peer object :

  public static function doSelectWithTranslation(Criteria $c, $culture =
null, $con = null)
  {
   $results = parent::doSelectWithTranslation($c, $culture, $con);
   foreach ($results as $result){
   $result-applyCampagneFilter();
   }
   return $results;
  }
  public static function doSelect(Criteria $criteria, PropelPDO $con = null)
  {
   $results = parent::doSelect($criteria, $con);
   foreach ($results as $result){
   $result-applyCampagneFilter();
   }
   return $results;
  }
  public static function retrieveById($id, $criteria = null, $withI18n =
false)
  {
   $object = parent::retrieveById($id, $criteria, $withI18n);
   $object-applyCampagneFilter();
   return $object;
  }



It works but I feel something wrong about that ... So I wonder if their is
not a proper way to do all this ...
It feel unnatural to me to override multiple methods as shown above (but I
don't kown how to to that in a proper way (more object oriented ?? /
decoupled way ??)) and Do I have to use event notification, event filter ,
other someting else that events ... ???

Thanks for your help, suggestion, ideas ... :)

--~--~-~--~~~---~--~~
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] don't repeat already executed sql statement during a single HTTP request

2009-02-09 Thread Olivier Revollat
Hello !
On my application (e-commerce) I list the available products. For each
products I call a filter that modify the product price according to current
price campaign (if any campaign is active)
So for each products, I retrive the current campagne (SQL QUERY) :

$query = sprintf(SELECT %s AS campagneid FROM %s WHERE NOW() BETWEEN %s AND
%s LIMIT 1, AmaCampagnePeer::ID, AmaCampagnePeer::TABLE_NAME,
AmaCampagnePeer::DEBUT_VALIDITE, AmaCampagnePeer::FIN_VALIDITE);
$statement = $connection-prepare($query);
$statement-execute();
$campagneid = $statement-fetch(PDO::FETCH_OBJ);

But as soon as I get the current's campagn ID this is not going to change
during the current HTTP request ... so I don't have to execute this request
for each products... I want to use the same campagne ID for all the HTTP
request and not recalculate it each time I filter a product (to retrive the
campagne price) ... some kind of singleton design pattern .. but I don't
know exactly how to implement this (for example how do I know that I am I
the same HTTP request ?)
I don't know if i'm clear enougth ... :)

Thanks for your help, ideas, suggestions !!

--~--~-~--~~~---~--~~
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: don't repeat already executed sql statement during a single HTTP request

2009-02-09 Thread Olivier Revollat
OK but the campaign_id is likely to change from one HTTP request to another
so I only want to store the campaign_id during ONE HTTP request (so I don't
have to retrive this ID for each product because that mean 20 same SQL
request if their is 20 product on the page  )
Am I clear enough  ?

Thanks for your help :)

2009/2/9 Sid Bachtiar sid.bacht...@gmail.com


 Not flash! Use your user object, e.g.:

 public function executeMyAction()
 {
  $user = $this-getUser();
  $user-setAttribute('campaign_id', 3);
 }

 Then later use $user-getAttribute('campaign_id') from anywhere in
 your project to retrieve it.

 On Tue, Feb 10, 2009 at 3:52 AM, Olivier Revollat revol...@gmail.com
 wrote:
  All right, or maybe I can use session (flash) ... ?
 
  2009/2/9 Iltar kja...@gmail.com
 
  Hey,
  If I understand you correctly, you want to have the id like 3
  available in every part of your script?
 
  Try setting it as a config value: sfConfig::set('campaign_id',
  $campaign-getId()); if I recall correctly. This is available
  everywhere. Else I recommend either bridging to Zend Framework for a
  registry, or build on yourself.
 
  On Feb 9, 11:52 am, Olivier Revollat revol...@gmail.com wrote:
   Hello !
   On my application (e-commerce) I list the available products. For each
   products I call a filter that modify the product price according to
   current
   price campaign (if any campaign is active)
   So for each products, I retrive the current campagne (SQL QUERY) :
  
   $query = sprintf(SELECT %s AS campagneid FROM %s WHERE NOW() BETWEEN
 %s
   AND
   %s LIMIT 1, AmaCampagnePeer::ID, AmaCampagnePeer::TABLE_NAME,
   AmaCampagnePeer::DEBUT_VALIDITE, AmaCampagnePeer::FIN_VALIDITE);
   $statement = $connection-prepare($query);
   $statement-execute();
   $campagneid = $statement-fetch(PDO::FETCH_OBJ);
  
   But as soon as I get the current's campagn ID this is not going to
   change
   during the current HTTP request ... so I don't have to execute this
   request
   for each products... I want to use the same campagne ID for all the
 HTTP
   request and not recalculate it each time I filter a product (to
 retrive
   the
   campagne price) ... some kind of singleton design pattern .. but I
 don't
   know exactly how to implement this (for example how do I know that I
 am
   I
   the same HTTP request ?)
   I don't know if i'm clear enougth ... :)
  
   Thanks for your help, ideas, suggestions !!
 
 
 
  
 



 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz

 


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



[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 gang.al...@gmail.com a écrit
:

 HI!
 English please!
 Alecs

 2009/1/28 Olivier Revollat revol...@gmail.com

 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
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 gang.al...@gmail.com a écrit
:

 HI!
 English please!
 Alecs

 2009/1/28 Olivier Revollat revol...@gmail.com

 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] Convert propel object to formatted text or HTML

2009-01-19 Thread Olivier Revollat
is their any way to do this ? 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] newsletter plugin ?

2008-12-03 Thread Olivier Revollat
I'm looking for a newsletter plugin for symfony 1.1. Does it exist ?
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] enable a module in config.php for a specific application

2008-11-26 Thread Olivier Revollat
I wrote a plugin how is specific to my application (a backend module) so to
not interact with the original
backend/config/settings.yml

I enabled my module with :
sfConfig::set('sf_enabled_modules',
array_merge(sfConfig::get('sf_enabled_modules'), array('jouegagne')));(in
plugin/myplugin/config/config.php)

But the module is also enable in frontend !!! how can I enable my module
ONLY in backend ?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] define constants in plugins

2008-11-26 Thread Olivier Revollat
I defined a constant (the absolute path of my plugin root) like that in the
config.php of my plugin like that :
DEFINE('PATH_TO_AMA_PLUGIN'
,realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..').DIRECTORY_SEPARATOR);

it's works, I mean I can acces the constant in my module action for example
but when I do a 'clear cache' I got wome notices :
Notice: Constant PATH_TO_AMA_PLUGIN already defined in
C:\...\plugins\ama\config\config.php on line 4

I think their is a better way to define the plugin root ...

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfWidgetFormDateTime Rich format

2008-08-20 Thread Olivier Revollat
Is it possible to display the sfWidgetFormDateTime widget in javascript
(i.e. rich format)

I tried :

?php echo $form['date_news']-render(array('rich'=true)) ?

But it doesn't  works.


Any idea ? 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Symfony 1.1 unset form widget

2008-07-14 Thread Olivier Revollat
Hello !!
I have some generated code to manage my users (from sfGuard schema).
I have done :

propel:generate-crud frontend users sfGuardUser --with-show

but I don't want to edit the 'created_at' column since it's automatically
fill ... so I just unset it inside the configure() method of the base form
as explain in the doc :

class sfGuardUserForm extends BasesfGuardUserForm
{
  public function configure()
  {

  unset($this-widgetSchema['created_at']);
  unset($this-validatorSchema['created_at']);
  }
}

But when I want to edit or crate a user (call to sfGuardUserForm) their is
an exception :

[InvalidArgumentException]
*Widget created_at does not exist.*
stack trace

* at ()
  in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ...
 715. {
 716.   if (!$widget = $this-widgetSchema[$name])
 717.   {
 718. throw new InvalidArgumentException(sprintf('Widget
%s does not exist.', $name));
 719.   }
 720.

 721.   $values = $this-isBound ? $this-taintedValues :
$this-defaults;
* at sfForm-offsetGet('created_at')
  in SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php
line 50


I don't understand because I have already tested this when I read the
symfony form book.
It doesn't work neither if I try other colum like is_active .. i got the
same exception ... !!!


Can you help please ?
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Symfony 1.1 unset form widget

2008-07-14 Thread Olivier Revollat
I tried the following code but I got *the same exception*  this means
that offsetExistsreturn true but I can't unset this widget !!! any idea ?

class sfGuardUserForm extends BasesfGuardUserForm
{
  public function configure()
  {

  if($this-offsetExists('created_at')){
  $this-offsetUnset('created_at');
  }

  }
}

2008/7/14 CaffeineInc [EMAIL PROTECTED]:


 You should probably use the   $form-offsetUnset('widgetName'); and
 make sure it exists using $form-offsetExists('widgetName');
 might do some cleaning up a bit more.

 On Jul 14, 11:49 am, Olivier Revollat [EMAIL PROTECTED] wrote:
  Hello !!
  I have some generated code to manage my users (from sfGuard schema).
  I have done :
 
  propel:generate-crud frontend users sfGuardUser --with-show
 
  but I don't want to edit the 'created_at' column since it's automatically
  fill ... so I just unset it inside the configure() method of the base
 form
  as explain in the doc :
 
  class sfGuardUserForm extends BasesfGuardUserForm
  {
public function configure()
{
 
unset($this-widgetSchema['created_at']);
unset($this-validatorSchema['created_at']);
}
 
  }
 
  But when I want to edit or crate a user (call to sfGuardUserForm) their
 is
  an exception :
 
  [InvalidArgumentException]
  *Widget created_at does not exist.*
  stack trace
 
  * at ()
in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ...
   715. {
   716.   if (!$widget = $this-widgetSchema[$name])
   717.   {
   718. throw new
 InvalidArgumentException(sprintf('Widget
  %s does not exist.', $name));
   719.   }
   720.
 
   721.   $values = $this-isBound ? $this-taintedValues :
  $this-defaults;
  * at sfForm-offsetGet('created_at')
in
 SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php
  line 50
 
  I don't understand because I have already tested this when I read the
  symfony form book.
  It doesn't work neither if I try other colum like is_active .. i got
 the
  same exception ... !!!
 
  Can you help please ?
  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Symfony 1.1 unset form widget

2008-07-14 Thread Olivier Revollat
Ok that's me ... I'm stupid this morning :)
the problem don't come from the code below ... i have to comment the code
that retrive 'created_at' int the edit template ... that's all ;)

2008/7/14 Olivier Revollat [EMAIL PROTECTED]:

 I tried the following code but I got *the same exception*  this means
 that offsetExistsreturn true but I can't unset this widget !!! any idea ?

 class sfGuardUserForm extends BasesfGuardUserForm
 {
   public function configure()
   {

   if($this-offsetExists('created_at')){
   $this-offsetUnset('created_at');
   }

   }
 }

 2008/7/14 CaffeineInc [EMAIL PROTECTED]:


 You should probably use the   $form-offsetUnset('widgetName'); and
 make sure it exists using $form-offsetExists('widgetName');
 might do some cleaning up a bit more.

 On Jul 14, 11:49 am, Olivier Revollat [EMAIL PROTECTED] wrote:
  Hello !!
  I have some generated code to manage my users (from sfGuard schema).
  I have done :
 
  propel:generate-crud frontend users sfGuardUser --with-show
 
  but I don't want to edit the 'created_at' column since it's
 automatically
  fill ... so I just unset it inside the configure() method of the base
 form
  as explain in the doc :
 
  class sfGuardUserForm extends BasesfGuardUserForm
  {
public function configure()
{
 
unset($this-widgetSchema['created_at']);
unset($this-validatorSchema['created_at']);
}
 
  }
 
  But when I want to edit or crate a user (call to sfGuardUserForm) their
 is
  an exception :
 
  [InvalidArgumentException]
  *Widget created_at does not exist.*
  stack trace
 
  * at ()
in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ...
   715. {
   716.   if (!$widget = $this-widgetSchema[$name])
   717.   {
   718. throw new
 InvalidArgumentException(sprintf('Widget
  %s does not exist.', $name));
   719.   }
   720.
 
   721.   $values = $this-isBound ? $this-taintedValues
 :
  $this-defaults;
  * at sfForm-offsetGet('created_at')
in
 SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php
  line 50
 
  I don't understand because I have already tested this when I read the
  symfony form book.
  It doesn't work neither if I try other colum like is_active .. i got
 the
  same exception ... !!!
 
  Can you help please ?
  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfLucene accentuated content

2008-06-30 Thread Olivier Revollat
 My problem: I can't find *accentuated static content* with with sfLucene !!

My config : I use *symfony 1.0.6* with *sfLucenePlugin 0.1.6*.



f*rontend/config/settings.yml :*

charset: utf-8



*Search.yml (project level) :*

MyIndex:

  models:

  index:

cultures: [en, fr]

encoding: utf-8

analyzer: utf8

case_sensitive: off

mb_string: on

*Search.yml (app level) :*

MyIndex:

  models:

   Actualites:

  route: common/actualite?actu=%Actualiteid%

  fields:

Actualiteid: unindexed

Textefr:

  boost: 1.5

  type: text



I use i18N with XLIFF files and for example I have this content:



trans-unit id=258

sourceDetail_PresentationDeveloppement/source

target![CDATA[p blablabla est une société au service blablabl/p]]/
target

/trans-unit



Notice the accents in 'société' …

I build the index using this command:

*php symfony lucene-rebuild frontend*



And if I look into the index to find the string I see :



p blablabla est une *sociÃ(c)tÃ(c)* au service blablabla /p



Now if I search for *société* in lucene module I got *no results* … and if
I search for *sociÃ(c)tÃ(c)* I got *some results*!!!


And if I try to *encode the index* in utf-8, so I can see *société*
instead of *sociÃ(c)tÃ(c)* in notepad++ then, there is an error :
Largest supported segment size (for 32-bit mode) is 2Gb Can anyone help me ?
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Ignore accent with sfLucenePlugin

2008-06-24 Thread Olivier Revollat
Is ther any way of doing this ? strip accent from indexation and user search
field ... 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfLucene and words highlighting

2008-06-23 Thread Olivier Revollat
I installed sfLucene plugin and when I use it an exception is thrown by
sfLucenHilighter.class.php :

throw new sfLuceneHighlighterException('Highlighting failed because content
is malformed X/HTML');

Acctually my code is not XHTML... so I want to desactivate syntax
highlighting in sfLucen results page but I don't see that parameter on the
online doc ...

Any ideas ?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Webmail integration

2008-04-01 Thread Olivier Revollat
Hi !
I want to use an existing webmail (for example nocc) and use sfGuard to
centralize authentication... is it possible ?
Thanks.

2008/4/1, Lee Bolding [EMAIL PROTECTED]:


 You need to be more specific...

 How do you want to use Symfony? is it with an existing application or
 something you're developing yourself?

 Symfony isn't an application, it's a framework - so 'integration' can
 be interpreted in many different ways. Without an application there is
 no 'integration'



 On 31 Mar 2008, at 13:32, Olivier Revollat wrote:
  Hi !
  I want to use symfony with a webmail and I don't know what is the
  best solution ... I would like to use sfSuagr plugin to centralize
  authentication.
 
  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Webmail integration

2008-03-31 Thread Olivier Revollat
Hi !
I want to use symfony with a webmail and I don't know what is the best
solution ... I would like to use sfSuagr plugin to centralize
authentication.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfSimpleBlog and symfony internal links

2007-09-19 Thread Olivier Revollat
Hello,
i've installed sfSimpleBLogPlugin and I wonder how can I include symfony
internal links in blog articles ... ??

Any ideas ?
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfSimpleCMS and symfony 1.1

2007-09-10 Thread Olivier Revollat
Hi everybody !

I host on my website symfony with sfSimpleCMS and I would like to know if
this plugin (and sfGuard, sfSimpleBlog...) will be compatible with future
version of symfony (1.1)

Any info ?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] URL rewriting problem

2007-08-31 Thread Olivier Revollat
Hi !

I have a site powered by symfony (1.0.6) (wich was previously develop with
.NET technology)
I have a flash file (swf) in my site, and their is an http link in the flash
file .. but the problem is that I can't recompile the flash with the symfony
URL inside (I forgot the source of the flash) ... so in my flash file I have
the old (.NET) url :

http://localhost/fr/common/aires/carte/aires.aspx?carte=1

and I want this URL :

http://localhost/fr/common/aires/carte/1

I try to use apache mod_rewrite with the following rule in the .htaccess :

  RewriteCond %{QUERY_STRING} carte=1
  RewriteRule ^(.*)$ /fr/common/aires/carte/1 [R]

But symfony append the query string (QSA flag see below)  (?carte=1)
RewriteRule ^(.*)$ index.php [QSA,L]

So the URL match again my rule and their is an infinite loop !!!

So it doesn't work ...

Theire is mabe two solutions :

1) Rewrite the query string to erase carte=1 so symfony append nothing and
the redirected URL does not match my rule again ...
2) Using the symfony URL routing, but I don't know how to do that 


Any ideas ?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Symfony API and eclipse autocompletion

2007-08-27 Thread Olivier Revollat
When I develop a symfony project using eclipse, I have to put the symfony
core within my project directory so eclipse can autocomplete class names,
methods, function documentation etc ...

I would like to know if I can achieve this without putting symfony core in
my directory project ... i.e. how can I configure eclipse to discover
extarnals libs ...  ???

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Customize error 500 page for several applications

2007-08-27 Thread Olivier Revollat
How can I customize error 500 page
(symfony_core/data/web/errors/error500.php) for different applications in
the same project ... ?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Using DB model in a pake task

2007-08-22 Thread Olivier Revollat
How can I use my propel model inside a pake task ?

I've try to write something like this (see below) but I get the following
error :

  [PropelException]
  No connection params set for propel

What should I call inside the task to be able to use my model and request
the database ?
Any ideas ?? thanks ...


pake_desc('Tirage au sort des gagnants du jeux Trafic FM');
pake_task('tirage');

function run_tirage($task, $args)
{
$jeu = new Jeux();
$nbjeux = $jeu-getOnlineJeux();
$nbjeux-next();
$nbjeux = $nbjeux-getInt('nbjeux');
if($nbjeux=1)
{
pake_echo('OK');
}
}

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Using DB model in a pake task

2007-08-22 Thread Olivier Revollat
Thanks, a lot... that's what I found in the source code of the
propel_load_data task ;)

But, when I try this :

pake_desc('Tirage au sort des gagnants du jeux Trafic FM');
pake_task('tirage','app_exists');
function run_tirage($task, $args)
{
  $app= $args[0];
  $databaseManager = new sfDatabaseManager();
  $databaseManager-initialize();
}

I get the following error :


[sfConfigurationException]

  Module directory C:\xampp\htdocs\escota\symfony_private\apps\\modules
does not exist or is not readable
:(

Any idea ? thanks... ;)


2007/8/22, Fabien POTENCIER [EMAIL PROTECTED]:


 To initialize database connections:

 $databaseManager = new sfDatabaseManager();
 $databaseManager-initialize();

 Optionally, you can retrieve the current database connection:

 $con = Propel::getConnection();

 Fabien

 Olivier Revollat wrote:
  How can I use my propel model inside a pake task ?
 
  I've try to write something like this (see below) but I get the
  following error :
 
[PropelException]
No connection params set for propel
 
  What should I call inside the task to be able to use my model and
  request the database ?
  Any ideas ?? thanks ...
 
 
  pake_desc('Tirage au sort des gagnants du jeux Trafic FM');
  pake_task('tirage');
 
  function run_tirage($task, $args)
  {
  $jeu = new Jeux();
  $nbjeux = $jeu-getOnlineJeux();
  $nbjeux-next();
  $nbjeux = $nbjeux-getInt('nbjeux');
  if($nbjeux=1)
  {
  pake_echo('OK');
  }
  }
 
 
  

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Using DB model in a pake task

2007-08-22 Thread Olivier Revollat
The problem seem to come from sfConfig::get when retriving applicatio module
directory :

When I try this :

pake_task('tirage','app_exists');
function run_tirage($task, $args)
{
  $app= $args[0];
  pake_echo(sfConfig::get('sf_app_module_dir'));
}

I call ./symfony tirage admin
sfConfig returns :

C:\[...]\symfony_private\apps\\modules
instead of :
C:\[...]\symfony_private\apps\admin\modules

What's wrong ? did I forget something ? did I properly define the
application ($app= $args[0];) ??

Thanks ;)


2007/8/22, Olivier Revollat [EMAIL PROTECTED]:

 Thanks, a lot... that's what I found in the source code of the
 propel_load_data task ;)

 But, when I try this :

 pake_desc('Tirage au sort des gagnants du jeux Trafic FM');
 pake_task('tirage','app_exists');
 function run_tirage($task, $args)
 {
   $app= $args[0];
   $databaseManager = new sfDatabaseManager();
   $databaseManager-initialize();
 }

 I get the following error :


 [sfConfigurationException]

   Module directory C:\xampp\htdocs\escota\symfony_private\apps\\modules
 does not exist or is not readable
 :(

 Any idea ? thanks... ;)


 2007/8/22, Fabien POTENCIER [EMAIL PROTECTED]:
 
 
  To initialize database connections:
 
  $databaseManager = new sfDatabaseManager();
  $databaseManager-initialize();
 
  Optionally, you can retrieve the current database connection:
 
  $con = Propel::getConnection();
 
  Fabien
 
  Olivier Revollat wrote:
   How can I use my propel model inside a pake task ?
  
   I've try to write something like this (see below) but I get the
   following error :
  
 [PropelException]
 No connection params set for propel
  
   What should I call inside the task to be able to use my model and
   request the database ?
   Any ideas ?? thanks ...
  
  
   pake_desc('Tirage au sort des gagnants du jeux Trafic FM');
   pake_task('tirage');
  
   function run_tirage($task, $args)
   {
   $jeu = new Jeux();
   $nbjeux = $jeu-getOnlineJeux();
   $nbjeux-next();
   $nbjeux = $nbjeux-getInt('nbjeux');
   if($nbjeux=1)
   {
   pake_echo('OK');
   }
   }
  
  
   
 
   
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfConfig::get('sf_app_module_dir') inside a pake task

2007-08-22 Thread Olivier Revollat
When I try to initialize the database connexion inside a pake task, I do
this :


pake_task('tirage','app_exists');
function run_tirage($task, $args)
{
  $app= $args[0];
  $databaseManager = new sfDatabaseManager();
  $databaseManager-initialize();
}

Then I call symfony.bat tirage admin But I get this error :


[sfConfigurationException]

  Module directory C:\[...]\symfony_private\apps\\modules does not exist
or is not readable
(notice the double '\', it's like my task doesn't know the application name
...)

The problem occure during the call of

sfConfig::get('sf_app_module_dir')

And I don't know why the previous code returns :
C:\[...]\symfony_private\apps\\modules
instead of :
C:\[...]\symfony_private\apps\admin\modules

??? any ideas ?? 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: sfConfig::get('sf_app_module_dir') inside a pake task

2007-08-22 Thread Olivier Revollat
OK it works !!
Merci Fabien.

Je profite de l'occasion pour te dire que j'apprécie énormément ton
framework ... un travaille colossale qui à été extrêmement bien pensé. Bravo
;)


2007/8/22, Fabien POTENCIER [EMAIL PROTECTED]:


 In your batch, before initializing the database, you need to load th
 symfony configuration:

 define('SF_ROOT_DIR',realpath(dirname(__file__).'/..'));
 define('SF_APP', 'frontend');
 define('SF_ENVIRONMENT', 'dev');
 define('SF_DEBUG',   true);


 require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'
 config.php');

 Fabien

 Olivier Revollat wrote:
  When I try to initialize the database connexion inside a pake task, I do
  this :
 
 
  pake_task('tirage','app_exists');
  function run_tirage($task, $args)
  {
$app= $args[0];
$databaseManager = new sfDatabaseManager();
$databaseManager-initialize();
  }
 
  Then I call symfony.bat tirage admin But I get this error :
 
 
  [sfConfigurationException]
 
Module directory C:\[...]\symfony_private\apps\\modules does not
  exist or is not readable
  (notice the double '\', it's like my task doesn't know the application
  name ...)
 
  The problem occure during the call of
 
  sfConfig::get('sf_app_module_dir')
 
  And I don't know why the previous code returns :
  C:\[...]\symfony_private\apps\\modules
  instead of :
  C:\[...]\symfony_private\apps\admin\modules
 
  ??? any ideas ?? 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: doSave with or withOUT

2007-08-02 Thread Olivier Revollat
I have done this by overloading the save() method ... like this :

public function save($action = '')
{
sfContext::getInstance()-getLogger()-info('log your action in
symfony log');
if($action!='')
{
$log = new Logs(); // log your action in database

}

parent::save(); // call parent method
}


2007/8/2, Andrew [EMAIL PROTECTED]:

  Hello

 We're having a discussion in the office about how to effectively use
 the models to include application business rules.

 Our example is as follows:
 Every time a customer is restricted a logged description is required. This
 updates the customer table and creates a new record in
 the customer_restriction_log tables.

 Our question is this, which of the following solutions would you
 recommend?

 1. create a separate function called doSaveWithLog in the model
 2. extend the doSave function in the model

 I18n could also be include in this discussion.

 Regards

 Andrew von Hoesslin

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfSiteMapPlugin : create the site map of a symfony powered web site ...

2007-07-23 Thread Olivier Revollat
See :

http://www.symfony-project.com/forum/index.php/t/7660/#msg_num_6

This plugin build a module listing all the links of a given application ...

Things to do :

* Ability to exclude module directories or actions from a list or a regular
expression (given in config file)
* Store links labels in the actions classes static
For example in the action class : $myactionLinkv= 'this is my link' and then
by reflection we can can the link label for the corresponding action ... I
don't know if this is the proper way to do that ...
[image: Wink]
Any ideas, suggetions, contribution ?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: tinymce full options

2007-07-23 Thread Olivier Revollat
http://wiki.moxiecode.com/index.php/TinyMCE:Control_reference

does that help you ?

2007/7/22, Greg Freeman [EMAIL PROTECTED]:


 How do you get all of tinymce's options to display using the textarea
 tag helper?


 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Doubt - One To One

2007-07-23 Thread Olivier Revollat
use : objects_for_select

objects_for_select ($options = array(), $value_method, $text_method = null,
$selected = null, $html_options = array())
Accepts a container of objects, the method name to use for the value, and
the method name to use for the display.
It returns a string of option tags.

EXAMPLE :
?echo select_tag('nameOfTag',objects_for_select($priorityObject,
'getPriorityID', 'getNomPriority', $todo-getPriority()))?



2007/7/23, [EMAIL PROTECTED] [EMAIL PROTECTED]:


 Guyz,

 I'm have problems with relationships here, look. I haver 2 tables,
 Todo, TodoPriorities.

 The Todo store things to do and TodoPriorities, types of priorities
 for todo.

 My doubt is how to link to priorities id but showing priority mane in
 the select box, in the administrator?

 i will send the schema.yml and generator.yml, please help me

 [SCHEMA.YML]
 ---
 propel:
   todo:
 _attributes: { phpName: Todo }
 id:
   type: INTEGER
   primaryKey: true
   autoincrement: true
 name:
   type: VARCHAR
   size: 20
   required: true
 description:
   type: LONGVARCHAR
 do_at:
   type: TIMESTAMP
   required: true
 created_at:
 priority:
 type: INTEGER
 required: true
 size: 3
 foreignTable: todoPriorities
 foreignReference: id
 status:
   type: INTEGER
   required: true
 _indexes:
   (todo autoindex 1):
 - id
   todoPriorities:
 _attributes: { phpName: TodoPriorities }
 id:
 type: INTEGER
 primaryKey: true
 autoincrement: true
 name:
 type: VARCHAR
 size:  5

 [GENERATOR.YML]
 generator:
   class:  sfPropelAdminGenerator
   param:
 model_class:  Todo
 theme:default

 fields:
 name:
 name: Nome da Tarefa
 description:
 name: Descrição
 do_at:
 name: Fazer em
 params:
 date_format: hh:mm:ss - dd/MM/
 created_at:
 name: Criado em
 type: plain
 params:
 date_format: hh:mm:ss - dd/MM/
 priority:
 name: Prioridade
 status:
 name: Situação

 list:
 title: Lista de Tarefas
 #display: [=name]

 edit:
 title: Editando tarefa %%name%%


 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---