[symfony-users] Re: sfValidatorString returing text Array when used as form filter validator

2010-09-30 Thread Tom Ptacnik
What is in this array?

On 28 zář, 18:49, pantherse panthe...@gmail.com wrote:
 What I want to do is replace the validator for a field to
 sfValidatorString instead of the sfValidatorPass in the base form
 filter class. However, when I do that the field's value becomes the
 text Array instead of the actual cleaned array that I'm getting on
 form classes.

-- 
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] Re: Is there an easy way to enable display the lookup values instead of IDs in indexSuccess.php in symfony 1.4.6?

2010-09-22 Thread Tom Ptacnik
For that create a partial, like guiguiboy sad and create a link here.
Instead of just echo $issue-getEmp() do something like  link_to()

On 22 zář, 15:20, dmitrypol dmitry...@gmail.com wrote:
 Thank you both.  I do have one more question.  I created a page
 listing all employees
 symfony doctrine:generate-admin frontend emp --module=emp
 ID      Name
 1       Emp 1
 2       Emp 2
 I want to be able to click on the employee name and go to a page
 listing all issues that person is working on.

-- 
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] Re: motion : new mailling list for Synfony2

2010-09-02 Thread Tom Ptacnik
Agree

On 1 zář, 16:23, sam zoulil...@gmail.com wrote:
 Hello,
 I follow this mailling list for a while, and I see more and more
 subject on Synfony2.
 I think that can be a good idea to split this one in 2 : synfony1 and
 synfony2
 or at least allways use a tag like [sf2] in the subject.

 I am interested in synfony2 but not a lot in older version, I might
 make my inbox a little cleaner.

 Not ?

-- 
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] Re: Unsecure module into secure application

2010-08-29 Thread Tom Ptacnik
I think you can, because login page is unsecured action in the secured
app...

On 28 srp, 03:28, Alvaro Garcia maxpo...@gmail.com wrote:
 Hi!
 I have secured the application (application/config/security.yml) and a want
 an unsecured module. Then I have the file
 /application/unsecuredModule/config/security.yml configure to make the
 module no secure.

 With this configuration the module are still secured.
 At the moment I have unsecured the application and make secure every module
 with its own config/security.yml file.

 Can I unsecure a module that is located into a secure application?

 Thank you!

-- 
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] Re: sfFormExtraPlugin - jquery UI DatePicker - Safari 5

2010-08-24 Thread Tom Ptacnik
Try this http://garakkio.altervista.org/datepickerui/
I like it.

On 16 srp, 21:42, Joe666 joe...@gmail.com wrote:
  Hello guys,

 I installed the sfFormExtraPlugin as per the README file, then I
 downloaded jquery 1.4.2 and jquery UI 1.8.4, installed, included in the
 project, then I go to one of the admin generated forms for one of my
 tables and do this:

 class RoomInventoryForm extends BaseRoomInventoryForm
 {
   public function configure()
   {
     $this-widgetSchema['creation'] = new sfWidgetFormJQueryDate();

       $this-setDefaults(array(
         'creation' = date(Y/m/d)
       ));
   }

 }

 Everything works in Internet Explorer, Firefox and Chrome, but Safari
 5.0.1 (ipad/iphone as well) simply display a blank page with no HTML in
 it at all.

 I see the widget alright in all other browsers except Safari 5, I've
 searched around and found nothing similar, has anyone experienced this
 before ?

 Best Regards.

 --
 Luis Maga

-- 
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] Re: disable form value remembering?

2010-08-24 Thread Tom Ptacnik
The filter value is saved to the session - the filter is saved even if
you move to another page and go back. Also the value is showed on the
form ... it's good to know which filter is set.

How do you want to change it? ... only don't show the value on the
form but let the filter value in the session?

On 23 srp, 17:16, axel at axel.zu...@gmail.com wrote:
 symfony rembembers filter settings in admin generated forms, is
 there a way to disable that (globaly / or for certain modules)?

-- 
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] Re: created_at gets deleted on edit

2010-08-23 Thread Tom Ptacnik
Try to unset it in the form class (configure method) . . . . .
unset($this['updated_at']);

On 18 srp, 15:15, Christopher Schnell christopher.schn...@mda.ch
wrote:
 A part of it, I can answer myself:

 the updated_at column is set to null if I press save in the Form and do not 
 really make an update (i.e. leave all values, as they are). However, 
 updated_at is written if I really update a value.

 Seems to me like a problem in Propel 1.5.

 I guess, it will be better to ask in the propel list then.

 Regards,
 Christopher.



  -Ursprüngliche Nachricht-
  Von: symfony-users@googlegroups.com [mailto:symfony-
  us...@googlegroups.com] Im Auftrag von Christopher Schnell
  Gesendet: Dienstag, 17. August 2010 09:49
  An: symfony-users@googlegroups.com
  Betreff: [symfony-users] created_at gets deleted on edit

  Hi all,

  currently, I am facing a strange problem. My created_at and updated_at
  values get deleted when editing an object via its form.

  Everything should be straightforward, both fields are in my schema.yml.
  I customize the corresponding Form class via $this-
  useFields(array(...)), so that created_at and updated_at are not used
  and displayed. But anyway if I update the object, both values are set
  to null.

  I user Symfony 1.4.7-DEV (Trunk as svn External) and sfPropel15Plugin.

  Did anyone experience such a problem?

  Thanks and regards,
  Christopher.

  
  Christopher Schnell

  MdA Business Communications AG
  Unterer Rheinweg 86
  4057 Basel
  Schweiz

  Tel: +41 61 273 44 69
  Fax: +41 61 273 44 68

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

-- 
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] Re: Yaml and html tags

2010-08-22 Thread Tom Ptacnik
xemple:
  job:
title: my job
description: |
   Cooker, i can find more information at : a
href=a_website.commy_website.com/a.

On 16 srp, 00:33, Reo rweil...@gmail.com wrote:
 Hi,

 I was wondering if it is possible to put some HTML tags in YAML files.

 Exemple:
   job:
     title: my job
     description: Cooker, i can find more information at : a
 href=a_website.commy_website.com/a.

 (Here, title and description are both string type).

 When i'm doing that, i get the full description with tags as well, no
 real link is made.

 Thanks for futur answers.

-- 
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] Re: Permalink route

