[symfony-users] using sfJqueryTreeDoctrineManagerPlugin at admin backend

2010-04-30 Thread el-sid
hi, i found this plugin to manage nested set tree but i am having
problems getting it to work, i followed the instructions but nothing
seems to happen

my yaml file looks like this

Category:
  actAs:
NestedSet:
  hasManyRoots: true
  rootColumnName: root_id
  columns:
cat_name: { type: string(255), notnull: true, unique: true }
cat_description: { type: string(255), notnull: true, unique:
true }
cat_image: { type: string(255), notnull: true, unique: true }



i installed the plugin and published assets then cleared the cache

i then autogenerated the module category for the backend and cleared
the cache. i enabled my plugin

all:
  .settings:
  enabled_modules:[default, sfJqueryTreeDoctrineManager]



and then i checked the results in the browser. the result is still as
if i never used the plugin at all. i think i may need to use the
helper but have no idea on how to enable it from the admin.
any ideas on how to get this done please. 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: using sfJqueryTreeDoctrineManagerPlugin at admin backend

2010-04-30 Thread el-sid
i get that the question might sound a little dumb :-( but can someone
please help me. google is not yielding
any results on this particular plugin. thanks

On Apr 30, 11:13 pm, el-sid  wrote:
> hi, i found this plugin to manage nested set tree but i am having
> problems getting it to work, i followed the instructions but nothing
> seems to happen
>
> my yaml file looks like this
>
> Category:
>   actAs:
>     NestedSet:
>       hasManyRoots: true
>       rootColumnName: root_id
>   columns:
>     cat_name: { type: string(255), notnull: true, unique: true }
>     cat_description: { type: string(255), notnull: true, unique:
> true }
>     cat_image: { type: string(255), notnull: true, unique: true }
>
> i installed the plugin and published assets then cleared the cache
>
> i then autogenerated the module category for the backend and cleared
> the cache. i enabled my plugin
>
> all:
>   .settings:
>   enabled_modules:        [default, sfJqueryTreeDoctrineManager]
>
> and then i checked the results in the browser. the result is still as
> if i never used the plugin at all. i think i may need to use the
> helper but have no idea on how to enable it from the admin.
> any ideas on how to get this done please. 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 
> 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] how to loop through nested set categories with related data

2010-05-10 Thread el-sid
hello, i have this problem with looping through my query.

my yaml is like so

Category:
  actAs:
NestedSet:
  hasManyRoots: true
  rootColumnName: root_id
  columns:
name: { type: string(255), notnull: true, unique: true }

Product:
  columns:
category_id: { type: integer, notnull: true }
name: { type: string(255), notnull: true }
description: { type: clob, notnull: true }
price: { type: decimal, scale: 2 }
quantity: { type: string(255), notnull: true }
image: { type: string(255) }
date: { type: date, notnull: true }
last_update: { type: date, notnull: true }
  relations:
Category:
  local: category_id
  foreign: id
  type: one
  foreignType: many
  onDelete: cascade




i have this function on the model that follows instructions from
doctrine manual on how to retrieve nested set tree with related data

 public function productCategories($catName) {

$q = Doctrine_Query::create()
->select('c.name, p.name, p.price, p.image')
->from('Category c')
->leftJoin('c.Product p')
->where('c.name = ?', $catName);


$treeObject = Doctrine_Core::getTable('Category')->getTree();
$treeObject->setBaseQuery($q);
$tree = $treeObject->fetchTree();

return $tree;

}




i retrieve it from the controller and pass an attribute to the method.

 $this->products = Doctrine_Core::getTable('Category')
->productCategories($request->getAttribute('node'));



however, when i try to loop the object products in the view, it gives
me the following error

Warning: Invalid argument supplied for foreach()

code for view



getName() ?>






any ideas 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] getting object labels sfShoppingCart

2010-05-18 Thread el-sid
Hi,

im trying to integrate sfShoppingCart with doctrine. Its all going
well except for the view

 

getClass() .
'Table', 'retrieveProductName'), $item->getId()) ?>

getLabel() ?>
getQuantity() ?>
getPrice() ?>
getDiscount()): ?>

 getDiscount() ?>







I believe the $oject->getLabel() is probably propel based. Anyone know
how to implement a doctrine version?

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] getRaw produces blank content

2010-06-08 Thread el-sid
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

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: getRaw produces blank content

2010-06-08 Thread el-sid
i mean unescape selected content

On Jun 8, 3:23 pm, el-sid  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
>
> 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: getRaw produces blank content

2010-06-08 Thread el-sid
i assume you mean:
 getContent(ESC_RAW) ?>

i also tried  getContent(ESC_RAW) ?>

didnt work either. View source still produces un escaped content but
cannot be seen in the template
On Jun 8, 5:06 pm, Tom Ptacnik  wrote:
> In the template
>
> getAtributte(ESC_RAW) ?>
>
> On 8 čvn, 14:26, el-sid  wrote:
>
> > i mean unescape selected content
>
> > On Jun 8, 3:23 pm, el-sid  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
>
> > > 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: getRaw produces blank content

2010-06-09 Thread el-sid
it worked..it seems the generated content was disagreeable to my css

On Jun 8, 7:56 pm, el-sid  wrote:
> i assume you mean:
>  getContent(ESC_RAW) ?>
>
> i also tried  getContent(ESC_RAW) ?>
>
> didnt work either. View source still produces un escaped content but
> cannot be seen in the template
> On Jun 8, 5:06 pm, Tom Ptacnik  wrote:
>
> > In the template
>
> > getAtributte(ESC_RAW) ?>
>
> > On 8 čvn, 14:26, el-sid  wrote:
>
> > > i mean unescape selected content
>
> > > On Jun 8, 3:23 pm, el-sid  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
>
> > > > 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: Form helper on symfony 1.4

2010-06-14 Thread el-sid
Hi gustavo, i think you would be better served by reading these
manuals:

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

The forms framework was revamped so these manuals should get you up
and going
On Jun 14, 11:46 pm, Gustavo Fonseca  wrote:
> hi,
> The book A gentle introduction do symfony[1] tells me that there is a
> helper called Form which can generate a  element containig a
> country list, but this helper is deprecated [2]! Somebody know if this
> feature does not exists anymore on symfony 1.4?
>
> [1]http://www.symfony-project.org/gentle-introduction/1_4/en/13-I18n-and...
> [2]http://www.symfony-project.org/tutorial/1_4/en/deprecated#chapter_460...

-- 
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] integrating galleria into symfony 1.4

2010-06-15 Thread el-sid
hi all,

i am trying to integrate this jquery script into symfony found at:
http://galleria.aino.se/ . however i am coming up with a blank
screen.

i put the javascripts inside /js/galleria folder

then in the showSuccess of my module, i put this










getImage()) ?>