2010-08-15 Thread Tom Ptacnik
/browse/:permalink/*
or /browse/*
or something like that ;)


On 15 srp, 00:05, Arnau Alcázar Lleopart ar...@alcalleop.net wrote:
 Hi everybody,

 I've got urls likehttp://example.com/browse/one/twoand I have creayed a
 route where url is /browse/:permalink

 The problem is this route is only selected when there is only one name after
 browse (browse/one). How cab I solve it?

 Thank you in advance!

-- 
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] Re: How i can implement this with sfGuard plugin

2010-08-14 Thread Tom Ptacnik
Maybe better would be to store the id of the user not the username.
But the principle is right.

And this code of creating the query move to the JobTable class ..
create a method with userId parametter.


On 12 srp, 21:16, RusAlex interpret...@gmail.com wrote:
 I have my own opinion:

 I need to add new field user into job table, and use edited actions
 to show:

 class jobActions extends sfActions
 {
   public function executeIndex(sfWebRequest $request)
   {
     $this-jobs = Doctrine::getTable('JobeetJob')
       -createQuery('a')
       -where('a.user = ?' , $this-getUser()-getUsername())
       -execute();
   }

 Is this a right approach for solving my task ?

-- 
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] Re: symfony form not merging with existing object data (1.4.7-DEV)

2010-08-14 Thread Tom Ptacnik
This behaviour is correct. It depends on the form you are using...I
gess that this form is designed to set all attributes of the object.

If you want to change only some values of the object, then you need to
change the form. Or update just this few attributes of the object
manualy and seve it.


On 12 srp, 22:54, ashton ahonn...@gmail.com wrote:
 I have generated an action using doctrine:generate-module (I can
 reproduce this behavior in the admin module as well)

 When I post to the update page with an incomplete set of values (just
 the title for instance) so:
 /api_dev.php/event/update?id=1event[title]=nothing
 The object is updated and saves correctly, but all the other values in
 the object (except title in this instance) get nulled.

 This is easy to test by building the module and then removing one form
 element that has saved data in it from the page and then saving the
 form.  When saving that form without that form element, it gets
 nulled. I would assume that I am somehow building the form or binding
 it incorrectly, but I am using the generated code.  Is this expected
 behavior? How do I change this so that I can just update the existing
 object without having to pass all values every time?

-- 
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] Re: sfGuardAuth causes everything on my homepage to disappear when I embed any code that corresponds with $sform.. any ideas why?

2010-08-11 Thread Tom Ptacnik
I think it can be done by component.

Look into the sfGuard template and action .. you need to create the
form class (action) then pass it into the component template and show
it.


On 8 srp, 00:31, Psychonetics mrajcampb...@gmail.com wrote:
 I'm trying to embed my sfDoctrineGuardPlugin login form on an existing
 page (homepage), this homepage template will be used on every page
 that links of the home.

 Please note I want the sfDoctrineGuardPlugin login form to take on my
 homepage template and discard what ever template it was originally
 using. I've been reading through the Inside the view layer chapter
 in gentle-introduction-1.4 symfony documentation

 and would like to know what would be better to use for what I'm trying
 to achieve? A partial or component?

 and is there detailed documentation on how I can do this properly?

 My current homepage has my login fields in 1 row in a table. So what I
 want to do is delete the fields and replace with sfDoctrineGuardPlugin
 forms code. e.g.

 td?php echo $form['username']-render(); ?/td
 td?php echo $form['password']-render(); ?/td

 Advice is appreciated. I've been trying to figure this out for 2
 days.

-- 
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] Re: Embedding form filters

2010-08-11 Thread Tom Ptacnik
I don't think that you need embed form filter.

Just add a widget for selecting a school into the person formFilter
Something like:

public function configure() {

  $this-widgetSchema['school_id'] = new
sfWidgetFormDoctrineChoice(array(
  'model' = $this-getRelatedModelName('School'),
  'method' = 'myMethodForWhatIWhant',
  'add_empty' = true
));
$this-validatorSchema['school_id'].

}

Then add this field to the filter, and set that it will have cutom
method for creating the query

public function getFields()
  {
$fields = parent::getFields();
$fields['school_id'] = 'custom';
return $fields;
  }


Then create the method for altering the query for the filter


This is my method for i18n join, so modify this for your WHERE query.
You can look into the sfFormFilterDoctrine class, method
addForeignKeyQuery.
Maybe you can use directly this method from the
sfFormFilterDoctrine you can try to not creating the custom method
- in the getFields method set type to ForeignKey (maybe foreign_key..)
 $fields['school_id'] = 'ForeignKey';

public function addSchoolIdColumnQuery($query, $field, $values)
  {


$fieldName = 'title';
$translationAlias = 't'; // Must by the same as in the
table_method
//$query-leftJoin(sprintf('%s.%s %s', $query-getRootAlias(),
'Translation', $translationAlias)); // Translations already joined in
table_method generator settings
//echo $query-contains('Translation t');

if (is_array($values)  isset($values['is_empty']) 
$values['is_empty'])
{
  $query-addWhere(sprintf('(%s.%s IS NULL OR %1$s.%2$s = ?)',
$translationAlias, $fieldName), array(''));
}
else if (is_array($values)  isset($values['text'])  '' !=
$values['text'])
{
  $query-addWhere(sprintf('%s.%s LIKE ?', $translationAlias,
$fieldName), '%'.$values['text'].'%');
}
  }

On 10 srp, 11:23, Sebastien Armand [Pink] khe...@gmail.com wrote:
 Actually I don't think what I'm looking for is a join, but a set of WHERE
 conditions like:

 WHERE person.school_id IN (SELECT school.id FROM School WHERE city = paris)

 still no clue how to get that though!

 2010/8/10 Sebastien Armand [Pink] khe...@gmail.com



  Hello everyone!

  New day new issue!

  let's imagine the following model:

  person:
    name:
    nickname:
    school_id:

  school:
    name:
    city:

  I want to have a filter on 'person' to browse through the person database.
  And in that filter I want to be able to choose the city they studied in.

  What I did so far is:
  use the standard PersonFormFilter, this works like a charm, no problem
  embed a SchoolFormFilter in the PersonFormFilter

  when doing so, the first problem appears: while binding the
  PersonFormFilter to its values, the embedded form will not be bound to
  anything.
  If trying to bind it separately, I get a csrf error because no csrf token
  is included in the values for the school. Adding it manually only brings up
  a csrf attack detection.

  So disabled the CSRF protection on the embedded form.

  Now I can get my 2 filters and get a look at the queries generated. What
  would be wonderful from now is to be able to build a join of those 2
  queries.

  However, the 2 queries being built independently, they are using the same
  alias: 'r' which causes a conflict.

  Also it seems a pretty complicated way to work, anyone knows of a better /
  much more simple and clean solution, or at least can help me going forward?

-- 
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] Re: which differences between Doctrine::getTable and Doctrine_Query::create

2010-08-11 Thread Tom Ptacnik
You can use Doctrine::getTable('RankDomain')-
findOne or FindOneByXXX

On 11 srp, 12:10, RusAlex interpret...@gmail.com wrote:
 First variant returns an object and you can use method.

 But second variant returns and array of objects and you must select
 object (ex.$rank_domain[0]) for using methods

 On Aug 11, 1:31 pm, catchamonkey ch...@sedlmayr.co.uk wrote:



  Hi Rus,

  Would you mind posting your solution so it could benefit others in the
  future?

  Many thanks,
  Chris

  On Aug 11, 10:29 am, RusAlex interpret...@gmail.com wrote:

   SOLVED

   On Aug 11, 12:46 pm, RusAlex interpret...@gmail.com wrote:

1.    $this-rank_domain = Doctrine::getTable('RankDomain')-

find(array($request-getParameter('id')));

2.    $q = Doctrine_Query::create()
      -select('d.*')
      -where('d.id = ?', $request-getParameter('id'))
      -from('RankDomain d');
      $this-rank_domain = $q-execute();

A first work correct and $this-rank_domain have own methods, but
second doesn't have methods like $this-rank_domain-getId() or
getName()

Why ?

-- 
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] Re: a good IDE for Symfony

2010-08-06 Thread Tom Ptacnik
I'm using Eclipse too, and I'm happy with it.

On 4 srp, 11:36, Gareth McCumskey gmccums...@gmail.com wrote:
 For me the biggest aspects of using an IDE like Eclipse is simply that,
 while it may be bloated and slow to load at times, that it actually speeds
 up my coding. Auto-completion of class method names for example in a class
 that is a few directories removed from the one my current file is in. PHP
 function assistance where a little used functions parameters can be show to
 me in a tooltip on hover so that I don't have to necessarily head off to the
 PHP manual to check it. If I need to make a quick edit to a file and don't
 want to load the entire IDE, I do use VIM, but when I need to sit for a few
 hours adding new features to an already large and extensive application,
 nothing to me can beat a full-fledged IDE like Eclipse in helping keep
 everything managed and together.





 On Wed, Aug 4, 2010 at 10:18 AM, Eno symb...@gmail.com wrote:
  On Wed, 4 Aug 2010, [ISO-8859-1] Stéphane wrote:

   You can try VIM too (really).

  For years Ive been writing code quite happily with vim. Apart from being
  available on almost every platform, its light and fast (I find most IDE's
  slow and bloated). Also you have the added advantage of being able to do
  everything with the keyboard.

  --

  --
  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.comsymfony-users%2bunsubscr...@goog 
  legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 Gareth McCumskeyhttp://garethmccumskey.blogspot.com
 twitter: @garethmcc

-- 
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] Re: Customize admin generator to parse generator.yml with custom properties

2010-08-06 Thread Tom Ptacnik
Great, thank you for sharing your solution.


On 4 srp, 12:12, Thor thorste...@gmail.com wrote:
 Thank you Tom!
 today i found a bette solution!
 it's more solid than the solutoin posted in the first link you
 provided, and i guess it's easier.

 i don't know how, but in all this time i had the solution under my
 nose, but i couldn't see it:

 i was right suspecting that the place to act was the generator.yml
 class parameter:
 all i had to do is change in
   class: customGenerator

 and create my customGenerator, overridden as follows:

 http://pastebin.com/9jzcpNmq

 then in my generator i could add my extra context like:

       list:
         [something]

       extra:
         foo: bar
         asd: { test: foo }

 in the admin theme (or cache file) you can access your custom
 properties with $this-getExtraValue('foo');

 Y

 On 20 Lug, 09:32, Tom Ptacnik to...@tomor.cz wrote:



  Found some 
  stuff:http://fkling.wordpress.com/2009/09/09/custom-properties-in-symfonys-..

  On 15 čnc, 12:48, Thor thorste...@gmail.com wrote:

   nobody? :(

   On 12 Lug, 12:43, Thor thorste...@gmail.com wrote:

well,actually i need to heavily customizeadmingenerators to create
various functionalities, so i haven't got a single example, i provide
some of them that i could use:

batch_position: top  # (top,bottom,both)
toggable_fields: [ gallery, field1,field2 ]  # fields who will have a
jquery effect to toggle containers
floating_components: [ component1,component2, component3 ] # ok ,maybe
this is a bit too much, but is only for the sake of the example

The goal i'd want to reach is to provide other developers in the
company,admingenerators already configured / built with some custom
needs

I looked in the built-in themes, and for example they look for

$this-configuration-getValue('list.batch_actions')
or again
$this-configuration-getValue('list.display')
or again
$this-getI18NString ('list.title')

i'd like to find a way to make
$this-configuration-getValue('list.batch_position')
parsable with a custom function...

On 12 Lug, 12:25, Daniel Lohse annismcken...@googlemail.com wrote:

 This sounds much too abtract (custom_option1) — what use-case do you 
 have?

 Cheers, Daniel

 Sent from my iPad

 On Jul 12, 2010, at 12:18 PM, Thor thorste...@gmail.com wrote:

  Hi all,
  i cannot understand how to customize theadmingenerator:
  i am using propel, and i see that from thegenerator.yml the first
  line is the class used by thegenerator, therefore in my case
  sfPropelGenerator.

  I think that extending that class with a custom one is the first 
  step,
  what i'd like to know, and i didn't find any information about it, 
  is
  how to parse the yml with options i want, for example by adding some
  options

  list:
         display: [ title, _content, status, created_at ]
         batch_actions: { }
         custom_option1: true
         custom_option2: { attrib1: xyz, attrib2: aaa }
         etc..

  could someone please address me toward the correct direction?
  what class do i have to look for?

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

-- 
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] Re: Problem with filters

2010-08-05 Thread Tom Ptacnik
One problem might be in that you are changing the 'nom' from text to
list
Then you have to build query with another method.

So you need to overwrite the getFields() method:
public function getFields()
  {
$fields = parent::getFields();
$fields['nom'] = 'ForeignKey';
return $fields;
  }

Or if it doesn't work sfFormFilterDoctrine is another class which can
get you answers why your filtering doesn't work.

On 4 srp, 08:40, florian périn poulet.va...@gmail.com wrote:
 I want this filters to do the role of filter. When I choose for
 exemple 'non' on enligne, there are only families with 0 on the column
 enligne. But when I chose this, there is not generated SQL query...

 So I don't know what to do.

 On 3 août, 16:35, Tom Ptacnik to...@tomor.cz wrote:



  What do you want to this filter to do? And what is does instead?

  ... look on the generated SQL query which is creaded by the filter.
  This is the way to go to find your mistake.

  On 3 srp, 13:16, florian périn poulet.va...@gmail.com wrote:

   I use symfony 1.4.5.

   //lib/filter/doctrine/BackendgammeFormFilter.class.php

     1 ?php
     2
     3 /**
     4  * Gamme filter form backend class.
     5  *
     6  * @package    refactor_metaux
     7  * @subpackage filter
     8  * @author     Florian PÉRIN
     9  * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php
   29570 2010-05-21 14:49:47Z Kris.Wallsmith $
    10  */
    11 class BackendGammeFormFilter extends GammeFormFilter
    12 {
    13   public function configure()
    14   {
    15       $this-addWidgets();
    16       $this-addValidators();
    17       $this-widgetSchema-setNameFormat('gamme_filters[%s]');
    18       $this-errorSchema = new 
   sfValidatorErrorSchema($this-validatorSchema);

    19   }
    20
    21   public function addWidgets()
    22   {
    23     $this-setWidgets(array(
    24       'nom'          = new sfWidgetFormDoctrineChoice(array(
    25                                 'model' = 'Gamme',-
    26                                 'add_empty' = true,-
    27                                 'order_by' = array('nom',
   'asc'),-
    28                         )),
    29       'image'        = new sfWidgetFormFilterInput(),
    30       'description'  = new sfWidgetFormFilterInput(),
    31       'deuxcolonnes' = new sfWidgetFormChoice(array( 'choices' =
   array( '' = 'oui ou non', '0' = 'non', '1' = 'oui'), ) ),
    32       'enligne'      = new sfWidgetFormChoice(array( 'choices' =
   array( '' = 'oui ou non', '0' = 'non', '1' = 'oui'), ) ),
    33       'lienspe'      = new sfWidgetFormFilterInput(),
    34     ));
    35   }
    36
    37   public function addValidators()
    38   {
    39     $this-setValidators(array(
    40       'nom'          = new sfValidatorChoice( array( 'choices' =
   array($this-getObject()-get('idgamme')), 'required' = false)),
    41       'image'        = new sfValidatorPass(array('required' =
   false)),
    42       'description'  = new sfValidatorPass(array('required' =
   false)),
    43       'deuxcolonnes' = new sfValidatorChoice(array('required' =
   false, 'choices' = array( '0', '1'))),
    44       'enligne'      = new sfValidatorChoice(array('required' =
   false, 'choices' = array( '0', '1'))),
    45       'lienspe'      = new sfValidatorPass(array('required' =
   false)),
    46     ));
    47   }

   And it looks before like this:

     1 ?php
     2
     3 /**
     4  * Gamme filter form backend class.
     5  *
     6  * @package    refactor_metaux
     7  * @subpackage filter
     8  * @author     Florian PÉRIN
     9  * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php
   29570 2010-05-21 14:49:47Z Kris.Wallsmith $
    10  */
    11 class BackendGammeFormFilter extends GammeFormFilter
    12 {
    13   public function configure()
    14   {
    15       $this-addWidgets();
    16       $this-addValidators();
    17       $this-widgetSchema-setNameFormat('gamme_filters[%s]');
    18       $this-errorSchema = new 
   sfValidatorErrorSchema($this-validatorSchema);

    19   }
    20
    21   public function addWidgets()
    22   {
    23     $this-setWidgets(array(
    24       'nom'          = new sfWidgetFormFilterInput(),
    25       'image'        = new sfWidgetFormFilterInput(),
    26       'description'  = new sfWidgetFormFilterInput(),
    27       'deuxcolonnes' = new sfWidgetFormFilterInput(),
    28       'enligne'      = new sfWidgetFormFilterInput(),
    29       'lienspe'      = new sfWidgetFormFilterInput(),
    30     ));
    31   }
    32
    33   public function addValidators()
    34   {
    35     $this-setValidators(array(
    36       'nom'          = new sfValidatorPass(array('required' =
   false)),
    37       'image'        = new sfValidatorPass(array('required' =
   false)),
    38       'description'  = new sfValidatorPass(array('required' =
   false)),
    39       'deuxcolonnes' = new sfValidatorPass(array('required' =
   false)),
    40

[symfony-users] Re: Problem with filters

2010-08-03 Thread Tom Ptacnik
What means doesn't work?
How it looks before ... show BaseFormFilter class, or the schema of
the object at least.
Which version of Symfony?

On 3 srp, 11:01, florian périn poulet.va...@gmail.com wrote:
 Hello,

 I wanted to change the type of my filters auto-generate with admin-
 generator, but when I did it, the filters didn't work anymore.

 For exemple, I change :

 //lib/filter/doctrine/BackendGammeFormFilter.class.php
 [...]
 'nom' = new sfWidgetFormDoctrineChoice(array(
                                'model' = 'Gamme',
                                'add_empty' = true,
                                'order_by' = array('nom', 'asc'),
                           )),
 'enligne' = new sfWidgetFormChoice(array( 'choices = array( ' ' =
 'oui ou non', 0 = 'non', 1 = 'oui') ) ),
 [...]

 'nom' = new sfValidatorChoice( array( 'choices' = 
 array($this-getObject()-get('idgamme')), 'required' = false)),

 'enligne' = new sfValidatorChoice( array('required' = false,
 'choices'  = array( 0, 1) ) ),
 [...]

 If you have any clue why it doesn't work...

 Thanks,

-- 
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] Re: Problem with filters

2010-08-03 Thread Tom Ptacnik
What do you want to this filter to do? And what is does instead?

... look on the generated SQL query which is creaded by the filter.
This is the way to go to find your mistake.

On 3 srp, 13:16, florian périn poulet.va...@gmail.com wrote:
 I use symfony 1.4.5.

 //lib/filter/doctrine/BackendgammeFormFilter.class.php

   1 ?php
   2
   3 /**
   4  * Gamme filter form backend class.
   5  *
   6  * @package    refactor_metaux
   7  * @subpackage filter
   8  * @author     Florian PÉRIN
   9  * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php
 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
  10  */
  11 class BackendGammeFormFilter extends GammeFormFilter
  12 {
  13   public function configure()
  14   {
  15       $this-addWidgets();
  16       $this-addValidators();
  17       $this-widgetSchema-setNameFormat('gamme_filters[%s]');
  18       $this-errorSchema = new 
 sfValidatorErrorSchema($this-validatorSchema);

  19   }
  20
  21   public function addWidgets()
  22   {
  23     $this-setWidgets(array(
  24       'nom'          = new sfWidgetFormDoctrineChoice(array(
  25                                 'model' = 'Gamme',-
  26                                 'add_empty' = true,-
  27                                 'order_by' = array('nom',
 'asc'),-
  28                         )),
  29       'image'        = new sfWidgetFormFilterInput(),
  30       'description'  = new sfWidgetFormFilterInput(),
  31       'deuxcolonnes' = new sfWidgetFormChoice(array( 'choices' =
 array( '' = 'oui ou non', '0' = 'non', '1' = 'oui'), ) ),
  32       'enligne'      = new sfWidgetFormChoice(array( 'choices' =
 array( '' = 'oui ou non', '0' = 'non', '1' = 'oui'), ) ),
  33       'lienspe'      = new sfWidgetFormFilterInput(),
  34     ));
  35   }
  36
  37   public function addValidators()
  38   {
  39     $this-setValidators(array(
  40       'nom'          = new sfValidatorChoice( array( 'choices' =
 array($this-getObject()-get('idgamme')), 'required' = false)),
  41       'image'        = new sfValidatorPass(array('required' =
 false)),
  42       'description'  = new sfValidatorPass(array('required' =
 false)),
  43       'deuxcolonnes' = new sfValidatorChoice(array('required' =
 false, 'choices' = array( '0', '1'))),
  44       'enligne'      = new sfValidatorChoice(array('required' =
 false, 'choices' = array( '0', '1'))),
  45       'lienspe'      = new sfValidatorPass(array('required' =
 false)),
  46     ));
  47   }

 And it looks before like this:

   1 ?php
   2
   3 /**
   4  * Gamme filter form backend class.
   5  *
   6  * @package    refactor_metaux
   7  * @subpackage filter
   8  * @author     Florian PÉRIN
   9  * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php
 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
  10  */
  11 class BackendGammeFormFilter extends GammeFormFilter
  12 {
  13   public function configure()
  14   {
  15       $this-addWidgets();
  16       $this-addValidators();
  17       $this-widgetSchema-setNameFormat('gamme_filters[%s]');
  18       $this-errorSchema = new 
 sfValidatorErrorSchema($this-validatorSchema);

  19   }
  20
  21   public function addWidgets()
  22   {
  23     $this-setWidgets(array(
  24       'nom'          = new sfWidgetFormFilterInput(),
  25       'image'        = new sfWidgetFormFilterInput(),
  26       'description'  = new sfWidgetFormFilterInput(),
  27       'deuxcolonnes' = new sfWidgetFormFilterInput(),
  28       'enligne'      = new sfWidgetFormFilterInput(),
  29       'lienspe'      = new sfWidgetFormFilterInput(),
  30     ));
  31   }
  32
  33   public function addValidators()
  34   {
  35     $this-setValidators(array(
  36       'nom'          = new sfValidatorPass(array('required' =
 false)),
  37       'image'        = new sfValidatorPass(array('required' =
 false)),
  38       'description'  = new sfValidatorPass(array('required' =
 false)),
  39       'deuxcolonnes' = new sfValidatorPass(array('required' =
 false)),
  40       'enligne'      = new sfValidatorPass(array('required' =
 false)),
  41       'lienspe'      = new sfValidatorPass(array('required' =
 false)),
  42     ));
  43   }

 On 3 août, 12:26, Tom Ptacnik to...@tomor.cz wrote:



  What means doesn't work?
  How it looks before ... show BaseFormFilter class, or the schema of
  the object at least.
  Which version of Symfony?

  On 3 srp, 11:01, florian périn poulet.va...@gmail.com wrote:

   Hello,

   I wanted to change the type of my filters auto-generate with admin-
   generator, but when I did it, the filters didn't work anymore.

   For exemple, I change :

   //lib/filter/doctrine/BackendGammeFormFilter.class.php
   [...]
   'nom' = new sfWidgetFormDoctrineChoice(array(
                                  'model' = 'Gamme',
                                  'add_empty' = true,
                                  'order_by' = array('nom', 'asc'),
                             )),
   'enligne' = new sfWidgetFormChoice(array( 'choices

[symfony-users] Re: How to turn off filters in admin generator?

2010-07-31 Thread Tom Ptacnik
generator:
  param:
config:
  filter:
class: false

Works for me.


On 30 čnc, 18:09, halfer google.com.20080213...@jondh.me.uk wrote:
 Hi all

 I've discovered a bug in the filters section of the admin generator
 (when run against Oracle anyway) on Symfony 1.3 and Propel 1.5. I
 believe that if I can turn the filters off, the problem will go away.
 I have tried the following in a child generator.yml (i.e. a module
 level one that customises the parent version in a plugin).

 generator:
   param:
     config:
       filter:
         class: false

 I've also tried:

 generator:
   param:
     config:
       filter:
         display: []

 Neither appears to have any affect.

 I have also added a _filters.php file in the appropriate app-level
 module templates folder, in order to prevent the filters rendering,
 and it has had no effect.

 Any help that can be provided will be appreciated :o)

-- 
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] Re: Problems with a select to change the language (cookies)

2010-07-30 Thread Tom Ptacnik
Why do you need to delete cookies before?

On 28 čnc, 20:47, Javier Garcia tirengar...@gmail.com wrote:
   Hi

 I have followed the steps below to add a select to change the language
 of my app.

 http://www.symfony-project.org/jobeet/1_4/Doctrine/en/19#chapter_19_l...

 It works OK for the first time I change the language, but the next time
 I try to change it I need to delete the Cookies before..

 I tried it in FF and Epiphany and is the same problem in both.

 Any idea?

 Javi

 Sf 1.3 / Ubuntu 8.04

-- 
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] Re: how to use Flush wih symfony

2010-07-30 Thread Tom Ptacnik
Ok, I think I understand.

You are showing some page - the loading of the page is slow because of
the work on the background (rebuilding the lucene index)

If I'm right, then the solution would be to show some javascript
progressbar and do the rebuilding in ajax request.

Or (if you are rebuilding the index by yourself), then you can write
to the database that you started rebuilding the index. Then on the
page periodically check (probably by ajax request) if the index
rebuilding is still in action.
Then after the rebuilding is done ... write to the database
rebuilding=false ... The page then will recognize that its over...


On 28 čnc, 22:52, Julian Reyes Escrigas
julian.reyes.escri...@gmail.com wrote:
 I'm trying to make a task in the backend for re-build the lucene's index but 
 the index grows with the time and is more slower to rebuild in the future, 
 and trying to make an action form rebuild the index and notice to user the 
 progress of the operation, I need send to the browser information like the 
 progress,

 Example:
 While (true) {
         updateIndex();
         send( 'progress');}

 Send (''task ended);

 sorry for my grammar, I dont speak well the English

 -Mensaje original-
 De: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] En 
 nombre de Tom Ptacnik
 Enviado el: miércoles, 28 de julio de 2010 1:13
 Para: symfony users
 Asunto: [symfony-users] Re: how to use Flush wih symfony

 I don't understand what are you trying to achieve.Try to explain again.

 On 25 čnc, 20:12, Julian Reyes Escrigas

 julian.reyes.escri...@gmail.com wrote:
  How to use flush with symfony in a long while for send information to
  user

 --
 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 
 athttp://groups.google.com/group/symfony-users?hl=en

-- 
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] Re: Avoid blank embed form to be saved

2010-07-30 Thread Tom Ptacnik
I think that easy solution is to overwrite the save method of the
object wich is on the embeded form.

Just test if there are some values and if not, end the method. If yes,
call parent::save()


On 30 čnc, 01:51, J_Wesker j_chave...@hotmail.com wrote:
 After making some changes on my code and debugging using die's and
 var_dump() all day,
 I haven't found the cause of all this. But I have make sure of some
 facts:

 1. If I embed directly the comment form, and set the body field as
 required, then both objects get saved smoothly,
 unfortunately the bussiness rules I'm following here don't apply.

 2. On my extended saveEmbeddedForms() method, $comment is actually
 NULL,
 because on the custom post validator, if no body comment is entered,
 the comment value
 is unset. Therefore, the condition we discussed before complies
 correctly when necessary.

 3. Even though the values from the embedded form aren't set, the
 comment form is saved anyway if left blank.

 I came to the point to think that perhaps the relation between the
 comment and user table might be the cause,
 and then I decided to remove the relation from the comment table, but
 still, the embed form is saved blank.
 If not removing the relationship and with the following updated code,
 I get a Propel Exception only when the comment
 is left blank.

 http://pastie.org/1066339 / model

 http://pastie.org/1066347 / ExpenseForm

 http://pastie.org/1066350 / ExpenseCommentValidatorSchema

 http://pastie.org/1066353 / ExpenseCommentForm

 http://pastie.org/1066364 / PropelException generated

 UPDATE!!!

 While writing this post I made a breaktrhough with this, but even so,
 I'm still missing something...

 If instead of defining the relationship between Expense and Comment
 objects in the ExpenseForm like this:

 $comment-setExpense($this-getObject());

 to this:

 $comment-setExpenseId($this-getObject()-getId());

 when editing an existing expense, comments are saved correctly, and
 most important no blank comment is saved!

 There is a big BUT, however, the expense object doesn't get an ID
 until after saving the embeded objects, so, how
 can I approach this for new expense forms???

 Apparently the problem is about how Propel saves embedded objects,
 because as a direct object relation was made
 with $comment-setExpense(), the saving of the embed object is forced,
 even if the embed form is deleted S

 Any ideas on how to solve this?

 I will try to analyze more the flow used in sfFormObject::save()
 method tomorrow, and perhaps extending some of the method
 calls used by save() I will find the answer. If someone has any
 suggestion or idea please let me know :)

 Best regards!

-- 
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] Re: how to use Flush wih symfony

2010-07-28 Thread Tom Ptacnik
I don't understand what are you trying to achieve.Try to explain
again.


On 25 čnc, 20:12, Julian Reyes Escrigas
julian.reyes.escri...@gmail.com wrote:
 How to use flush with symfony in a long while for send information to user

-- 
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] Re: problem with $form-getObject()

2010-07-28 Thread Tom Ptacnik
Then you can try to set your form like in this
http://melikedev.com/2009/12/09/symfony-w-doctrine-saving-many-to-many-mm-relationships/
article and see how Symfony does this.

On 26 čnc, 22:51, Devang Modi dpm...@gmail.com wrote:
 Thanks for info.
 I tried something similar but it didn't work.

 In doUpdateObject
 $authors = Doctrine::getTable('Dauthor')-createQuery('a')-where('id=?', 
 '1')-execute();

 $this-object-setDauthor($authors);

 What am I doing wrong?

 Thanks,
 Devang.

 On Jul 26, 5:59 am, Johannes johannes.schmitt...@googlemail.com
 wrote:



  I'd update the object directly instead of the values:
  $this-object-setPublication('test');
  $this-object-Authors-get(null);

  kind regards,
  Johannes

  On 26 Jul., 02:18, Devang Modi dpm...@gmail.com wrote:

   I found doUpdateObject to update publication and it worked. But same
   thing I tried with many to many relationship it didn't work.
   I change my YML;
   Dauthor:
     tableName: dauthor
     columns:
       id:     { type: integer(4), unsigned: true, primary: true,
   autoincrement: true }
       name:   { type: string(30), unique: true }
       publication:   { type: string(30), unique: true }
     relations:
       Dbook:
         class: Dbook
         refClass: DauthorBook
         local: dauthor_id
         foreign: dbook_id

   In
   protected function doUpdateObject($values)
     {
        values[publication] = test; // This works
        values[dauthor_list] = array(1); //this doesn't work

           parent::doUpdateObject($values);
     }

   Even I do unset(values[dauthor_list]) doesn't help.

   any suggests?

   Thanks,
   Devang.

   On Sun, Jul 25, 2010 at 10:12 PM, Devang Modi dpm...@gmail.com wrote:
Hi,

I am new to symfony and need help populate field after form
submission.

I unset form field so that user won't able to see. Once form has been
submitted I want to populate that field with default value.

In YML file
Dbook:
 tableName: dbook
 columns:
   id:     { type: integer(4), unsigned: true, primary: true,
autoincrement: true }
   name:   { type: string(30), unique: true }
   publication:   { type: string(30), unique: true }

In DbookForm:
unset($this[publicatoin])

In Action file;
if ($form-isValid())
               {
                       $book = $form-getObject();
                       if ($book-isNew())
                       {
                               $book-setPublication(test);
                       }
                       $book = $form-save();
                       $this-redirect('book/index');
               }

But this doesn't work.

I can do workaround by showing field and hiding with javascript but I
don't like that. Is that better way to solve this issue?

Thanks,
Devang.

-- 
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] Re: Concept Issue

2010-07-28 Thread Tom Ptacnik
Ok, then I think that with only 3 tables the schema would be too
complex.
Because then it looks to me like M:N relation(r1) between Design and
Type
Then this relation r1 is M:N related to the size. And also quantity is
somehow related to the all of that?
..phew.. :)

Then maybe another way would be better.
Do this like an classic e-shop.. maybe not classic but...

You will have a product table with some attributes and some M:N
relations

Possibility 1)
Product(table)
---
name (not necessary .. maybe only some code for you)
design_id (this means 1:N relation to the Design table)
type_id (this means 1:N relation to the Type table)
Sizes (M:N relationi to the Size table)

and Size will be related to the Quantity (this means that every A5
format will be avaliable for example from 1 to 5 pieces - no matter of
design and type)

Or of you need to connect the quantity to the design and type, then
your schema could look like this:

Possibility 2)
Product
---
name/code
design_id
type_id
size_id (1:N relation to the size table)
Quantity (M:N relation to the quantity table)

.. with this schema you have to add more products for same design
and type and size and diferrent quantity. But this quantity is
connected just to this combination.


I'm not saying that this is the best solution. Maybe someone has a
better idea. But I think it can work :)


On 26 čnc, 21:23, Micoto mich...@micoto.co.uk wrote:
 Thanks for replying Tom,

 It is 2), but with combinations of 1c) they will be connected to
 combinations of type, size and quantity.

 e.g.

 Person selects

 Design 1.. they get a drop down list of available media types (not all
 may be available, flyers and posters may be available, but banners not
 allowed).

 They pick flyers in this case, , they then get a Size type (A5,A6,A7,
 depending on the media type). They would not be allowed to have A5
 Banners or 2ft x 10ft flyers for example.

 I could have a list of 1,2,3,4,5,10,20,50,100,1000,1, 2, but
 all may not be displayed to them (they would not be allowed to order
 just 1 A5 flyer for example, and could not order 10,000 A2 posters.

 I hope I have explained a little better.

 On Jul 26, 8:35 am, Tom Ptacnik to...@tomor.cz wrote:



  Hi,

  there are some questions which you have to answer if you want to
  design this app.

  1) sizes are connected to the type or to the design, or to the
  combinatioin of designtype?
    a) all posters have size A5 and A6 (no matter which design), all
  banners has size A6, A7 (no matter which design)
    b) design D1 can have size A2, A3, A4 (no matter which type)
    c) design D2 on banner can have size A4,A5, A6; design D2 on Flyer
  can have sizes A5,A6, A7

  2) quantity is connected only to the size? Or to the combinations of
  the size  type?

  On 24 čnc, 18:08, Micoto mich...@micoto.co.uk wrote:

   This is more of a 'how would I go about it' rather than a specific
   symfony question, but as I am using symfony to develop this, here
   goes!

   I have a website I would like to set up whereby a person can login,
   choose a design and then (admin configurable) be able to choose either
   a Flyer, Poster or Banner depending on what they choose they will be
   able to order a different quantity.

   i.e. Person logs in -
   They pick a design
   They pick a media Type (Flyers, Posters, Banners)
   They pick A siz (A5,A6, A7)
   They pick a quantity (determined by admin on a per size scale, they
   can choose from 100,200 on A5 flyers; 500 or 1000 on A6 flyers, 1 or 2
   A2 Posters or 3 or 4 A3 Posters. And then a configurable option if
   they can choose to provide their own quantity.

   In the backend I want to be able to add one design and then be able to
   add different quantities for different sizes and media types.

   I have thought that I would need 3 tables, one for designs, one for
   media types and one for sizes.

   I would then have a serialized field in the designs with say A2:1,2,3-
   N|A5:100,200,500-Y which would then populate the settings for the
   design.
   A2 being file size (but relational to the media types table), 1,2,3
   being the quantities allowed (again relational to the stored
   quantities table) and the -N or -Y if they are allowed to provide
   there own quantity.

   I would really appreciate input from other people as it's kind of
   challenging to get my head around the logic of it. Any other ideas?

-- 
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] Re: overriding delete method in a Many-to-Many relation

2010-07-28 Thread Tom Ptacnik
What about to overwrite the delete method?


On 28 čnc, 09:59, pierre.use...@gmail.com pierre.use...@gmail.com
wrote:
 Hi all,

 I've a problem with the delete method in my project.

 here is my schema :

 USER:
   columns:
     id:    {type: integer(7), primary: true, autoincrement: true}
     name:   {type: string(20), primary: false}
   relations:
     USER_SESSION:
       foreignAlias: Users
       local: id_user
       foreign: id_session
       refClass: USER_SESSION

 SESSION:
   columns:
     id:    {type: integer(7), primary: true, autoincrement: true}
     name:   {type: string(20), primary: false}
   relations:
     USER_SESSION:
       foreignAlias: Sessions
       local: id_session
       foreign: id_user
       refClass: USER_SESSION

 USER_SESSION:
   columns:
     id:    {type: integer(7), primary: true, autoincrement: true}
     id_user:   {type: integer(7)}
     id_session:   {type: integer(7)}
     deleted: {type: boolean, default: false}
   relations:
     SESSION:
       foreignAlias: Users
       local: id_session
       foreign: id
       onDelete: CASCADE
     USER:
       foreignAlias: Sessions
       local: id_user
       foreign: id
       onDelete: CASCADE

 I've created the modules to manipulate Users and Sessions tables and
 I'm able to add or remove Users, sessions and create or remove
 relations USER_SESSION (it add or delete the corresponding row). This
 is great !

 The problem is that now I want that when I will update a user and
 cancel a subscription to a session I don't want to delete the row in
 the table USER_SESSION. I just want to update the boolean field of the
 row and set it to true when I remove the relation in my form.

 Anybody know how to override the delete method to not delete the many
 to many relation when calling the executeUpdate ?

 I've tried to override preDelete and postDelete but it continues to
 remove the entry from the table.

 Thanks !
 regards,
 Pierre.

-- 
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] Re: Concept Issue

2010-07-26 Thread Tom Ptacnik
Hi,

there are some questions which you have to answer if you want to
design this app.

1) sizes are connected to the type or to the design, or to the
combinatioin of designtype?
  a) all posters have size A5 and A6 (no matter which design), all
banners has size A6, A7 (no matter which design)
  b) design D1 can have size A2, A3, A4 (no matter which type)
  c) design D2 on banner can have size A4,A5, A6; design D2 on Flyer
can have sizes A5,A6, A7

2) quantity is connected only to the size? Or to the combinations of
the size  type?


On 24 čnc, 18:08, Micoto mich...@micoto.co.uk wrote:
 This is more of a 'how would I go about it' rather than a specific
 symfony question, but as I am using symfony to develop this, here
 goes!

 I have a website I would like to set up whereby a person can login,
 choose a design and then (admin configurable) be able to choose either
 a Flyer, Poster or Banner depending on what they choose they will be
 able to order a different quantity.

 i.e. Person logs in -
 They pick a design
 They pick a media Type (Flyers, Posters, Banners)
 They pick A siz (A5,A6, A7)
 They pick a quantity (determined by admin on a per size scale, they
 can choose from 100,200 on A5 flyers; 500 or 1000 on A6 flyers, 1 or 2
 A2 Posters or 3 or 4 A3 Posters. And then a configurable option if
 they can choose to provide their own quantity.

 In the backend I want to be able to add one design and then be able to
 add different quantities for different sizes and media types.

 I have thought that I would need 3 tables, one for designs, one for
 media types and one for sizes.

 I would then have a serialized field in the designs with say A2:1,2,3-
 N|A5:100,200,500-Y which would then populate the settings for the
 design.
 A2 being file size (but relational to the media types table), 1,2,3
 being the quantities allowed (again relational to the stored
 quantities table) and the -N or -Y if they are allowed to provide
 there own quantity.

 I would really appreciate input from other people as it's kind of
 challenging to get my head around the logic of it. Any other ideas?

-- 
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] Re: Multiple Doctrine Database Issues again

2010-07-23 Thread Tom Ptacnik
Maybe this is for developers list?


On 20 čnc, 20:38, PhiKapJames phikapja...@gmail.com wrote:
 I had this issue back in November and it was fixed on the doctrine
 side.  I recently updated Symfony from 1.4.3 to the latest 1.4.7 and
 the issue has cropped back up again.  Even though I'm specifying two
 different databases to use, it's still using the last one in the
 list.  The base models haven't changed and still bind correctly.

 databases.yml:
 all:
   db1:
     class: sfDoctrineDatabase
     param:
       dsn: 'mysql:host=localhost;dbname=db1'
       username: db1
       password: db1
   db2:
     class: sfDoctrineDatabase
     param:
       dsn: 'mysql:host=localhost;dbname=db2'
       username: db2
       password: db2

 So even though the model says to bind to db1, it will return an error
 now with can't find table db2.tableInDB1.  The only change on my end
 was a svn update in the vendor directory and then clear out cache.

-- 
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] Re: no_script_name and problems with URI

2010-07-23 Thread Tom Ptacnik
If you set no_script_name to false then it shouldn't change you url
from
http://www.example.com/index.php/module/action to
http://www.example.com/moduleName?productId=2

Try to set it to true again (or look on the page in the dev
environment - with the frontend_dev.php) and look how the URL changes.
..if you set it to true it should only remove the frontend controller
name (index.php, backend.php) from the URL .. nothing else


On 23 čnc, 10:09, mehdi hadef mehdi.ha...@gmail.com wrote:
 Yes by default it should take the action index like you say but it does not
 in my case. Maybe it's due to the fact that the URI have parameters ?

 I think it's not clean because I found strange that changing a parameter in
 my settings.yml forced me to modify my routings.yml to work.

 2010/7/21 Gustavo Adrian comfortablynum...@gmail.com



  If I'm wrong, please, correct me, but didn't the routing framework take the
  action index by default, so you can avoid tu put it on the URL?

  BTW, Why do you think is not clean to put the rules on the routing.yml?

  On Wed, Jul 21, 2010 at 6:51 AM, snoop mehdi.ha...@gmail.com wrote:

  Hi all,

  I changed the no_script_namemy parameter of my settings.yml for prod
  environnement and set it to on.
  So now I havehttp://www.example.com/module/actioninstead of
 http://www.example.com/index.php/module/actionlike I want.

  But I got a problem with my link using helper url_for().
  For example in my action I have a link with url_for('moduleName/index?
  productId=$productId') and the result in my page is
 http://mywebsite.com/moduleName?productId=2.
  So I got a 404 error because it remove my action name index.

  How can I solve this problem ? I know I can add some rules in my
  routing.yml to fix it but I think this solution is not clean ...

  --
  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.comsymfony-users%2bunsubscr...@goog
   legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

   --
  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.comsymfony-users%2bunsubscr...@goog 
  legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

-- 
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] Re: upgrade sfDoctrineGuardPlugin from 4.0.1 to 4.0.2

2010-07-23 Thread Tom Ptacnik
I want to try a new version (5.0.0). Do you suggest to connect the
trunk to my project (http://svn.symfony-project.com/plugins/
sfDoctrineGuardPlugin/trunk/) via svn external or rather instal it
like a package?

I'm afraid of to much changes in the trunk in the future... What about
creating a tag in the svn repository .. named like the package 5.0.0?
Then I can use the svn:externals and don't worry about some future
changes which wouldn't be compatible with my app.


On 22 čnc, 18:12, Jonathan Wage jonw...@gmail.com wrote:
 We added the forgot password, register, etc. functionality. Everything
 else stayed the way it was.

 - Jon





 On Thu, Jul 22, 2010 at 3:40 AM, Sela Yair tzi...@gmail.com wrote:
  what actually did you change in the 5.0.0 release?

  On 18 July 2010 19:37, fizyk fi...@fizyk.net.pl wrote:

  Hello,
  I'm trying to upgrade sfDoctrineGuardPlugin to the new version, and at
  first found that surprised that although in changelog said there was
  only change (fix) to the Remember Me? key generator, I'm getting fatal
  error whenever I make use something from sfDoctrineGuardPlugin after
  upgrade.

  But then I've started diff task and found that the whole set of
  changes waiting in svn trunk was upgraded along ;) that's quite a
  surprise.

  Any thoughts on what I need to be carefull with upgrade to the new
  sfDoctrineGuardPlugin version?
  first thing is that I need to migrate my database,
  second, modify schema.yml declaration, since existing users will have
  empty email_address fields at first,

  Anything more?

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

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

 --
 Jonathan H. Wagehttp://www.twitter.com/jwage

-- 
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] Re: backend: forward to another module

2010-07-22 Thread Tom Ptacnik
I think it's because when you want to edit something, you must  say
what

This edit action in mod_B don't know which object it should edit (you
didn't send any id, or object)


On 20 čnc, 16:10, Martin Henits martin.hen...@gmail.com wrote:
 in one of my backend modules (mod_A), I need to put a link to the edit
 page of another backend module (mod_B).

 I did it in this way:
   - in mod_A/config/generator.yml, I wrote:
        list:
          actions:
             mylink:
                action: mylink

   - and in mod_A/actions/actions.class.php, I added a function named
 executeMylink

 now I don't know what I should write inside the executeMylink
 I tried $this-forward('mod_B', 'edit'); but I'm getting Call to
 undefined method sfRoute::getObject() error.

 Thanks 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] Re: Admin generator edit/delete action link error

2010-07-22 Thread Tom Ptacnik
One appliacation in your project can use index.php (probably
frontend)
the others must use another frontend controller which isn't
automaticly executed.

Solutions how to add /admin/ or /backend/ into your url are several.
Try to look there, it might help you.
http://groups.google.com/group/symfony-users/browse_thread/thread/255dbf23ba25cd33
http://particul.es/blog/index.php?post/How-to-change-backend.php-to-admin-prefix-routes-automatically-symfony
http://symfony-check.org/permalink/delete-backend-php-from-your-uri

On 20 čnc, 18:05, mohdshakir mohdsha...@gmail.com wrote:
 Thanks a lot, that solves the problem, but I will always get admin.php
 instead of the cleaner 'admin' only in the URL. Any workaround for
 that?

 On Jul 20, 11:23 pm, Gábor Fási maerl...@gmail.com wrote:



  Make sure you have no_script_name disabled in your backend's
  settings.yml for the prod environment. And clear your cache.

  On Tue, Jul 20, 2010 at 16:44, Mohd Shakir bin Zakaria

  mohdsha...@gmail.com wrote:
   Hi everyone,

   I'm using admin generator for one of my project, and the edit/delete
   action in the list points to wrong URL.

   For example, for this URL,

  http://127.0.0.1/ems/admin/data

   the edit link of the first item is as the following,
  http://127.0.0.1/ems/data/1/edit

   where the application name (admin) is not in the list, and so I get
   the error when clicking the link. The same goes for the delete action.

   Things are OK if I'm using dev (http://127.0.0.1/ems/admin_dev.php/data).

   Any idea of what could be causing the problem?

   p/s: I'm still new with Symfony

   --
   Regards,

   Mohd Shakir Zakaria
  http://www.mohdshakir.net

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