Galleria.loadTheme('../galleria/themes/
galleria.classic.js');


$('.images').galleria();




the path in the url is like this: 
http://mydomain:8080/portal_dev.php/gallery/show/id/1

is there a better way to integrate external jquery into symfony??

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: integrating galleria into symfony 1.4

2010-06-15 Thread el-sid
thanks for reply,

i took your advice and put the code on the index and the changed the
 tags..however, i notice that if i comment
out these statements:



 the images show, i am thinking it has something to do with file
paths, especially on the javascript

Galleria.loadTheme('../galleria/themes/
galleria.classic.js');

but i dont know how to set it. i have tried ../../../../ on several
levels but nothing

On Jun 15, 9:17 pm, Richard D Shank  wrote:
> I would probably do this on index instead of show.  Also, your code to
> create the gallery should be
>
> 
>
>      
>
>           $pics->getImage()) ?>
> 
>
>      
>
> 
>
> Disable the the script to see if the images are actually loading on the
> page.
>
> On 06/15/2010 10:18 AM, el-sid wrote:
>
> > hi all,
>
> > i am trying to integrate this jquery script into symfony found at:
> >http://galleria.aino.se/. however i am coming up with a blank
> > screen.
>
> > i put the javascripts inside /js/galleria folder
>
> > then in the showSuccess of my module, i put this
>
> > 
> > 
>
> > 
>
> >      
>
> >           > $pics->getImage()) ?>
>
> >      
>
> >      
> >      
> >              Galleria.loadTheme('../galleria/themes/
> > galleria.classic.js');
> >          
> > 
> >              $('.images').galleria();
> >          
> > 
>
> > the path in the url is like 
> > this:http://mydomain:8080/portal_dev.php/gallery/show/id/1
>
> > is there a better way to integrate external jquery into symfony??
>
> > 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: integrating galleria into symfony 1.4

2010-06-15 Thread el-sid
oh...what i mean is that the images display but the gallery is still
not enabled

On Jun 15, 10:09 pm, el-sid  wrote:
> thanks for reply,
>
> i took your advice and put the code on the index and the changed the
>  tags..however, i notice that if i comment
> out these statements:
> 
> 
>
>  the images show, i am thinking it has something to do with file
> paths, especially on the javascript
> 
>             Galleria.loadTheme('../galleria/themes/
> galleria.classic.js');
>         
> but i dont know how to set it. i have tried ../../../../ on several
> levels but nothing
>
> On Jun 15, 9:17 pm, Richard D Shank  wrote:
>
> > I would probably do this on index instead of show.  Also, your code to
> > create the gallery should be
>
> > 
>
> >      
>
> >           > $pics->getImage()) ?>
> > 
>
> >      
>
> > 
>
> > Disable the the script to see if the images are actually loading on the
> > page.
>
> > On 06/15/2010 10:18 AM, el-sid wrote:
>
> > > hi all,
>
> > > i am trying to integrate this jquery script into symfony found at:
> > >http://galleria.aino.se/. however i am coming up with a blank
> > > screen.
>
> > > i put the javascripts inside /js/galleria folder
>
> > > then in the showSuccess of my module, i put this
>
> > > 
> > > 
>
> > > 
>
> > >      
>
> > >           > > $pics->getImage()) ?>
>
> > >      
>
> > >      
> > >      
> > >              Galleria.loadTheme('../galleria/themes/
> > > galleria.classic.js');
> > >          
> > > 
> > >              $('.images').galleria();
> > >          
> > > 
>
> > > the path in the url is like 
> > > this:http://mydomain:8080/portal_dev.php/gallery/show/id/1
>
> > > is there a better way to integrate external jquery into symfony??
>
> > > 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: integrating galleria into symfony 1.4

2010-06-15 Thread el-sid
nope. it didn't work. i tried
Galleria.loadTheme('/js/galleria/themes/galleria.classic.js');
and also
Galleria.loadTheme('../js/galleria/themes/galleria.classic.js');
but nothing. I am relatively new to symfony, so i have never
integrated php with jquery. is there
an alternative way of doing this
On Jun 15, 10:40 pm, Richard D Shank  wrote:
> On 06/15/2010 12:09 PM, el-sid wrote:
>
>
>
> > thanks for reply,
>
> > i took your advice and put the code on the index and the changed the
> >   tags..however, i notice that if i comment
> > out these statements:
> > 
> > 
>
> >   the images show, i am thinking it has something to do with file
> > paths, especially on the javascript
> > 
> >              Galleria.loadTheme('../galleria/themes/
> > galleria.classic.js');
> >          
> > but i dont know how to set it. i have tried ../../../../ on several
> > levels but nothing
>
> I think your hunch is right, try an absolute link.  
> Galleria.loadTheme('/js/galleria/themes/galleria.classic.js'); or where
> ever it is located for you
>
> > On Jun 15, 9:17 pm, Richard D Shank  wrote:
>
> >> I would probably do this on index instead of show.  Also, your code to
> >> create the gallery should be
>
> >> 
>
> >>       
>
> >>            >> $pics->getImage()) ?>
> >> 
>
> >>       
>
> >> 
>
> >> Disable the the script to see if the images are actually loading on the
> >> page.
>
> >> On 06/15/2010 10:18 AM, el-sid wrote:
>
> >>> hi all,
>
> >>> i am trying to integrate this jquery script into symfony found at:
> >>>http://galleria.aino.se/. however i am coming up with a blank
> >>> screen.
>
> >>> i put the javascripts inside /js/galleria folder
>
> >>> then in the showSuccess of my module, i put this
>
> >>> 
> >>> 
>
> >>> 
>
> >>>       
>
> >>>            >>> $pics->getImage()) ?>
>
> >>>       
>
> >>>       
> >>>       
> >>>               Galleria.loadTheme('../galleria/themes/
> >>> galleria.classic.js');
> >>>           
> >>> 
> >>>               $('.images').galleria();
> >>>           
> >>> 
>
> >>> the path in the url is like 
> >>> this:http://mydomain:8080/portal_dev.php/gallery/show/id/1
>
> >>> is there a better way to integrate external jquery into symfony??
>
> >>> 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: integrating galleria into symfony 1.4

2010-06-15 Thread el-sid
geez! i think you are right..just put firebug and it seems some of the
javascript code is being obstructed by the debug toolbar and/or with
my other javascript code there. On my layout..i had used:

 

though now i am starting to think its a better idea to include
stylesheets for the layout only and add module specific stylesheets
and javascripts in the view.yml
Is that about right??

Anyway, time to power down my brain. its late in my continent. Thanks
for all your help Richard, i'll let you know how it goes.
On Jun 15, 11:43 pm, Richard D Shank  wrote:
> On 06/15/2010 01:09 PM, el-sid wrote:
>
> > nope. it didn't work. i tried
> > Galleria.loadTheme('/js/galleria/themes/galleria.classic.js');
> > and also
> > Galleria.loadTheme('../js/galleria/themes/galleria.classic.js');
> > but nothing. I am relatively new to symfony, so i have never
> > integrated php with jquery. is there
> > an alternative way of doing this
>
> That part of it is, most likely, not related to symfony.  If you have
> the images being created, the galleria plugin adds the extra html/css/js
> to make the slideshow work.  Have you looked at what is happening on the
> webpage using firebug?
>
> The other thing, that is obvious, but easy to overlook, are you sure the
> js files are where they are supposed to be.
>
> > On Jun 15, 10:40 pm, Richard D Shank  wrote:
>
> >> On 06/15/2010 12:09 PM, el-sid wrote:
>
> >>> thanks for reply,
>
> >>> i took your advice and put the code on the index and the changed the
> >>>     tags..however, i notice that if i comment
> >>> out these statements:
> >>> 
> >>> 
>
> >>>    the images show, i am thinking it has something to do with file
> >>> paths, especially on the javascript
> >>> 
> >>>               Galleria.loadTheme('../galleria/themes/
> >>> galleria.classic.js');
> >>>           
> >>> but i dont know how to set it. i have tried ../../../../ on several
> >>> levels but nothing
>
> >> I think your hunch is right, try an absolute link.  
> >> Galleria.loadTheme('/js/galleria/themes/galleria.classic.js'); or where
> >> ever it is located for you
>
> >>> On Jun 15, 9:17 pm, Richard D Shank    wrote:
>
> >>>> I would probably do this on index instead of show.  Also, your code to
> >>>> create the gallery should be
>
> >>>> 
>
> >>>>        
>
> >>>>             >>>> $pics->getImage()) ?>
> >>>> 
>
> >>>>        
>
> >>>> 
>
> >>>> Disable the the script to see if the images are actually loading on the
> >>>> page.
>
> >>>> On 06/15/2010 10:18 AM, el-sid wrote:
>
> >>>>> hi all,
>
> >>>>> i am trying to integrate this jquery script into symfony found at:
> >>>>>http://galleria.aino.se/. however i am coming up with a blank
> >>>>> screen.
>
> >>>>> i put the javascripts inside /js/galleria folder
>
> >>>>> then in the showSuccess of my module, i put this
>
> >>>>> 
> >>>>> 
>
> >>>>> 
>
> >>>>>        
>
> >>>>>             >>>>> $pics->getImage()) ?>
>
> >>>>>        
>
> >>>>>        
> >>>>>        
> >>>>>                Galleria.loadTheme('../galleria/themes/
> >>>>> galleria.classic.js');
> >>>>>            
> >>>>> 
> >>>>>                $('.images').galleria();
> >>>>>            
> >>>>> 
>
> >>>>> the path in the url is like 
> >>>>> this:http://mydomain:8080/portal_dev.php/gallery/show/id/1
>
> >>>>> is there a better way to integrate external jquery into symfony??
>
> >>>>> 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: integrating galleria into symfony 1.4

2010-06-16 Thread el-sid
It finally worked...firebug was a big help. turns out the hunch i had
was right.
Galleria.loadTheme('/js/galleria/themes/galleria.classic.js'); was the
problem since it was
returning a 404 not found in firebug. The above format you suggested
was right only that my path was
a little messed up.
Thanks again.

On Jun 16, 12:09 am, el-sid  wrote:
> geez! i think you are right..just put firebug and it seems some of the
> javascript code is being obstructed by the debug toolbar and/or with
> my other javascript code there. On my layout..i had used:
> 
>  
>
> though now i am starting to think its a better idea to include
> stylesheets for the layout only and add module specific stylesheets
> and javascripts in the view.yml
> Is that about right??
>
> Anyway, time to power down my brain. its late in my continent. Thanks
> for all your help Richard, i'll let you know how it goes.
> On Jun 15, 11:43 pm, Richard D Shank  wrote:
>
> > On 06/15/2010 01:09 PM, el-sid wrote:
>
> > > nope. it didn't work. i tried
> > > Galleria.loadTheme('/js/galleria/themes/galleria.classic.js');
> > > and also
> > > Galleria.loadTheme('../js/galleria/themes/galleria.classic.js');
> > > but nothing. I am relatively new to symfony, so i have never
> > > integrated php with jquery. is there
> > > an alternative way of doing this
>
> > That part of it is, most likely, not related to symfony.  If you have
> > the images being created, the galleria plugin adds the extra html/css/js
> > to make the slideshow work.  Have you looked at what is happening on the
> > webpage using firebug?
>
> > The other thing, that is obvious, but easy to overlook, are you sure the
> > js files are where they are supposed to be.
>
> > > On Jun 15, 10:40 pm, Richard D Shank  wrote:
>
> > >> On 06/15/2010 12:09 PM, el-sid wrote:
>
> > >>> thanks for reply,
>
> > >>> i took your advice and put the code on the index and the changed the
> > >>>     tags..however, i notice that if i comment
> > >>> out these statements:
> > >>> 
> > >>> 
>
> > >>>    the images show, i am thinking it has something to do with file
> > >>> paths, especially on the javascript
> > >>> 
> > >>>               Galleria.loadTheme('../galleria/themes/
> > >>> galleria.classic.js');
> > >>>           
> > >>> but i dont know how to set it. i have tried ../../../../ on several
> > >>> levels but nothing
>
> > >> I think your hunch is right, try an absolute link.  
> > >> Galleria.loadTheme('/js/galleria/themes/galleria.classic.js'); or where
> > >> ever it is located for you
>
> > >>> On Jun 15, 9:17 pm, Richard D Shank    wrote:
>
> > >>>> I would probably do this on index instead of show.  Also, your code to
> > >>>> create the gallery should be
>
> > >>>> 
>
> > >>>>        
>
> > >>>>             > >>>> $pics->getImage()) ?>
> > >>>> 
>
> > >>>>        
>
> > >>>> 
>
> > >>>> Disable the the script to see if the images are actually loading on the
> > >>>> page.
>
> > >>>> On 06/15/2010 10:18 AM, el-sid wrote:
>
> > >>>>> hi all,
>
> > >>>>> i am trying to integrate this jquery script into symfony found at:
> > >>>>>http://galleria.aino.se/. however i am coming up with a blank
> > >>>>> screen.
>
> > >>>>> i put the javascripts inside /js/galleria folder
>
> > >>>>> then in the showSuccess of my module, i put this
>
> > >>>>> 
> > >>>>> 
>
> > >>>>> 
>
> > >>>>>        
>
> > >>>>>             > >>>>> .
> > >>>>> $pics->getImage()) ?>
>
> > >>>>>        
>
> > >>>>>        
> > >>>>>        
> > >>>>>                Galleria.loadTheme('../galleria/themes/
> > >>>>> galleria.classic.js');
> > >>>>>            
> > >>>>> 
> > >>>>>                $('.images').galleria();
> > >>>>>            
> > >>>>> 
>
> > >>>>> the path in the url is like 
> > >>>>> this:http://mydomain:8080/portal_dev.php/gallery/show/id/1
>
> > >>>>> is there a better way to integrate external jquery into symfony??
>
> > >>>>> 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] forward404Unless() problem