-- 
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] Re: sfGuard default culture for a user

2010-07-21 Thread Tom Ptacnik
I would do that somewhere in the login process of the user.

just call getUser()-setCulture($culture); where $culture is
readed from the user profile.



On 19 čnc, 20:16, Tomasz Ignatiuk tomek.ignat...@gmail.com wrote:
 Hi

 If I add a profile to a user with some information, also a language
 for a user, how to set up default culture for a user based on a value
 from Profile model?

 Symfony 1.4 sfGuard 4.0

-- 
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] Re: Filter config

2010-07-20 Thread Tom Ptacnik
I don't think that sfBasicSecurityFilter read files..


On 10 čnc, 23:44, Julian Reyes Escrigas
julian.reyes.escri...@gmail.com wrote:
 Hi

 I'm trying to change the security of my app from files security.yml to my DB
 with some more options but I don't get where the filter
 sfBasicSecurityFilter read the files.

 Anybody have a solution or knows about this topic

-- 
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] Re: Customize admin generator to parse generator.yml with custom properties

2010-07-20 Thread Tom Ptacnik
Found some stuff:
http://fkling.wordpress.com/2009/09/09/custom-properties-in-symfonys-admin-generator-configuration/
http://www.symfony-project.org/gentle-introduction/1_4/en/14-Admin-Generator#chapter_14_summary
http://gestadieu.blogspot.com/2009/08/sfadminthemejrollerplugin-symfony-admin.html


On 15 čnc, 12:48, Thor thorste...@gmail.com wrote:
 nobody? :(

 On 12 Lug, 12:43, Thor thorste...@gmail.com wrote:



  well,actually i need to heavily customizeadmingenerators to create
  various functionalities, so i haven't got a single example, i provide
  some of them that i could use:

  batch_position: top  # (top,bottom,both)
  toggable_fields: [ gallery, field1,field2 ]  # fields who will have a
  jquery effect to toggle containers
  floating_components: [ component1,component2, component3 ] # ok ,maybe
  this is a bit too much, but is only for the sake of the example

  The goal i'd want to reach is to provide other developers in the
  company,admingenerators already configured / built with some custom
  needs

  I looked in the built-in themes, and for example they look for

  $this-configuration-getValue('list.batch_actions')
  or again
  $this-configuration-getValue('list.display')
  or again
  $this-getI18NString ('list.title')

  i'd like to find a way to make
  $this-configuration-getValue('list.batch_position')
  parsable with a custom function...

  On 12 Lug, 12:25, Daniel Lohse annismcken...@googlemail.com wrote:

   This sounds much too abtract (custom_option1) — what use-case do you have?

   Cheers, Daniel

   Sent from my iPad

   On Jul 12, 2010, at 12:18 PM, Thor thorste...@gmail.com wrote:

Hi all,
i cannot understand how to customize theadmingenerator:
i am using propel, and i see that from thegenerator.yml the first
line is the class used by thegenerator, therefore in my case
sfPropelGenerator.

I think that extending that class with a custom one is the first step,
what i'd like to know, and i didn't find any information about it, is
how to parse the yml with options i want, for example by adding some
options

list:
       display: [ title, _content, status, created_at ]
       batch_actions: { }
       custom_option1: true
       custom_option2: { attrib1: xyz, attrib2: aaa }
       etc..

could someone please address me toward the correct direction?
what class do i have to look for?

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

-- 
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] Re: [admin generator]

2010-07-20 Thread Tom Ptacnik
one way is to remove the reset button from the layout

On 13 čnc, 20:28, osinet osinet.c...@gmail.com wrote:
 I probe this example http://www.slideshare.net/jcleveley/working-with-
 the-admin-generator slide number 39 and 40 and runs but the problem
 is that the filter can be restored and see the complete list phone
 numbers of all employees. How can I avoid the restoration of the
 filter?

-- 
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] Re: how to get changes in modell class pre update

2010-07-20 Thread Tom Ptacnik
look at the method $this-getModified(true/false);


On 14 čnc, 12:43, axel at axel.zu...@gmail.com wrote:
 hello,

 I have a model with an integer attribute - invitationCount, in case of
 an model update I would need to know the old and new value.

 public function preUpdate($event) {

   $oldValue = $this-getInvitationCount();
   $newValue = .?



 }

-- 
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] Re: Doctrine Admin Generator

2010-07-20 Thread Tom Ptacnik
If you haven't to much credentials (groups..), you can create one form
for admin and the second for normal user, they show the form by
the credential of the user.


On 14 čnc, 23:49, galileo galileo...@gmail.com wrote:
 You have misunderstand me :)

 i need display form fields only for those users that have needed
 credentials not the whole actions :) for you knowladge
 it is possible to define the actions credentials in the
 generator.yml :P

 it is

 generator:
   class: sfDoctrineGenerator
   param:
     model_class:           incReport
     theme:                 admin
     non_verbose_templates: true
     with_show:             false
     singular:              ~
     plural:                ~
     route_prefix:          inc_report
     with_doctrine_route:   true
     actions_base_class:    sfActions
     config:
       actions:
         edit:
           credentials: [ editReport ]
         show:
           credentials: [ showReport ]

       form:
         fields:
           some_field:
              credentials: [editReport]            -  THIS IS WHAT
 I NEED i CAN'T FIGURE how to get this :)

 On 14 Lip, 23:17, pghoratiu pghora...@gmail.com wrote:



  AFAIK you can not specify security settings in generator.yml only in
  config/security.yml
  There you have to specify the action name and the credentials required
  to access the action,
  see more info 
  here:http://www.symfony-project.org/reference/1_4/en/08-Security

      gabriel

  On Jul 14, 11:58 pm, galileo galileo...@gmail.com wrote:

   I have question

   how in admin generator add credentials to forms in edit or new

   for example i have

   new:
     display:
        Something:  [ great ]
     fields:
       great: { credentials:[admin_credential]}

   It dosn't working this field is allways displayed any reason ?

   Symfony 1.4 with standard sfDoctrinePlugin doctrine 1.2

   Hope for any answer how to do that

-- 
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] Re: I am trying to call return $ this- renderComponent ('onlineshop', 'homeShopsService', array ('service' = $ item [0])); from components.class.php

2010-07-20 Thread Tom Ptacnik
No you can't. renderComponent() method is only in sfAction, sfActions

Look on the Inheritence
http://www.symfony-project.org/api/1_4/sfAction#method_rendercomponent

On 14 čnc, 22:21, juanes31516 carocobal...@gmail.com wrote:
 sorry, there is in English-

 I am trying to call return $ this- renderComponent ('onlineshop',
 'homeShopsService', array ('service' = $ item [0])); from
 components.class.php
 getting the following error:
 OnlineShopComponents Call to undefined method: renderComponent.

 I can use renderComponent from the component.class.php?

 thank you very much

-- 
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] Re: actions in generator.yml

2010-07-20 Thread Tom Ptacnik
You can create this route and map it to your action

my_foo_action:
  url: /my_module/foo/action
  param: { module: my_module, action: foo}


On 17 čnc, 20:12, Martin Henits martin.hen...@gmail.com wrote:
 Hi all,

 I wrote the following piece of code in the generator.yml of a module:

 list:
   actions:
     foo:
       action: foo

 but instead of having an action linking to backend_dev.php/my_module/
 foo, it is linked to backend_dev.php/my_module/foo/action

 therefore, when I click on it, I see:
 Action my_module/action does not exist.

-- 
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] Re: include_js/css VS partials

2010-07-20 Thread Tom Ptacnik
Which version of Symfony do you use?

On 17 čnc, 20:15, comb sa...@gmx.net wrote:
 Hi! :)

 I found much on the web regarding the topic, but no solution! :(
 Normally one would include the css and js in the head. But if I call

 ?php use_javascript('xyz.js');
     php use_stylesheet('xyz.css') ?

 from an partial, they are not included, because the helpers in the
 head of the layout are executed already.
 Putting the helpers to the bottom of the layout includes ALL, but this
 fails caused by html-standards.

 How can I manage to include the js/css needed from partials in the
 head of the html-document, too?

-- 
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] Re: Sluggable behaviour: field called slug is not created

2010-07-20 Thread Tom Ptacnik
Maybe colision with inheritance? Try to move inheritance before actAs
(only guess)

On 19 čnc, 21:16, Javier Garcia tirengar...@gmail.com wrote:
 no idea?

 On Jul 17, 10:35 pm, Javier Garcia tirengar...@gmail.com wrote:



  Hi,

  I have this model:

  Usuario:
     actAs:
       Sluggable:
         unique: true
         fields:  [nombre_apellidos]
         canUpdate: true
     inheritance:
       extends: sfGuardUser
       type: simple
     columns:
       username:
         type: string(128)
         notnull: false
         unique: true
       nombre_apellidos: string(60)
       sexo: boolean
       fecha_nac: date
       provincia: string(60)
       localidad: string(255)
       #email_address: string(255)
       fotografia: string(255)
       avatar: string(255)
     relations:
       Usuario:
         local: user1_id
         foreign: user2_id
         refClass: AmigoUsuario
         equal: true

  I expected the a field called 'slug' was created after build
  doctrine:build --all, but no...

  Any idea?

  --
  Javi

  Ubuntu 8.04 - Symfony 1.3

-- 
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] Re: SQLSTATE[23000]: Integrity constraint violation

2010-07-20 Thread Tom Ptacnik
When does this error occurs?


On 19 čnc, 11:24, François SEDE francois.s...@gmail.com wrote:
 HI all,

 I have this error :

 500 | Internal Server Error | Doctrine_Connection_Mysql_Exception
 SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
 update a child row: a foreign key constraint fails
 (`yurplan1`.`items`, CONSTRAINT `items_shoplist_id_sub_categories_id`
 FOREIGN KEY (`shoplist_id`) REFERENCES `sub_categories` (`id`))

 the problem is : I DON'T HAVE ANY FIELD SUB_CATEGORIES in my ITEM...

 Here is my yml :

 SubCategories:
   actAs: { Timestampable: ~ }
   columns:
     name: { type: string(255), notnull: true }
   relations:
      ...
     ShoppingList:
       type: many
       class: ShoppingList
       local: id
       foreign: subcat_id

 ShoppingList:
   actAs: { Timestampable: ~ }
   columns:
     name: { type: string(255), notnull: true }
     subcat_id: { type: integer(50), notnull: false }
   relations:
     SubCategories:
       local: subcat_id
       foreign: id
     Items:
       type: many
       class: Items
       local: id
       foreign: shoplist_id
       onDelete: CASCADE
       foreignAlias: Items

 Items:
   actAs: { Timestampable: ~ }
   columns:
     name: { type: string(255), notnull: true }
     shoplist_id : { type: integer(50), notnull: true }
   relations:
     SubCategories:
       local: shoplist_id
       foreign: id

 Thanks you for any 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] Re: Calling stored procedures with SF and Doctrine

2010-07-19 Thread Tom Ptacnik
You can do this without stored procedure in the preInsert() method of
the model class.


On 7 čnc, 18:38, Ricardo Jose Guzman Milanes
guzman.ricardoj...@gmail.com wrote:
 Hello

 I was searching in Google about how to call stored procedures, I found
 this post in this 
 group:http://groups.google.com/group/symfony-users/browse_thread/thread/099...

 There Praveen recommended to use the following sintax:

 $wt=Doctrine_Manager::getInstance()-getCurrentConnection()-fetchAssoc

 ('SELECT your_function()');

 I was testing around and pasted it in the executeNew action in
 actions.php.Don't know if it is the correct place.

  public function executeNew(sfWebRequest $request)
   {
     $this-form = new personasForm();
         
 $wt=Doctrine_Manager::getInstance()-getCurrentConnection()-fetchAssoc

 ('stored_proc_name_goes_here()');
   }

 What I want to do is the following:

 When a new user is inserted into the sfGuardUser table and that user
 belongs to a group on sfGuardUserGroup (doctors ),
 the id of that user is inserted into a table that have the following
 fields :
 userID and Value, an example:
 1(userID), 0 (default value, Value)

 Can that be done via Doctrine without calling the stored procedure?

 Thanks 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] Re: Symfony2 or CakePHP ?

2010-07-19 Thread Tom Ptacnik
I wouldn't recomend Symfony2 for a real project till it's finished.


On 9 čnc, 16:06, Ekinox ekinox1...@gmail.com wrote:
 Hello,

 Will Symfony2 's interface evolve just a
 little, or will it be rethought before the final release ? So I will
 know if I should use it for a big project. In fact, I may not use
 symfony 1.4 ; as the project chief (even if it is not a professional
 project) thinks it is too heavy (and I think he is not so wrong). Zend
 isn't what we are looking for. So we saw Symfony2 and CakePHP. Should
 we use Symfony2 or CakePHP ? Knowing that the project should be passed
 in production server around September. If there will be still some
 bugs, that's not a so big problem (we would just have to update the
 Symfony2 version we have), but if the interface is regularly
 rethought, it might cause problems. So, CakePHP or Symfony2 ?

 Thank you in advance,
 Ekinox

-- 
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] Re: check cookies enabled?

2010-07-05 Thread Tom Ptacnik
Just set a cookie and try to read it...

http://snippets.symfony-project.org/snippet/179


On 4 čnc, 11:45, comb sa...@gmx.net wrote:
 Hi! =)

 What's the proper way to check if a user has cookies enabled with
 symfony 1.4?

 Best greets
 comb

-- 
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] Re: sfguardplugin i18n login page

2010-07-04 Thread Tom Ptacnik
Maybe your action for changing language is secured? ... then it won't
be executed and it will be redirected to login page again.


On 2 čnc, 23:03, fRAnKEnSTEin shirkav...@gmail.com wrote:
 Hi,

 I am using  sfguardplugin for everything related to credentials at
 the backend(generated with the backend generator). I have added a
 combobox language selector based on Jobbet's tutorial, and everything
 works fine.

 The only problem i got is the login page generated by the pluggin,
 eveytime i try to change the language it does not worck,  the post
 generated by the combobox to the action:

 www.mysite.com/backend_dev.php/change_language?

 never be executed. Is like somewhere the plugin intercepts the post
 and avoid the execution of if.

 After changing the language the url becomes to:

 http://www.mysite.com/backend_dev.php/change_language?language=en_cs...

 As you can see the redirection that has the change_language action
 is necer executed.

 Any idea?

 Cheers

-- 
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] Re: Doctrine admin generator and parameters to partial

2010-07-03 Thread Tom Ptacnik
http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chapter_07_sub_partials

?php include_partial('mypartial', array('mytotal' = $total)) ?


On 1 čnc, 15:04, Guill Lo guill.b...@gmail.com wrote:
 Hi!

 I've got a partial that I'm sharing over different modules to show a
 photo. I have 2 different parameters in this partial that are the
 user, and the size of the thumbnail.

 So the simple question is: is it possible in the admin generator to
 send the width parameter to the partial.

 Cheers,

-- 
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] Re: Problem with doctrine:build

2010-07-03 Thread Tom Ptacnik
One problem is in your schema - there you have differents integer
types - type: integer(4), integer - if you want to build a
relationship you have to have the same integer types. (integer on
both, or integer(4) or integer(8)...

On 1 čnc, 17:46, Shawn electricbonf...@gmail.com wrote:
 After running through the Jobeet Tutorial i decided to try building my
 own application. I created the yaml file for the data mapping and am
 having some errors:

 when i run symfony doctrine:build --model:
 Notice: Undefined index: class in /Users/shawn/Documents/work/sites/
 whatsup/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/
 doctrine/Doctrine/Import/Builder.php on line 672

 Notice: Undefined index: alias in /Users/shawn/Documents/work/sites/
 whatsup/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/
 doctrine/Doctrine/Import/Builder.php on line 673

 I would post the yaml file but it is rather large, you can view it
 here:http://dev.wheelheadstudios.com/schema.yml

 Also, I first created the Database using MySQL, however i was
 uncertain how to create relationships this way (CONSTRAINTS ?), so i
 then ran symfony doctrine:build-schema, added the relationships and
 then ran: doctrine:build --sql. I found the same error as above.

 Feeling adventurous i decided to then try doctrine:insert-sql
 receiving this error:
 SQLSTATE[HY000]: General error: 1005 Can't create table 'whatsup.#sql-
 c1_9' (errno: 150). Failing Query: ALTER TABLE ad ADD CONSTRAINT
 ad_venue_id_venue_id FOREIGN KEY (venue_id) REFERENCES venue(id) ON
 DELETE CASCADE. Failing Query: ALTER TABLE ad ADD CONSTRAINT
 ad_venue_id_venue_id FOREIGN KEY (venue_id) REFERENCES venue(id) ON
 DELETE CASCADE

 The SQL created in the data/sql/schema.sql can be found 
 here:http://dev.wheelheadstudios.com/schema.sql

 So here i sit confused and at a standstill. If you have any advise or
 can point me in a direction i would appreciate it!

 Thanks,
 Shawn

-- 
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] Re: Question about set/get methods of model classes

2010-07-03 Thread Tom Ptacnik
Because you can have this on the air get/set methods in the parent
class and you don't have to generate all get/set methods in your
concrete model.


On 1 čnc, 18:59, Javier Garcia tirengar...@gmail.com wrote:
 Hi,

 why the get and set methods of the model classes are created on the
 air, instead of generate them when the model class is created?

 --
 Javi

 Ubuntu 8.04 - Symfony 1.3

-- 
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] Re: Rich text editor with upload image plugin

2010-07-03 Thread Tom Ptacnik
I'm using tinybrowser with tinyMCE  - it works fine for me.


On 1 čnc, 22:10, Mariano Sola mariano.s...@gmail.com wrote:
 Has anyone worked with any rich text editor with the upload image option
 activated in Symfony 1.4?

 I did some tests with TinyMCE and iBrowser but I wasn't be able to make it
 works.

 thanks a lot!
 *mariano ::*

-- 
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] Re: HELP: error sending mail

2010-07-03 Thread Tom Ptacnik
There is some solution http://markmail.org/message/vc4tgfssxriqrrew

--
$message = $this-getMailer()-compose();
$message-setSubject('Asunto');
$message-setTo($email);
$message-setFrom('server...@mail.cu');
$message-setBody($mailBody);
$this-getMailer()-send($message);
--

This error look like

On 1 čnc, 22:25, Orlando Menendez frankuni...@gmail.com wrote:
 When i try send a email i get the next error:

 Catchable fatal error: Argument 1 passed to
 Swift_Transport_AbstractSmtpTransport::registerPlugin() must be an
 instance of Swift_Events_EventListener, instance of
 sfMailerMessageLoggerPlugin given, called in /SGF_All/SGF/lib/
 symfony13/lib/mailer/sfMailer.class.php on line 140 and defined in /
 SGF_All/SGF/lib/symfony13/lib/vendor/swiftmailer/classes/Swift/
 Transport/AbstractSmtpTransport.php on line 247

 i searched in google but I'm don't know what is bad.

 I send the email:

 $message = $this-getMailer()-compose();
 $message-setSubject('Asunto');
 $message-setTo($email);
 $message-setFrom('server...@mail.cu');
 $message-setBody($mailBody);

 $this-getMailer()-send($message);

 And in my factories.yml file I have:

 mailer:
    class: sfMailer
    param:
     logging:  %SF_LOGGING_ENABLED%
     charset:  %SF_CHARSET%
     delivery_strategy:  realtime
     transport:
       class: Swift_SmtpTransport
       param:
          host:       10.8.5.5
          port:       25
          encryption: ~
          username:   u...@mail.es
          password:   pass

 Please I need 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] Re: one backend multiple sites

2010-07-03 Thread Tom Ptacnik
I think this can be done via .htaccess ... there will be only one
project and the domains will be alliased to the one domain (one
place). Then you can set in htaccess specific frontend controller for
every domain.


On 2 čnc, 01:03, david davi...@gmail.com wrote:
 Hi, I've got multiple sites with duplicated backend in each of them.
 My idea is to have one single symfony project with one backend with
 one DB and mutiple frontend apps for all different sites so
 domain1.com redirects to the first app, domain2.com redirects to the
 second app and domain.com/backend.php/ redirects to the unique
 backend.

 Is this possible and if so, could you give some steps to follow or
 reference?, thanks.

-- 
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] Re: Determine sfGuardPermission required for action, from within an action or filter

2010-07-02 Thread Tom Ptacnik
I suggest to send this to a filter object as a parametter - pass it to
the filter object in the action.


On 2 čnc, 02:24, Donald Tyler chekot...@gmail.com wrote:
 Excellent, thanks for the pointer.

 Now, it would be perfect if I could do the same from within a filter. Is
 there a similar method I can use, or is there a way to access the action
 object from within a filter?



 On Thu, Jul 1, 2010 at 1:59 AM, Tom Ptacnik to...@tomor.cz wrote:
  Try this
 http://www.symfony-project.org/api/1_4/sfAction#method_getcredential

  On 30 čvn, 14:49, Donald chekot...@gmail.com wrote:
   I'm trying to determine what sfGuardPermission was required for an
   action, from within the action. Is this possible?

   myModule/config/security.yml:

   show:
     credentials: view something

   myModule/actions/actions.class.php:

   class myModuleActions extends sfActions {
     public function executeShow(sfRequest $request) {
       // determine required credential... (view something)
     }

   }

  --
  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.comsymfony-users%2bunsubscr...@goog 
  legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