2010-07-16 Thread el-sid
Hi,

i am trying to redirect by action when it returns an empty result set
using foward404Unless(). the problem is it doesnt seem to have any
effect. It just brings me a page without the content

in my action i have this

public function executeIndex(sfWebRequest $request) {

$this->articles = Doctrine_Core::getTable('Articles')-
>getArticles($request->getParameter('id'));

$this->forward404Unless($this->articles);
}



this method is retrieved from the table as follows

public function getArticles($id) {

$q = $this->createQuery('a')
->where('a.category_id =?', $id)
->orderBy('a.id')
->limit('1');

return $q->execute();
}

i have a few records in the database that call this method and data is
displayed. but where there is no record, the forward404Unless() method
does not redirect

-- 
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: forward404Unless() problem

2010-07-17 Thread el-sid
any ideas anyone?

On Jul 16, 8:37 pm, el-sid  wrote:
> Hi,
>
> i am trying to redirect by action when it returns an empty result set
> using foward404Unless(). the problem is it doesnt seem to have any
> effect. It just brings me a page without the content
>
> in my action i have this
>
> public function executeIndex(sfWebRequest $request) {
>
>         $this->articles = Doctrine_Core::getTable('Articles')-
>
> >getArticles($request->getParameter('id'));
>
>         $this->forward404Unless($this->articles);
>     }
>
> this method is retrieved from the table as follows
>
> public function getArticles($id) {
>
>         $q = $this->createQuery('a')
>                         ->where('a.category_id =?', $id)
>                         ->orderBy('a.id')
>                         ->limit('1');
>
>         return $q->execute();
>     }
>
> i have a few records in the database that call this method and data is
> displayed. but where there is no record, the forward404Unless() method
> does not redirect

-- 
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] The requested URL was not found on this server. ERROR

2010-08-09 Thread el-sid
hello,
i am trying to test out how my app should behave in a production
environment so this is what i did.
In my settings.yml i set this

prod:
  .settings:
no_script_name: true
logging_enabled:false

i modified my htaccess file to look like this


Options +FollowSymLinks +ExecCGI


  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

   # we skip all files with .something
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]


and my index.php looks like this