-- 
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] Re: Warning: glob() [function.glob]: Unable to access .../plugins/xxxPlugin/modules/* when modules directory doesn't exist

2010-07-02 Thread Tom Ptacnik
5.2.4

(sorry I didn't mention it ;)

On 1 čnc, 16:27, axe ca...@centrum.cz wrote:
 what version of PHP do you use?

-- 
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] Re: Use database in app.yml

2010-07-02 Thread Tom Ptacnik
I'm not sure it's possible to do it this way.

Why do you want to insert some configuration into the app.yml from
database? For what do you need this configuration setting?



On 1 čnc, 14:51, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com
wrote:
 I want to use some configuration settings from the database in my
 app.yml configuration file.
 This is my code now:

 all:
 ?php foreach(SettingPeer::getIndex() as $oSetting): ?
   ?php echo $oSetting-getSlug() . ': ' . $oSetting-getValue() ?
 ?php endforeach; ?

 But the error I receive says No connection information in your
 runtime configuration file for datasource [propel]

 What should I do to make this happen?
 Thanks!

-- 
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] Re: Re-populate file input field after validation error

2010-07-01 Thread Tom Ptacnik
Problem with automatic refilling file input is due to the security -
it's restricted by browsers. (think about what can happen if you could
change the file path...you can stole files from the users computer
easily.)
So if you'll google you'll find many topics where people complain
about this...and trying find some solution how to solve usability in
another way.

My opinion is that one of the best solution would be to validate whole
form (by javascript) and if it's valid, show the form for files upload
(by javascript - only remove the display: none style...or something
like that.)


On 29 čvn, 22:00, Philipp Schächtele
philipp.schaecht...@googlemail.com wrote:
 Hey Daniel,
 thanks for the Link to the plugin. So there seems to be no native
 implementation of such behavior in Symfony. My use case doesn't seem
 to uncommon to me. To bad symfony does not provide support for that.

 Sadly there are some dependencies to other deprecated Apostrophe
 plugins (missing classes pkGuid, pkFiles, pkDimensions), but at least
 I can use this plugin as inspiration to solve my problem.

 On 29 Jun., 17:18, Daniel Lohse annismcken...@googlemail.com wrote:



  Hey there,

  although it's obsolete and has been merged into another plugin you could 
  have a look at 
  this:http://www.symfony-project.org/plugins/pkPersistentFileUploadPlugin

  Cheers, Daniel

  On 29.06.2010, at 16:23, Philipp Schächtele wrote:

   I'm currently working on a form where users can post articles for a
   print magazine (Symfony 1.4, Doctrine). Anonym Users can add multiple
   images to the article and submit that.

   The use case is quite similiar to what is described in the Advanced
   Forms Article in the More with symfony book (
  http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-F...
   ), therefore I use a lot of the code from the tutorial. The difference
   is, that users that I only use the new and create functions of the
   CRUD since people cannot edit their articles after submitting them.

   My problem is the following: If there are any validation errors in the
   form, the file input field gets cleaned and the user has to choose the
   file again. This is a usability problem since there is no validation
   message or warning to do so (which could be a solution, but not a very
   good one). The user will correct the other validation errors, but will
   probably not realize to choose the file again and submit an article
   without the image.

   Is there a solution to re-populate the file-input field with the
   original image location or show and use the already uploaded image
   like sfWidgetFormInputFileEditable does for entries, which are already
   saved to the database?

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

-- 
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] Re: Imploding an array before saving

2010-07-01 Thread Tom Ptacnik
I think you can do this in the doUpdateObject() method of the form
class

something like that:

protected function doUpdateObject($values)
 {
  // implode the age
  $values['age_separation']  == $this-implodeAge($values);

  parent::doUpdateObject($values);
}

On 30 čvn, 11:08, Dantes mwojc...@gmail.com wrote:
 Hi everyone!

 First of all, before I forget I use symfony v. 1.2.9. Please, do not
 suggest me to upgrade as my client's application is in use during the
 holidays and I am going to update after the holiday's season
 finishes. ;)

 I think that my problem is quite simple, unfortunately the solution is
 not :(

 I have a class (based on schema.yml) TripTemplate. One of it's fields
 is called `age_separation`, declared as longvarchar. In the admin
 generator for TripTemplate I have created a partial to present the
 age_separation as a set of 5 input texts (age_separation is to be a
 comma-separated array, like adult,12-18 years old,below 12 years
 old. There is no problem of exploding the data before putting it to
 appropriate fields on the edit page. However, I don't know where to
 put an implode action before saving the data to the db. I tried to
 override setAgeSeparation($v) method by checking if $v is an array and
 if it is, then implode with ','.

 However, this does not work. As far as I have checked, this method
 (setter) is not even called while saving the object to db. The text
 fields are named trip_template[age_separation][$i], so, after
 casting this data to string it is saved as Array.

 I'm sure some of you had similar problems.

 Regards

-- 
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] Re: Determine sfGuardPermission required for action, from within an action or filter

2010-07-01 Thread Tom Ptacnik
Try this http://www.symfony-project.org/api/1_4/sfAction#method_getcredential

On 30 čvn, 14:49, Donald chekot...@gmail.com wrote:
 I'm trying to determine what sfGuardPermission was required for an
 action, from within the action. Is this possible?

 myModule/config/security.yml:

 show:
   credentials: view something

 myModule/actions/actions.class.php:

 class myModuleActions extends sfActions {
   public function executeShow(sfRequest $request) {
     // determine required credential... (view something)
   }



 }

-- 
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] Warning: glob() [function.glob]: Unable to access .../plugins/xxxPlugin/modules/* when modules directory doesn't exist

2010-07-01 Thread Tom Ptacnik
Hi,

I'm using Symfony 1.4.5 and on my production server Warning appears
(if I browse the application with debug environment)
(unix machine, safe mode is ON)

I know why it happen - It's caused by the fact that there aren't
directory /modules in any of this plugin

What do you suggest?
1) Should I create the modules directory in my plugins and just ignore
the warning for other plugins (because the warning aren't shown in
production environment)
2) Or should I suggest some patch in the dev mailing list?

Do you thing it slower down the application?


Some of these plugins are mine, some fo them are common or Symfony
default (sfDoctrinePlugin)

The warnings:

Warning: glob() [function.glob]: Unable to access /xxx/public/test/
application/plugins/dtBasePlugin/modules/* in /xxx/public/test/
application/lib/vendor/symfony/lib/config/
sfAutoloadConfigHandler.class.php on line 111

Warning: glob() [function.glob]: Unable to access /xxx/public/test/
application/plugins/dtLoggerPlugin/modules/* in /xxx/public/test/
application/lib/vendor/symfony/lib/config/
sfAutoloadConfigHandler.class.php on line 111

Warning: glob() [function.glob]: Unable to access /xxx/public/test/
application/plugins/dtI18nPlugin/modules/* in /xxx/public/test/
application/lib/vendor/symfony/lib/config/
sfAutoloadConfigHandler.class.php on line 111

Warning: glob() [function.glob]: Unable to access /xxx/public/test/
application/plugins/sfThumbnailPlugin/modules/* in /xxx/public/test/
application/lib/vendor/symfony/lib/config/
sfAutoloadConfigHandler.class.php on line 111

Warning: glob() [function.glob]: Unable to access /xxx/public/test/
application/plugins/sfFormExtraPlugin/modules/* in /xxx/public/test/
application/lib/vendor/symfony/lib/config/
sfAutoloadConfigHandler.class.php on line 111

Warning: glob() [function.glob]: Unable to access /xxx/public/test/
application/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/modules/*
in /xxx/public/test/application/lib/vendor/symfony/lib/config/
sfAutoloadConfigHandler.class.php on line 111

-- 
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] Re: Custom filter for admin generated sfGuardUser module

2010-06-30 Thread Tom Ptacnik
This is how i create filter for joined table..

class sfDtProduktFormFilter extends BasesfDtProduktFormFilter
{
  public function configure()
  {
$this-widgetSchema['title'] = new sfWidgetFormFilterInput();
$this-validatorSchema['title'] = new sfValidatorPass();
  }

  public function getFields()
  {
$fields = parent::getFields();
$fields['title'] = 'custom';
return $fields;
  }

public function addTitleColumnQuery($query, $field, $values)
  {
$fieldName = 'title';
$translationAlias = 't';
$query-leftJoin(sprintf('%s.%s %s', $query-getRootAlias(),
'Translation', $translationAlias));

if (is_array($values)  isset($values['is_empty']) 
$values['is_empty'])
{
  $query-addWhere(sprintf('(%s.%s IS NULL OR %1$s.%2$s = ?)',
$translationAlias, $fieldName), array(''));
}
else if (is_array($values)  isset($values['text'])  '' !=
$values['text'])
{
  $query-addWhere(sprintf('%s.%s LIKE ?', $translationAlias,
$fieldName), '%'.$values['text'].'%');
}
  }
On 27 čvn, 16:47, juro fo...@juro.at wrote:
 Hi,
 I have read a few tutorials and howtos but have not gotten this to
 work. I have also looked at the base classes to get an idea on best
 practice etc.

 I have installed the sfDoctrineGuardPlugin and created a Profile
 model, that relates to sfGuardUser. In my admin generated list, I want
 to be able to filter the list based on fields in the Profile (namely:
 first_name and last_name).

 For this I have added some code to the /lib/filter/Doctrine/
 sfDoctrineGuardPlugin/sfGuardUserFormFilter.class.php

 class sfGuardUserFormFilter extends PluginsfGuardUserFormFilter
 {
   public function configure()
   {
     parent::configure();

     $this-widgetSchema['first_name'] = new
 sfWidgetFormFilterInput(array('with_empty' = false));
     $this-widgetSchema['last_name']  = new
 sfWidgetFormFilterInput(array('with_empty' = false));

     $this-validatorSchema['first_name'] = new
 sfValidatorPass(array('required' = false));
     $this-validatorSchema['last_name']  = new
 sfValidatorPass(array('required' = false));
   }

   protected function addFirstNameColumnQuery(Doctrine_Query $query,
 $field, $values)
   {
     if (!is_array($values))
     {
       $values = array($values);
     }

     if (!count($values))
     {
       return;
     }
     $query-leftJoin('r.Profile p')
           -andWhereIn('p.first_name = ?', $values);
   }

   protected function addLastNameColumnQuery(Doctrine_Query $query,
 $field, $values)
   {
     if (!is_array($values))
     {
       $values = array($values);
     }

     if (!count($values))
     {
       return;
     }
     $query-leftJoin('r.Profile pf')
           -addWhere('pf.last_name = ?', $values);
   }

 }

 I have also turned on these filters in the generator.yml and they are
 displayed. When I filter for any of these values, I get this error:
  Invalid parameter number: number of bound variables does not match
 number of tokens

 which comes from the SELECT ignoring the filter values. This is the
 resulting SELECT:

 at Doctrine_Connection-execute('SELECT COUNT(*) AS num_results FROM
 (SELECT s.id FROM sf_guard_user s LEFT JOIN profiles p ON s.id =
 p.sf_guard_user_id LEFT JOIN profiles p2 ON s.id = p2.sf_guard_user_id
 WHERE p.first_name = ? IN (?) AND p2.last_name = ? GROUP BY s.id)
 dctrn_count_query', array('text' = ''))

 This was for a filter where first_name = Tom and last_name did not
 have anything to filter for. Theoretically, the query should not
 include last_name at all. I have checked the $values and they are
 correct.

 Any ideas how to find out what is going wrong?

 juro

-- 
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] Re: Organization of library applications

2010-06-30 Thread Tom Ptacnik
try generatePath: parameter in the  schema.yml

http://groups.google.com/group/symfony-devs/browse_thread/thread/124582b39dd19a55


On 29 čvn, 14:29, Romeu Godoi romeu.go...@gmail.com wrote:
  English 
 Hello everyone!

 I am migrating some projects from SF 1.0 (Propel) to SF 1.4 (Doctrine). I
 need a help from the community on some issues ...

 Before using propel in schema.yml I could separate the classes by applying
 the model through the parameter package.
 I realized that this parameter in the case of the Doctrine has another
 function, because it creates classes of plugin in the model.

 As I have several applications in a single project, it helped me a lot in
 the organization. Have surfed a lot on the web in search of that answer, but
 so far have found nothing satisfactory.

 Is there any way of separating the model classes, forms and filters of
 applications
 with Doctrine?

 Excuse the bad English writing.

 I thank you ...
  pt_BR 
 Olá a todos !

 Estou migrando alguns projetos de SF 1.0 (Propel) para SF 1.4 (Doctrine).
 Preciso de um help da comunidade em algumas questões...

 Antes, usando propel, no schema.yml eu podia separar as classes modelo por
 aplicação através do parametro package.
 Percebi que esse parâmetro no caso do Doctrine tem outra função, pois ele
 cria classes de plugin no modelo.

 Como tenho várias aplicações em um projeto só, isso me ajudava muito na
 organização. Já naveguei muito na web em busca dessa resposta, mas até agora
 não encontrei nada satisfatório.

 Existe alguma forma de separar as classes model, forms e filters das
 aplicações com Doctrine ?

 Desde já agradeço...

 --
 Att, Romeu Godoi
 Supervisor de Desenvolvimento Web
 Blog: romeugodoi.wordpress.com

 Proteja o endereço de seus amigos como estou protegendo o seu. Ao enviar
 mensagens para mais de um endereço use SEMPRE o Cco (cópia oculta ou Bcc
 (Blind carbon copy)).

-- 
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] Re: Multiple links in a single image slide show..

2010-06-28 Thread Tom Ptacnik
Post more detail, I don't understand what the problem is. Show some
code. Or post some link that We can see your gallery.

On 23 čvn, 12:15, Vinay reddy vinayreddy1...@gmail.com wrote:
 Please..Very urgent..I have created multiple image slide show but it
 is becoming complex when trying to slide show multiple images with
 each image having multiple links(Each image are sliced as tables and
 this images in 3 html pages, each sliced image is having link ) as we
 can see it inwww.vonage.com/www.unovon.com. Please help me solve
 this problem. Give me a resource link or some code explanation. I
 don't want this in Flash but in Jquery or Javascript. Iam a PHP
 developer.

 Regards..

-- 
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] Re: Plugin from Embedded form in new window

2010-06-28 Thread Tom Ptacnik
What about a little different solution:

- When you click on the plus only an input will be shown next to the
plus (this input can be defined as hidden and shown by javascript).
You will write a new Poll name into this input and it will be used
instead of the choice. This new Poll will be added into the table
after the form submit.
I think this is a standard solution and there should be no problem in
realizing it in Symfony.

On 25 čvn, 15:14, Leandro leandro.jac...@gmail.com wrote:
 For example from django, open related form for quick add ando auto populate
 choice with added data, for example view image.

 2010/6/25 Leandro Jácome leandro.jac...@gmail.com

  Hello friends,

  I need plugin or widget from show button add on right side widget
  sfWidgetFormDoctrineChoice for open embed form in new window. Anybody
  know one solution from this problem?

  tks!

 --
 Leandro Jácome
 Desenvolvedor Web
 leandro.jac...@gmail.com
 mobile: +55 62 8178-0415
 talk/msn: lean...@globitec.com.br
 twitter: @leandrojacome

  admin10.png
 14KZobrazitStáhnout

-- 
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] Re: Switch database sf 1.4 doctrine

2010-06-28 Thread Tom Ptacnik
Something is here (but not much)
http://symfonyexperts.com/question/show/id/38
http://groups.google.com/group/symfony-users/browse_thread/thread/3b09221615b51919/dc44e4d364bdc9b2?lnk=gstq=multiple+databases#dc44e4d364bdc9b2

On 25 čvn, 21:30, stakovicz stakov...@gmail.com wrote:
 Hi !

 How can I switch database by domain ?
 Is it a function to set database schema ?

 Thanks for your clues !

-- 
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] Re: Doctrine fails on insert new value

2010-06-25 Thread Tom Ptacnik
Try to google it. I'm sure you will find some solution.

I found this:
http://trac.doctrine-project.org/ticket/568
http://trac.symfony-project.org/ticket/3831


On 22 čvn, 15:27, Marxy oleha.ma...@gmail.com wrote:
 Hello!

 I got this error while added new value on standrd form generated by
 default.

 execute : SELECT r.sprint_id AS r__sprint_id, r.sprint_name AS
 r__sprint_name, r.sprint_start AS r__sprint_start, r.sprint_end AS
 r__sprint_end, r.sprint_summary AS r__sprint_summary, r.created AS
 r__created FROM rank_sprints r WHERE (r.sprint_id = ?) LIMIT 1 - ()

 SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input
 syntax for integer: 

 I guess this happened 'cause of serial ype of primary key but I'm not
 sure.
 Nevertheless here is yml of the table:

 rank_sprints:
   columns:
     sprint_id:
       primary: true
       type: serial
     sprint_name:
       unique: true
       type: string(255)
       notnull: true
     sprint_start:
       type: date
       notnull: true
     sprint_end:
       type: date
       notnull: true
     sprint_summary:
       type: string
     created:
       default: 'now'
       type: timestamp
       notnull: true

 And forms were generated by default as

 php symfony doctrine:build --model
 php symfony doctrine:build --forms
 php symfony doctrine:build --sql
 php symfony doctrine:insert-sql
 php symfony doctrine:generate-module --with-show --non-verbose-
 templates frontend sprins rank_sprints

 If any one could help me why It is happened please!

-- 
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] Re: How to pass PHP values to addJavascript() (or something else) ?

2010-06-25 Thread Tom Ptacnik
And what do you suggest if I need for example some texts... some info
messages .. assume that I'm using I18n. Is there another way than read
it from the DOM .. some hidden generated div, or span.. or whatever.



On 24 čvn, 18:19, Massimiliano Arione garak...@gmail.com wrote:
 On 24 Giu, 08:05, Tom Ptacnik to...@tomor.cz wrote:

  So if I need to get some variables in javascript from the app, you
  advice is to generate it into the DOM?

  Example: I need to detect which culture is set. Then i should generate
  div id=culture style=display:none;en/div into the DOM and then
  in the javascript read the value of the div by id?

 If you just need the culture, you should get it from html tag. (in the
 lang attribute)
 Of course, you should before set it in html tag, but it's trivial:
 just set it in layout.php

 cheers
 Massimiliano

-- 
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] Re: How to pass PHP values to addJavascript() (or something else) ?

2010-06-25 Thread Tom Ptacnik
Ajax was in my mind too, but I don't like to create a request for the
recieving a translation text... If I need 5 info messages, there will
be 5 requests. It looks bad to me... slowing down the app
unnecessarily.


On 25 čvn, 10:55, Ben Bieker m...@ben-bieker.de wrote:
 On Thu, 24 Jun 2010 23:27:38 -0700 (PDT), Tom Ptacnik to...@tomor.cz
 wrote:

  And what do you suggest if I need for example some texts... some info
  messages .. assume that I'm using I18n. Is there another way than read
  it from the DOM .. some hidden generated div, or span.. or whatever.

 Hi,

 maybe you could load them via an ajax call? Would be an elegant solution I
 think.
 You could write a litle web service especially for your javascript's needs
 or so..

 would be grat for i18n too because the language is set in php and your
 webservice always delivers the correct language then.

-- 
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] Re: Doctrine Query Left Join

2010-06-25 Thread Tom Ptacnik
What about

$this-nodes = Doctrine::getTable('ElementNode')
-createQuery('n1')
-select('n1.*, n2.*')
-leftJoin('ElementNode n2 ON n1.id = n2.nodeSubnodeOf')
-execute();

On 25 čvn, 14:35, Jérémie jeremie.symf...@gmail.com wrote:
 Hi,

 I have this mysql query :

 SELECT n1.*, n2.* FROM ElementNode n1 LEFT JOIN ElementNode n2 ON n1.id
 = n2.nodeSubnodeOf

 I translated it this way:
 $this-nodes = Doctrine::getTable('ElementNode')
 -createQuery()
 -select('*, n2.*')
 -leftJoin('ElementNode n2 ON id = n2.nodeSubnodeOf')
 -execute();

 But it seems like symfony/doctrine transates it :[...] ON n2.id =
 n1.nodeSubnodeOf.

 I'm pretty lost, could someone give me some help please?

 Thanks a lot!
 Jérémie

-- 
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] Re: How to pass PHP values to addJavascript() (or something else) ?

2010-06-24 Thread Tom Ptacnik
So if I need to get some variables in javascript from the app, you
advice is to generate it into the DOM?

Example: I need to detect which culture is set. Then i should generate
div id=culture style=display:none;en/div into the DOM and then
in the javascript read the value of the div by id?


On 23 čvn, 14:57, Massimiliano Arione garak...@gmail.com wrote:
 On 22 Giu, 10:03, François franc...@robichet.com wrote:

  I'd like to pass values to my JS script when I call it. So I look the
  API for the addJavascript() method, herre is it :

 You shouldn't pass variables from php to javascript.
 Javascript should be always unobtrusive, so the only point of contact
 between your html (and php) and your javascript should be the DOM.
 Just insert your php variables somewhere in your page (e.g. in a
 hidden field of a form), then retrieve them with javascript (with
 jQuery, it's really simple)

 cheers
 Massimiliano

-- 
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] Re: Doctrine fails on insert new value

2010-06-24 Thread Tom Ptacnik
Which type of database do you use?


On 22 čvn, 15:27, Marxy oleha.ma...@gmail.com wrote:
 Hello!

 I got this error while added new value on standrd form generated by
 default.

 execute : SELECT r.sprint_id AS r__sprint_id, r.sprint_name AS
 r__sprint_name, r.sprint_start AS r__sprint_start, r.sprint_end AS
 r__sprint_end, r.sprint_summary AS r__sprint_summary, r.created AS
 r__created FROM rank_sprints r WHERE (r.sprint_id = ?) LIMIT 1 - ()

 SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input
 syntax for integer: 

 I guess this happened 'cause of serial ype of primary key but I'm not
 sure.
 Nevertheless here is yml of the table:

 rank_sprints:
   columns:
     sprint_id:
       primary: true
       type: serial
     sprint_name:
       unique: true
       type: string(255)
       notnull: true
     sprint_start:
       type: date
       notnull: true
     sprint_end:
       type: date
       notnull: true
     sprint_summary:
       type: string
     created:
       default: 'now'
       type: timestamp
       notnull: true

 And forms were generated by default as

 php symfony doctrine:build --model
 php symfony doctrine:build --forms
 php symfony doctrine:build --sql
 php symfony doctrine:insert-sql
 php symfony doctrine:generate-module --with-show --non-verbose-
 templates frontend sprins rank_sprints

 If any one could help me why It is happened please!

-- 
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] Re: Symfony design issue

2010-06-24 Thread Tom Ptacnik
I think that events would be right way to go (
http://www.symfony-project.org/gentle-introduction/1_4/en/17-Extending-Symfony
)

I would create myUser which extends of sfGuardSecurityUser or
sfBasicSecurityUser or something like that.

Then when credentials will be changed notify(), if user is logged -
notify()... and so on Then you can do whathever you want with this
event in any class which will be registered to this event.



On 22 čvn, 00:02, William william...@gmail.com wrote:
 Hello all,

 Another engineer and I are having a bit of a debate on the correct way
 to handle how Symfony automatically regenerates the session id when
 authentication, and changing credentials. We have to make a
 modification to the database whenever a session is regenerated when a
 user is logged in. So my initial thought would be to extend the
 sfBasicSecurityUser class and have it dispatch a notification so
 another part of the system can pick it up whenever credentials are
 added/removed.

 The other engineer believes we should extend the session storage class
 and modify it directly, then pass this to the sfBasicSecurityUser. To
 my knowledge, the sfBaicSecurityUser class is meant to be able to
 accept any kind of sfStorage class, not specific the session storage
 class even though it's kind of assumed. He thinks we should extend
 whichever class we currently want to use, if it's session then extend
 that, if later down the road we want to use MySQL then modify the
 mySession class and tell it to extend MySQL instead. So instead of
 simply modifying what storage is sent to the sfBasicSecurityUser,
 you'd have to modify the mySession and change what it extends.

 I'm not looking to be right or wrong, I'm interested what others
 opinions are and if they have even a better option.

-- 
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] Re: Doctrine schema: two realtionships between two tables

2010-06-24 Thread Tom Ptacnik
I would create an attribute in the GalleryPicture table
preview  { type: boolean }

then I would create a method for retrieving this preview_image -
getPreviewImage() in the Gallery model class
.. this method wil call a method from GalleryPictureTable.class.php -
findPreviewImage($galleryId)

body of the method:

$q = $this-createQuery('p')
-leftJoin('g.Gallery g')
-andWhere('g.id = ?', $galleryId)
-andWhere('p.preview = ?', true);

return $q-fetchOne();


On 20 čvn, 17:10, Johannes Trommer johannes.trom...@gmail.com wrote:
 Hi,

 I need a little help creating my schema. I am creating a gallery-
 module containing the two tables Gallery and GalleryPicture. First one  
 stores the galleries with additional information, the second one  
 stores the pictures. The tables are related over the gallery.id-field  
 and the gallerypictures.gallery_id-field. Here you see the schema:

 Gallery:
    columns:
      name: { type: string(255), notnull: true }
      preview_image: { type: integer, default: NULL }

 GalleryPicture:
    columns:
      gallery_id: { type: integer }
      filename: { type: string(255), notnull: true }
    relations:
      Gallery:
        alias: Gallery
        foreignAlias: Pictures
        foreign: id
        local: gallery_id
        onDelete: CASCADE

 I want to define a preview image for every gallery. This image would  
 be an image out of the GalleryPictures table.
 How can I declare this additional relationship?

 Thanks in advance! =)

-- 
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] Re: backend module

2010-06-24 Thread Tom Ptacnik
Or you can disable it in generator.yml

try this...

list:
object_actions:
  _edit:  ~
batch_actions: {}
actions: {}

On 23 čvn, 08:30, slau susan@gmx.de wrote:
 Hi,

 for 1) 
 seehttp://www.symfony-project.org/jobeet/1_4/Doctrine/en/12#chapter_12_t...

 you can copy out of your cache folder
 /cache/APP/ENV/modules/MODULENAME/templates/_list_actions.php
 to your module template folder and then remove the link

 for 2) then just change the filter in the corresponding class by
 replacing the widget
 $this-widgetSchema['user_id'] = new
 sfWidgetFormFilterInput(array('with_empty' = false))

 Hope that helps
 Susan

-- 
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] Re: Route does not add a parameter when its defined as a default one.

2010-06-24 Thread Tom Ptacnik
I don't get why in first example the Output: http://localhost/blog/page/2

If you want the output like this just define your route like

blog:
  url: /blog/page/:page
  param:   { module: blog, action: list, page: 1 }

On 23 čvn, 13:55, Ivo Az. sep...@gmail.com wrote:
 These are just example routes, there are no routes with the same name.
 Why should order of route matter when I use it's name in the url
 helper (e.g. link_for(5 '@blog?page=5'))?
 For Route 3 this should outputhttp://localhost/blog/page/5, but the
 output ishttp://localhost/blog.

 On Jun 23, 4:38 am, Eno symb...@gmail.com wrote:



  Remember the orderf of routes *does* matter, so you should have most
  specific route to least specific routes, e.g. using a wildcard will
  match all routes that start /blog so probably that route should be last.

  On Tue, 22 Jun 2010, Ivo Az. wrote:
   Here's examples:

    Link 
   ?php echo link_to($page, '@blog?page='.$page) ?

    Route 1
   blog:
     url:             /blog/*
     param:       { module: blog, action: list }

   Output:http://localhost/blog/page/2

    Route 2
   blog:
     url:             /blog/:page
     param:       { module: blog, action: list, page: 1 }

   Output:http://localhost/blog/2

    Route 3
   blog:
     url:             /blog/*
     param:       { module: blog, action: list, page: 1 }

   Output:http://localhost/blog

   Why in 3rd case the url does not contain the page parameter as in
   first example?

-- 
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] Re: Get record id and set it into form

2010-06-22 Thread Tom Ptacnik
Does your form has input (hidden) for this id? Show your form code.
(setup, configure, ...)


On 21 čvn, 15:06, titiyoyo terence.pi...@gmail.com wrote:
 Hi there

 thanks for that.

 for now i have this :

   public function executeNew(sfWebRequest $request)
   {
         $fiche = new Fiche();
         $fiche-save();
         $artiste = new Artiste();
         $a = $fiche-getId();

         $artiste-setIdFiche($a);

         $this-form = new ArtisteForm($artiste);
   }

 i got the needed id in $a, but when the form is saved no id is written
 in db...

 On 21 juin, 09:00, Tom Ptacnik to...@tomor.cz wrote:



  I think that the solution might be owerwriting the doSave method .. or
  some method where the saving of the object is done. You need to save
  the foreign object first - to obtain the id from the database, then
  save the main object.

  On 19 čvn, 12:24, titiyoyo terence.pi...@gmail.com wrote:

   Hi there,

   i'm new to symfony and am bumping into a problem here.
   I merged two forms from 2 different models and need to get a foreign
   key from table A to put in this table B form.

   Basically, i have to
   - create a record in table A and get this record's id
   - create a record in table B an set it's table_a_id to the value i
   just got
   - fill out the rest of the info that will be put in table B

   My question is :
   how can i get the needed id ?

-- 
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] Re: Set form value from controler

2010-06-22 Thread Tom Ptacnik
If you mean how to set default values, then try setDefaults()

http://www.symfony-project.org/api/1_4/sfForm#method_setdefaults

On 21 čvn, 19:49, titiyoyo terence.pi...@gmail.com wrote:
 Hi there,

 i have a simple and basic quesion here about symfony : how can i set
 values into a form field from the controller in symfony ?

 I looked again and again and again without finding an answer.

 So for now i have this below.

 Please help me, it's quite urgent !!

 public function executeNew(sfWebRequest $request)
   {
         $fiche = new Fiche();
         $fiche-save();

         $a = $fiche-getId();

         $this-form = new ArtisteForm($artiste);
   }

-- 
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] Re: Inserting same form multiple entries at the same time

2010-06-22 Thread Tom Ptacnik
Let this form as it was (without loop) - let's call it basic form.
Create another form (master form) and embed basic form x-times into
it.

http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms


On 21 čvn, 23:00, mo.mughrabi mo.mughr...@gmail.com wrote:
 Hello,
 I been trying all day to do multiple insert for the same form based on
 a number and i couldn't go any where with it. I hope someone here
 would be help me out...

 am using admin generator on 1.4 doctrine. I have a form which i
 generated with only two fields. what am trying to do is, based on a
 number inserted the form will be repeated x number of times.

 In the generator file I added a partial which placed a text field in
 the beginning of the form with default value of 1. If I choose 2 the
 form below gets duplicated twice..

 Here is what i did to my form.. In action

 class prizesActions extends autoPrizesActions
 {
   public function executeNew(sfWebRequest $request)
   {

     $this-form = $this-configuration-getForm(null, array('n' =
 5));
     $this-prizes = $this-form-getObject();

   }

 }

 and in the PrizesForm, I wrote the following

 class PrizesForm extends BasePrizesForm
 {
  public function configure()
   {
         $array = $this-getOptions();
         for ($i = 0; $i  $array['n']; $i++) {

             $this-setWidgets(array(
               'id'         = new sfWidgetFormInputHidden(),
               'prize_no'   = new sfWidgetFormInputText(),
               'prize'      = new sfWidgetFormInputText(),
               'created_at' = new sfWidgetFormDateTime(),
               'updated_at' = new sfWidgetFormDateTime(),
             ));

             $this-setValidators(array(
               'id'         = new sfValidatorDoctrineChoice(array('model' =
 $this-getModelName(), 'column' = 'id', 'required' = false)),
               'prize_no'   = new sfValidatorInteger(array('required' =
 false)),
               'prize'      = new sfValidatorString(array('max_length' =
 200, 'required' = false)),
               'created_at' = new sfValidatorDateTime(),
               'updated_at' = new sfValidatorDateTime(),
             ));

             $this-widgetSchema-setNameFormat('prizes['.$i.'][%s]');

             $this-errorSchema = new 
 sfValidatorErrorSchema($this-validatorSchema);

         }

         unset(  $this['updated_at'],
                         $this['created_at']
                         );
   }

 }

 I think the loop is working but its over writing the widgets at every
 entry and i cannot find other method to append instead. Any ideas?

 Thanks,

-- 
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] Re: Advantages over foreign key

2010-06-21 Thread Tom Ptacnik
http://en.wikipedia.org/wiki/Foreign_key
http://www.youtube.com/watch?v=KBYU5bAR0_g



On 17 čvn, 14:53, Arun Raj R aru...@gmail.com wrote:
 Thanks Dan Harabagiu,

 I used it in symfony and it is very useful . But some time i want to use
 plain php. I don't know how to manage these foreign keys in plain php. do u
 have any idea ?

 On Thu, Jun 17, 2010 at 6:16 PM, Dan Harabagiu harabagiu@gmail.comwrote:





  Hi,

    I am using foreign keys with propel, and it provides me ability to access
  the data with ease, without operating additional queries. Like

  $c = new Criteria();
  $c-add(DetailsPeer::ID,1);
  $details = DetailsPeer::doSelectOne($c);
  $details-getUsers()-getName(); //this would get the user name from
  details using FK

  Dan.

  On Thu, Jun 17, 2010 at 3:40 PM, Arun Raj R aru...@gmail.com wrote:

  Dear Friends,

  Could you please tell me what are the advantages of setting foreign key in
  database ?

  I had created two tables

  users
     id
     name
  details
     id
     address
     users_id (foreign key)

  Could you please tell me what are the advantages of using like this ?
  and how to operate on this data ?

  Can i able to insert both table data into it with one query  ?

  If you have any info please share me

  CREATE TABLE IF NOT EXISTS `details` (
    `id` int(11) NOT NULL auto_increment,
    `address` varchar(255) NOT NULL,
    `users_id` int(11) NOT NULL,
    PRIMARY KEY  (`id`),
    KEY `users_id` (`users_id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

  CREATE TABLE IF NOT EXISTS `users` (
    `id` int(11) NOT NULL auto_increment,
    `name` varchar(255) NOT NULL,
    PRIMARY KEY  (`id`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

  Thanks in advance

  --
  Arun Raj R

  Developer , OrisysIndia IT Enabled Services, Thiruvananthapuram
  Corporate office : Bangalore
  Phone : 0471-(40)-14325
  Mobile : 919946014345
  Blog :www.techaspirant.com
 www.OrisysIndia.com
  Linkedin:www.linkedin.com/in/arunrajr

  --
  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.comsymfony-users%2bunsubscr...@goog­legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

   --
  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.comsymfony-users%2bunsubscr...@goog­legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 Arun Raj R

 Developer , OrisysIndia IT Enabled Services, Thiruvananthapuram
 Corporate office : Bangalore
 Phone : 0471-(40)-14325
 Mobile : 919946014345
 Blog :www.techaspirant.comwww.OrisysIndia.com
 Linkedin:www.linkedin.com/in/arunrajr

-- 
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] Re: Too many redirects error on symfony.

2010-06-16 Thread Tom Ptacnik
I think that this code will redirect to http even if I'm on http
right. And same with https. I'm on https and this filter redirect me
to https again..

So I advice to insert conditions...I'll show it on pseudocode

if (ImNotOnHTTP  $sslEnabled  !$secureRequest) {
 redirect to http
}
elseif($secureRequest  ImNotOnHTTPS) {
  redirect to https
}

On 14 čvn, 17:56, Bruno Reis bruno.p.r...@gmail.com wrote:
 Hi,

 I´m using a filter with the following code to change from http to https and
 back from https to http. Sometimes when leaving from a https page, the
 browser gives a too many redirects error. I cannot reproduce the error
 easily. It´s not all the time that it happens. Normaly it still happening
 very often after the first time it happens.

 We have debuged the error requests here and the sfResponse status code still
 200 until the very last filter (rendering), but the headers sent to the
 browser have a 302 code and I have no idea why neither where.

 Do you have any idea of what can be happening?

         $module = $this-getContext()-getModuleName();
         $secureRequest = $this-getContext()-getRequest()-isSecure();
         $moduleHasToBeSecure = in_array($module,array('join','payment'));
         //$sslEnabled = sfConfig::get('app_enable_join_ssl', true);
         $sslEnabled = true;
         $uri = $this-getContext()-getRequest()-getUri();
         if (!$this-isAjax()) {
             if ($moduleHasToBeSecure) {
                 if ($sslEnabled  !$secureRequest) {

 $this-getContext()-getController()-redirect(preg_replace(/^http:\/\//,
 https://;, $uri));
                 }
             }
             else {
                 if($secureRequest) {

 $this-getContext()-getController()-redirect(preg_replace(/^https:\/\//­,
 http://;, $uri));
                 }
             }
         }

-- 
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] Re: Automated web installer

2010-06-14 Thread Tom Ptacnik
- User has to prepare hosting for your app (this can't by done by your
install script)
- You have to create an install script which will create a database
and set database connection settings.


On 10 čvn, 14:26, Davide Bellettini davide.bellett...@gmail.com
wrote:
 Hello everybody,

 i'm working on my free software project called phpYABS
 (www.phpyabs.com) that is mainly based on symfony.
 I'd like to distribute it with a wizard allowing an easy installation
 on shared hostings (e.g. like wordpress).
 What would I do?

 Sorry for my poor english

 --
 Davide Bellettini

 dav...@davidebellettini.itwww.davidebellettini.it

-- 
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] Re: practical symfony guide 1.4 routing (or apache?) question

2010-06-14 Thread Tom Ptacnik
Look here http://code-launch.com/?p=36
same problems as you've described

On 12 čvn, 11:59, Gábor Fási maerl...@gmail.com wrote:
 The symptoms you described show otherwise. Try to uncomment the
 IfModule tags in your .htaccess, if you get an internal server
 error, you surely have it disabled.

 Also, even if it is enabled globally, it may be disabled for your
 vhost. Check your related config, and look for the AllowOverride
 directive. I am not sure what you need to enable there, my one usually
 looks like `AllowOverride all`, obviously only on the dev machine.

 On Sat, Jun 12, 2010 at 07:47, Marvin Frederickson



 marvin.frederick...@gmail.com wrote:
  I do have it enabled.  If I browse to justhttp://jobeet.artemisu.local/
  it works, but when I include the other items in the url (such as when
  looking up a job, as mentioned in the first email) it does not work.

  Any other ideas?

  On Jun 11, 12:55 am, pghoratiu pghora...@gmail.com wrote:
  Check if you have mod_rewrite enabled in your apache setup.

     gabriel

  On Jun 10, 2:48 am, Marvin Frederickson

  marvin.frederick...@gmail.com wrote:
   I'm up to day 5 (page 69) in the guide.  When I browse 
   tohttp://jobeet.artemisu.local/the job list comes up fine.  But when I
   click on the first job in the list, I get an apache page not found
   error.  The url is this:

  http://jobeet.artemisu.local/job/sensio-labs/paris-france/1/web-devel...

   It works fine if I include the index.php or frontend_dev.php filename
   in the url, but not if I omit it.  Why is that?  And how can I fix it?

   Thanks.

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

-- 
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] Re: Managing i18n content for frontend in the backend

2010-06-14 Thread Tom Ptacnik
: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] 
 Im Auftrag von Tom Ptacnik
 Gesendet: Donnerstag, 10. Juni 2010 10:10
 An: symfony users
 Betreff: [symfony-users] Re: Managing i18n content for frontend in the backend

 I prefer codewise, but if you can show me also how it look in action,
 I don't ...

 číst dál »

-- 
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] app.yml array is not array on first level

2010-06-14 Thread Tom Ptacnik
Do someone know why first solution produce bad array and second will
produce good array?
I'm talking abou settings in app.yml

1)
all:
  frontend_cultures: [cs, en]

will produce (cache/app/dev/app.yml.php):

'app_frontend_cultures_0' = 'cs',
'app_frontend_cultures_1' = 'en',

2)
all:
  frontend:
cultures: [cs, en]

 'app_frontend_cultures' = array (
  0 = 'cs',
  1 = 'en',
),

-- 
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] Re: Sorting in one to many relationships

2010-06-14 Thread Tom Ptacnik
In yaml

Object:
  connection: doctrine
  options:
orderBy: column DESC
  tableName: tablename
  columns:

On 13 čvn, 12:32, Ozzy oye...@gmail.com wrote:
 Hi,

 I have a table which is called Articles. It is related to another
 table ArticleComment via:
         $this-hasMany('ArticleComment as Comments', array(
              'local' = 'id',
              'foreign' = 'article_id'));

 I can get the comments of an article using $article-getComments().

 But I want to get the comments sorted according to a column. How can I
 get them sorted without overriding the getComments method and writing
 a DQL query from scratch?

 Is there an easy way to achieve this?

 Thanks.

-- 
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] Re: How to show an object_action based on a specific condition (admin generator)?

2010-06-14 Thread Tom Ptacnik
I think you can use GeneratorHelper for that ... apps/appname/module/
lib/moduleGeneratorHelper.class.php


On 14 čvn, 00:49, Bruno Reis bruno.p.r...@gmail.com wrote:
 Hi,

 Is there a way to specify a specific condition required to show one
 object_action in a list?
 I want to show the action link only if a field on my record is true.

-- 
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] Re: Doctrine many to many relation problem

2010-06-14 Thread Tom Ptacnik
I think it's because different integer types... they must be the same
when you want to create relation

user_id:
  type: integer(5)
... check which type is on the other side.


On 14 čvn, 12:00, Jon jon...@gmail.com wrote:
 Hi, I have a problem with de many to many relations in doctrine.

 I have a database with users and jobs:

 Profile:
   actAs: [Timestampable]
   connection: doctrine
   tableName: sf_guard_user_profile
   columns:
     user_id:
       type: integer(5)
     first_name:
       type: string(255)
       notnull: true
     last_name:
       type: string(255)
       notnull: true
     email:
       type: string(255)
       notnull: true
   relations:
     User:
       class: sfGuardUser
       local: user_id
       foreignAlias: Profiles
       foreignType: one
     Jobs:
       class: Job
       local: user_id
       foreign: job_id
       refClass: UserJob
       foreignAlias: Profiles
       type: many

 Job:
   actAs: [Timestampable]
   connection: doctrine
   tableName: job
   columns:
     label:
       type: string(6)
       notnull: true
     name:
       type: string(50)
       notnull: true
   relations:
     Profile:
       class: Profile
       refClass: UserJob
       local: job_id
       foreign: id
       foreignAlias: Jobs
       type: many

 UserJob:
   actAs: [Timestampable]
   connection: doctrine
   tableName: user_job
   columns:
     user_id:
       type: integer(5)
     job_id:
       type: integer(5)
   relations:
     Profile:
       class: Profile
       local: user_id
       foreign:  id
       onDelete: CASCADE
       foreignAlias: UserJobs
     Job:
       class: Job
       local: job_id
       foreign:  id
       onDelete: CASCADE
       foreignAlias: UserJobs

 But, when I do:

 php symfony doctrine:build-mode
 php symfony doctrine:build-sql
 php symfony doctrine:insert-sql

 I get an error when try to insert the changes to generate
 relations (tables are created fine), just this error:

 SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
 error in your SQL syntax; check the manual that corresponds to your
 MySQL server version for the right syntax to use near 'job(id) ON
 DELETE CASCADE' at line 1. Failing Query: ALTER TABLE user_job ADD
 CONSTRAINT user_job_job_id_job_id FOREIGN KEY (job_id) REFERENCES
 job(id) ON DELETE CASCADE. Failing Query: ALTER TABLE user_job ADD
 CONSTRAINT user_job_job_id_job_id FOREIGN KEY (job_id) REFERENCES
 job(id) ON DELETE CASCADE

 La tabla Profile tambien la tengo relacionada con el plugin
 sfDoctrineGuardPlugin

 The Profile table also related to the plugin sfDoctrineGuardPlugin.

 Thanks!

 Pd.: Sorry for my English, I'm Spanish

-- 
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] Re: How to add an error to a form field

2010-06-10 Thread Tom Ptacnik
I think that errors of hidden fields are rendered as global errors.
And from your description it looks like embeded forms leave their
global errors to the master form (I didn't look into Symfony how this
is done).

So the solution would be just to create your own attributte in the
main form, set it in your validator. Then edit your template which is
showing the embeded forms - test this attribute and show your error.

your validator can look like:
foreach (all forms)
{
 if  date isn't good
  set $this-subFormErr = 2; // mean subform 2 is bad
}

ten in the template
if $form-getSubFormErr() == nowRenderedEmbededFormId - echo bad
date


It can look like hacking the forms framework, but maybe your need is
such special, that it can't be solved by classic Symfony features.


On 8 čvn, 17:31, Asier aillarrame...@gmail.com wrote:
 Ehhh, ok, how can I be so stupid... ejem. ^_^U
 Anyway, how would it be if the field is a text input field??

 Now that I notice, even if those fields are hidden, if I set an error on one
 of then, shouldn't they be rendered by the embedded form template if I put:
 $form-renderError() ?? I mean, all the hidden fields errors should be
 rendered by that renderError() so that they would apper in the embedded form
 context and no as parentForm's, isn't it?

 When I said I just want the error next to it's corresponding field. I
 wanted to say that the errors should appear in the embedded form context,
 and not as global errors of parentForm.

 Sorry for the confusion,
 Asier.



 On Tue, Jun 8, 2010 at 3:55 PM, Tom Ptacnik to...@tomor.cz wrote:
  How do you want to show the error next to the hidden field? All hidden
  fields are on the beginning of the form, aren't they?

  On 7 čvn, 16:35, Asier aillarrame...@gmail.com wrote:
   Hi there,

   I have a form with an embedded form, wich can have N embedded forms:

   parentForm:
     wrapperForm:
       form_1
       form_2
       ...
       form_n

   Nice. The problem is that this child forms have a date field (actually a
   hidden field: sfWidgetFormInputHidden) which I must check so that:
   form_1.date = form_2.date = ... = form_n.date. So, I have opted to use
  a
   callback postValidator in parentForm. I set this in parentForm
  configure()
   method:

   $this-validatorSchema-setPostValidator(new sfValidatorCallback(array(
     'callback' = array($this, 'validateSchema'),
   )));

   And this is my validateSchema method:

   public function validateSchema(sfValidatorBase $validator, array $values)
   {
     $previous_date = 0;
     $forms = $this-embeddedForms['wrapperForm']-getEmbeddedForms();

     foreach ($values['wrapperForm'] as $form_id = $form) {
       if (strtotime($form['date'])  $previous_date) {
         *// ADD ERROR MESSAGE*
       } else {
         $previous_date = strtotime($form['date']);
       }
     }

     return $values;

   }

   Knowing that to access one of the child forms object, we can use
   $forms[$form_id] within the for loop. How the hell can I add an error
   message to the date field?? :( I don't want a global error, I just want
  the
   error next to it's corresponding field. Any idea would be greatly
   appreciated.

   Thank you,
   Asier.

  --
  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.comsymfony-users%2bunsubscr...@goog­legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

-- 
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] Re: using PropelRouteCollections in YAML or elsewhere

2010-06-10 Thread Tom Ptacnik
Show your: symfony app:routes nameOfTheApp


On 8 čvn, 18:18, Robert Schoenthal seros...@googlemail.com wrote:
 he guys,

 i have a propelRouteCollection:

 foo:
   class: sfPropel15RouteCollection
   options:
     model:                 Foo
     module:               foo
     prefix_path:          /:sf_culture/foo
     column:               id
     with_wildcard_routes: true

 now i want to be able to define something like this:

 @foo?action=new             - /en/foo    (but i needed /en/foo/new)
 @foo?bar=baz                  - /en/foo?bar=baz (unknown params are
 passed through)

 for directly jumping to the creation page.

 i tried it as seen up there, but it wont work, whats the clue?

 thanks
 robert

-- 
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] Re: Managing i18n content for frontend in the backend

2010-06-10 Thread Tom Ptacnik
I prefer codewise, but if you can show me also how it look in action,
I don't mind :)



On 9 čvn, 08:08, Christopher Schnell ty...@mda.ch wrote:
 Hi,

 you like to see it codewise or in action?

 Regards,
 Christopher.

 -Ursprüngliche Nachricht-
 Von: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] 
 Im Auftrag von Tom Ptacnik
 Gesendet: Dienstag, 8. Juni 2010 16:03
 An: symfony users
 Betreff: [symfony-users] Re: Managing i18n content for frontend in the backend

 Hi,

 thank you for your response.

 I've managed this today as I sad in my first report (one translation
 on the form via mergeForm, selected language is set in the session),
 but I would realy like to see your solution.

 Regards, Tom

 On 8 čvn, 09:17, Christopher Schnell ty...@mda.ch wrote:





  Hi,

  I've done something like this, but with an AJAX approach. The user can
  select the language he wants to edit and the form adjusts to the selected
  language. Then I only have to validate that at least one language does exist
  and adjust the __toString() methods of translated objects to provide
  language fallback.

  It is a little tricky, but it works. If you need more information, I will
  try to provide some detailed examples. The advantage is, that you don't have
  to get the language in the form, but rather render only the form, required.

  Hope, this helps a little.

  Regards,
  Christopher.

  -Ursprüngliche Nachricht-
  Von: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
  Im Auftrag von Tom Ptacnik
  Gesendet: Dienstag, 8. Juni 2010 08:54
  An: symfony users
  Betreff: [symfony-users] Managing i18n content for frontend in the backend

  Hi,

  I want to tell you my thoughts about managing I18N content in the
  backend and want to know your opinions.

  I want to internationalize my frontend app - classic (i18n/
  messages.xx.xml + object with I18n behaviour) .. no problem

  Then I need to manage internationalized objects (News) in the backend.
  I have attributes: title and content  (doctrine - i18n behaviour).
  I want English, Deutch and Czech language.

  I need to somehow to display this languages on the form.

  possibility 1)
  In the master form use $this-embedI18n(array('en', 'de', 'cs')); ..
  like in Jobeet example.
  I don't like this solution because the form is too long. 2 fields for
  every language. (imagine that I want to add some mor languages, or
  more internationalized fields ... I thing this is not suitable for me)

  possibility 2)
  Show only fields for selected translation. There is some solution here
  [url1]http://forum.symfony-project.org/index.php/t/16823/... I
  almost like it.

  I want to do something like this [url1]. For this I can use
  embedI18n(array('onlyOneSelectedLang')) or
  mergeForm(xxFormTranslation())
  I think I'll go with mergeForm() if I don't hit a snag with something.

  One thing I dont like on the solution in [url1]  is that he use use
  sf_culture in the sfUser object for selecting languege and
  sf_default_culture setting. I don't think that is correct, because
  this stuff is for internationalizing the backend, not for the managing
  the internationalized content. Am I right?

  So if I don't want to use sf_culture -  I have to figer out how to
  KNOW which language is selected .. which translation show on the form.

  I've thought about two solutions
  1) store it into the session - something like sf_culture in sf_user
  object
  2) store in only in the URL ( backend_dev.php/news/1/edit/
  edited_lang )

  If you have read this till this end and you've some opinion or you
  have deal with something similar .. tell me how you did it.

  I want to do this:
  - Show some tabs-like links for changing the language of the form
  content (EN, DE, CZ)
  - Store this selected lang into the session (contentCulture)
  - On the form show only the fields for the selected lang by
  mergeForm() function

  What do you thing abou it?

  --
  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 
  athttp://groups.google.com/group/symfony-users?hl=en

 --
 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 
 athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send