require_once(dirname(__FILE__).'/../config/
ProjectConfiguration.class.php');

$configuration =
ProjectConfiguration::getApplicationConfiguration('portal', 'prod',
false);
sfContext::createInstance($configuration)->dispatch();




when i put this address

http://127.0.0.1:8080/ it works perfectly
when i put this
http://uia:8080/module/action

it gives me this 404 error
The requested URL/module/action was not found on this server.

when i include the index.php as in
http://127.0.0.1:8080/index.php/module/action it works.

Anyone knows whats causing this error? What am i missing?

i googled it and found a similar problem in these forums:
http://oldforum.symfony-project.org/index.php/m/42318/
but no concrete solutions

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: The requested URL was not found on this server. ERROR

2010-08-09 Thread el-sid
@Gustavo...i uncommented RewriteBase and nothing happened
@Alexandre...i removed the tags as you suggested and did get an
internal server error

my error log has this line:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a
module not included in the server configuration, referer: http://127.0.0.1:8080/

i guess you are right and mod_rewrite might not be properly
configured, i am running on debian lenny.

Thanks for the suggestions

On Aug 9, 11:45 pm, Gustavo Adrian 
wrote:
> Try to change this line:
>
> #RewriteBase /
>
> To:
>
> RewriteBase /
>
> Cheers.
>
> On Mon, Aug 9, 2010 at 5:41 PM, Alexandre Salomé 
> > wrote:
> >  Can be rewrite module that is not enabled in your project.
>
> > To check it is the missing module, remove the  > tag.
>
> > It it shows "500 - Internal Error", look at your Apache logs to see if you
> > have an error output.
>
> > The next step depends of your apache installation. You will have to install
> > mod_rewrite.
>
> > Le 09/08/10 22:38, el-sid a écrit :
>
> >  hello,
> >> i am trying to test out how my app should behave in a production
> >> environment so this is what i did.
> >> In my settings.yml i set this
>
> >> prod:
> >>   .settings:
> >>     no_script_name:         true
> >>     logging_enabled:        false
>
> >> i modified my htaccess file to look like this
>
> >>     Options +FollowSymLinks +ExecCGI
>
> >>     
> >>       RewriteEngine On
>
> >>       # uncomment the following line, if you are having trouble
> >>       # getting no_script_name to work
> >>       #RewriteBase /
>
> >>        # we skip all files with .something
> >>         RewriteCond %{REQUEST_URI} \..+$
> >>         RewriteCond %{REQUEST_URI} !\.html$
> >>         RewriteRule .* - [L]
>
> >>       # we check if the .html version is here (caching)
> >>       RewriteRule ^$ index.html [QSA]
> >>       RewriteRule ^([^.]+)$ $1.html [QSA]
> >>       RewriteCond %{REQUEST_FILENAME} !-f
>
> >>       # no, so we redirect to our front web controller
> >>       RewriteRule ^(.*)$ index.php [QSA,L]
> >>     
>
> >> and my index.php looks like this
>
> >>     require_once(dirname(__FILE__).'/../config/
> >> ProjectConfiguration.class.php');
>
> >>     $configuration =
> >> ProjectConfiguration::getApplicationConfiguration('portal', 'prod',
> >> false);
> >>     sfContext::createInstance($configuration)->dispatch();
>
> >> when i put this address
>
> >>http://127.0.0.1:8080/it works perfectly
> >> when i put this
> >>http://uia:8080/module/action
>
> >> it gives me this 404 error
> >> The requested URL/module/action was not found on this server.
>
> >> when i include the index.php as in
> >>http://127.0.0.1:8080/index.php/module/actionit works.
>
> >> Anyone knows whats causing this error? What am i missing?
>
> >> i googled it and found a similar problem in these forums:
> >>http://oldforum.symfony-project.org/index.php/m/42318/
> >> but no concrete solutions
>
> >> 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: The requested URL was not found on this server. ERROR

2010-08-09 Thread el-sid
tracked the solution(for apache config on debian) to this link
http://tymonn.wordpress.com/2009/07/31/how-to-enable-mod_rewrite-in-apache2-debianubuntu/

for anyone interested. Thanks mates

On Aug 9, 11:58 pm, el-sid  wrote:
> @Gustavo...i uncommented RewriteBase and nothing happened
> @Alexandre...i removed the tags as you suggested and did get an
> internal server error
>
> my error log has this line:
> Invalid command 'RewriteEngine', perhaps misspelled or defined by a
> module not included in the server configuration, 
> referer:http://127.0.0.1:8080/
>
> i guess you are right and mod_rewrite might not be properly
> configured, i am running on debian lenny.
>
> Thanks for the suggestions
>
> On Aug 9, 11:45 pm, Gustavo Adrian 
> wrote:
>
> > Try to change this line:
>
> > #RewriteBase /
>
> > To:
>
> > RewriteBase /
>
> > Cheers.
>
> > On Mon, Aug 9, 2010 at 5:41 PM, Alexandre Salomé 
> > > wrote:
> > >  Can be rewrite module that is not enabled in your project.
>
> > > To check it is the missing module, remove the  > > tag.
>
> > > It it shows "500 - Internal Error", look at your Apache logs to see if you
> > > have an error output.
>
> > > The next step depends of your apache installation. You will have to 
> > > install
> > > mod_rewrite.
>
> > > Le 09/08/10 22:38, el-sid a écrit :
>
> > >  hello,
> > >> i am trying to test out how my app should behave in a production
> > >> environment so this is what i did.
> > >> In my settings.yml i set this
>
> > >> prod:
> > >>   .settings:
> > >>     no_script_name:         true
> > >>     logging_enabled:        false
>
> > >> i modified my htaccess file to look like this
>
> > >>     Options +FollowSymLinks +ExecCGI
>
> > >>     
> > >>       RewriteEngine On
>
> > >>       # uncomment the following line, if you are having trouble
> > >>       # getting no_script_name to work
> > >>       #RewriteBase /
>
> > >>        # we skip all files with .something
> > >>         RewriteCond %{REQUEST_URI} \..+$
> > >>         RewriteCond %{REQUEST_URI} !\.html$
> > >>         RewriteRule .* - [L]
>
> > >>       # we check if the .html version is here (caching)
> > >>       RewriteRule ^$ index.html [QSA]
> > >>       RewriteRule ^([^.]+)$ $1.html [QSA]
> > >>       RewriteCond %{REQUEST_FILENAME} !-f
>
> > >>       # no, so we redirect to our front web controller
> > >>       RewriteRule ^(.*)$ index.php [QSA,L]
> > >>     
>
> > >> and my index.php looks like this
>
> > >>     require_once(dirname(__FILE__).'/../config/
> > >> ProjectConfiguration.class.php');
>
> > >>     $configuration =
> > >> ProjectConfiguration::getApplicationConfiguration('portal', 'prod',
> > >> false);
> > >>     sfContext::createInstance($configuration)->dispatch();
>
> > >> when i put this address
>
> > >>http://127.0.0.1:8080/itworks perfectly
> > >> when i put this
> > >>http://uia:8080/module/action
>
> > >> it gives me this 404 error
> > >> The requested URL/module/action was not found on this server.
>
> > >> when i include the index.php as in
> > >>http://127.0.0.1:8080/index.php/module/actionitworks.
>
> > >> Anyone knows whats causing this error? What am i missing?
>
> > >> i googled it and found a similar problem in these forums:
> > >>http://oldforum.symfony-project.org/index.php/m/42318/
> > >> but no concrete solutions
>
> > >> 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: How to set the title to each page dynamically

2010-11-28 Thread el-sid
or you can modify the title per module basis using the view.yml.
However, make sure that you have not written anything between  tags in the global layout, then you can specify title in the
application level and myModule/config/view.yml level

On Nov 22, 8:36 am, Pradeep  wrote:
> I found that title is being obtained from the layout.php which is
> being applied to all pages taking it from there. I wonder how to add
> the title to each page according to the type of the page showing
> necessary title.
>
> Can someone tell me how to proceed

-- 
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] image rendering problem-symfony 1.4

2010-12-03 Thread el-sid
hello all,

in my project, i have stored css files in web/css/template/ directory
and images in web/images/template/ directory

However, images are not displaying in my project. Using the element
inspector for chrome,
i find this error

Failed to load resource: the server responded with a status of 404
(Not Found)

and the resource path is http://eprocure:8080/css/images/template/tray.gif

its corresponding css style is

#tray {padding:12px 15px; background:url("../images/template/
tray.gif") 0 0 repeat-x; font:85%/1.2 "tahoma",sans-serif;}

as i understand, for it to render correctly, it should have a path
like without css in the path

 http://eprocure:8080/images/template/tray.gif

in my other projects, it renders correctly.

Does anyone understand what i am doing wrong?

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: image rendering problem-symfony 1.4

2010-12-03 Thread el-sid
Thanks for the reply,

However, i had already tried that and it did not work. However,
removing the quotes and adding two levels worked

background:url(../../images/template/tray.gif)

The thing is, it should have worked either way correct?

This comes from a template i downloaded and it works right out of the
box. However, trying to put it
inside a symfony project caused me a lot of problems. Hence my reason
for asking in this forum.

I suspect that if i asked that in a html/css forum, they would be
baffled as the syntax
background:url("../../images/template/tray.gif")
is correct but did not work.

But thanks again for your reply

On Dec 3, 6:19 pm, Christian Schaefer  wrote:
> you're using a relative path but your missing one level.
> according to your folder structure it would be
>
> #tray {padding:12px 15px; background:url("../images/template/
> tray.gif") 0 0 repeat-x; font:85%/1.2 "tahoma",sans-serif;}
>
> however this is not an appropriate question for this mailing list as
> it has nothing to do with symfony not even with php..
>
> On 3 Dez., 15:47, el-sid  wrote:
>
>
>
>
>
>
>
> > hello all,
>
> > in my project, i have stored css files in web/css/template/ directory
> > and images in web/images/template/ directory
>
> > However, images are not displaying in my project. Using the element
> > inspector for chrome,
> > i find this error
>
> > Failed to load resource: the server responded with a status of 404
> > (Not Found)
>
> > and the resource path ishttp://eprocure:8080/css/images/template/tray.gif
>
> > its corresponding css style is
>
> > #tray {padding:12px 15px; background:url("../images/template/
> > tray.gif") 0 0 repeat-x; font:85%/1.2 "tahoma",sans-serif;}
>
> > as i understand, for it to render correctly, it should have a path
> > like without css in the path
>
> >  http://eprocure:8080/images/template/tray.gif
>
> > in my other projects, it renders correctly.
>
> > Does anyone understand what i am doing wrong?
>
> > 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] problem saving forms

2010-12-05 Thread el-sid
Hi all,

I am trying to modify the registration process in
sfDoctrineGuardPlugin to allow for an edit feature in the frontend. So
i came up with this..


public function executeIndex(sfWebRequest $request)
{

$response = $this->getResponse()->addStyleSheet('template/
2col.css');

if ($request->isMethod('post'))
{

$this->form->bind($request-
>getParameter('sf_guard_user'));

if ($this->form->isValid())
{

$this->form->getObject()->save();

$this->redirect('@homepage');
}
}
}

public function executeEdit(sfWebRequest $request)
{

$response = $this->getResponse()->addStyleSheet('template/
2col.css');

$this->forward404Unless($user =
Doctrine_Core::getTable('sfGuardUser')->find(array($this->getUser()-
>getGuardUser()->getId())), sprintf('Object requisition does not exist
(%s).', $request->getParameter('id')));
$this->form = new RegisterForm($user);
}

problem is the form is neither saving nor validating.

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: problem saving forms

2010-12-10 Thread el-sid
okam really at my wits end here. can anyone please show me whats
going on here.
I modified my code to look like so

 $response = $this->getResponse()->addStyleSheet('template/2col.css');

$this->form = new RegisterForm();

if ($request->isMethod('post'))
{

$this->processForm($request, $this->form);

$this->form->bind($request-
>getParameter('sf_guard_user'));

if ($this->form->isValid())
{

$this->form->save();

// $this->getUser()->signIn($this->form->getObject());
$this->redirect('@homepage');
}
}


However, all it does is give me a blank screen and does not redirect
as it is supposed to.
In my debug toolbar, it shows the modified response values. My problem
is nothing gets saved in the
database, and no error indicating why.

Any help? thanks

On Dec 6, 9:42 am, el-sid  wrote:
> Hi all,
>
> I am trying to modify the registration process in
> sfDoctrineGuardPlugin to allow for an edit feature in the frontend. So
> i came up with this..
>
> public function executeIndex(sfWebRequest $request)
>     {
>
>         $response = $this->getResponse()->addStyleSheet('template/
> 2col.css');
>
>         if ($request->isMethod('post'))
>         {
>
>             $this->form->bind($request-
>
> >getParameter('sf_guard_user'));
>
>             if ($this->form->isValid())
>             {
>
>                 $this->form->getObject()->save();
>
>                 $this->redirect('@homepage');
>             }
>         }
>     }
>
>     public function executeEdit(sfWebRequest $request)
>     {
>
>         $response = $this->getResponse()->addStyleSheet('template/
> 2col.css');
>
>         $this->forward404Unless($user =
> Doctrine_Core::getTable('sfGuardUser')->find(array($this->getUser()->getGuardUser()->getId())),
>  sprintf('Object requisition does not exist
>
> (%s).', $request->getParameter('id')));
>         $this->form = new RegisterForm($user);
>     }
>
> problem is the form is neither saving nor validating.
>
> 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: problem saving forms

2010-12-10 Thread el-sid
sorry, this part
 $this->processForm($request, $this->form);

 and this part

$this->getUser()->signIn($this->form->getObject());

is not in the code.

Thanks again

On Dec 10, 6:10 pm, el-sid  wrote:
> okam really at my wits end here. can anyone please show me whats
> going on here.
> I modified my code to look like so
>
>  $response = $this->getResponse()->addStyleSheet('template/2col.css');
>
>         $this->form = new RegisterForm();
>
>         if ($request->isMethod('post'))
>         {
>
>             $this->processForm($request, $this->form);
>
>             $this->form->bind($request-
>
> >getParameter('sf_guard_user'));
>
>             if ($this->form->isValid())
>             {
>
>                 $this->form->save();
>
>                 // $this->getUser()->signIn($this->form->getObject());
>                 $this->redirect('@homepage');
>             }
>         }
>
> However, all it does is give me a blank screen and does not redirect
> as it is supposed to.
> In my debug toolbar, it shows the modified response values. My problem
> is nothing gets saved in the
> database, and no error indicating why.
>
> Any help? thanks
>
> On Dec 6, 9:42 am, el-sid  wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > I am trying to modify the registration process in
> > sfDoctrineGuardPlugin to allow for an edit feature in the frontend. So
> > i came up with this..
>
> > public function executeIndex(sfWebRequest $request)
> >     {
>
> >         $response = $this->getResponse()->addStyleSheet('template/
> > 2col.css');
>
> >         if ($request->isMethod('post'))
> >         {
>
> >             $this->form->bind($request-
>
> > >getParameter('sf_guard_user'));
>
> >             if ($this->form->isValid())
> >             {
>
> >                 $this->form->getObject()->save();
>
> >                 $this->redirect('@homepage');
> >             }
> >         }
> >     }
>
> >     public function executeEdit(sfWebRequest $request)
> >     {
>
> >         $response = $this->getResponse()->addStyleSheet('template/
> > 2col.css');
>
> >         $this->forward404Unless($user =
> > Doctrine_Core::getTable('sfGuardUser')->find(array($this->getUser()->getGua 
> > rdUser()->getId())), sprintf('Object requisition does not exist
>
> > (%s).', $request->getParameter('id')));
> >         $this->form = new RegisterForm($user);
> >     }
>
> > problem is the form is neither saving nor validating.
>
> > 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] ckWebServicePlugin unit tests

2011-04-04 Thread el-sid
hi all,

been trying out the ckWebServicePlugin but i am unable to get the unit
tests to show any result
 my app.yml is

all:
  enable_soap_parameter: off
  #your environment for webservice mode
  soap:
#enable the `ckSoapParameterFilter`
enable_soap_parameter: on
ck_web_service_plugin:
  #the location of your wsdl file
  wsdl: %SF_WEB_DIR%/TestApi.wsdl
  #the class that will be registered as handler for webservice
requests
  handler: TestApiHandler

  soaptest:
enable_soap_parameter: on
ck_web_service_plugin:
  wsdl: %SF_WEB_DIR%/TestApi.wsdl
  handler: TestApiHandler

the module is

public function executeMultiply($request)
{
$factorA = $request->getParameter('a');
$factorB = $request->getParameter('b');

if(is_numeric($factorA) && is_numeric($factorB))
{
$this->result = $factorA * $factorB;

//$result = $this->result;

//return $request;

return sfView::SUCCESS;
}
else
{
return sfView::ERROR;
}
}

and the test script is


test_multiply(5, 2)// call the action
  //->isFaultEmpty() // check there are no errors
  //->isType('', 'double')   // check the result type is double
->is('', 10);// check the result value is 10

$result = $c->getResult();

echo $result;


i have been following the documentation but i just can't seem to get
the tests to work.
when i type this command

php test/functional/testApiTest.php

nothing happens, no error message, nothing.

anyone knows how to fix 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: ckWebServicePlugin unit tests

2011-04-04 Thread el-sid
ok, i managed to get the unit tests to atleast show an output,
however, it shows this error

# Multiply(...)
ok 1 - response object . is a double
not ok 2 - response object . is 10
# Failed test (./plugins/ckWebServicePlugin/lib/test/
ckTestSoapClient.class.php at line 368)
#got: 1
#   expected: 10
1..2
# Looks like you failed 1 tests of
2.


i don't get why the output would be one unless the request object is
outputting arrays. The methods and tests are
exactly like in  the documentation.

please help

On Apr 4, 10:19 am, el-sid  wrote:
> hi all,
>
> been trying out the ckWebServicePlugin but i am unable to get the unit
> tests to show any result
>  my app.yml is
>
> all:
>   enable_soap_parameter: off
>   #your environment for webservice mode
>   soap:
>     #enable the `ckSoapParameterFilter`
>     enable_soap_parameter: on
>     ck_web_service_plugin:
>       #the location of your wsdl file
>       wsdl: %SF_WEB_DIR%/TestApi.wsdl
>       #the class that will be registered as handler for webservice
> requests
>       handler: TestApiHandler
>
>   soaptest:
>     enable_soap_parameter: on
>     ck_web_service_plugin:
>       wsdl: %SF_WEB_DIR%/TestApi.wsdl
>       handler: TestApiHandler
>
> the module is
>
> public function executeMultiply($request)
>         {
>                 $factorA = $request->getParameter('a');
>                 $factorB = $request->getParameter('b');
>
>                 if(is_numeric($factorA) && is_numeric($factorB))
>                 {
>                         $this->result = $factorA * $factorB;
>
>                         //$result = $this->result;
>
>                         //return $request;
>
>                         return sfView::SUCCESS;
>                 }
>                 else
>                 {
>                         return sfView::ERROR;
>                 }
>         }
>
> and the test script is
>
> 
> $app   = 'frontend';
> $debug = true;
>
> include_once(dirname(__FILE__).'/../bootstrap/soaptest.php');
>
> $c = new ckTestSoapClient();
>
> // test executeMultiply
> $c->test_multiply(5, 2)    // call the action
>   //->isFaultEmpty()         // check there are no errors
>   //->isType('', 'double')   // check the result type is double
>     ->is('', 10);            // check the result value is 10
>
> $result = $c->getResult();
>
> echo $result;
>
> i have been following the documentation but i just can't seem to get
> the tests to work.
> when i type this command
>
> php test/functional/testApiTest.php
>
> nothing happens, no error message, nothing.
>
> anyone knows how to fix 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: ckWebServicePlugin unit tests

2011-04-04 Thread el-sid
can anyone please help me with this situation, or at least point me to
the right direction. I would be happy
to provide further information if needed. I'm stumped and google
doesn't point to such an error.

thanks again

On Apr 5, 12:23 am, el-sid  wrote:
> ok, i managed to get the unit tests to atleast show an output,
> however, it shows this error
>
> # Multiply(...)
> ok 1 - response object . is a double
> not ok 2 - response object . is 10
> #     Failed test (./plugins/ckWebServicePlugin/lib/test/
> ckTestSoapClient.class.php at line 368)
> #            got: 1
> #       expected: 10
> 1..2
> # Looks like you failed 1 tests of
> 2.
>
> i don't get why the output would be one unless the request object is
> outputting arrays. The methods and tests are
> exactly like in  the documentation.
>
> please help
>
> On Apr 4, 10:19 am, el-sid  wrote:
>
>
>
>
>
>
>
> > hi all,
>
> > been trying out the ckWebServicePlugin but i am unable to get the unit
> > tests to show any result
> >  my app.yml is
>
> > all:
> >   enable_soap_parameter: off
> >   #your environment for webservice mode
> >   soap:
> >     #enable the `ckSoapParameterFilter`
> >     enable_soap_parameter: on
> >     ck_web_service_plugin:
> >       #the location of your wsdl file
> >       wsdl: %SF_WEB_DIR%/TestApi.wsdl
> >       #the class that will be registered as handler for webservice
> > requests
> >       handler: TestApiHandler
>
> >   soaptest:
> >     enable_soap_parameter: on
> >     ck_web_service_plugin:
> >       wsdl: %SF_WEB_DIR%/TestApi.wsdl
> >       handler: TestApiHandler
>
> > the module is
>
> > public function executeMultiply($request)
> >         {
> >                 $factorA = $request->getParameter('a');
> >                 $factorB = $request->getParameter('b');
>
> >                 if(is_numeric($factorA) && is_numeric($factorB))
> >                 {
> >                         $this->result = $factorA * $factorB;
>
> >                         //$result = $this->result;
>
> >                         //return $request;
>
> >                         return sfView::SUCCESS;
> >                 }
> >                 else
> >                 {
> >                         return sfView::ERROR;
> >                 }
> >         }
>
> > and the test script is
>
> > 
> > $app   = 'frontend';
> > $debug = true;
>
> > include_once(dirname(__FILE__).'/../bootstrap/soaptest.php');
>
> > $c = new ckTestSoapClient();
>
> > // test executeMultiply
> > $c->test_multiply(5, 2)    // call the action
> >   //->isFaultEmpty()         // check there are no errors
> >   //->isType('', 'double')   // check the result type is double
> >     ->is('', 10);            // check the result value is 10
>
> > $result = $c->getResult();
>
> > echo $result;
>
> > i have been following the documentation but i just can't seem to get
> > the tests to work.
> > when i type this command
>
> > php test/functional/testApiTest.php
>
> > nothing happens, no error message, nothing.
>
> > anyone knows how to fix 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] properly download excel file

2011-05-23 Thread el-sid
hi all,

does anyone know to properly download an excel file?
in my code i have

public function executeDownload(sfWebRequest $request)
{
$excel_file = Doctrine::getTable('Project')->find($request-
>getParameter('id'));

$this->setLayout(false);
sfConfig::set('sf_web_debug', false);

$excelpath =
sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR.'project'.DIRECTORY_SEPARATOR.
$excel_file['file'];

// check if the file exists
$this->forward404Unless(file_exists($excelpath));

$response = $this->getContext()->getResponse();
$response->setHttpHeader('Pragma', '');
$response->setHttpHeader('Cache-Control', '');
$response->setHttpHeader('Content-Type', 'application/
vnd.openxmlformats-officedocument.spreadsheetml.sheet');
$response->setHttpHeader('Content-Disposition', 'attachment;
filename="invoice.xlsx"');
$response->setContent($excel_file);


return sfView::NONE;

}

this downloads a file with the name invoice.xlsx but its corrupted.

any help please? Thanks

 the post is here as well

http://forum.symfony-project.org/viewtopic.php?f=22&t=35430

to clear any duplication

-- 
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] problem with building sql

2009-09-20 Thread el-sid

hi all, am new to symfony and have been using the jobbet tutorial to
try building a new app. i posted this message on the symfony forums
but got no reply so am trying out here. I am having problems parsing
the yaml file. it generates the model classes using doctrine:build-
model but gives me this error when i use doctrine-buil-sql

While exporting model class 'UrbanMusicAlbum' to SQL: Couldn't find
class Tracks

can anyone please give me atleast an idea of how to go about this.
thanks.
the yaml syntax is as follows

UrbanMusicArtist:
  columns:
media_id: { type: integer }
album_id: { type: integer }
singles_id: { type: integer }
name: { type: varchar(255), notnull: true, unique: true }
gender:
  type: enum
  values: [male,female]
bio: { type: clob, notnull: true }
  relations:
Media:
  local: media_id
  foreign: id
  type: one
  foreignType: many
  onDelete: cascade
Album:
  local: album_id
  foreign: id
  type: one
  foreignType: many
  onDelete: cascade
Singles:
  local: singles_id
  foreign: id
  type: one
  foreignType: many
  onDelete: cascade

UrbanMusicSingles:
  columns:
track_name: { type: varchar(255), notnull: true, unique: true }
genre: { type: varchar(255), notnull: true }
date_produced: { type: timestamp }
price: { type: decimal, scale: 2 }
mp3: { type: blob }

UrbanMusicMedia:
  columns:
artist_picture: { type: blob }
singles_picture: { type: blob }
album_picture: { type: blob }
mp3: { type: blob }

UrbanMusicAlbum:
  columns:
tracks_id: { type: integer }
genre: { type: varchar(255), notnull: true }
date_produced: { type: timestamp }
price: { type: decimal, scale: 2 }
mp3: { type: blob }
  relations:
Tracks:
  local: tracks_id
  foreign: id
  type: one
  foreignType: many
  onDelete: cascade

UrbanMusicTracks:
  columns:
track_name: { type: varchar(255), notnull: true }


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

2009-09-21 Thread el-sid

thanks eric, from what u say, i changed all the relations by adding
the prefix UrbanMusic and it worked. But i now get the logic behind
it. thanks

On Sep 21, 3:49 pm, erikms  wrote:
> Hi el-Sid,
> from what I see, you have a *relation* to a table Tracks, but not the
> actual table.
> -Erik
>
> >   relations:
> -->     Tracks:
> >       local: tracks_id
> >       foreign: id
> >       type: one
> >       foreignType: many
> >       onDelete: cascade
--~--~-~--~~~---~--~~
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] referencing static html pages

2009-09-24 Thread el-sid

hi,
i was wondering, is it possible to dynamically generate links on a
page that point to static html pages in a symfony directory and, if
possible, restrict access to them. im asking because ive seen so far
that symfony configures routes to modules and a project im working on
requires the static pages remain as is.

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



[symfony-users] using fixtures with images and audio files

2009-10-27 Thread el-sid

hi all,
 i have a system im working on that allows loading images and mp3
files into a mysql database.
what i want to know is, is it possible to load sample files into the
db using fixtures?

--~--~-~--~~~---~--~~
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 fixtures with images and audio files

2009-10-27 Thread el-sid

thanks alot. guess i have some redesigning to do :-)

On Oct 27, 10:31 pm, david  wrote:
> Nope.
>
> Generally it's not a good idea to load files into a database.
> The usual approach is to load the path&name into the database - loading  
> binary data into a database is possible - but not optimal.
>
> On Tue, 27 Oct 2009 20:23:37 +0100, el-sid  wrote:
>
> > hi all,
> >  i have a system im working on that allows loading images and mp3
> > files into a mysql database.
> > what i want to know is, is it possible to load sample files into the
> > db using fixtures?
>
> --
> Using Opera's revolutionary e-mail client:http://www.opera.com/mail/
--~--~-~--~~~---~--~~
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] problem installing sfDoctrineGuard Plugin

2010-01-04 Thread el-sid
hi all
i'm using symfony 1.4 with version 4.0.1 of doctrineguardplugin.
i downloaded the package from symfony website. when i issue the
command

./symfony plugin:install  /path/to/sfDoctrineGuardPlugin.tzg

i get this error

unable to register channel pear.symfony.com

from the readme file, it says i can do a local install the way ive
done above. Is there a way i can stop plugin:install from refering to
the web, since the computer i am using syfony in is not connected?

thanks

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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 installing sfDoctrineGuard Plugin

2010-01-05 Thread el-sid
ok...i downgraded to symfony 1.3 and downloaded sfDoctrineGuardPlugin
4.0 and 3.0
followed some advice on symfony forums to do this

symfony plugin:install ./sfDoctrineGuardPlugin-3.0.0.tgz
rm sfDoctrineGuardPlugin-3.0.0.tgz

but the symfony tool still tries to connect to the internet, even
though i am trying to do a local plugin install.
Is there a way to unset this default choice?

please help

On Jan 4, 11:34 pm, el-sid  wrote:
> hi all
> i'm using symfony 1.4 with version 4.0.1 of doctrineguardplugin.
> i downloaded the package from symfony website. when i issue the
> command
>
> ./symfony plugin:install  /path/to/sfDoctrineGuardPlugin.tzg
>
> i get this error
>
> unable to register channel pear.symfony.com
>
> from the readme file, it says i can do a local install the way ive
> done above. Is there a way i can stop plugin:install from refering to
> the web, since the computer i am using syfony in is not connected?
>
> thanks

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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 installing sfDoctrineGuard Plugin

2010-01-05 Thread el-sid
thanks alot. it was deceptively simple but it worked. I must have
missed a step somewhere.
thanks again

On Jan 5, 5:29 pm, Stéphane  wrote:
> Please, download package, unzip it in your plugins directory and add the
> $this->enablePlugins('dirName'), in your projectConfiguration.class.php
> then plugin:publish-assets if needed. Check readme on plugin website.
>
> I'm pretty sure google would give you an answer near this one :-)
>
> Before Printing, Think about Your Environmental Responsibility!
> Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!
>
> On Tue, Jan 5, 2010 at 3:15 PM, el-sid  wrote:
> > ok...i downgraded to symfony 1.3 and downloaded sfDoctrineGuardPlugin
> > 4.0 and 3.0
> > followed some advice on symfony forums to do this
>
> > symfony plugin:install ./sfDoctrineGuardPlugin-3.0.0.tgz
> > rm sfDoctrineGuardPlugin-3.0.0.tgz
>
> > but the symfony tool still tries to connect to the internet, even
> > though i am trying to do a local plugin install.
> > Is there a way to unset this default choice?
>
> > please help
>
> > On Jan 4, 11:34 pm, el-sid  wrote:
> > > hi all
> > > i'm using symfony 1.4 with version 4.0.1 of doctrineguardplugin.
> > > i downloaded the package from symfony website. when i issue the
> > > command
>
> > > ./symfony plugin:install  /path/to/sfDoctrineGuardPlugin.tzg
>
> > > i get this error
>
> > > unable to register channel pear.symfony.com
>
> > > from the readme file, it says i can do a local install the way ive
> > > done above. Is there a way i can stop plugin:install from refering to
> > > the web, since the computer i am using syfony in is not connected?
>
> > > thanks
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "symfony users" group.
> > To post to this group, send email to symfony-us...@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.

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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] processing hidden input in forms

2010-01-21 Thread el-sid
hi,
basically what i'm trying to do is hide two fields from the form Stock
in the admin then when the user is creating or editing a new stock
object. there is some background calculation that is done then passed
as a request before the form is processed.

The code am trying to process is this in
/lib/model/doctrine/Stock.class

public function calculateTax($price) {

$afterTax = $price * sfConfig::get('app_tax_rate');

return $afterTax;
}

i then pass this function to a stockActions class using this code

public function executeUpdate(sfWebRequest $request) {
$this->stock = $this->getRoute()->getObject();
$this->form = this->configuration->getForm($this->stock);


$price = $request->getParameter('price');

$mystock = new Stock();
$taxRate = $mystock->calculateTax($price);

$request->setParameter('vat', $taxRate);
$request->setParameter('amount_with_vat', ($taxRate+$price));


$this->processForm($request, $this->form);

$this->setTemplate('edit');
}

what am trying to do is overide the default update function by getting
and calculating the appropriate parameters before the form is
processed. However, the values am calculating are not being processed
with the form.

what am i doing wrong? or is there another way to do this?

Thanks
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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: processing hidden input in forms

2010-01-21 Thread el-sid
ive modified the code in the controller so that it can set the
parameters before create or update
like so

 private  function processTax(sfWebRequest $request) {

$price = $request->getParameter('price');
$mystock = new Stock();
$taxRate = $mystock->calculateTax($price);

$request->setParameter('vat', $taxRate);
$request->setParameter('amount_with_vat', ($taxRate+$price));
}

public function executeCreate(sfWebRequest $request) {

$this->processTax($request);

$this->form = $this->configuration->getForm();
$this->stock = $this->form->getObject();

$this->processForm($request, $this->form);

$this->setTemplate('new');
}

public function executeUpdate(sfWebRequest $request) {

$this->processTax($request);

$this->stock = $this->getRoute()->getObject();
$this->form = $this->configuration->getForm($this->stock);

$this->processForm($request, $this->form);

$this->setTemplate('edit');
}

i dont get any error when i do this but the processTax function does
not seem to execute since i
dont find the values in the db. Any ideas?


On 21 Jan, 23:28, el-sid  wrote:
> hi,
> basically what i'm trying to do is hide two fields from the form Stock
> in the admin then when the user is creating or editing a new stock
> object. there is some background calculation that is done then passed
> as a request before the form is processed.
>
> The code am trying to process is this in
> /lib/model/doctrine/Stock.class
>
> public function calculateTax($price) {
>
>         $afterTax = $price * sfConfig::get('app_tax_rate');
>
>         return $afterTax;
>     }
>
> i then pass this function to a stockActions class using this code
>
> public function executeUpdate(sfWebRequest $request) {
>         $this->stock = $this->getRoute()->getObject();
>         $this->form = this->configuration->getForm($this->stock);
>
>         $price = $request->getParameter('price');
>
>         $mystock = new Stock();
>         $taxRate = $mystock->calculateTax($price);
>
>         $request->setParameter('vat', $taxRate);
>         $request->setParameter('amount_with_vat', ($taxRate+$price));
>
>         $this->processForm($request, $this->form);
>
>         $this->setTemplate('edit');
>     }
>
> what am trying to do is overide the default update function by getting
> and calculating the appropriate parameters before the form is
> processed. However, the values am calculating are not being processed
> with the form.
>
> what am i doing wrong? or is there another way to do this?
>
> Thanks
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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: processing hidden input in forms

2010-01-22 Thread el-sid
thanks for the reply...i thought i had the logic down but it wasnt
showing any errors or warnings. I finally stumbled upon
a method that works--probably the way its supposed to be done. I moved
the logic from the controller to the model in a save method like this:

 public function save(Doctrine_Connection $conn = null) {

$price = $this->getPrice();

$taxRate = $this->calculateTax($price);
$amnt = ($taxRate + $price);
$this->setVat($taxRate);
$this->setAmountWithVat($amnt);

return parent::save($conn);
}

using this method in the same class

 public function calculateTax($price) {

$afterTax = $price * sfConfig::get('app_tax_rate');

return $afterTax;
}

and it worked.  Thanks for the reply anyway :-)
On 22 Jan, 09:46, Tom Ptacnik  wrote:
> Try to debug if processTax() is executed ie. simply do echo "I'm
> here";exit; or something like that. And when you will be sure that it
> isn't executed or it's executed, then do some more ...
>
> On 21 led, 21:46, el-sid  wrote:
>
> > ive modified the code in the controller so that it can set the
> > parameters before create or update
> > like so
>
> >  private  function processTax(sfWebRequest $request) {
>
> >         $price = $request->getParameter('price');
> >         $mystock = new Stock();
> >         $taxRate = $mystock->calculateTax($price);
>
> >         $request->setParameter('vat', $taxRate);
> >         $request->setParameter('amount_with_vat', ($taxRate+$price));
> >     }
>
> > public function executeCreate(sfWebRequest $request) {
>
> >         $this->processTax($request);
>
> >         $this->form = $this->configuration->getForm();
> >         $this->stock = $this->form->getObject();
>
> >         $this->processForm($request, $this->form);
>
> >         $this->setTemplate('new');
> >     }
>
> >     public function executeUpdate(sfWebRequest $request) {
>
> >         $this->processTax($request);
>
> >         $this->stock = $this->getRoute()->getObject();
> >         $this->form = $this->configuration->getForm($this->stock);
>
> >         $this->processForm($request, $this->form);
>
> >         $this->setTemplate('edit');
> >     }
>
> > i dont get any error when i do this but the processTax function does
> > not seem to execute since i
> > dont find the values in the db. Any ideas?
>
> > On 21 Jan, 23:28, el-sid  wrote:
>
> > > hi,
> > > basically what i'm trying to do is hide two fields from the form Stock
> > > in the admin then when the user is creating or editing a new stock
> > > object. there is some background calculation that is done then passed
> > > as a request before the form is processed.
>
> > > The code am trying to process is this in
> > > /lib/model/doctrine/Stock.class
>
> > > public function calculateTax($price) {
>
> > >         $afterTax = $price * sfConfig::get('app_tax_rate');
>
> > >         return $afterTax;
> > >     }
>
> > > i then pass this function to a stockActions class using this code
>
> > > public function executeUpdate(sfWebRequest $request) {
> > >         $this->stock = $this->getRoute()->getObject();
> > >         $this->form = this->configuration->getForm($this->stock);
>
> > >         $price = $request->getParameter('price');
>
> > >         $mystock = new Stock();
> > >         $taxRate = $mystock->calculateTax($price);
>
> > >         $request->setParameter('vat', $taxRate);
> > >         $request->setParameter('amount_with_vat', ($taxRate+$price));
>
> > >         $this->processForm($request, $this->form);
>
> > >         $this->setTemplate('edit');
> > >     }
>
> > > what am trying to do is overide the default update function by getting
> > > and calculating the appropriate parameters before the form is
> > > processed. However, the values am calculating are not being processed
> > > with the form.
>
> > > what am i doing wrong? or is there another way to do this?
>
> > > Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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.