[symfony-users] Re: Trouble whith session and sfWebRequest

2010-06-10 Thread Tom Ptacnik
Show the URL you are typing.
look what echo $request-getParameter('P'); die; shows


On 9 čvn, 13:40, Albert Johé albert.j...@gmail.com wrote:
 I have this easy function:

 public function executeGProva(sfWebRequest $request)
   {
         file_put_contents('C:\test.txt',$request-getParameter('P'));
         echo 'File:'.file_get_contents('C:\test.txt');
   }

 Then when i call the url with a P parameter the echo return me the
 correct value but inside test file there is the string images. I
 have discovered this because if i pass the parameter to de sfUser,
 when i save de session the value is images too.

 What's happening?

-- 
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] Managing i18n content for frontend in the backend

2010-06-08 Thread Tom Ptacnik
Hi,

I want to tell you my thoughts about managing I18N content in the
backend and want to know your opinions.

I want to internationalize my frontend app - classic (i18n/
messages.xx.xml + object with I18n behaviour) .. no problem


Then I need to manage internationalized objects (News) in the backend.
I have attributes: title and content  (doctrine - i18n behaviour).
I want English, Deutch and Czech language.

I need to somehow to display this languages on the form.

possibility 1)
In the master form use $this-embedI18n(array('en', 'de', 'cs')); ..
like in Jobeet example.
I don't like this solution because the form is too long. 2 fields for
every language. (imagine that I want to add some mor languages, or
more internationalized fields ... I thing this is not suitable for me)

possibility 2)
Show only fields for selected translation. There is some solution here
[url1] http://forum.symfony-project.org/index.php/t/16823/ ... I
almost like it.

I want to do something like this [url1]. For this I can use
embedI18n(array('onlyOneSelectedLang')) or
mergeForm(xxFormTranslation())
I think I'll go with mergeForm() if I don't hit a snag with something.

One thing I dont like on the solution in [url1]  is that he use use
sf_culture in the sfUser object for selecting languege and
sf_default_culture setting. I don't think that is correct, because
this stuff is for internationalizing the backend, not for the managing
the internationalized content. Am I right?

So if I don't want to use sf_culture -  I have to figer out how to
KNOW which language is selected .. which translation show on the form.

I've thought about two solutions
1) store it into the session - something like sf_culture in sf_user
object
2) store in only in the URL ( backend_dev.php/news/1/edit/
edited_lang )


If you have read this till this end and you've some opinion or you
have deal with something similar .. tell me how you did it.

I want to do this:
- Show some tabs-like links for changing the language of the form
content (EN, DE, CZ)
- Store this selected lang into the session (contentCulture)
- On the form show only the fields for the selected lang by
mergeForm() function

What do you thing abou it?

-- 
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] Re: Math problem in my diploma thesis

2010-06-08 Thread Tom Ptacnik
I'll try :)

input - arrayA, arrayB


while arrayA has values
{
  take value of arrayA one by one

  while arrayB has values
  {
add combination of value from arrayA and arrayB into the result as
array
  }
}

return result


.. if combinations are only the pairs of numbers (I hope so :) , I
don't think it's that hard to understand .. it's only about
understanding the PHP array functions.


On 6 čvn, 16:05, Daniel Lohse annismcken...@googlemail.com wrote:
 Hey guys,

 I'm in the middle of my diploma thesis and I have a little Math problem. I 
 needed an algorithm that takes arrays with numbers in them and calculates all 
 possible combinations out of these – much like a tree diagram, only in code. 
 :) So, I found something on the net (please don't bash me) and I do know that 
 it's a non-recursive function (which is good). But I can't for the life of me 
 figure out how it does what it does.

 I thought that someone here could help me out with this? I pasted it 
 here:http://pastebin.com/jtpEDnkj

 The class takes this input:

 array(
   array(1, 2),
   array(3, 4)
 )

 and returns this after having done its thing:

 array(
   array(2, 3),
   array(2, 4),
   array(1, 3),
   array(1, 4)
 )

 It works great but I need this in pseudo-code. :(

 Any help is very much appreciated!

 Daniel

-- 
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] Re: help:doctrine

2010-06-08 Thread Tom Ptacnik
How is it giving you the id?



On 7 čvn, 13:20, safa boubekri boubekri.s...@gmail.com wrote:
 hello

 i  make  this  code in my action

 $this-test = Doctrine_Query::create()
    -select('titre')
    -from('Cotisation')-execute();

 it's give me  the Id   but not  'titre'

 thank  you

-- 
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] Re: How to add an error to a form field

2010-06-08 Thread Tom Ptacnik
How do you want to show the error next to the hidden field? All hidden
fields are on the beginning of the form, aren't they?


On 7 čvn, 16:35, Asier aillarrame...@gmail.com wrote:
 Hi there,

 I have a form with an embedded form, wich can have N embedded forms:

 parentForm:
   wrapperForm:
     form_1
     form_2
     ...
     form_n

 Nice. The problem is that this child forms have a date field (actually a
 hidden field: sfWidgetFormInputHidden) which I must check so that:
 form_1.date = form_2.date = ... = form_n.date. So, I have opted to use a
 callback postValidator in parentForm. I set this in parentForm configure()
 method:

 $this-validatorSchema-setPostValidator(new sfValidatorCallback(array(
   'callback' = array($this, 'validateSchema'),
 )));

 And this is my validateSchema method:

 public function validateSchema(sfValidatorBase $validator, array $values)
 {
   $previous_date = 0;
   $forms = $this-embeddedForms['wrapperForm']-getEmbeddedForms();

   foreach ($values['wrapperForm'] as $form_id = $form) {
     if (strtotime($form['date'])  $previous_date) {
       *// ADD ERROR MESSAGE*
     } else {
       $previous_date = strtotime($form['date']);
     }
   }

   return $values;

 }

 Knowing that to access one of the child forms object, we can use
 $forms[$form_id] within the for loop. How the hell can I add an error
 message to the date field?? :( I don't want a global error, I just want the
 error next to it's corresponding field. Any idea would be greatly
 appreciated.

 Thank you,
 Asier.

-- 
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] Re: Managing i18n content for frontend in the backend

2010-06-08 Thread Tom Ptacnik
Hi,

thank you for your response.

I've managed this today as I sad in my first report (one translation
on the form via mergeForm, selected language is set in the session),
but I would realy like to see your solution.


Regards, Tom


On 8 čvn, 09:17, Christopher Schnell ty...@mda.ch wrote:
 Hi,

 I've done something like this, but with an AJAX approach. The user can
 select the language he wants to edit and the form adjusts to the selected
 language. Then I only have to validate that at least one language does exist
 and adjust the __toString() methods of translated objects to provide
 language fallback.

 It is a little tricky, but it works. If you need more information, I will
 try to provide some detailed examples. The advantage is, that you don't have
 to get the language in the form, but rather render only the form, required.

 Hope, this helps a little.

 Regards,
 Christopher.

 -Ursprüngliche Nachricht-
 Von: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
 Im Auftrag von Tom Ptacnik
 Gesendet: Dienstag, 8. Juni 2010 08:54
 An: symfony users
 Betreff: [symfony-users] Managing i18n content for frontend in the backend

 Hi,

 I want to tell you my thoughts about managing I18N content in the
 backend and want to know your opinions.

 I want to internationalize my frontend app - classic (i18n/
 messages.xx.xml + object with I18n behaviour) .. no problem

 Then I need to manage internationalized objects (News) in the backend.
 I have attributes: title and content  (doctrine - i18n behaviour).
 I want English, Deutch and Czech language.

 I need to somehow to display this languages on the form.

 possibility 1)
 In the master form use $this-embedI18n(array('en', 'de', 'cs')); ..
 like in Jobeet example.
 I don't like this solution because the form is too long. 2 fields for
 every language. (imagine that I want to add some mor languages, or
 more internationalized fields ... I thing this is not suitable for me)

 possibility 2)
 Show only fields for selected translation. There is some solution here
 [url1]http://forum.symfony-project.org/index.php/t/16823/... I
 almost like it.

 I want to do something like this [url1]. For this I can use
 embedI18n(array('onlyOneSelectedLang')) or
 mergeForm(xxFormTranslation())
 I think I'll go with mergeForm() if I don't hit a snag with something.

 One thing I dont like on the solution in [url1]  is that he use use
 sf_culture in the sfUser object for selecting languege and
 sf_default_culture setting. I don't think that is correct, because
 this stuff is for internationalizing the backend, not for the managing
 the internationalized content. Am I right?

 So if I don't want to use sf_culture -  I have to figer out how to
 KNOW which language is selected .. which translation show on the form.

 I've thought about two solutions
 1) store it into the session - something like sf_culture in sf_user
 object
 2) store in only in the URL ( backend_dev.php/news/1/edit/
 edited_lang )

 If you have read this till this end and you've some opinion or you
 have deal with something similar .. tell me how you did it.

 I want to do this:
 - Show some tabs-like links for changing the language of the form
 content (EN, DE, CZ)
 - Store this selected lang into the session (contentCulture)
 - On the form show only the fields for the selected lang by
 mergeForm() function

 What do you thing abou it?

 --
 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 
 athttp://groups.google.com/group/symfony-users?hl=en

-- 
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] Re: getRaw produces blank content

2010-06-08 Thread Tom Ptacnik
In the template

?php echo $object-getAtributte(ESC_RAW) ?



On 8 čvn, 14:26, el-sid sydneyari...@gmail.com wrote:
 i mean unescape selected content

 On Jun 8, 3:23 pm, el-sid sydneyari...@gmail.com wrote:



  hello all,

  I am trying to render content from the database that was stored using
  tiny_mice and sfFormExtraPlugin

  in the controller

  $this-articles = Doctrine::getTable('Articles')-

  getNewsItems($request-getParameter('id'));

  in the template, i try this after looping in a foreach

  php article-getRaw('content') ?

  the result is a blank page(not white screen) where the content should
  render

  if i look at the view source of the browser, the data is there nicely
  formatted and unescaped.

  I want to leave escaping strategy on and only escape selected content.
  I am using symfony 1.4

  any ideas?

  thanks

-- 
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] Re: Trying to overwriting a method of a sf class

2010-06-07 Thread Tom Ptacnik
Your solution is good if you need it in one or two form classes.
Otherwise implement this method in the BaseForm.class.php which is
located in lib/form ... all your form classes are extended from this
class, so this method will be avaliable (you have to set it public or
protected)



On 4 čvn, 13:01, Javier Garcia tirengar...@gmail.com wrote:
 Hi,

 i want to overwrite a method of
 symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php.

 I think a good way could be writing again the method in the form class
 where i need that method.

 In that case if i need that method in other form class should i write
 again the new method, so i would break the rule DRY...

 So is there any better way?

 --
 Javi

 Ubuntu 8.04 - Symfony 1.3

-- 
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] Re: Custom directory structure

2010-06-07 Thread Tom Ptacnik
Try to simulate this localy on your computer. It must work. I've
easily changed the project web folder.


On 3 čvn, 07:47, Ragnis ragnis.ar...@gmail.com wrote:
 No. In public_html/pub there are only index.php, frontend_dev.php and
 image/css/javascript files.

 On Jun 1, 9:34 am, Tom Ptacnik to...@tomor.cz wrote:



  Is there (/home/xx/public_html/api/lib/vendor/symfony/lib/
  plugins/sfDoctrinePlugin/lib/database/) the file
  sfDoctrineDatabase.class.php ?

  On 27 kvě, 16:45, Ragnis ragnis.ar...@gmail.com wrote:

   Nothing changed.
   Still theese errors:

   Warning: require(/home/xx/public_html/api/lib/vendor/symfony/lib/
   plugins/sfDoctrinePlugin/lib/database/sfDoctrineDatabase.class.php)
   [function.require]: failed to open stream: No such file or directory
   in /home/xx/private_html/api/lib/vendor/symfony/lib/autoload/
   sfAutoload.class.php on line 188

   Fatal error: require() [function.require]: Failed opening required '/
   home/xx/public_html/api/lib/vendor/symfony/lib/plugins/
   sfDoctrinePlugin/lib/database/
   sfDoctrineDatabase.class.php' (include_path='.:/usr/lib/php:/usr/local/
   lib/php') in /home/xx/private_html/api/lib/vendor/symfony/lib/autoload/
   sfAutoload.class.php on line 188

   On May 27, 11:45 am, Tom Ptacnik to...@tomor.cz wrote:

I think it can be done easily... it's just about moving the web folder
somewhere else. And you have to configure you virtual in a right way
of course.

Virtual
 - classic - for you into public_html/api
  don't forget for alias for vendor/symfony/data/web/sf (The Alias
statement is necessary for the images of the debug sidebar to be
displayed)

Then the project
  private_html/api = application
  public_html/api = web

1) All stuff from /web folder move to public_html/api
2) change the path to the web dir in ProjectConfiguration.class.php -
something like this should work: 
$this-setWebDir($this-getRootDir().'/../../public_html/api);

3) change the path of the project in the front controllers:
index.php, frontend_dev.php, backend.dev.php  something like
require_once(dirname(__FILE__).'/../../private_html/api/config/
ProjectConfiguration.class.php');

On 24 kvě, 20:06, Ragnis ragnis.ar...@gmail.com wrote:

 I want to use the following directory strucure:

 home
 ---xx
 --private_html
 -api
 apps
 cache
 config
 ...
 --public_html
 -api
 index.php
 frontend_dev.php
 ...

 But i don't know what files i need to edit to get it work.

 ProjectConfiguration.class.php
 ?php
 //require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/
 sfCoreAutoload.class.php';
 require_once '../../private_html/api/lib/vendor/symfony/lib/autoload/
 sfCoreAutoload.class.php';
 sfCoreAutoload::register();

 class ProjectConfiguration extends sfProjectConfiguration
 {
   public function setup()
   {
     $this-setWebDir($this-getRootDir().'../../public_html/api');
     $this-enablePlugins('sfDoctrinePlugin');
   }

 }

 frontend_dev.php
 ?php

 // this check prevents access to debug front controllers that are
 deployed by accident to production servers.
 // feel free to remove this, extend it or make something more
 sophisticated.
 if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')) 
 false)
 {
   die('You are not allowed to access this file. Check
 '.basename(__FILE__).' for more information.');

 }

 //require_once(dirname(__FILE__).'/config/
 ProjectConfiguration.class.php');
 require_once('../../private_html/api/config/
 ProjectConfiguration.class.php');

 $configuration =
 ProjectConfiguration::getApplicationConfiguration('frontend', 'dev',
 true);
 sfContext::createInstance($configuration)-dispatch();

 I get an php error:

 Warning: require(/home/xx/public_html/api/lib/vendor/symfony/lib/
 plugins/sfDoctrinePlugin/lib/database/sfDoctrineDatabase.class.php)
 [function.require]: failed to open stream: No such file or directory
 in /home/xx/private_html/api/lib/vendor/symfony/lib/autoload/
 sfAutoload.class.php on line 188

 Fatal error: require() [function.require]: Failed opening required '/
 home/xx/public_html/api/lib/vendor/symfony/lib/plugins/
 sfDoctrinePlugin/lib/database/
 sfDoctrineDatabase.class.php' 
 (include_path='.:/usr/lib/php:/usr/local/
 lib/php') in 
 /home/xx/private_html/api/lib/vendor/symfony/lib/autoload/
 sfAutoload.class.php on line 188

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

  1   2   3   4   >